vendor: 6,488 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-BOzHcyJ6.js","assets/to-string-CqV7wPRW.js","assets/pilot-DUfhDNwv.js","assets/agent-view-wIosNIjn.js","assets/index-c2t2FjZI.js","assets/popover-5zndvtb5.js","assets/sb-loading-BS93ZLM4.js","assets/bubble-up-confirm-dialog-DzO4LIt0.js","assets/label-DewNCvIZ.js","assets/search-BenPg9xh.js","assets/header-CqtDmtDa.js","assets/mobile-pending-C6irSst_.js","assets/logo-B8_A0nH6.js","assets/device-status-icons-7iM_qVs6.js","assets/incognito-BoJbb9iM.js","assets/clock-3-DOXEOeIR.js","assets/search-C82yR-Px.js","assets/copy-DpsntgYm.js","assets/index-CdnnOvXz.css","assets/refresh-cw-DaN2jrmX.js","assets/global-Dswfph5k.js","assets/toaster-CbNKbYSs.js","assets/dapposLogo-T2t9YBIw.js","assets/channel-airdrop-CjA8rODc.js","assets/telegram-D_yRa8Ri.js","assets/messages-D9aDLI9e.js","assets/_locale-Cu3WlYy6.js","assets/index-CZymfhBC.js","assets/index-DAkWUOeG.js","assets/index-CAtkfuLI.js","assets/invite-code-page-xhVh6mvp.js","assets/chat-view-DZbbM_de.js","assets/noPackages-DM38xhD5.js","assets/use-code-mode-projects-CMu2Dslp.js","assets/chevron-down-C7lCUKQy.js","assets/switcher-LFj8n8JV.js","assets/order_dialog_warning-MN9_wnCL.js","assets/schedule-D7KdZ_Vl.js","assets/alert-dialog-De_x8LSL.js","assets/trash-2-3MeFaQb8.js","assets/pricing-BbrTUh_H.js","assets/pricing.config-DRwWTe1Y.js","assets/minus-C6iqDqBd.js","assets/pilot-XRVujXsR.js","assets/mall-BnhY56fK.js","assets/order_dialog_success-CTvM1juB.js","assets/devices-DOrP3Be4.js","assets/table-CILtHE9X.js","assets/refresh-ccw-DyyvFge7.js","assets/chevron-left-DDXlRq2t.js","assets/code-projects-DtA9F8E6.js","assets/checkout-LvfcJT7f.js","assets/account-D6CzTY4y.js","assets/mall.history-DBkb8lr5.js","assets/_threadId-CRSDCNd0.js","assets/_messageId-Djf9ydQL.js"])))=>i.map(i=>d[i]); 2var X5e=Object.defineProperty;var sH=t=>{throw TypeError(t)};var J5e=(t,e,n)=>e in t?X5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ft=(t,e,n)=>J5e(t,typeof e!="symbol"?e+"":e,n),gk=(t,e,n)=>e.has(t)||sH("Cannot "+n);var ne=(t,e,n)=>(gk(t,e,"read from private field"),n?n.call(t):e.get(t)),Je=(t,e,n)=>e.has(t)?sH("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Xe=(t,e,n,r)=>(gk(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Mt=(t,e,n)=>(gk(t,e,"access private method"),n);var zw=(t,e,n,r)=>({set _(i){Xe(t,e,i,n)},get _(){return ne(t,e,r)}});function exe(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Oa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ys(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qE(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var mk={exports:{}},Ww={},yk={exports:{}},Ln={};/** 3 * @license React 4 * react.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var oH;function txe(){if(oH)return Ln;oH=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;function h(B){return B===null||typeof B!="object"?null:(B=d&&B[d]||B["@@iterator"],typeof B=="function"?B:null)}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,y={};function v(B,P,j){this.props=B,this.context=P,this.refs=y,this.updater=j||f}v.prototype.isReactComponent={},v.prototype.setState=function(B,P){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,P,"setState")},v.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function b(){}b.prototype=v.prototype;function C(B,P,j){this.props=B,this.context=P,this.refs=y,this.updater=j||f}var x=C.prototype=new b;x.constructor=C,m(x,v.prototype),x.isPureReactComponent=!0;var _=Array.isArray,$=Object.prototype.hasOwnProperty,I={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function N(B,P,j){var G,Y={},te=null,ae=null;if(P!=null)for(G in P.ref!==void 0&&(ae=P.ref),P.key!==void 0&&(te=""+P.key),P)$.call(P,G)&&!R.hasOwnProperty(G)&&(Y[G]=P[G]);var oe=arguments.length-2;if(oe===1)Y.children=j;else if(1<oe){for(var de=Array(oe),ke=0;ke<oe;ke++)de[ke]=arguments[ke+2];Y.children=de}if(B&&B.defaultProps)for(G in oe=B.defaultProps,oe)Y[G]===void 0&&(Y[G]=oe[G]);return{$$typeof:t,type:B,key:te,ref:ae,props:Y,_owner:I.current}}function T(B,P){return{$$typeof:t,type:B.type,key:P,ref:B.ref,props:B.props,_owner:B._owner}}
vendor: 5,088 bytes, lines 10-18
10function O(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function U(B){var P={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(j){return P[j]})}var z=/\/+/g;function L(B,P){return typeof B=="object"&&B!==null&&B.key!=null?U(""+B.key):P.toString(36)}function S(B,P,j,G,Y){var te=typeof B;(te==="undefined"||te==="boolean")&&(B=null);var ae=!1;if(B===null)ae=!0;else switch(te){case"string":case"number":ae=!0;break;case"object":switch(B.$$typeof){case t:case e:ae=!0}}if(ae)return ae=B,Y=Y(ae),B=G===""?"."+L(ae,0):G,_(Y)?(j="",B!=null&&(j=B.replace(z,"$&/")+"/"),S(Y,P,j,"",function(ke){return ke})):Y!=null&&(O(Y)&&(Y=T(Y,j+(!Y.key||ae&&ae.key===Y.key?"":(""+Y.key).replace(z,"$&/")+"/")+B)),P.push(Y)),1;if(ae=0,G=G===""?".":G+":",_(B))for(var oe=0;oe<B.length;oe++){te=B[oe];var de=G+L(te,oe);ae+=S(te,P,j,de,Y)}else if(de=h(B),typeof de=="function")for(B=de.call(B),oe=0;!(te=B.next()).done;)te=te.value,de=G+L(te,oe++),ae+=S(te,P,j,de,Y);else if(te==="object")throw P=String(B),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return ae}function k(B,P,j){if(B==null)return B;var G=[],Y=0;return S(B,G,"","",function(te){return P.call(j,te,Y++)}),G}function M(B){if(B._status===-1){var P=B._result;P=P(),P.then(function(j){(B._status===0||B._status===-1)&&(B._status=1,B._result=j)},function(j){(B._status===0||B._status===-1)&&(B._status=2,B._result=j)}),B._status===-1&&(B._status=0,B._result=P)}if(B._status===1)return B._result.default;throw B._result}var W={current:null},H={transition:null},D={ReactCurrentDispatcher:W,ReactCurrentBatchConfig:H,ReactCurrentOwner:I};function V(){throw Error("act(...) is not supported in production builds of React.")}return Ln.Children={map:k,forEach:function(B,P,j){k(B,function(){P.apply(this,arguments)},j)},count:function(B){var P=0;return k(B,function(){P++}),P},toArray:function(B){return k(B,function(P){return P})||[]},only:function(B){if(!O(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Ln.Component=v,Ln.Fragment=n,Ln.Profiler=i,Ln.PureComponent=C,Ln.StrictMode=r,Ln.Suspense=c,Ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,Ln.act=V,Ln.cloneElement=function(B,P,j){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var G=m({},B.props),Y=B.key,te=B.ref,ae=B._owner;if(P!=null){if(P.ref!==void 0&&(te=P.ref,ae=I.current),P.key!==void 0&&(Y=""+P.key),B.type&&B.type.defaultProps)var oe=B.type.defaultProps;for(de in P)$.call(P,de)&&!R.hasOwnProperty(de)&&(G[de]=P[de]===void 0&&oe!==void 0?oe[de]:P[de])}var de=arguments.length-2;if(de===1)G.children=j;else if(1<de){oe=Array(de);for(var ke=0;ke<de;ke++)oe[ke]=arguments[ke+2];G.children=oe}return{$$typeof:t,type:B.type,key:Y,ref:te,props:G,_owner:ae}},Ln.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:s,_context:B},B.Consumer=B},Ln.createElement=N,Ln.createFactory=function(B){var P=N.bind(null,B);return P.type=B,P},Ln.createRef=function(){return{current:null}},Ln.forwardRef=function(B){return{$$typeof:a,render:B}},Ln.isValidElement=O,Ln.lazy=function(B){return{$$typeof:u,_payload:{_status:-1,_result:B},_init:M}},Ln.memo=function(B,P){return{$$typeof:l,type:B,compare:P===void 0?null:P}},Ln.startTransition=function(B){var P=H.transition;H.transition={};try{B()}finally{H.transition=P}},Ln.unstable_act=V,Ln.useCallback=function(B,P){return W.current.useCallback(B,P)},Ln.useContext=function(B){return W.current.useContext(B)},Ln.useDebugValue=function(){},Ln.useDeferredValue=function(B){return W.current.useDeferredValue(B)},Ln.useEffect=function(B,P){return W.current.useEffect(B,P)},Ln.useId=function(){return W.current.useId()},Ln.useImperativeHandle=function(B,P,j){return W.current.useImperativeHandle(B,P,j)},Ln.useInsertionEffect=function(B,P){return W.current.useInsertionEffect(B,P)},Ln.useLayoutEffect=function(B,P){return W.current.useLayoutEffect(B,P)},Ln.useMemo=function(B,P){return W.current.useMemo(B,P)},Ln.useReducer=function(B,P,j){return W.current.useReducer(B,P,j)},Ln.useRef=function(B){return W.current.useRef(B)},Ln.useState=function(B){return W.current.useState(B)},Ln.useSyncExternalStore=function(B,P,j){return W.current.useSyncExternalStore(B,P,j)},Ln.useTransition=function(){return W.current.useTransition()},Ln.version="18.3.1",Ln}var aH;function wh(){return aH||(aH=1,yk.exports=txe()),yk.exports}/** 11 * @license React 12 * react-jsx-runtime.production.min.js 13 * 14 * Copyright (c) Facebook, Inc. and its affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var cH;function nxe(){if(cH)return Ww;cH=1;var t=wh(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INT
18ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var u,d={},h=null,f=null;l!==void 0&&(h=""+l),c.key!==void 0&&(h=""+c.key),c.ref!==void 0&&(f=c.ref);for(u in c)r.call(c,u)&&!s.hasOwnProperty(u)&&(d[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)d[u]===void 0&&(d[u]=c[u]);return{$$typeof:e,type:a,key:h,ref:f,props:d,_owner:i.current}}return Ww.Fragment=n,Ww.jsx=o,Ww.jsxs=o,Ww}var lH;function rxe(){return lH||(lH=1,mk.exports=nxe()),mk.exports}var p=rxe(),ixe="Invariant failed";function Kd(t,e){if(!t)throw new Error(ixe)}const Km=new WeakMap,X6=new WeakMap,j7={current:[]};let wk=!1,sb=0;const Dv=new Set,S4=new Map;function Gie(t){const e=Array.from(t).sort((n,r)=>n instanceof Gm&&n.options.deps.includes(r)?1:r instanceof Gm&&r.options.deps.includes(n)?-1:0);for(const n of e){if(j7.current.includes(n))continue;j7.current.push(n),n.recompute();const r=X6.get(n);if(r)for(const i of r){const s=Km.get(i);s&&Gie(s)}}}function sxe(t){t.listeners.forEach(e=>e({prevVal:t.prevState,currentVal:t.state}))}function oxe(t){t.listeners.forEach(e=>e({prevVal:t.prevState,currentVal:t.state}))}function Zie(t){if(sb>0&&!S4.has(t)&&S4.set(t,t.prevState),Dv.add(t),!(sb>0)&&!wk)try{for(wk=!0;Dv.size>0;){const e=Array.from(Dv);Dv.clear();for(const n of e){const r=S4.get(n)??n.prevState;n.prevState=r,sxe(n)}for(const n of e){const r=Km.get(n);r&&(j7.current.push(n),Gie(r))}for(const n of e){const r=Km.get(n);if(r)for(const i of r)oxe(i)}}}finally{wk=!1,j7.current=[],S4.clear()}}function uH(t){sb++;try{t()}finally{if(sb--,sb===0){const e=Array.from(Dv)[0];e&&Zie(e)}}}function axe(t){return typeof t=="function"}class iR{constructor(e,n){this.listeners=new Set,this.subscribe=r=>{var i,s;this.listeners.add(r);const o=(s=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:s.call(i,r,this);return()=>{this.listeners.delete(r),o==null||o()}},this.prevState=e,this.state=e,this.options=n}setState(e){var n,r,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(e):axe(e)?this.state=e(this.prevState):this.state=e,(i=(r=this.options)==null?void 0:r.onUpdate)==null||i.call(r),Zie(this)}}class Gm{constructor(e){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=[],r=[];for(const i of this.options.deps)n.push(i.prevState),r.push(i.state);return this.lastSeenDepValues=r,{prevDepVals:n,currDepVals:r,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,r;this.prevState=this.state;const{prevDepVals:i,currDepVals:s,prevVal:o}=this.getDepVals();this.state=this.options.fn({prevDepVals:i,currDepVals:s,prevVal:o}),(r=(n=this.options).onUpdate)==null||r.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const s of this.options.deps)s instanceof Gm&&s.checkIfRecalculationNeededDeeply();let n=!1;const r=this.lastSeenDepValues,{currDepVals:i}=this.getDepVals();for(let s=0;s<i.length;s++)if(i[s]!==r[s]){n=!0;break}n&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var r,i;this.listeners.add(n);const s=(i=(r=this.options).onSubscribe)==null?void 0:i.call(r,n,this);return()=>{this.listeners.delete(n),s==null||s()}},this.options=e,this.state=e.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(e=this.options.deps){for(const n of e)if(n instanceof Gm)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof iR){let r=Km.get(n);r||(r=new Set,Km.set(n,r)),r.add(this);let i=X6.get(this);i||(i=new Set,X6.set(this,i)),i.add(n)}}unregisterFromGraph(e=this.options.deps){for(const n of e)if(n instanceof Gm)this.unregisterFromGraph(n.options.deps);else if(n instanceof iR){const r=Km.get(n);r&&r.delete(this);const i=X6.get(this);i&&i.delete(n)}}}const Yf="__TSR_index",dH="popstate",hH="beforeunload";function Yie(t){let e=t.getLocation();const n=new Set,r=o=>{e=t.getLocation(),n.forEach(a=>a({location:e,action:o}))},i=o=>{t.notifyOnIndexChange??!0?r(o):e=t.getLocation()},s=async({task:o,navigateOpts:a,...c})=>{var l,u;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}
18const h=((l=t.getBlockers)==null?void 0:l.call(t))??[],f=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&h.length&&f)for(const m of h){const y=jb(c.path,c.state);if(await m.blockerFn({currentLocation:e,nextLocation:y,action:c.type})){(u=t.onBlocked)==null||u.call(t);return}}o()};return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,a,c)=>{const l=e.state[Yf];a=sR(l+1,a),s({task:()=>{t.pushState(o,a),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:o,state:a})},replace:(o,a,c)=>{const l=e.state[Yf];a=sR(l,a),s({task:()=>{t.replaceState(o,a),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:o,state:a})},go:(o,a)=>{s({task:()=>{t.go(o),i({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{s({task:()=>{t.back((o==null?void 0:o.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{s({task:()=>{t.forward((o==null?void 0:o.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>e.state[Yf]!==0,createHref:o=>t.createHref(o),block:o=>{var a;if(!t.setBlockers)return()=>{};const c=((a=t.getBlockers)==null?void 0:a.call(t))??[];return t.setBlockers([...c,o]),()=>{var l,u;const d=((l=t.getBlockers)==null?void 0:l.call(t))??[];(u=t.setBlockers)==null||u.call(t,d.filter(h=>h!==o))}},flush:()=>{var o;return(o=t.flush)==null?void 0:o.call(t)},destroy:()=>{var o;return(o=t.destroy)==null?void 0:o.call(t)},notify:r}}function sR(t,e){return e||(e={}),{...e,key:VN(),[Yf]:t}}function cxe(t){var e;const n=typeof document<"u"?window:void 0,r=n.history.pushState,i=n.history.replaceState;let s=[];const o=()=>s,a=T=>s=T,c=T=>T,l=()=>jb(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state);(e=n.history.state)!=null&&e.key||n.history.replaceState({[Yf]:0,key:VN()},"");let u=l(),d,h=!1,f=!1,m=!1,y=!1;const v=()=>u;let b,C;const x=()=>{b&&(N._ignoreSubscribers=!0,(b.isPush?n.history.pushState:n.history.replaceState)(b.state,"",b.href),N._ignoreSubscribers=!1,b=void 0,C=void 0,d=void 0)},_=(T,O,U)=>{const z=c(O);C||(d=u),u=jb(O,U),b={href:z,state:U,isPush:(b==null?void 0:b.isPush)||T==="push"},C||(C=Promise.resolve().then(()=>x()))},$=T=>{u=l(),N.notify({type:T})},I=async()=>{if(f){f=!1;return}const T=l(),O=T.state[Yf]-u.state[Yf],U=O===1,z=O===-1,L=!U&&!z||h;h=!1;const S=L?"GO":z?"BACK":"FORWARD",k=L?{type:"GO",index:O}:{type:z?"BACK":"FORWARD"};if(m)m=!1;else{const M=o();if(typeof document<"u"&&M.length){for(const W of M)if(await W.blockerFn({currentLocation:u,nextLocation:T,action:S})){f=!0,n.history.go(1),N.notify(k);return}}}u=l(),N.notify(k)},R=T=>{if(y){y=!1;return}let O=!1;const U=o();if(typeof document<"u"&&U.length)for(const z of U){const L=z.enableBeforeUnload??!0;if(L===!0){O=!0;break}if(typeof L=="function"&&L()===!0){O=!0;break}}if(O)return T.preventDefault(),T.returnValue=""},N=Yie({getLocation:v,getLength:()=>n.history.length,pushState:(T,O)=>_("push",T,O),replaceState:(T,O)=>_("replace",T,O),back:T=>(T&&(m=!0),y=!0,n.history.back()),forward:T=>{T&&(m=!0),y=!0,n.history.forward()},go:T=>{h=!0,n.history.go(T)},createHref:T=>c(T),flush:x,destroy:()=>{n.history.pushState=r,n.history.replaceState=i,n.removeEventListener(hH,R,{capture:!0}),n.removeEventListener(dH,I)},onBlocked:()=>{d&&u!==d&&(u=d)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(hH,R,{capture:!0}),n.addEventListener(dH,I),n.history.pushState=function(...T){const O=r.apply(n.history,T);return N._ignoreSubscribers||$("PUSH"),O},n.history.replaceState=function(...T){const O=i.apply(n.history,T);return N._ignoreSubscribers||$("REPLACE"),O},N}function lxe(t={initialEntries:["/"]}){const e=t.initialEntries;let n=t.initialIndex?Math.min(Math.max(t.initialIndex,0),e.length-1):e.length-1;const r=e.map((s,o)=>sR(o,void 0));return Yie({getLocation:()=>jb(e[n],r[n]),getLength:()=>e.length,pushState:(s,o)=>{n<e.length-1&&(e.splice(n+1),r.splice(n+1)),r.push(o),e.push(s),n=Math.max(e.length-1,0)},replaceState:(s,o)=>{r[n]=o,e[n]=s},back:()=>{n=Math.max(n-1,0)},forward:()=>{n=Math.min(n+1,e.length-1)},go:s=>{n=Math.min(Math.max(n+s,0),e.length-1)},createHref:s=>s})}function jb(t,e){const n=t.indexOf("#"),r=t.indexOf("?");
18return{href:t,pathname:t.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:t.length),hash:n>-1?t.substring(n):"",search:r>-1?t.slice(r,n===-1?void 0:n):"",state:e||{[Yf]:0,key:VN()}}}function VN(){return(Math.random()+1).toString(36).substring(7)}function oR(t){return t[t.length-1]}function uxe(t){return typeof t=="function"}function Z0(t,e){return uxe(t)?t(e):t}function aR(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function ic(t,e){if(t===e)return t;const n=e,r=gH(t)&&gH(n);if(r||fH(t)&&fH(n)){const i=r?t:Object.keys(t).concat(Object.getOwnPropertySymbols(t)),s=i.length,o=r?n:Object.keys(n).concat(Object.getOwnPropertySymbols(n)),a=o.length,c=r?[]:{};let l=0;for(let u=0;u<a;u++){const d=r?u:o[u];(!r&&i.includes(d)||r)&&t[d]===void 0&&n[d]===void 0?(c[d]=void 0,l++):(c[d]=ic(t[d],n[d]),c[d]===t[d]&&t[d]!==void 0&&l++)}return s===a&&l===s?t:c}return n}function fH(t){return cR(t)&&Object.getOwnPropertyNames(t).length===Object.keys(t).length}function cR(t){if(!pH(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const n=e.prototype;return!(!pH(n)||!n.hasOwnProperty("isPrototypeOf"))}function pH(t){return Object.prototype.toString.call(t)==="[object Object]"}function gH(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function mH(t,e){let n=Object.keys(t);return e&&(n=n.filter(r=>t[r]!==void 0)),n}function Zm(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(cR(t)&&cR(e)){const r=(n==null?void 0:n.ignoreUndefined)??!0,i=mH(t,r),s=mH(e,r);return!(n!=null&&n.partial)&&i.length!==s.length?!1:s.every(o=>Zm(t[o],e[o],n))}return Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:!t.some((r,i)=>!Zm(r,e[i],n)):!1}function vm(t){let e,n;const r=new Promise((i,s)=>{e=i,n=s});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,e(i),t==null||t(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Eu(t){return KE(t.filter(e=>e!==void 0).join("/"))}function KE(t){return t.replace(/\/{2,}/g,"/")}function qN(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function Dy(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function dxe(t){return Dy(qN(t))}function N7(t,e){return t!=null&&t.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function hxe(t,e,n){return N7(t,n)===N7(e,n)}function fxe({basepath:t,base:e,to:n,trailingSlash:r="never",caseSensitive:i}){var s,o;e=D7(t,e,i),n=D7(t,n,i);let a=Ly(e);const c=Ly(n);a.length>1&&((s=oR(a))==null?void 0:s.value)==="/"&&a.pop(),c.forEach((d,h)=>{d.value==="/"?h?h===c.length-1&&a.push(d):a=[d]:d.value===".."?a.pop():d.value==="."||a.push(d)}),a.length>1&&(((o=oR(a))==null?void 0:o.value)==="/"?r==="never"&&a.pop():r==="always"&&a.push({type:"pathname",value:"/"}));const l=a.map(d=>{if(d.type==="param"){const h=d.value.substring(1);if(d.prefixSegment&&d.suffixSegment)return`${d.prefixSegment}{$${h}}${d.suffixSegment}`;if(d.prefixSegment)return`${d.prefixSegment}{$${h}}`;if(d.suffixSegment)return`{$${h}}${d.suffixSegment}`}if(d.type==="wildcard"){if(d.prefixSegment&&d.suffixSegment)return`${d.prefixSegment}{$}${d.suffixSegment}`;if(d.prefixSegment)return`${d.prefixSegment}{$}`;if(d.suffixSegment)return`{$}${d.suffixSegment}`}return d.value}),u=Eu([t,...l]);return KE(u)}const pxe=/^\$.{1,}$/,gxe=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,mxe=/^\$$/,yxe=/^(.*?)\{\$\}(.*)$/;function Ly(t){if(!t)return[];t=KE(t);const e=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const n=t.split("/").filter(Boolean);return e.push(...n.map(r=>{const i=r.match(yxe);if(i){const o=i[1],a=i[2];return{type:"wildcard",value:"$",prefixSegment:o||void 0,suffixSegment:a||void 0}}const s=r.match(gxe);if(s){const o=s[1],a=s[2],c=s[3];return{type:"param",value:""+a,prefixSegment:o||void 0,suffixSegment:c||void 0}}return pxe.test(r)?{type:"param",value:"$"+r.substring(1),prefixSegment:void 0,suffixSegment:void 0}:mxe.test(r)?{type:"wildcard",value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:"pathname",value:r.includes("%25")?r.split("%25").map(o=>decodeURI(o)).join("%25"):decodeURI(r)}})),t.slice(-1)==="/"&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}
18function vk({path:t,params:e,leaveWildcards:n,leaveParams:r,decodeCharMap:i}){const s=Ly(t);function o(u){const d=e[u],h=typeof d=="string";return["*","_splat"].includes(u)?h?encodeURI(d):d:h?wxe(d,i):d}let a=!1;const c={},l=Eu(s.map(u=>{if(u.type==="wildcard"){c._splat=e._splat;const d=u.prefixSegment||"",h=u.suffixSegment||"",f=o("_splat");return n?`${d}${u.value}${f??""}${h}`:`${d}${f}${h}`}if(u.type==="param"){const d=u.value.substring(1);!a&&!(d in e)&&(a=!0),c[d]=e[d];const h=u.prefixSegment||"",f=u.suffixSegment||"";if(r){const m=o(u.value);return`${h}${u.value}${m??""}${f}`}return`${h}${o(d)??"undefined"}${f}`}return u.value}));return{usedParams:c,interpolatedPath:l,isMissingParams:a}}function wxe(t,e){let n=encodeURIComponent(t);if(e)for(const[r,i]of e)n=n.replaceAll(r,i);return n}function lR(t,e,n){const r=vxe(t,e,n);if(!(n.to&&!r))return r??{}}function D7(t,e,n=!1){const r=n?t:t.toLowerCase(),i=n?e:e.toLowerCase();switch(!0){case r==="/":return e;case i===r:return"";case e.length<t.length:return e;case i[r.length]!=="/":return e;case i.startsWith(r):return e.slice(t.length);default:return e}}function vxe(t,e,n){if(t!=="/"&&!e.startsWith(t))return;e=D7(t,e,n.caseSensitive);const r=D7(t,`${n.to??"$"}`,n.caseSensitive),i=Ly(e),s=Ly(r);e.startsWith("/")||i.unshift({type:"pathname",value:"/"}),r.startsWith("/")||s.unshift({type:"pathname",value:"/"});const o={};return(()=>{var c;for(let l=0;l<Math.max(i.length,s.length);l++){const u=i[l],d=s[l],h=l>=i.length-1,f=l>=s.length-1;if(d){if(d.type==="wildcard"){const m=i.slice(l);let y;if(d.prefixSegment||d.suffixSegment){if(!u)return!1;const v=d.prefixSegment||"",b=d.suffixSegment||"",C=u.value;if("prefixSegment"in d&&!C.startsWith(v)||"suffixSegment"in d&&!((c=i[i.length-1])!=null&&c.value.endsWith(b)))return!1;let x=decodeURI(Eu(m.map(_=>_.value)));v&&x.startsWith(v)&&(x=x.slice(v.length)),b&&x.endsWith(b)&&(x=x.slice(0,x.length-b.length)),y=x}else y=decodeURI(Eu(m.map(v=>v.value)));return o["*"]=y,o._splat=y,!0}if(d.type==="pathname"){if(d.value==="/"&&!(u!=null&&u.value))return!0;if(u){if(n.caseSensitive){if(d.value!==u.value)return!1}else if(d.value.toLowerCase()!==u.value.toLowerCase())return!1}}if(!u)return!1;if(d.type==="param"){if(u.value==="/")return!1;let m;if(d.prefixSegment||d.suffixSegment){const y=d.prefixSegment||"",v=d.suffixSegment||"",b=u.value;if(y&&!b.startsWith(y)||v&&!b.endsWith(v))return!1;let C=b;y&&C.startsWith(y)&&(C=C.slice(y.length)),v&&C.endsWith(v)&&(C=C.slice(0,C.length-v.length)),m=decodeURIComponent(C)}else m=decodeURIComponent(u.value);o[d.value.substring(1)]=m}}if(!h&&f)return o["**"]=Eu(i.slice(l+1).map(m=>m.value)),!!n.fuzzy&&(d==null?void 0:d.value)!=="/"}return!0})()?o:void 0}function uc(t){return!!(t!=null&&t.isNotFound)}function bxe(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{return}}const L7="tsr-scroll-restoration-v1_3",xxe=(t,e)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{t(...r),n=null},e))}};function Exe(){const t=bxe();if(!t)return;const e=t.getItem(L7);let n=e?JSON.parse(e):{};return{state:n,set:r=>(n=Z0(r,n)||n,t.setItem(L7,JSON.stringify(n)))}}const bk=Exe(),uR=t=>t.state.key||t.href;function Cxe(t){const e=[];let n;for(;n=t.parentNode;)e.unshift(`${t.tagName}:nth-child(${[].indexOf.call(n.children,t)+1})`),t=n;return`${e.join(" > ")}`.toLowerCase()}let B7=!1;function Qie(t,e,n,r,i){var s;let o;try{o=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(l){console.error(l);return}const a=e||((s=window.history.state)==null?void 0:s.key),c=o[a];B7=!0,(()=>{if(r&&c){for(const u in c){const d=c[u];if(u==="window")window.scrollTo({top:d.scrollY,left:d.scrollX,behavior:n});else if(u){const h=document.querySelector(u);h&&(h.scrollLeft=d.scrollX,h.scrollTop=d.scrollY)}}return}const l=window.location.hash.split("#")[1];if(l){const u=(window.history.state||{}).__hashScrollIntoViewOptions??!0;if(u){const d=document.getElementById(l);d&&d.scrollIntoView(u)}return}["window",...(i==null?void 0:i.filter(u=>u!=="window"))??[]].forEach(u=>{const d=u==="window"?window:typeof u=="function"?u():document.querySelector(u);d&&d.scrollTo({top:0,left:0,behavior:n})})})(),B7=!1}function _xe(t,e){if(bk===void 0||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),typeof document>"u"||t.isScrollRestorationSetup))return;t.isScrollRestorationSetup=!0,B7=!1;const r=t.options.getScrollRestorationKey||uR;window.history.scrollRestoration="manual";const i=s=>{if(B7||!t.isScrollRestoring)return;let o="";if(s.target===document||s.target===window)o="window";else{const c=s.target.getAttribute("data-scroll-restoration-id");c?o=`[data-scroll-restoration-id="${c}"]`:o=Cxe(s.target)}const a=r(t.state.location);bk.set(c=>{const l=c[a]=c[a]||{},u=l[o]=l[o]||{};if(o==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(o){const d=document.querySelector(o);d&&(u.scrollX=d.scrollLeft||0,u.scrollY=d.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",xxe(i,100),!0),t.subscribe("onRendered",s=>{const o=r(s.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}Qie(L7,o,t.options.scrollRestorationBehavior||void 0,t.isScrollRestoring||void 0,t.options.scrollToTopSelectors||void 0),t.isScrollRestoring&&bk.set(a=>(a[o]=a[o]||{},a))})}function Sxe(t){if(typeof document<"u"&&document.querySelector){const e=t.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&t.state.location.hash!==""){const n=document.getElementById(t.state.location.hash);n&&n.scrollIntoView(e)}}}function Axe(t,e){const n=Object.entries(t).flatMap(([i,s])=>Array.isArray(s)?s.map(o=>[i,String(o)]):[[i,String(s)]]);return""+new URLSearchParams(n).toString()}function xk(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function kxe(t,e){const n=t;return[...new URLSearchParams(n).entries()].reduce((s,[o,a])=>{const c=s[o];return c==null?s[o]=xk(a):s[o]=Array.isArray(c)?[...c,xk(a)]:[c,xk(a)],s},{})}const $xe=Txe(JSON.parse),Ixe=Pxe(JSON.stringify,JSON.parse);function Txe(t){return e=>{e.substring(0,1)==="?"&&(e=e.substring(1));const n=kxe(e);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=t(i)}catch{}}return n}}function Pxe(t,e){function n(r){if(typeof r=="object"&&r!==null)try{return t(r)}catch{}else if(typeof r=="string"&&typeof e=="function")try{return e(r),t(r)}catch{}return r}return r=>{r={...r},Object.keys(r).forEach(s=>{const o=r[s];typeof o>"u"||o===void 0?delete r[s]:r[s]=n(o)});const i=Axe(r).toString();return i?`?${i}`:""}}const il="__root__";function Rxe(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument)try{new URL(`${t.href}`),t.reloadDocument=!0}catch{}const e=new Headers(t.headers||{}),n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}function Xl(t){return t instanceof Response&&!!t.options}function Y0(t){const e=t.resolvedLocation,n=t.location,r=(e==null?void 0:e.pathname)!==n.pathname,i=(e==null?void 0:e.href)!==n.href,s=(e==null?void 0:e.hash)!==n.hash;return{fromLocation:e,toLocation:n,pathChanged:r,hrefChanged:i,hashChanged:s}}class Mxe{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>
18n(),this.isShell=!1,this.update=n=>{var r;n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const i=this.options;this.options={...this.options,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(s=>[encodeURIComponent(s),s])):void 0,(!this.basepath||n.basepath&&n.basepath!==i.basepath)&&(n.basepath===void 0||n.basepath===""||n.basepath==="/"?this.basepath="/":this.basepath=`/${dxe(n.basepath)}`),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??(this.isServer?lxe({initialEntries:[this.basepath||"/"]}):cxe()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new iR(jxe(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(s=>!["redirected"].includes(s.status))}}}),_xe(this)),typeof window<"u"&&"CSS"in window&&typeof((r=window.CSS)==null?void 0:r.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)")),this.latestLocation.search.__TSS_SHELL&&(this.isShell=!0)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:r,flatRoutes:i}=Nxe({routeTree:this.routeTree,initRoute:(o,a)=>{o.init({originalIndex:a,defaultSsr:this.options.defaultSsr})}});this.routesById=n,this.routesByPath=r,this.flatRoutes=i;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999,defaultSsr:this.options.defaultSsr}),this.routesById[s.id]=s)},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:c,search:l,hash:u,state:d})=>{const h=this.options.parseSearch(l),f=this.options.stringifySearch(h);return{pathname:c,searchStr:f,search:ic(n==null?void 0:n.search,h),hash:u.split("#").reverse()[0]??"",href:`${c}${f}${u}`,state:ic(n==null?void 0:n.state,d)}},s=i(r??this.history.location),{__tempLocation:o,__tempKey:a}=s.state;if(o&&(!a||a===this.tempLocationKey)){const c=i(o);return c.state.key=s.state.key,delete c.state.__tempLocation,{...c,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>fxe({basepath:this.basepath,base:n,to:KE(r),trailingSlash:this.options.trailingSlash,caseSensitive:this.options.caseSensitive}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=(n,r)=>Dxe({pathname:n,routePathname:r,basepath:this.basepath,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r.pendingTimeout))},this.cancelMatches=()=>{var n;(n=this.state.pendingMatches)==null||n.forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=n=>{const r=(s={})=>{var o;const a=s._fromLocation||this.latestLocation,c=this.matchRoutes(a,{_buildLocation:!0}),l=oR(c);let u=l.fullPath;s.unsafeRelative==="path"?u=a.pathname:s.to&&s.from&&(u=s.from,[...c].reverse().find(R=>R.fullPath===u||R.fullPath===Eu([u,"/"]))||console.warn(`Could not find match for from: ${s.from}`));const d=l.search,h={...l.params},f=s.to?this.resolvePathWithBase(u,`${s.to}`):u;let m=(s.params??!0)===!0?h:{...h,...Z0(s.params,h)};const y=this.matchRoutes(f,{},{_buildLocation:!0}).map(I=>this.looseRoutesById[I.routeId]);Object.keys(m).length>0&&y.map(I=>{var R;return((R=I.options.params)==null?void 0:R.stringify)??I.options.stringifyParams}).filter(Boolean).forEach(I=>{m={...m,...I(m)}});const v=vk({path:f,params:m??{}
18,leaveWildcards:!1,leaveParams:n.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath;let b=d;if(n._includeValidateSearch&&((o=this.options.search)!=null&&o.strict)){let I={};y.forEach(R=>{try{R.options.validateSearch&&(I={...I,...dR(R.options.validateSearch,{...I,...b})??{}})}catch{}}),b=I}b=Lxe({search:b,dest:s,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),b=ic(d,b);const C=this.options.stringifySearch(b),x=s.hash===!0?a.hash:s.hash?Z0(s.hash,a.hash):void 0,_=x?`#${x}`:"";let $=s.state===!0?a.state:s.state?Z0(s.state,a.state):{};return $=ic(a.state,$),{pathname:v,search:b,searchStr:C,state:$,hash:x??"",href:`${v}${C}${_}`,unmaskOnReload:s.unmaskOnReload}},i=(s={},o)=>{var a;const c=r(s);let l=o?r(o):void 0;if(!l){let u={};const d=(a=this.options.routeMasks)==null?void 0:a.find(h=>{const f=lR(this.basepath,c.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1});return f?(u=f,!0):!1});if(d){const{from:h,...f}=d;o={...aR(n,["from"]),...f,params:u},l=r(o)}}if(l){const u=r(o);c.maskedLocation=u}return c};return n.mask?i(n,{...aR(n,["from"]),...n.mask}):i(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...i})=>{const s=()=>{const c=["key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(u=>{i.state[u]=this.latestLocation.state[u]});const l=Zm(i.state,this.latestLocation.state);return c.forEach(u=>{delete i.state[u]}),l},o=this.latestLocation.href===i.href,a=this.commitLocationPromise;if(this.commitLocationPromise=vm(()=>{a==null||a.resolve()}),o&&s())this.load();else{let{maskedLocation:c,hashScrollIntoView:l,...u}=i;c&&(u={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](u.href,u.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:s,ignoreBlocker:o,href:a,...c}={})=>{if(a){const u=this.history.location.state.__TSR_index,d=jb(a,{__TSR_index:n?u:u+1});c.to=d.pathname,c.search=this.options.parseSearch(d.search),c.hash=d.hash.slice(1)}const l=this.buildLocation({...c,_includeValidateSearch:!0});return this.commitLocation({...l,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:o})},this.navigate=({to:n,reloadDocument:r,href:i,...s})=>{if(!r&&i)try{new URL(`${i}`),r=!0}catch{}if(r){if(!i){const o=this.buildLocation({to:n,...s});i=this.history.createHref(o.href)}s.replace?window.location.replace(i):window.location.href=i;return}return this.buildAndCommitLocation({...s,href:i,to:n})},this.beforeLoad=()=>{this.cancelMatches(),this.latestLocation=this.parseLocation(this.latestLocation);const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(i=>!n.find(s=>s.id===i.id))}))},this.load=async n=>{let r,i,s;for(s=new Promise(o=>{this.startTransition(async()=>{var a;try{this.beforeLoad();const c=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Y0({resolvedLocation:l,location:c})}),this.emit({type:"onBeforeLoad",...Y0({resolvedLocation:l,location:c})}),await this.loadMatches({sync:n==null?void 0:n.sync,matches:this.state.pendingMatches,location:c,onReady:async()=>{this.startViewTransition(async()=>{let u,d,h;uH(()=>{this.__store.setState(f=>{const m=f.matches,y=f.pendingMatches||f.matches;return u=m.filter(v=>!y.find(b=>b.id===v.id)),d=y.filter(v=>!m.find(b=>b.id===v.id)),h=m.filter(v=>y.find(b=>b.id===v.id)),{...f,isLoading:!1,loadedAt:Date.now(),matches:y,pendingMatches:void 0,cachedMatches:[...f.cachedMatches,...u.filter(v=>v.status!=="error")]}}),this.clearExpiredCache()}
18),[[u,"onLeave"],[d,"onEnter"],[h,"onStay"]].forEach(([f,m])=>{f.forEach(y=>{var v,b;(b=(v=this.looseRoutesById[y.routeId].options)[m])==null||b.call(v,y)})})})}})}catch(c){Xl(c)?(r=c,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):uc(c)&&(i=c),this.__store.setState(l=>({...l,statusCode:r?r.status:i?404:l.matches.some(u=>u.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&((a=this.commitLocationPromise)==null||a.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;this.hasNotFoundMatch()&&this.__store.setState(o=>({...o,statusCode:404}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,o=this.state.resolvedLocation,a=typeof r.types=="function"?r.types(Y0({resolvedLocation:o,location:s})):r.types;i={update:n,types:a}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{var i;let s;const o=(i=this.state.pendingMatches)==null?void 0:i.find(u=>u.id===n),a=this.state.matches.find(u=>u.id===n),c=this.state.cachedMatches.find(u=>u.id===n),l=o?"pendingMatches":a?"matches":c?"cachedMatches":"";return l&&this.__store.setState(u=>{var d;return{...u,[l]:(d=u[l])==null?void 0:d.map(h=>h.id===n?s=r(h):h)}}),s},this.getMatch=n=>[...this.state.cachedMatches,...this.state.pendingMatches??[],...this.state.matches].find(r=>r.id===n),this.loadMatches=async({location:n,matches:r,preload:i,onReady:s,updateMatch:o=this.updateMatch,sync:a})=>{let c,l=!1;const u=async()=>{l||(l=!0,await(s==null?void 0:s()))},d=f=>!!(i&&!this.state.matches.find(m=>m.id===f)),h=(f,m)=>{var y,v,b,C;if(Xl(m)||uc(m)){if(Xl(m)&&m.redirectHandled&&!m.options.reloadDocument)throw m;if(o(f.id,x=>({...x,status:Xl(m)?"redirected":uc(m)?"notFound":"error",isFetching:!1,error:m,beforeLoadPromise:void 0,loaderPromise:void 0})),m.routeId||(m.routeId=f.routeId),(y=f.beforeLoadPromise)==null||y.resolve(),(v=f.loaderPromise)==null||v.resolve(),(b=f.loadPromise)==null||b.resolve(),Xl(m))throw l=!0,m.options._fromLocation=n,m.redirectHandled=!0,m=this.resolveRedirect(m),m;if(uc(m))throw this._handleNotFound(r,m,{updateMatch:o}),(C=this.serverSsr)==null||C.onMatchSettled({router:this,match:this.getMatch(f.id)}),m}};try{await new Promise((f,m)=>{(async()=>{var y,v,b,C;try{const x=(I,R,N)=>{var T,O;const{id:U,routeId:z}=r[I],L=this.looseRoutesById[z];if(R instanceof Promise)throw R;R.routerCode=N,c=c??I,h(this.getMatch(U),R);try{(O=(T=L.options).onError)==null||O.call(T,R)}catch(S){R=S,h(this.getMatch(U),R)}o(U,S=>{var k,M;return(k=S.beforeLoadPromise)==null||k.resolve(),(M=S.loadPromise)==null||M.resolve(),{...S,error:R,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController,beforeLoadPromise:void 0}})};for(const[I,{id:R,routeId:N}]of r.entries()){const T=this.getMatch(R),O=(y=r[I-1])==null?void 0:y.id,U=this.looseRoutesById[N],z=U.options.pendingMs??this.options.defaultPendingMs,L=!!(s&&!this.isServer&&!d(R)&&(U.options.loader||U.options.beforeLoad||yH(U))&&typeof z=="number"&&z!==1/0&&(U.options.pendingComponent??((v=this.options)==null?void 0:v.defaultPendingComponent)));let S=!0;if((T.beforeLoadPromise||T.loaderPromise)&&(L&&setTimeout(()=>{try{u()}catch{}},z),await T.beforeLoadPromise,S=this.getMatch(R).status!=="success"),S){try{o(R,ae=>{const oe=ae.loadPromise;return{...ae,loadPromise:vm(()=>{oe==null||oe.resolve()}),beforeLoadPromise:vm()}});const k=new AbortController;let M;L&&(M=setTimeout(()=>{try{u()}catch{}},z));const{paramsError:W,searchError:H}=this.getMatch(R);W&&x(I,W,"PARSE_PARAMS"),H&&x(I,H,"VALIDATE_SEARCH");const D=()=>O?this.getMatch(O).context:this.options.context??{};o(R,ae=>({...ae,isFetching:"beforeLoad",fetchCount:ae.fetchCount+1,abortController:k,pendingTimeout:M,context:{...D(),...ae.__routeC
18ontext}}));const{search:V,params:B,context:P,cause:j}=this.getMatch(R),G=d(R),Y={search:V,abortController:k,params:B,preload:G,context:P,location:n,navigate:ae=>this.navigate({...ae,_fromLocation:n}),buildLocation:this.buildLocation,cause:G?"preload":j,matches:r},te=await((C=(b=U.options).beforeLoad)==null?void 0:C.call(b,Y))??{};(Xl(te)||uc(te))&&x(I,te,"BEFORE_LOAD"),o(R,ae=>({...ae,__beforeLoadContext:te,context:{...D(),...ae.__routeContext,...te},abortController:k}))}catch(k){x(I,k,"BEFORE_LOAD")}o(R,k=>{var M;return(M=k.beforeLoadPromise)==null||M.resolve(),{...k,beforeLoadPromise:void 0,isFetching:!1}})}}const _=r.slice(0,c),$=[];_.forEach(({id:I,routeId:R},N)=>{$.push((async()=>{const{loaderPromise:T}=this.getMatch(I);let O=!1,U=!1;if(T){await T;const z=this.getMatch(I);z.error&&h(z,z.error)}else{const z=$[N-1],L=this.looseRoutesById[R],S=()=>{const{params:G,loaderDeps:Y,abortController:te,context:ae,cause:oe}=this.getMatch(I),de=d(I);return{params:G,deps:Y,preload:!!de,parentMatchPromise:z,abortController:te,context:ae,location:n,navigate:ke=>this.navigate({...ke,_fromLocation:n}),cause:de?"preload":oe,route:L}},k=Date.now()-this.getMatch(I).updatedAt,M=d(I),W=M?L.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:L.options.staleTime??this.options.defaultStaleTime??0,H=L.options.shouldReload,D=typeof H=="function"?H(S()):H;o(I,G=>({...G,loaderPromise:vm(),preload:!!M&&!this.state.matches.find(Y=>Y.id===I)}));const V=async()=>{var G,Y,te,ae,oe,de;const ke=this.getMatch(I);if(!ke)return;const Be={matches:r,match:ke,params:ke.params,loaderData:ke.loaderData},$e=await((Y=(G=L.options).head)==null?void 0:Y.call(G,Be)),He=$e==null?void 0:$e.meta,Ge=$e==null?void 0:$e.links,je=$e==null?void 0:$e.scripts,xt=await((ae=(te=L.options).scripts)==null?void 0:ae.call(te,Be)),ft=await((de=(oe=L.options).headers)==null?void 0:de.call(oe,Be));return{meta:He,links:Ge,headScripts:je,headers:ft,scripts:xt}},B=async()=>{var G,Y,te,ae,oe;try{const de=async()=>{const ke=this.getMatch(I);ke.minPendingPromise&&await ke.minPendingPromise};try{this.loadRouteChunk(L),o(I,$e=>({...$e,isFetching:"loader"}));const ke=await((Y=(G=L.options).loader)==null?void 0:Y.call(G,S()));h(this.getMatch(I),ke),await L._lazyPromise,await de(),await L._componentsPromise,o(I,$e=>({...$e,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:ke}));const Be=await V();o(I,$e=>({...$e,...Be}))}catch(ke){let Be=ke;await de(),h(this.getMatch(I),ke);try{(ae=(te=L.options).onError)==null||ae.call(te,ke)}catch(He){Be=He,h(this.getMatch(I),He)}const $e=await V();o(I,He=>({...He,error:Be,status:"error",isFetching:!1,...$e}))}(oe=this.serverSsr)==null||oe.onMatchSettled({router:this,match:this.getMatch(I)})}catch(de){const ke=await V();o(I,Be=>({...Be,loaderPromise:void 0,...ke})),h(this.getMatch(I),de)}},{status:P,invalid:j}=this.getMatch(I);if(O=P==="success"&&(j||(D??k>W)),!(M&&L.options.preload===!1))if(O&&!a)U=!0,(async()=>{try{await B();const{loaderPromise:G,loadPromise:Y}=this.getMatch(I);G==null||G.resolve(),Y==null||Y.resolve(),o(I,te=>({...te,loaderPromise:void 0}))}catch(G){Xl(G)&&await this.navigate(G.options)}})();else if(P!=="success"||O&&a)await B();else{const G=await V();o(I,Y=>({...Y,...G}))}}if(!U){const{loaderPromise:z,loadPromise:L}=this.getMatch(I);z==null||z.resolve(),L==null||L.resolve()}return o(I,z=>({...z,isFetching:U?z.isFetching:!1,loaderPromise:U?z.loaderPromise:void 0,invalid:!1})),this.getMatch(I)})())}),await Promise.all($),f()}catch(x){m(x)}})()}),await u()}catch(f){if(Xl(f)||uc(f))throw uc(f)&&!i&&await u(),f}return r},this.invalidate=n=>{const r=i=>{var s;return((s=n==null?void 0:n.filter)==null?void 0:s.call(n,i))??!0?{...i,invalid:!0,...i.status==="error"?{status:"pending",error:void 0}:{}}:i};return this.__store.setState(i=>{var s;return{...i,matches:i.matches.map(r),cachedMatches:i.cachedMatches.map(r),pendingMatches:(s=i.pendingMatches)==null?void 0:s.map(r)}}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.resolveRedirect=n=>(n.options.href||(n.options.href=this.buildLocation(n.options).href,n.headers.set("Location",n.options.href)),n.headers.get("Location")||n.headers.set("Location",n.options.href),n),this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(s=>!r(s))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const i=this.looseRoutesById[r.routeId];if(!i.options.loader)return!0;const s=(r.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return!(r.status!=="error"&&Date.now()-r.updatedAt<s)};this.clearCache({filter:n})},this.loadRouteChunk=n=>(n._lazyPromise===void 0&&(n.lazyFn?n._lazyPromise=n.lazyFn().then(r=>{const{id:i,...s}=r.options;Object.assign(n.options,s)}):n._lazyPromise=Promise.resolve()),n._componentsPromise===void 0&&(n._componentsPromise=n._lazyPromise.then(()=>Promise.all(Xie.map(async r=>{const i=n.options[r];i!=null&&i.preload&&await i.preload()})))),n._componentsPromise),this.preloadRoute=async n=>{const r=this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),o=new Set([...s,...this.state.cachedMatches.map(a=>a.id)]);uH(()=>
18{i.forEach(a=>{o.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return i=await this.loadMatches({matches:i,location:r,preload:!0,updateMatch:(a,c)=>{s.has(a)?i=i.map(l=>l.id===a?c(l):l):this.updateMatch(a,c)}}),i}catch(a){if(Xl(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:r});uc(a)||console.error(a);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(i);if(r!=null&&r.pending&&this.state.status!=="pending")return!1;const a=((r==null?void 0:r.pending)===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=lR(this.basepath,a.pathname,{...r,to:s.pathname});return!c||n.params&&!Zm(c,n.params,{partial:!0})?!1:c&&((r==null?void 0:r.includeSearch)??!0)?Zm(a.search,s.search,{partial:!0})?c:!1:c},this._handleNotFound=(n,r,{updateMatch:i=this.updateMatch}={})=>{var s;const o=this.routesById[r.routeId??""]??this.routeTree,a={};for(const l of n)a[l.routeId]=l;!o.options.notFoundComponent&&((s=this.options)!=null&&s.defaultNotFoundComponent)&&(o.options.notFoundComponent=this.options.defaultNotFoundComponent),Kd(o.options.notFoundComponent);const c=a[o.id];Kd(c,"Could not find match for route: "+o.id),i(c.id,l=>({...l,status:"notFound",error:r,isFetching:!1})),r.routerCode==="BEFORE_LOAD"&&o.parentRoute&&(r.routeId=o.parentRoute.id,this._handleNotFound(n,r,{updateMatch:i}))},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Ixe,parseSearch:e.parseSearch??$xe}),typeof document<"u"&&(window.__TSR_ROUTER__=this)}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(e,n){var r;const{foundRoute:i,matchedRoutes:s,routeParams:o}=this.getMatchedRoutes(e.pathname,(r=n==null?void 0:n.dest)==null?void 0:r.to);let a=!1;(i?i.path!=="/"&&o["**"]:Dy(e.pathname))&&(this.options.notFoundRoute?s.push(this.options.notFoundRoute):a=!0);const c=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let h=s.length-1;h>=0;h--){const f=s[h];if(f.children)return f.id}return il}})(),l=s.map(h=>{var f;let m;const y=((f=h.options.params)==null?void 0:f.parse)??h.options.parseParams;if(y)try{const v=y(o);Object.assign(o,v)}catch(v){if(m=new Oxe(v.message,{cause:v}),n!=null&&n.throwOnError)throw m;return m}}),u=[],d=h=>(h==null?void 0:h.id)?h.context??this.options.context??{}:this.options.context??{};return s.forEach((h,f)=>{var m,y;const v=u[f-1],[b,C,x]=(()=>{const S=(v==null?void 0:v.search)??e.search,k=(v==null?void 0:v._strictSearch)??{};try{const M=dR(h.options.validateSearch,{...S})??{};return[{...S,...M},{...k,...M},void 0]}catch(M){let W=M;if(M instanceof F7||(W=new F7(M.message,{cause:M})),n!=null&&n.throwOnError)throw W;return[S,{},W]}})(),_=((y=(m=h.options).loaderDeps)==null?void 0:y.call(m,{search:b}))??"",$=_?JSON.stringify(_):"",{usedParams:I,interpolatedPath:R}=vk({path:h.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),N=vk({path:h.id,params:o,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath+$,T=this.getMatch(N),O=this.state.matches.find(S=>S.routeId===h.id),U=O?"stay":"enter";let z;if(T)z={...T,cause:U,params:O?ic(O.params,o):o,_strictParams:I,search:ic(O?O.search:T.search,b),_strictSearch:C};else{const S=h.options.loader||h.options.beforeLoad||h.lazyFn||yH(h)?"pending":"success";z={id:N,index:f,routeId:h.id,params:O?ic(O.params,o):o,_strictParams:I,pathname:Eu([this.basepath,R]),updatedAt:Date.now(),search:O?ic(O.search,b):b,_strictSearch:C,searchError:void 0,status:S,isFetching:!1,error:void 0,paramsError:l[f],__routeContext:{},__beforeLoadContext:{},context:{},abortController:new AbortController,fetchCount:0,cause:U,loaderDeps:O?ic(O.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},loadPromise:vm(),fullPath:h.fullPath}}n!=null&&n.preload||(z.globalNotFound=c===h.id),z.searchError=x;const L=d(v);
18z.context={...L,...z.__routeContext,...z.__beforeLoadContext},u.push(z)}),u.forEach((h,f)=>{var m,y;const v=this.looseRoutesById[h.routeId];if(!this.getMatch(h.id)&&(n==null?void 0:n._buildLocation)!==!0){const C=u[f-1],x=d(C),_={deps:h.loaderDeps,params:h.params,context:x,location:e,navigate:$=>this.navigate({...$,_fromLocation:e}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:u};h.__routeContext=((y=(m=v.options).context)==null?void 0:y.call(m,_))??{},h.context={...x,...h.__routeContext,...h.__beforeLoadContext}}}),u}}class F7 extends Error{}class Oxe extends Error{}function jxe(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function dR(t,e){if(t==null)return{};if("~standard"in t){const n=t["~standard"].validate(e);if(n instanceof Promise)throw new F7("Async validation not supported");if(n.issues)throw new F7(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}const Xie=["component","errorComponent","pendingComponent","notFoundComponent"];function yH(t){var e;for(const n of Xie)if((e=t.options[n])!=null&&e.preload)return!0;return!1}function Nxe({routeTree:t,initRoute:e}){const n={},r={},i=c=>{c.forEach((l,u)=>{e==null||e(l,u);const d=n[l.id];if(Kd(!d,`Duplicate routes found with id: ${String(l.id)}`),n[l.id]=l,!l.isRoot&&l.path){const f=Dy(l.fullPath);(!r[f]||l.fullPath.endsWith("/"))&&(r[f]=l)}const h=l.children;h!=null&&h.length&&i(h)})};i([t]);const s=[];Object.values(n).forEach((c,l)=>{var u;if(c.isRoot||!c.path)return;const d=qN(c.fullPath),h=Ly(d);for(;h.length>1&&((u=h[0])==null?void 0:u.value)==="/";)h.shift();const f=h.map(m=>m.value==="/"?.75:m.type==="param"&&m.prefixSegment&&m.suffixSegment?.55:m.type==="param"&&m.prefixSegment?.52:m.type==="param"&&m.suffixSegment?.51:m.type==="param"?.5:m.type==="wildcard"&&m.prefixSegment&&m.suffixSegment?.3:m.type==="wildcard"&&m.prefixSegment?.27:m.type==="wildcard"&&m.suffixSegment?.26:m.type==="wildcard"?.25:1);s.push({child:c,trimmed:d,parsed:h,index:l,scores:f})});const a=s.sort((c,l)=>{const u=Math.min(c.scores.length,l.scores.length);for(let d=0;d<u;d++)if(c.scores[d]!==l.scores[d])return l.scores[d]-c.scores[d];if(c.scores.length!==l.scores.length)return l.scores.length-c.scores.length;for(let d=0;d<u;d++)if(c.parsed[d].value!==l.parsed[d].value)return c.parsed[d].value>l.parsed[d].value?1:-1;return c.index-l.index}).map((c,l)=>(c.child.rank=l,c.child));return{routesById:n,routesByPath:r,flatRoutes:a}}function Dxe({pathname:t,routePathname:e,basepath:n,caseSensitive:r,routesByPath:i,routesById:s,flatRoutes:o}){let a={};const c=Dy(t),l=f=>{var m;return lR(n,c,{to:f.fullPath,caseSensitive:((m=f.options)==null?void 0:m.caseSensitive)??r,fuzzy:!0})};let u=e!==void 0?i[e]:void 0;u?a=l(u):u=o.find(f=>{const m=l(f);return m?(a=m,!0):!1});let d=u||s[il];const h=[d];for(;d.parentRoute;)d=d.parentRoute,h.unshift(d);return{matchedRoutes:h,routeParams:a,foundRoute:u}}function Lxe({search:t,dest:e,destRoutes:n,_includeValidateSearch:r}){const i=n.reduce((a,c)=>{var l;const u=[];if("search"in c.options)(l=c.options.search)!=null&&l.middlewares&&u.push(...c.options.search.middlewares);else if(c.options.preSearchFilters||c.options.postSearchFilters){const d=({search:h,next:f})=>{let m=h;"preSearchFilters"in c.options&&c.options.preSearchFilters&&(m=c.options.preSearchFilters.reduce((v,b)=>b(v),h));const y=f(m);return"postSearchFilters"in c.options&&c.options.postSearchFilters?c.options.postSearchFilters.reduce((v,b)=>b(v),y):y};u.push(d)}if(r&&c.options.validateSearch){const d=({search:h,next:f})=>{const m=f(h);try{return{...m,...dR(c.options.validateSearch,m)??{}}}catch{return m}};u.push(d)}return a.concat(u)},[])??[],s=({search:a})=>e.search?e.search===!0?a:Z0(e.search,a):{};i.push(s);const o=(a,c)=>{if(a>=i.length)return c;const l=i[a];return l({search:c,next:d=>o(a+1,d)})};return o(0,t)}const Bxe="Error preloading route! âï¸";class Jie{constructor(e){if(this.init=n=>{var r,i;this.originalIndex=n.originalIndex;const s=this.options,o=!(s!=null&&s.path)&&!(s!=null&&s.id);this.parentRoute=(i=(r=this.options).getParentRoute)==null?void 0:i.call(r),o?this._path=il:this.parentRoute||Kd(!1);let a=o?il:s==null?void 0:s.path;
18a&&a!=="/"&&(a=qN(a));const c=(s==null?void 0:s.id)||a;let l=o?il:Eu([this.parentRoute.id===il?"":this.parentRoute.id,c]);a===il&&(a="/"),l!==il&&(l=Eu(["/",l]));const u=l===il?"/":Eu([this.parentRoute.fullPath,a]);this._path=a,this._id=l,this._fullPath=u,this._to=u,this._ssr=(s==null?void 0:s.ssr)??n.defaultSsr??!0},this.clone=n=>{this._path=n._path,this._id=n._id,this._fullPath=n._fullPath,this._to=n._to,this._ssr=n._ssr,this.options.getParentRoute=n.options.getParentRoute,this.children=n.children},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}get ssr(){return this._ssr}}class Fxe extends Jie{constructor(e){super(e)}}var E=wh();const Rt=ys(E),GE=exe({__proto__:null,default:Rt},[E]);function KN(t){const e=t.errorComponent??ZE;return p.jsx(Uxe,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:n,reset:r})=>n?E.createElement(e,{error:n,reset:r}):t.children})}class Uxe extends E.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,n){this.props.onCatch&&this.props.onCatch(e,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function ZE({error:t}){const[e,n]=E.useState(!1);return p.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[p.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),p.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:e?"Hide Error":"Show Error"})]}),p.jsx("div",{style:{height:".25rem"}}),e?p.jsx("div",{children:p.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?p.jsx("code",{children:t.message}):null})}):null]})}function zxe({children:t,fallback:e=null}){return Wxe()?p.jsx(Rt.Fragment,{children:t}):p.jsx(Rt.Fragment,{children:e})}function Wxe(){return Rt.useSyncExternalStore(Hxe,()=>!0,()=>!1)}function Hxe(){return()=>{}}var Ek={exports:{}},Ck={},_k={exports:{}},Sk={};/** 19 * @license React 20 * use-sync-external-store-shim.production.js 21 * 22 * Copyright (c) Meta Platforms, Inc. and affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */var wH;function Vxe(){if(wH)return Sk;wH=1;var t=wh();function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(d,h){var f=h(),m=r({inst:{value:f,getSnapshot:h}}),y=m[0].inst,v=m[1];return s(function(){y.value=f,y.getSnapshot=h,c(y)&&v({inst:y})},[d,f,h]),i(function(){return c(y)&&v({inst:y}),d(function(){c(y)&&v({inst:y})})},[d]),o(f),f}function c(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function l(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Sk.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Sk}var vH;function ese(){return vH||(vH=1,_k.exports=Vxe()),_k.exports}/** 27 * @license React 28 * use-sync-external-store-shim/with-selector.production.js 29 * 30 * Copyright (c) Meta Platforms, Inc. and affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var bH;function qxe(){if(bH)return Ck;bH=1;var t=wh(),e=ese();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,c=t.useDebugValue;return Ck.useSyncExternalStoreWithSelector=function(l,u,d,h,f){var m=s(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function b(I){if(!C){if(C=!0,x=I,I=h(I),f!==void 0&&y.hasValue){var R=y.value;if(f(R,I))return _=R}return _=I}if(R=_,r(x,I))return R;var N=h(I);return f!==void 0&&f(R,N)?(x=I,R):(x=I,_=N)}var C=!1,x,_,$=d===void 0?null:d;return[function(){return b(u())},$===null?void 0:function(){return b($())}]},[u,d,h,f]);var v=i(l,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=v},[v]),c(v),v},Ck}var xH;function Kxe(){return xH||(xH=1,Ek.exports=qxe()),Ek.exports}var tse=Kxe();const Gxe=ys(tse);function Zxe(t,e=n=>n){return tse.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,Yxe)}function Yxe(t,e){if(Object.is(t,e))return!0;
34if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,i]of t)if(!e.has(r)||!Object.is(i,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(e,n[r])||!Object.is(t[n[r]],e[n[r]]))return!1;return!0}const Ak=E.createContext(null);function nse(){return typeof document>"u"?Ak:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Ak,Ak)}function $c(t){const e=E.useContext(nse());return t==null||t.warn,e}function Ds(t){const e=$c({warn:(t==null?void 0:t.router)===void 0}),n=(t==null?void 0:t.router)||e,r=E.useRef(void 0);return Zxe(n.__store,i=>{if(t!=null&&t.select){if(t.structuralSharing??n.options.defaultStructuralSharing){const s=ic(r.current,t.select(i));return r.current=s,s}return t.select(i)}return i})}const YE=E.createContext(void 0),Qxe=E.createContext(void 0);function bc(t){const e=E.useContext(t.from?Qxe:YE);return Ds({select:r=>{const i=r.matches.find(s=>t.from?t.from===s.routeId:s.id===e);if(Kd(!((t.shouldThrow??!0)&&!i),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),i!==void 0)return t.select?t.select(i):i},structuralSharing:t.structuralSharing})}function GN(t){return bc({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function ZN(t){const{select:e,...n}=t;return bc({...n,select:r=>e?e(r.loaderDeps):r.loaderDeps})}function QE(t){return bc({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.params):e.params})}function YN(t){return bc({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function XE(t){const{navigate:e,state:n}=$c(),r=bc({strict:!1,select:i=>i.index});return E.useCallback(i=>{const s=i.from??(t==null?void 0:t.from)??n.matches[r].fullPath;return e({...i,from:s})},[t==null?void 0:t.from,e])}var kk={exports:{}},zo={},$k={exports:{}},Ik={};/** 35 * @license React 36 * scheduler.production.min.js 37 * 38 * Copyright (c) Facebook, Inc. and its affiliates. 39 * 40 * This source code is licensed under the MIT license found in the 41 * LICENSE file in the root directory of this source tree. 42 */var EH;function Xxe(){return EH||(EH=1,function(t){function e(H,D){var V=H.length;H.push(D);e:for(;0<V;){var B=V-1>>>1,P=H[B];if(0<i(P,D))H[B]=D,H[V]=P,V=B;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var D=H[0],V=H.pop();if(V!==D){H[0]=V;e:for(var B=0,P=H.length,j=P>>>1;B<j;){var G=2*(B+1)-1,Y=H[G],te=G+1,ae=H[te];if(0>i(Y,V))te<P&&0>i(ae,Y)?(H[B]=ae,H[te]=V,B=te):(H[B]=Y,H[G]=V,B=G);else if(te<P&&0>i(ae,V))H[B]=ae,H[te]=V,B=te;else break e}}return D}function i(H,D){var V=H.sortIndex-D.sortIndex;return V!==0?V:H.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,d=null,h=3,f=!1,m=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(H){for(var D=n(l);D!==null;){if(D.callback===null)r(l);else if(D.startTime<=H)r(l),D.sortIndex=D.expirationTime,e(c,D);else break;D=n(l)}}function _(H){if(y=!1,x(H),!m)if(n(c)!==null)m=!0,M($);else{var D=n(l);D!==null&&W(_,D.startTime-H)}}function $(H,D){m=!1,y&&(y=!1,b(N),N=-1),f=!0;var V=h;try{for(x(D),d=n(c);d!==null&&(!(d.expirationTime>D)||H&&!U());){var B=d.callback;
vendor: 4,686 bytes, lines 42-50
42if(typeof B=="function"){d.callback=null,h=d.priorityLevel;var P=B(d.expirationTime<=D);D=t.unstable_now(),typeof P=="function"?d.callback=P:d===n(c)&&r(c),x(D)}else r(c);d=n(c)}if(d!==null)var j=!0;else{var G=n(l);G!==null&&W(_,G.startTime-D),j=!1}return j}finally{d=null,h=V,f=!1}}var I=!1,R=null,N=-1,T=5,O=-1;function U(){return!(t.unstable_now()-O<T)}function z(){if(R!==null){var H=t.unstable_now();O=H;var D=!0;try{D=R(!0,H)}finally{D?L():(I=!1,R=null)}}else I=!1}var L;if(typeof C=="function")L=function(){C(z)};else if(typeof MessageChannel<"u"){var S=new MessageChannel,k=S.port2;S.port1.onmessage=z,L=function(){k.postMessage(null)}}else L=function(){v(z,0)};function M(H){R=H,I||(I=!0,L())}function W(H,D){N=v(function(){H(t.unstable_now())},D)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,M($))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(H){switch(h){case 1:case 2:case 3:var D=3;break;default:D=h}var V=h;h=D;try{return H()}finally{h=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,D){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var V=h;h=H;try{return D()}finally{h=V}},t.unstable_scheduleCallback=function(H,D,V){var B=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?B+V:B):V=B,H){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=V+P,H={id:u++,callback:D,priorityLevel:H,startTime:V,expirationTime:P,sortIndex:-1},V>B?(H.sortIndex=V,e(l,H),n(c)===null&&H===n(l)&&(y?(b(N),N=-1):y=!0,W(_,V-B))):(H.sortIndex=P,e(c,H),m||f||(m=!0,M($))),H},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(H){var D=h;return function(){var V=h;h=D;try{return H.apply(this,arguments)}finally{h=V}}}}(Ik)),Ik}var CH;function Jxe(){return CH||(CH=1,$k.exports=Xxe()),$k.exports}/** 43 * @license React 44 * react-dom.production.min.js 45 * 46 * Copyright (c) Facebook, Inc. and its affiliates. 47 * 48 * This source code is licensed under the MIT license found in the 49 * LICENSE file in the root directory of this source tree. 50 */var _H;function e4e(){if(_H)return zo;_H=1;var t=wh(),e=Jxe();function n(g){for(var w="https://reactjs.org/docs/error-decoder.html?invariant="+g,A=1;A<arguments.length;A++)w+="&args[]="+encodeURIComponent(arguments[A]);return"Minified React error #"+g+"; visit "+w+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function s(g,w){o(g,w),o(g+"Capture",w)}function o(g,w){for(i[g]=w,g=0;g<w.length;g++)r.add(w[g])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,l=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},d={};function h(g){return c.call(d,g)?!0:c.call(u,g)?!1:l.test(g)?d[g]=!0:(u[g]=!0,!1)}function f(g,w,A,F){if(A!==null&&A.type===0)return!1;switch(typeof w){case"function":case"symbol":return!0;case"boolean":return F?!1:A!==null?!A.acceptsBooleans:(g=g.toLowerCase().slice(0,5),g!=="data-"&&g!=="aria-");default:return!1}}function m(g,w,A,F){if(w===null||typeof w>"u"||f(g,w,A,F))return!0;if(F)return!1;if(A!==null)switch(A.type){case 3:return!w;case 4:return w===!1;case 5:return isNaN(w);case 6:return isNaN(w)||1>w}return!1}function y(g,w,A,F,K,Q,re){this.acceptsBooleans=w===2||w===3||w===4,this.attributeName=F,this.attributeNamespace=K,this.mustUseProperty=A,this.propertyName=g,this.type=w,this.sanitizeURL=Q,this.removeEmptyString=re}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(g){v[g]=new y(g,0,!1,g,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEac
vendor: 4,366 bytes, lines 50-51
50h(function(g){var w=g[0];v[w]=new y(w,1,!1,g[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(g){v[g]=new y(g,2,!1,g.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(g){v[g]=new y(g,2,!1,g,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(g){v[g]=new y(g,3,!1,g.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(g){v[g]=new y(g,3,!0,g,null,!1,!1)}),["capture","download"].forEach(function(g){v[g]=new y(g,4,!1,g,null,!1,!1)}),["cols","rows","size","span"].forEach(function(g){v[g]=new y(g,6,!1,g,null,!1,!1)}),["rowSpan","start"].forEach(function(g){v[g]=new y(g,5,!1,g.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function C(g){return g[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(g){var w=g.replace(b,C);v[w]=new y(w,1,!1,g,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(g){var w=g.replace(b,C);v[w]=new y(w,1,!1,g,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(g){var w=g.replace(b,C);v[w]=new y(w,1,!1,g,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(g){v[g]=new y(g,1,!1,g.toLowerCase(),null,!1,!1)}),v.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(g){v[g]=new y(g,1,!1,g.toLowerCase(),null,!0,!0)});function x(g,w,A,F){var K=v.hasOwnProperty(w)?v[w]:null;(K!==null?K.type!==0:F||!(2<w.length)||w[0]!=="o"&&w[0]!=="O"||w[1]!=="n"&&w[1]!=="N")&&(m(w,A,K,F)&&(A=null),F||K===null?h(w)&&(A===null?g.removeAttribute(w):g.setAttribute(w,""+A)):K.mustUseProperty?g[K.propertyName]=A===null?K.type===3?!1:"":A:(w=K.attributeName,F=K.attributeNamespace,A===null?g.removeAttribute(w):(K=K.type,A=K===3||K===4&&A===!0?"":""+A,F?g.setAttributeNS(F,w,A):g.setAttribute(w,A))))}var _=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),I=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),U=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),H=Symbol.iterator;function D(g){return g===null||typeof g!="object"?null:(g=H&&g[H]||g["@@iterator"],typeof g=="function"?g:null)}var V=Object.assign,B;function P(g){if(B===void 0)try{throw Error()}catch(A){var w=A.stack.trim().match(/\n( *(at )?)/);B=w&&w[1]||""}return` 51`+B+g}var j=!1;function G(g,w){if(!g||j)return"";j=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(w)if(w=function(){throw Error()},Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(Fe){var F=Fe}Reflect.construct(g,[],w)}
vendor: 6,588 bytes, lines 51-54
51else{try{w.call()}catch(Fe){F=Fe}g.call(w.prototype)}else{try{throw Error()}catch(Fe){F=Fe}g()}}catch(Fe){if(Fe&&F&&typeof Fe.stack=="string"){for(var K=Fe.stack.split(` 52`),Q=F.stack.split(` 53`),re=K.length-1,ge=Q.length-1;1<=re&&0<=ge&&K[re]!==Q[ge];)ge--;for(;1<=re&&0<=ge;re--,ge--)if(K[re]!==Q[ge]){if(re!==1||ge!==1)do if(re--,ge--,0>ge||K[re]!==Q[ge]){var Se=` 54`+K[re].replace(" at new "," at ");return g.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",g.displayName)),Se}while(1<=re&&0<=ge);break}}}finally{j=!1,Error.prepareStackTrace=A}return(g=g?g.displayName||g.name:"")?P(g):""}function Y(g){switch(g.tag){case 5:return P(g.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return g=G(g.type,!1),g;case 11:return g=G(g.type.render,!1),g;case 1:return g=G(g.type,!0),g;default:return""}}function te(g){if(g==null)return null;if(typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case R:return"Fragment";case I:return"Portal";case T:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case S:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case U:return(g.displayName||"Context")+".Consumer";case O:return(g._context.displayName||"Context")+".Provider";case z:var w=g.render;return g=g.displayName,g||(g=w.displayName||w.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case k:return w=g.displayName||null,w!==null?w:te(g.type)||"Memo";case M:w=g._payload,g=g._init;try{return te(g(w))}catch{}}return null}function ae(g){var w=g.type;switch(g.tag){case 24:return"Cache";case 9:return(w.displayName||"Context")+".Consumer";case 10:return(w._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return g=w.render,g=g.displayName||g.name||"",w.displayName||(g!==""?"ForwardRef("+g+")":"ForwardRef");case 7:return"Fragment";case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(w);case 8:return w===N?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w}return null}function oe(g){switch(typeof g){case"boolean":case"number":case"string":case"undefined":return g;case"object":return g;default:return""}}function de(g){var w=g.type;return(g=g.nodeName)&&g.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function ke(g){var w=de(g)?"checked":"value",A=Object.getOwnPropertyDescriptor(g.constructor.prototype,w),F=""+g[w];if(!g.hasOwnProperty(w)&&typeof A<"u"&&typeof A.get=="function"&&typeof A.set=="function"){var K=A.get,Q=A.set;return Object.defineProperty(g,w,{configurable:!0,get:function(){return K.call(this)},set:function(re){F=""+re,Q.call(this,re)}}),Object.defineProperty(g,w,{enumerable:A.enumerable}),{getValue:function(){return F},setValue:function(re){F=""+re},stopTracking:function(){g._valueTracker=null,delete g[w]}}}}function Be(g){g._valueTracker||(g._valueTracker=ke(g))}function $e(g){if(!g)return!1;var w=g._valueTracker;if(!w)return!0;var A=w.getValue(),F="";return g&&(F=de(g)?g.checked?"true":"false":g.value),g=F,g!==A?(w.setValue(g),!0):!1}function He(g){if(g=g||(typeof document<"u"?document:void 0),typeof g>"u")return null;try{return g.activeElement||g.body}catch{return g.body}}function Ge(g,w){var A=w.checked;return V({},w,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:A??g._wrapperState.initialChecked})}function je(g,w){var A=w.defaultValue==null?"":w.defaultValue,F=w.checked!=null?w.checked:w.defaultChecked;A=oe(w.value!=null?w.value:A),g._wrapperState={initialChecked:F,initialValue:A,controlled:w.type==="checkbox"||w.type==="radio"?w.checked!=null:w.value!=null}}function xt(g,w){w=w.checked,w!=null&&x(g,"checked",w,!1)}function ft(g,w){xt(g,w);var A=oe(w.value),F=w.type;if(A!=null)F==="number"?(A===0&&g.value===""||g.value!=A)&&(g.value=""+A):g.value!==""+A&&(g.value=""+A);else if(F==="submit"||F==="reset"){g.removeAttribute("value");return}w.hasOwnProperty("value")?be(g,w.type,A):w.hasOwnProperty("defaultValue")&&be(g,w.type,oe(w.defaultValue)),w.checked==null&&w.defaultChecked!=null&&(g.defaultChecked=!!w.defaultChecked)}function it(g,w,A){if(w.hasOwnProperty("value")||w.hasOwnProperty("defaultValue")){var F=w.type;if(!(F!=="submit"&&F!=="reset"||w.value!==void 0&&w.value!==null))return;w=""+g._wrapperState.initialValue,A||w===g.value||(g.value=w),g.defaultValue=w}A=g.name,A!==""&&(g.name=""),g.defaultChecked=!!g._wrapperState.initialChecked,A!==""&&(g.name=A)}function be(g,w,A){(w!=="number"||He(g.ownerDocument)!==g)&&(A==null?g.defaultValue=""+g._wrapperState.initialValue:g.defaultValue!==""+A&&(g.defaultValue=""+A))}var Lt=Array.isArray;function Qe(g,w,A,F){if(g=g.options,w){w={};for(var K=0;K<A.length;K++)w["$"+A[K]]=!0;for(A=0;A<g.length;A++)K=w.hasOwnProperty("$"+g[A].value),g[A].selected!==K&&(g[A].selected=K),K&&F&&(g[A].defaultSelected=!0)}else{for(A=""+oe(A),w=null,K=0;K<g.length;K++){if(g[K].value===A){g[K].selected=!0,F&&(g[K].defaultSelected=!0);return}w!==null||g[K].disabled||(w=g[K])}w!==null&&(w.selected=!0)}}function Ue(g,w){if(w.dangerouslySetInnerHTML!=null)throw Error(n(91));return V({},w,{value:void 0,defaultValue:void 0,children:""+g._wrapperState.initialValue})}function Ye(g,w){var A=w.value;if(A==null){if(A=w.children,w=w.defaultValue,A!=null){if(w!=null)throw Error(n(92));if(Lt(A)){if(1<A.length)throw Error(n(93));A=A[0]}w=A}w==null&&(w=""),A=w}g._wrapperState={initialValue:oe(A)}}function tt(g,w){var A=oe(w.value),F=oe(w.defaultValue);A!=null&&(A=""+A,A!==g.value&&(g.value=A),w.defaultValue==null&&g.defaultValue!==A&&(g.defaultValue=A)),F!=null&&(g.defaultValue=""+F)}function ze(g){var w=g.textContent;w===g._wrapperState.initialValue&&w!==""&&w!==null&&(g.value=w)}function Ne(g){switch(g){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function J(g,w){return g==null||g==="http://www.w3.org/1999/xhtml"?Ne(w):g==="http://www.w3.org/2000/svg"&&w==="foreignObject"?"http://www.w3.org/1999/xhtml":g}var q,Z=function(g){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(w,A,F,K){MSApp.execUnsafeLocalFunction(function(){return g(w,A,F,K)})}:g}(function(g,w){if(g.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in g)g.innerHTML=w;
vendor: 31,519 bytes, line 54
54else{for(q=q||document.createElement("div"),q.innerHTML="<svg>"+w.valueOf().toString()+"</svg>",w=q.firstChild;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)g.appendChild(w.firstChild)}});function se(g,w){if(w){var A=g.firstChild;if(A&&A===g.lastChild&&A.nodeType===3){A.nodeValue=w;return}}g.textContent=w}var he={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fe=["Webkit","ms","Moz","O"];Object.keys(he).forEach(function(g){fe.forEach(function(w){w=w+g.charAt(0).toUpperCase()+g.substring(1),he[w]=he[g]})});function ye(g,w,A){return w==null||typeof w=="boolean"||w===""?"":A||typeof w!="number"||w===0||he.hasOwnProperty(g)&&he[g]?(""+w).trim():w+"px"}function nt(g,w){g=g.style;for(var A in w)if(w.hasOwnProperty(A)){var F=A.indexOf("--")===0,K=ye(A,w[A],F);A==="float"&&(A="cssFloat"),F?g.setProperty(A,K):g[A]=K}}var vt=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Nt(g,w){if(w){if(vt[g]&&(w.children!=null||w.dangerouslySetInnerHTML!=null))throw Error(n(137,g));if(w.dangerouslySetInnerHTML!=null){if(w.children!=null)throw Error(n(60));if(typeof w.dangerouslySetInnerHTML!="object"||!("__html"in w.dangerouslySetInnerHTML))throw Error(n(61))}if(w.style!=null&&typeof w.style!="object")throw Error(n(62))}}function mn(g,w){if(g.indexOf("-")===-1)return typeof w.is=="string";switch(g){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 At=null;function En(g){return g=g.target||g.srcElement||window,g.correspondingUseElement&&(g=g.correspondingUseElement),g.nodeType===3?g.parentNode:g}var yr=null,xn=null,kt=null;function Ie(g){if(g=kw(g)){if(typeof yr!="function")throw Error(n(280));var w=g.stateNode;w&&(w=Fx(w),yr(g.stateNode,g.type,w))}}function It(g){xn?kt?kt.push(g):kt=[g]:xn=g}function rt(){if(xn){var g=xn,w=kt;if(kt=xn=null,Ie(g),w)for(g=0;g<w.length;g++)Ie(w[g])}}function Zt(g,w){return g(w)}function yt(){}var pt=!1;function St(g,w,A){if(pt)return g(w,A);pt=!0;try{return Zt(g,w,A)}finally{pt=!1,(xn!==null||kt!==null)&&(yt(),rt())}}function qe(g,w){var A=g.stateNode;if(A===null)return null;var F=Fx(A);if(F===null)return null;A=F[w];e:switch(w){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(F=!F.disabled)||(g=g.type,F=!(g==="button"||g==="input"||g==="select"||g==="textarea")),g=!F;break e;default:g=!1}if(g)return null;if(A&&typeof A!="function")throw Error(n(231,w,typeof A));return A}var Et=!1;if(a)try{var Ze={};Object.defineProperty(Ze,"passive",{get:function(){Et=!0}}),window.addEventListener("test",Ze,Ze),window.removeEventListener("test",Ze,Ze)}catch{Et=!1}function wt(g,w,A,F,K,Q,re,ge,Se){var Fe=Array.prototype.slice.call(arguments,3);try{w.apply(A,Fe)}catch(ut){this.onError(ut)}}var ot=!1,qt=null,mt=!1,Bt=null,un={onError:function(g){ot=!0,qt=g}};function Ve(g,w,A,F,K,Q,re,ge,Se){ot=!1,qt=null,wt.apply(un,arguments)}function st(g,w,A,F,K,Q,re,ge,Se){if(Ve.apply(this,arguments),ot){if(ot){var Fe=qt;ot=!1,qt=null}else throw Error(n(198));mt||(mt=!0,Bt=Fe)}}function X(g){var w=g,A=g;if(g.alternate)for(;w.return;)w=w.return;else{g=w;do w=g,(w.flags&4098)!==0&&(A=w.return),g=w.return;while(g)}return w.tag===3?A:null}function ee(g){if(g.tag===13){var w=g.memoizedState;if(w===null&&(g=g.alternate,g!==null&&(w=g.memoizedState)),w!==null)return w.dehydrated}return null}function ie(g){if(X(g)!==g)throw Error(n(188))}function ce(g){var w=g.alternate;if(!w){if(w=X(g),w===null)throw Error(n(188));return w!==g?null:g}for(var A=g,F=w;;){var K=A.return;if(K===null)break;var Q=K.alternate;if(Q===null){if(F=K.return,F!==null){A=F;continue}break}if(K.child===Q.child){for(Q=K.child;Q;){if(Q===A)return ie(K),g;if(Q===F)return ie(K),w;Q=Q.sibling}throw Error(n(188))}if(A.return!==F.return)A=K,F=Q;else{for(var re=!1,ge=K.child;ge;){if(ge===A){re=!0,A=K,F=Q;break}if(ge===F){re=!0,F=K,A=Q;break}ge=ge.sibling}if(!re){for(ge=Q.child;ge;){if(ge===A){re=!0,A=Q,F=K;break}if(ge===F){re=!0,F=Q,A=K;break}ge=ge.sibling}if(!re)throw Error(n(189))}}if(A.alternate!==F)throw Error(n(190))}if(A.tag!==3)throw Error(n(188));return A.stateNode.current===A?g:w}function le(g){return g=ce(g),g!==null?_e(g):null}function _e(g){if(g.tag===5||g.tag===6)return g;for(g=g.child;g!==null;){var w=_e(g);if(w!==null)return w;g=g.sibling}return null}var me=e.unstable_scheduleCallback,we=e.unstable_cancelCallback,Te=e.unstable_shouldYield,Ct=e.unstable_requestPaint,at=e.unstable_now,Gt=e.unstable_getCurrentPriorityLevel,Dt=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,kn=e.unstable_NormalPriority,Cn=e.unstable_LowPriority,Hn=e.unstable_IdlePriority,xr=null,hr=null;function Er(g){if(hr&&typeof hr.onCommitFiberRoot=="function")try{hr.onCommitFiberRoot(xr,g,void 0,(g.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:BS,ti=Math.log,yo=Math.LN2;function BS(g){return g>>>=0,g===0?32:31-(ti(g)/yo|0)|0}var lg=64,ug=4194304;function Ip(g){switch(g&-g){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return g&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return g&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return g}}function dg(g,w){var A=g.pendingLanes;if(A===0)return 0;var F=0,K=g.suspendedLanes,Q=g.pingedLanes,re=A&268435455;if(re!==0){var ge=re&~K;ge!==0?F=Ip(ge):(Q&=re,Q!==0&&(F=Ip(Q)))}else re=A&~K,re!==0?F=Ip(re):Q!==0&&(F=Ip(Q));if(F===0)return 0;if(w!==0&&w!==F&&(w&K)===0&&(K=F&-F,Q=w&-w,K>=Q||K===16&&(Q&4194240)!==0))return w;if((F&4)!==0&&(F|=A&16),w=g.entangledLanes,w!==0)for(g=g.entanglements,w&=F;0<w;)A=31-Fn(w),K=1<<A,F|=g[A],w&=~K;return F}function FS(g,w){switch(g){case 1:case 2:case 4:return w+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return w+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function US(g,w){for(var A=g.suspendedLanes,F=g.pingedLanes,K=g.expirationTimes,Q=g.pendingLanes;0<Q;){var re=31-Fn(Q),ge=1<<re,Se=K[re];Se===-1?((ge&A)===0||(ge&F)!==0)&&(K[re]=FS(ge,w)):Se<=w&&(g.expiredLanes|=ge),Q&=~ge}}function lw(g){return g=g.pendingLanes&-1073741825,g!==0?g:g&1073741824?1073741824:0}function bx(){var g=lg;return lg<<=1,(lg&4194240)===0&&(lg=64),g}function uw(g){for(var w=[],A=0;31>A;A++)w.push(g);return w}function Tp(g,w,A){g.pendingLanes|=w,w!==536870912&&(g.suspendedLanes=0,g.pingedLanes=0),g=g.eventTimes,w=31-Fn(w),g[w]=A}function zS(g,w){var A=g.pendingLanes&~w;g.pendingLanes=w,g.suspendedLanes=0,g.pingedLanes=0,g.expiredLanes&=w,g.mutableReadLanes&=w,g.entangledLanes&=w,w=g.entanglements;var F=g.eventTimes;for(g=g.expirationTimes;0<A;){var K=31-Fn(A),Q=1<<K;w[K]=0,F[K]=-1,g[K]=-1,A&=~Q}}function dw(g,w){var A=g.entangledLanes|=w;for(g=g.entanglements;A;){var F=31-Fn(A),K=1<<F;K&w|g[F]&w&&(g[F]|=w),A&=~K}}var ir=0;function xx(g){return g&=-g,1<g?4<g?(g&268435455)!==0?16:536870912:4:1}var Ex,hw,Cx,_x,Sx,fw=!1,hg=[],Rl=null,Ml=null,Ol=null,Pp=new Map,Rp=new Map,jl=[],WS="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 submit".split(" ");function Ax(g,w){switch(g){case"focusin":case"focusout":Rl=null;break;case"dragenter":case"dragleave":Ml=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":Pp.delete(w.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rp.delete(w.pointerId)}}function Mp(g,w,A,F,K,Q){return g===null||g.nativeEvent!==Q?(g={blockedOn:w,domEventName:A,eventSystemFlags:F,nativeEvent:Q,targetContainers:[K]},w!==null&&(w=kw(w),w!==null&&hw(w)),g):(g.eventSystemFlags|=F,w=g.targetContainers,K!==null&&w.indexOf(K)===-1&&w.push(K),g)}function kx(g,w,A,F,K){switch(w){case"focusin":return Rl=Mp(Rl,g,w,A,F,K),!0;case"dragenter":return Ml=Mp(Ml,g,w,A,F,K),!0;case"mouseover":return Ol=Mp(Ol,g,w,A,F,K),!0;case"pointerover":var Q=K.pointerId;return Pp.set(Q,Mp(Pp.get(Q)||null,g,w,A,F,K)),!0;case"gotpointercapture":return Q=K.pointerId,Rp.set(Q,Mp(Rp.get(Q)||null,g,w,A,F,K)),!0}return!1}function $x(g){var w=Op(g.target);if(w!==null){var A=X(w);if(A!==null){if(w=A.tag,w===13){if(w=ee(A),w!==null){g.blockedOn=w,Sx(g.priority,function(){Cx(A)});return}}else if(w===3&&A.stateNode.current.memoizedState.isDehydrated){g.blockedOn=A.tag===3?A.stateNode.containerInfo:null;return}}}g.blockedOn=null}function Pe(g){if(g.blockedOn!==null)return!1;for(var w=g.targetContainers;0<w.length;){var A=gg(g.domEventName,g.eventSystemFlags,w[0],g.nativeEvent);if(A===null){A=g.nativeEvent;var F=new A.constructor(A.type,A);At=F,A.target.dispatchEvent(F),At=null}else return w=kw(A),w!==null&&hw(w),g.blockedOn=A,!1;w.shift()}return!0}function pe(g,w,A){Pe(g)&&A.delete(w)}function Ee(){fw=!1,Rl!==null&&Pe(Rl)&&(Rl=null),Ml!==null&&Pe(Ml)&&(Ml=null),Ol!==null&&Pe(Ol)&&(Ol=null),Pp.forEach(pe),Rp.forEach(pe)}function Ke(g,w){g.blockedOn===w&&(g.blockedOn=null,fw||(fw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Ee)))}function ct(g){function w(K){return Ke(K,g)}if(0<hg.length){Ke(hg[0],g);for(var A=1;A<hg.length;A++){var F=hg[A];F.blockedOn===g&&(F.blockedOn=null)}}for(Rl!==null&&Ke(Rl,g),Ml!==null&&Ke(Ml,g),Ol!==null&&Ke(Ol,g),Pp.forEach(w),Rp.forEach(w),A=0;A<jl.length;A++)F=jl[A],F.blockedOn===g&&(F.blockedOn=null);for(;0<jl.length&&(A=jl[0],A.blockedOn===null);)$x(A),A.blockedOn===null&&jl.shift()}var Tn=_.ReactCurrentBatchConfig,Rr=!0;function qs(g,w,A,F){var K=ir,Q=Tn.transition;Tn.transition=null;try{ir=1,pw(g,w,A,F)}finally{ir=K,Tn.transition=Q}}function fg(g,w,A,F){var K=ir,Q=Tn.transition;Tn.transition=null;try{ir=4,pw(g,w,A,F)}finally{ir=K,Tn.transition=Q}}function pw(g,w,A,F){if(Rr){var K=gg(g,w,A,F);if(K===null)sA(g,w,F,pg,A),Ax(g,F);else if(kx(K,g,w,A,F))F.stopPropagation();else if(Ax(g,F),w&4&&-1<WS.indexOf(g)){for(;K!==null;){var Q=kw(K);if(Q!==null&&Ex(Q),Q=gg(g,w,A,F),Q===null&&sA(g,w,F,pg,A),Q===K)break;K=Q}K!==null&&F.stopPropagation()}else sA(g,w,F,null,A)}}var pg=null;function gg(g,w,A,F){if(pg=null,g=En(F),g=Op(g),g!==null)if(w=X(g),w===null)g=null;else if(A=w.tag,A===13){if(g=ee(w),g!==null)return g;g=null}else if(A===3){if(w.stateNode.current.memoizedState.isDehydrated)return w.tag===3?w.stateNode.containerInfo:null;g=null}else w!==g&&(g=null);return pg=g,null}function gw(g){switch(g){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Gt()){case Dt:return 1;case zt:return 4;case kn:case Cn:return 16;case Hn:return 536870912;default:return 16}default:return 16}}var jc=null,mg=null,Ix=null;function qU(){if(Ix)return Ix;var g,w=mg,A=w.length,F,K="value"in jc?jc.value:jc.textContent,Q=K.length;for(g=0;g<A&&w[g]===K[g];g++);var re=A-g;for(F=1;F<=re&&w[A-F]===K[Q-F];F++);return Ix=K.slice(g,1<F?1-F:void 0)}function Tx(g){var w=g.keyCode;return"charCode"in g?(g=g.charCode,g===0&&w===13&&(g=13)):g=w,g===10&&(g=13),32<=g||g===13?g:0}function Px(){return!0}function KU(){return!1}function ba(g){function w(A,F,K,Q,re){this._reactName=A,this._targetInst=K,this.type=F,this.nativeEvent=Q,this.target=re,this.currentTarget=null;for(var ge in g)g.hasOwnProperty(ge)&&(A=g[ge],this[ge]=A?A(Q):Q[ge]);return this.isDefaultPrevented=(Q.defaultPrevented!=null?Q.defaultPrevented:Q.returnValue===!1)?Px:KU,this.isPropagationStopped=KU,this}return V(w.prototype,{preventDefault:function(){this.defaultPrevented=!0;var A=this.nativeEvent;A&&(A.preventDefault?A.preventDefault():typeof A.returnValue!="unknown"&&(A.returnValue=!1),this.isDefaultPrevented=Px)},stopPropagation:function(){var A=this.nativeEvent;A&&(A.stopPropagation?A.stopPropagation():typeof A.cancelBubble!="unknown"&&(A.cancelBubble=!0),this.isPropagationStopped=Px)},persist:function(){},isPersistent:Px}),w}var yg={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(g){return g.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},HS=ba(yg),mw=V({},yg,{view:0,detail:0}),S3e=ba(mw),VS,qS,yw,Rx=V({},mw,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:GS,button:0,buttons:0,relatedTarget:function(g){return g.relatedTarget===void 0?g.fromElement===g.srcElement?g.toElement:g.fromElement:g.relatedTarget},movementX:function(g){return"movementX"in g?g.movementX:(g!==yw&&(yw&&g.type==="mousemove"?(VS=g.screenX-yw.screenX,qS=g.screenY-yw.screenY):qS=VS=0,yw=g),VS)},movementY:function(g){return"movementY"in g?g.movementY:qS}}),GU=ba(Rx),A3e=V({},Rx,{dataTransfer:0}),k3e=ba(A3e),$3e=V({},mw,{relatedTarget:0}),KS=ba($3e),I3e=V({},yg,{animationName:0,elapsedTime:0,pseudoElement:0}),T3e=ba(I3e),P3e=V({},yg,{clipboardData:function(g){return"clipboardData"in g?g.clipboardData:window.clipboardData}}),R3e=ba(P3e),M3e=V({},yg,{data:0}),ZU=ba(M3e),O3e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j3e={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"},N3e={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D3e(g){var w=this.nativeEvent;return w.getModifierState?w.getModifierState(g):(g=N3e[g])?!!w[g]:!1}function GS(){return D3e}var L3e=V({},mw,{key:function(g){if(g.key){var w=O3e[g.key]||g.key;if(w!=="Unidentified")return w}return g.type==="keypress"?(g=Tx(g),g===13?"Enter":String.fromCharCode(g)):g.type==="keydown"||g.type==="keyup"?j3e[g.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:GS,charCode:function(g){return g.type==="keypress"?Tx(g):0},keyCode:function(g){return g.type==="keydown"||g.type==="keyup"?g.keyCode:0},which:function(g){return g.type==="keypress"?Tx(g):g.type==="keydown"||g.type==="keyup"?g.keyCode:0}}),B3e=ba(L3e),F3e=V({},Rx,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),YU=ba(F3e),U3e=V({},mw,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:GS}),z3e=ba(U3e),W3e=V({},yg,{propertyName:0,elapsedTime:0,pseudoElement:0}),H3e=ba(W3e),V3e=V({},Rx,{deltaX:function(g){return"deltaX"in g?g.deltaX:"wheelDeltaX"in g?-g.wheelDeltaX:0},deltaY:function(g){return"deltaY"in g?g.deltaY:"wheelDeltaY"in g?-g.wheelDeltaY:"wheelDelta"in g?-g.wheelDelta:0},deltaZ:0,deltaMode:0}),q3e=ba(V3e),K3e=[9,13,27,32],ZS=a&&"CompositionEvent"in window,ww=null;a&&"documentMode"in document&&(ww=document.documentMode);var G3e=a&&"TextEvent"in window&&!ww,QU=a&&(!ZS||ww&&8<ww&&11>=ww),XU=" ",JU=!1;function ez(g,w){switch(g){case"keyup":return K3e.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tz(g){return g=g.detail,typeof g=="object"&&"data"in g?g.data:null}var wg=!1;function Z3e(g,w){switch(g){case"compositionend":return tz(w);case"keypress":return w.which!==32?null:(JU=!0,XU);case"textInput":return g=w.data,g===XU&&JU?null:g;default:return null}}function Y3e(g,w){if(wg)return g==="compositionend"||!ZS&&ez(g,w)?(g=qU(),Ix=mg=jc=null,wg=!1,g):null;switch(g){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1<w.char.length)return w.char;if(w.which)return String.fromCharCode(w.which)}return null;case"compositionend":return QU&&w.locale!=="ko"?null:w.data;default:return null}}var Q3e={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 nz(g){var w=g&&g.nodeName&&g.nodeName.toLowerCase();return w==="input"?!!Q3e[g.type]:w==="textarea"}function rz(g,w,A,F){It(F),w=Dx(w,"onChange"),0<w.length&&(A=new HS("onChange","change",null,A,F),g.push({event:A,listeners:w}))}var vw=null,bw=null;function X3e(g){xz(g,0)}function Mx(g){var w=Cg(g);if($e(w))return g}function J3e(g,w){if(g==="change")return w}var iz=!1;if(a){var YS;if(a){var QS="oninput"in document;if(!QS){var sz=document.createElement("div");sz.setAttribute("oninput","return;"),QS=typeof sz.oninput=="function"}YS=QS}else YS=!1;iz=YS&&(!document.documentMode||9<document.documentMode)}function oz(){vw&&(vw.detachEvent("onpropertychange",az),bw=vw=null)}function az(g){if(g.propertyName==="value"&&Mx(bw)){var w=[];rz(w,bw,g,En(g)),St(X3e,w)}}function e5e(g,w,A){g==="focusin"?(oz(),vw=w,bw=A,vw.attachEvent("onpropertychange",az)):g==="focusout"&&oz()}function t5e(g){if(g==="selectionchange"||g==="keyup"||g==="keydown")return Mx(bw)}function n5e(g,w){if(g==="click")return Mx(w)}function r5e(g,w){if(g==="input"||g==="change")return Mx(w)}function i5e(g,w){return g===w&&(g!==0||1/g===1/w)||g!==g&&w!==w}var Nc=typeof Object.is=="function"?Object.is:i5e;function xw(g,w){if(Nc(g,w))return!0;if(typeof g!="object"||g===null||typeof w!="object"||w===null)return!1;var A=Object.keys(g),F=Object.keys(w);if(A.length!==F.length)return!1;for(F=0;F<A.length;F++){var K=A[F];if(!c.call(w,K)||!Nc(g[K],w[K]))return!1}return!0}function cz(g){for(;g&&g.firstChild;)g=g.firstChild;return g}function lz(g,w){var A=cz(g);g=0;for(var F;A;){if(A.nodeType===3){if(F=g+A.textContent.length,g<=w&&F>=w)return{node:A,offset:w-g};g=F}e:{for(;A;){if(A.nextSibling){A=A.nextSibling;break e}A=A.parentNode}A=void 0}A=cz(A)}}function uz(g,w){return g&&w?g===w?!0:g&&g.nodeType===3?!1:w&&w.nodeType===3?uz(g,w.parentNode):"contains"in g?g.contains(w):g.compareDocumentPosition?!!(g.compareDocumentPosition(w)&16):!1:!1}function dz(){for(var g=window,w=He();w instanceof g.HTMLIFrameElement;){try{var A=typeof w.contentWindow.location.href=="string"}catch{A=!1}if(A)g=w.contentWindow;else break;w=He(g.document)}return w}function XS(g){var w=g&&g.nodeName&&g.nodeName.toLowerCase();return w&&(w==="input"&&(g.type==="text"||g.type==="search"||g.type==="tel"||g.type==="url"||g.type==="password")||w==="textarea"||g.contentEditable==="true")}function s5e(g){var w=dz(),A=g.focusedElem,F=g.selectionRange;if(w!==A&&A&&A.ownerDocument&&uz(A.ownerDocument.documentElement,A)){if(F!==null&&XS(A)){if(w=F.start,g=F.end,g===void 0&&(g=w),"selectionStart"in A)A.selectionStart=w,A.selectionEnd=Math.min(g,A.value.length);else if(g=(w=A.ownerDocument||document)&&w.defaultView||window,g.getSelection){g=g.getSelection();var K=A.textContent.length,Q=Math.min(F.start,K);F=F.end===void 0?Q:Math.min(F.end,K),!g.extend&&Q>F&&(K=F,F=Q,Q=K),K=lz(A,Q);var re=lz(A,F);K&&re&&(g.rangeCount!==1||g.anchorNode!==K.node||g.anchorOffset!==K.offset||g.focusNode!==re.node||g.focusOffset!==re.offset)&&(w=w.createRange(),w.setStart(K.node,K.offset),g.removeAllRanges(),Q>F?(g.addRange(w),g.extend(re.node,re.offset)):(w.setEnd(re.node,re.offset),g.addRange(w)))}}for(w=[],g=A;g=g.parentNode;)g.nodeType===1&&w.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<w.length;A++)g=w[A],g.element.scrollLeft=g.left,g.element.scrollTop=g.top}}var o5e=a&&"documentMode"in document&&11>=document.documentMode,vg=null,JS=null,Ew=null,eA=!1;function hz(g,w,A){var F=A.window===A?A.document:A.nodeType===9?A:A.ownerDocument;eA||vg==null||vg!==He(F)||(F=vg,"selectionStart"in F&&XS(F)?F={start:F.selectionStart,end:F.selectionEnd}:(F=(F.ownerDocument&&F.ownerDocument.defaultView||window).getSelection(),F={anchorNode:F.anchorNode,anchorOffset:F.anchorOffset,focusNode:F.focusNode,focusOffset:F.focusOffset}),Ew&&xw(Ew,F)||(Ew=F,F=Dx(JS,"onSelect"),0<F.length&&(w=new HS("onSelect","select",null,w,A),g.push({event:w,listeners:F}),w.target=vg)))}function Ox(g,w){var A={};return A[g.toLowerCase()]=w.toLowerCase(),A["Webkit"+g]="webkit"+w,A["Moz"+g]="moz"+w,A}var bg={animationend:Ox("Animation","AnimationEnd"),animationiteration:Ox("Animation","AnimationIteration"),animationstart:Ox("Animation","AnimationStart"),transitionend:Ox("Transition","TransitionEnd")},tA={},fz={};a&&(fz=document.createElement("div").style,"AnimationEvent"in window||(delete bg.animationend.animation,delete bg.animationiteration.animation,delete bg.animationstart.animation),"TransitionEvent"in window||delete bg.transitionend.transition);function jx(g){if(tA[g])return tA[g];if(!bg[g])return g;var w=bg[g],A;for(A in w)if(w.hasOwnProperty(A)&&A in fz)return tA[g]=w[A];return g}var pz=jx("animationend"),gz=jx("animationiteration"),mz=jx("animationstart"),yz=jx("transitionend"),wz=new Map,vz="abort auxClick 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(" ");function $h(g,w){wz.set(g,w),s(w,[g])}for(var nA=0;nA<vz.length;nA++){var rA=vz[nA],a5e=rA.toLowerCase(),c5e=rA[0].toUpperCase()+rA.slice(1);$h(a5e,"on"+c5e)}$h(pz,"onAnimationEnd"),$h(gz,"onAnimationIteration"),$h(mz,"onAnimationStart"),$h("dblclick","onDoubleClick"),$h("focusin","onFocus"),$h("focusout","onBlur"),$h(yz,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cw="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(" "),l5e=new Set("cancel close invalid load scroll toggle".split(" ").concat(Cw));function bz(g,w,A){var F=g.type||"unknown-event";g.currentTarget=A,st(F,w,void 0,g),g.currentTarget=null}function xz(g,w){w=(w&4)!==0;for(var A=0;A<g.length;A++){var F=g[A],K=F.event;F=F.listeners;e:{var Q=void 0;if(w)for(var re=F.length-1;0<=re;re--){var ge=F[re],Se=ge.instance,Fe=ge.currentTarget;if(ge=ge.listener,Se!==Q&&K.isPropagationStopped())break e;bz(K,ge,Fe),Q=Se}else for(re=0;re<F.length;re++){if(ge=F[re],Se=ge.instance,Fe=ge.currentTarget,ge=ge.listener,Se!==Q&&K.isPropagationStopped())break e;bz(K,ge,Fe),Q=Se}}}if(mt)throw g=Bt,mt=!1,Bt=null,g}function Mr(g,w){var A=w[dA];A===void 0&&(A=w[dA]=new Set);var F=g+"__bubble";A.has(F)||(Ez(w,g,2,!1),A.add(F))}function iA(g,w,A){var F=0;w&&(F|=4),Ez(A,g,F,w)}var Nx="_reactListening"+Math.random().toString(36).slice(2);function _w(g){if(!g[Nx]){g[Nx]=!0,r.forEach(function(A){A!=="selectionchange"&&(l5e.has(A)||iA(A,!1,g),iA(A,!0,g))});var w=g.nodeType===9?g:g.ownerDocument;w===null||w[Nx]||(w[Nx]=!0,iA("selectionchange",!1,w))}}function Ez(g,w,A,F){switch(gw(w)){case 1:var K=qs;break;case 4:K=fg;break;default:K=pw}A=K.bind(null,w,A,g),K=void 0,!Et||w!=="touchstart"&&w!=="touchmove"&&w!=="wheel"||(K=!0),F?K!==void 0?g.addEventListener(w,A,{capture:!0,passive:K}):g.addEventListener(w,A,!0):K!==void 0?g.addEventListener(w,A,{passive:K}):g.addEventListener(w,A,!1)}function sA(g,w,A,F,K){var Q=F;if((w&1)===0&&(w&2)===0&&F!==null)e:for(;;){if(F===null)return;var re=F.tag;if(re===3||re===4){var ge=F.stateNode.containerInfo;if(ge===K||ge.nodeType===8&&ge.parentNode===K)break;if(re===4)for(re=F.return;re!==null;){var Se=re.tag;if((Se===3||Se===4)&&(Se=re.stateNode.containerInfo,Se===K||Se.nodeType===8&&Se.parentNode===K))return;re=re.return}for(;ge!==null;){if(re=Op(ge),re===null)return;if(Se=re.tag,Se===5||Se===6){F=Q=re;continue e}ge=ge.parentNode}}F=F.return}St(function(){var Fe=Q,ut=En(A),gt=[];e:{var lt=wz.get(g);if(lt!==void 0){var Kt=HS,Jt=g;switch(g){case"keypress":if(Tx(A)===0)break e;case"keydown":case"keyup":Kt=B3e;break;case"focusin":Jt="focus",Kt=KS;break;case"focusout":Jt="blur",Kt=KS;break;case"beforeblur":case"afterblur":Kt=KS;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":Kt=GU;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Kt=k3e;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Kt=z3e;break;case pz:case gz:case mz:Kt=T3e;break;case yz:Kt=H3e;break;case"scroll":Kt=S3e;break;case"wheel":Kt=q3e;break;case"copy":case"cut":case"paste":Kt=R3e;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Kt=YU}var nn=(w&4)!==0,xi=!nn&&g==="scroll",Re=nn?lt!==null?lt+"Capture":null:lt;nn=[];for(var Ae=Fe,Oe;Ae!==null;){Oe=Ae;var bt=Oe.stateNode;if(Oe.tag===5&&bt!==null&&(Oe=bt,Re!==null&&(bt=qe(Ae,Re),bt!=null&&nn.push(Sw(Ae,bt,Oe)))),xi)break;Ae=Ae.return}0<nn.length&&(lt=new Kt(lt,Jt,null,A,ut),gt.push({event:lt,listeners:nn}))}}if((w&7)===0){e:{if(lt=g==="mouseover"||g==="pointerover",Kt=g==="mouseout"||g==="pointerout",lt&&A!==At&&(Jt=A.relatedTarget||A.fromElement)&&(Op(Jt)||Jt[Hu]))break e;if((Kt||lt)&&(lt=ut.window===ut?ut:(lt=ut.ownerDocument)?lt.defaultView||lt.parentWindow:window,Kt?(Jt=A.relatedTarget||A.toElement,Kt=Fe,Jt=Jt?Op(Jt):null,Jt!==null&&(xi=X(Jt),Jt!==xi||Jt.tag!==5&&Jt.tag!==6)&&(Jt=null)):(Kt=null,Jt=Fe),Kt!==Jt)){if(nn=GU,bt="onMouseLeave",Re="onMouseEnter",Ae="mouse",(g==="pointerout"||g==="pointerover")&&(nn=YU,bt="onPointerLeave",Re="onPointerEnter",Ae="pointer"),xi=Kt==null?lt:Cg(Kt),Oe=Jt==null?lt:Cg(Jt),lt=new nn(bt,Ae+"leave",Kt,A,ut),lt.target=xi,lt.relatedTarget=Oe,bt=null,Op(ut)===Fe&&(nn=new nn(Re,Ae+"enter",Jt,A,ut),nn.target=Oe,nn.relatedTarget=xi,bt=nn),xi=bt,Kt&&Jt)t:{for(nn=Kt,Re=Jt,Ae=0,Oe=nn;Oe;Oe=xg(Oe))Ae++;for(Oe=0,bt=Re;bt;bt=xg(bt))Oe++;for(;0<Ae-Oe;)nn=xg(nn),Ae--;for(;0<Oe-Ae;)Re=xg(Re),Oe--;for(;Ae--;){if(nn===Re||Re!==null&&nn===Re.alternate)break t;nn=xg(nn),Re=xg(Re)}nn=null}else nn=null;Kt!==null&&Cz(gt,lt,Kt,nn,!1),Jt!==null&&xi!==null&&Cz(gt,xi,Jt,nn,!0)}}e:{if(lt=Fe?Cg(Fe):window,Kt=lt.nodeName&<.nodeName.toLowerCase(),Kt==="select"||Kt==="input"&<.type==="file")var rn=J3e;else if(nz(lt))if(iz)rn=r5e;else{rn=t5e;var pn=e5e}else(Kt=lt.nodeName)&&Kt.toLowerCase()==="input"&&(lt.type==="checkbox"||lt.type==="radio")&&(rn=n5e);if(rn&&(rn=rn(g,Fe))){rz(gt,rn,A,ut);break e}pn&&pn(g,lt,Fe),g==="focusout"&&(pn=lt._wrapperState)&&pn.controlled&<.type==="number"&&be(lt,"number",lt.value)}switch(pn=Fe?Cg(Fe):window,g){case"focusin":(nz(pn)||pn.contentEditable==="true")&&(vg=pn,JS=Fe,Ew=null);break;case"focusout":Ew=JS=vg=null;break;case"mousedown":eA=!0;break;case"contextmenu":case"mouseup":case"dragend":eA=!1,hz(gt,A,ut);break;case"selectionchange":if(o5e)break;case"keydown":case"keyup":hz(gt,A,ut)}var gn;if(ZS)e:{switch(g){case"compositionstart":var Sn="onCompositionStart";break e;case"compositionend":Sn="onCompositionEnd";break e;case"compositionupdate":Sn="onCompositionUpdate";break e}Sn=void 0}else wg?ez(g,A)&&(Sn="onCompositionEnd"):g==="keydown"&&A.keyCode===229&&(Sn="onCompositionStart");Sn&&(QU&&A.locale!=="ko"&&(wg||Sn!=="onCompositionStart"?Sn==="onCompositionEnd"&&wg&&(gn=qU()):(jc=ut,mg="value"in jc?jc.value:jc.textContent,wg=!0)),pn=Dx(Fe,Sn),0<pn.length&&(Sn=new ZU(Sn,g,null,A,ut),gt.push({event:Sn,listeners:pn}),gn?Sn.data=gn:(gn=tz(A),gn!==null&&(Sn.data=gn)))),(gn=G3e?Z3e(g,A):Y3e(g,A))&&(Fe=Dx(Fe,"onBeforeInput"),0<Fe.length&&(ut=new ZU("onBeforeInput","beforeinput",null,A,ut),gt.push({event:ut,listeners:Fe}),ut.data=gn))}xz(gt,w)})}function Sw(g,w,A){return{instance:g,listener:w,currentTarget:A}}function Dx(g,w){for(var A=w+"Capture",F=[];g!==null;){var K=g,Q=K.stateNode;K.tag===5&&Q!==null&&(K=Q,Q=qe(g,A),Q!=null&&F.unshift(Sw(g,Q,K)),Q=qe(g,w),Q!=null&&F.push(Sw(g,Q,K))),g=g.return}return F}function xg(g){if(g===null)return null;do g=g.return;while(g&&g.tag!==5);return g||null}function Cz(g,w,A,F,K){for(var Q=w._reactName,re=[];A!==null&&A!==F;){var ge=A,Se=ge.alternate,Fe=ge.stateNode;if(Se!==null&&Se===F)break;
vendor: 9,067 bytes, lines 54-55
54ge.tag===5&&Fe!==null&&(ge=Fe,K?(Se=qe(A,Q),Se!=null&&re.unshift(Sw(A,Se,ge))):K||(Se=qe(A,Q),Se!=null&&re.push(Sw(A,Se,ge)))),A=A.return}re.length!==0&&g.push({event:w,listeners:re})}var u5e=/\r\n?/g,d5e=/\u0000|\uFFFD/g;function _z(g){return(typeof g=="string"?g:""+g).replace(u5e,` 55`).replace(d5e,"")}function Lx(g,w,A){if(w=_z(w),_z(g)!==w&&A)throw Error(n(425))}function Bx(){}var oA=null,aA=null;function cA(g,w){return g==="textarea"||g==="noscript"||typeof w.children=="string"||typeof w.children=="number"||typeof w.dangerouslySetInnerHTML=="object"&&w.dangerouslySetInnerHTML!==null&&w.dangerouslySetInnerHTML.__html!=null}var lA=typeof setTimeout=="function"?setTimeout:void 0,h5e=typeof clearTimeout=="function"?clearTimeout:void 0,Sz=typeof Promise=="function"?Promise:void 0,f5e=typeof queueMicrotask=="function"?queueMicrotask:typeof Sz<"u"?function(g){return Sz.resolve(null).then(g).catch(p5e)}:lA;function p5e(g){setTimeout(function(){throw g})}function uA(g,w){var A=w,F=0;do{var K=A.nextSibling;if(g.removeChild(A),K&&K.nodeType===8)if(A=K.data,A==="/$"){if(F===0){g.removeChild(K),ct(w);return}F--}else A!=="$"&&A!=="$?"&&A!=="$!"||F++;A=K}while(A);ct(w)}function Ih(g){for(;g!=null;g=g.nextSibling){var w=g.nodeType;if(w===1||w===3)break;if(w===8){if(w=g.data,w==="$"||w==="$!"||w==="$?")break;if(w==="/$")return null}}return g}function Az(g){g=g.previousSibling;for(var w=0;g;){if(g.nodeType===8){var A=g.data;if(A==="$"||A==="$!"||A==="$?"){if(w===0)return g;w--}else A==="/$"&&w++}g=g.previousSibling}return null}var Eg=Math.random().toString(36).slice(2),Nl="__reactFiber$"+Eg,Aw="__reactProps$"+Eg,Hu="__reactContainer$"+Eg,dA="__reactEvents$"+Eg,g5e="__reactListeners$"+Eg,m5e="__reactHandles$"+Eg;function Op(g){var w=g[Nl];if(w)return w;for(var A=g.parentNode;A;){if(w=A[Hu]||A[Nl]){if(A=w.alternate,w.child!==null||A!==null&&A.child!==null)for(g=Az(g);g!==null;){if(A=g[Nl])return A;g=Az(g)}return w}g=A,A=g.parentNode}return null}function kw(g){return g=g[Nl]||g[Hu],!g||g.tag!==5&&g.tag!==6&&g.tag!==13&&g.tag!==3?null:g}function Cg(g){if(g.tag===5||g.tag===6)return g.stateNode;throw Error(n(33))}function Fx(g){return g[Aw]||null}var hA=[],_g=-1;function Th(g){return{current:g}}function Or(g){0>_g||(g.current=hA[_g],hA[_g]=null,_g--)}function kr(g,w){_g++,hA[_g]=g.current,g.current=w}var Ph={},Ks=Th(Ph),Do=Th(!1),jp=Ph;function Sg(g,w){var A=g.type.contextTypes;if(!A)return Ph;var F=g.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===w)return F.__reactInternalMemoizedMaskedChildContext;var K={},Q;for(Q in A)K[Q]=w[Q];return F&&(g=g.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=w,g.__reactInternalMemoizedMaskedChildContext=K),K}function Lo(g){return g=g.childContextTypes,g!=null}function Ux(){Or(Do),Or(Ks)}function kz(g,w,A){if(Ks.current!==Ph)throw Error(n(168));kr(Ks,w),kr(Do,A)}function $z(g,w,A){var F=g.stateNode;if(w=w.childContextTypes,typeof F.getChildContext!="function")return A;F=F.getChildContext();for(var K in F)if(!(K in w))throw Error(n(108,ae(g)||"Unknown",K));return V({},A,F)}function zx(g){return g=(g=g.stateNode)&&g.__reactInternalMemoizedMergedChildContext||Ph,jp=Ks.current,kr(Ks,g),kr(Do,Do.current),!0}function Iz(g,w,A){var F=g.stateNode;if(!F)throw Error(n(169));A?(g=$z(g,w,jp),F.__reactInternalMemoizedMergedChildContext=g,Or(Do),Or(Ks),kr(Ks,g)):Or(Do),kr(Do,A)}var Vu=null,Wx=!1,fA=!1;function Tz(g){Vu===null?Vu=[g]:Vu.push(g)}function y5e(g){Wx=!0,Tz(g)}function Rh(){if(!fA&&Vu!==null){fA=!0;var g=0,w=ir;try{var A=Vu;for(ir=1;g<A.length;g++){var F=A[g];do F=F(!0);while(F!==null)}Vu=null,Wx=!1}catch(K){throw Vu!==null&&(Vu=Vu.slice(g+1)),me(Dt,Rh),K}finally{ir=w,fA=!1}}return null}var Ag=[],kg=0,Hx=null,Vx=0,Ha=[],Va=0,Np=null,qu=1,Ku="";function Dp(g,w){Ag[kg++]=Vx,Ag[kg++]=Hx,Hx=g,Vx=w}function Pz(g,w,A){Ha[Va++]=qu,Ha[Va++]=Ku,Ha[Va++]=Np,Np=g;var F=qu;g=Ku;var K=32-Fn(F)-1;F&=~(1<<K),A+=1;var Q=32-Fn(w)+K;if(30<Q){var re=K-K%5;Q=(F&(1<<re)-1).toString(32),F>>=re,K-=re,qu=1<<32-Fn(w)+K|A<<K|F,Ku=Q+g}else qu=1<<Q|A<<K|F,Ku=g}function pA(g){g.return!==null&&(Dp(g,1),Pz(g,1,0))}function gA(g){for(;g===Hx;)Hx=Ag[--kg],Ag[kg]=null,Vx=Ag[--kg],Ag[kg]=null;for(;g===Np;)Np=Ha[--Va],Ha[Va]=null,Ku=Ha[--Va],Ha[Va]=null,qu=Ha[--Va],Ha[Va]=null}var xa=null,Ea=null,qr=!1,Dc=null;function Rz(g,w){var A=Za(5,null,null,0);A.elementType="DELETED",A.stateNode=w,A.return=g,w=g.deletions,w===null?(g.deletions=[A],g.flags|=16):w.push(A)}function Mz(g,w){switch(g.tag){case 5:var A=g.type;return w=w.nodeType!==1||A.toLowerCase()!==w.nodeName.toLowerCase()?null:w,w!==null?(g.stateNode=w,xa=g,Ea=Ih(w.firstChild),!0):!1;case 6:return w=g.pendingProps===""||w.nodeType!==3?null:w,w!==null?(g.stateNode=w,xa=g,Ea=null,!0):!1;case 13:return w=w.nodeType!==8?null:w,w!==null?(A=Np!==null?{id:qu,overflow:Ku}:null,g.memoizedState={dehydrated:w,treeContext:A,retryLane:1073741824},A=Za(18,null,null,0),A.stateNode=w,A.return=g,g.child=A,xa=g,Ea=null,!0):!1;default:return!1}}function mA(g){return(g.mode&1)!==0&&(g.flags&128)===0}function yA(g){if(qr){var w=Ea;if(w){var A=w;if(!Mz(g,w)){if(mA(g))throw Error(n(418));w=Ih(A.nextSibling);var F=xa;w&&Mz(g,w)?Rz(F,A):(g.flags=g.flags&-4097|2,qr=!1,xa=g)}}else{if(mA(g))throw Error(n(418));g.flags=g.flags&-4097|2,qr=!1,xa=g}}}function Oz(g){for(g=g.return;g!==null&&g.tag!==5&&g.tag!==3&&g.tag!==13;)g=g.return;xa=g}function qx(g){if(g!==xa)return!1;if(!qr)return Oz(g),qr=!0,!1;var w;if((w=g.tag!==3)&&!(w=g.tag!==5)&&(w=g.type,w=w!=="head"&&w!=="body"&&!cA(g.type,g.memoizedProps)),w&&(w=Ea)){if(mA(g))throw jz(),Error(n(418));for(;w;)Rz(g,w),w=Ih(w.nextSibling)}if(Oz(g),g.tag===13){if(g=g.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(n(317));e:{for(g=g.nextSibling,w=0;g;){if(g.nodeType===8){var A=g.data;if(A==="/$"){if(w===0){Ea=Ih(g.nextSibling);break e}w--}else A!=="$"&&A!=="$!"&&A!=="$?"||w++}g=g.nextSibling}Ea=null}}else Ea=xa?Ih(g.stateNode.nextSibling):null;return!0}function jz(){for(var g=Ea;g;)g=Ih(g.nextSibling)}function $g(){Ea=xa=null,qr=!1}function wA(g){Dc===null?Dc=[g]:Dc.push(g)}var w5e=_.ReactCurrentBatchConfig;function $w(g,w,A){if(g=A.ref,g!==null&&typeof g!="function"&&typeof g!="object"){if(A._owner){if(A=A._owner,A){if(A.tag!==1)throw Error(n(309));var F=A.stateNode}if(!F)throw Error(n(147,g));var K=F,Q=""+g;return w!==null&&w.ref!==null&&typeof w.ref=="function"&&w.ref._stringRef===Q?w.ref:(w=function(re){var ge=K.refs;re===null?delete ge[Q]:ge[Q]=re},w._stringRef=Q,w)}if(typeof g!="string")throw Error(n(284));if(!A._owner)throw Error(n(290,g))}return g}function Kx(g,w){throw g=Object.prototype.toString.call(w),Error(n(31,g==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":g))}function Nz(g){var w=g._init;return w(g._payload)}function Dz(g){function w(Re,Ae){if(g){var Oe=Re.deletions;Oe===null?(Re.deletions=[Ae],Re.flags|=16):Oe.push(Ae)}}function A(Re,Ae){if(!g)return null;for(;Ae!==null;)w(Re,Ae),Ae=Ae.sibling;return null}function F(Re,Ae){for(Re=new Map;Ae!==null;)Ae.key!==null?Re.set(Ae.key,Ae):Re.set(Ae.index,Ae),Ae=Ae.sibling;return Re}function K(Re,Ae){return Re=Fh(Re,Ae),Re.index=0,Re.sibling=null,Re}function Q(Re,Ae,Oe){return Re.index=Oe,g?(Oe=Re.alternate,Oe!==null?(Oe=Oe.index,Oe<Ae?(Re.flags|=2,Ae):Oe):(Re.flags|=2,Ae)):(Re.flags|=1048576,Ae)}function re(Re){return g&&Re.alternate===null&&(Re.flags|=2),Re}function ge(Re,Ae,Oe,bt){return Ae===null||Ae.tag!==6?(Ae=lk(Oe,Re.mode,bt),Ae.return=Re,Ae):(Ae=K(Ae,Oe),Ae.return=Re,Ae)}function Se(Re,Ae,Oe,bt){var rn=Oe.type;return rn===R?ut(Re,Ae,Oe.props.children,bt,Oe.key):Ae!==null&&(Ae.elementType===rn||typeof rn=="object"&&rn!==null&&rn.$$typeof===M&&Nz(rn)===Ae.type)?(bt=K(Ae,Oe.props),bt.ref=$w(Re,Ae,Oe),bt.return=Re,bt):(bt=y4(Oe.type,Oe.key,Oe.props,null,Re.mode,bt),bt.ref=$w(Re,Ae,Oe),bt.return=Re,bt)}function Fe(Re,Ae,Oe,bt){return Ae===null||Ae.tag!==4||Ae.stateNode.containerInfo!==Oe.containerInfo||Ae.stateNode.implementation!==Oe.implementation?(Ae=uk(Oe,Re.mode,bt),Ae.return=Re,Ae):(Ae=K(Ae,Oe.children||[]),Ae.return=Re,Ae)}function ut(Re,Ae,Oe,bt,rn){return Ae===null||Ae.tag!==7?(Ae=Vp(Oe,Re.mode,bt,rn),Ae.return=Re,Ae):(Ae=K(Ae,Oe),Ae.return=Re,Ae)}function gt(Re,Ae,Oe){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number")return Ae=lk(""+Ae,Re.mode,Oe),Ae.return=Re,Ae;if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case $:return Oe=y4(Ae.type,Ae.key,Ae.props,null,Re.mode,Oe),Oe.ref=$w(Re,null,Ae),Oe.return=Re,Oe;case I:return Ae=uk(Ae,Re.mode,Oe),Ae.return=Re,Ae;case M:var bt=Ae._init;return gt(Re,bt(Ae._payload),Oe)}if(Lt(Ae)||D(Ae))return Ae=Vp(Ae,Re.mode,Oe,null),Ae.return=Re,Ae;Kx(Re,Ae)}return null}function lt(Re,Ae,Oe,bt){var rn=Ae!==null?Ae.key:null;if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number")return rn!==null?null:ge(Re,Ae,""+Oe,bt);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case $:return Oe.key===rn?Se(Re,Ae,Oe,bt):null;case I:return Oe.key===rn?Fe(Re,Ae,Oe,bt):null;case M:return rn=Oe._init,lt(Re,Ae,rn(Oe._payload),bt)}if(Lt(Oe)||D(Oe))return rn!==null?null:ut(Re,Ae,Oe,bt,null);Kx(Re,Oe)}
vendor: 6,217 bytes, line 55
55return null}function Kt(Re,Ae,Oe,bt,rn){if(typeof bt=="string"&&bt!==""||typeof bt=="number")return Re=Re.get(Oe)||null,ge(Ae,Re,""+bt,rn);if(typeof bt=="object"&&bt!==null){switch(bt.$$typeof){case $:return Re=Re.get(bt.key===null?Oe:bt.key)||null,Se(Ae,Re,bt,rn);case I:return Re=Re.get(bt.key===null?Oe:bt.key)||null,Fe(Ae,Re,bt,rn);case M:var pn=bt._init;return Kt(Re,Ae,Oe,pn(bt._payload),rn)}if(Lt(bt)||D(bt))return Re=Re.get(Oe)||null,ut(Ae,Re,bt,rn,null);Kx(Ae,bt)}return null}function Jt(Re,Ae,Oe,bt){for(var rn=null,pn=null,gn=Ae,Sn=Ae=0,Ji=null;gn!==null&&Sn<Oe.length;Sn++){gn.index>Sn?(Ji=gn,gn=null):Ji=gn.sibling;var Jn=lt(Re,gn,Oe[Sn],bt);if(Jn===null){gn===null&&(gn=Ji);break}g&&gn&&Jn.alternate===null&&w(Re,gn),Ae=Q(Jn,Ae,Sn),pn===null?rn=Jn:pn.sibling=Jn,pn=Jn,gn=Ji}if(Sn===Oe.length)return A(Re,gn),qr&&Dp(Re,Sn),rn;if(gn===null){for(;Sn<Oe.length;Sn++)gn=gt(Re,Oe[Sn],bt),gn!==null&&(Ae=Q(gn,Ae,Sn),pn===null?rn=gn:pn.sibling=gn,pn=gn);return qr&&Dp(Re,Sn),rn}for(gn=F(Re,gn);Sn<Oe.length;Sn++)Ji=Kt(gn,Re,Sn,Oe[Sn],bt),Ji!==null&&(g&&Ji.alternate!==null&&gn.delete(Ji.key===null?Sn:Ji.key),Ae=Q(Ji,Ae,Sn),pn===null?rn=Ji:pn.sibling=Ji,pn=Ji);return g&&gn.forEach(function(Uh){return w(Re,Uh)}),qr&&Dp(Re,Sn),rn}function nn(Re,Ae,Oe,bt){var rn=D(Oe);if(typeof rn!="function")throw Error(n(150));if(Oe=rn.call(Oe),Oe==null)throw Error(n(151));for(var pn=rn=null,gn=Ae,Sn=Ae=0,Ji=null,Jn=Oe.next();gn!==null&&!Jn.done;Sn++,Jn=Oe.next()){gn.index>Sn?(Ji=gn,gn=null):Ji=gn.sibling;var Uh=lt(Re,gn,Jn.value,bt);if(Uh===null){gn===null&&(gn=Ji);break}g&&gn&&Uh.alternate===null&&w(Re,gn),Ae=Q(Uh,Ae,Sn),pn===null?rn=Uh:pn.sibling=Uh,pn=Uh,gn=Ji}if(Jn.done)return A(Re,gn),qr&&Dp(Re,Sn),rn;if(gn===null){for(;!Jn.done;Sn++,Jn=Oe.next())Jn=gt(Re,Jn.value,bt),Jn!==null&&(Ae=Q(Jn,Ae,Sn),pn===null?rn=Jn:pn.sibling=Jn,pn=Jn);return qr&&Dp(Re,Sn),rn}for(gn=F(Re,gn);!Jn.done;Sn++,Jn=Oe.next())Jn=Kt(gn,Re,Sn,Jn.value,bt),Jn!==null&&(g&&Jn.alternate!==null&&gn.delete(Jn.key===null?Sn:Jn.key),Ae=Q(Jn,Ae,Sn),pn===null?rn=Jn:pn.sibling=Jn,pn=Jn);return g&&gn.forEach(function(Q5e){return w(Re,Q5e)}),qr&&Dp(Re,Sn),rn}function xi(Re,Ae,Oe,bt){if(typeof Oe=="object"&&Oe!==null&&Oe.type===R&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case $:e:{for(var rn=Oe.key,pn=Ae;pn!==null;){if(pn.key===rn){if(rn=Oe.type,rn===R){if(pn.tag===7){A(Re,pn.sibling),Ae=K(pn,Oe.props.children),Ae.return=Re,Re=Ae;break e}}else if(pn.elementType===rn||typeof rn=="object"&&rn!==null&&rn.$$typeof===M&&Nz(rn)===pn.type){A(Re,pn.sibling),Ae=K(pn,Oe.props),Ae.ref=$w(Re,pn,Oe),Ae.return=Re,Re=Ae;break e}A(Re,pn);break}else w(Re,pn);pn=pn.sibling}Oe.type===R?(Ae=Vp(Oe.props.children,Re.mode,bt,Oe.key),Ae.return=Re,Re=Ae):(bt=y4(Oe.type,Oe.key,Oe.props,null,Re.mode,bt),bt.ref=$w(Re,Ae,Oe),bt.return=Re,Re=bt)}return re(Re);case I:e:{for(pn=Oe.key;Ae!==null;){if(Ae.key===pn)if(Ae.tag===4&&Ae.stateNode.containerInfo===Oe.containerInfo&&Ae.stateNode.implementation===Oe.implementation){A(Re,Ae.sibling),Ae=K(Ae,Oe.children||[]),Ae.return=Re,Re=Ae;break e}else{A(Re,Ae);break}else w(Re,Ae);Ae=Ae.sibling}Ae=uk(Oe,Re.mode,bt),Ae.return=Re,Re=Ae}return re(Re);case M:return pn=Oe._init,xi(Re,Ae,pn(Oe._payload),bt)}if(Lt(Oe))return Jt(Re,Ae,Oe,bt);if(D(Oe))return nn(Re,Ae,Oe,bt);Kx(Re,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"?(Oe=""+Oe,Ae!==null&&Ae.tag===6?(A(Re,Ae.sibling),Ae=K(Ae,Oe),Ae.return=Re,Re=Ae):(A(Re,Ae),Ae=lk(Oe,Re.mode,bt),Ae.return=Re,Re=Ae),re(Re)):A(Re,Ae)}return xi}var Ig=Dz(!0),Lz=Dz(!1),Gx=Th(null),Zx=null,Tg=null,vA=null;function bA(){vA=Tg=Zx=null}function xA(g){var w=Gx.current;Or(Gx),g._currentValue=w}function EA(g,w,A){for(;g!==null;){var F=g.alternate;if((g.childLanes&w)!==w?(g.childLanes|=w,F!==null&&(F.childLanes|=w)):F!==null&&(F.childLanes&w)!==w&&(F.childLanes|=w),g===A)break;g=g.return}}function Pg(g,w){Zx=g,vA=Tg=null,g=g.dependencies,g!==null&&g.firstContext!==null&&((g.lanes&w)!==0&&(Bo=!0),g.firstContext=null)}function qa(g){var w=g._currentValue;if(vA!==g)if(g={context:g,memoizedValue:w,next:null},Tg===null){if(Zx===null)throw Error(n(308));Tg=g,Zx.dependencies={lanes:0,firstContext:g}}else Tg=Tg.next=g;return w}var Lp=null;function CA(g){Lp===null?Lp=[g]:Lp.push(g)}function Bz(g,w,A,F){var K=w.interleaved;return K===null?(A.next=A,CA(w)):(A.next=K.next,K.next=A),w.interleaved=A,Gu(g,F)}function Gu(g,w){g.lanes|=w;var A=g.alternate;for(A!==null&&(A.lanes|=w),A=g,g=g.return;g!==null;)g.childLanes|=w,A=g.alternate,A!==null&&(A.childLanes|=w),A=g,g=g.return;return A.tag===3?A.stateNode:null}var Mh=!1;function _A(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fz(g,w){g=g.updateQueue,w.updateQueue===g&&(w.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,effects:g.effects})}function Zu(g,w){return{eventTime:g,lane:w,tag:0,payload:null,callback:null,next:null}}function Oh(g,w,A){var F=g.updateQueue;if(F===null)return null;if(F=F.shared,(Yn&2)!==0){var K=F.pending;return K===null?w.next=w:(w.next=K.next,K.next=w),F.pending=w,Gu(g,A)}return K=F.interleaved,K===null?(w.next=w,CA(F)):(w.next=K.next,K.next=w),F.interleaved=w,Gu(g,A)}function Yx(g,w,A){if(w=w.updateQueue,w!==null&&(w=w.shared,(A&4194240)!==0)){var F=w.lanes;F&=g.pendingLanes,A|=F,w.lanes=A,dw(g,A)}}function Uz(g,w){var A=g.updateQueue,F=g.alternate;if(F!==null&&(F=F.updateQueue,A===F)){var K=null,Q=null;if(A=A.firstBaseUpdate,A!==null){do{var re={eventTime:A.eventTime,lane:A.lane,tag:A.tag,payload:A.payload,callback:A.callback,next:null};Q===null?K=Q=re:Q=Q.next=re,A=A.next}while(A!==null);Q===null?K=Q=w:Q=Q.next=w}else K=Q=w;A={baseState:F.baseState,firstBaseUpdate:K,lastBaseUpdate:Q,shared:F.shared,effects:F.effects},g.updateQueue=A;return}g=A.lastBaseUpdate,g===null?A.firstBaseUpdate=w:g.next=w,A.lastBaseUpdate=w}function Qx(g,w,A,F){var K=g.updateQueue;Mh=!1;var Q=K.firstBaseUpdate,re=K.lastBaseUpdate,ge=K.shared.pending;if(ge!==null){K.shared.pending=null;var Se=ge,Fe=Se.next;Se.next=null,re===null?Q=Fe:re.next=Fe,re=Se;var ut=g.alternate;
vendor: 1,317 bytes, line 55
55ut!==null&&(ut=ut.updateQueue,ge=ut.lastBaseUpdate,ge!==re&&(ge===null?ut.firstBaseUpdate=Fe:ge.next=Fe,ut.lastBaseUpdate=Se))}if(Q!==null){var gt=K.baseState;re=0,ut=Fe=Se=null,ge=Q;do{var lt=ge.lane,Kt=ge.eventTime;if((F<)===lt){ut!==null&&(ut=ut.next={eventTime:Kt,lane:0,tag:ge.tag,payload:ge.payload,callback:ge.callback,next:null});e:{var Jt=g,nn=ge;switch(lt=w,Kt=A,nn.tag){case 1:if(Jt=nn.payload,typeof Jt=="function"){gt=Jt.call(Kt,gt,lt);break e}gt=Jt;break e;case 3:Jt.flags=Jt.flags&-65537|128;case 0:if(Jt=nn.payload,lt=typeof Jt=="function"?Jt.call(Kt,gt,lt):Jt,lt==null)break e;gt=V({},gt,lt);break e;case 2:Mh=!0}}ge.callback!==null&&ge.lane!==0&&(g.flags|=64,lt=K.effects,lt===null?K.effects=[ge]:lt.push(ge))}else Kt={eventTime:Kt,lane:lt,tag:ge.tag,payload:ge.payload,callback:ge.callback,next:null},ut===null?(Fe=ut=Kt,Se=gt):ut=ut.next=Kt,re|=lt;if(ge=ge.next,ge===null){if(ge=K.shared.pending,ge===null)break;lt=ge,ge=lt.next,lt.next=null,K.lastBaseUpdate=lt,K.shared.pending=null}}while(!0);if(ut===null&&(Se=gt),K.baseState=Se,K.firstBaseUpdate=Fe,K.lastBaseUpdate=ut,w=K.shared.interleaved,w!==null){K=w;do re|=K.lane,K=K.next;while(K!==w)}else Q===null&&(K.shared.lanes=0);Up|=re,g.lanes=re,g.memoizedState=gt}}function zz(g,w,A){if(g=w.effects,w.effects=null,g!==null)for(w=0;w<g.length;
vendor: 5,373 bytes, line 55
55w++){var F=g[w],K=F.callback;if(K!==null){if(F.callback=null,F=A,typeof K!="function")throw Error(n(191,K));K.call(F)}}}var Iw={},Dl=Th(Iw),Tw=Th(Iw),Pw=Th(Iw);function Bp(g){if(g===Iw)throw Error(n(174));return g}function SA(g,w){switch(kr(Pw,w),kr(Tw,g),kr(Dl,Iw),g=w.nodeType,g){case 9:case 11:w=(w=w.documentElement)?w.namespaceURI:J(null,"");break;default:g=g===8?w.parentNode:w,w=g.namespaceURI||null,g=g.tagName,w=J(w,g)}Or(Dl),kr(Dl,w)}function Rg(){Or(Dl),Or(Tw),Or(Pw)}function Wz(g){Bp(Pw.current);var w=Bp(Dl.current),A=J(w,g.type);w!==A&&(kr(Tw,g),kr(Dl,A))}function AA(g){Tw.current===g&&(Or(Dl),Or(Tw))}var ni=Th(0);function Xx(g){for(var w=g;w!==null;){if(w.tag===13){var A=w.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||A.data==="$?"||A.data==="$!"))return w}else if(w.tag===19&&w.memoizedProps.revealOrder!==void 0){if((w.flags&128)!==0)return w}else if(w.child!==null){w.child.return=w,w=w.child;continue}if(w===g)break;for(;w.sibling===null;){if(w.return===null||w.return===g)return null;w=w.return}w.sibling.return=w.return,w=w.sibling}return null}var kA=[];function $A(){for(var g=0;g<kA.length;g++)kA[g]._workInProgressVersionPrimary=null;kA.length=0}var Jx=_.ReactCurrentDispatcher,IA=_.ReactCurrentBatchConfig,Fp=0,ri=null,Hi=null,Qi=null,e4=!1,Rw=!1,Mw=0,v5e=0;function Gs(){throw Error(n(321))}function TA(g,w){if(w===null)return!1;for(var A=0;A<w.length&&A<g.length;A++)if(!Nc(g[A],w[A]))return!1;return!0}function PA(g,w,A,F,K,Q){if(Fp=Q,ri=w,w.memoizedState=null,w.updateQueue=null,w.lanes=0,Jx.current=g===null||g.memoizedState===null?C5e:_5e,g=A(F,K),Rw){Q=0;do{if(Rw=!1,Mw=0,25<=Q)throw Error(n(301));Q+=1,Qi=Hi=null,w.updateQueue=null,Jx.current=S5e,g=A(F,K)}while(Rw)}if(Jx.current=r4,w=Hi!==null&&Hi.next!==null,Fp=0,Qi=Hi=ri=null,e4=!1,w)throw Error(n(300));return g}function RA(){var g=Mw!==0;return Mw=0,g}function Ll(){var g={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qi===null?ri.memoizedState=Qi=g:Qi=Qi.next=g,Qi}function Ka(){if(Hi===null){var g=ri.alternate;g=g!==null?g.memoizedState:null}else g=Hi.next;var w=Qi===null?ri.memoizedState:Qi.next;if(w!==null)Qi=w,Hi=g;else{if(g===null)throw Error(n(310));Hi=g,g={memoizedState:Hi.memoizedState,baseState:Hi.baseState,baseQueue:Hi.baseQueue,queue:Hi.queue,next:null},Qi===null?ri.memoizedState=Qi=g:Qi=Qi.next=g}return Qi}function Ow(g,w){return typeof w=="function"?w(g):w}function MA(g){var w=Ka(),A=w.queue;if(A===null)throw Error(n(311));A.lastRenderedReducer=g;var F=Hi,K=F.baseQueue,Q=A.pending;if(Q!==null){if(K!==null){var re=K.next;K.next=Q.next,Q.next=re}F.baseQueue=K=Q,A.pending=null}if(K!==null){Q=K.next,F=F.baseState;var ge=re=null,Se=null,Fe=Q;do{var ut=Fe.lane;if((Fp&ut)===ut)Se!==null&&(Se=Se.next={lane:0,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null}),F=Fe.hasEagerState?Fe.eagerState:g(F,Fe.action);else{var gt={lane:ut,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null};Se===null?(ge=Se=gt,re=F):Se=Se.next=gt,ri.lanes|=ut,Up|=ut}Fe=Fe.next}while(Fe!==null&&Fe!==Q);Se===null?re=F:Se.next=ge,Nc(F,w.memoizedState)||(Bo=!0),w.memoizedState=F,w.baseState=re,w.baseQueue=Se,A.lastRenderedState=F}if(g=A.interleaved,g!==null){K=g;do Q=K.lane,ri.lanes|=Q,Up|=Q,K=K.next;while(K!==g)}else K===null&&(A.lanes=0);return[w.memoizedState,A.dispatch]}function OA(g){var w=Ka(),A=w.queue;if(A===null)throw Error(n(311));A.lastRenderedReducer=g;var F=A.dispatch,K=A.pending,Q=w.memoizedState;if(K!==null){A.pending=null;var re=K=K.next;do Q=g(Q,re.action),re=re.next;while(re!==K);Nc(Q,w.memoizedState)||(Bo=!0),w.memoizedState=Q,w.baseQueue===null&&(w.baseState=Q),A.lastRenderedState=Q}return[Q,F]}function Hz(){}function Vz(g,w){var A=ri,F=Ka(),K=w(),Q=!Nc(F.memoizedState,K);if(Q&&(F.memoizedState=K,Bo=!0),F=F.queue,jA(Gz.bind(null,A,F,g),[g]),F.getSnapshot!==w||Q||Qi!==null&&Qi.memoizedState.tag&1){if(A.flags|=2048,jw(9,Kz.bind(null,A,F,K,w),void 0,null),Xi===null)throw Error(n(349));(Fp&30)!==0||qz(A,w,K)}return K}function qz(g,w,A){g.flags|=16384,g={getSnapshot:w,value:A},w=ri.updateQueue,w===null?(w={lastEffect:null,stores:null},ri.updateQueue=w,w.stores=[g]):(A=w.stores,A===null?w.stores=[g]:A.push(g))}function Kz(g,w,A,F){w.value=A,w.getSnapshot=F,Zz(w)&&Yz(g)}function Gz(g,w,A){return A(function(){Zz(w)&&Yz(g)})}function Zz(g){var w=g.getSnapshot;g=g.value;try{var A=w();return!Nc(g,A)}catch{return!0}}function Yz(g){var w=Gu(g,1);w!==null&&Uc(w,g,1,-1)}function Qz(g){var w=Ll();return typeof g=="function"&&(g=g()),w.memoizedState=w.baseState=g,g={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ow,lastRenderedState:g},w.queue=g,g=g.dispatch=E5e.bind(null,ri,g),[w.memoizedState,g]}function jw(g,w,A,F){return g={tag:g,create:w,destroy:A,deps:F,next:null},w=ri.updateQueue,w===null?(w={lastEffect:null,stores:null},ri.updateQueue=w,w.lastEffect=g.next=g):(A=w.lastEffect,A===null?w.lastEffect=g.next=g:(F=A.next,A.next=g,g.next=F,w.lastEffect=g)),g}function Xz(){return Ka().memoizedState}function t4(g,w,A,F){var K=Ll();ri.flags|=g,K.memoizedState=jw(1|w,A,void 0,F===void 0?null:F)}function n4(g,w,A,F){var K=Ka();F=F===void 0?null:F;var Q=void 0;if(Hi!==null){var re=Hi.memoizedState;if(Q=re.destroy,F!==null&&TA(F,re.deps)){K.memoizedState=jw(w,A,Q,F);return}}ri.flags|=g,K.memoizedState=jw(1|w,A,Q,F)}
vendor: 5,409 bytes, line 55
55function Jz(g,w){return t4(8390656,8,g,w)}function jA(g,w){return n4(2048,8,g,w)}function eW(g,w){return n4(4,2,g,w)}function tW(g,w){return n4(4,4,g,w)}function nW(g,w){if(typeof w=="function")return g=g(),w(g),function(){w(null)};if(w!=null)return g=g(),w.current=g,function(){w.current=null}}function rW(g,w,A){return A=A!=null?A.concat([g]):null,n4(4,4,nW.bind(null,w,g),A)}function NA(){}function iW(g,w){var A=Ka();w=w===void 0?null:w;var F=A.memoizedState;return F!==null&&w!==null&&TA(w,F[1])?F[0]:(A.memoizedState=[g,w],g)}function sW(g,w){var A=Ka();w=w===void 0?null:w;var F=A.memoizedState;return F!==null&&w!==null&&TA(w,F[1])?F[0]:(g=g(),A.memoizedState=[g,w],g)}function oW(g,w,A){return(Fp&21)===0?(g.baseState&&(g.baseState=!1,Bo=!0),g.memoizedState=A):(Nc(A,w)||(A=bx(),ri.lanes|=A,Up|=A,g.baseState=!0),w)}function b5e(g,w){var A=ir;ir=A!==0&&4>A?A:4,g(!0);var F=IA.transition;IA.transition={};try{g(!1),w()}finally{ir=A,IA.transition=F}}function aW(){return Ka().memoizedState}function x5e(g,w,A){var F=Lh(g);if(A={lane:F,action:A,hasEagerState:!1,eagerState:null,next:null},cW(g))lW(w,A);else if(A=Bz(g,w,A,F),A!==null){var K=vo();Uc(A,g,F,K),uW(A,w,F)}}function E5e(g,w,A){var F=Lh(g),K={lane:F,action:A,hasEagerState:!1,eagerState:null,next:null};if(cW(g))lW(w,K);else{var Q=g.alternate;if(g.lanes===0&&(Q===null||Q.lanes===0)&&(Q=w.lastRenderedReducer,Q!==null))try{var re=w.lastRenderedState,ge=Q(re,A);if(K.hasEagerState=!0,K.eagerState=ge,Nc(ge,re)){var Se=w.interleaved;Se===null?(K.next=K,CA(w)):(K.next=Se.next,Se.next=K),w.interleaved=K;return}}catch{}finally{}A=Bz(g,w,K,F),A!==null&&(K=vo(),Uc(A,g,F,K),uW(A,w,F))}}function cW(g){var w=g.alternate;return g===ri||w!==null&&w===ri}function lW(g,w){Rw=e4=!0;var A=g.pending;A===null?w.next=w:(w.next=A.next,A.next=w),g.pending=w}function uW(g,w,A){if((A&4194240)!==0){var F=w.lanes;F&=g.pendingLanes,A|=F,w.lanes=A,dw(g,A)}}var r4={readContext:qa,useCallback:Gs,useContext:Gs,useEffect:Gs,useImperativeHandle:Gs,useInsertionEffect:Gs,useLayoutEffect:Gs,useMemo:Gs,useReducer:Gs,useRef:Gs,useState:Gs,useDebugValue:Gs,useDeferredValue:Gs,useTransition:Gs,useMutableSource:Gs,useSyncExternalStore:Gs,useId:Gs,unstable_isNewReconciler:!1},C5e={readContext:qa,useCallback:function(g,w){return Ll().memoizedState=[g,w===void 0?null:w],g},useContext:qa,useEffect:Jz,useImperativeHandle:function(g,w,A){return A=A!=null?A.concat([g]):null,t4(4194308,4,nW.bind(null,w,g),A)},useLayoutEffect:function(g,w){return t4(4194308,4,g,w)},useInsertionEffect:function(g,w){return t4(4,2,g,w)},useMemo:function(g,w){var A=Ll();return w=w===void 0?null:w,g=g(),A.memoizedState=[g,w],g},useReducer:function(g,w,A){var F=Ll();return w=A!==void 0?A(w):w,F.memoizedState=F.baseState=w,g={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:w},F.queue=g,g=g.dispatch=x5e.bind(null,ri,g),[F.memoizedState,g]},useRef:function(g){var w=Ll();return g={current:g},w.memoizedState=g},useState:Qz,useDebugValue:NA,useDeferredValue:function(g){return Ll().memoizedState=g},useTransition:function(){var g=Qz(!1),w=g[0];return g=b5e.bind(null,g[1]),Ll().memoizedState=g,[w,g]},useMutableSource:function(){},useSyncExternalStore:function(g,w,A){var F=ri,K=Ll();if(qr){if(A===void 0)throw Error(n(407));A=A()}else{if(A=w(),Xi===null)throw Error(n(349));(Fp&30)!==0||qz(F,w,A)}K.memoizedState=A;var Q={value:A,getSnapshot:w};return K.queue=Q,Jz(Gz.bind(null,F,Q,g),[g]),F.flags|=2048,jw(9,Kz.bind(null,F,Q,A,w),void 0,null),A},useId:function(){var g=Ll(),w=Xi.identifierPrefix;if(qr){var A=Ku,F=qu;A=(F&~(1<<32-Fn(F)-1)).toString(32)+A,w=":"+w+"R"+A,A=Mw++,0<A&&(w+="H"+A.toString(32)),w+=":"}else A=v5e++,w=":"+w+"r"+A.toString(32)+":";return g.memoizedState=w},unstable_isNewReconciler:!1},_5e={readContext:qa,useCallback:iW,useContext:qa,useEffect:jA,useImperativeHandle:rW,useInsertionEffect:eW,useLayoutEffect:tW,useMemo:sW,useReducer:MA,useRef:Xz,useState:function(){return MA(Ow)},useDebugValue:NA,useDeferredValue:function(g){var w=Ka();return oW(w,Hi.memoizedState,g)},useTransition:function(){var g=MA(Ow)[0],w=Ka().memoizedState;return[g,w]},useMutableSource:Hz,useSyncExternalStore:Vz,useId:aW,unstable_isNewReconciler:!1},S5e={readContext:qa,useCallback:iW,useContext:qa,useEffect:jA,useImperativeHandle:rW,useInsertionEffect:eW,useLayoutEffect:tW,useMemo:sW,useReducer:OA,useRef:Xz,useState:function(){return OA(Ow)},useDebugValue:NA,useDeferredValue:function(g){var w=Ka();return Hi===null?w.memoizedState=g:oW(w,Hi.memoizedState,g)},useTransition:function(){var g=OA(Ow)[0],w=Ka().memoizedState;return[g,w]},useMutableSource:Hz,useSyncExternalStore:Vz,useId:aW,unstable_isNewReconciler:!1};function Lc(g,w){if(g&&g.defaultProps){w=V({},w),g=g.defaultProps;for(var A in g)w[A]===void 0&&(w[A]=g[A]);return w}return w}function DA(g,w,A,F){w=g.memoizedState,A=A(F,w),A=A==null?w:V({},w,A),g.memoizedState=A,g.lanes===0&&(g.updateQueue.baseState=A)}var i4={isMounted:function(g){return(g=g._reactInternals)?X(g)===g:!1},enqueueSetState:function(g,w,A){g=g._reactInternals;var F=vo(),K=Lh(g),Q=Zu(F,K);Q.payload=w,A!=null&&(Q.callback=A),w=Oh(g,Q,K),w!==null&&(Uc(w,g,K,F),Yx(w,g,K))},enqueueReplaceState:function(g,w,A){g=g._reactInternals;var F=vo(),K=Lh(g),Q=Zu(F,K);Q.tag=1,Q.payload=w,A!=null&&(Q.callback=A),w=Oh(g,Q,K),w!==null&&(Uc(w,g,K,F),Yx(w,g,K))},enqueueForceUpdate:function(g,w){g=g._reactInternals;
vendor: 4,962 bytes, lines 55-57
55var A=vo(),F=Lh(g),K=Zu(A,F);K.tag=2,w!=null&&(K.callback=w),w=Oh(g,K,F),w!==null&&(Uc(w,g,F,A),Yx(w,g,F))}};function dW(g,w,A,F,K,Q,re){return g=g.stateNode,typeof g.shouldComponentUpdate=="function"?g.shouldComponentUpdate(F,Q,re):w.prototype&&w.prototype.isPureReactComponent?!xw(A,F)||!xw(K,Q):!0}function hW(g,w,A){var F=!1,K=Ph,Q=w.contextType;return typeof Q=="object"&&Q!==null?Q=qa(Q):(K=Lo(w)?jp:Ks.current,F=w.contextTypes,Q=(F=F!=null)?Sg(g,K):Ph),w=new w(A,Q),g.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=i4,g.stateNode=w,w._reactInternals=g,F&&(g=g.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=K,g.__reactInternalMemoizedMaskedChildContext=Q),w}function fW(g,w,A,F){g=w.state,typeof w.componentWillReceiveProps=="function"&&w.componentWillReceiveProps(A,F),typeof w.UNSAFE_componentWillReceiveProps=="function"&&w.UNSAFE_componentWillReceiveProps(A,F),w.state!==g&&i4.enqueueReplaceState(w,w.state,null)}function LA(g,w,A,F){var K=g.stateNode;K.props=A,K.state=g.memoizedState,K.refs={},_A(g);var Q=w.contextType;typeof Q=="object"&&Q!==null?K.context=qa(Q):(Q=Lo(w)?jp:Ks.current,K.context=Sg(g,Q)),K.state=g.memoizedState,Q=w.getDerivedStateFromProps,typeof Q=="function"&&(DA(g,w,Q,A),K.state=g.memoizedState),typeof w.getDerivedStateFromProps=="function"||typeof K.getSnapshotBeforeUpdate=="function"||typeof K.UNSAFE_componentWillMount!="function"&&typeof K.componentWillMount!="function"||(w=K.state,typeof K.componentWillMount=="function"&&K.componentWillMount(),typeof K.UNSAFE_componentWillMount=="function"&&K.UNSAFE_componentWillMount(),w!==K.state&&i4.enqueueReplaceState(K,K.state,null),Qx(g,A,K,F),K.state=g.memoizedState),typeof K.componentDidMount=="function"&&(g.flags|=4194308)}function Mg(g,w){try{var A="",F=w;do A+=Y(F),F=F.return;while(F);var K=A}catch(Q){K=` 56Error generating stack: `+Q.message+` 57`+Q.stack}return{value:g,source:w,stack:K,digest:null}}function BA(g,w,A){return{value:g,source:null,stack:A??null,digest:w??null}}function FA(g,w){try{console.error(w.value)}catch(A){setTimeout(function(){throw A})}}var A5e=typeof WeakMap=="function"?WeakMap:Map;function pW(g,w,A){A=Zu(-1,A),A.tag=3,A.payload={element:null};var F=w.value;return A.callback=function(){d4||(d4=!0,tk=F),FA(g,w)},A}function gW(g,w,A){A=Zu(-1,A),A.tag=3;var F=g.type.getDerivedStateFromError;if(typeof F=="function"){var K=w.value;A.payload=function(){return F(K)},A.callback=function(){FA(g,w)}}var Q=g.stateNode;return Q!==null&&typeof Q.componentDidCatch=="function"&&(A.callback=function(){FA(g,w),typeof F!="function"&&(Nh===null?Nh=new Set([this]):Nh.add(this));var re=w.stack;this.componentDidCatch(w.value,{componentStack:re!==null?re:""})}),A}function mW(g,w,A){var F=g.pingCache;if(F===null){F=g.pingCache=new A5e;var K=new Set;F.set(w,K)}else K=F.get(w),K===void 0&&(K=new Set,F.set(w,K));K.has(A)||(K.add(A),g=F5e.bind(null,g,w,A),w.then(g,g))}function yW(g){do{var w;if((w=g.tag===13)&&(w=g.memoizedState,w=w!==null?w.dehydrated!==null:!0),w)return g;g=g.return}while(g!==null);return null}function wW(g,w,A,F,K){return(g.mode&1)===0?(g===w?g.flags|=65536:(g.flags|=128,A.flags|=131072,A.flags&=-52805,A.tag===1&&(A.alternate===null?A.tag=17:(w=Zu(-1,1),w.tag=2,Oh(A,w,1))),A.lanes|=1),g):(g.flags|=65536,g.lanes=K,g)}var k5e=_.ReactCurrentOwner,Bo=!1;function wo(g,w,A,F){w.child=g===null?Lz(w,null,A,F):Ig(w,g.child,A,F)}function vW(g,w,A,F,K){A=A.render;var Q=w.ref;return Pg(w,K),F=PA(g,w,A,F,Q,K),A=RA(),g!==null&&!Bo?(w.updateQueue=g.updateQueue,w.flags&=-2053,g.lanes&=~K,Yu(g,w,K)):(qr&&A&&pA(w),w.flags|=1,wo(g,w,F,K),w.child)}function bW(g,w,A,F,K){if(g===null){var Q=A.type;return typeof Q=="function"&&!ck(Q)&&Q.defaultProps===void 0&&A.compare===null&&A.defaultProps===void 0?(w.tag=15,w.type=Q,xW(g,w,Q,F,K)):(g=y4(A.type,null,F,w,w.mode,K),g.ref=w.ref,g.return=w,w.child=g)}if(Q=g.child,(g.lanes&K)===0){var re=Q.memoizedProps;if(A=A.compare,A=A!==null?A:xw,A(re,F)&&g.ref===w.ref)return Yu(g,w,K)}return w.flags|=1,g=Fh(Q,F),g.ref=w.ref,g.return=w,w.child=g}function xW(g,w,A,F,K){if(g!==null){var Q=g.memoizedProps;if(xw(Q,F)&&g.ref===w.ref)if(Bo=!1,w.pendingProps=F=Q,(g.lanes&K)!==0)(g.flags&131072)!==0&&(Bo=!0);else return w.lanes=g.lanes,Yu(g,w,K)}return UA(g,w,A,F,K)}function EW(g,w,A){var F=w.pendingProps,K=F.children,Q=g!==null?g.memoizedState:null;if(F.mode==="hidden")if((w.mode&1)===0)w.memoizedState={baseLanes:0,cachePool:null,transitions:null},kr(jg,Ca),Ca|=A;else{if((A&1073741824)===0)return g=Q!==null?Q.baseLanes|A:A,w.lanes=w.childLanes=1073741824,w.memoizedState={baseLanes:g,cachePool:null,transitions:null},w.updateQueue=null,kr(jg,Ca),Ca|=g,null;w.memoizedState={baseLanes:0,cachePool:null,transitions:null},F=Q!==null?Q.baseLanes:A,kr(jg,Ca),Ca|=F}else Q!==null?(F=Q.baseLanes|A,w.memoizedState=null):F=A,kr(jg,Ca),Ca|=F;return wo(g,w,K,A),w.child}function CW(g,w){var A=w.ref;(g===null&&A!==null||g!==null&&g.ref!==A)&&(w.flags|=512,w.flags|=2097152)}
vendor: 13,987 bytes, line 57
57function UA(g,w,A,F,K){var Q=Lo(A)?jp:Ks.current;return Q=Sg(w,Q),Pg(w,K),A=PA(g,w,A,F,Q,K),F=RA(),g!==null&&!Bo?(w.updateQueue=g.updateQueue,w.flags&=-2053,g.lanes&=~K,Yu(g,w,K)):(qr&&F&&pA(w),w.flags|=1,wo(g,w,A,K),w.child)}function _W(g,w,A,F,K){if(Lo(A)){var Q=!0;zx(w)}else Q=!1;if(Pg(w,K),w.stateNode===null)o4(g,w),hW(w,A,F),LA(w,A,F,K),F=!0;else if(g===null){var re=w.stateNode,ge=w.memoizedProps;re.props=ge;var Se=re.context,Fe=A.contextType;typeof Fe=="object"&&Fe!==null?Fe=qa(Fe):(Fe=Lo(A)?jp:Ks.current,Fe=Sg(w,Fe));var ut=A.getDerivedStateFromProps,gt=typeof ut=="function"||typeof re.getSnapshotBeforeUpdate=="function";gt||typeof re.UNSAFE_componentWillReceiveProps!="function"&&typeof re.componentWillReceiveProps!="function"||(ge!==F||Se!==Fe)&&fW(w,re,F,Fe),Mh=!1;var lt=w.memoizedState;re.state=lt,Qx(w,F,re,K),Se=w.memoizedState,ge!==F||lt!==Se||Do.current||Mh?(typeof ut=="function"&&(DA(w,A,ut,F),Se=w.memoizedState),(ge=Mh||dW(w,A,ge,F,lt,Se,Fe))?(gt||typeof re.UNSAFE_componentWillMount!="function"&&typeof re.componentWillMount!="function"||(typeof re.componentWillMount=="function"&&re.componentWillMount(),typeof re.UNSAFE_componentWillMount=="function"&&re.UNSAFE_componentWillMount()),typeof re.componentDidMount=="function"&&(w.flags|=4194308)):(typeof re.componentDidMount=="function"&&(w.flags|=4194308),w.memoizedProps=F,w.memoizedState=Se),re.props=F,re.state=Se,re.context=Fe,F=ge):(typeof re.componentDidMount=="function"&&(w.flags|=4194308),F=!1)}else{re=w.stateNode,Fz(g,w),ge=w.memoizedProps,Fe=w.type===w.elementType?ge:Lc(w.type,ge),re.props=Fe,gt=w.pendingProps,lt=re.context,Se=A.contextType,typeof Se=="object"&&Se!==null?Se=qa(Se):(Se=Lo(A)?jp:Ks.current,Se=Sg(w,Se));var Kt=A.getDerivedStateFromProps;(ut=typeof Kt=="function"||typeof re.getSnapshotBeforeUpdate=="function")||typeof re.UNSAFE_componentWillReceiveProps!="function"&&typeof re.componentWillReceiveProps!="function"||(ge!==gt||lt!==Se)&&fW(w,re,F,Se),Mh=!1,lt=w.memoizedState,re.state=lt,Qx(w,F,re,K);var Jt=w.memoizedState;ge!==gt||lt!==Jt||Do.current||Mh?(typeof Kt=="function"&&(DA(w,A,Kt,F),Jt=w.memoizedState),(Fe=Mh||dW(w,A,Fe,F,lt,Jt,Se)||!1)?(ut||typeof re.UNSAFE_componentWillUpdate!="function"&&typeof re.componentWillUpdate!="function"||(typeof re.componentWillUpdate=="function"&&re.componentWillUpdate(F,Jt,Se),typeof re.UNSAFE_componentWillUpdate=="function"&&re.UNSAFE_componentWillUpdate(F,Jt,Se)),typeof re.componentDidUpdate=="function"&&(w.flags|=4),typeof re.getSnapshotBeforeUpdate=="function"&&(w.flags|=1024)):(typeof re.componentDidUpdate!="function"||ge===g.memoizedProps&<===g.memoizedState||(w.flags|=4),typeof re.getSnapshotBeforeUpdate!="function"||ge===g.memoizedProps&<===g.memoizedState||(w.flags|=1024),w.memoizedProps=F,w.memoizedState=Jt),re.props=F,re.state=Jt,re.context=Se,F=Fe):(typeof re.componentDidUpdate!="function"||ge===g.memoizedProps&<===g.memoizedState||(w.flags|=4),typeof re.getSnapshotBeforeUpdate!="function"||ge===g.memoizedProps&<===g.memoizedState||(w.flags|=1024),F=!1)}return zA(g,w,A,F,Q,K)}function zA(g,w,A,F,K,Q){CW(g,w);var re=(w.flags&128)!==0;if(!F&&!re)return K&&Iz(w,A,!1),Yu(g,w,Q);F=w.stateNode,k5e.current=w;var ge=re&&typeof A.getDerivedStateFromError!="function"?null:F.render();return w.flags|=1,g!==null&&re?(w.child=Ig(w,g.child,null,Q),w.child=Ig(w,null,ge,Q)):wo(g,w,ge,Q),w.memoizedState=F.state,K&&Iz(w,A,!0),w.child}function SW(g){var w=g.stateNode;w.pendingContext?kz(g,w.pendingContext,w.pendingContext!==w.context):w.context&&kz(g,w.context,!1),SA(g,w.containerInfo)}function AW(g,w,A,F,K){return $g(),wA(K),w.flags|=256,wo(g,w,A,F),w.child}var WA={dehydrated:null,treeContext:null,retryLane:0};function HA(g){return{baseLanes:g,cachePool:null,transitions:null}}function kW(g,w,A){var F=w.pendingProps,K=ni.current,Q=!1,re=(w.flags&128)!==0,ge;if((ge=re)||(ge=g!==null&&g.memoizedState===null?!1:(K&2)!==0),ge?(Q=!0,w.flags&=-129):(g===null||g.memoizedState!==null)&&(K|=1),kr(ni,K&1),g===null)return yA(w),g=w.memoizedState,g!==null&&(g=g.dehydrated,g!==null)?((w.mode&1)===0?w.lanes=1:g.data==="$!"?w.lanes=8:w.lanes=1073741824,null):(re=F.children,g=F.fallback,Q?(F=w.mode,Q=w.child,re={mode:"hidden",children:re},(F&1)===0&&Q!==null?(Q.childLanes=0,Q.pendingProps=re):Q=w4(re,F,0,null),g=Vp(g,F,A,null),Q.return=w,g.return=w,Q.sibling=g,w.child=Q,w.child.memoizedState=HA(A),w.memoizedState=WA,g):VA(w,re));if(K=g.memoizedState,K!==null&&(ge=K.dehydrated,ge!==null))return $5e(g,w,re,F,ge,K,A);if(Q){Q=F.fallback,re=w.mode,K=g.child,ge=K.sibling;var Se={mode:"hidden",children:F.children};return(re&1)===0&&w.child!==K?(F=w.child,F.childLanes=0,F.pendingProps=Se,w.deletions=null):(F=Fh(K,Se),F.subtreeFlags=K.subtreeFlags&14680064),ge!==null?Q=Fh(ge,Q):(Q=Vp(Q,re,A,null),Q.flags|=2),Q.return=w,F.return=w,F.sibling=Q,w.child=F,F=Q,Q=w.child,re=g.child.memoizedState,re=re===null?HA(A):{baseLanes:re.baseLanes|A,cachePool:null,transitions:re.transitions},Q.memoizedState=re,Q.childLanes=g.childLanes&~A,w.memoizedState=WA,F}return Q=g.child,g=Q.sibling,F=Fh(Q,{mode:"visible",children:F.children}),(w.mode&1)===0&&(F.lanes=A),F.return=w,F.sibling=null,g!==null&&(A=w.deletions,A===null?(w.deletions=[g],w.flags|=16):A.push(g)),w.child=F,w.memoizedState=null,F}function VA(g,w){return w=w4({mode:"visible",children:w},g.mode,0,null),w.return=g,g.child=w}function s4(g,w,A,F){return F!==null&&wA(F),Ig(w,g.child,null,A),g=VA(w,w.pendingProps.children),g.flags|=2,w.memoizedState=null,g}function $5e(g,w,A,F,K,Q,re){if(A)return w.flags&256?(w.flags&=-257,F=BA(Error(n(422))),s4(g,w,re,F)):w.memoizedState!==null?(w.child=g.child,w.flags|=128,null):(Q=F.fallback,K=w.mode,F=w4({mode:"visible",children:F.children},K,0,null),Q=Vp(Q,K,re,null),Q.flags|=2,F.return=w,Q.return=w,F.sibling=Q,w.child=F,(w.mode&1)!==0&&Ig(w,g.child,null,re),w.child.memoizedState=HA(re),w.memoizedState=WA,Q);if((w.mode&1)===0)return s4(g,w,re,null);if(K.data==="$!"){if(F=K.nextSibling&&K.nextSibling.dataset,F)var ge=F.dgst;return F=ge,Q=Error(n(419)),F=BA(Q,F,void 0),s4(g,w,re,F)}if(ge=(re&g.childLanes)!==0,Bo||ge){if(F=Xi,F!==null){switch(re&-re){case 4:K=2;break;case 16:K=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:K=32;break;case 536870912:K=268435456;break;default:K=0}K=(K&(F.suspendedLanes|re))!==0?0:K,K!==0&&K!==Q.retryLane&&(Q.retryLane=K,Gu(g,K),Uc(F,g,K,-1))}return ak(),F=BA(Error(n(421))),s4(g,w,re,F)}return K.data==="$?"?(w.flags|=128,w.child=g.child,w=U5e.bind(null,g),K._reactRetry=w,null):(g=Q.treeContext,Ea=Ih(K.nextSibling),xa=w,qr=!0,Dc=null,g!==null&&(Ha[Va++]=qu,Ha[Va++]=Ku,Ha[Va++]=Np,qu=g.id,Ku=g.overflow,Np=w),w=VA(w,F.children),w.flags|=4096,w)}function $W(g,w,A){g.lanes|=w;var F=g.alternate;F!==null&&(F.lanes|=w),EA(g.return,w,A)}function qA(g,w,A,F,K){var Q=g.memoizedState;Q===null?g.memoizedState={isBackwards:w,rendering:null,renderingStartTime:0,last:F,tail:A,tailMode:K}:(Q.isBackwards=w,Q.rendering=null,Q.renderingStartTime=0,Q.last=F,Q.tail=A,Q.tailMode=K)}function IW(g,w,A){var F=w.pendingProps,K=F.revealOrder,Q=F.tail;if(wo(g,w,F.children,A),F=ni.current,(F&2)!==0)F=F&1|2,w.flags|=128;else{if(g!==null&&(g.flags&128)!==0)e:for(g=w.child;g!==null;){if(g.tag===13)g.memoizedState!==null&&$W(g,A,w);else if(g.tag===19)$W(g,A,w);else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===w)break e;for(;g.sibling===null;){if(g.return===null||g.return===w)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}F&=1}if(kr(ni,F),(w.mode&1)===0)w.memoizedState=null;else switch(K){case"forwards":for(A=w.child,K=null;A!==null;)g=A.alternate,g!==null&&Xx(g)===null&&(K=A),A=A.sibling;A=K,A===null?(K=w.child,w.child=null):(K=A.sibling,A.sibling=null),qA(w,!1,K,A,Q);break;case"backwards":for(A=null,K=w.child,w.child=null;K!==null;){if(g=K.alternate,g!==null&&Xx(g)===null){w.child=K;break}g=K.sibling,K.sibling=A,A=K,K=g}qA(w,!0,A,null,Q);break;case"together":qA(w,!1,null,null,void 0);break;default:w.memoizedState=null}return w.child}function o4(g,w){(w.mode&1)===0&&g!==null&&(g.alternate=null,w.alternate=null,w.flags|=2)}function Yu(g,w,A){if(g!==null&&(w.dependencies=g.dependencies),Up|=w.lanes,(A&w.childLanes)===0)return null;if(g!==null&&w.child!==g.child)throw Error(n(153));if(w.child!==null){for(g=w.child,A=Fh(g,g.pendingProps),w.child=A,A.return=w;g.sibling!==null;)g=g.sibling,A=A.sibling=Fh(g,g.pendingProps),A.return=w;A.sibling=null}return w.child}function I5e(g,w,A){switch(w.tag){case 3:SW(w),$g();break;case 5:Wz(w);break;case 1:Lo(w.type)&&zx(w);break;case 4:SA(w,w.stateNode.containerInfo);break;case 10:var F=w.type._context,K=w.memoizedProps.value;kr(Gx,F._currentValue),F._currentValue=K;break;case 13:if(F=w.memoizedState,F!==null)return F.dehydrated!==null?(kr(ni,ni.current&1),w.flags|=128,null):(A&w.child.childLanes)!==0?kW(g,w,A):(kr(ni,ni.current&1),g=Yu(g,w,A),g!==null?g.sibling:null);kr(ni,ni.current&1);break;case 19:if(F=(A&w.childLanes)!==0,(g.flags&128)!==0){if(F)return IW(g,w,A);w.flags|=128}if(K=w.memoizedState,K!==null&&(K.rendering=null,K.tail=null,K.lastEffect=null),kr(ni,ni.current),F)break;return null;case 22:case 23:return w.lanes=0,EW(g,w,A)}return Yu(g,w,A)}var TW,KA,PW,RW;TW=function(g,w){for(var A=w.child;A!==null;){if(A.tag===5||A.tag===6)g.appendChild(A.stateNode);else if(A.tag!==4&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===w)break;for(;A.sibling===null;){if(A.return===null||A.return===w)return;A=A.return}A.sibling.return=A.return,A=A.sibling}},KA=function(){},PW=function(g,w,A,F){var K=g.memoizedProps;if(K!==F){g=w.stateNode,Bp(Dl.current);var Q=null;switch(A){case"input":K=Ge(g,K),F=Ge(g,F),Q=[];break;case"select":K=V({},K,{value:void 0}),F=V({},F,{value:void 0}),Q=[];break;case"textarea":K=Ue(g,K),F=Ue(g,F),Q=[];break;default:typeof K.onClick!="function"&&typeof F.onClick=="function"&&(g.onclick=Bx)}Nt(A,F);var re;A=null;for(Fe in K)if(!F.hasOwnProperty(Fe)&&K.hasOwnProperty(Fe)&&K[Fe]!=null)if(Fe==="style"){var ge=K[Fe];for(re in ge)ge.hasOwnProperty(re)&&(A||(A={}),A[re]="")}else Fe!=="dangerouslySetInnerHTML"&&Fe!=="children"&&Fe!=="suppressContentEditableWarning"&&Fe!=="suppressHydrationWarning"&&Fe!=="autoFocus"&&(i.hasOwnProperty(Fe)?Q||(Q=[]):(Q=Q||[]).push(Fe,null));for(Fe in F){var Se=F[Fe];if(ge=K!=null?K[Fe]:void 0,F.hasOwnProperty(Fe)&&Se!==ge&&(Se!=null||ge!=null))if(Fe==="style")if(ge){for(re in ge)!ge.hasOwnProperty(re)||Se&&Se.hasOwnProperty(re)||(A||(A={}),A[re]="");for(re in Se)Se.hasOwnProperty(re)&&ge[re]!==Se[re]&&(A||(A={}),A[re]=Se[re])}else A||(Q||(Q=[]),Q.push(Fe,A)),A=Se;else Fe==="dangerouslySetInnerHTML"?(Se=Se?Se.__html:void 0,ge=ge?ge.__html:void 0,Se!=null&&ge!==Se&&(Q=Q||[]).push(Fe,Se)):Fe==="children"?typeof Se!="string"&&typeof Se!="number"||(Q=Q||[]).push(Fe,""+Se):Fe!=="suppressContentEditableWarning"&&Fe!=="suppressHydrationWarning"&&(i.hasOwnProperty(Fe)?(Se!=null&&Fe==="onScroll"&&Mr("scroll",g),Q||ge===Se||(Q=[])):(Q=Q||[]).push(Fe,Se))}A&&(Q=Q||[]).push("style",A);var Fe=Q;(w.updateQueue=Fe)&&(w.flags|=4)}},RW=function(g,w,A,F){A!==F&&(w.flags|=4)};function Nw(g,w){if(!qr)switch(g.tailMode){case"hidden":w=g.tail;for(var A=null;w!==null;)w.alternate!==null&&(A=w),w=w.sibling;A===null?g.tail=null:A.sibling=null;break;case"collapsed":A=g.tail;for(var F=null;A!==null;)A.alternate!==null&&(F=A),A=A.sibling;F===null?w||g.tail===null?g.tail=null:g.tail.sibling=null:F.sibling=null}}function Zs(g){var w=g.alternate!==null&&g.alternate.child===g.child,A=0,F=0;if(w)for(var K=g.child;K!==null;)A|=K.lanes|K.childLanes,F|=K.subtreeFlags&14680064,F|=K.flags&14680064,K.return=g,K=K.sibling;else for(K=g.child;K!==null;)A|=K.lanes|K.childLanes,F|=K.subtreeFlags,F|=K.flags,K.return=g,K=K.sibling;return g.subtreeFlags|=F,g.childLanes=A,w}function T5e(g,w,A){var F=w.pendingProps;switch(gA(w),w.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zs(w),null;case 1:return Lo(w.type)&&Ux(),Zs(w),null;case 3:return F=w.stateNode,Rg(),Or(Do),Or(Ks),$A(),F.pendingContext&&(F.context=F.pendingContext,F.pendingContext=null),(g===null||g.child===null)&&(qx(w)?w.flags|=4:g===null||g.memoizedState.isDehydrated&&(w.flags&256)===0||(w.flags|=1024,Dc!==null&&(ik(Dc),Dc=null))),KA(g,w),Zs(w),null;case 5:AA(w);var K=Bp(Pw.current);if(A=w.type,g!==null&&w.stateNode!=null)PW(g,w,A,F,K),g.ref!==w.ref&&(w.flags|=512,w.flags|=2097152);else{if(!F){if(w.stateNode===null)throw Error(n(166));return Zs(w),null}if(g=Bp(Dl.current),qx(w)){F=w.stateNode,A=w.type;var Q=w.memoizedProps;switch(F[Nl]=w,F[Aw]=Q,g=(w.mode&1)!==0,A){case"dialog":Mr("cancel",F),Mr("close",F);break;case"iframe":case"object":case"embed":Mr("load",F);break;case"video":case"audio":for(K=0;K<Cw.length;K++)Mr(Cw[K],F);break;case"source":Mr("error",F);break;case"img":case"image":case"link":Mr("error",F),Mr("load",F);break;case"details":Mr("toggle",F);break;case"input":je(F,Q),Mr("invalid",F);break;case"select":F._wrapperState={wasMultiple:!!Q.multiple},Mr("invalid",F);break;case"textarea":Ye(F,Q),Mr("invalid",F)}Nt(A,Q),K=null;for(var re in Q)if(Q.hasOwnProperty(re)){var ge=Q[re];re==="children"?typeof ge=="string"?F.textContent!==ge&&(Q.suppressHydrationWarning!==!0&&Lx(F.textContent,ge,g),K=["children",ge]):typeof ge=="number"&&F.textContent!==""+ge&&(Q.suppressHydrationWarning!==!0&&Lx(F.textContent,ge,g),K=["children",""+ge]):i.hasOwnProperty(re)&&ge!=null&&re==="onScroll"&&Mr("scroll",F)}switch(A){case"input":Be(F),it(F,Q,!0);break;case"textarea":Be(F),ze(F);break;case"select":case"option":break;default:typeof Q.onClick=="function"&&(F.onclick=Bx)}F=K,w.updateQueue=F,F!==null&&(w.flags|=4)}else{re=K.nodeType===9?K:K.ownerDocument,g==="http://www.w3.org/1999/xhtml"&&(g=Ne(A)),g==="http://www.w3.org/1999/xhtml"?A==="script"?(g=re.createElement("div"),g.innerHTML="<script><\/script>
57",g=g.removeChild(g.firstChild)):typeof F.is=="string"?g=re.createElement(A,{is:F.is}):(g=re.createElement(A),A==="select"&&(re=g,F.multiple?re.multiple=!0:F.size&&(re.size=F.size))):g=re.createElementNS(g,A),g[Nl]=w,g[Aw]=F,TW(g,w,!1,!1),w.stateNode=g;e:{switch(re=mn(A,F),A){case"dialog":Mr("cancel",g),Mr("close",g),K=F;break;case"iframe":case"object":case"embed":Mr("load",g),K=F;break;case"video":case"audio":for(K=0;K<Cw.length;K++)Mr(Cw[K],g);K=F;break;case"source":Mr("error",g),K=F;break;case"img":case"image":case"link":Mr("error",g),Mr("load",g),K=F;break;case"details":Mr("toggle",g),K=F;break;case"input":je(g,F),K=Ge(g,F),Mr("invalid",g);break;case"option":K=F;break;case"select":g._wrapperState={wasMultiple:!!F.multiple},K=V({},F,{value:void 0}),Mr("invalid",g);break;case"textarea":Ye(g,F),K=Ue(g,F),Mr("invalid",g);break;default:K=F}Nt(A,K),ge=K;for(Q in ge)if(ge.hasOwnProperty(Q)){var Se=ge[Q];Q==="style"?nt(g,Se):Q==="dangerouslySetInnerHTML"?(Se=Se?Se.__html:void 0,Se!=null&&Z(g,Se)):Q==="children"?typeof Se=="string"?(A!=="textarea"||Se!=="")&&se(g,Se):typeof Se=="number"&&se(g,""+Se):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(i.hasOwnProperty(Q)?Se!=null&&Q==="onScroll"&&Mr("scroll",g):Se!=null&&x(g,Q,Se,re))}switch(A){case"input":Be(g),it(g,F,!1);break;case"textarea":Be(g),ze(g);break;case"option":F.value!=null&&g.setAttribute("value",""+oe(F.value));break;case"select":g.multiple=!!F.multiple,Q=F.value,Q!=null?Qe(g,!!F.multiple,Q,!1):F.defaultValue!=null&&Qe(g,!!F.multiple,F.defaultValue,!0);break;default:typeof K.onClick=="function"&&(g.onclick=Bx)}switch(A){case"button":case"input":case"select":case"textarea":F=!!F.autoFocus;break e;case"img":F=!0;break e;default:F=!1}}F&&(w.flags|=4)}w.ref!==null&&(w.flags|=512,w.flags|=2097152)}return Zs(w),null;case 6:if(g&&w.stateNode!=null)RW(g,w,g.memoizedProps,F);else{if(typeof F!="string"&&w.stateNode===null)throw Error(n(166));if(A=Bp(Pw.current),Bp(Dl.current),qx(w)){if(F=w.stateNode,A=w.memoizedProps,F[Nl]=w,(Q=F.nodeValue!==A)&&(g=xa,g!==null))switch(g.tag){case 3:Lx(F.nodeValue,A,(g.mode&1)!==0);break;case 5:g.memoizedProps.suppressHydrationWarning!==!0&&Lx(F.nodeValue,A,(g.mode&1)!==0)}Q&&(w.flags|=4)}else F=(A.nodeType===9?A:A.ownerDocument).createTextNode(F),F[Nl]=w,w.stateNode=F}return Zs(w),null;case 13:if(Or(ni),F=w.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if(qr&&Ea!==null&&(w.mode&1)!==0&&(w.flags&128)===0)jz(),$g(),w.flags|=98560,Q=!1;else if(Q=qx(w),F!==null&&F.dehydrated!==null){if(g===null){if(!Q)throw Error(n(318));if(Q=w.memoizedState,Q=Q!==null?Q.dehydrated:null,!Q)throw Error(n(317));Q[Nl]=w}else $g(),(w.flags&128)===0&&(w.memoizedState=null),w.flags|=4;Zs(w),Q=!1}else Dc!==null&&(ik(Dc),Dc=null),Q=!0;if(!Q)return w.flags&65536?w:null}return(w.flags&128)!==0?(w.lanes=A,w):(F=F!==null,F!==(g!==null&&g.memoizedState!==null)&&F&&(w.child.flags|=8192,(w.mode&1)!==0&&(g===null||(ni.current&1)!==0?Vi===0&&(Vi=3):ak())),w.updateQueue!==null&&(w.flags|=4),Zs(w),null);case 4:return Rg(),KA(g,w),g===null&&_w(w.stateNode.containerInfo),Zs(w),null;case 10:return xA(w.type._context),Zs(w),null;case 17:return Lo(w.type)&&Ux(),Zs(w),null;case 19:if(Or(ni),Q=w.memoizedState,Q===null)return Zs(w),null;if(F=(w.flags&128)!==0,re=Q.rendering,re===null)if(F)Nw(Q,!1);else{if(Vi!==0||g!==null&&(g.flags&128)!==0)for(g=w.child;g!==null;){if(re=Xx(g),re!==null){for(w.flags|=128,Nw(Q,!1),F=re.updateQueue,F!==null&&(w.updateQueue=F,w.flags|=4),w.subtreeFlags=0,F=A,A=w.child;A!==null;)Q=A,g=F,Q.flags&=14680066,re=Q.alternate,re===null?(Q.childLanes=0,Q.lanes=g,Q.child=null,Q.subtreeFlags=0,Q.memoizedProps=null,Q.memoizedState=null,Q.updateQueue=null,Q.dependencies=null,Q.stateNode=null):(Q.childLanes=re.childLanes,Q.lanes=re.lanes,Q.child=re.child,Q.subtreeFlags=0,Q.deletions=null,Q.memoizedProps=re.memoizedProps,Q.memoizedState=re.memoizedState,Q.updateQueue=re.updateQueue,Q.type=re.type,g=re.dependencies,Q.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext}),A=A.sibling;return kr(ni,ni.current&1|2),w.child}g=g.sibling}Q.tail!==null&&at()>Ng&&(w.flags|=128,F=!0,Nw(Q,!1),w.lanes=4194304)}else{if(!F)if(g=Xx(re),g!==null){if(w.flags|=128,F=!0,A=g.updateQueue,A!==null&&(w.updateQueue=A,w.flags|=4),Nw(Q,!0),Q.tail===null&&Q.tailMode==="hidden"&&!re.alternate&&!qr)return Zs(w),null}else 2*at()-Q.renderingStartTime>Ng&&A!==1073741824&&(w.flags|=128,F=!0,Nw(Q,!1),w.lanes=4194304);Q.isBackwards?(re.sibling=w.child,w.child=re):(A=Q.last,A!==null?A.sibling=re:w.child=re,Q.last=re)}return Q.tail!==null?(w=Q.tail,Q.rendering=w,Q.tail=w.sibling,Q.renderingStartTime=at(),w.sibling=null,A=ni.current,kr(ni,F?A&1|2:A&1),w):(Zs(w),null);case 22:case 23:return ok(),F=w.memoizedState!==null,g!==null&&g.memoizedState!==null!==F&&(w.flags|=8192),F&&(w.mode&1)!==0?(Ca&1073741824)!==0&&(Zs(w),w.subtreeFlags&6&&(w.flags|=8192)):Zs(w),null;case 24:return null;case 25:return null}throw Error(n(156,w.tag))}function P5e(g,w){switch(gA(w),w.tag){case 1:return Lo(w.type)&&Ux(),g=w.flags,g&65536?(w.flags=g&-65537|128,w):null;case 3:return Rg(),Or(Do),Or(Ks),$A(),g=w.flags,(g&65536)!==0&&(g&128)===0?(w.flags=g&-65537|128,w):null;case 5:return AA(w),null;case 13:if(Or(ni),g=w.memoizedState,g!==null&&g.dehydrated!==null){if(w.alternate===null)throw Error(n(340));$g()}return g=w.flags,g&65536?(w.flags=g&-65537|128,w):null;case 19:return Or(ni),null;case 4:return Rg(),null;case 10:return xA(w.type._context),null;case 22:case 23:return ok(),null;case 24:return null;default:return null}}var a4=!1,Ys=!1,R5e=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function Og(g,w){var A=g.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(F){fi(g,w,F)}else A.current=null}function GA(g,w,A){try{A()}catch(F){fi(g,w,F)}}var MW=!1;
vendor: 15,680 bytes, line 57
57function M5e(g,w){if(oA=Rr,g=dz(),XS(g)){if("selectionStart"in g)var A={start:g.selectionStart,end:g.selectionEnd};else e:{A=(A=g.ownerDocument)&&A.defaultView||window;var F=A.getSelection&&A.getSelection();if(F&&F.rangeCount!==0){A=F.anchorNode;var K=F.anchorOffset,Q=F.focusNode;F=F.focusOffset;try{A.nodeType,Q.nodeType}catch{A=null;break e}var re=0,ge=-1,Se=-1,Fe=0,ut=0,gt=g,lt=null;t:for(;;){for(var Kt;gt!==A||K!==0&>.nodeType!==3||(ge=re+K),gt!==Q||F!==0&>.nodeType!==3||(Se=re+F),gt.nodeType===3&&(re+=gt.nodeValue.length),(Kt=gt.firstChild)!==null;)lt=gt,gt=Kt;for(;;){if(gt===g)break t;if(lt===A&&++Fe===K&&(ge=re),lt===Q&&++ut===F&&(Se=re),(Kt=gt.nextSibling)!==null)break;gt=lt,lt=gt.parentNode}gt=Kt}A=ge===-1||Se===-1?null:{start:ge,end:Se}}else A=null}A=A||{start:0,end:0}}else A=null;for(aA={focusedElem:g,selectionRange:A},Rr=!1,Xt=w;Xt!==null;)if(w=Xt,g=w.child,(w.subtreeFlags&1028)!==0&&g!==null)g.return=w,Xt=g;else for(;Xt!==null;){w=Xt;try{var Jt=w.alternate;if((w.flags&1024)!==0)switch(w.tag){case 0:case 11:case 15:break;case 1:if(Jt!==null){var nn=Jt.memoizedProps,xi=Jt.memoizedState,Re=w.stateNode,Ae=Re.getSnapshotBeforeUpdate(w.elementType===w.type?nn:Lc(w.type,nn),xi);Re.__reactInternalSnapshotBeforeUpdate=Ae}break;case 3:var Oe=w.stateNode.containerInfo;Oe.nodeType===1?Oe.textContent="":Oe.nodeType===9&&Oe.documentElement&&Oe.removeChild(Oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(bt){fi(w,w.return,bt)}if(g=w.sibling,g!==null){g.return=w.return,Xt=g;break}Xt=w.return}return Jt=MW,MW=!1,Jt}function Dw(g,w,A){var F=w.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var K=F=F.next;do{if((K.tag&g)===g){var Q=K.destroy;K.destroy=void 0,Q!==void 0&&GA(w,A,Q)}K=K.next}while(K!==F)}}function c4(g,w){if(w=w.updateQueue,w=w!==null?w.lastEffect:null,w!==null){var A=w=w.next;do{if((A.tag&g)===g){var F=A.create;A.destroy=F()}A=A.next}while(A!==w)}}function ZA(g){var w=g.ref;if(w!==null){var A=g.stateNode;switch(g.tag){case 5:g=A;break;default:g=A}typeof w=="function"?w(g):w.current=g}}function OW(g){var w=g.alternate;w!==null&&(g.alternate=null,OW(w)),g.child=null,g.deletions=null,g.sibling=null,g.tag===5&&(w=g.stateNode,w!==null&&(delete w[Nl],delete w[Aw],delete w[dA],delete w[g5e],delete w[m5e])),g.stateNode=null,g.return=null,g.dependencies=null,g.memoizedProps=null,g.memoizedState=null,g.pendingProps=null,g.stateNode=null,g.updateQueue=null}function jW(g){return g.tag===5||g.tag===3||g.tag===4}function NW(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||jW(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function YA(g,w,A){var F=g.tag;if(F===5||F===6)g=g.stateNode,w?A.nodeType===8?A.parentNode.insertBefore(g,w):A.insertBefore(g,w):(A.nodeType===8?(w=A.parentNode,w.insertBefore(g,A)):(w=A,w.appendChild(g)),A=A._reactRootContainer,A!=null||w.onclick!==null||(w.onclick=Bx));else if(F!==4&&(g=g.child,g!==null))for(YA(g,w,A),g=g.sibling;g!==null;)YA(g,w,A),g=g.sibling}function QA(g,w,A){var F=g.tag;if(F===5||F===6)g=g.stateNode,w?A.insertBefore(g,w):A.appendChild(g);else if(F!==4&&(g=g.child,g!==null))for(QA(g,w,A),g=g.sibling;g!==null;)QA(g,w,A),g=g.sibling}var vs=null,Bc=!1;function jh(g,w,A){for(A=A.child;A!==null;)DW(g,w,A),A=A.sibling}function DW(g,w,A){if(hr&&typeof hr.onCommitFiberUnmount=="function")try{hr.onCommitFiberUnmount(xr,A)}catch{}switch(A.tag){case 5:Ys||Og(A,w);case 6:var F=vs,K=Bc;vs=null,jh(g,w,A),vs=F,Bc=K,vs!==null&&(Bc?(g=vs,A=A.stateNode,g.nodeType===8?g.parentNode.removeChild(A):g.removeChild(A)):vs.removeChild(A.stateNode));break;case 18:vs!==null&&(Bc?(g=vs,A=A.stateNode,g.nodeType===8?uA(g.parentNode,A):g.nodeType===1&&uA(g,A),ct(g)):uA(vs,A.stateNode));break;case 4:F=vs,K=Bc,vs=A.stateNode.containerInfo,Bc=!0,jh(g,w,A),vs=F,Bc=K;break;case 0:case 11:case 14:case 15:if(!Ys&&(F=A.updateQueue,F!==null&&(F=F.lastEffect,F!==null))){K=F=F.next;do{var Q=K,re=Q.destroy;Q=Q.tag,re!==void 0&&((Q&2)!==0||(Q&4)!==0)&&GA(A,w,re),K=K.next}while(K!==F)}jh(g,w,A);break;case 1:if(!Ys&&(Og(A,w),F=A.stateNode,typeof F.componentWillUnmount=="function"))try{F.props=A.memoizedProps,F.state=A.memoizedState,F.componentWillUnmount()}catch(ge){fi(A,w,ge)}jh(g,w,A);break;case 21:jh(g,w,A);break;case 22:A.mode&1?(Ys=(F=Ys)||A.memoizedState!==null,jh(g,w,A),Ys=F):jh(g,w,A);break;default:jh(g,w,A)}}function LW(g){var w=g.updateQueue;if(w!==null){g.updateQueue=null;var A=g.stateNode;A===null&&(A=g.stateNode=new R5e),w.forEach(function(F){var K=z5e.bind(null,g,F);A.has(F)||(A.add(F),F.then(K,K))})}}function Fc(g,w){var A=w.deletions;if(A!==null)for(var F=0;F<A.length;F++){var K=A[F];try{var Q=g,re=w,ge=re;e:for(;ge!==null;){switch(ge.tag){case 5:vs=ge.stateNode,Bc=!1;break e;case 3:vs=ge.stateNode.containerInfo,Bc=!0;break e;case 4:vs=ge.stateNode.containerInfo,Bc=!0;break e}ge=ge.return}if(vs===null)throw Error(n(160));DW(Q,re,K),vs=null,Bc=!1;var Se=K.alternate;Se!==null&&(Se.return=null),K.return=null}catch(Fe){fi(K,w,Fe)}}if(w.subtreeFlags&12854)for(w=w.child;w!==null;)BW(w,g),w=w.sibling}function BW(g,w){var A=g.alternate,F=g.flags;switch(g.tag){case 0:case 11:case 14:case 15:if(Fc(w,g),Bl(g),F&4){try{Dw(3,g,g.return),c4(3,g)}catch(nn){fi(g,g.return,nn)}try{Dw(5,g,g.return)}catch(nn){fi(g,g.return,nn)}}break;case 1:Fc(w,g),Bl(g),F&512&&A!==null&&Og(A,A.return);break;case 5:if(Fc(w,g),Bl(g),F&512&&A!==null&&Og(A,A.return),g.flags&32){var K=g.stateNode;try{se(K,"")}catch(nn){fi(g,g.return,nn)}}if(F&4&&(K=g.stateNode,K!=null)){var Q=g.memoizedProps,re=A!==null?A.memoizedProps:Q,ge=g.type,Se=g.updateQueue;if(g.updateQueue=null,Se!==null)try{ge==="input"&&Q.type==="radio"&&Q.name!=null&&xt(K,Q),mn(ge,re);var Fe=mn(ge,Q);for(re=0;re<Se.length;re+=2){var ut=Se[re],gt=Se[re+1];ut==="style"?nt(K,gt):ut==="dangerouslySetInnerHTML"?Z(K,gt):ut==="children"?se(K,gt):x(K,ut,gt,Fe)}switch(ge){case"input":ft(K,Q);break;case"textarea":tt(K,Q);break;case"select":var lt=K._wrapperState.wasMultiple;K._wrapperState.wasMultiple=!!Q.multiple;var Kt=Q.value;Kt!=null?Qe(K,!!Q.multiple,Kt,!1):lt!==!!Q.multiple&&(Q.defaultValue!=null?Qe(K,!!Q.multiple,Q.defaultValue,!0):Qe(K,!!Q.multiple,Q.multiple?[]:"",!1))}K[Aw]=Q}catch(nn){fi(g,g.return,nn)}}break;case 6:if(Fc(w,g),Bl(g),F&4){if(g.stateNode===null)throw Error(n(162));K=g.stateNode,Q=g.memoizedProps;try{K.nodeValue=Q}catch(nn){fi(g,g.return,nn)}}break;case 3:if(Fc(w,g),Bl(g),F&4&&A!==null&&A.memoizedState.isDehydrated)try{ct(w.containerInfo)}catch(nn){fi(g,g.return,nn)}break;case 4:Fc(w,g),Bl(g);break;case 13:Fc(w,g),Bl(g),K=g.child,K.flags&8192&&(Q=K.memoizedState!==null,K.stateNode.isHidden=Q,!Q||K.alternate!==null&&K.alternate.memoizedState!==null||(ek=at())),F&4&&LW(g);break;case 22:if(ut=A!==null&&A.memoizedState!==null,g.mode&1?(Ys=(Fe=Ys)||ut,Fc(w,g),Ys=Fe):Fc(w,g),Bl(g),F&8192){if(Fe=g.memoizedState!==null,(g.stateNode.isHidden=Fe)&&!ut&&(g.mode&1)!==0)for(Xt=g,ut=g.child;ut!==null;){for(gt=Xt=ut;Xt!==null;){switch(lt=Xt,Kt=lt.child,lt.tag){case 0:case 11:case 14:case 15:Dw(4,lt,lt.return);break;case 1:Og(lt,lt.return);var Jt=lt.stateNode;if(typeof Jt.componentWillUnmount=="function"){F=lt,A=lt.return;try{w=F,Jt.props=w.memoizedProps,Jt.state=w.memoizedState,Jt.componentWillUnmount()}catch(nn){fi(F,A,nn)}}break;case 5:Og(lt,lt.return);break;case 22:if(lt.memoizedState!==null){zW(gt);continue}}Kt!==null?(Kt.return=lt,Xt=Kt):zW(gt)}ut=ut.sibling}e:for(ut=null,gt=g;;){if(gt.tag===5){if(ut===null){ut=gt;try{K=gt.stateNode,Fe?(Q=K.style,typeof Q.setProperty=="function"?Q.setProperty("display","none","important"):Q.display="none"):(ge=gt.stateNode,Se=gt.memoizedProps.style,re=Se!=null&&Se.hasOwnProperty("display")?Se.display:null,ge.style.display=ye("display",re))}catch(nn){fi(g,g.return,nn)}}}else if(gt.tag===6){if(ut===null)try{gt.stateNode.nodeValue=Fe?"":gt.memoizedProps}catch(nn){fi(g,g.return,nn)}}else if((gt.tag!==22&>.tag!==23||gt.memoizedState===null||gt===g)&>.child!==null){gt.child.return=gt,gt=gt.child;continue}if(gt===g)break e;for(;gt.sibling===null;){if(gt.return===null||gt.return===g)break e;ut===gt&&(ut=null),gt=gt.return}ut===gt&&(ut=null),gt.sibling.return=gt.return,gt=gt.sibling}}break;case 19:Fc(w,g),Bl(g),F&4&&LW(g);break;case 21:break;default:Fc(w,g),Bl(g)}}function Bl(g){var w=g.flags;if(w&2){try{e:{for(var A=g.return;A!==null;){if(jW(A)){var F=A;break e}A=A.return}throw Error(n(160))}switch(F.tag){case 5:var K=F.stateNode;F.flags&32&&(se(K,""),F.flags&=-33);var Q=NW(g);QA(g,Q,K);break;case 3:case 4:var re=F.stateNode.containerInfo,ge=NW(g);YA(g,ge,re);break;default:throw Error(n(161))}}catch(Se){fi(g,g.return,Se)}g.flags&=-3}w&4096&&(g.flags&=-4097)}function O5e(g,w,A){Xt=g,FW(g)}function FW(g,w,A){for(var F=(g.mode&1)!==0;Xt!==null;){var K=Xt,Q=K.child;if(K.tag===22&&F){var re=K.memoizedState!==null||a4;if(!re){var ge=K.alternate,Se=ge!==null&&ge.memoizedState!==null||Ys;ge=a4;var Fe=Ys;if(a4=re,(Ys=Se)&&!Fe)for(Xt=K;Xt!==null;)re=Xt,Se=re.child,re.tag===22&&re.memoizedState!==null?WW(K):Se!==null?(Se.return=re,Xt=Se):WW(K);for(;Q!==null;)Xt=Q,FW(Q),Q=Q.sibling;Xt=K,a4=ge,Ys=Fe}UW(g)}else(K.subtreeFlags&8772)!==0&&Q!==null?(Q.return=K,Xt=Q):UW(g)}}function UW(g){for(;Xt!==null;){var w=Xt;if((w.flags&8772)!==0){var A=w.alternate;try{if((w.flags&8772)!==0)switch(w.tag){case 0:case 11:case 15:Ys||c4(5,w);break;case 1:var F=w.stateNode;if(w.flags&4&&!Ys)if(A===null)F.componentDidMount();else{var K=w.elementType===w.type?A.memoizedProps:Lc(w.type,A.memoizedProps);F.componentDidUpdate(K,A.memoizedState,F.__reactInternalSnapshotBeforeUpdate)}var Q=w.updateQueue;Q!==null&&zz(w,Q,F);break;case 3:var re=w.updateQueue;if(re!==null){if(A=null,w.child!==null)switch(w.child.tag){case 5:A=w.child.stateNode;break;case 1:A=w.child.stateNode}zz(w,re,A)}break;case 5:var ge=w.stateNode;if(A===null&&w.flags&4){A=ge;var Se=w.memoizedProps;switch(w.type){case"button":case"input":case"select":case"textarea":Se.autoFocus&&A.focus();break;case"img":Se.src&&(A.src=Se.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(w.memoizedState===null){var Fe=w.alternate;if(Fe!==null){var ut=Fe.memoizedState;if(ut!==null){var gt=ut.dehydrated;gt!==null&&ct(gt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Ys||w.flags&512&&ZA(w)}catch(lt){fi(w,w.return,lt)}}if(w===g){Xt=null;break}if(A=w.sibling,A!==null){A.return=w.return,Xt=A;break}Xt=w.return}}function zW(g){for(;Xt!==null;){var w=Xt;if(w===g){Xt=null;break}var A=w.sibling;if(A!==null){A.return=w.return,Xt=A;break}Xt=w.return}}function WW(g){for(;Xt!==null;){var w=Xt;try{switch(w.tag){case 0:case 11:case 15:var A=w.return;try{c4(4,w)}catch(Se){fi(w,A,Se)}break;case 1:var F=w.stateNode;if(typeof F.componentDidMount=="function"){var K=w.return;try{F.componentDidMount()}catch(Se){fi(w,K,Se)}}var Q=w.return;try{ZA(w)}catch(Se){fi(w,Q,Se)}break;case 5:var re=w.return;try{ZA(w)}catch(Se){fi(w,re,Se)}}}catch(Se){fi(w,w.return,Se)}if(w===g){Xt=null;break}var ge=w.sibling;if(ge!==null){ge.return=w.return,Xt=ge;break}Xt=w.return}}var j5e=Math.ceil,l4=_.ReactCurrentDispatcher,XA=_.ReactCurrentOwner,Ga=_.ReactCurrentBatchConfig,Yn=0,Xi=null,Pi=null,bs=0,Ca=0,jg=Th(0),Vi=0,Lw=null,Up=0,u4=0,JA=0,Bw=null,Fo=null,ek=0,Ng=1/0,Qu=null,d4=!1,tk=null,Nh=null,h4=!1,Dh=null,f4=0,Fw=0,nk=null,p4=-1,g4=0;function vo(){return(Yn&6)!==0?at():p4!==-1?p4:p4=at()}function Lh(g){return(g.mode&1)===0?1:(Yn&2)!==0&&bs!==0?bs&-bs:w5e.transition!==null?(g4===0&&(g4=bx()),g4):(g=ir,g!==0||(g=window.event,g=g===void 0?16:gw(g.type)),g)}function Uc(g,w,A,F){if(50<Fw)throw Fw=0,nk=null,Error(n(185));Tp(g,A,F),((Yn&2)===0||g!==Xi)&&(g===Xi&&((Yn&2)===0&&(u4|=A),Vi===4&&Bh(g,bs)),Uo(g,F),A===1&&Yn===0&&(w.mode&1)===0&&(Ng=at()+500,Wx&&Rh()))}function Uo(g,w){var A=g.callbackNode;US(g,w);var F=dg(g,g===Xi?bs:0);if(F===0)A!==null&&we(A),g.callbackNode=null,g.callbackPriority=0;else if(w=F&-F,g.callbackPriority!==w){if(A!=null&&we(A),w===1)g.tag===0?y5e(VW.bind(null,g)):Tz(VW.bind(null,g)),f5e(function(){(Yn&6)===0&&Rh()}),A=null;else{switch(xx(F)){case 1:A=Dt;break;case 4:A=zt;break;case 16:A=kn;break;case 536870912:A=Hn;break;default:A=kn}A=JW(A,HW.bind(null,g))}g.callbackPriority=w,g.callbackNode=A}}function HW(g,w){if(p4=-1,g4=0,(Yn&6)!==0)throw Error(n(327));var A=g.callbackNode;if(Dg()&&g.callbackNode!==A)return null;var F=dg(g,g===Xi?bs:0);if(F===0)return null;if((F&30)!==0||(F&g.expiredLanes)!==0||w)w=m4(g,F);else{w=F;var K=Yn;Yn|=2;var Q=KW();(Xi!==g||bs!==w)&&(Qu=null,Ng=at()+500,Wp(g,w));do try{L5e();break}catch(ge){qW(g,ge)}while(!0);bA(),l4.current=Q,Yn=K,Pi!==null?w=0:(Xi=null,bs=0,w=Vi)}if(w!==0){if(w===2&&(K=lw(g),K!==0&&(F=K,w=rk(g,K))),w===1)throw A=Lw,Wp(g,0),Bh(g,F),Uo(g,at()),A;if(w===6)Bh(g,F);else{if(K=g.current.alternate,(F&30)===0&&!N5e(K)&&(w=m4(g,F),w===2&&(Q=lw(g),Q!==0&&(F=Q,w=rk(g,Q))),w===1))throw A=Lw,Wp(g,0),Bh(g,F),Uo(g,at()),A;switch(g.finishedWork=K,g.finishedLanes=F,w){case 0:case 1:throw Error(n(345));case 2:Hp(g,Fo,Qu);break;case 3:if(Bh(g,F),(F&130023424)===F&&(w=ek+500-at(),10<w)){if(dg(g,0)!==0)break;if(K=g.suspendedLanes,(K&F)!==F){vo(),g.pingedLanes|=g.suspendedLanes&K;break}g.timeoutHandle=lA(Hp.bind(null,g,Fo,Qu),w);break}Hp(g,Fo,Qu);break;case 4:if(Bh(g,F),(F&4194240)===F)break;for(w=g.eventTimes,K=-1;0<F;){var re=31-Fn(F);Q=1<<re,re=w[re],re>K&&(K=re),F&=~Q}if(F=K,F=at()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*j5e(F/1960))-F,10<F){g.timeoutHandle=lA(Hp.bind(null,g,Fo,Qu),F);break}Hp(g,Fo,Qu);break;case 5:Hp(g,Fo,Qu);break;default:throw Error(n(329))}}}return Uo(g,at()),g.callbackNode===A?HW.bind(null,g):null}function rk(g,w){var A=Bw;return g.current.memoizedState.isDehydrated&&(Wp(g,w).flags|=256),g=m4(g,w),g!==2&&(w=Fo,Fo=A,w!==null&&ik(w)),g}function ik(g){Fo===null?Fo=g:Fo.push.apply(Fo,g)}function N5e(g){for(var w=g;;){if(w.flags&16384){var A=w.updateQueue;if(A!==null&&(A=A.stores,A!==null))for(var F=0;F<A.length;F++){var K=A[F],Q=K.getSnapshot;K=K.value;try{if(!Nc(Q(),K))return!1}catch{return!1}}}if(A=w.child,w.subtreeFlags&16384&&A!==null)A.return=w,w=A;else{if(w===g)break;for(;w.sibling===null;){if(w.return===null||w.return===g)return!0;w=w.return}w.sibling.return=w.return,w=w.sibling}}return!0}function Bh(g,w){for(w&=~JA,w&=~u4,g.suspendedLanes|=w,g.pingedLanes&=~w,g=g.expirationTimes;0<w;){var A=31-Fn(w),F=1<<A;g[A]=-1,w&=~F}}function VW(g){if((Yn&6)!==0)throw Error(n(327));Dg();var w=dg(g,0);if((w&1)===0)return Uo(g,at()),null;var A=m4(g,w);if(g.tag!==0&&A===2){var F=lw(g);F!==0&&(w=F,A=rk(g,F))}if(A===1)throw A=Lw,Wp(g,0),Bh(g,w),Uo(g,at()),A;if(A===6)throw Error(n(345));return g.finishedWork=g.current.alternate,g.finishedLanes=w,Hp(g,Fo,Qu),Uo(g,at()),null}function sk(g,w){var A=Yn;Yn|=1;try{return g(w)}finally{Yn=A,Yn===0&&(Ng=at()+500,Wx&&Rh())}}function zp(g){Dh!==null&&Dh.tag===0&&(Yn&6)===0&&Dg();var w=Yn;Yn|=1;var A=Ga.transition,F=ir;try{if(Ga.transition=null,ir=1,g)return g()}finally{ir=F,Ga.transition=A,Yn=w,(Yn&6)===0&&Rh()}}function ok(){Ca=jg.current,Or(jg)}function Wp(g,w){g.finishedWork=null,g.finishedLanes=0;var A=g.timeoutHandle;if(A!==-1&&(g.timeoutHandle=-1,h5e(A)),Pi!==null)for(A=Pi.return;A!==null;){var F=A;switch(gA(F),F.tag){case 1:F=F.type.childContextTypes,F!=null&&Ux();break;case 3:Rg(),Or(Do),Or(Ks),$A();break;case 5:AA(F);break;case 4:Rg();break;case 13:Or(ni);break;case 19:Or(ni);break;case 10:xA(F.type._context);break;case 22:case 23:ok()}A=A.return}if(Xi=g,Pi=g=Fh(g.current,null),bs=Ca=w,Vi=0,Lw=null,JA=u4=Up=0,Fo=Bw=null,
vendor: 7,053 bytes, line 57
57Lp!==null){for(w=0;w<Lp.length;w++)if(A=Lp[w],F=A.interleaved,F!==null){A.interleaved=null;var K=F.next,Q=A.pending;if(Q!==null){var re=Q.next;Q.next=K,F.next=re}A.pending=F}Lp=null}return g}function qW(g,w){do{var A=Pi;try{if(bA(),Jx.current=r4,e4){for(var F=ri.memoizedState;F!==null;){var K=F.queue;K!==null&&(K.pending=null),F=F.next}e4=!1}if(Fp=0,Qi=Hi=ri=null,Rw=!1,Mw=0,XA.current=null,A===null||A.return===null){Vi=1,Lw=w,Pi=null;break}e:{var Q=g,re=A.return,ge=A,Se=w;if(w=bs,ge.flags|=32768,Se!==null&&typeof Se=="object"&&typeof Se.then=="function"){var Fe=Se,ut=ge,gt=ut.tag;if((ut.mode&1)===0&&(gt===0||gt===11||gt===15)){var lt=ut.alternate;lt?(ut.updateQueue=lt.updateQueue,ut.memoizedState=lt.memoizedState,ut.lanes=lt.lanes):(ut.updateQueue=null,ut.memoizedState=null)}var Kt=yW(re);if(Kt!==null){Kt.flags&=-257,wW(Kt,re,ge,Q,w),Kt.mode&1&&mW(Q,Fe,w),w=Kt,Se=Fe;var Jt=w.updateQueue;if(Jt===null){var nn=new Set;nn.add(Se),w.updateQueue=nn}else Jt.add(Se);break e}else{if((w&1)===0){mW(Q,Fe,w),ak();break e}Se=Error(n(426))}}else if(qr&&ge.mode&1){var xi=yW(re);if(xi!==null){(xi.flags&65536)===0&&(xi.flags|=256),wW(xi,re,ge,Q,w),wA(Mg(Se,ge));break e}}Q=Se=Mg(Se,ge),Vi!==4&&(Vi=2),Bw===null?Bw=[Q]:Bw.push(Q),Q=re;do{switch(Q.tag){case 3:Q.flags|=65536,w&=-w,Q.lanes|=w;var Re=pW(Q,Se,w);Uz(Q,Re);break e;case 1:ge=Se;var Ae=Q.type,Oe=Q.stateNode;if((Q.flags&128)===0&&(typeof Ae.getDerivedStateFromError=="function"||Oe!==null&&typeof Oe.componentDidCatch=="function"&&(Nh===null||!Nh.has(Oe)))){Q.flags|=65536,w&=-w,Q.lanes|=w;var bt=gW(Q,ge,w);Uz(Q,bt);break e}}Q=Q.return}while(Q!==null)}ZW(A)}catch(rn){w=rn,Pi===A&&A!==null&&(Pi=A=A.return);continue}break}while(!0)}function KW(){var g=l4.current;return l4.current=r4,g===null?r4:g}function ak(){(Vi===0||Vi===3||Vi===2)&&(Vi=4),Xi===null||(Up&268435455)===0&&(u4&268435455)===0||Bh(Xi,bs)}function m4(g,w){var A=Yn;Yn|=2;var F=KW();(Xi!==g||bs!==w)&&(Qu=null,Wp(g,w));do try{D5e();break}catch(K){qW(g,K)}while(!0);if(bA(),Yn=A,l4.current=F,Pi!==null)throw Error(n(261));return Xi=null,bs=0,Vi}function D5e(){for(;Pi!==null;)GW(Pi)}function L5e(){for(;Pi!==null&&!Te();)GW(Pi)}function GW(g){var w=XW(g.alternate,g,Ca);g.memoizedProps=g.pendingProps,w===null?ZW(g):Pi=w,XA.current=null}function ZW(g){var w=g;do{var A=w.alternate;if(g=w.return,(w.flags&32768)===0){if(A=T5e(A,w,Ca),A!==null){Pi=A;return}}else{if(A=P5e(A,w),A!==null){A.flags&=32767,Pi=A;return}if(g!==null)g.flags|=32768,g.subtreeFlags=0,g.deletions=null;else{Vi=6,Pi=null;return}}if(w=w.sibling,w!==null){Pi=w;return}Pi=w=g}while(w!==null);Vi===0&&(Vi=5)}function Hp(g,w,A){var F=ir,K=Ga.transition;try{Ga.transition=null,ir=1,B5e(g,w,A,F)}finally{Ga.transition=K,ir=F}return null}function B5e(g,w,A,F){do Dg();while(Dh!==null);if((Yn&6)!==0)throw Error(n(327));A=g.finishedWork;var K=g.finishedLanes;if(A===null)return null;if(g.finishedWork=null,g.finishedLanes=0,A===g.current)throw Error(n(177));g.callbackNode=null,g.callbackPriority=0;var Q=A.lanes|A.childLanes;if(zS(g,Q),g===Xi&&(Pi=Xi=null,bs=0),(A.subtreeFlags&2064)===0&&(A.flags&2064)===0||h4||(h4=!0,JW(kn,function(){return Dg(),null})),Q=(A.flags&15990)!==0,(A.subtreeFlags&15990)!==0||Q){Q=Ga.transition,Ga.transition=null;var re=ir;ir=1;var ge=Yn;Yn|=4,XA.current=null,M5e(g,A),BW(A,g),s5e(aA),Rr=!!oA,aA=oA=null,g.current=A,O5e(A),Ct(),Yn=ge,ir=re,Ga.transition=Q}else g.current=A;if(h4&&(h4=!1,Dh=g,f4=K),Q=g.pendingLanes,Q===0&&(Nh=null),Er(A.stateNode),Uo(g,at()),w!==null)for(F=g.onRecoverableError,A=0;A<w.length;A++)K=w[A],F(K.value,{componentStack:K.stack,digest:K.digest});if(d4)throw d4=!1,g=tk,tk=null,g;return(f4&1)!==0&&g.tag!==0&&Dg(),Q=g.pendingLanes,(Q&1)!==0?g===nk?Fw++:(Fw=0,nk=g):Fw=0,Rh(),null}function Dg(){if(Dh!==null){var g=xx(f4),w=Ga.transition,A=ir;try{if(Ga.transition=null,ir=16>g?16:g,Dh===null)var F=!1;else{if(g=Dh,Dh=null,f4=0,(Yn&6)!==0)throw Error(n(331));var K=Yn;for(Yn|=4,Xt=g.current;Xt!==null;){var Q=Xt,re=Q.child;if((Xt.flags&16)!==0){var ge=Q.deletions;if(ge!==null){for(var Se=0;Se<ge.length;Se++){var Fe=ge[Se];for(Xt=Fe;Xt!==null;){var ut=Xt;switch(ut.tag){case 0:case 11:case 15:Dw(8,ut,Q)}var gt=ut.child;if(gt!==null)gt.return=ut,Xt=gt;else for(;Xt!==null;){ut=Xt;var lt=ut.sibling,Kt=ut.return;if(OW(ut),ut===Fe){Xt=null;break}if(lt!==null){lt.return=Kt,Xt=lt;break}Xt=Kt}}}var Jt=Q.alternate;if(Jt!==null){var nn=Jt.child;if(nn!==null){Jt.child=null;do{var xi=nn.sibling;nn.sibling=null,nn=xi}while(nn!==null)}}Xt=Q}}if((Q.subtreeFlags&2064)!==0&&re!==null)re.return=Q,Xt=re;else e:for(;Xt!==null;){if(Q=Xt,(Q.flags&2048)!==0)switch(Q.tag){case 0:case 11:case 15:Dw(9,Q,Q.return)}var Re=Q.sibling;if(Re!==null){Re.return=Q.return,Xt=Re;break e}Xt=Q.return}}var Ae=g.current;for(Xt=Ae;Xt!==null;){re=Xt;var Oe=re.child;if((re.subtreeFlags&2064)!==0&&Oe!==null)Oe.return=re,Xt=Oe;else e:for(re=Ae;Xt!==null;){if(ge=Xt,(ge.flags&2048)!==0)try{switch(ge.tag){case 0:case 11:case 15:c4(9,ge)}}catch(rn){fi(ge,ge.return,rn)}if(ge===re){Xt=null;break e}var bt=ge.sibling;if(bt!==null){bt.return=ge.return,Xt=bt;break e}Xt=ge.return}}if(Yn=K,Rh(),hr&&typeof hr.onPostCommitFiberRoot=="function")try{hr.onPostCommitFiberRoot(xr,g)}catch{}F=!0}return F}finally{ir=A,Ga.transition=w}}return!1}function YW(g,w,A){w=Mg(A,w),w=pW(g,w,1),g=Oh(g,w,1),w=vo(),g!==null&&(Tp(g,1,w),Uo(g,w))}function fi(g,w,A){if(g.tag===3)YW(g,g,A);else for(;w!==null;){if(w.tag===3){YW(w,g,A);break}else if(w.tag===1){var F=w.stateNode;if(typeof w.type.getDerivedStateFromError=="function"||typeof F.componentDidCatch=="function"&&(Nh===null||!Nh.has(F))){g=Mg(A,g),g=gW(w,g,1),w=Oh(w,g,1),g=vo(),w!==null&&(Tp(w,1,g),Uo(w,g));break}}w=w.return}}function F5e(g,w,A){var F=g.pingCache;F!==null&&F.delete(w),w=vo(),g.pingedLanes|=g.suspendedLanes&A,Xi===g&&(bs&A)===A&&(Vi===4||Vi===3&&(bs&130023424)===bs&&500>at()-ek?Wp(g,0):JA|=A),Uo(g,w)}function QW(g,w){w===0&&((g.mode&1)===0?w=1:(w=ug,ug<<=1,(ug&130023424)===0&&(ug=4194304)));var A=vo();g=Gu(g,w),g!==null&&(Tp(g,w,A),Uo(g,A))}function U5e(g){var w=g.memoizedState,A=0;w!==null&&(A=w.retryLane),QW(g,A)}function z5e(g,w){var A=0;switch(g.tag){case 13:var F=g.stateNode,K=g.memoizedState;K!==null&&(A=K.retryLane);break;case 19:F=g.stateNode;break;default:throw Error(n(314))}F!==null&&F.delete(w),QW(g,A)}var XW;XW=function(g,w,A){if(g!==null)if(g.memoizedProps!==w.pendingProps||Do.current)Bo=!0;else{if((g.lanes&A)===0&&(w.flags&128)===0)return Bo=!1,I5e(g,w,A);Bo=(g.flags&131072)!==0}else Bo=!1,qr&&(w.flags&1048576)!==0&&Pz(w,Vx,w.index);switch(w.lanes=0,w.tag){case 2:var F=w.type;o4(g,w),g=w.pendingProps;var K=Sg(w,Ks.current);Pg(w,A),K=PA(null,w,F,g,K,A);var Q=RA();return w.flags|=1,typeof K=="object"&&K!==null&&typeof K.render=="function"&&K.$$typeof===void 0?(w.tag=1,w.memoizedState=null,w.updateQueue=null,Lo(F)?(Q=!0,zx(w)):Q=!1,w.memoizedState=K.state!==null&&K.state!==void 0?K.state:null,_A(w),K.updater=i4,w.stateNode=K,K._reactInternals=w,LA(w,F,g,A),w=zA(null,w,F,!0,Q,A)):(w.tag=0,qr&&Q&&pA(w),wo(null,w,K,A),w=w.child),w;case 16:F=w.elementType;
vendor: 10,974 bytes, line 57
57e:{switch(o4(g,w),g=w.pendingProps,K=F._init,F=K(F._payload),w.type=F,K=w.tag=H5e(F),g=Lc(F,g),K){case 0:w=UA(null,w,F,g,A);break e;case 1:w=_W(null,w,F,g,A);break e;case 11:w=vW(null,w,F,g,A);break e;case 14:w=bW(null,w,F,Lc(F.type,g),A);break e}throw Error(n(306,F,""))}return w;case 0:return F=w.type,K=w.pendingProps,K=w.elementType===F?K:Lc(F,K),UA(g,w,F,K,A);case 1:return F=w.type,K=w.pendingProps,K=w.elementType===F?K:Lc(F,K),_W(g,w,F,K,A);case 3:e:{if(SW(w),g===null)throw Error(n(387));F=w.pendingProps,Q=w.memoizedState,K=Q.element,Fz(g,w),Qx(w,F,null,A);var re=w.memoizedState;if(F=re.element,Q.isDehydrated)if(Q={element:F,isDehydrated:!1,cache:re.cache,pendingSuspenseBoundaries:re.pendingSuspenseBoundaries,transitions:re.transitions},w.updateQueue.baseState=Q,w.memoizedState=Q,w.flags&256){K=Mg(Error(n(423)),w),w=AW(g,w,F,A,K);break e}else if(F!==K){K=Mg(Error(n(424)),w),w=AW(g,w,F,A,K);break e}else for(Ea=Ih(w.stateNode.containerInfo.firstChild),xa=w,qr=!0,Dc=null,A=Lz(w,null,F,A),w.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if($g(),F===K){w=Yu(g,w,A);break e}wo(g,w,F,A)}w=w.child}return w;case 5:return Wz(w),g===null&&yA(w),F=w.type,K=w.pendingProps,Q=g!==null?g.memoizedProps:null,re=K.children,cA(F,K)?re=null:Q!==null&&cA(F,Q)&&(w.flags|=32),CW(g,w),wo(g,w,re,A),w.child;case 6:return g===null&&yA(w),null;case 13:return kW(g,w,A);case 4:return SA(w,w.stateNode.containerInfo),F=w.pendingProps,g===null?w.child=Ig(w,null,F,A):wo(g,w,F,A),w.child;case 11:return F=w.type,K=w.pendingProps,K=w.elementType===F?K:Lc(F,K),vW(g,w,F,K,A);case 7:return wo(g,w,w.pendingProps,A),w.child;case 8:return wo(g,w,w.pendingProps.children,A),w.child;case 12:return wo(g,w,w.pendingProps.children,A),w.child;case 10:e:{if(F=w.type._context,K=w.pendingProps,Q=w.memoizedProps,re=K.value,kr(Gx,F._currentValue),F._currentValue=re,Q!==null)if(Nc(Q.value,re)){if(Q.children===K.children&&!Do.current){w=Yu(g,w,A);break e}}else for(Q=w.child,Q!==null&&(Q.return=w);Q!==null;){var ge=Q.dependencies;if(ge!==null){re=Q.child;for(var Se=ge.firstContext;Se!==null;){if(Se.context===F){if(Q.tag===1){Se=Zu(-1,A&-A),Se.tag=2;var Fe=Q.updateQueue;if(Fe!==null){Fe=Fe.shared;var ut=Fe.pending;ut===null?Se.next=Se:(Se.next=ut.next,ut.next=Se),Fe.pending=Se}}Q.lanes|=A,Se=Q.alternate,Se!==null&&(Se.lanes|=A),EA(Q.return,A,w),ge.lanes|=A;break}Se=Se.next}}else if(Q.tag===10)re=Q.type===w.type?null:Q.child;else if(Q.tag===18){if(re=Q.return,re===null)throw Error(n(341));re.lanes|=A,ge=re.alternate,ge!==null&&(ge.lanes|=A),EA(re,A,w),re=Q.sibling}else re=Q.child;if(re!==null)re.return=Q;else for(re=Q;re!==null;){if(re===w){re=null;break}if(Q=re.sibling,Q!==null){Q.return=re.return,re=Q;break}re=re.return}Q=re}wo(g,w,K.children,A),w=w.child}return w;case 9:return K=w.type,F=w.pendingProps.children,Pg(w,A),K=qa(K),F=F(K),w.flags|=1,wo(g,w,F,A),w.child;case 14:return F=w.type,K=Lc(F,w.pendingProps),K=Lc(F.type,K),bW(g,w,F,K,A);case 15:return xW(g,w,w.type,w.pendingProps,A);case 17:return F=w.type,K=w.pendingProps,K=w.elementType===F?K:Lc(F,K),o4(g,w),w.tag=1,Lo(F)?(g=!0,zx(w)):g=!1,Pg(w,A),hW(w,F,K),LA(w,F,K,A),zA(null,w,F,!0,g,A);case 19:return IW(g,w,A);case 22:return EW(g,w,A)}throw Error(n(156,w.tag))};function JW(g,w){return me(g,w)}function W5e(g,w,A,F){this.tag=g,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=w,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Za(g,w,A,F){return new W5e(g,w,A,F)}function ck(g){return g=g.prototype,!(!g||!g.isReactComponent)}function H5e(g){if(typeof g=="function")return ck(g)?1:0;if(g!=null){if(g=g.$$typeof,g===z)return 11;if(g===k)return 14}return 2}function Fh(g,w){var A=g.alternate;return A===null?(A=Za(g.tag,w,g.key,g.mode),A.elementType=g.elementType,A.type=g.type,A.stateNode=g.stateNode,A.alternate=g,g.alternate=A):(A.pendingProps=w,A.type=g.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=g.flags&14680064,A.childLanes=g.childLanes,A.lanes=g.lanes,A.child=g.child,A.memoizedProps=g.memoizedProps,A.memoizedState=g.memoizedState,A.updateQueue=g.updateQueue,w=g.dependencies,A.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext},A.sibling=g.sibling,A.index=g.index,A.ref=g.ref,A}function y4(g,w,A,F,K,Q){var re=2;if(F=g,typeof g=="function")ck(g)&&(re=1);else if(typeof g=="string")re=5;else e:switch(g){case R:return Vp(A.children,K,Q,w);case N:re=8,K|=8;break;case T:return g=Za(12,A,w,K|2),g.elementType=T,g.lanes=Q,g;case L:return g=Za(13,A,w,K),g.elementType=L,g.lanes=Q,g;case S:return g=Za(19,A,w,K),g.elementType=S,g.lanes=Q,g;case W:return w4(A,K,Q,w);default:if(typeof g=="object"&&g!==null)switch(g.$$typeof){case O:re=10;break e;case U:re=9;break e;case z:re=11;break e;case k:re=14;break e;case M:re=16,F=null;break e}throw Error(n(130,g==null?g:typeof g,""))}return w=Za(re,A,w,K),w.elementType=g,w.type=F,w.lanes=Q,w}function Vp(g,w,A,F){return g=Za(7,g,F,w),g.lanes=A,g}function w4(g,w,A,F){return g=Za(22,g,F,w),g.elementType=W,g.lanes=A,g.stateNode={isHidden:!1},g}function lk(g,w,A){return g=Za(6,g,null,w),g.lanes=A,g}function uk(g,w,A){return w=Za(4,g.children!==null?g.children:[],g.key,w),w.lanes=A,w.stateNode={containerInfo:g.containerInfo,pendingChildren:null,implementation:g.implementation},w}function V5e(g,w,A,F,K){this.tag=w,this.containerInfo=g,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=uw(0),this.expirationTimes=uw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uw(0),this.identifierPrefix=F,this.onRecoverableError=K,this.mutableSourceEagerHydrationData=null}function dk(g,w,A,F,K,Q,re,ge,Se){return g=new V5e(g,w,A,ge,Se),w===1?(w=1,Q===!0&&(w|=8)):w=0,Q=Za(3,null,null,w),g.current=Q,Q.stateNode=g,Q.memoizedState={element:F,isDehydrated:A,cache:null,transitions:null,pendingSuspenseBoundaries:null},_A(Q),g}function q5e(g,w,A){var F=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:F==null?null:""+F,children:g,containerInfo:w,implementation:A}}function eH(g){if(!g)return Ph;g=g._reactInternals;e:{if(X(g)!==g||g.tag!==1)throw Error(n(170));var w=g;do{switch(w.tag){case 3:w=w.stateNode.context;break e;case 1:if(Lo(w.type)){w=w.stateNode.__reactInternalMemoizedMergedChildContext;break e}}w=w.return}while(w!==null);throw Error(n(171))}if(g.tag===1){var A=g.type;if(Lo(A))return $z(g,A,w)}return w}function tH(g,w,A,F,K,Q,re,ge,Se){return g=dk(A,F,!0,g,K,Q,re,ge,Se),g.context=eH(null),A=g.current,F=vo(),K=Lh(A),Q=Zu(F,K),Q.callback=w??null,Oh(A,Q,K),g.current.lanes=K,Tp(g,K,F),Uo(g,F),g}function v4(g,w,A,F){var K=w.current,Q=vo(),re=Lh(K);return A=eH(A),w.context===null?w.context=A:w.pendingContext=A,w=Zu(Q,re),w.payload={element:g},F=F===void 0?null:F,F!==null&&(w.callback=F),g=Oh(K,w,re),g!==null&&(Uc(g,K,re,Q),Yx(g,K,re)),re}function b4(g){if(g=g.current,!g.child)return null;switch(g.child.tag){case 5:return g.child.stateNode;default:return g.child.stateNode}}function nH(g,w){if(g=g.memoizedState,g!==null&&g.dehydrated!==null){var A=g.retryLane;g.retryLane=A!==0&&A<w?A:w}}function hk(g,w){nH(g,w),(g=g.alternate)&&nH(g,w)}function K5e(){return null}var rH=typeof reportError=="function"?reportError:function(g){console.error(g)};function fk(g){this._internalRoot=g}x4.prototype.render=fk.prototype.render=function(g){var w=this._internalRoot;if(w===null)throw Error(n(409));v4(g,w,null,null)},x4.prototype.unmount=fk.prototype.unmount=function(){var g=this._internalRoot;if(g!==null){this._internalRoot=null;var w=g.containerInfo;zp(function(){v4(null,g,null,null)}),w[Hu]=null}};function x4(g){this._internalRoot=g}x4.prototype.unstable_scheduleHydration=function(g){if(g){var w=_x();g={blockedOn:null,target:g,priority:w};for(var A=0;A<jl.length&&w!==0&&w<jl[A].priority;A++);jl.splice(A,0,g),A===0&&$x(g)}};function pk(g){return!(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)}function E4(g){return!(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11&&(g.nodeType!==8||g.nodeValue!==" react-mount-point-unstable "))}function iH(){}function G5e(g,w,A,F,K){if(K){if(typeof F=="function"){var Q=F;F=function(){var Fe=b4(re);Q.call(Fe)}}var re=tH(w,F,g,0,null,!1,!1,"",iH);return g._reactRootContainer=re,g[Hu]=re.current,_w(g.nodeType===8?g.parentNode:g),zp(),re}for(;K=g.lastChild;)g.removeChild(K);if(typeof F=="function"){var ge=F;F=function(){var Fe=b4(Se);ge.call(Fe)}}var Se=dk(g,0,!1,null,null,!1,!1,"",iH);return g._reactRootContainer=Se,g[Hu]=Se.current,_w(g.nodeType===8?g.parentNode:g),zp(function(){v4(w,Se,A,F)}),Se}function C4(g,w,A,F,K){var Q=A._reactRootContainer;if(Q){var re=Q;if(typeof K=="function"){var ge=K;K=function(){var Se=b4(re);ge.call(Se)}}v4(w,re,g,K)}else re=G5e(A,w,g,K,F);return b4(re)}Ex=function(g){switch(g.tag){case 3:var w=g.stateNode;if(w.current.memoizedState.isDehydrated){var A=Ip(w.pendingLanes);A!==0&&(dw(w,A|1),Uo(w,at()),(Yn&6)===0&&(Ng=at()+500,Rh()))}break;case 13:zp(function(){var F=Gu(g,1);if(F!==null){var K=vo();Uc(F,g,1,K)}}),hk(g,1)}},hw=function(g){if(g.tag===13){var w=Gu(g,134217728);if(w!==null){var A=vo();Uc(w,g,134217728,A)}hk(g,134217728)}},Cx=function(g){if(g.tag===13){var w=Lh(g),A=Gu(g,w);if(A!==null){var F=vo();Uc(A,g,w,F)}hk(g,w)}},_x=function(){return ir},Sx=function(g,w){var A=ir;try{return ir=g,w()}finally{ir=A}},yr=function(g,w,A){switch(w){case"input":if(ft(g,A),w=A.name,A.type==="radio"&&w!=null){for(A=g;A.parentNode;)A=A.parentNode;for(A=A.querySelectorAll("input[name="+JSON.stringify(""+w)+'][type="radio"]'),w=0;w<A.length;w++){var F=A[w];if(F!==g&&F.form===g.form){var K=Fx(F);if(!K)throw Error(n(90));$e(F),ft(F,K)}}}break;case"textarea":tt(g,A);break;case"select":w=A.value,w!=null&&Qe(g,!!A.multiple,w,!1)}},Zt=sk,yt=zp;var Z5e={usingClientEntryPoint:!1,Events:[kw,Cg,Fx,It,rt,sk]},Uw={findFiberByHostInstance:Op,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Y5e={bundleType:Uw.bundleType,version:Uw.version,rendererPackageName:Uw.rendererPackageName,rendererConfig:Uw.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(g){return g=le(g),g===null?null:g.stateNode},findFiberByHostInstance:Uw.findFiberByHostInstance||K5e,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
57if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _4=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_4.isDisabled&&_4.supportsFiber)try{xr=_4.inject(Y5e),hr=_4}catch{}}return zo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z5e,zo.createPortal=function(g,w){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pk(w))throw Error(n(200));return q5e(g,w,null,A)},zo.createRoot=function(g,w){if(!pk(g))throw Error(n(299));var A=!1,F="",K=rH;return w!=null&&(w.unstable_strictMode===!0&&(A=!0),w.identifierPrefix!==void 0&&(F=w.identifierPrefix),w.onRecoverableError!==void 0&&(K=w.onRecoverableError)),w=dk(g,1,!1,null,null,A,!1,F,K),g[Hu]=w.current,_w(g.nodeType===8?g.parentNode:g),new fk(w)},zo.findDOMNode=function(g){if(g==null)return null;if(g.nodeType===1)return g;var w=g._reactInternals;if(w===void 0)throw typeof g.render=="function"?Error(n(188)):(g=Object.keys(g).join(","),Error(n(268,g)));return g=le(w),g=g===null?null:g.stateNode,g},zo.flushSync=function(g){return zp(g)},zo.hydrate=function(g,w,A){if(!E4(w))throw Error(n(200));return C4(null,g,w,!0,A)},zo.hydrateRoot=function(g,w,A){if(!pk(g))throw Error(n(405));var F=A!=null&&A.hydratedSources||null,K=!1,Q="",re=rH;if(A!=null&&(A.unstable_strictMode===!0&&(K=!0),A.identifierPrefix!==void 0&&(Q=A.identifierPrefix),A.onRecoverableError!==void 0&&(re=A.onRecoverableError)),w=tH(w,null,g,1,A??null,K,!1,Q,re),g[Hu]=w.current,_w(g),F)for(g=0;g<F.length;g++)A=F[g],K=A._getVersion,K=K(A._source),w.mutableSourceEagerHydrationData==null?w.mutableSourceEagerHydrationData=[A,K]:w.mutableSourceEagerHydrationData.push(A,K);return new x4(w)},zo.render=function(g,w,A){if(!E4(w))throw Error(n(200));return C4(null,g,w,!1,A)},zo.unmountComponentAtNode=function(g){if(!E4(g))throw Error(n(40));return g._reactRootContainer?(zp(function(){C4(null,null,g,!1,function(){g._reactRootContainer=null,g[Hu]=null})}),!0):!1},zo.unstable_batchedUpdates=sk,zo.unstable_renderSubtreeIntoContainer=function(g,w,A,F){if(!E4(A))throw Error(n(200));if(g==null||g._reactInternals===void 0)throw Error(n(38));return C4(g,w,A,!1,F)},zo.version="18.3.1-next-f1338f8080-20240426",zo}var SH;function rse(){if(SH)return kk.exports;SH=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),kk.exports=e4e(),kk.exports}var xc=rse();const t4e=ys(xc),Lv=typeof window<"u"?E.useLayoutEffect:E.useEffect;function Tk(t){const e=E.useRef({value:t,prev:null}),n=e.current.value;return t!==n&&(e.current={value:t,prev:n}),e.current.prev}function n4e(t,e,n={},r={}){const i=E.useRef(typeof IntersectionObserver=="function"),s=E.useRef(null);return E.useEffect(()=>{if(!(!t.current||!i.current||r.disabled))return s.current=new IntersectionObserver(([o])=>{e(o)},n),s.current.observe(t.current),()=>{var o;(o=s.current)==null||o.disconnect()}},[e,n,r.disabled,t]),s.current}function r4e(t){const e=E.useRef(null);return E.useImperativeHandle(t,()=>e.current,[]),e}function i4e(t,e){const n=$c(),[r,i]=E.useState(!1),s=E.useRef(!1),o=r4e(e),{activeProps:a=()=>({className:"active"}),inactiveProps:c=()=>({}),activeOptions:l,to:u,preload:d,preloadDelay:h,hashScrollIntoView:f,replace:m,startTransition:y,resetScroll:v,viewTransition:b,children:C,target:x,disabled:_,style:$,className:I,onClick:R,onFocus:N,onMouseEnter:T,onMouseLeave:O,onTouchStart:U,ignoreBlocker:z,...L}=t,{params:S,search:k,hash:M,state:W,mask:H,reloadDocument:D,...V}=L,B=E.useMemo(()=>{try{return new URL(`${u}`),"external"}catch{}return"internal"},[u]),P=Ds({select:Qe=>Qe.location.search,structuralSharing:!0}),j=bc({strict:!1,select:Qe=>Qe.fullPath}),G=t.from??j;t={...t,from:G};const Y=E.useMemo(()=>n.buildLocation(t),[n,t,P]),te=E.useMemo(()=>t.reloadDocument?!1:d??n.options.defaultPreload,[n.options.defaultPreload,d,t.reloadDocument]),ae=h??n.options.defaultPreloadDelay??0,oe=Ds({select:Qe=>{if(l!=null&&l.exact){if(!hxe(Qe.location.pathname,Y.pathname,n.basepath))return!1}else{const Ue=N7(Qe.location.pathname,n.basepath).split("/");if(!N7(Y.pathname,n.basepath).split("/").every((ze,Ne)=>ze===Ue[Ne]))return!1}return((l==null?void 0:l.includeSearch)??!0)&&!Zm(Qe.location.search,Y.search,{partial:!(l!=null&&l.exact),ignoreUndefined:!(l!=null&&l.explicitUndef
57ined)})?!1:l!=null&&l.includeHash?Qe.location.hash===Y.hash:!0}}),de=E.useCallback(()=>{n.preloadRoute(t).catch(Qe=>{console.warn(Qe),console.warn(Bxe)})},[t,n]),ke=E.useCallback(Qe=>{Qe!=null&&Qe.isIntersecting&&de()},[de]);if(n4e(o,ke,{rootMargin:"100px"},{disabled:!!_||te!=="viewport"}),Lv(()=>{s.current||!_&&te==="render"&&(de(),s.current=!0)},[_,de,te]),B==="external")return{...V,ref:o,type:B,href:u,...C&&{children:C},...x&&{target:x},..._&&{disabled:_},...$&&{style:$},...I&&{className:I},...R&&{onClick:R},...N&&{onFocus:N},...T&&{onMouseEnter:T},...O&&{onMouseLeave:O},...U&&{onTouchStart:U}};const Be=Qe=>{if(!_&&!s4e(Qe)&&!Qe.defaultPrevented&&(!x||x==="_self")&&Qe.button===0){Qe.preventDefault(),xc.flushSync(()=>{i(!0)});const Ue=n.subscribe("onResolved",()=>{Ue(),i(!1)});return n.navigate({...t,replace:m,resetScroll:v,hashScrollIntoView:f,startTransition:y,viewTransition:b,ignoreBlocker:z})}},$e=Qe=>{_||te&&de()},He=$e,Ge=Qe=>{if(_)return;const Ue=Qe.target||{};if(te){if(Ue.preloadTimeout)return;ae?Ue.preloadTimeout=setTimeout(()=>{Ue.preloadTimeout=null,de()},ae):de()}},je=Qe=>{if(_)return;const Ue=Qe.target||{};Ue.preloadTimeout&&(clearTimeout(Ue.preloadTimeout),Ue.preloadTimeout=null)},xt=Qe=>Ue=>{var Ye;(Ye=Ue.persist)==null||Ye.call(Ue),Qe.filter(Boolean).forEach(tt=>{Ue.defaultPrevented||tt(Ue)})},ft=oe?Z0(a,{})??{}:{},it=oe?{}:Z0(c,{}),be=[I,ft.className,it.className].filter(Boolean).join(" "),Lt={...$,...ft.style,...it.style};return{...V,...ft,...it,href:_?void 0:Y.maskedLocation?n.history.createHref(Y.maskedLocation.href):n.history.createHref(Y.href),ref:o,onClick:xt([R,Be]),onFocus:xt([N,$e]),onMouseEnter:xt([T,Ge]),onMouseLeave:xt([O,je]),onTouchStart:xt([U,He]),disabled:!!_,target:x,...Object.keys(Lt).length&&{style:Lt},...be&&{className:be},..._&&{role:"link","aria-disabled":!0},...oe&&{"data-status":"active","aria-current":"page"},...r&&{"data-transitioning":"transitioning"}}}const QN=E.forwardRef((t,e)=>{const{_asChild:n,...r}=t,{type:i,ref:s,...o}=i4e(r,e),a=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;return typeof n>"u"&&delete o.disabled,E.createElement(n||"a",{...o,ref:s},a)});function s4e(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}let o4e=class extends Jie{constructor(e){super(e),this.useMatch=n=>bc({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>bc({...n,from:this.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>YN({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>QE({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>ZN({...n,from:this.id}),this.useLoaderData=n=>GN({...n,from:this.id}),this.useNavigate=()=>XE({from:this.fullPath}),this.Link=Rt.forwardRef((n,r)=>p.jsx(QN,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function a4e(t){return new o4e(t)}class c4e extends Fxe{constructor(e){super(e),this.useMatch=n=>bc({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>bc({...n,from:this.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>YN({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>QE({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>ZN({...n,from:this.id}),this.useLoaderData=n=>GN({...n,from:this.id}),this.useNavigate=()=>XE({from:this.fullPath}),this.Link=Rt.forwardRef((n,r)=>p.jsx(QN,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function l4e(t){return new c4e(t)}function $i(t){return typeof t=="object"?new AH(t,{silent:!0}).createRoute(t):new AH(t,{silent:!0}).createRoute}class AH{constructor(e,n){this.path=e,this.createRoute=r=>{this.silent;const i=a4e(r);return i.isRoot=!1,i},this.silent=n==null?void 0:n.silent}}class kH{constructor(e){this.useMatch=n=>bc({select:n==null?void 0:n.select,from:this.options.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>bc({from:this.options.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>YN({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useParams=n=>QE({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>ZN({...n,from:this.options.id}),this.useLoaderData=n=>GN({...n,from:this.options.id}),this.useNavigate=()=>{const n=$c();return XE({from:n.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function $H(t){return typeof t=="object"?new kH(t):e=>new kH({id:t,...e})}function u4e(t){const e=Ds({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(KN,{getResetKey:()=>e,onCatch:(n,r)=>{var i;if(uc(n))(i=t.onCatch)==null||i.call(t,n,r);else throw n},errorComponent:({error:n})=>{var r;if(uc(n))return(r=t.fallback)==null?void 0:r.call(t,n);throw n},children:t.children})}function d4e(){return p.jsx("p",{children:"Not Found"})}function J6(t){return p.jsx(p.Fragment,{children:t.children})}function ise(t,e,n){return e.options.notFoundComponent?p.jsx(e.options.notFoundComponent,{data:n}):t.options.defaultNotFoundComponent?p.jsx(t.options.defaultNotFoundComponent,{data:n}):p.jsx(d4e,{})}var Pk,IH;function h4e(){if(IH)return Pk;IH=1;const t={},e=t.hasOwnProperty,n=(N,T)=>{for(const O in N)e.call(N,O)&&T(O,N[O])},r=(N,T)=>(T&&n(T,(O,U)=>{N[O]=U}),N),i=(N,T)=>{const O=N.length;let U=-1;for(;++U<O;)T(N[U])},s=N=>"\\u"+("0000"+N).slice(-4),o=(N,T)=>{let O=N.toString(16);return T?O:O.toUpperCase()},a=t.toString,c=Array.isArray,l=N=>typeof Buffer=="function"&&Buffer.isBuffer(N),u=N=>a.call(N)=="[object Object]",d=N=>typeof N=="string"||a.call(N)=="[object String]",h=N=>typeof N=="number"||a.call(N)=="[object Number]",f=N=>typeof N=="bigint",m=N=>typeof N=="function",y=N=>a.call(N)=="[object Map]",v=N=>a.call(N)=="[object Set]",b={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},C=/[\\\b\f\n\r\t]/,x=/[0-9]/,_=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,$=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,I=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,R=(N,T)=>{const O=()=>{W=M,++T.indentLevel,M=T.indent.repeat(T.indentLevel)},U={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:" ",indentLevel:0,__inline1__:!1,__inline2__:!1},z=T&&T.json;z&&(U.quotes="double",U.wrap=!0),T=r(U,T),T.quotes!="single"&&T.quotes!="double"&&T.quotes!="backtick"&&(T.quotes="single");const L=T.quotes=="double"?'"':T.quotes=="backtick"?"`":"'",S=T.compact,k=T.lowercaseHex;let M=T.indent.repeat(T.indentLevel),W="";const H=T.__inline1__,D=T.__inline2__,V=S?"":` 58`;let B,P=!0;const j=T.numbers=="binary",G=T.numbers=="octal",Y=T.numbers=="decimal",te=T.numbers=="hexadecimal";if(z&&N&&m(N.toJSON)&&(N=N.toJSON()),!d(N)){if(y(N))return N.size==0?"new Map()":(S||(T.__inline1__=!0,T.__inline2__=!1),"new Map("+R(Array.from(N),T)+")");if(v(N))return N.size==0?"new Set()":"new Set("+R(Array.from(N),T)+")";if(l(N))return N.length==0?"Buffer.from([])":"Buffer.from("+R(Array.from(N),T)+")";if(c(N))return B=[],T.wrap=!0,H&&(T.__inline1__=!1,T.__inline2__=!0),D||O(),i(N,oe=>
58{P=!1,D&&(T.__inline2__=!1),B.push((S||D?"":M)+R(oe,T))}),P?"[]":D?"["+B.join(", ")+"]":"["+V+B.join(","+V)+V+(S?"":W)+"]";if(h(N)||f(N)){if(z)return JSON.stringify(Number(N));let oe;if(Y)oe=String(N);else if(te){let de=N.toString(16);k||(de=de.toUpperCase()),oe="0x"+de}else j?oe="0b"+N.toString(2):G&&(oe="0o"+N.toString(8));return f(N)?oe+"n":oe}else return f(N)?z?JSON.stringify(Number(N)):N+"n":u(N)?(B=[],T.wrap=!0,O(),n(N,(oe,de)=>{P=!1,B.push((S?"":M)+R(oe,T)+":"+(S?"":" ")+R(de,T))}),P?"{}":"{"+V+B.join(","+V)+V+(S?"":W)+"}"):z?JSON.stringify(N)||"null":String(N)}const ae=T.escapeEverything?$:I;return B=N.replace(ae,(oe,de,ke,Be,$e,He)=>{if(de){if(T.minimal)return de;const je=de.charCodeAt(0),xt=de.charCodeAt(1);if(T.es6){const ft=(je-55296)*1024+xt-56320+65536;return"\\u{"+o(ft,k)+"}"}return s(o(je,k))+s(o(xt,k))}if(ke)return s(o(ke.charCodeAt(0),k));if(oe=="\0"&&!z&&!x.test(He.charAt($e+1)))return"\\0";if(Be)return Be==L||T.escapeEverything?"\\"+Be:Be;if(C.test(oe))return b[oe];if(T.minimal&&!_.test(oe))return oe;const Ge=o(oe.charCodeAt(0),k);return z||Ge.length>2?s(Ge):"\\x"+("00"+Ge).slice(-2)}),L=="`"&&(B=B.replace(/\$\{/g,"\\${")),T.isScriptContext&&(B=B.replace(/<\/(script|style)/gi,"<\\/$1").replace(/<!--/g,z?"\\u003C!--":"\\x3C!--")),T.wrap&&(B=L+B+L),B};return R.version="3.0.2",Pk=R,Pk}h4e();function f4e({children:t,log:e}){return typeof document<"u"?null:p.jsx("script",{className:"tsr-once",dangerouslySetInnerHTML:{__html:[t,"",'if (typeof __TSR_SSR__ !== "undefined") __TSR_SSR__.cleanScripts()'].filter(
58Boolean).join(` 59`)}})}function p4e(){const t=$c(),n=(t.options.getScrollRestorationKey||uR)(t.latestLocation),r=n!==uR(t.latestLocation)?n:null;return!t.isScrollRestoring||!t.isServer?null:p.jsx(f4e,{children:`(${Qie.toString()})(${JSON.stringify(L7)},${JSON.stringify(r)}, undefined, true)`,log:!1})}const sse=E.memo(function({matchId:e}){var n,r;const i=$c(),s=Ds({select:b=>{var C;return(C=b.matches.find(x=>x.id===e))==null?void 0:C.routeId}});Kd(s);const o=i.routesById[s],a=o.options.pendingComponent??i.options.defaultPendingComponent,c=a?p.jsx(a,{}):null,l=o.options.errorComponent??i.options.defaultErrorComponent,u=o.options.onCatch??i.options.defaultOnCatch,d=o.isRoot?o.options.notFoundComponent??((n=i.options.notFoundRoute)==null?void 0:n.options.component):o.options.notFoundComponent,h=(!o.isRoot||o.options.wrapInSuspense)&&(o.options.wrapInSuspense??a??((r=o.options.errorComponent)==null?void 0:r.preload))?E.Suspense:J6,f=l?KN:J6,m=d?u4e:J6,y=Ds({select:b=>b.loadedAt}),v=Ds({select:b=>{var C;const x=b.matches.findIndex(_=>_.id===e);return(C=b.matches[x-1])==null?void 0:C.routeId}});return p.jsxs(p.Fragment,{children:[p.jsx(YE.Provider,{value:e,children:p.jsx(h,{fallback:c,children:p.jsx(f,{getResetKey:()=>y,errorComponent:l||ZE,onCatch:(b,C)=>{if(uc(b))throw b;u==null||u(b,C)},children:p.jsx(m,{fallback:b=>{if(!d||b.routeId&&b.routeId!==s||!b.routeId&&!o.isRoot)throw b;return E.createElement(d,b)},children:p.jsx(m4e,{matchId:e})})})})}),v===il&&i.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(g4e,{}),p.jsx(p4e,{})]}):null]})});function g4e(){const t=$c(),e=E.useRef(void 0);return p.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...Y0(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.key)}const m4e=E.memo(function({matchId:e}){var n,r,i;const s=$c(),{match:o,key:a,routeId:c}=Ds({select:h=>{const f=h.matches.findIndex(x=>x.id===e),m=h.matches[f],y=m.routeId,v=s.routesById[y].options.remountDeps??s.options.defaultRemountDeps,b=v==null?void 0:v({routeId:y,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:b?JSON.stringify(b):void 0,routeId:y,match:aR(m,["id","status","error"])}},structuralSharing:!0}),l=s.routesById[c],u=E.useMemo(()=>{const h=l.options.component??s.options.defaultComponent;return h?p.jsx(h,{},a):p.jsx(XN,{})},[a,l.options.component,s.options.defaultComponent]),d=(l.options.errorComponent??s.options.defaultErrorComponent)||ZE;if(o.status==="notFound")return Kd(uc(o.error)),ise(s,l,o.error);if(o.status==="redirected")throw Kd(Xl(o.error)),(n=s.getMatch(o.id))==null?void 0:n.loadPromise;if(o.status==="error"){if(s.isServer)return p.jsx(d,{error:o.error,reset:void 0,info:{componentStack:""}});throw o.error}if(o.status==="pending"){const h=l.options.pendingMinMs??s.options.defaultPendingMinMs;if(h&&!((r=s.getMatch(o.id))!=null&&r.minPendingPromise)&&!s.isServer){const f=vm();Promise.resolve().then(()=>{s.updateMatch(o.id,m=>({...m,minPendingPromise:f}))}),setTimeout(()=>{f.resolve(),s.updateMatch(o.id,m=>({...m,minPendingPromise:void 0}))},h)}throw(i=s.getMatch(o.id))==null?void 0:i.loadPromise}return u}),XN=E.memo(function(){const e=$c(),n=E.useContext(YE),r=Ds({select:l=>{var u;return(u=l.matches.find(d=>d.id===n))==null?void 0:u.routeId}}),i=e.routesById[r],s=Ds({select:l=>{const d=l.matches.find(h=>h.id===n);return Kd(d),d.globalNotFound}}),o=Ds({select:l=>{var u;const d=l.matches,h=d.findIndex(f=>f.id===n);return(u=d[h+1])==null?void 0:u.id}}),a=e.options.defaultPendingComponent?p.jsx(e.options.defaultPendingComponent,{}):null;if(e.isShell)return p.jsx(E.Suspense,{fallback:a,children:p.jsx(y4e,{})});if(s)return ise(e,i,void 0);if(!o)return null;const c=p.jsx(sse,{matchId:o});return n===il?p.jsx(E.Suspense,{fallback:a,children:c}):c});function y4e(){throw new Error("ShellBoundaryError")}function w4e(t){return typeof(t==null?void 0:t.message)!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}function Us(t,e,n){let r,i,s,o;const a=()=>typeof document>"u"&&(n==null?void 0:n())===!1?(i=()=>null,Promise.resolve()):(r||(r=t().then(l=>{r=void 0,i=l[e]}).catch(l=>{if(s=l,w4e(s)&&s instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const u=`tanstack_router_reload:${s.message}`;sessionStorage.getItem(u)||(sessionStorage.setItem(u,"1"),o=!0)}})),r),c=function(u){if(o)throw window.location.reload(),new Promise(()=>{});if(s)throw s;if(!i)throw a();return(n==null?void 0:n())===!1?p.jsx(zxe,{fallback:p.jsx(XN,{}),children:E.createElement(i,u)}):E.createElement(i,u)};return c.preload=a,c}function v4e(){const t=$c(),e=E.useRef({router:t,mounted:!1}),n=Ds({select:({isLoading:d})=>d}),[r,i]=E.useState(!1),s=Ds({select:d=>d.matches.some(h=>h.status==="pending"),structuralSharing:!0}),o=Tk(n),a=n||r||s,c=Tk(a),l=n||s,u=Tk(l);return t.isServer||(t.startTransition=d=>{i(!0),E.startTransition(()=>{d(),i(!1)})}),E.useEffect(()=>{const d=t.history.subscribe(t.load),h=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Dy(t.latestLocation.href)!==Dy(h.href)&&t.commitLocation({...h,replace:!0}),()=>{d()}},[t,t.history]),Lv(()=>{if(typeof window<"u"&&t.clientSsr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(h){console.error(h)}})()},[t]),Lv(()=>{o&&!n&&t.emit({type:"onLoad",...Y0(t.state)})},[o,t,n]),Lv(()=>{u&&!l&&t.emit({type:"onBeforeRouteMount",...Y0(t.state)})},[l,u,t]),Lv(()=>
59{c&&!a&&(t.emit({type:"onResolved",...Y0(t.state)}),t.__store.setState(d=>({...d,status:"idle",resolvedLocation:d.location})),Sxe(t))},[a,c,t]),null}function b4e(){const t=$c(),e=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null,n=t.isServer||typeof document<"u"&&t.clientSsr?J6:E.Suspense,r=p.jsxs(n,{fallback:e,children:[p.jsx(v4e,{}),p.jsx(x4e,{})]});return t.options.InnerWrap?p.jsx(t.options.InnerWrap,{children:r}):r}function x4e(){const t=Ds({select:n=>{var r;return(r=n.matches[0])==null?void 0:r.id}}),e=Ds({select:n=>n.loadedAt});return p.jsx(YE.Provider,{value:t,children:p.jsx(KN,{getResetKey:()=>e,errorComponent:ZE,onCatch:n=>{n.message||n.toString()},children:t?p.jsx(sse,{matchId:t}):null})})}const E4e=t=>new C4e(t);class C4e extends Mxe{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=$i,globalThis.createLazyFileRoute=$H):typeof window<"u"&&(window.createFileRoute=$i,window.createFileRoute=$H);function _4e({router:t,children:e,...n}){Object.keys(n).length>
590&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});const r=nse(),i=p.jsx(r.Provider,{value:t,children:e});return t.options.Wrap?p.jsx(t.options.Wrap,{children:i}):i}function S4e({router:t,...e}){return p.jsx(_4e,{router:t,...e,children:p.jsx(b4e,{})})}function ose(t){return Ds({select:e=>t!=null&&t.select?t.select(e.location):e.location})}var A4={},TH;function A4e(){if(TH)return A4;TH=1;var t=rse();return A4.createRoot=t.createRoot,A4.hydrateRoot=t.hydrateRoot,A4}var k4e=A4e();const U7="DAPPOS:BUBBLE:",ase={AUTH:`${U7}AUTH`,SIDEBAR_STATE:`${U7}SIDEBAR_STATE`},JN="/xbubble",SIt="https://pub-resource.dappos.com/v3/images/default.png",Rk="/xbubble";function eD(t){var e;return((e=t.split(",")[0])==null?void 0:e.trim().toLowerCase().replace(/:\d+$/,""))??""}function $4e(t){return t===Rk||t.startsWith(`${Rk}/`)?Rk:""}function I4e(t){return eD(t)==="dappos.com"?JN:""}function JE(t,e){return $4e(t)||I4e(e)}function cse(t=typeof window>"u"?"":window.location.pathname,e=typeof window>"u"?"":window.location.host){return JE(t,e)||"/"}function T4e(t,e=cse()){return e==="/"?t||"/":t===e?"/":t.startsWith(`${e}/`)?t.slice(e.length)||"/":t||"/"}function PH(t){const e=eD(t);return!e||e.includes("localhost")||e.startsWith("127.0.0.1")||e.startsWith("[::1]")?!1:e.includes(".")}function P4e(t,e,n=""){return`${t}${e}${n}`}function AIt({origin:t,host:e,pathname:n,locale:r,inviteCode:i}){const s=JE(n,e);return`${t}${s}/${r}?referral=${i}`}function lse(){if(typeof window>"u")return{origin:"https://dappos.com",prefix:JN};const t=JE(window.location.pathname,window.location.host);return{origin:window.location.origin,prefix:t}}const R4e=new Set(["CN"]);function hR(t){const e=t==null?void 0:t.trim().toUpperCase();return e||null}function use(t){const e=hR(t);return e?R4e.has(e):!1}function M4e(t){return!!(t!=null&&t.ethereum||t!=null&&t.okxwallet||t!=null&&t.coinbaseWalletExtension)}function O4e(t){return/MicroMessenger/i.test(t??"")}function j4e({countryCode:t,hasGeoError:e,hasInjectedWallet:n,isWeChat:r}){return e||r||use(t)&&!n}async function N4e(t,e){const n=await t("/dapposdata/geo",{cache:"no-store",credentials:"same-origin",method:"GET",signal:e});if(!n.ok)throw new Error(`Geo lookup failed with status ${n.status}`);const r=await n.json().catch(()=>null),i=hR(r==null?void 0:r.country);return i||hR(n.headers.get("CloudFront-Viewer-Country"))}const RH={countryCode:null,error:null,isLoading:!1},D4e={countryCode:null,error:null,isLoading:!0};function L4e(){const[t,e]=E.useState(()=>typeof window<"u"&&!PH(window.location.host)?RH:D4e);return E.useEffect(()=>{if(!PH(window.location.host)){e(RH);return}const n=new AbortController;async function r(){try{const i=await N4e(fetch,n.signal);e({countryCode:i,error:null,isLoading:!1})}catch(i){if(n.signal.aborted)return;e({countryCode:null,error:i instanceof Error?i:new Error("Failed to load viewer country"),isLoading:!1})}}return r(),()=>{n.abort()}},[]),t}const B4e="app-boot-loader";function F4e(){if(typeof document>"u")return;const t=document.getElementById(B4e);t&&(t.setAttribute("data-hidden","true"),window.setTimeout(()=>{t.remove()},180))}function dse(){typeof window>"u"||window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{F4e()})})}const U4e="modulepreload",z4e=function(t){return"/xbubble/"+t},MH={},mr=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(l){return Promise.all(l.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=o(n.map(l=>{if(l=z4e(l),l in MH)return;MH[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":U4e,u||(h.as="script"),h.crossOrigin="",h.href=l,c&&h.setAttribute("nonce",c),document.head.appendChild(h),u)return new Promise((f,m)=>{h.addEventListener("load",f),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */var By;
59(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(By||(By={}));class Mk extends Error{constructor(e,n,r){super(e),this.message=e,this.code=n,this.data=r}}const W4e=t=>{var e,n;return t!=null&&t.androidBridge?"android":!((n=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},H4e=t=>{const e=t.CapacitorCustomPlatform||null,n=t.Capacitor||{},r=n.Plugins=n.Plugins||{},i=()=>e!==null?e.name:W4e(t),s=()=>i()!=="web",o=d=>{const h=l.get(d);return!!(h!=null&&h.platforms.has(i())||a(d))},a=d=>{var h;return(h=n.PluginHeaders)===null||h===void 0?void 0:h.find(f=>f.name===d)},c=d=>t.console.error(d),l=new Map,u=(d,h={})=>{const f=l.get(d);if(f)return console.warn(`Capacitor plugin "${d}" already registered. Cannot register plugins twice.`),f.proxy;const m=i(),y=a(d);let v;const b=async()=>(!v&&m in h?v=typeof h[m]=="function"?v=await h[m]():v=h[m]:e!==null&&!v&&"web"in h&&(v=typeof h.web=="function"?v=await h.web():v=h.web),v),C=(N,T)=>{var O,U;if(y){const z=y==null?void 0:y.methods.find(L=>T===L.name);if(z)return z.rtype==="promise"?L=>n.nativePromise(d,T.toString(),L):(L,S)=>n.nativeCallback(d,T.toString(),L,S);if(N)return(O=N[T])===null||O===void 0?void 0:O.bind(N)}else{if(N)return(U=N[T])===null||U===void 0?void 0:U.bind(N);throw new Mk(`"${d}" plugin is not implemented on ${m}`,By.Unimplemented)}},x=N=>{let T;const O=(...U)=>{const z=b().then(L=>{const S=C(L,N);if(S){const k=S(...U);return T=k==null?void 0:k.remove,k}else throw new Mk(`"${d}.${N}()" is not implemented on ${m}`,By.Unimplemented)});return N==="addListener"&&(z.remove=async()=>T()),z};return O.toString=()=>`${N.toString()}() { [capacitor code] }`,Object.defineProperty(O,"name",{value:N,writable:!1,configurable:!1}),O},_=x("addListener"),$=x("removeListener"),I=(N,T)=>{const O=_({eventName:N},T),U=async()=>{const L=await O;$({eventName:N,callbackId:L},T)},z=new Promise(L=>O.then(()=>L({remove:U})));return z.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await U()},z},R=new Proxy({},{get(N,T){switch(T){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return y?I:_;case"removeListener":return $;default:return x(T)}}});return r[d]=R,l.set(d,{name:d,proxy:R,platforms:new Set([...Object.keys(h),...y?[m]:[]])}),R};return n.convertFileSrc||(n.convertFileSrc=d=>d),n.getPlatform=i,n.handleError=c,n.isNativePlatform=s,n.isPluginAvailable=o,n.registerPlugin=u,n.Exception=Mk,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},V4e=t=>t.Capacitor=H4e(t),Nb=V4e(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),vh=Nb.registerPlugin;class tD{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,n){let r=!1;this.listeners[e]||(this.listeners[e]=[],r=!0),this.listeners[e].push(n);const s=this.windowListeners[e];s&&!s.registered&&this.addWindowListener(s),r&&this.sendRetainedArgumentsForEvent(e);const o=async()=>this.removeListener(e,n);return Promise.resolve({remove:o})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,n,r){const i=this.listeners[e];if(!i){if(r){let s=this.retainedEventArguments[e];s||(s=[]),s.push(n),this.retainedEventArguments[e]=s}return}i.forEach(s=>s(n))}hasListeners(e){var n;return!!(!((n=this.listeners[e])===null||n===void 0)&&n.length)}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(e="not implemented"){return new Nb.Exception(e,By.Unimplemented)}unavailable(e="not available"){return new Nb.Exception(e,By.Unavailable)}async removeListener(e,n){const r=this.listeners[e];if(!r)return;const i=r.indexOf(n);this.listeners[e].splice(i,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const n=this.retainedEventArguments[e];
59n&&(delete this.retainedEventArguments[e],n.forEach(r=>{this.notifyListeners(e,r)}))}}const OH=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),jH=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class q4e extends tD{async getCookies(){const e=document.cookie,n={};return e.split(";").forEach(r=>{if(r.length<=0)return;let[i,s]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");i=jH(i).trim(),s=jH(s).trim(),n[i]=s}),n}async setCookie(e){try{const n=OH(e.key),r=OH(e.value),i=e.expires?`; expires=${e.expires.replace("expires=","")}`:"",s=(e.path||"/").replace("path=",""),o=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${r||""}${i}; path=${s}; ${o};`}catch(n){return Promise.reject(n)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const n of e)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}vh("CapacitorCookies",{web:()=>new q4e});const K4e=async t=>new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{const i=r.result;e(i.indexOf(",")>=0?i.split(",")[1]:i)},r.onerror=i=>n(i),r.readAsDataURL(t)}),G4e=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(i=>i.toLocaleLowerCase()).reduce((i,s,o)=>(i[s]=t[e[o]],i),{})},Z4e=(t,e=!0)=>t?Object.entries(t).reduce((r,i)=>{const[s,o]=i;let a,c;return Array.isArray(o)?(c="",o.forEach(l=>{a=e?encodeURIComponent(l):l,c+=`${s}=${a}&`}),c.slice(0,-1)):(a=e?encodeURIComponent(o):o,c=`${s}=${a}`),`${r}&${c}`},"").substr(1):null,Y4e=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),i=G4e(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(i.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[o,a]of Object.entries(t.data||{}))s.set(o,a);n.body=s.toString()}else if(i.includes("multipart/form-data")||t.data instanceof FormData){const s=new FormData;if(t.data instanceof FormData)t.data.forEach((a,c)=>{s.append(c,a)});else for(const a of Object.keys(t.data))s.append(a,t.data[a]);n.body=s;const o=new Headers(n.headers);o.delete("content-type"),n.headers=o}else(i.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class Q4e extends tD{async request(e){const n=Y4e(e,e.webFetchExtra),r=Z4e(e.params,e.shouldEncodeUrlParams),i=r?`${e.url}?${r}`:e.url,s=await fetch(i,n),o=s.headers.get("content-type")||"";let{responseType:a="text"}=s.ok?e:{};o.includes("application/json")&&(a="json");let c,l;switch(a){case"arraybuffer":case"blob":l=await s.blob(),c=await K4e(l);break;case"json":c=await s.json();break;case"document":case"text":default:c=await s.text()}const u={};return s.headers.forEach((d,h)=>{u[h]=d}),{data:c,headers:u,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}vh("CapacitorHttp",{web:()=>new Q4e});var NH;(function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"})(NH||(NH={}));var DH;(function(t){t.StatusBar="StatusBar",t.NavigationBar="NavigationBar"})(DH||(DH={}));class X4e extends tD{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}vh("SystemBars",{web:()=>new X4e});const J4e=vh("Browser",{web:()=>mr(()=>import("./web-BUoQmg9u.js"),[]).then(t=>new t.BrowserWeb)});vh("Share",{web:()=>mr(()=>import("./web-Bynt0OfC.js"),[]).then(t=>new t.ShareWeb)});function hd(){if(!(typeof window>"u"))return window.bubbleAi}const e8=vh("DappOSNativeShell"),zc=vh("DappOSNativeWallet"),k4=vh("DappOSNativeIAP"),Ok=vh("DappOSNativeFile"),e6e="native-wallet";function fR(t){return t?{...t,connectorId:e6e}:null}function oa(){return Nb.getPlatform()}function Ur(){return Nb.isNativePlatform()}function Db(){return typeof window>"u"?!1:!!window.bubbleAi}
59function z7(){return Ur()||Db()}function t6e(){var t,e,n;if(!(typeof window>"u")){if(Db()){(e=(t=window.bubbleAi)==null?void 0:t.frontendReady)==null||e.call(t);return}Ur()&&oa()==="ios"&&((n=e8.frontendReady)==null||n.call(e8).catch(()=>{}))}}function wf(){const t=hd();return t?typeof t.nativeWalletIsAvailable=="function"&&typeof t.nativeWalletConnect=="function"&&typeof t.nativeWalletSignMessage=="function"&&typeof t.nativeWalletDisconnect=="function":!1}function n6e(t){if(typeof t=="boolean")return{available:t};if(!t)return{available:!1,reason:"native-wallet-unavailable"};try{const e=JSON.parse(t);return{available:!!e.available,reason:e.reason}}catch{return{available:t==="true",reason:t==="true"?void 0:t}}}let r6e=0;const W7=new Map;function i6e(){if(typeof window>"u")return;const t=window;t.__dappOSNativeWalletCallback||(t.__dappOSNativeWalletCallback=(e,n,r)=>{const i=W7.get(e);if(!i)return;if(W7.delete(e),n){i.resolve(r??null);return}const s=H7(r),o=s&&typeof s.message=="string"?s.message:"native-wallet-failed";i.reject(new Error(o))})}function H7(t){if(!t)return null;if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return{message:t}}}function Hw(t,e){if(typeof window>"u")return Promise.reject(new Error("native-wallet-unavailable"));i6e();const n=`native-wallet-${Date.now()}-${++r6e}`;return new Promise((r,i)=>{W7.set(n,{resolve:s=>{try{r(e(s))}catch(o){i(o instanceof Error?o:new Error("native-wallet-invalid-response"))}},reject:i});try{t(n)}catch(s){W7.delete(n),i(s instanceof Error?s:new Error("native-wallet-unavailable"))}})}function LH(t){const e=H7(t),n=e&&"wallet"in e?e.wallet:e;return!n||typeof n!="object"?null:fR(n)}async function s6e(){if(!Ur())return{isNative:Db(),platform:Db()?"android":"web",capabilities:[]};try{const t=await e8.getShellInfo();return{...t,isNative:!0,platform:t.platform||oa(),capabilities:t.capabilities??[]}}catch{return{isNative:!0,platform:oa(),capabilities:[]}}}async function o6e(t){if(Ur()){await J4e.open({url:t});return}window.open(t,"_blank","noopener,noreferrer")}const ou={async isAvailable(){var t,e;if(wf())return n6e((e=(t=hd())==null?void 0:t.nativeWalletIsAvailable)==null?void 0:e.call(t));if(!Ur())return{available:!1,reason:"not-native"};try{return await zc.isAvailable()}catch(n){return{available:!1,reason:n instanceof Error?n.message:"native-wallet-unavailable"}}},async getConnectedWallet(){var t;if(wf()&&((t=hd())!=null&&t.nativeWalletGetConnectedWallet))return Hw(e=>{var n,r;return(r=(n=hd())==null?void 0:n.nativeWalletGetConnectedWallet)==null?void 0:r.call(n,e)},LH);if(!Ur())return null;try{const e=await zc.getConnectedWallet();return fR(e.wallet)}catch{return null}},async connect(t="evm"){if(wf()){const r=await Hw(i=>{var s,o;return(o=(s=hd())==null?void 0:s.nativeWalletConnect)==null?void 0:o.call(s,i,t)},LH);if(!r)throw new Error("Native wallet unavailable");return r}if(!Ur())throw new Error("Native wallet unavailable");const e=await zc.connect({chain:t}),n=fR(e.wallet);if(!n)throw new Error("Native wallet unavailable");return n},async signMessage(t){if(wf())return Hw(n=>{var r,i;return(i=(r=hd())==null?void 0:r.nativeWalletSignMessage)==null?void 0:i.call(r,n,t.chain,t.address,t.message)},n=>{const r=H7(n);if(r&&typeof r.signature=="string")return r.signature;throw new Error("native-wallet-signature-missing")});if(!Ur())throw new Error("Native wallet unavailable");return(await zc.signMessage(t)).signature},async sendTransaction(t){var n;if(wf()&&((n=hd())!=null&&n.nativeWalletSendTransaction))return Hw(r=>{var i,s;return(s=(i=hd())==null?void 0:i.nativeWalletSendTransaction)==null?void 0:s.call(i,r,t.chain,t.address,t.to,t.data??"0x",t.value??"0x0",String(t.chainId??""))},r=>{const i=H7(r);if(i&&typeof i.hash=="string")return i.hash;throw new Error("native-wallet-transaction-hash-missing")});if(!Ur()||!zc.sendTransaction)throw new Error("Native wallet transaction unavailable");return(await zc.sendTransaction(t)).hash},async disconnect(){if(wf()){await Hw(t=>{var e,n;return(n=(e=hd())==null?void 0:e.nativeWalletDisconnect)==null?void 0:n.call(e,t)},()=>{});return}Ur()&&await zc.disconnect()},async resumePendingRequest(){!Ur()||!zc.resumePendingRequest||await zc.resumePendingRequest()},async cancelPendingRequest(){!Ur()||!zc.cancelPendingRequest||await zc.cancelPendingRequest()}},kIt={async getProducts(t){return!Ur()||oa()!=="ios"?[]:(await k4.getProducts({productIds:t})).products??[]},async purchase(t,e){if(!Ur()||oa()!=="ios")throw new Error("Apple in-app purchases are only available in the iOS app");return k4.purchase({productId:t,appAccountToken:e})},async finishTransaction(t){!Ur()||oa()!=="ios"||await k4.finishTransaction({transactionId:t})},async getUnfinishedTransactions(){return!Ur()||oa()!=="ios"?[]:(await k4.getUnfinishedTransactions()).transactions??[]}},$It={async downloadFile(t){if(!Ur()||oa()!=="ios")throw new Error("Native file download is only available in the iOS app");return Ok.downloadFile(t)},async saveMediaToPhotos(t){if(!Ur()||oa()!=="ios")throw new Error("Native media save is only available in the iOS app");return Ok.saveMediaToPhotos(t)},async copyImageToClipboard(t){if(!Ur()||oa()!=="ios")throw new Error("Native image clipboard is only available in the iOS app");return Ok.copyImageToClipboard(t)}};var BH=function(){},a6e=typeof window<"u",jk={exports:{}};/*! 60 * JavaScript Cookie v2.2.1 61 * https://github.com/js-cookie/js-cookie 62 * 63 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 64 * Released under the MIT license 65 */var FH;function c6e(){return FH||(FH=1,function(t,e){(function(n){var r;if(t.exports=n(),r=!0,!r){var i=window.Cookies,s=window.Cookies=n();s.noConflict=function(){return window.Cookies=i,s}}})(function(){function n(){for(var s=0,o={};s<arguments.length;s++){var a=arguments[s];for(var c in a)o[c]=a[c]}return o}function r(s){return s.replace(/(%[0-9A-Z]{2}
65)+/g,decodeURIComponent)}function i(s){function o(){}function a(l,u,d){if(!(typeof document>"u")){d=n({path:"/"},o.defaults,d),typeof d.expires=="number"&&(d.expires=new Date(new Date*1+d.expires*864e5)),d.expires=d.expires?d.expires.toUTCString():"";try{var h=JSON.stringify(u);/^[\{\[]/.test(h)&&(u=h)}catch{}u=s.write?s.write(u,l):encodeURIComponent(String(u)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),l=encodeURIComponent(String(l)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var f="";for(var m in d)d[m]&&(f+="; "+m,d[m]!==!0&&(f+="="+d[m].split(";")[0]));return document.cookie=l+"="+u+f}}function c(l,u){if(!(typeof document>"u")){for(var d={},h=document.cookie?document.cookie.split("; "):[],f=0;f<h.length;f++){var m=h[f].split("="),y=m.slice(1).join("=");!u&&y.charAt(0)==='"'&&(y=y.slice(1,-1));try{var v=r(m[0]);if(y=(s.read||s)(y,v)||r(y),u)try{y=JSON.parse(y)}catch{}if(d[v]=y,l===v)break}catch{}}return l?d[l]:d}}return o.set=a,o.get=function(l){return c(l,!1)},o.getJSON=function(l){return c(l,!0)},o.remove=function(l,u){a(l,"",n(u,{expires:-1}))},o.defaults={},o.withConverter=i,o}return i(function(){})})}(jk)),jk.exports}var l6e=c6e();const Nk=ys(l6e);var V7=function(t){var e=E.useState(function(){return Nk.get(t)||null}),n=e[0],r=e[1],i=E.useCallback(function(o,a){Nk.set(t,o,a),r(o)},[t]),s=E.useCallback(function(){Nk.remove(t),r(null)},[t]);return[n,i,s]},hse=function(t,e,n){if(!a6e)return[e,BH,BH];if(!t)throw new Error("useLocalStorage key may not be falsy");var r=JSON.parse,i=E.useRef(function(u){try{var d=n?n.raw?String:n.serializer:JSON.stringify,h=localStorage.getItem(u);return h!==null?r(h):(e&&localStorage.setItem(u,d(e)),e)}catch{return e}}),s=E.useState(function(){return i.current(t)}),o=s[0],a=s[1];E.useLayoutEffect(function(){return a(i.current(t))},[t]);var c=E.useCallback(function(u){try{var d=typeof u=="function"?u(o):u;if(typeof d>"u")return;var h=void 0;n||(h=JSON.stringify(d)),localStorage.setItem(t,h),a(r(h))}catch{}},[t,a]),l=E.useCallback(function(){try{localStorage.removeItem(t),a(void 0)}catch{}},[t,a]);return[o,c,l]};const u6e=$i("/disable")({component:fse}),d6e=["en","zh-CN","zh-TW","ja","ru","vi"],Dk={en:{back:"Back",title:"App unavailable",description:"Unfortunately, Bubble is only available in certain regions right now. Please contact support if you think youâre getting this message in error."},"zh-CN":{back:"è¿å",title:"åºç¨æ æ³ä½¿ç¨",description:"å¾éæ¾ï¼Bubbleç®åä»
å¨ç¹å®åºå弿¾ä½¿ç¨ã妿æ¨è®¤ä¸ºæ¤æç¤ºæè¯¯ï¼è¯·èç³»å®¢ææ¯æã"},"zh-TW":{back:"è¿å",title:"æç¨ç¡æ³ä½¿ç¨",description:"å¾éºæ¾ï¼Bubbleç®åå
å¨ç¹å®ååéæ¾ä½¿ç¨ã妿æ¨èªçºæ¤æç¤ºæèª¤ï¼è«è¯ç¹«å®¢ææ¯æã"},ja:{back:"æ»ã",title:"ã¢ããªã¯å©ç¨ã§ãã¾ãã",description:"ç³ã訳ããã¾ããããBubbleã¯ç¾å¨ç¹å®ã®å°åã§ã®ã¿å©ç¨å¯è½ã§ãã誤表示ã®å ´åã¯ãµãã¼ãã¾ã§ãé£çµ¡ãã ããã"},ru:{back:"Ðазад",title:"ÐÑиложение недоÑÑÑпно",description:"Ð ÑожалениÑ, Bubble доÑÑÑпен ÑолÑко в некоÑоÑÑÑ
ÑегионаÑ
. ÐÑли Ð²Ñ ÑÑиÑаеÑе, ÑÑо ÑÑо оÑибка, ÑвÑжиÑеÑÑ Ñ Ð¿Ð¾Ð´Ð´ÐµÑжкой."},vi:{back:"Quay lại",title:"Ứng dụng không khả dụng",description:"Rất tiếc, Bubble hiá»n chá» khả dụng á» má»t sá» khu vá»±c. Vui lòng liên há» há» trợ nếu bạn cho rằng Äây là nhầm lẫn."}};function fse({blockedByRegion:t=!1}){const[e]=V7("DAPPOS_LANGUAGE"),[n]=V7("REGION_BLOCK"),[r,i]=E.useState(null),[s,o]=E.useState(null);return E.useEffect(()=>{o(/MicroMessenger/i.test(navigator.userAgent||""))},[]),E.useEffect(()=>{if(s!==null){if(s){i(navigator.language.toLowerCase().startsWith("zh")?"zh-CN":"en");return}if(t){i("zh-CN");return}if(e&&d6e.includes(e)){i(e);return}i(n==="1"?"zh-CN":"en")}},[t,e,s,n]),r?p.jsxs("div",{className:"flex h-[calc(100dvh-env(safe-area-inset-bottom))] w-full flex-col bg-[#f8f8f7] px-5 py-4",children:[s===!1&&n!=="1"&&!t&&p.jsxs("button",{type:"button",className:"flex w-fit items-center gap-1 text-[#34322d]",onClick:()=>window.history.back(),children:[p.jsx("span",{className:"text-2xl leading-none",children:"â¹"}),p.jsx("span",{className:"text-[18px] font-medium",children:Dk[r].back})]}),p.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center text-center",children:[p.jsx("div",{className:"grid h-[60px] w-[60px] place-items-center rounded-[18px] bg-[#1d1c1b]/10 text-[28px] font-semibold text-[#1d1c1b]/40",children:"x"}),p.jsx("div",{className:"mt-4 text-[24px] font-semibold leading-[32px] text-[#1d1c1b]",children:Dk[r].title}),p.jsx("div",{className:"mt-2 text-[12px] font-medium leading-[18px] text-[#858481]",children:Dk[r].description})]})]}):null}function h6e(t){if(typeof window>"u")return;const e=n=>t(n.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function pse(){const t=new Set;let e=[];const n=()=>h6e(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let r=n();return{_listeners(){return t},clear(){t.forEach(i=>
65i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),r==null||r()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),r==null||r(),r=n()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}var Yt={},Bv={exports:{}},f6e=Bv.exports,UH;function p6e(){return UH||(UH=1,function(t,e){(function(n,r){var i="1.0.40",s="",o="?",a="function",c="undefined",l="object",u="string",d="major",h="model",f="name",m="type",y="vendor",v="version",b="architecture",C="console",x="mobile",_="tablet",$="smarttv",I="wearable",R="embedded",N=500,T="Amazon",O="Apple",U="ASUS",z="BlackBerry",L="Browser",S="Chrome",k="Edge",M="Firefox",W="Google",H="Huawei",D="LG",V="Microsoft",B="Motorola",P="Opera",j="Samsung",G="Sharp",Y="Sony",te="Xiaomi",ae="Zebra",oe="Facebook",de="Chromium OS",ke="Mac OS",Be=" Browser",$e=function(Ne,J){var q={};for(var Z in Ne)J[Z]&&J[Z].length%2===0?q[Z]=J[Z].concat(Ne[Z]):q[Z]=Ne[Z];return q},He=function(Ne){for(var J={},q=0;q<Ne.length;q++)J[Ne[q].toUpperCase()]=Ne[q];return J},Ge=function(Ne,J){return typeof Ne===u?je(J).indexOf(je(Ne))!==-1:!1},je=function(Ne){return Ne.toLowerCase()},xt=function(Ne){return typeof Ne===u?Ne.replace(/[^\d\.]/g,s).split(".")[0]:r},ft=function(Ne,J){if(typeof Ne===u)return Ne=Ne.replace(/^\s\s*/,s),typeof J===c?Ne:Ne.substring(0,N)},it=function(Ne,J){for(var q=0,Z,se,he,fe,ye,nt;q<J.length&&!ye;){var vt=J[q],Nt=J[q+1];for(Z=se=0;Z<vt.length&&!ye&&vt[Z];)if(ye=vt[Z++].exec(Ne),ye)for(he=0;he<Nt.length;he++)nt=ye[++se],fe=Nt[he],typeof fe===l&&fe.length>0?fe.length===2?typeof fe[1]==a?this[fe[0]]=fe[1].call(this,nt):this[fe[0]]=fe[1]:fe.length===3?typeof fe[1]===a&&!(fe[1].exec&&fe[1].test)?this[fe[0]]=nt?fe[1].call(this,nt,fe[2]):r:this[fe[0]]=nt?nt.replace(fe[1],fe[2]):r:fe.length===4&&(this[fe[0]]=nt?fe[3].call(this,nt.replace(fe[1],fe[2])):r):this[fe]=nt||r;q+=2}},be=function(Ne,J){for(var q in J)if(typeof J[q]===l&&J[q].length>0){for(var Z=0;Z<J[q].length;Z++)if(Ge(J[q][Z],Ne))return q===o?r:q}else if(Ge(J[q],Ne))return q===o?r:q;return J.hasOwnProperty("*")?J["*"]:Ne},Lt={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Qe={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ue={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[v,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[v,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,v],[/opios[\/ ]+([\w\.]+)/i],[v,[f,P+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[v,[f,P+" GX"]],[/\bopr\/([\w\.]+)/i],[v,[f,P]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[v,[f,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[v,[f,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,v],[/quark(?:pc)?\/([-\w\.]+)/i],[v,[f,"Quark"]],[/\bddg\/([\w\.]+)/i],[v,[f,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[v,[f,"UC"+L]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[v,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[v,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[v,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[v,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[v,[f,"Smart Lenovo "+L]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+L],v],[/\bfocus\/([\w\.]+)/i],[v,[f,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[v,[f,P+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[v,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[v,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[v,[f,P+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[v,[f,"MIUI"+Be]],[/fxios\/([\w\.-]+)/i],[v,[f,M]],[/\bqihoobrowser\/?([\w\.]*)/i],[v,[f,"3
6560"]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,"$1Browser"],v],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1"+Be],v],[/samsungbrowser\/([\w\.]+)/i],[v,[f,j+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[v,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],v],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,v],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[v,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,oe],v],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,v],[/\bgsa\/([\w\.]+) .*safari\//i],[v,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[v,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[v,[f,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,S+" WebView"],v],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[v,[f,"Android "+L]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,v],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[v,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[v,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[v,be,Lt]],[/(webkit|khtml)\/([\w\.]+)/i],[f,v],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],v],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,v],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[v,[f,M+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[f,[v,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[f,[v,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,je]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows (ce|mobile); ppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[b,/ower/,s,je]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,je]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[h,[y,j],[m,_]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[h,[y,j],[m,x]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[h,[y,O],[m,x]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[h,[y,O],[m,_]],[/(macintosh);/i],[h,[y,O]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[h,[y,G],[m,x]],[/(?:honor)([-\w ]+)[;\)]/i],[h,[y,"Honor"],[m,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[h,[y,H],[m,_]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[h,[y,H],[m,x]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[h,/_/g," "],[y,te],[m,x]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[h,/_/g," "],[y,te],[m,_]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[h,[y,"OPPO"],[m,x]],[/\b(opd2\d{3}a?) bui/i],[h,[y,"OPPO"],[m,_]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[h,[y,"Vivo"],[m,x]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[h,[y,"Realme"],[m,x]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[h,[y,B],[m,x]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[h,[y,B],[m,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[h,[y,D],[m,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[h,[y,D],[m,x]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[h,[y,"Lenovo"],[m,_]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[h,/_/g," "],[y,"Nokia"],[m,x]],[/(pixel c)\b/i],[h,[y,W],[m,_]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[h,[y,W],[m,x]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[h,[y,Y],[m,x]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[h,"Xperia Tablet"],[y,Y],[m,_]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[h,[y,"OnePlus"],[m,x]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[h,[y,T],[m,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[h,/(.+)/g,"Fire Phone $1"],[
vendor: 9,031 bytes, line 65
65y,T],[m,x]],[/(playbook);[-\w\),; ]+(rim)/i],[h,y,[m,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[h,[y,z],[m,x]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[h,[y,U],[m,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[h,[y,U],[m,x]],[/(nexus 9)/i],[h,[y,"HTC"],[m,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[h,/_/g," "],[m,x]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[h,[y,"TCL"],[m,_]],[/(itel) ((\w+))/i],[[y,je],h,[m,be,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[h,[y,"Acer"],[m,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[h,[y,"Meizu"],[m,x]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[h,[y,"Ulefone"],[m,x]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[h,[y,"Energizer"],[m,x]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[h,[y,"Cat"],[m,x]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[h,[y,"Smartfren"],[m,x]],[/droid.+; (a(?:015|06[35]|142p?))/i],[h,[y,"Nothing"],[m,x]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[y,h,[m,x]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[y,h,[m,_]],[/(surface duo)/i],[h,[y,V],[m,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[h,[y,"Fairphone"],[m,x]],[/(u304aa)/i],[h,[y,"AT&T"],[m,x]],[/\bsie-(\w*)/i],[h,[y,"Siemens"],[m,x]],[/\b(rct\w+) b/i],[h,[y,"RCA"],[m,_]],[/\b(venue[\d ]{2,7}) b/i],[h,[y,"Dell"],[m,_]],[/\b(q(?:mv|ta)\w+) b/i],[h,[y,"Verizon"],[m,_]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[h,[y,"Barnes & Noble"],[m,_]],[/\b(tm\d{3}\w+) b/i],[h,[y,"NuVision"],[m,_]],[/\b(k88) b/i],[h,[y,"ZTE"],[m,_]],[/\b(nx\d{3}j) b/i],[h,[y,"ZTE"],[m,x]],[/\b(gen\d{3}) b.+49h/i],[h,[y,"Swiss"],[m,x]],[/\b(zur\d{3}) b/i],[h,[y,"Swiss"],[m,_]],[/\b((zeki)?tb.*\b) b/i],[h,[y,"Zeki"],[m,_]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],h,[m,_]],[/\b(ns-?\w{0,9}) b/i],[h,[y,"Insignia"],[m,_]],[/\b((nxa|next)-?\w{0,9}) b/i],[h,[y,"NextBook"],[m,_]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],h,[m,x]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],h,[m,x]],[/\b(ph-1) /i],[h,[y,"Essential"],[m,x]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[h,[y,"Envizen"],[m,_]],[/\b(trio[-\w\. ]+) b/i],[h,[y,"MachSpeed"],[m,_]],[/\btu_(1491) b/i],[h,[y,"Rotor"],[m,_]],[/(shield[\w ]+) b/i],[h,[y,"Nvidia"],[m,_]],[/(sprint) (\w+)/i],[y,h,[m,x]],[/(kin\.[onetw]{3})/i],[[h,/\./g," "],[y,V],[m,x]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[h,[y,ae],[m,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[h,[y,ae],[m,x]],[/smart-tv.+(samsung)/i],[y,[m,$]],[/hbbtv.+maple;(\d+)/i],[[h,/^/,"SmartTV"],[y,j],[m,$]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,D],[m,$]],[/(apple) ?tv/i],[y,[h,O+" TV"],[m,$]],[/crkey/i],[[h,S+"cast"],[y,W],[m,$]],[/droid.+aft(\w+)( bui|\))/i],[h,[y,T],[m,$]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[h,[y,G],[m,$]],[/(bravia[\w ]+)( bui|\))/i],[h,[y,Y],[m,$]],[/(mitv-\w{5}) bui/i],[h,[y,te],[m,$]],[/Hbbtv.*(technisat) (.*);/i],[y,h,[m,$]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,ft],[h,ft],[m,$]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,$]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,h,[m,C]],[/droid.+; (shield) bui/i],[h,[y,"Nvidia"],[m,C]],[/(playstation [345portablevi]+)/i],[h,[y,Y],[m,C]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[h,[y,V],[m,C]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[h,[y,j],[m,I]],[/((pebble))app/i],[y,h,[m,I]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[h,[y,O],[m,I]],[/droid.+; (glass) \d/i],[h,[y,W],[m,I]],[/droid.+; (wt63?0{2,3})\)/i],[h,[y,ae],[m,I]],[/droid.+; (glass) \d/i],[h,[y,W],[m,I]],[/(pico) (4|neo3(?: link|pro)?)/i],[y,h,[m,I]],[/; (quest( \d| pro)?)/i],[h,[y,oe],[m,I]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[m,R]],[/(aeobc)\b/i],[h,[y,T],[m,R]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[h,[m,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[h,[m,_]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,x]],[/(android[-\w\. ]{0,9});.+buil/i],[h,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[v,[f,k+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[f,v],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[v,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,v],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[v,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,v],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[f,[v,be,Qe]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[v,be,Qe],[f,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[v,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,ke],[v,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[v,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,v],[/\(bb(10);/i],[v,[f,z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[v,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[v,[f,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[v,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[v,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[v,[f,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,de],v],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,v],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],v],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,v]]},Ye=function(Ne,J){if(typeof Ne===l&&(J=Ne,Ne=r),!(this instanceof Ye))return new Ye(Ne,J).getResult();var q=typeof n!==c&&n.navigator?n.navigator:r,Z=Ne||(q&&q.userAgent?q.userAgent:s),se=q&&q.userAgentData?q.userAgentData:r,he=J?$e(Ue,J):Ue,fe=q&&q.userAgent==Z;return this.getBrowser=function(){var ye={};return ye[f]=r,ye[v]=r,it.call(ye,Z,he.browser),ye[d]=xt(ye[v]),fe&&q&&q.brave&&typeof q.brave.isBrave==a&&(ye[f]="Brave"),ye},this.getCPU=function(){var ye={};return ye[b]=r,it.call(ye,Z,he.cpu),ye},this.getDevice=function(){var ye={};return ye[y]=r,ye[h]=r,ye[m]=r,it.call(ye,Z,he.device),fe&&!ye[m]&&se&&se.mobile&&(ye[m]=x),fe&&ye[h]=="Macintosh"&&q&&typeof q.standalone!==c&&q.maxTouchPoints&&q.maxTouchPoints>2&&(ye[h]="iPad",ye[m]=_),ye},this.getEngine=function(){var ye={};return ye[f]=r,ye[v]=r,it.call(ye,Z,he.engine),ye},this.getOS=function(){var ye={};return ye[f]=r,ye[v]=r,it.call(ye,Z,he.os),fe&&!ye[f]&&se&&se.platform&&se.platform!="Unknown"&&(ye[f]=se.platform.replace(/chrome os/i,de).replace(/macos/i,ke)),ye},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Z},this.setUA=function(ye){return Z=typeof ye===u&&ye.length>N?ft(ye,N):ye,this},this.setUA(Z),this};Ye.VERSION=i,Ye.BROWSER=He([f,v,d]),Ye.CPU=He([b]),Ye.DEVICE=He([h,y,m,C,x,$,_,I,R]),Ye.ENGINE=Ye.OS=He([f,v]),t.exports&&(e=t.exports=Ye),e.UAParser=Ye;var tt=typeof n!==c&&(n.jQuery||n.Zepto);if(tt&&!tt.ua){var ze=new Ye;tt.ua=ze.getResult(),tt.ua.get=function(){return ze.getUA()}
65,tt.ua.set=function(Ne){ze.setUA(Ne);var J=ze.getResult();for(var q in J)tt.ua[q]=J[q]}}})(typeof window=="object"?window:f6e)}(Bv,Bv.exports)),Bv.exports}var zH;function g6e(){if(zH)return Yt;zH=1,Object.defineProperty(Yt,"__esModule",{value:!0});function t(Pe){return Pe&&typeof Pe=="object"&&"default"in Pe?Pe.default:Pe}var e=wh(),n=t(e),r=p6e(),i=new r,s=i.getBrowser(),o=i.getCPU(),a=i.getDevice(),c=i.getEngine(),l=i.getOS(),u=i.getUA(),d=function(pe){return i.setUA(pe)},h=function(pe){if(!pe){console.error("No userAgent string was provided");return}var Ee=new r(pe);return{UA:Ee,browser:Ee.getBrowser(),cpu:Ee.getCPU(),device:Ee.getDevice(),engine:Ee.getEngine(),os:Ee.getOS(),ua:Ee.getUA(),setUserAgent:function(ct){return Ee.setUA(ct)}}},f=Object.freeze({ClientUAInstance:i,browser:s,cpu:o,device:a,engine:c,os:l,ua:u,setUa:d,parseUserAgent:h});function m(Pe,pe){var Ee=Object.keys(Pe);if(Object.getOwnPropertySymbols){var Ke=Object.getOwnPropertySymbols(Pe);pe&&(Ke=Ke.filter(function(ct){return Object.getOwnPropertyDescriptor(Pe,ct).enumerable})),Ee.push.apply(Ee,Ke)}return Ee}function y(Pe){for(var pe=1;pe<arguments.length;pe++){var Ee=arguments[pe]!=null?arguments[pe]:{};pe%2?m(Object(Ee),!0).forEach(function(Ke){_(Pe,Ke,Ee[Ke])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Pe,Object.getOwnPropertyDescriptors(Ee)):m(Object(Ee)).forEach(function(Ke){Object.defineProperty(Pe,Ke,Object.getOwnPropertyDescriptor(Ee,Ke))})}return Pe}function v(Pe){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?v=function(pe){return typeof pe}:v=function(pe){return pe&&typeof Symbol=="function"&&pe.constructor===Symbol&&pe!==Symbol.prototype?"symbol":typeof pe},v(Pe)}function b(Pe,pe){if(!(Pe instanceof pe))throw new TypeError("Cannot call a class as a function")}function C(Pe,pe){for(var Ee=0;Ee<pe.length;Ee++){var Ke=pe[Ee];Ke.enumerable=Ke.enumerable||!1,Ke.configurable=!0,"value"in Ke&&(Ke.writable=!0),Object.defineProperty(Pe,Ke.key,Ke)}}function x(Pe,pe,Ee){return pe&&C(Pe.prototype,pe),Pe}function _(Pe,pe,Ee){return pe in Pe?Object.defineProperty(Pe,pe,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):Pe[pe]=Ee,Pe}function $(){return $=Object.assign||function(Pe){for(var pe=1;pe<arguments.length;pe++){var Ee=arguments[pe];for(var Ke in Ee)Object.prototype.hasOwnProperty.call(Ee,Ke)&&(Pe[Ke]=Ee[Ke])}return Pe},$.apply(this,arguments)}function I(Pe,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");Pe.prototype=Object.create(pe&&pe.prototype,{constructor:{value:Pe,writable:!0,configurable:!0}}),pe&&N(Pe,pe)}function R(Pe){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(Ee){return Ee.__proto__||Object.getPrototypeOf(Ee)},R(Pe)}function N(Pe,pe){return N=Object.setPrototypeOf||function(Ke,ct){return Ke.__proto__=ct,Ke},N(Pe,pe)}function T(Pe,pe){if(Pe==null)return{};var Ee={},Ke=Object.keys(Pe),ct,Tn;for(Tn=0;Tn<Ke.length;Tn++)ct=Ke[Tn],!(pe.indexOf(ct)>=0)&&(Ee[ct]=Pe[ct]);return Ee}function O(Pe,pe){if(Pe==null)return{};var Ee=T(Pe,pe),Ke,ct;if(Object.getOwnPropertySymbols){var Tn=Object.getOwnPropertySymbols(Pe);for(ct=0;ct<Tn.length;ct++)Ke=Tn[ct],!(pe.indexOf(Ke)>=0)&&Object.prototype.propertyIsEnumerable.call(Pe,Ke)&&(Ee[Ke]=Pe[Ke])}return Ee}function U(Pe){if(Pe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Pe}
65function z(Pe,pe){if(pe&&(typeof pe=="object"||typeof pe=="function"))return pe;if(pe!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U(Pe)}function L(Pe,pe){return S(Pe)||k(Pe,pe)||M(Pe,pe)||H()}function S(Pe){if(Array.isArray(Pe))return Pe}function k(Pe,pe){var Ee=Pe==null?null:typeof Symbol<"u"&&Pe[Symbol.iterator]||Pe["@@iterator"];if(Ee!=null){var Ke=[],ct=!0,Tn=!1,Rr,qs;try{for(Ee=Ee.call(Pe);!(ct=(Rr=Ee.next()).done)&&(Ke.push(Rr.value),!(pe&&Ke.length===pe));ct=!0);}catch(fg){Tn=!0,qs=fg}finally{try{!ct&&Ee.return!=null&&Ee.return()}finally{if(Tn)throw qs}}return Ke}}function M(Pe,pe){if(Pe){if(typeof Pe=="string")return W(Pe,pe);var Ee=Object.prototype.toString.call(Pe).slice(8,-1);if(Ee==="Object"&&Pe.constructor&&(Ee=Pe.constructor.name),Ee==="Map"||Ee==="Set")return Array.from(Pe);if(Ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ee))return W(Pe,pe)}}function W(Pe,pe){(pe==null||pe>Pe.length)&&(pe=Pe.length);for(var Ee=0,Ke=new Array(pe);Ee<pe;Ee++)Ke[Ee]=Pe[Ee];return Ke}function H(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 66In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},V={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},B={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},P={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},j=function(pe){switch(pe){case D.Mobile:return{isMobile:!0};case D.Tablet:return{isTablet:!0};case D.SmartTv:return{isSmartTV:!0};case D.Console:return{isConsole:!0};case D.Wearable:return{isWearable:!0};case D.Browser:return{isBrowser:!0};case D.Embedded:return{isEmbedded:!0};default:return P}},G=function(pe){return d(pe)},Y=function(pe){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return pe||Ee},te=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},ae=function(pe){var Ee=te();return Ee&&Ee.platform&&(Ee.platform.indexOf(pe)!==-1||Ee.platform==="MacIntel"&&Ee.maxTouchPoints>1&&!window.MSStream)},oe=function(pe,Ee,Ke,ct,Tn){return{isBrowser:pe,browserMajorVersion:Y(Ee.major),browserFullVersion:Y(Ee.version),browserName:Y(Ee.name),engineName:Y(Ke.name),engineVersion:Y(Ke.version),osName:Y(ct.name),osVersion:Y(ct.version),userAgent:Y(Tn)}},de=function(pe,Ee,Ke,ct){return y({},pe,{vendor:Y(Ee.vendor),model:Y(Ee.model),os:Y(Ke.name),osVersion:Y(Ke.version),ua:Y(ct)})},ke=function(pe,Ee,Ke,ct){return{isSmartTV:pe,engineName:Y(Ee.name),engineVersion:Y(Ee.version),osName:Y(Ke.name),osVersion:Y(Ke.version),userAgent:Y(ct)}},Be=function(pe,Ee,Ke,ct){return{isConsole:pe,engineName:Y(Ee.name),engineVersion:Y(Ee.version),osName:Y(Ke.name),osVersion:Y(Ke.version),userAgent:Y(ct)}},$e=function(pe,Ee,Ke,ct){return{isWearable:pe,engineName:Y(Ee.name),engineVersion:Y(Ee.version),osName:Y(Ke.name),osVersion:Y(Ke.version),userAgent:Y(ct)}},He=function(pe,Ee,Ke,ct,Tn){return{isEmbedded:pe,vendor:Y(Ee.vendor),model:Y(Ee.model),engineName:Y(Ke.name),engineVersion:Y(Ke.version),osName:Y(ct.name),osVersion:Y(ct.version),userAgent:Y(Tn)}};function Ge(Pe){var pe=Pe?h(Pe):f,Ee=pe.device,Ke=pe.browser,ct=pe.engine,Tn=pe.os,Rr=pe.ua,qs=j(Ee.type),fg=qs.isBrowser,pw=qs.isMobile,pg=qs.isTablet,gg=qs.isSmartTV,gw=qs.isConsole,jc=qs.isWearable,mg=qs.isEmbedded;if(fg)return oe(fg,Ke,ct,Tn,Rr);if(gg)return ke(gg,ct,Tn,Rr);if(gw)return Be(gw,ct,Tn,Rr);if(pw||pg)return de(qs,Ee,Tn,Rr);if(jc)return $e(jc,ct,Tn,Rr);if(mg)return He(mg,Ee,ct,Tn,Rr)}var je=function(pe){var Ee=pe.type;return Ee===D.Mobile},xt=function(pe){var Ee=pe.type;return Ee===D.Tablet},ft=function(pe){var Ee=pe.type;return Ee===D.Mobile||Ee===D.Tablet},it=function(pe){var Ee=pe.type;return Ee===D.SmartTv},be=function(pe){var Ee=pe.type;return Ee===D.Browser},Lt=function(pe){var Ee=pe.type;return Ee===D.Wearable},Qe=function(pe){var Ee=pe.type;return Ee===D.Console},Ue=function(pe){var Ee=pe.type;return Ee===D.Embedded}
66,Ye=function(pe){var Ee=pe.vendor;return Y(Ee)},tt=function(pe){var Ee=pe.model;return Y(Ee)},ze=function(pe){var Ee=pe.type;return Y(Ee,"browser")},Ne=function(pe){var Ee=pe.name;return Ee===B.Android},J=function(pe){var Ee=pe.name;return Ee===B.Windows},q=function(pe){var Ee=pe.name;return Ee===B.MAC_OS},Z=function(pe){var Ee=pe.name;return Ee===B.WindowsPhone},se=function(pe){var Ee=pe.name;return Ee===B.IOS},he=function(pe){var Ee=pe.version;return Y(Ee)},fe=function(pe){var Ee=pe.name;return Y(Ee)},ye=function(pe){var Ee=pe.name;return Ee===V.Chrome},nt=function(pe){var Ee=pe.name;return Ee===V.Firefox},vt=function(pe){var Ee=pe.name;return Ee===V.Chromium},Nt=function(pe){var Ee=pe.name;return Ee===V.Edge},mn=function(pe){var Ee=pe.name;return Ee===V.Yandex},At=function(pe){var Ee=pe.name;return Ee===V.Safari||Ee===V.MobileSafari},En=function(pe){var Ee=pe.name;return Ee===V.MobileSafari},yr=function(pe){var Ee=pe.name;return Ee===V.Opera},xn=function(pe){var Ee=pe.name;return Ee===V.InternetExplorer||Ee===V.Ie},kt=function(pe){var Ee=pe.name;return Ee===V.MIUI},Ie=function(pe){var Ee=pe.name;return Ee===V.SamsungBrowser},It=function(pe){var Ee=pe.version;return Y(Ee)},rt=function(pe){var Ee=pe.major;return Y(Ee)},Zt=function(pe){var Ee=pe.name;return Y(Ee)},yt=function(pe){var Ee=pe.name;return Y(Ee)},pt=function(pe){var Ee=pe.version;return Y(Ee)},St=function(){var pe=te(),Ee=pe&&pe.userAgent&&pe.userAgent.toLowerCase();return typeof Ee=="string"?/electron/.test(Ee):!1},qe=function(pe){return typeof pe=="string"&&pe.indexOf("Edg/")!==-1},Et=function(){var pe=te();return pe&&(/iPad|iPhone|iPod/.test(pe.platform)||pe.platform==="MacIntel"&&pe.maxTouchPoints>1)&&!window.MSStream},Ze=function(){return ae("iPad")},wt=function(){return ae("iPhone")},ot=function(){return ae("iPod")},qt=function(pe){return Y(pe)};function mt(Pe){var pe=Pe||f,Ee=pe.device,Ke=pe.browser,ct=pe.os,Tn=pe.engine,Rr=pe.ua;return{isSmartTV:it(Ee),isConsole:Qe(Ee),isWearable:Lt(Ee),isEmbedded:Ue(Ee),isMobileSafari:En(Ke)||Ze(),isChromium:vt(Ke),isMobile:ft(Ee)||Ze(),isMobileOnly:je(Ee),isTablet:xt(Ee)||Ze(),isBrowser:be(Ee),isDesktop:be(Ee),isAndroid:Ne(ct),isWinPhone:Z(ct),isIOS:se(ct)||Ze(),isChrome:ye(Ke),isFirefox:nt(Ke),isSafari:At(Ke),isOpera:yr(Ke),isIE:xn(Ke),osVersion:he(ct),osName:fe(ct),fullBrowserVersion:It(Ke),browserVersion:rt(Ke),browserName:Zt(Ke),mobileVendor:Ye(Ee),mobileModel:tt(Ee),engineName:yt(Tn),engineVersion:pt(Tn),getUA:qt(Rr),isEdge:Nt(Ke)||qe(Rr),isYandex:mn(Ke),deviceType:ze(Ee),isIOS13:Et(),isIPad13:Ze(),isIPhone13:wt(),isIPod13:ot(),isElectron:St(),isEdgeChromium:qe(Rr),isLegacyEdge:Nt(Ke)&&!qe(Rr),isWindows:J(ct),isMacOs:q(ct),isMIUI:kt(Ke),isSamsungBrowser:Ie(Ke)}}var Bt=it(a),un=Qe(a),Ve=Lt(a),st=Ue(a),X=En(s)||Ze(),ee=vt(s),ie=ft(a)||Ze(),ce=je(a),le=xt(a)||Ze(),_e=be(a),me=be(a),we=Ne(l),Te=Z(l),Ct=se(l)||Ze(),at=ye(s),Gt=nt(s),Dt=At(s),zt=yr(s),kn=xn(s),Cn=he(l),Hn=fe(l),xr=It(s),hr=rt(s),Er=Zt(s),Fn=Ye(a),ti=tt(a),yo=yt(c),BS=pt(c),lg=qt(u),ug=Nt(s)||qe(u),Ip=mn(s),dg=ze(a),FS=Et(),US=Ze(),lw=wt(),bx=ot(),uw=St(),Tp=qe(u),zS=Nt(s)&&!qe(u),dw=J(l),ir=q(l),xx=kt(s),Ex=Ie(s),hw=function(pe){if(!pe||typeof pe!="string"){console.error("No valid user agent string was provided");return}var Ee=h(pe),Ke=Ee.device,ct=Ee.browser,Tn=Ee.os,Rr=Ee.engine,qs=Ee.ua;return mt({device:Ke,browser:ct,os:Tn,engine:Rr,ua:qs})},Cx=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return we?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},_x=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return _e?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},Sx=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return kn?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},fw=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return Ct?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},hg=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return ie?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},Rl=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return le?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},Ml=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return Te?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},Ol=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children;pe.viewClassName,pe.style;var ct=O(pe,["renderWithFragment","children","viewClassName","style"]);return ce?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},Pp=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return Bt?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},Rp=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return un?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},jl=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children,ct=O(pe,["renderWithFragment","children"]);return Ve?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",ct,Ke):null},WS=function(pe){var Ee=pe.renderWithFragment,Ke=pe.children;pe.viewClassName,pe.style;var ct=pe.condition,Tn=O(pe,["renderWithFragment","children","viewClassName","style","condition"]);return ct?Ee?n.createElement(e.Fragment,null,Ke):n.createElement("div",Tn,Ke):null};function Ax(Pe){return function(pe){I(Ee,pe);function Ee(Ke){var ct;return b(this,Ee),ct=z(this,R(Ee).call(this,Ke)),ct.isEventListenerAdded=!1,ct.handleOrientationChange=ct.handleOrientationChange.bind(U(ct)),ct.onOrientationChange=ct.onOrientationChange.bind(U(ct)),ct.onPageLoad=ct.onPageLoad.bind(U(ct)),ct.state={isLandscape:!1,isPortrait:!1},ct}return x(Ee,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var ct=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:ct===0,isLandscape:ct===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":v(window))!==void 0&&ie&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(Pe,$({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),Ee}(n.Component)}function Mp(){var Pe=e.useState(function(){var Tn=window.innerWidth>window.innerHeight?90:0;return{isPortrait:Tn===0,isLandscape:Tn===90,orientation:Tn===0?"portrait":"landscape"}}),pe=L(Pe,2),Ee=pe[0],Ke=pe[1],ct=e.useCallback(function(){var Tn=window.innerWidth>window.innerHeight?90:0,Rr={isPortrait:Tn===0,isLandscape:Tn===90,orientation:Tn===0?"portrait":"landscape"};Ee.orientation!==Rr.orientation&&Ke(Rr)},[Ee.orientation]);return e.useEffect(function(){return(typeof window>"u"?"undefined":v(window))!==void 0&&ie&&(ct(),window.addEventListener("load",ct,!1),window.addEventListener("resize",ct,!1)),function(){window.removeEventListener("resize",ct,!1),window.removeEventListener("load",ct,!1)}},[ct]),Ee}function kx(Pe){var pe=Pe||window.navigator.userAgent;return h(pe)}function $x(Pe){var pe=Pe||window.navigator.userAgent,Ee=kx(pe),Ke=mt(Ee);return[Ke,Ee]}return Yt.AndroidView=Cx,Yt.BrowserTypes=V,Yt.BrowserView=_x,Yt.ConsoleView=Rp,Yt.CustomView=WS,Yt.IEView=Sx,Yt.IOSView=fw,Yt.MobileOnlyView=Ol,Yt.MobileView=hg,Yt.OsTypes=B,Yt.SmartTVView=Pp,Yt.TabletView=Rl,Yt.WearableView=jl,Yt.WinPhoneView=Ml,Yt.browserName=Er,Yt.browserVersion=hr,Yt.deviceDetect=Ge,Yt.deviceType=dg,Yt.engineName=yo,Yt.engineVersion=BS,Yt.fullBrowserVersion=xr,Yt.getSelectorsByUserAgent=hw,Yt.getUA=lg,Yt.isAndroid=we,Yt.isBrowser=_e,Yt.isChrome=at,Yt.isChromium=ee,Yt.isConsole=un,Yt.isDesktop=me,Yt.isEdge=ug,Yt.isEdgeChromium=Tp,Yt.isElectron=uw,Yt.isEmbedded=st,Yt.isFirefox=Gt,Yt.isIE=kn,Yt.isIOS=Ct,Yt.isIOS13=FS,Yt.isIPad13=US,Yt.isIPhone13=lw,Yt.isIPod13=bx,Yt.isLegacyEdge=zS,Yt.isMIUI=xx,Yt.isMacOs=ir,Yt.isMobile=ie,Yt.isMobileOnly=ce,Yt.isMobileSafari=X,Yt.isOpera=zt,Yt.isSafari=Dt,Yt.isSamsungBrowser=Ex,Yt.isSmartTV=Bt,Yt.isTablet=le,Yt.isWearable=Ve,Yt.isWinPhone=Te,Yt.isWindows=dw,Yt.isYandex=Ip,Yt.mobileModel=ti,Yt.mobileVendor=Fn,Yt.osName=Hn,Yt.osVersion=Cn,Yt.parseUserAgent=h,Yt.setUserAgent=G,Yt.useDeviceData=kx,Yt.useDeviceSelectors=$x,Yt.useMobileOrientation=Mp,Yt.withOr
66ientationChange=Ax,Yt}var di=g6e();const gse="2.23.14";let Vw={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:n})=>e?`${t??"https://viem.sh"}${e}${n?`#${n}`:""}`:void 0,version:`viem@${gse}`},et=class pR extends Error{constructor(e,n={}){var a;const r=(()=>{var c;return n.cause instanceof pR?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof pR&&n.cause.docsPath||n.docsPath,s=(a=Vw.getDocsUrl)==null?void 0:a.call(Vw,{...n,docsPath:i}),o=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...Vw.version?[`Version: ${Vw.version}`]:[]].join(` 67`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=e,this.version=gse}walk(e){return mse(this,e)}};function mse(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?mse(t.cause,e):e?null:t}const fs=(t,e,n)=>JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString():i,n),m6e=t=>t,nD=t=>t;class ob extends et{constructor({body:e,cause:n,details:r,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${nD(o)}`,e&&`Request body: ${fs(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class rD extends et{constructor({body:e,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${nD(r)}`,`Request body: ${fs(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class WH extends et{constructor({body:e,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${nD(n)}`,`Request body: ${fs(e)}`],name:"TimeoutError"})}}const y6e=-1;class ma extends et{constructor(e,{code:n,docsPath:r,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof rD?e.code:n??y6e}}class A2 extends ma{constructor(e,n){super(e,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class Lb extends ma{constructor(e){super(e,{code:Lb.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Lb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Bb extends ma{constructor(e){super(e,{code:Bb.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Bb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Fb extends ma{constructor(e,{method:n}={}){super(e,{code:Fb.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(Fb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Ub extends ma{constructor(e){super(e,{code:Ub.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` 68`)})}}Object.defineProperty(Ub,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class c1 extends ma{constructor(e){super(e,{code:c1.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(c1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});
vendor: 4,113 bytes, lines 68-69
68class l1 extends ma{constructor(e){super(e,{code:l1.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` 69`)})}}Object.defineProperty(l1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class zb extends ma{constructor(e){super(e,{code:zb.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(zb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ml extends ma{constructor(e){super(e,{code:ml.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ml,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Fy extends ma{constructor(e){super(e,{code:Fy.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Fy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class g0 extends ma{constructor(e,{method:n}={}){super(e,{code:g0.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(g0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Uy extends ma{constructor(e){super(e,{code:Uy.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Uy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Wb extends ma{constructor(e){super(e,{code:Wb.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Wb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Fr extends A2{constructor(e){super(e,{code:Fr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Fr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Hb extends A2{constructor(e){super(e,{code:Hb.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Hb,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Vb extends A2{constructor(e,{method:n}={}){super(e,{code:Vb.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(Vb,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class u1 extends A2{constructor(e){super(e,{code:u1.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(u1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class zy extends A2{constructor(e){super(e,{code:zy.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(zy,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Gd extends A2{constructor(e){super(e,{code:Gd.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Gd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class w6e extends ma{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}let yse=class extends et{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}};class v6e extends et{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class b6e extends et{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let x6e=class extends et{constructor({givenSize:e,maxSize:n}
69){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}},wse=class extends et{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},vse=class extends et{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class HH extends et{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}function O1(t,{dir:e,size:n=32}={}){return typeof t=="string"?Qf(t,{dir:e,size:n}):E6e(t,{dir:e,size:n})}function Qf(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new vse({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function E6e(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new vse({size:t.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const s=e==="right";r[s?i:n-i-1]=t[s?i:t.length-i-1]}return r}function Da(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function vi(t){return Da(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function yc(t,{dir:e="left"}={}){let n=typeof t=="string"?t.replace("0x",""):t,r=0;for(let i=0;i<n.length-1&&n[e==="left"?i:n.length-i-1].toString()==="0";i++)r++;return n=e==="left"?n.slice(r):n.slice(0,n.length-r),typeof t=="string"?(n.length===1&&e==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}const C6e=new TextEncoder;function Ud(t,e={}){return typeof t=="number"||typeof t=="bigint"?S6e(t,e):typeof t=="boolean"?_6e(t,e):Da(t)?To(t,e):Q0(t,e)}function _6e(t,e={}){const n=new Uint8Array(1);return n[0]=Number(t),typeof e.size=="number"?(Ic(n,{size:e.size}),O1(n,{size:e.size})):n}const Xu={zero:48,nine:57,A:65,F:70,a:97,f:102};function VH(t){if(t>=Xu.zero&&t<=Xu.nine)return t-Xu.zero;if(t>=Xu.A&&t<=Xu.F)return t-(Xu.A-10);if(t>=Xu.a&&t<=Xu.f)return t-(Xu.a-10)}function To(t,e={}){let n=t;e.size&&(Ic(n,{size:e.size}),n=O1(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=VH(r.charCodeAt(a++)),l=VH(r.charCodeAt(a++));if(c===void 0||l===void 0)throw new et(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[o]=c*16+l}return s}function S6e(t,e){const n=dn(t,e);return To(n)}function Q0(t,e={}){const n=C6e.encode(t);return typeof e.size=="number"?(Ic(n,{size:e.size}),O1(n,{dir:"right",size:e.size})):n}function Ic(t,{size:e}){if(vi(t)>e)throw new x6e({givenSize:vi(t),maxSize:e})}function Sr(t,e={}){const{signed:n}=e;e.size&&Ic(t,{size:e.size});const r=BigInt(t);if(!n)return r;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function A6e(t,e={}){let n=t;if(e.size&&(Ic(n,{size:e.size}),n=yc(n)),yc(n)==="0x00")return!1;if(yc(n)==="0x01")return!0;throw new b6e(n)}function Ec(t,e={}){return Number(Sr(t,e))}function k6e(t,e={}){let n=To(t);return e.size&&(Ic(n,{size:e.size}),n=yc(n,{dir:"right"})),new TextDecoder().decode(n)}const $6e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Qt(t,e={}){return typeof t=="number"||typeof t=="bigint"?dn(t,e):typeof t=="string"?Wy(t,e):typeof t=="boolean"?bse(t,e):Ii(t,e)}function bse(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(Ic(n,{size:e.size}),O1(n,{size:e.size})):n}function Ii(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=$6e[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(Ic(r,{size:e.size}),O1(r,{dir:"right",size:e.size})):r}function dn(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new yse({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${t}${c}`})}const a=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?O1(a,{size:r}):a}const I6e=new TextEncoder;function Wy(t,e={}){const n=I6e.encode(t);return Ii(n,e)}let eC=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const $4=new eC(8192);function T6e(t,{enabled:e=!0,id:n}){if(!e||!n)return t();if($4.get(n))return $4.get(n);const r=t().finally(()=>$4.delete(n));return $4.set(n,r),r}async function q7(t){return new Promise(e=>setTimeout(e,t))}function Hy(t,{delay:e=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await q7(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a<n&&await r({count:a,error:l}))return c({error:l});s(l)}};o()})}function P6e(t,e={}){return async(n,r={})=>{var d;const{dedupe:i=!1,methods:s,retryDelay:o=150,retryCount:a=3,uid:c}={...e,...r},{method:l}=n;if((d=s==null?void 0:s.exclude)!=null&&d.includes(l))throw new g0(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new g0(new Error("method not supported"),{method:l});const u=i?Wy(`${c}.${fs(n)}`):void 0;return T6e(()=>Hy(async()=>{try{return await t(n)}catch(h){const f=h;switch(f.code){case Lb.code:throw new Lb(f);case Bb.code:throw new Bb(f);case Fb.code:throw new Fb(f,{method:n.method});case Ub.code:throw new Ub(f);case c1.code:throw new c1(f);case l1.code:throw new l1(f);case zb.code:throw new zb(f);case ml.code:throw new ml(f);case Fy.code:throw new Fy(f);case g0.code:throw new g0(f,{method:n.method});case Uy.code:throw new Uy(f);case Wb.code:throw new Wb(f);case Fr.code:throw new Fr(f);case Hb.code:throw new Hb(f);case Vb.code:throw new Vb(f);case u1.code:throw new u1(f);case zy.code:throw new zy(f);case Gd.code:throw new Gd(f);case 5e3:throw new Fr(f);default:throw h instanceof et?h:new w6e(f)}}},{delay:({count:h,error:f})=>{var m;if(f&&f instanceof ob){const y=(m=f==null?void 0:f.headers)==null?void 0:m.get("Retry-After");if(y!=null&&y.match(/\d/))return Number.parseInt(y)*1e3}return~~(1<<h)*o},retryCount:a,shouldRetry:({error:h})=>R6e(h)}),{enabled:i,id:u})}}function R6e(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Uy.code||t.code===c1.code:t instanceof ob&&t.status?t.status===403||t.status===408||t.status===4
6913||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}const M6e="1.0.8";let Ua=class gR extends Error{constructor(e,n={}){var o;const r=n.cause instanceof gR?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,i=n.cause instanceof gR&&n.cause.docsPath||n.docsPath,s=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${M6e}`].join(` 70`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}};function bh(t,e){const n=t.exec(e);return n==null?void 0:n.groups}const xse=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ese=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Cse=/^\(.+?\).*?$/,qH=/^tuple(?<array>(\[(\d*)\])*)$/;function mR(t){let e=t.type;if(qH.test(t.type)&&"components"in t){e="(";const n=t.components.length;for(let i=0;i<n;i++){const s=t.components[i];e+=mR(s),i<n-1&&(e+=", ")}const r=bh(qH,t.type);return e+=`)${(r==null?void 0:r.array)??""}`,mR({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e}
70 indexed`),t.name?`${e} ${t.name}`:e}function qw(t){let e="";const n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=mR(i),r!==n-1&&(e+=", ")}return e}function O6e(t){var e;return t.type==="function"?`function ${t.name}(${qw(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${(e=t.outputs)!=null&&e.length?` returns (${qw(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${qw(t.inputs)})`:t.type==="error"?`error ${t.name}(${qw(t.inputs)})`:t.type==="constructor"?`constructor(${qw(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const _se=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function j6e(t){return _se.test(t)}function N6e(t){return bh(_se,t)}const Sse=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function D6e(t){return Sse.test(t)}function L6e(t){return bh(Sse,t)}const Ase=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function B6e(t){return Ase.test(t)}function F6e(t){return bh(Ase,t)}const kse=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function $se(t){return kse.test(t)}function U6e(t){return bh(kse,t)}const Ise=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function z6e(t){return Ise.test(t)}function W6e(t){return bh(Ise,t)}const Tse=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function H6e(t){return Tse.test(t)}function V6e(t){return bh(Tse,t)}const q6e=/^receive\(\) external payable$/;function K6e(t){return q6e.test(t)}const G6e=new Set(["indexed"]),yR=new Set(["calldata","memory","storage"]);let OIt=class extends Ua{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}},Z6e=class extends Ua{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},Y6e=class extends Ua{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}},Q6e=class extends Ua{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},X6e=class extends Ua{constructor({param:e,name:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},J6e=class extends Ua{constructor({param:e,type:n,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},e8e=class extends Ua{constructor({param:e,type:n,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},t8e=class extends Ua{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}},k2=class extends Ua{constructor({signature:e,type:n}){super(`Invalid ${n} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},n8e=class extends Ua{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},r8e=class extends Ua{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}},i8e=class extends Ua{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}},s8e=class extends Ua{constructor({current:e,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};function o8e(t,e,n){let r="";if(n)for(const i of Object.entries(n)){if(!i)continue;let s="";for(const o of i[1])s+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${i[0]}{${s}})`}return e?`${e}:${t}${r}`:t}const Lk=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function a8e(t,e={}){if(B6e(t))return c8e(t,e);if(D6e(t))return l8e(t,e);if(j6e(t))return u8e(t,e);if(z6e(t))return d8e(t,e);if(H6e(t))return h8e(t);if(K6e(t))return{type:"receive",stateMutability:"payable"};throw new n8e({signature:t})}function c8e(t,e={}){const n=F6e(t);if(!n)throw new k2({signature:t,type:"function"});const r=ol(n.parameters),i=[],s=r.length;for(let a=0;a<s;a++)i.push(d1(r[a],{modifiers:yR,structs:e,type:"function"}));const o=[];if(n.returns){const a=ol(n.returns),c=a.length;for(let l=0;l<c;l++)o.push(d1(a[l],{modifiers:yR,structs:e,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:i,outputs:o}}function l8e(t,e={}){const n=L6e(t);if(!n)throw new k2({signature:t,type:"event"});const r=ol(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(d1(r[o],{modifiers:G6e,structs:e,type:"event"}));return{name:n.name,type:"event",inputs:i}}function u8e(t,e={}){const n=N6e(t);if(!n)throw new k2({signature:t,type:"error"});const r=ol(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(d1(r[o],{structs:e,type:"error"}));return{name:n.name,type:"error",inputs:i}}function d8e(t,e={}){const n=W6e(t);if(!n)throw new k2({signature:t,type:"constructor"});const r=ol(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(d1(r[o],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:i}}
70function h8e(t){const e=V6e(t);if(!e)throw new k2({signature:t,type:"fallback"});return{type:"fallback",stateMutability:e.stateMutability??"nonpayable"}}const f8e=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,p8e=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,g8e=/^u?int$/;function d1(t,e){var d,h;const n=o8e(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(Lk.has(n))return Lk.get(n);const r=Cse.test(t),i=bh(r?p8e:f8e,t);if(!i)throw new Q6e({param:t});if(i.name&&y8e(i.name))throw new X6e({param:t,name:i.name});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=(e==null?void 0:e.structs)??{};let c,l={};if(r){c="tuple";const f=ol(i.type),m=[],y=f.length;for(let v=0;v<y;v++)m.push(d1(f[v],{structs:a}));l={components:m}}else if(i.type in a)c="tuple",l={components:a[i.type]};else if(g8e.test(i.type))c=`${i.type}256`;else if(c=i.type,(e==null?void 0:e.type)!=="struct"&&!Pse(c))throw new Y6e({type:c});if(i.modifier){if(!((h=(d=e==null?void 0:e.modifiers)==null?void 0:d.has)!=null&&h.call(d,i.modifier)))throw new J6e({param:t,type:e==null?void 0:e.type,modifier:i.modifier});if(yR.has(i.modifier)&&!w8e(c,!!i.array))throw new e8e({param:t,type:e==null?void 0:e.type,modifier:i.modifier})}const u={type:`${c}${i.array??""}`,...s,...o,...l};return Lk.set(n,u),u}function ol(t,e=[],n="",r=0){const i=t.trim().length;for(let s=0;s<i;s++){const o=t[s],a=t.slice(s+1);switch(o){case",":return r===0?ol(a,[...e,n.trim()]):ol(a,e,`${n}${o}`,r);case"(":return ol(a,e,`${n}${o}`,r+1);case")":return ol(a,e,`${n}${o}`,r-1);default:return ol(a,e,`${n}${o}`,r)}}if(n==="")return e;if(r!==0)throw new s8e({current:n,depth:r});return e.push(n.trim()),e}function Pse(t){return t==="address"||t==="bool"||t==="function"||t==="string"||xse.test(t)||Ese.test(t)}const m8e=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function y8e(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||xse.test(t)||Ese.test(t)||m8e.test(t)}function w8e(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function v8e(t){const e={},n=t.length;for(let o=0;o<n;o++){const a=t[o];if(!$se(a))continue;const c=U6e(a);if(!c)throw new k2({signature:a,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let h=0;h<d;h++){const m=l[h].trim();if(!m)continue;const y=d1(m,{type:"struct"});u.push(y)}if(!u.length)throw new r8e({signature:a});e[c.name]=u}const r={},i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,c]=i[o];r[a]=Rse(c,e)}return r}const b8e=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Rse(t,e,n=new Set){const r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];if(Cse.test(o.type))r.push(o);else{const c=bh(b8e,o.type);if(!(c!=null&&c.type))throw new t8e({abiParameter:o});const{array:l,type:u}=c;if(u in e){if(n.has(u))throw new i8e({type:u});r.push({...o,type:`tuple${l??""}`,components:Rse(e[u]??[],e,new Set([...n,u]))})}else if(Pse(u))r.push(o);else throw new Z6e({type:u})}}return r}function Mse(t){const e=v8e(t),n=[],r=t.length;for(let i=0;i<r;i++){const s=t[i];$se(s)||n.push(a8e(s,e))}return n}function zs(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const wR=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Ose=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],jse=[...Ose,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],x8e=[...Ose,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],KH=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],GH=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],ZH=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],E8e="0x82ad56cb",Nse="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b
70602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",C8e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",_8e="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
70603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";class vR extends et{constructor({blockNumber:e,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class S8e extends et{constructor({chain:e,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${e.id} â ${e.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${e.id} â ${e.name}`],name:"ChainMismatchError"})}}class A8e extends et{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` 71`),{name:"ChainNotFoundError"})}}class Dse extends et{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class t5 extends et{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}
71" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const Lse={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},k8e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},$8e={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function Mu(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new z8e(t.type);return`${t.name}(${tC(t.inputs,{includeName:e})})`}function tC(t,{includeName:e=!1}={}){return t?t.map(n=>I8e(n,{includeName:e})).join(e?", ":","):""}function I8e(t,{includeName:e}){return t.type.startsWith("tuple")?`(${tC(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class T8e extends et{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` 72`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class YH extends et{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` 73`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class Bse extends et{constructor({data:e,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(` 74`),{metaMessages:[`Params: (${tC(n,{includeName:!0})})`,`Data: ${e} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=n,this.size=r}}class n5 extends et{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class P8e extends et{constructor({expectedLength:e,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${e}`,`Given length: ${n}`].join(` 75`),{name:"AbiEncodingArrayLengthMismatchError"})}}class R8e extends et{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${vi(n)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class M8e extends et{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${n}`].join(` 76`),{name:"AbiEncodingLengthMismatchError"})}}class Fse extends et{constructor(e,{docsPath:n}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` 77`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class O8e extends et{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class Use extends et{constructor(e,{docsPath:n}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` 78`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class QH extends et{constructor(e,{docsPath:n}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` 79`),{docsPath:n,name:"AbiEventNotFoundError"})}}class K7 extends et{constructor(e,{docsPath:n}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` 80`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class j8e extends et{constructor(e,{docsPath:n}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` 81`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class N8e extends et{constructor(e,{docsPath:n}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` 82`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class D8e extends et{constructor(e,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Mu(e.abiItem)}\`, and`,`\`${n.type}\` in \`${Mu(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let L8e=class extends et{constructor({expectedSize:e,givenSize:n}){super(`Expected bytes${e}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class qb extends et{constructor({abiItem:e,data:n,params:r,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` 83`),{metaMessages:[`Params: (${tC(r,{includeName:!0})})`,`Data: ${n} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=n,this.params=r,this.size=i}}class nC extends et{constructor({abiItem:e,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${Mu(e,{includeName:!0})}".`].join(` 84`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class B8e extends et{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` 85`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class F8e extends et{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` 86`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let U8e=class extends et{constructor(e){super([`Value "${e}" is not a valid array.`].join(` 87`),{name:"InvalidArrayError"})}};class z8e extends et{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` 88`),{name:"InvalidDefinitionTypeError"})}}function h1(t,e,n,{strict:r}={}
88){return Da(t,{strict:!1})?Vse(t,e,n,{strict:r}):Hse(t,e,n,{strict:r})}function zse(t,e){if(typeof e=="number"&&e>0&&e>vi(t)-1)throw new wse({offset:e,position:"start",size:vi(t)})}function Wse(t,e,n){if(typeof e=="number"&&typeof n=="number"&&vi(t)!==n-e)throw new wse({offset:n,position:"end",size:vi(t)})}function Hse(t,e,n,{strict:r}={}){zse(t,e);const i=t.slice(e,n);return r&&Wse(i,e,n),i}function Vse(t,e,n,{strict:r}={}){zse(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return r&&Wse(i,e,n),i}function G7(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function W8e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function r5(t,...e){if(!W8e(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function H8e(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");G7(t.outputLen),G7(t.blockLen)}function Vy(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function qse(t,e){r5(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const I4=BigInt(2**32-1),XH=BigInt(32);function V8e(t,e=!1){return e?{h:Number(t&I4),l:Number(t>>XH&I4)}:{h:Number(t>>XH&I4)|0,l:Number(t&I4)|0}}
vendor: 4,485 bytes, line 88
88function q8e(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=V8e(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const K8e=(t,e,n)=>t<<n|e>>>32-n,G8e=(t,e,n)=>e<<n|t>>>32-n,Z8e=(t,e,n)=>e<<n-32|t>>>64-n,Y8e=(t,e,n)=>t<<n-32|e>>>64-n,Lg=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Q8e(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Bk(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Fl(t,e){return t<<32-e|t>>>e}const JH=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function X8e(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function eV(t){for(let e=0;e<t.length;e++)t[e]=X8e(t[e])}function J8e(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function rC(t){return typeof t=="string"&&(t=J8e(t)),r5(t),t}function e7e(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];r5(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}let iD=class{clone(){return this._cloneInto()}};function Kse(t){const e=r=>t().update(rC(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function t7e(t=32){if(Lg&&typeof Lg.getRandomValues=="function")return Lg.getRandomValues(new Uint8Array(t));if(Lg&&typeof Lg.randomBytes=="function")return Lg.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const Gse=[],Zse=[],Yse=[],n7e=BigInt(0),Kw=BigInt(1),r7e=BigInt(2),i7e=BigInt(7),s7e=BigInt(256),o7e=BigInt(113);for(let t=0,e=Kw,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],Gse.push(2*(5*r+n)),Zse.push((t+1)*(t+2)/2%64);let i=n7e;for(let s=0;s<7;s++)e=(e<<Kw^(e>>i7e)*o7e)%s7e,e&r7e&&(i^=Kw<<(Kw<<BigInt(s))-Kw);Yse.push(i)}const[a7e,c7e]=q8e(Yse,!0),tV=(t,e,n)=>n>32?Z8e(t,e,n):K8e(t,e,n),nV=(t,e,n)=>n>32?Y8e(t,e,n):G8e(t,e,n);function l7e(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],d=tV(l,u,1)^n[a],h=nV(l,u,1)^n[a+1];for(let f=0;f<50;f+=10)t[o+f]^=d,t[o+f+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=Zse[o],c=tV(i,s,a),l=nV(i,s,a),u=Gse[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=a7e[r],t[1]^=c7e[r]}n.fill(0)}let u7e=class Qse extends iD{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,G7(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Q8e(this.state)}keccak(){JH||eV(this.state32),l7e(this.state32,this.rounds),JH||eV(this.state32),this.posOut=0,this.pos=0}update(e){Vy(this);const{blockLen:n,state:r}=this;e=rC(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Vy(this,!1),r5(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return G7(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(qse(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Qse(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const d7e=(t,e,n)=>Kse(()=>new u7e(e,t,n)),h7e=d7e(1,136,256/8);
88function Ns(t,e){const n=e||"hex",r=h7e(Da(t,{strict:!1})?Ud(t):t);return n==="bytes"?r:Qt(r)}const f7e=t=>Ns(Ud(t));function p7e(t){return f7e(t)}function g7e(t){let e=!0,n="",r=0,i="",s=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&r++,a===")"&&r--,!!e){if(r===0){if(a===" "&&["event","function",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){t[o-1]!==","&&n!==","&&n!==",("&&(n="",e=!1);continue}i+=a,n+=a}}if(!s)throw new et("Unable to normalize signature.");return i}const m7e=t=>{const e=typeof t=="string"?t:O6e(t);return g7e(e)};function Xse(t){return p7e(m7e(t))}const iC=t=>h1(Xse(t),0,4);let ps=class extends et{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}};const y7e=/^0x[a-fA-F0-9]{40}$/,Fk=new eC(8192);function Wr(t,e){const{strict:n=!0}=e??{},r=`${t}.${n}`;if(Fk.has(r))return Fk.get(r);const i=y7e.test(t)?t.toLowerCase()===t?!0:n?i5(t)===t:!0:!1;return Fk.set(r,i),i}const Uk=new eC(8192);function i5(t,e){if(Uk.has(`${t}.${e}`))return Uk.get(`${t}.${e}`);const n=t.substring(2).toLowerCase(),r=Ns(Q0(n),"bytes"),i=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(r[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return Uk.set(`${t}.${e}`,s),s}function cr(t,e){if(!Wr(t,{strict:!1}))throw new ps({address:t});return i5(t,e)}class rV extends et{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Jse extends et{constructor({length:e,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class w7e extends et{constructor({count:e,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const v7e={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new w7e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new Jse({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new rV({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new rV({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const n=e??this.position;return this.assertPosition(n+t-1),this.bytes.subarray(n,n+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const n=this.inspectBytes(t);return this.position+=e??t,n},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function sD(t,{recursiveReadLimit:e=8192}={}){const n=Object.create(v7e);return n.bytes=t,n.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=e,n}function b7e(t,e={}){typeof e.size<"u"&&Ic(t,{size:e.size});const n=Ii(t,e);return Sr(n,e)}function x7e(t,e={}){let n=t;if(typeof e.size<"u"&&(Ic(n,{size:e.size}),n=yc(n)),n.length>1||n[0]>1)throw new v6e(n);return!!n[0]}function zd(t,e={}){typeof e.size<"u"&&Ic(t,{size:e.size});const n=Ii(t,e);return Ec(n,e)}function E7e(t,e={}){let n=t;return typeof e.size<"u"&&(Ic(n,{size:e.size}),n=yc(n,{dir:"right"})),new TextDecoder().decode(n)}function Zd(t){return typeof t[0]=="string"?Il(t):C7e(t)}function C7e(t){let e=0;for(const i of t)e+=i.length;const n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function Il(t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}const _7e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,eoe=/^(u?int)(8|
8816|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function $2(t,e){if(t.length!==e.length)throw new M8e({expectedLength:t.length,givenLength:e.length});const n=S7e({params:t,values:e}),r=aD(n);return r.length===0?"0x":r}function S7e({params:t,values:e}){const n=[];for(let r=0;r<t.length;r++)n.push(oD({param:t[r],value:e[r]}));return n}function oD({param:t,value:e}){const n=cD(t.type);if(n){const[r,i]=n;return k7e(e,{length:r,param:{...t,type:i}})}if(t.type==="tuple")return R7e(e,{param:t});if(t.type==="address")return A7e(e);if(t.type==="bool")return I7e(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){const r=t.type.startsWith("int"),[,,i="256"]=eoe.exec(t.type)??[];return T7e(e,{signed:r,size:Number(i)})}if(t.type.startsWith("bytes"))return $7e(e,{param:t});if(t.type==="string")return P7e(e);throw new B8e(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function aD(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?e+=32:e+=vi(a)}const n=[],r=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?(n.push(dn(e+i,{size:32})),r.push(a),i+=vi(a)):n.push(a)}return Zd([...n,...r])}function A7e(t){if(!Wr(t))throw new ps({address:t});return{dynamic:!1,encoded:Qf(t.toLowerCase())}}function k7e(t,{length:e,param:n}){const r=e===null;if(!Array.isArray(t))throw new U8e(t);if(!r&&t.length!==e)throw new P8e({expectedLength:e,givenLength:t.length,type:`${n.type}[${e}]`});let i=!1;const s=[];for(let o=0;o<t.length;o++){const a=oD({param:n,value:t[o]});a.dynamic&&(i=!0),s.push(a)}if(r||i){const o=aD(s);if(r){const a=dn(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Zd([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Zd(s.map(({encoded:o})=>o))}}function $7e(t,{param:e}){const[,n]=e.type.split("bytes"),r=vi(t);if(!n){let i=t;return r%32!==0&&(i=Qf(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Zd([Qf(dn(r,{size:32})),i])}}if(r!==Number.parseInt(n))throw new R8e({expectedSize:Number.parseInt(n),value:t});return{dynamic:!1,encoded:Qf(t,{dir:"right"})}}function I7e(t){if(typeof t!="boolean")throw new et(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Qf(bse(t))}}function T7e(t,{signed:e,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(e?1n:0n))-1n,i=e?-r-1n:0n;if(t>r||t<i)throw new yse({max:r.toString(),min:i.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:dn(t,{size:32,signed:e})}}function P7e(t){const e=Wy(t),n=Math.ceil(vi(e)/32),r=[];for(let i=0;i<n;i++)r.push(Qf(h1(e,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Zd([Qf(dn(vi(e),{size:32})),...r])}}function R7e(t,{param:e}){let n=!1;const r=[];for(let i=0;i<e.components.length;i++){const s=e.components[i],o=Array.isArray(t)?i:s.name,a=oD({param:s,value:t[o]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?aD(r):Zd(r.map(({encoded:i})=>i))}}function cD(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function I2(t,e){const n=typeof e=="string"?To(e):e,r=sD(n);if(vi(n)===0&&t.length>0)throw new n5;if(vi(e)&&vi(e)<32)throw new Bse({data:typeof e=="string"?e:Ii(e),params:t,size:vi(e)});let i=0;const s=[];for(let o=0;o<t.length;++o){const a=t[o];r.setPosition(i);const[c,l]=Ym(r,a,{staticPosition:0});i+=l,s.push(c)}return s}function Ym(t,e,{staticPosition:n}){const r=cD(e.type);if(r){const[i,s]=r;return O7e(t,{...e,type:s},{length:i,staticPosition:n})}if(e.type==="tuple")return L7e(t,e,{staticPosition:n});if(e.type==="address")return M7e(t);if(e.type==="bool")return j7e(t);if(e.type.startsWith("bytes"))return N7e(t,e,{staticPosition:n});if(e.type.startsWith("uint")||e.type.startsWith("int"))return D7e(t,e);if(e.type==="string")return B7e(t,{staticPosition:n});throw new F8e(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const iV=32,bR=32;function M7e(t){const e=t.readBytes(32);return[i5(Ii(Hse(e,-20))),32]}function O7e(t,e,{length:n,staticPosition:r}){if(!n){const o=zd(t.readBytes(bR)),a=r+o,c=a+iV;t.setPosition(a);const l=zd(t.readBytes(iV)),u=Kb(e);let d=0;const h=[];for(let f=0;f<l;++f){t.setPosition(c+(u?f*32:d));const[m,y]=Ym(t,e,{staticPosition:c});d+=y,h.push(m)}return t.setPosition(r+32),[h,32]}if(Kb(e)){const o=zd(t.readBytes(bR)),a=r+o,c=[];for(let l=0;l<n;++l){t.setPosition(a+l*32);const[u]=Ym(t,e,{staticPosition:a});c.push(u)}return t.setPosition(r+32),[c,32]}let i=0;const s=[];for(let o=0;o<n;++o){const[a,c]=Ym(t,e,{staticPosition:r+i});i+=c,s.push(a)}return[s,i]}function j7e(t){return[x7e(t.readBytes(32),{size:32}),32]}function N7e(t,e,{staticPosition:n}){const[r,i]=e.type.split("bytes");if(!i){const o=zd(t.readBytes(32));t.setPosition(n+o);const a=zd(t.readBytes(32));if(a===0)return t.setPosition(n+32),["0x",32];const c=t.readBytes(a);return t.setPosition(n+32),[Ii(c),32]}return[Ii(t.readBytes(Number.parseInt(i),32)),32]}function D7e(t,e){const n=e.type.startsWith("int"),r=Number.parseInt(e.type.split("int")[1]||"256"),i=t.readBytes(32);return[r>48?b7e(i,{signed:n}):zd(i,{signed:n}),32]}function L7e(t,e,{staticPosition:n}){const r=e.components.length===0||e.components.some(({name:o})=>!o),i=r?[]:{};let s=0;if(Kb(e)){const o=zd(t.readBytes(bR)),a=n+o;for(let c=0;c<e.components.length;++c){const l=e.components[c];t.setPosition(a+s);const[u,d]=Ym(t,l,{staticPosition:a});s+=d,i[r?c:l==null?void 0:l.name]=u}return t.setPosition(n+32),[i,32]}for(let o=0;o<e.components.length;++o){const a=e.components[o],[c,l]=Ym(t,a,{staticPosition:n});i[r?o:a==null?void 0:a.name]=c,s+=l}return[i,s]}function B7e(t,{staticPosition:e}){const n=zd(t.readBytes(32)),r=e+n;t.setPosition(r);const i=zd(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];const s=t.readBytes(i,32),o=E7e(yc(s));return t.setPosition(e+32),[o,32]}function Kb(t){var r;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;
88if(e==="tuple")return(r=t.components)==null?void 0:r.some(Kb);const n=cD(t.type);return!!(n&&Kb({...t,type:n[1]}))}function F7e(t){const{abi:e,data:n}=t,r=h1(n,0,4);if(r==="0x")throw new n5;const s=[...e||[],k8e,$8e].find(o=>o.type==="error"&&r===iC(Mu(o)));if(!s)throw new Fse(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?I2(s.inputs,h1(n,4)):void 0,errorName:s.name}}function toe({abiItem:t,args:e,includeFunctionName:n=!0,includeName:r=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${n?t.name:""}(${t.inputs.map((i,s)=>`${r&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?fs(e[s]):e[s]}`).join(", ")})`}const sC=Xse;function s5(t){const{abi:e,args:n=[],name:r}=t,i=Da(r,{strict:!1}),s=e.filter(a=>i?a.type==="function"?iC(a)===r:a.type==="event"?sC(a)===r:!1:"name"in a&&a.name===r);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((l,u)=>{const d="inputs"in a&&a.inputs[u];return d?xR(l,d):!1})){if(o&&"inputs"in o&&o.inputs){const l=noe(a.inputs,o.inputs,n);if(l)throw new D8e({abiItem:a,type:l[0]},{abiItem:o,type:l[1]})}o=a}}return o||s[0]}function xR(t,e){const n=typeof t,r=e.type;switch(r){case"address":return Wr(t,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>xR(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(t)&&t.every(i=>xR(i,{...e,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function noe(t,e,n){for(const r in t){const i=t[r],s=e[r];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return noe(i.components,s.components,n[r]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Wr(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?Wr(n[r],{strict:!1}):!1)return o}}const roe={gwei:9,wei:18},U7e={ether:-9,wei:9};function us(t,e){let n=t.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(e,"0");let[i,s]=[n.slice(0,n.length-e),n.slice(n.length-e)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${i||"0"}${s?`.${s}`:""}`}function j1(t,e="wei"){return us(t,roe[e])}function da(t,e="wei"){return us(t,U7e[e])}class z7e extends et{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class W7e extends et{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function sV(t){return t.reduce((e,{slot:n,value:r})=>`${e} ${n}: ${r} 89`,"")}function H7e(t){return t.reduce((e,{address:n,...r})=>{let i=`${e} ${n}: 90`;return r.nonce&&(i+=` nonce: ${r.nonce} 91`),r.balance&&(i+=` balance: ${r.balance} 92`),r.code&&(i+=` code: ${r.code} 93`),r.state&&(i+=` state: 94`,i+=sV(r.state)),r.stateDiff&&(i+=` stateDiff: 95`,i+=sV(r.stateDiff)),i},` State Override: 96`).slice(0,-1)}function o5(t){const e=Object.entries(t).map(([r,i])=>i===void 0||i===!1?null:[r,i]).filter(Boolean),n=e.reduce((r,[i])=>Math.max(r,i.length),0);return e.map(([r,i])=>` ${`${r}:`.padEnd(n+1)} ${i}`).join(` 97`)}class V7e extends et{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` 98`),{name:"FeeConflictError"})}}class q7e extends et{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class K7e extends et{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",o5(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class G7e extends et{constructor({storageKey:e}){super(`Size for storage key "${e}
98" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class Z7e extends et{constructor(e,{account:n,docsPath:r,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:h}){var m;const f=o5({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:n==null?void 0:n.address,to:d,value:typeof h<"u"&&`${j1(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${da(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${da(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${da(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",f].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class ioe extends et{constructor({blockHash:e,blockNumber:n,blockTag:r,hash:i,index:s}){let o="Transaction";r&&s!==void 0&&(o=`Transaction at block time "${r}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),n&&s!==void 0&&(o=`Transaction at block number "${n}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class soe extends et{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class Y7e extends et{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}class ooe extends et{constructor(e,{account:n,docsPath:r,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:h,stateOverride:f}){var v;const m=n?zs(n):void 0;let y=o5({from:m==null?void 0:m.address,to:d,value:typeof h<"u"&&`${j1(h)} ${((v=i==null?void 0:i.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${da(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${da(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${da(l)} gwei`,nonce:u});f&&(y+=` 99${H7e(f)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",y].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class Q7e extends et{constructor(e,{abi:n,args:r,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=s5({abi:n,args:r,name:o}),l=c?toe({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=c?Mu(c,{includeName:!0}):void 0,d=o5({address:i&&m6e(i),function:u,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class ER extends et{constructor({abi:e,data:n,functionName:r,message:i}){let s,o,a,c;if(n&&n!=="0x")try{o=F7e({abi:e,data:n});const{abiItem:u,errorName:d,args:h}=o;if(d==="Error")c=h[0];else if(d==="Panic"){const[f]=h;c=Lse[f]}else{const f=u?Mu(u,{includeName:!0}):void 0,m=u&&h?toe({abiItem:u,args:h,includeFunctionName:!1,includeName:!1}):void 0;a=[f?`Error: ${f}`:"",m&&m!=="()"?` ${[...Array((d==null?void 0:d.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(u){s=u}else i&&(c=i);let l;s instanceof Fse&&(l=s.signature,a=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(c&&c!=="execution reverted"||l?[`The contract function "${r}" reverted with the following ${l?"signature":"reason"}:`,c||l].join(` 100`):`The contract function "${r}" reverted.`,{cause:s,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.raw=n,this.reason=c,this.signature=l}}class X7e extends et{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class J7e extends et{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class oC extends et{constructor({data:e,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}const zk="/docs/contract/decodeFunctionResult";function N1(t){const{abi:e,args:n,functionName:r,data:i}=t;let s=e[0];if(r){const a=s5({abi:e,args:n,name:r});if(!a)throw new K7(r,{docsPath:zk});s=a}if(s.type!=="function")throw new K7(void 0,{docsPath:zk});if(!s.outputs)throw new j8e(s.name,{docsPath:zk});const o=I2(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const Wk="/docs/contract/encodeDeployData";function aC(t){const{abi:e,args:n,bytecode:r}=t;if(!n||n.length===0)return r;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new T8e({docsPath:Wk});if(!("inputs"in i))throw new YH({docsPath:Wk});if(!i.inputs||i.inputs.length===0)throw new YH({docsPath:Wk});const s=$2(i.inputs,n);return Il([r,s])}const oV="/docs/contract/encodeFunctionData";function e9e(t){const{abi:e,args:n,functionName:r}=t;let i=e[0];if(r){const s=s5({abi:e,args:n,name:r});if(!s)throw new K7(r,{docsPath:oV});i=s}if(i.type!=="function")throw new K7(void 0,{docsPath:oV});return{abi:[i],functionName:iC(Mu(i))}}function Tc(t){const{args:e}=t,{abi:n,functionName:r}=(()=>{var a;return t.abi.length===1&&((a=t.functionName)!=null&&a.startsWith("0x"))?t:e9e(t)})(),i=n[0],s=r,o="inputs"in i&&i.inputs?$2(i.inputs,e??[]):void 0;return Il([s,o??"0x"])}function T2({blockNumber:t,chain:e,contract:n}){var i;const r=(i=e==null?void 0:e.contracts)==null?void 0:i[n];if(!r)throw new vR({chain:e,contract:{name:n}});if(t&&r.blockCreated&&r.blockCreated>t)throw new vR({blockNumber:t,chain:e,contract:{name:n,blockCreated:r.blockCreated}});return r.address}
100class m0 extends et{constructor({cause:e,message:n}={}){var i;const r=(i=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(m0,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(m0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class f1 extends et{constructor({cause:e,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${da(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(f1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class CR extends et{constructor({cause:e,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${da(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(CR,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class _R extends et{constructor({cause:e,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(_R,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class SR extends et{constructor({cause:e,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` 101`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(SR,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class AR extends et{constructor({cause:e,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(AR,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class kR extends et{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` 102`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(kR,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class $R extends et{constructor({cause:e,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty($R,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class IR extends et{constructor({cause:e,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(IR,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class TR extends et{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(TR,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Gb extends et{constructor({cause:e,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${da(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${da(r)} gwei`:""}).`].join(` 103`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(Gb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class a5 extends et{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function cC(t,e){const n=(t.details||"").toLowerCase(),r=t instanceof et?t.walk(i=>(i==null?void 0:i.code)===m0.code):t;return r instanceof et?new m0({cause:t,message:r.details}):m0.nodeMessage.test(n)?new m0({cause:t,message:t.details}):f1.nodeMessage.test(n)?new f1({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):CR.nodeMessage.test(n)?new CR({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):_R.nodeMessage.test(n)?new _R({cause:t,nonce:e==null?void 0:e.nonce}):SR.nodeMessage.test(n)?new SR({cause:t,nonce:e==null?void 0:e.nonce}):AR.nodeMessage.test(n)?new AR({cause:t,nonce:e==null?void 0:e.nonce}):kR.nodeMessage.test(n)?new kR({cause:t}):$R.nodeMessage.test(n)?new $R({cause:t,gas:e==null?void 0:e.gas}):IR.nodeMessage.test(n)?new IR({cause:t,gas:e==null?void 0:e.gas}):TR.nodeMessage.test(n)?new TR({cause:t}):Gb.nodeMessage.test(n)?new Gb({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new a5({cause:t})}function aoe(t,{docsPath:e,...n}){const r=(()=>{const i=cC(t,n);return i instanceof a5?t:i})();return new ooe(r,{docsPath:e,...n})}function lC(t,{format:e}){if(!e)return{};const n={};function r(s){const o=Object.keys(s);for(const a of o)a in t&&(n[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&r(s[a])}const i=e(t||{});return r(i),n}function uC(t,e){return({exclude:n,format:r})=>({exclude:n,format:i=>{const s=e(i);if(n)for(const o of n)delete s[o];return{...s,...r(i)}},type:t})}const t9e={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function D1(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=r9e(t.authorizationList)),typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="str
103ing"?e.blobs=t.blobs.map(n=>Ii(n)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=dn(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=dn(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=dn(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=dn(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=dn(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=dn(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=t9e[t.type]),typeof t.value<"u"&&(e.value=dn(t.value)),e}const n9e=uC("transactionRequest",D1);function r9e(t){return t.map(e=>({address:e.contractAddress,r:e.r?dn(BigInt(e.r)):e.r,s:e.s?dn(BigInt(e.s)):e.s,chainId:dn(e.chainId),nonce:dn(e.nonce),...typeof e.yParity<"u"?{yParity:dn(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:dn(e.v)}:{}}))}function coe(){let t=()=>{},e=()=>{};return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}const Hk=new Map;function loe({fn:t,id:e,shouldSplitBatch:n,wait:r=0,sort:i}){const s=async()=>{const u=c();o();const d=u.map(({args:h})=>h);d.length!==0&&t(d).then(h=>{i&&Array.isArray(h)&&h.sort(i);for(let f=0;f<u.length;f++){const{resolve:m}=u[f];m==null||m([h[f],h])}}).catch(h=>{for(let f=0;f<u.length;f++){const{reject:m}=u[f];m==null||m(h)}})},o=()=>Hk.delete(e),a=()=>c().map(({args:u})=>u),c=()=>Hk.get(e)||[],l=u=>Hk.set(e,[...c(),u]);return{flush:o,async schedule(u){const{promise:d,resolve:h,reject:f}=coe();return(n==null?void 0:n([...a(),u]))&&s(),c().length>0?(l({args:u,resolve:h,reject:f}),d):(l({args:u,resolve:h,reject:f}),setTimeout(s,r),d)}}}function aV(t){if(!(!t||t.length===0))return t.reduce((e,{slot:n,value:r})=>{if(n.length!==66)throw new HH({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new HH({size:r.length,targetSize:66,type:"hex"});return e[n]=r,e},{})}function i9e(t){const{balance:e,nonce:n,state:r,stateDiff:i,code:s}=t,o={};if(s!==void 0&&(o.code=s),e!==void 0&&(o.balance=dn(e)),n!==void 0&&(o.nonce=dn(n)),r!==void 0&&(o.state=aV(r)),i!==void 0){if(o.state)throw new W7e;o.stateDiff=aV(i)}return o}function lD(t){if(!t)return;const e={};for(const{address:n,...r}of t){if(!Wr(n,{strict:!1}))throw new ps({address:n});if(e[n])throw new z7e({address:n});e[n]=i9e(r)}return e}const s9e=2n**16n-1n,dC=2n**256n-1n;function L1(t){const{account:e,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:i,to:s}=t,o=e?zs(e):void 0;if(o&&!Wr(o.address))throw new ps({address:o.address});if(s&&!Wr(s))throw new ps({address:s});if(typeof n<"u"&&(typeof r<"u"||typeof i<"u"))throw new V7e;if(r&&r>dC)throw new f1({maxFeePerGas:r});if(i&&r&&i>r)throw new Gb({maxFeePerGas:r,maxPriorityFeePerGas:i})}async function hC(t,e){var U,z,L,S;const{account:n=t.account,batch:r=!!((U=t.batch)!=null&&U.multicall),blockNumber:i,blockTag:s="latest",accessList:o,blobs:a,code:c,data:l,factory:u,factoryData:d,gas:h,gasPrice:f,maxFeePerBlobGas:m,maxFeePerGas:y,maxPriorityFeePerGas:v,nonce:b,to:C,value:x,stateOverride:_,...$}=e,I=n?zs(n):void 0;if(c&&(u||d))throw new et("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&C)throw new et("Cannot provide both `code` & `to` as parameters.");const R=c&&l,N=u&&d&&C&&l,T=R||N,O=R?c9e({code:c,data:l}):N?l9e({data:l,factory:u,factoryData:d,to:C}):l;try{L1(e);const M=(i?dn(i):void 0)||s,W=lD(_),H=(S=(L=(z=t.chain)==null?void 0:z.formatters)==null?void 0:L.transactionRequest)==null?void 0:S.format,V=(H||D1)({...lC($,{format:H}),from:I==null?void 0:I.address,accessList:o,blobs:a,data:O,gas:h,gasPrice:f,maxFeePerBlobGas:m,maxFeePerGas:y,maxPriorityFeePerGas:v,nonce:b,to:T?void 0:C,value:x});if(r&&o9e({request:V})&&!W)try{return await a9e(t,{...V,blockNumber:i,blockTag:s})}catch(P){if(!(P instanceof Dse)&&!(P instanceof vR))throw P}const B=await t.request({method:"eth_call",params:W?[V,M,W]:[V,M]});return B==="0x"?{data:void 0}:{data:B}}catch(k){const M=u9e(k),{offchainLookup:W,offchainLookupSignature:H}=await mr(async()=>{const{offchainLookup:D,offchainLookupSignature:V}=await import("./ccip-BVxjNfIl.js");return{offchainLookup:D,offchainLookupSignature:V}},[]);if(t.ccipRead!==!1&&(M==null?void 0:M.slice(0,10))===H&&C)return{data:await W(t,{data:M,to:C})};throw T&&(M==null?void 0:M.slice(0,10))==="0x101bb98d"?new J7e({factory:u}):aoe(k,{...e,account:I,chain:t.chain})}}function o9e({request:t}){const{data:e,to:n,...r}=t;return!(!e||e.startsWith(E8e)||!n||Object.values(r).filter(i=>typeof i<"u").length>0)}async function a9e(t,e){var y;const{batchSize:n=1024,wait:r=0}=typeof((y=t.batch)==null?void 0:y.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new Dse;l=T2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const d=(i?dn(i):void 0)||s,{schedule:h}=loe({id:`${t.uid}.${d}`,wait:r,shouldSplitBatch(v){return v.reduce((C,{data:x})=>C+(x.length-2),0)>n*2},fn:async v=>{const b=v.map(_=>
103({allowFailure:!0,callData:_.data,target:_.to})),C=Tc({abi:wR,args:[b],functionName:"aggregate3"}),x=await t.request({method:"eth_call",params:[{data:C,to:l},d]});return N1({abi:wR,args:[b],functionName:"aggregate3",data:x||"0x"})}}),[{returnData:f,success:m}]=await h({data:o,to:c});if(!m)throw new oC({data:f});return f==="0x"?{data:void 0}:{data:f}}function c9e(t){const{code:e,data:n}=t;return aC({abi:Mse(["constructor(bytes, bytes)"]),bytecode:Nse,args:[e,n]})}function l9e(t){const{data:e,factory:n,factoryData:r,to:i}=t;return aC({abi:Mse(["constructor(address, bytes, address, bytes)"]),bytecode:C8e,args:[i,e,n,r]})}function u9e(t){var n;if(!(t instanceof et))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(n=e.data)==null?void 0:n.data:e.data}function uD(t,e){if(!Wr(t,{strict:!1}))throw new ps({address:t});if(!Wr(e,{strict:!1}))throw new ps({address:e});return t.toLowerCase()===e.toLowerCase()}function uoe({chain:t,currentChainId:e}){if(!t)throw new A8e;if(e!==t.id)throw new S8e({chain:t,currentChainId:e})}function Pc(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function fC(t,{errorInstance:e=new Error("timed out"),timeout:n,signal:r}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;n>0&&(o=setTimeout(()=>{r?a.abort():s(e)},n)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function d9e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const cV=d9e();function h9e(t,e={}){return{async request(n){var d;const{body:r,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=n,a={...e.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:l,signal:u}=a;try{const h=await fC(async({signal:m})=>{const y={...a,body:Array.isArray(r)?fs(r.map(x=>({jsonrpc:"2.0",id:x.id??cV.take(),...x}))):fs({jsonrpc:"2.0",id:r.id??cV.take(),...r}),headers:{"Content-Type":"application/json",...c},method:l||"POST",signal:u||(o>0?m:null)},v=new Request(t,y),b=await(i==null?void 0:i(v,y))??{...y,url:t};return await fetch(b.url??t,b)},{errorInstance:new WH({body:r,url:t}),timeout:o,signal:!0});s&&await s(h);let f;if((d=h.headers.get("Content-Type"))!=null&&d.startsWith("application/json"))f=await h.json();else{f=await h.text();try{f=JSON.parse(f||"{}")}catch(m){if(h.ok)throw m;f={error:f}}}if(!h.ok)throw new ob({body:r,details:fs(f.error)||h.statusText,headers:h.headers,status:h.status,url:t});return f}catch(h){throw h instanceof ob||h instanceof WH?h:new ob({body:r,cause:h,url:t})}}}}class f9e extends et{constructor({domain:e}){super(`Invalid domain "${fs(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class p9e extends et{constructor({primaryType:e,types:n}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class g9e extends et{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function m9e(t){const{domain:e={},message:n,primaryType:r}=t,i={EIP712Domain:moe({domain:e}),...t.types};goe({domain:e,message:n,primaryType:r,types:i});const s=["0x1901"];return e&&s.push(y9e({domain:e,types:i})),r!=="EIP712Domain"&&s.push(doe({data:n,primaryType:r,types:i})),Ns(Zd(s))}function y9e({domain:t,types:e}){return doe({data:t,primaryType:"EIP712Domain",types:e})}function doe({data:t,primaryType:e,types:n}){const r=hoe({data:t,primaryType:e,types:n});return Ns(r)}function hoe({data:t,primaryType:e,types:n}){const r=[{type:"bytes32"}],i=[w9e({primaryType:e,types:n})];for(const s of n[e]){const[o,a]=poe({types:n,name:s.name,type:s.type,value:t[s.name]});r.push(o),i.push(a)}return $2(r,i)}function w9e({primaryType:t,types:e}){const n=Qt(v9e({primaryType:t,types:e}));return Ns(n)}function v9e({primaryType:t,types:e}){let n="";const r=foe({primaryType:t,types:e});r.delete(t);const i=[t,...Array.from(r).sort()];for(const s of i)n+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return n}function foe({primaryType:t,types:e},n=new Set){const r=t.match(/^\w*/u),i=r==null?void 0:r[0];if(n.has(i)||e[i]===void 0)return n;n.add(i);for(const s of e[i])foe({primaryType:s.type,types:e},n);return n}function poe({types:t,name:e,type:n,value:r}){if(t[n]!==void 0)return[{type:"bytes32"},Ns(hoe({data:r,primaryType:n,types:t}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},Ns(r)];if(n==="string")return[{type:"bytes32"},Ns(Qt(r))];if(n.lastIndexOf("]")===n.length-1){const i=n.slice(0,n.lastIndexOf("[")),s=r.map(o=>poe({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},Ns($2(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:n},r]}function b9e(t){const{domain:e,message:n,primaryType:r,types:i}=t,s=(c,l)=>{const u={...l};for(const d of c){const{name:h,type:f}=d;f==="address"&&(u[h]=u[h].toLowerCase())}return u},o=i.EIP712Domain?e?s(i.EIP712Domain,e):{}:{},a=(()=>
103{if(r!=="EIP712Domain")return s(i[r],n)})();return fs({domain:o,message:a,primaryType:r,types:i})}function goe(t){const{domain:e,message:n,primaryType:r,types:i}=t,s=(o,a)=>{for(const c of o){const{name:l,type:u}=c,d=a[l],h=u.match(eoe);if(h&&(typeof d=="number"||typeof d=="bigint")){const[y,v,b]=h;dn(d,{signed:v==="int",size:Number.parseInt(b)/8})}if(u==="address"&&typeof d=="string"&&!Wr(d))throw new ps({address:d});const f=u.match(_7e);if(f){const[y,v]=f;if(v&&vi(d)!==Number.parseInt(v))throw new L8e({expectedSize:Number.parseInt(v),givenSize:vi(d)})}const m=i[u];m&&(x9e(u),s(m,d))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new f9e({domain:e});s(i.EIP712Domain,e)}if(r!=="EIP712Domain")if(i[r])s(i[r],n);else throw new p9e({primaryType:r,types:i})}function moe({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},(typeof(t==null?void 0:t.chainId)=="number"||typeof(t==null?void 0:t.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function x9e(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new g9e({type:t})}const lV="/docs/contract/decodeEventLog";function dD(t){const{abi:e,data:n,strict:r,topics:i}=t,s=r??!0,[o,...a]=i;if(!o)throw new O8e({docsPath:lV});const c=e.length===1?e[0]:e.find(y=>y.type==="event"&&o===sC(Mu(y)));if(!(c&&"name"in c)||c.type!=="event")throw new Use(o,{docsPath:lV});const{name:l,inputs:u}=c,d=u==null?void 0:u.some(y=>!("name"in y&&y.name));let h=d?[]:{};const f=u.filter(y=>"indexed"in y&&y.indexed);for(let y=0;y<f.length;y++){const v=f[y],b=a[y];if(!b)throw new nC({abiItem:c,param:v});h[d?y:v.name||y]=E9e({param:v,value:b})}const m=u.filter(y=>!("indexed"in y&&y.indexed));if(m.length>0){if(n&&n!=="0x")try{const y=I2(m,n);if(y)if(d)h=[...h,...y];else for(let v=0;v<m.length;v++)h[m[v].name]=y[v]}catch(y){if(s)throw y instanceof Bse||y instanceof Jse?new qb({abiItem:c,data:n,params:m,size:vi(n)}):y}else if(s)throw new qb({abiItem:c,data:"0x",params:m,size:0})}return{eventName:l,args:Object.values(h).length>0?h:void 0}}function E9e({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(I2([t],e)||[])[0]}function C9e(t){const{abi:e,data:n}=t,r=h1(n,0,4),i=e.find(s=>s.type==="function"&&r===iC(Mu(s)));if(!i)throw new N8e(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?I2(i.inputs,h1(n,4)):void 0}}class _9e extends et{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const uV="/docs/contract/encodeEventTopics";function c5(t){var c;const{abi:e,eventName:n,args:r}=t;let i=e[0];if(n){const l=s5({abi:e,name:n});if(!l)throw new QH(n,{docsPath:uV});i=l}if(i.type!=="event")throw new QH(void 0,{docsPath:uV});const s=Mu(i),o=sC(s);let a=[];if(r&&"inputs"in i){const l=(c=i.inputs)==null?void 0:c.filter(d=>"indexed"in d&&d.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?(l==null?void 0:l.map(d=>r[d.name]))??[]:[];u.length>0&&(a=(l==null?void 0:l.map((d,h)=>Array.isArray(u[h])?u[h].map((f,m)=>dV({param:d,value:u[h][m]})):typeof u[h]<"u"&&u[h]!==null?dV({param:d,value:u[h]}):null))??[])}return[o,...a]}function dV({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Ns(Ud(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new _9e(t.type);return $2([t],[e])}function hD(t){const{abi:e,args:n,logs:r,strict:i=!0}=t,s=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})();return r.map(o=>{var a;try{const c=e.find(u=>u.type==="event"&&o.topics[0]===sC(u));if(!c)return null;const l=dD({...o,abi:[c],strict:i});return s&&!s.includes(l.eventName)||!S9e({args:l.args,inputs:c.inputs,matchArgs:n})?null:{...l,...o}}catch(c){let l,u;if(c instanceof Use)return null;if(c instanceof qb||c instanceof nC){if(i)return null;l=c.abiItem.name,u=(a=c.abiItem.inputs)==null?void 0:a.some(d=>!("name"in d&&d.name))}return{...o,args:u?[]:{},eventName:l}}}
103).filter(Boolean)}function S9e(t){const{args:e,inputs:n,matchArgs:r}=t;if(!r)return!0;if(!e)return!1;function i(s,o,a){try{return s.type==="address"?uD(o,a):s.type==="string"||s.type==="bytes"?Ns(Ud(o))===a:o===a}catch{return!1}}return Array.isArray(e)&&Array.isArray(r)?r.every((s,o)=>{if(s==null)return!0;const a=n[o];return a?(Array.isArray(s)?s:[s]).some(l=>i(a,l,e[o])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,o])=>{if(o==null)return!0;const a=n.find(l=>l.name===s);return a?(Array.isArray(o)?o:[o]).some(l=>i(a,l,e[s])):!1}):!1}function A9e(t){const e=Ns(`0x${t.substring(4)}`).substring(26);return i5(`0x${e}`)}function Yd(t,e="hex"){const n=yoe(t),r=sD(new Uint8Array(n.length));return n.encode(r),e==="hex"?Ii(r.bytes):r.bytes}function yoe(t){return Array.isArray(t)?k9e(t.map(e=>yoe(e))):$9e(t)}function k9e(t){const e=t.reduce((i,s)=>i+s.length,0),n=woe(e);return{length:e<=55?1+e:1+n+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+n),n===1?i.pushUint8(e):n===2?i.pushUint16(e):n===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:s}of t)s(i)}}}function $9e(t){const e=typeof t=="string"?To(t):t,n=woe(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+n+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+n),n===1?i.pushUint8(e.length):n===2?i.pushUint16(e.length):n===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function woe(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new et("Length is too large.")}const voe={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function pC(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?Ec(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?Ec(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?voe[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(e.authorizationList=I9e(t.authorizationList)),e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}const boe=uC("transaction",pC);function I9e(t){return t.map(e=>({contractAddress:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}function fD(t){const e=(t.transactions??[]).map(n=>typeof n=="string"?n:pC(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}const xoe=uC("block",fD);function Ou(t,{args:e,eventName:n}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...n?{args:e,eventName:n}:{}}}const T9e={"0x0":"reverted","0x1":"success"};function Eoe(t){const e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(n=>Ou(n)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Ec(t.transactionIndex):null,status:t.status?T9e[t.status]:null,type:t.type?voe[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const Coe=uC("transactionReceipt",Eoe),P9e=3;function p1(t,{abi:e,address:n,args:r,docsPath:i,functionName:s,sender:o}){const a=t instanceof oC?t:t instanceof et?t.walk(m=>"data"in m)||t.walk():{},{code:c,data:l,details:u,message:d,shortMessage:h}=a,f=t instanceof n5?new X7e({functionName:s}
103):[P9e,c1.code].includes(c)&&(l||u||d||h)?new ER({abi:e,data:typeof l=="object"?l.data:l,functionName:s,message:a instanceof rD?u:h??d}):t;return new Q7e(f,{abi:e,args:r,contractAddress:n,docsPath:i,functionName:s,sender:o})}class R9e extends et{constructor(e,{account:n,docsPath:r,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:h}){var m;const f=o5({from:n==null?void 0:n.address,to:d,value:typeof h<"u"&&`${j1(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${da(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${da(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${da(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",f].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}function M9e(t,{docsPath:e,...n}){const r=(()=>{const i=cC(t,n);return i instanceof a5?t:i})();return new R9e(r,{docsPath:e,...n})}function O9e(t,{docsPath:e,...n}){const r=(()=>{const i=cC(t,n);return i instanceof a5?t:i})();return new Z7e(r,{docsPath:e,...n})}function yn(t,e,n){const r=t[e.name];if(typeof r=="function")return r;const i=t[n];return typeof i=="function"?i:s=>e(t,s)}function j9e(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+l,a,r)}function N9e(t,e,n){return t&e^~t&n}function D9e(t,e,n){return t&e^t&n^e&n}let L9e=class extends iD{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Bk(this.buffer)}update(e){Vy(this);const{view:n,buffer:r,blockLen:i}=this;e=rC(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Bk(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Vy(this),qse(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let d=o;d<i;d++)n[d]=0;j9e(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=Bk(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%n&&e.buffer.set(r),e}};const B9e=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]),zh=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Wh=new Uint32Array(64);let F9e=class extends L9e{constructor(){super(64,32,8,!1),this.A=zh[0]|0,this.B=zh[1]|0,this.C=zh[2]|0,this.D=zh[3]|0,this.E=zh[4]|0,this.F=zh[5]|0,this.G=zh[6]|0,this.H=zh[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:o,G:a,H:c}=this;return[e,n,r,i,s,o,a,c]}set(e,n,r,i,s,o,a,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,n){for(let d=0;d<16;d++,n+=4)Wh[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const h=Wh[d-15],f=Wh[d-2],m=Fl(h,7)^Fl(h,18)^h>>>3,y=Fl(f,17)^Fl(f,19)^f>>>10;Wh[d]=y+Wh[d-7]+m+Wh[d-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const h=Fl(a,6)^Fl(a,11)^Fl(a,25),f=u+h+N9e(a,c,l)+B9e[d]+Wh[d]|0,y=(Fl(r,2)^Fl(r,13)^Fl(r,22))+D9e(r,i,s)|0;u=l,l=c,c=a,a=o+f|0,o=s,s=i,i=r,r=f+y|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,s,o,a,c,l,u)}roundClean(){Wh.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const _oe=Kse(()=>new F9e);
103function Soe(t,e){const n=e||"hex",r=_oe(Da(t,{strict:!1})?Ud(t):t);return n==="bytes"?r:Qt(r)}async function U9e({hash:t,signature:e}){const n=Da(t)?t:Qt(t),{secp256k1:r}=await mr(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>a$e);return{secp256k1:o}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:l,s:u,v:d,yParity:h}=e,f=Number(h??d),m=hV(f);return new r.Signature(Sr(l),Sr(u)).addRecoveryBit(m)}const o=Da(e)?e:Qt(e),a=Ec(`0x${o.slice(130)}`),c=hV(a);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function hV(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function Aoe({hash:t,signature:e}){return A9e(await U9e({hash:t,signature:e}))}const z9e=`�Ethereum Signed Message: 104`;function W9e(t){const e=typeof t=="string"?Wy(t):typeof t.raw=="string"?t.raw:Ii(t.raw),n=Wy(`${z9e}${vi(e)}`);return Zd([n,e])}function koe(t,e){return Ns(W9e(t),e)}const $oe="0x6492649264926492649264926492649264926492649264926492649264926492";function H9e(t){return Vse(t,-32)===$oe}function V9e(t){const{address:e,data:n,signature:r,to:i="hex"}=t,s=Il([$2([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,n,r]),$oe]);return i==="hex"?s:To(s)}function Ioe(t){if(t.type)return t.type;if(typeof t.authorizationList<"u")return"eip7702";if(typeof t.blobs<"u"||typeof t.blobVersionedHashes<"u"||typeof t.maxFeePerBlobGas<"u"||typeof t.sidecars<"u")return"eip4844";if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new K7e({transaction:t})}const Toe=1;class q9e extends et{constructor({maxSize:e,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Poe extends et{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class K9e extends et{constructor({hash:e,size:n}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class G9e extends et{constructor({hash:e,version:n}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${Toe}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Z9e(t){const{authorizationList:e}=t;if(e)for(const n of e){const{contractAddress:r,chainId:i}=n;if(!Wr(r))throw new ps({address:r});if(i<0)throw new t5({chainId:i})}pD(t)}function Y9e(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new Poe;for(const n of e){const r=vi(n),i=Ec(h1(n,0,1));if(r!==32)throw new K9e({hash:n,size:r});if(i!==Toe)throw new G9e({hash:n,version:i})}}pD(t)}function pD(t){const{chainId:e,maxPriorityFeePerGas:n,maxFeePerGas:r,to:i}=t;if(e<=0)throw new t5({chainId:e});if(i&&!Wr(i))throw new ps({address:i});if(r&&r>dC)throw new f1({maxFeePerGas:r});if(n&&r&&n>r)throw new Gb({maxFeePerGas:r,maxPriorityFeePerGas:n})}function Q9e(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:s}=t;if(e<=0)throw new t5({chainId:e});if(s&&!Wr(s))throw new ps({address:s});if(n||i)throw new et("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>dC)throw new f1({maxFeePerGas:r})}function X9e(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:s}=t;if(s&&!Wr(s))throw new ps({address:s});if(typeof e<"u"&&e<=0)throw new t5({chainId:e});if(n||i)throw new et("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>dC)throw new f1({maxFeePerGas:r})}function gD(t){const{kzg:e}=t,n=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),r=typeof t.blobs[0]=="string"?t.blobs.map(s=>To(s)):t.blobs,i=[];for(const s of r)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return n==="bytes"?i:i.map(s=>Ii(s))}function mD(t){const{kzg:e}=t,n=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),r=typeof t.blobs[0]=="string"?t.blobs.map(o=>To(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>To(o)):t.commitments,s=[];for(let o=0;o<r.length;o++){const a=r[o],c=i[o];s.push(Uint8Array.from(e.computeBlobKzgProof(a,c)))}return n==="bytes"?s:s.map(o=>Ii(o))}const fV=6,Roe=32,yD=4096,Moe=Roe*yD,pV=Moe*fV-1-1*yD*fV;
104function J9e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?To(t.data):t.data,r=vi(n);if(!r)throw new Poe;if(r>pV)throw new q9e({maxSize:pV,size:r});const i=[];let s=!0,o=0;for(;s;){const a=sD(new Uint8Array(Moe));let c=0;for(;c<yD;){const l=n.slice(o,o+(Roe-1));if(a.pushByte(0),a.pushBytes(l),l.length<31){a.pushByte(128),s=!1;break}c++,o+=31}i.push(a)}return e==="bytes"?i.map(a=>a.bytes):i.map(a=>Ii(a.bytes))}function Ooe(t){const{data:e,kzg:n,to:r}=t,i=t.blobs??J9e({data:e,to:r}),s=t.commitments??gD({blobs:i,kzg:n,to:r}),o=t.proofs??mD({blobs:i,commitments:s,kzg:n,to:r}),a=[];for(let c=0;c<i.length;c++)a.push({blob:i[c],commitment:s[c],proof:o[c]});return a}function eEe(t){const{commitment:e,version:n=1}=t,r=t.to??(typeof e=="string"?"hex":"bytes"),i=Soe(e,"bytes");return i.set([n],0),r==="bytes"?i:Ii(i)}function joe(t){const{commitments:e,version:n}=t,r=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push(eEe({commitment:s,to:r,version:n}));return i}function tEe(t){if(!t||t.length===0)return[];const e=[];for(const n of t){const{contractAddress:r,chainId:i,nonce:s,...o}=n;e.push([i?Qt(i):"0x",r,s?Qt(s):"0x",...l5({},o)])}return e}function gC(t){if(!t||t.length===0)return[];const e=[];for(let n=0;n<t.length;n++){const{address:r,storageKeys:i}=t[n];for(let s=0;s<i.length;s++)if(i[s].length-2!==64)throw new G7e({storageKey:i[s]});if(!Wr(r,{strict:!1}))throw new ps({address:r});e.push([r,i])}return e}function Noe(t,e){const n=Ioe(t);return n==="eip1559"?iEe(t,e):n==="eip2930"?sEe(t,e):n==="eip4844"?rEe(t,e):n==="eip7702"?nEe(t,e):oEe(t,e)}function nEe(t,e){const{authorizationList:n,chainId:r,gas:i,nonce:s,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=t;Z9e(t);const h=gC(u),f=tEe(n);return Il(["0x04",Yd([Qt(r),s?Qt(s):"0x",l?Qt(l):"0x",c?Qt(c):"0x",i?Qt(i):"0x",o??"0x",a?Qt(a):"0x",d??"0x",h,f,...l5(t,e)])])}function rEe(t,e){const{chainId:n,gas:r,nonce:i,to:s,value:o,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=t;Y9e(t);let h=t.blobVersionedHashes,f=t.sidecars;if(t.blobs&&(typeof h>"u"||typeof f>"u")){const x=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(I=>Ii(I)),_=t.kzg,$=gD({blobs:x,kzg:_});if(typeof h>"u"&&(h=joe({commitments:$})),typeof f>"u"){const I=mD({blobs:x,commitments:$,kzg:_});f=Ooe({blobs:x,commitments:$,proofs:I})}}const m=gC(u),y=[Qt(n),i?Qt(i):"0x",l?Qt(l):"0x",c?Qt(c):"0x",r?Qt(r):"0x",s??"0x",o?Qt(o):"0x",d??"0x",m,a?Qt(a):"0x",h??[],...l5(t,e)],v=[],b=[],C=[];if(f)for(let x=0;x<f.length;x++){const{blob:_,commitment:$,proof:I}=f[x];v.push(_),b.push($),C.push(I)}return Il(["0x03",Yd(f?[y,v,b,C]:y)])}function iEe(t,e){const{chainId:n,gas:r,nonce:i,to:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,data:u}=t;pD(t);const d=gC(l),h=[Qt(n),i?Qt(i):"0x",c?Qt(c):"0x",a?Qt(a):"0x",r?Qt(r):"0x",s??"0x",o?Qt(o):"0x",u??"0x",d,...l5(t,e)];return Il(["0x02",Yd(h)])}function sEe(t,e){const{chainId:n,gas:r,data:i,nonce:s,to:o,value:a,accessList:c,gasPrice:l}=t;Q9e(t);const u=gC(c),d=[Qt(n),s?Qt(s):"0x",l?Qt(l):"0x",r?Qt(r):"0x",o??"0x",a?Qt(a):"0x",i??"0x",u,...l5(t,e)];return Il(["0x01",Yd(d)])}function oEe(t,e){const{chainId:n=0,gas:r,data:i,nonce:s,to:o,value:a,gasPrice:c}=t;X9e(t);let l=[s?Qt(s):"0x",c?Qt(c):"0x",r?Qt(r):"0x",o??"0x",a?Qt(a):"0x",i??"0x"];if(e){const u=(()=>{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+e.v-27n);const f=27n+(e.v===27n?0n:1n);if(e.v!==f)throw new q7e({v:e.v});return f})(),d=yc(e.r),h=yc(e.s);l=[...l,Qt(u),d==="0x00"?"0x":d,h==="0x00"?"0x":h]}else n>0&&(l=[...l,Qt(n),"0x","0x"]);return Yd(l)}function l5(t,e){const n=e??t,{v:r,yParity:i}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof i>"u")return[];const s=yc(n.r),o=yc(n.s);return[typeof i=="number"?i?Qt(1):"0x":r===0n?"0x":r===1n?Qt(1):r===27n?"0x":Qt(1),s==="0x00"?"0x":s,o==="0x00"?"0x":o]}class aEe extends et{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function cEe(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new aEe({value:t});let[n,r="0"]=t.split(".");const i=n.startsWith("-");if(i&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),e===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>e){const[s,o,a]=[r.slice(0,e-1),r.slice(e-1,e),r.slice(e)],c=Math.round(+`${o}.${a}`);c>9?r=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):r=`${s}${c}`,r.length>e&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,e)}else r=r.padEnd(e,"0");return BigInt(`${i?"-":""}${n}${r}`)}function Doe(t,e="wei"){return cEe(t,roe[e])}async function Loe(t,{address:e,blockTag:n="latest",blockNumber:r}){const i=await t.request({method:"eth_getTransactionCount",params:[e,r?dn(r):n]},{dedupe:!!r});return Ec(i)}const lEe=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,uEe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,dEe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function hEe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){fEe(t);return}return e}function fEe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Fv(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const n=t.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!dEe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(lEe.test(t)||uEe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,hEe)}return JSON.parse(t)}catch(r){if(e.strict)throw r;return t}}
104const pEe=/#/g,gEe=/&/g,mEe=/\//g,yEe=/=/g,wD=/\+/g,wEe=/%5e/gi,vEe=/%60/gi,bEe=/%7c/gi,xEe=/%20/gi;function EEe(t){return encodeURI(""+t).replace(bEe,"|")}function PR(t){return EEe(typeof t=="string"?t:JSON.stringify(t)).replace(wD,"%2B").replace(xEe,"+").replace(pEe,"%23").replace(gEe,"%26").replace(vEe,"`").replace(wEe,"^").replace(mEe,"%2F")}function Vk(t){return PR(t).replace(yEe,"%3D")}function Boe(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function CEe(t){return Boe(t.replace(wD," "))}function _Ee(t){return Boe(t.replace(wD," "))}function SEe(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const n of t.split("&")){const r=n.match(/([^=]+)=?(.*)/)||[];if(r.length<2)continue;const i=CEe(r[1]);if(i==="__proto__"||i==="constructor")continue;const s=_Ee(r[2]||"");e[i]===void 0?e[i]=s:Array.isArray(e[i])?e[i].push(s):e[i]=[e[i],s]}return e}function AEe(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(n=>`${Vk(t)}=${PR(n)}`).join("&"):`${Vk(t)}=${PR(e)}`:Vk(t)}function kEe(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>AEe(e,t[e])).filter(Boolean).join("&")}const $Ee=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,IEe=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,TEe=/^([/\\]\s*){2,}[^/\\]/,PEe=/^\.?\//;function Foe(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?$Ee.test(t):IEe.test(t)||(e.acceptRelative?TEe.test(t):!1)}function REe(t="",e){return t.endsWith("/")}function MEe(t="",e){return(REe(t)?t.slice(0,-1):t)||"/"}function OEe(t="",e){return t.endsWith("/")?t:t+"/"}function jEe(t,e){if(DEe(e)||Foe(t))return t;const n=MEe(e);return t.startsWith(n)?t:BEe(n,t)}function NEe(t,e){const n=FEe(t),r={...SEe(n.search),...e};return n.search=kEe(r),UEe(n)}function DEe(t){return!t||t==="/"}function LEe(t){return t&&t!=="/"}function BEe(t,...e){let n=t||"";for(const r of e.filter(i=>LEe(i)))if(n){const i=r.replace(PEe,"");n=OEe(n)+i}else n=r;return n}const Uoe=Symbol.for("ufo:protocolRelative");function FEe(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,d,h=""]=n;return{protocol:d.toLowerCase(),pathname:h,href:d+h,auth:"",host:"",search:"",hash:""}}if(!Foe(t,{acceptRelative:!0}))return gV(t);const[,r="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,o="",a=""]=s.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:c,search:l,hash:u}=gV(a);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:o,pathname:c,search:l,hash:u,[Uoe]:!r}}function gV(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}function UEe(t){const e=t.pathname||"",n=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",r=t.hash||"",i=t.auth?t.auth+"@":"",s=t.host||"";return(t.protocol||t[Uoe]?(t.protocol||"")+"//":"")+i+s+e+n+r}class zoe extends Error{constructor(e,n){super(e,n),this.name="FetchError",n!=null&&n.cause&&!this.cause&&(this.cause=n.cause)}}function zEe(t){var c,l,u,d,h;const e=((c=t.error)==null?void 0:c.message)||((l=t.error)==null?void 0:l.toString())||"",n=((u=t.request)==null?void 0:u.method)||((d=t.options)==null?void 0:d.method)||"GET",r=((h=t.request)==null?void 0:h.url)||String(t.request)||"/",i=`[${n}] ${JSON.stringify(r)}`,s=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",o=`${i}: ${s}${e?` ${e}`:""}`,a=new zoe(o,t.error?{cause:t.error}:void 0);for(const f of["request","options","response"])Object.defineProperty(a,f,{get(){return t[f]}});for(const[f,m]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,f,{get(){return t.response&&t.response[m]}});return a}const WEe=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function mV(t="GET"){return WEe.has(t.toUpperCase())}function HEe(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const VEe=new Set(["image/svg","application/xml","application/xhtml","application/html"]),qEe=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function KEe(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return qEe.test(e)?"json":VEe.has(e)||e.startsWith("text/")?"text":"blob"}function GEe(t,e,n,r){const i=ZEe((e==null?void 0:e.headers)??(t==null?void 0:t.headers),n==null?void 0:n.headers,r);let s;return(n!=null&&n.query||n!=null&&n.params||e!=null&&e.params||e!=null&&e.query)&&(s={...n==null?void 0:n.params,...n==null?void 0:n.query,...e==null?void 0:e.params,...e==null?void 0:e.query}),{...n,...e,query:s,params:s,headers:i}}function ZEe(t,e,n){if(!e)return new n(t);const r=new n(e);if(t)for(const[i,s]of Symbol.iterator in t||Array.isArray(t)?t:new n(t))r.set(i,s);return r}async function T4(t,e){if(e)if(Array.isArray(e))for(const n of e)await n(t);else await e(t)}const YEe=new Set([408,409,425,429,500,502,503,504]),QEe=new Set([101,204,205,304]);function Woe(t={}){const{fetch:e=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=t;async function i(a){const c=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!c){let u;typeof a.options.retry=="number"?u=a.options.retry:u=mV(a.options.method)?0:1;const d=a.response&&a.response.status||500;if(u>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(d):YEe.has(d))){const h=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return h>0&&await new Promise(f=>setTimeout(f,h)),s(a.request,{...a.options,retry:u-1})}}const l=zEe(a);throw Error.captureStackTrace&&Error.captureStackTrace(l,s),l}const s=async function(c,l={}){const u={request:c,options:GEe(c,l,t.defaults,n),response:void 0,error:void 0};u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&await T4(u,u.options.onRequest),typeof u.request=="string"&&(u.options.baseURL&&(u.request=jEe(u.request,u.options.baseURL)),u.options.query&&(u.request=NEe(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&mV(u.options.method)&&(HEe(u.options.body)?(u.options.body=typeof u.options.body=="str
104ing"?u.options.body:JSON.stringify(u.options.body),u.options.headers=new n(u.options.headers||{}),u.options.headers.has("content-type")||u.options.headers.set("content-type","application/json"),u.options.headers.has("accept")||u.options.headers.set("accept","application/json")):("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half")));let d;if(!u.options.signal&&u.options.timeout){const f=new r;d=setTimeout(()=>{const m=new Error("[TimeoutError]: The operation was aborted due to timeout");m.name="TimeoutError",m.code=23,f.abort(m)},u.options.timeout),u.options.signal=f.signal}try{u.response=await e(u.request,u.options)}catch(f){return u.error=f,u.options.onRequestError&&await T4(u,u.options.onRequestError),await i(u)}finally{d&&clearTimeout(d)}if((u.response.body||u.response._bodyInit)&&!QEe.has(u.response.status)&&u.options.method!=="HEAD"){const f=(u.options.parseResponse?"json":u.options.responseType)||KEe(u.response.headers.get("content-type")||"");switch(f){case"json":{const m=await u.response.text(),y=u.options.parseResponse||Fv;u.response._data=y(m);break}case"stream":{u.response._data=u.response.body||u.response._bodyInit;break}default:u.response._data=await u.response[f]()}}return u.options.onResponse&&await T4(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await T4(u,u.options.onResponseError),await i(u)):u.response},o=async function(c,l){return(await s(c,l))._data};return o.raw=s,o.native=(...a)=>e(...a),o.create=(a={},c={})=>Woe({...t,...c,defaults:{...t.defaults,...c.defaults,...a}}),o}const Z7=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),XEe=Z7.fetch?(...t)=>Z7.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),JEe=Z7.Headers,eCe=Z7.AbortController,u5=Woe({fetch:XEe,Headers:JEe,AbortController:eCe});var wn;let fa=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,n,r){super(e),n instanceof Error&&(this.cause=n),this.privyErrorCode=r}},fc=class extends fa{constructor(e,n,r,i,s,o){super(r,i,s),this.type=e,this.status=n,this.data=o}},ve=class extends fa{constructor(e,n,r){super(e,n,r),this.type="client_error"}},tCe=class extends ve{constructor(){super("Request timed out",void 0,"client_request_timeout")}},li=class extends fa{constructor(e,n,r){super(e,n,r),this.type="connector_error"}};const Gn=t=>{if(t instanceof fa)return t;if(!(t instanceof zoe))return Pr(t);if(!t.response)return new fc("api_error",null,t.message,t);let{type:e,message:n,error:r,code:i}=t.data;return new fc(e||"ApiError",t.response.status,n||r,t,i,t.data)},Pr=t=>t instanceof fa?t:t instanceof Error?new ve(t.message,t):new ve(`Internal error: ${t}`);var Ce=((wn={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",wn.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",wn.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",wn.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",wn.INVALID_DATA="invalid_data",wn.INVALID_CAPTCHA="invalid_captcha",wn.LINKED_TO_ANOTHER_USER="linked_to_another_user",wn.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",wn.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",wn.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",wn.USER_EXITED_UPDATE_FLOW="exited_update_flow",wn.ALLOWLIST_REJECTED="allowlist_rejected",wn.OAUTH_USER_DENIED="oauth_user_denied",wn.OAUTH_UNEXPECTED="oauth_unexpected",wn.UNKNOWN_AUTH_ERROR="unknown_auth_error",wn.USER_EXITED_AUTH_FLOW="exited_auth_flow",wn.USER_EXITED_LINK_FLOW="exited_link_flow",wn.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",wn.MUST_BE_AUTHENTICATED="must_be_authenticated",wn.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",wn.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",wn.CLIENT_REQUEST_TIMEOUT="client_request_timeout",wn.INVALID_CREDENTIALS="invalid_credentials",
104wn.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",wn.UNKNOWN_MFA_ERROR="unknown_mfa_error",wn.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",wn.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",wn.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",wn.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",wn.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",wn.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",wn.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",wn.TRANSACTION_FAILURE="transaction_failure",wn.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",wn.NOT_SUPPORTED="not_supported",wn.CAPTCHA_TIMEOUT="captcha_timeout",wn.INVALID_MESSAGE="invalid_message",wn.UNABLE_TO_SIGN="unable_to_sign",wn.CAPTCHA_FAILURE="captcha_failure",wn.CAPTCHA_DISABLED="captcha_disabled",wn.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",wn.TOO_MANY_REQUESTS="too_many_requests",wn.USER_LIMIT_REACHED="max_accounts_reached",wn.DISALLOWED_LOGIN_METHOD="disallowed_login_method",
104wn.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",wn.PASSKEY_NOT_ALLOWED="passkey_not_allowed",wn.USER_DOES_NOT_EXIST="user_does_not_exist",wn.INSUFFICIENT_BALANCE="insufficient_balance",wn.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",wn);let qp=class extends ve{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Xf=class extends ve{constructor(e="Embedded wallet error",n){super(e,n,"unknown_embedded_wallet_error")}},nCe=class extends ve{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},d5=class extends ve{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}};const Hoe="/api/v1/sessions",Voe="/api/v1/sessions/logout",rCe="/api/v1/siwe/init",iCe="/api/v1/siwe/authenticate",sCe="/api/v1/siwe/link",oCe="/api/v1/siwe/link_smart_wallet",aCe="/api/v1/siwe/unlink",cCe="/api/v1/siwe/transfer",lCe="/api/v1/siws/init",uCe="/api/v1/siws/authenticate",dCe="/api/v1/siws/link",hCe="/api/v1/siws/unlink",fCe="/api/v1/farcaster/init",pCe="/api/v1/farcaster/authenticate",gCe="/api/v1/farcaster/link",mCe="/api/v1/farcaster/status",yCe="/api/v1/farcaster/unlink",wCe="/api/v1/farcaster/transfer",vCe="/api/v1/passwordless/init",bCe="/api/v1/passwordless/authenticate",xCe="/api/v1/passwordless/link",ECe="/api/v1/passwordless/unlink",CCe="/api/v1/passwordless/update",_Ce="/api/v1/passwordless/transfer",SCe="/api/v1/passwordless_sms/init",ACe="/api/v1/passwordless_sms/link",kCe="/api/v1/passwordless_sms/unlink",$Ce="/api/v1/passwordless_sms/authenticate",ICe="/api/v1/passwordless_sms/update",TCe="/api/v1/passwordless_sms/transfer",qoe="/api/v1/oauth/init",Koe="/api/v1/oauth/authenticate",Goe="/api/v1/oauth/link",PCe="/api/v1/oauth/unlink",RCe="/api/v1/oauth/transfer",MCe="/api/v1/recovery/oauth/init",OCe="/api/v1/recovery/oauth/init_icloud",jCe="/api/v1/recovery/oauth/authenticate",NCe="/api/v1/passkeys/link/init",DCe="/api/v1/passkeys/authenticate/init",LCe="/api/v1/passkeys/register/init",BCe="/api/v1/passkeys/link",FCe="/api/v1/passkeys/authenticate",UCe="/api/v1/passkeys/register",zCe="/api/v1/telegram/authenticate",WCe="/api/v1/telegram/link",HCe="/api/v1/telegram/unlink",VCe="/api/v1/telegram/transfer",qCe="/api/v1/mfa/passwordless_sms/init",KCe="/api/v1/mfa/passkeys/init",GCe="/api/v1/users/me/accept_terms",Zoe="/api/v1/analytics_events",ZCe="/api/v1/custom_jwt_account/authenticate",YCe="/api/v1/guest/authenticate",QCe="/api/v1/plugins/moonpay_on_ramp/sign",XCe="/api/v1/funding/coinbase_on_ramp/init",JCe="/api/v1/funding/coinbase_on_ramp/status",e_e="/api/v1/wallets/revoke",t_e="/api/v1/users/me",n_e="/api/v1/scan/transaction",Le=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},Gw=t=>()=>{throw Error(t.trim())},Yoe=E.createContext({setAuthenticated:Le,setUser:Le,isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:Le,initializeWalletProxy:Le,getAuthMeta:Le,getAuthFlow:Le,closePrivyModal:Le,openPrivyModal:Le,connectWallet:Le,initLoginWithWallet:Le,loginWithWallet:Le,initLoginWithFarcaster:Le,loginWithFarcaster:Le,loginWithCode:Le,initLoginWithEmail:Le,initLoginWithSms:Le,initUpdateEmail:Le,initUpdatePhone:Le,resendEmailCode:Le,resendSmsCode:Le,initLoginWithHeadlessOAuth:Le,loginWithHeadlessOAuth:Le,crossAppAuthFlow:Le,initLoginWithOAuth:Le,recoveryOAuthFlow:Le,loginWithOAuth:Le,passkeyAuthState:{status:"initial"},setPasskeyAuthState:Le,initSignupWithPasskey:Le,signupWithPasskey:Le,initLoginWithPasskey:Le,loginWithPasskey:Le,initLinkWithPasskey:Le,linkWithPasskey:Le,refreshSessionAndUser:Le,loginWithGuestAccountFlow:Le,walletProxy:null,createAnalyticsEvent:Le,acceptTerms:Le,getUsdTokenPrice:Le,getUsdPriceForSol:Le,getSplTokenMetadata:Le,recoverPrimaryWallet:Le,updateWallets:Le,fundWallet:Le,openModal:Le,setReadyToTrue:Le,requestFarcasterSignerStatus:Le,initLoginWithTelegram:Le,loginWithTelegram:Le,generateSiweMessage:Le,generateSiweMessageForSmartWallet:Le,linkWithSiwe:Le,linkSmartWallet:Le,delegateWallet:Le,revokeDelegatedWallets:Le,embeddedSolanaWallets:null,createEmbeddedSolanaWallet:Le,exportSolanaWallet:Le,solanaSignMessage:Le,sendSolanaTransaction:Le,signSolanaTransaction:Le,connectCoinbaseSmartWallet:Le,initiateAccountTransfer:Le,emailOtpState:{status:"initial"},setEmailOtpState:Le,smsOtpState:{status:"initial"},setSmsOtpState:Le,siweState:{status:"initial"},setSiweState:Le,oAuthState:{status:"initial"},setOAuthState:Le,telegramAuthState:{status:"initial"},setTelegramAuthState:Le,isHeadlessOAuthLoading:!1,isHeadlessSigning:Le}),Ht=()=>E.useContext(Yoe);function r_e({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Tl=E.forwardRef(r_e);function mC(t,{method:e}){var r,i;const n={};return t.transport.type==="fallback"&&((i=(r=t.transport).onResponse)==null||i.call(r,({method:s,response:o,status:a,transport:c})=>{a==="success"&&e===s&&(n[o]=c.request)})),s=>n[s]||t.request}async function Qoe(t,e){const{address:n,abi:r,args:i,eventName:s,fromBlock:o,strict:a,toBlock:c}=e,l=mC(t,{method:"eth_newFilter"}),u=s?c5({abi:r,args:i,eventName:s}):void 0,d=await t.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof o=="bigint"?dn(o):o,toBlock:typeof c=="bigint"?dn(c):c,topics:u}]});return{abi:r,args:i,eventName:s,id:d,request:l(d),strict:!!a,type:"event"}}function i_e(t){const{chainId:e,contractAddress:n,nonce:r,to:i}=t,s=Ns(Il(["0x05",Yd([e?dn(e):"0x",n,r?dn(r):"0x"])]));return i==="bytes"?To(s):s}async function Xoe(t){const{authorization:e,signature:n}=t;return Aoe({hash:i_e(e),signature:n??e})}class s_e extends et{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class vD extends et{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class o_e extends et{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${da(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Joe extends et{constructor({blockHash:e,blockNumber:n}){let r="Block";e&&(r=`Block at hash "${e}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}async function wu(t,{blockHash:e,blockNumber:n,blockTag:r,includeTransactions:i}={}){var u,d,h;const s=r??"latest",o=i??!1,a=n!==void 0?dn(n):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]},{dedupe:!0}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]},{dedupe:!!a}),!c)throw new Joe({blockHash:e,blockNumber:n});return(((h=(d=(u=t.chain)==null?void 0:u.formatters)==null?void 0:d.block)==null?void 0:h.format)||fD)(c)}async function bD(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function a_e(t,e){return eae(t,e)}async function eae(t,e){var s,o;const{block:n,chain:r=t.chain,request:i}=e||{};try{const a=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee);if(typeof a=="function"){const l=n||await yn(t,wu,"getBlock")({}),u=await a({block:l,client:t,request:i});if(u===null)throw new Error;return u}if(typeof a<"u")return a;const c=await t.request({method:"eth_maxPriorityFeePerGas"});return Sr(c)}catch{const[a,c]=await Promise.all([n?Promise.resolve(n):yn(t,wu,"getBlock")({}),yn(t,bD,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new vD;const l=c-a.baseFeePerGas;return l<0n?0n:l}}async function c_e(t,e){return RR(t,e)}async function RR(t,e){var h,f;const{block:n,chain:r=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var m,y;return typeof((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:t,request:i}):((y=r==null?void 0:r.fees)==null?void 0:y.baseFeeMultiplier)??1.2})();if(o<1)throw new s_e;const c=10**(((h=o.toString().split(".")[1])==null?void 0:h.length)??0),l=m=>m*BigInt(Math.ceil(o*c))/BigInt(c),u=n||await yn(t,wu,"getBlock")({});if(typeof((f=r==null?void 0:r.fees)==null?void 0:f.estimateFeesPerGas)=="function"){const m=await r.fees.estimateFeesPerGas({block:n,client:t,multiply:l,request:i,type:s});if(m!==null)return m}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new vD;const m=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await eae(t,{block:u,chain:r,request:i}),y=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??y+m,maxPriorityFeePerGas:m}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await yn(t,bD,"getGasPrice")({}))}}async function h5(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return Ec(e)}const tae=["blobVersionedHashes","chainId","fees","gas","nonce","type"],yV=new Map;async function yC(t,e){const{account:n=t.account,blobs:r,chain:i,gas:s,kzg:o,nonce:a,nonceManager:c,parameters:l=tae,type:u}=e,d=n&&zs(n),h={...e,...d?{from:d==null?void 0:d.address}:{}};let f;async function m(){return f||(f=await yn(t,wu,"getBlock")({blockTag:"latest"}),f)}let y;async function v(){return y||(i?i.id:typeof e.chainId<"u"?e.chainId:(y=await yn(t,h5,"getChainId")({}),y))}if(l.includes("nonce")&&typeof a>"u"&&d)if(c){const b=await v();h.nonce=await c.consume({address:d.address,chainId:b,client:t})}else h.nonce=await yn(t,Loe,"getTransactionCount")({address:d.address,blockTag:"pending"});if((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&r&&o){const b=gD({blobs:r,kzg:o});if(l.includes("blobVersionedHashes")){const C=joe({commitments:b,to:"hex"});h.blobVersionedHashes=C}if(l.includes("sidecars")){const C=mD({blobs:r,commitments:b,kzg:o}),x=Ooe({blobs:r,commitments:b,proofs:C,to:"hex"});h.sidecars=x}}if(l.includes("chainId")&&(h.chainId=await v()),(l.includes("fees")||l.includes("type"))&&typeof u>"u")try{h.type=Ioe(h)}catch{let b=yV.get(t.uid);if(typeof b>"u"){const C=await m();b=typeof(C==null?void 0:C.baseFeePerGas)=="bigint",yV.set(t.uid,b)}h.type=b?"eip1559":"legacy"}if(l.includes("fees"))if(h.type!=="legacy"&&h.type!=="eip2930"){if(typeof h.maxFeePerGas>"u"||typeof h.maxPriorityFeePerGas>"u"){const b=await m(),{maxFeePerGas:C,maxPriorityFeePerGas:x}=await RR(t,{block:b,chain:i,request:h});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas<x)throw new o_e({maxPriorityFeePerGas:x});h.maxPriorityFeePerGas=x,h.maxFeePerGas=C}}else{if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")throw new vD;if(typeof e.gasPrice>"u"){const b=await m(),{gasPrice:C}=await RR(t,{block:b,chain:i,request:h,type:"legacy"});h.gasPrice=C}}return l.includes("gas")&&typeof s>"u"&&(h.gas=await yn(t,xD,"estimateGas")({...h,account:d&&{address:d.address,type:"json-rpc"}})),L1(h),delete h.parameters,h}async function nae(t,{address:e,blockNumber:n,blockTag:r="latest"}){const i=n?dn(n):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||r]});return BigInt(s)}async function xD(t,e){var i,s,o;const{account:n=t.account}=e,r=n?zs(n):void 0;try{let S=function(M){const{block:W,request:H,rpcStateOverride:D}=M;return t.request({method:"eth_estimateGas",params:D?[H,W??"latest",D]:W?[H,W]:[H]})};const{accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:u,blockNumber:d,blockTag:h,data:f,gas:m,gasPrice:y,maxFeePerBlobGas:v,maxFeePerGas:b,maxPriorityFeePerGas:C,nonce:x,value:_,stateOverride:$,...I}=await yC(t,{...e,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),N=(d?dn(d):void 0)||h,T=lD($),O=await(async()=>
104{if(I.to)return I.to;if(c&&c.length>0)return await Xoe({authorization:c[0]}).catch(()=>{throw new et("`to` is required. Could not infer from `authorizationList`")})})();L1(e);const U=(o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format,L=(U||D1)({...lC(I,{format:U}),from:r==null?void 0:r.address,accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:u,data:f,gas:m,gasPrice:y,maxFeePerBlobGas:v,maxFeePerGas:b,maxPriorityFeePerGas:C,nonce:x,to:O,value:_});let k=BigInt(await S({block:N,request:L,rpcStateOverride:T}));if(c){const M=await nae(t,{address:L.from}),W=await Promise.all(c.map(async H=>{const{contractAddress:D}=H,V=await S({block:N,request:{authorizationList:void 0,data:f,from:r==null?void 0:r.address,to:D,value:dn(M)},rpcStateOverride:T}).catch(()=>100000n);return 2n*BigInt(V)}));k+=W.reduce((H,D)=>H+D,0n)}return k}catch(a){throw M9e(a,{...e,account:r,chain:t.chain})}}async function l_e(t,e){const{abi:n,address:r,args:i,functionName:s,dataSuffix:o,...a}=e,c=Tc({abi:n,args:i,functionName:s});try{return await yn(t,xD,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:r,...a})}catch(l){const u=a.account?zs(a.account):void 0;throw p1(l,{abi:n,address:r,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u==null?void 0:u.address})}}async function ED(t,{address:e,blockHash:n,fromBlock:r,toBlock:i,event:s,events:o,args:a,strict:c}={}){const l=c??!1,u=o??(s?[s]:void 0);let d=[];u&&(d=[u.flatMap(y=>c5({abi:[y],eventName:y.name,args:o?void 0:a}))],s&&(d=d[0]));let h;n?h=await t.request({method:"eth_getLogs",params:[{address:e,topics:d,blockHash:n}]}):h=await t.request({method:"eth_getLogs",params:[{address:e,topics:d,fromBlock:typeof r=="bigint"?dn(r):r,toBlock:typeof i=="bigint"?dn(i):i}]});const f=h.map(m=>Ou(m));return u?hD({abi:u,args:a,logs:f,strict:l}):f}async function rae(t,e){const{abi:n,address:r,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:c,strict:l}=e,u=o?s5({abi:n,name:o}):void 0,d=u?void 0:n.filter(h=>h.type==="event");return yn(t,ED,"getLogs")({address:r,args:i,blockHash:s,event:u,events:d,fromBlock:a,toBlock:c,strict:l})}async function Qd(t,e){const{abi:n,address:r,args:i,functionName:s,...o}=e,a=Tc({abi:n,args:i,functionName:s});try{const{data:c}=await yn(t,hC,"call")({...o,data:a,to:r});return N1({abi:n,args:i,functionName:s,data:c||"0x"})}catch(c){throw p1(c,{abi:n,address:r,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function u_e(t,e){const{abi:n,address:r,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?zs(a.account):t.account,l=Tc({abi:n,args:i,functionName:o});try{const{data:u}=await yn(t,hC,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:r,...a,account:c}),d=N1({abi:n,args:i,functionName:o,data:u||"0x"}),h=n.filter(f=>"name"in f&&f.name===e.functionName);return{result:d,request:{abi:h,address:r,args:i,dataSuffix:s,functionName:o,...a,account:c}}}catch(u){throw p1(u,{abi:n,address:r,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}const qk=new Map,wV=new Map;let d_e=0;function sp(t,e,n){const r=++d_e,i=()=>qk.get(t)||[],s=()=>{const u=i();qk.set(t,u.filter(d=>d.id!==r))},o=()=>{const u=i();if(!u.some(h=>h.id===r))return;const d=wV.get(t);u.length===1&&d&&d(),s()},a=i();if(qk.set(t,[...a,{id:r,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...d)=>{var f,m;const h=i();if(h.length!==0)for(const y of h)(m=(f=y.fns)[u])==null||m.call(f,...d)};const l=n(c);return typeof l=="function"&&wV.set(t,l),o}function f5(t,{emitOnBegin:e,initialWaitTime:n,interval:r}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(n==null?void 0:n(a))??r;await q7(c);const l=async()=>{i&&(await t({unpoll:s}),await q7(r),l())};l()})(),s}const h_e=new Map,f_e=new Map;function p_e(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),n=e(t,h_e),r=e(t,f_e);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function g_e(t,{cacheKey:e,cacheTime:n=Number.POSITIVE_INFINITY}){const r=p_e(e),i=r.response.get();if(i&&n>0&&new Date().getTime()-i.created.getTime()<n)return i.data;let s=r.promise.get();s||(s=t(),r.promise.set(s));try{const o=await s;return r.response.set({created:new Date,data:o}),o}finally{r.promise.clear()}}const m_e=t=>`blockNumber.${t}`;async function p5(t,{cacheTime:e=t.cacheTime}={}){const n=await g_e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:m_e(t.uid),cacheTime:e});return BigInt(n)}async function wC(t,{filter:e}){const n="strict"in e&&e.strict,r=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof r[0]=="string")return r;const i=r.map(s=>Ou(s));return!("abi"in e)||!e.abi?i:hD({abi:e.abi,logs:i,strict:n})}async function vC(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function y_e(t,e){const{abi:n,address:r,args:i,batch:s=!0,eventName:o,fromBlock:a,onError:c,onLogs:l,poll:u,pollingInterval:d=t.pollingInterval,strict:h}=e;return(typeof u<"u"?u:typeof a=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].c
104onfig.type==="webSocket"))?(()=>{const v=h??!1,b=fs(["watchContractEvent",r,i,s,t.uid,o,d,v,a]);return sp(b,{onLogs:l,onError:c},C=>{let x;a!==void 0&&(x=a-1n);let _,$=!1;const I=f5(async()=>{var R;if(!$){try{_=await yn(t,Qoe,"createContractEventFilter")({abi:n,address:r,args:i,eventName:o,strict:v,fromBlock:a})}catch{}$=!0;return}try{let N;if(_)N=await yn(t,wC,"getFilterChanges")({filter:_});else{const T=await yn(t,p5,"getBlockNumber")({});x&&x<T?N=await yn(t,rae,"getContractEvents")({abi:n,address:r,args:i,eventName:o,fromBlock:x+1n,toBlock:T,strict:v}):N=[],x=T}if(N.length===0)return;if(s)C.onLogs(N);else for(const T of N)C.onLogs([T])}catch(N){_&&N instanceof l1&&($=!1),(R=C.onError)==null||R.call(C,N)}},{emitOnBegin:!0,interval:d});return async()=>{_&&await yn(t,vC,"uninstallFilter")({filter:_}),I()}})})():(()=>{const v=h??!1,b=fs(["watchContractEvent",r,i,s,t.uid,o,d,v]);let C=!0,x=()=>C=!1;return sp(b,{onLogs:l,onError:c},_=>((async()=>{try{const $=(()=>{if(t.transport.type==="fallback"){const N=t.transport.transports.find(T=>T.config.type==="webSocket");return N?N.value:t.transport}return t.transport})(),I=o?c5({abi:n,eventName:o,args:i}):[],{unsubscribe:R}=await $.subscribe({params:["logs",{address:r,topics:I}],onData(N){var O;if(!C)return;const T=N.result;try{const{eventName:U,args:z}=dD({abi:n,data:T.data,topics:T.topics,strict:h}),L=Ou(T,{args:z,eventName:U});_.onLogs([L])}catch(U){let z,L;if(U instanceof qb||U instanceof nC){if(h)return;z=U.abiItem.name,L=(O=U.abiItem.inputs)==null?void 0:O.some(k=>!("name"in k&&k.name))}const S=Ou(T,{args:L?[]:{},eventName:z});_.onLogs([S])}},onError(N){var T;(T=_.onError)==null||T.call(_,N)}});x=R,C||x()}catch($){c==null||c($)}})(),()=>x()))})()}class g5 extends et{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` 105`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class Kk extends et{constructor({docsPath:e,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:e,metaMessages:n,name:"AccountTypeNotSupportedError"})}}async function CD(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const Gk=new eC(128);async function _D(t,e){var b,C,x,_;const{account:n=t.account,chain:r=t.chain,accessList:i,authorizationList:s,blobs:o,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:f,value:m,...y}=e;if(typeof n>"u")throw new g5({docsPath:"/docs/actions/wallet/sendTransaction"});const v=n?zs(n):null;try{L1(e);const $=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await Xoe({authorization:s[0]}).catch(()=>{throw new et("`to` is required. Could not infer from `authorizationList`.")})})();if((v==null?void 0:v.type)==="json-rpc"||v===null){let I;r!==null&&(I=await yn(t,h5,"getChainId")({}),uoe({currentChainId:I,chain:r}));const R=(x=(C=(b=t.chain)==null?void 0:b.formatters)==null?void 0:C.transactionRequest)==null?void 0:x.format,T=(R||D1)({...lC(y,{format:R}),accessList:i,authorizationList:s,blobs:o,chainId:I,data:a,from:v==null?void 0:v.address,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:f,to:$,value:m}),O=Gk.get(t.uid),U=O?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:U,params:[T]},{retryCount:0})}catch(z){if(O===!1)throw z;const L=z;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[T]},{retryCount:0}).then(S=>(Gk.set(t.uid,!0),S)).catch(S=>{const k=S;throw k.name==="MethodNotFoundRpcError"||k.name==="MethodNotSupportedRpcError"?(Gk.set(t.uid,!1),L):k});throw L}}if((v==null?void 0:v.type)==="local"){const I=await yn(t,yC,"prepareTransactionRequest")({account:v,accessList:i,authorizationList:s,blobs:o,chain:r,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:f,nonceManager:v.nonceManager,parameters:[...tae,"sidecars"],value:m,...y,to:$}),R=(_=r==null?void 0:r.serializers)==null?void 0:_.transaction,N=await v.signTransaction(I,{serializer:R});return await yn(t,CD,"sendRawTransaction")({serializedTransaction:N})}throw(v==null?void 0:v.type)==="smart"?new Kk({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Kk({docsPath:"/docs/actions/wallet/sendTransaction",type:v==null?void 0:v.type})}catch($){throw $ instanceof Kk?$:O9e($,{...e,account:v,chain:e.chain||void 0})}}async function w_e(t,e){const{abi:n,account:r=t.account,address:i,args:s,dataSuffix:o,functionName:a,...c}=e;if(typeof r>"u")throw new g5({docsPath:"/docs/contract/writeContract"});const l=r?zs(r):null,u=Tc({abi:n,args:s,functionName:a});try{return await yn(t,_D,"sendTransaction")({data:`${u}${o?o.replace("0x",""):""}`,to:i,account:l,...c})}catch(d){throw p1(d,{abi:n,address:i,args:s,docsPath:"/docs/contract/writeContract",functionName:a,sender:l==null?void 0:l.address})}}class v_e extends et{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function b_e(t,e){const{address:n,factory:r,factoryData:i}=e;try{const[s,o,a,c,l,u,d]=await yn(t,Qd,"readContract")({abi:x_e,address:n,functionName:"eip712Domain",factory:r,factoryData:i});return{domain:{name:o,version:a,chainId:Number(c),verifyingContract:l,salt:u},extensions:d,fields:s}}catch(s){const o=s;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new v_e({address:n}):o}}const x_e=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function E_e(t,{chain:e}){const{id:n,name:r,nativeCurrency:i,rpcUrls:s,blockExplorers:o}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:dn(n),chainName:r,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:o?Object.values(o).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}const MR=256;let P4=MR,R4;function iae(t=11){if(!R4||P4+t>MR*2){R4="",P4=0;for(let e=0;e<MR;e++)R4+=(256+Math.random()*256|0).toString(16).substring(1)}return R4.substring(P4,P4+++t)}
105function bC(t){const{batch:e,cacheTime:n=t.pollingInterval??4e3,ccipRead:r,key:i="base",name:s="Base Client",pollingInterval:o=4e3,type:a="base"}=t,c=t.chain,l=t.account?zs(t.account):void 0,{config:u,request:d,value:h}=t.transport({chain:c,pollingInterval:o}),f={...u,...h},m={account:l,batch:e,cacheTime:n,ccipRead:r,chain:c,key:i,name:s,pollingInterval:o,request:d,transport:f,type:a,uid:iae()};function y(v){return b=>{const C=b(v);for(const _ in m)delete C[_];const x={...v,...C};return Object.assign(x,{extend:y(x)})}}return Object.assign(m,{extend:y(m)})}function xC({key:t,methods:e,name:n,request:r,retryCount:i=3,retryDelay:s=150,timeout:o,type:a},c){const l=iae();return{config:{key:t,methods:e,name:n,request:r,retryCount:i,retryDelay:s,timeout:o,type:a},request:P6e(r,{methods:e,retryCount:i,retryDelay:s,uid:l}),value:c}}function SD(t,e={}){const{key:n="custom",methods:r,name:i="Custom Provider",retryDelay:s}=e;return({retryCount:o})=>xC({key:n,methods:r,name:i,request:t.request.bind(t),retryCount:e.retryCount??o,retryDelay:s,type:"custom"})}function C_e(t,e={}){const{key:n="fallback",name:r="Fallback",rank:i=!1,shouldThrow:s=__e,retryCount:o,retryDelay:a}=e;return({chain:c,pollingInterval:l=4e3,timeout:u,...d})=>{let h=t,f=()=>{};const m=xC({key:n,name:r,async request({method:y,params:v}){let b;const C=async(x=0)=>{const _=h[x]({...d,chain:c,retryCount:0,timeout:u});try{const $=await _.request({method:y,params:v});return f({method:y,params:v,response:$,transport:_,status:"success"}),$}catch($){if(f({error:$,method:y,params:v,transport:_,status:"error"}),s($)||x===h.length-1||(b??(b=h.slice(x+1).some(I=>{const{include:R,exclude:N}=I({chain:c}).config.methods||{};return R?R.includes(y):N?!N.includes(y):!0})),!b))throw $;return C(x+1)}};return C()},retryCount:o,retryDelay:a,type:"fallback"},{onResponse:y=>f=y,transports:h.map(y=>y({chain:c,retryCount:0}))});if(i){const y=typeof i=="object"?i:{};S_e({chain:c,interval:y.interval??l,onTransports:v=>h=v,ping:y.ping,sampleCount:y.sampleCount,timeout:y.timeout,transports:h,weights:y.weights})}return m}}function __e(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===Fy.code||t.code===Fr.code||m0.nodeMessage.test(t.message)||t.code===5e3))}function S_e({chain:t,interval:e=4e3,onTransports:n,ping:r,sampleCount:i=10,timeout:s=1e3,transports:o,weights:a={}}){const{stability:c=.7,latency:l=.3}=a,u=[],d=async()=>{const h=await Promise.all(o.map(async y=>{const v=y({chain:t,retryCount:0,timeout:s}),b=Date.now();let C,x;try{await(r?r({transport:v}):v.request({method:"net_listening"})),x=1}catch{x=0}finally{C=Date.now()}return{latency:C-b,success:x}}));u.push(h),u.length>i&&u.shift();const f=Math.max(...u.map(y=>Math.max(...y.map(({latency:v})=>v)))),m=o.map((y,v)=>{const b=u.map(I=>I[v].latency),x=1-b.reduce((I,R)=>I+R,0)/b.length/f,_=u.map(I=>I[v].success),$=_.reduce((I,R)=>I+R,0)/_.length;return $===0?[0,v]:[l*x+c*$,v]}).sort((y,v)=>v[0]-y[0]);n(m.map(([,y])=>o[y])),await q7(e),d()};d()}class A_e extends et{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Un(t,e={}){const{batch:n,fetchOptions:r,key:i="http",methods:s,name:o="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:c,retryDelay:l,raw:u}=e;return({chain:d,retryCount:h,timeout:f})=>{const{batchSize:m=1e3,wait:y=0}=typeof n=="object"?n:{},v=e.retryCount??h,b=f??e.timeout??1e4,C=t||(d==null?void 0:d.rpcUrls.default.http[0]);if(!C)throw new A_e;const x=h9e(C,{fetchOptions:r,onRequest:a,onResponse:c,timeout:b});return xC({key:i,methods:s,name:o,async request({method:_,params:$}){const I={method:_,params:$},{schedule:R}=loe({id:C,wait:y,shouldSplitBatch(U){return U.length>m},fn:U=>x.request({body:U}),sort:(U,z)=>U.id-z.id}),N=async U=>n?R(U):[await x.request({body:U})],[{error:T,result:O}]=await N(I);if(u)return{error:T,result:O};if(T)throw new rD({body:I,error:T,url:C});return O},retryCount:v,retryDelay:l,timeout:b,type:"http"},{fetchOptions:r,url:C})}}function AD(t,e){var r,i,s,o,a,c;if(!(t instanceof et))return!1;const n=t.walk(l=>l instanceof ER);return n instanceof ER?!!(((r=n.data)==null?void 0:r.errorName)==="ResolverNotFound"||((i=n.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((s=n.data)==null?void 0:s.errorName)==="ResolverNotContract"||((o=n.data)==null?void 0:o.errorName)==="ResolverError"||((a=n.data)==null?void 0:a.errorName)==="HttpError"||(c=n.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&n.reason===Lse[50]):!1}function sae(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==6
1055)return null;const e=`0x${t.slice(1,65)}`;return Da(e)?e:null}function t8(t){let e=new Uint8Array(32).fill(0);if(!t)return Ii(e);const n=t.split(".");for(let r=n.length-1;r>=0;r-=1){const i=sae(n[r]),s=i?Ud(i):Ns(Q0(n[r]),"bytes");e=Ns(Zd([e,s]),"bytes")}return Ii(e)}function k_e(t){return`[${t.slice(2)}]`}function $_e(t){const e=new Uint8Array(32).fill(0);return t?sae(t)||Ns(Q0(t)):Ii(e)}function EC(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const n=new Uint8Array(Q0(e).byteLength+2);let r=0;const i=e.split(".");for(let s=0;s<i.length;s++){let o=Q0(i[s]);o.byteLength>255&&(o=Q0(k_e($_e(i[s])))),n[r]=o.length,n.set(o,r+1),r+=o.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function I_e(t,{blockNumber:e,blockTag:n,coinType:r,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=T2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=Tc({abi:GH,functionName:"addr",...r!=null?{args:[t8(i),BigInt(r)]}:{args:[t8(i)]}}),u={address:c,abi:jse,functionName:"resolve",args:[Qt(EC(i)),l],blockNumber:e,blockTag:n},d=yn(t,Qd,"readContract"),h=s?await d({...u,args:[...u.args,s]}):await d(u);if(h[0]==="0x")return null;const f=N1({abi:GH,args:r!=null?[t8(i),BigInt(r)]:void 0,functionName:"addr",data:h[0]});return f==="0x"||yc(f)==="0x00"?null:f}catch(l){if(o)throw l;if(AD(l,"resolve"))return null;throw l}}class T_e extends et{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class Zw extends et{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class kD extends et{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class P_e extends et{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const R_e=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,M_e=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,O_e=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,j_e=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function N_e(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const n=e.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=t})}}function vV(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function oae({uri:t,gatewayUrls:e}){const n=O_e.test(t);if(n)return{uri:t,isOnChain:!0,isEncoded:n};const r=vV(e==null?void 0:e.ipfs,"https://ipfs.io"),i=vV(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(R_e),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",d=o==="ipfs:/"||a==="ipfs/"||M_e.test(t);if(t.startsWith("http")&&!u&&!d){let f=t;return e!=null&&e.arweave&&(f=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:f,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=t.replace(j_e,"");if(h.startsWith("<svg")&&(h=`data:image/svg+xml;base64,${btoa(h)}`),h.startsWith("data:")||h.startsWith("{"))return{uri:h,isOnChain:!0,isEncoded:!1};throw new kD({uri:t})}function aae(t){if(typeof t!="object"||!("image"in t)&&!("image_url"in t)&&!("image_data"in t))throw new T_e({data:t});return t.image||t.image_url||t.image_data}async function D_e({gatewayUrls:t,uri:e}){try{const n=await fetch(e).then(i=>i.json());return await $D({gatewayUrls:t,uri:aae(n)})}catch{throw new kD({uri:e})}}async function $D({gatewayUrls:t,uri:e}){const{uri:n,isOnChain:r}=oae({uri:e,gatewayUrls:t});if(r||await N_e(n))return n;throw new kD({uri:e})}function L_e(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[n,r,i]=e.split("/"),[s,o]=n.split(":"),[a,c]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Zw({reason:"Only EIP-155 supported"});if(!o)throw new Zw({reason:"Chain ID not found"});if(!c)throw new Zw({reason:"Contract address not found"});if(!i)throw new Zw({reason:"Token ID not found"});if(!a)throw new Zw({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function B_e(t,{nft:e}){if(e.namespace==="erc721")return Qd(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}
105],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Qd(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new P_e({namespace:e.namespace})}async function F_e(t,{gatewayUrls:e,record:n}){return/eip155:/i.test(n)?U_e(t,{gatewayUrls:e,record:n}):$D({uri:n,gatewayUrls:e})}async function U_e(t,{gatewayUrls:e,record:n}){const r=L_e(n),i=await B_e(t,{nft:r}),{uri:s,isOnChain:o,isEncoded:a}=oae({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return $D({uri:aae(u),gatewayUrls:e})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),D_e({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function cae(t,{blockNumber:e,blockTag:n,name:r,key:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=T2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:jse,functionName:"resolve",args:[Qt(EC(r)),Tc({abi:KH,functionName:"text",args:[t8(r),i]})],blockNumber:e,blockTag:n},u=yn(t,Qd,"readContract"),d=s?await u({...l,args:[...l.args,s]}):await u(l);if(d[0]==="0x")return null;const h=N1({abi:KH,functionName:"text",data:d[0]});return h===""?null:h}catch(l){if(o)throw l;if(AD(l,"resolve"))return null;throw l}}async function z_e(t,{blockNumber:e,blockTag:n,assetGatewayUrls:r,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await yn(t,cae,"getEnsText")({blockNumber:e,blockTag:n,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await F_e(t,{record:c,gatewayUrls:r})}catch{return null}}async function W_e(t,{address:e,blockNumber:n,blockTag:r,gatewayUrls:i,strict:s,universalResolverAddress:o}){let a=o;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=T2({blockNumber:n,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:x8e,functionName:"reverse",args:[Qt(EC(c))],blockNumber:n,blockTag:r},u=yn(t,Qd,"readContract"),[d,h]=i?await u({...l,args:[...l.args,i]}):await u(l);return e.toLowerCase()!==h.toLowerCase()?null:d}catch(l){if(s)throw l;if(AD(l,"reverse"))return null;throw l}}async function H_e(t,{blockNumber:e,blockTag:n,name:r,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=T2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await yn(t,Qd,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Qt(EC(r))],blockNumber:e,blockTag:n});return o}async function lae(t,e){var v,b,C;const{account:n=t.account,blockNumber:r,blockTag:i="latest",blobs:s,data:o,gas:a,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:h,value:f,...m}=e,y=n?zs(n):void 0;try{L1(e);const _=(r?dn(r):void 0)||i,$=(C=(b=(v=t.chain)==null?void 0:v.formatters)==null?void 0:b.transactionRequest)==null?void 0:C.format,R=($||D1)({...lC(m,{format:$}),from:y==null?void 0:y.address,blobs:s,data:o,gas:a,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:h,value:f}),N=await t.request({method:"eth_createAccessList",params:[R,_]});return{accessList:N.accessList,gasUsed:BigInt(N.gasUsed)}}catch(x){throw aoe(x,{...e,account:y,chain:t.chain})}}async function V_e(t){const e=mC(t,{method:"eth_newBlockFilter"}),n=await t.request({method:"eth_newBlockFilter"});return{id:n,request:e(n),type:"block"}}async function uae(t,{address:e,args:n,event:r,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(r?[r]:void 0),l=mC(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(f=>c5({abi:[f],eventName:f.name,args:n}))],r&&(u=u[0]));const d=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?dn(s):s,toBlock:typeof a=="bigint"?dn(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:s,id:d,request:l(d),strict:!!o,toBlock:a,type:"event"}}async function dae(t){const e=mC(t,{method:"eth_newPendingTransactionFilter"}),n=await t.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:e(n),type:"transaction"}}async function q_e(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function K_e(t,{blockHash:e,blockNumber:n,blockTag:r="latest"}={}){const i=n!==void 0?dn(n):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||r]},{dedupe:!!i}),Ec(s)}async function bV(t,{address:e,blockNumber:n,blockTag:r="latest"}){const i=n!==void 0?dn(n):void 0,s=await t.request({method:"eth_getCode",params:[e,i||r]},{dedupe:!!i});if(s!=="0x")return s}function G_e(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(n=>n.map(r=>BigInt(r)))}}async function Z_e(t,{blockCount:e,blockNumber:n,blockTag:r="latest",rewardPercentiles:i}){const s=n?dn(n):void 0,o=await t.request({method:"eth_feeHistory",params:[dn(e),s||r,i]},{dedupe:!!s});return G_e(o)}async function Y_e(t,{filter:e}){const n=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>Ou(s));return e.abi?hD({abi:e.abi,logs:i,strict:n}):i}function Q_e(t){return t.map(e=>
105({...e,value:BigInt(e.value)}))}function X_e(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?Ec(t.nonce):void 0,storageProof:t.storageProof?Q_e(t.storageProof):void 0}}async function J_e(t,{address:e,blockNumber:n,blockTag:r,storageKeys:i}){const s=r??"latest",o=n!==void 0?dn(n):void 0,a=await t.request({method:"eth_getProof",params:[e,i,o||s]});return X_e(a)}async function eSe(t,{address:e,blockNumber:n,blockTag:r="latest",slot:i}){const s=n!==void 0?dn(n):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||r]})}async function ID(t,{blockHash:e,blockNumber:n,blockTag:r,hash:i,index:s}){var u,d,h;const o=r||"latest",a=n!==void 0?dn(n):void 0;let c=null;if(i?c=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,dn(s)]},{dedupe:!0}):c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,dn(s)]},{dedupe:!!a}),!c)throw new ioe({blockHash:e,blockNumber:n,blockTag:o,hash:i,index:s});return(((h=(d=(u=t.chain)==null?void 0:u.formatters)==null?void 0:d.transaction)==null?void 0:h.format)||pC)(c)}async function tSe(t,{hash:e,transactionReceipt:n}){const[r,i]=await Promise.all([yn(t,p5,"getBlockNumber")({}),e?yn(t,ID,"getTransaction")({hash:e}):void 0]),s=(n==null?void 0:n.blockNumber)||(i==null?void 0:i.blockNumber);return s?r-s+1n:0n}async function OR(t,{hash:e}){var i,s,o;const n=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!n)throw new soe({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||Eoe)(n)}async function nSe(t,e){var v;const{allowFailure:n=!0,batchSize:r,blockNumber:i,blockTag:s,multicallAddress:o,stateOverride:a}=e,c=e.contracts,l=r??(typeof((v=t.batch)==null?void 0:v.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=o;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=T2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const d=[[]];let h=0,f=0;for(let b=0;b<c.length;b++){const{abi:C,address:x,args:_,functionName:$}=c[b];try{const I=Tc({abi:C,args:_,functionName:$});f+=(I.length-2)/2,l>0&&f>l&&d[h].length>0&&(h++,f=(I.length-2)/2,d[h]=[]),d[h]=[...d[h],{allowFailure:!0,callData:I,target:x}]}catch(I){const R=p1(I,{abi:C,address:x,args:_,docsPath:"/docs/contract/multicall",functionName:$});if(!n)throw R;d[h]=[...d[h],{allowFailure:!0,callData:"0x",target:x}]}}const m=await Promise.allSettled(d.map(b=>yn(t,Qd,"readContract")({abi:wR,address:u,args:[b],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),y=[];for(let b=0;b<m.length;b++){const C=m[b];if(C.status==="rejected"){if(!n)throw C.reason;for(let _=0;_<d[b].length;_++)y.push({status:"failure",error:C.reason,result:void 0});continue}const x=C.value;for(let _=0;_<x.length;_++){const{returnData:$,success:I}=x[_],{callData:R}=d[b][_],{abi:N,address:T,functionName:O,args:U}=c[y.length];try{if(R==="0x")throw new n5;if(!I)throw new oC({data:$});const z=N1({abi:N,args:U,data:$,functionName:O});y.push(n?{result:z,status:"success"}:z)}catch(z){const L=p1(z,{abi:N,address:T,args:U,docsPath:"/docs/contract/multicall",functionName:O});if(!n)throw L;y.push({error:L,result:void 0,status:"failure"})}}}if(y.length!==c.length)throw new et("multicall results mismatch");return y}const Bg=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function m5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Zb(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Xd(t,...e){if(!m5(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function hae(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Zb(t.outputLen),Zb(t.blockLen)}function qy(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function fae(t,e){Xd(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function rSe(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function op(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Zk(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Ul(t,e){return t<<32-e|t>>>e}const iSe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function sSe(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function oSe(t){for(let e=0;e<t.length;e++)t[e]=sSe(t[e]);return t}const xV=iSe?t=>t:oSe,pae=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",aSe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Jf(t){if(Xd(t),pae)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=aSe[t[n]];return e}const Ju={_0:48,_9:57,A:65,F:70,a:97,f:102};function EV(t){if(t>=Ju._0&&t<=Ju._9)return t-Ju._0;if(t>=Ju.A&&t<=Ju.F)return t-(Ju.A-10);if(t>=Ju.a&&t<=Ju.f)return t-(Ju.a-10)}function Y7(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);
vendor: 7,228 bytes, lines 105-106
105if(pae)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const o=EV(t.charCodeAt(s)),a=EV(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function cSe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function CC(t){return typeof t=="string"&&(t=cSe(t)),Xd(t),t}function yu(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Xd(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}class TD{}function PD(t){const e=r=>t().update(CC(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function RD(t=32){if(Bg&&typeof Bg.getRandomValues=="function")return Bg.getRandomValues(new Uint8Array(t));if(Bg&&typeof Bg.randomBytes=="function")return Uint8Array.from(Bg.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const MD=BigInt(0),jR=BigInt(1);function g1(t,e=""){if(typeof t!="boolean"){const n=e&&`"${e}"`;throw new Error(n+"expected boolean, got type="+typeof t)}return t}function hl(t,e,n=""){const r=m5(t),i=t==null?void 0:t.length,s=e!==void 0;if(!r||s&&i!==e){const o=n&&`"${n}" `,a=s?` of length ${e}`:"",c=r?`length=${i}`:`type=${typeof t}`;throw new Error(o+"expected Uint8Array"+a+", got "+c)}return t}function M4(t){const e=t.toString(16);return e.length&1?"0"+e:e}function gae(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?MD:BigInt("0x"+t)}function _C(t){return gae(Jf(t))}function Yb(t){return Xd(t),gae(Jf(Uint8Array.from(t).reverse()))}function OD(t,e){return Y7(t.toString(16).padStart(e*2,"0"))}function mae(t,e){return OD(t,e).reverse()}function mi(t,e,n){let r;if(typeof e=="string")try{r=Y7(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(m5(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function CV(t){return Uint8Array.from(t)}const Yk=t=>typeof t=="bigint"&&MD<=t;function lSe(t,e,n){return Yk(t)&&Yk(e)&&Yk(n)&&e<=t&&t<n}function NR(t,e,n,r){if(!lSe(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function yae(t){let e;for(e=0;t>MD;t>>=jR,e+=1);return e}const y5=t=>(jR<<BigInt(t))-jR;function uSe(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=f=>new Uint8Array(f),i=f=>Uint8Array.of(f);let s=r(t),o=r(t),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},l=(...f)=>n(o,s,...f),u=(f=r(0))=>{o=l(i(0),f),s=l(),f.length!==0&&(o=l(i(1),f),s=l())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const m=[];for(;f<e;){s=l();const y=s.slice();m.push(y),f+=s.length}return yu(...m)};return(f,m)=>{c(),u(f);let y;for(;!(y=m(d()));)u();return c(),y}}function w5(t,e,n={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function r(i,s,o){const a=t[i];if(o&&a===void 0)return;const c=typeof a;if(c!==s||a===null)throw new Error(`param "${i}" is invalid: expected ${s}, got ${c}`)}Object.entries(e).forEach(([i,s])=>r(i,s,!1)),Object.entries(n).forEach(([i,s])=>r(i,s,!0))}function Q7(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}const dSe="0.1.1";function hSe(){return dSe}let Ti=class DR extends Error{constructor(e,n={}){const r=(()=>{var c;if(n.cause instanceof DR){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof DR&&n.cause.docsPath||n.docsPath,o=`https://oxlib.sh${i??""}`,a=[e||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||i?["",r?`Details: ${r}`:void 0,i?`See: ${o}`:void 0]:[]].filter(c=>typeof c=="string").join(` 106`);super(a,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${hSe()}`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsPath=i,this.shortMessage=e}walk(e){return wae(this,e)}};function wae(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?wae(t.cause,e):e?null:t}const fSe="#__bigint";function pSe(t,e,n){return JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString()+fSe:i,n)}function gSe(t,e){if(SV(t)>e)throw new SSe({givenSize:SV(t),maxSize:e})}const ed={zero:48,nine:57,A:65,F:70,a:97,f:102};function _V(t){if(t>=ed.zero&&t<=ed.nine)return t-ed.zero;if(t>=ed.A&&t<=ed.F)return t-(ed.A-10);if(t>=ed.a&&t<=ed.f)return t-(ed.a-10)}function mSe(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;if(t.length>r)throw new ASe({size:t.length,targetSize:r,type:"Bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const o=n==="right";i[o?s:r-s-1]=t[o?s:t.length-s-1]}return i}function jD(t,e){if(Cc(t)>e)throw new PSe({givenSize:Cc(t),maxSize:e})}function ySe(t,e){if(typeof e=="number"&&e>0&&e>Cc(t)-1)throw new Cae({offset:e,position:"start",size:Cc(t)})}function wSe(t,e,n){if(typeof e=="number"&&typeof n=="number"&&Cc(t)!==n-e)throw new Cae({offset:n,position:"end",size:Cc(t)})}function vae(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;const i=t.replace("0x","");if(i.length>r*2)throw new RSe({size:Math.ceil(i.length/2),targetSize:r,type:"Hex"});return`0x${i[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const vSe=new TextEncoder;function bSe(t){return t instanceof Uint8Array?t:typeof t=="string"?ESe(t):xSe(t)}function xSe(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function ESe(t,e={}){const{size:n}=e;let r=t;n&&(jD(t,n),r=y1(t,n));let i=r.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const l=_V(i.charCodeAt(c++)),u=_V(i.charCodeAt(c++));if(l===void 0||u===void 0)throw new Ti(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);o[a]=l*16+u}return o}function CSe(t,e={}){const{size:n}=e,r=vSe.encode(t);return typeof n=="number"?(gSe(r,n),_Se(r,n)):r}function _Se(t,e){return mSe(t,{dir:"right",size:e})}function SV(t){return t.length}let SSe=class extends Ti{constructor({givenSize:e,maxSize:n}
106){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},ASe=class extends Ti{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const kSe=new TextEncoder,$Se=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ISe(t,e={}){const{strict:n=!1}=e;if(!t)throw new AV(t);if(typeof t!="string")throw new AV(t);if(n&&!/^0x[0-9a-fA-F]*$/.test(t))throw new kV(t);if(!t.startsWith("0x"))throw new kV(t)}function ju(...t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}function bae(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(jD(n,e.size),m1(n,e.size)):n}function xae(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=$Se[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(jD(r,e.size),y1(r,e.size)):r}function _o(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<o){const l=typeof t=="bigint"?"n":"";throw new Eae({max:s?`${s}${l}`:void 0,min:`${o}${l}`,signed:n,size:r,value:`${t}${l}`})}const c=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?m1(c,r):c}function ND(t,e={}){return xae(kSe.encode(t),e)}function m1(t,e){return vae(t,{dir:"left",size:e})}function y1(t,e){return vae(t,{dir:"right",size:e})}function DD(t,e,n,r={}){const{strict:i}=r;ySe(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return i&&wSe(s,e,n),s}function Cc(t){return Math.ceil((t.length-2)/2)}function TSe(t,e={}){const{strict:n=!1}=e;try{return ISe(t,{strict:n}),!0}catch{return!1}}let Eae=class extends Ti{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number \`${s}\` is not in safe${i?` ${i*8}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}};class AV extends Ti{constructor(e){super(`Value \`${typeof e=="object"?pSe(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class kV extends Ti{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}let PSe=class extends Ti{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};class Cae extends Ti{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}let RSe=class extends Ti{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};function MSe(t){return{address:t.address,amount:_o(t.amount),index:_o(t.index),validatorIndex:_o(t.validatorIndex)}}function OSe(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:_o(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:_o(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient}
106,...typeof t.gasLimit=="bigint"&&{gasLimit:_o(t.gasLimit)},...typeof t.number=="bigint"&&{number:_o(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:_o(t.prevRandao)},...typeof t.time=="bigint"&&{time:_o(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(MSe)}}}async function LR(t,e){const{blockNumber:n,blockTag:r="latest",blocks:i,returnFullTransactions:s,traceTransfers:o,validation:a}=e;try{const c=[];for(const h of i){const f=h.blockOverrides?OSe(h.blockOverrides):void 0,m=h.calls.map(v=>{const b=v,C=b.account?zs(b.account):void 0,x={...b,data:b.abi?Tc(b):b.data,from:b.from??(C==null?void 0:C.address)};return L1(x),D1(x)}),y=h.stateOverrides?lD(h.stateOverrides):void 0;c.push({blockOverrides:f,calls:m,stateOverrides:y})}const u=(n?dn(n):void 0)||r;return(await t.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:s,traceTransfers:o,validation:a},u]})).map((h,f)=>({...fD(h),calls:h.calls.map((m,y)=>{var O,U;const{abi:v,args:b,functionName:C,to:x}=i[f].calls[y],_=((O=m.error)==null?void 0:O.data)??m.returnData,$=BigInt(m.gasUsed),I=(U=m.logs)==null?void 0:U.map(z=>Ou(z)),R=m.status==="0x1"?"success":"failure",N=v&&R==="success"&&_!=="0x"?N1({abi:v,data:_,functionName:C}):null,T=(()=>{var L;if(R==="success")return;let z;if(((L=m.error)==null?void 0:L.data)==="0x"?z=new n5:m.error&&(z=new oC(m.error)),!!z)return p1(z,{abi:v??[],address:x,args:b,functionName:C??"<unknown>"})})();return{data:_,gasUsed:$,logs:I,status:R,...R==="success"?{result:N}:{error:T}}})}))}catch(c){const l=c,u=cC(l,{});throw u instanceof a5?l:u}}const jSe="1.1.1";let za=class BR extends Error{constructor(e,n={}){var o;const r=n.cause instanceof BR?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,i=n.cause instanceof BR&&n.cause.docsPath||n.docsPath,s=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${jSe}`].join(` 107`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}};function xh(t,e){const n=t.exec(e);return n==null?void 0:n.groups}const _ae=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Sae=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Aae=/^\(.+?\).*?$/,$V=/^tuple(?<array>(\[(\d*)\])*)$/;function FR(t){let e=t.type;if($V.test(t.type)&&"components"in t){e="(";const n=t.components.length;for(let i=0;i<n;i++){const s=t.components[i];e+=FR(s),i<n-1&&(e+=", ")}const r=xh($V,t.type);return e+=`)${(r==null?void 0:r.array)??""}`,FR({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e}
107 indexed`),t.name?`${e} ${t.name}`:e}function Yw(t){let e="";const n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=FR(i),r!==n-1&&(e+=", ")}return e}function UR(t){var e;return t.type==="function"?`function ${t.name}(${Yw(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${(e=t.outputs)!=null&&e.length?` returns (${Yw(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${Yw(t.inputs)})`:t.type==="error"?`error ${t.name}(${Yw(t.inputs)})`:t.type==="constructor"?`constructor(${Yw(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const kae=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function NSe(t){return kae.test(t)}function DSe(t){return xh(kae,t)}const $ae=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function LSe(t){return $ae.test(t)}function BSe(t){return xh($ae,t)}const Iae=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function FSe(t){return Iae.test(t)}function USe(t){return xh(Iae,t)}const Tae=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Pae(t){return Tae.test(t)}function zSe(t){return xh(Tae,t)}const Rae=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function WSe(t){return Rae.test(t)}function HSe(t){return xh(Rae,t)}const Mae=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function VSe(t){return Mae.test(t)}function qSe(t){return xh(Mae,t)}const KSe=/^receive\(\) external payable$/;function GSe(t){return KSe.test(t)}const ZSe=new Set(["indexed"]),zR=new Set(["calldata","memory","storage"]);class YSe extends za{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class QSe extends za{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class XSe extends za{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class JSe extends za{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class eAe extends za{constructor({param:e,name:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class tAe extends za{constructor({param:e,type:n,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class nAe extends za{constructor({param:e,type:n,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class rAe extends za{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class P2 extends za{constructor({signature:e,type:n}){super(`Invalid ${n} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class iAe extends za{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class sAe extends za{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class oAe extends za{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class aAe extends za{constructor({current:e,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function cAe(t,e,n){let r="";if(n)for(const i of Object.entries(n)){if(!i)continue;let s="";for(const o of i[1])s+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${i[0]}{${s}})`}return e?`${e}:${t}${r}`:t}const Qk=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function IV(t,e={}){if(FSe(t))return lAe(t,e);if(LSe(t))return uAe(t,e);if(NSe(t))return dAe(t,e);if(WSe(t))return hAe(t,e);if(VSe(t))return fAe(t);if(GSe(t))return{type:"receive",stateMutability:"payable"};throw new iAe({signature:t})}function lAe(t,e={}){const n=USe(t);if(!n)throw new P2({signature:t,type:"function"});const r=al(n.parameters),i=[],s=r.length;for(let a=0;a<s;a++)i.push(w1(r[a],{modifiers:zR,structs:e,type:"function"}));const o=[];if(n.returns){const a=al(n.returns),c=a.length;for(let l=0;l<c;l++)o.push(w1(a[l],{modifiers:zR,structs:e,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:i,outputs:o}}function uAe(t,e={}){const n=BSe(t);if(!n)throw new P2({signature:t,type:"event"});const r=al(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(w1(r[o],{modifiers:ZSe,structs:e,type:"event"}));return{name:n.name,type:"event",inputs:i}}function dAe(t,e={}){const n=DSe(t);if(!n)throw new P2({signature:t,type:"error"});const r=al(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(w1(r[o],{structs:e,type:"error"}));return{name:n.name,type:"error",inputs:i}}function hAe(t,e={}){const n=HSe(t);if(!n)throw new P2({signature:t,type:"constructor"});const r=al(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(w1(r[o],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:i}}function fAe(t){const e=qSe(t);if(!e)throw new P2({signature:t,type:"fallback"});return{type:"fallback",stateMutability:e.stateMutability??"nonpayable"}}const pAe=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,gAe=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,mAe=/^u?int$/;function w1(t,e){var d,h;const n=cAe(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(Qk.has(n))return Qk.get(n);const r=Aae.test(t),i=xh(r?gAe:pAe,t);if(!i)throw new JSe({param:t});if(i.name&&wAe(i.name))throw new eAe({param:t,name:i.name});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=(e==null?void 0:e.structs)??{};let c,l={};if(r){c="tuple";const f=al(i.type),m=[],y=f.length;for(let v=0;v<y;v++)m.push(w1(f[v],{structs:a}));l={components:m}}else if(i.type in a)c="tuple",l={components:a[i.type]};else if(mAe.test(i.type))c=`${i.type}256`;else if(i.type==="address payable")c="address";else if(c=i.type,(e==null?void 0:e.type)!=="struct"&&!Oae(c))throw new XSe({type:c});if(i.modifier){if(!((h=(d=e==null?void 0:e.modifiers)==null?void 0:d.has)!=null&&h.call(d,i.modifier)))throw new tAe({param:t,type:e==null?void 0:e.type,modifier:i.modifier});if(zR.has(i.modifier)&&!vAe(c,!!i.array))throw new nAe({param:t,type:e==null?void 0:e.type,modifier:i.modifier})}const u={type:`${c}${i.array??""}`,...s,...o,...l};return Qk.set(n,u),u}function al(t,e=[],n="",r=0){const i=t.trim().length;for(let s=0;s<i;s++){const o=t[s],a=t.slice(s+1);switch(o){case",":return r===0?al(a,[...e,n.trim()]):al(a,e,`${n}${o}`,r);case"(":return al(a,e,`${n}${o}`,r+1);case")":return al(a,e,`${n}${o}`,r-1);default:return al(a,e,`${n}${o}`,r)}}if(n==="")return e;if(r!==0)throw new aAe({current:n,depth:r});return e.push(n.trim()),e}function Oae(t){return t==="address"||t==="bool"||t==="function"||t==="string"||_ae.test(t)||Sae.test(t)}const yAe=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function wAe(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||_ae.test(t)||Sae.test(t)||yAe.test(t)}function vAe(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function bAe(t){const e={},n=t.length;for(let o=0;o<n;o++){const a=t[o];if(!Pae(a))continue;const c=zSe(a);if(!c)throw new P2({signature:a,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let h=0;h<d;h++){const m=l[h].trim();if(!m)continue;const y=w1(m,{type:"struct"});u.push(y)}if(!u.length)throw new sAe({signature:a});e[c.name]=u}const r={},i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,c]=i[o];r[a]=jae(c,e)}return r}const xAe=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function jae(t,e,n=new Set){const r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];if(Aae.test(o.type))r.push(o);else{const c=xh(xAe,o.type);if(!(c!=null&&c.type))throw new rAe({abiParameter:o});const{array:l,type:u}=c;if(u in e){if(n.has(u))throw new oAe({type:u});
vendor: 8,840 bytes, line 107
107r.push({...o,type:`tuple${l??""}`,components:jae(e[u]??[],e,new Set([...n,u]))})}else if(Oae(u))r.push(o);else throw new QSe({type:u})}}return r}function TV(t){let e;if(typeof t=="string")e=IV(t);else{const n=bAe(t),r=t.length;for(let i=0;i<r;i++){const s=t[i];if(!Pae(s)){e=IV(s,n);break}}}if(!e)throw new YSe({signature:t});return e}function EAe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+l,a,r)}function CAe(t,e,n){return t&e^~t&n}function _Ae(t,e,n){return t&e^t&n^e&n}class Nae extends TD{constructor(e,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Zk(this.buffer)}update(e){qy(this),e=CC(e),Xd(e);const{view:n,buffer:r,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Zk(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){qy(this),fae(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,op(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let d=o;d<i;d++)n[d]=0;EAe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=Zk(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Hh=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qs=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),O4=BigInt(2**32-1),PV=BigInt(32);function SAe(t,e=!1){return e?{h:Number(t&O4),l:Number(t>>PV&O4)}:{h:Number(t>>PV&O4)|0,l:Number(t&O4)|0}}function Dae(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let s=0;s<n;s++){const{h:o,l:a}=SAe(t[s],e);[r[s],i[s]]=[o,a]}return[r,i]}const RV=(t,e,n)=>t>>>n,MV=(t,e,n)=>t<<32-n|e>>>n,Fg=(t,e,n)=>t>>>n|e<<32-n,Ug=(t,e,n)=>t<<32-n|e>>>n,j4=(t,e,n)=>t<<64-n|e>>>n-32,N4=(t,e,n)=>t>>>n-32|e<<64-n,AAe=(t,e,n)=>t<<n|e>>>32-n,kAe=(t,e,n)=>e<<n|t>>>32-n,$Ae=(t,e,n)=>e<<n-32|t>>>64-n,IAe=(t,e,n)=>t<<n-32|e>>>64-n;function td(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const TAe=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),PAe=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,RAe=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),MAe=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,OAe=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),jAe=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,NAe=BigInt(0),Qw=BigInt(1),DAe=BigInt(2),LAe=BigInt(7),BAe=BigInt(256),FAe=BigInt(113),Lae=[],Bae=[],Fae=[];for(let t=0,e=Qw,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],Lae.push(2*(5*r+n)),Bae.push((t+1)*(t+2)/2%64);let i=NAe;for(let s=0;s<7;s++)e=(e<<Qw^(e>>LAe)*FAe)%BAe,e&DAe&&(i^=Qw<<(Qw<<BigInt(s))-Qw);Fae.push(i)}const Uae=Dae(Fae,!0),UAe=Uae[0],zAe=Uae[1],OV=(t,e,n)=>n>32?$Ae(t,e,n):AAe(t,e,n),jV=(t,e,n)=>n>32?IAe(t,e,n):kAe(t,e,n);function WAe(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],d=OV(l,u,1)^n[a],h=jV(l,u,1)^n[a+1];for(let f=0;f<50;f+=10)t[o+f]^=d,t[o+f+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=Bae[o],c=OV(i,s,a),l=jV(i,s,a),u=Lae[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=UAe[r],t[1]^=zAe[r]}op(n)}class LD extends TD{constructor(e,n,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,Zb(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=rSe(this.state)}clone(){return this._cloneInto()}keccak(){xV(this.state32),WAe(this.state32,this.rounds),xV(this.state32),this.posOut=0,this.pos=0}update(e){qy(this),e=CC(e),Xd(e);const{blockLen:n,state:r}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){qy(this,!1),Xd(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Zb(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(fae(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,op(this.state)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new LD(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const HAe=(t,e,n)=>PD(()=>new LD(e,t,n)),zae=HAe(1,136,256/8),VAe=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]),Vh=new Uint32Array(64);class qAe extends Nae{constructor(e=32){super(64,e,8,!1),this.A=Hh[0]|0,this.B=Hh[1]|0,this.C=Hh[2]|0,this.D=Hh[3]|0,this.E=Hh[4]|0,this.F=Hh[5]|0,this.G=Hh[6]|0,this.H=Hh[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:o,G:a,H:c}=this;return[e,n,r,i,s,o,a,c]}set(e,n,r,i,s,o,a,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,n){for(let d=0;d<16;d++,n+=4)Vh[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const h=Vh[d-15],f=Vh[d-2],m=Ul(h,7)^Ul(h,18)^h>>>3,y=Ul(f,17)^Ul(f,19)^f>>>10;Vh[d]=y+Vh[d-7]+m+Vh[d-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const h=Ul(a,6)^Ul(a,11)^Ul(a,25),f=u+h+CAe(a,c,l)+VAe[d]+Vh[d]|0,y=(Ul(r,2)^Ul(r,13)^Ul(r,22))+_Ae(r,i,s)|0;u=l,l=c,c=a,a=o+f|0,o=s,s=i,i=r,r=f+y|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,s,o,a,c,l,u)}roundClean(){op(Vh)}destroy(){this.set(0,0,0,0,0,0,0,0),op(this.buffer)}}const Wae=Dae(["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
1075771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),KAe=Wae[0],GAe=Wae[1],qh=new Uint32Array(80),Kh=new Uint32Array(80);class ZAe extends Nae{constructor(e=64){super(128,e,16,!1),this.Ah=Qs[0]|0,this.Al=Qs[1]|0,this.Bh=Qs[2]|0,this.Bl=Qs[3]|0,this.Ch=Qs[4]|0,this.Cl=Qs[5]|0,this.Dh=Qs[6]|0,this.Dl=Qs[7]|0,this.Eh=Qs[8]|0,this.El=Qs[9]|0,this.Fh=Qs[10]|0,this.Fl=Qs[11]|0,this.Gh=Qs[12]|0,this.Gl=Qs[13]|0,this.Hh=Qs[14]|0,this.Hl=Qs[15]|0}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:h,Gh:f,Gl:m,Hh:y,Hl:v}=this;return[e,n,r,i,s,o,a,c,l,u,d,h,f,m,y,v]}set(e,n,r,i,s,o,a,c,l,u,d,h,f,m,y,v){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=h|0,this.Gh=f|0,this.Gl=m|0,this.Hh=y|0,this.Hl=v|0}process(e,n){for(let x=0;x<16;x++,n+=4)qh[x]=e.getUint32(n),Kh[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const _=qh[x-15]|0,$=Kh[x-15]|0,I=Fg(_,$,1)^Fg(_,$,8)^RV(_,$,7),R=Ug(_,$,1)^Ug(_,$,8)^MV(_,$,7),N=qh[x-2]|0,T=Kh[x-2]|0,O=Fg(N,T,19)^j4(N,T,61)^RV(N,T,6),U=Ug(N,T,19)^N4(N,T,61)^MV(N,T,6),z=RAe(R,U,Kh[x-7],Kh[x-16]),L=MAe(z,I,O,qh[x-7],qh[x-16]);qh[x]=L|0,Kh[x]=z|0}let{Ah:r,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:h,Fh:f,Fl:m,Gh:y,Gl:v,Hh:b,Hl:C}=this;for(let x=0;x<80;x++){const _=Fg(d,h,14)^Fg(d,h,18)^j4(d,h,41),$=Ug(d,h,14)^Ug(d,h,18)^N4(d,h,41),I=d&f^~d&y,R=h&m^~h&v,N=OAe(C,$,R,GAe[x],Kh[x]),T=jAe(N,b,_,I,KAe[x],qh[x]),O=N|0,U=Fg(r,i,28)^j4(r,i,34)^j4(r,i,39),z=Ug(r,i,28)^N4(r,i,34)^N4(r,i,39),L=r&s^r&a^s&a,S=i&o^i&c^o&c;b=y|0,C=v|0,y=f|0,v=m|0,f=d|0,m=h|0,{h:d,l:h}=td(l|0,u|0,T|0,O|0),l=a|0,u=c|0,a=s|0,c=o|0,s=r|0,o=i|0;const k=TAe(O,z,S);r=PAe(k,T,U,L),i=k|0}({h:r,l:i}=td(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:o}=td(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=td(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=td(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:h}=td(this.Eh|0,this.El|0,d|0,h|0),{h:f,l:m}=td(this.Fh|0,this.Fl|0,f|0,m|0),{h:y,l:v}=td(this.Gh|0,this.Gl|0,y|0,v|0),{h:b,l:C}=td(this.Hh|0,this.Hl|0,b|0,C|0),this.set(r,i,s,o,a,c,l,u,d,h,f,m,y,v,b,C)}roundClean(){op(qh,Kh)}destroy(){op(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Hae=PD(()=>new qAe),YAe=PD(()=>new ZAe),WR=Hae;function Vae(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=zae(bSe(t));return n==="Bytes"?r:xae(r)}let QAe=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const XAe={checksum:new QAe(8192)},Xk=XAe.checksum,JAe=/^0x[a-fA-F0-9]{40}$/;function SC(t,e={}){const{strict:n=!0}=e;if(!JAe.test(t))throw new NV({address:t,cause:new tke});if(n){if(t.toLowerCase()===t)return;if(eke(t)!==t)throw new NV({address:t,cause:new nke})}}function eke(t){if(Xk.has(t))return Xk.get(t);SC(t,{strict:!1});const e=t.substring(2).toLowerCase(),n=Vae(CSe(e),{as:"Bytes"}),r=e.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const i=`0x${r.join("")}`;return Xk.set(t,i),i}function HR(t,e={}){const{strict:n=!0}=e??{};try{return SC(t,{strict:n}),!0}catch{return!1}}class NV extends Ti{constructor({address:e,cause:n}){super(`Address "${e}
107" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class tke extends Ti{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class nke extends Ti{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function VR(t){let e=!0,n="",r=0,i="",s=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&r++,a===")"&&r--,!!e){if(r===0){if(a===" "&&["event","function","error",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){t[o-1]!==","&&n!==","&&n!==",("&&(n="",e=!1);continue}i+=a,n+=a}}if(!s)throw new Ti("Unable to normalize signature.");return i}function qR(t,e){const n=typeof t,r=e.type;switch(r){case"address":return HR(t,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>qR(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(t)&&t.every(i=>qR(i,{...e,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function qae(t,e,n){for(const r in t){const i=t[r],s=e[r];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return qae(i.components,s.components,n[r]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?HR(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?HR(n[r],{strict:!1}):!1)return o}}function Kae(t,e={}){const{prepare:n=!0}=e,r=Array.isArray(t)||typeof t=="string"?TV(t):t;return{...r,...n?{hash:Am(r)}:{}}}function rke(t,e,n){const{args:r=[],prepare:i=!0}=n??{},s=TSe(e,{strict:!1}),o=t.filter(l=>s?l.type==="function"||l.type==="error"?Gae(l)===DD(e,0,4):l.type==="event"?Am(l)===e:!1:"name"in l&&l.name===e);if(o.length===0)throw new KR({name:e});if(o.length===1)return{...o[0],...i?{hash:Am(o[0])}:{}};let a;for(const l of o){if(!("inputs"in l))continue;if(!r||r.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...i?{hash:Am(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==r.length)continue;if(r.every((d,h)=>{const f="inputs"in l&&l.inputs[h];return f?qR(d,f):!1}
107)){if(a&&"inputs"in a&&a.inputs){const d=qae(l.inputs,a.inputs,r);if(d)throw new ske({abiItem:l,type:d[0]},{abiItem:a,type:d[1]})}a=l}}const c=(()=>{if(a)return a;const[l,...u]=o;return{...l,overloads:u}})();if(!c)throw new KR({name:e});return{...c,...i?{hash:Am(c)}:{}}}function Gae(t){return DD(Am(t),0,4)}function ike(t){const e=typeof t=="string"?t:UR(t);return VR(e)}function Am(t){return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Vae(ND(ike(t)))}class ske extends Ti{constructor(e,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${VR(UR(e.abiItem))}\`, and`,`\`${n.type}\` in \`${VR(UR(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class KR extends Ti{constructor({name:e,data:n,type:r="item"}){const i=e?` with name "${e}"`:n?` with data "${n}"`:"";super(`ABI ${r}${i} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}const oke=/^(.*)\[([0-9]*)\]$/,ake=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Zae=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function cke({checksumAddress:t,parameters:e,values:n}){const r=[];for(let i=0;i<e.length;i++)r.push(BD({checksumAddress:t,parameter:e[i],value:n[i]}));return r}function BD({checksumAddress:t=!1,parameter:e,value:n}){const r=e,i=mke(r.type);if(i){const[s,o]=i;return uke(n,{checksumAddress:t,length:s,parameter:{...r,type:o}})}if(r.type==="tuple")return gke(n,{checksumAddress:t,parameter:r});if(r.type==="address")return lke(n,{checksum:t});if(r.type==="bool")return hke(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,o="256"]=Zae.exec(r.type)??[];return fke(n,{signed:s,size:Number(o)})}if(r.type.startsWith("bytes"))return dke(n,{type:r.type});if(r.type==="string")return pke(n);throw new Jae(r.type)}function FD(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?e+=32:e+=Cc(a)}const n=[],r=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?(n.push(_o(e+i,{size:32})),r.push(a),i+=Cc(a)):n.push(a)}return ju(...n,...r)}function lke(t,e){const{checksum:n=!1}=e;return SC(t,{strict:n}),{dynamic:!1,encoded:m1(t.toLowerCase())}}function uke(t,e){const{checksumAddress:n,length:r,parameter:i}=e,s=r===null;if(!Array.isArray(t))throw new wke(t);if(!s&&t.length!==r)throw new yke({expectedLength:r,givenLength:t.length,type:`${i.type}[${r}]`});let o=!1;const a=[];for(let c=0;c<t.length;c++){const l=BD({checksumAddress:n,parameter:i,value:t[c]});l.dynamic&&(o=!0),a.push(l)}if(s||o){const c=FD(a);if(s){const l=_o(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?ju(l,c):l}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:ju(...a.map(({encoded:c})=>c))}}function dke(t,{type:e}){const[,n]=e.split("bytes"),r=Cc(t);if(!n){let i=t;return r%32!==0&&(i=y1(i,Math.ceil((t.length-2)/2/32)*32)),{dynamic:!0,encoded:ju(m1(_o(r,{size:32})),i)}}if(r!==Number.parseInt(n))throw new Qae({expectedSize:Number.parseInt(n),value:t});return{dynamic:!1,encoded:y1(t)}}function hke(t){if(typeof t!="boolean")throw new Ti(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:m1(bae(t))}}function fke(t,{signed:e,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(e?1n:0n))-1n,i=e?-r-1n:0n;if(t>r||t<i)throw new Eae({max:r.toString(),min:i.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:_o(t,{size:32,signed:e})}}function pke(t){const e=ND(t),n=Math.ceil(Cc(e)/32),r=[];for(let i=0;i<n;i++)r.push(y1(DD(e,i*32,(i+1)*32)));return{dynamic:!0,encoded:ju(y1(_o(Cc(e),{size:32})),...r)}}function gke(t,e){const{checksumAddress:n,parameter:r}=e;let i=!1;const s=[];for(let o=0;o<r.components.length;o++){const a=r.components[o],c=Array.isArray(t)?o:a.name,l=BD({checksumAddress:n,parameter:a,value:t[c]});s.push(l),l.dynamic&&(i=!0)}return{dynamic:i,encoded:i?FD(s):ju(...s.map(({encoded:o})=>o))}}function mke(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function Yae(t,e,n){const{checksumAddress:r=!1}={};if(t.length!==e.length)throw new Xae({expectedLength:t.length,givenLength:e.length});const i=cke({checksumAddress:r,parameters:t,values:e}),s=FD(i);return s.length===0?"0x":s}function GR(t,e){if(t.length!==e.length)throw new Xae({expectedLength:t.length,givenLength:e.length});const n=[];for(let r=0;r<t.length;r++){const i=t[r],s=e[r];n.push(GR.encode(i,s))}return ju(...n)}(function(t){function e(n,r,i=!1){if(n==="address"){const c=r;return SC(c),m1(c.toLowerCase(),i?32:0)}if(n==="string")return ND(r);if(n==="bytes")return r;if(n==="bool")return m1(bae(r),i?32:1);const s=n.match(Zae);
107if(s){const[c,l,u="256"]=s,d=Number.parseInt(u)/8;return _o(r,{size:i?32:d,signed:l==="int"})}const o=n.match(ake);if(o){const[c,l]=o;if(Number.parseInt(l)!==(r.length-2)/2)throw new Qae({expectedSize:Number.parseInt(l),value:r});return y1(r,i?32:0)}const a=n.match(oke);if(a&&Array.isArray(r)){const[c,l]=a,u=[];for(let d=0;d<r.length;d++)u.push(e(l,r[d],!0));return u.length===0?"0x":ju(...u)}throw new Jae(n)}t.encode=e})(GR||(GR={}));class yke extends Ti{constructor({expectedLength:e,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class Qae extends Ti{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Cc(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Xae extends Ti{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(` 108`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class wke extends Ti{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class Jae extends Ti{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function vke(t,e){var i;const{bytecode:n,args:r}=e;return ju(n,(i=t.inputs)!=null&&i.length&&(r!=null&&r.length)?Yae(t.inputs,r):"0x")}function bke(t){return Kae(t)}function xke(t,...e){const{overloads:n}=t,r=n?Eke([t,...n],t.name,{args:e[0]}):t,i=Cke(r),s=e.length>0?Yae(r.inputs,e[0]):void 0;return s?ju(i,s):i}function zg(t,e={}){return Kae(t,e)}function Eke(t,e,n){const r=rke(t,e,n);if(r.type!=="function")throw new KR({name:e,type:"function"});return r}function Cke(t){return Gae(t)}const _ke="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Gc="0x0000000000000000000000000000000000000000",Ske="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function Ake(t,e){const{blockNumber:n,blockTag:r,calls:i,stateOverrides:s,traceAssetChanges:o,traceTransfers:a,validation:c}=e,l=e.account?zs(e.account):void 0;if(o&&!l)throw new et("`account` is required when `traceAssetChanges` is true");const u=l?vke(bke("constructor(bytes, bytes)"),{bytecode:Nse,args:[Ske,xke(zg("function getBalance(address)"),[l.address])]}):void 0,d=o?await Promise.all(e.calls.map(async D=>{if(!D.data&&!D.abi)return;const{accessList:V}=await lae(t,{account:l.address,...D,data:D.abi?Tc(D):D.data});return V.map(({address:B,storageKeys:P})=>P.length>0?B:null)})).then(D=>D.flat().filter(Boolean)):[],h=s==null?void 0:s.map(D=>D.address===(l==null?void 0:l.address)?{...D,nonce:0}:D),f=await LR(t,{blockNumber:n,blockTag:r,blocks:[...o?[{calls:[{data:u}],stateOverrides:s},{calls:d.map((D,V)=>({abi:[zg("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:D,from:Gc,nonce:V})),stateOverrides:[{address:Gc,nonce:0}]}]:[],{calls:[...i,{}].map((D,V)=>({...D,from:l==null?void 0:l.address,nonce:V})),stateOverrides:h},...o?[{calls:[{data:u}]},{calls:d.map((D,V)=>({abi:[zg("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:D,from:Gc,nonce:V})),stateOverrides:[{address:Gc,nonce:0}]},{calls:d.map((D,V)=>({to:D,abi:[zg("function decimals() returns (uint256)")],functionName:"decimals",from:Gc,nonce:V})),stateOverrides:[{address:Gc,nonce:0}]},{calls:d.map((D,V)=>({to:D,abi:[zg("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Gc,nonce:V})),stateOverrides:[{address:Gc,nonce:0}]},{calls:d.map((D,V)=>({to:D,abi:[zg("function symbol() returns (string)")],functionName:"symbol",from:G
108c,nonce:V})),stateOverrides:[{address:Gc,nonce:0}]}]:[]],traceTransfers:a,validation:c}),m=o?f[2]:f[0],[y,v,,b,C,x,_,$]=o?f:[],{calls:I,...R}=m,N=I.slice(0,-1)??[],T=(y==null?void 0:y.calls)??[],O=(v==null?void 0:v.calls)??[],U=[...T,...O].map(D=>D.status==="success"?Sr(D.data):null),z=(b==null?void 0:b.calls)??[],L=(C==null?void 0:C.calls)??[],S=[...z,...L].map(D=>D.status==="success"?Sr(D.data):null),k=((x==null?void 0:x.calls)??[]).map(D=>D.status==="success"?D.result:null),M=(($==null?void 0:$.calls)??[]).map(D=>D.status==="success"?D.result:null),W=((_==null?void 0:_.calls)??[]).map(D=>D.status==="success"?D.result:null),H=[];for(const[D,V]of S.entries()){const B=U[D];if(typeof V!="bigint"||typeof B!="bigint")continue;const P=k[D-1],j=M[D-1],G=W[D-1],Y=D===0?{address:_ke,decimals:18,symbol:"ETH"}:{address:d[D-1],decimals:G||P?Number(P??1):void 0,symbol:j??void 0};H.some(te=>te.token.address===Y.address)||H.push({token:Y,value:{pre:B,post:V,diff:V-B}})}return{assetChanges:H,block:R,results:N}}let ece=class extends iD{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,H8e(e);const r=rC(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return Vy(this),this.iHash.update(e),this}digestInto(e){Vy(this),r5(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const tce=(t,e,n)=>new ece(t,e).update(n).digest();tce.create=(t,e)=>new ece(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const AC=BigInt(0),kC=BigInt(1),kke=BigInt(2);function v1(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function v5(t){if(!v1(t))throw new Error("Uint8Array expected")}function Ky(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const $ke=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Gy(t){v5(t);let e="";for(let n=0;n<t.length;n++)e+=$ke[t[n]];return e}function km(t){const e=t.toString(16);return e.length&1?"0"+e:e}function UD(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?AC:BigInt("0x"+t)}const nd={_0:48,_9:57,A:65,F:70,a:97,f:102};function DV(t){if(t>=nd._0&&t<=nd._9)return t-nd._0;if(t>=nd.A&&t<=nd.F)return t-(nd.A-10);if(t>=nd.a&&t<=nd.f)return t-(nd.a-10)}function Zy(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const o=DV(t.charCodeAt(s)),a=DV(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function X0(t){return UD(Gy(t))}function zD(t){return v5(t),UD(Gy(Uint8Array.from(t).reverse()))}function Yy(t,e){return Zy(t.toString(16).padStart(e*2,"0"))}function WD(t,e){return Yy(t,e).reverse()}function Ike(t){return Zy(km(t))}function el(t,e,n){let r;if(typeof e=="string")try{r=Zy(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(v1(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function Qb(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];
vendor: 24,314 bytes, line 108
108v5(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}function Tke(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return n===0}function Pke(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const Jk=t=>typeof t=="bigint"&&AC<=t;function $C(t,e,n){return Jk(t)&&Jk(e)&&Jk(n)&&e<=t&&t<n}function J0(t,e,n,r){if(!$C(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function nce(t){let e;for(e=0;t>AC;t>>=kC,e+=1);return e}function Rke(t,e){return t>>BigInt(e)&kC}function Mke(t,e,n){return t|(n?kC:AC)<<BigInt(e)}const HD=t=>(kke<<BigInt(t-1))-kC,e$=t=>new Uint8Array(t),LV=t=>Uint8Array.from(t);function rce(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=e$(t),i=e$(t),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=(...d)=>n(i,r,...d),c=(d=e$())=>{i=a(LV([0]),d),r=a(),d.length!==0&&(i=a(LV([1]),d),r=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const h=[];for(;d<e;){r=a();const f=r.slice();h.push(f),d+=r.length}return Qb(...h)};return(d,h)=>{o(),c(d);let f;for(;!(f=h(l()));)c();return o(),f}}const Oke={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||v1(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function b5(t,e,n={}){const r=(i,s,o)=>{const a=Oke[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}const jke=()=>{throw new Error("not implemented")};function ZR(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}const Nke=Object.freeze(Object.defineProperty({__proto__:null,aInRange:J0,abool:Ky,abytes:v5,bitGet:Rke,bitLen:nce,bitMask:HD,bitSet:Mke,bytesToHex:Gy,bytesToNumberBE:X0,bytesToNumberLE:zD,concatBytes:Qb,createHmacDrbg:rce,ensureBytes:el,equalBytes:Tke,hexToBytes:Zy,hexToNumber:UD,inRange:$C,isBytes:v1,memoized:ZR,notImplemented:jke,numberToBytesBE:Yy,numberToBytesLE:WD,numberToHexUnpadded:km,numberToVarBytesBE:Ike,utf8ToBytes:Pke,validateObject:b5},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ds=BigInt(0),Ai=BigInt(1),o0=BigInt(2),Dke=BigInt(3),YR=BigInt(4),BV=BigInt(5),FV=BigInt(8);function na(t,e){const n=t%e;return n>=ds?n:e+n}function Lke(t,e,n){if(e<ds)throw new Error("invalid exponent, negatives unsupported");if(n<=ds)throw new Error("invalid modulus");if(n===Ai)return ds;let r=Ai;for(;e>ds;)e&Ai&&(r=r*t%n),t=t*t%n,e>>=Ai;return r}function Ya(t,e,n){let r=t;for(;e-- >ds;)r*=r,r%=n;return r}function QR(t,e){if(t===ds)throw new Error("invert: expected non-zero number");if(e<=ds)throw new Error("invert: expected positive modulus, got "+e);let n=na(t,e),r=e,i=ds,s=Ai;for(;n!==ds;){const a=r/n,c=r%n,l=i-s*a;r=n,n=c,i=s,s=l}if(r!==Ai)throw new Error("invert: does not exist");return na(i,e)}function Bke(t){const e=(t-Ai)/o0;let n,r,i;for(n=t-Ai,r=0;n%o0===ds;n/=o0,r++);for(i=o0;i<t&&Lke(i,e,t)!==t-Ai;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(t+Ai)/YR;return function(c,l){const u=c.pow(l,o);if(!c.eql(c.sqr(u),l))throw new Error("Cannot find square root");return u}}const s=(n+Ai)/o0;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let l=r,u=a.pow(a.mul(a.ONE,i),n),d=a.pow(c,s),h=a.pow(c,n);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let f=1;for(let y=a.sqr(h);f<l&&!a.eql(y,a.ONE);f++)y=a.sqr(y);const m=a.pow(u,Ai<<BigInt(l-f-1));u=a.sqr(m),d=a.mul(d,m),h=a.mul(h,u),l=f}return d}}function Fke(t){if(t%YR===Dke){const e=(t+Ai)/YR;return function(r,i){const s=r.pow(i,e);if(!r.eql(r.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%FV===BV){const e=(t-BV)/FV;return function(r,i){const s=r.mul(i,o0),o=r.pow(s,e),a=r.mul(i,o),c=r.mul(r.mul(a,o0),o),l=r.mul(a,r.sub(c,r.ONE));if(!r.eql(r.sqr(l),i))throw new Error("Cannot find square root");return l}}return Bke(t)}const Uke=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zke(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Uke.reduce((r,i)=>(r[i]="function",r),e);return b5(t,n)}function Wke(t,e,n){if(n<ds)throw new Error("invalid exponent, negatives unsupported");if(n===ds)return t.ONE;if(n===Ai)return e;let r=t.ONE,i=e;for(;n>ds;)n&Ai&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Ai;return r}function Hke(t,e){const n=new Array(e.length),r=e.reduce((s,o,a)=>t.is0(o)?s:(n[a]=s,t.mul(s,o)),t.ONE),i=t.inv(r);return e.reduceRight((s,o,a)=>t.is0(o)?s:(n[a]=t.mul(s,n[a]),t.mul(s,o)),i),n}function ice(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function sce(t,e,n=!1,r={}){if(t<=ds)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=ice(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:n,BITS:i,BYTES:s,MASK:HD(i),ZERO:ds,ONE:Ai,create:c=>na(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return ds<=c&&c<t},is0:c=>c===ds,isOdd:c=>(c&Ai)===Ai,neg:c=>na(-c,t),eql:(c,l)=>c===l,sqr:c=>na(c*c,t),add:(c,l)=>na(c+l,t),sub:(c,l)=>na(c-l,t),mul:(c,l)=>na(c*l,t),pow:(c,l)=>Wke(a,c,l),div:(c,l)=>na(c*QR(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>QR(c,t),sqrt:r.sqrt||(c=>(o||(o=Fke(t)),o(a,c))),invertBatch:c=>Hke(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>n?WD(c,s):Yy(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return n?zD(c):X0(c)}});return Object.freeze(a)}function oce(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function ace(t){const e=oce(t);return e+Math.ceil(e/2)}function Vke(t,e,n=!1){const r=t.length,i=oce(e),s=ace(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=n?zD(t):X0(t),a=na(o,e-Ai)+Ai;return n?WD(a,i):Yy(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const UV=BigInt(0),D4=BigInt(1);function t$(t,e){const n=e.negate();return t?n:e}function cce(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function n$(t,e){cce(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1);return{windows:n,windowSize:r}}function qke(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function Kke(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const r$=new WeakMap,lce=new WeakMap;function i$(t){return lce.get(t)||1}function Gke(t,e){return{constTimeNegate:t$,hasPrecomputes(n){return i$(n)!==1},unsafeLadder(n,r,i=t.ZERO){let s=n;for(;r>UV;)r&D4&&(i=i.add(s)),s=s.double(),r>>=D4;return i},precomputeWindow(n,r){const{windows:i,windowSize:s}=n$(r,e),o=[];let a=n,c=a;for(let l=0;l<i;l++){c=a,o.push(c);for(let u=1;u<s;u++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(n,r,i){const{windows:s,windowSize:o}=n$(n,e);let a=t.ZERO,c=t.BASE;const l=BigInt(2**n-1),u=2**n,d=BigInt(n);for(let h=0;h<s;h++){const f=h*o;let m=Number(i&l);i>>=d,m>o&&(m-=u,i+=D4);const y=f,v=f+Math.abs(m)-1,b=h%2!==0,C=m<0;m===0?c=c.add(t$(b,r[y])):a=a.add(t$(C,r[v]))}return{p:a,f:c}},wNAFUnsafe(n,r,i,s=t.ZERO){const{windows:o,windowSize:a}=n$(n,e),c=BigInt(2**n-1),l=2**n,u=BigInt(n);for(let d=0;d<o;d++){const h=d*a;if(i===UV)break;let f=Number(i&c);if(i>>=u,f>a&&(f-=l,i+=D4),f===0)continue;let m=r[h+Math.abs(f)-1];f<0&&(m=m.negate()),s=s.add(m)}return s},getPrecomputes(n,r,i){let s=r$.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&r$.set(r,i(s))),s},wNAFCached(n,r,i){const s=i$(n);return this.wNAF(s,this.getPrecomputes(s,n,i),r)},wNAFCachedUnsafe(n,r,i,s){const o=i$(n);return o===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(o,this.getPrecomputes(o,n,i),r,s)},setWindowSize(n,r){cce(r,e),lce.set(n,r),r$.delete(n)}}}function Zke(t,e,n,r){if(qke(n,t),Kke(r,e),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=nce(BigInt(n.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<<o)-1,c=new Array(a+1).fill(i),l=Math.floor((e.BITS-1)/o)*o;let u=i;for(let d=l;d>=0;d-=o){c.fill(i);for(let f=0;f<r.length;f++){const m=r[f],y=Number(m>>BigInt(d)&BigInt(a));c[y]=c[y].add(n[f])}let h=i;for(let f=c.length-1,m=i;f>0;f--)m=m.add(c[f]),h=h.add(m);if(u=u.add(h),d!==0)for(let f=0;f<o;f++)u=u.double()}return u}function uce(t){return zke(t.Fp),b5(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ice(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function zV(t){t.lowS!==void 0&&Ky("lowS",t.lowS),t.prehash!==void 0&&Ky("prehash",t.prehash)}function Yke(t){const e=uce(t);b5(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("invalid 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("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Qke,hexToBytes:Xke}=Nke;let Jke=class extends Error{constructor(e=""){super(e)}};const vd={Err:Jke,_tlv:{encode:(t,e)=>{const{Err:n}=vd;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=km(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?km(i.length/2|128):"";return km(t)+s+i+e},decode(t,e){const{Err:n}=vd;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=e.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)o=o<<8|u;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(t){const{Err:e}=vd;if(t<Pd)throw new e("integer: negative integers are not allowed");let n=km(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=vd;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Qke(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=vd,i=typeof t=="string"?Xke(t):t;v5(i);const{v:s,l:o}=r.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:l,l:u}=r.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(t){const{_tlv:e,_int:n}=vd,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),s=r+i;return e.encode(48,s)}},Pd=BigInt(0),ss=BigInt(1);BigInt(2);const WV=BigInt(3);BigInt(4);function e$e(t){const e=Yke(t),{Fp:n}=e,r=sce(e.n,e.nBitLength),i=e.toBytes||((y,v,b)=>{const C=v.toAffine();return Qb(Uint8Array.from([4]),n.toBytes(C.x),n.toBytes(C.y))}),s=e.fromBytes||(y=>{const v=y.subarray(1),b=n.fromBytes(v.subarray(0,n.BYTES)),C=n.fromBytes(v.subarray(n.BYTES,2*n.BYTES));return{x:b,y:C}});function o(y){const{a:v,b}=e,C=n.sqr(y),x=n.mul(C,y);return n.add(n.add(x,n.mul(y,v)),b)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(y){return $C(y,ss,e.n)}function c(y){const{allowedPrivateKeyLengths:v,nByteLength:b,wrapPrivateKey:C,n:x}=e;if(v&&typeof y!="bigint"){if(v1(y)&&(y=Gy(y)),typeof y!="string"||!v.includes(y.length))throw new Error("invalid private key");y=y.padStart(b*2,"0")}let _;try{_=typeof y=="bigint"?y:X0(el("private key",y,b))}catch{throw new Error("invalid private key, expected hex or "+b+" bytes, got "+typeof y)}return C&&(_=na(_,x)),J0("private key",_,ss,x),_}function l(y){if(!(y instanceof h))throw new Error("ProjectivePoint expected")}const u=ZR((y,v)=>{const{px:b,py:C,pz:x}=y;if(n.eql(x,n.ONE))return{x:b,y:C};const _=y.is0();v==null&&(v=_?n.ONE:n.inv(x));const $=n.mul(b,v),I=n.mul(C,v),R=n.mul(x,v);if(_)return{x:n.ZERO,y:n.ZERO};if(!n.eql(R,n.ONE))throw new Error("invZ was invalid");return{x:$,y:I}}),d=ZR(y=>{if(y.is0()){if(e.allowInfinityPoint&&!n.is0(y.py))return;throw new Error("bad point: ZERO")}const{x:v,y:b}=y.toAffine();if(!n.isValid(v)||!n.isValid(b))throw new Error("bad point: x or y not FE");const C=n.sqr(b),x=o(v);if(!n.eql(C,x))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(v,b,C){if(this.px=v,this.py=b,this.pz=C,v==null||!n.isValid(v))throw new Error("x required");if(b==null||!n.isValid(b))throw new Error("y required");if(C==null||!n.isValid(C))throw new Error("z required");Object.freeze(this)}static fromAffine(v){const{x:b,y:C}=v||{};if(!v||!n.isValid(b)||!n.isValid(C))throw new Error("invalid affine point");if(v instanceof h)throw new Error("projective point not allowed");const x=_=>n.eql(_,n.ZERO);return x(b)&&x(C)?h.ZERO:new h(b,C,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(v){const b=n.invertBatch(v.map(C=>C.pz));return v.map((C,x)=>C.toAffine(b[x])).map(h.fromAffine)}static fromHex(v){const b=h.fromAffine(s(el("pointHex",v)));return b.assertValidity(),b}static fromPrivateKey(v){return h.BASE.multiply(c(v))}static msm(v,b){return Zke(h,r,v,b)}_setWindowSize(v){m.setWindowSize(this,v)}assertValidity(){d(this)}hasEvenY(){const{y:v}=this.toAffine();if(n.isOdd)return!n.isOdd(v);throw new Error("Field doesn't support isOdd")}equals(v){l(v);const{px:b,py:C,pz:x}=this,{px:_,py:$,pz:I}=v,R=n.eql(n.mul(b,I),n.mul(_,x)),N=n.eql(n.mul(C,I),n.mul($,x));return R&&N}negate(){return new h(this.px,n.neg(this.py),this.pz)}double(){const{a:v,b}=e,C=n.mul(b,WV),{px:x,py:_,pz:$}=this;let I=n.ZERO,R=n.ZERO,N=n.ZERO,T=n.mul(x,x),O=n.mul(_,_),U=n.mul($,$),z=n.mul(x,_);return z=n.add(z,z),N=n.mul(x,$),N=n.add(N,N),I=n.mul(v,N),R=n.mul(C,U),R=n.add(I,R),I=n.sub(O,R),R=n.add(O,R),R=n.mul(I,R),I=n.mul(z,I),N=n.mul(C,N),U=n.mul(v,U),z=n.sub(T,U),z=n.mul(v,z),z=n.add(z,N),N=n.add(T,T),T=n.add(N,T),T=n.add(T,U),T=n.mul(T,z),R=n.add(R,T),U=n.mul(_,$),U=n.add(U,U),T=n.mul(U,z),I=n.sub(I,T),N=n.mul(U,O),N=n.add(N,N),N=n.add(N,N),new h(I,R,N)}add(v){l(v);const{px:b,py:C,pz:x}=this,{px:_,py:$,pz:I}=v;let R=n.ZERO,N=n.ZERO,T=n.ZERO;const O=e.a,U=n.mul(e.b,WV);let z=n.mul(b,_),L=n.mul(C,$),S=n.mul(x,I),k=n.add(b,C),M=n.add(_,$);k=n.mul(k,M),M=n.add(z,L),k=n.sub(k,M),M=n.add(b,x);let W=n.add(_,I);return M=n.mul(M,W),W=n.add(z,S),M=n.sub(M,W),W=n.add(C,x),R=n.add($,I),W=n.mul(W,R),R=n.add(L,S),W=n.sub(W,R),T=n.mul(O,M),R=n.mul(U,S),T=n.add(R,T),R=n.sub(L,T),T=n.add(L,T),N=n.mul(R,T),L=n.add(z,z),L=n.add(L,z),S=n.mul(O,S),M=n.mul(U,M),L=n.add(L,S),S=n.sub(z,S),S=n.mul(O,S),M=n.add(M,S),z=n.mul(L,M),N=n.add(N,z),z=n.mul(W,M),R=n.mul(k,R),R=n.sub(R,z),z=n.mul(k,L),T=n.mul(W,T),T=n.add(T,z),new h(R,N,T)}subtract(v){return this.add(v.negate())}is0(){return this.equals(h.ZERO)}wNAF(v){return m.wNAFCached(this,v,h.normalizeZ)}multiplyUnsafe(v){const{endo:b,n:C}=e;J0("scalar",v,Pd,C);const x=h.ZERO;if(v===Pd)return x;if(this.is0()||v===ss)return this;if(!b||m.hasPrecomputes(this))return m.wNAFCachedUnsafe(this,v,h.normalizeZ);let{k1neg:_,k1:$,k2neg:I,k2:R}=b.splitScalar(v),N=x,T=x,O=this;for(;$>Pd||R>Pd;)$&ss&&(N=N.add(O)),R&ss&&(T=T.add(O)),O=O.double(),$>>=ss,R>>=ss;return _&&(N=N.negate()),I&&(T=T.negate()),T=new h(n.mul(T.px,b.beta),T.py,T.pz),N.add(T)}multiply(v){const{endo:b,n:C}=e;J0("scalar",v,ss,C);let x,_;if(b){const{k1neg:$,k1:I,k2neg:R,k2:N}=b.splitScalar(v);let{p:T,f:O}=this.wNAF(I),{p:U,f:z}=this.wNAF(N);T=m.constTimeNegate($,T),U=m.constTimeNegate(R,U),U=new h(n.mul(U.px,b.beta),U.py,U.pz),x=T.add(U),_=O.add(z)}else{const{p:$,f:I}=this.wNAF(v);x=$,_=I}return h.normalizeZ([x,_])[0]}multiplyAndAddUnsafe(v,b,C){const x=h.BASE,_=(I,R)=>R===Pd||R===ss||!I.equals(x)?I.multiplyUnsafe(R):I.multiply(R),$=_(this,b).add(_(v,C));return $.is0()?void 0:$}toAffine(v){return u(this,v)}isTorsionFree(){const{h:v,isTorsionFree:b}=e;if(v===ss)return!0;if(b)return b(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:v,clearCofactor:b}=e;return v===ss?this:b?b(h,this):this.multiplyUnsafe(e.h)}toRawBytes(v=!0){return Ky("isCompressed",v),this.assertValidity(),i(h,this,v)}toHex(v=!0){return Ky("isCompressed",v),Gy(this.toRawBytes(v))}}h.BASE=new h(e.Gx,e.Gy,n.ONE),h.ZERO=new h(n.ZERO,n.ONE,n.ZERO);const f=e.nBitLength,m=Gke(h,e.endo?Math.ceil(f/2):f);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function t$e(t){const e=uce(t);return b5(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function n$e(t){const e=t$e(t),{Fp:n,n:r}=e,i=n.BYTES+1,s=2*n.BYTES+1;function o(S){return na(S,r)}function a(S){return QR(S,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:u,isWithinCurveOrder:d}=e$e({...e,toBytes(S,k,M){const W=k.toAffine(),H=n.toBytes(W.x),D=Qb;return Ky("isCompressed",M),M?D(Uint8Array.from([k.hasEvenY()?2:3]),H):D(Uint8Array.from([4]),H,n.toBytes(W.y))},fromBytes(S){const k=S.length,M=S[0],W=S.subarray(1);if(k===i&&(M===2||M===3)){const H=X0(W);if(!$C(H,ss,n.ORDER))throw new Error("Point is not on curve");const D=u(H);let V;try{V=n.sqrt(D)}catch(j){const G=j instanceof Error?": "+j.message:"";throw new Error("Point is not on curve"+G)}const B=(V&ss)===ss;return(M&1)===1!==B&&(V=n.neg(V)),{x:H,y:V}}else if(k===s&&M===4){const H=n.fromBytes(W.subarray(0,n.BYTES)),D=n.fromBytes(W.subarray(n.BYTES,2*n.BYTES));return{x:H,y:D}}else{const H=i,D=s;throw new Error("invalid Point, expected length of "+H+", or uncompressed "+D+", got "+k)}}}),h=S=>Gy(Yy(S,e.nByteLength));function f(S){const k=r>>ss;return S>k}function m(S){return f(S)?o(-S):S}const y=(S,k,M)=>X0(S.slice(k,M));class v{constructor(k,M,W){this.r=k,this.s=M,this.recovery=W,this.assertValidity()}static fromCompact(k){const M=e.nByteLength;return k=el("compactSignature",k,M*2),new v(y(k,0,M),y(k,M,2*M))}static fromDER(k){const{r:M,s:W}=vd.toSig(el("DER",k));return new v(M,W)}assertValidity(){J0("r",this.r,ss,r),J0("s",this.s,ss,r)}addRecoveryBit(k){return new v(this.r,this.s,k)}recoverPublicKey(k){const{r:M,s:W,recovery:H}=this,D=I(el("msgHash",k));if(H==null||![0,1,2,3].includes(H))throw new Error("recovery id invalid");const V=H===2||H===3?M+e.n:M;if(V>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const B=(H&1)===0?"02":"03",P=c.fromHex(B+h(V)),j=a(V),G=o(-D*j),Y=o(W*j),te=c.BASE.multiplyAndAddUnsafe(P,G,Y);if(!te)throw new Error("point at infinify");return te.assertValidity(),te}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new v(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Zy(this.toDERHex())}toDERHex(){return vd.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Zy(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const b={isValidPrivateKey(S){try{return l(S),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const S=ace(e.n);return Vke(e.randomBytes(S),e.n)},precompute(S=8,k=c.BASE){return k._setWindowSize(S),k.multiply(BigInt(3)),k}};function C(S,k=!0){return c.fromPrivateKey(S).toRawBytes(k)}function x(S){const k=v1(S),M=typeof S=="string",W=(k||M)&&S.length;return k?W===i||W===s:M?W===2*i||W===2*s:S instanceof c}function _(S,k,M=!0){if(x(S))throw new Error("first arg must be private key");if(!x(k))throw new Error("second arg must be public key");return c.fromHex(k).multiply(l(S)).toRawBytes(M)}const $=e.bits2int||function(S){if(S.length>8192)throw new Error("input is too large");const k=X0(S),M=S.length*8-e.nBitLength;return M>0?k>>BigInt(M):k},I=e.bits2int_modN||function(S){return o($(S))},R=HD(e.nBitLength);function N(S){return J0("num < 2^"+e.nBitLength,S,Pd,R),Yy(S,e.nByteLength)}function T(S,k,M=O){if(["recovered","canonical"].some(oe=>oe in M))throw new Error("sign() legacy options not supported");const{hash:W,randomBytes:H}=e;let{lowS:D,prehash:V,extraEntropy:B}=M;D==null&&(D=!0),S=el("msgHash",S),zV(M),V&&(S=el("prehashed msgHash",W(S)));const P=I(S),j=l(k),G=[N(j),N(P)];if(B!=null&&B!==!1){const oe=B===!0?H(n.BYTES):B;G.push(el("extraEntropy",oe))}const Y=Qb(...G),te=P;function ae(oe){const de=$(oe);if(!d(de))return;const ke=a(de),Be=c.BASE.multiply(de).toAffine(),$e=o(Be.x);if($e===Pd)return;const He=o(ke*o(te+$e*j));if(He===Pd)return;let Ge=(Be.x===$e?0:2)|Number(Be.y&ss),je=He;return D&&f(He)&&(je=m(He),Ge^=1),new v($e,je,Ge)}return{seed:Y,k2sig:ae}}const O={lowS:e.lowS,prehash:!1},U={lowS:e.lowS,prehash:!1};function z(S,k,M=O){const{seed:W,k2sig:H}=T(S,k,M),D=e;return rce(D.hash.outputLen,D.nByteLength,D.hmac)(W,H)}c.BASE._setWindowSize(8);function L(S,k,M,W=U){var Ge;const H=S;k=el("msgHash",k),M=el("publicKey",M);const{lowS:D,prehash:V,format:B}=W;if(zV(W),"strict"in W)throw new Error("options.strict was renamed to lowS");if(B!==void 0&&B!=="compact"&&B!=="der")throw new Error("format must be compact or der");const P=typeof H=="string"||v1(H),j=!P&&!B&&typeof H=="object"&&H!==null&&typeof H.r=="bigint"&&typeof H.s=="bigint";if(!P&&!j)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let G,Y;try{if(j&&(G=new v(H.r,H.s)),P){try{B!=="compact"&&(G=v.fromDER(H))}catch(je){if(!(je instanceof vd.Err))throw je}!G&&B!=="der"&&(G=v.fromCompact(H))}Y=c.fromHex(M)}catch{return!1}if(!G||D&&G.hasHighS())return!1;V&&(k=e.hash(k));const{r:te,s:ae}=G,oe=I(k),de=a(ae),ke=o(oe*de),Be=o(te*de),$e=(Ge=c.BASE.multiplyAndAddUnsafe(Y,ke,Be))==null?void 0:Ge.toAffine();return $e?o($e.x)===te:!1}return{CURVE:e,getPublicKey:C,getSharedSecret:_,sign:z,verify:L,ProjectivePoint:c,Signature:v,utils:b}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function r$e(t){return{hash:t,hmac:(e,...n)=>tce(t,e,e7e(...n)),randomBytes:t7e}}function i$e(t,e){const n=r=>n$e({...t,...r$e(r)});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dce=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),HV=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),s$e=BigInt(1),XR=BigInt(2),VV=(t,e)=>(t+e/XR)/e;function o$e(t){const e=dce,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,d=Ya(u,n,e)*u%e,h=Ya(d,n,e)*u%e,f=Ya(h,XR,e)*l%e,m=Ya(f,i,e)*f%e,y=Ya(m,s,e)*m%e,v=Ya(y,a,e)*y%e,b=Ya(v,c,e)*v%e,C=Ya(b,a,e)*y%e,x=Ya(C,n,e)*u%e,_=Ya(x,o,e)*m%e,$=Ya(_,r,e)*l%e,I=Ya($,XR,e);
108if(!JR.eql(JR.sqr(I),t))throw new Error("Cannot find square root");return I}const JR=sce(dce,void 0,void 0,{sqrt:o$e}),VD=i$e({a:BigInt(0),b:BigInt(7),Fp:JR,n:HV,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=HV,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-s$e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),a=VV(s*t,e),c=VV(-r*t,e);let l=na(t-a*n-c*i,e),u=na(-a*r-c*s,e);const d=l>o,h=u>o;if(d&&(l=e-l),h&&(u=e-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:l,k2neg:h,k2:u}}}},_oe);BigInt(0);VD.ProjectivePoint;const a$e=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:VD},Symbol.toStringTag,{value:"Module"}));function c$e({r:t,s:e,to:n="hex",v:r,yParity:i}){const s=(()=>{if(i===0||i===1)return i;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new VD.Signature(Sr(t),Sr(e)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?o:To(o)}async function qD(t,e){var d,h,f;const{address:n,factory:r,factoryData:i,hash:s,signature:o,universalSignatureVerifierAddress:a=(f=(h=(d=t.chain)==null?void 0:d.contracts)==null?void 0:h.universalSignatureVerifier)==null?void 0:f.address,...c}=e,l=Da(o)?o:typeof o=="object"&&"r"in o&&"s"in o?c$e(o):Ii(o),u=await(async()=>!r&&!i||H9e(l)?l:V9e({address:r,data:i,signature:l}))();try{const m=a?{to:a,data:Tc({abi:ZH,functionName:"isValidSig",args:[n,s,u]}),...c}:{data:aC({abi:ZH,args:[n,s,u],bytecode:_8e}),...c},{data:y}=await yn(t,hC,"call")(m);return A6e(y??"0x0")}catch(m){try{if(uD(cr(n),await Aoe({hash:s,signature:o})))return!0}catch{}if(m instanceof ooe)return!1;throw m}}async function l$e(t,{address:e,message:n,factory:r,factoryData:i,signature:s,...o}){const a=koe(n);return qD(t,{address:e,factory:r,factoryData:i,hash:a,signature:s,...o})}async function u$e(t,e){const{address:n,factory:r,factoryData:i,signature:s,message:o,primaryType:a,types:c,domain:l,...u}=e,d=m9e({message:o,primaryType:a,types:c,domain:l});return qD(t,{address:n,factory:r,factoryData:i,hash:d,signature:s,...u})}function hce(t,{emitOnBegin:e=!1,emitMissed:n=!1,onBlockNumber:r,onError:i,poll:s,pollingInterval:o=t.pollingInterval}){const a=typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].c
108onfig.type==="webSocket");let c;return a?(()=>{const d=fs(["watchBlockNumber",t.uid,e,n,o]);return sp(d,{onBlockNumber:r,onError:i},h=>f5(async()=>{var f;try{const m=await yn(t,p5,"getBlockNumber")({cacheTime:0});if(c){if(m===c)return;if(m-c>1&&n)for(let y=c+1n;y<m;y++)h.onBlockNumber(y,c),c=y}(!c||m>c)&&(h.onBlockNumber(m,c),c=m)}catch(m){(f=h.onError)==null||f.call(h,m)}},{emitOnBegin:e,interval:o}))})():(()=>{const d=fs(["watchBlockNumber",t.uid,e,n]);return sp(d,{onBlockNumber:r,onError:i},h=>{let f=!0,m=()=>f=!1;return(async()=>{try{const y=(()=>{if(t.transport.type==="fallback"){const b=t.transport.transports.find(C=>C.config.type==="webSocket");return b?b.value:t.transport}return t.transport})(),{unsubscribe:v}=await y.subscribe({params:["newHeads"],onData(b){var x;if(!f)return;const C=Sr((x=b.result)==null?void 0:x.number);h.onBlockNumber(C,c),c=C},onError(b){var C;(C=h.onError)==null||C.call(h,b)}});m=v,f||m()}catch(y){i==null||i(y)}})(),()=>m()})})()}async function d$e(t,{confirmations:e=1,hash:n,onReplaced:r,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<<c)*200,timeout:a=18e4}){const c=fs(["waitForTransactionReceipt",t.uid,n]);let l,u,d,h=!1;const{promise:f,resolve:m,reject:y}=coe(),v=a?setTimeout(()=>y(new Y7e({hash:n})),a):void 0,b=sp(c,{onReplaced:r,resolve:m,reject:y},C=>{const x=yn(t,hce,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(_){const $=R=>{clearTimeout(v),x(),R(),b()};let I=_;if(!h)try{if(d){if(e>1&&(!d.blockNumber||I-d.blockNumber+1n<e))return;$(()=>C.resolve(d));return}if(l||(h=!0,await Hy(async()=>{l=await yn(t,ID,"getTransaction")({hash:n}),l.blockNumber&&(I=l.blockNumber)},{delay:o,retryCount:s}),h=!1),d=await yn(t,OR,"getTransactionReceipt")({hash:n}),e>1&&(!d.blockNumber||I-d.blockNumber+1n<e))return;$(()=>C.resolve(d))}catch(R){if(R instanceof ioe||R instanceof soe){if(!l){h=!1;return}try{u=l,h=!0;const N=await Hy(()=>yn(t,wu,"getBlock")({blockNumber:I,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:U})=>U instanceof Joe});h=!1;const T=N.transactions.find(({from:U,nonce:z})=>U===u.from&&z===u.nonce);if(!T||(d=await yn(t,OR,"getTransactionReceipt")({hash:T.hash}),e>1&&(!d.blockNumber||I-d.blockNumber+1n<e)))return;let O="replaced";T.to===u.to&&T.value===u.value&&T.input===u.input?O="repriced":T.from===T.to&&T.value===0n&&(O="cancelled"),$(()=>{var U;(U=C.onReplaced)==null||U.call(C,{reason:O,replacedTransaction:u,transaction:T,transactionReceipt:d}),C.resolve(d)})}catch(N){$(()=>C.reject(N))}}else $(()=>C.reject(R))}}})});return f}function h$e(t,{blockTag:e="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:c=t.pollingInterval}){const l=typeof a<"u"?a:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].c
108onfig.type==="webSocket"),u=o??!1;let d;return l?(()=>{const m=fs(["watchBlocks",t.uid,e,n,r,u,c]);return sp(m,{onBlock:i,onError:s},y=>f5(async()=>{var v;try{const b=await yn(t,wu,"getBlock")({blockTag:e,includeTransactions:u});if(b.number&&(d!=null&&d.number)){if(b.number===d.number)return;if(b.number-d.number>1&&n)for(let C=(d==null?void 0:d.number)+1n;C<b.number;C++){const x=await yn(t,wu,"getBlock")({blockNumber:C,includeTransactions:u});y.onBlock(x,d),d=x}}(!(d!=null&&d.number)||e==="pending"&&!(b!=null&&b.number)||b.number&&b.number>d.number)&&(y.onBlock(b,d),d=b)}catch(b){(v=y.onError)==null||v.call(y,b)}},{emitOnBegin:r,interval:c}))})():(()=>{let m=!0,y=!0,v=()=>m=!1;return(async()=>{try{r&&yn(t,wu,"getBlock")({blockTag:e,includeTransactions:u}).then(x=>{m&&y&&(i(x,void 0),y=!1)});const b=(()=>{if(t.transport.type==="fallback"){const x=t.transport.transports.find(_=>_.config.type==="webSocket");return x?x.value:t.transport}return t.transport})(),{unsubscribe:C}=await b.subscribe({params:["newHeads"],async onData(x){if(!m)return;const _=await yn(t,wu,"getBlock")({blockNumber:x.blockNumber,includeTransactions:u}).catch(()=>{});m&&(i(_,d),y=!1,d=_)},onError(x){s==null||s(x)}});v=C,m||v()}catch(b){s==null||s(b)}})(),()=>v()})()}function f$e(t,{address:e,args:n,batch:r=!0,event:i,events:s,fromBlock:o,onError:a,onLogs:c,poll:l,pollingInterval:u=t.pollingInterval,strict:d}){const h=typeof l<"u"?l:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].c
108onfig.type==="webSocket"),f=d??!1;return h?(()=>{const v=fs(["watchEvent",e,n,r,t.uid,i,u,o]);return sp(v,{onLogs:c,onError:a},b=>{let C;o!==void 0&&(C=o-1n);let x,_=!1;const $=f5(async()=>{var I;if(!_){try{x=await yn(t,uae,"createEventFilter")({address:e,args:n,event:i,events:s,strict:f,fromBlock:o})}catch{}_=!0;return}try{let R;if(x)R=await yn(t,wC,"getFilterChanges")({filter:x});else{const N=await yn(t,p5,"getBlockNumber")({});C&&C!==N?R=await yn(t,ED,"getLogs")({address:e,args:n,event:i,events:s,fromBlock:C+1n,toBlock:N}):R=[],C=N}if(R.length===0)return;if(r)b.onLogs(R);else for(const N of R)b.onLogs([N])}catch(R){x&&R instanceof l1&&(_=!1),(I=b.onError)==null||I.call(b,R)}},{emitOnBegin:!0,interval:u});return async()=>{x&&await yn(t,vC,"uninstallFilter")({filter:x}),$()}})})():(()=>{let v=!0,b=()=>v=!1;return(async()=>{try{const C=(()=>{if(t.transport.type==="fallback"){const I=t.transport.transports.find(R=>R.config.type==="webSocket");return I?I.value:t.transport}return t.transport})(),x=s??(i?[i]:void 0);let _=[];x&&(_=[x.flatMap(R=>c5({abi:[R],eventName:R.name,args:n}))],i&&(_=_[0]));const{unsubscribe:$}=await C.subscribe({params:["logs",{address:e,topics:_}],onData(I){var N;if(!v)return;const R=I.result;try{const{eventName:T,args:O}=dD({abi:x??[],data:R.data,topics:R.topics,strict:f}),U=Ou(R,{args:O,eventName:T});c([U])}catch(T){let O,U;if(T instanceof qb||T instanceof nC){if(d)return;O=T.abiItem.name,U=(N=T.abiItem.inputs)==null?void 0:N.some(L=>!("name"in L&&L.name))}const z=Ou(R,{args:U?[]:{},eventName:O});c([z])}},onError(I){a==null||a(I)}});b=$,v||b()}catch(C){a==null||a(C)}})(),()=>b()})()}function p$e(t,{batch:e=!0,onError:n,onTransactions:r,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const l=fs(["watchPendingTransactions",t.uid,e,s]);return sp(l,{onTransactions:r,onError:n},u=>{let d;const h=f5(async()=>{var f;try{if(!d)try{d=await yn(t,dae,"createPendingTransactionFilter")({});return}catch(y){throw h(),y}const m=await yn(t,wC,"getFilterChanges")({filter:d});if(m.length===0)return;if(e)u.onTransactions(m);else for(const y of m)u.onTransactions([y])}catch(m){(f=u.onError)==null||f.call(u,m)}},{emitOnBegin:!0,interval:s});return async()=>{d&&await yn(t,vC,"uninstallFilter")({filter:d}),h()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:d}=await t.transport.subscribe({params:["newPendingTransactions"],onData(h){if(!l)return;const f=h.result;r([f])},onError(h){n==null||n(h)}});u=d,l||u()}catch(d){n==null||n(d)}})(),()=>u()})()}function g$e(t){var d,h,f;const{scheme:e,statement:n,...r}=((d=t.match(m$e))==null?void 0:d.groups)??{},{chainId:i,expirationTime:s,issuedAt:o,notBefore:a,requestId:c,...l}=((h=t.match(y$e))==null?void 0:h.groups)??{},u=(f=t.split("Resources:")[1])==null?void 0:f.split(` 109- `).slice(1);return{...r,...l,...i?{chainId:Number(i)}:{},...s?{expirationTime:new Date(s)}:{},...o?{issuedAt:new Date(o)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...n?{statement:n}:{}}}const m$e=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,y$e=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function w$e(t){const{address:e,domain:n,message:r,nonce:i,scheme:s,time:o=new Date}=t;if(n&&r.domain!==n||i&&r.nonce!==i||s&&r.scheme!==s||r.expirationTime&&o>=r.expirationTime||r.notBefore&&o<r.notBefore)return!1;try{if(!r.address||e&&!uD(r.address,e))return!1}catch{return!1}return!0}async function v$e(t,e){const{address:n,domain:r,message:i,nonce:s,scheme:o,signature:a,time:c=new Date,...l}=e,u=g$e(i);if(!u.address||!w$e({address:n,domain:r,message:u,nonce:s,scheme:o,time:c}))return!1;const h=koe(i);return qD(t,{address:u.address,hash:h,signature:a,...l})}function KD(t){return{call:e=>hC(t,e),createAccessList:e=>lae(t,e),createBlockFilter:()=>V_e(t),createContractEventFilter:e=>Qoe(t,e),createEventFilter:e=>uae(t,e),createPendingTransactionFilter:()=>dae(t),estimateContractGas:e=>l_e(t,e),estimateGas:e=>xD(t,e),getBalance:e=>nae(t,e),getBlobBaseFee:()=>q_e(t),getBlock:e=>wu(t,e),getBlockNumber:e=>p5(t,e),getBlockTransactionCount:e=>K_e(t,e),getBytecode:e=>bV(t,e),getChainId:()=>h5(t),getCode:e=>bV(t,e),getContractEvents:e=>rae(t,e),getEip712Domain:e=>b_e(t,e),getEnsAddress:e=>I_e(t,e),getEnsAvatar:e=>z_e(t,e),getEnsName:e=>W_e(t,e),getEnsResolver:e=>H_e(t,e),getEnsText:e=>cae(t,e),getFeeHistory:e=>
109Z_e(t,e),estimateFeesPerGas:e=>c_e(t,e),getFilterChanges:e=>wC(t,e),getFilterLogs:e=>Y_e(t,e),getGasPrice:()=>bD(t),getLogs:e=>ED(t,e),getProof:e=>J_e(t,e),estimateMaxPriorityFeePerGas:e=>a_e(t,e),getStorageAt:e=>eSe(t,e),getTransaction:e=>ID(t,e),getTransactionConfirmations:e=>tSe(t,e),getTransactionCount:e=>Loe(t,e),getTransactionReceipt:e=>OR(t,e),multicall:e=>nSe(t,e),prepareTransactionRequest:e=>yC(t,e),readContract:e=>Qd(t,e),sendRawTransaction:e=>CD(t,e),simulate:e=>LR(t,e),simulateBlocks:e=>LR(t,e),simulateCalls:e=>Ake(t,e),simulateContract:e=>u_e(t,e),verifyMessage:e=>l$e(t,e),verifySiweMessage:e=>v$e(t,e),verifyTypedData:e=>u$e(t,e),uninstallFilter:e=>vC(t,e),waitForTransactionReceipt:e=>d$e(t,e),watchBlocks:e=>h$e(t,e),watchBlockNumber:e=>hce(t,e),watchContractEvent:e=>y_e(t,e),watchEvent:e=>f$e(t,e),watchPendingTransactions:e=>p$e(t,e)}}function ap(t){const{key:e="public",name:n="Public Client"}=t;return bC({...t,key:e,name:n,type:"publicClient"}).extend(KD)}function b$e(t,e){const{abi:n,args:r,bytecode:i,...s}=e,o=aC({abi:n,args:r,bytecode:i}
109);return _D(t,{...s,...s.authorizationList?{to:null}:{},data:o})}async function x$e(t){var n;return((n=t.account)==null?void 0:n.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(r=>i5(r))}async function E$e(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function C$e(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(n=>cr(n))}async function _$e(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function fce(t,{account:e=t.account,message:n}){if(!e)throw new g5({docsPath:"/docs/actions/wallet/signMessage"});const r=zs(e);if(r.signMessage)return r.signMessage({message:n});const i=typeof n=="string"?Wy(n):n.raw instanceof Uint8Array?Qt(n.raw):n.raw;return t.request({method:"personal_sign",params:[i,r.address]},{retryCount:0})}async function S$e(t,e){var l,u,d,h;const{account:n=t.account,chain:r=t.chain,...i}=e;if(!n)throw new g5({docsPath:"/docs/actions/wallet/signTransaction"});const s=zs(n);L1({account:s,...e});const o=await yn(t,h5,"getChainId")({});r!==null&&uoe({currentChainId:o,chain:r});const a=(r==null?void 0:r.formatters)||((l=t.chain)==null?void 0:l.formatters),c=((u=a==null?void 0:a.transactionRequest)==null?void 0:u.format)||D1;return s.signTransaction?s.signTransaction({...i,chainId:o},{serializer:(h=(d=t.chain)==null?void 0:d.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c(i),chainId:dn(o),from:s.address}]},{retryCount:0})}async function A$e(t,e){const{account:n=t.account,domain:r,message:i,primaryType:s}=e;if(!n)throw new g5({docsPath:"/docs/actions/wallet/signTypedData"});const o=zs(n),a={EIP712Domain:moe({domain:r}),...e.types};if(goe({domain:r,message:i,primaryType:s,types:a}),o.signTypedData)return o.signTypedData({domain:r,message:i,primaryType:s,types:a});const c=b9e({domain:r,message:i,primaryType:s,types:a});return t.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function k$e(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:dn(e)}]},{retryCount:0})}async function $$e(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function I$e(t){return{addChain:e=>E_e(t,e),deployContract:e=>b$e(t,e),getAddresses:()=>x$e(t),getChainId:()=>h5(t),getPermissions:()=>E$e(t),prepareTransactionRequest:e=>yC(t,e),requestAddresses:()=>C$e(t),requestPermissions:e=>_$e(t,e),sendRawTransaction:e=>CD(t,e),sendTransaction:e=>_D(t,e),signMessage:e=>fce(t,e),signTransaction:e=>S$e(t,e),signTypedData:e=>A$e(t,e),switchChain:e=>k$e(t,e),watchAsset:e=>$$e(t,e),writeContract:e=>w_e(t,e)}}function pce(t){const{key:e="wallet",name:n="Wallet Client",transport:r}=t;return bC({...t,key:e,name:n,transport:r,type:"walletClient"}).extend(I$e)}var fo=function(){return fo=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},fo.apply(this,arguments)};function Qy(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Dr="-ms-",ab="-moz-",or="-webkit-",gce="comm",IC="rule",GD="decl",T$e="@import",mce="@keyframes",P$e="@layer",yce=Math.abs,ZD=String.fromCharCode,eM=Object.assign;function R$e(t,e){return cs(t,0)^45?(((e<<2^cs(t,0))<<2^cs(t,1))<<2^cs(t,2))<<2^cs(t,3):0}function wce(t){return t.trim()}function yd(t,e){return(t=e.exec(t))?t[0]:t}function Mn(t,e,n){return t.replace(e,n)}function n8(t,e,n){return t.indexOf(e,n)}function cs(t,e){return t.charCodeAt(e)|0}function Xy(t,e,n){return t.slice(e,n)}function gu(t){return t.length}function vce(t){return t.length}function Uv(t,e){return e.push(t),t}function M$e(t,e){return t.map(e).join("")}function qV(t,e){return t.filter(function(n){return!yd(n,e)})}var TC=1,Jy=1,bce=0,_c=0,Ui=0,R2="";function PC(t,e,n,r,i,s,o,a){return{value:t,root:e,parent:n,type:r,props:i,children:s,line:TC,column:Jy,length:o,return:"",siblings:a}}function pf(t,e){return eM(PC("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function Wg(t){for(;t.root;)t=pf(t.root,{children:[t]});Uv(t,t.siblings)}function O$e(){return Ui}function j$e(){return Ui=_c>
vendor: 3,362 bytes, line 109
1090?cs(R2,--_c):0,Jy--,Ui===10&&(Jy=1,TC--),Ui}function yl(){return Ui=_c<bce?cs(R2,_c++):0,Jy++,Ui===10&&(Jy=1,TC++),Ui}function e1(){return cs(R2,_c)}function r8(){return _c}function RC(t,e){return Xy(R2,t,e)}function tM(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function N$e(t){return TC=Jy=1,bce=gu(R2=t),_c=0,[]}function D$e(t){return R2="",t}function s$(t){return wce(RC(_c-1,nM(t===91?t+2:t===40?t+1:t)))}function L$e(t){for(;(Ui=e1())&&Ui<33;)yl();return tM(t)>2||tM(Ui)>3?"":" "}function B$e(t,e){for(;--e&&yl()&&!(Ui<48||Ui>102||Ui>57&&Ui<65||Ui>70&&Ui<97););return RC(t,r8()+(e<6&&e1()==32&&yl()==32))}function nM(t){for(;yl();)switch(Ui){case t:return _c;case 34:case 39:t!==34&&t!==39&&nM(Ui);break;case 40:t===41&&nM(t);break;case 92:yl();break}return _c}function F$e(t,e){for(;yl()&&t+Ui!==57;)if(t+Ui===84&&e1()===47)break;return"/*"+RC(e,_c-1)+"*"+ZD(t===47?t:yl())}function U$e(t){for(;!tM(e1());)yl();return RC(t,_c)}function z$e(t){return D$e(i8("",null,null,null,[""],t=N$e(t),0,[0],t))}function i8(t,e,n,r,i,s,o,a,c){for(var l=0,u=0,d=o,h=0,f=0,m=0,y=1,v=1,b=1,C=0,x="",_=i,$=s,I=r,R=x;v;)switch(m=C,C=yl()){case 40:if(m!=108&&cs(R,d-1)==58){n8(R+=Mn(s$(C),"&","&\f"),"&\f",yce(l?a[l-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:R+=s$(C);break;case 9:case 10:case 13:case 32:R+=L$e(m);break;case 92:R+=B$e(r8()-1,7);continue;case 47:switch(e1()){case 42:case 47:Uv(W$e(F$e(yl(),r8()),e,n,c),c);break;default:R+="/"}break;case 123*y:a[l++]=gu(R)*b;case 125*y:case 59:case 0:switch(C){case 0:case 125:v=0;case 59+u:b==-1&&(R=Mn(R,/\f/g,"")),f>0&&gu(R)-d&&Uv(f>32?GV(R+";",r,n,d-1,c):GV(Mn(R," ","")+";",r,n,d-2,c),c);break;case 59:R+=";";default:if(Uv(I=KV(R,e,n,l,u,i,a,x,_=[],$=[],d,s),s),C===123)if(u===0)i8(R,e,I,I,_,s,d,a,$);else switch(h===99&&cs(R,3)===110?100:h){case 100:case 108:case 109:case 115:i8(t,I,I,r&&Uv(KV(t,I,I,0,0,i,a,x,i,_=[],d,$),$),i,$,d,a,r?_:$);break;default:i8(R,I,I,I,[""],$,0,a,$)}}l=u=f=0,y=b=1,x=R="",d=o;break;case 58:d=1+gu(R),f=m;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&j$e()==125)continue}switch(R+=ZD(C),C*y){case 38:b=u>0?1:(R+="\f",-1);break;case 44:a[l++]=(gu(R)-1)*b,b=1;break;case 64:e1()===45&&(R+=s$(yl())),h=e1(),u=d=gu(x=R+=U$e(r8())),C++;break;case 45:m===45&&gu(R)==2&&(y=0)}}return s}function KV(t,e,n,r,i,s,o,a,c,l,u,d){for(var h=i-1,f=i===0?s:[""],m=vce(f),y=0,v=0,b=0;y<r;++y)for(var C=0,x=Xy(t,h+1,h=yce(v=o[y])),_=t;C<m;++C)(_=wce(v>0?f[C]+" "+x:Mn(x,/&\f/g,f[C])))&&(c[b++]=_);return PC(t,e,n,i===0?IC:a,c,l,u,d)}function W$e(t,e,n,r){return PC(t,e,n,gce,ZD(O$e()),Xy(t,2,-2),0,r)}function GV(t,e,n,r,i){return PC(t,e,n,GD,Xy(t,0,r),Xy(t,r+1,-1),r,i)}function xce(t,e,n){switch(R$e(t,e)){case 5103:return or+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return or+t+t;case 4789:return ab+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return or+t+ab+t+Dr+t+t;case 5936:switch(cs(t,e+11)){case 114:return or+t+Dr+Mn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;
vendor: 16,328 bytes, lines 109-110
109case 108:return or+t+Dr+Mn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return or+t+Dr+Mn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return or+t+Dr+t+t;case 6165:return or+t+Dr+"flex-"+t+t;case 5187:return or+t+Mn(t,/(\w+).+(:[^]+)/,or+"box-$1$2"+Dr+"flex-$1$2")+t;case 5443:return or+t+Dr+"flex-item-"+Mn(t,/flex-|-self/g,"")+(yd(t,/flex-|baseline/)?"":Dr+"grid-row-"+Mn(t,/flex-|-self/g,""))+t;case 4675:return or+t+Dr+"flex-line-pack"+Mn(t,/align-content|flex-|-self/g,"")+t;case 5548:return or+t+Dr+Mn(t,"shrink","negative")+t;case 5292:return or+t+Dr+Mn(t,"basis","preferred-size")+t;case 6060:return or+"box-"+Mn(t,"-grow","")+or+t+Dr+Mn(t,"grow","positive")+t;case 4554:return or+Mn(t,/([^-])(transform)/g,"$1"+or+"$2")+t;case 6187:return Mn(Mn(Mn(t,/(zoom-|grab)/,or+"$1"),/(image-set)/,or+"$1"),t,"")+t;case 5495:case 3959:return Mn(t,/(image-set\([^]*)/,or+"$1$`$1");case 4968:return Mn(Mn(t,/(.+:)(flex-)?(.*)/,or+"box-pack:$3"+Dr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+or+t+t;case 4200:if(!yd(t,/flex-|baseline/))return Dr+"grid-column-align"+Xy(t,e)+t;break;case 2592:case 3360:return Dr+Mn(t,"template-","")+t;case 4384:case 3616:return n&&n.some(function(r,i){return e=i,yd(r.props,/grid-\w+-end/)})?~n8(t+(n=n[e].value),"span",0)?t:Dr+Mn(t,"-start","")+t+Dr+"grid-row-span:"+(~n8(n,"span",0)?yd(n,/\d+/):+yd(n,/\d+/)-+yd(t,/\d+/))+";":Dr+Mn(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(r){return yd(r.props,/grid-\w+-start/)})?t:Dr+Mn(Mn(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Mn(t,/(.+)-inline(.+)/,or+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(gu(t)-1-e>6)switch(cs(t,e+1)){case 109:if(cs(t,e+4)!==45)break;case 102:return Mn(t,/(.+:)(.+)-([^]+)/,"$1"+or+"$2-$3$1"+ab+(cs(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~n8(t,"stretch",0)?xce(Mn(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return Mn(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,s,o,a,c,l){return Dr+i+":"+s+l+(o?Dr+i+"-span:"+(a?c:+c-+s)+l:"")+t});case 4949:if(cs(t,e+6)===121)return Mn(t,":",":"+or)+t;break;case 6444:switch(cs(t,cs(t,14)===45?18:11)){case 120:return Mn(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+or+(cs(t,14)===45?"inline-":"")+"box$3$1"+or+"$2$3$1"+Dr+"$2box$3")+t;case 100:return Mn(t,":",":"+Dr)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Mn(t,"scroll-","scroll-snap-")+t}return t}function X7(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function H$e(t,e,n,r){switch(t.type){case P$e:if(t.children.length)break;case T$e:case GD:return t.return=t.return||t.value;case gce:return"";case mce:return t.return=t.value+"{"+X7(t.children,r)+"}";case IC:if(!gu(t.value=t.props.join(",")))return""}return gu(n=X7(t.children,r))?t.return=t.value+"{"+n+"}":""}function V$e(t){var e=vce(t);return function(n,r,i,s){for(var o="",a=0;a<e;a++)o+=t[a](n,r,i,s)||"";return o}}function q$e(t){return function(e){e.root||(e=e.return)&&t(e)}}function K$e(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case GD:t.return=xce(t.value,t.length,n);return;case mce:return X7([pf(t,{value:Mn(t.value,"@","@"+or)})],r);case IC:if(t.length)return M$e(n=t.props,function(i){switch(yd(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Wg(pf(t,{props:[Mn(i,/:(read-\w+)/,":"+ab+"$1")]})),Wg(pf(t,{props:[i]})),eM(t,{props:qV(n,r)});break;case"::placeholder":Wg(pf(t,{props:[Mn(i,/:(plac\w+)/,":"+or+"input-$1")]})),Wg(pf(t,{props:[Mn(i,/:(plac\w+)/,":"+ab+"$1")]})),Wg(pf(t,{props:[Mn(i,/:(plac\w+)/,Dr+"input-$1")]})),Wg(pf(t,{props:[i]})),eM(t,{props:qV(n,r)});break}return""})}}var G$e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},$a={},e2=typeof process<"u"&&$a!==void 0&&($a.REACT_APP_SC_ATTR||$a.SC_ATTR)||"data-styled",Ece="active",Cce="data-styled-version",MC="6.1.19",YD=`/*!sc*/ 110`,J7=typeof window<"u"&&typeof document<"u",Z$e=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&$a!==void 0&&$a.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&$a.REACT_APP_SC_DISABLE_SPEEDY!==""?$a.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&$a.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&$a!==void 0&&$a.SC_DISABLE_SPEEDY!==void 0&&$a.SC_DISABLE_SPEEDY!==""&&$a.SC_DISABLE_SPEEDY!=="false"&&$a.SC_DISABLE_SPEEDY),Y$e={},OC=Object.freeze([]),t2=Object.freeze({});function _ce(t,e,n){return n===void 0&&(n=t2),t.theme!==n.theme&&t.theme||e||n.theme}var Sce=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Q$e=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,X$e=/(^-|-$)/g;function ZV(t){return t.replace(Q$e,"-").replace(X$e,"")}var J$e=/(a)(d)/gi,L4=52,YV=function(t){return String.fromCharCode(t+(t>25?39:97))};function rM(t){var e,n="";for(e=Math.abs(t);e>L4;e=e/L4|0)n=YV(e%L4)+n;return(YV(e%L4)+n).replace(J$e,"$1-$2")}var o$,Ace=5381,$m=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},kce=function(t){return $m(Ace,t)};function QD(t){return rM(kce(t)>>>0)}function eIe(t){return t.displayName||t.name||"Component"}function a$(t){return typeof t=="string"&&!0}var $ce=typeof Symbol=="function"&&Symbol.for,Ice=$ce?Symbol.for("react.memo"):60115,tIe=$ce?Symbol.for("react.forward_ref"):60112,nIe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},rIe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Tce={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},iIe=((o$={})[tIe]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o$[Ice]=Tce,o$);function QV(t){return("type"in(e=t)&&e.type.$$typeof)===Ice?Tce:"$$typeof"in t?iIe[t.$$typeof]:nIe;var e}var sIe=Object.defineProperty,oIe=Object.getOwnPropertyNames,XV=Object.getOwnPropertySymbols,aIe=Object.getOwnPropertyDescriptor,cIe=Object.getPrototypeOf,JV=Object.prototype;function Pce(t,e,n){if(typeof e!="string"){if(JV){var r=cIe(e);r&&r!==JV&&Pce(t,r,n)}var i=oIe(e);XV&&(i=i.concat(XV(e)));for(var s=QV(t),o=QV(e),a=0;a<i.length;++a){var c=i[a];if(!(c in rIe||n&&n[c]||o&&c in o||s&&c in s)){var l=aIe(e,c);try{sIe(t,c,l)}catch{}}}}return t}function n2(t){return typeof t=="function"}function XD(t){return typeof t=="object"&&"styledComponentId"in t}function y0(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function e9(t,e){if(t.length===0)return"";for(var n=t[0],r=1;r<t.length;r++)n+=t[r];return n}function Xb(t){return t!==null&&typeof t=="object"&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function iM(t,e,n){if(n===void 0&&(n=!1),!n&&!Xb(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)t[r]=iM(t[r],e[r]);else if(Xb(e))for(var r in e)t[r]=iM(t[r],e[r]);return t}function JD(t,e){Object.defineProperty(t,"toString",{value:e})}function x5(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var lIe=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var n=0,r=0;r<e;r++)n+=this.groupSizes[r];return n},t.prototype.insertRules=function(e,n){if(e>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,s=i;e>=s;)if((s<<=1)<0)throw x5(16,"".concat(e));this.groupSizes=new Uint32Array(s),this.groupSizes.set(r),this.length=s;for(var o=i;o<s;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),c=(o=0,n.length);o<c;o++)this.tag.insertRule(a,n[o])&&(this.groupSizes[e]++,a++)},t.prototype.clearGroup=function(e){if(e<this.length){var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n;this.groupSizes[e]=0;for(var s=r;s<i;s++)this.tag.deleteRule(r)}},t.prototype.getGroup=function(e){var n="";if(e>=this.length||this.groupSizes[e]===0)return n;for(var r=this.groupSizes[e],i=this.indexOfGroup(e),s=i+r,o=i;o<s;o++)n+="".concat(this.tag.getRule(o)).concat(YD);return n},t}(),s8=new Map,t9=new Map,o8=1,B4=function(t){if(s8.has(t))return s8.get(t);for(;t9.has(o8);)o8++;var e=o8++;return s8.set(t,e),t9.set(e,t),e},uIe=function(t,e){o8=e+1,s8.set(t,e),t9.set(e,t)},dIe="style[".concat(e2,"][").concat(Cce,'="').concat(MC,'"]'),hIe=new RegExp("^".concat(e2,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),fIe=function(t,e,n){for(var r,i=n.split(","),s=0,o=i.length;s<o;s++)(r=i[s])&&t.registerName(e,r)},pIe=function(t,e){for(var n,r=((n=e.textContent)!==null&&n!==void 0?n:"").split(YD),i=[],s=0,o=r.length;s<o;s++){var a=r[s].trim();if(a){var c=a.match(hIe);if(c){var l=0|parseInt(c[1],10),u=c[2];l!==0&&(uIe(u,l),fIe(t,u,c[3]),t.getTag().insertRules(l,i)),i.length=0}else i.push(a)}}},eq=function(t){for(var e=document.querySelectorAll(dIe),n=0,r=e.length;n<r;n++){var i=e[n];i&&i.getAttribute(e2)!==Ece&&(pIe(t,i),i.parentNode&&i.parentNode.removeChild(i))}};function gIe(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Rce=function(t){var e=document.head,n=t||e,r=document.createElement("style"),i=function(a){var c=Array.from(a.querySelectorAll("style[".concat(e2,"]")));return c[c.length-1]}(n),s=i!==void 0?i.nextSibling:null;r.setAttribute(e2,Ece),r.setAttribute(Cce,MC);var o=gIe();return o&&r.setAttribute("nonce",o),n.insertBefore(r,s),r},mIe=function(){function t(e){this.element=Rce(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(n){if(n.sheet)return n.sheet;for(var r=document.styleSheets,i=0,s=r.length;i<s;i++){var o=r[i];if(o.ownerNode===n)return o}throw x5(17)}(this.element),this.length=0}return t.prototype.insertRule=function(e,n){try{return this.sheet.insertRule(n,e),this.length++,!0}catch{return!1}},t.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.prototype.getRule=function(e){var n=this.sheet.cssRules[e];return n&&n.cssText?n.cssText:""},t}(),yIe=function(){function t(e){this.element=Rce(e),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(e,n){if(e<=this.length&&e>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},t}(),wIe=function(){function t(e){this.rules=[],this.length=0}return t.prototype.insertRule=function(e,n){return e<=this.length&&(this.rules.splice(e,0,n),this.length++,!0)},t.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},t}(),tq=J7,vIe={isServer:!J7,useCSSOMInjection:!Z$e},n9=function(){function t(e,n,r){e===void 0&&(e=t2),n===void 0&&(n={});var i=this;this.options=fo(fo({},vIe),e),this.gs=n,this.names=new Map(r),this.server=!!e.isServer,!this.server&&J7&&tq&&(tq=!1,eq(this)),JD(this,function(){return function(s){for(var o=s.getTag(),a=o.length,c="",l=function(d){var h=function(b){return t9.get(b)}(d);if(h===void 0)return"continue";var f=s.names.get(h),m=o.getGroup(d);if(f===void 0||!f.size||m.length===0)return"continue";var y="".concat(e2,".g").concat(d,'[id="').concat(h,'"]'),v="";f!==void 0&&f.forEach(function(b){b.length>0&&(v+="".concat(b,","))}),c+="".concat(m).concat(y,'{content:"').concat(v,'"}').concat(YD)},u=0;u<a;u++)l(u);return c}(i)})}return t.registerId=function(e){return B4(e)},t.prototype.rehydrate=function(){!this.server&&J7&&eq(this)},t.prototype.reconstructWithOptions=function(e,n){return n===void 0&&(n=!0),new t(fo(fo({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(e=function(n){var r=n.useCSSOMInjection,i=n.target;return n.isServer?new wIe(i):r?new mIe(i):new yIe(i)}(this.options),new lIe(e)));var e},t.prototype.hasNameForId=function(e,n){return this.names.has(e)&&this.names.get(e).has(n)},t.prototype.registerName=function(e,n){if(B4(e),this.names.has(e))this.names.get(e).add(n);else{var r=new Set;r.add(n),this.names.set(e,r)}},t.prototype.insertRules=function(e,n,r){this.registerName(e,n),this.getTag().insertRules(B4(e),r)},t.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.prototype.clearRules=function(e){this.getTag().clearGroup(B4(e)),this.clearNames(e)},t.prototype.clearTag=function(){this.tag=void 0},t}(),bIe=/&/g,xIe=/^\s*\/\/.*$/gm;function Mce(t,e){return t.map(function(n){return n.type==="rule"&&(n.value="".concat(e," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(e," ")),n.props=n.props.map(function(r){return"".concat(e," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=Mce(n.children,e)),n})}function EIe(t){var e,n,r,i=t2,s=i.options,o=s===void 0?t2:s,a=i.plugins,c=a===void 0?OC:a,l=function(h,f,m){return m.startsWith(n)&&m.endsWith(n)&&m.replaceAll(n,"").length>0?".".concat(e):h},u=c.slice();u.push(function(h){h.type===IC&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(bIe,n).replace(r,l))}),o.prefix&&u.push(K$e),u.push(H$e);var d=function(h,f,m,y){f===void 0&&(f=""),m===void 0&&(m=""),y===void 0&&(y="&"),e=y,n=f,r=new RegExp("\\".concat(n,"\\b"),"g");var v=h.replace(xIe,""),b=z$e(m||f?"".concat(m," ").concat(f," { ").concat(v," }"):v);o.namespace&&(b=Mce(b,o.namespace));var C=[];return X7(b,V$e(u.concat(q$e(function(x){return C.push(x)})))),C};return d.hash=c.length?c.reduce(function(h,f){return f.name||x5(15),$m(h,f.name)},Ace).toString():"",d}var CIe=new n9,sM=EIe(),Oce=Rt.createContext({shouldForwardProp:void 0,styleSheet:CIe,stylis:sM});Oce.Consumer;Rt.createContext(void 0);function oM(){return E.useContext(Oce)}var jce=function(){function t(e,n){var r=this;this.inject=function(i,s){s===void 0&&(s=sM);var o=r.name+s.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,s(r.rules,o,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=n,JD(this,function(){throw x5(12,String(r.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=sM),this.name+e.hash},t}(),_Ie=function(t){return t>="A"&&t<="Z"};function nq(t){for(var e="",n=0;n<t.length;n++){var r=t[n];if(n===1&&r==="-"&&t[0]==="-")return t;_Ie(r)?e+="-"+r.toLowerCase():e+=r}return e.startsWith("ms-")?"-"+e:e}var Nce=function(t){return t==null||t===!1||t===""},Dce=function(t){var e,n,r=[];for(var i in t){var s=t[i];t.hasOwnProperty(i)&&!Nce(s)&&(Array.isArray(s)&&s.isCss||n2(s)?r.push("".concat(nq(i),":"),s,";
110"):Xb(s)?r.push.apply(r,Qy(Qy(["".concat(i," {")],Dce(s),!1),["}"],!1)):r.push("".concat(nq(i),": ").concat((e=i,(n=s)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||e in G$e||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function ep(t,e,n,r){if(Nce(t))return[];if(XD(t))return[".".concat(t.styledComponentId)];if(n2(t)){if(!n2(s=t)||s.prototype&&s.prototype.isReactComponent||!e)return[t];var i=t(e);return ep(i,e,n,r)}var s;return t instanceof jce?n?(t.inject(n,r),[t.getName(r)]):[t]:Xb(t)?Dce(t):Array.isArray(t)?Array.prototype.concat.apply(OC,t.map(function(o){return ep(o,e,n,r)})):[t.toString()]}function Lce(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(n2(n)&&!XD(n))return!1}return!0}var SIe=kce(MC),AIe=function(){function t(e,n,r){this.rules=e,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&Lce(e),this.componentId=n,this.baseHash=$m(SIe,n),this.baseStyle=r,n9.registerId(n)}return t.prototype.generateAndInjectStyles=function(e,n,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,n,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))i=y0(i,this.staticRulesId);else{var s=e9(ep(this.rules,e,n,r)),o=rM($m(this.baseHash,s)>>>0);if(!n.hasNameForId(this.componentId,o)){var a=r(s,".".concat(o),void 0,this.componentId);n.insertRules(this.componentId,o,a)}i=y0(i,o),this.staticRulesId=o}else{for(var c=$m(this.baseHash,r.hash),l="",u=0;u<this.rules.length;u++){var d=this.rules[u];if(typeof d=="string")l+=d;else if(d){var h=e9(ep(d,e,n,r));c=$m(c,h+u),l+=h}}if(l){var f=rM(c>>>0);n.hasNameForId(this.componentId,f)||n.insertRules(this.componentId,f,r(l,".".concat(f),void 0,this.componentId)),i=y0(i,f)}}return i},t}(),eL=Rt.createContext(void 0);eL.Consumer;var c$={};function kIe(t,e,n){var r=XD(t),i=t,s=!a$(t),o=e.attrs,a=o===void 0?OC:o,c=e.componentId,l=c===void 0?function(_,$){var I=typeof _!="string"?"sc":ZV(_);c$[I]=(c$[I]||0)+1;var R="".concat(I,"-").concat(QD(MC+I+c$[I]));return $?"".concat($,"-").concat(R):R}(e.displayName,e.parentComponentId):c,u=e.displayName,d=u===void 0?function(_){return a$(_)?"styled.".concat(_):"Styled(".concat(eIe(_),")")}(t):u,h=e.displayName&&e.componentId?"".concat(ZV(e.displayName),"-").concat(e.componentId):e.componentId||l,f=r&&i.attrs?i.attrs.concat(a).filter(Boolean):a,m=e.shouldForwardProp;if(r&&i.shouldForwardProp){var y=i.shouldForwardProp;if(e.shouldForwardProp){var v=e.shouldForwardProp;m=function(_,$){return y(_,$)&&v(_,$)}}else m=y}var b=new AIe(n,h,r?i.componentStyle:void 0);function C(_,$){return function(I,R,N){var T=I.attrs,O=I.componentStyle,U=I.defaultProps,z=I.foldedComponentIds,L=I.styledComponentId,S=I.target,k=Rt.useContext(eL),M=oM(),W=I.shouldForwardProp||M.shouldForwardProp,H=_ce(R,k,U)||t2,D=function(Y,te,ae){for(var oe,de=fo(fo({},te),{className:void 0,theme:ae}),ke=0;ke<Y.length;ke+=1){var Be=n2(oe=Y[ke])?oe(de):oe;for(var $e in Be)de[$e]=$e==="className"?y0(de[$e],Be[$e]):$e==="style"?fo(fo({},de[$e]),Be[$e]):Be[$e]}return te.className&&(de.className=y0(de.className,te.className)),de}(T,R,H),V=D.as||S,B={};for(var P in D)D[P]===void 0||P[0]==="$"||P==="as"||P==="theme"&&D.theme===H||(P==="forwardedAs"?B.as=D.forwardedAs:W&&!W(P,V)||(B[P]=D[P]));var j=function(Y,te){var ae=oM(),oe=Y.generateAndInjectStyles(te,ae.styleSheet,ae.stylis);return oe}(O,D),G=y0(z,L);return j&&(G+=" "+j),D.className&&(G+=" "+D.className),B[a$(V)&&!Sce.has(V)?"class":"className"]=G,N&&(B.ref=N),E.createElement(V,B)}(x,_,$)}C.displayName=d;var x=Rt.forwardRef(C);
vendor: 1,704 bytes, line 110
110return x.attrs=f,x.componentStyle=b,x.displayName=d,x.shouldForwardProp=m,x.foldedComponentIds=r?y0(i.foldedComponentIds,i.styledComponentId):"",x.styledComponentId=h,x.target=r?i.target:t,Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(_){this._foldedDefaultProps=r?function($){for(var I=[],R=1;R<arguments.length;R++)I[R-1]=arguments[R];for(var N=0,T=I;N<T.length;N++)iM($,T[N],!0);return $}({},i.defaultProps,_):_}}),JD(x,function(){return".".concat(x.styledComponentId)}),s&&Pce(x,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),x}function rq(t,e){for(var n=[t[0]],r=0,i=e.length;r<i;r+=1)n.push(e[r],t[r+1]);return n}var iq=function(t){return Object.assign(t,{isCss:!0})};function gs(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(n2(t)||Xb(t))return iq(ep(rq(OC,Qy([t],e,!0))));var r=t;return e.length===0&&r.length===1&&typeof r[0]=="string"?ep(r):iq(ep(rq(r,e)))}function aM(t,e,n){if(n===void 0&&(n=t2),!e)throw x5(1,e);var r=function(i){for(var s=[],o=1;o<arguments.length;o++)s[o-1]=arguments[o];return t(e,n,gs.apply(void 0,Qy([i],s,!1)))};return r.attrs=function(i){return aM(t,e,fo(fo({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return aM(t,e,fo(fo({},n),i))},r}var Bce=function(t){return aM(kIe,t)},ue=Bce;Sce.forEach(function(t){ue[t]=Bce(t)});var $Ie=function(){function t(e,n){this.rules=e,this.componentId=n,this.isStatic=Lce(e),n9.registerId(this.componentId+1)}return t.prototype.createStyles=function(e,n,r,i){var s=i(e9(ep(this.rules,n,r,i)),""),o=this.componentId+e;r.insertRules(o,o,s)}
110,t.prototype.removeStyles=function(e,n){n.clearRules(this.componentId+e)},t.prototype.renderStyles=function(e,n,r,i){e>2&&n9.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,n,r,i)},t}();function IIe(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=gs.apply(void 0,Qy([t],e,!1)),i="sc-global-".concat(QD(JSON.stringify(r))),s=new $Ie(r,i),o=function(c){var l=oM(),u=Rt.useContext(eL),d=Rt.useRef(l.styleSheet.allocateGSInstance(i)).current;return l.styleSheet.server&&a(d,c,l.styleSheet,u,l.stylis),Rt.useLayoutEffect(function(){if(!l.styleSheet.server)return a(d,c,l.styleSheet,u,l.stylis),function(){return s.removeStyles(d,l.styleSheet)}},[d,c,l.styleSheet,u,l.stylis]),null};function a(c,l,u,d,h){if(s.isStatic)s.renderStyles(c,Y$e,u,h);else{var f=fo(fo({},l),{theme:_ce(l,d,o.defaultProps)});s.renderStyles(c,f,u,h)}}return Rt.memo(o)}function Fce(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e9(gs.apply(void 0,Qy([t],e,!1))),i=QD(r);return new jce(i,r)}function r9(t){"@babel/helpers - typeof";return r9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r9(t)}var TIe=/^\s+/,PIe=/\s+$/;function en(t,e){if(t=t||"",e=e||{},t instanceof en)return t;if(!(this instanceof en))return new en(t,e);var n=RIe(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}en.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),n,r,i,s,o,a;return n=e.r/255,r=e.g/255,i=e.b/255,n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*o+.0722*a},setAlpha:function(e){return this._a=Uce(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=oq(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=oq(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+i+"%)":"hsva("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=sq(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=sq(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+i+"%)":"hsla("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return aq(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return NIe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Zr(this._r,255)*100)+"%",g:Math.round(Zr(this._g,255)*100)+"%",b:Math.round(Zr(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Zr(this._r,255)*100)+"%, "+Math.round(Zr(this._g,255)*100)+"%, "+Math.round(Zr(this._b,255)*100)+"%)":"rgba("+Math.round(Zr(this._r,255)*100)+"%, "+Math.round(Zr(this._g,255)*100)+"%, "+Math.round(Zr(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:GIe[aq(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var n="#"+cq(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?"GradientType = 1, ":"";if(e){var s=en(e);r="#"+cq(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+n+",endColorstr="+r+")"},toString:function(e){var n=!!e;e=e||this._format;var r=!1,i=this._a<1&&this._a>=0,s=!n&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return s?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return en(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(FIe,arguments)},brighten:function(){return this._applyModification(UIe,arguments)},darken:function(){return this._applyModification(zIe,arguments)},desaturate:function(){return this._applyModification(DIe,arguments)},saturate:function(){return this._applyModification(LIe,arguments)}
vendor: 5,421 bytes, line 110
110,greyscale:function(){return this._applyModification(BIe,arguments)},spin:function(){return this._applyModification(WIe,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(qIe,arguments)},complement:function(){return this._applyCombination(HIe,arguments)},monochromatic:function(){return this._applyCombination(KIe,arguments)},splitcomplement:function(){return this._applyCombination(VIe,arguments)},triad:function(){return this._applyCombination(lq,[3])},tetrad:function(){return this._applyCombination(lq,[4])}};en.fromRatio=function(t,e){if(r9(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=zv(t[r]));t=n}return en(t,e)};function RIe(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,s=null,o=!1,a=!1;return typeof t=="string"&&(t=XIe(t)),r9(t)=="object"&&(rd(t.r)&&rd(t.g)&&rd(t.b)?(e=MIe(t.r,t.g,t.b),o=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):rd(t.h)&&rd(t.s)&&rd(t.v)?(r=zv(t.s),i=zv(t.v),e=jIe(t.h,r,i),o=!0,a="hsv"):rd(t.h)&&rd(t.s)&&rd(t.l)&&(r=zv(t.s),s=zv(t.l),e=OIe(t.h,r,s),o=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=Uce(n),{ok:o,format:t.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function MIe(t,e,n){return{r:Zr(t,255)*255,g:Zr(e,255)*255,b:Zr(n,255)*255}}function sq(t,e,n){t=Zr(t,255),e=Zr(e,255),n=Zr(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),s,o,a=(r+i)/2;if(r==i)s=o=0;else{var c=r-i;switch(o=a>.5?c/(2-r-i):c/(r+i),r){case t:s=(e-n)/c+(e<n?6:0);break;case e:s=(n-t)/c+2;break;case n:s=(t-e)/c+4;break}s/=6}return{h:s,s:o,l:a}}function OIe(t,e,n){var r,i,s;t=Zr(t,360),e=Zr(e,100),n=Zr(n,100);function o(l,u,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?l+(u-l)*6*d:d<1/2?u:d<2/3?l+(u-l)*(2/3-d)*6:l}if(e===0)r=i=s=n;else{var a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;r=o(c,a,t+1/3),i=o(c,a,t),s=o(c,a,t-1/3)}return{r:r*255,g:i*255,b:s*255}}function oq(t,e,n){t=Zr(t,255),e=Zr(e,255),n=Zr(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),s,o,a=r,c=r-i;if(o=r===0?0:c/r,r==i)s=0;else{switch(r){case t:s=(e-n)/c+(e<n?6:0);break;case e:s=(n-t)/c+2;break;case n:s=(t-e)/c+4;break}s/=6}return{h:s,s:o,v:a}}function jIe(t,e,n){t=Zr(t,360)*6,e=Zr(e,100),n=Zr(n,100);var r=Math.floor(t),i=t-r,s=n*(1-e),o=n*(1-i*e),a=n*(1-(1-i)*e),c=r%6,l=[n,o,s,s,a,n][c],u=[a,n,n,o,s,s][c],d=[s,s,a,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function aq(t,e,n,r){var i=[fl(Math.round(t).toString(16)),fl(Math.round(e).toString(16)),fl(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function NIe(t,e,n,r,i){var s=[fl(Math.round(t).toString(16)),fl(Math.round(e).toString(16)),fl(Math.round(n).toString(16)),fl(zce(r))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function cq(t,e,n,r){var i=[fl(zce(r)),fl(Math.round(t).toString(16)),fl(Math.round(e).toString(16)),fl(Math.round(n).toString(16))];return i.join("")}en.equals=function(t,e){return!t||!e?!1:en(t).toRgbString()==en(e).toRgbString()};en.random=function(){return en.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function DIe(t,e){e=e===0?0:e||10;var n=en(t).toHsl();return n.s-=e/100,n.s=jC(n.s),en(n)}function LIe(t,e){e=e===0?0:e||10;var n=en(t).toHsl();return n.s+=e/100,n.s=jC(n.s),en(n)}function BIe(t){return en(t).desaturate(100)}function FIe(t,e){e=e===0?0:e||10;var n=en(t).toHsl();return n.l+=e/100,n.l=jC(n.l),en(n)}function UIe(t,e){e=e===0?0:e||10;var n=en(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),en(n)}function zIe(t,e){e=e===0?0:e||10;var n=en(t).toHsl();return n.l-=e/100,n.l=jC(n.l),en(n)}function WIe(t,e){var n=en(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,en(n)}function HIe(t){var e=en(t).toHsl();return e.h=(e.h+180)%360,en(e)}function lq(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=en(t).toHsl(),r=[en(t)],i=360/e,s=1;s<e;s++)r.push(en({h:(n.h+s*i)%360,s:n.s,l:n.l}));return r}function VIe(t){var e=en(t).toHsl(),n=e.h;return[en(t),en({h:(n+72)%360,s:e.s,l:e.l}),en({h:(n+216)%360,s:e.s,l:e.l})]}function qIe(t,e,n){e=e||6,n=n||30;var r=en(t).toHsl(),i=360/n,s=[en(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,s.push(en(r));return s}function KIe(t,e){e=e||6;for(var n=en(t).toHsv(),r=n.h,i=n.s,s=n.v,o=[],a=1/e;e--;)o.push(en({h:r,s:i,v:s})),s=(s+a)%1;return o}en.mix=function(t,e,n){n=n===0?0:n||50;var r=en(t).toRgb(),i=en(e).toRgb(),s=n/100,o={r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a};return en(o)};en.readability=function(t,e){var n=en(t),r=en(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};en.isReadable=function(t,e,n){var r=en.readability(t,e),i,s;switch(s=!1,i=JIe(n),i.level+i.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s};en.mostReadable=function(t,e,n){var r=null,i=0,s,o,a,c;n=n||{},o=n.includeFallbackColors,a=n.level,c=n.size;
110for(var l=0;l<e.length;l++)s=en.readability(t,e[l]),s>i&&(i=s,r=en(e[l]));return en.isReadable(t,r,{level:a,size:c})||!o?r:(n.includeFallbackColors=!1,en.mostReadable(t,["#fff","#000"],n))};var cM=en.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
1100",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},GIe=en.hexNames=ZIe(cM);function ZIe(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function Uce(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Zr(t,e){YIe(t)&&(t="100%");var n=QIe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function jC(t){return Math.min(1,Math.max(0,t))}function Aa(t){return parseInt(t,16)}function YIe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function QIe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function fl(t){return t.length==1?"0"+t:""+t}function zv(t){return t<=1&&(t=t*100+"%"),t}function zce(t){return Math.round(parseFloat(t)*255).toString(16)}function uq(t){return Aa(t)/255}var Zc=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"
110+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function rd(t){return!!Zc.CSS_UNIT.exec(t)}function XIe(t){t=t.replace(TIe,"").replace(PIe,"").toLowerCase();var e=!1;if(cM[t])t=cM[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Zc.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=Zc.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Zc.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=Zc.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Zc.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=Zc.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Zc.hex8.exec(t))?{r:Aa(n[1]),g:Aa(n[2]),b:Aa(n[3]),a:uq(n[4]),format:e?"name":"hex8"}:(n=Zc.hex6.exec(t))?{r:Aa(n[1]),g:Aa(n[2]),b:Aa(n[3]),format:e?"name":"hex"}:(n=Zc.hex4.exec(t))?{r:Aa(n[1]+""+n[1]),g:Aa(n[2]+""+n[2]),b:Aa(n[3]+""+n[3]),a:uq(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=Zc.hex3.exec(t))?{r:Aa(n[1]+""+n[1]),g:Aa(n[2]+""+n[2]),b:Aa(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function JIe(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}function eTe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const tTe=E.forwardRef(eTe);function nTe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const Wce=E.forwardRef(nTe);function rTe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const t1=E.forwardRef(rTe);function iTe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const sTe=E.forwardRef(iTe);function oTe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const aTe=E.forwardRef(oTe);function cTe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"}))}const Hce=E.forwardRef(cTe);function lTe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"}))}const E5=E.forwardRef(lTe),dq=t=>{let e;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(e):l;if(!Object.is(d,e)){const h=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({}
vendor: 7,058 bytes, line 110
110,e,d),n.forEach(f=>f(e,h))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=e=t(r,i,a);return a},Vce=t=>t?dq(t):dq,uTe=t=>t;function dTe(t,e=uTe){const n=Rt.useSyncExternalStore(t.subscribe,Rt.useCallback(()=>e(t.getState()),[t,e]),Rt.useCallback(()=>e(t.getInitialState()),[t,e]));return Rt.useDebugValue(n),n}const hq=t=>{const e=Vce(t),n=r=>dTe(e,r);return Object.assign(n,e),n},C5=t=>t?hq(t):hq;function fq(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),i=0;i<3;i++){var s=Number(n[i]),o=Number(r[i]);if(s>o)return 1;if(o>s)return-1;if(!isNaN(s)&&isNaN(o))return 1;if(isNaN(s)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var hTe={}.constructor;function n1(t){return t!=null&&t.constructor===hTe}function lM(t){"@babel/helpers - typeof";return lM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lM(t)}function NC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fTe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function DC(t,e,n){return e&&fTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var pTe="1.2.0",gTe="1.7.35",pq=" ext. ",mTe=/^\d+$/,ms=function(){function t(e){NC(this,t),qce(e),this.metadata=e,Kce.call(this,e)}return DC(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var r=this.countryCallingCodes()[n];if(r&&r.length===1&&r[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,r){if(n&&mTe.test(n)&&(r=n,n=null),n&&n!=="001"){if(!this.hasCountry(n))throw new Error("Unknown country: ".concat(n));this.numberingPlan=new gq(this.getCountryMetadata(n),this)}else if(r){if(!this.hasCallingCode(r))throw new Error("Unknown calling code: ".concat(r));this.numberingPlan=new gq(this.getNumberingPlanMetadata(r),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var r=this.countryCallingCodes()[n];if(r)return r.length===1&&r[0].length===3?void 0:r}},{key:"getCountryCodeForCallingCode",value:function(n){var r=this.getCountryCodesForCallingCode(n);if(r)return r[0]}},{key:"getNumberingPlanMetadata",value:function(n){var r=this.getCountryCodeForCallingCode(n);if(r)return this.getCountryMetadata(r);if(this.nonGeographic()){var i=this.nonGeographic()[n];if(i)return i}else{var s=this.countryCallingCodes()[n];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}]),t}(),gq=function(){function t(e,n){NC(this,t),this.globalMetadataObject=n,this.metadata=e,Kce.call(this,n.metadata)}return DC(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,r=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return r.map(function(i){return new yTe(i,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}}
vendor: 1,355 bytes, line 110
110,{key:"type",value:function(n){if(this.hasTypes()&&mq(this.types(),n))return new vTe(mq(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?pq:this.metadata[13]||pq}}]),t}(),yTe=function(){function t(e,n){NC(this,t),this._format=e,this.metadata=n}return DC(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!wTe.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),t}(),wTe=/^\(?\$1\)?$/,vTe=function(){function t(e,n){NC(this,t),this.type=e,this.metadata=n}return DC(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.t
vendor: 4,460 bytes, lines 110-111
110ype[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),t}();function mq(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function qce(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!n1(t)||!n1(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(n1(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+bTe(t)+": "+t,"."))}var bTe=function(e){return lM(e)};function LC(t,e){if(e=new ms(e),e.hasCountry(t))return e.country(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function xTe(t,e){return e.countries.hasOwnProperty(t)}function Kce(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?fq(e,pTe)===-1?this.v2=!0:fq(e,gTe)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function BC(t,e){return ETe(t,void 0,e)}function ETe(t,e,n){var r=n.type(e),i=r&&r.possibleLengths()||n.possibleLengths();if(!i)return"IS_POSSIBLE";var s=t.length,o=i[0];return o===s?"IS_POSSIBLE":o>s?"TOO_SHORT":i[i.length-1]<s?"TOO_LONG":i.indexOf(s,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function CTe(t,e,n){if(e===void 0&&(e={}),n=new ms(n),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}}if(n.possibleLengths())return Gce(t.phone||t.nationalNumber,n);if(t.countryCallingCode&&n.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function Gce(t,e){switch(BC(t,e)){case"IS_POSSIBLE":return!0;default:return!1}}function Jd(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function _Te(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=STe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 111In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function STe(t,e){if(t){if(typeof t=="string")return yq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yq(t,e)}}function yq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ATe=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function tL(t,e,n){if(e=e||{},!(!t.country&&!t.countryCallingCode)){n=new ms(n),n.selectNumberingPlan(t.country,t.countryCallingCode);var r=e.v2?t.nationalNumber:t.phone;if(Jd(r,n.nationalNumberPattern())){if(l$(r,"FIXED_LINE",n))return n.type("MOBILE")&&n.type("MOBILE").pattern()===""||!n.type("MOBILE")||l$(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var i=_Te(ATe),s;!(s=i()).done;){var o=s.value;if(l$(r,o,n))return o}}}}function l$(t,e,n){return e=n.type(e),!e||!e.pattern()||e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0?!1:Jd(t,e.pattern())}function kTe(t,e,n){if(e=e||{},n=new ms(n),n.selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes())return tL(t,e,n.metadata)!==void 0;var r=e.v2?t.nationalNumber:t.phone;return Jd(r,n.nationalNumberPattern())}function $Te(t,e,n){var r=new ms(n),i=r.getCountryCodesForCallingCode(t);return i?i.filter(function(s){return ITe(e,s,n)}):[]}function ITe(t,e,n){var r=new ms(n);return r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0}var nL=2,TTe=17,PTe=3,Mo="0-9ï¼-ï¼Ù -Ù©Û°-Û¹",RTe="-â-ââã¼ï¼",MTe="ï¼/",OTe="ï¼.",jTe="  Ââ
111â ã",NTe="()ï¼ï¼ï¼»ï¼½\\[\\]",DTe="~ââ¼ï½",wl="".concat(RTe).concat(MTe).concat(OTe).concat(jTe).concat(NTe).concat(DTe),FC="+ï¼",LTe=new RegExp("(["+Mo+"])");function Zce(t,e,n,r){if(e){var i=new ms(r);i.selectNumberingPlan(e,n);var s=new RegExp(i.IDDPrefix());if(t.search(s)===0){t=t.slice(t.match(s)[0].length);var o=t.match(LTe);if(!(o&&o[1]!=null&&o[1].length>0&&o[1]==="0"))return t}}}function uM(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var i,s,o=r.length-1,a=o>0&&r[o];if(e.nationalPrefixTransformRule()&&a)i=t.replace(n,e.nationalPrefixTransformRule()),o>1&&(s=r[1]);else{var c=r[0];i=t.slice(c.length),a&&(s=r[1])}var l;if(a){var u=t.indexOf(r[1]),d=t.slice(0,u);d===e.numberingPlan.nationalPrefix()&&(l=e.numberingPlan.nationalPrefix())}else l=r[0];return{nationalNumber:i,nationalPrefix:l,carrierCode:s}}}return{nationalNumber:t}}function dM(t,e){var n=uM(t,e),r=n.carrierCode,i=n.nationalNumber;if(i!==t){if(!BTe(t,i,e))return{nationalNumber:t};if(e.possibleLengths()&&!FTe(i,e))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:r}}function BTe(t,e,n){return!(Jd(t,n.nationalNumberPattern())&&!Jd(e,n.nationalNumberPattern()))}function FTe(t,e){switch(BC(t,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Yce(t,e,n,r){var i=e?LC(e,r):n;if(t.indexOf(i)===0){r=new ms(r),r.selectNumberingPlan(e,n);var s=t.slice(i.length),o=dM(s,r),a=o.nationalNumber,c=dM(t,r),l=c.nationalNumber;if(!Jd(l,r.nationalNumberPattern())&&Jd(a,r.nationalNumberPattern())||BC(l,r)==="TOO_LONG")return{countryCallingCode:i,number:s}}return{number:t}}function rL(t,e,n,r){if(!t)return{};var i;if(t[0]!=="+"){var s=Zce(t,e,n,r);if(s&&s!==t)i=!0,t="+"+s;else{if(e||n){var o=Yce(t,e,n,r),a=o.countryCallingCode,c=o.number;if(a)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:a,number:c}}return{number:t}}}if(t[1]==="0")return{};r=new ms(r);for(var l=2;l-1<=PTe&&l<=t.length;){var u=t.slice(1,l);if(r.hasCallingCode(u))return r.selectNumberingPlan(u),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:t.slice(l)};l++}return{}}function Qce(t){return t.replace(new RegExp("[".concat(wl,"]+"),"g")," ").trim()}var Xce=/(\$\d)/;function Jce(t,e,n){var r=n.useInternationalFormat,i=n.withNationalPrefix;n.carrierCode,n.metadata;var s=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(Xce,e.nationalPrefixFormattingRule()):e.format());return r?Qce(s):s}var UTe=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function zTe(t,e,n){var r=new ms(n);if(r.selectNumberingPlan(t,e),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(UTe.test(r.IDDPrefix()))return r.IDDPrefix()}var WTe=";ext=",Hg=function(e){return"([".concat(Mo,"]{1,").concat(e,"})")};function ele(t){var e="20",n="15",r="9",i="6",s="[  \\t,]*",o="[:\\.ï¼]?[  \\t,-]*",a="#?",c="(?:e?xt(?:ensi(?:oÌ?|ó))?n?|ï½ ?ï½ï½ï½?|доб|anexo)",l="(?:[xï½#ï¼~ï½]|int|ï½ï½ï½)",u="[- ]+",d="[  \\t]*",h="(?:,{2}|;)",f=WTe+Hg(e),m=s+c+o+Hg(e)+a,y=s+l+o+Hg(r)+a,v=u+Hg(i)+"#",b=d+h+o+Hg(n)+a,C=d+"(?:,)+"+o+Hg(r)+a;return f+"|"+m+"|"+y+"|"+v+"|"+b+"|"+C}var HTe="["+Mo+"]{"+nL+"}",VTe="["+FC+"]{0,1}(?:["+wl+"]*["+Mo+"]){3,}["+wl+Mo+"]*",qTe=new RegExp("^["+FC+"]{0,1}(?:["+wl+"]*["+Mo+"]){1,2}$","i"),KTe=VTe+"(?:"+ele()+")?",GTe=new RegExp("^"+HTe+"$|^"+KTe+"$","i");function ZTe(t){return t.length>=nL&>e.test(t)}function YTe(t){return qTe.test(t)}function QTe(t){var e=t.number,n=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}function XTe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=JTe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 112In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JTe(t,e){if(t){if(typeof t=="string")return wq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wq(t,e)}}function wq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vq(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function bq(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 11,714 bytes, lines 112-115
112e%2?vq(Object(n),!0).forEach(function(r){ePe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vq(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ePe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xq={formatExtension:function(e,n,r){return"".concat(e).concat(r.ext()).concat(n)}};function tPe(t,e,n,r){if(n?n=bq(bq({},xq),n):n=xq,r=new ms(r),t.country&&t.country!=="001"){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.country(t.country)}else if(t.countryCallingCode)r.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var i=r.countryCallingCode(),s=n.v2?t.nationalNumber:t.phone,o;switch(e){case"NATIONAL":return s?(o=i9(s,t.carrierCode,"NATIONAL",r,n),u$(o,t.ext,r,n.formatExtension)):"";case"INTERNATIONAL":return s?(o=i9(s,null,"INTERNATIONAL",r,n),o="+".concat(i," ").concat(o),u$(o,t.ext,r,n.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(s);case"RFC3966":return QTe({number:"+".concat(i).concat(s),ext:t.ext});case"IDD":if(!n.fromCountry)return;var a=rPe(s,t.carrierCode,i,n.fromCountry,r);return u$(a,t.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function i9(t,e,n,r,i){var s=nPe(r.formats(),t);return s?Jce(t,s,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:e,metadata:r}):t}function nPe(t,e){for(var n=XTe(t),r;!(r=n()).done;){var i=r.value;if(i.leadingDigitsPatterns().length>0){var s=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(e.search(s)!==0)continue}if(Jd(e,i.pattern()))return i}}function u$(t,e,n,r){return e?r(t,e,n):t}function rPe(t,e,n,r,i){var s=LC(r,i.metadata);if(s===n){var o=i9(t,e,"NATIONAL",i);return n==="1"?n+" "+o:o}var a=zTe(r,void 0,i.metadata);if(a)return"".concat(a," ").concat(n," ").concat(i9(t,null,"INTERNATIONAL",i))}function Eq(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Cq(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Eq(Object(n),!0).forEach(function(r){iPe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Eq(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iPe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sPe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oPe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function aPe(t,e,n){return e&&oPe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var iL=function(){function t(e,n,r){if(sPe(this,t),!e)throw new TypeError("First argument is required");if(typeof e!="string")throw new TypeError("First argument must be a string");if(e[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(n1(n)&&n1(n.countries)){r=n;var i=e;if(!uPe.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=rL(i,void 0,void 0,r),o=s.countryCallingCode,a=s.number;if(n=a,e=o,!n)throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");qce(r);var c=lPe(e,r),l=c.country,u=c.countryCallingCode;this.country=l,this.countryCallingCode=u,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return aPe(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:$Te(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return CTe(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return kTe(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new ms(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return tL(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return tPe(this,n,r?Cq(Cq({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}]),t}(),cPe=function(e){return/^[A-Z]{2}$/.test(e)};function lPe(t,e){var n,r,i=new ms(e);return cPe(t)?(n=t,i.selectNumberingPlan(n),r=i.countryCallingCode()):r=t,{country:n,countryCallingCode:r}}var uPe=/^\+\d+$/;function hM(t){"@babel/helpers - typeof";return hM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hM(t)}function dPe(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function hPe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fPe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jb(t,e)}function pPe(t){var e=nle();return function(){var r=e3(t),i;if(e){var s=e3(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return gPe(this,i)}}function gPe(t,e){if(e&&(hM(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tle(t)}function tle(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fM(t){var e=typeof Map=="function"?new Map:void 0;return fM=function(r){if(r===null||!mPe(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return a8(r,arguments,e3(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Jb(i,r)},fM(t)}function a8(t,e,n){return nle()?a8=Reflect.construct:a8=function(i,s,o){var a=[null];a.push.apply(a,s);var c=Function.bind.apply(i,a),l=new c;return o&&Jb(l,o.prototype),l},a8.apply(null,arguments)}function nle(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function mPe(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Jb(t,e){return Jb=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Jb(t,e)}function e3(t){return e3=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},e3(t)}var bd=function(t){fPe(n,t);var e=pPe(n);function n(r){var i;return hPe(this,n),i=e.call(this,r),Object.setPrototypeOf(tle(i),n.prototype),i.name=i.constructor.name,i}return dPe(n)}(fM(Error)),_q=new RegExp("(?:"+ele()+")$","i");function yPe(t){var e=t.search(_q);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(_q),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}function wPe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=vPe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 113In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vPe(t,e){if(t){if(typeof t=="string")return Sq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sq(t,e)}}function Sq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var bPe={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","ï¼":"0","ï¼":"1","ï¼":"2","ï¼":"3","ï¼":"4","ï¼":"5","ï¼":"6","ï¼":"7","ï¼":"8","ï¼":"9","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9"};function rle(t){return bPe[t]}function s9(t){for(var e="",n=wPe(t.split("")),r;!(r=n()).done;){var i=r.value,s=rle(i);s&&(e+=s)}return e}function xPe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=EPe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 114In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EPe(t,e){if(t){if(typeof t=="string")return Aq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Aq(t,e)}}function Aq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function kq(t){for(var e="",n=xPe(t.split("")),r;!(r=n()).done;){var i=r.value;e+=CPe(i,e)||""}return e}function CPe(t,e,n){return t==="+"?e?void 0:"+":rle(t)}function _Pe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=SPe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 115In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SPe(t,e){if(t){if(typeof t=="string")return $q(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $q(t,e)}}function $q(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ile(t,e){var n=e.countries;e.defaultCountry;var r=e.metadata;r=new ms(r);for(var i=_Pe(n),s;!(s=i()).done;){var o=s.value;if(r.country(o),r.leadingDigits()){if(t&&t.search(r.leadingDigits())===0)return o}else if(tL({phone:t,country:o},void 0,r.metadata))return o}}function sle(t,e){var n=e.nationalNumber,r=e.defaultCountry,i=e.metadata,s=i.getCountryCodesForCallingCode(t);if(s)return s.length===1?s[0]:ile(n,{countries:s,defaultCountry:r,metadata:i.metadata})}var ole="+",APe="[\\-\\.\\(\\)]?",Iq="(["+Mo+"]|"+APe+")",kPe="^\\"+ole+Iq+"*["+Mo+"]"+Iq+"*$",$Pe=ne
vendor: 4,120 bytes, line 115
115w RegExp(kPe,"g"),pM=Mo,IPe="["+pM+"]+((\\-)*["+pM+"])*",TPe="a-zA-Z",PPe="["+TPe+"]+((\\-)*["+pM+"])*",RPe="^("+IPe+"\\.)*"+PPe+"\\.?$",MPe=new RegExp(RPe,"g"),Tq="tel:",gM=";phone-context=",OPe=";isub=";function jPe(t){var e=t.indexOf(gM);if(e<0)return null;var n=e+gM.length;if(n>=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}function NPe(t){return t===null?!0:t.length===0?!1:$Pe.test(t)||MPe.test(t)}function DPe(t,e){var n=e.extractFormattedPhoneNumber,r=jPe(t);if(!NPe(r))throw new bd("NOT_A_NUMBER");var i;if(r===null)i=n(t)||"";else{i="",r.charAt(0)===ole&&(i+=r);var s=t.indexOf(Tq),o;s>=0?o=s+Tq.length:o=0;var a=t.indexOf(gM);i+=t.substring(o,a)}var c=i.indexOf(OPe);if(c>0&&(i=i.substring(0,c)),i!=="")return i}var LPe=250,BPe=new RegExp("["+FC+Mo+"]"),FPe=new RegExp("[^"+Mo+"#]+$");function UPe(t,e,n){if(e=e||{},n=new ms(n),e.defaultCountry&&!n.hasCountry(e.defaultCountry))throw e.v2?new bd("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var r=WPe(t,e.v2,e.extract),i=r.number,s=r.ext,o=r.error;if(!i){if(e.v2)throw o==="TOO_SHORT"?new bd("TOO_SHORT"):new bd("NOT_A_NUMBER");return{}}var a=VPe(i,e.defaultCountry,e.defaultCallingCode,n),c=a.country,l=a.nationalNumber,u=a.countryCallingCode,d=a.countryCallingCodeSource,h=a.carrierCode;if(!n.hasSelectedNumberingPlan()){if(e.v2)throw new bd("INVALID_COUNTRY");return{}}if(!l||l.length<nL){if(e.v2)throw new bd("TOO_SHORT");return{}}if(l.length>TTe){if(e.v2)throw new bd("TOO_LONG");return{}}if(e.v2){var f=new iL(u,l,n.metadata);return c&&(f.country=c),h&&(f.carrierCode=h),s&&(f.ext=s),f.__countryCallingCodeSource=d,f}var m=(e.extended?n.hasSelectedNumberingPlan():c)?Jd(l,n.nationalNumberPattern()):!1;return e.extended?{country:c,countryCallingCode:u,carrierCode:h,valid:m,possible:m?!0:!!(e.extended===!0&&n.possibleLengths()&&Gce(l,n)),phone:l,ext:s}:m?HPe(c,l,s):{}}function zPe(t,e,n){if(t){if(t.length>LPe){if(n)throw new bd("TOO_LONG");return}if(e===!1)return t;var r=t.search(BPe);if(!(r<0))return t.slice(r).replace(FPe,"")}}function WPe(t,e,n){var r=DPe(t,{extractFormattedPhoneNumber:function(o){return zPe(o,n,e)}});if(!r)return{};if(!ZTe(r))return YTe(r)?{error:"TOO_SHORT"}:{};var i=yPe(r);return i.ext?i:{number:r}}function HPe(t,e,n){var r={country:t,phone:e};return n&&(r.ext=n),r}function VPe(t,e,n,r){var i=rL(kq(t),e,n,r.metadata),s=i.countryCallingCodeSource,o=i.countryCallingCode,a=i.number,c;if(o)r.selectNumberingPlan(o);else if(a&&(e||n))r.selectNumberingPlan(e,n),e&&(c=e),o=n||LC(e,r.metadata);else return{};if(!a)return{countryCallingCodeSource:s,countryCallingCode:o};var l=dM(kq(a),r),u=l.nationalNumber,d=l.carrierCode,h=sle(o,{nationalNumber:u,defaultCountry:e,metadata:r});return h&&(c=h,h==="001"||r.country(c)),{country:c,countryCallingCode:o,countryCallingCodeSource:s,nationalNumber:u,carrierCode:d}}function Pq(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Rq(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Pq(Object(n),!0).forEach(function(r){qPe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pq(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function qPe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KPe(t,e,n){return UPe(t,Rq(Rq({},e),{},{v2:!0}),n)}function Mq(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function GPe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Mq(Object(n),!0).forEach(function(r){ZPe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mq(Object(n)).forEac
vendor: 30,730 bytes, lines 115-123
115h(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ZPe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function YPe(t,e){return eRe(t)||JPe(t,e)||XPe(t,e)||QPe()}function QPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 116In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XPe(t,e){if(t){if(typeof t=="string")return Oq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oq(t,e)}}function Oq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function JPe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(c){s=!0,a=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function eRe(t){if(Array.isArray(t))return t}function tRe(t){var e=Array.prototype.slice.call(t),n=YPe(e,4),r=n[0],i=n[1],s=n[2],o=n[3],a,c,l;if(typeof r=="string")a=r;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")o?(c=s,l=o):(c=void 0,l=s),i&&(c=GPe({defaultCountry:i},c));else if(n1(i))s?(c=i,l=s):l=i;else throw new Error("Invalid second argument: ".concat(i));return{text:a,options:c,metadata:l}}function jq(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Nq(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jq(Object(n),!0).forEach(function(r){nRe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jq(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nRe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rRe(t,e,n){e&&e.defaultCountry&&!xTe(e.defaultCountry,n)&&(e=Nq(Nq({},e),{},{defaultCountry:void 0}));try{return KPe(t,e,n)}catch(r){if(!(r instanceof bd))throw r}}function Dq(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Lq(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Dq(Object(n),!0).forEach(function(r){iRe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dq(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iRe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sRe(){var t=tRe(arguments),e=t.text,n=t.options,r=t.metadata;n=Lq(Lq({},n),{},{extract:!1});var i=rRe(e,n,r);return i&&i.isPossible()||!1}function oRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aRe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function cRe(t,e,n){return e&&aRe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var lRe=function(){function t(e){var n=e.onCountryChange,r=e.onCallingCodeChange;oRe(this,t),this.onCountryChange=n,this.onCallingCodeChange=r}return cRe(t,[{key:"reset",value:function(n){var r=n.country,i=n.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(r,i)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"update",value:function(n){for(var r=0,i=Object.keys(n);r<i.length;r++){var s=i[r];this[s]=n[s]}}},{key:"initCountryAndCallingCode",value:function(n,r){this.setCountry(n),this.setCallingCode(r)}},{key:"setCountry",value:function(n){this.country=n,this.onCountryChange(n)}},{key:"setCallingCode",value:function(n){this.callingCode=n,this.onCallingCodeChange(n,this.country)}},{key:"startInternationalNumber",value:function(n,r){this.international=!0,this.initCountryAndCallingCode(n,r)}},{key:"appendDigits",value:function(n){this.digits+=n}},{key:"appendNationalSignificantNumberDigits",value:function(n){this.nationalSignificantNumber+=n}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}]),t}();function uRe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=dRe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 117In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dRe(t,e){if(t){if(typeof t=="string")return Bq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bq(t,e)}}function Bq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Qc="x",d$=new RegExp(Qc);function c8(t,e){if(e<1)return"";for(var n="";e>1;)e&1&&(n+=t),e>>=1,t+=t;return n+t}function Fq(t,e){return t[e]===")"&&e++,hRe(t.slice(0,e))}function hRe(t){for(var e=[],n=0;n<t.length;)t[n]==="("?e.push(n):t[n]===")"&&e.pop(),n++;var r=0,i="";e.push(t.length);for(var s=0,o=e;s<o.length;s++){var a=o[s];i+=t.slice(r,a),r=a+1}return i}function fRe(t,e,n){for(var r=uRe(n.split("")),i;!(i=r()).done;){var s=i.value;if(t.slice(e+1).search(d$)<0)return;e=t.search(d$),t=t.replace(d$,s)}return[t,e]}function pRe(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,o=new RegExp("^(?:".concat(e.pattern(),")$"));if(o.test(t.nationalSignificantNumber))return mRe(t,e,{metadata:r,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:s})}function gRe(t,e){return BC(t,e)==="IS_POSSIBLE"}function mRe(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix;if(t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode,i(e)){var o=Uq(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:s,metadata:r});if(o)return o}return Uq(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:s,metadata:r})}function Uq(t,e,n){var r=n.metadata,i=n.useNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,o=Jce(t.nationalSignificantNumber,e,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:i,metadata:r});if(i||(t.nationalPrefix?o=t.nationalPrefix+s(e)+o:t.complexPrefixBeforeNationalSignificantNumber&&(o=t.complexPrefixBeforeNationalSignificantNumber+" "+o)),yRe(o,t))return o}function yRe(t,e){return s9(t)===e.getNationalDigits()}function wRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vRe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function bRe(t,e,n){return e&&vRe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var xRe=function(){function t(){wRe(this,t)}return bRe(t,[{key:"parse",value:function(n){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(n),this.context.length!==1)throw new Error("Non-finalized contexts left when pattern parse ended");var r=this.context[0],i=r.branches,s=r.instructions;if(i)return{op:"|",args:i.concat([h$(s)])};if(s.length===0)throw new Error("Pattern is required");return s.length===1?s[0]:s}},{key:"startContext",value:function(n){this.context.push(n)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(n){if(!n)throw new Error("Pattern is required");var r=n.match(_Re);if(!r){if(CRe.test(n))throw new Error("Illegal characters found in a pattern: ".concat(n));this.getContext().instructions=this.getContext().instructions.concat(n.split(""));return}var i=r[1],s=n.slice(0,r.index),o=n.slice(r.index+i.length);switch(i){case"(?:":s&&this.parsePattern(s),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(s&&this.parsePattern(s),this.getContext().instructions.length===0)throw new Error('No instructions found after "|" operator in an "or" group');var a=this.getContext(),c=a.branches;c.push(h$(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:c});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(s&&this.parsePattern(s),!this.getContext().branches)if(this.context.length===1)this.getContext().branches=[];else throw new Error('"branches" not found in an "or" group context');this.getContext().branches.push(h$(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":s&&this.parsePattern(s),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:ERe(s)});break;default:throw new Error("Unknown operator: ".concat(i))}o&&this.parsePattern(o)}}]),t}();function ERe(t){for(var e=[],n=0;n<t.length;){if(t[n]==="-"){if(n===0||n===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var r=t[n-1].charCodeAt(0)+1,i=t[n+1].charCodeAt(0)-1,s=r;s<=i;)e.push(String.fromCharCode(s)),s++}else e.push(t[n]);n++}return e}var CRe=/[\(\)\[\]\?\:\|]/,_Re=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function h$(t){return t.length===1?t[0]:t}function zq(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=SRe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 118In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SRe(t,e){if(t){if(typeof t=="string")return Wq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wq(t,e)}}function Wq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ARe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kRe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $Re(t,e,n){return e&&kRe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var IRe=function(){function t(e){ARe(this,t),this.matchTree=new xRe().parse(e)}return $Re(t,[{key:"match",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.allowOverflow;if(!n)throw new Error("String is required");var s=mM(n.split(""),this.matchTree,!0);if(s&&s.match&&delete s.matchedChars,!(s&&s.overflow&&!i))return s}}]),t}();function mM(t,e,n){if(typeof e=="string"){var r=t.join("");return e.indexOf(r)===0?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:r.indexOf(e)===0?n&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),s=0;s<e.length;){var o=e[s],a=mM(i,o,n&&s===e.length-1);if(a){if(a.overflow)return a;if(a.match){if(i=i.slice(a.matchedChars.length),i.length===0)return s===e.length-1?{match:!0,matchedChars:t}:{partialMatch:!0}}else{if(a.partialMatch)return{partialMatch:!0};throw new Error(`Unsupported match result: 119`.concat(JSON.stringify(a,null,2)))}}else return;s++}return n?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-i.length)}}switch(e.op){case"|":for(var c,l=zq(e.args),u;!(u=l()).done;){var d=u.value,h=mM(t,d,n);if(h){if(h.overflow)return h;if(h.match)return{match:!0,matchedChars:h.matchedChars};if(h.partialMatch)c=!0;else throw new Error(`Unsupported match result: 120`.concat(JSON.stringify(h,null,2)))}}return c?{partialMatch:!0}:void 0;case"[]":for(var f=zq(e.args),m;!(m=f()).done;){var y=m.value;if(t[0]===y)return t.length===1?{match:!0,matchedChars:t}:n?{overflow:!0}:{match:!0,matchedChars:[y]}}return;default:throw new Error("Unsupported instruction tree: ".concat(e))}}function Hq(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=TRe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 121In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TRe(t,e){if(t){if(typeof t=="string")return Vq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vq(t,e)}}function Vq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function PRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function RRe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function MRe(t,e,n){return e&&RRe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var yM="9",ORe=15,jRe=c8(yM,ORe),NRe=/[- ]/,DRe=function(){return/\[([^\[\]])*\]/g},LRe=function(){return/\d(?=[^,}][^,}])/g},BRe=new RegExp("["+wl+"]*\\$1["+wl+"]*(\\$\\d["+wl+"]*)*$"),qq=3,FRe=function(){function t(e){e.state;var n=e.metadata;PRe(this,t),this.metadata=n,this.resetFormat()}return MRe(t,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(n,r){this.resetFormat(),n?(this.isNANP=n.callingCode()==="1",this.matchingFormats=n.formats(),r.nationalSignificantNumber&&this.narrowDownMatchingFormats(r)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(n,r){var i=this;if(gRe(r.nationalSignificantNumber,this.metadata))for(var s=Hq(this.matchingFormats),o;!(o=s()).done;){var a=o.value,c=pRe(r,a,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(u){return i.shouldTryNationalPrefixFormattingRule(u,{international:r.international,nationalPrefix:r.nationalPrefix})},getSeparatorAfterNationalPrefix:function(u){return i.getSeparatorAfterNationalPrefix(u)}});if(c)return this.resetFormat(),this.chosenFormat=a,this.setNationalNumberTemplate(c.replace(/\d/g,Qc),r),this.populatedNationalNumberTemplate=c,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(Qc),c}return this.formatNationalNumberWithNextDigits(n,r)}},{key:"formatNationalNumberWithNextDigits",value:function(n,r){var i=this.chosenFormat,s=this.chooseFormat(r);if(s)return s===i?this.formatNextNationalNumberDigits(n):this.formatNextNationalNumberDigits(r.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(n){var r=this,i=n.nationalSignificantNumber,s=n.nationalPrefix,o=n.international,a=i,c=a.length-qq;c<0&&(c=0),this.matchingFormats=this.matchingFormats.filter(function(l){return r.formatSuits(l,o,s)&&r.formatMatches(l,a,c)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(n,r,i){return!(i&&!n.usesNationalPrefix()&&!n.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!r&&!i&&n.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(n,r,i){var s=n.leadingDigitsPatterns().length;if(s===0)return!0;i=Math.min(i,s-1);var o=n.leadingDigitsPatterns()[i];if(r.length<qq)try{return new IRe(o).match(r,{allowOverflow:!0})!==void 0}catch(a){return console.error(a),!0}return new RegExp("^(".concat(o,")")).test(r)}},{key:"getFormatFormat",value:function(n,r){return r?n.internationalFormat():n.format()}},{key:"chooseFormat",value:function(n){for(var r=this,i=function(){var l=o.value;return r.chosenFormat===l?"break":BRe.test(r.getFormatFormat(l,n.international))?r.createTemplateForFormat(l,n)?(r.chosenFormat=l,"break"):(r.matchingFormats=r.matchingFormats.filter(function(u){return u!==l}),"continue"):"continue"},s=Hq(this.matchingFormats.slice()),o;!(o=s()).done;){var a=i();if(a==="break")break}return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(n,r){if(!(n.pattern().indexOf("|")>=0)){var i=this.getTemplateForFormat(n,r);if(i)return this.setNationalNumberTemplate(i,r),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(n){return this.isNANP||n&&n.nationalPrefixFormattingRule()&&NRe.test(n.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(n,r){var i=n.IDDPrefix,s=n.missingPlus;return i?r&&r.spacing===!1?i:i+" ":s?"":"+"}},{key:"getTemplate",value:function(n){if(this.template){for(var r=-1,i=0,s=n.international?this.getInternationalPrefixBeforeCountryCallingCode(n,{spacing:!1}):"";i<s.length+n.getDigitsWithoutInternationalPrefix().length;)r=this.template.indexOf(Qc,r+1),i++;return Fq(this.template,r+1)}}},{key:"setNationalNumberTemplate",value:function(n,r){this.nationalNumberTemplate=n,this.populatedNationalNumberTemplate=n,this.populatedNationalNumberTemplatePosition=-1,r.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(r).replace(/[\d\+]/g,Qc)+c8(Qc,r.callingCode.length)+" "+n:this.template=n}},{key:"getTemplateForFormat",value:function(n,r){var i=r.nationalSignificantNumber,s=r.international,o=r.nationalPrefix,a=r.complexPrefixBeforeNationalSignificantNumber,c=n.pattern();c=c.replace(DRe(),"\\d").replace(LRe(),"\\d");var l=jRe.match(c)[0];if(!(i.length>l.length)){var u=new RegExp("^"+c+"$"),d=i.replace(/\d/g,yM);u.test(d)&&(l=d);var h=this.getFormatFormat(n,s),f;if(this.shouldTryNationalPrefixFormattingRule(n,{international:s,nationalPrefix:o})){var m=h.replace(Xce,n.nationalPrefixFormattingRule());if(s9(n.nationalPrefixFormattingRule())===(o||"")+s9("$1")&&(h=m,f=!0,o))for(var y=o.length;y>0;)h=h.replace(/\d/,Qc),y--}var v=l.replace(new RegExp(c),h).replace(new RegExp(yM,"g"),Qc);return f||(a?v=c8(Qc,a.length)+" "+v:o&&(v=c8(Qc,o.length)+this.getSeparatorAfterNationalPrefix(n)+v)),s&&(v=Qce(v)),v}}},{key:"formatNextNationalNumberDigits",value:function(n){var r=fRe(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,n);if(!r){this.resetFormat();return}return this.populatedNationalNumberTemplate=r[0],this.populatedNationalNumberTemplatePosition=r[1],Fq(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(n,r){var i=r.international,s=r.nationalPrefix;if(n.nationalPrefixFormattingRule()){var o=n.usesNationalPrefix();if(o&&s||!o&&!i)return!0}}}]),t}();function ale(t,e){return HRe(t)||WRe(t,e)||zRe(t,e)||URe()}function URe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 122In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zRe(t,e){if(t){if(typeof t=="string")return Kq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kq(t,e)}}function Kq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function WRe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(c){s=!0,a=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function HRe(t){if(Array.isArray(t))return t}function VRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qRe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function KRe(t,e,n){return e&&qRe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var GRe="["+wl+Mo+"]+",ZRe=new RegExp("^"+GRe+"$","i"),YRe="(?:["+FC+"]["+wl+Mo+"]*|["+wl+Mo+"]+)",QRe=new RegExp("[^"+wl+Mo+"]+.*$"),XRe=/[^\d\[\]]/,JRe=function(){function t(e){var n=e.defaultCountry,r=e.defaultCallingCode,i=e.metadata,s=e.onNationalSignificantNumberChange;VRe(this,t),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=i,this.onNationalSignificantNumberChange=s}return KRe(t,[{key:"input",value:function(n,r){var i=nMe(n),s=ale(i,2),o=s[0],a=s[1],c=s9(o),l;return a&&(r.digits||(r.startInternationalNumber(),c||(l=!0))),c&&this.inputDigits(c,r),{digits:c,justLeadingPlus:l}}},{key:"inputDigits",value:function(n,r){var i=r.digits,s=i.length<3&&i.length+n.length>=3;if(r.appendDigits(n),s&&this.extractIddPrefix(r),this.isWaitingForCountryCallingCode(r)){if(!this.extractCountryCallingCode(r))return}else r.appendNationalSignificantNumberDigits(n);r.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(r.getNationalDigits(),function(o){return r.update(o)})}},{key:"isWaitingForCountryCallingCode",value:function(n){var r=n.international,i=n.callingCode;return r&&!i}},{key:"extractCountryCallingCode",value:function(n){var r=rL("+"+n.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=r.countryCallingCode,s=r.number;if(i)return n.setCallingCode(i),n.update({nationalSignificantNumber:s}),!0}},{key:"reset",value:function(n){if(n){this.hasSelectedNumberingPlan=!0;var r=n._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=r&&XRe.test(r)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(n,r){if(this.hasSelectedNumberingPlan){var i=uM(n,this.metadata),s=i.nationalPrefix,o=i.nationalNumber,a=i.carrierCode;if(o!==n)return this.onExtractedNationalNumber(s,a,o,n,r),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(n,r,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(n,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var s=uM(n,this.metadata),o=s.nationalPrefix,a=s.nationalNumber,c=s.carrierCode;if(a!==r)return this.onExtractedNationalNumber(o,c,a,n,i),!0}}},{key:"onExtractedNationalNumber",value:function(n,r,i,s,o){var a,c,l=s.lastIndexOf(i);if(l>=0&&l===s.length-i.length){c=!0;var u=s.slice(0,l);u!==n&&(a=u)}o({nationalPrefix:n,carrierCode:r,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:c,complexPrefixBeforeNationalSignificantNumber:a}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(n){if(this.extractAnotherNationalSignificantNumber(n.getNationalDigits(),n.nationalSignificantNumber,function(r){return n.update(r)}))return!0;if(this.extractIddPrefix(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0;if(this.fixMissingPlus(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0}},{key:"extractIddPrefix",value:function(n){var r=n.international,i=n.IDDPrefix,s=n.digits;if(n.nationalSignificantNumber,!(r||i)){var o=Zce(s,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(o!==void 0&&o!==s)return n.update({IDDPrefix:s.slice(0,s.length-o.length)}),this.startInternationalNumber(n,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(n){if(!n.international){var r=Yce(n.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=r.countryCallingCode;if(r.number,i)return n.update({missingPlus:!0}),this.startInternationalNumber(n,{country:n.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(n,r){var i=r.country,s=r.callingCode;n.startInternationalNumber(i,s),n.nationalSignificantNumber&&(n.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(n){this.extractCountryCallingCode(n)&&this.extractNationalSignificantNumber(n.getNationalDigits(),function(r){return n.update(r)})}}]),t}();function eMe(t){var e=t.search(YRe);if(!(e<0)){t=t.slice(e);var n;return t[0]==="+"&&(n=!0,t=t.slice(1)),t=t.replace(QRe,""),n&&(t="+"+t),t}}function tMe(t){var e=eMe(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function nMe(t){var e=tMe(t),n=ale(e,2),r=n[0],i=n[1];return ZRe.test(r)||(r=""),[r,i]}function rMe(t,e){return aMe(t)||oMe(t,e)||sMe(t,e)||iMe()}function iMe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 123In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sMe(t,e){if(t){if(typeof t=="string")return Gq(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gq(t,e)}}function Gq(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function oMe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(c){s=!0,a=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function aMe(t){if(Array.isArray(t))return t}function cMe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lMe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function uMe(t,e,n){return e&&lMe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var cle=function(){function t(e,n){cMe(this,t),this.metadata=new ms(n);var r=this.getCountryAndCallingCode(e),i=rMe(r,2),s=i[0],o=i[1];this.defaultCountry=s,this.defaultCallingCode=o,this.reset()}return uMe(t,[{key:"getCountryAndCallingCode",value:function(n){var r,i;return n&&(n1(n)?(r=n.defaultCountry,i=n.defaultCallingCode):r=n),r&&!this.metadata.hasCountry(r)&&(r=void 0),[r,i]}},{key:"input",value:function(n){var r=this.parser.input(n,this.state),i=r.digits,s=r.justLeadingPlus;if(s)this.formattedOutput="+";else if(i){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var o;if(this.metadata.hasSelectedNumberingPlan()&&(o=this.formatter.format(i,this.state)),o===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var a=this.state.getNationalDigits();a&&(o=this.formatter.format(a,this.state))}this.formattedOutput=o?this.getFullNumber(o):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var n=this;return this.state=new lRe({onCountryChange:function(i){n.country=i},onCallingCodeChange:function(i,s){n.metadata.selectNumberingPlan(s,i),n.formatter.reset(n.metadata.numberingPlan,n.state),n.parser.reset(n.metadata.numberingPlan)}}),this.formatter=new FRe({state:this.state,metadata:this.metadata}),this.parser=new JRe({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){n.determineTheCountryIfNeeded(),n.formatter.reset(n.metadata.numberingPlan,n.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var n=this.state.digits;if(n)return this._getCountry()}},{key:"_getCountry",value:function(){var n=this.state.country;return n}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(n){var r=this;if(this.isInternational()){var i=function(a){return r.formatter.getInternationalPrefixBeforeCountryCallingCode(r.state,{spacing:!!a})+a},s=this.state.callingCode;return i(s?n?"".concat(s," ").concat(n):s:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return n}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var n=this.state,r=n.nationalSignificantNumber,i=n.complexPrefixBeforeNationalSignificantNumber,s=n.nationalPrefix,o=r,a=i||s;return a&&(o=a+o),o}},{key:"getNonFormattedNumber",value:function(){var n=this.state.nationalSignificantNumberMatchesInput;
123return this.getFullNumber(n?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var n=this.getNonFormattedNumber();if(n)return n.replace(/[\+\d]/g,Qc)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var n=this.state.callingCode,r=this.metadata.getCountryCodesForCallingCode(n);return r&&r.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(sle(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var n=this.state,r=n.digits,i=n.callingCode,s=n.country,o=n.nationalSignificantNumber;if(r){if(this.isInternational())return i?"+"+i+o:"+"+r;if(s||i){var a=s?this.metadata.countryCallingCode():i;return"+"+a+o}}}},{key:"getNumber",value:function(){var n=this.state,r=n.nationalSignificantNumber,i=n.carrierCode,s=n.callingCode,o=this._getCountry();if(r&&!(!o&&!s)){if(o&&o===this.defaultCountry){var a=new ms(this.metadata.metadata);a.selectNumberingPlan(o);var c=a.numberingPlan.callingCode(),l=this.metadata.getCountryCodesForCallingCode(c);if(l.length>1){var u=ile(r,{countries:l,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});u&&(o=u)}}var d=new iL(o||s,r,this.metadata.metadata);return i&&(d.carrierCode=i),d}}},{key:"isPossible",value:function(){var n=this.getNumber();return n?n.isPossible():!1}},{key:"isValid",value:function(){var n=this.getNumber();return n?n.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),t}();function dMe(t){return new ms(t).getCountries()}function hMe(t,e,n){if(e[t])return new iL(t,e[t],n)}const fMe=new TextEncoder,lle=new TextDecoder,pMe=t=>{let e=t;typeof e=="string"&&(e=fMe.encode(e));const n=32768,r=[];for(let i=0;i<e.length;i+=n)r.push(String.fromCharCode.apply(null,e.subarray(i,i+n)));return btoa(r.join(""))},gMe=t=>pMe(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),mMe=t=>{const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},yMe=t=>{let e=t;e instanceof Uint8Array&&(e=lle.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return mMe(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class wMe extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var n;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class Kp extends wMe{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function vMe(t){return typeof t=="object"&&t!==null}function bMe(t){if(!vMe(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}const o9=gMe,xMe=yMe;function Zq(t){if(typeof t!="string")throw new Kp("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");if(n===5)throw new Kp("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new Kp("Invalid JWT");if(!e)throw new Kp("JWTs must contain a payload");let r;try{r=xMe(e)}catch{throw new Kp("Failed to base64url decode the payload")}let i;try{i=JSON.parse(lle.decode(r))}catch{throw new Kp("Failed to parse the decoded payload as JSON")}if(!bMe(i))throw new Kp("Invalid JWT Claims Set");return i}const UC={id:42161},ule={id:43114},_5={id:8453},dle={id:42220},S5={id:1},sL={id:10},A5={id:137};var Wo;(Wo={}).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",Wo.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",Wo.INVALID_DATA="invalid_data",Wo.LINKED_TO_ANOTHER_USER="linked_to_another_user",Wo.ALLOWLIST_REJECTED="allowlist_rejected",Wo.OAUTH_USER_DENIED="oauth_user_denied",Wo.UNKNOWN_AUTH_ERROR="unknown_auth_error",Wo.USER_EXITED_AUTH_FLOW="exited_auth_flow",Wo.MUST_BE_AUTHENTICATED="must_be_authenticated",Wo.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",Wo.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",Wo.CLIENT_REQUEST_TIMEOUT="client_request_timeout",Wo.INVALID_CREDENTIALS="invalid_credentials";const cl={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail
123:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};var l8={exports:{}};const EMe={},CMe=Object.freeze(Object.defineProperty({__proto__:null,default:EMe},Symbol.toStringTag,{value:"Module"})),hle=qE(CMe);var _Me=l8.exports,Yq;function fle(){return Yq||(Yq=1,function(t){(function(e,n){function r(L,S){if(!L)throw new Error(S||"Assertion failed")}function i(L,S){L.super_=S;var k=function(){};k.prototype=S.prototype,L.prototype=new k,L.prototype.constructor=L}function s(L,S,k){if(s.isBN(L))return L;
vendor: 15,761 bytes, line 123
123this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((S==="le"||S==="be")&&(k=S,S=10),this._init(L||0,S||10,k||"be"))}typeof e=="object"?e.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=hle.Buffer}catch{}s.isBN=function(S){return S instanceof s?!0:S!==null&&typeof S=="object"&&S.constructor.wordSize===s.wordSize&&Array.isArray(S.words)},s.max=function(S,k){return S.cmp(k)>0?S:k},s.min=function(S,k){return S.cmp(k)<0?S:k},s.prototype._init=function(S,k,M){if(typeof S=="number")return this._initNumber(S,k,M);if(typeof S=="object")return this._initArray(S,k,M);k==="hex"&&(k=16),r(k===(k|0)&&k>=2&&k<=36),S=S.toString().replace(/\s+/g,"");var W=0;S[0]==="-"&&(W++,this.negative=1),W<S.length&&(k===16?this._parseHex(S,W,M):(this._parseBase(S,k,W),M==="le"&&this._initArray(this.toArray(),k,M)))},s.prototype._initNumber=function(S,k,M){S<0&&(this.negative=1,S=-S),S<67108864?(this.words=[S&67108863],this.length=1):S<4503599627370496?(this.words=[S&67108863,S/67108864&67108863],this.length=2):(r(S<9007199254740992),this.words=[S&67108863,S/67108864&67108863,1],this.length=3),M==="le"&&this._initArray(this.toArray(),k,M)},s.prototype._initArray=function(S,k,M){if(r(typeof S.length=="number"),S.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(S.length/3),this.words=new Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var H,D,V=0;if(M==="be")for(W=S.length-1,H=0;W>=0;W-=3)D=S[W]|S[W-1]<<8|S[W-2]<<16,this.words[H]|=D<<V&67108863,this.words[H+1]=D>>>26-V&67108863,V+=24,V>=26&&(V-=26,H++);else if(M==="le")for(W=0,H=0;W<S.length;W+=3)D=S[W]|S[W+1]<<8|S[W+2]<<16,this.words[H]|=D<<V&67108863,this.words[H+1]=D>>>26-V&67108863,V+=24,V>=26&&(V-=26,H++);return this._strip()};function a(L,S){var k=L.charCodeAt(S);if(k>=48&&k<=57)return k-48;if(k>=65&&k<=70)return k-55;if(k>=97&&k<=102)return k-87;r(!1,"Invalid character in "+L)}function c(L,S,k){var M=a(L,k);return k-1>=S&&(M|=a(L,k-1)<<4),M}s.prototype._parseHex=function(S,k,M){this.length=Math.ceil((S.length-k)/6),this.words=new Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var H=0,D=0,V;if(M==="be")for(W=S.length-1;W>=k;W-=2)V=c(S,k,W)<<H,this.words[D]|=V&67108863,H>=18?(H-=18,D+=1,this.words[D]|=V>>>26):H+=8;else{var B=S.length-k;for(W=B%2===0?k+1:k;W<S.length;W+=2)V=c(S,k,W)<<H,this.words[D]|=V&67108863,H>=18?(H-=18,D+=1,this.words[D]|=V>>>26):H+=8}this._strip()};function l(L,S,k,M){for(var W=0,H=0,D=Math.min(L.length,k),V=S;V<D;V++){var B=L.charCodeAt(V)-48;W*=M,B>=49?H=B-49+10:B>=17?H=B-17+10:H=B,r(B>=0&&H<M,"Invalid character"),W+=H}return W}s.prototype._parseBase=function(S,k,M){this.words=[0],this.length=1;for(var W=0,H=1;H<=67108863;H*=k)W++;W--,H=H/k|0;for(var D=S.length-M,V=D%W,B=Math.min(D,D-V)+M,P=0,j=M;j<B;j+=W)P=l(S,j,j+W,k),this.imuln(H),this.words[0]+P<67108864?this.words[0]+=P:this._iaddn(P);if(V!==0){var G=1;for(P=l(S,j,S.length,k),j=0;j<V;j++)G*=k;this.imuln(G),this.words[0]+P<67108864?this.words[0]+=P:this._iaddn(P)}this._strip()},s.prototype.copy=function(S){S.words=new Array(this.length);for(var k=0;k<this.length;k++)S.words[k]=this.words[k];S.length=this.length,S.negative=this.negative,S.red=this.red};function u(L,S){L.words=S.words,L.length=S.length,L.negative=S.negative,L.red=S.red}if(s.prototype._move=function(S){u(S,this)},s.prototype.clone=function(){var S=new s(null);return this.copy(S),S},s.prototype._expand=function(S){for(;this.length<S;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{s.prototype.inspect=d}else s.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","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"],f=[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],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(S,k){S=S||10,k=k|0||1;var M;if(S===16||S==="hex"){M="";for(var W=0,H=0,D=0;D<this.length;D++){var V=this.words[D],B=((V<<W|H)&16777215).toString(16);H=V>>>24-W&16777215,W+=2,W>=26&&(W-=26,D--),H!==0||D!==this.length-1?M=h[6-B.length]+B+M:M=B+M}for(H!==0&&(M=H.toString(16)+M);M.length%k!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}if(S===(S|0)&&S>=2&&S<=36){var P=f[S],j=m[S];M="";var G=this.clone();for(G.negative=0;!G.isZero();){var Y=G.modrn(j).toString(S);G=G.idivn(j),G.isZero()?M=Y+M:M=h[P-Y.length]+Y+M}for(this.isZero()&&(M="0"+M);M.length%k!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var S=this.words[0];return this.length===2?S+=this.words[1]*67108864:this.length===3&&this.words[2]===1?S+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-S:S},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(S,k){return this.toArrayLike(o,S,k)}),s.prototype.toArray=function(S,k){return this.toArrayLike(Array,S,k)};var y=function(S,k){return S.allocUnsafe?S.allocUnsafe(k):new S(k)};s.prototype.toArrayLike=function(S,k,M){this._strip();var W=this.byteLength(),H=M||Math.max(1,W);r(W<=H,"byte array longer than desired length"),r(H>0,"Requested array length <= 0");var D=y(S,H),V=k==="le"?"LE":"BE";return this["_toArrayLike"+V](D,W),D},s.prototype._toArrayLikeLE=function(S,k){for(var M=0,W=0,H=0,D=0;H<this.length;H++){var V=this.words[H]<<D|W;S[M++]=V&255,M<S.length&&(S[M++]=V>>8&255),M<S.length&&(S[M++]=V>>16&255),D===6?(M<S.length&&(S[M++]=V>>24&255),W=0,D=0):(W=V>>>24,D+=2)}if(M<S.length)for(S[M++]=W;M<S.length;)S[M++]=0},s.prototype._toArrayLikeBE=function(S,k){for(var M=S.length-1,W=0,H=0,D=0;H<this.length;H++){var V=this.words[H]<<D|W;S[M--]=V&255,M>=0&&(S[M--]=V>>8&255),M>=0&&(S[M--]=V>>16&255),D===6?(M>=0&&(S[M--]=V>>24&255),W=0,D=0):(W=V>>>24,D+=2)}if(M>=0)for(S[M--]=W;M>=0;)S[M--]=0},Math.clz32?s.prototype._countBits=function(S){return 32-Math.clz32(S)}:s.prototype._countBits=function(S){var k=S,M=0;return k>=4096&&(M+=13,k>>>=13),k>=64&&(M+=7,k>>>=7),k>=8&&(M+=4,k>>>=4),k>=2&&(M+=2,k>>>=2),M+k},s.prototype._zeroBits=function(S){if(S===0)return 26;var k=S,M=0;return(k&8191)===0&&(M+=13,k>>>=13),(k&127)===0&&(M+=7,k>>>=7),(k&15)===0&&(M+=4,k>>>=4),(k&3)===0&&(M+=2,k>>>=2),(k&1)===0&&M++,M},s.prototype.bitLength=function(){var S=this.words[this.length-1],k=this._countBits(S);return(this.length-1)*26+k};function v(L){for(var S=new Array(L.bitLength()),k=0;k<S.length;k++){var M=k/26|0,W=k%26;S[k]=L.words[M]>>>W&1}return S}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var S=0,k=0;k<this.length;k++){var M=this._zeroBits(this.words[k]);if(S+=M,M!==26)break}return S},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(S){return this.negative!==0?this.abs().inotn(S).iaddn(1):this.clone()},s.prototype.fromTwos=function(S){return this.testn(S-1)?this.notn(S).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(S){for(;this.length<S.length;)this.words[this.length++]=0;for(var k=0;k<S.length;k++)this.words[k]=this.words[k]|S.words[k];return this._strip()},s.prototype.ior=function(S){return r((this.negative|S.negative)===0),this.iuor(S)},s.prototype.or=function(S){return this.length>S.length?this.clone().ior(S):S.clone().ior(this)},s.prototype.uor=function(S){return this.length>S.length?this.clone().iuor(S):S.clone().iuor(this)},s.prototype.iuand=function(S){var k;this.length>S.length?k=S:k=this;for(var M=0;M<k.length;M++)this.words[M]=this.words[M]&S.words[M];return this.length=k.length,this._strip()},s.prototype.iand=function(S){return r((this.negative|S.negative)===0),this.iuand(S)},s.prototype.and=function(S){return this.length>S.length?this.clone().iand(S):S.clone().iand(this)},s.prototype.uand=function(S){return this.length>S.length?this.clone().iuand(S):S.clone().iuand(this)},s.prototype.iuxor=function(S){var k,M;this.length>S.length?(k=this,M=S):(k=S,M=this);for(var W=0;W<M.length;W++)this.words[W]=k.words[W]^M.words[W];if(this!==k)for(;W<k.length;W++)this.words[W]=k.words[W];return this.length=k.length,this._strip()},s.prototype.ixor=function(S){return r((this.negative|S.negative)===0),this.iuxor(S)},s.prototype.xor=function(S){return this.length>S.length?this.clone().ixor(S):S.clone().ixor(this)},s.prototype.uxor=function(S){return this.length>S.length?this.clone().iuxor(S):S.clone().iuxor(this)},s.prototype.inotn=function(S){r(typeof S=="number"&&S>=0);var k=Math.ceil(S/26)|0,M=S%26;this._expand(k),M>0&&k--;for(var W=0;W<k;W++)this.words[W]=~this.words[W]&67108863;return M>0&&(this.words[W]=~this.words[W]&67108863>>26-M),this._strip()},s.prototype.notn=function(S){return this.clone().inotn(S)},s.prototype.setn=function(S,k){r(typeof S=="number"&&S>=0);var M=S/26|0,W=S%26;return this._expand(M+1),k?this.words[M]=this.words[M]|1<<W:this.words[M]=this.words[M]&~(1<<W),this._strip()},s.prototype.iadd=function(S){var k;if(this.negative!==0&&S.negative===0)return this.negative=0,k=this.isub(S),this.negative^=1,this._normSign();if(this.negative===0&&S.negative!==0)return S.negative=0,k=this.isub(S),S.negative=1,k._normSign();var M,W;this.length>S.length?(M=this,W=S):(M=S,W=this);for(var H=0,D=0;D<W.length;D++)k=(M.words[D]|0)+(W.words[D]|0)+H,this.words[D]=k&67108863,H=k>>>26;for(;H!==0&&D<M.length;D++)k=(M.words[D]|0)+H,this.words[D]=k&67108863,H=k>>>26;if(this.length=M.length,H!==0)this.words[this.length]=H,this.length++;else if(M!==this)for(;D<M.length;D++)this.words[D]=M.words[D];return this},s.prototype.add=function(S){var k;return S.negative!==0&&this.negative===0?(S.negative=0,k=this.sub(S),S.negative^=1,k):S.negative===0&&this.negative!==0?(this.negative=0,k=S.sub(this),this.negative=1,k):this.length>S.length?this.clone().iadd(S):S.clone().iadd(this)},s.prototype.isub=function(S){if(S.negative!==0){S.negative=0;var k=this.iadd(S);return S.negative=1,k._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(S),this.negative=1,this._normSign();var M=this.cmp(S);if(M===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,H;M>0?(W=this,H=S):(W=S,H=this);for(var D=0,V=0;V<H.length;V++)k=(W.words[V]|0)-(H.words[V]|0)+D,D=k>>26,this.words[V]=k&67108863;for(;D!==0&&V<W.length;V++)k=(W.words[V]|0)+D,D=k>>26,this.words[V]=k&67108863;if(D===0&&V<W.length&&W!==this)for(;V<W.length;V++)this.words[V]=W.words[V];return this.length=Math.max(this.length,V),W!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(S){return this.clone().isub(S)};function b(L,S,k){k.negative=S.negative^L.negative;var M=L.length+S.length|0;k.length=M,M=M-1|0;var W=L.words[0]|0,H=S.words[0]|0,D=W*H,V=D&67108863,B=D/67108864|0;k.words[0]=V;for(var P=1;P<M;P++){for(var j=B>>>26,G=B&67108863,Y=Math.min(P,S.length-1),te=Math.max(0,P-L.length+1);te<=Y;te++){var ae=P-te|0;W=L.words[ae]|0,H=S.words[te]|0,D=W*H+G,j+=D/67108864|0,G=D&67108863}k.words[P]=G|0,B=j|0}return B!==0?k.words[P]=B|0:k.length--,k._strip()}var C=function(S,k,M){var W=S.words,H=k.words,D=M.words,V=0,B,P,j,G=W[0]|0,Y=G&8191,te=G>>>13,ae=W[1]|0,oe=ae&8191,de=ae>>>13,ke=W[2]|0,Be=ke&8191,$e=ke>>>13,He=W[3]|0,Ge=He&8191,je=He>>>13,xt=W[4]|0,ft=xt&8191,it=xt>>>13,be=W[5]|0,Lt=be&8191,Qe=be>>>13,Ue=W[6]|0,Ye=Ue&8191,tt=Ue>>>13,ze=W[7]|0,Ne=ze&8191,J=ze>>>13,q=W[8]|0,Z=q&8191,se=q>>>13,he=W[9]|0,fe=he&8191,ye=he>>>13,nt=H[0]|0,vt=nt&8191,Nt=nt>>>13,mn=H[1]|0,At=mn&8191,En=mn>>>13,yr=H[2]|0,xn=yr&8191,kt=yr>>>13,Ie=H[3]|0,It=Ie&8191,rt=Ie>>>13,Zt=H[4]|0,yt=Zt&8191,pt=Zt>>>13,St=H[5]|0,qe=St&8191,Et=St>>>13,Ze=H[6]|0,wt=Ze&8191,ot=Ze>>>13,qt=H[7]|0,mt=qt&8191,Bt=qt>>>13,un=H[8]|0,Ve=un&8191,st=un>>>13,X=H[9]|0,ee=X&8191,ie=X>>>13;M.negative=S.negative^k.negative,M.length=19,B=Math.imul(Y,vt),P=Math.imul(Y,Nt),P=P+Math.imul(te,vt)|0,j=Math.imul(te,Nt);var ce=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(ce>>>26)|0,ce&=67108863,B=Math.imul(oe,vt),P=Math.imul(oe,Nt),P=P+Math.imul(de,vt)|0,j=Math.imul(de,Nt),B=B+Math.imul(Y,At)|0,P=P+Math.imul(Y,En)|0,P=P+Math.imul(te,At)|0,j=j+Math.imul(te,En)|0;var le=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(le>>>26)|0,le&=67108863,B=Math.imul(Be,vt),P=Math.imul(Be,Nt),P=P+Math.imul($e,vt)|0,j=Math.imul($e,Nt),B=B+Math.imul(oe,At)|0,P=P+Math.imul(oe,En)|0,P=P+Math.imul(de,At)|0,j=j+Math.imul(de,En)|0,B=B+Math.imul(Y,xn)|0,P=P+Math.imul(Y,kt)|0,P=P+Math.imul(te,xn)|0,j=j+Math.imul(te,kt)|0;var _e=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(_e>>>26)|0,_e&=67108863,B=Math.imul(Ge,vt),P=Math.imul(Ge,Nt),P=P+Math.imul(je,vt)|0,j=Math.imul(je,Nt),B=B+Math.imul(Be,At)|0,P=P+Math.imul(Be,En)|0,P=P+Math.imul($e,At)|0,j=j+Math.imul($e,En)|0,B=B+Math.imul(oe,xn)|0,P=P+Math.imul(oe,kt)|0,P=P+Math.imul(de,xn)|0,j=j+Math.imul(de,kt)|0,B=B+Math.imul(Y,It)|0,P=P+Math.imul(Y,rt)|0,P=P+Math.imul(te,It)|0,j=j+Math.imul(te,rt)|0;var me=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(me>>>26)|0,me&=67108863,B=Math.imul(ft,vt),P=Math.imul(ft,Nt),P=P+Math.imul(it,vt)|0,j=Math.imul(it,Nt),B=B+Math.imul(Ge,At)|0,P=P+Math.imul(Ge,En)|0,P=P+Math.imul(je,At)|0,j=j+Math.imul(je,En)|0,B=B+Math.imul(Be,xn)|0,P=P+Math.imul(Be,kt)|0,P=P+Math.imul($e,xn)|0,j=j+Math.imul($e,kt)|0,B=B+Math.imul(oe,It)|0,P=P+Math.imul(oe,rt)|0,P=P+Math.imul(de,It)|0,j=j+Math.imul(de,rt)|0,B=B+Math.imul(Y,yt)|0,P=P+Math.imul(Y,pt)|0,P=P+Math.imul(te,yt)|0,j=j+Math.imul(te,pt)|0;var we=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(we>>>26)|0,we&=67108863,B=Math.imul(Lt,vt),P=Math.imul(Lt,Nt),P=P+Math.imul(Qe,vt)|0,j=Math.imul(Qe,Nt),B=B+Math.imul(ft,At)|0,P=P+Math.imul(ft,En)|0,P=P+Math.imul(it,At)|0,j=j+Math.imul(it,En)|0,B=B+Math.imul(Ge,xn)|0,P=P+Math.imul(Ge,kt)|0,P=P+Math.imul(je,xn)|0,j=j+Math.imul(je,kt)|0,B=B+Math.imul(Be,It)|0,P=P+Math.imul(Be,rt)|0,P=P+Math.imul($e,It)|0,j=j+Math.imul($e,rt)|0,B=B+Math.imul(oe,yt)|0,P=P+Math.imul(oe,pt)|0,P=P+Math.imul(de,yt)|0,j=j+Math.imul(de,pt)|0,B=B+Math.imul(Y,qe)|0,P=P+Math.imul(Y,Et)|0,P=P+Math.imul(te,qe)|0,j=j+Math.imul(te,Et)|0;var Te=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(Te>>>26)|0,Te&=67108863,B=Math.imul(Ye,vt),P=Math.imul(Ye,Nt),P=P+Math.imul(tt,vt)|0,j=Math.imul(tt,Nt),B=B+Math.imul(Lt,At)|0,P=P+Math.imul(Lt,En)|0,P=P+Math.imul(Qe,At)|0,j=j+Math.imul(Qe,En)|0,B=B+Math.imul(ft,xn)|0,P=P+Math.imul(ft,kt)|0,P=P+Math.imul(it,xn)|0,j=j+Math.imul(it,kt)|0,B=B+Math.imul(Ge,It)|0,P=P+Math.imul(Ge,rt)|0,P=P+Math.imul(je,It)|0,j=j+Math.imul(je,rt)|0,B=B+Math.imul(Be,yt)|0,P=P+Math.imul(Be,pt)|0,P=P+Math.imul($e,yt)|0,j=j+Math.imul($e,pt)|0,B=B+Math.imul(oe,qe)|0,P=P+Math.imul(oe,Et)|0,P=P+Math.imul(de,qe)|0,j=j+Math.imul(de,Et)|0,B=B+Math.imul(Y,wt)|0,P=P+Math.imul(Y,ot)|0,P=P+Math.imul(te,wt)|0,j=j+Math.imul(te,ot)|0;
123var Ct=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,B=Math.imul(Ne,vt),P=Math.imul(Ne,Nt),P=P+Math.imul(J,vt)|0,j=Math.imul(J,Nt),B=B+Math.imul(Ye,At)|0,P=P+Math.imul(Ye,En)|0,P=P+Math.imul(tt,At)|0,j=j+Math.imul(tt,En)|0,B=B+Math.imul(Lt,xn)|0,P=P+Math.imul(Lt,kt)|0,P=P+Math.imul(Qe,xn)|0,j=j+Math.imul(Qe,kt)|0,B=B+Math.imul(ft,It)|0,P=P+Math.imul(ft,rt)|0,P=P+Math.imul(it,It)|0,j=j+Math.imul(it,rt)|0,B=B+Math.imul(Ge,yt)|0,P=P+Math.imul(Ge,pt)|0,P=P+Math.imul(je,yt)|0,j=j+Math.imul(je,pt)|0,B=B+Math.imul(Be,qe)|0,P=P+Math.imul(Be,Et)|0,P=P+Math.imul($e,qe)|0,j=j+Math.imul($e,Et)|0,B=B+Math.imul(oe,wt)|0,P=P+Math.imul(oe,ot)|0,P=P+Math.imul(de,wt)|0,j=j+Math.imul(de,ot)|0,B=B+Math.imul(Y,mt)|0,P=P+Math.imul(Y,Bt)|0,P=P+Math.imul(te,mt)|0,j=j+Math.imul(te,Bt)|0;var at=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(at>>>26)|0,at&=67108863,B=Math.imul(Z,vt),P=Math.imul(Z,Nt),P=P+Math.imul(se,vt)|0,j=Math.imul(se,Nt),B=B+Math.imul(Ne,At)|0,P=P+Math.imul(Ne,En)|0,P=P+Math.imul(J,At)|0,j=j+Math.imul(J,En)|0,B=B+Math.imul(Ye,xn)|0,P=P+Math.imul(Ye,kt)|0,P=P+Math.imul(tt,xn)|0,j=j+Math.imul(tt,kt)|0,B=B+Math.imul(Lt,It)|0,P=P+Math.imul(Lt,rt)|0,P=P+Math.imul(Qe,It)|0,j=j+Math.imul(Qe,rt)|0,B=B+Math.imul(ft,yt)|0,P=P+Math.imul(ft,pt)|0,P=P+Math.imul(it,yt)|0,j=j+Math.imul(it,pt)|0,B=B+Math.imul(Ge,qe)|0,P=P+Math.imul(Ge,Et)|0,P=P+Math.imul(je,qe)|0,j=j+Math.imul(je,Et)|0,B=B+Math.imul(Be,wt)|0,P=P+Math.imul(Be,ot)|0,P=P+Math.imul($e,wt)|0,j=j+Math.imul($e,ot)|0,B=B+Math.imul(oe,mt)|0,P=P+Math.imul(oe,Bt)|0,P=P+Math.imul(de,mt)|0,j=j+Math.imul(de,Bt)|0,B=B+Math.imul(Y,Ve)|0,P=P+Math.imul(Y,st)|0,P=P+Math.imul(te,Ve)|0,j=j+Math.imul(te,st)|0;var Gt=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,B=Math.imul(fe,vt),P=Math.imul(fe,Nt),P=P+Math.imul(ye,vt)|0,j=Math.imul(ye,Nt),B=B+Math.imul(Z,At)|0,P=P+Math.imul(Z,En)|0,P=P+Math.imul(se,At)|0,j=j+Math.imul(se,En)|0,B=B+Math.imul(Ne,xn)|0,P=P+Math.imul(Ne,kt)|0,P=P+Math.imul(J,xn)|0,j=j+Math.imul(J,kt)|0,B=B+Math.imul(Ye,It)|0,P=P+Math.imul(Ye,rt)|0,P=P+Math.imul(tt,It)|0,j=j+Math.imul(tt,rt)|0,B=B+Math.imul(Lt,yt)|0,P=P+Math.imul(Lt,pt)|0,P=P+Math.imul(Qe,yt)|0,j=j+Math.imul(Qe,pt)|0,B=B+Math.imul(ft,qe)|0,P=P+Math.imul(ft,Et)|0,P=P+Math.imul(it,qe)|0,j=j+Math.imul(it,Et)|0,B=B+Math.imul(Ge,wt)|0,P=P+Math.imul(Ge,ot)|0,P=P+Math.imul(je,wt)|0,j=j+Math.imul(je,ot)|0,B=B+Math.imul(Be,mt)|0,P=P+Math.imul(Be,Bt)|0,P=P+Math.imul($e,mt)|0,j=j+Math.imul($e,Bt)|0,B=B+Math.imul(oe,Ve)|0,P=P+Math.imul(oe,st)|0,P=P+Math.imul(de,Ve)|0,j=j+Math.imul(de,st)|0,B=B+Math.imul(Y,ee)|0,P=P+Math.imul(Y,ie)|0,P=P+Math.imul(te,ee)|0,j=j+Math.imul(te,ie)|0;var Dt=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,B=Math.imul(fe,At),P=Math.imul(fe,En),P=P+Math.imul(ye,At)|0,j=Math.imul(ye,En),B=B+Math.imul(Z,xn)|0,P=P+Math.imul(Z,kt)|0,P=P+Math.imul(se,xn)|0,j=j+Math.imul(se,kt)|0,B=B+Math.imul(Ne,It)|0,P=P+Math.imul(Ne,rt)|0,P=P+Math.imul(J,It)|0,j=j+Math.imul(J,rt)|0,B=B+Math.imul(Ye,yt)|0,P=P+Math.imul(Ye,pt)|0,P=P+Math.imul(tt,yt)|0,j=j+Math.imul(tt,pt)|0,B=B+Math.imul(Lt,qe)|0,P=P+Math.imul(Lt,Et)|0,P=P+Math.imul(Qe,qe)|0,j=j+Math.imul(Qe,Et)|0,B=B+Math.imul(ft,wt)|0,P=P+Math.imul(ft,ot)|0,P=P+Math.imul(it,wt)|0,j=j+Math.imul(it,ot)|0,B=B+Math.imul(Ge,mt)|0,P=P+Math.imul(Ge,Bt)|0,P=P+Math.imul(je,mt)|0,j=j+Math.imul(je,Bt)|0,B=B+Math.imul(Be,Ve)|0,P=P+Math.imul(Be,st)|0,P=P+Math.imul($e,Ve)|0,j=j+Math.imul($e,st)|0,B=B+Math.imul(oe,ee)|0,P=P+Math.imul(oe,ie)|0,P=P+Math.imul(de,ee)|0,j=j+Math.imul(de,ie)|0;var zt=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(zt>>>26)|0,zt&=67108863,B=Math.imul(fe,xn),P=Math.imul(fe,kt),P=P+Math.imul(ye,xn)|0,j=Math.imul(ye,kt),B=B+Math.imul(Z,It)|0,P=P+Math.imul(Z,rt)|0,P=P+Math.imul(se,It)|0,j=j+Math.imul(se,rt)|0,B=B+Math.imul(Ne,yt)|0,P=P+Math.imul(Ne,pt)|0,P=P+Math.imul(J,yt)|0,j=j+Math.imul(J,pt)|0,B=B+Math.imul(Ye,qe)|0,P=P+Math.imul(Ye,Et)|0,P=P+Math.imul(tt,qe)|0,j=j+Math.imul(tt,Et)|0,B=B+Math.imul(Lt,wt)|0,P=P+Math.imul(Lt,ot)|0,P=P+Math.imul(Qe,wt)|0,j=j+Math.imul(Qe,ot)|0,B=B+Math.imul(ft,mt)|0,P=P+Math.imul(ft,Bt)|0,P=P+Math.imul(it,mt)|0,j=j+Math.imul(it,Bt)|0,B=B+Math.imul(Ge,Ve)|0,P=P+Math.imul(Ge,st)|0,P=P+Math.imul(je,Ve)|0,j=j+Math.imul(je,st)|0,B=B+Math.imul(Be,ee)|0,P=P+Math.imul(Be,ie)|0,P=P+Math.imul($e,ee)|0,j=j+Math.imul($e,ie)|0;var kn=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(kn>>>26)|0,kn&=67108863,B=Math.imul(fe,It),P=Math.imul(fe,rt),P=P+Math.imul(ye,It)|0,j=Math.imul(ye,rt),B=B+Math.imul(Z,yt)|0,P=P+Math.imul(Z,pt)|0,P=P+Math.imul(se,yt)|0,j=j+Math.imul(se,pt)|0,B=B+Math.imul(Ne,qe)|0,P=P+Math.imul(Ne,Et)|0,P=P+Math.imul(J,qe)|0,j=j+Math.imul(J,Et)|0,B=B+Math.imul(Ye,wt)|0,P=P+Math.imul(Ye,ot)|0,P=P+Math.imul(tt,wt)|0,j=j+Math.imul(tt,ot)|0,B=B+Math.imul(Lt,mt)|0,P=P+Math.imul(Lt,Bt)|0,P=P+Math.imul(Qe,mt)|0,j=j+Math.imul(Qe,Bt)|0,B=B+Math.imul(ft,Ve)|0,P=P+Math.imul(ft,st)|0,P=P+Math.imul(it,Ve)|0,j=j+Math.imul(it,st)|0,B=B+Math.imul(Ge,ee)|0,P=P+Math.imul(Ge,ie)|0,P=P+Math.imul(je,ee)|0,j=j+Math.imul(je,ie)|0;
vendor: 16,384 bytes, line 123
123var Cn=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,B=Math.imul(fe,yt),P=Math.imul(fe,pt),P=P+Math.imul(ye,yt)|0,j=Math.imul(ye,pt),B=B+Math.imul(Z,qe)|0,P=P+Math.imul(Z,Et)|0,P=P+Math.imul(se,qe)|0,j=j+Math.imul(se,Et)|0,B=B+Math.imul(Ne,wt)|0,P=P+Math.imul(Ne,ot)|0,P=P+Math.imul(J,wt)|0,j=j+Math.imul(J,ot)|0,B=B+Math.imul(Ye,mt)|0,P=P+Math.imul(Ye,Bt)|0,P=P+Math.imul(tt,mt)|0,j=j+Math.imul(tt,Bt)|0,B=B+Math.imul(Lt,Ve)|0,P=P+Math.imul(Lt,st)|0,P=P+Math.imul(Qe,Ve)|0,j=j+Math.imul(Qe,st)|0,B=B+Math.imul(ft,ee)|0,P=P+Math.imul(ft,ie)|0,P=P+Math.imul(it,ee)|0,j=j+Math.imul(it,ie)|0;var Hn=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,B=Math.imul(fe,qe),P=Math.imul(fe,Et),P=P+Math.imul(ye,qe)|0,j=Math.imul(ye,Et),B=B+Math.imul(Z,wt)|0,P=P+Math.imul(Z,ot)|0,P=P+Math.imul(se,wt)|0,j=j+Math.imul(se,ot)|0,B=B+Math.imul(Ne,mt)|0,P=P+Math.imul(Ne,Bt)|0,P=P+Math.imul(J,mt)|0,j=j+Math.imul(J,Bt)|0,B=B+Math.imul(Ye,Ve)|0,P=P+Math.imul(Ye,st)|0,P=P+Math.imul(tt,Ve)|0,j=j+Math.imul(tt,st)|0,B=B+Math.imul(Lt,ee)|0,P=P+Math.imul(Lt,ie)|0,P=P+Math.imul(Qe,ee)|0,j=j+Math.imul(Qe,ie)|0;var xr=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(xr>>>26)|0,xr&=67108863,B=Math.imul(fe,wt),P=Math.imul(fe,ot),P=P+Math.imul(ye,wt)|0,j=Math.imul(ye,ot),B=B+Math.imul(Z,mt)|0,P=P+Math.imul(Z,Bt)|0,P=P+Math.imul(se,mt)|0,j=j+Math.imul(se,Bt)|0,B=B+Math.imul(Ne,Ve)|0,P=P+Math.imul(Ne,st)|0,P=P+Math.imul(J,Ve)|0,j=j+Math.imul(J,st)|0,B=B+Math.imul(Ye,ee)|0,P=P+Math.imul(Ye,ie)|0,P=P+Math.imul(tt,ee)|0,j=j+Math.imul(tt,ie)|0;var hr=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(hr>>>26)|0,hr&=67108863,B=Math.imul(fe,mt),P=Math.imul(fe,Bt),P=P+Math.imul(ye,mt)|0,j=Math.imul(ye,Bt),B=B+Math.imul(Z,Ve)|0,P=P+Math.imul(Z,st)|0,P=P+Math.imul(se,Ve)|0,j=j+Math.imul(se,st)|0,B=B+Math.imul(Ne,ee)|0,P=P+Math.imul(Ne,ie)|0,P=P+Math.imul(J,ee)|0,j=j+Math.imul(J,ie)|0;var Er=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(Er>>>26)|0,Er&=67108863,B=Math.imul(fe,Ve),P=Math.imul(fe,st),P=P+Math.imul(ye,Ve)|0,j=Math.imul(ye,st),B=B+Math.imul(Z,ee)|0,P=P+Math.imul(Z,ie)|0,P=P+Math.imul(se,ee)|0,j=j+Math.imul(se,ie)|0;var Fn=(V+B|0)+((P&8191)<<13)|0;V=(j+(P>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,B=Math.imul(fe,ee),P=Math.imul(fe,ie),P=P+Math.imul(ye,ee)|0,j=Math.imul(ye,ie);var ti=(V+B|0)+((P&8191)<<13)|0;return V=(j+(P>>>13)|0)+(ti>>>26)|0,ti&=67108863,D[0]=ce,D[1]=le,D[2]=_e,D[3]=me,D[4]=we,D[5]=Te,D[6]=Ct,D[7]=at,D[8]=Gt,D[9]=Dt,D[10]=zt,D[11]=kn,D[12]=Cn,D[13]=Hn,D[14]=xr,D[15]=hr,D[16]=Er,D[17]=Fn,D[18]=ti,V!==0&&(D[19]=V,M.length++),M};Math.imul||(C=b);function x(L,S,k){k.negative=S.negative^L.negative,k.length=L.length+S.length;for(var M=0,W=0,H=0;H<k.length-1;H++){var D=W;W=0;for(var V=M&67108863,B=Math.min(H,S.length-1),P=Math.max(0,H-L.length+1);P<=B;P++){var j=H-P,G=L.words[j]|0,Y=S.words[P]|0,te=G*Y,ae=te&67108863;D=D+(te/67108864|0)|0,ae=ae+V|0,V=ae&67108863,D=D+(ae>>>26)|0,W+=D>>>26,D&=67108863}k.words[H]=V,M=D,D=W}return M!==0?k.words[H]=M:k.length--,k._strip()}function _(L,S,k){return x(L,S,k)}s.prototype.mulTo=function(S,k){var M,W=this.length+S.length;return this.length===10&&S.length===10?M=C(this,S,k):W<63?M=b(this,S,k):W<1024?M=x(this,S,k):M=_(this,S,k),M},s.prototype.mul=function(S){var k=new s(null);return k.words=new Array(this.length+S.length),this.mulTo(S,k)},s.prototype.mulf=function(S){var k=new s(null);return k.words=new Array(this.length+S.length),_(this,S,k)},s.prototype.imul=function(S){return this.clone().mulTo(S,this)},s.prototype.imuln=function(S){var k=S<0;k&&(S=-S),r(typeof S=="number"),r(S<67108864);for(var M=0,W=0;W<this.length;W++){var H=(this.words[W]|0)*S,D=(H&67108863)+(M&67108863);M>>=26,M+=H/67108864|0,M+=D>>>26,this.words[W]=D&67108863}return M!==0&&(this.words[W]=M,this.length++),this.length=S===0?1:this.length,k?this.ineg():this},s.prototype.muln=function(S){return this.clone().imuln(S)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(S){var k=v(S);if(k.length===0)return new s(1);for(var M=this,W=0;W<k.length&&k[W]===0;W++,M=M.sqr());if(++W<k.length)for(var H=M.sqr();W<k.length;W++,H=H.sqr())k[W]!==0&&(M=M.mul(H));return M},s.prototype.iushln=function(S){r(typeof S=="number"&&S>=0);var k=S%26,M=(S-k)/26,W=67108863>>>26-k<<26-k,H;if(k!==0){var D=0;for(H=0;H<this.length;H++){var V=this.words[H]&W,B=(this.words[H]|0)-V<<k;this.words[H]=B|D,D=V>>>26-k}D&&(this.words[H]=D,this.length++)}if(M!==0){for(H=this.length-1;H>=0;H--)this.words[H+M]=this.words[H];for(H=0;H<M;H++)this.words[H]=0;this.length+=M}return this._strip()},s.prototype.ishln=function(S){return r(this.negative===0),this.iushln(S)},s.prototype.iushrn=function(S,k,M){r(typeof S=="number"&&S>=0);var W;k?W=(k-k%26)/26:W=0;var H=S%26,D=Math.min((S-H)/26,this.length),V=67108863^67108863>>>H<<H,B=M;if(W-=D,W=Math.max(0,W),B){for(var P=0;P<D;P++)B.words[P]=this.words[P];B.length=D}if(D!==0)if(this.length>D)for(this.length-=D,P=0;P<this.length;P++)this.words[P]=this.words[P+D];else this.words[0]=0,this.length=1;var j=0;for(P=this.length-1;P>=0&&(j!==0||P>=W);P--){var G=this.words[P]|0;this.words[P]=j<<26-H|G>>>H,j=G&V}return B&&j!==0&&(B.words[B.length++]=j),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(S,k,M){return r(this.negative===0),this.iushrn(S,k,M)},s.prototype.shln=function(S){return this.clone().ishln(S)},s.prototype.ushln=function(S){return this.clone().iushln(S)},s.prototype.shrn=function(S){return this.clone().ishrn(S)},s.prototype.ushrn=function(S){return this.clone().iushrn(S)},s.prototype.testn=function(S){r(typeof S=="number"&&S>=0);var k=S%26,M=(S-k)/26,W=1<<k;if(this.length<=M)return!1;var H=this.words[M];return!!(H&W)},s.prototype.imaskn=function(S){r(typeof S=="number"&&S>=0);var k=S%26,M=(S-k)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=M)return this;if(k!==0&&M++,this.length=Math.min(M,this.length),k!==0){var W=67108863^67108863>>>k<<k;this.words[this.length-1]&=W}return this._strip()},s.prototype.maskn=function(S){return this.clone().imaskn(S)},s.prototype.iaddn=function(S){return r(typeof S=="number"),r(S<67108864),S<0?this.isubn(-S):this.negative!==0?this.length===1&&(this.words[0]|0)<=S?(this.words[0]=S-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(S),this.negative=1,this):this._iaddn(S)},s.prototype._iaddn=function(S){this.words[0]+=S;for(var k=0;k<this.length&&this.words[k]>=67108864;k++)this.words[k]-=67108864,k===this.length-1?this.words[k+1]=1:this.words[k+1]++;return this.length=Math.max(this.length,k+1),this},s.prototype.isubn=function(S){if(r(typeof S=="number"),r(S<67108864),S<0)return this.iaddn(-S);if(this.negative!==0)return this.negative=0,this.iaddn(S),this.negative=1,this;if(this.words[0]-=S,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var k=0;k<this.length&&this.words[k]<0;k++)this.words[k]+=67108864,this.words[k+1]-=1;return this._strip()},s.prototype.addn=function(S){return this.clone().iaddn(S)},s.prototype.subn=function(S){return this.clone().isubn(S)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(S,k,M){var W=S.length+M,H;this._expand(W);var D,V=0;for(H=0;H<S.length;H++){D=(this.words[H+M]|0)+V;var B=(S.words[H]|0)*k;D-=B&67108863,V=(D>>26)-(B/67108864|0),this.words[H+M]=D&67108863}for(;H<this.length-M;H++)D=(this.words[H+M]|0)+V,V=D>>26,this.words[H+M]=D&67108863;if(V===0)return this._strip();for(r(V===-1),V=0,H=0;H<this.length;H++)D=-(this.words[H]|0)+V,V=D>>26,this.words[H]=D&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(S,k){var M=this.length-S.length,W=this.clone(),H=S,D=H.words[H.length-1]|0,V=this._countBits(D);M=26-V,M!==0&&(H=H.ushln(M),W.iushln(M),D=H.words[H.length-1]|0);var B=W.length-H.length,P;if(k!=="mod"){P=new s(null),P.length=B+1,P.words=new Array(P.length);for(var j=0;j<P.length;j++)P.words[j]=0}var G=W.clone()._ishlnsubmul(H,1,B);G.negative===0&&(W=G,P&&(P.words[B]=1));for(var Y=B-1;Y>=0;Y--){var te=(W.words[H.length+Y]|0)*67108864+(W.words[H.length+Y-1]|0);for(te=Math.min(te/D|0,67108863),W._ishlnsubmul(H,te,Y);W.negative!==0;)te--,W.negative=0,W._ishlnsubmul(H,1,Y),W.isZero()||(W.negative^=1);P&&(P.words[Y]=te)}return P&&P._strip(),W._strip(),k!=="div"&&M!==0&&W.iushrn(M),{div:P||null,mod:W}},s.prototype.divmod=function(S,k,M){if(r(!S.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var W,H,D;return this.negative!==0&&S.negative===0?(D=this.neg().divmod(S,k),k!=="mod"&&(W=D.div.neg()),k!=="div"&&(H=D.mod.neg(),M&&H.negative!==0&&H.iadd(S)),{div:W,mod:H}):this.negative===0&&S.negative!==0?(D=this.divmod(S.neg(),k),k!=="mod"&&(W=D.div.neg()),{div:W,mod:D.mod}):(this.negative&S.negative)!==0?(D=this.neg().divmod(S.neg(),k),k!=="div"&&(H=D.mod.neg(),M&&H.negative!==0&&H.isub(S)),{div:D.div,mod:H}):S.length>this.length||this.cmp(S)<0?{div:new s(0),mod:this}:S.length===1?k==="div"?{div:this.divn(S.words[0]),mod:null}:k==="mod"?{div:null,mod:new s(this.modrn(S.words[0]))}:{div:this.divn(S.words[0]),mod:new s(this.modrn(S.words[0]))}:this._wordDiv(S,k)},s.prototype.div=function(S){return this.divmod(S,"div",!1).div},s.prototype.mod=function(S){return this.divmod(S,"mod",!1).mod},s.prototype.umod=function(S){return this.divmod(S,"mod",!0).mod},s.prototype.divRound=function(S){var k=this.divmod(S);if(k.mod.isZero())return k.div;var M=k.div.negative!==0?k.mod.isub(S):k.mod,W=S.ushrn(1),H=S.andln(1),D=M.cmp(W);return D<0||H===1&&D===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},s.prototype.modrn=function(S){var k=S<0;k&&(S=-S),r(S<=67108863);for(var M=(1<<26)%S,W=0,H=this.length-1;H>=0;H--)W=(M*W+(this.words[H]|0))%S;return k?-W:W},s.prototype.modn=function(S){return this.modrn(S)},s.prototype.idivn=function(S){var k=S<0;k&&(S=-S),r(S<=67108863);for(var M=0,W=this.length-1;W>=0;W--){var H=(this.words[W]|0)+M*67108864;this.words[W]=H/S|0,M=H%S}return this._strip(),k?this.ineg():this},s.prototype.divn=function(S){return this.clone().idivn(S)},s.prototype.egcd=function(S){r(S.negative===0),r(!S.isZero());var k=this,M=S.clone();k.negative!==0?k=k.umod(S):k=k.clone();for(var W=new s(1),H=new s(0),D=new s(0),V=new s(1),B=0;k.isEven()&&M.isEven();)k.iushrn(1),M.iushrn(1),++B;for(var P=M.clone(),j=k.clone();!k.isZero();){for(var G=0,Y=1;(k.words[0]&Y)===0&&G<26;++G,Y<<=1);if(G>0)for(k.iushrn(G);G-- >0;)(W.isOdd()||H.isOdd())&&(W.iadd(P),H.isub(j)),W.iushrn(1),H.iushrn(1);for(var te=0,ae=1;(M.words[0]&ae)===0&&te<26;++te,ae<<=1);if(te>0)for(M.iushrn(te);te-- >0;)(D.isOdd()||V.isOdd())&&(D.iadd(P),V.isub(j)),D.iushrn(1),V.iushrn(1);k.cmp(M)>=0?(k.isub(M),W.isub(D),H.isub(V)):(M.isub(k),D.isub(W),V.isub(H))}return{a:D,b:V,gcd:M.iushln(B)}},s.prototype._invmp=function(S){r(S.negative===0),r(!S.isZero());var k=this,M=S.clone();k.negative!==0?k=k.umod(S):k=k.clone();for(var W=new s(1),H=new s(0),D=M.clone();k.cmpn(1)>0&&M.cmpn(1)>0;){for(var V=0,B=1;(k.words[0]&B)===0&&V<26;++V,B<<=1);if(V>0)for(k.iushrn(V);V-- >0;)W.isOdd()&&W.iadd(D),W.iushrn(1);for(var P=0,j=1;(M.words[0]&j)===0&&P<26;++P,j<<=1);if(P>0)for(M.iushrn(P);P-- >0;)H.isOdd()&&H.iadd(D),H.iushrn(1);k.cmp(M)>=0?(k.isub(M),W.isub(H)):(M.isub(k),H.isub(W))}var G;return k.cmpn(1)===0?G=W:G=H,G.cmpn(0)<0&&G.iadd(S),G},s.prototype.gcd=function(S){if(this.isZero())return S.abs();if(S.isZero())return this.abs();var k=this.clone(),M=S.clone();k.negative=0,M.negative=0;for(var W=0;k.isEven()&&M.isEven();W++)k.iushrn(1),M.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;M.isEven();)M.iushrn(1);var H=k.cmp(M);if(H<0){var D=k;k=M,M=D}else if(H===0||M.cmpn(1)===0)break;k.isub(M)}while(!0);return M.iushln(W)},s.prototype.invm=function(S){return this.egcd(S).a.umod(S)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(S){return this.words[0]&S},s.prototype.bincn=function(S){r(typeof S=="number");var k=S%26,M=(S-k)/26,W=1<<k;if(this.length<=M)return this._expand(M+1),this.words[M]|=W,this;for(var H=W,D=M;H!==0&&D<this.length;D++){var V=this.words[D]|0;V+=H,H=V>>>26,V&=67108863,this.words[D]=V}return H!==0&&(this.words[D]=H,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(S){var k=S<0;if(this.negative!==0&&!k)return-1;if(this.negative===0&&k)return 1;this._strip();var M;if(this.length>1)M=1;else{k&&(S=-S),r(S<=67108863,"Number is too big");var W=this.words[0]|0;M=W===S?0:W<S?-1:1}return this.negative!==0?-M|0:M},s.prototype.cmp=function(S){if(this.negative!==0&&S.negative===0)return-1;if(this.negative===0&&S.negative!==0)return 1;var k=this.ucmp(S);return this.negative!==0?-k|0:k},s.prototype.ucmp=function(S){if(this.length>S.length)return 1;if(this.length<S.length)return-1;for(var k=0,M=this.length-1;M>=0;M--){var W=this.words[M]|0,H=S.words[M]|0;if(W!==H){W<H?k=-1:W>H&&(k=1);break}}return k},s.prototype.gtn=function(S){return this.cmpn(S)===1},s.prototype.gt=function(S){return this.cmp(S)===1},s.prototype.gten=function(S){return this.cmpn(S)>=0},s.prototype.gte=function(S){return this.cmp(S)>=0},s.prototype.ltn=function(S){return this.cmpn(S)===-1},s.prototype.lt=function(S){return this.cmp(S)===-1},s.prototype.lten=function(S){return this.cmpn(S)<=0},s.prototype.lte=function(S){return this.cmp(S)<=0},s.prototype.eqn=function(S){return this.cmpn(S)===0},s.prototype.eq=function(S){return this.cmp(S)===0},s.red=function(S){return new U(S)},s.prototype.toRed=function(S){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),S.convertTo(this)._forceRed(S)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(S){return this.red=S,this},s.prototype.forceRed=function(S){return r(!this.red,"Already a number in reduction context"),this._forceRed(S)},s.prototype.redAdd=function(S){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,S)},s.prototype.redIAdd=function(S){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,S)},s.prototype.redSub=function(S){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,S)},s.prototype.redISub=function(S){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,S)},s.prototype.redShl=function(S){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,S)},s.prototype.redMul=function(S){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,S),this.red.mul(this,S)},s.prototype.redIMul=function(S){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,S),this.red.imul(this,S)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(S){return r(this.red&&!S.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,S)};var $={k256:null,p224:null,p192:null,p25519:null};function I(L,S){this.name=L,this.p=new s(S,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}I.prototype._tmp=function(){var S=new s(null);return S.words=new Array(Math.ceil(this.n/13)),S},I.prototype.ireduce=function(S){var k=S,M;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),M=k.bitLength();while(M>this.n);var W=M<this.n?-1:k.ucmp(this.p);return W===0?(k.words[0]=0,k.length=1):W>0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},I.prototype.split=function(S,k){S.iushrn(this.n,0,k)},I.prototype.imulK=function(S){return S.imul(this.k)};function R(){I.call(this,"k256","ffffffff fff
123fffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(R,I),R.prototype.split=function(S,k){for(var M=4194303,W=Math.min(S.length,9),H=0;H<W;H++)k.words[H]=S.words[H];if(k.length=W,S.length<=9){S.words[0]=0,S.length=1;return}var D=S.words[9];for(k.words[k.length++]=D&M,H=10;H<S.length;H++){var V=S.words[H]|0;S.words[H-10]=(V&M)<<4|D>>>22,D=V}D>>>=22,S.words[H-10]=D,D===0&&S.length>10?S.length-=10:S.length-=9},R.prototype.imulK=function(S){S.words[S.length]=0,S.words[S.length+1]=0,S.length+=2;for(var k=0,M=0;M<S.length;M++){var W=S.words[M]|0;k+=W*977,S.words[M]=k&67108863,k=W*64+(k/67108864|0)}return S.words[S.length-1]===0&&(S.length--,S.words[S.length-1]===0&&S.length--),S};function N(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(N,I);function T(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(T,I);function O(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(O,I),O.prototype.imulK=function(S){for(var k=0,M=0;M<S.length;M++){var W=(S.words[M]|0)*19+k,H=W&67108863;W>>>=26,S.words[M]=H,k=W}return k!==0&&(S.words[S.length++]=k),S},s._prime=function(S){if($[S])return $[S];var k;if(S==="k256")k=new R;else if(S==="p224")k=new N;else if(S==="p192")k=new T;else if(S==="p25519")k=new O;else throw new Error("Unknown prime "+S);return $[S]=k,k};function U(L){if(typeof L=="string"){var S=s._prime(L);this.m=S.p,this.prime=S}else r(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}U.prototype._verify1=function(S){r(S.negative===0,"red works only with positives"),r(S.red,"red works only with red numbers")},U.prototype._verify2=function(S,k){r((S.negative|k.negative)===0,"red works only with positives"),r(S.red&&S.red===k.red,"red works only with red numbers")},U.prototype.imod=function(S){return this.prime?this.prime.ireduce(S)._forceRed(this):(u(S,S.umod(this.m)._forceRed(this)),S)},U.prototype.neg=function(S){return S.isZero()?S.clone():this.m.sub(S)._forceRed(this)},U.prototype.add=function(S,k){this._verify2(S,k);var M=S.add(k);return M.cmp(this.m)>=0&&M.isub(this.m),M._forceRed(this)},U.prototype.iadd=function(S,k){this._verify2(S,k);var M=S.iadd(k);return M.cmp(this.m)>=0&&M.isub(this.m),M},U.prototype.sub=function(S,k){this._verify2(S,k);var M=S.sub(k);return M.cmpn(0)<0&&M.iadd(this.m),M._forceRed(this)},U.prototype.isub=function(S,k){this._verify2(S,k);var M=S.isub(k);return M.cmpn(0)<0&&M.iadd(this.m),M},U.prototype.shl=function(S,k){return this._verify1(S),this.imod(S.ushln(k))},U.prototype.imul=function(S,k){return this._verify2(S,k),this.imod(S.imul(k))},U.prototype.mul=function(S,k){return this._verify2(S,k),this.imod(S.mul(k))},U.prototype.isqr=function(S){return this.imul(S,S.clone())},U.prototype.sqr=function(S){return this.mul(S,S)},U.prototype.sqrt=function(S){if(S.isZero())return S.clone();var k=this.m.andln(3);if(r(k%2===1),k===3){var M=this.m.add(new s(1)).iushrn(2);return this.pow(S,M)}for(var W=this.m.subn(1),H=0;!W.isZero()&&W.andln(1)===0;)H++,W.iushrn(1);r(!W.isZero());var D=new s(1).toRed(this),V=D.redNeg(),B=this.m.subn(1).iushrn(1),P=this.m.bitLength();for(P=new s(2*P*P).toRed(this);this.pow(P,B).cmp(V)!==0;)P.redIAdd(V);for(var j=this.pow(P,W),G=this.pow(S,W.addn(1).iushrn(1)),Y=this.pow(S,W),te=H;Y.cmp(D)!==0;){for(var ae=Y,oe=0;ae.cmp(D)!==0;oe++)ae=ae.redSqr();r(oe<te);var de=this.pow(j,new s(1).iushln(te-oe-1));G=G.redMul(de),j=de.redSqr(),Y=Y.redMul(j),te=oe}return G},U.prototype.invm=function(S){var k=S._invmp(this.m);return k.negative!==0?(k.negative=0,this.imod(k).redNeg()):this.imod(k)},U.prototype.pow=function(S,k){if(k.isZero())return new s(1).toRed(this);if(k.cmpn(1)===0)return S.clone();var M=4,W=new Array(1<<M);W[0]=new s(1).toRed(this),W[1]=S;for(var H=2;H<W.length;H++)W[H]=this.mul(W[H-1],S);var D=W[0],V=0,B=0,P=k.bitLength()%26;for(P===0&&(P=26),H=k.length-1;H>=0;H--){for(var j=k.words[H],G=P-1;G>=0;G--){var Y=j>>G&1;if(D!==W[0]&&(D=this.sqr(D)),Y===0&&V===0){B=0;continue}V<<=1,V|=Y,B++,!(B!==M&&(H!==0||G!==0))&&(D=this.mul(D,W[V]),B=0,V=0)}P=26}return D},U.prototype.convertTo=function(S){var k=S.umod(this.m);return k===S?k.clone():k},U.prototype.convertFrom=function(S){var k=S.clone();return k.red=null,k},s.mont=function(S){return new z(S)};function z(L){U.call(this,L),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(z,U),z.prototype.convertTo=function(S){return this.imod(S.ushln(this.shift))},z.prototype.convertFrom=function(S){var k=this.imod(S.mul(this.rinv));return k.red=null,k},z.prototype.imul=function(S,k){if(S.isZero()||k.isZero())return S.words[0]=0,S.length=1,S;var M=S.imul(k),W=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=M.isub(W).iushrn(this.shift),D=H;return H.cmp(this.m)>=0?D=H.isub(this.m):H.cmpn(0)<0&&(D=H.iadd(this.m)),D._forceRed(this)},z.prototype.mul=function(S,k){if(S.isZero()||k.isZero())return new s(0)._forceRed(this);var M=S.mul(k),W=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=M.isub(W).iushrn(this.shift),D=H;return H.cmp(this.m)>=0?D=H.isub(this.m):H.cmpn(0)<0&&(D=H.iadd(this.m)),D._forceRed(this)},z.prototype.invm=function(S){var k=this.imod(S._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(t,_Me)}(l8)),l8.exports}var SMe=fle();const Qq=ys(SMe);var f$={exports:{}},Xq;function AMe(){return Xq||(Xq=1,function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,d,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var f=new i(u,d||c,h),m=n?n+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],f]:c._events[m].push(f):(c._events[m]=f,c._eventsCount++),c}
123function o(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,d;if(this._eventsCount===0)return l;for(d in u=this._events)e.call(u,d)&&l.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=n?n+l:l,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,f=d.length,m=new Array(f);h<f;h++)m[h]=d[h].fn;return m},a.prototype.listenerCount=function(l){var u=n?n+l:l,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(l,u,d,h,f,m){var y=n?n+l:l;if(!this._events[y])return!1;var v=this._events[y],b=arguments.length,C,x;if(v.fn){switch(v.once&&this.removeListener(l,v.fn,void 0,!0),b){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,u),!0;case 3:return v.fn.call(v.context,u,d),!0;case 4:return v.fn.call(v.context,u,d,h),!0;case 5:return v.fn.call(v.context,u,d,h,f),!0;case 6:return v.fn.call(v.context,u,d,h,f,m),!0}for(x=1,C=new Array(b-1);x<b;x++)C[x-1]=arguments[x];v.fn.apply(v.context,C)}else{var _=v.length,$;for(x=0;x<_;x++)switch(v[x].once&&this.removeListener(l,v[x].fn,void 0,!0),b){case 1:v[x].fn.call(v[x].context);break;case 2:v[x].fn.call(v[x].context,u);break;case 3:v[x].fn.call(v[x].context,u,d);break;case 4:v[x].fn.call(v[x].context,u,d,h);break;default:if(!C)for($=1,C=new Array(b-1);$<b;$++)C[$-1]=arguments[$];v[x].fn.apply(v[x].context,C)}}return!0},a.prototype.on=function(l,u,d){return s(this,l,u,d,!1)},a.prototype.once=function(l,u,d){return s(this,l,u,d,!0)},a.prototype.removeListener=function(l,u,d,h){var f=n?n+l:l;if(!this._events[f])return this;if(!u)return o(this,f),this;var m=this._events[f];if(m.fn)m.fn===u&&(!h||m.once)&&(!d||m.context===d)&&o(this,f);else{for(var y=0,v=[],b=m.length;y<b;y++)(m[y].fn!==u||h&&!m[y].once||d&&m[y].context!==d)&&v.push(m[y]);v.length?this._events[f]=v.length===1?v[0]:v:o(this,f)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&o(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(f$)),f$.exports}var kMe=AMe();const wp=ys(kMe);let F4;const $Me=new Uint8Array(16);function IMe(){if(!F4&&(F4=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!F4))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return F4($Me)}const _s=[];for(let t=0;t<256;++t)_s.push((t+256).toString(16).slice(1));function TMe(t,e=0){return _s[t[e+0]]+_s[t[e+1]]+_s[t[e+2]]+_s[t[e+3]]+"-"+_s[t[e+4]]+_s[t[e+5]]+"-"+_s[t[e+6]]+_s[t[e+7]]+"-"+_s[t[e+8]]+_s[t[e+9]]+"-"+_s[t[e+10]]+_s[t[e+11]]+_s[t[e+12]]+_s[t[e+13]]+_s[t[e+14]]+_s[t[e+15]]}const PMe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jq={randomUUID:PMe};function ple(t,e,n){if(Jq.randomUUID&&!t)return Jq.randomUUID();t=t||{};const r=t.random||(t.rng||IMe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,TMe(r)}/*! js-cookie v3.0.5 | MIT */function U4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var RMe={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function wM(t,e){function n(i,s,o){if(!(typeof document>"u")){o=U4({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var c in o)o[c]&&(a+="; "+c,o[c]!==!0&&(a+="="+o[c].split(";")[0]));return document.cookie=i+"="+t.write(s,i)+a}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],o={},a=0;a<s.length;a++){var c=s[a].split("="),l=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(o[u]=t.read(l,u),i===u)break}catch{}}return i?o[i]:o}}return Object.create({set:n,get:r,remove:function(i,s){n(i,"",U4({},s,{expires:-1}))},withAttributes:function(i){return wM(this.converter,U4({},this.attributes,i))},withConverter:function(i){return wM(U4({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var ru=wM(RMe,{path:"/"});let MMe=new Set([S5.id,UC.id,_5.id,A5.id,ule.id,dle.id]),OMe=new Set([S5.id,UC.id,sL.id,_5.id,A5.id]);function jMe(t,e){switch(e){case"native-currency":return MMe.has(t);case"USDC":return OMe.has(t);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}}function NMe(t,e){switch(t){case UC.id:return e==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case ule.id:return"AVAX_CCHAIN";case _5.id:return e==="native-currency"?"ETH_BASE":"USDC_BASE";case dle.id:return"CELO_CELO";case A5.id:return e==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case S5.id:return e==="native-currency"?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${t} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}const DMe={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"470123456",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"0195123456",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"34412345",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"67622901",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"2221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"},gle
vendor: 12,748 bytes, line 123
123={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:2(?:(?:[0-26-9]\\d|3[0-8]|5[0135-9])\\d|4(?:[02-9]\\d|10))|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90))|7(?:[013-57-9]\\d|2[0-8])\\d)\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|[24-689])\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}
vendor: 18,150 bytes, line 123
123|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])
vendor: 9,367 bytes, line 123
123))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2
vendor: 4,571 bytes, line 123
123-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",[6,7,8,9,10,11]],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2
vendor: 14,743 bytes, line 123
123-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-8]|5[0-3]|8[0-7]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}
vendor: 7,500 bytes, line 123
123(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,0,[["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8
vendor: 16,844 bytes, line 123
123(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[0-68]))\\d{4}|(?:2742|305[3-9]|472[247-9]|505[2-57-9]|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function
123zC(t,e){var n=Array.prototype.slice.call(e);return n.push(gle),t.apply(this,n)}function LMe(){return zC(sRe,arguments)}function t3(t){return cle.call(this,t,gle)}t3.prototype=Object.create(cle.prototype,{});t3.prototype.constructor=t3;function BMe(){return zC(dMe,arguments)}function oL(){return zC(LC,arguments)}function FMe(){return zC(hMe,arguments)}const z4=(t,e)=>LMe(String(t),e),p$=(t,e)=>`+${oL(e)} ${t}`,UMe=t=>`*${t.replaceAll("-","").slice(-4)}`,zMe=t=>new t3(t),WMe=BMe().map(t=>({code:t,callCode:oL(t)})),HMe=t=>{var n;let e=(n=FMe(t,DMe))==null?void 0:n.formatInternational();return e==null?void 0:e.substring(e.indexOf(" ")+1)},VMe=t=>{let e=new t3;e.input(t);let n=e.getCountry()||"US",r=e.getCallingCode()||"1";return{countryCode:n,phone:t.replace("+"+r,"")}},qMe=(t,e=!0)=>t.reduce((n,r)=>({...n,[r]:e}),{});let KMe=new Set([S5.id,_5.id,sL.id,A5.id,UC.id]),GMe=new Set([S5.id,_5.id,A5.id,sL.id]),ZMe={buy:"CARD",send:"CRYPTO_ACCOUNT"},YMe={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1"};function QMe({input:t,amount:e,blockchain:n,asset:r,experience:i}){let s=new URL("https://pay.coinbase.com/buy/select-asset");return s.searchParams.set("appId",t.app_id),s.searchParams.set("sessionToken",t.session_token),s.searchParams.set("defaultExperience",i),s.searchParams.set("presetCryptoAmount",e.startsWith(".")?`0${e}`:e),s.searchParams.set("defaultNetwork",n),s.searchParams.set("defaultPaymentMethod",ZMe[i]),s.searchParams.set("defaultAsset",YMe[r]),s.searchParams.set("partnerUserId",t.partner_user_id),{url:s}}const XMe=(t,e)=>{switch(e){case"native-currency":return KMe.has(t);case"USDC":return GMe.has(t);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};let JMe=class{async invokeRpc({method:e,params:n}){return await(await fetch(this.cluster.rpcUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:ple(),method:e,params:n})})).json()}async getBalance(e){try{let n=await this.invokeRpc({method:"getBalance",params:[e]});return n.error?null:BigInt(n.result.value)}catch{return null}}async getTokenAccountsByOwner(e,n){var r,i,s,o,a;try{let c=await this.invokeRpc({method:"getTokenAccountsByOwner",params:[e,{mint:n},{encoding:"jsonParsed"}]});if(c.error)return null;let l=(a=(o=(s=(i=(r=c.result.value.at(0))==null?void 0:r.account)==null?void 0:i.data)==null?void 0:s.parsed)==null?void 0:o.info)==null?void 0:a.tokenAmount;return l?{amount:BigInt(l.amount),decimals:l.decimals}:null}catch{return null}}async getAccountInfo(e){var n,r,i;try{let s=await this.invokeRpc({method:"getAccountInfo",params:[e,{encoding:"jsonParsed"}]});if(s.error)return null;let o=(i=(r=(n=s.result.value)==null?void 0:n.data)==null?void 0:r.parsed)==null?void 0:i.info;return o?{decimals:o.decimals}:null}catch{return null}}constructor(e){this.cluster=e}};function eK(t){return t?`${t.slice(0,5)}â¦${t.slice(-4)}`:""}function eOe({wei:t,precision:e=3}){return parseFloat(j1(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function tK({amount:t,decimals:e}){return us(BigInt(t),e)}var W4={exports:{}},nK;
vendor: 5,430 bytes, line 123
123function tOe(){if(nK)return W4.exports;nK=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function($,I,R){return Function.prototype.apply.call($,I,R)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:n=function($){return Object.getOwnPropertyNames($)};function r(_){console&&console.warn&&console.warn(_)}var i=Number.isNaN||function($){return $!==$};function s(){s.init.call(this)}W4.exports=s,W4.exports.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(_){if(typeof _!="number"||_<0||i(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");o=_}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function($){if(typeof $!="number"||$<0||i($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this};function c(_){return _._maxListeners===void 0?s.defaultMaxListeners:_._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function($){for(var I=[],R=1;R<arguments.length;R++)I.push(arguments[R]);var N=$==="error",T=this._events;if(T!==void 0)N=N&&T.error===void 0;else if(!N)return!1;if(N){var O;if(I.length>0&&(O=I[0]),O instanceof Error)throw O;var U=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw U.context=O,U}var z=T[$];if(z===void 0)return!1;if(typeof z=="function")e(z,this,I);else for(var L=z.length,S=m(z,L),R=0;R<L;++R)e(S[R],this,I);return!0};function l(_,$,I,R){var N,T,O;if(a(I),T=_._events,T===void 0?(T=_._events=Object.create(null),_._eventsCount=0):(T.newListener!==void 0&&(_.emit("newListener",$,I.listener?I.listener:I),T=_._events),O=T[$]),O===void 0)O=T[$]=I,++_._eventsCount;else if(typeof O=="function"?O=T[$]=R?[I,O]:[O,I]:R?O.unshift(I):O.push(I),N=c(_),N>0&&O.length>N&&!O.warned){O.warned=!0;var U=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");U.name="MaxListenersExceededWarning",U.emitter=_,U.type=$,U.count=O.length,r(U)}return _}s.prototype.addListener=function($,I){return l(this,$,I,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function($,I){return l(this,$,I,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(_,$,I){var R={fired:!1,wrapFn:void 0,target:_,type:$,listener:I},N=u.bind(R);return N.listener=I,R.wrapFn=N,N}s.prototype.once=function($,I){return a(I),this.on($,d(this,$,I)),this},s.prototype.prependOnceListener=function($,I){return a(I),this.prependListener($,d(this,$,I)),this},s.prototype.removeListener=function($,I){var R,N,T,O,U;if(a(I),N=this._events,N===void 0)return this;if(R=N[$],R===void 0)return this;if(R===I||R.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete N[$],N.removeListener&&this.emit("removeListener",$,R.listener||I));else if(typeof R!="function"){for(T=-1,O=R.length-1;O>=0;O--)if(R[O]===I||R[O].listener===I){U=R[O].listener,T=O;break}if(T<0)return this;T===0?R.shift():y(R,T),R.length===1&&(N[$]=R[0]),N.removeListener!==void 0&&this.emit("removeListener",$,U||I)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function($){var I,R,N;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[$]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[$]),this;if(arguments.length===0){var T=Object.keys(R),O;for(N=0;N<T.length;++N)O=T[N],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=R[$],typeof I=="function")this.removeListener($,I);else if(I!==void 0)for(N=I.length-1;N>=0;N--)this.removeListener($,I[N]);return this};function h(_,$,I){var R=_._events;if(R===void 0)return[];var N=R[$];return N===void 0?[]:typeof N=="function"?I?[N.listener||N]:[N]:I?v(N):m(N,N.length)}s.prototype.listeners=function($){return h(this,$,!0)},s.prototype.rawListeners=function($){return h(this,$,!1)},s.listenerCount=function(_,$){return typeof _.listenerCount=="function"?_.listenerCount($):f.call(_,$)},s.prototype.listenerCount=f;function f(_){var $=this._events;if($!==void 0){var I=$[_];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function m(_,$){for(var I=new Array($),R=0;R<$;++R)I[R]=_[R];return I}function y(_,$){for(;$+1<_.length;$++)_[$]=_[$+1];_.pop()}function v(_){for(var $=new Array(_.length),I=0;I<$.length;
vendor: 16,416 bytes, lines 123-136
123++I)$[I]=_[I].listener||_[I];return $}function b(_,$){return new Promise(function(I,R){function N(O){_.removeListener($,T),R(O)}function T(){typeof _.removeListener=="function"&&_.removeListener("error",N),I([].slice.call(arguments))}x(_,$,T,{once:!0}),$!=="error"&&C(_,N,{once:!0})})}function C(_,$,I){typeof _.on=="function"&&x(_,"error",$,I)}function x(_,$,I,R){if(typeof _.on=="function")R.once?_.once($,I):_.on($,I);else if(typeof _.addEventListener=="function")_.addEventListener($,function N(T){R.once&&_.removeEventListener($,N),I(T)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}return W4.exports}var Wa=tOe();const aL=ys(Wa);var rK=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},nOe=function(){function t(e,n,r){this.name=e,this.version=n,this.os=r,this.type="browser"}return t}(),rOe=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),iOe=function(){function t(e,n,r,i){this.name=e,this.version=n,this.os=r,this.bot=i,this.type="bot-device"}return t}(),sOe=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),oOe=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),aOe=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,cOe=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,iK=3,lOe=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",aOe]],sK=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function uOe(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new oOe:typeof navigator<"u"?hOe(navigator.userAgent):pOe()}function dOe(t){return t!==""&&lOe.reduce(function(e,n){var r=n[0],i=n[1];if(e)return e;var s=i.exec(t);return!!s&&[r,s]},!1)}function hOe(t){var e=dOe(t);if(!e)return null;var n=e[0],r=e[1];if(n==="searchbot")return new sOe;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length<iK&&(i=rK(rK([],i,!0),gOe(iK-i.length),!0)):i=[];var s=i.join("."),o=fOe(t),a=cOe.exec(t);return a&&a[1]?new iOe(n,s,o,a[1]):new nOe(n,s,o)}function fOe(t){for(var e=0,n=sK.length;e<n;e++){var r=sK[e],i=r[0],s=r[1],o=s.exec(t);if(o)return i}return null}function pOe(){var t=typeof process<"u"&&process.version;return t?new rOe(process.version.slice(1)):null}function gOe(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}var g$={};/*! ***************************************************************************** 124Copyright (c) Microsoft Corporation. 125 126Permission to use, copy, modify, and/or distribute this software for any 127purpose with or without fee is hereby granted. 128 129THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 130REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 131AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 132INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 133LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 134OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 135PERFORMANCE OF THIS SOFTWARE. 136***************************************************************************** */var vM=function(t,e){return vM=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},vM(t,e)};function mOe(t,e){vM(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var bM=function(){return bM=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},bM.apply(this,arguments)};function yOe(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function wOe(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function vOe(t,e){return function(n,r){e(n,r,t)}}function bOe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function xOe(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{l(r.next(u))}catch(d){o(d)}}function c(u){try{l(r.throw(u))}catch(d){o(d)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((r=r.apply(t,e||[])).next())})}function EOe(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1],s=l;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(l);break}s[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(u){l=[6,u],i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function COe(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}function _Oe(t,e){for(var n in t)n!=="default"&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function xM(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function mle(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function SOe(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(mle(arguments[e]));return t}function AOe(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function n3(t){return this instanceof n3?(this.v=t,this):new n3(t)}function kOe(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){r[h]&&(i[h]=function(f){return new Promise(function(m,y){s.push([h,f,m,y])>1||a(h,f)})})}function a(h,f){try{c(r[h](f))}catch(m){d(s[0][3],m)}}function c(h){h.value instanceof n3?Promise.resolve(h.value.v).then(l,u):d(s[0][2],h)}function l(h){a("next",h)}function u(h){a("throw",h)}function d(h,f){h(f),s.shift(),s.length&&a(s[0][0],s[0][1])}}function $Oe(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=t[i]?function(o){return(n=!n)?{value:n3(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function IOe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof xM=="function"?xM(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function TOe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function POe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function ROe(t){return t&&t.__esModule?t:{default:t}}function MOe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function OOe(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}const jOe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return bM},__asyncDelegator:$Oe,__asyncGenerator:kOe,__asyncValues:IOe,__await:n3,__awaiter:xOe,__classPrivateFieldGet:MOe,__classPrivateFieldSet:OOe,__createBinding:COe,__decorate:wOe,__exportStar:_Oe,__extends:mOe,__generator:EOe,__importDefault:ROe,__importStar:POe,__makeTemplateObject:TOe,__metadata:bOe,__param:vOe,__read:mle,__rest:yOe,__spread:SOe,__spreadArrays:AOe,__values:xM},Symbol.toStringTag,{value:"Module"})),k5=qE(jOe);var m$={},Xw={},oK;function NOe(){if(oK)return Xw;oK=1,Object.defineProperty(Xw,"__esModule",{value:!0}),Xw.delay=void 0;function t(e){return new Promise(n=>{setTimeout(()=>{n(!0)},e)})}return Xw.delay=t,Xw}var Gp={},y$={},Zp={},aK;function DOe(){return aK||(aK=1,Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.ONE_THOUSAND=Zp.ONE_HUNDRED=void 0,Zp.ONE_HUNDRED=100,Zp.ONE_THOUSAND=1e3),Zp}var w$={},cK;function LOe(){return cK||(cK=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(w$)),w$}var lK;function yle(){return lK||(lK=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=k5;e.__exportStar(DOe(),t),e.__exportStar(LOe(),t)}(y$)),y$}var uK;function BOe(){if(uK)return Gp;uK=1,Object.defineProperty(Gp,"__esModule",{value:!0}),Gp.fromMiliseconds=Gp.toMiliseconds=void 0;const t=yle();function e(r){return r*t.ONE_THOUSAND}Gp.toMiliseconds=e;function n(r){return Math.floor(r/t.ONE_THOUSAND)}return Gp.fromMiliseconds=n,Gp}var dK;function FOe(){return dK||(dK=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=k5;e.__exportStar(NOe(),t),e.__exportStar(BOe(),t)}(m$)),m$}var Vg={},hK;function UOe(){if(hK)return Vg;hK=1,Object.defineProperty(Vg,"__esModule",{value:!0}),Vg.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(n){if(this.timestamps.has(n))throw new Error(`Watch already started for label: ${n}`);this.timestamps.set(n,{started:Date.now()})}stop(n){const r=this.get(n);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${n}`);const i=Date.now()-r.started;this.timestamps.set(n,{started:r.started,elapsed:i})}get(n){const r=this.timestamps.get(n);if(typeof r>"u")throw new Error(`No timestamp found for label: ${n}`);return r}elapsed(n){const r=this.get(n);return r.elapsed||Date.now()-r.started}}return Vg.Watch=t,Vg.default=t,Vg}var v$={},Jw={},fK;function zOe(){if(fK)return Jw;fK=1,Object.defineProperty(Jw,"__esModule",{value:!0}),Jw.IWatch=void 0;class t{}return Jw.IWatch=t,Jw}var pK;function WOe(){return pK||(pK=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),k5.__exportStar(zOe(),t)}(v$)),v$}var gK;function HOe(){return gK||(gK=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=k5;e.__exportStar(FOe(),t),e.__exportStar(UOe(),t),e.__exportStar(WOe(),t),e.__exportStar(yle(),t)}(g$)),g$}var Pt=HOe(),Cr={},mK;function wle(){if(mK)return Cr;mK=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.getLocalStorage=Cr.getLocalStorageOrThrow=Cr.getCrypto=Cr.getCryptoOrThrow=Cr.getLocation=Cr.getLocationOrThrow=Cr.getNavigator=Cr.getNavigatorOrThrow=Cr.getDocument=Cr.getDocumentOrThrow=Cr.getFromWindowOrThrow=Cr.getFromWindow=void 0;function t(h){let f;return typeof window<"u"&&typeof window[h]<"u"&&(f=window[h]),f}Cr.getFromWindow=t;function e(h){const f=t(h);if(!f)throw new Error(`${h} is not defined in Window`);return f}Cr.getFromWindowOrThrow=e;function n(){return e("document")}Cr.getDocumentOrThrow=n;function r(){return t("document")}Cr.getDocument=r;function i(){return e("navigator")}Cr.getNavigatorOrThrow=i;function s(){return t("navigator")}Cr.getNavigator=s;function o(){return e("location")}Cr.getLocationOrThrow=o;function a(){return t("location")}Cr.getLocation=a;function c(){return e("crypto")}Cr.getCryptoOrThrow=c;function l(){return t("crypto")}Cr.getCrypto=l;function u(){return e("localStorage")}Cr.getLocalStorageOrThrow=u;function d(){return t("localStorage")}return Cr.getLocalStorage=d,Cr}var eh=wle(),ev={},yK;function VOe(){if(yK)return ev;
136yK=1,Object.defineProperty(ev,"__esModule",{value:!0}),ev.getWindowMetadata=void 0;const t=wle();function e(){let n,r;try{n=t.getDocumentOrThrow(),r=t.getLocationOrThrow()}catch{return null}function i(){const f=n.getElementsByTagName("link"),m=[];for(let y=0;y<f.length;y++){const v=f[y],b=v.getAttribute("rel");if(b&&b.toLowerCase().indexOf("icon")>-1){const C=v.getAttribute("href");if(C)if(C.toLowerCase().indexOf("https:")===-1&&C.toLowerCase().indexOf("http:")===-1&&C.indexOf("//")!==0){let x=r.protocol+"//"+r.host;if(C.indexOf("/")===0)x+=C;else{const _=r.pathname.split("/");_.pop();const $=_.join("/");x+=$+"/"+C}m.push(x)}else if(C.indexOf("//")===0){const x=r.protocol+C;m.push(x)}else m.push(C)}}return m}function s(...f){const m=n.getElementsByTagName("meta");for(let y=0;y<m.length;y++){const v=m[y],b=["itemprop","property","name"].map(C=>v.getAttribute(C)).filter(C=>C?f.includes(C):!1);if(b.length&&b){const C=v.getAttribute("content");if(C)return C}}return""}function o(){let f=s("name","og:site_name","og:title","twitter:title");return f||(f=n.title),f}function a(){return s("description","og:description","twitter:description","keywords")}const c=o(),l=a(),u=r.origin,d=i();return{description:l,url:u,icons:d,name:c}}return ev.getWindowMetadata=e,ev}var qOe=VOe();function r3(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function EM(t){return r3(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const vle="2.31.0";let tv={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:n})=>e?`${t??"https://viem.sh"}${e}${n?`#${n}`:""}`:void 0,version:`viem@${vle}`},WC=class CM extends Error{constructor(e,n={}){var a;const r=(()=>{var c;return n.cause instanceof CM?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof CM&&n.cause.docsPath||n.docsPath,s=(a=tv.getDocsUrl)==null?void 0:a.call(tv,{...n,docsPath:i}),o=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...tv.version?[`Version: ${tv.version}`]:[]].join(` 137`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=e,this.version=vle}walk(e){return ble(this,e)}};function ble(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?ble(t.cause,e):e?null:t}class xle extends WC{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function M2(t,{dir:e,size:n=32}={}){return typeof t=="string"?KOe(t,{dir:e,size:n}):GOe(t,{dir:e,size:n})}function KOe(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new xle({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function GOe(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new xle({size:t.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const s=e==="right";r[s?i:n-i-1]=t[s?i:t.length-i-1]}return r}class ZOe extends WC{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class YOe extends WC{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function O2(t,{size:e}){if(EM(t)>e)throw new YOe({givenSize:EM(t),maxSize:e})}function _M(t,e={}){const{signed:n}=e;e.size&&O2(t,{size:e.size});const r=BigInt(t);if(!n)return r;
137const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function QOe(t,e={}){return Number(_M(t,e))}const XOe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function SM(t,e={}){return typeof t=="number"||typeof t=="bigint"?Cle(t,e):typeof t=="string"?tje(t,e):typeof t=="boolean"?JOe(t,e):Ele(t,e)}function JOe(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(O2(n,{size:e.size}),M2(n,{size:e.size})):n}function Ele(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=XOe[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(O2(r,{size:e.size}),M2(r,{dir:"right",size:e.size})):r}function Cle(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new ZOe({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${t}${c}`})}const a=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?M2(a,{size:r}):a}const eje=new TextEncoder;function tje(t,e={}){const n=eje.encode(t);return Ele(n,e)}const nje=new TextEncoder;function rje(t,e={}){return typeof t=="number"||typeof t=="bigint"?sje(t,e):typeof t=="boolean"?ije(t,e):r3(t)?_le(t,e):Sle(t,e)}function ije(t,e={}){const n=new Uint8Array(1);return n[0]=Number(t),typeof e.size=="number"?(O2(n,{size:e.size}),M2(n,{size:e.size})):n}const id={zero:48,nine:57,A:65,F:70,a:97,f:102};function wK(t){if(t>=id.zero&&t<=id.nine)return t-id.zero;if(t>=id.A&&t<=id.F)return t-(id.A-10);if(t>=id.a&&t<=id.f)return t-(id.a-10)}function _le(t,e={}){let n=t;e.size&&(O2(n,{size:e.size}),n=M2(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=wK(r.charCodeAt(a++)),l=wK(r.charCodeAt(a++));if(c===void 0||l===void 0)throw new WC(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[o]=c*16+l}return s}function sje(t,e){const n=Cle(t,e);return _le(n)}function Sle(t,e={}){const n=nje.encode(t);return typeof e.size=="number"?(O2(n,{size:e.size}),M2(n,{dir:"right",size:e.size})):n}function Ale(t,e){const n=e||"hex",r=zae(r3(t,{strict:!1})?rje(t):t);return n==="bytes"?r:SM(r)}class oje extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const b$=new oje(8192);function aje(t,e){if(b$.has(`${t}.${e}`))return b$.get(`${t}.${e}`);const n=t.substring(2).toLowerCase(),r=Ale(Sle(n),"bytes"),i=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(r[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return b$.set(`${t}.${e}`,s),s}function cje(t){const e=Ale(`0x${t.substring(4)}`).substring(26);return aje(`0x${e}`)}async function lje({hash:t,signature:e}){const n=r3(t)?t:SM(t),{secp256k1:r}=await mr(async()=>{const{secp256k1:o}=await import("./secp256k1-w_xTn9-2.js");return{secp256k1:o}},[]);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:l,s:u,v:d,yParity:h}=e,f=Number(h??d),m=vK(f);return new r.Signature(_M(l),_M(u)).addRecoveryBit(m)}const o=r3(e)?e:SM(e);if(EM(o)!==65)throw new Error("invalid signature length");const a=QOe(`0x${o.slice(130)}`),c=vK(a);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function vK(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function uje({hash:t,signature:e}){return cje(await lje({hash:t,signature:e}))}class kle extends TD{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,hae(e);const r=CC(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),op(s)}update(e){return qy(this),this.iHash.update(e),this}digestInto(e){qy(this),Xd(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const $le=(t,e,n)=>new kle(t,e).update(n).digest();$le.create=(t,e)=>new kle(t,e);function dje(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let l=0;l<e.length;l++)e[l]=255;for(let l=0;l<t.length;l++){const u=t.charAt(l),d=u.charCodeAt(0);if(e[d]!==255)throw new TypeError(u+" is ambiguous");e[d]=l}const n=t.length,r=t.charAt(0),i=Math.log(n)/Math.log(256),s=Math.log(256)/Math.log(n);function o(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let u=0,d=0,h=0;const f=l.length;for(;h!==f&&l[h]===0;)h++,u++;const m=(f-h)*s+1>>>0,y=new Uint8Array(m);for(;h!==f;){let C=l[h],x=0;for(let _=m-1;(C!==0||x<d)&&_!==-1;_--,x++)C+=256*y[_]>>>0,y[_]=C%n>>>0,C=C/n>>>0;if(C!==0)throw new Error("Non-zero carry");d=x,h++}let v=m-d;for(;v!==m&&y[v]===0;)v++;let b=r.repeat(u);for(;v<m;++v)b+=t.charAt(y[v]);return b}function a(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let u=0,d=0,h=0;for(;l[u]===r;)d++,u++;const f=(l.length-u)*i+1>>>0,m=new Uint8Array(f);for(;u<l.length;){const C=l.charCodeAt(u);if(C>255)return;let x=e[C];if(x===255)return;let _=0;for(let $=f-1;(x!==0||_<h)&&$!==-1;
vendor: 31,210 bytes, line 137
137$--,_++)x+=n*m[$]>>>0,m[$]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");h=_,u++}let y=f-h;for(;y!==f&&m[y]===0;)y++;const v=new Uint8Array(d+(f-y));let b=d;for(;y!==f;)v[b++]=m[y++];return v}function c(l){const u=a(l);if(u)return u;throw new Error("Non-base"+n+" character")}return{encode:o,decodeUnsafe:a,decode:c}}var hje="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const th=dje(hje);function fje(t){const e=t.length;let n=0,r=0;for(;r<e;){let i=t.charCodeAt(r++);if((i&4294967168)===0){n++;continue}else if((i&4294965248)===0)n+=2;else{if(i>=55296&&i<=56319&&r<e){const s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}(i&4294901760)===0?n+=3:n+=4}}return n}function pje(t,e,n){const r=t.length;let i=n,s=0;for(;s<r;){let o=t.charCodeAt(s++);if((o&4294967168)===0){e[i++]=o;continue}else if((o&4294965248)===0)e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<r){const a=t.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128):(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128)}e[i++]=o&63|128}}const gje=new TextEncoder,mje=50;function yje(t,e,n){gje.encodeInto(t,e.subarray(n))}function wje(t,e,n){t.length>mje?yje(t,e,n):pje(t,e,n)}const vje=4096;function Ile(t,e,n){let r=e;const i=r+n,s=[];let o="";for(;r<i;){const a=t[r++];if((a&128)===0)s.push(a);else if((a&224)===192){const c=t[r++]&63;s.push((a&31)<<6|c)}else if((a&240)===224){const c=t[r++]&63,l=t[r++]&63;s.push((a&31)<<12|c<<6|l)}else if((a&248)===240){const c=t[r++]&63,l=t[r++]&63,u=t[r++]&63;let d=(a&7)<<18|c<<12|l<<6|u;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(a);s.length>=vje&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}const bje=new TextDecoder,xje=200;function Eje(t,e,n){const r=t.subarray(e,e+n);return bje.decode(r)}function Cje(t,e,n){return n>xje?Eje(t,e,n):Ile(t,e,n)}class H4{constructor(e,n){this.type=e,this.data=n}}class Ia extends Error{constructor(e){super(e);const n=Object.create(Ia.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Ia.name})}}const nv=4294967295;function _je(t,e,n){const r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function Tle(t,e,n){const r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function Ple(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function Sje(t,e){const n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}const Aje=-1,kje=4294967296-1,$je=17179869184-1;function Ije({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=$je)if(e===0&&t<=kje){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,r=t&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|n&3),s.setUint32(4,r),i}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),Tle(r,4,t),n}}function Tje(t){const e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function Pje(t){if(t instanceof Date){const e=Tje(t);return Ije(e)}else return null}function Rje(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),i=(n&3)*4294967296+r,s=n>>>2;return{sec:i,nsec:s}}case 12:{const n=Ple(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new Ia(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Mje(t){const e=Rje(t);return new Date(e.sec*1e3+e.nsec/1e6)}const Oje={type:Aje,encode:Pje,decode:Mje};class a9{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Oje)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const i=-1-e;this.builtInEncoders[i]=n,this.builtInDecoders[i]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const i=this.builtInEncoders[r];if(i!=null){const s=i(e,n);if(s!=null){const o=-1-r;return new H4(o,s)}}}for(let r=0;r<this.encoders.length;r++){const i=this.encoders[r];if(i!=null){const s=i(e,n);if(s!=null){const o=r;return new H4(o,s)}}}return e instanceof H4?e:null}decode(e,n,r){const i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new H4(n,e)}}a9.defaultCodec=new a9;function jje(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function AM(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):jje(t)?new Uint8Array(t):Uint8Array.from(t)}const Nje=100,Dje=2048;let Lje=class Rle{constructor(e){this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??a9.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.maxDepth=(e==null?void 0:e.maxDepth)??Nje,this.initialBufferSize=(e==null?void 0:e.initialBufferSize)??Dje,this.sortKeys=(e==null?void 0:e.sortKeys)??!1,this.forceFloat32=(e==null?void 0:e.forceFloat32)??!1,this.ignoreUndefined=(e==null?void 0:e.ignoreUndefined)??!1,this.forceIntegerToFloat=(e==null?void 0:e.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new Rle({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=fje(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),wje(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,n){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=AM(e);this.writeU8a(r)}encodeArray(e,n){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const i of e)this.doEncode(i,n+1)}countWithoutUndefined(e,n){let r=0;for(const i of n)e[i]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.sortKeys&&r.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const s of r){const o=e[s];this.ignoreUndefined&&o===void 0||(this.encodeString(s),this.doEncode(o,n+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),i=r.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(r);return}const n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),_je(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),Tle(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function Bje(t,e){return new Lje(e).encodeSharedRef(t)}function x$(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const Fje=16,Uje=16;class zje{constructor(e=Fje,n=Uje){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=n,this.caches=[];for(let r=0;r<this.maxKeyLength;r++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,n,r){const i=this.caches[r-1];e:for(const s of i){const o=s.bytes;for(let a=0;a<r;a++)if(o[a]!==e[n+a])continue e;return s.str}return null}store(e,n){const r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)}decode(e,n,r){const i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;const s=Ile(e,n,r),o=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(o,s),s}}const kM="array",cb="map_key",Mle="map_value",Wje=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new Ia("The type of key must be string or number but "+typeof t)};class Hje{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const n=this.getUninitializedStateFromPool();n.type=kM,n.position=0,n.size=e,n.array=new Array(e)}pushMapState(e){const n=this.getUninitializedStateFromPool();n.type=cb,n.readCount=0,n.size=e,n.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===kM){const r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===cb||e.type===Mle){const r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const rv=-1,cL=new DataView(new ArrayBuffer(0)),Vje=new Uint8Array(cL.buffer);try{cL.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const bK=new RangeError("Insufficient data"),qje=new zje;let Kje=class Ole{constructor(e){this.totalPos=0,this.pos=0,this.view=cL,this.bytes=Vje,this.headByte=rv,this.stack=new Hje,this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??a9.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.rawStrings=(e==null?void 0:e.rawStrings)??!1,this.maxStrLength=(e==null?void 0:e.maxStrLength)??nv,this.maxBinLength=(e==null?void 0:e.maxBinLength)??nv,this.maxArrayLength=(e==null?void 0:e.maxArrayLength)??nv,this.maxMapLength=(e==null?void 0:e.maxMapLength)??nv,this.maxExtLength=(e==null?void 0:e.maxExtLength)??nv,this.keyDecoder=(e==null?void 0:e.keyDecoder)!==void 0?e.keyDecoder:qje,this.mapKeyConverter=(e==null?void 0:e.mapKeyConverter)??Wje}clone(){return new Ole({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=rv,this.stack.reset()}setBuffer(e){const n=AM(e);this.bytes=n,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===rv&&!this.hasRemaining(1))this.setBuffer(e);else{const n=this.bytes.subarray(this.pos),r=AM(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:n,pos:r}=this;return new RangeError(`Extra ${n.byteLength-r} of ${n.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let n=!1,r;for await(const a of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{r=this.doDecodeSync(),n=!0}catch(c){if(!(c instanceof RangeError))throw c}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return r}const{headByte:i,pos:s,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${x$(i)} at ${o} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,n){if(this.entered){yield*this.clone().decodeMultiAsync(e,n);return}try{this.entered=!0;let r=n,i=-1;for await(const s of e){if(n&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),r&&(i=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let n;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else{const i=e-160;n=this.decodeString(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){const i=this.lookU8();n=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();n=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();n=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===196){const i=this.lookU8();n=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();n=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();n=this.decodeBinary(i,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();n=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();n=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();n=this.decodeExtension(i,4)}else throw new Ia(`Unrecognized type byte: ${x$(e)}`);this.complete();const r=this.stack;for(;r.length>0;){const i=r.top();if(i.type===kM)if(i.array[i.position]=n,i.position++,i.position===i.size)n=i.array,r.release(i);else continue e;else if(i.type===cb){if(n==="__proto__")throw new Ia("The key __proto__ is not allowed");i.key=this.mapKeyConverter(n),i.type=Mle;continue e}else if(i.map[i.key]=n,i.readCount++,i.readCount===i.size)n=i.map,r.release(i);else{i.key=null,i.type=cb;continue e}}return n}}readHeadByte(){return this.headByte===rv&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=rv}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new Ia(`Unrecognized array type byte: ${x$(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new Ia(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new Ia(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)}decodeUtf8String(e,n){var s;if(e>this.maxStrLength)throw new Ia(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+n+e)throw bK;const r=this.pos+n;let i;return this.stateIsMapKey()&&((s=this.keyDecoder)!=null&&s.canBeCached(e))?i=this.keyDecoder.decode(this.bytes,r,e):i=Cje(this.bytes,r,e),this.pos+=n+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===cb:!1}decodeBinary(e,n){if(e>this.maxBinLength)throw new Ia(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+n))throw bK;const r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i}decodeExtension(e,n){if(e>this.maxExtLength)throw new Ia(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=Sje(this.view,this.pos);return this.pos+=8,e}readI64(){const e=Ple(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function Gje(t,e){return new Kje(e).decode(t)}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Zje(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function jle(t,e){return Array.isArray(e)?e.length===0?!0:t?e.every(n=>typeof n=="string"):e.every(n=>Number.isSafeInteger(n)):!1}function c9(t,e){if(typeof e!="string")throw new Error(`${t}: string expected`);return!0}function lL(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function $M(t){if(!Array.isArray(t))throw new Error("array expected")}function l9(t,e){if(!jle(!0,e))throw new Error(`${t}: array of strings expected`)}function Yje(t,e){if(!jle(!1,e))throw new Error(`${t}: array of numbers expected`)}function Qje(...t){const e=s=>s,n=(s,o)=>a=>s(o(a)),r=t.map(s=>s.encode).reduceRight(n,e),i=t.map(s=>s.decode).reduce(n,e);return{encode:r,decode:i}}function Xje(t){const e=typeof t=="string"?t.split(""):t,n=e.length;l9("alphabet",e);const r=new Map(e.map((i,s)=>[i,s]));return{encode:i=>($M(i),i.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${t}`);return e[s]})),decode:i=>($M(i),i.map(s=>{c9("alphabet.decode",s);const o=r.get(s);if(o===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${t}`);return o}))}}function Jje(t=""){return c9("join",t),{encode:e=>(l9("join.decode",e),e.join(t)),decode:e=>(c9("join.decode",e),e.split(t))}}function eNe(t,e="="){return lL(t),c9("padding",e),{encode(n){for(l9("padding.encode",n);n.length*t%8;)n.push(e);return n},decode(n){l9("padding.decode",n);let r=n.length;if(r*t%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if((r-1)*t%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,r)}}}const Nle=(t,e)=>e===0?t:Nle(e,t%e),u9=(t,e)=>t+(e-Nle(t,e)),E$=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function xK(t,e,n,r){if($M(t),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(u9(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${u9(e,n)}`);let i=0,s=0;const o=E$[e],a=E$[n]-1,c=[];for(const l of t){if(lL(l),l>=o)throw new Error(`convertRadix2: invalid data word=${l} from=${e}`);if(i=i<<e|l,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=n;s-=n)c.push((i>>s-n&a)>>>0);const u=E$[s];if(u===void 0)throw new Error("invalid carry");i&=u-1}if(i=i<<n-s&a,!r&&s>=e)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&s>0&&c.push(i>>>0),c}function tNe(t,e=!1){if(lL(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(u9(8,t)>32||u9(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!Zje(n))throw new Error("radix2.encode input should be Uint8Array");return xK(Array.from(n),8,t,!e)},decode:n=>(Yje("radix2.decode",n),Uint8Array.from(xK(n,t,8,e)))}}const nNe=Qje(tNe(5),Xje("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),eNe(5),Jje("")),rNe=t=>JSON.stringify(t,(e,n)=>typeof n=="bigint"?n.toString()+"n":n),iNe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=t.replace(e,'$1"$2n"$3');return JSON.parse(n,(r,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function b1(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return iNe(t)}catch{return t}}function nh(t){return typeof t=="string"?t:rNe(t)||""}function sNe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Dle(t,...e){if(!sNe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function EK(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function oNe(t,e){Dle(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const qg=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const C$=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function aNe(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function Lle(t){return typeof t=="string"&&(t=aNe(t)),Dle(t),t}let cNe=class{clone(){return this._cloneInto()}};function lNe(t){const e=r=>t().update(Lle(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Ble(t=32){if(qg&&typeof qg.getRandomValues=="function")return qg.getRandomValues(new Uint8Array(t));if(qg&&typeof qg.randomBytes=="function")return qg.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function uNe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+l,a,r)}let dNe=class extends cNe{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=C$(this.buffer)}update(e){EK(this);const{view:n,buffer:r,blockLen:i}=this;e=Lle(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=C$(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){EK(this),oNe(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let d=o;d<i;d++)n[d]=0;uNe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=C$(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%n&&e.buffer.set(r),e}};const V4=BigInt(2**32-1),IM=BigInt(32);function Fle(t,e=!1){return e?{h:Number(t&V4),l:Number(t>>IM&V4)}:{h:Number(t>>IM&V4)|0,l:Number(t&V4)|0}}function hNe(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=Fle(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const fNe=(t,e)=>BigInt(t>>>0)<<IM|BigInt(e>>>0),pNe=(t,e,n)=>t>>>n,gNe=(t,e,n)=>t<<32-n|e>>>n,mNe=(t,e,n)=>t>>>n|e<<32-n,yNe=(t,e,n)=>t<<32-n|e>>>n,wNe=(t,e,n)=>t<<64-n|e>>>n-32,vNe=(t,e,n)=>t>>>n-32|e<<64-n,bNe=(t,e)=>e,xNe=(t,e)=>t,ENe=(t,e,n)=>t<<n|e>>>32-n,CNe=(t,e,n)=>e<<n|t>>>32-n,_Ne=(t,e,n)=>e<<n-32|t>>>64-n,SNe=(t,e,n)=>t<<n-32|e>>>64-n;function ANe(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const kNe=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),$Ne=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,INe=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),TNe=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,PNe=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),RNe=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,Rn={fromBig:Fle,split:hNe,toBig:fNe,shrSH:pNe,shrSL:gNe,rotrSH:mNe,rotrSL:yNe,rotrBH:wNe,rotrBL:vNe,rotr32H:bNe,rotr32L:xNe,rotlSH:ENe,rotlSL:CNe,rotlBH:_Ne,rotlBL:SNe,add:ANe,add3L:kNe,add3H:$Ne,add4L:INe,add4H:TNe,add5H:RNe,add5L:PNe},[MNe,ONe]=Rn.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
1375771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Gh=new Uint32Array(80),Zh=new Uint32Array(80);let jNe=class extends dNe{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:h,Gh:f,Gl:m,Hh:y,Hl:v}=this;return[e,n,r,i,s,o,a,c,l,u,d,h,f,m,y,v]}set(e,n,r,i,s,o,a,c,l,u,d,h,f,m,y,v){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=h|0,this.Gh=f|0,this.Gl=m|0,this.Hh=y|0,this.Hl=v|0}process(e,n){for(let x=0;x<16;x++,n+=4)Gh[x]=e.getUint32(n),Zh[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const _=Gh[x-15]|0,$=Zh[x-15]|0,I=Rn.rotrSH(_,$,1)^Rn.rotrSH(_,$,8)^Rn.shrSH(_,$,7),R=Rn.rotrSL(_,$,1)^Rn.rotrSL(_,$,8)^Rn.shrSL(_,$,7),N=Gh[x-2]|0,T=Zh[x-2]|0,O=Rn.rotrSH(N,T,19)^Rn.rotrBH(N,T,61)^Rn.shrSH(N,T,6),U=Rn.rotrSL(N,T,19)^Rn.rotrBL(N,T,61)^Rn.shrSL(N,T,6),z=Rn.add4L(R,U,Zh[x-7],Zh[x-16]),L=Rn.add4H(z,I,O,Gh[x-7],Gh[x-16]);Gh[x]=L|0,Zh[x]=z|0}let{Ah:r,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:h,Fh:f,Fl:m,Gh:y,Gl:v,Hh:b,Hl:C}=this;for(let x=0;x<80;x++){const _=Rn.rotrSH(d,h,14)^Rn.rotrSH(d,h,18)^Rn.rotrBH(d,h,41),$=Rn.rotrSL(d,h,14)^Rn.rotrSL(d,h,18)^Rn.rotrBL(d,h,41),I=d&f^~d&y,R=h&m^~h&v,N=Rn.add5L(C,$,R,ONe[x],Zh[x]),T=Rn.add5H(N,b,_,I,MNe[x],Gh[x]),O=N|0,U=Rn.rotrSH(r,i,28)^Rn.rotrBH(r,i,34)^Rn.rotrBH(r,i,39),z=Rn.rotrSL(r,i,28)^Rn.rotrBL(r,i,34)^Rn.rotrBL(r,i,39),L=r&s^r&a^s&a,S=i&o^i&c^o&c;b=y|0,C=v|0,y=f|0,v=m|0,f=d|0,m=h|0,{h:d,l:h}=Rn.add(l|0,u|0,T|0,O|0),l=a|0,u=c|0,a=s|0,c=o|0,s=r|0,o=i|0;const k=Rn.add3L(O,z,S);r=Rn.add3H(k,T,U,L),i=k|0}({h:r,l:i}=Rn.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:o}=Rn.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Rn.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=Rn.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:h}=Rn.add(this.Eh|0,this.El|0,d|0,h|0),{h:f,l:m}=Rn.add(this.Fh|0,this.Fl|0,f|0,m|0),{h:y,l:v}=Rn.add(this.Gh|0,this.Gl|0,y|0,v|0),{h:b,l:C}=Rn.add(this.Hh|0,this.Hl|0,b|0,C|0),this.set(r,i,s,o,a,c,l,u,d,h,f,m,y,v,b,C)}roundClean(){Gh.fill(0),Zh.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 NNe=lNe(()=>new jNe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const uL=BigInt(0),Ule=BigInt(1),DNe=BigInt(2);function dL(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function hL(t){if(!dL(t))throw new Error("Uint8Array expected")}function _$(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const LNe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function fL(t){hL(t);let e="";for(let n=0;n<t.length;n++)e+=LNe[t[n]];return e}function zle(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?uL:BigInt("0x"+t)}const sd={_0:48,_9:57,A:65,F:70,a:97,f:102};function CK(t){if(t>=sd._0&&t<=sd._9)return t-sd._0;if(t>=sd.A&&t<=sd.F)return t-(sd.A-10);if(t>=sd.a&&t<=sd.f)return t-(sd.a-10)}function Wle(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);
vendor: 18,302 bytes, line 137
137const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const o=CK(t.charCodeAt(s)),a=CK(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function BNe(t){return zle(fL(t))}function u8(t){return hL(t),zle(fL(Uint8Array.from(t).reverse()))}function Hle(t,e){return Wle(t.toString(16).padStart(e*2,"0"))}function TM(t,e){return Hle(t,e).reverse()}function od(t,e,n){let r;if(typeof e=="string")try{r=Wle(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(dL(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function _K(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];hL(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}const S$=t=>typeof t=="bigint"&&uL<=t;function FNe(t,e,n){return S$(t)&&S$(e)&&S$(n)&&e<=t&&t<n}function iv(t,e,n,r){if(!FNe(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function UNe(t){let e;for(e=0;t>uL;t>>=Ule,e+=1);return e}const zNe=t=>(DNe<<BigInt(t-1))-Ule,WNe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||dL(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function pL(t,e,n={}){const r=(i,s,o)=>{const a=WNe[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}function SK(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}const hs=BigInt(0),ki=BigInt(1),a0=BigInt(2),HNe=BigInt(3),PM=BigInt(4),AK=BigInt(5),kK=BigInt(8);function Yi(t,e){const n=t%e;return n>=hs?n:e+n}function VNe(t,e,n){if(e<hs)throw new Error("invalid exponent, negatives unsupported");if(n<=hs)throw new Error("invalid modulus");if(n===ki)return hs;let r=ki;for(;e>hs;)e&ki&&(r=r*t%n),t=t*t%n,e>>=ki;return r}function zl(t,e,n){let r=t;for(;e-- >hs;)r*=r,r%=n;return r}function $K(t,e){if(t===hs)throw new Error("invert: expected non-zero number");if(e<=hs)throw new Error("invert: expected positive modulus, got "+e);let n=Yi(t,e),r=e,i=hs,s=ki;for(;n!==hs;){const o=r/n,a=r%n,c=i-s*o;r=n,n=a,i=s,s=c}if(r!==ki)throw new Error("invert: does not exist");return Yi(i,e)}function qNe(t){const e=(t-ki)/a0;let n,r,i;for(n=t-ki,r=0;n%a0===hs;n/=a0,r++);for(i=a0;i<t&&VNe(i,e,t)!==t-ki;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(t+ki)/PM;return function(a,c){const l=a.pow(c,o);if(!a.eql(a.sqr(l),c))throw new Error("Cannot find square root");return l}}const s=(n+ki)/a0;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=r,l=o.pow(o.mul(o.ONE,i),n),u=o.pow(a,s),d=o.pow(a,n);for(;!o.eql(d,o.ONE);){if(o.eql(d,o.ZERO))return o.ZERO;let h=1;for(let m=o.sqr(d);h<c&&!o.eql(m,o.ONE);h++)m=o.sqr(m);const f=o.pow(l,ki<<BigInt(c-h-1));l=o.sqr(f),u=o.mul(u,f),d=o.mul(d,l),c=h}return u}}function KNe(t){if(t%PM===HNe){const e=(t+ki)/PM;return function(n,r){const i=n.pow(r,e);if(!n.eql(n.sqr(i),r))throw new Error("Cannot find square root");return i}}if(t%kK===AK){const e=(t-AK)/kK;return function(n,r){const i=n.mul(r,a0),s=n.pow(i,e),o=n.mul(r,s),a=n.mul(n.mul(o,a0),s),c=n.mul(o,n.sub(a,n.ONE));if(!n.eql(n.sqr(c),r))throw new Error("Cannot find square root");return c}}return qNe(t)}const GNe=(t,e)=>(Yi(t,e)&ki)===ki,ZNe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function YNe(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=ZNe.reduce((r,i)=>(r[i]="function",r),e);return pL(t,n)}function QNe(t,e,n){if(n<hs)throw new Error("invalid exponent, negatives unsupported");if(n===hs)return t.ONE;if(n===ki)return e;let r=t.ONE,i=e;for(;n>hs;)n&ki&&(r=t.mul(r,i)),i=t.sqr(i),n>>=ki;return r}function XNe(t,e){const n=new Array(e.length),r=e.reduce((s,o,a)=>t.is0(o)?s:(n[a]=s,t.mul(s,o)),t.ONE),i=t.inv(r);return e.reduceRight((s,o,a)=>t.is0(o)?s:(n[a]=t.mul(s,n[a]),t.mul(s,o)),i),n}function Vle(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function qle(t,e,n=!1,r={}){if(t<=hs)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=Vle(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:n,BITS:i,BYTES:s,MASK:zNe(i),ZERO:hs,ONE:ki,create:c=>Yi(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return hs<=c&&c<t},is0:c=>c===hs,isOdd:c=>(c&ki)===ki,neg:c=>Yi(-c,t),eql:(c,l)=>c===l,sqr:c=>Yi(c*c,t),add:(c,l)=>Yi(c+l,t),sub:(c,l)=>Yi(c-l,t),mul:(c,l)=>Yi(c*l,t),pow:(c,l)=>QNe(a,c,l),div:(c,l)=>Yi(c*$K(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>$K(c,t),sqrt:r.sqrt||(c=>(o||(o=KNe(t)),o(a,c))),invertBatch:c=>XNe(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>n?TM(c,s):Hle(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return n?u8(c):BNe(c)}});return Object.freeze(a)}const IK=BigInt(0),q4=BigInt(1);function A$(t,e){const n=e.negate();return t?n:e}function Kle(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function k$(t,e){Kle(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1);return{windows:n,windowSize:r}}function JNe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function eDe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const $$=new WeakMap,Gle=new WeakMap;function I$(t){return Gle.get(t)||1}function tDe(t,e){return{constTimeNegate:A$,hasPrecomputes(n){return I$(n)!==1},unsafeLadder(n,r,i=t.ZERO){let s=n;for(;r>IK;)r&q4&&(i=i.add(s)),s=s.double(),r>>=q4;return i},precomputeWindow(n,r){const{windows:i,windowSize:s}=k$(r,e),o=[];let a=n,c=a;for(let l=0;l<i;l++){c=a,o.push(c);for(let u=1;u<s;u++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(n,r,i){const{windows:s,windowSize:o}=k$(n,e);let a=t.ZERO,c=t.BASE;const l=BigInt(2**n-1),u=2**n,d=BigInt(n);for(let h=0;h<s;h++){const f=h*o;let m=Number(i&l);i>>=d,m>o&&(m-=u,i+=q4);const y=f,v=f+Math.abs(m)-1,b=h%2!==0,C=m<0;m===0?c=c.add(A$(b,r[y])):a=a.add(A$(C,r[v]))}return{p:a,f:c}},wNAFUnsafe(n,r,i,s=t.ZERO){const{windows:o,windowSize:a}=k$(n,e),c=BigInt(2**n-1),l=2**n,u=BigInt(n);for(let d=0;d<o;d++){const h=d*a;if(i===IK)break;let f=Number(i&c);if(i>>=u,f>a&&(f-=l,i+=q4),f===0)continue;let m=r[h+Math.abs(f)-1];f<0&&(m=m.negate()),s=s.add(m)}return s},getPrecomputes(n,r,i){let s=$$.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&$$.set(r,i(s))),s},wNAFCached(n,r,i){const s=I$(n);return this.wNAF(s,this.getPrecomputes(s,n,i),r)},wNAFCachedUnsafe(n,r,i,s){const o=I$(n);return o===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(o,this.getPrecomputes(o,n,i),r,s)},setWindowSize(n,r){Kle(r,e),Gle.set(n,r),$$.delete(n)}}}function nDe(t,e,n,r){if(JNe(n,t),eDe(r,e),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=UNe(BigInt(n.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<<o)-1,c=new Array(a+1).fill(i),l=Math.floor((e.BITS-1)/o)*o;let u=i;for(let d=l;d>=0;d-=o){c.fill(i);for(let f=0;f<r.length;f++){const m=r[f],y=Number(m>>BigInt(d)&BigInt(a));c[y]=c[y].add(n[f])}let h=i;for(let f=c.length-1,m=i;f>0;f--)m=m.add(c[f]),h=h.add(m);if(u=u.add(h),d!==0)for(let f=0;f<o;f++)u=u.double()}return u}function rDe(t){return YNe(t.Fp),pL(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Vle(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const Wc=BigInt(0),Ho=BigInt(1),K4=BigInt(2),iDe=BigInt(8),sDe={zip215:!0};function oDe(t){const e=rDe(t);return pL(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function aDe(t){const e=oDe(t),{Fp:n,n:r,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,l=K4<<BigInt(a*8)-Ho,u=n.create,d=qle(e.n,e.nBitLength),h=e.uvRatio||((k,M)=>{try{return{isValid:!0,value:n.sqrt(k*n.inv(M))}}catch{return{isValid:!1,value:Wc}}}),f=e.adjustScalarBytes||(k=>k),m=e.domain||((k,M,W)=>{if(_$("phflag",W),M.length||W)throw new Error("Contexts/pre-hash are not supported");return k});function y(k,M){iv("coordinate "+k,M,Wc,l)}function v(k){if(!(k instanceof x))throw new Error("ExtendedPoint expected")}const b=SK((k,M)=>{const{ex:W,ey:H,ez:D}=k,V=k.is0();M==null&&(M=V?iDe:n.inv(D));const B=u(W*M),P=u(H*M),j=u(D*M);if(V)return{x:Wc,y:Ho};if(j!==Ho)throw new Error("invZ was invalid");return{x:B,y:P}}),C=SK(k=>{const{a:M,d:W}=e;if(k.is0())throw new Error("bad point: ZERO");const{ex:H,ey:D,ez:V,et:B}=k,P=u(H*H),j=u(D*D),G=u(V*V),Y=u(G*G),te=u(P*M),ae=u(G*u(te+j)),oe=u(Y+u(W*u(P*j)));if(ae!==oe)throw new Error("bad point: equation left != right (1)");const de=u(H*D),ke=u(V*B);if(de!==ke)throw new Error("bad point: equation left != right (2)");return!0});class x{constructor(M,W,H,D){this.ex=M,this.ey=W,this.ez=H,this.et=D,y("x",M),y("y",W),y("z",H),y("t",D),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(M){if(M instanceof x)throw new Error("extended point not allowed");const{x:W,y:H}=M||{};return y("x",W),y("y",H),new x(W,H,Ho,u(W*H))}static normalizeZ(M){const W=n.invertBatch(M.map(H=>H.ez));return M.map((H,D)=>H.toAffine(W[D])).map(x.fromAffine)}static msm(M,W){return nDe(x,d,M,W)}_setWindowSize(M){I.setWindowSize(this,M)}assertValidity(){C(this)}equals(M){v(M);const{ex:W,ey:H,ez:D}=this,{ex:V,ey:B,ez:P}=M,j=u(W*P),G=u(V*D),Y=u(H*P),te=u(B*D);return j===G&&Y===te}is0(){return this.equals(x.ZERO)}negate(){return new x(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:M}=e,{ex:W,ey:H,ez:D}=this,V=u(W*W),B=u(H*H),P=u(K4*u(D*D)),j=u(M*V),G=W+H,Y=u(u(G*G)-V-B),te=j+B,ae=te-P,oe=j-B,de=u(Y*ae),ke=u(te*oe),Be=u(Y*oe),$e=u(ae*te);return new x(de,ke,$e,Be)}add(M){v(M);const{a:W,d:H}=e,{ex:D,ey:V,ez:B,et:P}=this,{ex:j,ey:G,ez:Y,et:te}=M;if(W===BigInt(-1)){const be=u((V-D)*(G+j)),Lt=u((V+D)*(G-j)),Qe=u(Lt-be);if(Qe===Wc)return this.double();const Ue=u(B*K4*te),Ye=u(P*K4*Y),tt=Ye+Ue,ze=Lt+be,Ne=Ye-Ue,J=u(tt*Qe),q=u(ze*Ne),Z=u(tt*Ne),se=u(Qe*ze);return new x(J,q,se,Z)}const ae=u(D*j),oe=u(V*G),de=u(P*H*te),ke=u(B*Y),Be=u((D+V)*(j+G)-ae-oe),$e=ke-de,He=ke+de,Ge=u(oe-W*ae),je=u(Be*$e),xt=u(He*Ge),ft=u(Be*Ge),it=u($e*He);return new x(je,xt,it,ft)}subtract(M){return this.add(M.negate())}wNAF(M){return I.wNAFCached(this,M,x.normalizeZ)}multiply(M){const W=M;iv("scalar",W,Ho,r);const{p:H,f:D}=this.wNAF(W);return x.normalizeZ([H,D])[0]}multiplyUnsafe(M,W=x.ZERO){const H=M;return iv("scalar",H,Wc,r),H===Wc?$:this.is0()||H===Ho?this:I.wNAFCachedUnsafe(this,H,x.normalizeZ,W)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return I.unsafeLadder(this,r).is0()}toAffine(M){return b(this,M)}clearCofactor(){const{h:M}=e;return M===Ho?this:this.multiplyUnsafe(M)}static fromHex(M,W=!1){const{d:H,a:D}=e,V=n.BYTES;M=od("pointHex",M,V),_$("zip215",W);const B=M.slice(),P=M[V-1];B[V-1]=P&-129;const j=u8(B),G=W?l:n.ORDER;iv("pointHex.y",j,Wc,G);const Y=u(j*j),te=u(Y-Ho),ae=u(H*Y-D);let{isValid:oe,value:de}=h(te,ae);if(!oe)throw new Error("Point.fromHex: invalid y coordinate");const ke=(de&Ho)===Ho,Be=(P&128)!==0;if(!W&&de===Wc&&Be)throw new Error("Point.fromHex: x=0 and x_0=1");return Be!==ke&&(de=u(-de)),x.fromAffine({x:de,y:j})}static fromPrivateKey(M){return T(M).point}toRawBytes(){const{x:M,y:W}=this.toAffine(),H=TM(W,n.BYTES);return H[H.length-1]|=M&Ho?128:0,H}toHex(){return fL(this.toRawBytes())}}x.BASE=new x(e.Gx,e.Gy,Ho,u(e.Gx*e.Gy)),x.ZERO=new x(Wc,Ho,Ho,Wc);const{BASE:_,ZERO:$}=x,I=tDe(x,a*8);function R(k){return Yi(k,r)}function N(k){return R(u8(k))}function T(k){const M=n.BYTES;k=od("private key",k,M);const W=od("hashed private key",s(k),2*M),H=f(W.slice(0,M)),D=W.slice(M,2*M),V=N(H),B=_.multiply(V),P=B.toRawBytes();return{head:H,prefix:D,scalar:V,point:B,pointBytes:P}}function O(k){return T(k).pointBytes}function U(k=new Uint8Array,...M){const W=_K(...M);return N(s(m(W,od("context",k),!!i)))}function z(k,M,W={}){k=od("message",k),i&&(k=i(k));const{prefix:H,scalar:D,pointBytes:V}=T(M),B=U(W.context,H,k),P=_.multiply(B).toRawBytes(),j=U(W.context,P,V,k),G=R(B+j*D);iv("signature.s",G,Wc,r);const Y=_K(P,TM(G,n.BYTES));return od("result",Y,n.BYTES*2)}const L=sDe;function S(k,M,W,H=L){const{context:D,zip215:V}=H,B=n.BYTES;k=od("signature",k,2*B),M=od("message",M),W=od("publicKey",W,B),V!==void 0&&_$("zip215",V),i&&(M=i(M));const P=u8(k.slice(B,2*B));let j,G,Y;try{j=x.fromHex(W,V),G=x.fromHex(k.slice(0,B),V),Y=_.multiplyUnsafe(P)}catch{return!1}if(!V&&j.isSmallOrder())return!1;const te=U(D,G.toRawBytes(),j.toRawBytes(),M);return G.add(j.multiplyUnsafe(te)).subtract(Y).clearCofactor().equals(x.ZERO)}return _._setWindowSize(8),{CURVE:e,getPublicKey:O,sign:z,verify:S,ExtendedPoint:x,utils:{getExtendedPublicKey:T,randomPrivateKey:()=>o(n.BYTES),precompute(k=8,M=x.BASE){return M._setWindowSize(k),M.multiply(BigInt(3)),M}}}}BigInt(0),BigInt(1);const gL=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),TK=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const cDe=BigInt(1),PK=BigInt(2);BigInt(3);const lDe=BigInt(5),uDe=BigInt(8);function dDe(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=gL,o=t*t%s*t%s,a=zl(o,PK,s)*o%s,c=zl(a,cDe,s)*t%s,l=zl(c,lDe,s)*c%s,u=zl(l,e,s)*l%s,d=zl(u,n,s)*u%s,h=zl(d,r,s)*d%s,f=zl(h,i,s)*h%s,m=zl(f,i,s)*h%s,y=zl(m,e,s)*l%s;return{pow_p_5_8:zl(y,PK,s)*t%s,b2:o}}function hDe(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function fDe(t,e){const n=gL,r=Yi(e*e*e,n),i=Yi(r*r*e,n),s=dDe(t*i).pow_p_5_8;let o=Yi(t*r*s,n);const a=Yi(e*o*o,n),c=o,l=Yi(o*TK,n),u=a===t,d=a===Yi(-t,n),h=a===Yi(-t*TK,n);return u&&(o=c),(d||h)&&(o=l),GNe(o,n)&&(o=Yi(-o,n)),{isValid:u||d,value:o}}const pDe=qle(gL,void 0,!0),gDe={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:pDe,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:uDe,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:NNe,randomBytes:Ble,adjustScalarBytes:hDe,uvRatio:fDe},Zle=aDe(gDe),mDe="EdDSA",yDe="JWT",d9=".",HC="base64url",Yle="utf8",Qle="utf8",wDe=":",vDe="did",bDe="key",RK="base58btc",xDe="z",EDe="K36",CDe=32;function mL(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Xle(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?mL(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Jle(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const n=Xle(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return mL(n)}function _De(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var y=0,v=0,b=0,C=m.length;b!==C&&m[b]===0;)b++,y++;for(var x=(C-b)*u+1>>>0,_=new Uint8Array(x);b!==C;){for(var $=m[b],I=0,R=x-1;($!==0||I<v)&&R!==-1;R--,I++)$+=256*_[R]>>>0,_[R]=$%a>>>0,$=$/a>>>0;if($!==0)throw new Error("Non-zero carry");v=I,b++}for(var N=x-v;N!==x&&_[N]===0;)N++;for(var T=c.repeat(y);N<x;++N)T+=t.charAt(_[N]);return T}function h(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var y=0;if(m[y]!==" "){for(var v=0,b=0;m[y]===c;)v++,y++;for(var C=(m.length-y)*l+1>>>0,x=new Uint8Array(C);m[y];){var _=n[m.charCodeAt(y)];if(_===255)return;for(var $=0,I=C-1;(_!==0||$<b)&&I!==-1;I--,$++)_+=a*x[I]>>>0,x[I]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");b=$,y++}if(m[y]!==" "){for(var R=C-b;R!==C&&x[R]===0;)R++;for(var N=new Uint8Array(v+(C-R)),T=v;R!==C;)N[T++]=x[R++];return N}}}function f(m){var y=h(m);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:h,decode:f}}var SDe=_De,ADe=SDe;const eue=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},kDe=t=>new TextEncoder().encode(t),$De=t=>new TextDecoder().decode(t);let IDe=class{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},TDe=class{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
137 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return tue(this,e)}},PDe=class{constructor(e){this.decoders=e}or(e){return tue(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const tue=(t,e)=>new PDe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let RDe=class{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new IDe(e,n,r),this.decoder=new TDe(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const VC=({name:t,prefix:e,encode:n,decode:r})=>new RDe(t,e,n,r),$5=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=ADe(n,e);return VC({prefix:t,name:e,encode:r,decode:s=>eue(i(s))})},MDe=(t,e,n,r)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*n/8|0);let a=0,c=0,l=0;for(let u=0;u<s;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},ODe=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>n;)o-=n,s+=e[i&a>>o];if(o&&(s+=e[i&a<<n-o]),r)for(;s.length*n&7;)s+="=";return s},Ws=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>VC({prefix:e,name:t,encode(i){return ODe(i,r,n)},decode(i){return MDe(i,r,n,t)}}),jDe=VC({prefix:"\0",name:"identity",encode:t=>$De(t),decode:t=>kDe(t)});var NDe=Object.freeze({__proto__:null,identity:jDe});const DDe=Ws({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var LDe=Object.freeze({__proto__:null,base2:DDe});const BDe=Ws({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var FDe=Object.freeze({__proto__:null,base8:BDe});const UDe=$5({prefix:"9",name:"base10",alphabet:"0123456789"});var zDe=Object.freeze({__proto__:null,base10:UDe});const WDe=Ws({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),HDe=Ws({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var VDe=Object.freeze({__proto__:null,base16:WDe,base16upper:HDe});const qDe=Ws({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),KDe=Ws({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),GDe=Ws({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ZDe=Ws({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),YDe=Ws({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),QDe=Ws({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),XDe=Ws({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),JDe=Ws({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),eLe=Ws({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var tLe=Object.freeze({__proto__:null,base32:qDe,base32upper:KDe,base32pad:GDe,base32padupper:ZDe,base32hex:YDe,base32hexupper:QDe,base32hexpad:XDe,base32hexpadupper:JDe,base32z:eLe});const nLe=$5({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rLe=$5({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var iLe=Object.freeze({__proto__:null,base36:nLe,base36upper:rLe});const sLe=$5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),oLe=$5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var aLe=Object.freeze({__proto__:null,base58btc:sLe,base58flickr:oLe});const cLe=Ws({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
137+/",bitsPerChar:6}),lLe=Ws({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),uLe=Ws({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),dLe=Ws({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var hLe=Object.freeze({__proto__:null,base64:cLe,base64pad:lLe,base64url:uLe,base64urlpad:dLe});const nue=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),fLe=nue.reduce((t,e,n)=>(t[n]=e,t),[]),pLe=nue.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function gLe(t){return t.reduce((e,n)=>(e+=fLe[n],e),"")}function mLe(t){const e=[];for(const n of t){const r=pLe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const yLe=VC({prefix:"ð",name:"base256emoji",encode:gLe,decode:mLe});var wLe=Object.freeze({__proto__:null,base256emoji:yLe}),vLe=rue,MK=128,bLe=-128,xLe=Math.pow(2,31);function rue(t,e,n){e=e||[],n=n||0;for(var r=n;t>=xLe;)e[n++]=t&255|MK,t/=128;for(;t&bLe;)e[n++]=t&255|MK,t>>>=7;return e[n]=t|0,rue.bytes=n-r+1,e}var ELe=RM,CLe=128,OK=127;function RM(t,r){var n=0,r=r||0,i=0,s=r,o,a=t.length;do{if(s>=a)throw RM.bytes=0,new RangeError("Could not decode varint");o=t[s++],n+=i<28?(o&OK)<<i:(o&OK)*Math.pow(2,i),i+=7}while(o>=CLe);return RM.bytes=s-r,n}var _Le=Math.pow(2,7),SLe=Math.pow(2,14),ALe=Math.pow(2,21),kLe=Math.pow(2,28),$Le=Math.pow(2,35),ILe=Math.pow(2,42),TLe=Math.pow(2,49),PLe=Math.pow(2,56),RLe=Math.pow(2,63),MLe=function(t){return t<_Le?1:t<SLe?2:t<ALe?3:t<kLe?4:t<$Le?5:t<ILe?6:t<TLe?7:t<PLe?8:t<RLe?9:10},OLe={encode:vLe,decode:ELe,encodingLength:MLe},iue=OLe;const jK=(t,e,n=0)=>(iue.encode(t,e,n),e),NK=t=>iue.encodingLength(t),MM=(t,e)=>{const n=e.byteLength,r=NK(t),i=r+NK(n),s=new Uint8Array(i+n);return jK(t,s,0),jK(n,s,r),s.set(e,i),new jLe(t,n,e,s)};let jLe=class{constructor(e,n,r,i){this.code=e,this.size=n,this.digest=r,this.bytes=i}};const sue=({name:t,code:e,encode:n})=>new NLe(t,e,n);let NLe=class{constructor(e,n,r){this.name=e,this.code=n,this.encode=r}digest(e){if(e instanceof Uint8Array){const n=this.encode(e);return n instanceof Uint8Array?MM(this.code,n):n.then(r=>MM(this.code,r))}else throw Error("Unknown type, must be binary type")}};const oue=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),DLe=sue({name:"sha2-256",code:18,encode:oue("SHA-256")}),LLe=sue({name:"sha2-512",code:19,encode:oue("SHA-512")});var BLe=Object.freeze({__proto__:null,sha256:DLe,sha512:LLe});const aue=0,FLe="identity",cue=eue,ULe=t=>MM(aue,cue(t)),zLe={code:aue,name:FLe,encode:cue,digest:ULe};var WLe=Object.freeze({__proto__:null,identity:zLe});new TextEncoder,new TextDecoder;const DK={...NDe,...LDe,...FDe,...zDe,...VDe,...tLe,...iLe,...aLe,...hLe,...wLe};({...BLe,...WLe});function lue(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const LK=lue("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),T$=lue("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=Xle(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),uue={utf8:LK,"utf-8":LK,hex:DK.base16,latin1:T$,ascii:T$,binary:T$,...DK};function qC(t,e="utf8"){const n=uue[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}function j2(t,e="utf8"){const n=uue[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?mL(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}function BK(t){return b1(qC(j2(t,HC),Yle))}function h9(t){return qC(j2(nh(t),Yle),HC)}function due(t){const e=j2(EDe,RK),n=xDe+qC(Jle([e,t]),RK);return[vDe,bDe,n].join(wDe)}function HLe(t){return qC(t,HC)}function VLe(t){return j2(t,HC)}function qLe(t){return j2([h9(t.header),h9(t.payload)].join(d9),Qle)}function KLe(t){return[h9(t.header),h9(t.payload),HLe(t.signature)].join(d9)}function OM(t){const e=t.split(d9),n=BK(e[0]),r=BK(e[1]),i=VLe(e[2]),s=j2(e.slice(0,2).join(d9),Qle);return{header:n,payload:r,signature:i,data:s}}function FK(t=Ble(CDe)){const e=Zle.getPublicKey(t);return{secretKey:Jle([t,e]),publicKey:e}}async function GLe(t,e,n,r,i=Pt.fromMiliseconds(Date.now())){const s={alg:mDe,typ:yDe},o=due(r.publicKey),a=i+n,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=qLe({header:s,payload:c}),u=Zle.sign(l,r.secretKey.slice(0,32));return KLe({header:s,payload:c,signature:u})}function yL(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function hue(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?yL(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function lb(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const n=hue(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return yL(n)}function ZLe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=i}
vendor: 37,037 bytes, lines 137-139
137var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var y=0,v=0,b=0,C=m.length;b!==C&&m[b]===0;)b++,y++;for(var x=(C-b)*u+1>>>0,_=new Uint8Array(x);b!==C;){for(var $=m[b],I=0,R=x-1;($!==0||I<v)&&R!==-1;R--,I++)$+=256*_[R]>>>0,_[R]=$%a>>>0,$=$/a>>>0;if($!==0)throw new Error("Non-zero carry");v=I,b++}for(var N=x-v;N!==x&&_[N]===0;)N++;for(var T=c.repeat(y);N<x;++N)T+=t.charAt(_[N]);return T}function h(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var y=0;if(m[y]!==" "){for(var v=0,b=0;m[y]===c;)v++,y++;for(var C=(m.length-y)*l+1>>>0,x=new Uint8Array(C);m[y];){var _=n[m.charCodeAt(y)];if(_===255)return;for(var $=0,I=C-1;(_!==0||$<b)&&I!==-1;I--,$++)_+=a*x[I]>>>0,x[I]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");b=$,y++}if(m[y]!==" "){for(var R=C-b;R!==C&&x[R]===0;)R++;for(var N=new Uint8Array(v+(C-R)),T=v;R!==C;)N[T++]=x[R++];return N}}}function f(m){var y=h(m);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:h,decode:f}}var YLe=ZLe,QLe=YLe;const XLe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},JLe=t=>new TextEncoder().encode(t),eBe=t=>new TextDecoder().decode(t);class tBe{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class nBe{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return fue(this,e)}}class rBe{constructor(e){this.decoders=e}or(e){return fue(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const fue=(t,e)=>new rBe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class iBe{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new tBe(e,n,r),this.decoder=new nBe(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const KC=({name:t,prefix:e,encode:n,decode:r})=>new iBe(t,e,n,r),I5=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=QLe(n,e);return KC({prefix:t,name:e,encode:r,decode:s=>XLe(i(s))})},sBe=(t,e,n,r)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*n/8|0);let a=0,c=0,l=0;for(let u=0;u<s;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},oBe=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>n;)o-=n,s+=e[i&a>>o];if(o&&(s+=e[i&a<<n-o]),r)for(;s.length*n&7;)s+="=";return s},Hs=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>KC({prefix:e,name:t,encode(i){return oBe(i,r,n)},decode(i){return sBe(i,r,n,t)}}),aBe=KC({prefix:"\0",name:"identity",encode:t=>eBe(t),decode:t=>JLe(t)}),cBe=Object.freeze(Object.defineProperty({__proto__:null,identity:aBe},Symbol.toStringTag,{value:"Module"})),lBe=Hs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),uBe=Object.freeze(Object.defineProperty({__proto__:null,base2:lBe},Symbol.toStringTag,{value:"Module"})),dBe=Hs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),hBe=Object.freeze(Object.defineProperty({__proto__:null,base8:dBe},Symbol.toStringTag,{value:"Module"})),fBe=I5({prefix:"9",name:"base10",alphabet:"0123456789"}),pBe=Object.freeze(Object.defineProperty({__proto__:null,base10:fBe},Symbol.toStringTag,{value:"Module"})),gBe=Hs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),mBe=Hs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),yBe=Object.freeze(Object.defineProperty({__proto__:null,base16:gBe,base16upper:mBe},Symbol.toStringTag,{value:"Module"})),wBe=Hs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),vBe=Hs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),bBe=Hs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),xBe=Hs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),EBe=Hs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),CBe=Hs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),_Be=Hs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),SBe=Hs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ABe=Hs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),kBe=Object.freeze(Object.defineProperty({__proto__:null,base32:wBe,base32hex:EBe,base32hexpad:_Be,base32hexpadupper:SBe,base32hexupper:CBe,base32pad:bBe,base32padupper:xBe,base32upper:vBe,base32z:ABe},Symbol.toStringTag,{value:"Module"})),$Be=I5({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),IBe=I5({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),TBe=Object.freeze(Object.defineProperty({__proto__:null,base36:$Be,base36upper:IBe},Symbol.toStringTag,{value:"Module"})),PBe=I5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),RBe=I5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),MBe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:PBe,base58flickr:RBe},Symbol.toStringTag,{value:"Module"})),OBe=Hs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jBe=Hs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),NBe=Hs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),DBe=Hs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),LBe=Object.freeze(Object.defineProperty({__proto__:null,base64:OBe,base64pad:jBe,base64url:NBe,base64urlpad:DBe},Symbol.toStringTag,{value:"Module"})),pue=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð ððµðð¤²ð¤ ð¤§ððµð ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),BBe=pue.reduce((t,e,n)=>(t[n]=e,t),[]),FBe=pue.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function UBe(t){return t.reduce((e,n)=>(e+=BBe[n],e),"")}function zBe(t){const e=[];for(const n of t){const r=FBe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const WBe=KC({prefix:"ð",name:"base256emoji",encode:UBe,decode:zBe}),HBe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:WBe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const UK={...cBe,...uBe,...hBe,...pBe,...yBe,...kBe,...TBe,...MBe,...LBe,...HBe};function gue(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const zK=gue("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),P$=gue("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=hue(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),mue={utf8:zK,"utf-8":zK,hex:UK.base16,latin1:P$,ascii:P$,binary:P$,...UK};function mc(t,e="utf8"){const n=mue[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?yL(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}function ha(t,e="utf8"){const n=mue[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}const VBe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var R$,WK;function yue(){if(WK)return R$;WK=1;const t="Input must be an string, Buffer or Uint8Array";function e(o){let a;if(o instanceof Uint8Array)a=o;else if(typeof o=="string")a=new TextEncoder().encode(o);else throw new Error(t);return a}function n(o){return Array.prototype.map.call(o,function(a){return(a<16?"0":"")+a.toString(16)}).join("")}function r(o){return(4294967296+o).toString(16).substring(1)}function i(o,a,c){let l=` 138`+o+" = ";for(let u=0;u<a.length;u+=2){if(c===32)l+=r(a[u]).toUpperCase(),l+=" ",l+=r(a[u+1]).toUpperCase();else if(c===64)l+=r(a[u+1]).toUpperCase(),l+=r(a[u]).toUpperCase();else throw new Error("Invalid size "+c);u%6===4?l+=` 139`+new Array(o.length+4).join(" "):u<a.length-2&&(l+=" ")}console.log(l)}function s(o,a,c){let l=new Date().getTime();const u=new Uint8Array(a);for(let h=0;h<a;h++)u[h]=h%256;const d=new Date().getTime();console.log("Generated random input in "+(d-l)+"ms"),l=d;for(let h=0;h<c;h++){const f=o(u),m=new Date().getTime(),y=m-l;l=m,console.log("Hashed in "+y+"ms: "+f.substring(0,20)+"..."),console.log(Math.round(a/(1<<20)/(y/1e3)*100)/100+" MB PER SECOND")}}return R$={normalizeInput:e,toHex:n,debugPrint:i,testSpeed:s},R$}var M$,HK;function qBe(){if(HK)return M$;HK=1;const t=yue();function e(b,C,x){const _=b[C]+b[x];let $=b[C+1]+b[x+1];_>=4294967296&&$++,b[C]=_,b[C+1]=$}function n(b,C,x,_){let $=b[C]+x;x<0&&($+=4294967296);let I=b[C+1]+_;$>=4294967296&&I++,b[C]=$,b[C+1]=I}function r(b,C){return b[C]^b[C+1]<<8^b[C+2]<<16^b[C+3]<<24}function i(b,C,x,_,$,I){const R=l[$],N=l[$+1],T=l[I],O=l[I+1];e(c,b,C),n(c,b,R,N);let U=c[_]^c[b],z=c[_+1]^c[b+1];c[_]=z,c[_+1]=U,e(c,x,_),U=c[C]^c[x],z=c[C+1]^c[x+1],c[C]=U>>>24^z<<8,c[C+1]=z>>>24^U<<8,e(c,b,C),n(c,b,T,O),U=c[_]^c[b],z=c[_+1]^c[b+1],c[_]=U>>>16^z<<16,c[_+1]=z>>>16^U<<16,e(c,x,_),U=c[C]^c[x],z=c[C+1]^c[x+1],c[C]=z>>>31^U<<1,c[C+1]=U>>>31^z<<1}const s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],a=new Uint8Array(o.map(function(b){return b*2})),c=new Uint32Array(32),l=new Uint32Array(32);function u(b,C){let x=0;for(x=0;x<16;x++)c[x]=b.h[x],c[x+16]=s[x];for(c[24]=c[24]^b.t,c[25]=c[25]^b.t/4294967296,C&&(c[28]=~c[28],c[29]=~c[29]),x=0;x<32;x++)l[x]=r(b.b,4*x);for(x=0;x<12;x++)i(0,8,16,24,a[x*16+0],a[x*16+1]),i(2,10,18,26,a[x*16+2],a[x*16+3]),i(4,12,20,28,a[x*16+4],a[x*16+5]),i(6,14,22,30,a[x*16+6],a[x*16+7]),i(0,10,20,30,a[x*16+8],a[x*16+9]),i(2,12,22,24,a[x*16+10],a[x*16+11]),i(4,14,16,26,a[x*16+12],a[x*16+13]),i(6,8,18,28,a[x*16+14],a[x*16+15]);for(x=0;x<16;x++)b.h[x]=b.h[x]^c[x]^c[x+16]}const d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function h(b,C,x,_){if(b===0||b>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(C&&C.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(x&&x.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(_&&_.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const $={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:b};d.fill(0),d[0]=b,C&&(d[1]=C.length),d[2]=1,d[3]=1,x&&d.set(x,32),_&&d.set(_,48);for(let I=0;I<16;I++)$.h[I]=s[I]^r(d,I*4);return C&&(f($,C),$.c=128),$}function f(b,C){for(let x=0;x<C.length;x++)b.c===128&&(b.t+=b.c,u(b,!1),b.c=0),b.b[b.c++]=C[x]}function m(b){for(b.t+=b.c;b.c<128;)b.b[b.c++]=0;u(b,!0);const C=new Uint8Array(b.outlen);for(let x=0;x<b.outlen;x++)C[x]=b.h[x>>2]>>8*(x&3);return C}function y(b,C,x,_,$){x=x||64,b=t.normalizeInput(b),_&&(_=t.normalizeInput(_)),$&&($=t.normalizeInput($));const I=h(x,C,_,$);return f(I,b),m(I)}function v(b,C,x,_,$){const I=y(b,C,x,_,$);return t.toHex(I)}return M$={blake2b:y,blake2bHex:v,blake2bInit:h,blake2bUpdate:f,blake2bFinal:m},M$}var O$,VK;function KBe(){if(VK)return O$;VK=1;const t=yue();function e(m,y){return m[y]^m[y+1]<<8^m[y+2]<<16^m[y+3]<<24}function n(m,y,v,b,C,x){o[m]=o[m]+o[y]+C,o[b]=r(o[b]^o[m],16),o[v]=o[v]+o[b],o[y]=r(o[y]^o[v],12),o[m]=o[m]+o[y]+x,o[b]=r(o[b]^o[m],8),o[v]=o[v]+o[b],o[y]=r(o[y]^o[v],7)}function r(m,y){return m>>>y^m<<32-y}const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),o=new Uint32Array(16),a=new Uint32Array(16);function c(m,y){let v=0;for(v=0;v<8;v++)o[v]=m.h[v],o[v+8]=i[v];for(o[12]^=m.t,o[13]^=m.t/4294967296,y&&(o[14]=~o[14]),v=0;v<16;v++)a[v]=e(m.b,4*v);for(v=0;v<10;v++)n(0,4,8,12,a[s[v*16+0]],a[s[v*16+1]]),n(1,5,9,13,a[s[v*16+2]],a[s[v*16+3]]),n(2,6,10,14,a[s[v*16+4]],a[s[v*16+5]]),n(3,7,11,15,a[s[v*16+6]],a[s[v*16+7]]),n(0,5,10,15,a[s[v*16+8]],a[s[v*16+9]]),n(1,6,11,12,a[s[v*16+10]],a[s[v*16+11]]),n(2,7,8,13,a[s[v*16+12]],a[s[v*16+13]]),n(3,4,9,14,a[s[v*16+14]],a[s[v*16+15]]);for(v=0;v<8;v++)m.h[v]^=o[v]^o[v+8]}function l(m,y){if(!(m>0&&m<=32))throw new Error("Incorrect output length, should be in [1, 32]");const v=y?y.length:0;if(y&&!(v>0&&v<=32))throw new Error("Incorrect key length, should be in [1, 32]");const b={h:new Uint32Array(i),b:new Uint8Array(64),c:0,t:0,outlen:m};return b.h[0]^=16842752^v<<8^m,v>0&&(u(b,y),b.c=64),b}function u(m,y){for(let v=0;v<y.length;v++)m.c===64&&(m.t+=m.c,c(m,!1),m.c=0),m.b[m.c++]=y[v]}function d(m){for(m.t+=m.c;m.c<64;)m.b[m.c++]=0;c(m,!0);const y=new Uint8Array(m.outlen);for(let v=0;v<m.outlen;v++)y[v]=m.h[v>>2]>>8*(v&3)&255;return y}function h(m,y,v){v=v||32,m=t.normalizeInput(m);const b=l(v,y);return u(b,m),d(b)}function f(m,y,v){const b=h(m,y,v);return t.toHex(b)}return O$={blake2s:h,blake2sHex:f,blake2sInit:l,blake2sUpdate:u,blake2sFinal:d},O$}var j$,qK;function GBe(){if(qK)return j$;qK=1;const t=qBe(),e=KBe();return j$={blake2b:t.blake2b,blake2bHex:t.blake2bHex,blake2bInit:t.blake2bInit,blake2bUpdate:t.blake2bUpdate,blake2bFinal:t.blake2bFinal,blake2s:e.blake2s,blake2sHex:e.blake2sHex,blake2sInit:e.blake2sInit,blake2sUpdate:e.blake2sUpdate,blake2sFinal:e.blake2sFinal},j$}var ZBe=GBe(),YBe={};const QBe=":";function Qm(t){const[e,n]=t.split(QBe);return{namespace:e,reference:n}}function KK(t,e=[]){const n=[];return Object.keys(t).forEach(r=>{if(e.length&&!e.includes(r))return;const i=t[r];n.push(...i.accounts)}),n}function wue(t,e){return t.includes(":")?[t]:e.chains||[]}var XBe=Object.defineProperty,JBe=Object.defineProperties,eFe=Object.getOwnPropertyDescriptors,GK=Object.getOwnPropertySymbols,tFe=Object.prototype.hasOwnProperty,nFe=Object.prototype.propertyIsEnumerable,jM=(t,e,n)=>e in t?XBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ZK=(t,e)=>{for(var n in e||(e={}))tFe.call(e,n)&&jM(t,n,e[n]);if(GK)for(var n of GK(e))nFe.call(e,n)&&jM(t,n,e[n]);return t},rFe=(t,e)=>JBe(t,eFe(e)),YK=(t,e,n)=>jM(t,typeof e!="symbol"?e+"":e,n);const iFe="ReactNative",ja={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},sFe="js";function f9(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function vp(){return!eh.getDocument()&&!!eh.getNavigator()&&navigator.product===iFe}function oFe(){return vp()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function aFe(){return vp()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function N2(){return!f9()&&!!eh.getNavigator()&&!!eh.getDocument()}function T5(){return vp()?ja.reactNative:f9()?ja.node:N2()?ja.browser:ja.unknown}function QK(){var t;try{return vp()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function cFe(t,e){const n=new URLSearchParams(t);for(const r of Object.keys(e).sort())if(e.hasOwnProperty(r)){const i=e[r];i!==void 0&&n.set(r,i)}return n.toString()}function lFe(t){var e,n;const r=vue();try{return t!=null&&t.url&&r.url&&new URL(t.url).host!==new URL(r.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${t.url} differs from the actual page url:${r.url}. This is probably unintended and can lead to issues.`),t.url=r.url),(e=t==null?void 0:t.icons)!=null&&e.length&&t.icons.length>0&&(t.icons=t.icons.filter(i=>i!=="")),rFe(ZK(ZK({},r),t),{url:(t==null?void 0:t.url)||r.url,name:(t==null?void 0:t.name)||r.name,description:(t==null?void 0:t.description)||r.description,icons:(n=t==null?void 0:t.icons)!=null&&n.length&&t.icons.length>0?t.icons:r.icons})}catch(i){return console.warn("Error populating app metadata",i),t||r}}function vue(){return qOe.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function uFe(){if(T5()===ja.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:n,Version:r}=global.Platform;return[n,r].join("-")}const t=uOe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function dFe(){var t;const e=T5();return e===ja.browser?[e,((t=eh.getLocation())==null?void 0:t.host)||"unknown"].join(":"):e}function bue(t,e,n){const r=uFe(),i=dFe();return[[t,e].join("-"),[sFe,n].join("-"),r,i].join("/")}function hFe({protocol:t,version:e,relayUrl:n,sdkVersion:r,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a,packageName:c}){const l=n.split("?"),u=bue(t,e,r),d={auth:i,ua:u,projectId:s,useOnCloseEvent:o,packageName:c||void 0,bundleId:a||void 0},h=cFe(l[1]||"",d);return l[0]+"?"+h}function w0(t,e){return t.filter(n=>e.includes(n)).length===t.length}function NM(t){return Object.fromEntries(t.entries())}function DM(t){return new Map(Object.entries(t))}function t0(t=Pt.FIVE_MINUTES,e){const n=Pt.toMiliseconds(t||Pt.FIVE_MINUTES);let r,i,s,o;return{resolve:a=>{s&&r&&(clearTimeout(s),r(a),o=Promise.resolve(a))},reject:a=>{s&&i&&(clearTimeout(s),i(a))},done:()=>new Promise((a,c)=>{if(o)return a(o);s=setTimeout(()=>{const l=new Error(e);o=Promise.reject(l),c(l)},n),r=a,i=c})}}function Hf(t,e,n){return new Promise(async(r,i)=>{const s=setTimeout(()=>i(new Error(n)),e);try{const o=await t;r(o)}catch(o){i(o)}clearTimeout(s)})}function xue(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function fFe(t){return xue("topic",t)}function pFe(t){return xue("id",t)}function Eue(t){const[e,n]=t.split(":"),r={id:void 0,topic:void 0};if(e==="topic"&&typeof n=="string")r.topic=n;else if(e==="id"&&Number.isInteger(Number(n)))r.id=Number(n);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${n}`);return r}function Zi(t,e){return Pt.fromMiliseconds(Date.now()+Pt.toMiliseconds(t))}function vf(t){return Date.now()>=Pt.toMiliseconds(t)}function ar(t,e){return`${t}${e?`:${e}`:""}`}function Cu(t=[],e=[]){return[...new Set([...t,...e])]}async function gFe({id:t,topic:e,wcDeepLink:n}){var r;try{if(!n)return;const i=typeof n=="string"?JSON.parse(n):n,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=mFe(s,t,e),a=T5();if(a===ja.browser){if(!((r=eh.getDocument())!=null&&r.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}yFe(o)}else a===ja.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}function mFe(t,e,n){const r=`requestId=${e}&sessionTopic=${n}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${xFe(r,!0)}`}else i=`${i}/wc?${r}`;return i}function yFe(t){let e="_self";bFe()?e="_top":(vFe()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function wFe(t,e){let n="";try{if(N2()&&(n=localStorage.getItem(e),n))return n;n=await t.getItem(e)}catch(r){console.error(r)}return n}function XK(t,e){if(!t.includes(e))return null;const n=t.split(/([&,?,=])/),r=n.indexOf(e);return n[r+2]}function JK(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function wL(){return typeof process<"u"&&YBe.IS_VITEST==="true"}function vFe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function bFe(){try{return window.self!==window.top}catch{return!1}}function xFe(t,e=!1){const n=Buffer.from(t).toString("base64");return e?n.replace(/[=]/g,""):n}function Cue(t){return Buffer.from(t,"base64").toString("utf-8")}function EFe(t){return new Promise(e=>setTimeout(e,t))}let CFe=class{constructor({limit:e}){YK(this,"limit"),YK(this,"set"),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const n=this.set.values().next().value;n&&this.set.delete(n)}this.set.add(e)}}has(e){return this.set.has(e)}};const G4=BigInt(2**32-1),eG=BigInt(32);function _ue(t,e=!1){return e?{h:Number(t&G4),l:Number(t>>eG&G4)}:{h:Number(t>>eG&G4)|0,l:Number(t&G4)|0}}function Sue(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let s=0;s<n;s++){const{h:o,l:a}=_ue(t[s],e);[r[s],i[s]]=[o,a]}return[r,i]}const tG=(t,e,n)=>t>>>n,nG=(t,e,n)=>t<<32-n|e>>>n,bf=(t,e,n)=>t>>>n|e<<32-n,xf=(t,e,n)=>t<<32-n|e>>>n,Wv=(t,e,n)=>t<<64-n|e>>>n-32,Hv=(t,e,n)=>t>>>n-32|e<<64-n,_Fe=(t,e)=>e,SFe=(t,e)=>t,AFe=(t,e,n)=>t<<n|e>>>32-n,kFe=(t,e,n)=>e<<n|t>>>32-n,$Fe=(t,e,n)=>e<<n-32|t>>>64-n,IFe=(t,e,n)=>t<<n-32|e>>>64-n;function Xc(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const vL=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),bL=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,TFe=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),PFe=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,RFe=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),MFe=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,Kg=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function xL(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function rh(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Sc(t,...e){if(!xL(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function EL(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");rh(t.outputLen),rh(t.blockLen)}function cp(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function CL(t,e){Sc(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function i3(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Ac(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function N$(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Wl(t,e){return t<<32-e|t>>>e}const Aue=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function kue(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const fd=Aue?t=>t:t=>kue(t);function OFe(t){for(let e=0;e<t.length;e++)t[e]=kue(t[e]);return t}const Ef=Aue?t=>t:OFe,$ue=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",jFe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function s3(t){if(Sc(t),$ue)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=jFe[t[n]];return e}const ad={_0:48,_9:57,A:65,F:70,a:97,f:102};function rG(t){if(t>=ad._0&&t<=ad._9)return t-ad._0;if(t>=ad.A&&t<=ad.F)return t-(ad.A-10);if(t>=ad.a&&t<=ad.f)return t-(ad.a-10)}function _L(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if($ue)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const o=rG(t.charCodeAt(s)),a=rG(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function NFe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function vl(t){return typeof t=="string"&&(t=NFe(t)),Sc(t),t}function v0(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Sc(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}let GC=class{};function P5(t){const e=r=>t().update(vl(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function DFe(t){const e=(r,i)=>t(i).update(vl(r)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}function D2(t=32){if(Kg&&typeof Kg.getRandomValues=="function")return Kg.getRandomValues(new Uint8Array(t));if(Kg&&typeof Kg.randomBytes=="function")return Uint8Array.from(Kg.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const LFe=BigInt(0),sv=BigInt(1),BFe=BigInt(2),FFe=BigInt(7),UFe=BigInt(256),zFe=BigInt(113),Iue=[],Tue=[],Pue=[];for(let t=0,e=sv,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],Iue.push(2*(5*r+n)),Tue.push((t+1)*(t+2)/2%64);let i=LFe;for(let s=0;s<7;s++)e=(e<<sv^(e>>FFe)*zFe)%UFe,e&BFe&&(i^=sv<<(sv<<BigInt(s))-sv);Pue.push(i)}const Rue=Sue(Pue,!0),WFe=Rue[0],HFe=Rue[1],iG=(t,e,n)=>n>32?$Fe(t,e,n):AFe(t,e,n),sG=(t,e,n)=>n>32?IFe(t,e,n):kFe(t,e,n);function VFe(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],d=iG(l,u,1)^n[a],h=sG(l,u,1)^n[a+1];for(let f=0;f<50;f+=10)t[o+f]^=d,t[o+f+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=Tue[o],c=iG(i,s,a),l=sG(i,s,a),u=Iue[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=WFe[r],t[1]^=HFe[r]}Ac(n)}let qFe=class Mue extends GC{constructor(e,n,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,rh(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=i3(this.state)}clone(){return this._cloneInto()}keccak(){Ef(this.state32),VFe(this.state32,this.rounds),Ef(this.state32),this.posOut=0,this.pos=0}update(e){cp(this),e=vl(e),Sc(e);const{blockLen:n,state:r}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){cp(this,!1),Sc(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return rh(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(CL(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Ac(this.state)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Mue(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const KFe=(t,e,n)=>P5(()=>new qFe(e,t,n)),GFe=KFe(1,136,256/8);function ZFe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+l,a,r)}function YFe(t,e,n){return t&e^~t&n}function QFe(t,e,n){return t&e^t&n^e&n}let Oue=class extends GC{constructor(e,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=N$(this.buffer)}update(e){cp(this),e=vl(e),Sc(e);const{view:n,buffer:r,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=N$(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){cp(this),CL(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,Ac(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let d=o;d<i;d++)n[d]=0;ZFe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=N$(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}};const Yh=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xs=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Js=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),XFe=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]),Qh=new Uint32Array(64);let JFe=class extends Oue{constructor(e=32){super(64,e,8,!1),this.A=Yh[0]|0,this.B=Yh[1]|0,this.C=Yh[2]|0,this.D=Yh[3]|0,this.E=Yh[4]|0,this.F=Yh[5]|0,this.G=Yh[6]|0,this.H=Yh[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:o,G:a,H:c}=this;return[e,n,r,i,s,o,a,c]}set(e,n,r,i,s,o,a,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,n){for(let d=0;d<16;d++,n+=4)Qh[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const h=Qh[d-15],f=Qh[d-2],m=Wl(h,7)^Wl(h,18)^h>>>3,y=Wl(f,17)^Wl(f,19)^f>>>10;Qh[d]=y+Qh[d-7]+m+Qh[d-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const h=Wl(a,6)^Wl(a,11)^Wl(a,25),f=u+h+YFe(a,c,l)+XFe[d]+Qh[d]|0,m=(Wl(r,2)^Wl(r,13)^Wl(r,22))+QFe(r,i,s)|0;u=l,l=c,c=a,a=o+f|0,o=s,s=i,i=r,r=f+m|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,s,o,a,c,l,u)}roundClean(){Ac(Qh)}destroy(){this.set(0,0,0,0,0,0,0,0),Ac(this.buffer)}};const jue=Sue(["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
1395771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),eUe=jue[0],tUe=jue[1],Xh=new Uint32Array(80),Jh=new Uint32Array(80);let SL=class extends Oue{constructor(e=64){super(128,e,16,!1),this.Ah=Js[0]|0,this.Al=Js[1]|0,this.Bh=Js[2]|0,this.Bl=Js[3]|0,this.Ch=Js[4]|0,this.Cl=Js[5]|0,this.Dh=Js[6]|0,this.Dl=Js[7]|0,this.Eh=Js[8]|0,this.El=Js[9]|0,this.Fh=Js[10]|0,this.Fl=Js[11]|0,this.Gh=Js[12]|0,this.Gl=Js[13]|0,this.Hh=Js[14]|0,this.Hl=Js[15]|0}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:h,Gh:f,Gl:m,Hh:y,Hl:v}=this;return[e,n,r,i,s,o,a,c,l,u,d,h,f,m,y,v]}set(e,n,r,i,s,o,a,c,l,u,d,h,f,m,y,v){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=h|0,this.Gh=f|0,this.Gl=m|0,this.Hh=y|0,this.Hl=v|0}process(e,n){for(let x=0;x<16;x++,n+=4)Xh[x]=e.getUint32(n),Jh[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const _=Xh[x-15]|0,$=Jh[x-15]|0,I=bf(_,$,1)^bf(_,$,8)^tG(_,$,7),R=xf(_,$,1)^xf(_,$,8)^nG(_,$,7),N=Xh[x-2]|0,T=Jh[x-2]|0,O=bf(N,T,19)^Wv(N,T,61)^tG(N,T,6),U=xf(N,T,19)^Hv(N,T,61)^nG(N,T,6),z=TFe(R,U,Jh[x-7],Jh[x-16]),L=PFe(z,I,O,Xh[x-7],Xh[x-16]);Xh[x]=L|0,Jh[x]=z|0}let{Ah:r,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:h,Fh:f,Fl:m,Gh:y,Gl:v,Hh:b,Hl:C}=this;for(let x=0;x<80;x++){const _=bf(d,h,14)^bf(d,h,18)^Wv(d,h,41),$=xf(d,h,14)^xf(d,h,18)^Hv(d,h,41),I=d&f^~d&y,R=h&m^~h&v,N=RFe(C,$,R,tUe[x],Jh[x]),T=MFe(N,b,_,I,eUe[x],Xh[x]),O=N|0,U=bf(r,i,28)^Wv(r,i,34)^Wv(r,i,39),z=xf(r,i,28)^Hv(r,i,34)^Hv(r,i,39),L=r&s^r&a^s&a,S=i&o^i&c^o&c;b=y|0,C=v|0,y=f|0,v=m|0,f=d|0,m=h|0,{h:d,l:h}=Xc(l|0,u|0,T|0,O|0),l=a|0,u=c|0,a=s|0,c=o|0,s=r|0,o=i|0;const k=vL(O,z,S);r=bL(k,T,U,L),i=k|0}({h:r,l:i}=Xc(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:o}=Xc(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Xc(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=Xc(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:h}=Xc(this.Eh|0,this.El|0,d|0,h|0),{h:f,l:m}=Xc(this.Fh|0,this.Fl|0,f|0,m|0),{h:y,l:v}=Xc(this.Gh|0,this.Gl|0,y|0,v|0),{h:b,l:C}=Xc(this.Hh|0,this.Hl|0,b|0,C|0),this.set(r,i,s,o,a,c,l,u,d,h,f,m,y,v,b,C)}roundClean(){Ac(Xh,Jh)}destroy(){Ac(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},nUe=class extends SL{constructor(){super(48),this.Ah=Xs[0]|0,this.Al=Xs[1]|0,this.Bh=Xs[2]|0,this.Bl=Xs[3]|0,this.Ch=Xs[4]|0,this.Cl=Xs[5]|0,this.Dh=Xs[6]|0,this.Dl=Xs[7]|0,this.Eh=Xs[8]|0,this.El=Xs[9]|0,this.Fh=Xs[10]|0,this.Fl=Xs[11]|0,this.Gh=Xs[12]|0,this.Gl=Xs[13]|0,this.Hh=Xs[14]|0,this.Hl=Xs[15]|0}};const eo=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);let rUe=class extends SL{constructor(){super(32),this.Ah=eo[0]|0,this.Al=eo[1]|0,this.Bh=eo[2]|0,this.Bl=eo[3]|0,this.Ch=eo[4]|0,this.Cl=eo[5]|0,this.Dh=eo[6]|0,this.Dl=eo[7]|0,this.Eh=eo[8]|0,this.El=eo[9]|0,this.Fh=eo[10]|0,this.Fl=eo[11]|0,this.Gh=eo[12]|0,this.Gl=eo[13]|0,this.Hh=eo[14]|0,this.Hl=eo[15]|0}};const ZC=P5(()=>new JFe),iUe=P5(()=>new SL),sUe=P5(()=>new nUe),oUe=P5(()=>new rUe),aUe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),qi=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Vt=new Uint32Array(32);function ef(t,e,n,r,i,s){const o=i[s],a=i[s+1];let c=Vt[2*t],l=Vt[2*t+1],u=Vt[2*e],d=Vt[2*e+1],h=Vt[2*n],f=Vt[2*n+1],m=Vt[2*r],y=Vt[2*r+1],v=vL(c,u,o);
vendor: 44,787 bytes, lines 139-142
139l=bL(v,l,d,a),c=v|0,{Dh:y,Dl:m}={Dh:y^l,Dl:m^c},{Dh:y,Dl:m}={Dh:_Fe(y,m),Dl:SFe(y)},{h:f,l:h}=Xc(f,h,y,m),{Bh:d,Bl:u}={Bh:d^f,Bl:u^h},{Bh:d,Bl:u}={Bh:bf(d,u,24),Bl:xf(d,u,24)},Vt[2*t]=c,Vt[2*t+1]=l,Vt[2*e]=u,Vt[2*e+1]=d,Vt[2*n]=h,Vt[2*n+1]=f,Vt[2*r]=m,Vt[2*r+1]=y}function tf(t,e,n,r,i,s){const o=i[s],a=i[s+1];let c=Vt[2*t],l=Vt[2*t+1],u=Vt[2*e],d=Vt[2*e+1],h=Vt[2*n],f=Vt[2*n+1],m=Vt[2*r],y=Vt[2*r+1],v=vL(c,u,o);l=bL(v,l,d,a),c=v|0,{Dh:y,Dl:m}={Dh:y^l,Dl:m^c},{Dh:y,Dl:m}={Dh:bf(y,m,16),Dl:xf(y,m,16)},{h:f,l:h}=Xc(f,h,y,m),{Bh:d,Bl:u}={Bh:d^f,Bl:u^h},{Bh:d,Bl:u}={Bh:Wv(d,u,63),Bl:Hv(d,u,63)},Vt[2*t]=c,Vt[2*t+1]=l,Vt[2*e]=u,Vt[2*e+1]=d,Vt[2*n]=h,Vt[2*n+1]=f,Vt[2*r]=m,Vt[2*r+1]=y}function cUe(t,e={},n,r,i){if(rh(n),t<0||t>n)throw new Error("outputLen bigger than keyLen");const{key:s,salt:o,personalization:a}=e;if(s!==void 0&&(s.length<1||s.length>n))throw new Error("key length must be undefined or 1.."+n);if(o!==void 0&&o.length!==r)throw new Error("salt must be undefined or "+r);if(a!==void 0&&a.length!==i)throw new Error("personalization must be undefined or "+i)}class lUe extends GC{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,rh(e),rh(n),this.blockLen=e,this.outputLen=n,this.buffer=new Uint8Array(e),this.buffer32=i3(this.buffer)}update(e){cp(this),e=vl(e),Sc(e);const{blockLen:n,buffer:r,buffer32:i}=this,s=e.length,o=e.byteOffset,a=e.buffer;for(let c=0;c<s;){this.pos===n&&(Ef(i),this.compress(i,0,!1),Ef(i),this.pos=0);const l=Math.min(n-this.pos,s-c),u=o+c;if(l===n&&!(u%4)&&c+l<s){const d=new Uint32Array(a,u,Math.floor((s-c)/4));Ef(d);for(let h=0;c+n<s;h+=i.length,c+=n)this.length+=n,this.compress(d,h,!1);Ef(d);continue}r.set(e.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(e){cp(this),CL(e,this);const{pos:n,buffer32:r}=this;this.finished=!0,Ac(this.buffer.subarray(n)),Ef(r),this.compress(r,0,!0),Ef(r);const i=i3(e);this.get().forEach((s,o)=>i[o]=fd(s))}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){const{buffer:n,length:r,finished:i,destroyed:s,outputLen:o,pos:a}=this;return e||(e=new this.constructor({dkLen:o})),e.set(...this.get()),e.buffer.set(n),e.destroyed=s,e.finished=i,e.length=r,e.pos=a,e.outputLen=o,e}clone(){return this._cloneInto()}}class uUe extends lUe{constructor(e={}){const n=e.dkLen===void 0?64:e.dkLen;super(128,n),this.v0l=qi[0]|0,this.v0h=qi[1]|0,this.v1l=qi[2]|0,this.v1h=qi[3]|0,this.v2l=qi[4]|0,this.v2h=qi[5]|0,this.v3l=qi[6]|0,this.v3h=qi[7]|0,this.v4l=qi[8]|0,this.v4h=qi[9]|0,this.v5l=qi[10]|0,this.v5h=qi[11]|0,this.v6l=qi[12]|0,this.v6h=qi[13]|0,this.v7l=qi[14]|0,this.v7h=qi[15]|0,cUe(n,e,64,16,16);let{key:r,personalization:i,salt:s}=e,o=0;if(r!==void 0&&(r=vl(r),o=r.length),this.v0l^=this.outputLen|o<<8|65536|1<<24,s!==void 0){s=vl(s);const a=i3(s);this.v4l^=fd(a[0]),this.v4h^=fd(a[1]),this.v5l^=fd(a[2]),this.v5h^=fd(a[3])}if(i!==void 0){i=vl(i);const a=i3(i);this.v6l^=fd(a[0]),this.v6h^=fd(a[1]),this.v7l^=fd(a[2]),this.v7h^=fd(a[3])}if(r!==void 0){const a=new Uint8Array(this.blockLen);a.set(r),this.update(a)}}get(){let{v0l:e,v0h:n,v1l:r,v1h:i,v2l:s,v2h:o,v3l:a,v3h:c,v4l:l,v4h:u,v5l:d,v5h:h,v6l:f,v6h:m,v7l:y,v7h:v}=this;return[e,n,r,i,s,o,a,c,l,u,d,h,f,m,y,v]}set(e,n,r,i,s,o,a,c,l,u,d,h,f,m,y,v){this.v0l=e|0,this.v0h=n|0,this.v1l=r|0,this.v1h=i|0,this.v2l=s|0,this.v2h=o|0,this.v3l=a|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=d|0,this.v5h=h|0,this.v6l=f|0,this.v6h=m|0,this.v7l=y|0,this.v7h=v|0}compress(e,n,r){this.get().forEach((c,l)=>Vt[l]=c),Vt.set(qi,16);let{h:i,l:s}=_ue(BigInt(this.length));Vt[24]=qi[8]^s,Vt[25]=qi[9]^i,r&&(Vt[28]=~Vt[28],Vt[29]=~Vt[29]);let o=0;const a=aUe;for(let c=0;c<12;c++)ef(0,4,8,12,e,n+2*a[o++]),tf(0,4,8,12,e,n+2*a[o++]),ef(1,5,9,13,e,n+2*a[o++]),tf(1,5,9,13,e,n+2*a[o++]),ef(2,6,10,14,e,n+2*a[o++]),tf(2,6,10,14,e,n+2*a[o++]),ef(3,7,11,15,e,n+2*a[o++]),tf(3,7,11,15,e,n+2*a[o++]),ef(0,5,10,15,e,n+2*a[o++]),tf(0,5,10,15,e,n+2*a[o++]),ef(1,6,11,12,e,n+2*a[o++]),tf(1,6,11,12,e,n+2*a[o++]),ef(2,7,8,13,e,n+2*a[o++]),tf(2,7,8,13,e,n+2*a[o++]),ef(3,4,9,14,e,n+2*a[o++]),tf(3,4,9,14,e,n+2*a[o++]);this.v0l^=Vt[0]^Vt[16],this.v0h^=Vt[1]^Vt[17],this.v1l^=Vt[2]^Vt[18],this.v1h^=Vt[3]^Vt[19],this.v2l^=Vt[4]^Vt[20],this.v2h^=Vt[5]^Vt[21],this.v3l^=Vt[6]^Vt[22],this.v3h^=Vt[7]^Vt[23],this.v4l^=Vt[8]^Vt[24],this.v4h^=Vt[9]^Vt[25],this.v5l^=Vt[10]^Vt[26],this.v5h^=Vt[11]^Vt[27],this.v6l^=Vt[12]^Vt[28],this.v6h^=Vt[13]^Vt[29],this.v7l^=Vt[14]^Vt[30],this.v7h^=Vt[15]^Vt[31],Ac(Vt)}destroy(){this.destroyed=!0,Ac(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const dUe=DFe(t=>new uUe(t)),hUe="https://rpc.walletconnect.org/v1";function Nue(t){const e=`�Ethereum Signed Message: 140${t.length}`,n=new TextEncoder().encode(e+t);return"0x"+Buffer.from(GFe(n)).toString("hex")}async function fUe(t,e,n,r,i,s){switch(n.t){case"eip191":return await pUe(t,e,n.s);case"eip1271":return await gUe(t,e,n.s,r,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${n.t}`)}}async function pUe(t,e,n){return(await uje({hash:Nue(e),signature:n})).toLowerCase()===t.toLowerCase()}async function gUe(t,e,n,r,i,s){const o=Qm(r);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${r}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l=n.substring(2),u=(l.length/2).toString(16).padStart(64,"0"),d=(e.startsWith("0x")?e:Nue(e)).substring(2),h=a+d+c+u+l,f=await fetch(`${s||hUe}/?chainId=${r}&projectId=${i}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:mUe(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:h},"latest"]})}),{result:m}=await f.json();return m?m.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function mUe(){return Date.now()+Math.floor(Math.random()*1e3)}function yUe(t){const e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);const r=n[0];if(r===0)throw new Error("No signatures found");const i=1+r*64;if(n.length<i)throw new Error("Transaction data too short for claimed signature count");if(n.length<100)throw new Error("Transaction too short");const s=Buffer.from(t,"base64").slice(1,65);return th.encode(s)}function wUe(t){const e=new Uint8Array(Buffer.from(t,"base64")),n=Array.from("TransactionData::").map(s=>s.charCodeAt(0)),r=new Uint8Array(n.length+e.length);r.set(n),r.set(e,n.length);const i=dUe(r,{dkLen:32});return th.encode(i)}function oG(t){const e=new Uint8Array(ZC(vUe(t)));return th.encode(e)}function vUe(t){if(t instanceof Uint8Array)return t;if(Array.isArray(t))return new Uint8Array(t);if(typeof t=="object"&&t!=null&&t.data)return new Uint8Array(Object.values(t.data));if(typeof t=="object"&&t)return new Uint8Array(Object.values(t));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function aG(t){const e=Buffer.from(t,"base64"),n=Gje(e).txn;if(!n)throw new Error("Invalid signed transaction: missing 'txn' field");const r=Bje(n),i=Buffer.from("TX"),s=Buffer.concat([i,Buffer.from(r)]),o=oUe(s);return nNe.encode(o).replace(/=+$/,"")}function D$(t){const e=[];let n=BigInt(t);for(;n>=BigInt(128);)e.push(Number(n&BigInt(127)|BigInt(128))),n>>=BigInt(7);return e.push(Number(n)),Buffer.from(e)}function bUe(t){const e=Buffer.from(t.signed.bodyBytes,"base64"),n=Buffer.from(t.signed.authInfoBytes,"base64"),r=Buffer.from(t.signature.signature,"base64"),i=[];i.push(Buffer.from([10])),i.push(D$(e.length)),i.push(e),i.push(Buffer.from([18])),i.push(D$(n.length)),i.push(n),i.push(Buffer.from([26])),i.push(D$(r.length)),i.push(r);const s=Buffer.concat(i),o=ZC(s);return Buffer.from(o).toString("hex").toUpperCase()}var xUe=Object.defineProperty,EUe=Object.defineProperties,CUe=Object.getOwnPropertyDescriptors,cG=Object.getOwnPropertySymbols,_Ue=Object.prototype.hasOwnProperty,SUe=Object.prototype.propertyIsEnumerable,lG=(t,e,n)=>e in t?xUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,AUe=(t,e)=>{for(var n in e||(e={}))_Ue.call(e,n)&&lG(t,n,e[n]);if(cG)for(var n of cG(e))SUe.call(e,n)&&lG(t,n,e[n]);return t},kUe=(t,e)=>EUe(t,CUe(e));const $Ue="did:pkh:",AL=t=>t==null?void 0:t.split(":"),IUe=t=>{const e=t&&AL(t);if(e)return t.includes($Ue)?e[3]:e[1]},LM=t=>{const e=t&&AL(t);if(e)return e[2]+":"+e[3]},p9=t=>{const e=t&&AL(t);if(e)return e.pop()};async function uG(t){const{cacao:e,projectId:n}=t,{s:r,p:i}=e,s=Due(i,i.iss),o=p9(i.iss);return await fUe(o,s,r,LM(i.iss),n)}const Due=(t,e)=>{const n=`${t.domain} wants you to sign in with your Ethereum account:`,r=p9(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${IUe(e)}`,c=`Nonce: ${t.nonce}`,l=`Issued At: ${t.iat}`,u=t.exp?`Expiration Time: ${t.exp}`:void 0,d=t.nbf?`Not Before: ${t.nbf}`:void 0,h=t.requestId?`Request ID: ${t.requestId}`:void 0,f=t.resources?`Resources:${t.resources.map(y=>` 141- ${y}`).join("")}`:void 0,m=d8(t.resources);if(m){const y=o3(m);i=LUe(i,y)}return[n,r,"",i,"",s,o,a,c,l,u,d,h,f].filter(y=>y!=null).join(` 142`)};function TUe(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function PUe(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function x1(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(n=>{const r=t.att[n];if(Array.isArray(r))throw new Error(`Resource must be an object: ${n}`);if(typeof r!="object")throw new Error(`Resource must be an object: ${n}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${n}`);Object.keys(r).forEach(i=>{const s=r[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function RUe(t,e,n,r={}){return n==null||n.sort((i,s)=>i.localeCompare(s)),{att:{[t]:MUe(e,n,r)}}}function MUe(t,e,n={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const r=e.map(i=>({[`${t}/${i}`]:[n]}));return Object.assign({},...r)}function Lue(t){return x1(t),`urn:recap:${TUe(t).replace(/=/g,"")}`}function o3(t){const e=PUe(t.replace("urn:recap:",""));return x1(e),e}function OUe(t,e,n){const r=RUe(t,e,n);return Lue(r)}function jUe(t){return t&&t.includes("urn:recap:")}function NUe(t,e){const n=o3(t),r=o3(e),i=DUe(n,r);return Lue(i)}function DUe(t,e){x1(t),x1(e);const n=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),r={att:{}};return n.forEach(i=>{var s,o;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,l;r.att[i]=kUe(AUe({},r.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((l=e.att[i])==null?void 0:l[a])})})}),r}function LUe(t="",e){x1(e);const n="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(n))return t;const r=[];let i=0;Object.keys(e.att).forEach(a=>{const c=Object.keys(e.att[a]).map(d=>({ability:d.split("/")[0],action:d.split("/")[1]}));c.sort((d,h)=>d.action.localeCompare(h.action));const l={};c.forEach(d=>{l[d.ability]||(l[d.ability]=[]),l[d.ability].push(d.action)});const u=Object.keys(l).map(d=>(i++,`(${i}) '${d}': '${l[d].join("', '")}' for '${a}'.`));r.push(u.join(", ").replace(".,","."))});const s=r.join(" "),o=`${n}${s}`;return`${t?t+" ":""}${o}`}function dG(t){var e;const n=o3(t);x1(n);const r=(e=n.att)==null?void 0:e.eip155;return r?Object.keys(r).map(i=>i.split("/")[1]):[]}function hG(t){const e=o3(t);x1(e);const n=[];return Object.values(e.att).forEach(r=>{Object.values(r).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&n.push(i[0].chains)})}),[...new Set(n.flat())]}function d8(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return jUe(e)?e:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function Bue(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function BM(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function L$(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function ra(t,...e){if(!Bue(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function fG(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function BUe(t,e){ra(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function tp(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function r2(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function FUe(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const UUe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function zUe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function FM(t){if(typeof t=="string")t=zUe(t);else if(Bue(t))t=UM(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function WUe(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function HUe(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return n===0}const VUe=(t,e)=>{function n(r,...i){if(ra(r),!UUe)throw new Error("Non little-endian hardware is not yet supported");if(t.nonceLength!==void 0){const l=i[0];if(!l)throw new Error("nonce / iv required");t.varSizeNonce?ra(l):ra(l,t.nonceLength)}const s=t.tagLength;s&&i[1]!==void 0&&ra(i[1]);const o=e(r,...i),a=(l,u)=>{if(u!==void 0){if(l!==2)throw new Error("cipher output not supported");ra(u)}};let c=!1;return{encrypt(l,u){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,ra(l),a(o.encrypt.length,u),o.encrypt(l,u)},decrypt(l,u){if(ra(l),s&&l.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return a(o.decrypt.length,u),o.decrypt(l,u)}}}return Object.assign(n,t),n};function pG(t,e,n=!0){if(e===void 0)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(n&&!KUe(e))throw new Error("invalid output, must be aligned");return e}function gG(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s);t.setUint32(e+4,o,r),t.setUint32(e+0,a,r)}function qUe(t,e,n){BM(n);const r=new Uint8Array(16),i=FUe(r);return gG(i,0,BigInt(e),n),gG(i,8,BigInt(t),n),r}function KUe(t){return t.byteOffset%4===0}function UM(t){return Uint8Array.from(t)}const Fue=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),GUe=Fue("expand 16-byte k"),ZUe=Fue("expand 32-byte k"),YUe=tp(GUe),QUe=tp(ZUe);function er(t,e){return t<<e|t>>>32-e}function zM(t){return t.byteOffset%4===0}const Z4=64,XUe=16,Uue=2**32-1,mG=new Uint32Array;function JUe(t,e,n,r,i,s,o,a){const c=i.length,l=new Uint8Array(Z4),u=tp(l),d=zM(i)&&zM(s),h=d?tp(i):mG,f=d?tp(s):mG;for(let m=0;m<c;o++){if(t(e,n,r,u,o,a),o>=Uue)throw new Error("arx: counter overflow");const y=Math.min(Z4,c-m);if(d&&y===Z4){const v=m/4;if(m%4!==0)throw new Error("arx: invalid block position");for(let b=0,C;b<XUe;b++)C=v+b,f[C]=h[C]^u[b];m+=Z4;continue}for(let v=0,b;v<y;v++)b=m+v,s[b]=i[b]^l[v];m+=y}}function eze(t,e){const{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:s,rounds:o}=WUe({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return L$(i),L$(o),BM(s),BM(n),(a,c,l,u,d=0)=>{ra(a),ra(c),ra(l);const h=l.length;if(u===void 0&&(u=new Uint8Array(h)),ra(u),L$(d),d<0||d>=Uue)throw new Error("arx: counter overflow");if(u.length<h)throw new Error(`arx: output (${u.length}) is shorter than data (${h})`);const f=[];let m=a.length,y,v;if(m===32)f.push(y=UM(a)),v=QUe;else if(m===16&&n)y=new Uint8Array(32),y.set(a),y.set(a,16),v=YUe,f.push(y);else throw new Error(`arx: invalid 32-byte key, got length=${m}`);zM(c)||f.push(c=UM(c));const b=tp(y);if(r){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");r(v,b,tp(c.subarray(0,16)),b),c=c.subarray(16)}const C=16-i;if(C!==c.length)throw new Error(`arx: nonce must be ${C} or 16 bytes`);if(C!==12){const _=new Uint8Array(12);_.set(c,s?0:12-c.length),c=_,f.push(c)}const x=tp(c);return JUe(t,v,b,x,l,u,d,o),r2(...f),u}}const xs=(t,e)=>t[e++]&255|(t[e++]&255)<<8;class tze{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=FM(e),ra(e,32);const n=xs(e,0),r=xs(e,2),i=xs(e,4),s=xs(e,6),o=xs(e,8),a=xs(e,10),c=xs(e,12),l=xs(e,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let u=0;u<8;u++)this.pad[u]=xs(e,16+2*u)}process(e,n,r=!1){const i=r?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],l=o[2],u=o[3],d=o[4],h=o[5],f=o[6],m=o[7],y=o[8],v=o[9],b=xs(e,n+0),C=xs(e,n+2),x=xs(e,n+4),_=xs(e,n+6),$=xs(e,n+8),I=xs(e,n+10),R=xs(e,n+12),N=xs(e,n+14);let T=s[0]+(b&8191),O=s[1]+((b>>>13|C<<3)&8191),U=s[2]+((C>>>10|x<<6)&8191),z=s[3]+((x>>>7|_<<9)&8191),L=s[4]+((_>>>4|$<<12)&8191),S=s[5]+($>>>1&8191),k=s[6]+(($>>>14|I<<2)&8191),M=s[7]+((I>>>11|R<<5)&8191),W=s[8]+((R>>>8|N<<8)&8191),H=s[9]+(N>>>5|i),D=0,V=D+T*a+O*(5*v)+U*(5*y)+z*(5*m)+L*(5*f);D=V>>>13,V&=8191,V+=S*(5*h)+k*(5*d)+M*(5*u)+W*(5*l)+H*(5*c),D+=V>>>13,V&=8191;let B=D+T*c+O*a+U*(5*v)+z*(5*y)+L*(5*m);D=B>>>13,B&=8191,B+=S*(5*f)+k*(5*h)+M*(5*d)+W*(5*u)+H*(5*l),D+=B>>>13,B&=8191;let P=D+T*l+O*c+U*a+z*(5*v)+L*(5*y);D=P>>>13,P&=8191,P+=S*(5*m)+k*(5*f)+M*(5*h)+W*(5*d)+H*(5*u),D+=P>>>13,P&=8191;let j=D+T*u+O*l+U*c+z*a+L*(5*v);D=j>>>13,j&=8191,j+=S*(5*y)+k*(5*m)+M*(5*f)+W*(5*h)+H*(5*d),D+=j>>>13,j&=8191;let G=D+T*d+O*u+U*l+z*c+L*a;D=G>>>13,G&=8191,G+=S*(5*v)+k*(5*y)+M*(5*m)+W*(5*f)+H*(5*h),D+=G>>>13,G&=8191;let Y=D+T*h+O*d+U*u+z*l+L*c;D=Y>>>13,Y&=8191,Y+=S*a+k*(5*v)+M*(5*y)+W*(5*m)+H*(5*f),D+=Y>>>13,Y&=8191;let te=D+T*f+O*h+U*d+z*u+L*l;D=te>>>13,te&=8191,te+=S*c+k*a+M*(5*v)+W*(5*y)+H*(5*m),D+=te>>>13,te&=8191;let ae=D+T*m+O*f+U*h+z*d+L*u;D=ae>>>13,ae&=8191,ae+=S*l+k*c+M*a+W*(5*v)+H*(5*y),D+=ae>>>13,ae&=8191;let oe=D+T*y+O*m+U*f+z*h+L*d;D=oe>>>13,oe&=8191,oe+=S*u+k*l+M*c+W*a+H*(5*v),D+=oe>>>13,oe&=8191;let de=D+T*v+O*y+U*m+z*f+L*h;D=de>>>13,de&=8191,de+=S*d+k*u+M*l+W*c+H*a,D+=de>>>13,de&=8191,D=(D<<2)+D|0,D=D+V|0,V=D&8191,D=D>>>13,B+=D,s[0]=V,s[1]=B,s[2]=P,s[3]=j,s[4]=G,s[5]=Y,s[6]=te,s[7]=ae,s[8]=oe,s[9]=de}finalize(){const{h:e,pad:n}=this,r=new Uint16Array(10);let i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,r[0]=e[0]+5,i=r[0]>>>13,r[0]&=8191;for(let a=1;a<10;a++)r[a]=e[a]+i,i=r[a]>>>13,r[a]&=8191;r[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)r[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|r[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+n[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+n[a]|0)+(o>>>16)|0,e[a]=o&65535;r2(r)}update(e){fG(this),e=FM(e),ra(e);const{buffer:n,blockLen:r}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);if(o===r){for(;r<=i-s;s+=r)this.process(e,s);continue}n.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===r&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){r2(this.h,this.r,this.buffer,this.pad)}digestInto(e){fG(this),BUe(e,this),this.finished=!0;const{buffer:n,h:r}=this;let{pos:i}=this;if(i){for(n[i++]=1;i<16;i++)n[i]=0;this.process(n,0,!0)}this.finalize();let s=0;for(let o=0;o<8;o++)e[s++]=r[o]>>>0,e[s++]=r[o]>>>8;return e}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}}function nze(t){const e=(r,i)=>t(i).update(FM(r)).digest(),n=t(new Uint8Array(32));return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}const rze=nze(t=>new tze(t));function ize(t,e,n,r,i,s=20){let o=t[0],a=t[1],c=t[2],l=t[3],u=e[0],d=e[1],h=e[2],f=e[3],m=e[4],y=e[5],v=e[6],b=e[7],C=i,x=n[0],_=n[1],$=n[2],I=o,R=a,N=c,T=l,O=u,U=d,z=h,L=f,S=m,k=y,M=v,W=b,H=C,D=x,V=_,B=$;for(let j=0;j<s;j+=2)I=I+O|0,H=er(H^I,16),S=S+H|0,O=er(O^S,12),I=I+O|0,H=er(H^I,8),S=S+H|0,O=er(O^S,7),R=R+U|0,D=er(D^R,16),k=k+D|0,U=er(U^k,12),R=R+U|0,D=er(D^R,8),k=k+D|0,U=er(U^k,7),N=N+z|0,V=er(V^N,16),M=M+V|0,z=er(z^M,12),N=N+z|0,V=er(V^N,8),M=M+V|0,z=er(z^M,7),T=T+L|0,B=er(B^T,16),W=W+B|0,L=er(L^W,12),T=T+L|0,B=er(B^T,8),W=W+B|0,L=er(L^W,7),I=I+U|0,B=er(B^I,16),M=M+B|0,U=er(U^M,12),I=I+U|0,B=er(B^I,8),M=M+B|0,U=er(U^M,7),R=R+z|0,H=er(H^R,16),W=W+H|0,z=er(z^W,12),R=R+z|0,H=er(H^R,8),W=W+H|0,z=er(z^W,7),N=N+L|0,D=er(D^N,16),S=S+D|0,L=er(L^S,12),N=N+L|0,D=er(D^N,8),S=S+D|0,L=er(L^S,7),T=T+O|0,V=er(V^T,16),k=k+V|0,O=er(O^k,12),T=T+O|0,V=er(V^T,8),k=k+V|0,O=er(O^k,7);let P=0;r[P++]=o+I|0,r[P++]=a+R|0,r[P++]=c+N|0,r[P++]=l+T|0,r[P++]=u+O|0,r[P++]=d+U|0,r[P++]=h+z|0,r[P++]=f+L|0,r[P++]=m+S|0,r[P++]=y+k|0,r[P++]=v+M|0,r[P++]=b+W|0,r[P++]=C+H|0,r[P++]=x+D|0,r[P++]=_+V|0,r[P++]=$+B|0}const sze=eze(ize,{counterRight:!1,counterLength:4,allowShortKeys:!1}),oze=new Uint8Array(16),yG=(t,e)=>{t.update(e);const n=e.length%16;n&&t.update(oze.subarray(n))},aze=new Uint8Array(32);function wG(t,e,n,r,i){const s=t(e,n,aze),o=rze.create(s);i&&yG(o,i),yG(o,r);const a=qUe(r.length,i?i.length:0,!0);o.update(a);const c=o.digest();return r2(s,a),c}const cze=t=>(e,n,r)=>({encrypt(i,s){const o=i.length;s=pG(o+16,s,!1),s.set(i);const a=s.subarray(0,-16);t(e,n,a,a,1);const c=wG(t,e,n,a,r);return s.set(c,o),r2(c),s},decrypt(i,s){s=pG(i.length-16,s,!1);const o=i.subarray(0,-16),a=i.subarray(-16),c=wG(t,e,n,o,r);if(!HUe(a,c))throw new Error("invalid tag");return s.set(i.subarray(0,-16)),t(e,n,s,s,1),r2(c),s}}),zue=VUe({blockSize:64,nonceLength:12,tagLength:16},cze(sze));let Wue=class extends GC{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,EL(e);const r=vl(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),Ac(s)}update(e){return cp(this),this.iHash.update(e),this}digestInto(e){cp(this),Sc(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const YC=(t,e,n)=>new Wue(t,e).update(n).digest();YC.create=(t,e)=>new Wue(t,e);function lze(t,e,n){return EL(t),n===void 0&&(n=new Uint8Array(t.outputLen)),YC(t,vl(n),vl(e))}const B$=Uint8Array.from([0]),vG=Uint8Array.of();function uze(t,e,n,r=32){EL(t),rh(r);const i=t.outputLen;if(r>255*i)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(r/i);n===void 0&&(n=vG);const o=new Uint8Array(s*i),a=YC.create(t,e),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;u<s;u++)B$[0]=u+1,c.update(u===0?vG:l).update(n).update(B$).digestInto(l),o.set(l,i*u),a._cloneInto(c);return a.destroy(),c.destroy(),Ac(l,B$),o.slice(0,r)}const dze=(t,e,n,r,i)=>uze(t,lze(t,e,n),r,i),QC=ZC,kL=BigInt(0),WM=BigInt(1);function g9(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function Y4(t){const e=t.toString(16);return e.length&1?"0"+e:e}function Hue(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?kL:BigInt("0x"+t)}function XC(t){return Hue(s3(t))}function m9(t){return Sc(t),Hue(s3(Uint8Array.from(t).reverse()))}function $L(t,e){return _L(t.toString(16).padStart(e*2,"0"))}function IL(t,e){return $L(t,e).reverse()}function ea(t,e,n){let r;if(typeof e=="string")try{r=_L(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(xL(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}const F$=t=>typeof t=="bigint"&&kL<=t;function hze(t,e,n){return F$(t)&&F$(e)&&F$(n)&&e<=t&&t<n}function HM(t,e,n,r){if(!hze(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function fze(t){let e;for(e=0;t>kL;t>>=WM,e+=1);return e}const JC=t=>(WM<<BigInt(t))-WM;function pze(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=h=>new Uint8Array(h),i=h=>Uint8Array.of(h);let s=r(t),o=r(t),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},l=(...h)=>n(o,s,...h),u=(h=r(0))=>{o=l(i(0),h),s=l(),h.length!==0&&(o=l(i(1),h),s=l())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const f=[];for(;h<e;){s=l();const m=s.slice();f.push(m),h+=s.length}return v0(...f)};return(h,f)=>{c(),u(h);let m;for(;!(m=f(d()));)u();return c(),m}}function e_(t,e,n={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function r(i,s,o){const a=t[i];if(o&&a===void 0)return;const c=typeof a;if(c!==s||a===null)throw new Error(`param "${i}" is invalid: expected ${s}, got ${c}`)}Object.entries(e).forEach(([i,s])=>r(i,s,!1)),Object.entries(n).forEach(([i,s])=>r(i,s,!0))}function bG(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}const aa=BigInt(0),Po=BigInt(1),b0=BigInt(2),gze=BigInt(3),Vue=BigInt(4),que=BigInt(5),Kue=BigInt(8);function pc(t,e){const n=t%e;return n>=aa?n:e+n}function Yc(t,e,n){let r=t;for(;e-- >aa;)r*=r,r%=n;return r}function xG(t,e){if(t===aa)throw new Error("invert: expected non-zero number");if(e<=aa)throw new Error("invert: expected positive modulus, got "+e);let n=pc(t,e),r=e,i=aa,s=Po;for(;n!==aa;){const o=r/n,a=r%n,c=i-s*o;r=n,n=a,i=s,s=c}if(r!==Po)throw new Error("invert: does not exist");return pc(i,e)}function Gue(t,e){const n=(t.ORDER+Po)/Vue,r=t.pow(e,n);if(!t.eql(t.sqr(r),e))throw new Error("Cannot find square root");return r}function mze(t,e){const n=(t.ORDER-que)/Kue,r=t.mul(e,b0),i=t.pow(r,n),s=t.mul(e,i),o=t.mul(t.mul(s,b0),i),a=t.mul(s,t.sub(o,t.ONE));if(!t.eql(t.sqr(a),e))throw new Error("Cannot find square root");return a}function yze(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-Po,n=0;for(;e%b0===aa;)e/=b0,n++;let r=b0;const i=L2(t);for(;EG(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Gue;let s=i.pow(r,e);const o=(e+Po)/b0;return function(a,c){if(a.is0(c))return c;if(EG(a,c)!==1)throw new Error("Cannot find square root");let l=n,u=a.mul(a.ONE,s),d=a.pow(c,e),h=a.pow(c,o);for(;!a.eql(d,a.ONE);){if(a.is0(d))return a.ZERO;let f=1,m=a.sqr(d);for(;!a.eql(m,a.ONE);)if(f++,m=a.sqr(m),f===l)throw new Error("Cannot find square root");const y=Po<<BigInt(l-f-1),v=a.pow(u,y);l=f,u=a.sqr(v),d=a.mul(d,u),h=a.mul(h,v)}return h}}function wze(t){return t%Vue===gze?Gue:t%Kue===que?mze:yze(t)}const vze=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function bze(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=vze.reduce((r,i)=>(r[i]="function",r),e);return e_(t,n),t}function xze(t,e,n){if(n<aa)throw new Error("invalid exponent, negatives unsupported");if(n===aa)return t.ONE;if(n===Po)return e;let r=t.ONE,i=e;for(;n>aa;)n&Po&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Po;return r}function Zue(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((o,a,c)=>t.is0(a)?o:(r[c]=o,t.mul(o,a)),t.ONE),s=t.inv(i);return e.reduceRight((o,a,c)=>t.is0(a)?o:(r[c]=t.mul(o,r[c]),t.mul(o,a)),s),r}function EG(t,e){const n=(t.ORDER-Po)/b0,r=t.pow(e,n),i=t.eql(r,t.ONE),s=t.eql(r,t.ZERO),o=t.eql(r,t.neg(t.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function Eze(t,e){e!==void 0&&rh(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function L2(t,e,n=!1,r={}){if(t<=aa)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,s;if(typeof e=="object"&&e!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const u=e;u.BITS&&(i=u.BITS),u.sqrt&&(s=u.sqrt),typeof u.isLE=="boolean"&&(n=u.isLE)}else typeof e=="number"&&(i=e),r.sqrt&&(s=r.sqrt);const{nBitLength:o,nByteLength:a}=Eze(t,i);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const l=Object.freeze({ORDER:t,isLE:n,BITS:o,BYTES:a,MASK:JC(o),ZERO:aa,ONE:Po,create:u=>pc(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof u);return aa<=u&&u<t},is0:u=>u===aa,isValidNot0:u=>!l.is0(u)&&l.isValid(u),isOdd:u=>(u&Po)===Po,neg:u=>pc(-u,t),eql:(u,d)=>u===d,sqr:u=>pc(u*u,t),add:(u,d)=>pc(u+d,t),sub:(u,d)=>pc(u-d,t),mul:(u,d)=>pc(u*d,t),pow:(u,d)=>xze(l,u,d),div:(u,d)=>pc(u*xG(d,t),t),sqrN:u=>u*u,addN:(u,d)=>u+d,subN:(u,d)=>u-d,mulN:(u,d)=>u*d,inv:u=>xG(u,t),sqrt:s||(u=>(c||(c=wze(t)),c(l,u))),toBytes:u=>n?IL(u,a):$L(u,a),fromBytes:u=>{if(u.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+u.length);return n?m9(u):XC(u)},invertBatch:u=>Zue(l,u),cmov:(u,d,h)=>h?d:u});return Object.freeze(l)}function Yue(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Que(t){const e=Yue(t);return e+Math.ceil(e/2)}function Cze(t,e,n=!1){const r=t.length,i=Yue(e),s=Que(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=n?m9(t):XC(t),a=pc(o,e-Po)+Po;return n?IL(a,i):$L(a,i)}const i2=BigInt(0),x0=BigInt(1);function ub(t,e){const n=e.negate();return t?n:e}function _ze(t,e,n){const r=s=>s.pz,i=Zue(t.Fp,n.map(r));return n.map((s,o)=>s.toAffine(i[o])).map(t.fromAffine)}function Xue(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function U$(t,e){Xue(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),i=2**t,s=JC(t),o=BigInt(t);return{windows:n,windowSize:r,mask:s,maxNumber:i,shiftBy:o}}function CG(t,e,n){const{windowSize:r,mask:i,maxNumber:s,shiftBy:o}=n;let a=Number(t&i),c=t>>o;a>r&&(a-=s,c+=x0);const l=e*r,u=l+Math.abs(a)-1,d=a===0,h=a<0,f=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:h,isNegF:f,offsetF:l}}function Sze(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function Aze(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const z$=new WeakMap,Jue=new WeakMap;function W$(t){return Jue.get(t)||1}function _G(t){if(t!==i2)throw new Error("invalid wNAF")}function kze(t,e){return{constTimeNegate:ub,hasPrecomputes(n){return W$(n)!==1},unsafeLadder(n,r,i=t.ZERO){let s=n;for(;r>i2;)r&x0&&(i=i.add(s)),s=s.double(),r>>=x0;return i},precomputeWindow(n,r){const{windows:i,windowSize:s}=U$(r,e),o=[];let a=n,c=a;for(let l=0;l<i;l++){c=a,o.push(c);for(let u=1;u<s;u++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(n,r,i){let s=t.ZERO,o=t.BASE;const a=U$(n,e);for(let c=0;c<a.windows;c++){const{nextN:l,offset:u,isZero:d,isNeg:h,isNegF:f,offsetF:m}=CG(i,c,a);i=l,d?o=o.add(ub(f,r[m])):s=s.add(ub(h,r[u]))}return _G(i),{p:s,f:o}},wNAFUnsafe(n,r,i,s=t.ZERO){const o=U$(n,e);for(let a=0;a<o.windows&&i!==i2;a++){const{nextN:c,offset:l,isZero:u,isNeg:d}=CG(i,a,o);if(i=c,!u){const h=r[l];s=s.add(d?h.negate():h)}}return _G(i),s},getPrecomputes(n,r,i){let s=z$.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&(typeof i=="function"&&(s=i(s)),z$.set(r,s))),s},wNAFCached(n,r,i){const s=W$(n);return this.wNAF(s,this.getPrecomputes(s,n,i),r)},wNAFCachedUnsafe(n,r,i,s){const o=W$(n);return o===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(o,this.getPrecomputes(o,n,i),r,s)},setWindowSize(n,r){Xue(r,e),Jue.set(n,r),z$.delete(n)}}}function $ze(t,e,n,r){let i=e,s=t.ZERO,o=t.ZERO;for(;n>i2||r>i2;)n&x0&&(s=s.add(i)),r&x0&&(o=o.add(i)),i=i.double(),n>>=x0,r>>=x0;return{p1:s,p2:o}}function Ize(t,e,n,r){Sze(n,t),Aze(r,e);const i=n.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,a=fze(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=JC(c),u=new Array(Number(l)+1).fill(o),d=Math.floor((e.BITS-1)/c)*c;let h=o;for(let f=d;f>=0;f-=c){u.fill(o);for(let y=0;y<s;y++){const v=r[y],b=Number(v>>BigInt(f)&l);u[b]=u[b].add(n[y])}let m=o;for(let y=u.length-1,v=o;y>0;y--)v=v.add(u[y]),m=m.add(v);if(h=h.add(m),f!==0)for(let y=0;y<c;y++)h=h.double()}return h}function SG(t,e){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return bze(e),e}else return L2(t)}function Tze(t,e,n={}){if(!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const o of["p","n","h"]){const a=e[o];if(!(typeof a=="bigint"&&a>i2))throw new Error(`CURVE.${o} must be positive bigint`)}const r=SG(e.p,n.Fp),i=SG(e.n,n.Fn),s=["Gx","Gy","a","b"];for(const o of s)if(!r.isValid(e[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return{Fp:r,Fn:i}}BigInt(0),BigInt(1),BigInt(2),BigInt(8);const ov=BigInt(0),Gg=BigInt(1),Q4=BigInt(2);function Pze(t){return e_(t,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...t})}function Rze(t){const e=Pze(t),{P:n,type:r,adjustScalarBytes:i,powPminus2:s,randomBytes:o}=e,a=r==="x25519";if(!a&&r!=="x448")throw new Error("invalid type");const c=o||D2,l=a?255:448,u=a?32:56,d=BigInt(a?9:5),h=BigInt(a?121665:39081),f=a?Q4**BigInt(254):Q4**BigInt(447),m=a?BigInt(8)*Q4**BigInt(251)-Gg:BigInt(4)*Q4**BigInt(445)-Gg,y=f+m+Gg,v=T=>pc(T,n),b=C(d);function C(T){return IL(v(T),u)}function x(T){const O=ea("u coordinate",T,u);return a&&(O[31]&=127),v(m9(O))}function _(T){return m9(i(ea("scalar",T,u)))}function $(T,O){const U=N(x(O),_(T));if(U===ov)throw new Error("invalid private or public key received");return C(U)}function I(T){return $(T,b)}function R(T,O,U){const z=v(T*(O-U));return O=v(O-z),U=v(U+z),{x_2:O,x_3:U}}function N(T,O){HM("u",T,ov,n),HM("scalar",O,f,y);const U=O,z=T;let L=Gg,S=ov,k=T,M=Gg,W=ov;for(let D=BigInt(l-1);D>=ov;D--){const V=U>>D⋙W^=V,{x_2:L,x_3:k}=R(W,L,k),{x_2:S,x_3:M}=R(W,S,M),W=V;const B=L+S,P=v(B*B),j=L-S,G=v(j*j),Y=P-G,te=k+M,ae=k-M,oe=v(ae*B),de=v(te*j),ke=oe+de,Be=oe-de;k=v(ke*ke),M=v(z*v(Be*Be)),L=v(P*G),S=v(Y*(P+v(h*Y)))}({x_2:L,x_3:k}=R(W,L,k)),{x_2:S,x_3:M}=R(W,S,M);const H=s(S);return v(L*H)}return{scalarMult:$,scalarMultBase:I,getSharedSecret:(T,O)=>$(T,O),getPublicKey:T=>I(T),utils:{randomPrivateKey:()=>c(u)},GuBytes:b.slice()}}BigInt(0);const Mze=BigInt(1),AG=BigInt(2),Oze=BigInt(3),jze=BigInt(5);BigInt(8);const ede={p:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Nze(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=ede.p,o=t*t%s*t%s,a=Yc(o,AG,s)*o%s,c=Yc(a,Mze,s)*t%s,l=Yc(c,jze,s)*c%s,u=Yc(l,e,s)*l%s,d=Yc(u,n,s)*u%s,h=Yc(d,r,s)*d%s,f=Yc(h,i,s)*h%s,m=Yc(f,i,s)*h%s,y=Yc(m,e,s)*l%s;return{pow_p_5_8:Yc(y,AG,s)*t%s,b2:o}}function Dze(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const VM=(()=>{const t=ede.p;return Rze({P:t,type:"x25519",powPminus2:e=>{const{pow_p_5_8:n,b2:r}=Nze(e);return pc(Yc(n,Oze,t)*r,t)},adjustScalarBytes:Dze})})();function kG(t){t.lowS!==void 0&&g9("lowS",t.lowS),t.prehash!==void 0&&g9("prehash",t.prehash)}let Lze=class extends Error{constructor(e=""){super(e)}};const xd={Err:Lze,_tlv:{encode:(t,e)=>{const{Err:n}=xd;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=Y4(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Y4(i.length/2|128):"";return Y4(t)+s+i+e},decode(t,e){const{Err:n}=xd;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=e.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)o=o<<8|u;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(t){const{Err:e}=xd;if(t<db)throw new e("integer: negative integers are not allowed");let n=Y4(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=xd;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return XC(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=xd,i=ea("signature",t),{v:s,l:o}=r.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:l,l:u}=r.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(t){const{_tlv:e,_int:n}=xd,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),s=r+i;return e.encode(48,s)}},db=BigInt(0),hb=BigInt(1),Bze=BigInt(2),X4=BigInt(3),Fze=BigInt(4);function Uze(t,e,n){function r(i){const s=t.sqr(i),o=t.mul(s,i);return t.add(t.add(o,t.mul(i,e)),n)}return r}function tde(t,e,n){const{BYTES:r}=t;function i(s){let o;if(typeof s=="bigint")o=s;else{let a=ea("private key",s);if(e){if(!e.includes(a.length*2))throw new Error("invalid private key");const c=new Uint8Array(r);c.set(a,c.length-a.length),a=c}try{o=t.fromBytes(a)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof s}`)}}if(n&&(o=t.create(o)),!t.isValidNot0(o))throw new Error("invalid private key: out of range [1..N-1]");return o}return i}function zze(t,e={}){const{Fp:n,Fn:r}=Tze("weierstrass",t,e),{h:i,n:s}=t;e_(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:o}=e;if(o&&(!n.is0(t.a)||typeof o.beta!="bigint"||typeof o.splitScalar!="function"))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function a(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function c(N,T,O){const{x:U,y:z}=T.toAffine(),L=n.toBytes(U);if(g9("isCompressed",O),O){a();const S=!n.isOdd(z);return v0(nde(S),L)}else return v0(Uint8Array.of(4),L,n.toBytes(z))}function l(N){Sc(N);const T=n.BYTES,O=T+1,U=2*T+1,z=N.length,L=N[0],S=N.subarray(1);if(z===O&&(L===2||L===3)){const k=n.fromBytes(S);if(!n.isValid(k))throw new Error("bad point: is not on curve, wrong x");const M=h(k);let W;try{W=n.sqrt(M)}catch(D){const V=D instanceof Error?": "+D.message:"";throw new Error("bad point: is not on curve, sqrt error"+V)}a();const H=n.isOdd(W);return(L&1)===1!==H&&(W=n.neg(W)),{x:k,y:W}}else if(z===U&&L===4){const k=n.fromBytes(S.subarray(T*0,T*1)),M=n.fromBytes(S.subarray(T*1,T*2));if(!f(k,M))throw new Error("bad point: is not on curve");return{x:k,y:M}}else throw new Error(`bad point: got length ${z}, expected compressed=${O} or uncompressed=${U}`)}const u=e.toBytes||c,d=e.fromBytes||l,h=Uze(n,t.a,t.b);function f(N,T){const O=n.sqr(T),U=h(N);return n.eql(O,U)}if(!f(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const m=n.mul(n.pow(t.a,X4),Fze),y=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(m,y)))throw new Error("bad curve params: a or b");function v(N,T,O=!1){if(!n.isValid(T)||O&&n.is0(T))throw new Error(`bad point coordinate ${N}`);return T}function b(N){if(!(N instanceof $))throw new Error("ProjectivePoint expected")}const C=bG((N,T)=>{const{px:O,py:U,pz:z}=N;if(n.eql(z,n.ONE))return{x:O,y:U};const L=N.is0();T==null&&(T=L?n.ONE:n.inv(z));const S=n.mul(O,T),k=n.mul(U,T),M=n.mul(z,T);if(L)return{x:n.ZERO,y:n.ZERO};if(!n.eql(M,n.ONE))throw new Error("invZ was invalid");return{x:S,y:k}}),x=bG(N=>{if(N.is0()){if(e.allowInfinityPoint&&!n.is0(N.py))return;throw new Error("bad point: ZERO")}const{x:T,y:O}=N.toAffine();if(!n.isValid(T)||!n.isValid(O))throw new Error("bad point: x or y not field elements");if(!f(T,O))throw new Error("bad point: equation left != right");if(!N.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function _(N,T,O,U,z){return O=new $(n.mul(O.px,N),O.py,O.pz),T=ub(U,T),O=ub(z,O),T.add(O)}class ${constructor(T,O,U){this.px=v("x",T),this.py=v("y",O,!0),this.pz=v("z",U),Object.freeze(this)}static fromAffine(T){const{x:O,y:U}=T||{};if(!T||!n.isValid(O)||!n.isValid(U))throw new Error("invalid affine point");if(T instanceof $)throw new Error("projective point not allowed");return n.is0(O)&&n.is0(U)?$.ZERO:new $(O,U,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(T){return _ze($,"pz",T)}static fromBytes(T){return Sc(T),$.fromHex(T)}static fromHex(T){const O=$.fromAffine(d(ea("pointHex",T)));return O.assertValidity(),O}static fromPrivateKey(T){const O=tde(r,e.allowedPrivateKeyLengths,e.wrapPrivateKey);return $.BASE.multiply(O(T))}static msm(T,O){return Ize($,r,T,O)}precompute(T=8,O=!0){return R.setWindowSize(this,T),O||this.multiply(X4),this}_setWindowSize(T){this.precompute(T)}assertValidity(){x(this)}hasEvenY(){const{y:T}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(T)}equals(T){b(T);const{px:O,py:U,pz:z}=this,{px:L,py:S,pz:k}=T,M=n.eql(n.mul(O,k),n.mul(L,z)),W=n.eql(n.mul(U,k),n.mul(S,z));return M&&W}negate(){return new $(this.px,n.neg(this.py),this.pz)}double(){const{a:T,b:O}=t,U=n.mul(O,X4),{px:z,py:L,pz:S}=this;let k=n.ZERO,M=n.ZERO,W=n.ZERO,H=n.mul(z,z),D=n.mul(L,L),V=n.mul(S,S),B=n.mul(z,L);return B=n.add(B,B),W=n.mul(z,S),W=n.add(W,W),k=n.mul(T,W),M=n.mul(U,V),M=n.add(k,M),k=n.sub(D,M),M=n.add(D,M),M=n.mul(k,M),k=n.mul(B,k),W=n.mul(U,W),V=n.mul(T,V),B=n.sub(H,V),B=n.mul(T,B),B=n.add(B,W),W=n.add(H,H),H=n.add(W,H),H=n.add(H,V),H=n.mul(H,B),M=n.add(M,H),V=n.mul(L,S),V=n.add(V,V),H=n.mul(V,B),k=n.sub(k,H),W=n.mul(V,D),W=n.add(W,W),W=n.add(W,W),new $(k,M,W)}add(T){b(T);const{px:O,py:U,pz:z}=this,{px:L,py:S,pz:k}=T;let M=n.ZERO,W=n.ZERO,H=n.ZERO;const D=t.a,V=n.mul(t.b,X4);let B=n.mul(O,L),P=n.mul(U,S),j=n.mul(z,k),G=n.add(O,U),Y=n.add(L,S);G=n.mul(G,Y),Y=n.add(B,P),G=n.sub(G,Y),Y=n.add(O,z);let te=n.add(L,k);return Y=n.mul(Y,te),te=n.add(B,j),Y=n.sub(Y,te),te=n.add(U,z),M=n.add(S,k),te=n.mul(te,M),M=n.add(P,
142j),te=n.sub(te,M),H=n.mul(D,Y),M=n.mul(V,j),H=n.add(M,H),M=n.sub(P,H),H=n.add(P,H),W=n.mul(M,H),P=n.add(B,B),P=n.add(P,B),j=n.mul(D,j),Y=n.mul(V,Y),P=n.add(P,j),j=n.sub(B,j),j=n.mul(D,j),Y=n.add(Y,j),B=n.mul(P,Y),W=n.add(W,B),B=n.mul(te,Y),M=n.mul(G,M),M=n.sub(M,B),B=n.mul(G,P),H=n.mul(te,H),H=n.add(H,B),new $(M,W,H)}subtract(T){return this.add(T.negate())}is0(){return this.equals($.ZERO)}multiply(T){const{endo:O}=e;if(!r.isValidNot0(T))throw new Error("invalid scalar: out of range");let U,z;const L=S=>R.wNAFCached(this,S,$.normalizeZ);if(O){const{k1neg:S,k1:k,k2neg:M,k2:W}=O.splitScalar(T),{p:H,f:D}=L(k),{p:V,f:B}=L(W);z=D.add(B),U=_(O.beta,H,V,S,M)}else{const{p:S,f:k}=L(T);U=S,z=k}return $.normalizeZ([U,z])[0]}multiplyUnsafe(T){const{endo:O}=e,U=this;if(!r.isValid(T))throw new Error("invalid scalar: out of range");if(T===db||U.is0())return $.ZERO;if(T===hb)return U;if(R.hasPrecomputes(this))return this.multiply(T);if(O){const{k1neg:z,k1:L,k2neg:S,k2:k}=O.splitScalar(T),{p1:M,p2:W}=$ze($,U,L,k);return _(O.beta,M,W,z,S)}else return R.wNAFCachedUnsafe(U,T)}multiplyAndAddUnsafe(T,O,U){const z=this.multiplyUnsafe(O).add(T.multiplyUnsafe(U));return z.is0()?void 0:z}toAffine(T){return C(this,T)}isTorsionFree(){const{isTorsionFree:T}=e;return i===hb?!0:T?T($,this):R.wNAFCachedUnsafe(this,s).is0()}clearCofactor(){const{clearCofactor:T}=e;return i===hb?this:T?T($,this):this.multiplyUnsafe(i)}toBytes(T=!0){return g9("isCompressed",T),this.assertValidity(),u($,this,T)}toRawBytes(T=!0){return this.toBytes(T)}toHex(T=!0){return s3(this.toBytes(T))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}$.BASE=new $(t.Gx,t.Gy,n.ONE),$.ZERO=new $(n.ZERO,n.ONE,n.ZERO),$.Fp=n,$.Fn=r;const I=r.BITS,R=kze($,e.endo?Math.ceil(I/2):I);return $}function nde(t){return Uint8Array.of(t?2:3)}function Wze(t,e,n={}){e_(e,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=e.randomBytes||D2,i=e.hmac||((U,...z)=>YC(e.hash,U,v0(...z))),{Fp:s,Fn:o}=t,{ORDER:a,BITS:c}=o;function l(U){const z=a>>hb;return U>z}function u(U){return l(U)?o.neg(U):U}function d(U,z){if(!o.isValidNot0(z))throw new Error(`invalid signature ${U}: out of range 1..CURVE.n`)}class h{constructor(z,L,S){d("r",z),d("s",L),this.r=z,this.s=L,S!=null&&(this.recovery=S),Object.freeze(this)}static fromCompact(z){const L=o.BYTES,S=ea("compactSignature",z,L*2);return new h(o.fromBytes(S.subarray(0,L)),o.fromBytes(S.subarray(L,L*2)))}static fromDER(z){const{r:L,s:S}=xd.toSig(ea("DER",z));return new h(L,S)}assertValidity(){}addRecoveryBit(z){return new h(this.r,this.s,z)}recoverPublicKey(z){const L=s.ORDER,{r:S,s:k,recovery:M}=this;if(M==null||![0,1,2,3].includes(M))throw new Error("recovery id invalid");if(a*Bze<L&&M>1)throw new Error("recovery id is ambiguous for h>1 curve");const W=M===2||M===3?S+a:S;if(!s.isValid(W))throw new Error("recovery id 2 or 3 invalid");const H=s.toBytes(W),D=t.fromHex(v0(nde((M&1)===0),H)),V=o.inv(W),B=x(ea("msgHash",z)),P=o.create(-B*V),j=o.create(k*V),G=t.BASE.multiplyUnsafe(P).add(D.multiplyUnsafe(j));if(G.is0())throw new Error("point at infinify");return G.assertValidity(),G}hasHighS(){return l(this.s)}normalizeS(){return this.hasHighS()?new h(this.r,o.neg(this.s),this.recovery):this}toBytes(z){if(z==="compact")return v0(o.toBytes(this.r),o.toBytes(this.s));if(z==="der")return _L(xd.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return s3(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return s3(this.toBytes("compact"))}}const f=tde(o,n.allowedPrivateKeyLengths,n.wrapPrivateKey),m={isValidPrivateKey(U){try{return f(U),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const U=a;return Cze(r(Que(U)),U)},precompute(U=8,z=t.BASE){return z.precompute(U,!1)}};function y(U,z=!0){return t.fromPrivateKey(U).toBytes(z)}function v(U){if(typeof U=="bigint")return!1;if(U instanceof t)return!0;const z=ea("key",U).length,L=s.BYTES,S=L+1,k=2*L+1;if(!(n.allowedPrivateKeyLengths||o.BYTES===S))return z===S||z===k}function b(U,z,L=!0){if(v(U)===!0)throw new Error("first arg must be private key");if(v(z)===!1)throw new Error("second arg must be public key");return t.fromHex(z).multiply(f(U)).toBytes(L)}
vendor: 6,142 bytes, line 142
142const C=e.bits2int||function(U){if(U.length>8192)throw new Error("input is too large");const z=XC(U),L=U.length*8-c;return L>0?z>>BigInt(L):z},x=e.bits2int_modN||function(U){return o.create(C(U))},_=JC(c);function $(U){return HM("num < 2^"+c,U,db,_),o.toBytes(U)}function I(U,z,L=R){if(["recovered","canonical"].some(G=>G in L))throw new Error("sign() legacy options not supported");const{hash:S}=e;let{lowS:k,prehash:M,extraEntropy:W}=L;k==null&&(k=!0),U=ea("msgHash",U),kG(L),M&&(U=ea("prehashed msgHash",S(U)));const H=x(U),D=f(z),V=[$(D),$(H)];if(W!=null&&W!==!1){const G=W===!0?r(s.BYTES):W;V.push(ea("extraEntropy",G))}const B=v0(...V),P=H;function j(G){const Y=C(G);if(!o.isValidNot0(Y))return;const te=o.inv(Y),ae=t.BASE.multiply(Y).toAffine(),oe=o.create(ae.x);if(oe===db)return;const de=o.create(te*o.create(P+oe*D));if(de===db)return;let ke=(ae.x===oe?0:2)|Number(ae.y&hb),Be=de;return k&&l(de)&&(Be=u(de),ke^=1),new h(oe,Be,ke)}return{seed:B,k2sig:j}}const R={lowS:e.lowS,prehash:!1},N={lowS:e.lowS,prehash:!1};function T(U,z,L=R){const{seed:S,k2sig:k}=I(U,z,L);return pze(e.hash.outputLen,o.BYTES,i)(S,k)}t.BASE.precompute(8);function O(U,z,L,S=N){const k=U;z=ea("msgHash",z),L=ea("publicKey",L),kG(S);const{lowS:M,prehash:W,format:H}=S;if("strict"in S)throw new Error("options.strict was renamed to lowS");if(H!==void 0&&!["compact","der","js"].includes(H))throw new Error('format must be "compact", "der" or "js"');const D=typeof k=="string"||xL(k),V=!D&&!H&&typeof k=="object"&&k!==null&&typeof k.r=="bigint"&&typeof k.s=="bigint";if(!D&&!V)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let B,P;try{if(V)if(H===void 0||H==="js")B=new h(k.r,k.s);else throw new Error("invalid format");if(D){try{H!=="compact"&&(B=h.fromDER(k))}catch(ke){if(!(ke instanceof xd.Err))throw ke}!B&&H!=="der"&&(B=h.fromCompact(k))}P=t.fromHex(L)}catch{return!1}if(!B||M&&B.hasHighS())return!1;W&&(z=e.hash(z));const{r:j,s:G}=B,Y=x(z),te=o.inv(G),ae=o.create(Y*te),oe=o.create(j*te),de=t.BASE.multiplyUnsafe(ae).add(P.multiplyUnsafe(oe));return de.is0()?!1:o.create(de.x)===j}return Object.freeze({getPublicKey:y,getSharedSecret:b,sign:T,verify:O,utils:m,Point:t,Signature:h})}function Hze(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp,r=L2(e.n,t.nBitLength),i={Fp:n,Fn:r,allowedPrivateKeyLengths:t.allowedPrivateKeyLengths,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,wrapPrivateKey:t.wrapPrivateKey,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:i}}function Vze(t){const{CURVE:e,curveOpts:n}=Hze(t),r={hash:t.hash,hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,ecdsaOpts:r}}function qze(t,e){return Object.assign({},e,{ProjectivePoint:e.Point,CURVE:t})}function Kze(t){const{CURVE:e,curveOpts:n,ecdsaOpts:r}=Vze(t),i=zze(e,n),s=Wze(i,r,n);return qze(t,s)}function qM(t,e){const n=r=>Kze({...t,hash:r});return{...n(e),create:n}}const rde={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},ide={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},sde={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},Gze=L2(rde.p),Zze=L2(ide.p),Yze=L2(sde.p),Qze=qM({...rde,Fp:Gze,lowS:!1},ZC);qM({...ide,Fp:Zze,lowS:!1},sUe),qM({...sde,Fp:Yze,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},iUe);const Xze=Qze,ode="base10",Ro="base16",pl="base64pad",Cf="base64url",R5="utf8",ade=0,Wd=1,M5=2,Jze=0,$G=1,fb=12,TL=32;function eWe(){const t=VM.utils.randomPrivateKey(),e=VM.getPublicKey(t);return{privateKey:ha(t,Ro),publicKey:ha(e,Ro)}}function KM(){const t=D2(TL);return ha(t,Ro)}function tWe(t,e){const n=VM.getSharedSecret(mc(t,Ro),mc(e,Ro)),r=dze(QC,n,void 0,void 0,TL);return ha(r,Ro)}function h8(t){const e=QC(mc(t,Ro));return ha(e,Ro)}function mu(t){const e=QC(mc(t,R5));return ha(e,Ro)}function cde(t){return mc(`${t}`,ode)}function E1(t){return Number(ha(t,ode))}function lde(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ude(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=(4-e.length%4)%4;return e+"=".repeat(n)}function nWe(t){const e=cde(typeof t.type<"u"?t.type:ade);
142if(E1(e)===Wd&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const n=typeof t.senderPublicKey<"u"?mc(t.senderPublicKey,Ro):void 0,r=typeof t.iv<"u"?mc(t.iv,Ro):D2(fb),i=mc(t.symKey,Ro),s=zue(i,r).encrypt(mc(t.message,R5)),o=dde({type:e,sealed:s,iv:r,senderPublicKey:n});return t.encoding===Cf?lde(o):o}function rWe(t){const e=mc(t.symKey,Ro),{sealed:n,iv:r}=a3({encoded:t.encoded,encoding:t.encoding}),i=zue(e,r).decrypt(n);if(i===null)throw new Error("Failed to decrypt");return ha(i,R5)}function iWe(t,e){const n=cde(M5),r=D2(fb),i=mc(t,R5),s=dde({type:n,sealed:i,iv:r});return e===Cf?lde(s):s}function sWe(t,e){const{sealed:n}=a3({encoded:t,encoding:e});return ha(n,R5)}function dde(t){if(E1(t.type)===M5)return ha(lb([t.type,t.sealed]),pl);if(E1(t.type)===Wd){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ha(lb([t.type,t.senderPublicKey,t.iv,t.sealed]),pl)}return ha(lb([t.type,t.iv,t.sealed]),pl)}function a3(t){const e=(t.encoding||pl)===Cf?ude(t.encoded):t.encoded,n=mc(e,pl),r=n.slice(Jze,$G),i=$G;if(E1(r)===Wd){const c=i+TL,l=c+fb,u=n.slice(i,c),d=n.slice(c,l),h=n.slice(l);return{type:r,sealed:h,iv:d,senderPublicKey:u}}if(E1(r)===M5){const c=n.slice(i),l=D2(fb);return{type:r,sealed:c,iv:l}}const s=i+fb,o=n.slice(i,s),a=n.slice(s);return{type:r,sealed:a,iv:o}}function oWe(t,e){const n=a3({encoded:t,encoding:e==null?void 0:e.encoding});return hde({type:E1(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?ha(n.senderPublicKey,Ro):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function hde(t){const e=(t==null?void 0:t.type)||ade;if(e===Wd){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function IG(t){return t.type===Wd&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function TG(t){return t.type===M5}function aWe(t){const e=Buffer.from(t.x,"base64"),n=Buffer.from(t.y,"base64");return lb([new Uint8Array([4]),e,n])}function cWe(t,e){const[n,r,i]=t.split("."),s=Buffer.from(ude(i),"base64");if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32),a=s.slice(32,64),c=`${n}.${r}`,l=QC(c),u=aWe(e);if(!Xze.verify(lb([o,a]),l,u))throw new Error("Invalid signature");return OM(t).payload}const lWe="irn";function y9(t){return(t==null?void 0:t.relay)||{protocol:lWe}}function Vv(t){const e=VBe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}function uWe(t,e="-"){const n={},r="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(r)){const s=i.replace(r,""),o=t[i];n[s]=o}}),n}function PG(t){if(!t.includes("wc:")){const l=Cue(t);l!=null&&l.includes("wc:")&&(t=l)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),n=t.indexOf("?")!==-1?t.indexOf("?"):void 0,r=t.substring(0,e),i=t.substring(e+1,n).split("@"),s=typeof n<"u"?t.substring(n):"",o=new URLSearchParams(s),a={};o.forEach((l,u)=>{a[u]=l});
142const c=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:r,topic:dWe(i[0]),version:parseInt(i[1],10),symKey:a.symKey,relay:uWe(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function dWe(t){return t.startsWith("//")?t.substring(2):t}function hWe(t,e="-"){const n="relay",r={};return Object.keys(t).forEach(i=>{const s=i,o=n+e+s;t[s]&&(r[o]=t[s])}),r}function RG(t){const e=new URLSearchParams,n=hWe(t.relay);Object.keys(n).sort().forEach(i=>{e.set(i,n[i])}),e.set("symKey",t.symKey),t.expiryTimestamp&&e.set("expiryTimestamp",t.expiryTimestamp.toString()),t.methods&&e.set("methods",t.methods.join(","));const r=e.toString();return`${t.protocol}:${t.topic}@${t.version}?${r}`}function J4(t,e,n){return`${t}?wc_ev=${n}&topic=${e}`}var fWe=Object.defineProperty,pWe=Object.defineProperties,gWe=Object.getOwnPropertyDescriptors,MG=Object.getOwnPropertySymbols,mWe=Object.prototype.hasOwnProperty,yWe=Object.prototype.propertyIsEnumerable,OG=(t,e,n)=>e in t?fWe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wWe=(t,e)=>{for(var n in e||(e={}))mWe.call(e,n)&&OG(t,n,e[n]);if(MG)for(var n of MG(e))yWe.call(e,n)&&OG(t,n,e[n]);return t},vWe=(t,e)=>pWe(t,gWe(e));function B2(t){const e=[];return t.forEach(n=>{const[r,i]=n.split(":");e.push(`${r}:${i}`)}),e}function bWe(t){const e=[];return Object.values(t).forEach(n=>{e.push(...B2(n.accounts))}),e}function xWe(t,e){const n=[];return Object.values(t).forEach(r=>{B2(r.accounts).includes(e)&&n.push(...r.methods)}),n}function EWe(t,e){const n=[];return Object.values(t).forEach(r=>{B2(r.accounts).includes(e)&&n.push(...r.events)}),n}function t_(t){return t.includes(":")}function Im(t){return t_(t)?t.split(":")[0]:t}function jG(t){var e,n,r;const i={};if(!_u(t))return i;for(const[s,o]of Object.entries(t)){const a=t_(s)?[s]:o.chains,c=o.methods||[],l=o.events||[],u=Im(s);i[u]=vWe(wWe({},i[u]),{chains:Cu(a,(e=i[u])==null?void 0:e.chains),methods:Cu(c,(n=i[u])==null?void 0:n.methods),events:Cu(l,(r=i[u])==null?void 0:r.events)})}return i}function CWe(t){const e={};return t==null||t.forEach(n=>{var r;const[i,s]=n.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[],methods:[]}),e[i].accounts.push(n),(r=e[i].chains)==null||r.push(`${i}:${s}`)}),e}function NG(t,e){e=e.map(r=>r.replace("did:pkh:",""));const n=CWe(e);for(const[r,i]of Object.entries(n))i.methods?i.methods=Cu(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return n}function _We(t,e){var n,r,i,s,o,a;const c=jG(t),l=jG(e),u={},d=Object.keys(c).concat(Object.keys(l));for(const h of d)u[h]={chains:Cu((n=c[h])==null?void 0:n.chains,(r=l[h])==null?void 0:r.chains),methods:Cu((i=c[h])==null?void 0:i.methods,(s=l[h])==null?void 0:s.methods),events:Cu((o=c[h])==null?void 0:o.events,(a=l[h])==null?void 0:a.events)};return u}const SWe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},AWe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};
vendor: 20,724 bytes, lines 142-148
142function Tt(t,e){const{message:n,code:r}=AWe[t];return{message:e?`${n} ${e}`:n,code:r}}function Br(t,e){const{message:n,code:r}=SWe[t];return{message:e?`${n} ${e}`:n,code:r}}function wc(t,e){return!!Array.isArray(t)}function _u(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ms(t){return typeof t>"u"}function Bi(t,e){return e&&Ms(t)?!0:typeof t=="string"&&!!t.trim().length}function PL(t,e){return e&&Ms(t)?!0:typeof t=="number"&&!isNaN(t)}function kWe(t,e){const{requiredNamespaces:n}=e,r=Object.keys(t.namespaces),i=Object.keys(n);let s=!0;return w0(i,r)?(r.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],u=B2(a),d=n[o];(!w0(wue(o,d),u)||!w0(d.methods,c)||!w0(d.events,l))&&(s=!1)}),s):!1}function w9(t){return Bi(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function $We(t){if(Bi(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const n=e[0]+":"+e[1];return!!e[2]&&w9(n)}}return!1}function IWe(t){function e(n){try{return typeof new URL(n)<"u"}catch{return!1}}try{if(Bi(t,!1)){if(e(t))return!0;const n=Cue(t);return e(n)}}catch{}return!1}function TWe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function PWe(t){return t==null?void 0:t.topic}function RWe(t,e){let n=null;return Bi(t==null?void 0:t.publicKey,!1)||(n=Tt("MISSING_OR_INVALID",`${e} controller public key should be a string`)),n}function DG(t){let e=!0;return wc(t)?t.length&&(e=t.every(n=>Bi(n,!1))):e=!1,e}function MWe(t,e,n){let r=null;return wc(e)&&e.length?e.forEach(i=>{r||w9(i)||(r=Br("UNSUPPORTED_CHAINS",`${n}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):w9(t)||(r=Br("UNSUPPORTED_CHAINS",`${n}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),r}function OWe(t,e,n){let r=null;return Object.entries(t).forEach(([i,s])=>{if(r)return;const o=MWe(i,wue(i,s),`${e} ${n}`);o&&(r=o)}),r}function jWe(t,e){let n=null;return wc(t)?t.forEach(r=>{n||$We(r)||(n=Br("UNSUPPORTED_ACCOUNTS",`${e}, account ${r} should be a string and conform to "namespace:chainId:address" format`))}):n=Br("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),n}function NWe(t,e){let n=null;return Object.values(t).forEach(r=>{if(n)return;const i=jWe(r==null?void 0:r.accounts,`${e} namespace`);i&&(n=i)}),n}function DWe(t,e){let n=null;return DG(t==null?void 0:t.methods)?DG(t==null?void 0:t.events)||(n=Br("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):n=Br("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),n}function fde(t,e){let n=null;return Object.values(t).forEach(r=>{if(n)return;const i=DWe(r,`${e}, namespace`);i&&(n=i)}),n}function LWe(t,e,n){let r=null;if(t&&_u(t)){const i=fde(t,e);i&&(r=i);const s=OWe(t,e,n);s&&(r=s)}else r=Tt("MISSING_OR_INVALID",`${e}, ${n} should be an object with data`);return r}function H$(t,e){let n=null;if(t&&_u(t)){const r=fde(t,e);r&&(n=r);const i=NWe(t,e);i&&(n=i)}else n=Tt("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return n}function pde(t){return Bi(t.protocol,!0)}function BWe(t,e){let n=!1;return t?t&&wc(t)&&t.length&&t.forEach(r=>{n=pde(r)}):n=!0,n}function FWe(t){return typeof t=="number"}function Zo(t){return typeof t<"u"&&typeof t!==null}function UWe(t){return!(!t||typeof t!="object"||!t.code||!PL(t.code,!1)||!t.message||!Bi(t.message,!1))}function zWe(t){return!(Ms(t)||!Bi(t.method,!1))}function WWe(t){return!(Ms(t)||Ms(t.result)&&Ms(t.error)||!PL(t.id,!1)||!Bi(t.jsonrpc,!1))}function HWe(t){return!(Ms(t)||!Bi(t.name,!1))}function LG(t,e){return!(!w9(e)||!bWe(t).includes(e))}function VWe(t,e,n){return Bi(n,!1)?xWe(t,e).includes(n):!1}function qWe(t,e,n){return Bi(n,!1)?EWe(t,e).includes(n):!1}function BG(t,e,n){let r=null;const i=KWe(t),s=GWe(e),o=Object.keys(i),a=Object.keys(s),c=FG(Object.keys(t)),l=FG(Object.keys(e)),u=c.filter(d=>!l.includes(d));return u.length&&(r=Tt("NON_CONFORMING_NAMESPACES",`${n} namespaces keys don't satisfy requiredNamespaces. 143 Required: ${u.toString()} 144 Received: ${Object.keys(e).toString()}`)),w0(o,a)||(r=Tt("NON_CONFORMING_NAMESPACES",`${n} namespaces chains don't satisfy required namespaces. 145 Required: ${o.toString()} 146 Approved: ${a.toString()}`)),Object.keys(e).forEach(d=>{if(!d.includes(":")||r)return;const h=B2(e[d].accounts);h.includes(d)||(r=Tt("NON_CONFORMING_NAMESPACES",`${n} namespaces accounts don't satisfy namespace accounts for ${d} 147 Required: ${d} 148 Approved: ${h.toString()}`))}),o.forEach(d=>{r||(w0(i[d].methods,s[d].methods)?w0(i[d].events,s[d].events)||(r=Tt("NON_CONFORMING_NAMESPACES",`${n} namespaces events don't satisfy namespace events for ${d}`)):r=Tt("NON_CONFORMING_NAMESPACES",`${n} namespaces methods don't satisfy namespace methods for ${d}`))}),r}function KWe(t){const e={};return Object.keys(t).forEach(n=>{var r;n.includes(":")?e[n]=t[n]:(r=t[n].chains)==null||r.forEach(i=>{e[i]={methods:t[n].methods,events:t[n].events}})}),e}function FG(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function GWe(t){const e={};return Object.keys(t).forEach(n=>{if(n.includes(":"))e[n]=t[n];else{const r=B2(t[n].accounts);r==null||r.forEach(i=>{e[i]={accounts:t[n].accounts.filter(s=>s.includes(`${i}:`)),methods:t[n].methods,events:t[n].events}})}}),e}function ZWe(t,e){return PL(t,!1)&&t<=e.max&&t>=e.min}function UG(){const t=T5();return new Promise(e=>{switch(t){case ja.browser:e(YWe());break;case ja.reactNative:e(QWe());break;case ja.node:e(XWe());break;default:e(!0)}})}function YWe(){return N2()&&(navigator==null?void 0:navigator.onLine)}async function QWe(){if(vp()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function XWe(){return!0}function JWe(t){switch(T5()){case ja.browser:eHe(t);break;case ja.reactNative:tHe(t);break}}function eHe(t){!vp()&&N2()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function tHe(t){vp()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}function nHe(){var t;return N2()&&eh.getDocument()?((t=eh.getDocument())==null?void 0:t.visibilityState)==="visible":!0}const V$={};let av=class{static get(e){return V$[e]}static set(e,n){V$[e]=n}static delete(e){delete V$[e]}};function rHe(t){const e=th.decode(t);if(e.length<33)throw new Error("Too short to contain a public key");return e.slice(1,33)}function iHe({publicKey:t,signature:e,payload:n}){var r;const i=GM(n.method),s=128|parseInt(((r=n.version)==null?void 0:r.toString())||"4"),o=aHe(n.address),a=n.era==="00"?new Uint8Array([0]):GM(n.era);if(a.length!==1&&a.length!==2)throw new Error("Invalid era length");const c=parseInt(n.nonce,16),l=new Uint8Array([c&255,c>>8&255]),u=BigInt(`0x${oHe(n.tip)}`),d=lHe(u),h=new Uint8Array([0,...t,o,...e,...a,...l,...d,...i]),f=cHe(h.length+1);return new Uint8Array([...f,s,...h])}function sHe(t){const e=GM(t),n=ZBe.blake2b(e,void 0,32);return"0x"+Buffer.from(n).toString("hex")}function GM(t){return new Uint8Array(t.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function oHe(t){return t.startsWith("0x")?t.slice(2):t}function aHe(t){const e=th.decode(t)[0];return e===42?0:e===60?2:1}function cHe(t){if(t<64)return new Uint8Array([t<<2]);if(t<16384){const e=t<<2|1;return new Uint8Array([e&255,e>>8&255])}else if(t<1<<30){const e=t<<2|2;return new Uint8Array([e&255,e>>8&255,e>>16&255,e>>24&255])}else throw new Error("Compact encoding > 2^30 not supported")}function lHe(t){if(t<BigInt(1)<<BigInt(6))return new Uint8Array([Number(t<<BigInt(2))]);if(t<BigInt(1)<<BigInt(14)){const e=t<<BigInt(2)|BigInt(1);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255))])}else if(t<BigInt(1)<<BigInt(30)){const e=t<<BigInt(2)|BigInt(2);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255)),Number(e>>BigInt(16)&BigInt(255)),Number(e>>BigInt(24)&BigInt(255))])}else throw new Error("BigInt compact encoding not supported > 2^30")}function uHe(t){const e=Uint8Array.from(Buffer.from(t.signature,"hex")),n=rHe(t.transaction.address),r=iHe({publicKey:n,signature:e,payload:t.transaction}),i=Buffer.from(r).toString("hex");return sHe(i)}class B1{}let dHe=class extends B1{constructor(e){super()}};const zG=Pt.FIVE_SECONDS,F1={pulse:"heartbeat_pulse"};let hHe=class gde extends dHe{constructor(e){super(e),this.events=new Wa.EventEmitter,this.interval=zG,this.interval=(e==null?void 0:e.interval)||zG}static async init(e){const n=new gde(e);return await n.init(),n}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Pt.toMiliseconds(this.interval))}pulse(){this.events.emit(F1.pulse)}};function fHe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function ns(t,...e){try{return fHe(t(...e))}catch(n){return Promise.reject(n)}}function pHe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function gHe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function f8(t){if(pHe(t))return String(t);if(gHe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return f8(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const ZM="base64:";function mHe(t){return typeof t=="string"?t:ZM+vHe(t)}function yHe(t){return typeof t!="string"||!t.startsWith(ZM)?t:wHe(t.slice(ZM.length))}function wHe(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function vHe(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Go(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function bHe(...t){return Go(t.join(":"))}function e6(t){return t=Go(t),t?t+":":""}function xHe(t,e){if(e===void 0)return!0;let n=0,r=t.indexOf(":");for(;r>-1;)n++,r=t.indexOf(":",r+1);return n<=e}function EHe(t,e){return e?t.startsWith(e)&&t[t.length-1]!=="$":t[t.length-1]!=="$"}const CHe="memory",_He=()=>{const t=new Map;return{name:CHe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,n){t.set(e,n)},setItemRaw(e,n){t.set(e,n)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function SHe(t={}){const e={mounts:{"":t.driver||_He()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=l=>{for(const u of e.mountpoints)if(l.startsWith(u))return{base:u,relativeKey:l.slice(u.length),driver:e.mounts[u]};return{base:"",relativeKey:l,driver:e.mounts[""]}},r=(l,u)=>e.mountpoints.filter(d=>d.startsWith(l)||u&&l.startsWith(d)).map(d=>({relativeBase:l.length>d.length?l.slice(d.length):void 0,mountpoint:d,driver:e.mounts[d]})),i=(l,u)=>{if(e.watching){u=Go(u);for(const d of e.watchListeners)d(l,u)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await WG(e.mounts[l],i,l)}},o=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},a=(l,u,d)=>{const h=new Map,f=m=>{let y=h.get(m.base);return y||(y={driver:m.driver,base:m.base,items:[]},h.set(m.base,y)),y};for(const m of l){const y=typeof m=="string",v=Go(y?m:m.key),b=y?void 0:m.value,C=y||!m.options?u:{...u,...m.options},x=n(v);f(x).items.push({key:v,value:b,relativeKey:x.relativeKey,options:C})}return Promise.all([...h.values()].map(m=>d(m))).then(m=>m.flat())},c={hasItem(l,u={}){l=Go(l);const{relativeKey:d,driver:h}=n(l);return ns(h.hasItem,d,u)},getItem(l,u={}){l=Go(l);const{relativeKey:d,driver:h}=n(l);return ns(h.getItem,d,u).then(f=>Fv(f))},getItems(l,u={}){return a(l,u,d=>d.driver.getItems?ns(d.driver.getItems,d.items.map(h=>({key:h.relativeKey,options:h.options})),u).then(h=>h.map(f=>({key:bHe(d.base,f.key),value:Fv(f.value)}))):Promise.all(d.items.map(h=>ns(d.driver.getItem,h.relativeKey,h.options).then(f=>({key:h.key,value:Fv(f)})))))},getItemRaw(l,u={}){l=Go(l);const{relativeKey:d,driver:h}=n(l);return h.getItemRaw?ns(h.getItemRaw,d,u):ns(h.getItem,d,u).then(f=>yHe(f))},async setItem(l,u,d={}){if(u===void 0)return c.removeItem(l);l=Go(l);const{relativeKey:h,driver:f}=n(l);f.setItem&&(await ns(f.setItem,h,f8(u),d),f.watch||i("update",l))},async setItems(l,u){await a(l,u,async d=>{if(d.driver.setItems)return ns(d.driver.setItems,d.items.map(h=>({key:h.relativeKey,value:f8(h.value),options:h.options})),u);d.driver.setItem&&await Promise.all(d.items.map(h=>ns(d.driver.setItem,h.relativeKey,f8(h.value),h.options)))})},async setItemRaw(l,u,d={}){if(u===void 0)return c.removeItem(l,d);l=Go(l);const{relativeKey:h,driver:f}=n(l);if(f.setItemRaw)await ns(f.setItemRaw,h,u,d);else if(f.setItem)await ns(f.setItem,h,mHe(u),d);else return;f.watch||i("update",l)},async removeItem(l,u={}){typeof u=="boolean"&&(u={removeMeta:u}),l=Go(l);const{relativeKey:d,driver:h}=n(l);h.removeItem&&(await ns(h.removeItem,d,u),(u.removeMeta||u.removeMata)&&await ns(h.removeItem,d+"$",u),h.watch||i("remove",l))},async getMeta(l,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),l=Go(l);const{relativeKey:d,driver:h}=n(l),f=Object.create(null);if(h.getMeta&&Object.assign(f,await ns(h.getMeta,d,u)),!u.nativeOnly){const m=await ns(h.getItem,d+"$",u).then(y=>Fv(y));m&&typeof m=="object"&&(typeof m.atime=="string"&&(m.atime=new Date(m.atime)),typeof m.mtime=="string"&&(m.mtime=new Date(m.mtime)),Object.assign(f,m))}return f},setMeta(l,u,d={}){return this.setItem(l+"$",u,d)},removeMeta(l,u={}){return this.removeItem(l+"$",u)},async getKeys(l,u={}){var v;l=e6(l);const d=r(l,!0);let h=[];const f=[];let m=!0;for(const b of d){(v=b.driver.flags)!=null&&v.maxDepth||(m=!1);const C=await ns(b.driver.getKeys,b.relativeBase,u);for(const x of C){const _=b.mountpoint+Go(x);h.some($=>_.startsWith($))||f.push(_)}h=[b.mountpoint,...h.filter(x=>!x.startsWith(b.mountpoint))]}const y=u.maxDepth!==void 0&&!m;return f.filter(b=>(!y||xHe(b,u.maxDepth))&&EHe(b,l))},async clear(l,u={}){l=e6(l),await Promise.all(r(l,!1).map(async d=>{if(d.driver.clear)return ns(d.driver.clear,d.relativeBase,u);if(d.driver.removeItem){const h=await d.driver.getKeys(d.relativeBase||"",u);return Promise.all(h.map(f=>d.driver.removeItem(f,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>HG(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,u){if(l=e6(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((d,h)=>h.length-d.length)),e.mounts[l]=u,e.watching&&Promise.resolve(WG(u,i,l)).then(d=>{e.unwatch[l]=d}).catch(console.error),c},async unmount(l,u=!0){var d,h;l=e6(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&((h=(d=e.unwatch)[l])==null||h.call(d),delete e.unwatch[l]),u&&await HG(e.mounts[l]),e.mountpoints=e.mountpoints.filter(f=>f!==l),delete e.mounts[l])},getMount(l=""){l=Go(l)+":";const u=n(l);return{driver:u.driver,base:u.base}},getMounts(l="",u={}){return l=Go(l),r(l,u.parents).map(h=>({driver:h.driver,base:h.mountpoint}))},keys:(l,u={})=>c.getKeys(l,u),get:(l,u={})=>c.getItem(l,u),set:(l,u,d={})=>c.setItem(l,u,d),has:(l,u={})=>c.hasItem(l,u),del:(l,u={})=>c.removeItem(l,u),remove:(l,u={})=>c.removeItem(l,u)};return c}function WG(t,e,n){return t.watch?t.watch((r,i)=>e(r,n+i)):()=>{}}async function HG(t){typeof t.dispose=="function"&&await ns(t.dispose)}function U1(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function mde(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=U1(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(o=>s(o.transaction(e,i).objectStore(e)))}let q$;function O5(){return q$||(q$=mde("keyval-store","keyval")),q$}function VG(t,e=O5()){return e("readonly",n=>U1(n.get(t)))}function AHe(t,e,n=O5()){return n("readwrite",r=>(r.put(e,t),U1(r.transaction)))}function kHe(t,e=O5()){return e("readwrite",n=>(n.delete(t),U1(n.transaction)))}function $He(t=O5()){return t("readwrite",e=>(e.clear(),U1(e.transaction)))}function IHe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},U1(t.transaction)}function THe(t=O5()){return t("readonly",e=>{if(e.getAllKeys)return U1(e.getAllKeys());const n=[];return IHe(e,r=>n.push(r.key)).then(()=>n)})}const PHe="idb-keyval";var RHe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",n=i=>e+i;let r;return t.dbName&&t.storeName&&(r=mde(t.dbName,t.storeName)),{name:PHe,options:t,async hasItem(i){return!(typeof await VG(n(i),r)>"u")},async getItem(i){return await VG(n(i),r)??null},setItem(i,s){return AHe(n(i),s,r)},removeItem(i){return kHe(n(i),r)},getKeys(){return THe(r)},clear(){return $He(r)}}};const MHe="WALLET_CONNECT_V2_INDEXED_DB",OHe="keyvaluestorage";let jHe=class{constructor(){this.indexedDb=SHe({driver:RHe({dbName:MHe,storeName:OHe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const n=await this.indexedDb.getItem(e);if(n!==null)return n}async setItem(e,n){await this.indexedDb.setItem(e,nh(n))}async removeItem(e){await this.indexedDb.removeItem(e)}};var K$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},p8={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},t.prototype.setItem=function(n,r){this[n]=String(r)},t.prototype.removeItem=function(n){delete this[n]},t.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(r){n[r]=void 0,delete n[r]})},t.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof K$<"u"&&K$.localStorage?p8.exports=K$.localStorage:typeof window<"u"&&window.localStorage?p8.exports=window.localStorage:p8.exports=new e})();function NHe(t){var e;return[t[0],b1((e=t[1])!=null?e:"")]}let DHe=class{constructor(){this.localStorage=p8.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(NHe)}async getItem(e){const n=this.localStorage.getItem(e);if(n!==null)return b1(n)}async setItem(e,n){this.localStorage.setItem(e,nh(n))}async removeItem(e){this.localStorage.removeItem(e)}};const LHe="wc_storage_version",qG=1,BHe=async(t,e,n)=>{const r=LHe,i=await e.getItem(r);if(i&&i>=qG){n(e);return}const s=await t.getKeys();if(!s.length){n(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await t.getItem(a);await e.setItem(a,l),o.push(a)}}await e.setItem(r,qG),n(e),FHe(t,o)},FHe=async(t,e)=>{e.length&&e.forEach(async n=>{await t.removeItem(n)})};let UHe=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const e=new DHe;this.storage=e;try{const n=new jHe;BHe(e,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,n){return await this.initialize(),this.storage.setItem(e,n)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),e())},20)})}};var G$,KG;function zHe(){if(KG)return G$;KG=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}G$=e;function e(n,r,i){var s=i&&i.stringify||t,o=1;if(typeof n=="object"&&n!==null){var a=r.length+o;if(a===1)return n;var c=new Array(a);c[0]=s(n);for(var l=1;l<a;l++)c[l]=s(r[l]);return c.join(" ")}
148if(typeof n!="string")return n;var u=r.length;if(u===0)return n;for(var d="",h=1-o,f=-1,m=n&&n.length||0,y=0;y<m;){if(n.charCodeAt(y)===37&&y+1<m){switch(f=f>-1?f:0,n.charCodeAt(y+1)){case 100:case 102:if(h>=u||r[h]==null)break;f<y&&(d+=n.slice(f,y)),d+=Number(r[h]),f=y+2,y++;break;case 105:if(h>=u||r[h]==null)break;f<y&&(d+=n.slice(f,y)),d+=Math.floor(Number(r[h])),f=y+2,y++;break;case 79:case 111:case 106:if(h>=u||r[h]===void 0)break;f<y&&(d+=n.slice(f,y));var v=typeof r[h];if(v==="string"){d+="'"+r[h]+"'",f=y+2,y++;break}if(v==="function"){d+=r[h].name||"<anonymous>",f=y+2,y++;break}d+=s(r[h]),f=y+2,y++;break;case 115:if(h>=u)break;f<y&&(d+=n.slice(f,y)),d+=String(r[h]),f=y+2,y++;break;case 37:f<y&&(d+=n.slice(f,y)),d+="%",f=y+2,y++,h--;break}++h}++y}return f===-1?n:(f<m&&(d+=n.slice(f)),d)}return G$}var Z$,GG;function WHe(){if(GG)return Z$;GG=1;const t=zHe();Z$=i;const e=$().console||{},n={mapHttpRequest:m,mapHttpResponse:m,wrapRequestSerializer:y,wrapResponseSerializer:y,wrapErrorSerializer:y,req:m,res:m,err:h};function r(I,R){return Array.isArray(I)?I.filter(function(T){return T!=="!stdSerializers.err"}):I===!0?Object.keys(R):!1}function i(I){I=I||{},I.browser=I.browser||{};const R=I.browser.transmit;if(R&&typeof R.send!="function")throw Error("pino: transmit option must have a send function");const N=I.browser.write||e;I.browser.write&&(I.browser.asObject=!0);const T=I.serializers||{},O=r(I.browser.serialize,T);let U=I.browser.serialize;Array.isArray(I.browser.serialize)&&I.browser.serialize.indexOf("!stdSerializers.err")>-1&&(U=!1);const z=["error","fatal","warn","info","debug","trace"];typeof N=="function"&&(N.error=N.fatal=N.warn=N.info=N.debug=N.trace=N),I.enabled===!1&&(I.level="silent");const L=I.level||"info",S=Object.create(N);S.log||(S.log=v),Object.defineProperty(S,"levelVal",{get:M}),Object.defineProperty(S,"level",{get:W,set:H});const k={transmit:R,serialize:O,asObject:I.browser.asObject,levels:z,timestamp:f(I)};S.levels=i.levels,S.level=L,S.setMaxListeners=S.getMaxListeners=S.emit=S.addListener=S.on=S.prependListener=S.once=S.prependOnceListener=S.removeListener=S.removeAllListeners=S.listeners=S.listenerCount=S.eventNames=S.write=S.flush=v,S.serializers=T,S._serialize=O,S._stdErrSerialize=U,S.child=D,R&&(S._logEvent=d());function M(){return this.level==="silent"?1/0:this.levels.values[this.level]}function W(){return this._level}function H(V){if(V!=="silent"&&!this.levels.values[V])throw Error("unknown level "+V);this._level=V,s(k,S,"error","log"),s(k,S,"fatal","error"),s(k,S,"warn","error"),s(k,S,"info","log"),s(k,S,"debug","log"),s(k,S,"trace","log")}function D(V,B){if(!V)throw new Error("missing bindings for child Pino");B=B||{},O&&V.serializers&&(B.serializers=V.serializers);const P=B.serializers;if(O&&P){var j=Object.assign({},T,P),G=I.browser.serialize===!0?Object.keys(j):O;delete V.serializers,c([V],G,j,this._stdErrSerialize)}function Y(te){this._childLevel=(te._childLevel|0)+1,this.error=l(te,V,"error"),this.fatal=l(te,V,"fatal"),this.warn=l(te,V,"warn"),this.info=l(te,V,"info"),this.debug=l(te,V,"debug"),this.trace=l(te,V,"trace"),j&&(this.serializers=j,this._serialize=G),R&&(this._logEvent=d([].concat(te._logEvent.bindings,V)))}return Y.prototype=this,new Y(this)}return S}i.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},i.stdSerializers=n,i.stdTimeFunctions=Object.assign({},{nullTime:b,epochTime:C,unixTime:x,isoTime:_});function s(I,R,N,T){const O=Object.getPrototypeOf(R);R[N]=R.levelVal>R.levels.values[N]?v:O[N]?O[N]:e[N]||e[T]||v,o(I,R,N)}function o(I,R,N){!I.transmit&&R[N]===v||(R[N]=function(T){return function(){const U=I.timestamp(),z=new Array(arguments.length),L=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var S=0;S<z.length;S++)z[S]=arguments[S];if(I.serialize&&!I.asObject&&c(z,this._serialize,this.serializers,this._stdErrSerialize),I.asObject?T.call(L,a(this,N,z,U)):T.apply(L,z),I.transmit){const k=I.transmit.level||R.level,M=i.levels.values[k],W=i.levels.values[N];if(W<M)return;u(this,{ts:U,methodLevel:N,methodValue:W,transmitValue:i.levels.values[I.transmit.level||R.level],send:I.transmit.send,val:R.levelVal},z)}}}(R[N]))}function a(I,R,N,T){I._serialize&&c(N,I._serialize,I.serializers,I._stdErrSerialize);const O=N.slice();let U=O[0];const z={};T&&(z.time=T),z.level=i.levels.values[R];let L=(I._childLevel|0)+1;if(L<1&&(L=1),U!==null&&typeof U=="object"){for(;L--&&typeof O[0]=="object";)Object.assign(z,O.shift());
vendor: 9,199 bytes, line 148
148U=O.length?t(O.shift(),O):void 0}else typeof U=="string"&&(U=t(O.shift(),O));return U!==void 0&&(z.msg=U),z}function c(I,R,N,T){for(const O in I)if(T&&I[O]instanceof Error)I[O]=i.stdSerializers.err(I[O]);else if(typeof I[O]=="object"&&!Array.isArray(I[O]))for(const U in I[O])R&&R.indexOf(U)>-1&&U in N&&(I[O][U]=N[U](I[O][U]))}function l(I,R,N){return function(){const T=new Array(1+arguments.length);T[0]=R;for(var O=1;O<T.length;O++)T[O]=arguments[O-1];return I[N].apply(this,T)}}function u(I,R,N){const T=R.send,O=R.ts,U=R.methodLevel,z=R.methodValue,L=R.val,S=I._logEvent.bindings;c(N,I._serialize||Object.keys(I.serializers),I.serializers,I._stdErrSerialize===void 0?!0:I._stdErrSerialize),I._logEvent.ts=O,I._logEvent.messages=N.filter(function(k){return S.indexOf(k)===-1}),I._logEvent.level.label=U,I._logEvent.level.value=z,T(U,I._logEvent,L),I._logEvent=d(S)}function d(I){return{ts:0,messages:[],bindings:I||[],level:{label:"",value:0}}}function h(I){const R={type:I.constructor.name,msg:I.message,stack:I.stack};for(const N in I)R[N]===void 0&&(R[N]=I[N]);return R}function f(I){return typeof I.timestamp=="function"?I.timestamp:I.timestamp===!1?b:C}function m(){return{}}function y(I){return I}function v(){}function b(){return!1}function C(){return Date.now()}function x(){return Math.round(Date.now()/1e3)}function _(){return new Date(Date.now()).toISOString()}function $(){function I(R){return typeof R<"u"&&R}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return I(self)||I(window)||I(this)||{}}}return Z$}var bm=WHe();const j5=ys(bm),HHe={level:"info"},N5="custom_context",RL=1e3*1024;let VHe=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},ZG=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const n=new VHe(e);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let n=this.head;for(;n!==null;)e.push(n.value),n=n.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const n=e.value;return e=e.next,{done:!1,value:n}}}}},yde=class{constructor(e,n=RL){this.level=e??"error",this.levelValue=bm.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new ZG(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,n){n===bm.levels.values.error?console.error(e):n===bm.levels.values.warn?console.warn(e):n===bm.levels.values.debug?console.debug(e):n===bm.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(nh({timestamp:new Date().toISOString(),log:e}));const n=typeof e=="string"?JSON.parse(e).level:e.level;n>=this.levelValue&&this.forwardToConsole(e,n)}getLogs(){return this.logs}clearLogs(){this.logs=new ZG(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const n=this.getLogArray();return n.push(nh({extraMetadata:e})),new Blob(n,{type:"application/json"})}},qHe=class{constructor(e,n=RL){this.baseChunkLogger=new yde(e,n)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const n=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=n,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}},KHe=class{constructor(e,n=RL){this.baseChunkLogger=new yde(e,n)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var GHe=Object.defineProperty,ZHe=Object.defineProperties,YHe=Object.getOwnPropertyDescriptors,YG=Object.getOwnPropertySymbols,QHe=Object.prototype.hasOwnProperty,XHe=Object.prototype.propertyIsEnumerable,QG=(t,e,n)=>e in t?GHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,v9=(t,e)=>{for(var n in e||(e={}))QHe.call(e,n)&&QG(t,n,e[n]);if(YG)for(var n of YG(e))XHe.call(e,n)&&QG(t,n,e[n]);return t},b9=(t,e)=>ZHe(t,YHe(e));function n_(t){return b9(v9({},t),{level:(t==null?void 0:t.level)||HHe.level})}function JHe(t,e=N5){return t[e]||""}function eVe(t,e,n=N5){return t[n]=e,t}function ya(t,e=N5){let n="";return typeof t.bindings>"u"?n=JHe(t,e):n=t.bindings().context||"",n}function tVe(t,e,n=N5){const r=ya(t,n);return r.trim()?`${r}/${e}`:e}function jo(t,e,n=N5){const r=tVe(t,e,n),i=t.child({context:r});return eVe(i,r,n)}function nVe(t){var e,n;const r=new qHe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:j5(b9(v9({},t.opts),{level:"trace",browser:b9(v9({},(n=t.opts)==null?void 0:n.browser),{write:i=>r.write(i)})})),chunkLoggerController:r}}function rVe(t){var e;const n=new KHe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:j5(b9(v9({},t.opts),{level:"trace"}),n),chunkLoggerController:n}}function iVe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?nVe(t):rVe(t)}var sVe=Object.defineProperty,oVe=(t,e,n)=>e in t?sVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,XG=(t,e,n)=>oVe(t,typeof e!="symbol"?e+"":e,n);let aVe=class extends B1{constructor(e){super(),this.opts=e,XG(this,"protocol","wc"),XG(this,"version",2)}};var cVe=Object.defineProperty,lVe=(t,e,n)=>e in t?cVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,uVe=(t,e,n)=>lVe(t,e+"",n);let dVe=class extends B1{constructor(e,n){super(),this.core=e,this.logger=n,uVe(this,"records",new Map)}},hVe=class{constructor(e,n){this.logger=e,this.core=n}},fVe=class extends B1{constructor(e,n){super(),this.relayer=e,this.logger=n}},pVe=class extends B1{constructor(e){super()}},gVe=class{constructor(e,n,r,i){this.core=e,this.logger=n,this.name=r}},mVe=class extends B1{constructor(e,n){super(),this.relayer=e,this.logger=n}},yVe=class extends B1{constructor(e,n){super(),this.core=e,this.logger=n}},wVe=class{constructor(e,n,r){this.core=e,this.logger=n,this.store=r}},vVe=class{constructor(e,n){this.projectId=e,this.logger=n}},bVe=class{constructor(e,n,r){this.core=e,this.logger=n,this.telemetryEnabled=r}};var xVe=Object.defineProperty,EVe=(t,e,n)=>e in t?xVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,JG=(t,e,n)=>EVe(t,typeof e!="symbol"?e+"":e,n);let CVe=class{constructor(e){this.opts=e,JG(this,"protocol","wc"),JG(this,"version",2)}},_Ve=class{constructor(e){this.client=e}};const SVe="PARSE_ERROR",AVe="INVALID_REQUEST",kVe="METHOD_NOT_FOUND",$Ve="INVALID_PARAMS",wde="INTERNAL_ERROR",ML="SERVER_ERROR",IVe=[-32700,-32600,-32601,-32602,-32603],pb={[SVe]:{code:-32700,message:"Parse error"},[AVe]:{code:-32600,message:"Invalid Request"},[kVe]:{code:-32601,message:"Method not found"},[$Ve]:{code:-32602,message:"Invalid params"},[wde]:{code:-32603,message:"Internal error"},[ML]:{code:-32e3,message:"Server error"}},vde=ML;function TVe(t){return IVe.includes(t)}function eZ(t){return Object.keys(pb).includes(t)?pb[t]:pb[vde]}function PVe(t){const e=Object.values(pb).find(n=>n.code===t);return e||pb[vde]}function bde(t,e,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${e}`):t}var Y$={},cd={},tZ;function RVe(){if(tZ)return cd;tZ=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.isBrowserCryptoAvailable=cd.getSubtleCrypto=cd.getBrowerCrypto=void 0;function t(){return(Oa==null?void 0:Oa.crypto)||(Oa==null?void 0:Oa.msCrypto)||{}}cd.getBrowerCrypto=t;function e(){const r=t();return r.subtle||r.webkitSubtle}cd.getSubtleCrypto=e;function n(){return!!t()&&!!e()}return cd.isBrowserCryptoAvailable=n,cd}var ld={},nZ;function MVe(){if(nZ)return ld;nZ=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.isBrowser=ld.isNode=ld.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}ld.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}ld.isNode=e;function n(){return!t()&&!e()}return ld.isBrowser=n,ld}var rZ;function OVe(){return rZ||(rZ=1,function(t){Object.defineProperty(t,"__esMo
148dule",{value:!0});const e=k5;e.__exportStar(RVe(),t),e.__exportStar(MVe(),t)}(Y$)),Y$}var jVe=OVe();function iu(t=3){const e=Date.now()*Math.pow(10,t),n=Math.floor(Math.random()*Math.pow(10,t));return e+n}function E0(t=6){return BigInt(iu(t))}function Vf(t,e,n){return{id:n||iu(),jsonrpc:"2.0",method:t,params:e}}function r_(t,e){return{id:t,jsonrpc:"2.0",result:e}}function i_(t,e,n){return{id:t,jsonrpc:"2.0",error:NVe(e)}}function NVe(t,e){return typeof t>"u"?eZ(wde):(typeof t=="string"&&(t=Object.assign(Object.assign({},eZ(ML)),{message:t})),TVe(t.code)&&(t=PVe(t.code)),t)}let DVe=class{},LVe=class extends DVe{constructor(){super()}},BVe=class extends LVe{constructor(e){super()}};const FVe="^https?:",UVe="^wss?:";function zVe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function xde(t,e){const n=zVe(t);return typeof n>"u"?!1:new RegExp(e).test(n)}function iZ(t){return xde(t,FVe)}function sZ(t){return xde(t,UVe)}function WVe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Ede(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function OL(t){return Ede(t)&&"method"in t}function s_(t){return Ede(t)&&(su(t)||dc(t))}function su(t){return"result"in t}function dc(t){return"error"in t}let Rc=class extends BVe{constructor(e){super(e),this.events=new Wa.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async request(e,n){return this.requestStrict(Vf(e.method,e.params||[],e.id||E0().toString()),n)}async requestStrict(e,n){return new Promise(async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{dc(s)?i(s.error):r(s.result)});try{await this.connection.send(e,n)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),s_(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const HVe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),VVe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",oZ=t=>t.split("?")[0],aZ=10,qVe=HVe();let KVe=class{constructor(e){if(this.url=e,this.events=new Wa.EventEmitter,this.registering=!1,!sZ(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,n)=>{if(typeof this.socket>"u"){n(new Error("Connection already closed"));return}this.socket.onclose=r=>{this.onClose(r),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(nh(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!sZ(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((r,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));r(this.socket)})})}return this.url=e,this.registering=!0,new Promise((n,r)=>{const i=jVe.isReactNative()?void 0:{rejectUnauthorized:!WVe(e)},s=new qVe(e,[],i);VVe()?s.onerror=o=>{const a=o;r(this.emitError(a.error))}:s.on("error",o=>{r(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),n(s)}})}onOpen(e){e.onmessage=n=>this.onPayload(n),e.onclose=n=>this.onClose(n),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;
vendor: 68,186 bytes, line 148
148const n=typeof e.data=="string"?b1(e.data):e.data;this.events.emit("payload",n)}onError(e,n){const r=this.parseError(n),i=r.message||r.toString(),s=i_(e,i);this.events.emit("payload",s)}parseError(e,n=this.url){return bde(e,oZ(n),"WS")}resetMaxListeners(){this.events.getMaxListeners()>aZ&&this.events.setMaxListeners(aZ)}emitError(e){const n=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${oZ(this.url)}`));return this.events.emit("register_error",n),n}};var GVe={};const Cde="wc",_de=2,YM="core",Nu=`${Cde}@2:${YM}:`,ZVe={logger:"error"},YVe={database:":memory:"},QVe="crypto",cZ="client_ed25519_seed",XVe=Pt.ONE_DAY,JVe="keychain",eqe="0.3",tqe="messages",nqe="0.3",lZ=Pt.SIX_HOURS,rqe="publisher",Sde="irn",iqe="error",Ade="wss://relay.walletconnect.org",sqe="relayer",ls={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},oqe="_subscription",Qa={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},aqe=.1,QM="2.21.5",Lr={link_mode:"link_mode",relay:"relay"},g8={inbound:"inbound",outbound:"outbound"},cqe="0.3",lqe="WALLETCONNECT_CLIENT_ID",uZ="WALLETCONNECT_LINK_MODE_APPS",ka={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},uqe="subscription",dqe="0.3",hqe="pairing",fqe="0.3",cv={wc_pairingDelete:{req:{ttl:Pt.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Pt.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Pt.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Pt.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Pt.ONE_DAY,prompt:!1,tag:0},res:{ttl:Pt.ONE_DAY,prompt:!1,tag:0}}},c0={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Hc={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},pqe="history",gqe="0.3",mqe="expirer",sc={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},yqe="0.3",wqe="verify-api",vqe="https://verify.walletconnect.com",kde="https://verify.walletconnect.org",gb=kde,bqe=`${gb}/v3`,xqe=[vqe,kde],Eqe="echo",Cqe="https://echo.walletconnect.com",Jl={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},pd={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Vc={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},Yp={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},Qp={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"},lv={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},_qe=.1,Sqe="event-client",Aqe=86400,kqe="https://pulse.walletconnect.org/batch";function $qe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var y=0,v=0,b=0,C=m.length;b!==C&&m[b]===0;)b++,y++;for(var x=(C-b)*u+1>>>0,_=new Uint8Array(x);b!==C;){for(var $=m[b],I=0,R=x-1;($!==0||I<v)&&R!==-1;R--,I++)$+=256*_[R]>>>0,_[R]=$%a>>>0,$=$/a>>>0;if($!==0)throw new Error("Non-zero carry");v=I,b++}for(var N=x-v;N!==x&&_[N]===0;)N++;for(var T=c.repeat(y);N<x;++N)T+=t.charAt(_[N]);return T}function h(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var y=0;if(m[y]!==" "){for(var v=0,b=0;m[y]===c;)v++,y++;for(var C=(m.length-y)*l+1>>>0,x=new Uint8Array(C);m[y];){var _=n[m.charCodeAt(y)];if(_===255)return;for(var $=0,I=C-1;(_!==0||$<b)&&I!==-1;I--,$++)_+=a*x[I]>>>0,x[I]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");b=$,y++}if(m[y]!==" "){for(var R=C-b;R!==C&&x[R]===0;)R++;for(var N=new Uint8Array(v+(C-R)),T=v;R!==C;)N[T++]=x[R++];return N}}}function f(m){var y=h(m);if(y)return y;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:h,decode:f}}var Iqe=$qe,Tqe=Iqe;const $de=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Pqe=t=>new TextEncoder().encode(t),Rqe=t=>new TextDecoder().decode(t);let Mqe=class{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Oqe=class{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Ide(this,e)}},jqe=class{constructor(e){this.decoders=e}or(e){return Ide(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const Ide=(t,e)=>new jqe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let Nqe=class{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new Mqe(e,n,r),this.decoder=new Oqe(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const o_=({name:t,prefix:e,encode:n,decode:r})=>new Nqe(t,e,n,r),D5=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=Tqe(n,e);return o_({prefix:t,name:e,encode:r,decode:s=>$de(i(s))})},Dqe=(t,e,n,r)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*n/8|0);let a=0,c=0,l=0;for(let u=0;u<s;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Lqe=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>n;)o-=n,s+=e[i&a>>o];if(o&&(s+=e[i&a<<n-o]),r)for(;s.length*n&7;)s+="=";return s},Vs=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>o_({prefix:e,name:t,encode(i){return Lqe(i,r,n)},decode(i){return Dqe(i,r,n,t)}}),Bqe=o_({prefix:"\0",name:"identity",encode:t=>Rqe(t),decode:t=>Pqe(t)});var Fqe=Object.freeze({__proto__:null,identity:Bqe});const Uqe=Vs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var zqe=Object.freeze({__proto__:null,base2:Uqe});const Wqe=Vs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Hqe=Object.freeze({__proto__:null,base8:Wqe});const Vqe=D5({prefix:"9",name:"base10",alphabet:"0123456789"});var qqe=Object.freeze({__proto__:null,base10:Vqe});const Kqe=Vs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Gqe=Vs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Zqe=Object.freeze({__proto__:null,base16:Kqe,base16upper:Gqe});const Yqe=Vs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qqe=Vs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Xqe=Vs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Jqe=Vs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),eKe=Vs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tKe=Vs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nKe=Vs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rKe=Vs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),iKe=Vs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var sKe=Object.freeze({__proto__:null,base32:Yqe,base32upper:Qqe,base32pad:Xqe,base32padupper:Jqe,base32hex:eKe,base32hexupper:tKe,base32hexpad:nKe,base32hexpadupper:rKe,base32z:iKe});const oKe=D5({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),aKe=D5({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var cKe=Object.freeze({__proto__:null,base36:oKe,base36upper:aKe});const lKe=D5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),uKe=D5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var dKe=Object.freeze({__proto__:null,base58btc:lKe,base58flickr:uKe});const hKe=Vs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),fKe=Vs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),pKe=Vs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),gKe=Vs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var mKe=Object.freeze({__proto__:null,base64:hKe,base64pad:fKe,base64url:pKe,base64urlpad:gKe});const Tde=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),yKe=Tde.reduce((t,e,n)=>(t[n]=e,t),[]),wKe=Tde.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function vKe(t){return t.reduce((e,n)=>(e+=yKe[n],e),"")}function bKe(t){const e=[];for(const n of t){const r=wKe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const xKe=o_({prefix:"ð",name:"base256emoji",encode:vKe,decode:bKe});var EKe=Object.freeze({__proto__:null,base256emoji:xKe}),CKe=Pde,dZ=128,_Ke=-128,SKe=Math.pow(2,31);function Pde(t,e,n){e=e||[],n=n||0;for(var r=n;t>=SKe;)e[n++]=t&255|dZ,t/=128;for(;t&_Ke;)e[n++]=t&255|dZ,t>>>=7;return e[n]=t|0,Pde.bytes=n-r+1,e}var AKe=XM,kKe=128,hZ=127;function XM(t,r){var n=0,r=r||0,i=0,s=r,o,a=t.length;do{if(s>=a)throw XM.bytes=0,new RangeError("Could not decode varint");o=t[s++],n+=i<28?(o&hZ)<<i:(o&hZ)*Math.pow(2,i),i+=7}while(o>=kKe);return XM.bytes=s-r,n}var $Ke=Math.pow(2,7),IKe=Math.pow(2,14),TKe=Math.pow(2,21),PKe=Math.pow(2,28),RKe=Math.pow(2,35),MKe=Math.pow(2,42),OKe=Math.pow(2,49),jKe=Math.pow(2,56),NKe=Math.pow(2,63),DKe=function(t){return t<$Ke?1:t<IKe?2:t<TKe?3:t<PKe?4:t<RKe?5:t<MKe?6:t<OKe?7:t<jKe?8:t<NKe?9:10},LKe={encode:CKe,decode:AKe,encodingLength:DKe},Rde=LKe;const fZ=(t,e,n=0)=>(Rde.encode(t,e,n),e),pZ=t=>Rde.encodingLength(t),JM=(t,e)=>{const n=e.byteLength,r=pZ(t),i=r+pZ(n),s=new Uint8Array(i+n);return fZ(t,s,0),fZ(n,s,r),s.set(e,i),new BKe(t,n,e,s)};let BKe=class{constructor(e,n,r,i){this.code=e,this.size=n,this.digest=r,this.bytes=i}};const Mde=({name:t,code:e,encode:n})=>new FKe(t,e,n);let FKe=class{constructor(e,n,r){this.name=e,this.code=n,this.encode=r}digest(e){if(e instanceof Uint8Array){const n=this.encode(e);return n instanceof Uint8Array?JM(this.code,n):n.then(r=>JM(this.code,r))}else throw Error("Unknown type, must be binary type")}};const Ode=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),UKe=Mde({name:"sha2-256",code:18,encode:Ode("SHA-256")}),zKe=Mde({name:"sha2-512",code:19,encode:Ode("SHA-512")});var WKe=Object.freeze({__proto__:null,sha256:UKe,sha512:zKe});const jde=0,HKe="identity",Nde=$de,VKe=t=>JM(jde,Nde(t)),qKe={code:jde,name:HKe,encode:Nde,digest:VKe};var KKe=Object.freeze({__proto__:null,identity:qKe});new TextEncoder,new TextDecoder;const gZ={...Fqe,...zqe,...Hqe,...qqe,...Zqe,...sKe,...cKe,...dKe,...mKe,...EKe};({...WKe,...KKe});function Dde(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function GKe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Dde(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Lde(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const mZ=Lde("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Q$=Lde("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=GKe(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),ZKe={utf8:mZ,"utf-8":mZ,hex:gZ.base16,latin1:Q$,ascii:Q$,binary:Q$,...gZ};function YKe(t,e="utf8"){const n=ZKe[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Dde(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}var QKe=Object.defineProperty,XKe=(t,e,n)=>e in t?QKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Hl=(t,e,n)=>XKe(t,typeof e!="symbol"?e+"":e,n);let JKe=class{constructor(e,n){this.core=e,this.logger=n,Hl(this,"keychain",new Map),Hl(this,"name",JVe),Hl(this,"version",eqe),Hl(this,"initialized",!1),Hl(this,"storagePrefix",Nu),Hl(this,"init",async()=>{if(!this.initialized){const r=await this.getKeyChain();typeof r<"u"&&(this.keychain=r),this.initialized=!0}}),Hl(this,"has",r=>(this.isInitialized(),this.keychain.has(r))),Hl(this,"set",async(r,i)=>{this.isInitialized(),this.keychain.set(r,i),await this.persist()}),Hl(this,"get",r=>{this.isInitialized();const i=this.keychain.get(r);if(typeof i>"u"){const{message:s}=Tt("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(s)}return i}),Hl(this,"del",async r=>{this.isInitialized(),this.keychain.delete(r),await this.persist()}),this.core=e,this.logger=jo(n,this.name)}get context(){return ya(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,NM(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?DM(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var eGe=Object.defineProperty,tGe=(t,e,n)=>e in t?eGe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Es=(t,e,n)=>tGe(t,typeof e!="symbol"?e+"":e,n);let nGe=class{constructor(e,n,r){this.core=e,this.logger=n,Es(this,"name",QVe),Es(this,"keychain"),Es(this,"randomSessionIdentifier",KM()),Es(this,"initialized",!1),Es(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),Es(this,"hasKeys",i=>(this.isInitialized(),this.keychain.has(i))),Es(this,"getClientId",async()=>{this.isInitialized();const i=await this.getClientSeed(),s=FK(i);return due(s.publicKey)}),Es(this,"generateKeyPair",()=>{this.isInitialized();const i=eWe();return this.setPrivateKey(i.publicKey,i.privateKey)}),Es(this,"signJWT",async i=>{this.isInitialized();const s=await this.getClientSeed(),o=FK(s),a=this.randomSessionIdentifier;return await GLe(a,i,XVe,o)}),Es(this,"generateSharedKey",(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=tWe(a,s);return this.setSymKey(c,o)}),Es(this,"setSymKey",async(i,s)=>{this.isInitialized();const o=s||h8(i);return await this.keychain.set(o,i),o}),Es(this,"deleteKeyPair",async i=>{this.isInitialized(),await this.keychain.del(i)}),Es(this,"deleteSymKey",async i=>{this.isInitialized(),await this.keychain.del(i)}),Es(this,"encode",async(i,s,o)=>{this.isInitialized();const a=hde(o),c=nh(s);if(TG(a))return iWe(c,o==null?void 0:o.encoding);if(IG(a)){const h=a.senderPublicKey,f=a.receiverPublicKey;i=await this.generateSharedKey(h,f)}const l=this.getSymKey(i),{type:u,senderPublicKey:d}=a;return nWe({type:u,symKey:l,message:c,senderPublicKey:d,encoding:o==null?void 0:o.encoding})}),Es(this,"decode",async(i,s,o)=>{this.isInitialized();const a=oWe(s,o);if(TG(a)){const c=sWe(s,o==null?void 0:o.encoding);return b1(c)}if(IG(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=rWe({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return b1(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}}),Es(this,"getPayloadType",(i,s=pl)=>{const o=a3({encoded:i,encoding:s});return E1(o.type)}),Es(this,"getPayloadSenderPublicKey",(i,s=pl)=>{const o=a3({encoded:i,encoding:s});return o.senderPublicKey?ha(o.senderPublicKey,Ro):void 0}),this.core=e,this.logger=jo(n,this.name),this.keychain=r||new JKe(this.core,this.logger)}get context(){return ya(this.logger)}async setPrivateKey(e,n){return await this.keychain.set(e,n),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(cZ)}catch{e=KM(),await this.keychain.set(cZ,e)}return YKe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var rGe=Object.defineProperty,iGe=Object.defineProperties,sGe=Object.getOwnPropertyDescriptors,yZ=Object.getOwnPropertySymbols,oGe=Object.prototype.hasOwnProperty,aGe=Object.prototype.propertyIsEnumerable,eO=(t,e,n)=>e in t?rGe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,cGe=(t,e)=>{for(var n in e||(e={}))oGe.call(e,n)&&eO(t,n,e[n]);if(yZ)for(var n of yZ(e))aGe.call(e,n)&&eO(t,n,e[n]);return t},lGe=(t,e)=>iGe(t,sGe(e)),_a=(t,e,n)=>eO(t,typeof e!="symbol"?e+"":e,n);let uGe=class extends hVe{constructor(e,n){super(e,n),this.logger=e,this.core=n,_a(this,"messages",new Map),_a(this,"messagesWithoutClientAck",new Map),_a(this,"name",tqe),_a(this,"version",nqe),_a(this,"initialized",!1),_a(this,"storagePrefix",Nu),_a(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const r=await this.getRelayerMessages();typeof r<"u"&&(this.messages=r);const i=await this.getRelayerMessagesWithoutClientAck();typeof i<"u"&&(this.messagesWithoutClientAck=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(r){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(r)}finally{this.initialized=!0}}}),_a(this,"set",async(r,i,s)=>{this.isInitialized();const o=mu(i);let a=this.messages.get(r);if(typeof a>"u"&&(a={}),typeof a[o]<"u")return o;if(a[o]=i,this.messages.set(r,a),s===g8.inbound){const c=this.messagesWithoutClientAck.get(r)||{};this.messagesWithoutClientAck.set(r,lGe(cGe({},c),{[o]:i}))}return await this.persist(),o}),_a(this,"get",r=>{this.isInitialized();let i=this.messages.get(r);return typeof i>"u"&&(i={}),i}),_a(this,"getWithoutAck",r=>{this.isInitialized();const i={};for(const s of r){const o=this.messagesWithoutClientAck.get(s)||{};i[s]=Object.values(o)}return i}),_a(this,"has",(r,i)=>{this.isInitialized();const s=this.get(r),o=mu(i);return typeof s[o]<"u"}),_a(this,"ack",async(r,i)=>{this.isInitialized();const s=this.messagesWithoutClientAck.get(r);if(typeof s>"u")return;const o=mu(i);delete s[o],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(r):this.messagesWithoutClientAck.set(r,s),await this.persist()}),_a(this,"del",async r=>{this.isInitialized(),this.messages.delete(r),this.messagesWithoutClientAck.delete(r),await this.persist()}),this.logger=jo(e,this.name),this.core=n}get context(){return ya(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,NM(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,NM(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?DM(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?DM(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var dGe=Object.defineProperty,hGe=Object.defineProperties,fGe=Object.getOwnPropertyDescriptors,wZ=Object.getOwnPropertySymbols,pGe=Object.prototype.hasOwnProperty,gGe=Object.prototype.propertyIsEnumerable,tO=(t,e,n)=>e in t?dGe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,t6=(t,e)=>{for(var n in e||(e={}))pGe.call(e,n)&&tO(t,n,e[n]);if(wZ)for(var n of wZ(e))gGe.call(e,n)&&tO(t,n,e[n]);return t},X$=(t,e)=>hGe(t,fGe(e)),qc=(t,e,n)=>tO(t,typeof e!="symbol"?e+"":e,n);let mGe=class extends fVe{constructor(e,n){super(e,n),this.relayer=e,this.logger=n,qc(this,"events",new Wa.EventEmitter),qc(this,"name",rqe),qc(this,"queue",new Map),qc(this,"publishTimeout",Pt.toMiliseconds(Pt.ONE_MINUTE)),qc(this,"initialPublishTimeout",Pt.toMiliseconds(Pt.ONE_SECOND*15)),qc(this,"needsTransportRestart",!1),qc(this,"publish",async(r,i,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:r,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||lZ,c=y9(s),l=(s==null?void 0:s.prompt)||!1,u=(s==null?void 0:s.tag)||0,d=(s==null?void 0:s.id)||E0().toString(),h={topic:r,message:i,opts:{ttl:a,relay:c,prompt:l,tag:u,id:d,attestation:s==null?void 0:s.attestation,tvf:s==null?void 0:s.tvf}},f=`Failed to publish payload, please try again. id:${d} tag:${u}`;try{const m=new Promise(async y=>{const v=({id:C})=>{h.opts.id===C&&(this.removeRequestFromQueue(C),this.relayer.events.removeListener(ls.publish,v),y(h))};this.relayer.events.on(ls.publish,v);const b=Hf(new Promise((C,x)=>{this.rpcPublish({topic:r,message:i,ttl:a,prompt:l,tag:u,id:d,attestation:s==null?void 0:s.attestation,tvf:s==null?void 0:s.tvf}).then(C).catch(_=>{this.logger.warn(_,_==null?void 0:_.message),x(_)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${d} tag:${u}`);try{await b,this.events.removeListener(ls.publish,v)}catch(C){this.queue.set(d,X$(t6({},h),{attempt:1})),this.logger.warn(C,C==null?void 0:C.message)}});this.logger.trace({type:"method",method:"publish",params:{id:d,topic:r,message:i,opts:s}}),await Hf(m,this.publishTimeout,f)}catch(m){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(m),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw m}finally{this.queue.delete(d)}}),qc(this,"on",(r,i)=>{this.events.on(r,i)}),qc(this,"once",(r,i)=>{this.events.once(r,i)}),qc(this,"off",(r,i)=>{this.events.off(r,i)}),qc(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.relayer=e,this.logger=jo(n,this.name),this.registerEventListeners()}get context(){return ya(this.logger)}async rpcPublish(e){var n,r,i,s;const{topic:o,message:a,ttl:c=lZ,prompt:l,tag:u,id:d,attestation:h,tvf:f}=e,m={method:Vv(y9().protocol).publish,params:t6({topic:o,message:a,ttl:c,prompt:l,tag:u,attestation:h},f),id:d};Ms((n=m.params)==null?void 0:n.prompt)&&((r=m.params)==null||delete r.prompt),Ms((i=m.params)==null?void 0:i.tag)&&((s=m.params)==null||delete s.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:m});const y=await this.relayer.request(m);return this.relayer.events.emit(ls.publish,e),this.logger.debug("Successfully Published Payload"),y}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,n)=>{const r=e.attempt+1;this.queue.set(n,X$(t6({},e),{attempt:r}));const{topic:i,message:s,opts:o,attestation:a}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${r}`),await this.rpcPublish(X$(t6({},e),{topic:i,message:s,ttl:o.ttl,prompt:o.prompt,tag:o.tag,id:o.id,attestation:a,tvf:o.tvf})),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(F1.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(ls.connection_stalled);return}this.checkQueue()}),this.relayer.on(ls.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}};var yGe=Object.defineProperty,wGe=(t,e,n)=>e in t?yGe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Zg=(t,e,n)=>wGe(t,typeof e!="symbol"?e+"":e,n);let vGe=class{constructor(){Zg(this,"map",new Map),Zg(this,"set",(e,n)=>{const r=this.get(e);this.exists(e,n)||this.map.set(e,[...r,n])}),Zg(this,"get",e=>this.map.get(e)||[]),Zg(this,"exists",(e,n)=>this.get(e).includes(n)),Zg(this,"delete",(e,n)=>{if(typeof n>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,n))return;const i=r.filter(s=>s!==n);if(!i.length){this.map.delete(e);return}this.map.set(e,i)}),Zg(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}};var bGe=Object.defineProperty,xGe=Object.defineProperties,EGe=Object.getOwnPropertyDescriptors,vZ=Object.getOwnPropertySymbols,CGe=Object.prototype.hasOwnProperty,_Ge=Object.prototype.propertyIsEnumerable,nO=(t,e,n)=>e in t?bGe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,uv=(t,e)=>{for(var n in e||(e={}))CGe.call(e,n)&&nO(t,n,e[n]);if(vZ)for(var n of vZ(e))_Ge.call(e,n)&&nO(t,n,e[n]);return t},J$=(t,e)=>xGe(t,EGe(e)),_r=(t,e,n)=>nO(t,typeof e!="symbol"?e+"":e,n);let SGe=class extends mVe{constructor(e,n){super(e,n),this.relayer=e,this.logger=n,_r(this,"subscriptions",new Map),_r(this,"topicMap",new vGe),_r(this,"events",new Wa.EventEmitter),_r(this,"name",uqe),_r(this,"version",dqe),_r(this,"pending",new Map),_r(this,"cached",[]),_r(this,"initialized",!1),_r(this,"storagePrefix",Nu),_r(this,"subscribeTimeout",Pt.toMiliseconds(Pt.ONE_MINUTE)),_r(this,"initialSubscribeTimeout",Pt.toMiliseconds(Pt.ONE_SECOND*15)),_r(this,"clientId"),_r(this,"batchSubscribeTopicsLimit",500),_r(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),_r(this,"subscribe",async(r,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:i}});try{const s=y9(i),o={topic:r,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(r,o);const a=await this.rpcSubscribe(r,s,i);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:i}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}}),_r(this,"unsubscribe",async(r,i)=>{this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(r,i.id,i):await this.unsubscribeByTopic(r,i)}),_r(this,"isSubscribed",r=>new Promise(i=>{i(this.topicMap.topics.includes(r))})),_r(this,"isKnownTopic",r=>new Promise(i=>{i(this.topicMap.topics.includes(r)||this.pending.has(r)||this.cached.some(s=>s.topic===r))})),_r(this,"on",(r,i)=>{this.events.on(r,i)}),_r(this,"once",(r,i)=>{this.events.once(r,i)}),_r(this,"off",(r,i)=>{this.events.off(r,i)}),_r(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),_r(this,"start",async()=>{await this.onConnect()}),_r(this,"stop",async()=>{await this.onDisconnect()}),_r(this,"restart",async()=>{await this.restore(),await this.onRestart()}),_r(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const r=[];this.pending.forEach(i=>{r.push(i)}),await this.batchSubscribe(r)}),_r(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(F1.pulse,async()=>{await this.checkPending()}),this.events.on(ka.created,async r=>{const i=ka.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()}),this.events.on(ka.deleted,async r=>{const i=ka.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()})}),this.relayer=e,this.logger=jo(n,this.name),this.clientId=""}get context(){return ya(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,n){let r=!1;try{r=this.getSubscription(e).topic===n}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,n){const r=this.topicMap.get(e);await Promise.all(r.map(async i=>await this.unsubscribeById(e,i,n)))}async unsubscribeById(e,n,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:n,opts:r}});try{const i=y9(r);await this.restartToComplete({topic:e,id:n,relay:i}),await this.rpcUnsubscribe(e,n,i);const s=Br("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,n,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:n,opts:r}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,n,r){var i;(!r||(r==null?void 0:r.transportType)===Lr.relay)&&await this.restartToComplete({topic:e,id:e,relay:n});const s={method:Vv(n.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const o=(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;try{const a=await this.getSubscriptionId(e);if((r==null?void 0:r.transportType)===Lr.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(u=>this.logger.warn(u))},Pt.toMiliseconds(Pt.ONE_SECOND)),a;const c=new Promise(async u=>{const d=h=>{h.topic===e&&(this.events.removeListener(ka.created,d),u(h.id))};this.events.on(ka.created,d);try{const h=await Hf(new Promise((f,m)=>{this.relayer.request(s).catch(y=>{this.logger.warn(y,y==null?void 0:y.message),m(y)}).then(f)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(ka.created,d),u(h)}catch{}}),l=await Hf(c,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!l&&o)throw new Error(`Subscribing to ${e} failed, please try again`);return l?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(ls.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(e){if(!e.length)return;const n=e[0].relay,r={method:Vv(n.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await Hf(new Promise(i=>{this.relayer.request(r).catch(s=>this.logger.warn(s)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(ls.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const n=e[0].relay,r={method:Vv(n.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});let i;try{i=await await Hf(new Promise((s,o)=>{this.relayer.request(r).catch(a=>{this.logger.warn(a),o(a)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(ls.connection_stalled)}return i}rpcUnsubscribe(e,n,r){const i={method:Vv(r.protocol).unsubscribe,params:{topic:e,id:n}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,n){this.setSubscription(e,J$(uv({},n),{id:e})),this.pending.delete(n.topic)}onBatchSubscribe(e){e.length&&e.forEach(n=>{this.setSubscription(n.id,uv({},n)),this.pending.delete(n.topic)})}async onUnsubscribe(e,n,r){this.events.removeAllListeners(n),this.hasSubscription(n,e)&&this.deleteSubscription(n,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,n){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:n}),this.addSubscription(e,n)}addSubscription(e,n){this.subscriptions.set(e,uv({},n)),this.topicMap.set(n.topic,e),this.events.emit(ka.created,n)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const n=this.subscriptions.get(e);if(!n){const{message:r}=Tt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(r)}return n}deleteSubscription(e,n){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:n});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(ka.deleted,J$(uv({},r),{reason:n}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(ka.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],n=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<n;r++){const i=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(i)}}this.events.emit(ka.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:n}=Tt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async n=>J$(uv({},n),{id:await this.getSubscriptionId(n.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const n=await this.rpcBatchFetchMessages(e);n&&n.messages&&(await EFe(Pt.toMiliseconds(Pt.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(n.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return mu(e+await this.getClientId())}};var AGe=Object.defineProperty,bZ=Object.getOwnPropertySymbols,kGe=Object.prototype.hasOwnProperty,$Ge=Object.prototype.propertyIsEnumerable,rO=(t,e,n)=>e in t?AGe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xZ=(t,e)=>{for(var n in e||(e={}))kGe.call(e,n)&&rO(t,n,e[n]);if(bZ)for(var n of bZ(e))$Ge.call(e,n)&&rO(t,n,e[n]);return t},tr=(t,e,n)=>rO(t,typeof e!="symbol"?e+"":e,n);let IGe=class extends pVe{constructor(e){super(e),tr(this,"protocol","wc"),tr(this,"version",2),tr(this,"core"),tr(this,"logger"),tr(this,"events",new Wa.EventEmitter),tr(this,"provider"),tr(this,"messages"),tr(this,"subscriber"),tr(this,"publisher"),tr(this,"name",sqe),tr(this,"transportExplicitlyClosed",!1),tr(this,"initialized",!1),tr(this,"connectionAttemptInProgress",!1),tr(this,"relayUrl"),tr(this,"projectId"),tr(this,"packageName"),tr(this,"bundleId"),tr(this,"hasExperiencedNetworkDisruption",!1),tr(this,"pingTimeout"),tr(this,"heartBeatTimeout",Pt.toMiliseconds(Pt.THIRTY_SECONDS+Pt.FIVE_SECONDS)),tr(this,"reconnectTimeout"),tr(this,"connectPromise"),tr(this,"reconnectInProgress",!1),tr(this,"requestsInFlight",[]),tr(this,"connectTimeout",Pt.toMiliseconds(Pt.ONE_SECOND*15)),tr(this,"request",async n=>{var r,i;this.logger.debug("Publishing Request Payload");const s=n.id||E0().toString();await this.toEstablishConnection();try{this.logger.trace({id:s,method:n.method,topic:(r=n.params)==null?void 0:r.topic},"relayer.request - publishing...");const o=`${s}:${((i=n.params)==null?void 0:i.tag)||""}`;this.requestsInFlight.push(o);const a=await this.provider.request(n);return this.requestsInFlight=this.requestsInFlight.filter(c=>c!==o),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}}),tr(this,"resetPingTimeout",()=>{f9()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var n,r,i,s;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(s=(i=(r=(n=this.provider)==null?void 0:n.connection)==null?void 0:r.socket)==null?void 0:i.terminate)==null||s.call(i)}catch(o){this.logger.warn(o,o==null?void 0:o.message)}},this.heartBeatTimeout))}),tr(this,"onPayloadHandler",n=>{this.onProviderPayload(n),this.resetPingTimeout()}),tr(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected ð"),this.startPingTimeout(),this.events.emit(ls.connect)}),tr(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected ð"),this.requestsInFlight=[],this.onProviderDisconnect()}),tr(this,"onProviderErrorHandler",n=>{this.logger.fatal(`Fatal socket error: ${n.message}`),this.events.emit(ls.error,n),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),tr(this,"registerProviderListeners",()=>{this.provider.on(Qa.payload,this.onPayloadHandler),this.provider.on(Qa.connect,this.onConnectHandler),this.provider.on(Qa.disconnect,this.onDisconnectHandler),this.provider.on(Qa.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?jo(e.logger,this.name):j5(n_({level:e.logger||iqe})),this.messages=new uGe(this.logger,e.core),this.subscriber=new SGe(this,this.logger),this.publisher=new mGe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Ade,this.projectId=e.projectId,oFe()?this.packageName=QK():aFe()&&(this.bundleId=QK()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e==null?void 0:e.message))}get context(){return ya(this.logger)}get connected(){var e,n,r;return((r=(n=(e=this.provider)==null?void 0:e.connection)==null?void 0:n.socket)==null?void 0:r.readyState)===1||!1}get connecting(){var e,n,r;return((r=(n=(e=this.provider)==null?void 0:e.connection)==null?void 0:n.socket)==null?void 0:r.readyState)===0||this.connectPromise!==void 0||!1}async publish(e,n,r){this.isInitialized(),await this.publisher.publish(e,n,r),await this.recordMessageEvent({topic:e,message:n,publishedAt:Date.now(),transportType:Lr.relay},g8.outbound)}async subscribe(e,n){var r,i,s;this.isInitialized(),(!(n!=null&&n.transportType)||(n==null?void 0:n.transportType)==="relay")&&await this.toEstablishConnection();const o=typeof((r=n==null?void 0:n.internal)==null?void 0:r.throwOnFailedPublish)>"u"?!0:(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;let a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",c;const l=u=>{u.topic===e&&(this.subscriber.off(ka.created,l),c())};return await Promise.all([new Promise(u=>{c=u,this.subscriber.on(ka.created,l)}),new Promise(async(u,d)=>{a=await this.subscriber.subscribe(e,xZ({internal:{throwOnFailedPublish:o}},n)).catch(h=>{o&&d(h)})||a,u()})]),a}async unsubscribe(e,n){this.isInitialized(),await this.subscriber.unsubscribe(e,n)}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Hf(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(n,r)=>{await this.connect(e).then(n).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await UG())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const n=e.sort((r,i)=>r.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${n.length} message events sorted`);for(const r of n)try{await this.onMessageEvent(r)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+(i==null?void 0:i.message))}this.logger.trace(`Batch of ${n.length} message events processed`)}async onLinkMessageEvent(e,n){const{topic:r}=e;if(!n.sessionExists){const i=Zi(Pt.FIVE_MINUTES),s={topic:r,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,s)}this.events.emit(ls.message,e),await this.recordMessageEvent(e,g8.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let n=1;for(;n<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${n}...`),await this.createProvider(),await new Promise(async(r,i)=>{const s=()=>{i(new Error("Connection interrupted while trying to connect"))};this.provider.once(Qa.disconnect,s),await Hf(new Promise((o,a)=>{this.provider.connect().then(o).catch(a)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{i(o)}).finally(()=>{this.provider.off(Qa.disconnect,s),clearTimeout(this.reconnectTimeout)}),await new Promise(async(o,a)=>{const c=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Qa.disconnect,c),await this.subscriber.start().then(o).catch(a).finally(()=>{this.provider.off(Qa.disconnect,c)})}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){await this.subscriber.stop();const i=r;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${n}`);break}await new Promise(r=>setTimeout(r,Pt.toMiliseconds(n*1))),n++}}startPingTimeout(){var e,n,r,i,s;if(f9())try{(n=(e=this.provider)==null?void 0:e.connection)!=null&&n.socket&&((s=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o,o==null?void 0:o.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Rc(new KVe(hFe({sdkVersion:QM,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,n){const{topic:r,message:i}=e;await this.messages.set(r,i,n)}async shouldIgnoreMessageEvent(e){const{topic:n,message:r}=e;if(!r||r.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(n))return this.logger.warn(`Ignoring message for unknown topic ${n}`),!0;const i=this.messages.has(n,r);return i&&this.logger.warn(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),OL(e)){if(!e.method.endsWith(oqe))return;const n=e.params,{topic:r,message:i,publishedAt:s,attestation:o}=n.data,a={topic:r,message:i,publishedAt:s,transportType:Lr.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(xZ({type:"event",event:n.id},a)),this.events.emit(n.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else s_(e)&&this.events.emit(ls.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,g8.inbound),this.events.emit(ls.message,e))}async acknowledgePayload(e){const n=r_(e.id,!0);await this.provider.connection.send(n)}unregisterProviderListeners(){this.provider.off(Qa.payload,this.onPayloadHandler),this.provider.off(Qa.connect,this.onConnectHandler),this.provider.off(Qa.disconnect,this.onDisconnectHandler),this.provider.off(Qa.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await UG();JWe(async n=>{e!==n&&(e=n,n?await this.transportOpen().catch(r=>this.logger.error(r,r==null?void 0:r.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(F1.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&nHe())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(n){this.logger.warn(n,n==null?void 0:n.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(ls.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e==null?void 0:e.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},Pt.toMiliseconds(aqe)))))}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}};function TGe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function EZ(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function CZ(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const PGe="[object RegExp]",RGe="[object String]",MGe="[object Number]",OGe="[object Boolean]",_Z="[object Arguments]",jGe="[object Symbol]",NGe="[object Date]",DGe="[object Map]",LGe="[object Set]",BGe="[object Array]",FGe="[object Function]",UGe="[object ArrayBuffer]",eI="[object Object]",zGe="[object Error]",WGe="[object DataView]",HGe="[object Uint8Array]",VGe="[object Uint8ClampedArray]",qGe="[object Uint16Array]",KGe="[object Uint32Array]",GGe="[object BigUint64Array]",ZGe="[object Int8Array]",YGe="[object Int16Array]",QGe="[object Int32Array]",XGe="[object BigInt64Array]",JGe="[object Float32Array]",eZe="[object Float64Array]";function tZe(){}function SZ(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function nZe(t,e,n){return qv(t,e,void 0,void 0,void 0,void 0,n)}function qv(t,e,n,r,i,s,o){const a=o(t,e,n,r,i,s);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return mb(t,e,s,o)}return mb(t,e,s,o)}function mb(t,e,n,r){if(Object.is(t,e))return!0;let i=CZ(t),s=CZ(e);if(i===_Z&&(i=eI),s===_Z&&(s=eI),i!==s)return!1;switch(i){case RGe:return t.toString()===e.toString();case MGe:{const c=t.valueOf(),l=e.valueOf();return TGe(c,l)}case OGe:case NGe:case jGe:return Object.is(t.valueOf(),e.valueOf());case PGe:return t.source===e.source&&t.flags===e.flags;case FGe:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case DGe:{if(t.size!==e.size)return!1;for(const[c,l]of t.entries())if(!e.has(c)||!qv(l,e.get(c),c,t,e,n,r))return!1;return!0}case LGe:{if(t.size!==e.size)return!1;const c=Array.from(t.values()),l=Array.from(e.values());for(let u=0;u<c.length;u++){const d=c[u],h=l.findIndex(f=>qv(d,f,void 0,t,e,n,r));if(h===-1)return!1;l.splice(h,1)}return!0}case BGe:case HGe:case VGe:case qGe:case KGe:case GGe:case ZGe:case YGe:case QGe:case XGe:case JGe:case eZe:{if(typeof Buffer<"u"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let c=0;c<t.length;c++)if(!qv(t[c],e[c],c,t,e,n,r))return!1;return!0}case UGe:return t.byteLength!==e.byteLength?!1:mb(new Uint8Array(t),new Uint8Array(e),n,r);case WGe:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:mb(new Uint8Array(t),new Uint8Array(e),n,r);case zGe:return t.name===e.name&&t.message===e.message;case eI:{if(!(mb(t.constructor,e.constructor,n,r)||SZ(t)&&SZ(e)))return!1;const c=[...Object.keys(t),...EZ(t)],l=[...Object.keys(e),...EZ(e)];if(c.length!==l.length)return!1;for(let u=0;u<c.length;u++){const d=c[u],h=t[d];if(!Object.hasOwn(e,d))return!1;const f=e[d];if(!qv(h,f,d,t,e,n,r))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function rZe(t,e){return nZe(t,e,tZe)}var iZe=Object.defineProperty,AZ=Object.getOwnPropertySymbols,sZe=Object.prototype.hasOwnProperty,oZe=Object.prototype.propertyIsEnumerable,iO=(t,e,n)=>e in t?iZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,kZ=(t,e)=>{for(var n in e||(e={}))sZe.call(e,n)&&iO(t,n,e[n]);if(AZ)for(var n of AZ(e))oZe.call(e,n)&&iO(t,n,e[n]);return t},Vo=(t,e,n)=>iO(t,typeof e!="symbol"?e+"":e,n);let z1=class extends gVe{constructor(e,n,r,i=Nu,s=void 0){super(e,n,r,i),this.core=e,this.logger=n,this.name=r,Vo(this,"map",new Map),Vo(this,"version",cqe),Vo(this,"cached",[]),Vo(this,"initialized",!1),Vo(this,"getKey"),Vo(this,"storagePrefix",Nu),Vo(this,"recentlyDeleted",[]),Vo(this,"recentlyDeletedLimit",200),Vo(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!Ms(o)?this.map.set(this.getKey(o),o):TWe(o)?this.map.set(o.id,o):PWe(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)}),Vo(this,"set",async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())}),Vo(this,"get",o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o))),Vo(this,"getAll",o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>rZe(a[c],o[c]))):this.values)),Vo(this,"update",async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=kZ(kZ({},this.getData(o)),a);this.map.set(o,c),await this.persist()}),Vo(this,"delete",async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())}),this.logger=jo(n,this.name),this.storagePrefix=i,this.getKey=s}get context(){return ya(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const n=this.map.get(e);if(!n){if(this.recentlyDeleted.includes(e)){const{message:i}=Tt("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:r}=Tt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(r),new Error(r)}return n}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:n}=Tt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var aZe=Object.defineProperty,cZe=(t,e,n)=>e in t?aZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vn=(t,e,n)=>cZe(t,typeof e!="symbol"?e+"":e,n);let lZe=class{constructor(e,n){this.core=e,this.logger=n,Vn(this,"name",hqe),Vn(this,"version",fqe),Vn(this,"events",new aL),Vn(this,"pairings"),Vn(this,"initialized",!1),Vn(this,"storagePrefix",Nu),Vn(this,"ignoredPayloadTypes",[Wd]),Vn(this,"registeredMethods",[]),Vn(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),Vn(this,"register",({methods:r})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...r])]}),Vn(this,"create",async r=>{this.isInitialized();const i=KM(),s=await this.core.crypto.setSymKey(i),o=Zi(Pt.FIVE_MINUTES),a={protocol:Sde},c={topic:s,expiry:o,relay:a,active:!1,methods:r==null?void 0:r.methods},l=RG({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:r==null?void 0:r.methods});return this.events.emit(c0.create,c),this.core.expirer.set(s,o),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:r==null?void 0:r.transportType}),{topic:s,uri:l}}),Vn(this,"pair",async r=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:r==null?void 0:r.uri,trace:[Jl.pairing_started]}});this.isValidPair(r,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:l}=PG(r.uri);i.props.properties.topic=s,i.addTrace(Jl.pairing_uri_validation_success),i.addTrace(Jl.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(s)){if(u=this.pairings.get(s),i.addTrace(Jl.existing_pairing),u.active)throw i.setError(pd.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(Jl.pairing_not_expired)}const d=c||Zi(Pt.FIVE_MINUTES),h={topic:s,relay:a,expiry:d,active:!1,methods:l};this.core.expirer.set(s,d),await this.pairings.set(s,h),i.addTrace(Jl.store_new_pairing),r.activatePairing&&await this.activate({topic:s}),this.events.emit(c0.create,h),i.addTrace(Jl.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(Jl.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(pd.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(f){throw i.setError(pd.subscribe_pairing_topic_failure),f}return i.addTrace(Jl.subscribe_pairing_topic_success),h}),Vn(this,"activate",async({topic:r})=>{this.isInitialized();const i=Zi(Pt.FIVE_MINUTES);this.core.expirer.set(r,i),await this.pairings.update(r,{active:!0,expiry:i})}),Vn(this,"ping",async r=>{this.isInitialized(),await this.isValidPing(r),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:i}=r;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=t0();this.events.once(ar("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}}),Vn(this,"updateExpiry",async({topic:r,expiry:i})=>{this.isInitialized(),await this.pairings.update(r,{expiry:i})}),Vn(this,"updateMetadata",async({topic:r,metadata:i})=>{this.isInitialized(),await this.pairings.update(r,{peerMetadata:i})}),Vn(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),Vn(this,"disconnect",async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:i}=r;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Br("USER_DISCONNECTED")),await this.deletePairing(i))}),Vn(this,"formatUriFromPairing",r=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=r,c=this.core.crypto.keychain.get(i);return RG({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:o,methods:a})}),Vn(this,"sendRequest",async(r,i,s)=>{const o=Vf(i,s),a=await this.core.crypto.encode(r,o),c=cv[i].req;return this.core.history.set(r,o),this.core.relayer.publish(r,a,c),o.id}),Vn(this,"sendResult",async(r,i,s)=>{const o=r_(r,s),a=await this.core.crypto.encode(i,o),c=(await this.core.history.get(i,r)).request.method,l=cv[c].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)}),Vn(this,"sendError",async(r,i,s)=>{const o=i_(r,s),a=await this.core.crypto.encode(i,o),c=(await this.core.history.get(i,r)).request.method,l=cv[c]?cv[c].res:cv.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)}),Vn(this,"deletePairing",async(r,i)=>{await this.core.relayer.unsubscribe(r),await Promise.all([this.pairings.delete(r,Br("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(r),i?Promise.resolve():this.core.expirer.del(r)])}),Vn(this,"cleanup",async()=>{const r=this.pairings.getAll().filter(i=>vf(i.expiry));await Promise.all(r.map(i=>this.deletePairing(i.topic)))}),Vn(this,"onRelayEventRequest",async r=>{const{topic:i,payload:s}=r;switch(s.method){case"wc_pairingPing":return await this.onPairingPingRequest(i,s);case"wc_pairingDelete":return await this.onPairingDeleteRequest(i,s);default:return await this.onUnknownRpcMethodRequest(i,s)}}),Vn(this,"onRelayEventResponse",async r=>{const{topic:i,payload:s}=r,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}}),Vn(this,"onPairingPingRequest",async(r,i)=>{const{id:s}=i;try{this.isValidPing({topic:r}),await this.sendResult(s,r,!0),this.events.emit(c0.ping,{id:s,topic:r})}catch(o){await this.sendError(s,r,o),this.logger.error(o)}}),Vn(this,"onPairingPingResponse",(r,i)=>{const{id:s}=i;setTimeout(()=>{su(i)?this.events.emit(ar("pairing_ping",s),{}):dc(i)&&this.events.emit(ar("pairing_ping",s),{error:i.error})},500)}),Vn(this,"onPairingDeleteRequest",async(r,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:r}),await this.deletePairing(r),this.events.emit(c0.delete,{id:s,topic:r})}catch(o){await this.sendError(s,r,o),this.logger.error(o)}}),Vn(this,"onUnknownRpcMethodRequest",async(r,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=Br("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,r,a),this.logger.error(a)}catch(a){await this.sendError(s,r,a),this.logger.error(a)}}),Vn(this,"onUnknownRpcMethodResponse",r=>{this.registeredMethods.includes(r)||this.logger.error(Br("WC_METHOD_UNSUPPORTED",r))}),Vn(this,"isValidPair",(r,i)=>{var s;if(!Zo(r)){const{message:a}=Tt("MISSING_OR_INVALID",`pair() params: ${r}`);throw i.setError(pd.malformed_pairing_uri),new Error(a)}if(!IWe(r.uri)){const{message:a}=Tt("MISSING_OR_INVALID",`pair() uri: ${r.uri}`);throw i.setError(pd.malformed_pairing_uri),new Error(a)}const o=PG(r==null?void 0:r.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=Tt("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(pd.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=Tt("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(pd.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&Pt.toMiliseconds(o==null?void 0:o.expiryTimestamp)<Date.now()){i.setError(pd.pairing_expired);const{message:a}=Tt("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(a)}}),Vn(this,"isValidPing",async r=>{if(!Zo(r)){const{message:s}=Tt("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(s)}const{topic:i}=r;await this.isValidPairingTopic(i)}),Vn(this,"isValidDisconnect",async r=>{if(!Zo(r)){const{message:s}=Tt("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(s)}const{topic:i}=r;await this.isValidPairingTopic(i)}),Vn(this,"isValidPairingTopic",async r=>{if(!Bi(r,!1)){const{message:i}=Tt("MISSING_OR_INVALID",`pairing topic should be a string: ${r}`);throw new Error(i)}if(!this.pairings.keys.includes(r)){const{message:i}=Tt("NO_MATCHING_KEY",`pairing topic doesn't exist: ${r}`);throw new Error(i)}if(vf(this.pairings.get(r).expiry)){await this.deletePairing(r);const{message:i}=Tt("EXPIRED",`pairing topic: ${r}`);throw new Error(i)}}),this.core=e,this.logger=jo(n,this.name),this.pairings=new z1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return ya(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(ls.message,async e=>{const{topic:n,message:r,transportType:i}=e;if(this.pairings.keys.includes(n)&&i!==Lr.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{const s=await this.core.crypto.decode(n,r);OL(s)?(this.core.history.set(n,s),await this.onRelayEventRequest({topic:n,payload:s})):s_(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:n,payload:s}),this.core.history.delete(n,s.id)),await this.core.relayer.messages.ack(n,r)}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(sc.expired,async e=>{const{topic:n}=Eue(e.target);n&&this.pairings.keys.includes(n)&&(await this.deletePairing(n,!0),this.events.emit(c0.expire,{topic:n}))})}};var uZe=Object.defineProperty,dZe=(t,e,n)=>e in t?uZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Cs=(t,e,n)=>dZe(t,typeof e!="symbol"?e+"":e,n);let hZe=class extends dVe{constructor(e,n){super(e,n),this.core=e,this.logger=n,Cs(this,"records",new Map),Cs(this,"events",new Wa.EventEmitter),Cs(this,"name",pqe),Cs(this,"version",gqe),Cs(this,"cac
148hed",[]),Cs(this,"initialized",!1),Cs(this,"storagePrefix",Nu),Cs(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.records.set(r.id,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Cs(this,"set",(r,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:r,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:r,request:{method:i.method,params:i.params||null},chainId:s,expiry:Zi(Pt.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(Hc.created,o)}),Cs(this,"resolve",async r=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:r}),!this.records.has(r.id))return;const i=await this.getRecord(r.id);typeof i.response>"u"&&(i.response=dc(r)?{error:r.error}:{result:r.result},this.records.set(i.id,i),this.persist(),this.events.emit(Hc.updated,i))}),Cs(this,"get",async(r,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:r,id:i}),await this.getRecord(i))),Cs(this,"delete",(r,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===r){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(Hc.deleted,s)}}),this.persist()}),Cs(this,"exists",async(r,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===r:!1)),Cs(this,"on",(r,i)=>{this.events.on(r,i)}),Cs(this,"once",(r,i)=>{this.events.once(r,i)}),Cs(this,"off",(r,i)=>{this.events.off(r,i)}),Cs(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.logger=jo(n,this.name)}get context(){return ya(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(n=>{if(typeof n.response<"u")return;const r={topic:n.topic,request:Vf(n.request.method,n.request.params,n.id),chainId:n.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const n=this.records.get(e);if(!n){const{message:r}=Tt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(r)}return n}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Hc.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:n}=Tt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Hc.created,e=>{const n=Hc.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.events.on(Hc.updated,e=>{const n=Hc.updated;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.events.on(Hc.deleted,e=>{const n=Hc.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.core.heartbeat.on(F1.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(n=>{Pt.toMiliseconds(n.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${n.id}`),this.records.delete(n.id),this.events.emit(Hc.deleted,n,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var fZe=Object.defineProperty,pZe=(t,e,n)=>e in t?fZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,to=(t,e,n)=>pZe(t,typeof e!="symbol"?e+"":e,n);let gZe=class extends yVe{constructor(e,n){super(e,n),this.core=e,this.logger=n,to(this,"expirations",new Map),to(this,"events",new Wa.EventEmitter),to(this,"name",mqe),to(this,"version",yqe),to(this,"cac
148hed",[]),to(this,"initialized",!1),to(this,"storagePrefix",Nu),to(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.expirations.set(r.target,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),to(this,"has",r=>{try{const i=this.formatTarget(r);return typeof this.getExpiration(i)<"u"}catch{return!1}}),to(this,"set",(r,i)=>{this.isInitialized();const s=this.formatTarget(r),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(sc.created,{target:s,expiration:o})}),to(this,"get",r=>{this.isInitialized();const i=this.formatTarget(r);return this.getExpiration(i)}),to(this,"del",r=>{if(this.isInitialized(),this.has(r)){const i=this.formatTarget(r),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(sc.deleted,{target:i,expiration:s})}}),to(this,"on",(r,i)=>{this.events.on(r,i)}),to(this,"once",(r,i)=>{this.events.once(r,i)}),to(this,"off",(r,i)=>{this.events.off(r,i)}),to(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.logger=jo(n,this.name)}get context(){return ya(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return fFe(e);if(typeof e=="number")return pFe(e);const{message:n}=Tt("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(n)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(sc.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:n}=Tt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const n=this.expirations.get(e);if(!n){const{message:r}=Tt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(r),new Error(r)}return n}checkExpiry(e,n){const{expiry:r}=n;Pt.toMiliseconds(r)-Date.now()<=0&&this.expire(e,n)}expire(e,n){this.expirations.delete(e),this.events.emit(sc.expired,{target:e,expiration:n})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,n)=>this.checkExpiry(n,e))}registerEventListeners(){this.core.heartbeat.on(F1.pulse,()=>this.checkExpirations()),this.events.on(sc.created,e=>{const n=sc.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()}),this.events.on(sc.expired,e=>{const n=sc.expired;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()}),this.events.on(sc.deleted,e=>{const n=sc.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var mZe=Object.defineProperty,yZe=(t,e,n)=>e in t?mZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ri=(t,e,n)=>yZe(t,typeof e!="symbol"?e+"":e,n);let wZe=class extends wVe{constructor(e,n,r){super(e,n,r),this.core=e,this.logger=n,this.store=r,Ri(this,"name",wqe),Ri(this,"abortController"),Ri(this,"isDevEnv"),Ri(this,"verifyUrlV3",bqe),Ri(this,"storagePrefix",Nu),Ri(this,"version",_de),Ri(this,"publicKey"),Ri(this,"fetchPromise"),Ri(this,"init",async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Pt.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),Ri(this,"register",async i=>{if(!N2()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const l=eh.getDocument(),u=this.startAbortTimer(Pt.ONE_SECOND*5),d=await new Promise((h,f)=>{const m=()=>{window.removeEventListener("message",v),l.body.removeChild(y),f("attestation aborted")};this.abortController.signal.addEventListener("abort",m);const y=l.createElement("iframe");y.src=c,y.style.display="none",y.addEventListener("error",m,{signal:this.abortController.signal});const v=b=>
vendor: 71,620 bytes, line 148
148{if(b.data&&typeof b.data=="string")try{const C=JSON.parse(b.data);if(C.type==="verify_attestation"){if(OM(C.attestation).payload.id!==o)return;clearInterval(u),l.body.removeChild(y),this.abortController.signal.removeEventListener("abort",m),window.removeEventListener("message",v),h(C.attestation===null?"":C.attestation)}}catch(C){this.logger.warn(C)}};l.body.appendChild(y),window.addEventListener("message",v,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",d),d}catch(l){this.logger.warn(l)}return""}),Ri(this,"resolve",async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(OM(s).payload.id!==a)return;const l=await this.isValidJwtAttestation(s);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!o)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,c)}),Ri(this,"fetchAttestation",async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(Pt.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0}),Ri(this,"getVerifyUrl",i=>{let s=i||gb;return xqe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${gb}`),s=gb),s}),Ri(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(Pt.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}}),Ri(this,"persistPublicKey",async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i}),Ri(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),Ri(this,"isValidJwtAttestation",async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}}),Ri(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),Ri(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i}),Ri(this,"validateAttestation",(i,s)=>{const o=cWe(i,s.publicKey),a={hasExpired:Pt.toMiliseconds(o.exp)<Date.now(),payload:o};if(a.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:a.payload.origin,isScam:a.payload.isScam,isVerified:a.payload.isVerified}}),this.logger=jo(n,this.name),this.abortController=new AbortController,this.isDevEnv=wL(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return ya(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Pt.toMiliseconds(e))}};var vZe=Object.defineProperty,bZe=(t,e,n)=>e in t?vZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$Z=(t,e,n)=>bZe(t,typeof e!="symbol"?e+"":e,n);let xZe=class extends vVe{constructor(e,n){super(e,n),this.projectId=e,this.logger=n,$Z(this,"context",Eqe),$Z(this,"registerDeviceToken",async r=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=r,c=`${Cqe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})}),this.logger=jo(n,this.context)}};var EZe=Object.defineProperty,IZ=Object.getOwnPropertySymbols,CZe=Object.prototype.hasOwnProperty,_Ze=Object.prototype.propertyIsEnumerable,sO=(t,e,n)=>e in t?EZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,dv=(t,e)=>{for(var n in e||(e={}))CZe.call(e,n)&&sO(t,n,e[n]);if(IZ)for(var n of IZ(e))_Ze.call(e,n)&&sO(t,n,e[n]);return t},es=(t,e,n)=>sO(t,typeof e!="symbol"?e+"":e,n);let SZe=class extends bVe{constructor(e,n,r=!0){super(e,n,r),this.core=e,this.logger=n,es(this,"context",Sqe),es(this,"storagePrefix",Nu),es(this,"storageVersion",_qe),es(this,"events",new Map),es(this,"shouldPersist",!1),es(this,"init",async()=>{if(!wL())try{const i={eventId:JK(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:bue(this.core.relayer.protocol,this.core.relayer.version,QM)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}}),es(this,"createEvent",i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,l=JK(),u=this.core.projectId||"",d=Date.now(),h=dv({eventId:l,timestamp:d,props:{event:s,type:o,properties:{topic:a,trace:c}},bundleId:u,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,h),this.shouldPersist=!0),h}),es(this,"getEvent",i=>{const{eventId:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return dv(dv({},a),this.setMethods(a.eventId))}),es(this,"deleteEvent",i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0}),es(this,"setEventListeners",()=>{this.core.heartbeat.on(F1.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{Pt.fromMiliseconds(Date.now())-Pt.fromMiliseconds(i.timestamp)>Aqe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})}),es(this,"setMethods",i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)})),es(this,"addTrace",(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)}),es(this,"setError",(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)}),es(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),es(this,"restore",async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,dv(dv({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}}),es(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}}),es(this,"sendEvent",async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${kqe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${QM}${s}`,{method:"POST",body:JSON.stringify(i)})}),es(this,"getAppDomain",()=>vue().url),this.logger=jo(n,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}};var AZe=Object.defineProperty,TZ=Object.getOwnPropertySymbols,kZe=Object.prototype.hasOwnProperty,$Ze=Object.prototype.propertyIsEnumerable,oO=(t,e,n)=>e in t?AZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,PZ=(t,e)=>{for(var n in e||(e={}))kZe.call(e,n)&&oO(t,n,e[n]);if(TZ)for(var n of TZ(e))$Ze.call(e,n)&&oO(t,n,e[n]);return t},$r=(t,e,n)=>oO(t,typeof e!="symbol"?e+"":e,n);let IZe=class Bde extends aVe{constructor(e){var n;super(e),$r(this,"protocol",Cde),$r(this,"version",_de),$r(this,"name",YM),$r(this,"relayUrl"),$r(this,"projectId"),$r(this,"customStoragePrefix"),$r(this,"events",new Wa.EventEmitter),$r(this,"logger"),$r(this,"heartbeat"),$r(this,"relayer"),$r(this,"crypto"),$r(this,"storage"),$r(this,"history"),$r(this,"expirer"),$r(this,"pairing"),$r(this,"verify"),$r(this,"echoClient"),$r(this,"linkModeSupportedApps"),$r(this,"eventClient"),$r(this,"initialized",!1),$r(this,"logChunkController"),$r(this,"on",(a,c)=>this.events.on(a,c)),$r(this,"once",(a,c)=>this.events.once(a,c)),$r(this,"off",(a,c)=>this.events.off(a,c)),$r(this,"removeListener",(a,c)=>this.events.removeListener(a,c)),$r(this,"dispatchEnvelope",({topic:a,message:c,sessionExists:l})=>{if(!a||!c)return;const u={topic:a,message:c,publishedAt:Date.now(),transportType:Lr.link_mode};this.relayer.onLinkMessageEvent(u,{sessionExists:l})});const r=this.getGlobalCore(e==null?void 0:e.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(a){console.warn("Failed to copy global core",a)}this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Ade,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=n_({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:ZVe.logger,name:YM}),{logger:s,chunkLoggerController:o}=iVe({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=o,(n=this.logChunkController)!=null&&n.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,c;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((c=this.logChunkController)==null||c.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=jo(s,this.name),this.heartbeat=new hHe,this.crypto=new nGe(this,this.logger,e==null?void 0:e.keychain),this.history=new hZe(this,this.logger),this.expirer=new gZe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new UHe(PZ(PZ({},YVe),e==null?void 0:e.storageOptions)),this.relayer=new IGe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new lZe(this,this.logger),this.verify=new wZe(this,this.logger,this.storage),this.echoClient=new xZe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new SZe(this,this.logger,e==null?void 0:e.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const n=new Bde(e);await n.initialize();const r=await n.crypto.getClientId();return await n.storage.setItem(lqe,r),n}get context(){return ya(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(uZ,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(uZ)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const n=`_walletConnectCore_${e}`,r=`${n}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[n]}catch(n){console.warn("Failed to get global WalletConnect core",n);return}}setGlobalCore(e){var n;try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${((n=e.opts)==null?void 0:n.customStoragePrefix)||""}`;globalThis[r]=e}catch(r){console.warn("Failed to set global WalletConnect core",r)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&GVe.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}};const TZe=IZe,Fde="wc",Ude=2,zde="client",jL=`${Fde}@${Ude}:${zde}:`,tI={name:zde,logger:"error"},RZ="WALLETCONNECT_DEEPLINK_CHOICE",PZe="proposal",MZ="Proposal expired",RZe="session",Yg=Pt.SEVEN_DAYS,MZe="engine",ts={wc_sessionPropose:{req:{ttl:Pt.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Pt.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Pt.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Pt.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Pt.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Pt.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Pt.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Pt.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Pt.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Pt.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Pt.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Pt.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Pt.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Pt.FIVE_MINUTES,prompt:!1,tag:1119}}},nI={min:Pt.FIVE_MINUTES,max:Pt.SEVEN_DAYS},Vl={idle:"IDLE",active:"ACTIVE"},OZe={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},jZe="request",NZe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],DZe="wc",LZe="auth",BZe="authKeys",FZe="pairingTopics",UZe="requests",a_=`${DZe}@${1.5}:${LZe}:`,m8=`${a_}:PUB_KEY`;var zZe=Object.defineProperty,WZe=Object.defineProperties,HZe=Object.getOwnPropertyDescriptors,OZ=Object.getOwnPropertySymbols,VZe=Object.prototype.hasOwnProperty,qZe=Object.prototype.propertyIsEnumerable,aO=(t,e,n)=>e in t?zZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,jr=(t,e)=>{for(var n in e||(e={}))VZe.call(e,n)&&aO(t,n,e[n]);if(OZ)for(var n of OZ(e))qZe.call(e,n)&&aO(t,n,e[n]);return t},qo=(t,e)=>WZe(t,HZe(e)),ht=(t,e,n)=>aO(t,typeof e!="symbol"?e+"":e,n);let KZe=class extends _Ve{constructor(e){super(e),ht(this,"name",MZe),ht(this,"events",new aL),ht(this,"initialized",!1),ht(this,"requestQueue",{state:Vl.idle,queue:[]}),ht(this,"sessionRequestQueue",{state:Vl.idle,queue:[]}),ht(this,"emittedSessionRequests",new CFe({limit:500})),ht(this,"requestQueueDelay",Pt.ONE_SECOND),ht(this,"expectedPairingMethodMap",new Map),ht(this,"recentlyDeletedMap",new Map),ht(this,"recentlyDeletedLimit",200),ht(this,"relayMessageCache",[]),ht(this,"pendingSessions",new Map),ht(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(ts)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Pt.toMiliseconds(this.requestQueueDelay)))}),ht(this,"connect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const r=qo(jr({},n),{requiredNamespaces:n.requiredNamespaces||{},optionalNamespaces:n.optionalNamespaces||{}});await this.isValidConnect(r),r.optionalNamespaces=_We(r.requiredNamespaces,r.optionalNamespaces),r.requiredNamespaces={};const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,scopedProperties:c,relays:l}=r;let u=i,d,h=!1;try{if(u){const I=this.client.core.pairing.pairings.get(u);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),h=I.active}}catch(I){throw this.client.logger.error(`connect() -> pairing.get(${u}) failed`),I}if(!u||!h){const{topic:I,uri:R}=await this.client.core.pairing.create();u=I,d=R}if(!u){const{message:I}=Tt("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw new Error(I)}const f=await this.client.core.crypto.generateKeyPair(),m=ts.wc_sessionPropose.req.ttl||Pt.FIVE_MINUTES,y=Zi(m),v=qo(jr(jr({requiredNamespaces:s,optionalNamespaces:o,relays:l??[{protocol:Sde}],proposer:{publicKey:f,metadata:this.client.metadata},expiryTimestamp:y,pairingTopic:u},a&&{sessionProperties:a}),c&&{scopedProperties:c}),{id:iu()}),b=ar("session_connect",v.id),{reject:C,resolve:x,done:_}=t0(m,MZ),$=({id:I})=>{I===v.id&&(this.client.events.off("proposal_expire",$),this.pendingSessions.delete(v.id),this.events.emit(b,{error:{message:MZ,code:0}}))};return this.client.events.on("proposal_expire",$),this.events.once(b,({error:I,session:R})=>{this.client.events.off("proposal_expire",$),I?C(I):R&&x(R)}),await this.sendRequest({topic:u,method:"wc_sessionPropose",params:v,throwOnFailedPublish:!0,clientRpcId:v.id}),await this.setProposal(v.id,v),{uri:d,approval:_}}),ht(this,"pair",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(n)}catch(r){throw this.client.logger.error("pair() failed"),r}}),ht(this,"approve",async n=>{var r,i,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(r=n==null?void 0:n.id)==null?void 0:r.toString(),trace:[Vc.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(T){throw o.setError(Yp.no_internet_connection),T}try{await this.isValidProposalId(n==null?void 0:n.id)}catch(T){throw this.client.logger.error(`approve() -> proposal.get(${n==null?void 0:n.id}) failed`),o.setError(Yp.proposal_not_found),T}try{await this.isValidApprove(n)}catch(T){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(Yp.session_approve_namespace_validation_failure),T}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:h}=n,f=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:m,proposer:y,requiredNamespaces:v,optionalNamespaces:b}=f;let C=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:m});C||(C=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Vc.session_approve_started,properties:{topic:m,trace:[Vc.session_approve_started,Vc.session_namespaces_validation_success]}}));const x=await this.client.core.crypto.generateKeyPair(),_=y.publicKey,$=await this.client.core.crypto.generateSharedKey(x,_),I=jr(jr(jr({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:x,metadata:this.client.metadata},expiry:Zi(Yg)},u&&{sessionProperties:u}),d&&{scopedProperties:d}),h&&{sessionConfig:h}),R=Lr.relay;C.addTrace(Vc.subscribing_session_topic);try{await this.client.core.relayer.subscribe($,{transportType:R})}catch(T){throw C.setError(Yp.subscribe_session_topic_failure),T}C.addTrace(Vc.subscribe_session_topic_success);const N=qo(jr({},I),{topic:$,requiredNamespaces:v,optionalNamespaces:b,pairingTopic:m,acknowledged:!1,self:I.controller,peer:{publicKey:y.publicKey,metadata:y.metadata},controller:x,transportType:Lr.relay});await this.client.session.set($,N),C.addTrace(Vc.store_session);try{C.addTrace(Vc.publishing_session_settle),await this.sendRequest({topic:$,method:"wc_sessionSettle",params:I,throwOnFailedPublish:!0}).catch(T=>{throw C==null||C.setError(Yp.session_settle_publish_failure),T}),C.addTrace(Vc.session_settle_publish_success),C.addTrace(Vc.publishing_session_approve),await this.sendResult({id:a,topic:m,result:{relay:{protocol:c??"irn"},responderPublicKey:x},throwOnFailedPublish:!0}).catch(T=>{throw C==null||C.setError(Yp.session_approve_publish_failure),T}),C.addTrace(Vc.session_approve_publish_success)}catch(T){throw this.client.logger.error(T),this.client.session.delete($,Br("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe($),T}return this.client.core.eventClient.deleteEvent({eventId:C.eventId}),await this.client.core.pairing.updateMetadata({topic:m,metadata:y.metadata}),await this.deleteProposal(a),await this.client.core.pairing.activate({topic:m}),await this.setExpiry($,Zi(Yg)),{topic:$,acknowledged:()=>Promise.resolve(this.client.session.get($))}}),ht(this,"reject",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(n)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:r,reason:i}=n;let s;try{s=this.client.proposal.get(r).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),o}s&&await this.sendError({id:r,topic:s,error:i,rpcOpts:ts.wc_sessionPropose.reject}),await this.deleteProposal(r)}),ht(this,"update",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(n)}catch(d){throw this.client.logger.error("update() -> isValidUpdate() failed"),d}const{topic:r,namespaces:i}=n,{done:s,resolve:o,reject:a}=t0(),c=iu(),l=E0().toString(),u=this.client.session.get(r).namespaces;return this.events.once(ar("session_update",c),({error:d})=>{d?a(d):o()}),await this.client.session.update(r,{namespaces:i}),await this.sendRequest({topic:r,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(d=>{this.client.logger.error(d),this.client.session.update(r,{namespaces:u}),a(d)}),{acknowledged:s}}),ht(this,"extend",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(n)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:r}=n,i=iu(),{done:s,resolve:o,reject:a}=t0();return this.events.once(ar("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(r,Zi(Yg)),this.sendRequest({topic:r,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}}),ht(this,"request",async n=>{this.isInitialized();try{await this.isValidRequest(n)}catch(v){throw this.client.logger.error("request() -> isValidRequest() failed"),v}const{chainId:r,request:i,topic:s,expiry:o=ts.wc_sessionRequest.req.ttl}=n,a=this.client.session.get(s);(a==null?void 0:a.transportType)===Lr.relay&&await this.confirmOnlineStateOrThrow();const c=iu(),l=E0().toString(),{done:u,resolve:d,reject:h}=t0(o,"Request expired. Please try again.");this.events.once(ar("session_request",c),({error:v,result:b})=>{v?h(v):d(b)});const f="wc_sessionRequest",m=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(m)return await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:f,params:{request:qo(jr({},i),{expiryTimestamp:Zi(o)}),chainId:r},expiry:o,throwOnFailedPublish:!0,appLink:m}).catch(v=>h(v)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:r,id:c}),await u();const y={request:qo(jr({},i),{expiryTimestamp:Zi(o)}),chainId:r};return await Promise.all([new Promise(async v=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:f,params:y,expiry:o,throwOnFailedPublish:!0,tvf:this.getTVFParams(c,y)}).catch(b=>h(b)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:r,id:c}),v()}),new Promise(async v=>{var b;if(!((b=a.sessionConfig)!=null&&b.disableDeepLink)){const C=await wFe(this.client.core.storage,RZ);await gFe({id:c,topic:s,wcDeepLink:C})}v()}),u()]).then(v=>v[2])}),ht(this,"respond",async n=>{this.isInitialized(),await this.isValidRespond(n);const{topic:r,response:i}=n,{id:s}=i,o=this.client.session.get(r);o.transportType===Lr.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);su(i)?await this.sendResult({id:s,topic:r,result:i.result,throwOnFailedPublish:!0,appLink:a}):dc(i)&&await this.sendError({id:s,topic:r,error:i.error,appLink:a}),this.cleanupAfterResponse(n)}),ht(this,"ping",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(n)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:r}=n;if(this.client.session.keys.includes(r)){const i=iu(),s=E0().toString(),{done:o,resolve:a,reject:c}=t0();this.events.once(ar("session_ping",i),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:r,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(r)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:r}))}),ht(this,"emit",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(n);const{topic:r,event:i,chainId:s}=n,o=E0().toString(),a=iu();await this.sendRequest({topic:r,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:a})}),ht(this,"disconnect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(n);const{topic:r}=n;if(this.client.session.keys.includes(r))await this.sendRequest({topic:r,method:"wc_sessionDelete",params:Br("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:r,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(r))await this.client.core.pairing.disconnect({topic:r});else{const{message:i}=Tt("MISMATCHED_TOPIC",`Session or pairing topic not found: ${r}`);throw new Error(i)}}),ht(this,"find",n=>(this.isInitialized(),this.client.session.getAll().filter(r=>kWe(r,n)))),ht(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),ht(this,"authenticate",async(n,r)=>{var i;this.isInitialized(),this.isValidAuthenticate(n);const s=r&&this.client.core.linkModeSupportedApps.includes(r)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?Lr.link_mode:Lr.relay;o===Lr.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:u,nonce:d,type:h,exp:f,nbf:m,methods:y=[],expiry:v}=n,b=[...n.resources||[]],{topic:C,uri:x}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:C,uri:x}});const _=await this.client.core.crypto.generateKeyPair(),$=h8(_);if(await Promise.all([this.client.auth.authKeys.set(m8,{responseTopic:$,publicKey:_}),this.client.auth.pairingTopics.set($,{topic:$,pairingTopic:C})]),await this.client.core.relayer.subscribe($,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${C}`),y.length>0){const{namespace:D}=Qm(a[0]);let V=OUe(D,"request",y);d8(b)&&(V=NUe(V,b.pop())),b.push(V)}const I=v&&v>ts.wc_sessionAuthenticate.req.ttl?v:ts.wc_sessionAuthenticate.req.ttl,R={authPayload:{type:h??"caip122",chains:a,statement:c,aud:l,domain:u,version:"1",nonce:d,iat:new Date().toISOString(),exp:f,nbf:m,resources:b},requester:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Zi(I)},N={eip155:{chains:a,methods:[...new Set(["personal_sign",...y])],events:["chainChanged","accountsChanged"]}},T={requiredNamespaces:{},optionalNamespaces:N,relays:[{protocol:"irn"}],pairingTopic:C,proposer:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Zi(ts.wc_sessionPropose.req.ttl),id:iu()},{done:O,resolve:U,reject:z}=t0(I,"Request expired"),L=iu(),S=ar("session_connect",T.id),k=ar("session_request",L),M=async({error:D,session:V})=>{this.events.off(k,W),D?z(D):V&&U({session:V})},W=async D=>{var V,B,P;if(await this.deletePendingAuthRequest(L,{message:"fulfilled",code:0}),D.error){const de=Br("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return D.error.code===de.code?void 0:(this.events.off(S,M),z(D.error.message))}await this.deleteProposal(T.id),this.events.off(S,M);const{cacaos:j,responder:G}=D.result,Y=[],te=[];for(const de of j){await uG({cacao:de,projectId:this.client.core.projectId})||(this.client.logger.error(de,"Signature verification failed"),z(Br("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ke}=de,Be=d8(ke.resources),$e=[LM(ke.iss)],He=p9(ke.iss);if(Be){const Ge=dG(Be),je=hG(Be);Y.push(...Ge),$e.push(...je)}for(const Ge of $e)te.push(`${Ge}:${He}`)}const ae=await this.client.core.crypto.generateSharedKey(_,G.publicKey);let oe;Y.length>0&&(oe={topic:ae,acknowledged:!0,self:{publicKey:_,metadata:this.client.metadata},peer:G,controller:G.publicKey,expiry:Zi(Yg),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:C,namespaces:NG([...new Set(Y)],[...new Set(te)]),transportType:o},await this.client.core.relayer.subscribe(ae,{transportType:o}),await this.client.session.set(ae,oe),C&&await this.client.core.pairing.updateMetadata({topic:C,metadata:G.metadata}),oe=this.client.session.get(ae)),(V=this.client.metadata.redirect)!=null&&V.linkMode&&(B=G.metadata.redirect)!=null&&B.linkMode&&(P=G.metadata.redirect)!=null&&P.universal&&r&&(this.client.core.addLinkModeSupportedApp(G.metadata.redirect.universal),this.client.session.update(ae,{transportType:Lr.link_mode})),U({auths:j,session:oe})};this.events.once(S,M),this.events.once(k,W);let H;try{if(s){const D=Vf("wc_sessionAuthenticate",R,L);this.client.core.history.set(C,D);const V=await this.client.core.crypto.encode("",D,{type:M5,encoding:Cf});H=J4(r,C,V)}else await Promise.all([this.sendRequest({topic:C,method:"wc_sessionAuthenticate",params:R,expiry:n.expiry,throwOnFailedPublish:!0,clientRpcId:L}),this.sendRequest({topic:C,method:"wc_sessionPropose",params:T,expiry:ts.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:T.id})])}catch(D){throw this.events.off(S,M),this.events.off(k,W),D}return await this.setProposal(T.id,T),await this.setAuthRequest(L,{request:qo(jr({},R),{verifyContext:{}}),pairingTopic:C,transportType:o}),{uri:H??x,response:O}}),ht(this,"approveSessionAuthenticate",async n=>{const{id:r,auths:i}=n,s=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[Qp.authenticated_session_approve_started]}});try{this.isInitialized()}catch(v){throw s.setError(lv.no_internet_connection),v}const o=this.getPendingAuthRequest(r);if(!o)throw s.setError(lv.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${r}`);const a=o.transportType||Lr.relay;a===Lr.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),u=h8(c),d={type:Wd,receiverPublicKey:c,senderPublicKey:l},h=[],f=[];for(const v of i){if(!await uG({cacao:v,projectId:this.client.core.projectId})){s.setError(lv.invalid_cacao);const $=Br("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:r,topic:u,error:$,encodeOpts:d}),new Error($.message)}s.addTrace(Qp.cacaos_verified);const{p:b}=v,C=d8(b.resources),x=[LM(b.iss)],_=p9(b.iss);if(C){const $=dG(C),I=hG(C);h.push(...$),x.push(...I)}for(const $ of x)f.push(`${$}:${_}`)}const m=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(Qp.create_authenticated_session_topic);let y;if((h==null?void 0:h.length)>0){y={topic:m,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:Zi(Yg),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:NG([...new Set(h)],[...new Set(f)]),transportType:a},s.addTrace(Qp.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:a})}catch(v){throw s.setError(lv.subscribe_authenticated_session_topic_failure),v}s.addTrace(Qp.subscribe_authenticated_session_topic_success),await this.client.session.set(m,y),s.addTrace(Qp.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(Qp.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:r,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:d,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(v){throw s.setError(lv.authenticated_session_approve_publish_failure),v}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:y}}),ht(this,"rejectSessionAuthenticate",async n=>{this.isInitialized();const{id:r,reason:i}=n,s=this.getPendingAuthRequest(r);if(!s)throw new Error(`Could not find pending auth request with id ${r}`);s.transportType===Lr.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=h8(o),l={type:Wd,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:r,topic:c,error:i,encodeOpts:l,rpcOpts:ts.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(r,{message:"rejected",code:0}),await this.deleteProposal(r)}),ht(this,"formatAuthMessage",n=>{this.isInitialized();const{request:r,iss:i}=n;return Due(r,i)}),ht(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const n=this.relayMessageCache.shift();n&&await this.onRelayMessage(n)}catch(n){this.client.logger.error(n)}},50)}),ht(this,"cleanupDuplicatePairings",async n=>{if(n.pairingTopic)try{const r=this.client.core.pairing.pairings.get(n.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===n.peer.metadata.url&&s.topic&&s.topic!==r.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(r){this.client.logger.error(r)}}),ht(this,"deleteSession",async n=>{var r;const{topic:i,expirerHasDeleted:s=!1,emitEvent:o=!0,id:a=0}=n,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,Br("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(RZ).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===i&&this.deletePendingSessionRequest(l.id,Br("USER_DISCONNECTED"))}),i===((r=this.sessionRequestQueue.queue[0])==null?void 0:r.topic)&&(this.sessionRequestQueue.state=Vl.idle),o&&this.client.events.emit("session_delete",{id:a,topic:i})}),ht(this,"deleteProposal",async(n,r)=>{if(r)try{const i=this.client.proposal.get(n),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(Yp.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(n,Br("USER_DISCONNECTED")),r?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"proposal")}),ht(this,"deletePendingSessionRequest",async(n,r,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(n,r),i?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==n),i&&(this.sessionRequestQueue.state=Vl.idle,this.client.events.emit("session_request_expire",{id:n}))}),ht(this,"deletePendingAuthRequest",async(n,r,i=!1)=>{await Promise.all([this.client.auth.requests.delete(n,r),i?Promise.resolve():this.client.core.expirer.del(n)])}),ht(this,"setExpiry",async(n,r)=>{this.client.session.keys.includes(n)&&(this.client.core.expirer.set(n,r),await this.client.session.update(n,{expiry:r}))}),ht(this,"setProposal",async(n,r)=>{this.client.core.expirer.set(n,Zi(ts.wc_sessionPropose.req.ttl)),await this.client.proposal.set(n,r)}),ht(this,"setAuthRequest",async(n,r)=>{const{request:i,pairingTopic:s,transportType:o=Lr.relay}=r;this.client.core.expirer.set(n,i.expiryTimestamp),await this.client.auth.requests.set(n,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:n,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})}),ht(this,"setPendingSessionRequest",async n=>{const{id:r,topic:i,params:s,verifyContext:o}=n,a=s.request.expiryTimestamp||Zi(ts.wc_sessionRequest.req.ttl);this.client.core.expirer.set(r,a),await this.client.pendingRequest.set(r,{id:r,topic:i,params:s,verifyContext:o})}),ht(this,"sendRequest",async n=>{const{topic:r,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:u,tvf:d}=n,h=Vf(i,s,c);let f;const m=!!u;try{const b=m?Cf:pl;f=await this.client.core.crypto.encode(r,h,{encoding:b})}catch(b){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${r} failed`),b}let y;if(NZe.includes(i)){const b=mu(JSON.stringify(h)),C=mu(f);y=await this.client.core.verify.register({id:C,decryptedId:b})}const v=ts[i].req;if(v.attestation=y,o&&(v.ttl=o),a&&(v.id=a),this.client.core.history.set(r,h),m){const b=J4(u,r,f);await global.Linking.openURL(b,this.client.name)}else{const b=ts[i].req;o&&(b.ttl=o),a&&(b.id=a),b.tvf=qo(jr({},d),{correlationId:h.id}),l?(b.internal=qo(jr({},b.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,f,b)):this.client.core.relayer.publish(r,f,b).catch(C=>this.client.logger.error(C))}return h.id}),ht(this,"sendResult",async n=>{const{id:r,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=n,l=r_(r,s);let u;const d=c&&typeof(global==null?void 0:global.Linking)<"u";try{const m=d?Cf:pl;u=await this.client.core.crypto.encode(i,l,qo(jr({},a||{}),{encoding:m}))}catch(m){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),m}let h,f;try{h=await this.client.core.history.get(i,r);const m=h.request;try{f=this.getTVFParams(r,m.params,s)}catch(y){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${y==null?void 0:y.message}`)}}catch(m){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${r}) failed`),m}if(d){const m=J4(c,i,u);await global.Linking.openURL(m,this.client.name)}else{const m=h.request.method,y=ts[m].res;y.tvf=qo(jr({},f),{correlationId:r}),o?(y.internal=qo(jr({},y.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,u,y)):this.client.core.relayer.publish(i,u,y).catch(v=>this.client.logger.error(v))}await this.client.core.history.resolve(l)}),ht(this,"sendError",async n=>{const{id:r,topic:i,error:s,encodeOpts:o,rpcOpts:a,appLink:c}=n,l=i_(r,s);let u;const d=c&&typeof(global==null?void 0:global.Linking)<"u";try{const f=d?Cf:pl;u=await this.client.core.crypto.encode(i,l,qo(jr({},o||{}),{encoding:f}))}catch(f){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),f}let h;try{h=await this.client.core.history.get(i,r)}catch(f){throw this.client.logger.error(`sendError() -> history.get(${i}, ${r}) failed`),f}if(d){const f=J4(c,i,u);await global.Linking.openURL(f,this.client.name)}else{const f=h.request.method,m=a||ts[f].res;this.client.core.relayer.publish(i,u,m)}await this.client.core.history.resolve(l)}),ht(this,"cleanup",async()=>{const n=[],r=[];this.client.session.getAll().forEach(i=>{let s=!1;vf(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&n.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{vf(i.expiryTimestamp)&&r.push(i.id)}),await Promise.all([...n.map(i=>this.deleteSession({topic:i})),...r.map(i=>this.deleteProposal(i))])}),ht(this,"onProviderMessageEvent",async n=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(n):await this.onRelayMessage(n)}),ht(this,"onRelayEventRequest",async n=>{this.requestQueue.queue.push(n),await this.processRequestsQueue()}),ht(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===Vl.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Vl.active;const n=this.requestQueue.queue.shift();if(n)try{await this.processRequest(n)}catch(r){this.client.logger.warn(r)}}this.requestQueue.state=Vl.idle}),ht(this,"processRequest",async n=>{const{topic:r,payload:i,attestation:s,transportType:o,encryptedId:a}=n,c=i.method;if(!this.shouldIgnorePairingRequest({topic:r,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:r,payload:i,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(r,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(r,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(r,i);case"wc_sessionPing":return await this.onSessionPingRequest(r,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(r,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:r,payload:i,attestation:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(r,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:r,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}}),ht(this,"onRelayEventResponse",async n=>{const{topic:r,payload:i,transportType:s}=n,o=(await this.client.core.history.get(r,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(r,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(r,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(r,i);case"wc_sessionExtend":return this.onSessionExtendResponse(r,i);case"wc_sessionPing":return this.onSessionPingResponse(r,i);case"wc_sessionRequest":return this.onSessionRequestResponse(r,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(r,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}}),ht(this,"onRelayEventUnknownPayload",n=>{const{topic:r}=n,{message:i}=Tt("MISSING_OR_INVALID",`Decoded payload on topic ${r} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)}),ht(this,"shouldIgnorePairingRequest",n=>{const{topic:r,requestMethod:i}=n,s=this.expectedPairingMethodMap.get(r);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),ht(this,"onSessionProposeRequest",async n=>{const{topic:r,payload:i,attestation:s,encryptedId:o}=n,{params:a,id:c}=i;try{const l=this.client.core.eventClient.getEvent({topic:r});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(pd.proposal_listener_not_found)),this.isValidConnect(jr({},i.params));const u=a.expiryTimestamp||Zi(ts.wc_sessionPropose.req.ttl),d=jr({id:c,pairingTopic:r,expiryTimestamp:u,attestation:s,encryptedId:o},a);await this.setProposal(c,d);const h=await this.getVerifyContext({attestationId:s,hash:mu(JSON.stringify(i)),encryptedId:o,metadata:d.proposer.metadata});l==null||l.addTrace(Jl.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:d,verifyContext:h})}catch(l){await this.sendError({id:c,topic:r,error:l,rpcOpts:ts.wc_sessionPropose.autoReject}),this.client.logger.error(l)}}),ht(this,"onSessionProposeResponse",async(n,r,i)=>{const{id:s}=r;if(su(r)){const{result:o}=r;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const u=await this.client.core.crypto.generateSharedKey(c,l);this.pendingSessions.set(s,{sessionTopic:u,pairingTopic:n,proposalId:s,publicKey:c});const d=await this.client.core.relayer.subscribe(u,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:n})}else if(dc(r)){await this.deleteProposal(s);const o=ar("session_connect",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(o,{error:r.error})}}),ht(this,"onSessionSettleRequest",async(n,r)=>{const{id:i,params:s}=r;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:h}=r.params,f=[...this.pendingSessions.values()].find(v=>v.sessionTopic===n);if(!f)return this.client.logger.error(`Pending session not found for topic ${n}`);const m=this.client.proposal.get(f.proposalId),y=qo(jr(jr(jr({topic:n,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:f.pairingTopic,requiredNamespaces:m.requiredNamespaces,optionalNamespaces:m.optionalNamespaces,controller:a.publicKey,self:{publicKey:f.publicKey,metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},u&&{sessionProperties:u}),d&&{scopedProperties:d}),h&&{sessionConfig:h}),{transportType:Lr.relay});await this.client.session.set(y.topic,y),await this.setExpiry(y.topic,y.expiry),await this.client.core.pairing.updateMetadata({topic:f.pairingTopic,metadata:y.peer.metadata}),this.client.events.emit("session_connect",{session:y}),this.events.emit(ar("session_connect",f.proposalId),{session:y}),this.pendingSessions.delete(f.proposalId),this.deleteProposal(f.proposalId,!1),this.cleanupDuplicatePairings(y),await this.sendResult({id:r.id,topic:n,result:!0})}catch(o){await this.sendError({id:i,topic:n,error:o}),this.client.logger.error(o)}}),ht(this,"onSessionSettleResponse",async(n,r)=>{const{id:i}=r;su(r)?(await this.client.session.update(n,{acknowledged:!0}),this.events.emit(ar("session_approve",i),{})):dc(r)&&(await this.client.session.delete(n,Br("USER_DISCONNECTED")),this.events.emit(ar("session_approve",i),{error:r.error}))}),ht(this,"onSessionUpdateRequest",async(n,r)=>{const{params:i,id:s}=r;try{const o=`${n}_session_update`,a=av.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:n,error:Br("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(jr({topic:n},i));try{av.set(o,s),await this.client.session.update(n,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:n,result:!0})}catch(c){throw av.delete(o),c}this.client.events.emit("session_update",{id:s,topic:n,params:i})}catch(o){await this.sendError({id:s,topic:n,error:o}),this.client.logger.error(o)}}),ht(this,"isRequestOutOfSync",(n,r)=>r.toString().slice(0,-3)<n.toString().slice(0,-3)),ht(this,"onSessionUpdateResponse",(n,r)=>{const{id:i}=r,s=ar("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);su(r)?this.events.emit(ar("session_update",i),{}):dc(r)&&this.events.emit(ar("session_update",i),{error:r.error})}),ht(this,"onSessionExtendRequest",async(n,r)=>{const{id:i}=r;try{this.isValidExtend({topic:n}),await this.setExpiry(n,Zi(Yg)),await this.sendResult({id:i,topic:n,result:!0}),this.client.events.emit("session_extend",{id:i,topic:n})}catch(s){await this.sendError({id:i,topic:n,error:s}),this.client.logger.error(s)}}),ht(this,"onSessionExtendResponse",(n,r)=>{const{id:i}=r,s=ar("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);su(r)?this.events.emit(ar("session_extend",i),{}):dc(r)&&this.events.emit(ar("session_extend",i),{error:r.error})}),ht(this,"onSessionPingRequest",async(n,r)=>{const{id:i}=r;try{this.isValidPing({topic:n}),await this.sendResult({id:i,topic:n,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:n})}catch(s){await this.sendError({id:i,topic:n,error:s}),this.client.logger.error(s)}}),ht(this,"onSessionPingResponse",(n,r)=>{const{id:i}=r,s=ar("session_ping",i);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);su(r)?this.events.emit(ar("session_ping",i),{}):dc(r)&&this.events.emit(ar("session_ping",i),{error:r.error})},500)}),ht(this,"onSessionDeleteRequest",async(n,r)=>{const{id:i}=r;try{this.isValidDisconnect({topic:n,reason:r.params}),Promise.all([new Promise(s=>{this.client.core.relayer.once(ls.publish,async()=>{s(await this.deleteSession({topic:n,id:i}))})}),this.sendResult({id:i,topic:n,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:n,error:Br("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}}),ht(this,"onSessionRequest",async n=>{var r,i,s;const{topic:o,payload:a,attestation:c,encryptedId:l,transportType:u}=n,{id:d,params:h}=a;try{await this.isValidRequest(jr({topic:o},h));const f=this.client.session.get(o),m=await this.getVerifyContext({attestationId:c,hash:mu(JSON.stringify(Vf("wc_sessionRequest",h,d))),encryptedId:l,metadata:f.peer.metadata,transportType:u}),y={id:d,topic:o,params:h,verifyContext:m};await this.setPendingSessionRequest(y),u===Lr.link_mode&&(r=f.peer.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp((i=f.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(y):(this.addSessionRequestToSessionRequestQueue(y),this.processSessionRequestQueue())}catch(f){await this.sendError({id:d,topic:o,error:f}),this.client.logger.error(f)}}),ht(this,"onSessionRequestResponse",(n,r)=>{const{id:i}=r,s=ar("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);su(r)?this.events.emit(ar("session_request",i),{result:r.result}):dc(r)&&this.events.emit(ar("session_request",i),{error:r.error})}),ht(this,"onSessionEventRequest",async(n,r)=>{const{id:i,params:s}=r;try{const o=`${n}_session_event_${s.event.name}`,a=av.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(jr({topic:n},s)),this.client.events.emit("session_event",{id:i,topic:n,params:s}),av.set(o,i)}catch(o){await this.sendError({id:i,topic:n,error:o}),this.client.logger.error(o)}}),ht(this,"onSessionAuthenticateResponse",(n,r)=>{const{id:i}=r;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:n,payload:r}),su(r)?this.events.emit(ar("session_request",i),{result:r.result}):dc(r)&&this.events.emit(ar("session_request",i),{error:r.error})}),ht(this,"onSessionAuthenticateRequest",async n=>{var r;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=n;try{const{requester:l,authPayload:u,expiryTimestamp:d}=s.params,h=await this.getVerifyContext({attestationId:o,hash:mu(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),f={requester:l,pairingTopic:i,id:s.id,authPayload:u,verifyContext:h,expiryTimestamp:d};await this.setAuthRequest(s.id,{request:f,pairingTopic:i,transportType:c}),c===Lr.link_mode&&(r=l.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:h})}catch(l){this.client.logger.error(l);const u=s.params.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),h=this.getAppLinkIfEnabled(s.params.requester.metadata,c),f={type:Wd,receiverPublicKey:u,senderPublicKey:d};await this.sendError({id:s.id,topic:i,error:l,encodeOpts:f,rpcOpts:ts.wc_sessionAuthenticate.autoReject,appLink:h})}}),ht(this,"addSessionRequestToSessionRequestQueue",n=>{this.sessionRequestQueue.queue.push(n)}),ht(this,"cleanupAfterResponse",n=>{this.deletePendingSessionRequest(n.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Vl.idle,this.processSessionRequestQueue()},Pt.toMiliseconds(this.requestQueueDelay))}),ht(this,"cleanupPendingSentRequestsForTopic",({topic:n,error:r})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===n&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,a=ar("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(ar("session_request",s.request.id),{error:r})})}),ht(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===Vl.active){this.client.logger.info("session request queue is already active.");return}const n=this.sessionRequestQueue.queue[0];if(!n){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(n)}catch(r){this.client.logger.error(r)}}),ht(this,"emitSessionRequest",n=>{if(this.emittedSessionRequests.has(n.id)){this.client.logger.warn({id:n.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${n.id}`);return}this.sessionRequestQueue.state=Vl.active,this.emittedSessionRequests.add(n.id),this.client.events.emit("session_request",n)}),ht(this,"onPairingCreated",n=>{if(n.methods&&this.expectedPairingMethodMap.set(n.topic,n.methods),n.active)return;const r=this.client.proposal.getAll().find(i=>i.pairingTopic===n.topic);r&&this.onSessionProposeRequest({topic:n.topic,payload:Vf("wc_sessionPropose",qo(jr({},r),{requiredNamespaces:r.requiredNamespaces,optionalNamespaces:r.optionalNamespaces,relays:r.relays,proposer:r.proposer,sessionProperties:r.sessionProperties,scopedProperties:r.scopedProperties}),r.id),attestation:r.attestation,encryptedId:r.encryptedId})}),ht(this,"isValidConnect",async n=>{if(!Zo(n)){const{message:l}=Tt("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(n)}`);throw new Error(l)}const{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,scopedProperties:a,relays:c}=n;if(Ms(r)||await this.isValidPairingTopic(r),!BWe(c)){const{message:l}=Tt("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(l)}if(!Ms(i)&&_u(i)!==0){const l="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(l):this.client.logger.warn(l),this.validateNamespaces(i,"requiredNamespaces")}if(!Ms(s)&&_u(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Ms(o)||this.validateSessionProps(o,"sessionProperties"),!Ms(a)){this.validateSessionProps(a,"scopedProperties");const l=Object.keys(i||{}).concat(Object.keys(s||{}));if(!Object.keys(a).every(u=>l.includes(u.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(l)}`)}}),ht(this,"validateNamespaces",(n,r)=>{const i=LWe(n,"connect()",r);if(i)throw new Error(i.message)}),ht(this,"isValidApprove",async n=>{if(!Zo(n))throw new Error(Tt("MISSING_OR_INVALID",`approve() params: ${n}`).message);const{id:r,namespaces:i,relayProtocol:s,sessionProperties:o,scopedProperties:a}=n;this.checkRecentlyDeleted(r),await this.isValidProposalId(r);const c=this.client.proposal.get(r),l=H$(i,"approve()");if(l)throw new Error(l.message);const u=BG(c.requiredNamespaces,i,"approve()");if(u)throw new Error(u.message);if(!Bi(s,!0)){const{message:d}=Tt("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(d)}if(Ms(o)||this.validateSessionProps(o,"sessionProperties"),!Ms(a)){this.validateSessionProps(a,"scopedProperties");const d=new Set(Object.keys(i));if(!Object.keys(a).every(h=>d.has(h.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(d).join(", ")}`)}}),ht(this,"isValidReject",async n=>{if(!Zo(n)){const{message:s}=Tt("MISSING_OR_INVALID",`reject() params: ${n}`);throw new Error(s)}const{id:r,reason:i}=n;if(this.checkRecentlyDeleted(r),await this.isValidProposalId(r),!UWe(i)){const{message:s}=Tt("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}}),ht(this,"isValidSessionSettleRequest",n=>{if(!Zo(n)){const{message:l}=Tt("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${n}`);throw new Error(l)}const{relay:r,controller:i,namespaces:s,expiry:o}=n;if(!pde(r)){const{message:l}=Tt("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=RWe(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=H$(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(vf(o)){const{message:l}=Tt("EXPIRED","onSessionSettleRequest()");throw new Error(l)}}),ht(this,"isValidUpdate",async n=>{if(!Zo(n)){const{message:c}=Tt("MISSING_OR_INVALID",`update() params: ${n}`);throw new Error(c)}const{topic:r,namespaces:i}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const s=this.client.session.get(r),o=H$(i,"update()");if(o)throw new Error(o.message);const a=BG(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)}),ht(this,"isValidExtend",async n=>{if(!Zo(n)){const{message:i}=Tt("MISSING_OR_INVALID",`extend() params: ${n}`);throw new Error(i)}const{topic:r}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r)}),ht(this,"isValidRequest",async n=>{if(!Zo(n)){const{message:c}=Tt("MISSING_OR_INVALID",`request() params: ${n}`);throw new Error(c)}const{topic:r,request:i,chainId:s,expiry:o}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const{namespaces:a}=this.client.session.get(r);if(!LG(a,s)){const{message:c}=Tt("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!zWe(i)){const{message:c}=Tt("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!VWe(a,s,i.method)){const{message:c}=Tt("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!ZWe(o,nI)){const{message:c}=Tt("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${nI.min} and ${nI.max}`);throw new Error(c)}}),ht(this,"isValidRespond",async n=>{var r;if(!Zo(n)){const{message:o}=Tt("MISSING_OR_INVALID",`respond() params: ${n}`);throw new Error(o)}const{topic:i,response:s}=n;try{await this.isValidSessionTopic(i)}catch(o){throw(r=n==null?void 0:n.response)!=null&&r.id&&this.cleanupAfterResponse(n),o}if(!WWe(s)){const{message:o}=Tt("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}}),ht(this,"isValidPing",async n=>{if(!Zo(n)){const{message:i}=Tt("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(i)}const{topic:r}=n;await this.isValidSessionOrPairingTopic(r)}),ht(this,"isValidEmit",async n=>{if(!Zo(n)){const{message:a}=Tt("MISSING_OR_INVALID",`emit() params: ${n}`);throw new Error(a)}const{topic:r,event:i,chainId:s}=n;await this.isValidSessionTopic(r);const{namespaces:o}=this.client.session.get(r);if(!LG(o,s)){const{message:a}=Tt("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!HWe(i)){const{message:a}=Tt("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!qWe(o,s,i.name)){const{message:a}=Tt("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}}),ht(this,"isValidDisconnect",async n=>{if(!Zo(n)){const{message:i}=Tt("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(i)}const{topic:r}=n;await this.isValidSessionOrPairingTopic(r)}),ht(this,"isValidAuthenticate",n=>{const{chains:r,uri:i,domain:s,nonce:o}=n;if(!Array.isArray(r)||r.length===0)throw new Error("chains is required and must be a non-empty array");if(!Bi(i,!1))throw new Error("uri is required parameter");if(!Bi(s,!1))throw new Error("domain is required parameter");if(!Bi(o,!1))throw new Error("nonce is required parameter");if([...new Set(r.map(c=>Qm(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=Qm(r[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),ht(this,"getVerifyContext",async n=>{const{attestationId:r,hash:i,encryptedId:s,metadata:o,transportType:a}=n,c={verified:{verifyUrl:o.verifyUrl||gb,validation:"UNKNOWN",origin:o.url||""}};try{if(a===Lr.link_mode){const u=this.getAppLinkIfEnabled(o,a);return c.verified.validation=u&&new URL(u).origin===new URL(o.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:r,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c}),ht(this,"validateSessionProps",(n,r)=>{Object.values(n).forEach((i,s)=>{if(i==null){const{message:o}=Tt("MISSING_OR_INVALID",`${r} must contain an existing value for each key. Received: ${i} for key ${Object.keys(n)[s]}`);throw new Error(o)}})}),ht(this,"getPendingAuthRequest",n=>{const r=this.client.auth.requests.get(n);return typeof r=="object"?r:void 0}),ht(this,"addToRecentlyDeleted",(n,r)=>{if(this.recentlyDeletedMap.set(n,r),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}}),ht(this,"checkRecentlyDeleted",n=>{const r=this.recentlyDeletedMap.get(n);if(r){const{message:i}=Tt("MISSING_OR_INVALID",`Record was recently deleted - ${r}: ${n}`);throw new Error(i)}}),ht(this,"isLinkModeEnabled",(n,r)=>{var i,s,o,a,c,l,u,d,h;return!n||r!==Lr.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((u=n==null?void 0:n.redirect)==null?void 0:u.universal)!==void 0&&((d=n==null?void 0:n.redirect)==null?void 0:d.universal)!==""&&((h=n==null?void 0:n.redirect)==null?void 0:h.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(n.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"}),ht(this,"getAppLinkIfEnabled",(n,r)=>{var i;return this.isLinkModeEnabled(n,r)?(i=n==null?void 0:n.redirect)==null?void 0:i.universal:void 0}),ht(this,"handleLinkModeMessage",({url:n})=>{if(!n||!n.includes("wc_ev")||!n.includes("topic"))return;const r=XK(n,"topic")||"",i=decodeURIComponent(XK(n,"wc_ev")||""),s=this.client.session.keys.includes(r);s&&this.client.session.update(r,{transportType:Lr.link_mode}),this.client.core.dispatchEnvelope({topic:r,message:i,sessionExists:s})}),ht(this,"registerLinkModeListeners",async()=>{var n;if(wL()||vp()&&(n=this.client.metadata.redirect)!=null&&n.linkMode){const r=global==null?void 0:global.Linking;if(typeof r<"u"){r.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await r.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}),ht(this,"getTVFParams",(n,r,i)=>{var s,o,a;if(!((s=r.request)!=null&&s.method))return{};const c={correlationId:n,rpcMethods:[r.request.method],chainId:r.chainId};try{const l=this.extractTxHashesFromResult(r.request,i);c.txHashes=l,c.contractAddresses=this.isValidContractData(r.request.params)?[(a=(o=r.request.params)==null?void 0:o[0])==null?void 0:a.to]:[]}catch(l){this.client.logger.warn("Error getting TVF params",l)}return c}),ht(this,"isValidContractData",n=>{var r;if(!n)return!1;try{const i=(n==null?void 0:n.data)||((r=n==null?void 0:n[0])==null?void 0:r.data);if(!i.startsWith("0x"))return!1;const s=i.slice(2);return/^[0-9a-fA-F]*$/.test(s)?s.length%2===0:!1}catch{}return!1}),ht(this,"extractTxHashesFromResult",(n,r)=>{var i;try{if(!r)return[];const s=n.method,o=OZe[s];if(s==="sui_signTransaction")return[wUe(r.transactionBytes)];if(s==="near_signTransaction")return[oG(r)];if(s==="near_signTransactions")return r.map(c=>oG(c));if(s==="xrpl_signTransactionFor"||s==="xrpl_signTransaction")return[(i=r.tx_json)==null?void 0:i.hash];if(s==="polkadot_signTransaction")return[uHe({transaction:n.params.transactionPayload,signature:r.signature})];if(s==="algo_signTxn")return wc(r)?r.map(c=>aG(c)):[aG(r)];if(s==="cosmos_signDirect")return[bUe(r)];if(typeof r=="string")return[r];const a=r[o.key];if(wc(a))return s==="solana_signAllTransactions"?a.map(c=>yUe(c)):a;if(typeof a=="string")return[a]}catch(s){this.client.logger.warn("Error extracting tx hashes from result",s)}return[]})}async processPendingMessageEvents(){try{const e=this.client.session.keys,n=this.client.core.relayer.messages.getWithoutAck(e);for(const[r,i]of Object.entries(n))for(const s of i)try{await this.onProviderMessageEvent({topic:r,message:s,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${r}, message: ${s}`)}}catch(e){this.client.logger.warn("processPendingMessageEvents failed",e)}}isInitialized(){if(!this.initialized){const{message:e}=Tt("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(ls.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:n,message:r,attestation:i,transportType:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(m8)?this.client.auth.authKeys.get(m8):{publicKey:void 0};try{const a=await this.client.core.crypto.decode(n,r,{receiverPublicKey:o,encoding:s===Lr.link_mode?Cf:pl});OL(a)?(this.client.core.history.set(n,a),await this.onRelayEventRequest({topic:n,payload:a,attestation:i,transportType:s,encryptedId:mu(r)})):s_(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:n,payload:a,transportType:s}),this.client.core.history.delete(n,a.id)):await this.onRelayEventUnknownPayload({topic:n,payload:a,transportType:s}),await this.client.core.relayer.messages.ack(n,r)}catch(a){this.client.logger.error(a)}}registerExpirerEvents(){this.client.core.expirer.on(sc.expired,async e=>{const{topic:n,id:r}=Eue(e.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,Tt("EXPIRED"),!0);if(r&&this.client.auth.requests.keys.includes(r))return await this.deletePendingAuthRequest(r,Tt("EXPIRED"),!0);n?this.client.session.keys.includes(n)&&(await this.deleteSession({topic:n,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:n})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))})}registerPairingEvents(){this.client.core.pairing.events.on(c0.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(c0.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!Bi(e,!1)){const{message:n}=Tt("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(n)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:n}=Tt("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(n)}if(vf(this.client.core.pairing.pairings.get(e).expiry)){const{message:n}=Tt("EXPIRED",`pairing topic: ${e}`);throw new Error(n)}}async isValidSessionTopic(e){if(!Bi(e,!1)){const{message:n}=Tt("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(n)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:n}=Tt("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(n)}if(vf(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:n}=Tt("EXPIRED",`session topic: ${e}`);throw new Error(n)}if(!this.client.core.crypto.keychain.has(e)){const{message:n}=Tt("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(n)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Bi(e,!1)){const{message:n}=Tt("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(n)}else{const{message:n}=Tt("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(n)}}async isValidProposalId(e){if(!FWe(e)){const{message:n}=Tt("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(n)}if(!this.client.proposal.keys.includes(e)){const{message:n}=Tt("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(n)}if(vf(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:n}=Tt("EXPIRED",`proposal id: ${e}`);throw new Error(n)}}},GZe=class extends z1{constructor(e,n){super(e,n,PZe,jL),this.core=e,this.logger=n}},ZZe=class extends z1{constructor(e,n){super(e,n,RZe,jL),this.core=e,this.logger=n}},YZe=class extends z1{constructor(e,n){super(e,n,jZe,jL,r=>r.id),this.core=e,this.logger=n}},QZe=class extends z1{constructor(e,n){super(e,n,BZe,a_,()=>m8),this.core=e,this.logger=n}},XZe=class extends z1{constructor(e,n){super(e,n,FZe,a_),this.core=e,this.logger=n}},JZe=class extends z1{constructor(e,n){super(e,n,UZe,a_,r=>r.id),this.core=e,this.logger=n}};var eYe=Object.defineProperty,tYe=(t,e,n)=>e in t?eYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rI=(t,e,n)=>tYe(t,typeof e!="symbol"?e+"":e,n);let nYe=class{constructor(e,n){this.core=e,this.logger=n,rI(this,"authKeys"),rI(this,"pairingTopics"),rI(this,"requests"),this.authKeys=new QZe(this.core,this.logger),this.pairingTopics=new XZe(this.core,this.logger),this.requests=new JZe(this.core,this.logger)}
148async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}};var rYe=Object.defineProperty,iYe=(t,e,n)=>e in t?rYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qn=(t,e,n)=>iYe(t,typeof e!="symbol"?e+"":e,n);let sYe=class Wde extends CVe{constructor(e){super(e),qn(this,"protocol",Fde),qn(this,"version",Ude),qn(this,"name",tI.name),qn(this,"metadata"),qn(this,"core"),qn(this,"logger"),qn(this,"events",new Wa.EventEmitter),qn(this,"engine"),qn(this,"session"),qn(this,"proposal"),qn(this,"pendingRequest"),qn(this,"auth"),qn(this,"signConfig"),qn(this,"on",(r,i)=>this.events.on(r,i)),qn(this,"once",(r,i)=>this.events.once(r,i)),qn(this,"off",(r,i)=>this.events.off(r,i)),qn(this,"removeListener",(r,i)=>this.events.removeListener(r,i)),qn(this,"removeAllListeners",r=>this.events.removeAllListeners(r)),qn(this,"connect",async r=>{try{return await this.engine.connect(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"pair",async r=>{try{return await this.engine.pair(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"approve",async r=>{try{return await this.engine.approve(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"reject",async r=>{try{return await this.engine.reject(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"update",async r=>{try{return await this.engine.update(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"extend",async r=>{try{return await this.engine.extend(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"request",async r=>{try{return await this.engine.request(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"respond",async r=>{try{return await this.engine.respond(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"ping",async r=>{try{return await this.engine.ping(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"emit",async r=>{try{return await this.engine.emit(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"disconnect",async r=>{try{return await this.engine.disconnect(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"find",r=>{try{return this.engine.find(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(r){throw this.logger.error(r.message),r}}),qn(this,"authenticate",async(r,i)=>{try{return await this.engine.authenticate(r,i)}catch(s){throw this.logger.error(s.message),s}}),qn(this,"formatAuthMessage",r=>{try{return this.engine.formatAuthMessage(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"approveSessionAuthenticate",async r=>{try{return await this.engine.approveSessionAuthenticate(r)}catch(i){throw this.logger.error(i.message),i}}),qn(this,"rejectSessionAuthenticate",async r=>{try{return await this.engine.rejectSessionAuthenticate(r)}catch(i){throw this.logger.error(i.message),i}}),this.name=(e==null?void 0:e.name)||tI.name,this.metadata=lFe(e==null?void 0:e.metadata),this.signConfig=e==null?void 0:e.signConfig;const n=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:j5(n_({level:(e==null?void 0:e.logger)||tI.logger}));this.core=(e==null?void 0:e.core)||new TZe(e),this.logger=jo(n,this.name),this.session=new ZZe(this.core,this.logger),this.proposal=new GZe(this.core,this.logger),this.pendingRequest=new YZe(this.core,this.logger),this.engine=new KZe(this),this.auth=new nYe(this.core,this.logger)}static async init(e){const n=new Wde(e);return await n.initialize(),n}get context(){return ya(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var n6={exports:{}},jZ;function oYe(){return jZ||(jZ=1,function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Oa<"u"&&Oa,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof Oa<"u"&&Oa||{},c={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(k){return k&&DataView.prototype.isPrototypeOf(k)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
148]"],d=ArrayBuffer.isView||function(k){return k&&u.indexOf(Object.prototype.toString.call(k))>-1};function h(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function f(k){return typeof k!="string"&&(k=String(k)),k}function m(k){var M={next:function(){var W=k.shift();return{done:W===void 0,value:W}}};return c.iterable&&(M[Symbol.iterator]=function(){return M}),M}function y(k){this.map={},k instanceof y?k.forEach(function(M,W){this.append(W,M)},this):Array.isArray(k)?k.forEach(function(M){if(M.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+M.length);this.append(M[0],M[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(M){this.append(M,k[M])},this)}y.prototype.append=function(k,M){k=h(k),M=f(M);var W=this.map[k];this.map[k]=W?W+", "+M:M},y.prototype.delete=function(k){delete this.map[h(k)]},y.prototype.get=function(k){return k=h(k),this.has(k)?this.map[k]:null},y.prototype.has=function(k){return this.map.hasOwnProperty(h(k))},y.prototype.set=function(k,M){this.map[h(k)]=f(M)},y.prototype.forEach=function(k,M){for(var W in this.map)this.map.hasOwnProperty(W)&&k.call(M,this.map[W],W,this)},y.prototype.keys=function(){var k=[];return this.forEach(function(M,W){k.push(W)}),m(k)},y.prototype.values=function(){var k=[];return this.forEach(function(M){k.push(M)}),m(k)},y.prototype.entries=function(){var k=[];return this.forEach(function(M,W){k.push([W,M])}),m(k)},c.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function v(k){if(!k._noBody){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}}function b(k){return new Promise(function(M,W){k.onload=function(){M(k.result)},k.onerror=function(){W(k.error)}})}function C(k){var M=new FileReader,W=b(M);return M.readAsArrayBuffer(k),W}function x(k){var M=new FileReader,W=b(M),H=/charset=([A-Za-z0-9_-]+)/.exec(k.type),D=H?H[1]:"utf-8";return M.readAsText(k,D),W}function _(k){for(var M=new Uint8Array(k),W=new Array(M.length),H=0;H<M.length;H++)W[H]=String.fromCharCode(M[H]);return W.join("")}function $(k){if(k.slice)return k.slice(0);var M=new Uint8Array(k.byteLength);return M.set(new Uint8Array(k)),M.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:c.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:c.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():c.arrayBuffer&&c.blob&&l(k)?(this._bodyArrayBuffer=$(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||d(k))?this._bodyArrayBuffer=$(k):this._bodyText=k=Object.prototype.toString.call(k):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var k=v(this);if(k)return k;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var k=v(this);return k||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var k=v(this);if(k)return k;if(this._bodyBlob)return x(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(_(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(O)}),this.json=function(){return this.text().then(JSON.parse)},this}var R=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function N(k){var M=k.toUpperCase();return R.indexOf(M)>-1?M:k}function T(k,M){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object c
148onstructor cannot be called as a function.');M=M||{};var W=M.body;if(k instanceof T){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,M.headers||(this.headers=new y(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!W&&k._bodyInit!=null&&(W=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=M.credentials||this.credentials||"same-origin",(M.headers||!this.headers)&&(this.headers=new y(M.headers)),this.method=N(M.method||this.method||"GET"),this.mode=M.mode||this.mode||null,this.signal=M.signal||this.signal||function(){if("AbortController"in a){var V=new AbortController;return V.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&W)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(W),(this.method==="GET"||this.method==="HEAD")&&(M.cache==="no-store"||M.cache==="no-cache")){var H=/([?&])_=[^&]*/;if(H.test(this.url))this.url=this.url.replace(H,"$1_="+new Date().getTime());else{var D=/\?/;this.url+=(D.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function O(k){var M=new FormData;return k.trim().split("&").forEach(function(W){if(W){var H=W.split("="),D=H.shift().replace(/\+/g," "),V=H.join("=").replace(/\+/g," ");M.append(decodeURIComponent(D),decodeURIComponent(V))}}),M}function U(k){var M=new y,W=k.replace(/\r?\n[\t ]+/g," ");return W.split("\r").map(function(H){return H.indexOf(` 149`)===0?H.substr(1,H.length):H}).forEach(function(H){var D=H.split(":"),V=D.shift().trim();if(V){var B=D.join(":").trim();try{M.append(V,B)}catch(P){console.warn("Response "+P.message)}}}),M}I.call(T.prototype);function z(k,M){if(!(this instanceof z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(M||(M={}),this.type="default",this.status=M.status===void 0?200:M.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=M.statusText===void 0?"":""+M.statusText,this.headers=new y(M.headers),this.url=M.url||"",this._initBody(k)}I.call(z.prototype),z.prototype.clone=function(){return new z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},z.error=function(){var k=new z(null,{status:200,statusText:""});return k.ok=!1,k.status=0,k.type="error",k};var L=[301,302,303,307,308];z.redirect=function(k,M){if(L.indexOf(M)===-1)throw new RangeError("Invalid status code");return new z(null,{status:M,headers:{location:k}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(M,W){this.message=M,this.name=W;var H=Error(M);this.stack=H.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function S(k,M){return new Promise(function(W,H){var D=new T(k,M);if(D.signal&&D.signal.aborted)return H(new o.DOMException("Aborted","AbortError"));var V=new XMLHttpRequest;function B(){V.abort()}V.onload=function(){var G={statusText:V.statusText,headers:U(V.getAllResponseHeaders()||"")};D.url.indexOf("file://")===0&&(V.status<200||V.status>599)?G.status=200:G.status=V.status,G.url="responseURL"in V?V.responseURL:G.headers.get("X-Request-URL");var Y="response"in V?V.response:V.responseText;setTimeout(function(){W(new z(Y,G))},0)},V.onerror=function(){setTimeout(function(){H(new TypeError("Network request failed"))},0)},V.ontimeout=function(){setTimeout(function(){H(new TypeError("Network request timed out"))},0)},V.onabort=function(){setTimeout(function(){H(new o.DOMException("Aborted","AbortError"))},0)};function P(G){try{return G===""&&a.location.href?a.location.href:G}catch{return G}}if(V.open(D.method,P(D.url),!0),D.credentials==="include"?V.withCredentials=!0:D.credentials==="omit"&&(V.withCredentials=!1),"responseType"in V&&(c.blob?V.responseType="blob":c.arrayBuffer&&(V.responseType="arraybuffer")),M&&typeof M.headers=="object"&&!(M.headers instanceof y||a.Headers&&M.headers instanceof a.Headers)){var j=[];
vendor: 4,638 bytes, line 149
149Object.getOwnPropertyNames(M.headers).forEach(function(G){j.push(h(G)),V.setRequestHeader(G,f(M.headers[G]))}),D.headers.forEach(function(G,Y){j.indexOf(Y)===-1&&V.setRequestHeader(Y,G)})}else D.headers.forEach(function(G,Y){V.setRequestHeader(Y,G)});D.signal&&(D.signal.addEventListener("abort",B),V.onreadystatechange=function(){V.readyState===4&&D.signal.removeEventListener("abort",B)}),V.send(typeof D._bodyInit>"u"?null:D._bodyInit)})}return S.polyfill=!0,a.fetch||(a.fetch=S,a.Headers=y,a.Request=T,a.Response=z),o.Headers=y,o.Request=T,o.Response=z,o.fetch=S,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}(n6,n6.exports)),n6.exports}var aYe=oYe();const NZ=ys(aYe);var cYe=Object.defineProperty,lYe=Object.defineProperties,uYe=Object.getOwnPropertyDescriptors,DZ=Object.getOwnPropertySymbols,dYe=Object.prototype.hasOwnProperty,hYe=Object.prototype.propertyIsEnumerable,LZ=(t,e,n)=>e in t?cYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,BZ=(t,e)=>{for(var n in e||(e={}))dYe.call(e,n)&&LZ(t,n,e[n]);if(DZ)for(var n of DZ(e))hYe.call(e,n)&&LZ(t,n,e[n]);return t},FZ=(t,e)=>lYe(t,uYe(e));const fYe={Accept:"application/json","Content-Type":"application/json"},pYe="POST",UZ={headers:fYe,method:pYe},zZ=10;let Pl=class{constructor(e,n=!1){if(this.url=e,this.disableProviderPing=n,this.events=new Wa.EventEmitter,this.isAvailable=!1,this.registering=!1,!iZ(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=n}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const n=nh(e),r=await(await NZ(this.url,FZ(BZ({},UZ),{body:n}))).json();this.onPayload({data:r})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!iZ(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((r,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));r()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const n=nh({id:1,jsonrpc:"2.0",method:"test",params:[]});await NZ(e,FZ(BZ({},UZ),{body:n}))}this.onOpen()}catch(n){const r=this.parseError(n);throw this.events.emit("register_error",r),this.onClose(),r}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const n=typeof e.data=="string"?b1(e.data):e.data;this.events.emit("payload",n)}onError(e,n){const r=this.parseError(n),i=r.message||r.toString(),s=i_(e,i);this.events.emit("payload",s)}parseError(e,n=this.url){return bde(e,n,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>zZ&&this.events.setMaxListeners(zZ)}};const WZ="error",gYe="wss://relay.walletconnect.org",mYe="wc",yYe="universal_provider",r6=`${mYe}@2:${yYe}:`,Hde="https://rpc.walletconnect.org/v1/",xm="generic",wYe=`${Hde}bundler`,Mc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};function NL(t){return t==null||typeof t!="object"&&typeof t!="function"}function Vde(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function qde(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const vYe="[object RegExp]",Kde="[object String]",Gde="[object Number]",Zde="[object Boolean]",Yde="[object Arguments]",bYe="[object Symbol]",xYe="[object Date]",EYe="[object Map]",CYe="[object Set]",_Ye="[object Array]",SYe="[object ArrayBuffer]",AYe="[object Object]",kYe="[object DataView]",$Ye="[object Uint8Array]",IYe="[object Uint8ClampedArray]",TYe="[object Uint16Array]",PYe="[object Uint32Array]",RYe="[object Int8Array]",MYe="[object Int16Array]",OYe="[object Int32Array]",jYe="[object Float32Array]",NYe="[object Float64Array
149]";function DL(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function DYe(t,e){return Tm(t,void 0,t,new Map,e)}function Tm(t,e,n,r=new Map,i=void 0){const s=i==null?void 0:i(t,e,n,r);if(s!=null)return s;if(NL(t))return t;if(r.has(t))return r.get(t);if(Array.isArray(t)){const o=new Array(t.length);r.set(t,o);for(let a=0;a<t.length;a++)o[a]=Tm(t[a],a,n,r,i);return Object.hasOwn(t,"index")&&(o.index=t.index),Object.hasOwn(t,"input")&&(o.input=t.input),o}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const o=new RegExp(t.source,t.flags);return o.lastIndex=t.lastIndex,o}if(t instanceof Map){const o=new Map;r.set(t,o);for(const[a,c]of t)o.set(a,Tm(c,a,n,r,i));return o}if(t instanceof Set){const o=new Set;r.set(t,o);for(const a of t)o.add(Tm(a,void 0,n,r,i));return o}if(typeof Buffer<"u"&&Buffer.isBuffer(t))return t.subarray();if(DL(t)){const o=new(Object.getPrototypeOf(t)).constructor(t.length);r.set(t,o);for(let a=0;a<t.length;a++)o[a]=Tm(t[a],a,n,r,i);return o}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const o=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return r.set(t,o),l0(o,t,n,r,i),o}if(typeof File<"u"&&t instanceof File){const o=new File([t],t.name,{type:t.type});return r.set(t,o),l0(o,t,n,r,i),o}if(t instanceof Blob){const o=new Blob([t],{type:t.type});return r.set(t,o),l0(o,t,n,r,i),o}if(t instanceof Error){const o=new t.constructor;return r.set(t,o),o.message=t.message,o.name=t.name,o.stack=t.stack,o.cause=t.cause,l0(o,t,n,r,i),o}if(typeof t=="object"&&LYe(t)){const o=Object.create(Object.getPrototypeOf(t));return r.set(t,o),l0(o,t,n,r,i),o}return t}function l0(t,e,n=t,r,i){const s=[...Object.keys(e),...Vde(e)];for(let o=0;o<s.length;o++){const a=s[o],c=Object.getOwnPropertyDescriptor(t,a);(c==null||c.writable)&&(t[a]=Tm(e[a],a,n,r,i))}}function LYe(t){switch(qde(t)){case Yde:case _Ye:case SYe:case kYe:case Zde:case xYe:case jYe:case NYe:case RYe:case MYe:case OYe:case EYe:case Gde:case AYe:case vYe:case CYe:case Kde:case bYe:case $Ye:case IYe:case TYe:case PYe:return!0;default:return!1}}function BYe(t,e){return DYe(t,(n,r,i,s)=>{if(typeof t=="object")switch(Object.prototype.toString.call(t)){case Gde:case Kde:case Zde:{const o=new t.constructor(t==null?void 0:t.valueOf());return l0(o,t),o}case Yde:{const o={};return l0(o,t),o.length=t.length,o[Symbol.iterator]=t[Symbol.iterator],o}default:return}})}function HZ(t){return BYe(t)}function VZ(t){return t!==null&&typeof t=="object"&&qde(t)==="[object Arguments]"}function qZ(t){return typeof t=="object"&&t!==null}function FYe(){}function UYe(t){return DL(t)}function zYe(t){var n;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const r=t[Symbol.toStringTag];return r==null||!((n=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&n.writable)?!1:t.toString()===`[object ${r}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function WYe(t){if(NL(t))return t;if(Array.isArray(t)||DL(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t),n=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new n(t);if(t instanceof RegExp){const r=new n(t);return r.lastIndex=t.lastIndex,r}if(t instanceof DataView)return new n(t.buffer.slice(0));if(t instanceof Error){const r=new n(t.message);return r.stack=t.stack,r.name=t.name,r.cause=t.cause,r}if(typeof File<"u"&&t instanceof File)return new n([t],t.name,{type:t.type,lastModified:t.lastModified});if(typeof t=="object"){const r=Object.create(e);return Object.assign(r,t)}return t}function HYe(t,...e){const n=e.slice(0,-1),r=e[e.length-1];let i=t;for(let s=0;s<n.length;s++){const o=n[s];i=cO(i,o,r,new Map)}return i}function cO(t,e,n,r){if(NL(t)&&(t=Object(t)),e==null||typeof e!="object")return t;if(r.has(e))return WYe(r.get(e));if(r.set(e,t),Array.isArray(e)){e=e.slice();for(let s=0;s<e.length;s++)e[s]=e[s]??void 0}const i=[...Object.keys(e),...Vde(e)];for(let s=0;s<i.length;s++){const o=i[s];let a=e[o],c=t[o];if(VZ(a)&&(a={...a}),VZ(c)&&(c={...c}),typeof Buffer<"u"&&Buffer.isBuffer(a)&&(a=HZ(a)),Array.isArray(a))if(typeof c=="object"&&c!=null){const u=[],d=Reflect.ownKeys(c);for(let h=0;h<d.length;h++){const f=d[h];u[f]=c[f]}c=u}else c=[];const l=n(c,a,o,t,e,r);l!=null?t[o]=l:Array.isArray(a)||qZ(c)&&qZ(a)?t[o]=cO(c,a,n,r):c==null&&zYe(a)?t[o]=cO({},a,n,r):c==null&&UYe(a)?t[o]=HZ(a):(c===void 0||a!==void 0)&&(t[o]=a)}return t}function VYe(t,...e){return HYe(t,...e,FYe)}var qYe=Object.defineProperty,KYe=Object.defineProperties,GYe=Object.getOwnPropertyDescriptors,KZ=Object.getOwnPropertySymbols,ZYe=Object.prototype.hasOwnProperty,YYe=Object.prototype.propertyIsEnumerable,GZ=(t,e,n)=>e in t?qYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i6=(t,e)=>{for(var n in e||(e={}))ZYe.call(e,n)&&GZ(t,n,e[n]);if(KZ)for(var n of KZ(e))YYe.call(e,n)&&GZ(t,n,e[n]);return t},QYe=(t,e)=>KYe(t,GYe(e));function La(t,e,n){var r;const i=Qm(t);return((r=e.rpcMap)==null?void 0:r[i.reference])||`${Hde}?chainId=${i.namespace}:${i.reference}&projectId=${n}`}function W1(t){return t.includes(":")?t.split(":")[1]:t}function Qde(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function XYe(t,e){const n=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!n.length)return[];const r=[];
vendor: 9,295 bytes, line 149
149return n.forEach(i=>{const s=e.namespaces[i].accounts;r.push(...s)}),r}function ZZ(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>{var r,i;return((r=n==null?void 0:n.chains)==null?void 0:r.length)&&((i=n==null?void 0:n.chains)==null?void 0:i.length)>0}))}function s6(t={},e={}){const n=ZZ(YZ(t)),r=ZZ(YZ(e));return VYe(n,r)}function YZ(t){var e,n,r,i,s;const o={};if(!_u(t))return o;for(const[a,c]of Object.entries(t)){const l=t_(a)?[a]:c.chains,u=c.methods||[],d=c.events||[],h=c.rpcMap||{},f=Im(a);o[f]=QYe(i6(i6({},o[f]),c),{chains:Cu(l,(e=o[f])==null?void 0:e.chains),methods:Cu(u,(n=o[f])==null?void 0:n.methods),events:Cu(d,(r=o[f])==null?void 0:r.events)}),(_u(h)||_u(((i=o[f])==null?void 0:i.rpcMap)||{}))&&(o[f].rpcMap=i6(i6({},h),(s=o[f])==null?void 0:s.rpcMap))}return o}function QZ(t){return t.includes(":")?t.split(":")[2]:t}function XZ(t){const e={};for(const[n,r]of Object.entries(t)){const i=r.methods||[],s=r.events||[],o=r.accounts||[],a=t_(n)?[n]:r.chains?r.chains:Qde(r.accounts);e[n]={chains:a,methods:i,events:s,accounts:o}}return e}function iI(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Xde={},rr=t=>Xde[t],sI=(t,e)=>{Xde[t]=e};var JYe=Object.defineProperty,JZ=Object.getOwnPropertySymbols,eQe=Object.prototype.hasOwnProperty,tQe=Object.prototype.propertyIsEnumerable,eY=(t,e,n)=>e in t?JYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,tY=(t,e)=>{for(var n in e||(e={}))eQe.call(e,n)&&eY(t,n,e[n]);if(JZ)for(var n of JZ(e))tQe.call(e,n)&&eY(t,n,e[n]);return t};const nY="eip155",nQe=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],rQe=t=>t&&t.startsWith("0x")?BigInt(t).toString(10):t,oI=t=>t&&t.startsWith("0x")?t:`0x${BigInt(t).toString(16)}`,rY=t=>Object.keys(t).filter(e=>nQe.includes(e)).reduce((e,n)=>(e[n]=t[n],e),{}),iQe=(t,e,n)=>{const{sessionProperties:r={},scopedProperties:i={}}=t,s={};if(!_u(i)&&!_u(r))return;const o=rY(r);for(const a of n){const c=rQe(a);if(!c)continue;s[oI(c)]=o;const l=i==null?void 0:i[`${nY}:${c}`];if(l){const u=l==null?void 0:l[`${nY}:${c}:${e}`];s[oI(c)]=tY(tY({},s[oI(c)]),rY(u||l))}}for(const[a,c]of Object.entries(s))Object.keys(c).length===0&&delete s[a];return Object.keys(s).length>0?s:void 0};var sQe=Object.defineProperty,oQe=(t,e,n)=>e in t?sQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Qg=(t,e,n)=>oQe(t,typeof e!="symbol"?e+"":e,n);let aQe=class{constructor(e){Qg(this,"name","polkadot"),Qg(this,"client"),Qg(this,"httpProviders"),Qg(this,"events"),Qg(this,"namespace"),Qg(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n),this.chainId=e,this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;const i=W1(n);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Rc(new Pl(r,rr("disableProviderPing")))}};var cQe=Object.defineProperty,lQe=Object.defineProperties,uQe=Object.getOwnPropertyDescriptors,iY=Object.getOwnPropertySymbols,dQe=Object.prototype.hasOwnProperty,hQe=Object.prototype.propertyIsEnumerable,lO=(t,e,n)=>e in t?cQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,sY=(t,e)=>{for(var n in e||(e={}))dQe.call(e,n)&&lO(t,n,e[n]);if(iY)for(var n of iY(e))hQe.call(e,n)&&lO(t,n,e[n]);return t},oY=(t,e)=>lQe(t,uQe(e)),Xg=(t,e,n)=>lO(t,typeof e!="symbol"?e+"":e,n);let fQe=class{constructor(e){Xg(this,"name","eip155"),Xg(this,"client"),Xg(this,"chainId"),Xg(this,"namespace"),Xg(this,"httpProviders"),Xg(this,"events"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(parseInt(e),n),this.chainId=parseInt(e),this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,n){const r=n||La(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Rc(new Pl(r,rr("disableProviderPing")))}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;const i=parseInt(W1(n));e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}async handleSwitchChain(e){var n,r;let i=e.request.params?(n=e.request.params[0])==null?void 0:n.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(r=this.namespace.chains)==null?void 0:r[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var n,r,i,s,o;const a=(r=(n=e.request)==null?void 0:n.params)==null?void 0:r[0],c=((s=(i=e.request)==null?void 0:i.params)==null?void 0:s[1])||[];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const l=this.client.session.get(e.topic),u=((o=l==null?void 0:l.sessionProperties)==null?void 0:o.capabilities)||{},d=`${a}${c.join(",")}`,h=u==null?void 0:u[d];if(h)return h;let f;try{f=iQe(l,a,c)}catch(y){console.warn("Failed to extract capabilities from session",y)}if(f)return f;const m=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:oY(sY({},l.sessionProperties||{}),{capabilities:oY(sY({},u||{}),{[d]:m})})})}catch(y){console.warn("Failed to update session with capabilities",y)}return m}async getCallStatus(e){var n,r;const i=this.client.session.get(e.topic),s=(n=i.sessionProperties)==null?void 0:n.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(r=i.sessionProperties)==null?void 0:r.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,n){var r;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Vf("eth_getUserOperationReceipt",[(r=n.request.params)==null?void 0:r[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}
149getBundlerUrl(e,n){return`${wYe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${n}`}};var pQe=Object.defineProperty,gQe=(t,e,n)=>e in t?pQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Jg=(t,e,n)=>gQe(t,typeof e!="symbol"?e+"":e,n);let mQe=class{constructor(e){Jg(this,"name","solana"),Jg(this,"client"),Jg(this,"httpProviders"),Jg(this,"events"),Jg(this,"namespace"),Jg(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n),this.chainId=e,this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;const i=W1(n);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Rc(new Pl(r,rr("disableProviderPing")))}};var yQe=Object.defineProperty,wQe=(t,e,n)=>e in t?yQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,em=(t,e,n)=>wQe(t,typeof e!="symbol"?e+"":e,n);let vQe=class{constructor(e){em(this,"name","cosmos"),em(this,"client"),em(this,"httpProviders"),em(this,"events"),em(this,"namespace"),em(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n),this.chainId=e,this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;const i=W1(n);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Rc(new Pl(r,rr("disableProviderPing")))}};var bQe=Object.defineProperty,xQe=(t,e,n)=>e in t?bQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,tm=(t,e,n)=>xQe(t,typeof e!="symbol"?e+"":e,n);let EQe=class{constructor(e){tm(this,"name","algorand"),tm(this,"client"),tm(this,"httpProviders"),tm(this,"events"),tm(this,"namespace"),tm(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){if(!this.httpProviders[e]){const r=n||La(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;e[n]=this.createHttpProvider(n,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Rc(new Pl(r,rr("disableProviderPing")))}};var CQe=Object.defineProperty,_Qe=(t,e,n)=>e in t?CQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,nm=(t,e,n)=>_Qe(t,typeof e!="symbol"?e+"":e,n);let SQe=class{constructor(e){nm(this,"name","cip34"),nm(this,"client"),nm(this,"httpProviders"),nm(this,"events"),nm(this,"namespace"),nm(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n),this.chainId=e,this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{const r=this.getCardanoRPCUrl(n),i=W1(n);e[i]=this.createHttpProvider(i,r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}getCardanoRPCUrl(e){const n=this.namespace.rpcMap;if(n)return n[e]}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||this.getCardanoRPCUrl(e);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Rc(new Pl(r,rr("disableProviderPing")))}};var AQe=Object.defineProperty,kQe=(t,e,n)=>e in t?AQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rm=(t,e,n)=>kQe(t,typeof e!="symbol"?e+"":e,n);let $Qe=class{constructor(e){rm(this,"name","elrond"),rm(this,"client"),rm(this,"httpProviders"),rm(this,"events"),rm(this,"namespace"),rm(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n),this.chainId=e,this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;const i=W1(n);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Rc(new Pl(r,rr("disableProviderPing")))}};
149var IQe=Object.defineProperty,TQe=(t,e,n)=>e in t?IQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,im=(t,e,n)=>TQe(t,typeof e!="symbol"?e+"":e,n);let PQe=class{constructor(e){im(this,"name","multiversx"),im(this,"client"),im(this,"httpProviders"),im(this,"events"),im(this,"namespace"),im(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n),this.chainId=e,this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;const i=W1(n);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Rc(new Pl(r,rr("disableProviderPing")))}};var RQe=Object.defineProperty,MQe=(t,e,n)=>e in t?RQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,sm=(t,e,n)=>MQe(t,typeof e!="symbol"?e+"":e,n);let OQe=class{constructor(e){sm(this,"name","near"),sm(this,"client"),sm(this,"httpProviders"),sm(this,"events"),sm(this,"namespace"),sm(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){if(this.chainId=e,!this.httpProviders[e]){const r=n||La(`${this.name}:${e}`,this.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;e[n]=this.createHttpProvider(n,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace);return typeof r>"u"?void 0:new Rc(new Pl(r,rr("disableProviderPing")))}};var jQe=Object.defineProperty,NQe=(t,e,n)=>e in t?jQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,om=(t,e,n)=>NQe(t,typeof e!="symbol"?e+"":e,n);let DQe=class{constructor(e){om(this,"name","tezos"),om(this,"client"),om(this,"httpProviders"),om(this,"events"),om(this,"namespace"),om(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,n){if(this.chainId=e,!this.httpProviders[e]){const r=n||La(`${this.name}:${e}`,this.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{e[n]=this.createHttpProvider(n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace);return typeof r>"u"?void 0:new Rc(new Pl(r))}};var LQe=Object.defineProperty,BQe=(t,e,n)=>e in t?LQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,am=(t,e,n)=>BQe(t,typeof e!="symbol"?e+"":e,n);let FQe=class{constructor(e){am(this,"name",xm),am(this,"client"),am(this,"httpProviders"),am(this,"events"),am(this,"namespace"),am(this,"chainId"),this.namespace=e.namespace,this.events=rr("events"),this.client=rr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n),this.chainId=e,this.events.emit(Mc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){var e,n;const r={};return(n=(e=this.namespace)==null?void 0:e.accounts)==null||n.forEac
vendor: 8,436 bytes, line 149
149h(i=>{const s=Qm(i);r[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),r}getHttpProvider(e){const n=this.httpProviders[e];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||La(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Rc(new Pl(r,rr("disableProviderPing")))}};var UQe=Object.defineProperty,zQe=Object.defineProperties,WQe=Object.getOwnPropertyDescriptors,aY=Object.getOwnPropertySymbols,HQe=Object.prototype.hasOwnProperty,VQe=Object.prototype.propertyIsEnumerable,uO=(t,e,n)=>e in t?UQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,o6=(t,e)=>{for(var n in e||(e={}))HQe.call(e,n)&&uO(t,n,e[n]);if(aY)for(var n of aY(e))VQe.call(e,n)&&uO(t,n,e[n]);return t},aI=(t,e)=>zQe(t,WQe(e)),Xa=(t,e,n)=>uO(t,typeof e!="symbol"?e+"":e,n);let qQe=class Jde{constructor(e){Xa(this,"client"),Xa(this,"namespaces"),Xa(this,"optionalNamespaces"),Xa(this,"sessionProperties"),Xa(this,"scopedProperties"),Xa(this,"events",new aL),Xa(this,"rpcProviders",{}),Xa(this,"session"),Xa(this,"providerOpts"),Xa(this,"logger"),Xa(this,"uri"),Xa(this,"disableProviderPing",!1),this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:j5(n_({level:(e==null?void 0:e.logger)||WZ})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const n=new Jde(e);return await n.initialize(),n}async request(e,n,r){const[i,s]=this.validateChain(n);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:o6({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:r})}sendAsync(e,n,r,i){const s=new Date().getTime();this.request(e,r,i).then(o=>n(null,r_(s,o))).catch(o=>n(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Br("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,n){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:i}=await this.client.authenticate(e,n);r&&(this.uri=r,this.events.emit("display_uri",r));const s=await i();if(this.session=s.session,this.session){const o=XZ(this.session.namespaces);this.namespaces=s6(this.namespaces,o),await this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}removeListener(e,n){this.events.removeListener(e,n)}off(e,n){this.events.off(e,n)}get isWalletConnect(){return!0}async pair(e){const{uri:n,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});n&&(this.uri=n,this.events.emit("display_uri",n));const i=await r();this.session=i;const s=XZ(i.namespaces);return this.namespaces=s6(this.namespaces,s),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,n){try{if(!this.session)return;const[r,i]=this.validateChain(e),s=this.getProvider(r);s.name===xm?s.setDefaultChain(`${r}:${i}`,n):s.setDefaultChain(i,n)}catch(r){if(!/Please call connect/.test(r.message))throw r}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const n=this.client.pairing.getAll();if(wc(n)){for(const r of n)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${n.length}`)}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,n;if(this.client=this.providerOpts.client||await sYe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||WZ,relayUrl:this.providerOpts.relayUrl||gYe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(r){throw this.logger.error("Failed to get session",r),new Error(`The provided session: ${(n=(e=this.providerOpts)==null?void 0:e.session)==null?void 0:n.topic} doesn't exist in the Sign client`)}else{const r=this.client.session.getAll();this.session=r[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(n=>Im(n)))];sI("client",this.client),sI("events",this.events),sI("disableProviderPing",this.disableProviderPing),e.forEach(n=>{if(!this.session)return;const r=XYe(n,this.session);if((r==null?void 0:r.length)===0)return;const i=Qde(r),s=s6(this.namespaces,this.optionalNamespaces),o=aI(o6({},s[n]),{accounts:r,chains:i});switch(n){case"eip155":this.rpcProviders[n]=new fQe({namespace:o});break;case"algorand":this.rpcProviders[n]=new EQe({namespace:o});break;case"solana":this.rpcProviders[n]=new mQe({namespace:o});break;case"cosmos":this.rpcProviders[n]=new vQe({namespace:o});break;case"polkadot":this.rpcProviders[n]=new aQe({namespace:o});break;case"cip34":this.rpcProviders[n]=new SQe({namespace:o});break;case"elrond":this.rpcProviders[n]=new $Qe({namespace:o});break;case"multiversx":this.rpcProviders[n]=new PQe({namespace:o});break;case"near":this.rpcProviders[n]=new OQe({namespace:o});break;case"tezos":this.rpcProviders[n]=new DQe({namespace:o});break;default:this.rpcProviders[xm]?this.rpcProviders[xm].updateNamespace(o):this.rpcProviders[xm]=new FQe({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var n;const{topic:r}=e;r===((n=this.session)==null?void 0:n.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var n;const{params:r,topic:i}=e;if(i!==((n=this.session)==null?void 0:n.topic))return;const{event:s}=r;if(s.name==="accountsChanged"){const o=s.data;o&&wc(o)&&this.events.emit("accountsChanged",o.map(QZ))}else if(s.name==="chainChanged"){const o=r.chainId,a=r.event.data,c=Im(o),l=iI(o)!==iI(a)?`${c}:${iI(a)}`:o;this.onChainChanged(l)}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:n})=>{var r,i;if(e!==((r=this.session)==null?void 0:r.topic))return;const{namespaces:s}=n,o=(i=this.client)==null?void 0:i.session.get(e);this.session=aI(o6({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:n})}),this.client.on("session_delete",async e=>{var n;e.topic===((n=this.session)==null?void 0:n.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",aI(o6({},Br("USER_DISCONNECTED")),{data:e.topic})))}),this.on(Mc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[xm]}
149onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var n;this.getProvider(e).updateNamespace((n=this.session)==null?void 0:n.namespaces[e])})}setNamespaces(e){const{namespaces:n={},optionalNamespaces:r={},sessionProperties:i,scopedProperties:s}=e;this.optionalNamespaces=s6(n,r),this.sessionProperties=i,this.scopedProperties=s}validateChain(e){const[n,r]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[n,r];if(n&&!Object.keys(this.namespaces||{}).map(o=>Im(o)).includes(n))throw new Error(`Namespace '${n}' is not configured. Please call connect() first with namespace config.`);if(n&&r)return[n,r];const i=Im(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged(e,n=!1){if(!this.namespaces)return;const[r,i]=this.validateChain(e);if(!i)return;this.updateNamespaceChain(r,i),this.events.emit("chainChanged",i);const s=this.getProvider(r).getDefaultChain();n||this.getProvider(r).setDefaultChain(i),this.emitAccountsChangedOnChainChange({namespace:r,previousChainId:s,newChainId:e}),await this.persist("namespaces",this.namespaces)}emitAccountsChangedOnChainChange({namespace:e,previousChainId:n,newChainId:r}){var i,s;try{if(n===r)return;const o=(s=(i=this.session)==null?void 0:i.namespaces[e])==null?void 0:s.accounts;if(!o)return;const a=o.filter(c=>c.includes(`${r}:`)).map(QZ);if(!wc(a))return;this.events.emit("accountsChanged",a)}catch(o){this.logger.warn("Failed to emit accountsChanged on chain change",o)}}updateNamespaceChain(e,n){if(!this.namespaces)return;const r=this.namespaces[e]?e:`${e}:${n}`,i={chains:[],methods:[],events:[],defaultChain:n};this.namespaces[r]?this.namespaces[r]&&(this.namespaces[r].defaultChain=n):this.namespaces[r]=i}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,n){var r;const i=((r=this.session)==null?void 0:r.topic)||"";await this.client.core.storage.setItem(`${r6}/${e}${i}`,n)}async getFromStore(e){var n;const r=((n=this.session)==null?void 0:n.topic)||"";return await this.client.core.storage.getItem(`${r6}/${e}${r}`)}async deleteFromStore(e){var n;const r=((n=this.session)==null?void 0:n.topic)||"";await this.client.core.storage.removeItem(`${r6}/${e}${r}`)}async cleanupStorage(){var e;try{if(((e=this.client)==null?void 0:e.session.length)>0)return;const n=await this.client.core.storage.getKeys();for(const r of n)r.startsWith(r6)&&await this.client.core.storage.removeItem(r)}catch(n){this.logger.warn("Failed to cleanup storage",n)}}};const KQe=qQe,GQe="wc",ZQe="ethereum_provider",YQe=`${GQe}@2:${ZQe}:`,QQe="https://rpc.walletconnect.org/v1/",dO=["eth_sendTransaction","personal_sign"],ehe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],hO=["chainChanged","accountsChanged"],the=["chainChanged","accountsChanged","message","disconnect","connect"],XQe=async()=>{const{createAppKit:t}=await mr(()=>import("./core-BOzHcyJ6.js").then(e=>e.G),__vite__mapDeps([0,1]));return t};var JQe=Object.defineProperty,eXe=Object.defineProperties,tXe=Object.getOwnPropertyDescriptors,cY=Object.getOwnPropertySymbols,nXe=Object.prototype.hasOwnProperty,rXe=Object.prototype.propertyIsEnumerable,fO=(t,e,n)=>e in t?JQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,n0=(t,e)=>{for(var n in e||(e={}))nXe.call(e,n)&&fO(t,n,e[n]);if(cY)for(var n of cY(e))rXe.call(e,n)&&fO(t,n,e[n]);return t},hv=(t,e)=>eXe(t,tXe(e)),Sa=(t,e,n)=>fO(t,typeof e!="symbol"?e+"":e,n);function x9(t){return Number(t[0].split(":")[1])}function a6(t){return`0x${t.toString(16)}`}function iXe(t){const{chains:e,optionalChains:n,methods:r,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!wc(e))throw new Error("Invalid chains");const c={chains:e,methods:r||dO,events:s||hO,rpcMap:n0({},e.length?{[x9(e)]:a[x9(e)]}:{})},l=s==null?void 0:s.filter(f=>!hO.includes(f)),u=r==null?void 0:r.filter(f=>!dO.includes(f));if(!n&&!o&&!i&&!(l!=null&&l.length)&&!(u!=null&&u.length))return{required:e.length?c:void 0};const d=(l==null?void 0:l.length)&&(u==null?void 0:u.length)||!n,h={chains:[...new Set(d?c.chains.concat(n||[]):n)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:ehe))],events:[...new Set(c.events.concat(o!=null&&o.length?o:the))],rpcMap:a};return{required:e.length?c:void 0,optional:n.length?h:void 0}}let sXe=class nhe{constructor(){Sa(this,"events",new Wa.EventEmitter),Sa(this,"namespace","eip155"),Sa(this,"accounts",[]),Sa(this,"signer"),Sa(this,"chainId",1),Sa(this,"modal"),Sa(this,"rpc"),Sa(this,"STORAGE_KEY",YQe),Sa(this,"on",(e,n)=>(this.events.on(e,n),this)),Sa(this,"once",(e,n)=>(this.events.once(e,n),this)),Sa(this,"removeListener",(e,n)=>(this.events.removeListener(e,n),this)),Sa(this,"off",(e,n)=>(this.events.off(e,n),this)),Sa(this,"parseAccount",e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e),this.signer={},this.rpc={}}static async init(e){const n=new nhe;return await n.initialize(e),n}async request(e,n){return await this.signer.request(e,this.formatChainId(this.chainId),n)}sendAsync(e,n,r){this.signer.sendAsync(e,n,this.formatChainId(this.chainId),r)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){var n;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:i}=iXe(this.rpc);try{const s=await new Promise(async(a,c)=>{var l,u;this.rpc.showQrModal&&((l=this.modal)==null||l.open(),(u=this.modal)==null||u.subscribeState(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),c(new Error("Connection request reset. Please try again.")))}));const d=e!=null&&e.scopedProperties?{[this.namespace]:e.scopedProperties}:void 0;await this.signer.connect(hv(n0({namespaces:n0({},r&&{[this.namespace]:r})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic,scopedProperties:d})).then(h=>{a(h)}).catch(h=>{var f;(f=this.modal)==null||f.showErrorMessage("Unable to connect"),c(new Error(h.message))})});if(!s)return;const o=KK(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:a6(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{(n=this.modal)==null||n.close()}}async authenticate(e,n){var r;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(o,a)=>{var c,l;this.rpc.showQrModal&&((c=this.modal)==null||c.open(),(l=this.modal)==null||l.subscribeState(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(hv(n0({},e),{chains:this.rpc.chains}),n).then(u=>{o(u)}).catch(u=>{var d;(d=this.modal)==null||d.showErrorMessage("Unable to connect"),a(new Error(u.message))})}),s=i.session;if(s){const o=KK(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:a6(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{(r=this.modal)==null||r.close()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:n}=e,{event:r}=n;r.name==="accountsChanged"?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):r.name==="chainChanged"?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)}),this.signer.on("accountsChanged",e=>{this.accounts=this.parseAccounts(e),this.events.emit("accountsChanged",this.accounts)}),this.signer.on("chainChanged",e=>{const n=parseInt(e);this.chainId=n,this.events.emit("chainChanged",a6(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",hv(n0({},Br("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const n=e.filter(r=>this.isCompatibleChainId(r)).map(r=>this.parseChainId(r));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",a6(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const n=this.parseChainId(e);this.chainId=n,this.switchEthereumChain(n)}}parseAccountId(e){const[n,r,i]=e.split(":");return{chainId:`${n}:${r}`,address:i}}setAccounts(e){this.accounts=e.filter(n=>this.parseChainId(this.parseAccountId(n).chainId)===this.chainId).map(n=>this.parseAccountId(n).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var n,r;const i=(n=e==null?void 0:e.chains)!=null?n:[],s=(r=e==null?void 0:e.optionalChains)!=null?r:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||dO:[],c=i.length?(e==null?void 0:e.events)||hO:[],l=(e==null?void 0:e.optionalMethods)||[],u=(e==null?void 0:e.optionalEvents)||[],d=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),h=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(f=>this.formatChainId(f)),optionalChains:s.map(f=>this.formatChainId(f)),methods:a,events:c,optionalMethods:l,optionalEvents:u,rpcMap:d,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:h,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,n){const r={};return e.forEach(i=>
149{r[i]=this.getRpcUrl(i,n)}),r}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?x9(this.rpc.chains):x9(this.rpc.optionalChains),this.signer=await KQe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storage:e.storage,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let n;try{const r=await XQe(),{convertWCMToAppKitOptions:i}=await Promise.resolve().then(function(){return mXe}),s=i(hv(n0({},this.rpc.qrModalOptions),{chains:[...new Set([...this.rpc.chains,...this.rpc.optionalChains])],metadata:this.rpc.metadata,projectId:this.rpc.projectId}));if(!s.networks.length)throw new Error("No networks found for WalletConnect·");n=r(hv(n0({},s),{universalProvider:this.signer,manualWCControl:!0}))}catch(r){throw console.warn(r),new Error("To use QR modal, please install @reown/appkit package")}if(n)try{this.modal=n}catch(r){throw this.signer.logger.error(r),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:n,optionalChains:r,rpcMap:i}=e;n&&wc(n)&&(this.rpc.chains=n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),r&&wc(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r==null?void 0:r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,n){var r;return((r=this.rpc.rpcMap)==null?void 0:r[e])||`${QQe}?chainId=eip155:${e}&projectId=${n||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),n=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:n==null?void 0:n.accounts),this.setAccounts(n==null?void 0:n.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(n=>this.signer.logger.warn(n))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(n=>this.parseAccount(n))}};const oXe=sXe;var aXe=Object.defineProperty,cXe=Object.defineProperties,lXe=Object.getOwnPropertyDescriptors,lY=Object.getOwnPropertySymbols,uXe=Object.prototype.hasOwnProperty,dXe=Object.prototype.propertyIsEnumerable,uY=(t,e,n)=>e in t?aXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rhe=(t,e)=>{for(var n in e||(e={}))uXe.call(e,n)&&uY(t,n,e[n]);if(lY)for(var n of lY(e))dXe.call(e,n)&&uY(t,n,e[n]);return t},hXe=(t,e)=>cXe(t,lXe(e));function fXe(t){if(t)return{"--w3m-font-family":t["--wcm-font-family"],"--w3m-accent":t["--wcm-accent-color"],"--w3m-color-mix":t["--wcm-background-color"],"--w3m-z-index":t["--wcm-z-index"]?Number(t["--wcm-z-index"]):void 0,"--w3m-qr-color":t["--wcm-accent-color"],"--w3m-font-size-master":t["--wcm-text-medium-regular-size"],"--w3m-border-radius-master":t["--wcm-container-border-radius"],"--w3m-color-mix-strength":0}}const pXe=t=>{const[e,n]=t.split(":");return ihe({id:n,caipNetworkId:t,chainNamespace:e,name:"",nativeCurrency:{name:"",symbol:"",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}})};function gXe(t){var e,n,r,i,s,o,a;const c=(e=t.chains)==null?void 0:e.map(pXe).filter(Boolean);if(c.length===0)throw new Error("At least one chain must be specified");const l=c.find(d=>{var h;return d.id===((h=t.defaultChain)==null?void 0:h.id)}),u={projectId:t.projectId,networks:c,themeMode:t.themeMode,themeVariables:fXe(t.themeVariables),chainImages:t.chainImages,connectorImages:t.walletImages,defaultNetwork:l,metadata:hXe(rhe({},t.metadata),{name:((n=t.metadata)==null?void 0:n.name)||"WalletConnect",description:((r=t.metadata)==null?void 0:r.description)||"Connect to WalletConnect-compatible wallets",url:((i=t.metadata)==null?void 0:i.url)||"https://walletconnect.org",icons:((s=t.metadata)==null?void 0:s.icons)||["https://walletconnect.org/walletconnect-logo.png"]}),showWallets:!0,featuredWalletIds:t.explorerRecommendedWalletIds==="NONE"?[]:Array.isArray(t.explorerRecommendedWalletIds)?t.explorerRecommendedWalletIds:[],excludeWalletIds:t.explorerExcludedWalletIds==="ALL"?[]:Array.isArray(t.explorerExcludedWalletIds)?t.explorerExcludedWalletIds:[],enableEIP6963:!1,enableInjected:!1,enableCoinbase:!0,enableWalletConnect:!0,features:{email:!1,socials:!1}};if((o=t.mobileWallets)!=null&&o.length||(a=t.desktopWallets)!=null&&a.length){const d=[...(t.mobileWallets||[]).map(m=>({id:m.id,name:m.name,links:m.links})),...(t.desktopWallets||[]).map(m=>({id:m.id,name:m.name,links:{native:m.links.native,universal:m.links.universal}}))],h=[...u.featuredWalletIds||[],...u.excludeWalletIds||[]],f=d.filter(m=>!h.includes(m.id));f.length&&(u.customWallets=f)}return u}function ihe(t){return rhe({formatters:void 0,fees:void 0,serializers:void 0},t)}var mXe=Object.freeze({__proto__:null,convertWCMToAppKitOptions:gXe,defineChain:ihe});function yXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const LL=E.forwardRef(yXe);
149function wXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"}))}const H1=E.forwardRef(wXe);function vXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const bXe=E.forwardRef(vXe);function xXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"}))}const xl=E.forwardRef(xXe);function EXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const Uu=E.forwardRef(EXe);function CXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const c_=E.forwardRef(CXe);function _Xe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const pO=E.forwardRef(_Xe);function SXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}),E.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}const AXe=E.forwardRef(SXe);function kXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
149currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const l_=E.forwardRef(kXe);var cI,dY;function $Xe(){if(dY)return cI;dY=1;var t=function(o,a){return Math.round(a*Math.log(o)/Math.LN2)},e=[{name:"lowercase",re:/[a-z]/,length:26},{name:"uppercase",re:/[A-Z]/,length:26},{name:"numbers",re:/[0-9]/,length:10},{name:"symbols",re:/[^a-zA-Z0-9]/,length:33}],n=function(o){return function(a){return o.reduce(function(c,l){return c+(l.re.test(a)?l.length:0)},0)}},r=n(e),i=function(o){return o?t(r(o),o.length):0};return cI=i,cI}var IXe=$Xe();const TXe=ys(IXe);function she(t){return crypto.getRandomValues(new Uint8Array(t))}const PXe=256,yb=65536;function RXe(){const[t]=she(1);return t}function MXe(){const[t,e]=she(2);return(t<<8)+e}function OXe(t){if(typeof t!="number"||t<2||t>yb)throw new Error(`Invalid number: number must be at least two and at most ${yb}`);const e=t>256,n=e?yb:PXe,r=e?MXe:RXe,i=t*Math.floor(n/t);for(;;){const s=r();if(s<i)return s%t}}function jXe(t,e,n){if(typeof n!="number"||n>yb)throw new Error(`Invalid argument: end must be a number less than or equal to ${yb}`);if(n-e<2)throw new Error("Invalid range: range must contain at least two values");const r=[];for(let i=0;i<t;i++)r[i]=e+OXe(n-e);return r}function NXe(t,e,n="-"){if(!Array.isArray(e)||e.length<2)throw new Error("Invalid argument: wordlist argument must be an array with length greater than or equal to 2");if(typeof n!="string")throw new Error("Invalid argument: sep argument must be a string");return jXe(t,0,e.length).reduce((r,i,s)=>{const o=e[i];return r+(s===0?o:n+o)},"")}const DXe=Object.freeze(["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","am
149igo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","co
149astline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dis
149h","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","eup
149hemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","gi
149ddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungr
149ily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","
149junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasse
149s","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastram
149i","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","re
149cycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","
149sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","
149shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","
149sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","t
149ingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unus
149able","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]),LXe=Object.freeze(DXe.filter(t=>!t.includes("-")));function BXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"}))}const ohe=E.forwardRef(BXe);function FXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))}const UXe=E.forwardRef(FXe);function zXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
149currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const C1=E.forwardRef(zXe);function WXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const HXe=E.forwardRef(WXe);function VXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const qXe=E.forwardRef(VXe);function KXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const GXe=E.forwardRef(KXe);function ZXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const YXe=E.forwardRef(ZXe);function QXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const XXe=E.forwardRef(QXe);function JXe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75"}))}const ahe=E.forwardRef(JXe);function eJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.7
1495"}))}const tJe=E.forwardRef(eJe);function nJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z",clipRule:"evenodd"}))}const che=E.forwardRef(nJe);function rJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))}const _1=E.forwardRef(rJe);var cm={},lI,hY;function iJe(){return hY||(hY=1,lI=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),lI}var uI={},nf={},fY;function V1(){if(fY)return nf;fY=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return nf.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},nf.getSymbolTotalCodewords=function(r){return e[r]},nf.getBCHDigit=function(n){let r=0;for(;n!==0;)r++,n>>>=1;return r},nf.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');t=r},nf.isKanjiModeEnabled=function(){return typeof t<"u"},nf.toSJIS=function(r){return t(r)},nf}var dI={},pY;function BL(){return pY||(pY=1,function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,i){if(t.isValid(r))return r;try{return e(r)}catch{return i}}}(dI)),dI}var hI,gY;function sJe(){if(gY)return hI;gY=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const n=Math.floor(e/8);return(this.buffer[n]>>>7-e%8&1)===1},put:function(e,n){for(let r=0;r<n;r++)this.putBit((e>>>n-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),e&&(this.buffer[n]|=128>>>this.length%8),this.length++}},hI=t,hI}var fI,mY;function oJe(){if(mY)return fI;mY=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,n,r,i){const s=e*this.size+n;this.data[s]=r,i&&(this.reservedBit[s]=!0)},t.prototype.get=function(e,n){return this.data[e*this.size+n]},t.prototype.xor=function(e,n,r){this.data[e*this.size+n]^=r},t.prototype.isReserved=function(e,n){return this.reservedBit[e*this.size+n]},fI=t,fI}var pI={},yY;function aJe(){return yY||(yY=1,function(t){const e=V1().getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const i=Math.floor(r/7)+2,s=e(r),o=s===145?26:Math.ceil((s-13)/(2*i-2))*2,a=[s-7];for(let c=1;c<i-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},t.getPositions=function(r){const i=[],s=t.getRowColCoords(r),o=s.length;for(let a=0;a<o;a++)for(let c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||i.push([s[a],s[c]]);return i}}(pI)),pI}var gI={},wY;function cJe(){if(wY)return gI;wY=1;const t=V1().getSymbolSize,e=7;return gI.getPositions=function(r){const i=t(r);return[[0,0],[i-e,0],[0,i-e]]},gI}var mI={},vY;function lJe(){return vY||(vY=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const s=i.size;let o=0,a=0,c=0,l=null,u=null;for(let d=0;d<s;d++){a=c=0,l=u=null;for(let h=0;h<s;h++){let f=i.get(d,h);f===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=f,a=1),f=i.get(h,d),f===u?c++:(c>
vendor: 23,497 bytes, lines 149-156
149=5&&(o+=e.N1+(c-5)),u=f,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},t.getPenaltyN2=function(i){const s=i.size;let o=0;for(let a=0;a<s-1;a++)for(let c=0;c<s-1;c++){const l=i.get(a,c)+i.get(a,c+1)+i.get(a+1,c)+i.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},t.getPenaltyN3=function(i){const s=i.size;let o=0,a=0,c=0;for(let l=0;l<s;l++){a=c=0;for(let u=0;u<s;u++)a=a<<1&2047|i.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|i.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*e.N3},t.getPenaltyN4=function(i){let s=0;const o=i.data.length;for(let c=0;c<o;c++)s+=i.data[c];return Math.abs(Math.ceil(s*100/o/5)-10)*e.N4};function n(r,i,s){switch(r){case t.Patterns.PATTERN000:return(i+s)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(i+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return i*s%2+i*s%3===0;case t.Patterns.PATTERN110:return(i*s%2+i*s%3)%2===0;case t.Patterns.PATTERN111:return(i*s%3+(i+s)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}t.applyMask=function(i,s){const o=s.size;for(let a=0;a<o;a++)for(let c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,n(i,c,a))},t.getBestMask=function(i,s){const o=Object.keys(t.Patterns).length;let a=0,c=1/0;for(let l=0;l<o;l++){s(l),t.applyMask(l,i);const u=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(l,i),u<c&&(c=u,a=l)}return a}}(mI)),mI}var c6={},bY;function lhe(){if(bY)return c6;bY=1;const t=BL(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return c6.getBlocksCount=function(i,s){switch(s){case t.L:return e[(i-1)*4+0];case t.M:return e[(i-1)*4+1];case t.Q:return e[(i-1)*4+2];case t.H:return e[(i-1)*4+3];default:return}},c6.getTotalCodewordsCount=function(i,s){switch(s){case t.L:return n[(i-1)*4+0];case t.M:return n[(i-1)*4+1];case t.Q:return n[(i-1)*4+2];case t.H:return n[(i-1)*4+3];default:return}},c6}var yI={},fv={},xY;function uJe(){if(xY)return fv;xY=1;const t=new Uint8Array(512),e=new Uint8Array(256);return function(){let r=1;for(let i=0;i<255;i++)t[i]=r,e[r]=i,r<<=1,r&256&&(r^=285);for(let i=255;i<512;i++)t[i]=t[i-255]}(),fv.log=function(r){if(r<1)throw new Error("log("+r+")");return e[r]},fv.exp=function(r){return t[r]},fv.mul=function(r,i){return r===0||i===0?0:t[e[r]+e[i]]},fv}var EY;function dJe(){return EY||(EY=1,function(t){const e=uJe();t.mul=function(r,i){const s=new Uint8Array(r.length+i.length-1);for(let o=0;o<r.length;o++)for(let a=0;a<i.length;a++)s[o+a]^=e.mul(r[o],i[a]);return s},t.mod=function(r,i){let s=new Uint8Array(r);for(;s.length-i.length>=0;){const o=s[0];for(let c=0;c<i.length;c++)s[c]^=e.mul(i[c],o);let a=0;for(;a<s.length&&s[a]===0;)a++;s=s.slice(a)}return s},t.generateECPolynomial=function(r){let i=new Uint8Array([1]);for(let s=0;s<r;s++)i=t.mul(i,new Uint8Array([1,e.exp(s)]));return i}}(yI)),yI}var wI,CY;function hJe(){if(CY)return wI;CY=1;const t=dJe();function e(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(r){this.degree=r,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(r.length+this.degree);i.set(r);const s=t.mod(i,this.genPoly),o=this.degree-s.length;if(o>0){const a=new Uint8Array(this.degree);return a.set(s,o),a}return s},wI=e,wI}var vI={},bI={},xI={},_Y;function uhe(){return _Y||(_Y=1,xI.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),xI}var ql={},SY;function dhe(){if(SY)return ql;SY=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r 150]))+`;ql.KANJI=new RegExp(n,"g"),ql.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ql.BYTE=new RegExp(r,"g"),ql.NUMERIC=new RegExp(t,"g"),ql.ALPHANUMERIC=new RegExp(e,"g");const i=new RegExp("^"+n+"$"),s=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ql.testKanji=function(c){return i.test(c)},ql.testNumeric=function(c){return s.test(c)},ql.testAlphanumeric=function(c){return o.test(c)},ql}var AY;function q1(){return AY||(AY=1,function(t){const e=uhe(),n=dhe();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return n.testNumeric(s)?t.NUMERIC:n.testAlphanumeric(s)?t.ALPHANUMERIC:n.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(s,o){if(t.isValid(s))return s;try{return r(s)}catch{return o}}}(bI)),bI}var kY;function fJe(){return kY||(kY=1,function(t){const e=V1(),n=lhe(),r=BL(),i=q1(),s=uhe(),o=7973,a=e.getBCHDigit(o);function c(h,f,m){for(let y=1;y<=40;y++)if(f<=t.getCapacity(y,m,h))return y}function l(h,f){return i.getCharCountIndicator(h,f)+4}function u(h,f){let m=0;return h.forEach(function(y){const v=l(y.mode,f);m+=v+y.getBitsLength()}),m}function d(h,f){for(let m=1;m<=40;m++)if(u(h,m)<=t.getCapacity(m,f,i.MIXED))return m}t.from=function(f,m){return s.isValid(f)?parseInt(f,10):m},t.getCapacity=function(f,m,y){if(!s.isValid(f))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=i.BYTE);const v=e.getSymbolTotalCodewords(f),b=n.getTotalCodewordsCount(f,m),C=(v-b)*8;if(y===i.MIXED)return C;const x=C-l(y,f);switch(y){case i.NUMERIC:return Math.floor(x/10*3);case i.ALPHANUMERIC:return Math.floor(x/11*2);case i.KANJI:return Math.floor(x/13);case i.BYTE:default:return Math.floor(x/8)}},t.getBestVersionForData=function(f,m){let y;const v=r.from(m,r.M);if(Array.isArray(f)){if(f.length>1)return d(f,v);if(f.length===0)return 1;y=f[0]}else y=f;return c(y.mode,y.getLength(),v)},t.getEncodedBits=function(f){if(!s.isValid(f)||f<7)throw new Error("Invalid QR Code version");let m=f<<12;for(;e.getBCHDigit(m)-a>=0;)m^=o<<e.getBCHDigit(m)-a;return f<<12|m}}(vI)),vI}var EI={},$Y;function pJe(){if($Y)return EI;$Y=1;const t=V1(),e=1335,n=21522,r=t.getBCHDigit(e);return EI.getEncodedBits=function(s,o){const a=s.bit<<3|o;let c=a<<10;for(;t.getBCHDigit(c)-r>=0;)c^=e<<t.getBCHDigit(c)-r;return(a<<10|c)^n},EI}var CI={},_I,IY;function gJe(){if(IY)return _I;IY=1;const t=q1();function e(n){this.mode=t.NUMERIC,this.data=n.toString()}return e.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(r){let i,s,o;for(i=0;i+3<=this.data.length;i+=3)s=this.data.substr(i,3),o=parseInt(s,10),r.put(o,10);const a=this.data.length-i;a>0&&(s=this.data.substr(i),o=parseInt(s,10),r.put(o,a*3+1))},_I=e,_I}var SI,TY;function mJe(){if(TY)return SI;TY=1;const t=q1(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(r){this.mode=t.ALPHANUMERIC,this.data=r}return n.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(i){let s;for(s=0;s+2<=this.data.length;s+=2){let o=e.indexOf(this.data[s])*45;o+=e.indexOf(this.data[s+1]),i.put(o,11)}this.data.length%2&&i.put(e.indexOf(this.data[s]),6)},SI=n,SI}var AI,PY;function yJe(){if(PY)return AI;PY=1;const t=q1();function e(n){this.mode=t.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}return e.getBitsLength=function(r){return r*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(n){for(let r=0,i=this.data.length;r<i;r++)n.put(this.data[r],8)},AI=e,AI}var kI,RY;function wJe(){if(RY)return kI;RY=1;const t=q1(),e=V1();function n(r){this.mode=t.KANJI,this.data=r}return n.getBitsLength=function(i){return i*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let i;for(i=0;i<this.data.length;i++){let s=e.toSJIS(this.data[i]);if(s>=33088&&s<=40956)s-=33088;else if(s>=57408&&s<=60351)s-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+` 151Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),r.put(s,13)}},kI=n,kI}var $I={exports:{}},MY;function vJe(){return MY||(MY=1,function(t){var e={single_source_shortest_paths:function(n,r,i){var s={},o={};o[r]=0;var a=e.PriorityQueue.make();a.push(r,0);for(var c,l,u,d,h,f,m,y,v;!a.empty();){c=a.pop(),l=c.value,d=c.cost,h=n[l]||{};for(u in h)h.hasOwnProperty(u)&&(f=h[u],m=d+f,y=o[u],v=typeof o[u]>"u",(v||y>m)&&(o[u]=m,a.push(u,m),s[u]=l))}if(typeof i<"u"&&typeof o[i]>"u"){var b=["Could not find a path from ",r," to ",i,"."].join("");throw new Error(b)}return s},extract_shortest_path_from_predecessor_list:function(n,r){for(var i=[],s=r;s;)i.push(s),n[s],s=n[s];return i.reverse(),i},find_path:function(n,r,i){var s=e.single_source_shortest_paths(n,r,i);return e.extract_shortest_path_from_predecessor_list(s,i)},PriorityQueue:{make:function(n){var r=e.PriorityQueue,i={},s;n=n||{};for(s in r)r.hasOwnProperty(s)&&(i[s]=r[s]);return i.queue=[],i.sorter=n.sorter||r.default_sorter,i},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var i={value:n,cost:r};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e}($I)),$I.exports}var OY;function bJe(){return OY||(OY=1,function(t){const e=q1(),n=gJe(),r=mJe(),i=yJe(),s=wJe(),o=dhe(),a=V1(),c=vJe();function l(b){return unescape(encodeURIComponent(b)).length}function u(b,C,x){const _=[];let $;for(;($=b.exec(x))!==null;)_.push({data:$[0],index:$.index,mode:C,length:$[0].length});return _}function d(b){const C=u(o.NUMERIC,e.NUMERIC,b),x=u(o.ALPHANUMERIC,e.ALPHANUMERIC,b);let _,$;return a.isKanjiModeEnabled()?(_=u(o.BYTE,e.BYTE,b),$=u(o.KANJI,e.KANJI,b)):(_=u(o.BYTE_KANJI,e.BYTE,b),$=[]),C.concat(x,_,$).sort(function(R,N){return R.index-N.index}).map(function(R){return{data:R.data,mode:R.mode,length:R.length}})}function h(b,C){switch(C){case e.NUMERIC:return n.getBitsLength(b);case e.ALPHANUMERIC:return r.getBitsLength(b);case e.KANJI:return s.getBitsLength(b);case e.BYTE:return i.getBitsLength(b)}}function f(b){return b.reduce(function(C,x){const _=C.length-1>=0?C[C.length-1]:null;return _&&_.mode===x.mode?(C[C.length-1].data+=x.data,C):(C.push(x),C)},[])}function m(b){const C=[];for(let x=0;x<b.length;x++){const _=b[x];switch(_.mode){case e.NUMERIC:C.push([_,{data:_.data,mode:e.ALPHANUMERIC,length:_.length},{data:_.data,mode:e.BYTE,length:_.length}]);break;case e.ALPHANUMERIC:C.push([_,{data:_.data,mode:e.BYTE,length:_.length}]);break;case e.KANJI:C.push([_,{data:_.data,mode:e.BYTE,length:l(_.data)}]);break;case e.BYTE:C.push([{data:_.data,mode:e.BYTE,length:l(_.data)}])}}return C}function y(b,C){const x={},_={start:{}};let $=["start"];for(let I=0;I<b.length;I++){const R=b[I],N=[];for(let T=0;T<R.length;T++){const O=R[T],U=""+I+T;N.push(U),x[U]={node:O,lastCount:0},_[U]={};for(let z=0;z<$.length;z++){const L=$[z];x[L]&&x[L].node.mode===O.mode?(_[L][U]=h(x[L].lastCount+O.length,O.mode)-h(x[L].lastCount,O.mode),x[L].lastCount+=O.length):(x[L]&&(x[L].lastCount=O.length),_[L][U]=h(O.length,O.mode)+4+e.getCharCountIndicator(O.mode,C))}}$=N}for(let I=0;I<$.length;I++)_[$[I]].end=0;return{map:_,table:x}}function v(b,C){let x;const _=e.getBestModeForData(b);if(x=e.from(C,_),x!==e.BYTE&&x.bit<_.bit)throw new Error('"'+b+'" cannot be encoded with mode '+e.toString(x)+`. 152 Suggested mode is: `+e.toString(_));switch(x===e.KANJI&&!a.isKanjiModeEnabled()&&(x=e.BYTE),x){case e.NUMERIC:return new n(b);case e.ALPHANUMERIC:return new r(b);case e.KANJI:return new s(b);case e.BYTE:return new i(b)}}t.fromArray=function(C){return C.reduce(function(x,_){return typeof _=="string"?x.push(v(_,null)):_.data&&x.push(v(_.data,_.mode)),x},[])},t.fromString=function(C,x){const _=d(C,a.isKanjiModeEnabled()),$=m(_),I=y($,x),R=c.find_path(I.map,"start","end"),N=[];for(let T=1;T<R.length-1;T++)N.push(I.table[R[T]].node);return t.fromArray(f(N))},t.rawSplit=function(C){return t.fromArray(d(C,a.isKanjiModeEnabled()))}}(CI)),CI}var jY;function xJe(){if(jY)return uI;jY=1;const t=V1(),e=BL(),n=sJe(),r=oJe(),i=aJe(),s=cJe(),o=lJe(),a=lhe(),c=hJe(),l=fJe(),u=pJe(),d=q1(),h=bJe();function f(I,R){const N=I.size,T=s.getPositions(R);for(let O=0;O<T.length;O++){const U=T[O][0],z=T[O][1];for(let L=-1;L<=7;L++)if(!(U+L<=-1||N<=U+L))for(let S=-1;S<=7;S++)z+S<=-1||N<=z+S||(L>=0&&L<=6&&(S===0||S===6)||S>=0&&S<=6&&(L===0||L===6)||L>=2&&L<=4&&S>=2&&S<=4?I.set(U+L,z+S,!0,!0):I.set(U+L,z+S,!1,!0))}}function m(I){const R=I.size;for(let N=8;N<R-8;N++){const T=N%2===0;I.set(N,6,T,!0),I.set(6,N,T,!0)}}function y(I,R){const N=i.getPositions(R);for(let T=0;T<N.length;T++){const O=N[T][0],U=N[T][1];for(let z=-2;z<=2;z++)for(let L=-2;L<=2;L++)z===-2||z===2||L===-2||L===2||z===0&&L===0?I.set(O+z,U+L,!0,!0):I.set(O+z,U+L,!1,!0)}}function v(I,R){const N=I.size,T=l.getEncodedBits(R);let O,U,z;for(let L=0;L<18;L++)O=Math.floor(L/3),U=L%3+N-8-3,z=(T>>L&1)===1,I.set(O,U,z,!0),I.set(U,O,z,!0)}function b(I,R,N){const T=I.size,O=u.getEncodedBits(R,N);let U,z;for(U=0;U<15;U++)z=(O>>U&1)===1,U<6?I.set(U,8,z,!0):U<8?I.set(U+1,8,z,!0):I.set(T-15+U,8,z,!0),U<8?I.set(8,T-U-1,z,!0):U<9?I.set(8,15-U-1+1,z,!0):I.set(8,15-U-1,z,!0);I.set(T-8,8,1,!0)}function C(I,R){const N=I.size;let T=-1,O=N-1,U=7,z=0;for(let L=N-1;L>0;L-=2)for(L===6&&L--;;){for(let S=0;S<2;S++)if(!I.isReserved(O,L-S)){let k=!1;z<R.length&&(k=(R[z]>>>U&1)===1),I.set(O,L-S,k),U--,U===-1&&(z++,U=7)}if(O+=T,O<0||N<=O){O-=T,T=-T;break}}}function x(I,R,N){const T=new n;N.forEach(function(S){T.put(S.mode.bit,4),T.put(S.getLength(),d.getCharCountIndicator(S.mode,I)),S.write(T)});const O=t.getSymbolTotalCodewords(I),U=a.getTotalCodewordsCount(I,R),z=(O-U)*8;for(T.getLengthInBits()+4<=z&&T.put(0,4);T.getLengthInBits()%8!==0;)T.putBit(0);const L=(z-T.getLengthInBits())/8;for(let S=0;S<L;S++)T.put(S%2?17:236,8);return _(T,I,R)}function _(I,R,N){const T=t.getSymbolTotalCodewords(R),O=a.getTotalCodewordsCount(R,N),U=T-O,z=a.getBlocksCount(R,N),L=T%z,S=z-L,k=Math.floor(T/z),M=Math.floor(U/z),W=M+1,H=k-M,D=new c(H);let V=0;const B=new Array(z),P=new Array(z);let j=0;const G=new Uint8Array(I.buffer);for(let de=0;de<z;de++){const ke=de<S?M:W;B[de]=G.slice(V,V+ke),P[de]=D.encode(B[de]),V+=ke,j=Math.max(j,ke)}const Y=new Uint8Array(T);let te=0,ae,oe;for(ae=0;ae<j;ae++)for(oe=0;oe<z;oe++)ae<B[oe].length&&(Y[te++]=B[oe][ae]);for(ae=0;ae<H;ae++)for(oe=0;oe<z;oe++)Y[te++]=P[oe][ae];return Y}function $(I,R,N,T){let O;if(Array.isArray(I))O=h.fromArray(I);else if(typeof I=="string"){let k=R;if(!k){const M=h.rawSplit(I);k=l.getBestVersionForData(M,N)}O=h.fromString(I,k||40)}else throw new Error("Invalid data");const U=l.getBestVersionForData(O,N);if(!U)throw new Error("The amount of data is too big to be stored in a QR Code");if(!R)R=U;else if(R<U)throw new Error(` 153The chosen QR Code version cannot contain this amount of data. 154Minimum version required to store current data is: `+U+`. 155`);const z=x(R,N,O),L=t.getSymbolSize(R),S=new r(L);return f(S,R),m(S),y(S,R),b(S,N,0),R>=7&&v(S,R),C(S,z),isNaN(T)&&(T=o.getBestMask(S,b.bind(null,S,N))),o.applyMask(T,S),b(S,N,T),{modules:S,version:R,errorCorrectionLevel:N,maskPattern:T,segments:O}}return uI.create=function(R,N){if(typeof R>"u"||R==="")throw new Error("No input text");let T=e.M,O,U;return typeof N<"u"&&(T=e.from(N.errorCorrectionLevel,e.M),O=l.from(N.version),U=o.from(N.maskPattern),N.toSJISFunc&&t.setToSJISFunction(N.toSJISFunc)),$(R,O,T,U)},uI}var II={},TI={},NY;function hhe(){return NY||(NY=1,function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const i=parseInt(r.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const i=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:s,scale:s?4:o,margin:i,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,i){return i.width&&i.width>=r+i.margin*2?i.width/(r+i.margin*2):i.scale},t.getImageWidth=function(r,i){const s=t.getScale(r,i);return Math.floor((r+i.margin*2)*s)},t.qrToImageData=function(r,i,s){const o=i.modules.size,a=i.modules.data,c=t.getScale(o,s),l=Math.floor((o+s.margin*2)*c),u=s.margin*c,d=[s.color.light,s.color.dark];for(let h=0;h<l;h++)for(let f=0;f<l;f++){let m=(h*l+f)*4,y=s.color.light;if(h>=u&&f>=u&&h<l-u&&f<l-u){const v=Math.floor((h-u)/c),b=Math.floor((f-u)/c);y=d[a[v*o+b]?1:0]}r[m++]=y.r,r[m++]=y.g,r[m++]=y.b,r[m]=y.a}}}(TI)),TI}var DY;function EJe(){return DY||(DY=1,function(t){const e=hhe();function n(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,o,a){let c=a,l=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(l=r()),c=e.getOptions(c);const u=e.getImageWidth(s.modules.size,c),d=l.getContext("2d"),h=d.createImageData(u,u);return e.qrToImageData(h.data,s,c),n(d,l,u),d.putImageData(h,0,0),l},t.renderToDataURL=function(s,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const l=t.render(s,o,c),u=c.type||"image/png",d=c.rendererOpts||{};return l.toDataURL(u,d.quality)}}(II)),II}var PI={},LY;function CJe(){if(LY)return PI;LY=1;const t=hhe();function e(i,s){const o=i.a/255,a=s+'="'+i.hex+'"';return o<1?a+" "+s+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function n(i,s,o){let a=i+s;return typeof o<"u"&&(a+=" "+o),a}function r(i,s,o){let a="",c=0,l=!1,u=0;for(let d=0;d<i.length;d++){const h=Math.floor(d%s),f=Math.floor(d/s);!h&&!l&&(l=!0),i[d]?(u++,d>0&&h>0&&i[d-1]||(a+=l?n("M",h+o,.5+f+o):n("m",c,0),c=0,l=!1),h+1<s&&i[d+1]||(a+=n("h",u),u=0)):c++}return a}return PI.render=function(s,o,a){const c=t.getOptions(o),l=s.modules.size,u=s.modules.data,d=l+c.margin*2,h=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",f="<path "+e(c.color.dark,"stroke")+' d="'+r(u,l,c.margin)+'"/>',m='viewBox="0 0 '+d+" "+d+'"',v='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+m+' shape-rendering="crispEdges">'+h+f+`</svg> 156`;return typeof a=="function"&&a(null,v),v},PI}var BY;function _Je(){if(BY)return cm;BY=1;const t=iJe(),e=xJe(),n=EJe(),r=CJe();function i(s,o,a,c,l){const u=[].slice.call(arguments,1),d=u.length,h=typeof u[d-1]=="function";if(!h&&!t())throw new Error("Callback required as last argument");if(h){if(d<2)throw new Error("Too few arguments provided");d===2?(l=a,a=o,o=c=void 0):d===3&&(o.getContext&&typeof l>"u"?(l=c,c=void 0):(l=c,c=a,a=o,o=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(a=o,o=c=void 0):d===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(f,m){try{const y=e.create(a,c);f(s(y,o,c))}catch(y){m(y)}})}try{const f=e.create(a,c);l(null,s(f,o,c))}catch(f){l(f)}}return cm.create=e.create,cm.toCanvas=i.bind(null,n.render),cm.toDataURL=i.bind(null,n.renderToDataURL),cm.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),cm}var SJe=_Je();const AJe=ys(SJe);function kJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.864 4.243A7.5 7.5 0 0 1 19.5 10.5c0 2.92-.556 5.709-1.568 8.268M5.742 6.364A7.465 7.465 0 0 0 4.5 10.5a7.464 7.464 0 0 1-1.15 3.993m1.989 3.559A11.209 11.209 0 0 0 8.25 10.5a3.75 3.75 0 1 1 7.5 0c0 .527-.021 1.049-.064 1.565M12 10.5a14.94 14.94 0 0 1-3.6 9.75m6.633-4.596a18.666 18.666 0 0 1-2.485 5.33"}))}const FL=E.forwardRef(kJe);function $Je({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const UL=E.forwardRef($Je);function IJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}
156const TJe=E.forwardRef(IJe);function PJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"}))}const RJe=E.forwardRef(PJe);function MJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z"}),E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z"}))}const OJe=E.forwardRef(MJe);function jJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M15.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H7.5a.75.75 0 0 1 0-1.5h11.69l-3.22-3.22a.75.75 0 0 1 0-1.06Zm-7.94 9a.75.75 0 0 1 0 1.06l-3.22 3.22H16.5a.75.75 0 0 1 0 1.5H4.81l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const zL=E.forwardRef(jJe);function NJe({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const fhe=E.forwardRef(NJe),phe=typeof document<"u"?Rt.useLayoutEffect:()=>{};var RI;const DJe=(RI=Rt.useInsertionEffect)!==null&&RI!==void 0?RI:phe;function LJe(t){const e=E.useRef(null);return DJe(()=>{e.current=t},[t]),E.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}const bp=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},C0=t=>t&&"window"in t&&t.window===t?t:bp(t).defaultView||window;function BJe(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&typeof t.nodeType=="number"}function FJe(t){return BJe(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}let UJe=!1;function WL(){return UJe}function ghe(t,e){if(!WL())return e&&t?t.contains(e):!1;if(!t||!e)return!1;let n=e;for(;n!==null;){if(n===t)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:FJe(n)?n=n.host:n=n.parentNode}return!1}const gO=(t=document)=>{var e;if(!WL())return t.activeElement;let n=t.activeElement;for(;n&&"shadowRoot"in n&&(!((e=n.shadowRoot)===null||e===void 0)&&e.activeElement);)n=n.shadowRoot.activeElement;return n};function mhe(t){return WL()&&t.target.shadowRoot&&t.composedPath?t.composedPath()[0]:t.target}function yhe(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=yhe(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function whe(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=yhe(t))&&(r&&(r+=" "),r+=e);return r}function zJe(t){var e;if(typeof window>"u"||window.navigator==null)return!1;let n=(e=window.navigator.userAgentData)===null||e===void 0?void 0:e.brands;return Array.isArray(n)&&n.some(r=>t.test(r.brand))||t.test(window.navigator.userAgent)}function WJe(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function vhe(t){let e=null;return()=>(e==null&&(e=t()),e)}const HJe=vhe(function(){return WJe(/^Mac/i)}),VJe=vhe(function(){return zJe(/Android/i)});function bhe(){let t=E.useRef(new Map),e=E.useCallback((i,s,o,a)=>{let c=a!=null&&a.once?(...l)=>{t.current.delete(o),o(...l)}:o;t.current.set(o,{type:s,eventTarget:i,fn:c,options:a}),i.addEventListener(s,c,a)},[]),n=E.useCallback((i,s,o,a)=>{var c;let l=((c=t.current.get(o))===null||c===void 0?void 0:c.fn)||o;i.removeEventListener(s,l,a),t.current.delete(o)},[]),r=E.useCallback(()=>{t.current.forEach((i,s)=>{n(i.eventTarget,i.type,s,i.options)})},[n]);return E.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}}function qJe(t){return t.mozInputSource===0&&t.isTrusted?!0:VJe()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function xhe(t){let e=t;return e.nativeEvent=t,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function KJe(t,e){Object.defineProperty(t,"target",{value:e}),Object.defineProperty(t,"currentTarget",{value:e})}function Ehe(t){let e=E.useRef({isFocused:!1,observer:null});phe(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=LJe(r=>{t==null||t(r)});return E.useCallback(r=>
vendor: 21,749 bytes, lines 156-159
156{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){e.current.isFocused=!0;let i=r.target,s=o=>{if(e.current.isFocused=!1,i.disabled){let a=xhe(o);n(a)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",s,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var o;(o=e.current.observer)===null||o===void 0||o.disconnect();let a=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let GJe=!1,L5=null,mO=new Set,wb=new Map,S1=!1,yO=!1;const ZJe={Tab:!0,Escape:!0};function HL(t,e){for(let n of mO)n(t,e)}function YJe(t){return!(t.metaKey||!HJe()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function E9(t){S1=!0,YJe(t)&&(L5="keyboard",HL("keyboard",t))}function Xm(t){L5="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(S1=!0,HL("pointer",t))}function Che(t){qJe(t)&&(S1=!0,L5="virtual")}function _he(t){t.target===window||t.target===document||GJe||!t.isTrusted||(!S1&&!yO&&(L5="virtual",HL("virtual",t)),S1=!1,yO=!1)}function She(){S1=!1,yO=!0}function wO(t){if(typeof window>"u"||typeof document>"u"||wb.get(C0(t)))return;const e=C0(t),n=bp(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){S1=!0,r.apply(this,arguments)},n.addEventListener("keydown",E9,!0),n.addEventListener("keyup",E9,!0),n.addEventListener("click",Che,!0),e.addEventListener("focus",_he,!0),e.addEventListener("blur",She,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Xm,!0),n.addEventListener("pointermove",Xm,!0),n.addEventListener("pointerup",Xm,!0)),e.addEventListener("beforeunload",()=>{Ahe(t)},{once:!0}),wb.set(e,{focus:r})}const Ahe=(t,e)=>{const n=C0(t),r=bp(t);e&&r.removeEventListener("DOMContentLoaded",e),wb.has(n)&&(n.HTMLElement.prototype.focus=wb.get(n).focus,r.removeEventListener("keydown",E9,!0),r.removeEventListener("keyup",E9,!0),r.removeEventListener("click",Che,!0),n.removeEventListener("focus",_he,!0),n.removeEventListener("blur",She,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",Xm,!0),r.removeEventListener("pointermove",Xm,!0),r.removeEventListener("pointerup",Xm,!0)),wb.delete(n))};function QJe(t){const e=bp(t);let n;return e.readyState!=="loading"?wO(t):(n=()=>{wO(t)},e.addEventListener("DOMContentLoaded",n)),()=>Ahe(t,n)}typeof document<"u"&&QJe();function khe(){return L5!=="pointer"}const XJe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function JJe(t,e,n){let r=bp(n==null?void 0:n.target);const i=typeof window<"u"?C0(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?C0(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?C0(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?C0(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return t=t||r.activeElement instanceof i&&!XJe.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof o&&r.activeElement.isContentEditable,!(t&&e==="keyboard"&&n instanceof a&&!ZJe[n.key])}function eet(t,e,n){wO(),E.useEffect(()=>{let r=(i,s)=>{JJe(!!(n!=null&&n.isTextInput),i,s)&&t(khe())};return mO.add(r),()=>{mO.delete(r)}},e)}function tet(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:i}=t;const s=E.useCallback(c=>{if(c.target===c.currentTarget)return r&&r(c),i&&i(!1),!0},[r,i]),o=Ehe(s),a=E.useCallback(c=>{const l=bp(c.target),u=l?gO(l):gO();c.target===c.currentTarget&&u===mhe(c.nativeEvent)&&(n&&n(c),i&&i(!0),o(c))},[i,n,o]);return{focusProps:{onFocus:!e&&(n||i||r)?a:void 0,onBlur:!e&&(r||i)?s:void 0}}}function net(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=t,s=E.useRef({isFocusWithin:!1}),{addGlobalListener:o,removeAllGlobalListeners:a}=bhe(),c=E.useCallback(d=>{d.currentTarget.contains(d.target)&&s.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(s.current.isFocusWithin=!1,a(),n&&n(d),i&&i(!1))},[n,i,s,a]),l=Ehe(c),u=E.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const h=bp(d.target),f=gO(h);if(!s.current.isFocusWithin&&f===mhe(d.nativeEvent)){r&&r(d),i&&i(!0),s.current.isFocusWithin=!0,l(d);let m=d.currentTarget;o(h,"focus",y=>{if(s.current.isFocusWithin&&!ghe(m,y.target)){let v=new h.defaultView.FocusEvent("blur",{relatedTarget:y.target});KJe(v,m);let b=xhe(v);c(b)}},{capture:!0})}},[r,i,l,o,c]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:c}}}let vO=!1,l6=0;function ret(){vO=!0,setTimeout(()=>{vO=!1},50)}function FY(t){t.pointerType==="touch"&&ret()}function iet(){if(!(typeof document>"u"))return l6===0&&typeof PointerEvent<"u"&&document.addEventListener("pointerup",FY),l6++,()=>{l6--,!(l6>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",FY)}}function set(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:i}=t,[s,o]=E.useState(!1),a=E.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;E.useEffect(iet,[]);let{addGlobalListener:c,removeAllGlobalListeners:l}=bhe(),{hoverProps:u,triggerHoverEnd:d}=E.useMemo(()=>{let h=(y,v)=>{if(a.pointerType=v,i||v==="touch"||a.isHovered||!y.currentTarget.contains(y.target))return;a.isHovered=!0;let b=y.currentTarget;a.target=b,c(bp(y.target),"pointerover",C=>{a.isHovered&&a.target&&!ghe(a.target,C.target)&&f(C,C.pointerType)},{capture:!0}),e&&e({type:"hoverstart",target:b,pointerType:v}),n&&n(!0),o(!0)},f=(y,v)=>{let b=a.target;a.pointerType="",a.target=null,!(v==="touch"||!a.isHovered||!b)&&(a.isHovered=!1,l(),r&&r({type:"hoverend",target:b,pointerType:v}),n&&n(!1),o(!1))},m={};return typeof PointerEvent<"u"&&(m.onPointerEnter=y=>{vO&&y.pointerType==="mouse"||h(y,y.pointerType)},m.onPointerLeave=y=>{!i&&y.currentTarget.contains(y.target)&&f(y,y.pointerType)}),{hoverProps:m,triggerHoverEnd:f}},[e,n,r,i,a,c,l]);return E.useEffect(()=>{i&&d({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:u,isHovered:s}}function oet(t={}){let{autoFocus:e=!1,isTextInput:n,within:r}=t,i=E.useRef({isFocused:!1,isFocusVisible:e||khe()}),[s,o]=E.useState(!1),[a,c]=E.useState(()=>i.current.isFocused&&i.current.isFocusVisible),l=E.useCallback(()=>c(i.current.isFocused&&i.current.isFocusVisible),[]),u=E.useCallback(f=>{i.current.isFocused=f,o(f),l()},[l]);eet(f=>{i.current.isFocusVisible=f,l()},[],{isTextInput:n});let{focusProps:d}=tet({isDisabled:r,onFocusChange:u}),{focusWithinProps:h}=net({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:a,focusProps:r?h:d}}var aet=Object.defineProperty,cet=(t,e,n)=>e in t?aet(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,MI=(t,e,n)=>(cet(t,typeof e!="symbol"?e+"":e,n),n);let uet=class{constructor(){MI(this,"current",this.detect()),MI(this,"handoffState","pending"),MI(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Su=new uet;function K1(t){var e,n;return Su.isServer?null:t?"ownerDocument"in t?t.ownerDocument:"current"in t?(n=(e=t.current)==null?void 0:e.ownerDocument)!=null?n:document:null:document}function u_(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Oc(){let t=[],e={addEventListener(n,r,i,s){return n.addEventListener(r,i,s),e.add(()=>n.removeEventListener(r,i,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return e.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return e.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return u_(()=>{r.current&&n[0]()}),e.add(()=>{r.current=!1})},style(n,r,i){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=Oc();return n(r),this.add(()=>r.dispose())},add(n){return t.includes(n)||t.push(n),()=>{let r=t.indexOf(n);if(r>=0)for(let i of t.splice(r,1))i()}},dispose(){for(let n of t.splice(0))n()}};return e}function F2(){let[t]=E.useState(Oc);return E.useEffect(()=>()=>t.dispose(),[t]),t}let br=(t,e)=>{Su.isServer?E.useEffect(t,e):E.useLayoutEffect(t,e)};function G1(t){let e=E.useRef(t);return br(()=>{e.current=t},[t]),e}let vn=function(t){let e=G1(t);return Rt.useCallback((...n)=>e.current(...n),[e])};function det(t){let e=t.width/2,n=t.height/2;return{top:t.clientY-n,right:t.clientX+e,bottom:t.clientY+n,left:t.clientX-e}}function het(t,e){return!(!t||!e||t.right<e.left||t.left>e.right||t.bottom<e.top||t.top>e.bottom)}function fet({disabled:t=!1}={}){let e=E.useRef(null),[n,r]=E.useState(!1),i=F2(),s=vn(()=>{e.current=null,r(!1),i.dispose()}),o=vn(a=>{if(i.dispose(),e.current===null){e.current=a.currentTarget,r(!0);{let c=K1(a.currentTarget);i.addEventListener(c,"pointerup",s,!1),i.addEventListener(c,"pointermove",l=>{if(e.current){let u=det(l);r(het(u,e.current.getBoundingClientRect()))}},!1),i.addEventListener(c,"pointercancel",s,!1)}}});return{pressed:n,pressProps:t?{}:{onPointerDown:o,onPointerUp:s,onClick:s}}}let pet=E.createContext(void 0);function $he(){return E.useContext(pet)}function bO(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function El(t,e,...n){if(t in e){let i=e[t];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,El),r}var s2=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(s2||{}),qf=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(qf||{});function Wi(){let t=met();return E.useCallback(e=>get({mergeRefs:t,...e}),[t])}function get({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:i,visible:s=!0,name:o,mergeRefs:a}){a=a??yet;let c=Ihe(e,t);if(s)return u6(c,n,r,o,a);let l=i??0;if(l&2){let{static:u=!1,...d}=c;if(u)return u6(d,n,r,o,a)}if(l&1){let{unmount:u=!0,...d}=c;return El(u?0:1,{0(){return null},1(){return u6({...d,hidden:!0,style:{display:"none"}},n,r,o,a)}})}return u6(c,n,r,o,a)}function u6(t,e={},n,r,i){let{as:s=n,children:o,refName:a="ref",...c}=OI(t,["unmount","static"]),l=t.ref!==void 0?{[a]:t.ref}:{},u=typeof o=="function"?o(e):o;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(e)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let d={};if(e){let h=!1,f=[];for(let[m,y]of Object.entries(e))typeof y=="boolean"&&(h=!0),y===!0&&f.push(m.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(h){d["data-headlessui-state"]=f.join(" ");for(let m of f)d[`data-${m}`]=""}}if(s===E.Fragment&&(Object.keys(r0(c)).length>0||Object.keys(r0(d)).length>0))if(!E.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(r0(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(r0(c)).concat(Object.keys(r0(d))).map(h=>` - ${h}`).join(` 157`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(` 158`)].join(` 159`))}else{let h=u.props,f=h==null?void 0:h.className,m=typeof f=="function"?(...b)=>bO(f(...b),c.className):bO(f,c.className),y=m?{className:m}:{},v=Ihe(u.props,r0(OI(c,["ref"])));for(let b in d)b in v&&delete d[b];return E.cloneElement(u,Object.assign({},v,d,l,{ref:i(wet(u),l.ref)},y))}return E.createElement(s,Object.assign({},OI(c,["ref"]),s!==E.Fragment&&l,s!==E.Fragment&&d),u)}function met(){let t=E.useRef([]),e=E.useCallback(n=>{for(let r of t.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return t.current=n,e}}function yet(...t){return t.every(e=>e==null)?void 0:e=>{for(let n of t)n!=null&&(typeof n=="function"?n(e):n.current=e)}}function Ihe(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},n={};for(let r of t)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):e[i]=r[i];if(e.disabled||e["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[i=>{var s;return(s=i==null?void 0:i.preventDefault)==null?void 0:s.call(i)}]);for(let r in n)Object.assign(e,{[r](i,...s){let o=n[r];for(let a of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...s)}}});return e}function The(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},n={};for(let r of t)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):e[i]=r[i];for(let r in n)Object.assign(e,{[r](...i){let s=n[r];for(let o of s)o==null||o(...i)}});return e}function bi(t){var e;return Object.assign(E.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function r0(t){let e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}function OI(t,e=[]){let n=Object.assign({},t);for(let r of e)r in n&&delete n[r];return n}function wet(t){return Rt.version.split(".")[0]>="19"?t.props.ref:t.ref}let vet="span";var C9=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(C9||{});function bet(t,e){var n;let{features:r=1,...i}=t,s={ref:e,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Wi()({ourProps:s,theirProps:i,slot:{},defaultTag:vet,name:"Hidden"})}let xO=bi(bet),xet=E.createContext(void 0);function Eet(){return E.useContext(xet)}function VL(t){return typeof t!="object"||t===null?!1:"nodeType"in t}function Hd(t){return VL(t)&&"tagName"in t}function Ba(t){return Hd(t)&&"accessKey"in t}function vu(t){return Hd(t)&&"tabIndex"in t}function Cet(t){return Hd(t)&&"style"in t}function _et(t){return Ba(t)&&t.nodeName==="IFRAME"}function Phe(t){return Ba(t)&&t.nodeName==="INPUT"}function UY(t){return Ba(t)&&t.nodeName==="LABEL"}function Aet(t){return Ba(t)&&t.nodeName==="FIELDSET"}function Rhe(t){return Ba(t)&&t.nodeName==="LEGEND"}function ket(t){return Hd(t)?t.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function $et(t){let e=t.parentElement,n=null;for(;e&&!Aet(e);)Rhe(e)&&(n=e),e=e.parentElement;let r=(e==null?void 0:e.getAttribute("disabled"))==="";return r&&Iet(n)?!1:r}function Iet(t){if(!t)return!1;let e=t.previousElementSibling;for(;e!==null;){if(Rhe(e))return!1;e=e.previousElementSibling}return!0}let Mhe=Symbol();function Tet(t,e=!0){return Object.assign(t,{[Mhe]:e})}function No(...t){let e=E.useRef(t);E.useEffect(()=>{e.current=t},[t]);let n=vn(r=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return t.every(r=>r==null||(r==null?void 0:r[Mhe]))?void 0:n}let qL=E.createContext(null);qL.displayName="DescriptionContext";function Ohe(){let t=E.useContext(qL);if(t===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Ohe),e}return t}function jhe(){let[t,e]=E.useState([]);return[t.length>0?t.join(" "):void 0,E.useMemo(()=>function(n){let r=vn(s=>(e(o=>[...o,s]),()=>e(o=>{let a=o.slice(),c=a.indexOf(s);return c!==-1&&a.splice(c,1),a}))),i=E.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return Rt.createElement(qL.Provider,{value:i},n.children)},[e])]}let Pet="p";function Ret(t,e){let n=E.useId(),r=$he(),{id:i=`headlessui-description-${n}`,...s}=t,o=Ohe(),a=No(e);br(()=>o.register(i),[i,o.register]);let c=r||!1,l=E.useMemo(()=>({...o.slot,disabled:c}),[o.slot,c]),u={ref:a,...o.props,id:i};return Wi()({ourProps:u,theirProps:s,slot:l,defaultTag:Pet,name:o.name||"Description"})}let Met=bi(Ret),Oet=Object.assign(Met,{});var os=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(os||{});let d_=E.createContext(null);d_.displayName="LabelContext";function KL(){let t=E.useContext(d_);if(t===null){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,KL),e}return t}function jet(t){var e,n,r;let i=(n=(e=E.useContext(d_))==null?void 0:e.value)!=null?n:void 0;return((r=void 0)!=null?r:0)>0?[i,...t].filter(Boolean).join(" "):i}function Nhe({inherit:t=!1}={}){let e=jet(),[n,r]=E.useState([]),i=t?[e,...n].filter(Boolean):n;return[i.length>0?i.join(" "):void 0,E.useMemo(()=>function(s){let o=vn(c=>(r(l=>[...l,c]),()=>r(l=>{let u=l.slice(),d=u.indexOf(c);return d!==-1&&u.splice(d,1),u}))),a=E.useMemo(()=>({register:o,slot:s.slot,name:s.name,props:s.props,value:s.value}),[o,s.slot,s.name,s.props,s.value]);return Rt.createElement(d_.Provider,{value:a},s.children)},[r])]}let Net="label";function Det(t,e){var n;let r=E.useId(),i=KL(),s=Eet(),o=$he(),{id:a=`headlessui-label-${r}`,htmlFor:c=s??((n=i.props)==null?void 0:n.htmlFor),passive:l=!1,...u}=t,d=No(e);br(()=>i.register(a),[a,i.register]);let h=vn(v=>{let b=v.currentTarget;if(!(v.target!==v.currentTarget&&ket(v.target))&&(UY(b)&&v.preventDefault(),i.props&&"onClick"in i.props&&typeof i.props.onClick=="function"&&i.props.onClick(v),UY(b))){let C=document.getElementById(b.htmlFor);if(C){let x=C.getAttribute("disabled");if(x==="true"||x==="")return;let _=C.getAttribute("aria-disabled");if(_==="true"||_==="")return;(Phe(C)&&(C.type==="file"||C.type==="radio"||C.type==="checkbox")||C.role==="radio"||C.role==="checkbox"||C.role==="switch")&&C.click(),C.focus({preventScroll:!0})}}}),f=o||!1,m=E.useMemo(()=>({...i.slot,disabled:f}),[i.slot,f]),y={ref:d,...i.props,id:a,htmlFor:c,onClick:h};return l&&("onClick"in y&&(delete y.htmlFor,delete y.onClick),"onClick"in u&&delete u.onClick),Wi()({ourProps:y,theirProps:u,slot:m,defaultTag:c?Net:"div",name:i.name||"Label"})}let Let=bi(Det);Object.assign(Let,{});let Bet=E.createContext(()=>{});function Fet({value:t,children:e}){return Rt.createElement(Bet.Provider,{value:t},e)}function Uet(t){if(t===null)return{width:0,height:0};let{width:e,height:n}=t.getBoundingClientRect();return{width:e,height:n}}function zet(t,e=!1){let[n,r]=E.useReducer(()=>({}),{}),i=E.useMemo(()=>Uet(t),[t,n]);return br(()=>{if(!t)return;let s=new ResizeObserver(r);return s.observe(t),()=>{s.disconnect()}},[t]),e?{width:`${i.width}px`,height:`${i.height}px`}:i}let Dhe=class extends Map{constructor(e){super(),this.factory=e}get(e){let n=super.get(e);return n===void 0&&(n=this.factory(e),this.set(e,n)),n}};var Wet=Object.defineProperty,Het=(t,e,n)=>e in t?Wet(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vet=(t,e,n)=>(Het(t,e+"",n),n),Lhe=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ja=(t,e,n)=>(Lhe(t,e,"read from private field"),n?n.call(t):e.get(t)),jI=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},zY=(t,e,n,r)=>(Lhe(t,e,"write to private field"),e.set(t,n),n),eu,Kv,Gv;let Bhe=class{constructor(e){jI(this,eu,{}),jI(this,Kv,new Dhe(()=>new Set)),jI(this,Gv,new Set),Vet(this,"disposables",Oc()),zY(this,eu,e),Su.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Ja(this,eu)}subscribe(e,n){if(Su.isServer)return()=>{};let r={selector:e,callback:n,current:e(Ja(this,eu))};return Ja(this,Gv).add(r),this.disposables.add(()=>{Ja(this,Gv).delete(r)})}on(e,n){return Su.isServer?()=>{}:(Ja(this,Kv).get(e).add(n),this.disposables.add(()=>{Ja(this,Kv).get(e).delete(n)}))}send(e){let n=this.reduce(Ja(this,eu),e);if(n!==Ja(this,eu)){zY(this,eu,n);for(let r of Ja(this,Gv)){let i=r.selector(Ja(this,eu));Fhe(r.current,i)||(r.current=i,r.callback(i))}for(let r of Ja(this,Kv).get(e.type))r(Ja(this,eu),e)}}};eu=new WeakMap,Kv=new WeakMap,Gv=new WeakMap;function Fhe(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:NI(t[Symbol.iterator](),e[Symbol.iterator]()):t instanceof Map&&e instanceof Map||t instanceof Set&&e instanceof Set?t.size!==e.size?!1:NI(t.entries(),e.entries()):WY(t)&&WY(e)?NI(Object.entries(t)[Symbol.iterator](),Object.entries(e)[Symbol.iterator]()):!1}function NI(t,e){do{let n=t.next(),r=e.next();if(n.done&&r.done)return!0;
159if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function WY(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||Object.getPrototypeOf(e)===null}function HY(t){let[e,n]=t(),r=Oc();return(...i)=>{e(...i),r.dispose(),r.microTask(n)}}var qet=Object.defineProperty,Ket=(t,e,n)=>e in t?qet(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,VY=(t,e,n)=>(Ket(t,typeof e!="symbol"?e+"":e,n),n),Uhe=(t=>(t[t.Push=0]="Push",t[t.Pop=1]="Pop",t))(Uhe||{});let Get={0(t,e){let n=e.id,r=t.stack,i=t.stack.indexOf(n);if(i!==-1){let s=t.stack.slice();return s.splice(i,1),s.push(n),r=s,{...t,stack:r}}return{...t,stack:[...t.stack,n]}},1(t,e){let n=e.id,r=t.stack.indexOf(n);if(r===-1)return t;let i=t.stack.slice();return i.splice(r,1),{...t,stack:i}}},Zet=class zhe extends Bhe{constructor(){super(...arguments),VY(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),VY(this,"selectors",{isTop:(e,n)=>e.stack[e.stack.length-1]===n,inStack:(e,n)=>e.stack.includes(n)})}static new(){return new zhe({stack:[]})}reduce(e,n){return El(n.type,Get,e,n)}};const h_=new Dhe(()=>Zet.new());var DI={exports:{}},LI={};/** 160 * @license React 161 * use-sync-external-store-with-selector.production.js 162 * 163 * Copyright (c) Meta Platforms, Inc. and affiliates. 164 * 165 * This source code is licensed under the MIT license found in the 166 * LICENSE file in the root directory of this source tree. 167 */var qY;function Yet(){if(qY)return LI;qY=1;var t=wh();function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,i=t.useRef,s=t.useEffect,o=t.useMemo,a=t.useDebugValue;return LI.useSyncExternalStoreWithSelector=function(c,l,u,d,h){var f=i(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=o(function(){function v($){if(!b){if(b=!0,C=$,$=d($),h!==void 0&&m.hasValue){var I=m.value;if(h(I,$))return x=I}return x=$}if(I=x,n(C,$))return I;var R=d($);return h!==void 0&&h(I,R)?(C=$,I):(C=$,x=R)}var b=!1,C,x,_=u===void 0?null:u;return[function(){return v(l())},_===null?void 0:function(){return v(_())}]},[l,u,d,h]);var y=r(c,f[0],f[1]);return s(function(){m.hasValue=!0,m.value=y},[y]),a(y),y},LI}var KY;function Qet(){return KY||(KY=1,DI.exports=Yet()),DI.exports}var Xet=Qet();function gl(t,e,n=Fhe){return Xet.useSyncExternalStoreWithSelector(vn(r=>t.subscribe(Jet,r)),vn(()=>t.state),vn(()=>t.state),vn(e),n)}function Jet(t){return t}function B5(t,e){let n=E.useId(),r=h_.get(e),[i,s]=gl(r,E.useCallback(o=>[r.selectors.isTop(o,n),r.selectors.inStack(o,n)],[r,n]));return br(()=>{if(t)return r.actions.push(n),()=>r.actions.pop(n)},[r,t,n]),t?s?i:!0:!1}let EO=new Map,vb=new Map;function GY(t){var e;let n=(e=vb.get(t))!=null?e:0;return vb.set(t,n+1),n!==0?()=>ZY(t):(EO.set(t,{"aria-hidden":t.getAttribute("aria-hidden"),inert:t.inert}),t.setAttribute("aria-hidden","true"),t.inert=!0,()=>ZY(t))}function ZY(t){var e;let n=(e=vb.get(t))!=null?e:1;if(n===1?vb.delete(t):vb.set(t,n-1),n!==1)return;let r=EO.get(t);r&&(r["aria-hidden"]===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r["aria-hidden"]),t.inert=r.inert,EO.delete(t))}function Whe(t,{allowed:e,disallowed:n}={}){let r=B5(t,"inert-others");br(()=>{var i,s;if(!r)return;let o=Oc();for(let c of(i=n==null?void 0:n())!=null?i:[])c&&o.add(GY(c));let a=(s=e==null?void 0:e())!=null?s:[];for(let c of a){if(!c)continue;let l=K1(c);if(!l)continue;let u=c.parentElement;for(;u&&u!==l.body;){for(let d of u.children)a.some(h=>d.contains(h))||o.add(GY(d));u=u.parentElement}}return o.dispose},[r,e,n])}function Hhe(t,e,n){let r=G1(i=>{let s=i.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});E.useEffect(()=>{if(!t)return;let i=e===null?null:Ba(e)?e:e.current;if(!i)return;let s=Oc();if(typeof ResizeObserver<"u"){let o=new ResizeObserver(()=>r.current(i));o.observe(i),s.add(()=>o.disconnect())}if(typeof IntersectionObserver<"u"){let o=new IntersectionObserver(()=>r.current(i));o.observe(i),s.add(()=>o.disconnect())}return()=>s.dispose()},[e,r,t])}let _9=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(","),ett=["[data-autofocus]"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var ll=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t[t.AutoFocus=64]="AutoFocus",t))(ll||{}),CO=(t=>(t[t.Error=0]="Error",t[t.Overflow=1]="Overflow",t[t.Success=2]="Success",t[t.Underflow=3]="Underflow",t))(CO||{}),ttt=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))(ttt||{});function Vhe(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(_9)).sort((e,n)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function ntt(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(ett)).sort((e,n)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var GL=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(GL||{});function ZL(t,e=0){var n;return t===((n=K1(t))==null?void 0:n.body)?!1:El(e,{0(){return t.matches(_9)},1(){let r=t;for(;r!==null;){if(r.matches(_9))return!0;r=r.parentElement}return!1}})}function qhe(t){let e=K1(t);Oc().nextFrame(()=>{e&&vu(e.activeElement)&&!ZL(e.activeElement,0)&&Au(t)})}var rtt=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(rtt||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{t.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:t.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Au(t){t==null||t.focus({preventScroll:!0})}let itt=["textarea","input"].join(",");function stt(t){var e,n;return(n=(e=t==null?void 0:t.matches)==null?void 0:e.call(t,itt))!=null?n:!1}function Khe(t,e=n=>n){return t.slice().sort((n,r)=>{let i=e(n),s=e(r);if(i===null||s===null)return 0;let o=i.compareDocumentPosition(s);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ott(t,e){return Jm(Vhe(),e,{relativeTo:t})}function Jm(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let s=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,o=Array.isArray(t)?n?Khe(t):t:e&64?ntt(t):Vhe(t);i.length>0&&o.length>1&&(o=o.filter(f=>!i.some(m=>m!=null&&"current"in m?(m==null?void 0:m.current)===f:m===f))),r=r??s.activeElement;let a=(()=>
167{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,o.indexOf(r))-1;if(e&4)return Math.max(0,o.indexOf(r))+1;if(e&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=e&32?{preventScroll:!0}:{},u=0,d=o.length,h;do{if(u>=d||u+d<=0)return 0;let f=c+u;if(e&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}h=o[f],h==null||h.focus(l),u+=a}while(h!==s.activeElement);return e&6&&stt(h)&&h.select(),2}function Ghe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function att(){return/Android/gi.test(window.navigator.userAgent)}function YY(){return Ghe()||att()}function Pm(t,e,n,r){let i=G1(n);E.useEffect(()=>{if(!t)return;function s(o){i.current(o)}return document.addEventListener(e,s,r),()=>document.removeEventListener(e,s,r)},[t,e,r])}function Zhe(t,e,n,r){let i=G1(n);E.useEffect(()=>{if(!t)return;function s(o){i.current(o)}return window.addEventListener(e,s,r),()=>window.removeEventListener(e,s,r)},[t,e,r])}const QY=30;function Yhe(t,e,n){let r=G1(n),i=E.useCallback(function(a,c){if(a.defaultPrevented)return;let l=c(a);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let u=function d(h){return typeof h=="function"?d(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e);for(let d of u)if(d!==null&&(d.contains(l)||a.composed&&a.composedPath().includes(d)))return;return!ZL(l,GL.Loose)&&l.tabIndex!==-1&&a.preventDefault(),r.current(a,l)},[r,e]),s=E.useRef(null);Pm(t,"pointerdown",a=>{var c,l;YY()||(s.current=((l=(c=a.composedPath)==null?void 0:c.call(a))==null?void 0:l[0])||a.target)},!0),Pm(t,"pointerup",a=>{if(YY()||!s.current)return;let c=s.current;return s.current=null,i(a,()=>c)},!0);let o=E.useRef({x:0,y:0});Pm(t,"touchstart",a=>{o.current.x=a.touches[0].clientX,o.current.y=a.touches[0].clientY},!0),Pm(t,"touchend",a=>{let c={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(c.x-o.current.x)>=QY||Math.abs(c.y-o.current.y)>=QY))return i(a,()=>vu(a.target)?a.target:null)},!0),Zhe(t,"blur",a=>i(a,()=>_et(window.document.activeElement)?window.document.activeElement:null),!0)}function o2(...t){return E.useMemo(()=>K1(...t),[...t])}var ctt=(t=>(t[t.Ignore=0]="Ignore",t[t.Select=1]="Select",t[t.Close=2]="Close",t))(ctt||{});const d6={Ignore:{kind:0},Select:t=>({kind:1,target:t}),Close:{kind:2}},ltt=200,XY=5;function utt(t,{trigger:e,action:n,close:r,select:i}){let s=E.useRef(null),o=E.useRef(null),a=E.useRef(null);Pm(t&&e!==null,"pointerdown",c=>{VL(c==null?void 0:c.target)&&e!=null&&e.contains(c.target)&&(o.current=c.x,a.current=c.y,s.current=c.timeStamp)}),Pm(t&&e!==null,"pointerup",c=>{var l,u;let d=s.current;if(d===null||(s.current=null,!vu(c.target))||Math.abs(c.x-((l=o.current)!=null?l:c.x))<XY&&Math.abs(c.y-((u=a.current)!=null?u:c.y))<XY)return;let h=n(c);switch(h.kind){case 0:return;case 1:{c.timeStamp-d>ltt&&(i(h.target),r());break}case 2:{r();break}}},{capture:!0})}function Qhe(t,e,n,r){let i=G1(n);E.useEffect(()=>{t=t??window;function s(o){i.current(o)}return t.addEventListener(e,s,r),()=>t.removeEventListener(e,s,r)},[t,e,r])}function dtt(t,e){return E.useMemo(()=>{var n;if(t.type)return t.type;let r=(n=t.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(e==null?void 0:e.tagName)==="BUTTON"&&!e.hasAttribute("type"))return"button"},[t.type,t.as,e])}function htt(t){return E.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)}function ftt(t,e){let n=t(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...s){let o=e[i].call(n,...s);o&&(n=o,r.forEach(a=>a()))}}}function ptt(){let t;return{before({doc:e}){var n;let r=e.documentElement,i=(n=e.defaultView)!=null?n:window;t=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:e,d:n}){let r=e.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,t-i);n.style(r,"paddingRight",`${s}px`)}}}function gtt(){return Ghe()?{before({doc:t,d:e,meta:n}){function r(i){return n.containers.flatMap(s=>s()).some(s=>s.contains(i))}e.microTask(()=>{var i;if(window.getComputedStyle(t.documentElement).scrollBehavior!=="auto"){let a=Oc();a.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>a.dispose()))}let s=(i=window.scrollY)!=null?i:window.pageYOffset,o=null;e.addEventListener(t,"click",a=>{if(vu(a.target))try{let c=a.target.closest("a");if(!c)return;let{hash:l}=new URL(c.href),u=t.querySelector(l);vu(u)&&!r(u)&&(o=u)}catch{}},!0),e.addEventListener(t,"touchstart",a=>{if(vu(a.target)&&Cet(a.target))if(r(a.target)){let c=a.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;e.style(c,"overscrollBehavior","contain")}else e.style(a.target,"touchAction","none")}),e.addEventListener(t,"touchmove",a=>{if(vu(a.target)){if(Phe(a.target))return;if(r(a.target)){let c=a.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),e.add(()=>{var a;let c=(a=window.scrollY)!=null?a:window.pageYOffset;s!==c&&window.scrollTo(0,s),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function mtt(){return{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}}function ytt(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let _0=ftt(()=>new Map,{PUSH(t,e){var n;let r=(n=this.get(t))!=null?n:{doc:t,count:0,d:Oc(),meta:new Set};return r.count++,r.meta.add(e),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:n}){let r={doc:t,d:e,meta:ytt(n)},i=[gtt(),ptt(),mtt()];
vendor: 9,108 bytes, lines 167-168
167i.forEach(({before:s})=>s==null?void 0:s(r)),i.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});_0.subscribe(()=>{let t=_0.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let r=e.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&_0.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&_0.dispatch("TEARDOWN",n)}});function wtt(t,e,n=()=>({containers:[]})){let r=htt(_0),i=e?r.get(e):void 0,s=i?i.count>0:!1;return br(()=>{if(!(!e||!t))return _0.dispatch("PUSH",e,n),()=>_0.dispatch("POP",e,n)},[t,e]),s}function Xhe(t,e,n=()=>[document.body]){let r=B5(t,"scroll-lock");wtt(r,e,i=>{var s;return{containers:[...(s=i.containers)!=null?s:[],n]}})}function JY(t){return[t.screenX,t.screenY]}function vtt(){let t=E.useRef([-1,-1]);return{wasMoved(e){let n=JY(e);return t.current[0]===n[0]&&t.current[1]===n[1]?!1:(t.current=n,!0)},update(e){t.current=JY(e)}}}function btt(t=0){let[e,n]=E.useState(t),r=E.useCallback(c=>n(c),[e]),i=E.useCallback(c=>n(l=>l|c),[e]),s=E.useCallback(c=>(e&c)===c,[e]),o=E.useCallback(c=>n(l=>l&~c),[n]),a=E.useCallback(c=>n(l=>l^c),[n]);return{flags:e,setFlag:r,addFlag:i,hasFlag:s,removeFlag:o,toggleFlag:a}}var xtt={},eQ,tQ;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((eQ=process==null?void 0:xtt)==null?void 0:eQ.NODE_ENV)==="test"&&typeof((tQ=Element==null?void 0:Element.prototype)==null?void 0:tQ.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(` 168`)),[]});var Ett=(t=>(t[t.None=0]="None",t[t.Closed=1]="Closed",t[t.Enter=2]="Enter",t[t.Leave=4]="Leave",t))(Ett||{});function Jhe(t){let e={};for(let n in t)t[n]===!0&&(e[`data-${n}`]="");return e}function efe(t,e,n,r){let[i,s]=E.useState(n),{hasFlag:o,addFlag:a,removeFlag:c}=btt(t&&i?3:0),l=E.useRef(!1),u=E.useRef(!1),d=F2();return br(()=>{var h;if(t){if(n&&s(!0),!e){n&&a(3);return}return(h=r==null?void 0:r.start)==null||h.call(r,n),Ctt(e,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(a(3),c(4)):(a(4),c(2)))},run(){u.current?n?(c(3),a(4)):(c(4),a(3)):n?c(1):a(1)},done(){var f;u.current&&typeof e.getAnimations=="function"&&e.getAnimations().length>0||(l.current=!1,c(7),n||s(!1),(f=r==null?void 0:r.end)==null||f.call(r,n))}})}},[t,n,e,d]),t?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Ctt(t,{prepare:e,run:n,done:r,inFlight:i}){let s=Oc();return Stt(t,{prepare:e,inFlight:i}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(_tt(t,r))})}),s.dispose}function _tt(t,e){var n,r;let i=Oc();if(!t)return i.dispose;let s=!1;i.add(()=>{s=!0});let o=(r=(n=t.getAnimations)==null?void 0:n.call(t).filter(a=>a instanceof CSSTransition))!=null?r:[];return o.length===0?(e(),i.dispose):(Promise.allSettled(o.map(a=>a.finished)).then(()=>{s||e()}),i.dispose)}function Stt(t,{inFlight:e,prepare:n}){if(e!=null&&e.current){n();return}let r=t.style.transition;t.style.transition="none",n(),t.offsetHeight,t.style.transition=r}function Att(t,{container:e,accept:n,walk:r}){let i=E.useRef(n),s=E.useRef(r);E.useEffect(()=>{i.current=n,s.current=r},[n,r]),br(()=>{if(!e||!t)return;let o=K1(e);if(!o)return;let a=i.current,c=s.current,l=Object.assign(d=>a(d),{acceptNode:a}),u=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,l,!1);for(;u.nextNode();)c(u.currentNode)},[e,t,i,s])}function YL(t,e){let n=E.useRef([]),r=vn(t);E.useEffect(()=>{let i=[...n.current];for(let[s,o]of e.entries())if(n.current[s]!==o){let a=r(e,i);return n.current=e,a}},[r,...e])}function f_(){return typeof window<"u"}function U2(t){return tfe(t)?(t.nodeName||"").toLowerCase():"#document"}function Na(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function zu(t){var e;return(e=(tfe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function tfe(t){return f_()?t instanceof Node||t instanceof Na(t).Node:!1}function So(t){return f_()?t instanceof Element||t instanceof Na(t).Element:!1}function Du(t){return f_()?t instanceof HTMLElement||t instanceof Na(t).HTMLElement:!1}function nQ(t){return!f_()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Na(t).ShadowRoot}const ktt=new Set(["inline","contents"]);function F5(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Cl(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!ktt.has(i)}const $tt=new Set(["table","td","th"]);function Itt(t){return $tt.has(U2(t))}const Ttt=[":popover-open",":modal"];function p_(t){return Ttt.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ptt=["transform","translate","scale","rotate","perspective"],Rtt=["transform","translate","scale","rotate","perspective","filter"],Mtt=["paint","layout","strict","content"];function QL(t){const e=XL(),n=So(t)?Cl(t):t;return Ptt.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Rtt.some(r=>(n.willChange||"").includes(r))||Mtt.some(r=>(n.contain||"").includes(r))}function Ott(t){let e=lp(t);for(;Du(e)&&!a2(e);){if(QL(e))return e;if(p_(e))return null;e=lp(e)}return null}function XL(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const jtt=new Set(["html","body","#document"]);function a2(t){return jtt.has(U2(t))}function Cl(t){return Na(t).getComputedStyle(t)}function g_(t){return So(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function lp(t){if(U2(t)==="html")return t;const e=t.assignedSlot||t.parentNode||nQ(t)&&t.host||zu(t);return nQ(e)?e.host:e}function nfe(t){const e=lp(t);return a2(e)?t.ownerDocument?t.ownerDocument.body:t.body:Du(e)&&F5(e)?e:nfe(e)}function c3(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=nfe(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Na(i);if(s){const a=_O(o);return e.concat(o,o.visualViewport||[],F5(i)?i:[],a&&n?c3(a):[])}return e.concat(i,c3(i,[],n))}function _O(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ntt(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}const Dtt=["top","right","bottom","left"],ih=Math.min,lo=Math.max,l3=Math.round,h6=Math.floor,ku=t=>({x:t,y:t}),Ltt={left:"right",right:"left",bottom:"top",top:"bottom"},Btt={start:"end",end:"start"};function SO(t,e,n){return lo(t,ih(e,n))}function Lu(t,e){return typeof t=="function"?t(e):t}function sh(t){return t.split("-")[0]}function z2(t){return t.split("-")[1]}function JL(t){return t==="x"?"y":"x"}function eB(t){return t==="y"?"height":"width"}const Ftt=new Set(["top","bottom"]);function bu(t){return Ftt.has(sh(t))?"y":"x"}function tB(t){return JL(bu(t))}function Utt(t,e,n){n===void 0&&(n=!1);const r=z2(t),i=tB(t),s=eB(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=S9(o)),[o,S9(o)]}function ztt(t){const e=S9(t);return[AO(t),e,AO(e)]}function AO(t){return t.replace(/start|end/g,e=>Btt[e])}const rQ=["left","right"],iQ=["right","left"],Wtt=["top","bottom"],Htt=["bottom","top"];function Vtt(t,e,n){switch(t){case"top":case"bottom":return n?e?iQ:rQ:e?rQ:iQ;case"left":case"right":return e?Wtt:Htt;default:return[]}}function qtt(t,e,n,r){const i=z2(t);let s=Vtt(sh(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(AO)))),s}function S9(t){return t.replace(/left|right|bottom|top/g,e=>Ltt[e])}function Ktt(t){return{top:0,right:0,bottom:0,left:0,...t}}function rfe(t){return typeof t!="number"?Ktt(t):{top:t,right:t,bottom:t,left:t}}function A9(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function sQ(t,e,n){let{reference:r,floating:i}=t;const s=bu(e),o=tB(e),a=eB(o),c=sh(e),l=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(z2(e)){case"start":f[o]-=h*(n&&l?-1:1);break;case"end":f[o]+=h*(n&&l?-1:1);break}return f}const Gtt=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=sQ(l,r,c),h=r,f={},m=0;for(let y=0;y<a.length;y++){const{name:v,fn:b}=a[y],{x:C,y:x,data:_,reset:$}=await b({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,re
vendor: 14,575 bytes, line 168
168cts:l,platform:o,elements:{reference:t,floating:e}});u=C??u,d=x??d,f={...f,[v]:{...f[v],..._}},$&&m<=50&&(m++,typeof $=="object"&&($.placement&&(h=$.placement),$.rects&&(l=$.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):$.rects),{x:u,y:d}=sQ(l,h,c)),y=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function c2(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Lu(e,t),m=rfe(f),v=a[h?d==="floating"?"reference":"floating":d],b=A9(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),C=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),_=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},$=A9(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:x,strategy:c}):C);return{top:(b.top-$.top+m.top)/_.y,bottom:($.bottom-b.bottom+m.bottom)/_.y,left:(b.left-$.left+m.left)/_.x,right:($.right-b.right+m.right)/_.x}}const Ztt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=Lu(t,e)||{};if(l==null)return{};const d=rfe(u),h={x:n,y:r},f=tB(i),m=eB(f),y=await o.getDimensions(l),v=f==="y",b=v?"top":"left",C=v?"bottom":"right",x=v?"clientHeight":"clientWidth",_=s.reference[m]+s.reference[f]-h[f]-s.floating[m],$=h[f]-s.reference[f],I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let R=I?I[x]:0;(!R||!await(o.isElement==null?void 0:o.isElement(I)))&&(R=a.floating[x]||s.floating[m]);const N=_/2-$/2,T=R/2-y[m]/2-1,O=ih(d[b],T),U=ih(d[C],T),z=O,L=R-y[m]-U,S=R/2-y[m]/2+N,k=SO(z,S,L),M=!c.arrow&&z2(i)!=null&&S!==k&&s.reference[m]/2-(S<z?O:U)-y[m]/2<0,W=M?S<z?S-z:S-L:0;return{[f]:h[f]+W,data:{[f]:k,centerOffset:S-k-W,...M&&{alignmentOffset:W}},reset:M}}}),Ytt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...v}=Lu(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=sh(i),C=bu(a),x=sh(a)===a,_=await(c.isRTL==null?void 0:c.isRTL(l.floating)),$=h||(x||!y?[S9(a)]:ztt(a)),I=m!=="none";!h&&I&&$.push(...qtt(a,y,m,_));const R=[a,...$],N=await c2(e,v),T=[];let O=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&T.push(N[b]),d){const S=Utt(i,o,_);T.push(N[S[0]],N[S[1]])}if(O=[...O,{placement:i,overflows:T}],!T.every(S=>S<=0)){var U,z;const S=(((U=s.flip)==null?void 0:U.index)||0)+1,k=R[S];if(k&&(!(d==="alignment"?C!==bu(k):!1)||O.every(H=>bu(H.placement)===C?H.overflows[0]>0:!0)))return{data:{index:S,overflows:O},reset:{placement:k}};let M=(z=O.filter(W=>W.overflows[0]<=0).sort((W,H)=>W.overflows[1]-H.overflows[1])[0])==null?void 0:z.placement;if(!M)switch(f){case"bestFit":{var L;const W=(L=O.filter(H=>{if(I){const D=bu(H.placement);return D===C||D==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(D=>D>0).reduce((D,V)=>D+V,0)]).sort((H,D)=>H[1]-D[1])[0])==null?void 0:L[0];W&&(M=W);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function oQ(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function aQ(t){return Dtt.some(e=>t[e]>=0)}const Qtt=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Lu(t,e);switch(r){case"referenceHidden":{const s=await c2(e,{...i,elementContext:"reference"}),o=oQ(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:aQ(o)}}}case"escaped":{const s=await c2(e,{...i,altBoundary:!0}),o=oQ(s,n.floating);return{data:{escapedOffsets:o,escaped:aQ(o)}}}default:return{}}}}},ife=new Set(["left","top"]);async function Xtt(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=sh(n),a=z2(n),c=bu(n)==="y",l=ife.has(o)?-1:1,u=s&&c?-1:1,d=Lu(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),c?{x:f*u,y:h*l}:{x:h*l,y:f*u}}const Jtt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await Xtt(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},ent=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x:b,y:C}=v;return{x:b,y:C}}},...c}=Lu(t,e),l={x:n,y:r},u=await c2(e,c),d=bu(sh(i)),h=JL(d);let f=l[h],m=l[d];if(s){const v=h==="y"?"top":"left",b=h==="y"?"bottom":"right",C=f+u[v],x=f-u[b];f=SO(C,f,x)}if(o){const v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",C=m+u[v],x=m-u[b];m=SO(C,m,x)}const y=a.fn({...e,[h]:f,[d]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:s,[d]:o}}}}}},tnt=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Lu(t,e),u={x:n,y:r},d=bu(i),h=JL(d);let f=u[h],m=u[d];const y=Lu(a,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const x=h==="y"?"height":"width",_=s.reference[h]-s.floating[x]+v.mainAxis,$=s.reference[h]+s.reference[x]-v.mainAxis;f<_?f=_:f>$&&(f=$)}if(l){var b,C;const x=h==="y"?"width":"height",_=ife.has(sh(i)),$=s.reference[d]-s.floating[x]+(_&&((b=o.offset)==null?void 0:b[d])||0)+(_?0:v.crossAxis),I=s.reference[d]+s.reference[x]+(_?0:((C=o.offset)==null?void 0:C[d])||0)-(_?v.crossAxis:0);m<$?m=$:m>I&&(m=I)}return{[h]:f,[d]:m}}}},nnt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:c=()=>{},...l}=Lu(t,e),u=await c2(e,l),d=sh(i),h=z2(i),f=bu(i)==="y",{width:m,height:y}=s.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,v=h==="end"?"top":"bottom");const C=y-u.top-u.bottom,x=m-u.left-u.right,_=ih(y-u[v],C),$=ih(m-u[b],x),I=!e.middlewareData.shift;let R=_,N=$;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(N=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(R=C),I&&!h){const O=lo(u.left,0),U=lo(u.right,0),z=lo(u.top,0),L=lo(u.bottom,0);f?N=m-2*(O!==0||U!==0?O+U:lo(u.left,u.right)):R=y-2*(z!==0||L!==0?z+L:lo(u.top,u.bottom))}await c({...e,availableWidth:N,availableHeight:R});const T=await o.getDimensions(a.floating);return m!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};function sfe(t){const e=Cl(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Du(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=l3(n)!==s||l3(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function nB(t){return So(t)?t:t.contextElement}function ey(t){const e=nB(t);if(!Du(e))return ku(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=sfe(e);let o=(s?l3(n.width):n.width)/r,a=(s?l3(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const rnt=ku(0);function ofe(t){const e=Na(t);return!XL()||!e.visualViewport?rnt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function int(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Na(t)?!1:e}function A1(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=nB(t);let o=ku(1);e&&(r?So(r)&&(o=ey(r)):o=ey(t));const a=int(s,n,r)?ofe(s):ku(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const h=Na(s),f=r&&So(r)?Na(r):r;let m=h,y=_O(m);for(;y&&r&&f!==m;){const v=ey(y),b=y.getBoundingClientRect(),C=Cl(y),x=b.left+(y.clientLeft+parseFloat(C.paddingLeft))*v.x,_=b.top+(y.clientTop+parseFloat(C.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,d*=v.y,c+=x,l+=_,m=Na(y),y=_O(m)}}return A9({width:u,height:d,x:c,y:l})}function rB(t,e){const n=g_(t).scrollLeft;return e?e.left+n:A1(zu(t)).left+n}function afe(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:rB(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function snt(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=zu(r),a=e?p_(e.floating):!1;if(r===o||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=ku(1);const u=ku(0),d=Du(r);if((d||!d&&!s)&&((U2(r)!=="body"||F5(o))&&(c=g_(r)),Du(r))){const f=A1(r);l=ey(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=o&&!d&&!s?afe(o,c,!0):ku(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function ont(t){return Array.from(t.getClientRects())}function ant(t){const e=zu(t),n=g_(t),r=t.ownerDocument.body,i=lo(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=lo(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+rB(t);const a=-n.scrollTop;return Cl(r).direction==="rtl"&&(o+=lo(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function cnt(t,e){const n=Na(t),r=zu(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=XL();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}const lnt=new Set(["absolute","fixed"]);function unt(t,e){const n=A1(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Du(t)?ey(t):ku(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=r*s.y;return{width:o,height:a,x:c,y:l}}function cQ(t,e,n){let r;if(e==="viewport")r=cnt(t,n);else if(e==="document")r=ant(zu(t));else if(So(e))r=unt(e,n);else{const i=ofe(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return A9(r)}function cfe(t,e){const n=lp(t);return n===e||!So(n)||a2(n)?!1:Cl(n).position==="fixed"||cfe(n,e)}function dnt(t,e){const n=e.get(t);if(n)return n;let r=c3(t,[],!1).filter(a=>So(a)&&U2(a)!=="body"),i=null;const s=Cl(t).position==="fixed";let o=s?lp(t):t;for(;So(o)&&!a2(o);){const a=Cl(o),c=QL(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&lnt.has(i.position)||F5(o)&&!c&&cfe(t,o))?r=r.filter(u=>u!==o):i=a,o=lp(o)}return e.set(t,r),r}function hnt(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?p_(e)?[]:dnt(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((l,u)=>{const d=cQ(e,u,i);return l.top=lo(d.top,l.top),l.right=ih(d.right,l.right),l.bottom=ih(d.bottom,l.bottom),l.left=lo(d.left,l.left),l},cQ(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function fnt(t){const{width:e,height:n}=sfe(t);return{width:e,height:n}}function pnt(t,e,n){const r=Du(e),i=zu(e),s=n==="fixed",o=A1(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=ku(0);function l(){c.x=rB(i)}if(r||!r&&!s)if((U2(e)!=="body"||F5(i))&&(a=g_(e)),r){const f=A1(e,!0,s,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&l();s&&!r&&i&&l();const u=i&&!r&&!s?afe(i,a):ku(0),d=o.left+a.scrollLeft-c.x-u.x,h=o.top+a.scrollTop-c.y-u.y;return{x:d,y:h,width:o.width,height:o.height}}function BI(t){return Cl(t).position==="static"}function lQ(t,e){if(!Du(t)||Cl(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return zu(t)===n&&(n=n.ownerDocument.body),n}function lfe(t,e){const n=Na(t);if(p_(t))return n;if(!Du(t)){let i=lp(t);for(;i&&!a2(i);){if(So(i)&&!BI(i))return i;i=lp(i)}return n}let r=lQ(t,e);for(;r&&Itt(r)&&BI(r);)r=lQ(r,e);return r&&a2(r)&&BI(r)&&!QL(r)?n:r||Ott(t)||n}const gnt=async function(t){const e=this.getOffsetParent||lfe,n=this.getDimensions,r=await n(t.floating);return{reference:pnt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mnt(t){return Cl(t).direction==="rtl"}const ynt={convertOffsetParentRelativeRectToViewportRelativeRect:snt,getDocumentElement:zu,getClippingRect:hnt,getOffsetParent:lfe,getElementRects:gnt,getClientRects:ont,getDimensions:fnt,getScale:ey,isElement:So,isRTL:mnt};function ufe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function wnt(t,e){let n=null,r;const i=zu(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=t.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=l;if(a||e(),!h||!f)return;const m=h6(d),y=h6(i.clientWidth-(u+h)),v=h6(i.clientHeight-(d+f)),b=h6(u),x={rootMargin:-m+"px "+-y+"px "+-v+"px "+-b+"px",threshold:lo(0,ih(1,c))||1};let _=!0;function $(I){const R=I[0].intersectionRatio;if(R!==c){if(!_)return o();R?o(!1,R):r=setTimeout(()=>{o(!1,1e-7)},1e3)}R===1&&!ufe(l,t.getBoundingClientRect())&&o(),_=!1}try{n=new IntersectionObserver($,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver($,x)}n.observe(t)}return o(!0),s}function dfe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=nB(t),u=i||s?[...l?c3(l):[],...c3(e)]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const d=l&&a?wnt(l,n):null;let h=-1,f=null;o&&(f=new ResizeObserver(b=>{let[C]=b;C&&C.target===l&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),l&&!c&&f.observe(l),f.observe(e));let m,y=c?A1(t):null;c&&v();function v(){const b=A1(t);y&&!ufe(y,b)&&n(),y=b,m=requestAnimationFrame(v)}return n(),()=>{var b;u.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),d==null||d(),(b=f)==null||b.disconnect(),f=null,c&&cancelAnimationFrame(m)}}const FI=c2,vnt=Jtt,bnt=ent,xnt=Ytt,Ent=nnt,Cnt=Qtt,uQ=Ztt,_nt=tnt,Snt=(t,e,n)=>{const r=new Map,i={platform:ynt,...n},s={...i.platform,_c:r};return Gtt(t,e,{...i,platform:s})};var Ant=typeof document<"u",knt=function(){},y8=Ant?E.useLayoutEffect:knt;function k9(t,e){if(t===e)return!0;
vendor: 4,505 bytes, line 168
168if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!k9(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!k9(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function hfe(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function dQ(t,e){const n=hfe(t);return Math.round(e*n)/n}function UI(t){const e=E.useRef(t);return y8(()=>{e.current=t}),e}function ffe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,d]=E.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,f]=E.useState(r);k9(h,r)||f(r);const[m,y]=E.useState(null),[v,b]=E.useState(null),C=E.useCallback(H=>{H!==I.current&&(I.current=H,y(H))},[]),x=E.useCallback(H=>{H!==R.current&&(R.current=H,b(H))},[]),_=s||m,$=o||v,I=E.useRef(null),R=E.useRef(null),N=E.useRef(u),T=c!=null,O=UI(c),U=UI(i),z=UI(l),L=E.useCallback(()=>{if(!I.current||!R.current)return;const H={placement:e,strategy:n,middleware:h};U.current&&(H.platform=U.current),Snt(I.current,R.current,H).then(D=>{const V={...D,isPositioned:z.current!==!1};S.current&&!k9(N.current,V)&&(N.current=V,xc.flushSync(()=>{d(V)}))})},[h,e,n,U,z]);y8(()=>{l===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(H=>({...H,isPositioned:!1})))},[l]);const S=E.useRef(!1);y8(()=>(S.current=!0,()=>{S.current=!1}),[]),y8(()=>{if(_&&(I.current=_),$&&(R.current=$),_&&$){if(O.current)return O.current(_,$,L);L()}},[_,$,L,O,T]);const k=E.useMemo(()=>({reference:I,floating:R,setReference:C,setFloating:x}),[C,x]),M=E.useMemo(()=>({reference:_,floating:$}),[_,$]),W=E.useMemo(()=>{const H={position:n,left:0,top:0};if(!M.floating)return H;const D=dQ(M.floating,u.x),V=dQ(M.floating,u.y);return a?{...H,transform:"translate("+D+"px, "+V+"px)",...hfe(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:V}},[n,a,M.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:L,refs:k,elements:M,floatingStyles:W}),[u,L,k,M,W])}const $nt=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?uQ({element:r.current,padding:i}).fn(n):{}:r?uQ({element:r,padding:i}).fn(n):{}}}},iB=(t,e)=>({...vnt(t),options:[t,e]}),pfe=(t,e)=>({...bnt(t),options:[t,e]}),Int=(t,e)=>({..._nt(t),options:[t,e]}),gfe=(t,e)=>({...xnt(t),options:[t,e]}),mfe=(t,e)=>({...Ent(t),options:[t,e]}),Tnt=(t,e)=>({...Cnt(t),options:[t,e]}),Pnt=(t,e)=>({...$nt(t),options:[t,e]}),yfe={...GE},Rnt=yfe.useInsertionEffect,Mnt=Rnt||(t=>t());function wfe(t){const e=E.useRef(()=>{});return Mnt(()=>{e.current=t}),E.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}var kO=typeof document<"u"?E.useLayoutEffect:E.useEffect;let hQ=!1,Ont=0;const fQ=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Ont++;function jnt(){const[t,e]=E.useState(()=>hQ?fQ():void 0);return kO(()=>{t==null&&e(fQ())},[]),E.useEffect(()=>{hQ=!0},[]),t}const Nnt=yfe.useId,Dnt=Nnt||jnt;function Lnt(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(i=>i(n))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var r;t.set(e,((r=t.get(e))==null?void 0:r.filter(i=>i!==n))||[])}}}const Bnt=E.createContext(null),Fnt=E.createContext(null),Unt=()=>{var t;return((t=E.useContext(Bnt))==null?void 0:t.id)||null},znt=()=>E.useContext(Fnt),Wnt="data-floating-ui-focusable";function Hnt(t){const{open:e=!1,onOpenChange:n,elements:r}=t,i=Dnt(),s=E.useRef({}),[o]=E.useState(()=>Lnt()),a=Unt()!=null,[c,l]=E.useState(r.reference),u=wfe((f,m,y)=>{s.current.openEvent=f?m:void 0,o.emit("openchange",{open:f,event:m,reason:y,nested:a}),n==null||n(f,m,y)}),d=E.useMemo(()=>({setPositionReference:l}),[]),h=E.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return E.useMemo(()=>({dataRef:s,open:e,onOpenChange:u,elements:h,events:o,floatingId:i,refs:d}),[e,u,h,o,i,d])}function Vnt(t){t===void 0&&(t={});const{nodeId:e}
vendor: 10,969 bytes, line 168
168=t,n=Hnt({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,i=r.elements,[s,o]=E.useState(null),[a,c]=E.useState(null),u=(i==null?void 0:i.domReference)||s,d=E.useRef(null),h=znt();kO(()=>{u&&(d.current=u)},[u]);const f=ffe({...t,elements:{...i,...a&&{reference:a}}}),m=E.useCallback(x=>{const _=So(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(_),f.refs.setReference(_)},[f.refs]),y=E.useCallback(x=>{(So(x)||x===null)&&(d.current=x,o(x)),(So(f.refs.reference.current)||f.refs.reference.current===null||x!==null&&!So(x))&&f.refs.setReference(x)},[f.refs]),v=E.useMemo(()=>({...f.refs,setReference:y,setPositionReference:m,domReference:d}),[f.refs,y,m]),b=E.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),C=E.useMemo(()=>({...f,...r,refs:v,elements:b,nodeId:e}),[f,v,b,e,r]);return kO(()=>{r.dataRef.current.floatingContext=C;const x=h==null?void 0:h.nodesRef.current.find(_=>_.id===e);x&&(x.context=C)}),E.useMemo(()=>({...f,context:C,refs:v,elements:b}),[f,v,b,C])}const pQ="active",gQ="selected";function zI(t,e,n){const r=new Map,i=n==="item";let s=t;if(i&&t){const{[pQ]:o,[gQ]:a,...c}=t;s=c}return{...n==="floating"&&{tabIndex:-1,[Wnt]:""},...s,...e.map(o=>{const a=o?o[n]:null;return typeof a=="function"?t?a(t):null:a}).concat(t).reduce((o,a)=>(a&&Object.entries(a).forEach(c=>{let[l,u]=c;if(!(i&&[pQ,gQ].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var d;(d=r.get(l))==null||d.push(u),o[l]=function(){for(var h,f=arguments.length,m=new Array(f),y=0;y<f;y++)m[y]=arguments[y];return(h=r.get(l))==null?void 0:h.map(v=>v(...m)).find(v=>v!==void 0)}}}else o[l]=u}),o),{})}}function qnt(t){t===void 0&&(t=[]);const e=t.map(a=>a==null?void 0:a.reference),n=t.map(a=>a==null?void 0:a.floating),r=t.map(a=>a==null?void 0:a.item),i=E.useCallback(a=>zI(a,t,"reference"),e),s=E.useCallback(a=>zI(a,t,"floating"),n),o=E.useCallback(a=>zI(a,t,"item"),r);return E.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:o}),[i,s,o])}function mQ(t,e){return{...t,rects:{...t.rects,floating:{...t.rects.floating,height:e}}}}const Knt=t=>({name:"inner",options:t,async fn(e){const{listRef:n,overflowRef:r,onFallbackChange:i,offset:s=0,index:o=0,minItemsVisible:a=4,referenceOverflowThreshold:c=0,scrollRef:l,...u}=Lu(t,e),{rects:d,elements:{floating:h}}=e,f=n.current[o],m=(l==null?void 0:l.current)||h,y=h.clientTop||m.clientTop,v=h.clientTop!==0,b=m.clientTop!==0,C=h===m;if(!f)return{};const x={...e,...await iB(-f.offsetTop-h.clientTop-d.reference.height/2-f.offsetHeight/2-s).fn(e)},_=await FI(mQ(x,m.scrollHeight+y+h.clientTop),u),$=await FI(x,{...u,elementContext:"reference"}),I=lo(0,_.top),R=x.y+I,O=(m.scrollHeight>m.clientHeight?U=>U:l3)(lo(0,m.scrollHeight+(v&&C||b?y*2:0)-I-lo(0,_.bottom)));if(m.style.maxHeight=O+"px",m.scrollTop=I,i){const U=m.offsetHeight<f.offsetHeight*ih(a,n.current.length)-1||$.top>=-c||$.bottom>=-c;xc.flushSync(()=>i(U))}return r&&(r.current=await FI(mQ({...x,y:R},m.offsetHeight+y+h.clientTop),u)),{y:R}}});function Gnt(t,e){const{open:n,elements:r}=t,{enabled:i=!0,overflowRef:s,scrollRef:o,onChange:a}=e,c=wfe(a),l=E.useRef(!1),u=E.useRef(null),d=E.useRef(null);E.useEffect(()=>{if(!i)return;function f(y){if(y.ctrlKey||!m||s.current==null)return;const v=y.deltaY,b=s.current.top>=-.5,C=s.current.bottom>=-.5,x=m.scrollHeight-m.clientHeight,_=v<0?-1:1,$=v<0?"max":"min";m.scrollHeight<=m.clientHeight||(!b&&v>0||!C&&v<0?(y.preventDefault(),xc.flushSync(()=>{c(I=>I+Math[$](v,x*_))})):/firefox/i.test(Ntt())&&(m.scrollTop+=v))}const m=(o==null?void 0:o.current)||r.floating;if(n&&m)return m.addEventListener("wheel",f),requestAnimationFrame(()=>{u.current=m.scrollTop,s.current!=null&&(d.current={...s.current})}),()=>{u.current=null,d.current=null,m.removeEventListener("wheel",f)}},[i,n,r.floating,s,o,c]);const h=E.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const f=(o==null?void 0:o.current)||r.floating;if(!(!s.current||!f||!l.current)){if(u.current!==null){const m=f.scrollTop-u.current;(s.current.bottom<-.5&&m<-1||s.current.top<-.5&&m>1)&&xc.flushSync(()=>c(y=>y+m))}requestAnimationFrame(()=>{u.current=f.scrollTop})}}}),[r.floating,c,s,o]);return E.useMemo(()=>i?{floating:h}:{},[i,h])}let W2=E.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});W2.displayName="FloatingContext";let sB=E.createContext(null);sB.displayName="PlacementContext";function Znt(t){return E.useMemo(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function Ynt(){return E.useContext(W2).setReference}function Qnt(){return E.useContext(W2).getReferenceProps}function Xnt(){let{getFloatingProps:t,slot:e}=E.useContext(W2);return E.useCallback((...n)=>Object.assign({},t(...n),{"data-anchor":e.anchor}),[t,e])}function Jnt(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let e=E.useContext(sB),n=E.useMemo(()=>t,[JSON.stringify(t,(i,s)=>{var o;return(o=s==null?void 0:s.outerHTML)!=null?o:s})]);br(()=>{e==null||e(n??null)},[e,n]);let r=E.useContext(W2);return E.useMemo(()=>[r.setFloating,t?r.styles:{}],[r.setFloating,t,r.styles])}let yQ=4;function ert({children:t,enabled:e=!0}){let[n,r]=E.useState(null),[i,s]=E.useState(0),o=E.useRef(null),[a,c]=E.useState(null);trt(a);let l=e&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:h=0,padding:f=0,inner:m}=nrt(n,a),[y,v="center"]=u.split(" ");br(()=>{l&&s(0)},[l]);let{refs:b,floatingStyles:C,context:x}=Vnt({open:l,placement:y==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${y}`:`${y}-${v}`,strategy:"absolute",transform:!1,middleware:[iB({mainAxis:y==="selection"?0:d,crossAxis:h}),pfe({padding:f}),y!=="selection"&&gfe({padding:f}),y==="selection"&&m?Knt({...m,padding:f,overflowRef:o,offset:i,minItemsVisible:yQ,referenceOverflowThreshold:f,onFallbackChange(U){var z,L;if(!U)return;let S=x.elements.floating;if(!S)return;let k=parseFloat(getComputedStyle(S).scrollPaddingBottom)||0,M=Math.min(yQ,S.childElementCount),W=0,H=0;for(let D of(L=(z=x.elements.floating)==null?void 0:z.childNodes)!=null?L:[])if(Ba(D)){let V=D.offsetTop,B=V+D.clientHeight+k,P=S.scrollTop,j=P+S.clientHeight;if(V>=P&&B<=j)M--;else{H=Math.max(0,Math.min(B,j)-Math.max(V,P)),W=D.clientHeight;break}}M>=1&&s(D=>{let V=W*M-H+k;return D>=V?D:V})}}):null,mfe({padding:f,apply({availableWidth:U,availableHeight:z,elements:L}){Object.assign(L.floating.style,{overflow:"auto",maxWidth:`${U}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${z}px)`})}})].filter(Boolean),whileElementsMounted:dfe}),[_=y,$=v]=x.placement.split("-");y==="selection"&&(_="selection");let I=E.useMemo(()=>({anchor:[_,$].filter(Boolean).join(" ")}),[_,$]),R=Gnt(x,{overflowRef:o,onChange:s}),{getReferenceProps:N,getFloatingProps:T}=qnt([R]),O=vn(U=>{c(U),b.setFloating(U)});return E.createElement(sB.Provider,{value:r},E.createElement(W2.Provider,{value:{setFloating:O,setReference:b.setReference,styles:C,getReferenceProps:N,getFloatingProps:T,slot:I}},t))}function trt(t){br(()=>{if(!t)return;let e=new MutationObserver(()=>{let n=window.getComputedStyle(t).maxHeight,r=parseFloat(n);if(isNaN(r))return;let i=parseInt(n);isNaN(i)||r!==i&&(t.style.maxHeight=`${Math.ceil(r)}px`)});return e.observe(t,{attributes:!0,attributeFilter:["style"]}),()=>{e.disconnect()}},[t])}function nrt(t,e){var n,r,i;let s=WI((n=t==null?void 0:t.gap)!=null?n:"var(--anchor-gap, 0)",e),o=WI((r=t==null?void 0:t.offset)!=null?r:"var(--anchor-offset, 0)",e),a=WI((i=t==null?void 0:t.padding)!=null?i:"var(--anchor-padding, 0)",e);return{...t,gap:s,offset:o,padding:a}}function WI(t,e,n=void 0){let r=F2(),i=vn((c,l)=>{if(c==null)return[n,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!l)return[n,null];let u=wQ(c,l);return[u,d=>{let h=vfe(c);{let f=h.map(m=>window.getComputedStyle(l).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let y=!1;for(let[b,C]of h.entries()){let x=window.getComputedStyle(l).getPropertyValue(C);if(f[b]!==x){f[b]=x,y=!0;break}}if(!y)return;let v=wQ(c,l);u!==v&&(d(v),u=v)})}return r.dispose}]}return[n,null]}),s=E.useMemo(()=>i(t,e)[0],[t,e]),[o=s,a]=E.useState();return br(()=>{let[c,l]=i(t,e);if(a(c),!!l)return l(a)},[t,e]),o}function vfe(t){let e=/var\((.*)\)/.exec(t);if(e){let n=e[1].indexOf(",");if(n===-1)return[e[1]];let r=e[1].slice(0,n).trim(),i=e[1].slice(n+1).trim();return i?[r,...vfe(i)]:[r]}return[]}function wQ(t,e){let n=document.createElement("div");e.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",t,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return e.removeChild(n),r}let m_=E.createContext(null);m_.displayName="OpenClosedContext";var Ao=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(Ao||{});function U5(){return E.useContext(m_)}function bfe({value:t,children:e}){return Rt.createElement(m_.Provider,{value:t},e)}function rrt({children:t}){return Rt.createElement(m_.Provider,{value:null},t)}function irt(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let _f=[];irt(()=>{function t(e){if(!vu(e.target)||e.target===document.body||_f[0]===e.target)return;let n=e.target;n=n.closest(_9),_f.unshift(n??e.target),_f=_f.filter(r=>r!=null&&r.isConnected),_f.splice(10)}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});function srt(t){throw new Error("Unexpected object: "+t)}var Fi=(t=>(t[t.First=0]="First",t[t.Previous=1]="Previous",t[t.Next=2]="Next",t[t.Last=3]="Last",t[t.Specific=4]="Specific",t[t.Nothing=5]="Nothing",t))(Fi||{});function f6(t,e){let n=e.resolveItems();if(n.length<=0)return null;let r=e.resolveActiveIndex(),i=r??-1;switch(t.focus){case 0:{for(let s=0;s<n.length;++s)if(!e.resolveDisabled(n[s],s,n))return s;return r}case 1:{i===-1&&(i=n.length);for(let s=i-1;s>=0;--s)if(!e.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=i+1;s<n.length;++s)if(!e.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!e.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(e.resolveId(n[s],s,n)===t.id)return s;return r}case 5:return null;default:srt(t)}}var xfe=(t=>(t[t.Left=0]="Left",t[t.Right=2]="Right",t))(xfe||{});function oB(t){let e=vn(t),n=E.useRef(!1);E.useEffect(()=>(n.current=!1,()=>{n.current=!0,u_(()=>{n.current&&e()})}),[e])}function ort(){let t=typeof document>"u";return(e=>e.useSyncExternalStore)(GE)(()=>()=>{},()=>!1,()=>!t)}
168function z5(){let t=ort(),[e,n]=E.useState(Su.isHandoffComplete);return e&&Su.isHandoffComplete===!1&&n(!1),E.useEffect(()=>{e!==!0&&n(!0)},[e]),E.useEffect(()=>Su.handoff(),[]),t?!1:e}let Efe=E.createContext(!1);function art(){return E.useContext(Efe)}function vQ(t){return Rt.createElement(Efe.Provider,{value:t.force},t.children)}function crt(t){let e=art(),n=E.useContext(_fe),[r,i]=E.useState(()=>{var s;if(!e&&n!==null)return(s=n.current)!=null?s:null;if(Su.isServer)return null;let o=t==null?void 0:t.getElementById("headlessui-portal-root");if(o)return o;if(t===null)return null;let a=t.createElement("div");return a.setAttribute("id","headlessui-portal-root"),t.body.appendChild(a)});return E.useEffect(()=>{r!==null&&(t!=null&&t.body.contains(r)||t==null||t.body.appendChild(r))},[r,t]),E.useEffect(()=>{e||n!==null&&i(n.current)},[n,i,e]),r}let Cfe=E.Fragment,lrt=bi(function(t,e){let{ownerDocument:n=null,...r}=t,i=E.useRef(null),s=No(Tet(f=>{i.current=f}),e),o=o2(i),a=n??o,c=crt(a),[l]=E.useState(()=>{var f;return Su.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),u=E.useContext($O),d=z5();br(()=>{!c||!l||c.contains(l)||(l.setAttribute("data-headlessui-portal",""),c.appendChild(l))},[c,l]),br(()=>{if(l&&u)return u.register(l)},[u,l]),oB(()=>{var f;!c||!l||(VL(l)&&c.contains(l)&&c.removeChild(l),c.childNodes.length<=0&&((f=c.parentElement)==null||f.removeChild(c)))});let h=Wi();return d?!c||!l?null:xc.createPortal(h({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:Cfe,name:"Portal"}),l):null});function urt(t,e){let n=No(e),{enabled:r=!0,ownerDocument:i,...s}=t,o=Wi();return r?Rt.createElement(lrt,{...s,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:Cfe,name:"Portal"})}let drt=E.Fragment,_fe=E.createContext(null);function hrt(t,e){let{target:n,...r}=t,i={ref:No(e)},s=Wi();return Rt.createElement(_fe.Provider,{value:n},s({ourProps:i,theirProps:r,defaultTag:drt,name:"Popover.Group"}))}let $O=E.createContext(null);function frt(){let t=E.useContext($O),e=E.useRef([]),n=vn(s=>(e.current.push(s),t&&t.register(s),()=>r(s))),r=vn(s=>{let o=e.current.indexOf(s);o!==-1&&e.current.splice(o,1),t&&t.unregister(s)}),i=E.useMemo(()=>({register:n,unregister:r,portals:e}),[n,r,e]);return[e,E.useMemo(()=>function({children:s}){return Rt.createElement($O.Provider,{value:i},s)},[i])]}let prt=bi(urt),Sfe=bi(hrt),Afe=Object.assign(prt,{Group:Sfe});function grt(t,e=typeof document<"u"?document.defaultView:null,n){let r=B5(t,"escape");Qhe(e,"keydown",i=>{r&&(i.defaultPrevented||i.key===os.Escape&&n(i))})}function mrt(){var t;let[e]=E.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=E.useState((t=e==null?void 0:e.matches)!=null?t:!1);return br(()=>{if(!e)return;function i(s){r(s.matches)}return e.addEventListener("change",i),()=>e.removeEventListener("change",i)},[e]),n}function yrt({defaultContainers:t=[],portals:e,mainTreeNode:n}={}){let r=o2(n),i=vn(()=>{var s,o;let a=[];for(let c of t)c!==null&&(Hd(c)?a.push(c):"current"in c&&Hd(c.current)&&a.push(c.current));if(e!=null&&e.current)for(let c of e.current)a.push(c);for(let c of(s=r==null?void 0:r.querySelectorAll("html > *, body > *"))!=null?s:[])c!==document.body&&c!==document.head&&Hd(c)&&c.id!=="headlessui-portal-root"&&(n&&(c.contains(n)||c.contains((o=n==null?void 0:n.getRootNode())==null?void 0:o.host))||a.some(l=>c.contains(l))||a.push(c));return a});
vendor: 4,451 bytes, line 168
168return{resolveContainers:i,contains:vn(s=>i().some(o=>o.contains(s)))}}let kfe=E.createContext(null);function bQ({children:t,node:e}){let[n,r]=E.useState(null),i=$fe(e??n);return Rt.createElement(kfe.Provider,{value:i},t,i===null&&Rt.createElement(xO,{features:C9.Hidden,ref:s=>{var o,a;if(s){for(let c of(a=(o=K1(s))==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?a:[])if(c!==document.body&&c!==document.head&&Hd(c)&&c!=null&&c.contains(s)){r(c);break}}}}))}function $fe(t=null){var e;return(e=E.useContext(kfe))!=null?e:t}function aB(){let t=E.useRef(!1);return br(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var Zv=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(Zv||{});function wrt(){let t=E.useRef(0);return Zhe(!0,"keydown",e=>{e.key==="Tab"&&(t.current=e.shiftKey?1:0)},!0),t}function Ife(t){if(!t)return new Set;if(typeof t=="function")return new Set(t());let e=new Set;for(let n of t.current)Hd(n.current)&&e.add(n.current);return e}let vrt="div";var u0=(t=>(t[t.None=0]="None",t[t.InitialFocus=1]="InitialFocus",t[t.TabLock=2]="TabLock",t[t.FocusLock=4]="FocusLock",t[t.RestoreFocus=8]="RestoreFocus",t[t.AutoFocus=16]="AutoFocus",t))(u0||{});function brt(t,e){let n=E.useRef(null),r=No(n,e),{initialFocus:i,initialFocusFallback:s,containers:o,features:a=15,...c}=t;z5()||(a=0);let l=o2(n);_rt(a,{ownerDocument:l});let u=Srt(a,{ownerDocument:l,container:n,initialFocus:i,initialFocusFallback:s});Art(a,{ownerDocument:l,container:n,containers:o,previousActiveElement:u});let d=wrt(),h=vn(C=>{if(!Ba(n.current))return;let x=n.current;(_=>_())(()=>{El(d.current,{[Zv.Forwards]:()=>{Jm(x,ll.First,{skipElements:[C.relatedTarget,s]})},[Zv.Backwards]:()=>{Jm(x,ll.Last,{skipElements:[C.relatedTarget,s]})}})})}),f=B5(!!(a&2),"focus-trap#tab-lock"),m=F2(),y=E.useRef(!1),v={ref:r,onKeyDown(C){C.key=="Tab"&&(y.current=!0,m.requestAnimationFrame(()=>{y.current=!1}))},onBlur(C){if(!(a&4))return;let x=Ife(o);Ba(n.current)&&x.add(n.current);let _=C.relatedTarget;vu(_)&&_.dataset.headlessuiFocusGuard!=="true"&&(Tfe(x,_)||(y.current?Jm(n.current,El(d.current,{[Zv.Forwards]:()=>ll.Next,[Zv.Backwards]:()=>ll.Previous})|ll.WrapAround,{relativeTo:C.target}):vu(C.target)&&Au(C.target)))}},b=Wi();return Rt.createElement(Rt.Fragment,null,f&&Rt.createElement(xO,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:C9.Focusable}),b({ourProps:v,theirProps:c,defaultTag:vrt,name:"FocusTrap"}),f&&Rt.createElement(xO,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:C9.Focusable}))}let xrt=bi(brt),Ert=Object.assign(xrt,{features:u0});function Crt(t=!0){let e=E.useRef(_f.slice());return YL(([n],[r])=>{r===!0&&n===!1&&u_(()=>{e.current.splice(0)}),r===!1&&n===!0&&(e.current=_f.slice())},[t,_f,e]),vn(()=>{var n;return(n=e.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function _rt(t,{ownerDocument:e}){let n=!!(t&8),r=Crt(n);YL(()=>{n||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Au(r())},[n]),oB(()=>{n&&Au(r())})}function Srt(t,{ownerDocument:e,container:n,initialFocus:r,initialFocusFallback:i}){let s=E.useRef(null),o=B5(!!(t&1),"focus-trap#initial-focus"),a=aB();return YL(()=>{if(t===0)return;if(!o){i!=null&&i.current&&Au(i.current);return}let c=n.current;c&&u_(()=>{if(!a.current)return;let l=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===l){s.current=l;return}}else if(c.contains(l)){s.current=l;return}if(r!=null&&r.current)Au(r.current);else{if(t&16){if(Jm(c,ll.First|ll.AutoFocus)!==CO.Error)return}else if(Jm(c,ll.First)!==CO.Error)return;if(i!=null&&i.current&&(Au(i.current),(e==null?void 0:e.activeElement)===i.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}s.current=e==null?void 0:e.activeElement})},[i,o,t]),s}function Art(t,{ownerDocument:e,container:n,containers:r,previousActiveElement:i}){let s=aB(),o=!!(t&4);Qhe(e==null?void 0:e.defaultView,"focus",a=>{if(!o||!s.current)return;let c=Ife(r);Ba(n.current)&&c.add(n.current);let l=i.current;if(!l)return;let u=a.target;Ba(u)?Tfe(c,u)?(i.current=u,Au(u)):(a.preventDefault(),a.stopPropagation(),Au(l)):Au(i.current)},!0)}function Tfe(t,e){for(let n of t)if(n.contains(e))return!0;return!1}function Pfe(t){var e;return!!(t.enter||t.enterFrom||t.enterTo||t.leave||t.leaveFrom||t.leaveTo)||((e=t.as)!=null?e:Mfe)!==E.Fragment||Rt.Children.count(t.children)===1}let y_=E.createContext(null);
vendor: 5,669 bytes, line 168
168y_.displayName="TransitionContext";var krt=(t=>(t.Visible="visible",t.Hidden="hidden",t))(krt||{});function $rt(){let t=E.useContext(y_);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function Irt(){let t=E.useContext(w_);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}let w_=E.createContext(null);w_.displayName="NestingContext";function v_(t){return"children"in t?v_(t.children):t.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Rfe(t,e){let n=G1(t),r=E.useRef([]),i=aB(),s=F2(),o=vn((f,m=qf.Hidden)=>{let y=r.current.findIndex(({el:v})=>v===f);y!==-1&&(El(m,{[qf.Unmount](){r.current.splice(y,1)},[qf.Hidden](){r.current[y].state="hidden"}}),s.microTask(()=>{var v;!v_(r)&&i.current&&((v=n.current)==null||v.call(n))}))}),a=vn(f=>{let m=r.current.find(({el:y})=>y===f);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:f,state:"visible"}),()=>o(f,qf.Unmount)}),c=E.useRef([]),l=E.useRef(Promise.resolve()),u=E.useRef({enter:[],leave:[]}),d=vn((f,m,y)=>{c.current.splice(0),e&&(e.chains.current[m]=e.chains.current[m].filter(([v])=>v!==f)),e==null||e.chains.current[m].push([f,new Promise(v=>{c.current.push(v)})]),e==null||e.chains.current[m].push([f,new Promise(v=>{Promise.all(u.current[m].map(([b,C])=>C)).then(()=>v())})]),m==="enter"?l.current=l.current.then(()=>e==null?void 0:e.wait.current).then(()=>y(m)):y(m)}),h=vn((f,m,y)=>{Promise.all(u.current[m].splice(0).map(([v,b])=>b)).then(()=>{var v;(v=c.current.shift())==null||v()}).then(()=>y(m))});return E.useMemo(()=>({children:r,register:a,unregister:o,onStart:d,onStop:h,wait:l,chains:u}),[a,o,r,d,h,u,l])}let Mfe=E.Fragment,Ofe=s2.RenderStrategy;function Trt(t,e){var n,r;let{transition:i=!0,beforeEnter:s,afterEnter:o,beforeLeave:a,afterLeave:c,enter:l,enterFrom:u,enterTo:d,entered:h,leave:f,leaveFrom:m,leaveTo:y,...v}=t,[b,C]=E.useState(null),x=E.useRef(null),_=Pfe(t),$=No(..._?[x,e,C]:e===null?[]:[e]),I=(n=v.unmount)==null||n?qf.Unmount:qf.Hidden,{show:R,appear:N,initial:T}=$rt(),[O,U]=E.useState(R?"visible":"hidden"),z=Irt(),{register:L,unregister:S}=z;br(()=>L(x),[L,x]),br(()=>{if(I===qf.Hidden&&x.current){if(R&&O!=="visible"){U("visible");return}return El(O,{hidden:()=>S(x),visible:()=>L(x)})}},[O,x,L,S,R,I]);let k=z5();br(()=>{if(_&&k&&O==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,O,k,_]);let M=T&&!N,W=N&&R&&T,H=E.useRef(!1),D=Rfe(()=>{H.current||(U("hidden"),S(x))},z),V=vn(ae=>{H.current=!0;let oe=ae?"enter":"leave";D.onStart(x,oe,de=>{de==="enter"?s==null||s():de==="leave"&&(a==null||a())})}),B=vn(ae=>{let oe=ae?"enter":"leave";H.current=!1,D.onStop(x,oe,de=>{de==="enter"?o==null||o():de==="leave"&&(c==null||c())}),oe==="leave"&&!v_(D)&&(U("hidden"),S(x))});E.useEffect(()=>{_&&i||(V(R),B(R))},[R,_,i]);let P=!(!i||!_||!k||M),[,j]=efe(P,b,R,{start:V,end:B}),G=r0({ref:$,className:((r=bO(v.className,W&&l,W&&u,j.enter&&l,j.enter&&j.closed&&u,j.enter&&!j.closed&&d,j.leave&&f,j.leave&&!j.closed&&m,j.leave&&j.closed&&y,!j.transition&&R&&h))==null?void 0:r.trim())||void 0,...Jhe(j)}),Y=0;O==="visible"&&(Y|=Ao.Open),O==="hidden"&&(Y|=Ao.Closed),R&&O==="hidden"&&(Y|=Ao.Opening),!R&&O==="visible"&&(Y|=Ao.Closing);let te=Wi();return Rt.createElement(w_.Provider,{value:D},Rt.createElement(bfe,{value:Y},te({ourProps:G,theirProps:v,defaultTag:Mfe,features:Ofe,visible:O==="visible",name:"Transition.Child"})))}function Prt(t,e){let{show:n,appear:r=!1,unmount:i=!0,...s}=t,o=E.useRef(null),a=Pfe(t),c=No(...a?[o,e]:e===null?[]:[e]);z5();let l=U5();if(n===void 0&&l!==null&&(n=(l&Ao.Open)===Ao.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=E.useState(n?"visible":"hidden"),h=Rfe(()=>{n||d("hidden")}),[f,m]=E.useState(!0),y=E.useRef([n]);br(()=>{f!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),m(!1))},[y,n]);let v=E.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);br(()=>{n?d("visible"):!v_(h)&&o.current!==null&&d("hidden")},[n,h]);let b={unmount:i},C=vn(()=>{var $;f&&m(!1),($=t.beforeEnter)==null||$.call(t)}),x=vn(()=>{var $;f&&m(!1),($=t.beforeLeave)==null||$.call(t)}),_=Wi();return Rt.createElement(w_.Provider,{value:h},Rt.createElement(y_.Provider,{value:v},_({ourProps:{...b,as:E.Fragment,children:Rt.createElement(jfe,{ref:c,...b,...s,beforeEnter:C,beforeLeave:x})},theirProps:{},defaultTag:E.Fragment,features:Ofe,visible:u==="visible",name:"Transition"})))}function Rrt(t,e){let n=E.useContext(y_)!==null,r=U5()!==null;return Rt.createElement(Rt.Fragment,null,!n&&r?Rt.createElement(IO,{ref:e,...t}):Rt.createElement(jfe,{ref:e,...t}))}let IO=bi(Prt),jfe=bi(Trt),u3=bi(Rrt),Nfe=Object.assign(IO,{Child:u3,Root:IO});var Mrt=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(Mrt||{}),Ort=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(Ort||{});let jrt={0(t,e){return t.titleId===e.id?t:{...t,titleId:e.id}}},cB=E.createContext(null);cB.displayName="DialogContext";function b_(t){let e=E.useContext(cB);if(e===null){let n=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,b_),n}return e}function Nrt(t,e){return El(e.type,jrt,t,e)}let xQ=bi(function(t,e){let n=E.useId(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:s,initialFocus:o,role:a="dialog",autoFocus:c=!0,__demoMode:l=!1,unmount:u=!1,...d}=t,h=E.useRef(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(h.current||(h.current=!0,
vendor: 5,224 bytes, line 168
168console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let f=U5();i===void 0&&f!==null&&(i=(f&Ao.Open)===Ao.Open);let m=E.useRef(null),y=No(m,e),v=o2(m),b=i?0:1,[C,x]=E.useReducer(Nrt,{titleId:null,descriptionId:null,panelRef:E.createRef()}),_=vn(()=>s(!1)),$=vn(j=>x({type:0,id:j})),I=z5()?b===0:!1,[R,N]=frt(),T={get current(){var j;return(j=C.panelRef.current)!=null?j:m.current}},O=$fe(),{resolveContainers:U}=yrt({mainTreeNode:O,portals:R,defaultContainers:[T]}),z=f!==null?(f&Ao.Closing)===Ao.Closing:!1;Whe(l||z?!1:I,{allowed:vn(()=>{var j,G;return[(G=(j=m.current)==null?void 0:j.closest("[data-headlessui-portal]"))!=null?G:null]}),disallowed:vn(()=>{var j;return[(j=O==null?void 0:O.closest("body > *:not(#headlessui-portal-root)"))!=null?j:null]})});let L=h_.get(null);br(()=>{if(I)return L.actions.push(r),()=>L.actions.pop(r)},[L,r,I]);let S=gl(L,E.useCallback(j=>L.selectors.isTop(j,r),[L,r]));Yhe(S,U,j=>{j.preventDefault(),_()}),grt(S,v==null?void 0:v.defaultView,j=>{j.preventDefault(),j.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),_()}),Xhe(l||z?!1:I,v,U),Hhe(I,m,_);let[k,M]=jhe(),W=E.useMemo(()=>[{dialogState:b,close:_,setTitleId:$,unmount:u},C],[b,C,_,$,u]),H=E.useMemo(()=>({open:b===0}),[b]),D={ref:y,id:r,role:a,tabIndex:-1,"aria-modal":l?void 0:b===0?!0:void 0,"aria-labelledby":C.titleId,"aria-describedby":k,unmount:u},V=!mrt(),B=u0.None;I&&!l&&(B|=u0.RestoreFocus,B|=u0.TabLock,c&&(B|=u0.AutoFocus),V&&(B|=u0.InitialFocus));let P=Wi();return Rt.createElement(rrt,null,Rt.createElement(vQ,{force:!0},Rt.createElement(Afe,null,Rt.createElement(cB.Provider,{value:W},Rt.createElement(Sfe,{target:m},Rt.createElement(vQ,{force:!1},Rt.createElement(M,{slot:H},Rt.createElement(N,null,Rt.createElement(Ert,{initialFocus:o,initialFocusFallback:m,containers:U,features:B},Rt.createElement(Fet,{value:_},P({ourProps:D,theirProps:d,slot:H,defaultTag:Drt,features:Lrt,visible:b===0,name:"Dialog"})))))))))))}),Drt="div",Lrt=s2.RenderStrategy|s2.Static;function Brt(t,e){let{transition:n=!1,open:r,...i}=t,s=U5(),o=t.hasOwnProperty("open")||s!==null,a=t.hasOwnProperty("onClose");if(!o&&!a)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!a)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&typeof t.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${t.open}`);if(typeof t.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${t.onClose}`);return(r!==void 0||n)&&!i.static?Rt.createElement(bQ,null,Rt.createElement(Nfe,{show:r,transition:n,unmount:i.unmount},Rt.createElement(xQ,{ref:e,...i}))):Rt.createElement(bQ,null,Rt.createElement(xQ,{ref:e,open:r,...i}))}let Frt="div";function Urt(t,e){let n=E.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...s}=t,[{dialogState:o,unmount:a},c]=b_("Dialog.Panel"),l=No(e,c.panelRef),u=E.useMemo(()=>({open:o===0}),[o]),d=vn(v=>{v.stopPropagation()}),h={ref:l,id:r,onClick:d},f=i?u3:E.Fragment,m=i?{unmount:a}:{},y=Wi();return Rt.createElement(f,{...m},y({ourProps:h,theirProps:s,slot:u,defaultTag:Frt,name:"Dialog.Panel"}))}let zrt="div";function Wrt(t,e){let{transition:n=!1,...r}=t,[{dialogState:i,unmount:s}]=b_("Dialog.Backdrop"),o=E.useMemo(()=>({open:i===0}),[i]),a={ref:e,"aria-hidden":!0},c=n?u3:E.Fragment,l=n?{unmount:s}:{},u=Wi();return Rt.createElement(c,{...l},u({ourProps:a,theirProps:r,slot:o,defaultTag:zrt,name:"Dialog.Backdrop"}))}let Hrt="h2";function Vrt(t,e){let n=E.useId(),{id:r=`headlessui-dialog-title-${n}`,...i}=t,[{dialogState:s,setTitleId:o}]=b_("Dialog.Title"),a=No(e);E.useEffect(()=>(o(r),()=>o(null)),[r,o]);let c=E.useMemo(()=>({open:s===0}),[s]),l={ref:a,id:r};return Wi()({ourProps:l,theirProps:i,slot:c,defaultTag:Hrt,name:"Dialog.Title"})}let qrt=bi(Brt),Dfe=bi(Urt);bi(Wrt);let Krt=bi(Vrt),Grt=Object.assign(qrt,{Panel:Dfe,Title:Krt,Description:Oet});function Zrt(t,e){let n=E.useRef({left:0,top:0});if(br(()=>{if(!e)return;let i=e.getBoundingClientRect();i&&(n.current=i)},[t,e]),e==null||!t||e===document.activeElement)return!1;let r=e.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let EQ=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function CQ(t){var e,n;let r=(e=t.innerText)!=null?e:"",i=t.cloneNode(!0);if(!Ba(i))return r;let s=!1;for(let a of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),s=!0;let o=s?(n=i.innerText)!=null?n:"":r;return EQ.test(o)&&(o=o.replace(EQ,"")),o}function Yrt(t){let e=t.getAttribute("aria-label");if(typeof e=="string")return e.trim();let n=t.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(i=>{let s=document.getElementById(i);if(s){let o=s.getAttribute("aria-label");
168return typeof o=="string"?o.trim():CQ(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return CQ(t).trim()}function Qrt(t){let e=E.useRef(""),n=E.useRef("");return vn(()=>{let r=t.current;if(!r)return"";let i=r.innerText;if(e.current===i)return n.current;let s=Yrt(r).trim().toLowerCase();return e.current=i,n.current=s,s})}var Xrt=Object.defineProperty,Jrt=(t,e,n)=>e in t?Xrt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_Q=(t,e,n)=>(Jrt(t,typeof e!="symbol"?e+"":e,n),n),Rs=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(Rs||{}),$9=(t=>(t[t.Pointer=0]="Pointer",t[t.Other=1]="Other",t))($9||{}),Ar=(t=>(t[t.OpenMenu=0]="OpenMenu",t[t.CloseMenu=1]="CloseMenu",t[t.GoToItem=2]="GoToItem",t[t.Search=3]="Search",t[t.ClearSearch=4]="ClearSearch",t[t.RegisterItems=5]="RegisterItems",t[t.UnregisterItems=6]="UnregisterItems",t[t.SetButtonElement=7]="SetButtonElement",t[t.SetItemsElement=8]="SetItemsElement",t[t.SortItems=9]="SortItems",t))(Ar||{});function SQ(t,e=n=>n){let n=t.activeItemIndex!==null?t.items[t.activeItemIndex]:null,r=Khe(e(t.items.slice()),s=>s.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{items:r,activeItemIndex:i}}let eit={1(t){return t.menuState===1?t:{...t,activeItemIndex:null,pendingFocus:{focus:Fi.Nothing},menuState:1}},0(t,e){return t.menuState===0?t:{...t,__demoMode:!1,pendingFocus:e.focus,menuState:0}},2:(t,e)=>{var n,r,i,s,o;if(t.menuState===1)return t;let a={...t,searchQuery:"",activationTrigger:(n=e.trigger)!=null?n:1,__demoMode:!1};if(e.focus===Fi.Nothing)return{...a,activeItemIndex:null};if(e.focus===Fi.Specific)return{...a,activeItemIndex:t.items.findIndex(u=>u.id===e.id)};if(e.focus===Fi.Previous){let u=t.activeItemIndex;if(u!==null){let d=t.items[u].dataRef.current.domRef,h=f6(e,{resolveItems:()=>t.items,resolveActiveIndex:()=>t.activeItemIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(h!==null){let f=t.items[h].dataRef.current.domRef;if(((r=d.current)==null?void 0:r.previousElementSibling)===f.current||((i=f.current)==null?void 0:i.previousElementSibling)===null)return{...a,activeItemIndex:h}}}}else if(e.focus===Fi.Next){let u=t.activeItemIndex;if(u!==null){let d=t.items[u].dataRef.current.domRef,h=f6(e,{resolveItems:()=>t.items,resolveActiveIndex:()=>t.activeItemIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(h!==null){let f=t.items[h].dataRef.current.domRef;if(((s=d.current)==null?void 0:s.nextElementSibling)===f.current||((o=f.current)==null?void 0:o.nextElementSibling)===null)return{...a,activeItemIndex:h}}}}let c=SQ(t),l=f6(e,{resolveItems:()=>c.items,resolveActiveIndex:()=>c.activeItemIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...a,...c,activeItemIndex:l}},3:(t,e)=>{let n=t.searchQuery!==""?0:1,r=t.searchQuery+e.value.toLowerCase(),i=(t.activeItemIndex!==null?t.items.slice(t.activeItemIndex+n).concat(t.items.slice(0,t.activeItemIndex+n)):t.items).find(o=>{var a;return((a=o.dataRef.current.textValue)==null?void 0:a.startsWith(r))&&!o.dataRef.current.disabled}),s=i?t.items.indexOf(i):-1;return s===-1||s===t.activeItemIndex?{...t,searchQuery:r}:{...t,searchQuery:r,activeItemIndex:s,activationTrigger:1}},4(t){return t.searchQuery===""?t:{...t,searchQuery:"",searchActiveItemIndex:null}},5:(t,e)=>{let n=t.items.concat(e.items.map(i=>i)),r=t.activeItemIndex;return t.pendingFocus.focus!==Fi.Nothing&&(r=f6(t.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>t.activeItemIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled})),{...t,items:n,activeItemIndex:r,pendingFocus:{focus:Fi.Nothing},pendingShouldSort:!0}},6:(t,e)=>{let n=t.items,r=[],i=new Set(e.items);for(let[s,o]of n.entries())if(i.has(o.id)&&(r.push(s),i.delete(o.id),i.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...t,items:n,activationTrigger:1}},7:(t,e)=>t.buttonElement===e.element?t:{...t,buttonElement:e.element},8:(t,e)=>t.itemsElement===e.element?t:{...t,itemsElement:e.element},9:t=>t.pendingShouldSort?{...t,...SQ(t),pendingShouldSort:!1}:t},tit=class Lfe extends Bhe{constructor(e){super(e),_Q(this,"actions",{registerItem:HY(()=>{let n=[],r=new Set;return[(i,s)=>{r.has(s)||(r.add(s),n.push({id:i,dataRef:s}))},()=>(r.clear(),this.send({type:5,items:n.splice(0)}))]}),unregisterItem:HY(()=>{let n=[];return[r=>n.push(r),()=>this.send({type:6,items:n.splice(0)})]})}),_Q(this,"selectors",{activeDescendantId(n){var r;let i=n.activeItemIndex,s=n.items;return i===null||(r=s[i])==null?void 0:r.id},isActive(n,r){var i;let s=n.activeItemIndex,o=n.items;return s!==null?((i=o[s])==null?void 0:i.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.menuState!==0||n.activationTrigger===0?!1:this.isActive(n,r)}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=h_.get(null);this.disposables.add(r.on(Uhe.Push,i=>{!r.selectors.isTop(i,n)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}}static new({id:e,__demoMode:n=!1}){return new Lfe({id:e,__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:Fi.Nothing}})}reduce(e,n){return El(n.type,eit,e,n)}};const Bfe=E.createContext(null);function lB(t){let e=E.useContext(Bfe);if(e===null){let n=new Error(`<${t} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ffe),n}return e}function Ffe({id:t,__demoMode:e=!1}){let n=E.useMemo(()=>tit.new({id:t,__demoMode:e}),[]);return oB(()=>n.dispose()),n}let nit=E.Fragment;function rit(t,e){let n=E.useId(),{__demoMode:r=!1,...i}=t,s=Ffe({id:n,__demoMode:r}),[o,a,c]=gl(s,v=>[v.menuState,v.itemsElement,v.buttonElement]),l=No(e),u=h_.get(null),d=gl(u,E.useCallback(v=>u.selectors.isTop(v,n),[u,n]));Yhe(d,[c,a],(v,b)=>{var C;s.send({type:Ar.CloseMenu}),ZL(b,GL.Loose)||(v.preventDefault(),(C=s.state.buttonElement)==null||C.focus())});let h=vn(()=>{s.send({type:Ar.CloseMenu})}),f=E.useMemo(()=>({open:o===Rs.Open,close:h}),[o,h]),m={ref:l},y=Wi();return Rt.createElement(ert,null,Rt.createElement(Bfe.Provider,{value:s},Rt.createElement(bfe,{value:El(o,{[Rs.Open]:Ao.Open,[Rs.Closed]:Ao.Closed})},y({ourProps:m,theirProps:i,slot:f,defaultTag:nit,name:"Menu"}))))}let iit="button";function sit(t,e){let n=lB("Menu.Button"),r=E.useId(),{id:i=`headlessui-menu-button-${r}`,disabled:s=!1,autoFocus:o=!1,...a}=t,c=E.useRef(null),l=Qnt(),u=No(e,c,Ynt(),vn(L=>n.send({type:Ar.SetButtonElement,element:L}))),d=vn(L=>{switch(L.key){case os.Space:case os.Enter:case os.ArrowDown:L.preventDefault(),L.stopPropagation(),n.send({type:Ar.OpenMenu,focus:{focus:Fi.First}});break;case os.ArrowUp:L.preventDefault(),L.stopPropagation(),n.send({type:Ar.OpenMenu,focus:{focus:Fi.Last}}
168);break}}),h=vn(L=>{switch(L.key){case os.Space:L.preventDefault();break}}),[f,m,y]=gl(n,L=>[L.menuState,L.buttonElement,L.itemsElement]),v=f===Rs.Open;utt(v,{trigger:m,action:E.useCallback(L=>{if(m!=null&&m.contains(L.target))return d6.Ignore;let S=L.target.closest('[role="menuitem"]:not([data-disabled])');return Ba(S)?d6.Select(S):y!=null&&y.contains(L.target)?d6.Ignore:d6.Close},[m,y]),close:E.useCallback(()=>n.send({type:Ar.CloseMenu}),[]),select:E.useCallback(L=>L.click(),[])});let b=vn(L=>{var S;if(L.button===xfe.Left){if($et(L.currentTarget))return L.preventDefault();s||(f===Rs.Open?(xc.flushSync(()=>n.send({type:Ar.CloseMenu})),(S=c.current)==null||S.focus({preventScroll:!0})):(L.preventDefault(),n.send({type:Ar.OpenMenu,focus:{focus:Fi.Nothing},trigger:$9.Pointer})))}}),C=E.useRef(null),x=vn(L=>{C.current=L.pointerType,L.pointerType==="mouse"&&b(L)}),_=vn(L=>{C.current!=="mouse"&&b(L)}),{isFocusVisible:$,focusProps:I}=oet({autoFocus:o}),{isHovered:R,hoverProps:N}=set({isDisabled:s}),{pressed:T,pressProps:O}=fet({disabled:s}),U=E.useMemo(()=>({open:f===Rs.Open,active:T||f===Rs.Open,disabled:s,hover:R,focus:$,autofocus:o}),[f,R,$,T,s,o]),z=The(l(),{ref:u,id:i,type:dtt(t,c.current),"aria-haspopup":"menu","aria-controls":y==null?void 0:y.id,"aria-expanded":f===Rs.Open,disabled:s||void 0,autoFocus:o,onKeyDown:d,onKeyUp:h,onPointerDown:x,onClick:_},I,N,O);return Wi()({ourProps:z,theirProps:a,slot:U,defaultTag:iit,name:"Menu.Button"})}let oit="div",ait=s2.RenderStrategy|s2.Static;function cit(t,e){let n=E.useId(),{id:r=`headlessui-menu-items-${n}`,anchor:i,portal:s=!1,modal:o=!0,transition:a=!1,...c}=t,l=Znt(i),u=lB("Menu.Items"),[d,h]=Jnt(l),f=Xnt(),[m,y]=E.useState(null),v=No(e,l?d:null,vn(D=>u.send({type:Ar.SetItemsElement,element:D})),y),[b,C]=gl(u,D=>[D.menuState,D.buttonElement]),x=o2(C),_=o2(m);l&&(s=!0);let $=U5(),[I,R]=efe(a,m,$!==null?($&Ao.Open)===Ao.Open:b===Rs.Open);Hhe(I,C,()=>{u.send({type:Ar.CloseMenu})});let N=gl(u,D=>D.__demoMode),T=N?!1:o&&b===Rs.Open;Xhe(T,_);let O=N?!1:o&&b===Rs.Open;Whe(O,{allowed:E.useCallback(()=>[C,m],[C,m])});let U=b!==Rs.Open,z=Zrt(U,C)?!1:I;E.useEffect(()=>{let D=m;D&&b===Rs.Open&&D!==(_==null?void 0:_.activeElement)&&D.focus({preventScroll:!0})},[b,m,_]),Att(b===Rs.Open,{container:m,accept(D){return D.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:D.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(D){D.setAttribute("role","none")}});let L=F2(),S=vn(D=>{var V,B,P;switch(L.dispose(),D.key){case os.Space:if(u.state.searchQuery!=="")return D.preventDefault(),D.stopPropagation(),u.send({type:Ar.Search,value:D.key});case os.Enter:if(D.preventDefault(),D.stopPropagation(),u.state.activeItemIndex!==null){let{dataRef:j}=u.state.items[u.state.activeItemIndex];(B=(V=j.current)==null?void 0:V.domRef.current)==null||B.click()}u.send({type:Ar.CloseMenu}),qhe(u.state.buttonElement);break;case os.ArrowDown:return D.preventDefault(),D.stopPropagation(),u.send({type:Ar.GoToItem,focus:Fi.Next});case os.ArrowUp:return D.preventDefault(),D.stopPropagation(),u.send({type:Ar.GoToItem,focus:Fi.Previous});case os.Home:case os.PageUp:return D.preventDefault(),D.stopPropagation(),u.send({type:Ar.GoToItem,focus:Fi.First});case os.End:case os.PageDown:return D.preventDefault(),D.stopPropagation(),u.send({type:Ar.GoToItem,focus:Fi.Last});case os.Escape:D.preventDefault(),D.stopPropagation(),xc.flushSync(()=>u.send({type:Ar.CloseMenu})),(P=u.state.buttonElement)==null||P.focus({preventScroll:!0});break;case os.Tab:D.preventDefault(),D.stopPropagation(),xc.flushSync(()=>u.send({type:Ar.CloseMenu})),ott(u.state.buttonElement,D.shiftKey?ll.Previous:ll.Next);break;default:D.key.length===1&&(u.send({type:Ar.Search,value:D.key}),L.setTimeout(()=>u.send({type:Ar.ClearSearch}),350));break}}),k=vn(D=>{switch(D.key){case os.Space:D.preventDefault();break}}),M=E.useMemo(()=>({open:b===Rs.Open}),[b]),W=The(l?f():{},{"aria-activedescendant":gl(u,u.selectors.activeDescendantId),"aria-labelledby":gl(u,D=>{var V;return(V=D.buttonElement)==null?void 0:V.id}),id:r,onKeyDown:S,onKeyUp:k,role:"menu",tabIndex:b===Rs.Open?0:void 0,ref:v,style:{...c.style,...h,"
168--button-width":zet(C,!0).width},...Jhe(R)}),H=Wi();return Rt.createElement(Afe,{enabled:s?t.static||I:!1,ownerDocument:x},H({ourProps:W,theirProps:c,slot:M,defaultTag:oit,features:ait,visible:z,name:"Menu.Items"}))}let lit=E.Fragment;function uit(t,e){let n=E.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:i=!1,...s}=t,o=lB("Menu.Item"),a=gl(o,U=>o.selectors.isActive(U,r)),c=E.useRef(null),l=No(e,c),u=gl(o,U=>o.selectors.shouldScrollIntoView(U,r));br(()=>{if(u)return Oc().requestAnimationFrame(()=>{var U,z;(z=(U=c.current)==null?void 0:U.scrollIntoView)==null||z.call(U,{block:"nearest"})})},[u,c]);let d=Qrt(c),h=E.useRef({disabled:i,domRef:c,get textValue(){return d()}});br(()=>{h.current.disabled=i},[h,i]),br(()=>(o.actions.registerItem(r,h),()=>o.actions.unregisterItem(r)),[h,r]);let f=vn(()=>{o.send({type:Ar.CloseMenu})}),m=vn(U=>{if(i)return U.preventDefault();o.send({type:Ar.CloseMenu}),qhe(o.state.buttonElement)}),y=vn(()=>{if(i)return o.send({type:Ar.GoToItem,focus:Fi.Nothing});o.send({type:Ar.GoToItem,focus:Fi.Specific,id:r})}),v=vtt(),b=vn(U=>v.update(U)),C=vn(U=>{v.wasMoved(U)&&(i||a||o.send({type:Ar.GoToItem,focus:Fi.Specific,id:r,trigger:$9.Pointer}))}),x=vn(U=>{v.wasMoved(U)&&(i||a&&o.state.activationTrigger===$9.Pointer&&o.send({type:Ar.GoToItem,focus:Fi.Nothing}))}),[_,$]=Nhe(),[I,R]=jhe(),N=E.useMemo(()=>({active:a,focus:a,disabled:i,close:f}),[a,i,f]),T={id:r,ref:l,role:"menuitem",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-labelledby":_,"aria-describedby":I,disabled:void 0,onClick:m,onFocus:y,onPointerEnter:b,onMouseEnter:b,onPointerMove:C,onMouseMove:C,onPointerLeave:x,onMouseLeave:x},O=Wi();return Rt.createElement($,null,Rt.createElement(R,null,O({ourProps:T,theirProps:s,slot:N,defaultTag:lit,name:"Menu.Item"})))}let dit="div";function hit(t,e){let[n,r]=Nhe(),i=t,s={ref:e,"aria-labelledby":n,role:"group"},o=Wi();return Rt.createElement(r,null,o({ourProps:s,theirProps:i,slot:{},defaultTag:dit,name:"Menu.Section"}))}let fit="header";function pit(t,e){let n=E.useId(),{id:r=`headlessui-menu-heading-${n}`,...i}=t,s=KL();br(()=>s.register(r),[r,s.register]);let o={id:r,ref:e,role:"presentation",...s.props};return Wi()({ourProps:o,theirProps:i,slot:{},defaultTag:fit,name:"Menu.Heading"})}let git="div";function mit(t,e){let n=t,r={ref:e,role:"separator"};return Wi()({ourProps:r,theirProps:n,slot:{},defaultTag:git,name:"Menu.Separator"})}let yit=bi(rit),Ufe=bi(sit),zfe=bi(cit),Wfe=bi(uit),wit=bi(hit),vit=bi(pit),bit=bi(mit),xit=Object.assign(yit,{Button:Ufe,Items:zfe,Item:Wfe,Section:wit,Heading:vit,Separator:bit});function Eit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const x_=E.forwardRef(Eit);function Cit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"}))}const _it=E.forwardRef(Cit);function Sit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))}const Ait=E.forwardRef(Sit);function kit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"}))}const $it=E.forwardRef(kit);function Iit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}
168const Hfe=E.forwardRef(Iit);function Tit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const Pit=E.forwardRef(Tit);function Rit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"}))}const E_=E.forwardRef(Rit);function Mit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const HI=E.forwardRef(Mit);function Oit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const jit=E.forwardRef(Oit);function Nit({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const Dit=E.forwardRef(Nit);let Vfe=class{get(e){let n=localStorage.getItem(e);return n===null?void 0:JSON.parse(n)}put(e,n){n!==void 0?localStorage.setItem(e,JSON.stringify(n)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(([e])=>e)}};function TO(){try{let t="privy:__session_storage__test",e=new Vfe;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var cn=typeof window<"u"&&window.localStorage?new Vfe:new class{get(t){return this._cache[t]}put(t,e){e!==void 0?this._cache[t]=e:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const qfe=t=>t.isApexWallet?"Apex Wallet":t.isAvalanche?"Core Wallet":t.isBackpack?"Backpack":t.isBifrost?"Bifrost Wallet":t.isBitKeep?"BitKeep":t.isBitski?"Bitski":t.isBlockWallet?"BlockWallet":t.isBraveWallet?"Brave Wallet":t.isClover?"Clover":t.isCoin98?"Coin98 Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isDawn?"Dawn Wallet":t.isDefiant?"Defiant":t.isDesig?"Desig Wallet":t.isEnkrypt?"Enkrypt":t.isExodus?"Exodus":t.isFordefi?"Fordefi":t.isFrame?"Frame":t.isFrontier?"Frontier Wallet":t.isGamestop?"GameStop Wallet":t.isHaqqWallet?"HAQQ Wallet":t.isHyperPay?"HyperPay Wallet":t.isImToken?"ImToken":t.isHaloWallet?"Halo Wallet":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isNovaWallet?"Nova Wallet":t.isOkxWallet||t.isOKExWallet?"OKX Wallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOneKey?"OneKey Wallet":t.isOpera?"Opera":t.isPhantom||"isPhantom"in t?"Phantom":t.isPortal?"Ripio Portal":t.isRabby?"Rabby Wallet":t.isRainbow?"Rainbow":t.isSafePal?"SafePal Wallet":t.isStatus?"Status":t.isSubWallet?"SubWallet":t.isTalisman?"Talisman":t.isTally||t.isTaho?"Taho":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isTTWallet?"TTWallet":t.isXDEFI?"XDEFI Wallet":t.isZeal?"Zeal":t.isZerion?"Zerion":t.isMetaMask?"MetaMask":void 0,Kfe=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;
168if(t.isBraveWallet&&!t._events&&!t._state||qfe(t)!=="MetaMask")return!1;if(t.providers){for(let n of t.providers)if(!Kfe(n))return!1}return!0},Gfe=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let e of t.ethereum.providers)if(e&&e.isCoinbaseWallet)return!0}return!1},l2=(t,e,n,r)=>{let i=Number(t),s=e.find(o=>o.id===i);if(!s)throw new li(`Unsupported chainId ${t}`,4901);return ap({transport:Un(oh(s,n,r.appId)),chain:s})},oh=(t,e,n)=>{var o,a,c;let r,i=t.id,s=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])r=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[s])r=e.rpcUrls[s];else if((o=t.rpcUrls.privy)!=null&&o.http[0]){let l=new URL(t.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",n),r=l.toString()}else r=(a=t.rpcUrls.public)!=null&&a.http[0]?t.rpcUrls.public.http[0]:(c=t.rpcUrls.default)==null?void 0:c.http[0];if(!r)throw new li(`No RPC url found for ${i}`);return r},Zfe=t=>!!String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),po=(t,e=3,n=4,r="ethereum")=>{if(!t)return"";let i=r==="ethereum"?2:0;return e+n+i+3>=t.length?t:`${t.slice(0,i+e)}...${t.slice(t.length-n,t.length)}`},VI=(t,e=3,n=4)=>po(t,e,n,"solana"),I9=t=>new Promise(e=>setTimeout(e,t)),PO=(t,e={})=>{let n=e.delayMs||150,r=e.maxAttempts||270;return new Promise(async(i,s)=>{var c;let o=!1,a=0;for(;!o&&a<r;){if((c=e.abortSignal)!=null&&c.aborted)return;t().then(l=>{o=!0,i(l)},(...l)=>{o=!0,s(...l)}),a+=1,await I9(n)}o||s(Error("Exceeded max attempts before resolving function"))})},Yfe=(t,e,n={},r={})=>{let i=new URL(e,t);for(let[o,a]of Object.entries(n))a!==void 0&&i.searchParams.set(o,a);let s=Object.entries(r);if(s.length>0){let o=new URLSearchParams;for(let[a,c]of s)o.append(a,c);i.hash=o.toString()}return i.href},Lit=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),T9=t=>typeof t=="string"?t:"0x"+t.toString(16);async function Bit({store:t,walletList:e,externalWalletConfig:n,walletChainType:r,timeout:i=3e3}){let s=!1,o=window;return new Promise(a=>{function c(){if(s)return;s=!0,window.removeEventListener("ethereum#initialized",c);let l=t.getProviders();console.debug("Detected injected providers:",l.map(d=>d.info));let u=[];for(let d of l)e.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||r==="solana-only"&&d.info.rdns==="app.phantom"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});if(r!=="solana-only")for(let d of function(){var y;let h=window,f=h.ethereum;if(!f)return[];let m=[];if((y=f.providers)!=null&&y.length)for(let v of f.providers)v&&m.push(v);return m.push(h.ethereum),m}()){let h=qfe(d);if(!l.some(f=>f.info.name===h)){if(Kfe(d,!0)&&!u.find(f=>f.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(h==="Phantom"&&!u.find(f=>f.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(h==="Coinbase Wallet"&&!u.find(f=>{var m;return f.type==="coinbase_wallet"&&((m=n.coinbaseWallet)==null?void 0:m.connectionOptions)!=="smartWalletOnly"})){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(f=>f.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}a(u)}o.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},i))})}function w8(t){return`eip155:${String(Number(t))}`}const Fit=(t,e,n,r)=>{let i=Number(t),s=e.find(o=>o.id===i);if(!s)throw new li(`Unsupported chainId ${t}`,4901);return oh(s,n,r)},RO=t=>{let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=t.types.EIP712Domain??Object.entries(t.domain).map(([r,i])=>{if(i!=null&&typeof r=="string"&&r in e)return{name:r,type:e[r]}}).filter(r=>r!==void 0);return{...t,types:{...t.types,EIP712Domain:n}}},Uit=["c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96","4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0","225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f","1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369","c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb2870
1685e95034a","ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18","bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6","74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d","afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7","f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d","84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04","0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150","38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662","9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0","c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576","8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4","e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4","f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2","138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98","47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83","7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26","8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3","031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa","2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568","dd43441a6368ec9046540c46c5fdc58f79926d1
1687ce61a176444568ca7c970dcd","2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01","b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f","0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92","719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3","942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef","8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2","07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80","8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819","bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a","cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e","94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43","2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715","14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc","576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd","49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd","19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b","5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b","d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b","50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b","9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8","6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa","41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071","14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd","a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1","971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709","18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1","15c8b91ade1a4e58f3ce4e7a0dd7f42b47db0c8df7e0d84f63eb39bcb96c4e0f","541d5dcd4ede02f3afaf75bf8e3e4c4f1fb09edb5fa6c4377ebf31c2785d9adf"];function AQ(t){var e;return{name:((e=t.metadata)==null?void 0:e.shortName)||t.name||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}let kQ="WALLETCONNECT_DEEPLINK_CHOICE";function Qfe(t){return t.startsWith("http://")||t.startsWith("https://")}function Xfe(t,e){if(Qfe(t))return MO(t,e);let n=t;return n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(e)}`,href:n}}function MO(t,e){if(!Qfe(t))return Xfe(t,e);let n=t;return n.endsWith("/")||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(e)}`,href:n}}function Jfe(t,e){window.open(t,e,"noreferrer noopener")}class ko{execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}const OO="https://auth.privy.io",zit=2e4,Jr=1400,epe=2500,C_=4e3,Wit="2.6.2",Yv="privy:token",$Q="privy-token",qI="privy:refresh_token",Hit="privy-refresh-token",v8="privy:pat",IQ="privy:id_token",TQ="privy-id-token",KI="privy-session",jO="privy:caid",tpe=t=>`privy:guest:${t}`,p6=t=>`privy:cross-app:${t}`,P9="privy:state_code",Qv="privy:code_verifier",R9="privy:headless_oauth",M9="privy:oauth_disable_signup",GI=t=>`privy:wallet:${t}`,PQ="privy:connectors",npe="privy:connections",__=12e4,Em=3e4,Vit="deprecated";function NO(t){return crypto.getRandomValues(new Uint8Array(t))}function S_(){return o9(NO(36))}function uB(){return S_()}async function dB(t,e="S256"){if(e!="S256")return t;{let n=await async function(r){let i=new TextEncoder().encode(r);return new Uint8Array(await crypto.subtle.digest("SHA-256",i))}(t);return o9(n)}}function qit(){let t=cn.get(Qv);if(!t)throw new ve("Authentication error.");return t}function rpe(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ipe=({style:t,...e})=>p.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...t},...e,children:[p.jsx("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),p.jsx("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089
168C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]}),spe=({style:t,...e})=>p.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...t},...e,children:[p.jsx("g",{clipPath:"url(#clip0)",children:p.jsx("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0",children:p.jsx("rect",{width:"71",height:"55",fill:"white"})})})]}),ope=({style:t,...e})=>p.jsx("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...t},...e,children:p.jsx("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.3
16862 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})}),ape=({style:t,...e})=>p.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...t},...e,children:[p.jsx("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),p.jsx("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),p.jsx("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),p.jsx("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});function cpe(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...t,children:[p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"b",children:[p.jsx("stop",{offset:"0",stopColor:"#3771c8"}),p.jsx("stop",{stopColor:"#3771c8",offset:".128"}),p.jsx("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),p.jsxs("linearGradient",{id:"a",children:[p.jsx("stop",{offset:"0",stopColor:"#fd5"}),p.jsx("stop",{offset:".1",stopColor:"#fd5"}),p.jsx("stop",{offset:".5",stopColor:"#ff543e"}),p.jsx("stop",{offset:"1",stopColor:"#c837ab"})]}),p.jsx("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),p.jsx("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),p.jsx("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),p.jsx("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.
168004 1)"}),p.jsx("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}function lpe({style:t,...e}){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...t},...e,children:p.jsx("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:p.jsx("g",{transform:"scale(5.12,5.12)",children:p.jsx("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}function upe(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...t,children:[p.jsx("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),p.jsx("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}function dpe(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...t,children:[p.jsx("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),p.jsx("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259
168-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),p.jsx("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}const hpe=({style:t,...e})=>p.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...t},...e,children:p.jsx("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});function DO(){let t=new URL(window.location.href);t.searchParams.delete("privy_oauth_code"),t.searchParams.delete("privy_oauth_provider"),t.searchParams.delete("privy_oauth_state"),cn.del(P9),window.history.replaceState({},"",t)}const LO=({address:t,chainId:e,nonce:n})=>`${window.location.host} wants you to sign in with your Ethereum account: 169${t} 170 171By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees. 172 173URI: ${window.location.origin} 174Version: 1 175Chain ID: ${e} 176Nonce: ${n} 177Issued At: ${new Date().toISOString()} 178Resources: 179- https://privy.io`;class O9{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new ve("SiweFlow has no client instance");try{let{message:e,signature:n}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:n,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Gn(e)}}async link(){if(!this.client)throw new ve("SiweFlow has no client instance");try{let{message:e,signature:n}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:n,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw Gn(e)}}async sign(){if(!this.client)throw new ve("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new ve("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new ve("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new ve("SiweFlow has no client instance");let e=this.wallet.address,n=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=LO({address:e,chainId:n,nonce:this.nonce}),this.preparedMessage}constructor(e,n,r,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new ko(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=n,this._meta.disableSignup=i}}class BO{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new ve("SiwsFlow has no client instance");try{let{message:e,signature:n}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:n,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Gn(e)}}async link(){if(!this.client)throw new ve("SiwsFlow has no client instance");try{let{message:e,signature:n}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:n,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw Gn(e)}}async sign(){if(!this.client)throw new ve("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new ve("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new ve("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new ve("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new ve("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=(({address:n,nonce:r})=>`${window.location.host} wants you to sign in with your Solana account: 180${n} 181 182You are proving you own ${n}. 183 184URI: ${window.location.origin} 185Version: 1 186Chain ID: mainnet 187Nonce: ${r} 188Issued At: ${new Date().toISOString()} 189Resources: 190- https://privy.io`)({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,n,r,i=!1){this._meta={disableSignup:!1}
190,this.getNonceOnce=new ko(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=n,this._meta.disableSignup=i}}const fpe=E.createContext({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:Le,setError:Le,setExecuting:Le,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:Le,reset:Le,execute:Le});class A_ extends fa{constructor(e,n,r){super(e||"Captcha failed"),this.type="Captcha",n instanceof Error&&(this.cause=n),this.privyErrorCode=r}}const Kit=({children:t,id:e,captchaSiteKey:n,captchaEnabled:r})=>{let i=E.useRef(null),[s,o]=E.useState(),[a,c]=E.useState(),[l,u]=E.useState(!1),d=E.useMemo(()=>r?l||s||a?!l||s||a?s&&!a?{status:"success",token:s}:a?{status:"error",error:a}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[r,s,a,l]);return p.jsx(fpe.Provider,{value:{...d,ref:i,enabled:r,siteKey:n,appId:e,setToken:o,setError:c,setExecuting:u,remove(){var h;r&&((h=i.current)==null||h.remove(),u(!1),c(void 0),o(void 0))},reset(){var h;r&&((h=i.current)==null||h.reset(),u(!1),c(void 0),o(void 0))},execute(){var h;r&&(u(!0),(h=i.current)==null||h.execute())},async waitForResult(){if(!r)return"";try{return await function(h,{interval:f=100,timeout:m=5e3}={}){return new Promise((y,v)=>{let b,C=0,x=()=>{C>=m?v("Max attempts reached without result"):(b=h(),C+=f,b==null?setTimeout(x,f):y(b))};x()})}(()=>{var h;return(h=i.current)==null?void 0:h.getResponse()},{interval:200,timeout:2e4})}catch{throw new A_("Captcha failed",null,Ce.CAPTCHA_TIMEOUT)}}},children:t})},wa=()=>E.useContext(fpe);class pv{async authenticate(){if(!this.api)throw new ve("Auth flow has no API instance");try{return await this.api.post(zCe,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Gn(e)}}async link(){if(!this.api)throw new ve("Auth flow has no API instance");try{return await this.api.post(WCe,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw Gn(e)}}constructor(e,n=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=n}}function RQ(t){let e={detail:"",retryable:!1};return(t==null?void 0:t.privyErrorCode)===Ce.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Ce.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),(t==null?void 0:t.privyErrorCode)===Ce.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ce.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ce.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ce.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Ce.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof A_&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function Git(){let t;return(t=function(){let e=new URLSearchParams(window.location.search),n=Number(e.get("id")||""),r=e.get("hash"),i=Number(e.get("auth_date")||""),s=e.get("first_name");if(n&&s&&i&&r)return Object.fromEntries(e.entries())}())?(MQ(),{flowType:"login-url",authData:t}):(t=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let n=ppe(e.replace("#tgWebAppData=","")),{user:r,auth_date:i,hash:s}=n;return r&&i&&s?n:void 0}())?(MQ(),{flowType:"web-app",authData:t}):void 0}function ppe(t){return Object.fromEntries(decodeURIComponent(t).split("&").map(e=>e.split("=").map(decodeURIComponent)))}function MQ(){let t=new URL(window.location.href);t.searchParams.delete("id"),t.searchParams.delete("hash"),t.searchParams.delete("auth_date"),t.searchParams.delete("first_name"),t.searchParams.delete("last_name"),t.searchParams.delete("username"),t.searchParams.delete("photo_url"),t.hash="",window.history.replaceState({},"",t)}function on(t){return t?new Date(1e3*t):null}function bo(t,e){return t.slice().sort((n,r)=>
190(n.firstVerifiedAt??n.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(n=>n.type===e)}const co=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"&&e.walletIndex===0))||null,b8=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"),Zit=t=>b8(t).reduce((e,n)=>!e||e.walletIndex<n.walletIndex?n:e,null),gpe=(t,e)=>((t==null?void 0:t.linkedAccounts)??[]).filter(n=>n.type==="wallet"&&n.walletClientType==="privy"&&n.chainType===e),x8=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"),ul=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"&&e.walletIndex===0))||null,Yit=t=>x8(t).reduce((e,n)=>!e||e.walletIndex<n.walletIndex?n:e,null),FO=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.imported&&e.chainType==="ethereum"))||null,bb=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana"))||null,j9=(t,e)=>(t==null?void 0:t.linkedAccounts.find(n=>n.type==="wallet"&&n.walletClientType==="privy"&&n.address===e))||null,$s=t=>co(t)??ul(t),Gr=t=>{if(t.chainType==="ethereum")return{entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier"};if(t.chainType==="solana")return{entropyId:t.address,entropyIdVerifier:"solana-address-ver
190ifier"};throw Error("Failed to get account entropy details")},OQ=t=>{let e=$s(t);if(!e)throw Error("Failed to find primary wallet");return Gr(e)},g6=(t,e)=>{let n=gpe(t,"ethereum").find(r=>cr(r.address)===cr(e));return{signingWallet:n,rootWallet:n?n.imported?n:co(t):void 0}},E8=(t,e)=>{let n=gpe(t,"solana").find(r=>r.address===e);return n?n.imported||n.walletIndex===0?{signingWallet:n,rootWallet:n}:{signingWallet:n,rootWallet:ul(t)}:{}};function oo(t){if(!t)return null;let e=function(C){let x=[];for(let _ of C){let $=_.type;switch(_.type){case"wallet":let I={id:_.id,address:_.address,type:_.type,imported:_.imported,delegated:_.delegated,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at),chainType:_.chain_type,walletClientType:_.wallet_client_type,connectorType:_.connector_type,recoveryMethod:_.recovery_method,walletIndex:_.wallet_index};x.push(I);break;case"smart_wallet":let R={address:_.address,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at),smartWalletType:_.smart_wallet_type};x.push(R);break;case"cross_app":let N={type:_.type,subject:_.subject,embeddedWallets:_.embedded_wallets,smartWallets:_.smart_wallets,providerApp:{id:_.provider_app_id},verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(N);break;case"email":let T={address:_.address,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(T);break;case"phone":let O={number:_.phoneNumber,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(O);break;case"google_oauth":let U={subject:_.subject,email:_.email,name:_.name,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(U);break;case"spotify_oauth":let z={subject:_.subject,email:_.email,name:_.name,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(z);break;case"instagram_oauth":let L={subject:_.subject,username:_.username,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(L);break;case"twitter_oauth":let S={subject:_.subject,username:_.username,name:_.name,type:_.type,profilePictureUrl:_.profile_picture_url,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(S);break;case"discord_oauth":let k={subject:_.subject,username:_.username,email:_.email,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(k);break;case"github_oauth":let M={subject:_.subject,username:_.username,name:_.name,email:_.email,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(M);break;case"tiktok_oauth":let W={subject:_.subject,username:_.username,name:_.name,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(W);break;case"linkedin_oauth":let H={subject:_.subject,name:_.name,email:_.email,vanityName:_.vanity_name,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(H);break;case"apple_oauth":let D={subject:_.subject,email:_.email,type:_.type,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(D);break;case"custom_auth":x.push({type:_.type,customUserId:_.custom_user_id,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)});break;case"farcaster":let V={type:_.type,fid:_.fid,ownerAddress:_.owner_address,displayName:_.display_name,username:_.username,bio:_.bio,pfp:_.profile_picture_url,url:_.homepage_url,verifiedAt:on(_.verified_at),first
190VerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at),signerPublicKey:_.signer_public_key};x.push(V);break;case"passkey":let B={type:_.type,enrolledInMfa:_.enrolled_in_mfa,credentialId:_.credential_id,authenticatorName:_.authenticator_name,createdWithDevice:_.created_with_device,createdWithOs:_.created_with_os,createdWithBrowser:_.created_with_browser,verifiedAt:on(_.verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(B);break;case"telegram":let P={type:_.type,telegramUserId:_.telegram_user_id,firstName:_.first_name,lastName:_.last_name,username:_.username,photoUrl:_.photo_url,verifiedAt:on(_.first_verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(P);break;case"signer":let j={type:_.type,publicKey:_.public_key,verifiedAt:on(_.first_verified_at),firstVerifiedAt:on(_.first_verified_at),latestVerifiedAt:on(_.latest_verified_at)};x.push(j);break;default:console.warn(`Unrecognized account type: ${$}. Please consider upgrading the Privy SDK.`)}}return x}(t.linked_accounts),n=bo(e,"wallet"),r=bo(e,"smart_wallet"),i=bo(e,"email"),s=bo(e,"phone"),o=bo(e,"google_oauth"),a=bo(e,"twitter_oauth"),c=bo(e,"discord_oauth"),l=bo(e,"github_oauth"),u=bo(e,"spotify_oauth"),d=bo(e,"instagram_oauth"),h=bo(e,"tiktok_oauth"),f=bo(e,"linkedin_oauth"),m=bo(e,"apple_oauth"),y=bo(e,"farcaster"),v=bo(e,"telegram"),b=t.mfa_methods.map(({type:C,verified_at:x})=>({type:C,verifiedAt:on(x)}));return{id:t.id,createdAt:on(t.created_at),linkedAccounts:e,email:i&&{address:i==null?void 0:i.address},phone:s&&{number:s==null?void 0:s.number},wallet:n&&{id:n.id,address:n.address,chainType:n.chainType,walletClientType:n.walletClientType,connectorType:n.connectorType,recoveryMethod:n.recoveryMethod,imported:n.imported,delegated:n.delegated,walletIndex:n.walletIndex},smartWallet:r&&{address:r.address,smartWalletType:r.smartWalletType},google:o&&{subject:o.subject,email:o.email,name:o.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:c&&{subject:c.subject,username:c.username,email:c.email},github:l&&{subject:l.subject,username:l.username,name:l.name,email:l.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:h&&{subject:h.subject,username:h.username,name:h.name},linkedin:f&&{subject:f.subject,name:f.name,email:f.email,vanityName:f.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:y&&{fid:y.fid,ownerAddress:y.ownerAddress,displayName:y.displayName,username:y.username,bio:y.bio,pfp:y.pfp,url:y.url,signerPublicKey:y.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},delegatedWallets:[],mfaMethods:b.map(C=>C.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}const Qit=({style:t,...e})=>p.jsxs("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[p.jsx("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),Xit="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",k_={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol
190:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},mpe={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},hB={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},ype={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},$_={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},wpe={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},vpe={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},bpe={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},W5={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},I_={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},xpe={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol
190:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},T_={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},Epe={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},Cpe={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},_pe={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},N9=[k_,mpe,Cpe,W5,I_,xpe,T_,Epe,vpe,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},$_,wpe,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webS
190ocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},bpe,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},hB,ype,_pe,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],Spe=new Set(N9.map(t=>t.id));class Ape extends li{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class kpe extends li{constructor(){super("User rejected connection"),this.type="wallet_error"}}const Z1=t=>t instanceof li?t:t!=null&&t.code?new Vd(t):new li("Unknown connector error",t);class ty extends fa{constructor(e,n,r){super(e),this.type="provider_error",this.code=n,this.data=r}}class Vd extends ty{constructor(e){var r,i,s;super(e.message,e.code,e.data);let n=Object.values(cl).find(o=>o.eipCode===e.code);this.details=n||cl.UNKNOWN_ERROR,e.code===-32002&&((r=e.message)!=null&&r.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=cl.E32002_CONNECTION_ALREADY_PENDING:this.details=cl.E32002_REQUEST_ALREADY_PENDING:(s=e.message)!=null&&s.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=cl.E32002_WALLET_LOCKED))}}const Sf={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...cl};function Ed(t){return t.type==="ethereum"}function UO(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if((r==null?void 0:r.address)!==(i==null?void 0:i.address)||r&&i&&Ed(r)&&Ed(i)&&(r==null?void 0:r.chainId)!==(i==null?void 0:i.chainId)||(r==null?void 0:r.connectorType)!==(i==null?void 0:i.connectorType)||(r==null?void 0:r.connectedAt)!==(i==null?void 0:i.connectedAt)||(r==null?void 0:r.walletClientType)!==(i==null?void 0:i.walletClientType)||(r==null?void 0:r.isConnected)!==(i==null?void 0:i.isConnected)||(r==null?void 0:r.linked)!==(i==null?void 0:i.linked))return!1}return!0}class $pe extends wp{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const fB=(t,e)=>t.rpcTimeouts&&t.rpcTimeouts[e]||__;
190function gv(t){return t.chainType==="ethereum"}class H2 extends $pe{buildConnectedWallet(e,n,r,i){let s=async()=>!!this.wallets.find(o=>cr(o.address)===cr(e));return{type:"ethereum",address:cr(e),chainId:n,meta:r,imported:i,switchChain:async o=>{var h,f,m,y;let a,c;if(!s)throw new li("Wallet is not currently connected.");let l=(h=this.wallets.find(v=>cr(v.address)===cr(e)))==null?void 0:h.chainId;if(!l)throw new li("Unable to determine current chainId.");if(typeof o=="number"?(a=`0x${o.toString(16)}`,c=o):(a=o,c=Number(o)),l===w8(a))return;let u=this.chains.find(v=>v.id===c);if(!u)throw new li(`Unsupported chainId: ${o}`);let d=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})};try{return await d()}catch(v){if(((b,C)=>{var x;switch(C){case"coinbase_wallet":return b.message.includes("addEthereumChain");case"rabby_wallet":return b.message.includes("Unrecognized chain ID");default:return b.code===4902||((x=b.message)==null?void 0:x.includes("4902"))}})(v,this.walletClientType))return this.walletClientType==="rabby_wallet"&&await I9(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:a,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[((f=u.rpcUrls.default)==null?void 0:f.http[0])??""],blockExplorerUrls:[((m=u.blockExplorers)==null?void 0:m.default.url)??""]}]}),d();throw this.walletClientType==="rainbow"&&((y=v.message)!=null&&y.includes("wallet_switchEthereumChain"))?new li(`Rainbow does not support the chainId ${n}`):v}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:s,getEthereumProvider:async()=>{if(!await s())throw new li("Wallet is not currently connected.");return this.proxyProvider},sign:async o=>{if(!await s())throw new li("Wallet is not currently connected.");return await this.sign(o)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let n,r=e;try{if(r===void 0){let c=await PO(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,c),Array.isArray(c)&&(r=c)}}catch(c){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let i=r[0],s=cr(i),o=[];if(this.walletClientType==="privy"){let c=cn.get(GI(s));this.chains.find(l=>l.id===Number(c))||(cn.del(GI(s)),c=null),n=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${n} on initialization`)}}else try{let c=await PO(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,c),typeof c=="string")n=c;else{if(typeof c!="number")throw Error("Invalid chainId returned from provider");n=`0x${c.toString(16)}`}}catch(c){console.warn("Failed to get chainId from provider, defaulting to 0x1",c),n="0x1"}let a=w8(n);if(!o.find(c=>cr(c.address)===s)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};o.push(this.buildConnectedWallet(cr(i),a,c,this.connectorType==="embedded_imported"))}UO(o,this.wallets)||(this.wallets=o,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((n,r)=>r.connectedAt-n.connectedAt).find(n=>e.find(r=>cr(r)===cr(n.address)))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){var n;return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[Qt(e),(n=this.wallets[0])==null?void 0:n.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,n,r,i){super(e),this.chainType="ethereum",this.onAccountsChanged=s=>{s.length===0?this.onDisconnect():this.syncAccounts(s)},this.onChainChanged=s=>
190{this.wallets.forEach(o=>{o.chainId=w8(s),this.walletClientType==="privy"&&cn.put(GI(o.address),s)}),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=async()=>{this.connected=!0,this.connectorType==="coinbase_wallet"&&await I9(300),this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=n,this.defaultChain=r,this.rpcConfig=i,this.rpcTimeoutDuration=fB(i,e),this.connected=!1,this.initialized=!1}}class Y1{on(e,n){if(this.walletProvider)return this.walletProvider.on(e,n);this._subscriptions.push({eventName:e,listener:n})}async request(e){if(!this.walletProvider)throw new li(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch(n=>{throw Z1(n)})}constructor(e,n){this.removeListener=(r,i)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(r,i)}catch{console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(r=new Ape,i=this.rpcTimeoutDuration)=>new Promise((s,o)=>setTimeout(()=>{o(r)},i)),this.setWalletProvider=r=>{this.walletProvider&&this._subscriptions.forEach(i=>{this.removeListener(i.eventName,i.listener)}),this.walletProvider=r,this._subscriptions.forEach(i=>{var s;(s=this.walletProvider)==null||s.on(i.eventName,i.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=n||__,this._subscriptions=[]}}const Ipe=({...t})=>p.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});let ZI={0:"legacy",1:"eip2930",2:"eip1559",3:"eip4844"};const Jit={legacy:0,eip2930:1,eip1559:2,eip4844:3};let lm=t=>t!==void 0?BigInt(t):void 0;function Tpe(t){let e,{type:n=2,...r}=t;r.accessList&&Array.isArray(r.accessList)?e=r.accessList.map(l=>Array.isArray(l)?{address:l[0],storageKeys:l[1]}:l):r.accessList&&(e=Object.entries(r.accessList).map(l=>({address:l[0],storageKeys:l[1]})));let i=Number(r.chainId??1),s=Da(r.data)?r.data:r.data?Qt(Uint8Array.from(r.data)):void 0,o=r.nonce?Number(r.nonce):void 0,a={chainId:i,data:s,nonce:o,value:lm(r.value),gas:lm(r.gas??r.gasLimit)},c=Number(n);if(c===0)return{...r,type:ZI[c],...a,gasPrice:lm(r.gasPrice),accessList:void 0,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0};if(c===1)return{...r,type:ZI[c],...a,gasPrice:lm(r.gasPrice),accessList:e,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0};if(c===2)return{...r,type:ZI[c],...a,nonce:o,accessList:e,maxFeePerGas:lm(r.maxFeePerGas),maxPriorityFeePerGas:lm(r.maxPriorityFeePerGas),gasPrice:void 0,maxFeePerBlobGas:void 0};throw new ve(`Unsupported transaction type: ${n}`)}const pB=({style:t,...e})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...t},...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),est=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","ronin_wallet","crypto.com_wallet_extension","crypto.com_onchain","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","ronin_wallet","privy","unknown","phantom","solflare","glow","backpack"],Ppe=Object.freeze({phantom:{client:"phantom",name:"Phantom",installLink:di.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",chainTypes:["ethereum","solana"],get isInstalled(){var t,e,n,r,i,s;if("phantom"in window){let o=window;if((e=(t=o==null?void 0:o.phantom)==null?void 0:t.ethereum)!=null&&e.isPhantom&&((r=(n=o==null?void 0:o.phantom)==null?void 0:n.ethereum)!=null&&r.chainId)||(s=(i=o==null?void 0:o.phantom)==null?void 0:i.solana)!=null&&s.isPhantom)return!0}return!1},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=m6({client:this.client,isSolana:e,connectOnly:n});return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`}},solflare:{client:"solflare",name:"Solflare",installLink:di.isFirefox?"https://addons.mozilla.org/es/firefox/addon/solflare-wallet/":"https://chromewebstore.google.com/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",chainTypes:["solana"],get isInstalled(){var t;return"solflare"in window&&!!((t=window==null?void 0:window.solflare)!=null&&t.isSolflare)},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=m6({client:this.client,isSolana:e,connectOnly:n});return`${t?"solflare://ul/v1/":"https://solflare.com/ul/v1/"}browse/${r}?ref=${r}`}},backpack:{client:"backpack",name:"Backpack",installLink:"https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcb
190cmnbpgliof",chainTypes:["ethereum","solana"],get isInstalled(){var t,e,n,r;return!(!("backpack"in window)||!((e=(t=window==null?void 0:window.backpack)==null?void 0:t.ethereum)!=null&&e.isBackpack)&&!((r=(n=window==null?void 0:window.backpack)==null?void 0:n.solana)!=null&&r.isBackpack))},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=m6({client:this.client,isSolana:e,connectOnly:n});return`${t?"backpack://ul/v1/":"https://backpack.com/ul/v1/"}browse/${r}?ref=${r}`}},okx_wallet:{client:"okx_wallet",name:"OKX Wallet",installLink:"https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",chainTypes:["solana"],get isInstalled(){var t;return"okxwallet"in window&&!!((t=window==null?void 0:window.okxwallet)!=null&&t.isOkxWallet)},getMobileRedirect({isSolana:t,connectOnly:e}){return"https://www.okx.com/download?deeplink="+encodeURIComponent("okx://wallet/dapp/url?dappUrl="+m6({client:this.client,isSolana:t,connectOnly:e}))}}});function Rpe({connectorType:t,walletClientType:e}){for(let n of est)if(t===n||e===n)return Ppe[n]}function m6({client:t,isSolana:e,connectOnly:n}){let r=new URL(window.location.href);return r.searchParams.set("privy_connector",e?"solana_adapter":"injected"),r.searchParams.set("privy_wallet_client",t),r.searchParams.set("privy_connect_only",String(n)),encodeURIComponent(r.href.replace(/\/$/g,""))}const P_=C5(()=>({listings:[]})),tst=P_.setState,YI=t=>{let e;try{e=new URL(t).hostname}catch{return}return P_.getState().listings.find(({homepage:n})=>{let r;try{r=new URL(n).hostname}catch{return!1}return e.includes(r)})},Eh=t=>P_(({listings:e})=>e.find(({slug:n})=>D9(n)===D9(t)));function D9(t){return t==="cryptocom"?"cryptocom-defi":t.replace(/[-_]wallet$/,"")}function nst({src:t,...e}){return p.jsx("img",{src:t,...e,style:{display:"none"}})}const Kc={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let rst=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack"]),jQ=t=>rst.has(t),NQ=(t,e,n)=>n.indexOf(t)===e;function gB(t){let e=t.filter(n=>!Spe.has(n.id));return N9.concat(e)}function ist(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const zO=792703809,WO="11111111111111111111111111111111";function R_(t){return t.includes("testnet")?"testnet":t.includes("devnet")?"devnet":"mainnet-beta"}function sst(t,e){return`https://explorer.solana.com/account/${t}?cluster=${e}`}let DQ="#FFFFFF";function Ko(t,e){let n=Math.max(0,Math.min(1,t.toHsl().l+e));return en({...t.toHsl(),l:n})}function ost({backgroundTheme:t,accentHex:e}){let n;switch(t){case"light":n=DQ;break;case"dark":n="#1E1E1D";break;default:n=t}let r=en(n),i=en(e),s=en("#51BA81"),o=en("#FFB74D"),a=en("#EC6351"),c=function(N){return N<.8&&N>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),N>.5?"light":"dark"}(r.getLuminance()),l=Ko(r,c==="light"?-.04:.11),u=Ko(r,c==="light"?-.08:.16),d=Ko(r,c==="light"?-.88:.87),h=Ko(r,c==="light"?-.7:.75),f=Ko(r,c==="light"?-.43:.45).desaturate(c==="light"?60:20),m=Ko(r,c==="light"?-.08:.25).desaturate(c==="light"?60:20),y=Ko(i,.15),v=Ko(i,.25),b=Ko(i,-.06),C=Ko(i,-.6),x=Ko(a,.3),_=Ko(o,.3),$=en(i.getLuminance()>.5?"#040217":DQ),I=Ko(s,-.16),R=Ko(s,.4);return{colorScheme:c,background:r.toHslString(),background2:l.toHslString(),background3:u.toHslString(),foreground:d.toHslString(),foreground2:h.toHslString(),foreground3:f.toHslString(),foreground4:m.toHslString(),accent:i.toHslString(),accentLight:y.toHslString(),accentLightest:v.toHslString(),accentDark:b.toHslString(),accentDarkest:C.toHslString(),foregroundAccent:$.toHslString(),success:s.toHslString(),successDark:I.toHslString(),successLight:R.toHslString(),error:a.toHslString(),errorLight:x.toHslString(),warn:o.toHslString(),warnLight:_.toHslString()}}function Mpe(t,e,n,r){var G,Y,te,ae,oe,de,ke,Be,$e,He,Ge,je,xt,ft,it,be,Lt,Qe,Ue,Ye,tt,ze,Ne,J,q,Z,se,he,fe,ye,nt,vt,Nt,mn,At,En,yr,xn,kt,Ie,It,rt,Zt,yt,pt,St,qe,Et,Ze,wt;let i,s,o,a,c,l,u,d,h,f,m,y,v,b,C,x=n?console.warn:()=>{};e!=null&&e.loginMethods?(i=e.loginMethods.includes("email"),s=e.loginMethods.includes("sms"),a=e.loginMethods.includes("wallet"),c=e.loginMethods.includes("google"),l=e.loginMethods.includes("twitter"),u=e.loginMethods.includes("discord"),h=e.loginMethods.includes("spotify"),f=e.loginMethods.includes("instagram"),d=e.loginMethods.includes("tiktok"),y=e.loginMethods.includes("github"),m=e.loginMethods.includes("linkedin"),v=e.loginMethods.includes("apple"),b=e.loginMethods.includes("farcaster"),C=e.loginMethods.includes("telegram"),o=e.loginMethods.includes("passkey")):(i=t.emailAuth,s=t.smsAuth,a=t.walletAuth||t.solanaWalletAuth,c=t.googleOAuth,l=t.twitterOAuth,u=t.discordOAuth,y=t.githubOAuth,h=t.spotifyOAuth,f=t.instagramOAuth,d=t.tiktokOAuth,m=t.linkedinOAuth,v=t.appleOAuth,b=t.farcasterAuth,C=t.telegramAuth,o=t.passkeyAuth),t.passkeyAuth&&(o=!0),typeof window<"u"&&typeof window.PublicKeyCredential!="function"&&(o=!1);
190let _=[i,s].filter(Boolean),$=[c,l,u,y,h,f,d,m,v,b,C].filter(Boolean),I=[a].filter(Boolean),R=((G=e==null?void 0:e.loginMethods)==null?void 0:G.includes("passkey"))??!1,N=t.passkeysForSignupEnabled??!1,T=[o&&(N||R)].filter(Boolean);if(_.length+$.length+I.length+T.length===0)throw Error("You must enable at least one login method");let O=((Y=e==null?void 0:e.appearance)==null?void 0:Y.showWalletLoginFirst)!==void 0?(te=e==null?void 0:e.appearance)==null?void 0:te.showWalletLoginFirst:t.showWalletLoginFirst;O&&I.length===0?(x("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),O=!1):O||$.length+_.length!==0||(x("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),O=!0);let U=((oe=(ae=e==null?void 0:e.externalWallets)==null?void 0:ae.walletConnect)==null?void 0:oe.enabled)??!0;e!=null&&e.loginMethods&&e.loginMethodsAndOrder&&x("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let z=(({input:ot,overrides:qt})=>qt?qt.primary.concat(qt.overflow??[]).filter(jQ).filter(NQ):ot?ot.filter(jQ).filter(NQ):Kc.appearance.walletList)({input:(de=e==null?void 0:e.appearance)==null?void 0:de.walletList,overrides:e==null?void 0:e.loginMethodsAndOrder}),L=(({input:ot})=>{if(!ot||!ot.primary[0])return;let qt=[ot.primary[0]],mt=[];for(let Bt of(ot.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),ot.primary.slice(1)))qt.includes(Bt)?console.warn(`Duplicated login method: ${Bt}`):qt.push(Bt);for(let Bt of ot.overflow??[])qt.includes(Bt)||mt.includes(Bt)?console.warn(`Duplicated login method: ${Bt}`):mt.push(Bt);return{primary:qt,overflow:mt}})({input:e==null?void 0:e.loginMethodsAndOrder}),S=((ke=e==null?void 0:e.intl)==null?void 0:ke.defaultCountry)??"US",{chains:k,defaultChain:M}=function({supportedChains:ot,defaultChainFromConfig:qt}){let mt;if(ot){if(ot.length===0)throw Error("`supportedChains` must contain at least one chain");mt=ot.map(Ve=>{var ee;if(Ve.rpcUrls.privyWalletOverride)return Ve;let st=N9.find(ie=>ie.id===Ve.id),X=(ee=st==null?void 0:st.rpcUrls.privy)==null?void 0:ee.http[0];return X?ist(Ve,X):Ve})}else mt=[...N9];let Bt=ot?mt[0]:W5,un=qt??Bt;if(!mt.find(Ve=>Ve.id===un.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:mt,defaultChain:un}}({supportedChains:e==null?void 0:e.supportedChains,defaultChainFromConfig:e==null?void 0:e.defaultChain}),W=!!(e!=null&&e.defaultChain),H=((Be=e==null?void 0:e.customAuth)==null?void 0:Be.getCustomAccessToken)&&(($e=e==null?void 0:e.customAuth)==null?void 0:$e.enabled)!==!1,D=(He=e==null?void 0:e.embeddedWallets)==null?void 0:He.requireUserPasswordOnCreate,V=(Ge=e==null?void 0:e.embeddedWallets)==null?void 0:Ge.createOnLogin,B=H?"all-users":t.embeddedWalletConfig.ethereum.createOnLogin,P=t.embeddedWalletConfig.solana.createOnLogin,j=(e==null?void 0:e.solanaClusters)??[];return t.solanaWalletAuth&&!((xt=(je=e==null?void 0:e.externalWallets)==null?void 0:je.solana)!=null&&xt.connectors)&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:t.id,name:t.name,allowlistConfig:t.allowlistConfig,legacyWalletUiConfig:t.legacyWalletUiConfig,appearance:{logo:((ft=e==null?void 0:e.appearance)==null?void 0:ft.logo)??t.logoUrl,landingHeader:((it=e==null?void 0:e.appearance)==null?void 0:it.landingHeader)??Kc.appearance.landingHeader,loginMessage:typeof((be=e==null?void 0:e.appearance)==null?void 0:be.loginMessage)=="string"?(Lt=e==null?void 0:e.appearance)==null?void 0:Lt.loginMessage.slice(0,100):(Qe=e==null?void 0:e.appearance)==null?void 0:Qe.loginMessage,footerLogo:(Ue=e==null?void 0:e.appearance)==null?void 0:Ue.footerLogo,palette:ost({backgroundTheme:((Ye=e==null?void 0:e.appearance)==null?void 0:Ye.theme)??Kc.appearance.theme,accentHex:((tt=e==null?void 0:e.appearance)==null?void 0:tt.accentColor)??t.accentColor??Kc.appearance.accentColor}),loginGroupPriority:O?"web3-first":"web2-first",hideDirectWeb2Inputs:!!((ze=e==null?void 0:e.appearance)!=null&&ze.hideDirectWeb2Inputs),walletList:z,walletChainType:((Ne=e==null?void 0:e.appearance)==null?void 0:Ne.walletChainType)??(({evmWalletAuth:ot,solanaWalletAuth:qt})=>ot&&qt?"ethereum-and-solana":ot?"ethereum-only":qt?"solana-only":"ethereum-only")({evmWalletAuth:t.walletAuth??!1,solanaWalletAuth:t.solanaWalletAuth??!1})},loginMethods:{wallet:a,email:i,sms:s,passkey:o,google:c,twitter:l,discord:u,github:y,spotify:h,instagram:f,tiktok:d,linkedin:m,apple:v,farcaster:b,telegram:C},disablePlusEmails:t.disablePlusEmails,loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:((J=e==null?void 0:e.legal)==null?void 0:J.termsAndConditionsUrl)??t.termsAndConditionsUrl,privacyPolicyUrl:((q=e==null?void 0:e.legal)==null?void 0:q.privacyPolicyUrl)??t.privacyPolicyUrl,requireUsersAcceptTerms:t.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:(e==null?void 0:e.walletConnectCloudProjectId)??t.walletConnectCloudProjectId??Kc.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},chains:k,solanaClusters:{"mainnet-beta":((Z=j.find(ot=>ot.name==="mainnet-beta"))==null?void 0:Z.rpcUrl)||"https://api.mainnet-beta.solana.com",testnet:((se=j.find(ot=>ot.name==="testnet"))==null?void 0:se.rpcUrl)||"https://api.testnet.solana.com",devnet:((he=j.find(ot=>ot.name==="devnet"))==null?void 0:he.rpcUrl)||"https://api.devnet.solana.com"},defaultChain:M,intl:{defaultCountry:S},shouldEnforceDefaultChainOnConnect:W,captchaEnabled:t.captchaEnabled??Kc.captchaEnabled,captchaSiteKey:t.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:((ye=(fe=e==null?void 0:e.externalWallets)==null?void 0:fe.coinbaseWallet)==null?void 0:ye.connectionOptions)??Kc.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U},solana:{connectors:(vt=(nt=e==null?void 0:e.externalWallets)==null?void 0:nt.solana)==null?void 0:vt.connectors}},embeddedWallets:{requireUserOwnedRecoveryOnCreate:D??(!H&&t.embeddedWalletConfig.requireUserOwnedRecoveryOnCreate),userOwnedRecoveryOptions:H?["user-passcode"]:t.embeddedWalletConfig.userOwnedRecoveryOptions,priceDisplay:((Nt=e==null?void 0:e.embeddedWallets)==null?void 0:Nt.priceDisplay)??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:V??((At=(mn=e==null?void 0:e.embeddedWallets)==null?void 0:mn.ethereum)==null?void 0:At.createOnLogin)??B}
190,solana:{createOnLogin:((yr=(En=e==null?void 0:e.embeddedWallets)==null?void 0:En.solana)==null?void 0:yr.createOnLogin)??P},showWalletUIs:((xn=e==null?void 0:e.embeddedWallets)==null?void 0:xn.showWalletUIs)??t.enforceWalletUis??!0,extendedCalldataDecoding:((kt=e==null?void 0:e.embeddedWallets)==null?void 0:kt.extendedCalldataDecoding)??!1,transactionScanning:{enabled:((It=(Ie=e==null?void 0:e.embeddedWallets)==null?void 0:Ie.transactionScanning)==null?void 0:It.enabled)??!1,domain:((Zt=(rt=e==null?void 0:e.embeddedWallets)==null?void 0:rt.transactionScanning)==null?void 0:Zt.domain)??r??"https://auth.privy.io"}},mfa:{methods:t.mfaMethods??[],noPromptOnMfaRequired:((yt=e==null?void 0:e.mfa)==null?void 0:yt.noPromptOnMfaRequired)??!1},passkeys:{shouldUnlinkOnUnenrollMfa:(pt=e==null?void 0:e.passkeys)==null?void 0:pt.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:(St=e==null?void 0:e.passkeys)==null?void 0:St.shouldUnenrollMfaOnUnlink},customAuth:H?{enabled:!0,...e.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:t.telegramAuthConfiguration,passkeysForSignupEnabled:t.passkeysForSignupEnabled},headless:!!(e!=null&&e.headless),render:{standalone:((qe=e==null?void 0:e._render)==null?void 0:qe.standalone)??Kc._render.standalone},fundingConfig:t.fundingConfig,fundingMethodConfig:{...(e==null?void 0:e.fundingMethodConfig)??Kc.fundingMethodConfig,moonpay:{...((Et=e==null?void 0:e.fundingMethodConfig)==null?void 0:Et.moonpay)??Kc.fundingMethodConfig.moonpay,useSandbox:((Ze=e==null?void 0:e.fundingMethodConfig)==null?void 0:Ze.moonpay.useSandbox)??((wt=e==null?void 0:e.fiatOnRamp)==null?void 0:wt.useSandbox)??Kc.fundingMethodConfig.moonpay.useSandbox}}}}let Ope={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{ethereum:{createOnLogin:"off"},solana:{createOnLogin:"off"},requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const jpe=Mpe(Ope,void 0,!1);let mB=E.createContext({appConfig:jpe,isServerConfigLoaded:!1});const ast=({children:t,client:e,clientConfig:n})=>{let[r,i]=E.useState(null),s=E.useMemo(()=>Mpe(r??Ope,n,!!r,typeof window<"u"?window.location.origin:void 0),[r,n]);return E.useEffect(()=>{if(!r)return;let o=function(l){var y,v;if(!l)return{};let{appearance:u,supportedChains:d,defaultChain:h,externalWallets:f,...m}=l;return{...m,...d?{supportedChains:d.map(b=>b.id)}:void 0,...h?{defaultChain:h.id}:void 0,...f?{walletConnect:f.walletConnect,coinbaseWallet:f.coinbaseWallet,s
190olana:{connectors:(v=(y=f.solana)==null?void 0:y.connectors)==null?void 0:v.get().map(b=>b.walletClientType)}}:void 0}}(n),a=function(l,u=0){let d=3735928559^u,h=1103547991^u;for(let f,m=0;m<l.length;m++)d=Math.imul(d^(f=l.charCodeAt(m)),2654435761),h=Math.imul(h^f,1597334677);return d=Math.imul(d^d>>>16,2246822507)^Math.imul(h^h>>>13,3266489909),4294967296*(2097151&(h=Math.imul(h^h>>>16,2246822507)^Math.imul(d^d>>>13,3266489909)))+(d>>>0)}(JSON.stringify(o)).toString(),c=`privy:sent:${r.id}:${a}`;localStorage.getItem(c)||(e.createAnalyticsEvent({eventName:"sdk_initialize",payload:o}),localStorage.setItem(c,"t"))},[n,r]),E.useEffect(()=>{r||(async()=>{try{let o=await e.getServerConfig();o.customApiUrl&&e.updateApiUrl(o.customApiUrl),i(o)}catch(o){console.warn("Error generating app config: ",o)}})()},[]),p.jsx(mB.Provider,{value:{appConfig:s,isServerConfigLoaded:!!r},children:t})},Vr=()=>{let{appConfig:t}=E.useContext(mB);return t},Npe=()=>{let{isServerConfigLoaded:t}=E.useContext(mB);return t};function cst(t){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...t,children:p.jsx("g",{fill:t.color||"var(--privy-color-foreground)",children:p.jsx("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.
19061-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let LQ=ue.div.withConfig({displayName:"TermsAndConditionsContainer",componentId:"sc-bdb69ecc-0"})(["margin-top:16px;font-size:13px;text-align:center;color:var(--privy-color-foreground-3);&& > a{color:var(--privy-color-accent);}"]);function yB({app:{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:e,requireUsersAcceptTerms:n}},alwaysShowImplicitConsent:r}){let i=!(!t||!e);return n&&!r||!e&&!t?p.jsx(LQ,{}):p.jsxs(LQ,{children:["By logging in I agree to the"," ",e&&p.jsx("a",{href:e,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",t&&p.jsx("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}const ln=()=>{let{appearance:t}=Vr();return p.jsx(Bn,{children:t.footerLogo??p.jsx("a",{href:"https://www.privy.io/",target:"_blank",id:"protected-by-privy",children:p.jsx(cst,{height:13,width:150})})})},Bn=ue.div.withConfig({displayName:"ModalFooter",componentId:"sc-bdb69ecc-1"})(["display:flex;align-items:center;justify-content:center;padding-top:8px;padding-bottom:12px;gap:8px;font-size:13px;&& a{padding:0.5rem 0;&:hover{text-decoration:none;}}@media all and (display-mode:standalone){padding-bottom:30px;}"]),Dpe=({backFn:t})=>p.jsx("div",{children:p.jsx(M_,{onClick:t,children:p.jsx(tTe,{height:"16px",width:"16px",strokeWidth:2})})}),lst=({nextFn:t})=>p.jsx("div",{children:p.jsx(M_,{onClick:t,children:p.jsx(Wce,{height:"16px",width:"16px",strokeWidth:2})})}),ust=({infoFn:t})=>p.jsx("div",{children:p.jsx(hst,{"aria-label":"info",onClick:t,children:p.jsx(t1,{height:"22px",width:"22px",strokeWidth:2})})}),dst=t=>p.jsx("div",{children:p.jsx(M_,{"aria-label":"close modal",onClick:t.onClose,children:p.jsx(sTe,{height:"16px",width:"16px",strokeWidth:2})})}),_t=({backFn:t,infoFn:e,onClose:n,title:r,closeable:i=!0})=>{let{closePrivyModal:s}=Ht(),o=Vr();return p.jsxs(fst,{children:[p.jsxs(pst,{children:[t&&p.jsx(Dpe,{backFn:t}),e&&p.jsx(ust,{infoFn:e})]}),r&&p.jsx(mst,{id:"privy-dialog-title",children:r}),p.jsx(gst,{children:!o.render.standalone&&i&&p.jsx(dst,{onClose:n||(()=>s())})})]})};let M_=ue.button.withConfig({displayName:"StyledButton",componentId:"sc-f295093d-0"})(["&&{cursor:pointer;display:flex;opacity:0.6;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-full);padding:4px;> svg{margin:auto;color:var(--privy-color-foreground);}:hover{opacity:1;}}
190"]),hst=ue(M_).withConfig({displayName:"TransparentStyledButton",componentId:"sc-f295093d-1"})(["&&{background-color:transparent;}"]),fst=ue.div.withConfig({displayName:"StyledHeader",componentId:"sc-f295093d-2"})(["padding:16px 0;display:flex;align-items:center;justify-content:space-between;h2{font-size:16px;line-height:24px;font-weight:600;color:var(--privy-color-foreground);}"]),pst=ue.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-f295093d-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),gst=ue.div.withConfig({displayName:"RightActionContainer",componentId:"sc-f295093d-4"})(["flex:1;display:flex;justify-content:flex-end;"]),mst=ue.div.withConfig({displayName:"TitleContainer",componentId:"sc-f295093d-5"})(["overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis;text-align:center;color:var(--privy-color-foreground-2);"]);const O_=({title:t,description:e,children:n,...r})=>p.jsx(Lpe,{...r,children:p.jsxs(p.Fragment,{children:[p.jsx("h3",{children:t}),typeof e=="string"?p.jsx("p",{children:e}):e,n]})}),H5=ue(O_).withConfig({displayName:"PaddedScreenHeader",componentId:"sc-523a75d6-0"})(["margin-bottom:24px;"]),ei=({title:t,description:e,icon:n,children:r,...i})=>p.jsxs(yst,{...i,children:[n||null,p.jsx("h3",{children:t}),e&&typeof e=="string"?p.jsx("p",{children:e}):e,r]});let Lpe=ue.div.withConfig({displayName:"StyledSection",componentId:"sc-523a75d6-1"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;width:100%;margin-bottom:24px;&& h3{font-size:17px;color:var(--privy-color-foreground);}&& p{color:var(--privy-color-foreground-2);font-size:14px;}"]),yst=ue(Lpe).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"]);const zi=({address:t,showCopyIcon:e,url:n,className:r})=>{let[i,s]=E.useState(!1);return E.useEffect(()=>{if(i){let o=setTimeout(()=>s(!1),2e3);return()=>clearTimeout(o)}},[i]),n?p.jsx("a",{title:t,className:r,href:`${n}/address/${t}`,target:"_blank",children:po(t)}):p.jsxs("button",{title:t,className:r,onClick:o=>(o.stopPropagation(),navigator.clipboard.writeText(t).then(()=>s(!0)).catch(console.error)),children:[po(t),e&&p.jsx(i?vst:wst,{})]})};let wst=ue(Hce).withConfig({displayName:"StyledSquare2StackIcon",componentId:"sc-6eaa0c94-0"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-foreground-3);"]),vst=ue(aTe).withConfig({displayName:"StyledCheckIcon",componentId:"sc-6eaa0c94-1"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-success);"]);const ah=ue.div.withConfig({displayName:"Grow",componentId:"sc-ddbf22b4-0"})(["text-align:left;flex-grow:1;"]),Bpe=ue.div.withConfig({displayName:"AlignBottom",componentId:"sc-ddbf22b4-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),u2=ue.div.withConfig({displayName:"LoginMethodContainer",componentId:"sc-ddbf22b4-2"})(["display:flex;flex-direction:column;gap:12px;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]),wB=ue(u2).withConfig({displayName:"LoginMethodContainerWithScrollShadows",componentId:"sc-ddbf22b4-3"})([""," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;max-height:400px;overflow-y:auto;scrollbar-width:none;padding:2px;"],t=>t.$colorScheme==="light"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":t.$colorScheme==="dark"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0);let Fpe=gs(["&&{width:100%;font-size:16px;line-height:24px;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;align-items:center;padding:12px 16px;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-mdlg);transition:background-color 200ms ease;cursor:pointer;&:hover{background-color:var(--privy-color-background-2);}&:disabled{cursor:pointer;background-color:var(--privy-color-background-2);}svg{height:24px;max-height:24px;max-width:24px;}}"]);const Upe=ue.div.withConfig({displayName:"Subtitle",componentId:"sc-ddbf22b4-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Qr=ue.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-ddbf22b4-5"})(["",""],Fpe),BQ=ue.a.withConfig({displayName:"LoginMethodButtonLink",componentId:"sc-ddbf22b4-6"})(["",""],Fpe),k1=ue.div.withConfig({displayName:"Hide",componentId:"sc-ddbf22b4-7"})(["width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;",""],t=>t.$if?"display: none;":""),bst=ue.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-ddbf22b4-8"})(["width:100%;height:100%;padding:",";"],t=>t.$withPadding?"64px 0px":"0px"),xst=ue.div.withConfig({displayName:"Header",componentId:"sc-ddbf22b4-9"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:32px;gap:12px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),C8=({chainType:t,withPadding:e})=>{let n="";return n=t==="ethereum-only"||t==="ethereum-and-solana"?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",p.jsx(bst,{$withPadding:e,children:p.jsxs(xst,{children:[p.jsx(t1,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),p.jsx("h3",{children:"No wallets available"}),p.jsxs("p",{children:["Please download an external wallet provider, like ",n,"."]})]})},"empty-wallet-state")},zpe=({icon:t,name:e})=>typeof t=="string"?p.jsx("img",{alt:`${e||"wallet"} logo`,src:t,style:{height:24,width:24,borderRadius:4}}):t===void 0?p.jsx(E5,{}):t?p.jsx(t,{}):null;let Est=Fce(["from,to{background:var(--privy-color-foreground-4);color:var(--privy-color-foreground-4);}50%{background:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-accent);}"]);const j_=gs(["",""],t=>t.$isLoading?gs(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],Est):""),_l=({children:t,color:e,isLoading:n,isPulsing:r,...i})=>p.jsx(Cst,{$color:e,$isLoading:n,$isPulsing:r,...i,children:t});let Cst=ue.span.withConfig({displayName:"StyledSpan",componentId:"sc-eba15c9-0"})(["padding:0.125rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);display:flex;align-items:center;"," ",""],t=>{let e,n;t.$color==="green"&&(e="var(--privy-color-success-dark)",n="var(--privy-color-success-light)"),t.$color==="red"&&(e="var(--privy-color-error)",n="var(--privy-color-error-light)"),t.$color==="gray"&&(e="var(--privy-color-foreground-2)",n="var(--privy-color-background-2)");let r=Fce(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],n,n);return gs(["color:",";background-color:",";",";"],e,n,t.$isPulsing&&gs(["animation:"," 3s linear infinite;"],r))},j_);function HO(t){var n,r;let e=t.toLowerCase();return!!((r=(n=window==null?void 0:window.webkit)==null?void 0:n.messageHandlers)!=null&&r.ReactNativeWebView)||!!(window!=null&&window.ReactNativeWebView)||["fbav","fban","instagram","snapchat","linkedinapp"].some(i=>e.includes(i))}const _st={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]}
190,configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},signTransaction:{onSuccess:[],onError:[]},signSolanaTransaction:{onSuccess:[],onError:[]},signSolanaMessage:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},Wpe=E.createContext(void 0);let Hpe=()=>E.useContext(Wpe);function V5(t,e){if(!e)return;let n=Hpe().current[t];return E.useEffect(()=>{var r;for(let[i,s]of Object.entries(e))Object.prototype.hasOwnProperty.call(n,i)||console.warn(`Invalid event type "${i}" for action "${t}"`),(r=n[i])==null||r.push(s);return()=>{var i;for(let[s,o]of Object.entries(e))Object.prototype.hasOwnProperty.call(n,s)||console.warn(`Invalid event type "${s}" for action "${t}"`),n[s]=(i=n[s])==null?void 0:i.filter(a=>a!==o)}},[e])}function We(t,e,n,...r){for(let i of t.current[e][n])i(...r)}function Vpe(){let t=Hpe();return(e,n,...r)=>We(t,e,n,...r)}let qpe=E.createContext({});const Sst=({children:t})=>{let e=Vr(),[n,r]=E.useState({});return V5("login",{onComplete:({loginAccount:i})=>{i&&i.type!=="passkey"&&i.type!=="cross_app"&&(i.type!=="wallet"||i.walletClientType!=="privy")&&(cn.put(FQ(e.id),i.type),i.type==="wallet"?(cn.put(QI(e.id),i.walletClientType),cn.put(XI(e.id),i.chainType),r({accountType:i.type,walletClientType:i.walletClientType,chainType:i.chainType})):(cn.del(QI(e.id)),cn.del(XI(e.id)),r({accountType:i.type})))}}),E.useEffect(()=>{if(!e.id)return;let i=cn.get(FQ(e.id)),s=cn.get(QI(e.id)),o=cn.get(XI(e.id));i&&r(i==="wallet"?{accountType:i,walletClientType:s,chainType:o}:{accountType:i})},[e.id]),p.jsx(qpe.Provider,{value:n,children:t})};let FQ=t=>`privy:${t}:recent-login-method`,QI=t=>`privy:${t}:recent-login-wallet-client`,XI=t=>`privy:${t}:recent-login-chain-type`;const xp=()=>E.useContext(qpe),Sl=({success:t,fail:e})=>p.jsxs(p.Fragment,{children:[p.jsx(kc,{className:t?"success":e?"fail":""}),p.jsx(vB,{className:t?"success":e?"fail":""})]}),kc=ue.span.withConfig({displayName:"Loader",componentId:"sc-ce7792e2-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-success);border-bottom-color:var(--privy-color-success);}&&&.fail{border-color:var(--privy-color-error);border-bottom-color:var(--privy-color-error);}"],t=>t.color??"var(--privy-color-accent)"),vB=ue(kc).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],t=>t.color??"var(--privy-color-accent)"),Ep=t=>p.jsx(Ast,{color:t.color||"var(--privy-color-foreground-3)"});let Ast=ue(kc).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const N_=ue.button.withConfig({displayName:"Button",componentId:"sc-3253171f-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{padding:12px 16px;}"]),tn=({children:t,loading:e,disabled:n,success:r,loadingText:i="Loading...",...s})=>p.jsx(Kpe,{disabled:e||n,success:r,...s,children:e?p.jsxs("span",{children:[p.jsx(Ep,{}),i?p.jsx("span",{children:i}):null]}):t}),d3=({children:t,loading:e,disabled:n,...r})=>p.jsx(kst,{disabled:n,...r,children:e?p.jsx(Ep,{color:"var(--privy-color-foreground-accent)"}):t});let kst=ue(N_).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-3253171f-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;pointer-events:none;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent-dark);}"]);const $st=({children:t,loading:e,disabled:n,loadingText:r="Loading...",...i})=>p.jsx(Kpe,{as:"a",disabled:e||n,...i,children:e?p.jsxs("span",{children:[p.jsx(Ep,{}),r?p.jsx("span",{children:r}):null]}):t});let Kpe=ue(N_).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-3253171f-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}"," >
190 span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent)",t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)",t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)",t=>t.disabled?gs(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):"");const ch=({children:t,loading:e,disabled:n,loadingText:r="Loading...",...i})=>p.jsx(Ist,{disabled:e||n,...i,children:e?p.jsxs("span",{children:[p.jsx(Ep,{}),r?p.jsx("span",{children:r}):null]}):t});let Ist=ue(N_).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-3253171f-3"})(["&&{border-width:1px;border-color:",";color:var(--privy-color-foreground);transition:border-color 200ms ease;}&:hover,&:active{border-color:",";}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-3);cursor:not-allowed;}> span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)",t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)");const bB=ue.button.withConfig({displayName:"SoftCtaButton",componentId:"sc-3253171f-4"})(["&&{padding:12px 16px;font-weight:500;text-align:center;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent);border-radius:var(--privy-border-radius-sm);min-width:144px;opacity:",";transition:opacity 200ms ease,background-color 200ms ease,color 200ms ease;user-select:none;"," &:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],t=>t.invisible?"0":"1",t=>t.invisible&&gs(["pointer-events:none;"])),q5=({children:t,onClick:e,disabled:n,isSubmitting:r,...i})=>p.jsxs(Tst,{$isSubmitting:r,onClick:e,disabled:n,...i,children:[p.jsx("span",{children:t}),p.jsx("span",{children:p.jsx(Ep,{})})]});let Tst=ue.button.withConfig({displayName:"StyledEmbeddedButton",componentId:"sc-3253171f-6"})(["&&{color:var(--privy-color-accent);font-size:16px;font-style:normal;font-weight:500;line-height:24px;cursor:pointer;border-radius:0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;border:none;transition:color 200ms ease;@media (min-width:441px){font-size:14px;}:hover{color:var(--privy-color-accent-dark);}&& > :first-child{opacity:",";}&& > :last-child{position:absolute;display:flex;top:50%;left:50%;transform:translate3d(-50%,-50%,0);opacity:",";}:disabled,:hover:disabled{color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],t=>t.$isSubmitting?0:1,t=>t.$isSubmitting?1:0);const Q1=ue.div.withConfig({displayName:"BottomPusherContainer",componentId:"sc-cb963810-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;margin-top:auto;gap:16px;flex-grow:100;"]),lh=ue.div.withConfig({displayName:"CenteredItem",componentId:"sc-cb963810-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1;width:100%;"]),xB=ue.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),EB=ue(lh).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),Ch=ue(lh).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),D_=ue.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),Fa=ue.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),Pst=ue.div.withConfig({displayName:"StyledCalloutSection",componentId:"sc-cb963810-8"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;padding:16px;margin-top:16px;margin-bottom:16px;width:100%;background:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);&& h4{color:var(--privy-color-foreground-3);font-size:14px;text-decoration:underline;font-weight:medium;}&& p{color:var(--privy-color-foreground-3);font-size:14px;}"]),sr=ue.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),dr=ue.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"}
190)(["height:12px;"]),Rst=ue.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),CB=ue.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],t=>t.height??"12"),Mst=ue.div.withConfig({displayName:"Circle",componentId:"sc-cb963810-13"})(["background-color:var(--privy-color-accent);display:flex;justify-content:center;align-items:center;border-radius:50%;border-color:white;border-width:2px !important;"]),UQ=t=>{var n;let e=(n=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses"))==null?void 0:n.split(" ").filter(r=>Da(r,{strict:!0})).map(r=>cr(r));return!!(e!=null&&e.length)&&!!(t!=null&&t.linkedAccounts.filter(r=>r.type=="wallet"&&e.includes(r.address)).length)},Cp=E.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:Le,login:Le,connectOrCreateWallet:Le,linkEmail:Le,linkPhone:Le,linkFarcaster:Le,linkWallet:Le,startCrossAppAuthFlow:Le,linkGoogle:Le,linkTwitter:Le,linkDiscord:Le,linkGithub:Le,linkSpotify:Le,linkInstagram:Le,linkTelegram:Le,linkTiktok:Le,linkLinkedIn:Le,linkApple:Le,linkPasskey:Le,updateEmail:Le,updatePhone:Le,logout:Le,getAccessToken:Le,unlinkEmail:Le,unlinkPhone:Le,unlinkWallet:Le,unlinkGoogle:Le,unlinkTwitter:Le,unlinkDiscord:Le,unlinkGithub:Le,unlinkSpotify:Le,unlinkInstagram:Le,unlinkTiktok:Le,unlinkLinkedIn:Le,unlinkApple:Le,unlinkCrossAppAccount:Le,unlinkFarcaster:Le,unlinkTelegram:Le,unlinkPasskey:Le,createWallet:Le,signMessage:Le,signTypedData:Le,enrollInMfa:Le,initEnrollmentWithSms:Le,initEnrollmentWithTotp:Le,initEnrollmentWithPasskey:Le,promptMfa:Le,init:Le,submitEnrollmentWithSms:Le,submitEnrollmentWithTotp:Le,submitEnrollmentWithPasskey:Le,unenroll:Le,submit:Le,cancel:Le,sendTransaction:Le,signTransaction:Le,exportWallet:Le,setWalletPassword:Le,setWalletRecovery:Le,requestFarcasterSignerFromWarpcast:Le,getFarcasterSignerPublicKey:Le,signFarcasterMessage:Le,createGuestAccount:Le,signMessageWithCrossAppWallet:Le,signTypedDataWithCrossAppWallet:Le,sendTransactionWithCrossAppWallet:Le,isModalOpen:!1,mfaMethods:[]}),Wn=()=>E.useContext(Cp),L9=(t,e)=>!co(t)&&(e==="all-users"||e==="users-without-wallets"&&!Ost(t).length);let Ost=t=>t.linkedAccounts.filter(e=>e.type==="wallet"&&e.chainType==="ethereum");const B9=(t,e)=>!ul(t)&&(e==="all-users"||e==="users-without-wallets"&&!jst(t).length);let jst=t=>t.linkedAccounts.filter(e=>e.type==="wallet"&&e.chainType==="solana");const _p=(t,e)=>L9(t,e.ethereum.createOnLogin)||B9(t,e.solana.createOnLogin),Gpe=ue.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],t=>t.color??"var(--privy-color-accent)",t=>t.color??"var(--privy-color-accent)");let pa=ue.div.withConfig({displayName:"StackedContainer",componentId:"sc-f7e7d474-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]),Nst={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",smart_wallet:"siwe",cross_app:"privy:"};const L_=t=>{let e=Nst[t];return t==="wallet"||t==="phone"?{displayName:t,loginMethod:e}:{displayName:e,loginMethod:e}},Dst=()=>{var i;let{app:t}=jt(),e=(i=t==null?void 0:t.appearance)==null?void 0:i.logo,n=`${t==null?void 0:t.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return e?typeof e=="string"?p.jsx("img",{src:e,alt:n,style:r}):e.type==="svg"||e.type==="img"?Rt.cloneElement(e,{alt:n,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},Zpe=t=>{let{app:e}=jt();return e!=null&&e.appearance.logo?p.jsx(Lst,{...t,children:p.jsx(Dst,{})}):null},Lst=ue.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-a206bd44-0"})(["display:flex;flex-direction:column;align-items:center;padding:24px 0;flex-grow:1;justify-content:center;"]),Ype=({name:t,logoUrl:e,size:n="38px"})=>typeof e=="string"?p.jsx("img",{src:e,alt:`${t??"Provider app"} logo`,style:{width:n,height:n,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):p.jsx("span",{}),Bst=({appId:t})=>{let[e,n]=E.useState(void 0),{startCrossAppAuthFlow:r,authenticated:i}=Wn(),{client:s}=Ht();return E.useEffect(()=>{(async()=>s&&n(await s.getCrossAppProviderDetails(t)))()},[s]),p.jsx(Qr,{onClick:()=>r({appId:t,action:i?"link":"login"}),disabled:!e,children:e?p.jsxs(p.Fragment,{children:[p.jsx(Ype,{name:e.name,logoUrl:e.icon_url||void 0,size:"24px"})," ",e.name]}):p.jsx(Ep,{})})},_B=ue.span.withConfig({displayName:"CircleBorder",componentId:"sc-9056b8b8-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;border-bottom-color:",";}"],t=>t.color??"var(--privy-color-accent)",t=>t.color??"var(--privy-color-accent)");function Fst(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...t,children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),p.jsx("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]})}
190const Ust=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];class ii extends Error{constructor(e,n){super(n),this.type=e}}function V2(t){let e=t.type;return typeof e=="string"&&Ust.includes(e)}function F9(t){return V2(t)&&t.type==="wallet_not_on_device"}function SB(t){return!!V2(t)&&t.type==="mfa_timeout"}function AB(t){return!!V2(t)&&t.type==="missing_or_invalid_mfa"}function zst(t){return!!V2(t)&&t.type==="mfa_verification_max_attempts_reached"}function Qpe(t){return!(!V2(t)||!t.message.includes("code 429"))}function Xpe(t){return!!function(e){let n=e.type;return typeof n=="string"&&n==="client_error"}(t)&&t.message==="MFA canceled"}let zQ="0x0000000000000000000000000000000000000000";const h3=({destinationCurrency:t,...e})=>({tradeType:"EXPECTED_OUTPUT",originCurrency:zQ,destinationCurrency:t??zQ,...e});let Jpe="https://api.relay.link",e0e="https://api.testnets.relay.link";const f3=async({input:t,isTestnet:e})=>{let n=await fetch((e?e0e:Jpe)+"/quote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json();if(!(n.ok||typeof r.message=="string"&&r.message.startsWith("Invalid address")))throw console.error("Relay error:",r),Error(r.message??"Error fetching quote from relay");return r},U9=t=>{var n,r;let e=(r=(n=t.steps[0])==null?void 0:n.items)==null?void 0:r[0];if(e)return{from:e.data.from,to:e.data.to,value:Number(e.data.value),chainId:Number(e.data.chainId),data:e.data.data}};function kB({transactionHash:t,wallet:e,isTestnet:n,bridgingStatus:r,setBridgingStatus:i,onSuccess:s,onFailure:o}){E.useEffect(()=>{if(t&&e&&r){if(["delayed","waiting","pending"].includes(r)){let a=setInterval(async()=>{try{let c=await async function({transactionHash:l,isTestnet:u}){var f;let d=await fetch((u?e0e:Jpe)+"/requests/v2?hash="+l),h=await d.json();if(!d.ok)throw"message"in h&&typeof h.message=="string"?Error(h.message):Error("Error fetching request from relay");return((f=h.requests.at(0))==null?void 0:f.status)??"pending"}({transactionHash:t,isTestnet:n});i(c)}catch(c){console.error(c)}},1e3);return()=>clearInterval(a)}r==="success"?s({transactionHash:t,wallet:e}):["refund","failure"].includes(r)&&o({error:new t0e(t,n)})}},[r,t,n,e])}let t0e=class extends ve{constructor(e,n){super("We were unable to complete the bridging transaction. Funds will be refunded on your wallet.",void 0,Ce.TRANSACTION_FAILURE),this.relayLink=n?`https://testnets.relay.link/transaction/${e}`:`https://relay.link/transaction/${e}`}};const n0e=({style:t,...e})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...e,children:p.jsx("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})}),Hr={component:()=>{var o,a;let{navigate:t,navigateBack:e,data:n,lastScreen:r,currentScreen:i}=jt(),s=((o=n==null?void 0:n.errorModalData)==null?void 0:o.previousScreen)||(r===i?void 0:r);return p.jsx(K5,{error:((a=n==null?void 0:n.errorModalData)==null?void 0:a.error)||Error(),backFn:()=>s?t(s,!1):e(),onClick:()=>t(s||mo,!1)})}},K5=({error:t,backFn:e,onClick:n})=>{let{reset:r}=wa(),{app:i}=jt(),s=((o,a)=>{let c=p.jsx(Uu,{height:38,width:38,stroke:"var(--privy-color-error)"});if(o instanceof t0e)return{title:"Transaction failed",detail:p.jsxs(p.Fragment,{children:[p.jsx("p",{children:o.message}),p.jsxs("p",{children:["Check the"," ",p.jsx(Vst,{href:o.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:c};if(o instanceof ve)switch(o.privyErrorCode){case Ce.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:o.message,ctaText:"Try again",icon:c};case Ce.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:o.message,ctaText:"Try again",icon:c};case Ce.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:o.message,ctaText:"Try again",icon:c};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:c}}else{if(o instanceof ii&&o.type==="twilio_verification_failed")return{title:"Something went wrong",detail:o.message,ctaText:"Try again",icon:p.jsx(xl,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(o instanceof fa))return o instanceof fc&&o.status&&[400,422].includes(o.status)?{title:"Something went wrong",detail:o.message,ctaText:"Try again",icon:c}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:c};switch(o.privyErrorCode){case Ce.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:c};case Ce.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail
190:o.message,ctaText:"Try another method",icon:c};case Ce.ALLOWLIST_REJECTED:return{title:a.errorTitle||"You don't have access to this app",detail:a.errorDetail||"Have you been invited?",ctaText:a.errorCtaText||"Try another account",icon:p.jsx(n0e,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case Ce.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:p.jsx("span",{})};case Ce.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:p.jsx("span",{})};case Ce.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:c};case Ce.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:c};case Ce.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:c};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:c}}}})(t,i.allowlistConfig);return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:e}),p.jsxs(Wst,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(_B,{color:"var(--privy-color-error)"}),s.icon]})}),p.jsxs(Hst,{children:[p.jsx("h3",{children:s.title}),typeof s.detail=="string"?p.jsx("p",{children:s.detail}):s.detail]}),p.jsx(tn,{color:"var(--privy-color-error)",onClick:()=>{t instanceof fa&&(t.privyErrorCode===Ce.INVALID_CAPTCHA&&r(),t.privyErrorCode===Ce.ALLOWLIST_REJECTED&&i.allowlistConfig.errorCtaLink)?window.location.href=i.allowlistConfig.errorCtaLink:n==null||n()},children:s.ctaText})]})]})};let Wst=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-b0d5228e-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),Hst=ue.div.withConfig({displayName:"GappedContainer",componentId:"sc-b0d5228e-1"})(["display:flex;flex-direction:column;gap:8px;"]),Vst=ue.a.withConfig({displayName:"Link",componentId:"sc-b0d5228e-2"})(["color:var(--privy-color-accent) !important;font-weight:600;"]);const r0e=({onTransfer:t,isTransferring:e,transferSuccess:n})=>p.jsx(tn,{...n?{success:!0,children:"Success!"}:{warn:!0,loading:e,onClick:t,children:"Transfer and delete account"}}),i0e=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-aa2e65ff-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;padding-bottom:16px;"]),VO=ue.div.withConfig({displayName:"GappedContainer",componentId:"sc-aa2e65ff-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),s0e=ue.div.withConfig({displayName:"DisclosedAccountContainer",componentId:"sc-aa2e65ff-2"})(["display:flex;cursor:pointer;align-items:center;width:100%;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);padding:8px 10px;font-size:14px;font-weight:500;gap:8px;"]),qst=ue(c_).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-aa2e65ff-3"})(["position:relative;width:",";height:",";color:var(--privy-color-foreground-3);margin-left:auto;"],t=>`${t.iconSize}px`,t=>`${t.iconSize}px`),Kst=ue(Hce).withConfig({displayName:"StyledCopyIcon",componentId:"sc-aa2e65ff-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),Gst=ue.ol.withConfig({displayName:"ListContainer",componentId:"sc-aa2e65ff-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),WQ=ue.li.withConfig({displayName:"ListItem",componentId:"sc-aa2e65ff-6"})(["font-size:14px;list-style-type:auto;list-style-position:outside;margin-left:1rem;margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]),Zst=ue.div.withConfig({displayName:"CircleContainer",componentId:"sc-aa2e65ff-7"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]);let Yst=()=>p.jsx(Zst,{children:p.jsx(qst,{iconSize:60})});const Qst=({address:t,onClose:e,onRetry:n,onTransfer:r,isTransferring:i,transferSuccess:s})=>{var c;let{defaultChain:o}=Vr(),a=((c=o.blockExplorers)==null?void 0:c.default.url)??"https://etherscan.io";return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:e,backFn:n}),p.jsxs(i0e,{children:[p.jsx(Yst,{}),p.jsxs(VO,{children:[p.jsx("h3",{children:"Check account assets before transferring"}),p.jsx("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),p.jsxs(Gst,{children:[p.jsx("p",{children:" To check your balance, you can:"}),p.jsx(WQ,{children:"Log out and log back into the other account, or "}),p.jsxs(WQ,{children:["Copy your wallet address and use a"," ",p.jsx("u",{children:p.jsx("a",{target:"_blank",href:a,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),p.jsxs(s0e,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[p.jsx(E5,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),p.jsx(zi,{address:t,showCopyIcon:!1}),p.jsx(Kst,{})]}),p.jsx(r0e,{onTransfer:r,isTransferring:i,transferSuccess:s})]})]}),p.jsx(ln,{})]})},q2={component:()=>{let{initiateAccountTransfer:t,closePrivyModal:e}=Ht(),{data:n,navigate:r,lastScreen:i,setModalData:s}=jt(),[o,a]=E.useState(void 0),[c,l]=E.useState(!1),[u,d]=E.useState(!1),h=async()=>{var f,m,y,v,b,C,x,_,$,I;try{if(!((f=n==null?void 0:n.accountTransfer)!=null&&f.nonce)||!((m=n==null?void 0:n.accountTransfer)!=null&&m.account))throw Error("missing account transfer inputs");d(!0),await t({nonce:(y=n==null?void 0:n.accountTransfer)==null?void 0:y.nonce,account:(v=n==null?void 0:n.accountTransfer)==null?void 0:v.account,accountType:(b=n==null?void 0:n.accountTransfer)==null?void 0:b.linkMethod,externalWalletMetadata:(C=n==null?void 0:n.accountTransfer)==null?void 0:C.externalWalletMetadata,telegramWebAppData:(x=n==null?void 0:n.accountTransfer)==null?void 0:x.telegramWebAppData,telegramAuthResult:(_=n==null?void 0:n.accountTransfer)==null?void 0:_.telegramAuthResult,farcasterEmbeddedAddress:($=n==null?void 0:n.accountTransfer)==null?void 0:$.farcasterEmbeddedAddress,oAuthUserInfo:(I=n==null?void 0:n.accountTransfer)==null?void 0:I.oAuthUserInfo}),l(!0),d(!1),setTimeout(e,1e3)}
190catch(R){s({errorModalData:{error:R,previousScreen:i||q2}}),r(Hr,!0)}};return o?p.jsx(Qst,{address:o,onClose:e,onRetry:()=>a(void 0),onTransfer:h,isTransferring:u,transferSuccess:c}):p.jsx(Xst,{onClose:e,onInfo:()=>{var f;return a((f=n==null?void 0:n.accountTransfer)==null?void 0:f.embeddedWalletAddress)},onContinue:()=>{var f;return a((f=n==null?void 0:n.accountTransfer)==null?void 0:f.embeddedWalletAddress)},onTransfer:h,isTransferring:u,transferSuccess:c,data:n})}},Xst=({onClose:t,onContinue:e,onInfo:n,onTransfer:r,transferSuccess:i,isTransferring:s,data:o})=>{var c,l,u,d,h,f,m;if(!((c=o==null?void 0:o.accountTransfer)!=null&&c.linkMethod)||!((l=o==null?void 0:o.accountTransfer)!=null&&l.displayName))return;let a={method:(u=o==null?void 0:o.accountTransfer)==null?void 0:u.linkMethod,handle:(d=o==null?void 0:o.accountTransfer)==null?void 0:d.displayName,disclosedAccount:(h=o==null?void 0:o.accountTransfer)!=null&&h.embeddedWalletAddress?{type:"wallet",handle:(f=o==null?void 0:o.accountTransfer)==null?void 0:f.embeddedWalletAddress}:void 0};return p.jsxs(p.Fragment,{children:[p.jsx(_t,{closeable:!0}),p.jsxs(i0e,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(_B,{color:"var(--privy-color-error)"}),p.jsx(Uu,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),p.jsxs(VO,{children:[p.jsxs("h3",{children:[function(y){switch(y){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"twitter":case"telegram":case"farcaster":return`${rpe(y.replace("_oauth",""))} profile`;default:return y}}(a.method)," is associated with another account"]}),p.jsxs("p",{children:["Do you want to transfer",p.jsx("b",{children:a.handle?` ${a.handle}`:""})," to this account instead? This will delete your other account."]}),p.jsx(Jst,{onClick:n,disclosedAccount:a.disclosedAccount})]}),p.jsxs(VO,{style:{gap:12,marginTop:12},children:[(m=o==null?void 0:o.accountTransfer)!=null&&m.embeddedWalletAddress?p.jsx(tn,{onClick:e,children:"Continue"}):p.jsx(r0e,{onTransfer:r,transferSuccess:i,isTransferring:s}),p.jsx(ch,{onClick:t,children:"No thanks"})]})]}),p.jsx(ln,{})]})};function Jst({disclosedAccount:t,onClick:e}){return t?p.jsxs(s0e,{onClick:e,children:[p.jsx(E5,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),p.jsx(zi,{address:t.handle,showCopyIcon:!1}),p.jsx(Fst,{width:15,height:15,color:"var(--privy-color-foreground-3)",style:{marginLeft:"auto"}})]}):null}const o0e=()=>p.jsx(eot,{children:p.jsxs(tot,{children:[p.jsx(not,{}),p.jsx(rot,{})]})});let eot=ue.div.withConfig({displayName:"LoadingContainer",componentId:"sc-85b54ede-0"})(["display:flex;justify-content:center;align-items:center;flex-grow:1;margin:12px;padding:16px;@media all and (display-mode:standalone){margin-bottom:30px;}"]),tot=ue.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-85b54ede-1"})(["position:relative;height:140px;width:140px;opacity:1;animation:fadein 200ms ease;"]),not=ue.div.withConfig({displayName:"CircleFixed",componentId:"sc-85b54ede-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;&&{border:4px solid var(--privy-color-accent-light);border-radius:50%;}"]),rot=ue.div.withConfig({displayName:"CircleRotate",componentId:"sc-85b54ede-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:var(--privy-color-accent) transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);function a0e(){let{getAccessToken:t}=Wn(),{refreshSessionAndUser:e,createAnalyticsEvent:n,initializeWalletProxy:r}=Ht(),i=E.useRef(!1);return{createWallet:E.useCallback(async({user:s,recoveryPassword:o})=>{let a=await t();if(!a)throw n({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),Error("An error has occured, please login again.");try{n({eventName:"embedded_wallet_creation_started"});let c=await r(3e4);if(!c)throw Error("walletProxy does not exist.");let l=new Promise((f,m)=>
190{setTimeout(()=>{m(Error("walletProxy.create timed out."))},2e4)}),u=ul(s);if(!await Promise.race([c.create({accessToken:a,recoveryPassword:o,recoveryMethod:o?"user-passcode":void 0,solanaAddress:u==null?void 0:u.address}),l]))throw Error("walletProxy.create did not send a response.");let d=await e();if(!d)throw Error("Failed to refresh user.");let h=co(d);if(!h)throw Error("Updated user is missing embedded wallet.");return n({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:h.address}}),i.current=!0,h}catch(c){if(i.current)return;throw n({eventName:"embedded_wallet_creation_failed",payload:{error:c.toString()}}),console.warn(c),c}},[])}}const c0e=t=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...t,children:[p.jsx("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),p.jsx("defs",{children:p.jsxs("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#3E82F4"}),p.jsx("stop",{offset:1,stopColor:"#93DCF7"})]})})]}),l0e=({style:t,...e})=>p.jsxs("svg",{width:"16",height:"14",style:t,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[p.jsxs("g",{clipPath:"url(#clip0_2115_829)",children:[p.jsx("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),p.jsx("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),p.jsx("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),p.jsx("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),p.jsx("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),p.jsx("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_2115_829",children:p.jsx("rect",{width:"16",height:"14",fill:"white"})})})]}),Rm={component:()=>{let{user:t}=Wn(),{closePrivyModal:e,isNewUserThisSession:n,updateWallets:r}=Ht(),{app:i,data:s,onUserCloseViaDialogOrKeybindRef:o}=jt(),{onSuccess:a,onFailure:c,callAuthOnSuccessOnClose:l}=s.createWallet,u=()=>{let d=co(t)??ul(t);d?(r(),a(d)):c(Error("Failed to create wallet")),e({shouldCallAuthOnSuccess:l})};return E.useEffect(()=>{let d=setTimeout(u,2500);return()=>clearTimeout(d)},[]),o.current=u,p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:u}),p.jsx(sr,{}),p.jsxs(Ch,{children:[p.jsx(C1,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),p.jsx(ei,{title:n?"Welcome"+(i!=null&&i.name?` to ${i==null?void 0:i.name}`:""):"All set!",description:n?"Youâve successfully created an account.":"Your account is secured."})]}),p.jsx(dr,{}),p.jsx(ln,{})]})}},qO=ue.div.withConfig({displayName:"RecoveryContainer",componentId:"sc-12b46968-0"})(["display:flex;flex-direction:column;gap:12px;padding-top:24px;padding-bottom:24px;"]),iot=ue.div.withConfig({displayName:"RecoveryExplainerContainer",componentId:"sc-12b46968-1"})(["padding-bottom:24px;"]);let HQ={"google-drive":{name:"Google Drive",component:l0e},icloud:{name:"iCloud",component:c0e}};const u0e={component:()=>{var N;let{logout:t}=Wn(),{navigate:e,setModalData:n,data:r}=jt(),{recoveryOAuthFlow:i,closePrivyModal:s,createAnalyticsEvent:o}=Ht(),[a,c]=E.useState(!1),{provider:l,action:u,isInAccountCreateFlow:d}=r==null?void 0:r.recoveryOAuthStatus,[h,f]=E.useState(void 0),[m,y]=E.useState(u==="create-wallet");if(l==="user-passcode")throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let v=HQ[l].name,b=HQ[l].component,C=(N=r==null?void 0:r.recoverWallet)==null?void 0:N.onCompleteNavigateTo,x=new ko(async(T="create-wallet")=>
190(y(!0),new Promise((O,U)=>{setTimeout(async()=>{try{let z=window.open();await i(l,T,z),c(!0),O()}catch{f({message:`${T==="recover"?"Recovery":"Back up"} with ${v} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${v} account associated with your backup.`:"",retryable:!0}),U()}},0)})));E.useEffect(()=>{u!=="recover"&&x.execute(d?"create-wallet":"set-recovery")},[]),E.useEffect(()=>{if(!a)return;let T=setTimeout(()=>{d?(n({createWallet:{onSuccess:()=>{},onFailure:O=>{o({eventName:"embedded_wallet_creation_failure_logout",payload:{error:O,screen:"RecoveryOAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),e(Rm)):s({shouldCallAuthOnSuccess:!1})},Jr);return()=>clearTimeout(T)},[a]);let _=E.useCallback(async()=>{await x.execute("recover"),C?e(C):c(!0)},[]),$=l==="google-drive"?"Google Drive":"Apple iCloud",I=a&&`Successfully ${u==="recover"?"recovered":"backed up"} with ${$}.`||h&&h.message||`${u==="recover"?"Recovering":"Backing up"} with ${$}...`,R=h?h.detail:"";return p.jsxs(p.Fragment,{children:[p.jsx(_t,{}),m?p.jsx(p.Fragment,{children:p.jsxs(qO,{children:[p.jsx(ei,{title:I,icon:p.jsx(b,{style:{width:"38px",height:"38px"}}),description:R}),h&&(h!=null&&h.retryable)?p.jsx(tn,{onClick:()=>{DO(),f(void 0),u==="create-wallet"?x.execute("create-wallet"):_()},disabled:!a&&!(h!=null&&h.retryable),children:"Try again"}):null]})}):p.jsxs(qO,{children:[p.jsx(ei,{title:"Confirm it's really you",icon:p.jsx(b,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${$} where your account is backed up.`}),p.jsxs(tn,{onClick:_,children:["Confirm with ",$]})]}),p.jsx(ln,{})]})}};let JI=ue.div.withConfig({displayName:"IconContainer",componentId:"sc-d3e051f2-0"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;"]),sot={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},oot=({onClose:t})=>p.jsxs(iot,{children:[p.jsx(ei,{title:"Why do I need to secure my account?",icon:p.jsx(t1,{width:48}),description:p.jsxs(p.Fragment,{children:[p.jsx("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),p.jsx("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. Itâs important you donât lose access to the method you choose."})]})}),p.jsx(tn,{onClick:t,children:"Select backup method"})]});const KO={component:()=>{let[t,e]=E.useState(!1),{navigate:n,lastScreen:r,navigateBack:i,setModalData:s,data:o,onUserCloseViaDialogOrKeybindRef:a}=jt(),{user:c}=Wn(),{embeddedWallets:l}=Vr(),{closePrivyModal:u}=Ht(),d=$s(c),h=d===null,{isInAccountCreateFlow:f,isResettingPassword:m}=o.recoverySelection,y=d&&d.recoveryMethod!=="privy",v=y?p.jsxs("span",{children:["Your account is currently secured using"," ",p.jsx("strong",{children:sot[(d==null?void 0:d.recoveryMethod)||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function b(x){s({recoveryOAuthStatus:{provider:x,action:h?"create-wallet":"set-recovery",isInAccountCreateFlow:f}}),n(u0e)}function C(){var x,_;(x=o==null?void 0:o.setWalletPassword)==null||x.onFailure(Error("User exited set recovery flow")),u({shouldCallAuthOnSuccess:((_=o==null?void 0:o.setWalletPassword)==null?void 0:_.callAuthOnSuccessOnClose)??!1})}return a.current=C,p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:C,backFn:t?()=>e(!1):r?i:void 0,infoFn:r||t?void 0:()=>e(!0)},"header"),t?p.jsx(oot,{onClose:()=>e(!1)}):p.jsxs(p.Fragment,{children:[p.jsx(ei,{title:y?"Update backup method":"Secure your account",icon:p.jsx(ohe,{width:48}),description:v}),p.jsx(qO,{children:l.userOwnedRecoveryOptions.filter(x=>!["icloud","google-drive"].includes((d==null?void 0:d.recoveryMethod)||"")||x!==(d==null?void 0:d.recoveryMethod)).sort().map(x=>{switch(x){case"google-drive":return p.jsxs(Qr,{onClick:()=>b("google-drive"),children:[p.jsx(JI,{children:p.jsx(l0e,{style:{width:18}})}),"Back up to Google Drive"]},x);case"icloud":return p.jsxs(Qr,{onClick:()=>b("icloud"),children:[p.jsx(JI,{children:p.jsx(c0e,{style:{width:24}})}),"Back up to Apple iCloud"]},x);case"user-passcode":return p.jsxs(Qr,{onClick:()=>{n(x0e({isCreatingWallet:h,skipSplashScreen:!0}))},children:[p.jsx(JI,{children:p.jsx(UXe,{style:{width:18}})}),m?"Reset your":"Set a"," password"]},x);default:return null}})})]}),p.jsx(ln,{})]})}};let aot=gs(["font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;text-align:left;transition:color 0.1s ease-in;"]);const d0e=ue.span.withConfig({displayName:"StatusText",componentId:"sc-3f6866a9-0"})([""," transition:color 0.1s ease-in;color:",";text-transform:",";&[aria-hidden='true']{visibility:hidden;}"],aot,({error:t})=>t?"var(--privy-color-error)":"var(--privy-color-foreground-3)",({error:t})=>t?"":"capitalize"),B_=ue.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-3f6866a9-1"})(["display:flex;flex-direction:column;justify-content:center;flex-grow:1;"]),F_=ue(tn).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-3f6866a9-2"})(["",""],t=>t.hideAnimations&&gs(["&&{transition:none;}"]));let h0e=gs(["&&{width:100%;border-width:1px;border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);background:var(--privy-color-background);color:var(--privy-color-foreground);padding:12px;font-size:16px;font-style:normal;font-weight:300;line-height:22px;}"]);const $B=ue.input.withConfig({displayName:"PasswordInput",componentId:"sc-3f6866a9-3"})([""," &::placeholder{color:var(--privy-color-foreground-3);font-style:italic;font-size:14px;}overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],h0e),cot=ue.div.withConfig({displayName:"PasswordDisplay",componentId:"sc-3f6866a9-4"})(["",""],h0e),U_=ue.div.withConfig({displayName:"PasswordContainer",componentId:"sc-3f6866a9-5"})(["position:relative;width:100%;display:flex;align-items:center;justify-content:",";"],({centered:t})=>t?"center":"space-between"),z_=ue.div.withConfig({displayName:"Header",componentId:"sc-3f6866a9-6"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:32px 0;gap:4px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),IB=ue.div.withConfig({displayName:"Details",componentId:"sc-3f6866a9-7"})(["display:flex;flex-direction:column;gap:10px;padding-bottom:1rem;"]),GO=ue.div.withConfig({displayName:"DetailItem",componentId:"sc-3f6866a9-8"})(["display:flex;text-align:left;align-items:center;gap:8px;max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;margin:0 8px;color:var(--privy-color-foreground-2);> :first-child{min-width:24px;}"]),VQ=ue(N_).withConfig({displayName:"ExportButton",componentId:"sc-3f6866a9-10"})(["display:flex;flex:1;gap:4px;justify-content:center;&&{background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);border-width:1px;}"]),W_=ue.div.withConfig({displayName:"InputRightIcons",componentId:"sc-3f6866a9-11"})(["position:absolute;right:0.5rem;display:flex;flex-direction:row;justify-content:space-around;align-items:center;"]),lot=ue(HXe).withConfig({displayName:"RegenerateIcon",componentId:"sc-3f6866a9-12"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),H_=ue(GXe).withConfig({displayName:"HiddenIcon",componentId:"sc-3f6866a9-13"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),V_=ue(qXe).withConfig({displayName:"ShownIcon",componentId:"sc-3f6866a9-14"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),uot=ue.progress.withConfig({displayName:"StrengthMeter",componentId:"sc-3f6866a9-15"}
190)(["height:4px;width:100%;margin:8px 0;::-webkit-progress-bar{border-radius:8px;background:var(--privy-color-foreground-4);}::-webkit-progress-value{border-radius:8px;transition:all 0.1s ease-out;background:",";}"],({label:t})=>(t==="Strong"?"#78dca6":t==="Medium"&&"var(--privy-color-warn)")||"var(--privy-color-error)"),dot=({buttonHideAnimations:t,buttonLoading:e,password:n,onSubmit:r,onBack:i})=>{let[s,o]=E.useState(!0),[a,c]=E.useState(!1),[l,u]=E.useState(""),d=n===l;return E.useEffect(()=>{l&&!a&&c(!0)},[l]),p.jsxs(p.Fragment,{children:[p.jsx(_t,{closeable:!1,backFn:i}),p.jsx(sr,{}),p.jsxs(B_,{children:[p.jsxs(z_,{children:[p.jsx(Uu,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),p.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),p.jsxs(U_,{children:[p.jsx($B,{value:l,onChange:h=>u(h.target.value),onKeyUp:h=>{h.key==="Enter"&&r()},onBlur:()=>c(!0),placeholder:"confirm your password",type:s?"password":"text",style:{paddingRight:"2.3rem"}}),p.jsx(W_,{style:{right:"0.75rem"},children:s?p.jsx(H_,{onClick:()=>o(!1)}):p.jsx(V_,{onClick:()=>o(!0)})})]}),p.jsx(d0e,{"aria-hidden":!a||d,error:!0,children:"Passwords do not match"})]}),p.jsx(F_,{onClick:r,loading:e,disabled:!d,hideAnimations:t,children:"Continue"}),p.jsx(dr,{}),p.jsx(ln,{})]})},f0e=({className:t,checked:e,color:n="var(--privy-color-accent)",...r})=>p.jsx("label",{children:p.jsxs(hot,{className:t,children:[p.jsx(g0e,{checked:e,...r}),p.jsx(fot,{color:n,checked:e,children:p.jsx(p0e,{viewBox:"0 0 24 24",children:p.jsx("polyline",{points:"20 6 9 17 4 12"})})})]})});let hot=ue.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),p0e=ue.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),g0e=ue.input.attrs({type:"checkbox"}).withConfig({displayName:"HiddenCheckbox",componentId:"sc-db51b935-3"})(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]),fot=ue.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-db51b935-4"})(["display:inline-block;width:18px;height:18px;transition:all 150ms;cursor:pointer;border-color:",";border-radius:3px;background:",";&&{border-width:1px;}",":focus + &{box-shadow:0 0 0 1px ",";}","{visibility:",";}"],t=>t.color,t=>t.checked?t.color:"var(--privy-color-background)",g0e,t=>t.color,p0e,t=>t.checked?"visible":"hidden");const pot=({buttonHideAnimations:t,buttonLoading:e,onSubmit:n,onBack:r,config:i})=>{let[s,o]=E.useState(!1);return p.jsxs(p.Fragment,{children:[p.jsx(_t,{closeable:!1,backFn:r}),p.jsx(sr,{}),p.jsxs(B_,{children:[p.jsxs(z_,{children:[p.jsx(Uu,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),p.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),p.jsx(IB,{children:p.jsxs(GO,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:a=>{a.preventDefault(),o(c=>!c)},children:[p.jsx(f0e,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),p.jsx(p.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),p.jsxs(got,{children:[i.initiatedBy==="user"&&p.jsx(ch,{onClick:i.onCancel,disabled:e,children:"Cancel"}),p.jsx(F_,{onClick:n,loading:e,hideAnimations:t,disabled:!s,children:"Set Password"})]}),p.jsx(dr,{}),p.jsx(ln,{})]})};let got=ue.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-eb601350-0"})(["display:flex;gap:10px;"]),mot=/[a-z]/,yot=/[A-Z]/,wot=/[0-9]/,m0e="!@#$%^&*()\\-_+.",y0e=`a-zA-Z0-9${m0e}`,vot=RegExp(`[${m0e}]`),bot=RegExp(`[${y0e}]`);const xot=RegExp(`^[${y0e}]{6,}$`),w0e=()=>NXe(4,LXe);function Eot(t){return t>.9?"Strong":t>.5?"Medium":"Weak"}function Cot(t=""){return(.3*function(e){if(e.length<8)return 0;let n=0;return mot.test(e)&&(n+=1),yot.test(e)&&(n+=1),wot.test(e)&&(n+=1),vot.test(e)&&(n+=1),Math.max(0,Math.min(1,n/3))}(t)+TXe(t)/95)/2}const _ot=({buttonHideAnimations:t,buttonLoading:e,password:n="",config:r,isResettingPassword:i,onSubmit:s,onClose:o,onBack:a,onPasswordChange:c,onPasswordGenerate:l})=>{let[u,d]=E.useState(!1),[h,f]=E.useState(!1);E.useEffect(()=>{n&&!h&&f(!0)},[n]);let m=E.useMemo(()=>h?6>((n==null?void 0:n.length)||0)?"Password must be at least 6 characters":xot.test(n||"")?null:`Invalid characters used ( ${((b="")=>[...new Set(b.split("").filter(C=>!bot.test(C)).map(C=>C.replace(" ","SPACE")))])(n).join(" ")} )`:null,[n,h]),y=E.useMemo(()=>m?{value:0,label:"Weak"}:function(b=""){let C=Cot(b);return{value:C,label:Eot(C)}}(n),[n,m]),v=E.useMemo(()=>!(n!=null&&n.length)||!!m,[m,n]);return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:o,closeable:r.initiatedBy==="user",backFn:a}),p.jsx(sr,{}),p.jsxs(B_,{children:[p.jsxs(z_,{children:[p.jsx(YXe,{height:48,width:48,stroke:"var(--privy-color-accent)"}),p.jsxs("h3",{style:{color:"var(--privy-color-foreground)"},children:[i?"Reset":"Set"," your password"]}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),p.jsxs(U_,{children:[p.jsx($B,{value:n,onChange:b=>c(b.target.value),onKeyUp:b=>{b.key==="Enter"&&s()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),p.jsxs(W_,{style:{width:"3.5rem"},children:[u?p.jsx(H_,{onClick:()=>d(!1)}):p.jsx(V_,{onClick:()=>d(!0)}),p.jsx(lot,{onClick:l})]})]}),p.jsx(uot,{value:y.value===0?.01:y.value,label:y.label}),p.jsx(d0e,{error:!!m,children:m||`Password Strength: ${h?y.label:"--"}`}),p.jsxs(Aot,{children:[p.jsx(Sot,{children:p.jsxs(IB,{children:[p.jsxs(GO,{children:[p.jsx(C1,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),p.jsxs(GO,{children:[p.jsx(C1,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),p.jsx(F_,{onClick:s,loading:e,disabled:v,hideAnimations:t,children:"Continue"})]})]}),p.jsx(dr,{}),p.jsx(ln,{})]})};let Sot=ue(IB).withConfig({displayName:"DetailsContainer",componentId:"sc-7b3b7727-0"})(["flex:1;padding-top:1rem;"]),Aot=ue.div.withConfig({displayName:"LowerContainer",componentId:"sc-7b3b7727-1"})(["display:flex;flex-direction:column;height:100%;"]);const kot=({buttonHideAnimations:t,buttonLoading:e,appName:n,password:r,onSubmit:i,onBack:s})=>{let[o,a]=E.useState(!1),[c,l]=E.useState(!0),u=E.useCallback(()=>{a(!0),r&&navigator.clipboard.writeText(r)},[r]),d=E.useCallback(()=>{let h=document.createElement("a"),f=n.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),m=new Blob([$ot(n,r)],{type:"text/plain"}),y=URL.createObjectURL(m);h.href=y,h.target="_blank",h.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(h),h.click(),setTimeout(()=>{h.remove(),URL.revokeObjectURL(y)},5e3)},[r]);return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:s,closeable:!1}),p.jsx(sr,{}),p.jsxs(B_,{children:[p.jsxs(z_,{children:[p.jsx(Uu,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),p.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),p.jsxs(U_,{centered:!0,children:[p.jsx(cot,{children:c?"â¢".repeat(r.length):r}),p.jsx(W_,{style:{right:"0.75rem"},children:c?p.jsx(H_,{onClick:()=>l(!1)}):p.jsx(V_,{onClick:()=>l(!0)})})]}),p.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[p.jsx(VQ,{onClick:u,children:p.jsxs(p.Fragment,o?{children:[p.jsx(ahe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[p.jsx(tJe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),p.jsxs(VQ,{onClick:d,children:[p.jsx(XXe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),p.jsx(F_,{onClick:i,loading:e,hideAnimations:t,children:"Continue"}),p.jsx(dr,{}),p.jsx(ln,{})]})};let $ot=(t,e)=>`Your wallet recovery password for ${t} is 191 192${e} 193 194You will need this password to access your ${t} wallet on a new device. Please keep it somewhere safe.`;const Iot=({error:t,onClose:e})=>p.jsxs(p.Fragment,{children:[p.jsx(_t,{closeable:!1}),p.jsx(sr,{}),p.jsxs(Ch,t?{children:[p.jsx(l_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),p.jsx(ei,{title:"Something went wrong",description:t})]}:{children:[p.jsx(C1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(ei,{title:"Success"})]}),p.jsx(tn,{onClick:e,children:"Close"}),p.jsx(dr,{}),p.jsx(ln,{})]});let Tot=(t,e)=>{switch(t){case"creating":return e==="back"?t:"saving";case"saving":return e==="back"?"creating":"confirming";case"confirming":return e==="back"?"saving":"finalizing";case"finalizing":return e==="back"?"confirming":"done";default:return t}};const v0e=({onSubmit:t,...e})=>{let{lastScreen:n,navigate:r}=jt(),{send:i,state:s}=(()=>{let[l,u]=E.useReducer(Tot,"creating");return{send:u,state:l}})(),o=E.useCallback(async()=>{s==="finalizing"&&await t(),i("next")},[s,i,t]);E.useEffect(()=>{let l;return s==="done"&&e.config.initiatedBy==="automatic"&&(l=setTimeout(()=>{var u;return(u=e.onClose)==null?void 0:u.call(e)},Jr)),()=>{l&&clearTimeout(l)}},[s,e.config.initiatedBy,e.onClose]);let a=E.useCallback(()=>{i("back")},[i]),c=E.useCallback(()=>{r(KO)},[n,r]);return s==="creating"?p.jsx(_ot,{...e,onSubmit:o,onBack:n===KO?c:void 0}):s==="saving"?p.jsx(kot,{...e,onSubmit:o,onBack:a}):s==="confirming"?p.jsx(dot,{...e,onSubmit:o,onBack:a}):s==="finalizing"?p.jsx(pot,{...e,onSubmit:o,onBack:a}):s==="done"?p.jsx(Iot,{...e,onSubmit:o}):null},b0e={component:()=>{let[t,e]=E.useState(null),[n,r]=E.useState(!1),[i,s]=E.useState(null),[o,a]=E.useState(""),{authenticated:c,getAccessToken:l,user:u}=Wn(),{walletProxy:d,refreshSessionAndUser:h,closePrivyModal:f,createAnalyticsEvent:m}=Ht(),{app:y,navigate:v,data:b,onUserCloseViaDialogOrKeybindRef:C}=jt(),{onSuccess:x,onFailure:_}=b.createWallet,$=$s(u),I=(t==null?void 0:t.recoveryMethod)==="user-passcode",R=($==null?void 0:$.recoveryMethod)==="user-passcode";E.useEffect(()=>{c||(v(mo),_(new nCe("User must be authenticated before setting a password on a Privy wallet")))},[c]);let N=()=>i?(_(i),void f({shouldCallAuthOnSuccess:!1})):I?(x(t),void f({shouldCallAuthOnSuccess:!1})):(_(new Xf("Exited before password was added to wallet")),void f({shouldCallAuthOnSuccess:!1}));return C.current=N,p.jsx(v0e,{appName:(y==null?void 0:y.name)||"privy",config:{initiatedBy:"user",onCancel:N},error:i?"An error has occurred, please try again.":void 0,buttonLoading:n,buttonHideAnimations:!1,password:o,isResettingPassword:R,onPasswordGenerate:()=>a(w0e()),onPasswordChange:a,onSubmit:async()=>{I?(x(t),f({shouldCallAuthOnSuccess:!1})):(r(!0),s(null),await(async()=>{let T=await l();if(T&&($!=null&&$.address)&&o&&d)try{m({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:$.address,existingRecoveryMethod:$.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:R}});let{entropyId:O,entropyIdVerifier:U}=Gr($);if(!(await d.setRecovery({accessToken:T,entropyId:O,entropyIdVerifier:U,recoveryPassword:o,recoveryMethod:"user-passcode"})).entropyId)return s(new Xf("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:$.address,existingRecoveryMethod:$.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:R,reason:"error setting password"}});let z=await h(),L=$s(z);
194if(!L)return s(new Xf("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:$.address,existingRecoveryMethod:$.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:R,reason:"wallet disconnected"}});e(L),m({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:$.address,existingRecoveryMethod:$.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:R}})}catch(O){console.warn(O),s(O instanceof Error?O:Error("Error setting password on privy wallet")),m({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:$.address,reason:O}})}})(),r(!1))},onClose:N})}},Pot={component:()=>{let{closePrivyModal:t}=Ht(),{data:e,setModalData:n,navigate:r,onUserCloseViaDialogOrKeybindRef:i}=jt(),{onSuccess:s,onFailure:o}=e.setWalletPassword,a=()=>{o(new Xf("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return i.current=a,p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:a}),p.jsx(sr,{}),p.jsxs(Ch,{children:[p.jsxs(Rst,{children:[p.jsx(LL,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),p.jsx(Mst,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:p.jsx(che,{width:"12px",height:"12px",fill:"white"})})]}),p.jsxs(ei,{title:"Secure Your Account",children:["Please set a password to secure your account.",p.jsx("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),p.jsx(tn,{onClick:()=>{n({createWallet:{onFailure:o,onSuccess:s,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),r(b0e)},children:"Add password"}),p.jsx(dr,{}),p.jsx(ln,{})]})}},Rot={component:()=>{let[t,e]=E.useState(!0),{authenticated:n,getAccessToken:r,user:i}=Wn(),{walletProxy:s,closePrivyModal:o,createAnalyticsEvent:a}=Ht(),{navigate:c,data:l,onUserCloseViaDialogOrKeybindRef:u}=jt(),[d,h]=E.useState(void 0),[f,m]=E.useState(""),[y,v]=E.useState(!1),{entropyId:b,entropyIdVerifier:C,onCompleteNavigateTo:x,onSuccess:_,onFailure:$}=l.recoverWallet,I=(R="User exited before their wallet could be recovered")=>{o({shouldCallAuthOnSuccess:!1}),$(typeof R=="string"?new Xf(R):R)};return u.current=I,E.useEffect(()=>{if(!n)return I("User must be authenticated and have a Privy wallet before it can be recovered")},[n]),p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:I}),p.jsx(sr,{}),p.jsxs(Oot,{children:[p.jsxs(Mot,{children:[p.jsx(_1,{height:48,width:48,stroke:"var(--privy-color-accent)"}),p.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),p.jsxs("div",{children:[p.jsxs(U_,{children:[p.jsx($B,{type:t?"password":"text",onChange:R=>(N=>{N&&h(N)})(R.target.value),disabled:y,style:{paddingRight:"2.3rem"}}),p.jsx(W_,{style:{right:"0.75rem"},children:t?p.jsx(H_,{onClick:()=>e(!1)}):p.jsx(V_,{onClick:()=>e(!0)})})]}),!!f&&p.jsx(jot,{children:f})]}),p.jsxs("div",{children:[p.jsxs(Pst,{children:[p.jsx("h4",{children:"Why is this necessary?"}),p.jsx("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),p.jsx(Not,{loading:y||!s,disabled:!d,onClick:async()=>{v(!0);let R=await r(),N=j9(i,b);if(!R||!N||d===null)return I("User must be authenticated and have a Privy wallet before it can be recovered");try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:N.address}}),await(s==null?void 0:s.recover({accessToken:R,entropyId:b,entropyIdVerifier:C,recoveryPassword:d})),m(""),x?c(x):o({shouldCallAuthOnSuccess:!1}),_==null||_(N),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:N.address}})}catch(T){(function(O){return V2(O)&&(O.type==="invalid_recovery_pin"||O.type==="invalid_request_arguments")})(T)?m("Invalid recovery password, please try again."):m("An error has occurred, please try again.")}finally{v(!1)}},warn:!1,hideAnimations:!b&&y,children:"Recover your account"})]})]}),p.jsx(dr,{}),p.jsx(ln,{})]})}},Mot=ue.div.withConfig({displayName:"Header",componentId:"sc-40a8a2b-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:20px 0;gap:4px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]);let Oot=ue.div.withConfig({displayName:"Content",componentId:"sc-40a8a2b-1"})(["display:flex;flex-direction:column;justify-content:space-between;"]),jot=ue.div.withConfig({displayName:"ErrorMessage",componentId:"sc-40a8a2b-2"})(["line-height:20px;height:20px;font-size:13px;color:var(--privy-color-error);text-align:left;margin-top:0.5rem;"]),Not=ue(tn).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-40a8a2b-3"})(["",""],t=>t.hideAnimations&&gs(["&&{transition:none;}"]));const Dot={component:()=>{let{app:t,navigate:e,data:n,onUserCloseViaDialogOrKeybindRef:r}=jt(),[i,s]=E.useState(""),[o,a]=E.useState(!1),[c,l]=E.useState(),[u,d]=E.useState(null),{authenticated:h,user:f}=Wn(),{closePrivyModal:m,isNewUserThisSession:y,initializeWalletProxy:v}=Ht(),{onSuccess:b,onFailure:C,callAuthOnSuccessOnClose:x}=n.createWallet,{createWallet:_}=a0e(),[$,I]=E.useState(null),R=new ko(async()=>
194{try{let N=await _({recoveryPassword:c,user:f});if(!N)return;I(N),y?e(Rm):(b(N),m({shouldCallAuthOnSuccess:x}))}catch(N){s(N.message)}});return E.useEffect(()=>{u||v(3e4).then(N=>d(N))},[u]),E.useEffect(()=>{if(!h||!f)return e(mo),void C(Error("User must be authenticated before creating a Privy wallet"))},[h]),r.current=()=>null,p.jsx(v0e,{config:{initiatedBy:"automatic"},appName:(t==null?void 0:t.name)||"privy",loading:!u,buttonLoading:o,buttonHideAnimations:!$&&o,isResettingPassword:!1,error:i,password:c||"",onClose:()=>{$&&($==null?void 0:$.recoveryMethod)!=="user-passcode"?(C(new Xf("User created a wallet but failed to set a password for it")),m({shouldCallAuthOnSuccess:!1})):$?(b($),m({shouldCallAuthOnSuccess:x})):(C(new Xf("User wallet creation failed")),m({shouldCallAuthOnSuccess:!1}))},onPasswordChange:l,onPasswordGenerate:()=>l(w0e()),onSubmit:async()=>(a(!0),R.execute().then(()=>new Promise(N=>setTimeout(N,250))).finally(()=>a(!1)))})}},Lot=ue.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],t=>t.$color??"var(--privy-color-accent)"),Sp=ue.span.withConfig({displayName:"Subtitle",componentId:"sc-7a11f796-0"})(["margin-top:4px;color:var(--privy-color-foreground);text-align:center;font-size:0.875rem;font-weight:400;line-height:1.375rem;&& a{color:var(--privy-color-accent);}"]),uh=ue.span.withConfig({displayName:"Title",componentId:"sc-66de63c-0"})(["color:var(--privy-color-foreground);font-size:1.125rem;font-weight:600;line-height:1.875rem;text-align:center;"]),Bot={component:()=>{var v;let{user:t,getAccessToken:e}=Wn(),{walletProxy:n,refreshSessionAndUser:r,closePrivyModal:i}=Ht(),s=jt(),{entropyId:o,entropyIdVerifier:a}=(v=s.data)==null?void 0:v.recoverWallet,[c,l]=E.useState(!1),[u,d]=E.useState(null),[h,f]=E.useState(null);function m(){var b,C,x,_;if(!c){if(h)return(C=(b=s.data)==null?void 0:b.setWalletPassword)==null||C.onFailure(h),void i();if(!u)return(_=(x=s.data)==null?void 0:x.setWalletPassword)==null||_.onFailure(Error("User exited set recovery flow")),void i()}}s.onUserCloseViaDialogOrKeybindRef.current=m;let y=!(!c&&!u);return p.jsxs(p.Fragment,h?{children:[p.jsx(_t,{onClose:m},"header"),p.jsx(Lot,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:p.jsx(Uu,{height:38,width:38,stroke:"var(--privy-color-error)"})}),p.jsx(uh,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),p.jsx(ah,{style:{minHeight:"2rem"}}),p.jsx(d3,{onClick:()=>f(null),children:"Try again"}),p.jsx(ln,{})]}:{children:[p.jsx(_t,{onClose:m},"header"),p.jsx(ohe,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),p.jsx(uh,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),p.jsx(Sp,{style:{marginTop:"1rem"},children:"When you log into a new device, youâll only need to authenticate to access your account. Never get logged out if you forget your password."}),p.jsx(ah,{style:{minHeight:"2rem"}}),p.jsx(d3,{loading:c,disabled:y,onClick:()=>async function(){l(!0);try{let b=await e(),C=j9(t,o);if(!b||!n||!C)return;if(!(await n.setRecovery({accessToken:b,entropyId:o,entropyIdVerifier:a,existingRecoveryMethod:C.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let x=await r();if(!x)throw Error("Unable to set recovery on wallet");let _=j9(x,C.address);if(!_)throw Error("Unabled to set recovery on wallet");d(!!x),setTimeout(()=>{var $,I;(I=($=s.data)==null?void 0:$.setWalletPassword)==null||I.onSuccess(_),i()},Jr)}catch(b){f(b)}finally{l(!1)}}(),children:u?"Success":"Confirm"}),p.jsx(ln,{})]})}};function x0e({isCreatingWallet:t,skipSplashScreen:e}){return t?Dot:e?b0e:Pot}function E0e({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:n,isResettingPassword:r,showAutomaticRecovery:i}){return i?Bot:n||e.length===1?x0e({isCreatingWallet:t==="create",skipSplashScreen:r}):KO}function C0e(t){switch(t){case"user-passcode":return Rot;case"google-drive":case"icloud":return u0e;default:throw Error("Recovery method not supported")}}async function qQ({api:t,provider:e}){let n=S_(),r=uB(),i=await dB(n);try{return e==="icloud"?{url:(await t.post(OCe,{client_type:"web"})).url}:{url:(await t.post(MCe,{redirect_to:window.location.href,code_challenge:i,state_code:r})).url,codeVerifier:n,stateCode:r,provider:e}}
194catch(s){throw Gn(s)}}async function Fot({api:t,provider:e,stateCode:n,codeVerifier:r,authorizationCode:i}){if(!i||!n)throw new ve("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(i==="undefined")throw new ve("User denied confirmation during OAuth flow");try{return(await t.post(jCe,{authorization_code:i,state_code:n,code_verifier:r,provider:e})).access_token}catch(s){let o=Gn(s);throw o.privyErrorCode?new ve(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new ve("Invalid code during oauth flow.",void 0,Ce.OAUTH_USER_DENIED):new ve("Invalid code during OAuth flow.",void 0,Ce.UNKNOWN_AUTH_ERROR)}}const _h={component:()=>{let{app:t,setModalData:e,navigate:n,data:r,onUserCloseViaDialogOrKeybindRef:i}=jt(),[s,o]=E.useState(""),{embeddedWallets:a}=Vr(),{authenticated:c,user:l,getAccessToken:u}=Wn(),{closePrivyModal:d,walletProxy:h,refreshSessionAndUser:f,recoverPrimaryWallet:m}=Ht(),{onSuccess:y,onFailure:v,callAuthOnSuccessOnClose:b}=r.createWallet,C=(t==null?void 0:t.embeddedWallets.requireUserOwnedRecoveryOnCreate)===!0,{createWallet:x}=a0e(),[_,$]=E.useState(null),I=new ko(async()=>{var N;let R=await u();if(l&&R&&h)try{let T=$s(l);if(T&&T.recoveryMethod==="privy")await m();else if(T){let{entropyId:z,entropyIdVerifier:L}=Gr(T);try{if(!await h.connect({accessToken:R,entropyId:z,entropyIdVerifier:L}))throw new ve("Primary wallet not connected.")}catch{return $(T),void n(Rm)}}let O=L9(l,t.embeddedWallets.ethereum.createOnLogin),U=B9(l,t.embeddedWallets.solana.createOnLogin);if(O&&U){let z=await x({user:l});return await h.createSolana({accessToken:R,ethereumAddress:z==null?void 0:z.address}),z?($(z),void n(Rm)):void 0}if(U){await h.createSolana({accessToken:R,ethereumAddress:(N=co(l))==null?void 0:N.address});let z=await f();return $(ul(z)),void n(Rm)}if(O){let z=await x({user:l});if(!z)return;$(z),n(Rm)}}catch(T){o(T.message)}});return E.useEffect(()=>c&&l?C?(e({...r,recoverySelection:{...r==null?void 0:r.recoverySelection,isInAccountCreateFlow:!0}}),n(E0e({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:a.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void I.execute():(n(mo),void v(Error("User must be authenticated before creating a Privy wallet"))),[C,c]),i.current=()=>null,s?p.jsxs(p.Fragment,{children:[p.jsx(_t,{closeable:!1}),p.jsxs(Ch,{children:[p.jsx(l_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),p.jsx(ei,{title:"Something went wrong",description:s})]}),p.jsx(tn,{onClick:()=>{_?(y(_),d({shouldCallAuthOnSuccess:b})):(v(new Xf("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))},children:"Close"}),p.jsx(Uot,{})]}):p.jsx(o0e,{})}};let Uot=ue.div.withConfig({displayName:"BottomSpacing",componentId:"sc-afb53dce-0"})(["height:44px;"]);const G5=ue.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-a63b1990-0"})(["display:flex;flex-direction:column;align-items:center;padding:0px 0px 30px;@media (max-width:440px){padding:10px 10px 20px;}"]),pr=ue.div.withConfig({displayName:"Title",componentId:"sc-a63b1990-1"})(["font-size:18px;line-height:30px;text-align:center;font-weight:600;margin-bottom:10px;"]),gr=ue.div.withConfig({displayName:"SubTitle",componentId:"sc-a63b1990-2"})(["font-size:0.875rem;text-align:center;"]),$1=ue.div.withConfig({displayName:"Container",componentId:"sc-a63b1990-3"})(["display:flex;flex-direction:column;align-items:center;gap:10px;flex-grow:1;padding:20px 0;@media (max-width:440px){padding:10px 10px 20px;}"]),q_=ue.div.withConfig({displayName:"List",componentId:"sc-a63b1990-4"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.75rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),$u=ue.div.withConfig({displayName:"ListItemIcon",componentId:"sc-a63b1990-5"})(["width:25px;display:flex;align-items:center;justify-content:flex-start;> svg{z-index:2;height:25px !important;width:25px !important;color:var(--privy-color-accent);}"]),Iu=ue.div.withConfig({displayName:"ListItem",componentId:"sc-a63b1990-6"})(["display:flex;align-items:center;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;"]),gc=ue.div.withConfig({displayName:"BottomSection",componentId:"sc-a63b1990-7"})(["display:flex;flex-direction:column;gap:10px;padding-top:20px;"]),_0e=ue.div.withConfig({displayName:"MethodList",componentId:"sc-a63b1990-8"})(["display:flex;flex-direction:column;align-items:stretch;gap:1rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),eT=ue.div.withConfig({displayName:"MethodListItem",componentId:"sc-a63b1990-9"})(["display:flex;gap:5px;width:100%;position:relative;"]),tT=ue.button.withConfig({displayName:"RemoveMethodButton",componentId:"sc-a63b1990-10"})(["&&{background-color:transparent;color:var(--privy-color-foreground-3);padding:0 0.75rem;display:flex;align-items:center;height:100%;> svg{z-index:2;height:20px !important;width:20px !important;}}&&:hover{color:var(--privy-color-error);}"]),nT=ue.div.withConfig({displayName:"MethodText",componentId:"sc-a63b1990-11"})(["display:flex;align-items:center;gap:0.5rem;> svg{z-index:2;height:20px !important;width:20px !important;}"]),rT=ue.div.withConfig({displayName:"ExtraText",componentId:"sc-a63b1990-12"})(["display:flex;align-items:center;gap:6px;font-weight:400 !important;color:",";> svg{z-index:2;height:18px !important;width:18px !important;display:flex !important;align-items:flex-end;}"],t=>t.isAccent?"var(--privy-color-accent)":"var(--privy-color-foreground-3)"),iT=ue.div.withConfig({displayName:"SmsInsecureText",componentId:"sc-a63b1990-13"})(["width:100%;display:flex;justify-content:space-between;"]),zot=ue.p.withConfig({displayName:"TermsText",componentId:"sc-a63b1990-14"})(["text-align:left;width:100%;color:var(--privy-color-foreground-3) !important;"]),z9=ue.button.withConfig({displayName:"PrimaryTextButton",componentId:"sc-a63b1990-15"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:0.875rem;line-height:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{color:",";background-color:transparent;padding:0.5rem 0px;}&:hover{text-decoration:underline;}"],t=>t.theme==="dark"?"var(--privy-color-foreground-2)":"var(--privy-color-accent)"),uo=ue.div.withConfig({displayName:"IconWrapper",componentId:"sc-a63b1990-16"})(["display:flex;align-items:center;justify-content:center;color:var(--privy-color-accent);width:100%;> svg{z-index:2;width:3rem;height:3rem;}"]),S0e=ue.div.withConfig({displayName:"ErrorMessage",componentId:"sc-a63b1990-17"})(["color:var(--privy-color-error);"]),X1={component:()=>{let{user:t,logout:e}=Wn(),{app:n,onUserCloseViaDialogOrKeybindRef:r,setModalData:i,navigate:s}=jt(),{acceptTerms:o,closePrivyModal:a,createAnalyticsEvent:c}=Ht(),l=u=>{u==null||u.preventDefault(),a({shouldCallAuthOnSuccess:!1}),e()};return r.current=l,p.jsx(Wot,{termsAndConditionsUrl:n==null?void 0:n.legal.termsAndConditionsUrl,privacyPolicyUrl:n==null?void 0:n.legal.privacyPolicyUrl,onAccept:async u=>{u.preventDefault(),await o(),t&&_p(t,n.embeddedWallets)?(i({createWallet:{onSuccess:()=>{},onFailure:d=>{console.error(d),c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:d,screen:"AffirmativeConsentScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),s(_h)):a()},onDecline:l})}},Wot=({termsAndConditionsUrl:t,privacyPolicyUrl:e,onAccept:n,onDecline:r})=>p.jsxs(p.Fragment,{children:[p.jsx(_t,{closeable:!1}),p.jsx(AXe,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),p.jsx(pr,{style:{marginTop:24},children:"One last step"}
194),p.jsx(gr,{children:"By signing up, you agree to our terms and privacy policy."}),p.jsxs(u2,{style:{marginTop:24},children:[t&&p.jsxs(BQ,{target:"_blank",href:t,children:["View Terms ",p.jsx(pO,{style:{marginLeft:"auto"}})]}),e&&p.jsxs(BQ,{target:"_blank",href:e,children:["View Privacy Policy ",p.jsx(pO,{style:{marginLeft:"auto"}})]})]}),p.jsxs(Hot,{style:{marginTop:24},children:[p.jsx(ch,{onClick:r,children:"No thanks"}),p.jsx(tn,{onClick:n,children:"Accept"})]}),p.jsx(ln,{})]});let Hot=ue.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-9abb9a03-0"})(["display:flex;gap:10px;"]);const Vot=({...t})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...t,children:[p.jsxs("g",{clipPath:"url(#clip0_2856_1743)",children:[p.jsx("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_2856_1743",children:p.jsx("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),r1=({style:t,...e})=>p.jsxs("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...t},...e,children:[p.jsx("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),p.jsx("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),p.jsx("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),p.jsx("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]}),qot=({icon:t})=>p.jsx(p.Fragment,{children:p.jsx(Kot,{children:p.jsxs("div",{children:[p.jsx(Sl,{}),typeof t=="string"?p.jsx("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?p.jsx(t,{style:{width:"38px",height:"38px"}}):p.jsx("span",{})]})})});let Kot=ue.div.withConfig({displayName:"StackedContainer",componentId:"sc-26c1d9b9-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const Al={component:()=>{let{lastScreen:t,currentScreen:e,data:n,navigateBack:r,navigate:i,setModalData:s}=jt(),{status:o,token:a,waitForResult:c,reset:l,execute:u}=wa(),d=E.useRef([]),h=z=>{d.current=[z,...d.current]},[f,m]=E.useState(!0);E.useEffect(()=>(h(setTimeout(m,1e3,!1)),()=>{d.current.forEach(z=>clearTimeout(z)),d.current=[]}
194),[]);let[y,v]=E.useState(""),[b,C]=E.useState("Checking that you are a human..."),[x,_]=E.useState(p.jsx(tn,{onClick:()=>{},disabled:!0,children:"Continue"})),[$,I]=E.useState(!1),[R,N]=E.useState(3),T=n==null?void 0:n.captchaModalData,O=async z=>{try{await(T==null?void 0:T.callback(z)),T!=null&&T.onSuccessNavigateTo&&i(T==null?void 0:T.onSuccessNavigateTo,!1)}catch(L){if(L instanceof A_)return;s({errorModalData:{error:L,previousScreen:t||mo}}),i((T==null?void 0:T.onErrorNavigateTo)||Hr,!1)}};E.useEffect(()=>{o==="success"?h(setTimeout(async()=>{let z=await c();!z||T!=null&&T.userIntentRequired||O(z)},1e3)):o==="ready"&&h(setTimeout(()=>{o==="ready"&&u()},500))},[o]),E.useEffect(()=>{if(!f)switch(o){case"success":v("Success!"),C("CAPTCHA passed successfully."),_(p.jsx(tn,{onClick:()=>{I(!0),O(a)},disabled:!(T!=null&&T.userIntentRequired),loading:$,children:T!=null&&T.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":v(""),C("Checking that you are a human..."),_(p.jsx(tn,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":v("Something went wrong"),R<=0?(C("If you use an adblocker or VPN, try disabling and re-attempting."),_(null)):(C("You did not pass CAPTCHA. Please try again."),_(p.jsx(tn,{onClick:U,children:"Retry"})))}},[o,f,$]);let U=async()=>{if(R<=0)return;N(L=>L-1),l(),u();let z=await c();!z||T!=null&&T.userIntentRequired||O(z)};return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:t&&e!==t?r:void 0}),p.jsxs(Got,{children:[o==="success"?p.jsx(C1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):o==="error"?p.jsx(l_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):p.jsx(qot,{}),p.jsxs(Fa,{children:[y?p.jsx("h3",{children:y}):null,p.jsx("p",{children:b})]}),x]}),p.jsx(Bn,{})]})}};let Got=ue.div.withConfig({displayName:"CaptchaContainer",componentId:"sc-ae138086-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const A0e=({style:t,color:e,...n})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:e||"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...n,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),Zot=({color:t,...e})=>p.jsx("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...e,children:p.jsx("g",{children:p.jsx("path",{fill:t||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),K_=t=>{let[e,n]=E.useState(!1);return p.jsxs(Yot,{color:t.color,onClick:()=>{n(!0),navigator.clipboard.writeText(t.text),setTimeout(()=>n(!1),1500)},$justCopied:e,children:[e?p.jsx(A0e,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):p.jsx(Zot,{style:{height:"14px",width:"14px"}}),e?"Copied":"Copy"," ",t.itemName?t.itemName:"to Clipboard"]})};let Yot=ue.button.withConfig({displayName:"StyledCopytoClipboardButton",componentId:"sc-46f4187f-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;
194height:14px;}"],t=>t.$justCopied?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)",t=>t.$justCopied?"medium":"normal",t=>t.$justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)");const k0e=t=>{let[e,n]=E.useState(!1);return p.jsx(Qot,{color:t.color,href:t.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{n(!0),setTimeout(()=>n(!1),1500)},justOpened:e,children:t.text})};let Qot=ue.a.withConfig({displayName:"StyledOpenLinkButton",componentId:"sc-4e695c83-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],t=>t.justOpened?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)",t=>t.justOpened?"medium":"normal",t=>t.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)");const Xot=()=>p.jsx("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:p.jsx("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let sT=(t,e,n,r,i)=>{for(let s=e;s<e+r;s++)for(let o=n;o<n+i;o++){let a=t==null?void 0:t[o];a&&a[s]&&(a[s]=0)}return t},Jot=({x:t,y:e,cellSize:n,bgColor:r,fgColor:i})=>p.jsx(p.Fragment,{children:[0,1,2].map(s=>p.jsx("circle",{r:n*(7-2*s)/2,cx:t+7*n/2,cy:e+7*n/2,fill:s%2!=0?r:i},`finder-${t}-${e}-${s}`))}),eat=({cellSize:t,matrixSize:e,bgColor:n,fgColor:r})=>p.jsx(p.Fragment,{children:[[0,0],[(e-7)*t,0],[0,(e-7)*t]].map(([i,s])=>p.jsx(Jot,{x:i,y:s,cellSize:t,bgColor:n,fgColor:r},`finder-${i}-${s}`))}),tat=({matrix:t,cellSize:e,color:n})=>p.jsx(p.Fragment,{children:t.map((r,i)=>r.map((s,o)=>s?p.jsx("rect",{height:e-.4,width:e-.4,x:i*e+.1*e,y:o*e+.1*e,rx:.5*e,ry:.5*e,fill:n},`cell-${i}-${o}`):p.jsx(Rt.Fragment,{},`circle-${i}-${o}`)))}),nat=({cellSize:t,matrixSize:e,element:n,sizePercentage:r,bgColor:i})=>{if(!n)return p.jsx(p.Fragment,{});let s=e*(r||.14),o=Math.floor(e/2-s/2),a=Math.floor(e/2+s/2);(a-o)%2!=e%2&&(a+=1);let c=(a-o)*t,l=c-.2*c,u=o*t;return p.jsxs(p.Fragment,{children:[p.jsx("rect",{x:o*t,y:o*t,width:c,height:c,fill:i}),p.jsx(n,{x:u+.1*c,y:u+.1*c,height:l,width:l})]})},rat=t=>{var s;let e=t.outputSize,n=((o,a)=>{let c=AJe.create(o,{errorCorrectionLevel:a}).modules,l=((u,d)=>{let h=u.slice(0),f=[];for(;h.length;)f.push(h.splice(0,d));return f})(Array.from(c.data),c.size);return l=sT(l,0,0,7,7),l=sT(l,l.length-7,0,7,7),sT(l,0,l.length-7,7,7)})(t.url,t.errorCorrectionLevel),r=e/n.length,i=function(o,{min:a,max:c}){return Math.min(Math.max(o,a),c)}(2*r,{min:.025*e,max:.036*e});return p.jsxs("svg",{height:t.outputSize,width:t.outputSize,viewBox:`0 0 ${t.outputSize} ${t.outputSize}`,style:{height:"100%",width:"100%",padding:`${i}px`},children:[p.jsx(tat,{matrix:n,cellSize:r,color:t.fgColor}),p.jsx(eat,{cellSize:r,matrixSize:n.length,fgColor:t.fgColor,bgColor:t.bgColor}),p.jsx(nat,{cellSize:r,element:(s=t.logo)==null?void 0:s.element,bgColor:t.bgColor,matrixSize:n.length})]})},iat=ue.div.attrs({className:"ph-no-capture"}).withConfig({displayName:"QrContainer",componentId:"sc-597e27f3-0"})(["display:flex;justify-content:center;align-items:center;height:",";width:",";margin:auto;background-color:",";&&{border-width:2px;border-color:",";border-radius:var(--privy-border-radius-md);}"],t=>`${t.$size}px`,t=>`${t.$size}px`,t=>t.$bgColor,t=>t.$borderColor);const G_=t=>{let{appearance:e}=Vr(),n=t.bgColor||"#FFFFFF",r=t.fgColor||"#000000",i=t.size||160,s=e.palette.colorScheme==="dark"?n:r;return p.jsx(iat,{$size:i,$bgColor:n,$fgColor:r,$borderColor:s,children:p.jsx(rat,{url:t.url,logo:{element:t.squareLogoElement??Xot},outputSize:i,bgColor:n,fgColor:r,errorCorrectionLevel:t.errorCorrectionLevel||"Q"})})},Z_={component:()=>{let{navigate:t,app:e}=jt(),n=(e==null?void 0:e.allowlistConfig.errorTitle)||"You don't have access to this app",r=(e==null?void 0:e.allowlistConfig.errorDetail)||"Have you been invited?",i=(e==null?void 0:e.allowlistConfig.errorCtaText)||"Try another account";return p.jsxs(p.Fragment,{children:[p.jsx(_t,{}),p.jsxs(sat,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(_B,{}),p.jsx(n0e,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),p.jsxs(oat,{children:[p.jsx(typeof n=="string"?"h3":p.Fragment,{children:n}),p.jsx(typeof r=="string"?"p":p.Fragment,{children:r})]}),e!=null&&e.allowlistConfig.errorCtaLink?p.jsx(tn,{as:"a",href:e.allowlistConfig.errorCtaLink,children:i}):p.jsx(tn,{onClick:()=>{t(mo)},children:i})]})]})}};let sat=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-274cb2fe-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),oat=ue.div.withConfig({displayName:"GappedContainer",componentId:"sc-274cb2fe-1"})(["display:flex;flex-direction:column;gap:8px;"]);const aat=({style:t,...e})=>p.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...t},...e,children:p.jsx("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),Z5={component:()=>{let{navigate:t}=jt();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{}),p.jsxs(cat,{children:[p.jsx(lat,{children:p.jsx(aat,{})}),p.jsxs(uat,{children:[p.jsx("h3",{children:"Unable to sign in"}),p.jsx("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),p.jsx(tn,{onClick:()=>{t(mo)},children:"Go back"})]}),p.jsx(ln,{})]})}};let cat=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-b3ae112e-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-top:8px;padding-bottom:32px;"]),lat=ue.div.withConfig({displayName:"IconContainer",componentId:"sc-b3ae112e-1"})(["display:flex;align-items:center;justify-content:center;height:72px;aspect-ratio:1;color:var(--privy-color-error);background-color:var(--privy-color-error-light);border-radius:50%;"]),uat=ue.div.withConfig({displayName:"GappedContainer",componentId:"sc-b3ae112e-2"})(["display:flex;flex-direction:column;gap:8px;"]),KQ="#8a63d2";const ZO={component:()=>{let{authenticated:t,logout:e,ready:n,user:r}=Wn(),{lastScreen:i,navigate:s,navigateBack:o,setModalData:a,app:c}=jt(),{getAuthFlow:l,loginWithFarcaster:u,closePrivyModal:d,createAnalyticsEvent:h}=Ht(),[f,m]=E.useState(void 0),[y,v]=E.useState(!1),[b,C]=E.useState(!1),x=E.useRef([]),_=l(),$=_==null?void 0:_.meta.connectUri;return E.useEffect(()=>{let I=Date.now(),R=setInterval(async()=>{var O,U,z,L,S,k,M,W,H,D,V,B,P,j,G;let N=await _.pollForReady.execute(),T=Date.now()-I;if(N){clearInterval(R),v(!0);try{await u(),C(!0)}catch(Y){let te={retryable:!1,message:"Authentication failed"};if((Y==null?void 0:Y.privyErrorCode)===Ce.ALLOWLIST_REJECTED)return void s(Z_);
194if((Y==null?void 0:Y.privyErrorCode)===Ce.USER_LIMIT_REACHED)return console.error(new d5(Y).toString()),void s(Z5);if((Y==null?void 0:Y.privyErrorCode)===Ce.USER_DOES_NOT_EXIST)return void s(X5);if((Y==null?void 0:Y.privyErrorCode)===Ce.LINKED_TO_ANOTHER_USER)te.detail=Y.message??"This account has already been linked to another user.";else{if((Y==null?void 0:Y.privyErrorCode)===Ce.ACCOUNT_TRANSFER_REQUIRED&&((U=(O=Y.data)==null?void 0:O.data)!=null&&U.nonce))return a({accountTransfer:{nonce:(L=(z=Y.data)==null?void 0:z.data)==null?void 0:L.nonce,account:(k=(S=Y.data)==null?void 0:S.data)==null?void 0:k.subject,displayName:(H=(W=(M=Y.data)==null?void 0:M.data)==null?void 0:W.account)==null?void 0:H.displayName,linkMethod:"farcaster",embeddedWalletAddress:(B=(V=(D=Y.data)==null?void 0:D.data)==null?void 0:V.otherUser)==null?void 0:B.embeddedWalletAddress,farcasterEmbeddedAddress:(G=(j=(P=Y.data)==null?void 0:P.data)==null?void 0:j.otherUser)==null?void 0:G.farcasterEmbeddedAddress}}),void s(q2);(Y==null?void 0:Y.privyErrorCode)===Ce.INVALID_CREDENTIALS?(te.retryable=!0,te.detail="Something went wrong. Try again."):(Y==null?void 0:Y.privyErrorCode)===Ce.TOO_MANY_REQUESTS&&(te.detail="Too many requests. Please wait before trying again.")}m(te)}}else T>12e4&&(clearInterval(R),m({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},2e3);return()=>{clearInterval(R),x.current.forEach(N=>clearTimeout(N))}},[]),E.useEffect(()=>{if(n&&t&&b&&r){if(c!=null&&c.legal.requireUsersAcceptTerms&&!r.hasAcceptedTerms){let I=setTimeout(()=>{s(X1)},Jr);return()=>clearTimeout(I)}b&&(_p(r,c.embeddedWallets)?x.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:I=>{console.error(I),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:I,screen:"FarcasterConnectStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),s(_h)},Jr)):x.current.push(setTimeout(()=>d({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Jr)))}},[b,n,t,r]),p.jsxs(p.Fragment,di.isMobile||y?{children:[p.jsx(_t,{backFn:i?o:void 0,onClose:d},"header"),p.jsx(sr,{}),p.jsx(p.Fragment,di.isIOS?{children:p.jsxs(dat,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:b,fail:!!f}),p.jsx(r1,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(Fa,{children:[p.jsx(pr,{children:f?f.message:"Sign in with Farcaster"}),p.jsx(gr,{children:f?f.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),$&&p.jsx(tn,{onClick:I=>{I.preventDefault(),window.location.href=$},children:"Open Warpcast app"})]})}:{children:p.jsxs(GQ,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:b,fail:!!f}),p.jsx(r1,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(Fa,{children:[p.jsx(pr,{children:f?f.message:"Signing in with Farcaster"}),p.jsx(gr,{children:f?f.detail:"This should only take a moment"}),p.jsx(lh,{children:$&&di.isMobile&&p.jsx(k0e,{text:"Take me to Warpcast",url:$,color:KQ})})]})]})}),p.jsx(Bn,{})]}:{children:[p.jsx(_t,{backFn:i?o:void 0,onClose:d},"header"),p.jsx(sr,{}),p.jsx(GQ,{children:p.jsxs("div",{children:[p.jsx(pr,{children:"Sign in with Farcaster"}),p.jsx(gr,{children:"Scan with your phone's camera to continue."}),p.jsx(EB,{children:$?p.jsx(G_,{url:$,size:275,squareLogoElement:r1}):p.jsx(kc,{})}),p.jsxs(lh,{children:[p.jsx(gr,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),$&&p.jsx(K_,{text:$,itemName:"link",color:KQ})]})]})}),p.jsx(Bn,{})]})}};let GQ=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-69a6d91f-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),dat=ue.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-69a6d91f-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const $0e=()=>{let[t,e]=E.useState(!1),{currentScreen:n,navigate:r,setModalData:i,data:s}=jt(),{enabled:o,token:a}=wa(),{initLoginWithFarcaster:c}=Ht(),{accountType:l}=xp();return p.jsxs(Qr,{onClick:async()=>{var u;e(!0);try{o&&!a?(i({captchaModalData:{callback:d=>{var h;return c(d,(h=s==null?void 0:s.login)==null?void 0:h.disableSignup)},userIntentRequired:!0,onSuccessNavigateTo:ZO,onErrorNavigateTo:Hr}}),r(Al)):(await c(a,(u=s==null?void 0:s.login)==null?void 0:u.disableSignup),r(ZO))}
194catch(d){i({errorModalData:{error:d,previousScreen:n||mo}}),r(Hr)}finally{e(!1)}},disabled:!1,children:[p.jsx(r1,{})," Farcaster",t&&p.jsx(Ep,{}),l==="farcaster"&&p.jsx(hat,{color:"gray",children:"Recent"})]})};let hat=ue(_l).withConfig({displayName:"StyledChip",componentId:"sc-30c9632d-0"})(["margin-left:auto;"]);const Y5=({style:t,...e})=>p.jsx("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...t},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})}),Q5=({style:t,...e})=>p.jsxs("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...t},xmlns:"http://www.w3.org/2000/svg",...e,children:[p.jsxs("g",{clipPath:"url(#clip0_113_33841)",children:[p.jsx("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),p.jsx("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.8300
1947 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),p.jsx("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),p.jsx("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),p.jsx("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),p.jsx("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),p.jsx("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),p.jsx("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),p.jsx("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),p.jsx("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),p.jsx("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),p.jsx("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),p.jsx("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),p.jsx("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),p.jsx("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),p.jsx("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),p.jsx("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),p.jsx("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.43
19401C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),p.jsx("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),p.jsx("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),p.jsx("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),p.jsx("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_113_33841",children:p.jsx("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]}),Mm={component:()=>{let{app:t,lastScreen:e,currentScreen:n,navigateBack:r,data:i,setModalData:s,navigate:o}=jt(),{loginWithPasskey:a,signupWithPasskey:c,closePrivyModal:l,createAnalyticsEvent:u}=Ht(),{user:d,logout:h}=Wn(),{passkeySignupFlow:f}=(i==null?void 0:i.passkeyAuthModalData)??{},[m,y]=E.useState("loading"),[v,b]=E.useState(null),C=E.useRef([]),x=$=>{C.current=[$,...C.current]};E.useEffect(()=>()=>{C.current.forEach($=>clearTimeout($)),C.current=[]},[]);let _=async()=>{y("loading");try{f?await c():await a(),y("success")}catch($){b($),y("error")}};return E.useEffect(()=>{if(m==="success"&&d){if(t!=null&&t.legal.requireUsersAcceptTerms&&!d.hasAcceptedTerms)return void x(setTimeout(()=>{o(X1)},900));if(!_p(d,t==null?void 0:t.embeddedWallets))return void x(setTimeout(()=>{l({shouldCallAuthOnSuccess:!0,isSuccess:!0})},Jr));x(setTimeout(()=>{s({createWallet:{onSuccess:()=>{},onFailure:$=>{console.error($),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:$,screen:"PasskeyStatusScreen"}}),h()},callAuthOnSuccessOnClose:!0}}),o(_h)},900))}},[d,m]),E.useEffect(()=>{_()},[]),p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:e&&n!==e?r:void 0}),p.jsxs(fat,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:m==="success",fail:m==="error"}),p.jsx(Q5,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(Fa,{children:[p.jsx("h3",{children:(()=>{switch(m){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})()}),p.jsx("p",{style:{whiteSpace:"pre-wrap"},children:(()=>{switch(m){case"loading":return f?"Please follow prompts to register your passkey.":`Please follow prompts to verify your passkey. 195You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(v instanceof fa){if(v.privyErrorCode===Ce.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(v.privyErrorCode===Ce.PASSKEY_NOT_ALLOWED)return`Passkey request timed out or rejected by user. 196You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred. 197You will have to sign up with another method first to register a passkey for your account.`}})()})]}),(()=>{switch(m){case"loading":case"success":return p.jsx(tn,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return p.jsx(tn,{onClick:_,disabled:!1,children:"Retry"})}})()]}),p.jsx(Bn,{})]})}};let fat=ue.div.withConfig({displayName:"Container",componentId:"sc-46c03a59-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const pat={component:()=>{let{enabled:t,token:e}=wa(),{lastScreen:n,currentScreen:r,navigateBack:i,navigate:s,setModalData:o}
197=jt(),{initSignupWithPasskey:a,initLoginWithPasskey:c}=Ht();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:n&&r!==n?i:void 0}),p.jsx(G5,{children:p.jsxs(gat,{children:[p.jsx(Y5,{}),p.jsx(Q5,{})]})}),p.jsx(pr,{children:"Log in or create a new account?"}),p.jsx(gr,{children:"Create a new account with a passkey or use a passkey to log in to an existing account."}),p.jsxs(gc,{children:[p.jsx(tn,{onClick:async()=>{t&&!e?(o({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:l=>a({captchaToken:l,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:Mm,onErrorNavigateTo:Hr}}),s(Al)):(await a({withPrivyUi:!0}),o({passkeyAuthModalData:{passkeySignupFlow:!0}}),s(Mm))},children:"Create new account"}),p.jsx(z9,{onClick:async()=>{t&&!e?(o({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:l=>c({captchaToken:l,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:Mm,onErrorNavigateTo:Hr}}),s(Al)):(await c({withPrivyUi:!0}),o({passkeyAuthModalData:{passkeySignupFlow:!1}}),s(Mm))},children:"Log in with a passkey"})]}),p.jsx(ln,{})]})}},gat=ue.div.withConfig({displayName:"DoubleIconWrapper",componentId:"sc-f058c8a2-0"})(["display:flex;align-items:center;justify-content:center;width:180px;height:90px;border-radius:50%;svg + svg{margin-left:12px;}> svg{z-index:2;color:var(--privy-color-accent);stroke:var(--privy-color-accent);fill:var(--privy-color-accent);}"]),I0e=()=>{let{enabled:t,token:e}=wa(),{navigate:n,setModalData:r,app:i,data:s}=jt(),{initLoginWithPasskey:o}=Ht(),a=()=>{i.loginConfig.passkeysForSignupEnabled?n(pat):(async()=>t&&!e?(r({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:c=>o({captchaToken:c,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:Mm,onErrorNavigateTo:Hr}}),n(Al)):(await o({withPrivyUi:!0}),r({passkeyAuthModalData:{passkeySignupFlow:!1}}),n(Mm)))()};return E.useMemo(()=>{var l;let c=(l=s==null?void 0:s.login)==null?void 0:l.loginMethods;return c?c.filter(u=>u!=="passkey").length:Object.entries(i.loginMethods).filter(([u,d])=>d).filter(([u])=>u!=="passkey").length},[i.loginMethods,s==null?void 0:s.login])===0?p.jsxs(Qr,{onClick:a,children:[p.jsx(FL,{})," Continue with passkey"]}):p.jsx(yat,{onClick:a,children:"I have a passkey"})};let mat=gs(["&&{width:100%;font-size:0.875rem;line-height:1rem;display:flex;gap:0.5rem;justify-content:center;align-items:center;padding:6px 8px;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent) !important;:focus{outline:none;box-shadow:none;}}"]);const yat=ue.button.withConfig({displayName:"StyledLink",componentId:"sc-1c6127e5-0"})(["",""],mat),wat=({value:t,onChange:e})=>p.jsx("select",{value:t,onChange:e,children:WMe.map(n=>p.jsxs("option",{value:n.code,children:[n.code," +",n.callCode]},n.code))}),Y_=E.forwardRef((t,e)=>{let{app:n}=jt(),[r,i]=E.useState(!1),{accountType:s}=xp(),[o,a]=E.useState(""),[c,l]=E.useState((n==null?void 0:n.intl.defaultCountry)??"US"),u=z4(o,c),d=zMe(c),h=HMe(c),f=oL(c),m=!u,[y,v]=E.useState(!1),b=f.length,C=$=>{let I=$.target.value;l(I),a(""),t.onChange&&t.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:p$(o,I),countryCode:I,isValid:z4(o,c)})},x=($,I)=>{try{let R=$.replace(/\D/g,"")===o.replace(/\D/g,"")?$:d.input($);a(R),t.onChange&&t.onChange({rawPhoneNumber:R,qualifiedPhoneNumber:p$($,I),countryCode:I,isValid:z4($,I)})}catch(R){console.error("Error processing phone number:",R)}},_=()=>{v(!0);let $=p$(o,c);t.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:$,countryCode:c,isValid:z4(o,c)}).finally(()=>v(!1))};return E.useEffect(()=>{if(t.defaultValue){let $=VMe(t.defaultValue);d.reset(),C({target:{value:$.countryCode}}),x($.phone,$.countryCode)}},[t.defaultValue]),p.jsxs(p.Fragment,{children:[p.jsx(vat,{children:p.jsxs(bat,{$callingCodeLength:b,$stacked:t.stacked,children:[p.jsx(wat,{value:c,onChange:C}),p.jsx("input",{ref:e,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:h,onFocus:()=>i(!0),onChange:$=>{x($.target.value,c)},onKeyUp:$=>{$.key==="Enter"&&_()},value:o,autoComplete:"tel"}),s!=="phone"||r||t.hideRecent?t.stacked||t.noIncludeSubmitButton?p.jsx("span",{}):p.jsx(q5,{isSubmitting:y,onClick:_,disabled:m,children:"Submit"}):p.jsx(_l,{color:"gray",children:"Recent"})]})}),t.stacked&&!t.noIncludeSubmitButton?p.jsx(tn,{loading:y,loadingText:null,onClick:_,disabled:m,children:"Submit"}):null]})});let vat=ue.div.withConfig({displayName:"InputContainer",componentId:"sc-2a729487-0"})(["width:100%;"]),bat=ue.label.withConfig({displayName:"PhoneNumberInput",componentId:"sc-2a729487-1"})(["--country-code-dropdown-width:calc(54px + calc(12 * ","px));--phone-input-extra-padding-left:calc(12px + calc(3 * ","px));display:block;position:relative;width:100%;@media (min-width:441px){--country-code-dropdown-width:calc(52px + calc(10 * ","px));}&& > select{font-size:16px;height:24px;position:absolute;margin:13px calc(var(--country-code-dropdown-width) / 4);line-height:24px;width:var(--country-code-dropdown-width);background-color:var(--privy-color-background);background-size:auto;background-position-x:right;cursor:pointer;@media (min-width:441px){font-size:14px;width:var(--country-code-dropdown-width);}:focus{outline:none;box-shadow:none;}}&& > input{font-size:16px;line-height:24px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:calc(100% - var(--country-code-dropdown-width));padding:12px 88px 12px calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));padding-right:",";flex-grow:1;background:var(--privy-color-background);border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-mdlg);width:100%;:focus{outline:none;border-color:var(--privy-color-accent);}:autofill,:-webkit-autofill{background:var(--privy-color-background);}@media (min-width:441px){font-size:14px;padding-right:78px;}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;border-color:var(--privy-color-accent);}}&& > input::placeholder{color:var(--privy-color-foreground-3);}"],t=>t.$callingCodeLength,t=>t.$callingCodeLength,t=>t.$callingCodeLength,t=>t.$stacked?"16px":"88px");const T0e=({isEditable:t,setIsEditable:e,defaultValue:n})=>{let r=E.useRef(null),{authenticated:i}=Wn(),{navigate:s,setModalData:o,currentScreen:a,data:c}=jt(),{initLoginWithSms:l}=Ht(),{enabled:u,token:d}=wa();return p.jsxs(p.Fragment,{children:[p.jsx(k1,{$if:!t,children:p.jsx(Y_,{ref:r,onSubmit:async function({qualifiedPhoneNumber:h}){var f;if(!u||d||i)try{await l({phoneNumber:h,captchaToken:d,withPrivyUi:!0,disableSignup:(f=c==null?void 0:c.login)==null?void 0:f.disableSignup}),s(dh)}
197catch(m){o({errorModalData:{error:m,previousScreen:a||mo}}),s(Hr)}else o({captchaModalData:{callback:m=>{var y;return l({phoneNumber:h,captchaToken:m,withPrivyUi:!0,disableSignup:(y=c==null?void 0:c.login)==null?void 0:y.disableSignup})},userIntentRequired:!1,onSuccessNavigateTo:dh,onErrorNavigateTo:Hr}}),s(Al)},defaultValue:n})}),p.jsx(k1,{$if:t,children:p.jsxs(Qr,{onClick:()=>{e(),setTimeout(()=>{var h;(h=r.current)==null||h.focus()},0)},children:[p.jsx(xl,{})," Continue with SMS"]})})]})};let xat={apple:{logo:p.jsx(ipe,{}),displayName:"Apple"},discord:{logo:p.jsx(spe,{}),displayName:"Discord"},github:{logo:p.jsx(ope,{}),displayName:"GitHub"},google:{logo:p.jsx(ape,{}),displayName:"Google"},linkedin:{logo:p.jsx(lpe,{}),displayName:"LinkedIn"},spotify:{logo:p.jsx(upe,{}),displayName:"Spotify"},instagram:{logo:p.jsx(cpe,{}),displayName:"Instagram"},twitter:{logo:p.jsx(hpe,{}),displayName:"Twitter"},tiktok:{logo:p.jsx(dpe,{}),displayName:"TikTok"}};const as=({provider:t})=>{let{enabled:e,token:n}=wa(),{navigate:r,setModalData:i,data:s}=jt(),[o,a]=E.useState(!1),{initLoginWithOAuth:c}=Ht(),{accountType:l}=xp(),u=E.useMemo(()=>l&&l!=="guest"&&l!=="signer"&&l!=="cross_app"?L_(l):null,[l]),{displayName:d,logo:h}=xat[t];return p.jsxs(Qr,{onClick:()=>{var f;a(!0),e&&!n?(i({captchaModalData:{callback:m=>{var y;return c(t,m,(y=s==null?void 0:s.login)==null?void 0:y.disableSignup)},userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:Hr}}),r(Al)):c(t,void 0,(f=s==null?void 0:s.login)==null?void 0:f.disableSignup)},disabled:o,children:[h," ",d,(u==null?void 0:u.loginMethod)===t&&p.jsx(Eat,{color:"gray",children:"Recent"})]})};let Eat=ue(_l).withConfig({displayName:"StyledChip",componentId:"sc-ba2aab1-0"})(["margin-left:auto;"]);function P0e(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...t,children:[p.jsx("defs",{children:p.jsxs("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[p.jsx("stop",{offset:"0",stopColor:"#1d93d2"}),p.jsx("stop",{offset:"1",stopColor:"#38b0e3"})]})}),p.jsx("title",{children:"Telegram_logo"}),p.jsx("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),p.jsx("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),p.jsx("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),p.jsx("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}const _8={component:()=>{let{authenticated:t,logout:e,ready:n,user:r}=Wn(),{app:i,setModalData:s,navigate:o,resetNavigation:a,data:c}=jt(),{initLoginWithTelegram:l,loginWithTelegram:u,updateWallets:d,setReadyToTrue:h,closePrivyModal:f,createAnalyticsEvent:m,getAuthMeta:y}=Ht(),[v,b]=E.useState(!1),[C,x]=E.useState(void 0),_=wa();async function $(){var N,T,O,U,z,L,S,k,M,W,H,D,V,B;try{let P=await async function(){let j;if(!t){if(_.enabled&&_.status==="error")throw new A_(_.error,null,Ce.CAPTCHA_FAILURE);return _.enabled&&_.status!=="success"&&(_.execute(),j=await _.waitForResult()),j}}();await u({captchaToken:P}),b(!0),h(!0)}catch(P){if((P==null?void 0:P.privyErrorCode)===Ce.ALLOWLIST_REJECTED)return x(void 0),a(),void o(Z_);if((P==null?void 0:P.privyErrorCode)===Ce.USER_LIMIT_REACHED)return console.error(new d5(P).toString()),x(void 0),a(),void o(Z5);if((P==null?void 0:P.privyErrorCode)===Ce.USER_DOES_NOT_EXIST)return x(void 0),a(),void o(X5);if((P==null?void 0:P.privyErrorCode)===Ce.ACCOUNT_TRANSFER_REQUIRED&&((T=(N=P.data)==null?void 0:N.data)!=null&&T.nonce))return x(void 0),a(),s({accountTransfer:{nonce:(U=(O=P.data)==null?void 0:O.data)==null?void 0:U.nonce,account:(L=(z=P.data)==null?void 0:z.data)==null?void 0:L.subject,telegramAuthResult:(S=y())==null?void 0:S.telegramAuthResult,telegramWebAppData:(k=y())==null?void 0:k.telegramWebAppData,displayName:(H=(W=(M=P.data)==null?void 0:M.data)==null?void 0:W.account)==null?void 0:H.displayName,linkMethod:"telegram",embeddedWalletAddress:(B=(V=(D=P.data)==null?void 0:D.data)==null?void 0:V.otherUser)==null?void 0:B.embeddedWalletAddress}}),void o(q2);let{retryable:j,detail:G}=RQ(P);x({retryable:j,detail:G,message:"Authentication failed"})}}E.useEffect(()=>{$()},[]),E.useEffect(()=>{if(!(n&&t&&v&&r))return;
197if(i!=null&&i.legal.requireUsersAcceptTerms&&!r.hasAcceptedTerms){let T=setTimeout(()=>{o(X1)},Jr);return()=>clearTimeout(T)}if(_p(r,i.embeddedWallets)){let T=setTimeout(()=>{s({createWallet:{onSuccess:()=>{},onFailure:O=>{console.error(O),m({eventName:"embedded_wallet_creation_failure_logout",payload:{error:O,provider:"telegram",screen:"TelegramAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),o(_h)},Jr);return()=>clearTimeout(T)}d();let N=setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Jr);return()=>clearTimeout(N)},[n,t,v,r]);let I=v?"Successfully connected with Telegram":C?C.message:"Verifying connection to Telegram",R="";return R=v?"Youâre good to go!":C?C.detail:"Just a few moments more",p.jsxs(p.Fragment,{children:[p.jsx(_t,{}),p.jsx(sr,{}),p.jsxs(Cat,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:v,fail:!!C}),p.jsx(P0e,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(Fa,{children:[p.jsx("h3",{children:I}),p.jsx("p",{children:R})]}),C&&(C!=null&&C.retryable)?p.jsx(bB,{onClick:async()=>{var N,T;try{x(void 0),(N=c==null?void 0:c.telegramAuthModalData)!=null&&N.seamlessAuth||await l(void 0,(T=c==null?void 0:c.login)==null?void 0:T.disableSignup),await $()}catch(O){let{retryable:U,detail:z}=RQ(O);x({retryable:U,detail:z,message:"Authentication failed"})}},disabled:!v&&!(C!=null&&C.retryable),children:"Retry"}):null]}),p.jsx(dr,{}),p.jsx(Bn,{})]})},isCaptchaRequired:!0};let Cat=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-491d0b9b-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);const R0e=()=>{let{enabled:t,token:e}=wa(),{navigate:n,setModalData:r,data:i}=jt(),[s,o]=E.useState(!1),{initLoginWithTelegram:a}=Ht(),{accountType:c}=xp();async function l(u){var d;try{await a(u,(d=i==null?void 0:i.login)==null?void 0:d.disableSignup),r({telegramAuthModalData:{seamlessAuth:!1}}),n(_8)}catch(h){console.error(h),o(!1)}}return p.jsxs(Qr,{onClick:async function(){if(o(!0),t&&!e)return r({captchaModalData:{callback:l,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:Hr}}),void n(Al);await l(e)},disabled:s,children:[p.jsx(P0e,{}),"Telegram",c==="telegram"&&p.jsx(_at,{color:"gray",children:"Recent"})]})};let _at=ue(_l).withConfig({displayName:"StyledChip",componentId:"sc-d81b85b5-0"})(["margin-left:auto;"]);const M0e=({onClick:t,text:e})=>p.jsxs(Qr,{onClick:t,children:[p.jsx(E5,{}),p.jsx(ah,{children:e}),p.jsx(UL,{})]}),O0e=({onClick:t,text:e,icon:n})=>p.jsxs(Qr,{onClick:t,children:[n,p.jsx(ah,{children:e}),p.jsx(UL,{})]}),j0e=({connectOnly:t})=>{var Ge;let{closePrivyModal:e,connectors:n}=Ht(),{data:r,onUserCloseViaDialogOrKeybindRef:i}=jt(),s=Vr(),{accountType:o,walletClientType:a,chainType:c}=xp(),l=E.useMemo(()=>o&&o!=="guest"&&o!=="signer"&&o!=="cross_app"?L_(o):null,[o]),u=r==null?void 0:r.login,{email:d,sms:h,google:f,twitter:m,discord:y,github:v,spotify:b,instagram:C,tiktok:x,linkedin:_,apple:$,wallet:I,farcaster:R,telegram:N}=E.useMemo(()=>u!=null&&u.loginMethods?qMe(u.loginMethods,!0):null,[u])??s.loginMethods,{passkey:T}=s.loginMethods,O=[d&&"email",h&&"sms",f&&"google",m&&"twitter",y&&"discord",v&&"github",b&&"spotify",C&&"instagram",x&&"tiktok",_&&"linkedin",$&&"apple",R&&"farcaster",N&&"telegram"].filter(je=>!!je),U=O.length>0,z=E.useMemo(()=>I&&!U?"web3-first":I&&(s==null?void 0:s.appearance.loginGroupPriority)||"web2-first",[I,U,s==null?void 0:s.appearance.loginGroupPriority]),L=s==null?void 0:s.appearance.hideDirectWeb2Inputs,[S,k]=E.useState("default"),[M,W]=E.useState(W9({mostRecentlyUsedAccountType:o,smsAvailable:h,emailAvailable:d,prefilledType:(Ge=u==null?void 0:u.prefill)==null?void 0:Ge.type}));E.useEffect(()=>{var je;W(W9({mostRecentlyUsedAccountType:o,smsAvailable:h,emailAvailable:d,prefilledType:(je=u==null?void 0:u.prefill)==null?void 0:je.type}))},[d,h,o]);let H=()=>{e({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{k("default")},150)};i.current=H;let D=[];a&&I?D.push(a):l!=null&&l.loginMethod&&O.includes(l.loginMethod)&&D.push(l.loginMethod);let V=je=>{var xt,ft;return je==="email"?p.jsx(F0e,{isEditable:M==="email",setIsEditable:()=>{W("email")},defaultValue:((xt=u==null?void 0:u.prefill)==null?void 0:xt.type)==="email"?u.prefill.value:void 0},je):je==="sms"?p.jsx(T0e,{isEditable:M==="sms",setIsEditable:()=>{W("sms")},defaultValue:((ft=u==null?void 0:u.prefill)==null?void 0:ft.type)==="phone"?u.prefill.value:void 0},je):je==="apple"?p.jsx(as,{provider:"apple"},je):je==="discord"?p.jsx(as,{provider:"discord"},je):je==="farcaster"?p.jsx($0e,{},je):je==="github"?p.jsx(as,{provider:"github"},je):je==="google"?p.jsx(as,{provider:"google"},je):je==="linkedin"?p.jsx(as,{provider:"linkedin"},je):je==="tiktok"?p.jsx(as,{provider:"tiktok"},je):je==="spotify"?p.jsx(as,{provider:"spotify"},je):je==="instagram"?p.jsx(as,{provider:"instagram"},je):je==="twitter"?p.jsx(as,{provider:"twitter"},je):je==="telegram"?p.jsx(R0e,{},je):I1({walletList:s.appearance.walletList,walletChainType:(u==null?void 0:u.walletChainType)??s.appearance.walletChainType,connectors:n,connectOnly:t,ignore:[],walletConnectEnabled:s.externalWallets.walletConnect.enabled,forceWallet:{wallet:je,chainType:c??"ethereum"}})},B=I1({walletList:s.appearance.walletList.filter(je=>je!==a),walletChainType:(u==null?void 0:u.walletChainType)??s.appearance.walletChainType,connectors:n,connectOnly:t,ignore:[...s.appearance.walletList,a],walletConnectEnabled:s.externalWallets.walletConnect.enabled}),P=O.filter(je=>je!==(l==null?void 0:l.loginMethod)).flatMap(V),j=D.flatMap(V);z==="web3-first"&&S==="default"?B.unshift(...j):z==="web2-first"&&P.unshift(...j);let G=O.filter(je=>je!=="email"&&je!=="sms"),Y=Aat({priority:z,email:d,sms:h,social:G}),te=kat({priority:z,email:d,sms:h,social:G}),ae=p.jsx(M0e,{text:$at({priority:z}),onClick:()=>k("web3-overflow")}),oe=p.jsx(O0e,{text:Y,icon:te,onClick:()=>k("web2-overflow")}),de=L?0:1,ke=I&&B.length>0,Be=P.length===0&&I&&B.length===0,$e=5-(ke?1:0),He=B.length>0?B:p.jsx(C8,{chainType:s.appearance.walletChainType,withPadding:!0});return p.jsxs(p.Fragment,{children:[p.jsx(_t,{title:s.appearance.landingHeader,onClose:H,backFn:S==="default"?void 0:()=>{k("default")}}),S==="default"&&p.jsx(Sat,{}),S==="default"&&(typeof s.appearance.loginMessage=="string"?p.jsx(Upe,{children:s.appearance.loginMessage}):s.appearance.loginMessage),p.jsx(Bpe,{style:{overflow:"hidden",padding:2},children:p.jsxs(u2,{children:[S==="default"&&z==="web2-first"&&p.jsxs(p.Fragment,{children:[P.length>$e?P.slice(0,$e-1):P,P.length>$e&&oe,ke&&ae,Be&&p.jsx(C8,{chainType:s.appearance.walletChainType})]}),S==="default"&&z==="web3-first"&&p.jsxs(p.Fragment,{children:[I&&p.jsxs(p.Fragment,{children:[B.length>$e?B.slice(0,$e-1):B,B.length>$e&&ae]}),P.length>de&&oe,P.length===de&&P[0],Be&&p.jsx(C8,{chainType:s.appearance.walletChainType})]}),S==="web2-overflow"&&p.jsx(p.Fragment,{children:z==="web3-first"?P:P.slice(3)}),S==="web3-overflow"?He:[],T&&S==="default"&&p.jsx(I0e,{})]})}),s&&p.jsx(yB,{app:s}),p.jsx(ln,{})]})};let Sat=ue(Zpe).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-2678dfdf-0"})(["margin-bottom:16px;"]),Aat=({priority:t,email:e,sms:n,social:r})=>t==="web2-first"?"Other socials":e&&n&&r.length>0||e&&r.length>0?"Log in with email or socials":n&&r.length>0?"Log in with sms or socials":e&&n?"Continue with email or sms":e?"Continue with email":n?"Continue with sms":"Log in with a social account",kat=({priority:t,email:e,sms:n,social:r})=>t==="web2-first"||r.length>0?p.jsx(LL,{}):e&&n?p.jsx(Vot,{}):e?p.jsx(H1,{}):n?p.jsx(xl,{}):null,$at=({priority:t})=>t==="web2-first"?"Continue with a wallet":"Other wallets";const W9=({mostRecentlyUsedAccountType:t,smsAvailable:e,emailAvailable:n,prefilledType:r})=>n&&(t==="email"&&r!=="phone"||r==="email")||!e||t!=="phone"&&r!=="phone"?"email":"sms",N0e={component:()=>{let{app:t}=jt();return t.loginMethodsAndOrder&&t.loginMethodsAndOrder.primary.length>0?p.jsx(U0e,{connectOnly:!0}):p.jsx(j0e,{connectOnly:!0})}};let ZQ=Array(6).fill("");var mv,yv,Iat=((mv=Iat||{})[mv.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",mv[mv.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",mv),Tat=((yv=Tat||{})[yv.EMAIL=0]="EMAIL",yv[yv.SMS=1]="SMS",yv);const dh={component:()=>{var S,k,M;let{app:t,navigate:e,lastScreen:n,navigateBack:r,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=jt(),{closePrivyModal:o,resendEmailCode:a,resendSmsCode:c,getAuthMeta:l,loginWithCode:u,updateWallets:d,createAnalyticsEvent:h}=Ht(),{authenticated:f,logout:m,user:y}=Wn(),[v,b]=E.useState(ZQ),[C,x]=E.useState(!1),[_,$]=E.useState(null),[I,R]=E.useState(null),[N,T]=E.useState(0);s.current=()=>null;let O=(S=l())!=null&&S.email?0:1;E.useEffect(()=>{if(N){let W=setTimeout(()=>{T(N-1)},1e3);return()=>clearTimeout(W)}
197},[N]),E.useEffect(()=>{if(f&&C&&y){if(t!=null&&t.legal.requireUsersAcceptTerms&&!y.hasAcceptedTerms){let W=setTimeout(()=>{e(X1)},900);return()=>clearTimeout(W)}if(_p(y,t.embeddedWallets)){let W=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:H=>{console.error(H),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:H,screen:"AwaitingPasswordlessCodeScreen"}}),m()},callAuthOnSuccessOnClose:!0}}),e(_h)},900);return()=>clearTimeout(W)}{d();let W=setTimeout(()=>o({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Jr);return()=>clearTimeout(W)}}},[f,C,y]),E.useEffect(()=>{if(_&&I===0){let W=setTimeout(()=>{b(ZQ),$(null);let H=document.querySelector("input[name=code-0]");H==null||H.focus()},1400);return()=>clearTimeout(W)}},[_]);let U=W=>{var j;W.preventDefault();let H=W.currentTarget.value.replace(" ","");if(H==="")return;if(isNaN(Number(H)))return $("Code should be numeric"),void R(1);$(null),R(null);let D=Number((j=W.currentTarget.name)==null?void 0:j.charAt(5)),V=[...H||[""]].slice(0,6-D),B=[...v.slice(0,D),...V,...v.slice(D+V.length)];b(B);let P=Math.min(Math.max(D+V.length,0),5);if(!isNaN(Number(W.currentTarget.value))){let G=document.querySelector(`input[name=code-${P}]`);G==null||G.focus()}if(B.every(G=>G&&!isNaN(+G))){let G=document.querySelector(`input[name=code-${P}]`);G==null||G.blur(),u(B.join("")).then(()=>x(!0)).catch(Y=>{var te,ae,oe,de,ke,Be,$e,He,Ge,je,xt,ft;if(Y instanceof fc&&Y.privyErrorCode===Ce.INVALID_CREDENTIALS)$("Invalid or expired verification code");else if(Y instanceof fc&&Y.privyErrorCode===Ce.CANNOT_LINK_MORE_OF_TYPE)$(Y.message);else{if(Y instanceof fc&&Y.privyErrorCode===Ce.USER_LIMIT_REACHED)return console.error(new d5(Y).toString()),void e(Z5);if(Y instanceof fc&&Y.privyErrorCode===Ce.USER_DOES_NOT_EXIST)return void e(X5);if(Y instanceof fc&&Y.privyErrorCode===Ce.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:Y,previousScreen:n??dh}}),void e(Hr,!1);if(Y instanceof fc&&Y.privyErrorCode===Ce.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:Y}}),void e(N0e,!1);if(Y instanceof fc&&Y.privyErrorCode===Ce.ACCOUNT_TRANSFER_REQUIRED&&((ae=(te=Y.data)==null?void 0:te.data)!=null&&ae.nonce))return i({accountTransfer:{nonce:(de=(oe=Y.data)==null?void 0:oe.data)==null?void 0:de.nonce,account:O===0?(ke=l())==null?void 0:ke.email:(Be=l())==null?void 0:Be.phoneNumber,displayName:(Ge=(He=($e=Y.data)==null?void 0:$e.data)==null?void 0:He.account)==null?void 0:Ge.displayName,linkMethod:O===0?"email":"sms",embeddedWalletAddress:(ft=(xt=(je=Y.data)==null?void 0:je.data)==null?void 0:xt.otherUser)==null?void 0:ft.embeddedWalletAddress}}),void e(q2);$("Issue verifying code")}R(0)})}},z=O==0?p.jsx(H1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):p.jsx(xl,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),L=p.jsxs("p",O==0?{children:["Please check ",p.jsx(YQ,{children:(k=l())==null?void 0:k.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",p.jsx(YQ,{children:(M=l())==null?void 0:M.phoneNumber})," for a message from ",(t==null?void 0:t.name)||"Privy"," and enter your code below."]});return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:()=>r()},"header"),p.jsxs(Pat,{children:[p.jsx(ei,{title:"Enter confirmation code",description:L,icon:z}),p.jsxs(xB,{children:[p.jsxs(Rat,{children:[p.jsx(Mat,{$fail:!!_,$success:C,children:p.jsx("span",{children:_||(C?"Success!":"")})}),p.jsx("div",{children:v.map((W,H)=>p.jsx("input",{name:`code-${H}`,type:"text",value:v[H],onChange:U,onKeyUp:D=>{D.key==="Backspace"&&(V=>{if(I===1&&($(null),R(null)),b([...v.slice(0,V),"",...v.slice(V+1)]),V>0){let B=document.querySelector(`input[name=code-${V-1}]`);B==null||B.focus()}})(H)},inputMode:"numeric",autoFocus:H===0,pattern:"[0-9]",className:`${C?"success":""} ${_?"fail":""}`,autoComplete:di.isMobile?"one-time-code":"off"},H))})]}),p.jsxs(Oat,{children:[p.jsxs("span",{children:["Didn't get ",O==0?"an email":"a message","?"]}),N?p.jsxs(Nat,{children:[p.jsx(bXe,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),p.jsx("span",{children:"Code sent"})]}):p.jsx(jat,{children:p.jsx("button",{onClick:async()=>{T(30),O==0?await a():await c()},children:"Resend code"})})]})]})]}),p.jsx(ln,{})]})}};let Pat=ue.div.withConfig({displayName:"PasswordlessCodeContainer",componentId:"sc-4f88a915-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:center;margin:auto;gap:16px;flex-grow:1;"]),Rat=ue.div.withConfig({displayName:"CodeInput",componentId:"sc-4f88a915-1"})(["display:flex;flex-direction:column;width:100%;gap:8px;> div:last-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-md);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);padding:8px 10px;height:58px;width:46px;text-align:center;font-size:18px;}> input:focus{border:1px solid var(--privy-color-accent);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-success);}> input.fail{border:1px solid var(--privy-color-error);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),Mat=ue.div.withConfig({displayName:"InputHelp",componentId:"sc-4f88a915-2"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-end;width:100%;"],t=>t.$success?"var(--privy-color-success)":t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"),Oat=ue.div.withConfig({displayName:"HelpText",componentId:"sc-4f88a915-3"})(["font-size:13px;color:var(--privy-color-foreground);
197display:flex;gap:8px;align-items:center;width:100%;margin-top:16px;padding-bottom:32px;"]),jat=ue.div.withConfig({displayName:"ResendButtonContainer",componentId:"sc-4f88a915-4"})(["color:var(--privy-color-accent);padding:2px 0;> button{text-decoration:underline;}"]),Nat=ue.div.withConfig({displayName:"Badge",componentId:"sc-4f88a915-5"})(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]),YQ=ue.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-4f88a915-6"})(["font-weight:500;word-break:break-all;"]);const hh=ue.span.withConfig({displayName:"ErrorMessage",componentId:"sc-fcb8cd50-0"})(["text-align:left;font-size:0.75rem;font-weight:500;line-height:1.125rem;color:var(--privy-color-error);"]);let D0e=ue.label.withConfig({displayName:"BaseEmailForm",componentId:"sc-d081b0e2-0"})(["display:block;position:relative;width:100%;> svg{position:absolute;margin:13px 17px;height:24px;width:24px;color:var(--privy-color-foreground-3);}&& > input{background-color:#f00;font-size:16px;line-height:24px;padding:12px 88px 12px 52px;flex-grow:1;background:var(--privy-color-background);border:1px solid ",";border-radius:var(--privy-border-radius-mdlg);width:100%;@media (min-width:441px){font-size:14px;padding-right:78px;}:focus{outline:none;border-color:",";box-shadow:",";}:autofill,:-webkit-autofill{background:var(--privy-color-background);}&& > input::placeholder{color:var(--privy-color-foreground-3);}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}"],({$error:t})=>t?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)",({$error:t})=>t?"var(--privy-color-error) !important":"var(--privy-color-accent-light)",({$error:t})=>t?"none":"0 0 0 1px var(--privy-color-accent-light)");const Dat=ue(D0e).withConfig({displayName:"EmailUpdateForm",componentId:"sc-d081b0e2-1"})(["background-color:var(--privy-color-background);transition:background-color 200ms ease;&& > button{right:0;line-height:24px;position:absolute;padding:13px 17px;background-color:#090;:focus{outline:none;border-color:var(--privy-color-accent);}}"]),Lat=ue(D0e).withConfig({displayName:"EmailInputForm",componentId:"sc-d081b0e2-2"})(["&& > input{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-right:",";border:1px solid ",";&& > input::placeholder{color:var(--privy-color-foreground-3);}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}}"],t=>t.stacked?"16px":"88px",({$error:t})=>t?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)"),L0e=ue.div.withConfig({displayName:"InputContainerForm",componentId:"sc-d081b0e2-3"})(["width:100%;&& > ","{display:block;text-align:left;padding-left:var(--privy-border-radius-mdlg);padding-bottom:5px;}"],hh),B0e=E.forwardRef((t,e)=>{let[n,r]=E.useState(t.defaultValue||""),[i,s]=E.useState(""),[o,a]=E.useState(!1),{authenticated:c}=Wn(),{initLoginWithEmail:l}=Ht(),{navigate:u,setModalData:d,currentScreen:h,data:f}=jt(),{enabled:m,token:y}=wa(),[v,b]=E.useState(!1),{accountType:C}=xp(),x=Vr();E.useEffect(()=>{var R,N;!n&&x.disablePlusEmails&&((R=f==null?void 0:f.inlineError)==null?void 0:R.error)instanceof fa&&((N=f==null?void 0:f.inlineError)==null?void 0:N.error.privyErrorCode)===Ce.DISALLOWED_PLUS_EMAIL&&!i&&s("Please enter a valid email address without a '+'."),i&&s("")},[n]);let _=Zfe(n),$=o||!_,I=()=>{d({inlineError:void 0}),!m||y||c?(R=>{var N;a(!0),l({email:n,captchaToken:R,disableSignup:(N=f==null?void 0:f.login)==null?void 0:N.disableSignup,withPrivyUi:!0}).then(()=>{u(dh)}).catch(T=>{d({errorModalData:{error:T,previousScreen:h||mo}}),u(Hr)}).finally(()=>{a(!1)})})(y):(d({captchaModalData:{callback:R=>l({email:n,captchaToken:R,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:dh,onErrorNavigateTo:Hr}}),u(Al))};return p.jsxs(p.Fragment,{children:[p.jsxs(Bat,{children:[i&&p.jsx(hh,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:i}),p.jsxs(Fat,{stacked:t.stacked,$error:!!i,children:[p.jsx(H1,{}),p.jsx("input",{ref:e,id:"email-input",className:"login-method-button",type:"email",placeholder:"[email protected]",onFocus:()=>b(!0),onChange:R=>r(R.target.value),onKeyUp:R=>{R.key==="Enter"&&I()},value:n,autoComplete:"email"}),C!=="email"||v?t.stacked?p.jsx("span",{}):p.jsx(q5,{isSubmitting:o,onClick:I,disabled:$,children:"Submit"}):p.jsx(_l,{color:"gray",children:"Recent"})]})]}),t.stacked?p.jsx(tn,{loadingText:null,loading:o,disabled:$,onClick:I,children:"Submit"}):null]})});let Bat=L0e,Fat=Lat;
197const F0e=({isEditable:t,setIsEditable:e,defaultValue:n})=>{let r=E.useRef(null);return p.jsxs(p.Fragment,{children:[p.jsx(k1,{$if:!t,children:p.jsx(B0e,{ref:r,defaultValue:n})}),p.jsx(k1,{$if:t,children:p.jsxs(Qr,{onClick:()=>{e(),setTimeout(()=>{var i;(i=r.current)==null||i.focus()},0)},children:[p.jsx(H1,{})," Continue with Email"]})})]})},U0e=({connectOnly:t})=>{var z,L,S;let{closePrivyModal:e,connectors:n}=Ht(),{app:r,onUserCloseViaDialogOrKeybindRef:i,data:s}=jt(),{appearance:{palette:{colorScheme:o}}}=Vr(),{accountType:a,walletClientType:c,chainType:l}=xp(),u=E.useMemo(()=>a&&a!=="guest"&&a!=="signer"&&a!=="cross_app"?L_(a):null,[a]),d=((z=r.loginMethodsAndOrder)==null?void 0:z.primary)??[],h=((L=r.loginMethodsAndOrder)==null?void 0:L.overflow)??[],f=E.useMemo(()=>[...d,...h],[d,h]),m=r.loginMethods.passkey,y=s==null?void 0:s.login,v=[];c&&f.includes(c)?v.push(c):a&&f.includes(u==null?void 0:u.loginMethod)&&v.push(u==null?void 0:u.loginMethod);let[b,C]=E.useState("default"),[x,_]=E.useState(W9({mostRecentlyUsedAccountType:a,smsAvailable:f.includes("sms"),emailAvailable:f.includes("email"),prefilledType:(S=y==null?void 0:y.prefill)==null?void 0:S.type}));E.useEffect(()=>{var k;_(W9({mostRecentlyUsedAccountType:a,smsAvailable:f.includes("sms"),emailAvailable:f.includes("email"),prefilledType:(k=y==null?void 0:y.prefill)==null?void 0:k.type}))},[f,a]),E.useEffect(()=>{a==="phone"&&_("sms");let k=f.indexOf("sms"),M=f.indexOf("email");k>-1&&k<M&&_("sms")},[a,d,h]);let $=()=>{e({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{C("default")},150)};i.current=$;let I=k=>{var M,W;return k==="email"?p.jsx(F0e,{isEditable:x==="email",setIsEditable:()=>{_("email")},defaultValue:((M=y==null?void 0:y.prefill)==null?void 0:M.type)==="email"?y.prefill.value:void 0},k):k==="sms"?p.jsx(T0e,{isEditable:x==="sms",setIsEditable:()=>{_("sms")},defaultValue:((W=y==null?void 0:y.prefill)==null?void 0:W.type)==="phone"?y.prefill.value:void 0},k):k==="apple"?p.jsx(as,{provider:"apple"},k):k==="discord"?p.jsx(as,{provider:"discord"},k):k==="farcaster"?p.jsx($0e,{},k):k==="github"?p.jsx(as,{provider:"github"},k):k==="google"?p.jsx(as,{provider:"google"},k):k==="linkedin"?p.jsx(as,{provider:"linkedin"},k):k==="spotify"?p.jsx(as,{provider:"spotify"},k):k==="instagram"?p.jsx(as,{provider:"instagram"},k):k==="tiktok"?p.jsx(as,{provider:"tiktok"},k):k==="twitter"?p.jsx(as,{provider:"twitter"},k):k==="telegram"?p.jsx(R0e,{},k):k.startsWith("privy:")?p.jsx(Bst,{appId:k.replace("privy:","")},k):I1({walletList:r.appearance.walletList,walletChainType:(y==null?void 0:y.walletChainType)??r.appearance.walletChainType,connectors:n,connectOnly:t,ignore:f,walletConnectEnabled:r.externalWallets.walletConnect.enabled,forceWallet:{wallet:k,chainType:l??"ethereum"}})},R=v.flatMap(I),N=d.filter(k=>k!==c&&k!==(u==null?void 0:u.loginMethod)).flatMap(I),T=h.filter(k=>k!==c&&k!==(u==null?void 0:u.loginMethod)).flatMap(I),[O,U]=((k,M)=>{let W=[],H=[];for(let[D,V]of k.entries())D<M?W.push(V):H.push(V);return[W,H]})([...R,...N,...T],Uat({primary:N.length+R.length,overflow:T.length}));return p.jsxs(p.Fragment,{children:[p.jsx(_t,{title:r.appearance.landingHeader,onClose:$,backFn:b==="default"?void 0:()=>{C("default")}}),b==="default"&&p.jsx(zat,{}),b==="default"&&(typeof r.appearance.loginMessage=="string"?p.jsx(Upe,{children:r.appearance.loginMessage}):r.appearance.loginMessage),p.jsx(Bpe,{style:{overflow:"hidden"},children:p.jsxs(wB,{$colorScheme:o,children:[b==="default"&&p.jsxs(p.Fragment,{children:[O,U.length>0&&p.jsx(O0e,{text:"More options",icon:p.jsx(LL,{}),onClick:()=>C("overflow")})]}),b==="overflow"&&p.jsx(p.Fragment,{children:U}),m&&b==="default"&&p.jsx(I0e,{})]})}),r&&p.jsx(yB,{app:r}),p.jsx(ln,{})]})};let Uat=({primary:t,overflow:e})=>t<5?t:t===5&&e===0?5:4,zat=ue(Zpe).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-85b7f7ea-0"})(["margin-bottom:16px;"]);const mo={component:()=>{let{app:t}=jt();return t.loginMethodsAndOrder&&t.loginMethodsAndOrder.primary.length>0?p.jsx(U0e,{connectOnly:!1}):p.jsx(j0e,{connectOnly:!1})},isCaptchaRequired:!0},X5={component:()=>{let{navigate:t,app:e,setModalData:n,data:r}=jt(),{getAuthMeta:i,client:s}=Ht();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{}),p.jsxs(Wat,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Gpe,{color:"var(--privy-color-warn-light)"}),p.jsx(t1,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),p.jsxs(Hat,{children:[p.jsx("h3",{children:"Account not found"}),p.jsxs("p",{children:["Please try logging in again or go to ",e.name," to create an account."]})]}),p.jsx(ah,{}),p.jsx(tn,{onClick:()=>{let o=i();n({...r,login:{...r==null?void 0:r.login,...o!=null&&o.disableSignup?{disableSignup:!0}:{}}}),s!=null&&s.authFlow&&(s.authFlow=void 0),t(mo)},children:"Try logging in again"})]})]})}};let Wat=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-feca2100-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;margin-top:24px;"]),Hat=ue.div.withConfig({displayName:"GappedContainer",componentId:"sc-feca2100-1"})(["display:flex;flex-direction:column;gap:8px;"]);const z0e=t=>(t==null?void 0:t.privyErrorCode)===Ce.LINKED_TO_ANOTHER_USER?Sf.ERROR_USER_EXISTS:t instanceof Vd&&!t.details.default?t.details:t instanceof Ape?Sf.E
197RROR_TIMED_OUT:t instanceof kpe?Sf.ERROR_USER_REJECTED_CONNECTION:(t==null?void 0:t.privyErrorCode)===Ce.CANNOT_LINK_MORE_OF_TYPE?Sf.ERROR_USER_LIMIT_REACHED:Sf.ERROR_WALLET_CONNECTION,ny={component:()=>{var je,xt,ft,it,be,Lt,Qe,Ue,Ye,tt,ze,Ne;let t,[e,n]=E.useState(!1),[r,i]=E.useState(!1),[s,o]=E.useState(void 0),{authenticated:a,logout:c}=Wn(),{app:l,navigate:u,navigateBack:d,lastScreen:h,currentScreen:f,setModalData:m,data:y}=jt(),{getAuthFlow:v,walletConnectionStatus:b,closePrivyModal:C,initLoginWithWallet:x,loginWithWallet:_,updateWallets:$,createAnalyticsEvent:I}=Ht(),{walletConnectors:R}=Wn(),[N,T]=E.useState(0),{user:O}=Wn(),[U]=E.useState((O==null?void 0:O.linkedAccounts.length)||0),[z,L]=E.useState(""),[S,k]=E.useState(""),[M,W]=E.useState(!1),{hasTabbedAway:H}=function(){let[J,q]=E.useState(!1),Z=E.useCallback(()=>{document.hidden&&q(!0)},[]);return E.useEffect(()=>(document.addEventListener("visibilitychange",Z),()=>document.removeEventListener("visibilitychange",Z)),[Z]),{hasTabbedAway:J,reset:()=>q(!1)}}(),{enabled:D,token:V}=wa(),B=Eh(((je=b==null?void 0:b.connector)==null?void 0:je.walletClientType)||"unknown"),P=di.isMobile&&((xt=b==null?void 0:b.connector)==null?void 0:xt.connectorType)==="wallet_connect_v2"||di.isMobile&&((ft=b==null?void 0:b.connector)==null?void 0:ft.connectorType)==="coinbase_wallet"||di.isMobile&&((it=b==null?void 0:b.connector)==null?void 0:it.connectorType)==="injected"&&((be=b==null?void 0:b.connector)==null?void 0:be.walletClientType)==="phantom",j=(b==null?void 0:b.status)==="connected",G=(b==null?void 0:b.status)==="switching_to_supported_chain";E.useEffect(()=>{var Z;let J=v(),q=J instanceof O9||J instanceof BO?J:void 0;j&&!q&&(!D||V||a?x(b.connectedWallet,V,(Z=y==null?void 0:y.login)==null?void 0:Z.disableSignup).then(()=>{W(!0)}):(m({captchaModalData:{callback:se=>{var he;return x(b.connectedWallet,se,(he=y==null?void 0:y.login)==null?void 0:he.disableSignup).then(()=>{W(!0)})},userIntentRequired:!1,onSuccessNavigateTo:ny,onErrorNavigateTo:Hr}}),u(Al,!1))),q&&P&&j&&!q.preparedMessage?q.buildMessage():q&&!P&&j&&(r||(async()=>{var se,he;i(!0),o(void 0);try{((se=b==null?void 0:b.connector)==null?void 0:se.connectorType)==="wallet_connect_v2"&&((he=b==null?void 0:b.connector)==null?void 0:he.walletClientType)==="metamask"&&await I9(2500),await te()}catch(fe){console.warn("Auto-prompted signature failed",fe)}finally{i(!1)}})())},[N,j,M]),E.useEffect(()=>{if(O&&e){let J=900;if(l!=null&&l.legal.requireUsersAcceptTerms&&!O.hasAcceptedTerms){let Z=setTimeout(()=>{u(X1)},J);return()=>clearTimeout(Z)}if(_p(O,l.embeddedWallets)){let Z=setTimeout(()=>{m({createWallet:{onSuccess:()=>{},onFailure:se=>{console.error(se),I({eventName:"embedded_wallet_creation_failure_logout",payload:{error:se,screen:"ConnectionStatusScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),u(_h)},J);return()=>clearTimeout(Z)}$();let q=setTimeout(()=>C({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Jr);return()=>clearTimeout(q)}},[O,e]);let Y=J=>{var q,Z,se,he,fe,ye,nt,vt,Nt,mn,At,En,yr,xn;if((J==null?void 0:J.privyErrorCode)!==Ce.ALLOWLIST_REJECTED){if((J==null?void 0:J.privyErrorCode)===Ce.USER_LIMIT_REACHED)return console.error(new d5(J).toString()),void u(Z5);if((J==null?void 0:J.privyErrorCode)!==Ce.USER_DOES_NOT_EXIST)return(J==null?void 0:J.privyErrorCode)===Ce.ACCOUNT_TRANSFER_REQUIRED&&((Z=(q=J.data)==null?void 0:q.data)!=null&&Z.nonce)?(m({accountTransfer:{nonce:(he=(se=J.data)==null?void 0:se.data)==null?void 0:he.nonce,account:(fe=v())==null?void 0:fe.meta.address,displayName:(vt=(nt=(ye=J.data)==null?void 0:ye.data)==null?void 0:nt.account)==null?void 0:vt.displayName,externalWalletMetadata:{walletClientType:(Nt=v())==null?void 0:Nt.meta.walletClientType,chainId:(mn=v())==null?void 0:mn.meta.chainId,connectorType:(At=v())==null?void 0:At.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:(xn=(yr=(En=J.data)==null?void 0:En.data)==null?void 0:yr.otherUser)==null?void 0:xn.embeddedWalletAddress}}),void u(q2)):void o(z0e(J));u(X5)}else u(Z_)};async function te(){try{await _(),n(!0)}catch(J){Y(J)}finally{i(!1)}}E.useEffect(()=>{b!=null&&b.connectError&&Y(b==null?void 0:b.connectError)},[b]),((J,q)=>{let Z=E.useRef(()=>{});E.useEffect(()=>{Z.current=J}),E.useEffect(()=>{if(q!==null){let se=setInterval(()=>Z.current(),q||0);return()=>clearInterval(se)}},[q])})(()=>{let J=ae==="wallet_connect_v2"&&(b==null?void 0:b.connector)instanceof ry?b.connector.redirectUri:void 0;J&&L(J);let q=ae==="wallet_connect_v2"&&(b==null?void 0:b.connector)instanceof ry?b.connector.fallbackUniversalRedirectUri:void 0;q&&k(q)},(b==null?void 0:b.connector)instanceof ry&&!z?500:null);let ae=((Lt=b==null?void 0:b.connector)==null?void 0:Lt.connectorType)||"injected",oe=((Qe=b==null?void 0:b.connector)==null?void 0:Qe.walletClientType)||"unknown",de=((Ue=B==null?void 0:B.metadata)==null?void 0:Ue.shortName)||(B==null?void 0:B.name)||((Ye=b==null?void 0:b.connector)==null?void 0:Ye.walletBranding.name)||"Browser Extension",ke=((tt=B==null?void 0:B.image_url)==null?void 0:tt.md)||((ze=b==null?void 0:b.connector)==null?void 0:ze.walletBranding.icon)||(J=>p.jsx(pB,{...J}
197)),Be=de==="Browser Extension"?de.toLowerCase():de;t=e?`Successfully connected with ${Be}`:s?s.message:G?"Switching networks":j?r&&P?"Signing":"Sign to verify":`Waiting for ${Be}`;let $e="Donât see your wallet? Check your other browser windows.";e?$e=U===((O==null?void 0:O.linkedAccounts.length)||0)?"Wallet was already linked.":"Youâre good to go!":N>=2&&s?$e="Unable to connect wallet":s?$e=s.detail:G?$e="Switch your wallet to the requested network.":j&&P?$e="Sign the message in your wallet to verify it belongs to you.":oe==="metamask"&&di.isMobile?$e="Click continue to open and connect MetaMask.":oe==="metamask"?$e="For the best experience, connect only one wallet at a time.":ae==="wallet_connect"?$e="Open your mobile wallet app to continue":ae!=="coinbase_wallet"||Gfe()||($e=UQ(O)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let He=(Ne=R==null?void 0:R.walletConnectors)==null?void 0:Ne.find(J=>J.walletClientType==="coinbase_wallet"),Ge=oe==="coinbase_wallet"&&(UQ(O)||s===Sf.ERROR_USER_EXISTS);return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:h&&f!==h?d:void 0}),p.jsxs(Vat,{children:[p.jsx(W0e,{walletLogo:ke,success:e,fail:!!s}),p.jsxs(Fa,{children:[p.jsx("h3",{children:t}),p.jsx("p",{children:$e}),j||!z||H?null:p.jsxs("p",{children:["Still here?"," ",p.jsx("a",{href:z,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),S&&p.jsxs(p.Fragment,{children:[" ","or"," ",p.jsx("a",{href:S,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),Ge?p.jsx(tn,{onClick:()=>He&&(He==null?void 0:He.disconnect()),disabled:e,children:"Use a different wallet"}):s==Sf.ERROR_USER_EXISTS&&f!==h?p.jsx(tn,{onClick:d,children:"Use a different wallet"}):j&&!e&&P?p.jsx(tn,{onClick:()=>{i(!0),te()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&(s!=null&&s.retryable)&&N<2?p.jsx(tn,{onClick:()=>{T(N+1),o(void 0),j?(i(!0),te()):b==null||b.connectRetry()},disabled:!e&&(!(s!=null&&s.retryable)||N>=2),children:"Retry"}):e||s?null:p.jsx(tn,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),p.jsx(Bn,{})]})}};let Vat=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-a7ed3654-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),qat=ue.div.withConfig({displayName:"StackedContainer",componentId:"sc-a7ed3654-1"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const W0e=t=>{let e=t.walletLogo;return p.jsx(p.Fragment,{children:p.jsx(qat,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:t.success,fail:t.fail}),typeof e=="string"?p.jsx("span",{style:{background:`url('${e}') 0 0 / contain`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"contain"}}):p.jsx(e,{style:{width:"38px",height:"38px"}})]})})})},YO={component:()=>{var I,R,N,T,O,U,z;let t,{navigateBack:e,navigate:n,lastScreen:r,currentScreen:i,data:s,setModalData:o}=jt(),{walletConnectionStatus:a,closePrivyModal:c}=Ht(),[l,u]=E.useState(void 0),[d,h]=E.useState(0),f=Eh(((I=a==null?void 0:a.connector)==null?void 0:I.walletClientType)||"unknown"),m=(a==null?void 0:a.status)==="connected",y=(a==null?void 0:a.status)==="switching_to_supported_chain";E.useEffect(()=>{var L,S;if(m){let k;if((L=s==null?void 0:s.externalConnectWallet)!=null&&L.onCompleteNavigateTo){let M=s.externalConnectWallet.onCompleteNavigateTo,W=(S=a.connectedWallet)==null?void 0:S.address;k=setTimeout(()=>{var H;s.funding&&o({...s,funding:{...s.funding,connectedWalletAddress:W}}),n(M({walletChainType:(H=a.connector)==null?void 0:H.chainType}))},Jr)}else k=setTimeout(c,Jr);return()=>clearTimeout(k)}},[m]),E.useEffect(()=>{a!=null&&a.connectError&&(L=>{u(z0e(L))})(a==null?void 0:a.connectError)},[a]);let v=((R=a==null?void 0:a.connector)==null?void 0:R.connectorType)||"injected",b=((N=a==null?void 0:a.connector)==null?void 0:N.walletClientType)||"unknown",C=((T=f==null?void 0:f.metadata)==null?void 0:T.shortName)||(f==null?void 0:f.name)||((O=a==null?void 0:a.connector)==null?void 0:O.walletBranding.name)||"Browser Extension",x=((U=f==null?void 0:f.image_url)==null?void 0:U.md)||((z=a==null?void 0:a.connector)==null?void 0:z.walletBranding.icon)||(L=>p.jsx(pB,{...L})),_=C==="Browser Extension"?C.toLowerCase():C;t=m?`Successfully connected with ${_}`:l?l.message:y?"Switching networks":`Waiting for ${_}`;let $="Donât see your wallet? Check your other browser windows.";return m?$="Youâre good to go!":d>=2&&l?$="Unable to connect wallet":l?$=l.detail:y?$="Switch your wallet to the requested network.":b==="metamask"&&di.isMobile?$="Click to continue to open and connect MetaMask.":b==="metamask"?$="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?$="Open your mobile wallet app to continue":v==="coinbase_wallet"&&($="Open the C
197oinbase app on your phone to continue."),p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:i===r?void 0:e}),p.jsxs(Kat,{children:[p.jsx(W0e,{walletLogo:x,success:m,fail:!!l}),p.jsxs(Fa,{children:[p.jsx("h3",{children:t}),p.jsx("p",{children:$})]}),l==Sf.ERROR_USER_EXISTS?p.jsx(tn,{onClick:e,children:"Use a different wallet"}):!m&&(l!=null&&l.retryable)&&d<2?p.jsx(tn,{onClick:()=>{h(d+1),u(void 0),a==null||a.connectRetry()},disabled:!m&&(!(l!=null&&l.retryable)||d>=2),children:"Retry"}):!m&&l&&d>=2?p.jsx(tn,{onClick:e,children:"Use a different wallet"}):null]}),p.jsx(Bn,{})]})}};let Kat=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-604d07cd-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const Gat=({style:t,...e})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...t},...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.
19701256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})}),Zat=ue.div.withConfig({displayName:"TodoList",componentId:"sc-491785d-0"})(["display:flex;flex-direction:column;justify-content:flex-start;gap:4px;"]),QQ=ue.div.withConfig({displayName:"TodoSpacer",componentId:"sc-491785d-1"})(["&&&{margin-left:7px;border-left:2px solid var(--privy-color-foreground-4);height:12px;}"]),oT=({children:t})=>p.jsxs(Yat,{children:[p.jsx(Gat,{style:{width:"16px",height:"16px"}}),t]});let Yat=ue.div.withConfig({displayName:"TodoItemWrapper",componentId:"sc-491785d-2"})(["display:flex;justify-content:flex-start;justify-items:center;text-align:left;gap:8px;&&{a{text-decoration:underline;color:var(--privy-color-accent);}svg{margin-top:auto;margin-bottom:auto;}}"]),Qat=({name:t,installLink:e})=>p.jsxs(lh,{children:[p.jsx(O_,{title:`Create a ${t} wallet`.replace(/wallet wallet/gi,"wallet"),description:"Follow the instructions below to get started."}),p.jsxs(Zat,{children:[p.jsx(oT,{children:p.jsxs("div",{children:[p.jsx("span",{children:"Install the "})," ",p.jsxs("a",{href:e,target:"_blank",children:[t," browser extension"]})]})}),p.jsx(QQ,{}),p.jsx(oT,{children:"Set up your first wallet"}),p.jsx(QQ,{}),p.jsx(oT,{children:"Store your recovery phrase in a safe place!"})]}),p.jsx(bB,{onClick:()=>window.location.reload(),style:{marginTop:"20px"},children:"Reload the page to use your wallet"})]});const Xat={component:()=>{let{navigateBack:t,data:e}=jt();if(!(e!=null&&e.installWalletModalData))throw Error("Wallet data is missing");let{walletConfig:n}=e.installWalletModalData;return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:t},"header"),p.jsx(sr,{}),p.jsx(Qat,{...n}),p.jsx(dr,{}),p.jsxs(Bn,{children:[p.jsx("span",{children:"Still not sure? "}),p.jsx("a",{target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]})]})}},Jat={component:()=>{let{ready:t}=Wn(),{data:e}=jt(),[n,r]=E.useState(!1);if(!(e!=null&&e.installWalletModalData))throw Error("Wallet data is missing");let{walletConfig:i,connectOnly:s,chainType:o}=e.installWalletModalData,a=i.getMobileRedirect({useUniversalLink:!n,isSolana:o==="solana",connectOnly:s}),c=i.name.replace(/ wallet/gi,""),l={title:`Redirecting to ${c} Mobile Wallet`,description:`We'll take you to the ${c} Mobile Wallet app to continue your login experience.`,footnote:""};return t&&(l.description=`For the best experience, we'll automatically log you into the ${c} Mobile Wallet in-app browser.`,l.footnote="You can always return here to login via other methods."),n&&(l.title="Still here?",l.description=`You may need to install the ${i.name} mobile app.`,l.footnote=`Once you're done, you can connect with ${i.name} wallet to complete the login.`),p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),p.jsx(sr,{}),p.jsx(H5,{title:l.title,description:l.description}),p.jsxs(Q1,{children:[p.jsx($st,{href:a,onClick:()=>setTimeout(()=>r(!0),1e3),loading:t&&!a,children:n?"Go to App Store":"Continue"}),l.footnote?p.jsx("p",{children:l.footnote}):null]}),p.jsx(dr,{}),p.jsx(ln,{})]})}},Kl=({provider:t,displayName:e,logo:n,connectOnly:r,connector:i})=>{var y,v;let s,{navigate:o,setModalData:a}=jt(),{connectWallet:c}=Ht(),l=xp(),u=Eh(t),d=i.connectorType==="wallet_connect_v2"?t:i.walletClientType,h=window.matchMedia("(display-mode: standalone)").matches,f=Rpe({connectorType:i.connectorType,walletClientType:d});s=f&&f.chainTypes.includes(i.chainType)?()=>{f.isInstalled||i.chainType==="solana"&&"isInstalled"in i&&i.isInstalled?(c(i,d),o(r?YO:ny)):di.isMobile?(a({installWalletModalData:{walletConfig:f,chainType:i.chainType,connectOnly:r}}),o(Jat)):(a({installWalletModalData:{walletConfig:f,chainType:i.chainType,connectOnly:r}}),o(Xat))}:i.connectorType!=="coinbase_wallet"||i.connectionOptions!=="eoaOnly"||!di.isMobile||h||Gfe()?()=>{(!HO(window.navigator.userAgent)||event!=null&&event.isTrusted)&&(c(i,d),o(r?YO:ny))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let m=e||((y=u==null?void 0:u.metadata)==null?void 0:y.shortName)||(u==null?void 0:u.name)||i.walletClientType;return p.jsxs(ect,{onClick:s,children:[p.jsx(zpe,{icon:n||((v=u==null?void 0:u.image_url)==null?void 0:v.md),name:m}),p.jsx("span",{children:m}),p.jsxs(tct,{id:"chip-container",children:[(l==null?void 0:l.walletClientType)===d&&(l==null?void 0:l.chainType)===i.chainType?p.jsx(XQ,{color:"gray",children:"Recent"}):p.jsx("span",{id:"connect-text",children:"Connect"}),i.chainType==="solana"&&p.jsx(XQ,{color:"gray",children:"Solana"})]})]})};let ect=ue(Qr).withConfig({displayName:"ConnectWalletButton",componentId:"sc-fdb6bbb9-0"})(["> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),XQ=ue(_l).withConfig({displayName:"StyledChip",componentId:"sc-fdb6bbb9-1"})(["margin-left:auto;"]),tct=ue.div.withConfig({displayName:"ChipContainer",componentId:"sc-fdb6bbb9-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const nct=["coinbase_wallet"];let rct=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","ronin_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom"];const ict=["safe"],sct=["phantom","backpack","solflare","universal_profile"],TB=({wallets:t})=>{let{app:e}=jt();return t.length===0?p.jsx(C8,{chainType:e.appearance.walletChainType,withPadding:!0}):p.jsx(p.Fragment,{children:t})},I1=({walletList:t,walletChainType:e,connectors:n,connectOnly:r,ignore:i,walletConnectEnabled:s,forceWallet:o})=>{var h,f;let a=[],c=[],l=[],u=n.filter(m=>e==="ethereum-only"?m.chainType==="ethereum":e!=="solana-only"||m.chainType==="solana"),d=u.find(m=>m.connectorType==="wallet_connect_v2");for(let[m,y]of(o?[o.wallet]:t).entries()){if(y==="detected_ethereum_wallets"||y==="detected_wallets")for(let[v,b]of u.filter(({chainType:C,connectorType:x,walletClientType:_})=>C!=="solana"&&(_==="uniswap_wallet_extension"||_==="uniswap_extension"?!i.includes("uniswap"):_==="crypto.com_wallet_extension"||_==="crypto.com_onchain"?!i.includes("cryptocom"):x==="injected"&&!i.includes(_))).entries()){let{walletClientType:C,walletBranding:x,chainType:_}=b;(C==="unknown"?c:a).push(p.jsx(Kl,{connectOnly:r,provider:C,logo:x.icon,displayName:x.name,connector:b},`${m}-${y}-${C}-${_}-${v}`))}if(y==="detected_solana_wallets"||y==="detected_wallets")for(let[v,b]of u.filter(({chainType:C,walletClientType:x})=>{if(C==="solana")return e!=="ethereum-only"&&!i.includes(x)}).entries()){let{walletClientType:C,walletBranding:x,chainType:_}=b;(C==="unknown"?c:a).push(p.jsx(Kl,{connectOnly:r,provider:C,logo:x.icon,displayName:x.name,connector:b},`${m}-${y}-${C}-${_}-${v}`))}if(sct.includes(y)){let v=u.find(b=>b.connectorType==="injected"&&b.walletClientType===y||b.connectorType===y);if(v&&a.push(p.jsx(Kl,{connectOnly:r,provider:y,connector:v},`${m}-${y}`)),e==="solana-only"||e==="ethereum-and-solana"){let b=u.find(({chainType:C,walletClientType:x})=>C==="solana"&&x===y);b&&a.push(p.jsx(Kl,{connectOnly:r,provider:y,connector:b},`${y}-solana`))}}else if(rct.includes(y)){let v=u.find(b=>y==="uniswap"?b.walletClientType==="uniswap_wallet_extension"||b.walletClientType==="uniswap_extension":y==="cryptocom"?b.walletClientType==="crypto.com_wallet_extension"||b.walletClientType==="crypto.com_onchain":b.connectorType==="injected"&&b.walletClientType===y);if(s&&!v&&(v=d),v&&a.push(p.jsx(Kl,{connectOnly:r,provider:y,connector:v,logo:v.connectorType==="injected"?v.walletBranding.icon:void 0,displayName:v.connectorType==="injected"?v.walletBranding.name:void 0},`${m}-${y}`)),e==="solana-only"||e==="ethereum-and-solana"){let b=u.find(({chainType:C,walletClientType:x})=>C==="solana"&&x===y);b&&a.push(p.jsx(Kl,{connectOnly:r,provider:y,connector:b},`${y}-solana`))}}else if(nct.includes(y)){let v=u.find(({connectorType:b})=>b===y);v&&a.push(p.jsx(Kl,{connectOnly:r,provider:y,connector:v},`${m}-${y}`))}else if(ict.includes(y))d&&l.push(p.jsx(Kl,{connectOnly:r,provider:y,connector:d},`${m}-${y}`));else if(y==="wallet_connect")d&&l.push(p.jsx(Kl,{connectOnly:r,provider:y,connector:d,logo:d.walletBranding.icon,displayName:"Wallet Connect"},`${m}-${y}`));else if(y===(o==null?void 0:o.wallet)){let v=o.chainType==="ethereum"&&t.includes("detected_ethereum_wallets"),b=o.chainType==="solana"&&t.includes("detected_solana_wallets");if(t.includes("detected_wallets")||v||b){let C=u.find(({walletClientType:x})=>x===y);C&&a.push(p.jsx(Kl,{connectOnly:r,provider:y,displayName:(h=C.walletBranding)==null?void 0:h.name,logo:(f=C.walletBranding)==null?void 0:f.icon,connector:C},`${m}-${y}`))}}}return[...c,...a,...l]},H0e={component:()=>{var a,c,l;let{app:t,data:e}=jt(),n=Vr(),r=(a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.suggestedAddress,i=r?p.jsxs("span",{children:["Connect the wallet with address ",p.jsx(zi,{showCopyIcon:!1,address:r})," ",t!=null&&t.name?`to ${t.name}.`:"."]}):`Connect a wallet to your ${t==null?void 0:t.name} account`,{connectors:s}=Ht(),o=I1({walletList:((c=e==null?void 0:e.externalConnectWallet)==null?void 0:c.walletList)??t.appearance.walletList,walletChainType:((l=e==null?void 0:e.externalConnectWallet)==null?void 0:l.walletChainType)??t.appearance.walletChainType,connectors:s,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),o.length>0&&p.jsx(O_,{title:"Connect your wallet",description:i}),p.jsx(wB,{$colorScheme:n.appearance.palette.colorScheme,children:p.jsx(TB,{wallets:o})}),t&&p.jsx(yB,{app:t,alwaysShowImplicitConsent:!0}),p.jsx(ln,{})]})}},V0e=E.createContext({app:jpe,currentScreen:null,lastScreen:null,navigate:Le,navigateBack:Le,resetNavigation:Le,setModalData:Le,onUserCloseViaDialogOrKeybindRef:void 0});let oct=[mo,H0e,null];const act=t=>{var a;let e=Vr(),n=t.authenticated,[r,i]=E.useState(t.initialScreen);E.useEffect(()=>{n||oct.includes(t.initialScreen)||t.setInitialScreen(null)},[n]);let s=E.useRef(null);E.useEffect(()=>{t.open||(s.current=null)},[t.open]),E.useEffect(()=>{s.current=null},[t.initialScreen]);let o={app:e,data:t.data,setModalData:t.setModalData,currentScreen:t.initialScreen,lastScreen:r,navigate:(c,l=!0)=>{t.setInitialScreen(c),l&&i(t.initialScreen)},navigateBack:()=>{t.setInitialScreen(r)},resetNavigation:()=>{t.setInitialScreen(null),i(null)},onUserCloseViaDialogOrKeybindRef:s};return p.jsxs(V0e.Provider,{value:o,children:[(typeof e.appearance.logo=="str
197ing"||((a=e.appearance.logo)==null?void 0:a.type)==="img")&&p.jsx(nst,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},jt=()=>E.useContext(V0e);class ry extends H2{async initialize(){var r,i,s,o,a;let e=await this.createProvider();this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session&&((i=(r=this.walletProvider)==null?void 0:r.session)!=null&&i.peer.metadata.url&&(this.walletEntry=YI((o=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:o.peer.metadata.url),this.walletClientType=((a=this.walletEntry)==null?void 0:a.slug)||"unknown"),this.connected=!0,await this.syncAccounts()),this.initialized=!0,this.emit("initialized");let{WalletConnectModal:n}=await mr(()=>import("./index-B7ATm0e3.js").then(c=>c.i),[]);this.modal=new n({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"},explorerRecommendedWalletIds:Uit}),this.modal.subscribeModal(c=>{var l;c.open||(l=this.walletProvider)!=null&&l.session||!this.onQrModalClosed||this.onQrModalClosed()})}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){var e;return!!((e=this.walletProvider)!=null&&e.connected)}get walletBranding(){var n,r,i,s,o,a,c;let e=(i=(r=(n=this.walletProvider)==null?void 0:n.session)==null?void 0:r.peer.metadata.icons)==null?void 0:i[0];return{name:Lit(((o=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:o.peer.metadata.name)||"")||"WalletConnect",icon:typeof e=="string"?e:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0x
197Mi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",id:((c=(a=this.walletProvider)==null?void 0:a.session)==null?void 0:c.peer.metadata.name.toLowerCase())||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(kQ)}catch{}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((e,n)=>{this.onQrModalClosed=()=>{n(new kpe)},(async()=>{var s,o,a,c,l,u;let r="",i=await Promise.race([(s=this.walletProvider)==null?void 0:s.enable(),this.proxyProvider.walletTimeout()]);if(i!=null&&i.length&&(r=i[0]),!r||r==="")throw new li("Unable to retrieve address");(a=(o=this.walletProvider)==null?void 0:o.session)!=null&&a.peer.metadata.url&&(this.walletEntry=YI((l=(c=this.walletProvider)==null?void 0:c.session)==null?void 0:l.peer.metadata.url),this.walletClientType=((u=this.walletEntry)==null?void 0:u.slug)||"unknown",this.proxyProvider.rpcTimeoutDuration=fB(this.rpcConfig,this.walletClientType)),this.connected=!0,await this.syncAccounts(i),e()})().catch(r=>{n(r?Z1(r):new li("Unknown error during connection"))}).finally(()=>{var r;return(r=this.modal)==null?void 0:r.closeModal()})})}disconnect(){var e;(e=this.walletProvider)==null||e.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let s of this.chains){let o=Fit(s.id,this.chains,this.rpcConfig,this.privyAppId);o&&(e[s.id]=o)}let n=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],r=this.chains.map(s=>s.id),i=await oXe.init({projectId:this.walletConnectCloudProjectId,chains:n,optionalChains:r,optionalEvents:the,optionalMethods:ehe,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",s=>{var o,a,c,l,u;if(i.signer.abortPairingAttempt(),this.walletEntry){let{redirect:d,href:h}=function(m,y){let v=AQ(y);if(v.deepLink)return Xfe(v.deepLink,m);if(v.universalLink)return MO(v.universalLink,m);throw new ve(`Unsupported wallet ${y.id}`)}(s,this.walletEntry);(function({href:m,name:y}){try{localStorage.setItem(kQ,JSON.stringify({href:m,name:y}))}catch{}})({href:h,name:((o=this.walletEntry.metadata)==null?void 0:o.shortName)||this.walletEntry.name}),this.redirectUri=d;let f=function(m,y){let v=AQ(y);if(v.universalLink)return MO(v.universalLink,m)}(s,this.walletEntry);f!=null&&f.redirect&&(this.fallbackUniversalRedirectUri=f.redirect),di.isMobile?(Jfe(d,"_self"),(a=this.showPrivyQrModal)==null||a.call(this,{native:d,universal:this.fallbackUniversalRedirectUri})):this.showPrivyQrModal?(c=this.showPrivyQrModal)==null||c.call(this,{native:d,universal:this.fallbackUniversalRedirectUri}):(l=this.modal)==null||l.openModal({uri:s,chains:[this.defaultChain.id]})}else(u=this.modal)==null||u.openModal({uri:s,chains:[this.defaultChain.id]})}),i.on("connect",()=>{var s,o,a,c;(s=this.modal)==null||s.closeModal(),(o=i.session)!=null&&o.peer.metadata.url&&(this.walletEntry=YI((a=i.session)==null?void 0:a.peer.metadata.url),this.walletClientType=((c=this.walletEntry)==null?void 0:c.slug)||"unknown")}),i}async enableProvider(){var e,n;return(e=this.walletProvider)!=null&&e.connected?Promise.resolve(this.walletProvider.accounts):await((n=this.walletProvider)==null?void 0:n.enable())}setWalletEntry(e,n){this.walletEntry=e,this.showPrivyQrModal=n}constructor(e,n,r,i,s,o,a,c){super(c||"unknown",r,i,n),this.connectorType="wallet_connect_v2",this.privyAppId=o,this.privyAppName=a,this.walletConnectCloudProjectId=e,this.rpcConfig=n,this.shouldEnforceDefaultChainOnConnect=s,this.proxyProvider=new Y1(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=(l=>P_.getState().listings.find(({slug:u})=>D9(u)===D9(l)))(c),this.walletClientType=c)}}const aT=({label:t,children:e,valueStyles:n})=>p.jsxs(cct,{children:[p.jsx("div",{children:t}),p.jsx(lct,{style:{...n},children:e})]});
197let cct=ue.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),lct=ue.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]),uct=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),q0e=t=>uct.format(t);const K0e=(t,e)=>{let n=q0e(e*parseFloat(t));return n!=="$0.00"?n:"<$0.01"},i1=(t,e)=>{let n=q0e(e*parseFloat(j1(t)));return n==="$0.00"?"<$0.01":n},bl=(t,e,n=6,r=!1)=>`${G0e(t,n,r)} ${e}`,G0e=(t,e=6,n=!1)=>{let r=parseFloat(j1(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"");return n?r:`${r==="0"?"<0.001":r}`},PB=t=>t.reduce((e,n)=>e+n,0n),dct=(t,e)=>{let{chains:n}=Ht(),r=`https://etherscan.io/address/${e}`,i=`${((s,o)=>{var l;let a=Number(s),c=o.find(u=>u.id===a);if(!c)throw new li(`Unsupported chainId ${s}`,4901);return(l=c.blockExplorers)==null?void 0:l.default.url})(t,n)}/address/${e}`;if(!i)return r;try{new URL(i)}catch{return r}return i};async function cT(t){try{return await t}catch{}}let hct=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function np(t,e=6,n=!1,r=!1){let i=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),s=r?"":" SOL";return n?`${i}${s}`:`${i==="0"?"<0.001":i}${s}`}function xb(t,e){let n=parseFloat(t.toString())/1e9,r=hct.format(e*n);return r==="$0.00"?"<$0.01":r}function Z0e({amount:t,fee:e,tokenPrice:n}){let r=BigInt(1e9*parseFloat(t)),i=r+e;return{fundingAmountInBaseUnit:r,fundingAmountInUsd:n?xb(r,n):void 0,totalPriceInUsd:n?xb(i,n):void 0,totalPriceInNativeCurrency:np(i),feePriceInNativeCurrency:np(e),feePriceInUsd:n?xb(e,n):void 0}}function p3(t){return"version"in t}function fct(t,e){let n=(p3(t)?t.message:t.compileMessage()).staticAccountKeys.find(r=>r.toBase58()===e);if(!n)throw Error(`Transaction does not contain public key ${e}`);return n}function H9(t,e,n){var r;return{signature:t,parsedTransaction:n??null,signedTransaction:e,fees:BigInt(((r=n==null?void 0:n.meta)==null?void 0:r.fee)||0)}}async function pct(t,e){var r;let{value:n}=await e.simulateTransaction(t);if(n.err==="BlockhashNotFound")throw Error("Simulation failed: Blockhash not found");return n.err==null&&((r=n.logs)==null?void 0:r.every(i=>!/insufficient funds/gi.test(i)))}async function gct({tx:t,connection:e,client:n}){var u,d,h,f;let r=p3(t)?t.message:t.compileMessage(),i=((u=r.staticAccountKeys[0])==null?void 0:u.toBase58())??"",s=await async function(m,y){return BigInt((p3(m)?(await y.getFeeForMessage(m.message)).value:await m.getEstimatedFee(y))??0)}(t,e),o={},a={},c=[];for(let m of r.compiledInstructions){let y=((d=r.staticAccountKeys[m.programIdIndex])==null?void 0:d.toBase58())||"";if(y!=="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"&&y!=="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb")if(y!=="11111111111111111111111111111111")if(y!=="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL")c.push({type:"unknown",program:y});else{let v=await cT(function(b,C){let[x,_,$,I]=b.accountKeyIndexes.map(R=>C.staticAccountKeys[R]);if(!(x&&_&&$&&I))throw Error("Failed to parse ATA creation instruction");return{type:"ata-creation",payer:x.toBase58(),ata:_.toBase58(),owner:$.toBase58(),mint:I.toBase58()}}(m,r));if(!v)continue;c.push(v),a[v.ata]={owner:v.owner,mint:v.mint}}else{let v=await cT(yct(m,r));if(!v)continue;c.push(v)}else{let v=await cT(mct(m,r,e,n,o,a));if(!v)continue;c.push(v),o[v.token.address]=v.token,a[h=v.fromAta]??(a[h]={owner:v.fromAccount,mint:v.token.address}),v.toAccount&&(a[f=v.toAta]??(a[f]={owner:v.toAccount,mint:v.token.address}))}}let l=c.filter(({type:m})=>["spl-transfer","sol-transfer"].includes(m));return{spender:i,fee:s,instructions:l.length?l:c}}function Y0e(t,e){try{return function(r,i=0){let s=0n;for(let o=0;o<8;o++)s|=BigInt(r[i+o])<<BigInt(8*o);return s}(t,e)}catch{}try{return t.readBigInt64LE(e)}catch{}let n=Buffer.from(t);try{return((r,i=0)=>{let s=r[i],o=r[i+7];if(!s||!o)throw Error(`Buffer offset out of range: first: ${s}, last: ${o}.`);return(BigInt(r[i+4]+256*r[i+5]+65536*r[i+6]+(o<<24))<<32n)+BigInt(s+256*r[++i]+65536*r[++i]+16777216*r[++i])})(n)}catch{}try{return n.subarray(e).readBigInt64LE()}catch{}try{return n.readBigInt64LE(e)}catch{}return 0n}async function mct(t,e,n,r,i,s){var v,b,C,x,_,$,I,R,N,T,O;let o,a,[c,l,u]=t.accountKeyIndexes.map(U=>e.staticAccountKeys[U]);if(!c||!l||!u)throw Error("Failed to parse SPL transfer instruction");let d="",h=s[l.toBase58()];if(h)o=h.owner,d=h.mint;else{let U=await n.getParsedAccountInfo(l,"confirmed"),z=(v=U.value)==null?void 0:v.data;o=(C=(b=z==null?void 0:z.parsed)==null?void 0:b.info)==null?void 0:C.owner,d=((_=(x=z==null?void 0:z.parsed)==null?void 0:x.info)==null?void 0:_.mint)??"",a=(R=(I=($=z==null?void 0:z.parsed)==null?void 0:$.info)==null?void 0:I.tokenAmount)==null?void 0:R.decimals}if(!d){let U=await n.getParsedAccountInfo(c,"confirmed"),z=(N=U.value)==null?void 0:N.data;d=((O=(T=z==null?void 0:z.parsed)==null?void 0:T.info)==null?void 0:O.mint)??""}let f=i[d];if(d&&!f){let U=await r.getSplTokenMetadata({mintAddress:d,cluster:R_(n.rpcEndpoint)});U&&(f={address:d,symbol:U.symbol,decimals:U.decimals})}let m=(f==null?void 0:f.symbol)??"";a??(a=(f==null?void 0:f.decimals)??9);let y=Y0e(t.data,1);return{type:"spl-transfer",fromAta:c.toBase58(),fromAccount:u.toBase58(),toAta:l.toBase58(),toAccount:o,value:y,token:{symbol
197:m,decimals:a,address:d}}}async function yct(t,e){let[n,r]=t.accountKeyIndexes.map(s=>e.staticAccountKeys[s]);if(!n||!r)throw Error("Failed to parse SOL transfer instruction");let i=Y0e(t.data,4);return{type:"sol-transfer",fromAccount:n.toBase58(),toAccount:r.toBase58(),value:i,token:{symbol:"SOL",decimals:9}}}const wct=({weiQuantities:t,tokenPrice:e,tokenSymbol:n})=>{let r=PB(t),i=e?i1(r,e):void 0,s=bl(r,n);return p.jsx(RB,{children:i||s})},Q0e=({weiQuantities:t,tokenPrice:e,tokenSymbol:n})=>{let r=PB(t),i=e?i1(r,e):void 0,s=bl(r,n);return p.jsx(RB,{children:i?p.jsxs(p.Fragment,{children:[p.jsx(vct,{children:"USD"}),i==="<$0.01"?p.jsxs(J0e,{children:[p.jsx(X0e,{children:"<"}),"$0.01"]}):i]}):s})},QO=({quantities:t,tokenPrice:e,tokenSymbol:n="SOL",tokenDecimals:r=9})=>{let i=t.reduce((a,c)=>a+c,0n),s=e&&n==="SOL"&&r===9?xb(i,e):void 0,o=n==="SOL"&&r===9?np(i):`${us(i,r)} ${n}`;return p.jsx(RB,{children:s?p.jsx(p.Fragment,{children:s==="<$0.01"?p.jsxs(J0e,{children:[p.jsx(X0e,{children:"<"}),"$0.01"]}):s}):o})};let RB=ue.span.withConfig({displayName:"StyledPriceDisplay",componentId:"sc-596cd423-0"})(["font-size:14px;line-height:140%;display:flex;gap:4px;align-items:center;"]),vct=ue.span.withConfig({displayName:"StyledPriceUnit",componentId:"sc-596cd423-1"})(["font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);"]),X0e=ue.span.withConfig({displayName:"TinyLessThan",componentId:"sc-596cd423-2"})(["font-size:10px;"]),J0e=ue.span.withConfig({displayName:"FlexCenter",componentId:"sc-596cd423-3"})(["display:flex;align-items:center;"]);const bct=({gas:t,tokenPrice:e,tokenSymbol:n})=>p.jsxs(D_,{style:{paddingBottom:"12px"},children:[p.jsxs(e1e,{children:[p.jsx(n1e,{children:"Est. Fees"}),p.jsx("div",{children:p.jsx(Q0e,{weiQuantities:[BigInt(t)],tokenPrice:e,tokenSymbol:n})})]}),e&&p.jsx(t1e,{children:`${bl(BigInt(t),n)}`})]}),xct=({value:t,gas:e,tokenPrice:n,tokenSymbol:r})=>{let i=BigInt(t??0)+BigInt(e);return p.jsxs(D_,{children:[p.jsxs(e1e,{children:[p.jsx(n1e,{children:"Total (including fees)"}),p.jsx("div",{children:p.jsx(Q0e,{weiQuantities:[BigInt(t||0),BigInt(e)],tokenPrice:n,tokenSymbol:r})})]}),n&&p.jsx(t1e,{children:bl(i,r)})]})};let e1e=ue.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),t1e=ue.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-f8ef9b74-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),n1e=ue.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const J5=E.createContext(void 0),Q_=E.createContext(void 0),Ect=({defaultValue:t,children:e})=>{let[n,r]=E.useState(t||null);return p.jsx(J5.Provider,{value:{activePanel:n,togglePanel:i=>{r(n===i?null:i)}},children:p.jsx(kct,{children:e})})},Cct=({value:t,children:e})=>{let{activePanel:n,togglePanel:r}=E.useContext(J5),i=n===t;return p.jsx(Q_.Provider,{value:{onToggle:()=>r(t),value:t},children:p.jsx(Pct,{isActive:i,"data-open":i,children:e})})},_ct=({children:t})=>{let{activePanel:e}=E.useContext(J5),{onToggle:n,value:r}=E.useContext(Q_),i=e===r;return p.jsxs(p.Fragment,{children:[p.jsxs($ct,{onClick:n,"data-open":i,children:[p.jsx(Tct,{children:t}),p.jsx(Mct,{isactive:i,children:p.jsx(x_,{height:"16px",width:"16px",strokeWidth:"2"})})]}),p.jsx(Ict,{})]})},Sct=({children:t})=>{let{activePanel:e}=E.useContext(J5),{value:n}=E.useContext(Q_);return p.jsx(Rct,{"data-open":e===n,children:p.jsx(r1e,{children:t})})},Act=({children:t})=>{let{activePanel:e}=E.useContext(J5),{value:n}=E.useContext(Q_);return p.jsx(r1e,{children:typeof t=="function"?t({isActive:e===n}):t})};let kct=ue.div.withConfig({displayName:"AccordionRoot",componentId:"sc-281bf545-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),$ct=ue.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-281bf545-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),Ict=ue.div.withConfig({displayName:"AccordionDivider",componentId:"sc-281bf545-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),Tct=ue.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-281bf545-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),Pct=ue.div.withConfig({displayName:"AccordionPanelContainer",componentId:"sc-281bf545-4"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;padding:12px;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),Rct=ue.div.withConfig({displayName:"AccordionContentContainer",componentId:"sc-281bf545-5"})(["position:relative;overflow:hidden;transition:max-height 25ms ease-out;&[data-open='true']{max-height:700px;}&[data-open='false']{max-height:0;}"]),r1e=ue.div.withConfig({displayName:"ContentWrapper",componentId:"sc-281bf545-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),Mct=ue.div.withConfig({displayName:"IconWrapper",componentId:"sc-281bf545-7"})(["transform:",";"],t=>t.isactive?"rotate(180deg)":"rotate(0deg)");
197const Om=({walletAddress:t,chainId:e=1,network:n,rpcEndpoint:r})=>p.jsx(Oct,{href:n==="ethereum"?dct(e,t):sst(t,R_(r||"")),target:"_blank",children:po(t)});let Oct=ue.a.withConfig({displayName:"StyledLink",componentId:"sc-adda23e5-0"})(["&:hover{text-decoration:underline;}"]);const i1e=({from:t,to:e,txn:n,transactionInfo:r,tokenPrice:i,gas:s,tokenSymbol:o})=>{let a=BigInt((n==null?void 0:n.value)||0);return p.jsx(Ect,{...Vr().render.standalone?{defaultValue:"details"}:{},children:p.jsxs(Cct,{value:"details",children:[p.jsx(_ct,{children:p.jsxs(jct,{children:[p.jsx("div",{children:(r==null?void 0:r.title)||"Details"}),p.jsx(Nct,{children:p.jsx(wct,{weiQuantities:[a],tokenPrice:i,tokenSymbol:o})})]})}),p.jsxs(Sct,{children:[p.jsx(aT,{label:"From",children:p.jsx(Om,{walletAddress:t,chainId:n.chainId||1,network:"ethereum"})}),p.jsx(aT,{label:"To",children:p.jsx(Om,{walletAddress:e,chainId:n.chainId||1,network:"ethereum"})}),r&&r.action&&p.jsx(aT,{label:"Action",children:r.action}),s&&p.jsx(bct,{value:n.value,gas:s,tokenPrice:i,tokenSymbol:o})]}),p.jsx(Act,{children:({isActive:c})=>p.jsx(xct,{value:n.value,displayFee:c,gas:s||"0x0",tokenPrice:i,tokenSymbol:o})})]})})};let jct=ue.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-29499c17-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),Nct=ue.div.withConfig({displayName:"TotalText",componentId:"sc-29499c17-1"})(["flex-shrink:0;padding-left:8px;"]);const s1e=({enabled:t=!0}={})=>{let{showFiatPrices:e,getUsdPriceForSol:n}=Ht(),[r,i]=E.useState(!0),[s,o]=E.useState(void 0),[a,c]=E.useState(void 0);return E.useEffect(()=>{(async()=>{if(e&&t)try{i(!0);let l=await n();l?c(l):o(Error("Unable to fetch SOL price"))}catch(l){o(l)}finally{i(!1)}else i(!1)})()}
197,[]),{solPrice:a,isSolPriceLoading:r,solPriceError:s}};function K2(t){let{tokenPrice:e,isTokenPriceLoading:n,tokenPriceError:r}=(a=>{let{showFiatPrices:c,getUsdTokenPrice:l,chains:u}=Ht(),[d,h]=E.useState(!0),[f,m]=E.useState(void 0),[y,v]=E.useState(void 0);return E.useEffect(()=>{a||(a=1);let b=gB(u).find(C=>C.id===Number(a));(async()=>{if(c){if(!b)return h(!1),void m(Error(`Unable to fetch token price on chain id ${a}`));try{h(!0);let C=await l(b);C?v(C):m(Error(`Unable to fetch token price on chain id ${b.id}`))}catch(C){m(C)}finally{h(!1)}}else h(!1)})()},[a]),{tokenPrice:y,isTokenPriceLoading:d,tokenPriceError:f}})(t==="solana"?-1:t),{solPrice:i,isSolPriceLoading:s,solPriceError:o}=s1e({enabled:t==="solana"});return t==="solana"?{tokenPrice:i,isTokenPriceLoading:s,tokenPriceError:o}:{tokenPrice:e,isTokenPriceLoading:n,tokenPriceError:r}}const o1e=E.createContext(null);function Ap(){let t=E.useContext(o1e);return t===null?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):t}async function MB(t,e,n){let r=Tpe(t),i=await e.prepareTransactionRequest({...r,account:{address:n,type:"json-rpc"}});return{...i,type:Jit[i.type]}}async function a1e({accessToken:t,entropyId:e,entropyIdVerifier:n,transactingWallet:r,walletProxy:i,transactionRequest:s,publicClient:o,requesterAppId:a}){let c=await XO({accessToken:t,entropyId:e,entropyIdVerifier:n,transactingWallet:r,walletProxy:i,transactionRequest:s,requesterAppId:a});return await o.sendRawTransaction({serializedTransaction:c})}async function XO({accessToken:t,entropyId:e,entropyIdVerifier:n,transactingWallet:r,walletProxy:i,transactionRequest:s,requesterAppId:o}){return(await i.rpc({entropyId:e,entropyIdVerifier:n,hdWalletIndex:r.walletIndex??0,chainType:"ethereum",accessToken:t,requesterAppId:o,request:{method:"eth_signTransaction",params:[s]}})).response.data}const X_=()=>window.open(void 0,void 0,Dct({w:440,h:680}));let Dct=({w:t,h:e})=>{let n=window.screenLeft!==void 0?window.screenLeft:window.screenX,r=window.screenTop!==void 0?window.screenTop:window.screenY,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,s=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;return`toolbar=0,location=0,menubar=0,height=${e},width=${t},popup=1,left=${(i-t)/2/(i/window.screen.availWidth)+n},top=${(s-e)/2/(s/window.screen.availHeight)+r}`};const c1e=({children:t,theme:e})=>p.jsxs(Lct,{$theme:e,children:[p.jsx(TJe,{width:"1.25rem",color:e==="dark"?"var(--privy-color-accent-light)":"var(--privy-color-accent-dark)",style:{minWidth:"1.25rem"}}),t]});let Lct=ue.div.withConfig({displayName:"Container",componentId:"sc-dc8a0871-0"})(["display:flex;gap:0.5rem;background-color:",";color:var(--privy-color-foreground);align-items:flex-start;text-align:left;font-size:0.8125rem;font-weight:400;line-height:1.125rem;padding:0.75rem;&&{border-radius:var(--privy-border-radius-sm);border:1px solid var(--privy-color-accent);}"],t=>t.$theme==="dark"?"var(--privy-color-accent-darkest)":"var(--privy-color-accent-lightest)");const Bct=ue.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]),Fct=ue.span.withConfig({displayName:"LabelXs",componentId:"sc-4c43f9fd-0"})(["color:var(--privy-color-foreground-3);font-size:0.75rem;font-weight:500;line-height:1.125rem;"]),l1e=gs(["&&{border-width:1px;padding:0.5rem 1rem;}width:100%;text-align:left;border:solid 1px var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);display:flex;justify-content:space-between;align-items:center;",""],t=>t.$state==="error"?"border-color: var(--privy-color-error);":""),OB=ue.div.withConfig({displayName:"Box",componentId:"sc-1660059c-0"})(["",""],l1e),J_=({errMsg:t,balance:e,address:n,isLoading:r,className:i,title:s,isPulsing:o,showIcon:a,statusColor:c="green"})=>{let l;return l=c||(t?"red":"green"),p.jsxs(p.Fragment,{children:[p.jsxs(OB,{className:i,$state:t?"error":void 0,children:[p.jsxs(Bct,{children:[p.jsx(Fct,{children:s||"Pay with"}),p.jsx(zi,{address:n,showCopyIcon:a||!!t})]}),e!==void 0&&p.jsx(_l,{isLoading:r,isPulsing:o,color:l,children:e})]}),t&&p.jsx(hh,{style:{marginTop:"0.25rem"},children:t})]})};function u1e({rpcConfig:t,appId:e,address:n,chain:r}){let{chains:i}=Ht(),[s,o]=E.useState(0n),[a,c]=E.useState(!1),l=E.useMemo(()=>{let d=r||i[0];if(d)return ap({chain:r,transport:Un(oh(d,t,e))})},[r,t,e]),u=E.useCallback(async()=>
197{if(!n||!l)return;c(!0);let d=await l.getBalance({address:n}).catch(console.error);return d?(o(d),c(!1),d):void 0},[l,n,o]);return E.useEffect(()=>{u().catch(console.error)},[]),{balance:s,isLoading:a,reloadBalance:u}}const kl="sdk_fiat_on_ramp_completed_with_status",d1e=async({chain:t,address:e,appId:n,rpcConfig:r,erc20Address:i})=>({balance:await ap({chain:t,transport:Un(oh(t,r,n))}).readContract({address:i,abi:Uct,functionName:"balanceOf",args:[e]}).catch(()=>0n),chain:t});let Uct=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}],h1e=E.createContext({plugins:{current:{}}});const zct=({children:t})=>{let e=E.useRef({});return p.jsx(h1e.Provider,{value:{plugins:e},children:t})},ex=()=>{let{plugins:t}=E.useContext(h1e);return E.useCallback(e=>t.current[e],[t])},tx=Symbol("solana-funding-plugin"),nx=()=>{let{exportSolanaWallet:t,createEmbeddedSolanaWallet:e,solanaWallets:n,embeddedSolanaWallets:r}=Ht(),{ready:i}=Ap();return{ready:i,createWallet:e,exportWallet:t,wallets:n.concat(r??[])}},Wct=({children:t,theme:e})=>p.jsxs(Hct,{$theme:e,children:[p.jsx(Uu,{width:"3rem",color:"var(--privy-color-error)"}),t]});let Hct=ue.div.withConfig({displayName:"Container",componentId:"sc-5400b18f-0"})(["display:flex;gap:0.5rem;"," align-items:flex-start;text-align:left;padding:0.5rem 0.75rem;font-size:0.75rem;font-weight:400;line-height:1.125rem;padding:0.5rem 0.75rem;&&{border:1px solid var(--privy-color-error);border-radius:var(--privy-border-radius-sm);}"],t=>t.$theme==="dark"?"color: var(--privy-color-error);":"background-color: var(--privy-color-error-light);");const Vct=t=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...t,children:p.jsx("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),qct=t=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[p.jsx("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),p.jsx("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),p.jsx("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),p.jsx("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),p.jsx("path",{style:{fill:"#34A853"}
197,d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),p.jsx("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),p.jsx("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),JQ=t=>{let[e,n]=E.useState();return E.useEffect(()=>{t().then(r=>{n(r)}).catch(()=>{})},[]),e},Kct=({...t})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...t,children:[p.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),p.jsx("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),p.jsx("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]}),f1e=async({address:t,chain:e,rpcConfig:n,privyAppId:r})=>{try{let i=ap({chain:e,transport:Un(oh(e,n,r))}),[s,o]=await Promise.all([i.readContract({abi:eX,address:t,functionName:"symbol"}),i.readContract({abi:eX,address:t,functionName:"decimals"})]);return{decimals:o,symbol:s}}catch(i){return console.log(i),null}};let eX=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];const G2=({size:t})=>p.jsx(Gct,{$size:t,children:p.jsxs(Zct,{children:[p.jsx(Yct,{}),p.jsx(Qct,{})]})});let Gct=ue.div.withConfig({displayName:"LoadingContainer",componentId:"sc-3ddaba1c-0"})(["--spinner-size:",";display:flex;justify-content:center;align-items:center;flex-grow:1;@media all and (display-mode:standalone){margin-bottom:30px;}"],t=>t.$size?t.$size:"96px"),Zct=ue.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-3ddaba1c-1"})(["position:relative;height:var(--spinner-size);width:var(--spinner-size);opacity:1;animation:fadein 200ms ease;"]),Yct=ue.div.withConfig({displayName:"CircleFixed",componentId:"sc-3ddaba1c-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);&&{border:4px solid #f1f2f9;border-radius:50%;}"]),Qct=ue.div.withConfig({displayName:"CircleRotate",componentId:"sc-3ddaba1c-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:#cbcde1 transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const Z2=ue.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),$n=ue.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),An=ue.span.withConfig({displayName:"LabelSm",componentId:"sc-6c002d6-0"})(["color:var(--privy-color-foreground-3);font-size:0.875rem;font-weight:400;line-height:1.375rem;"]),Xct=ue(An).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),jn=ue.span.withConfig({displayName:"Value",componentId:"sc-72aa026-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;",""],j_),Jct=t=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...t,children:[p.jsxs("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[p.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),p.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),p.jsx("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),p.jsxs("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[p.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),p.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),p.jsx("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),p.jsxs("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[p.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),p.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),p.jsx("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]});let elt={[k_.id]:t=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...t,children:p.jsx("g",{id:"Layer_x0020_1",children:p.jsxs("g",{id:"_2405588477232",children:[p.jsx("rect",{fill:"none",width:"2500",height:"2500"}),p.jsx("g",{children:p.jsxs("g",{children:[p.jsx("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),p.jsx("g",{children:p.jsxs("g",{children:[p.jsx("g",{children:p.jsx("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),p.jsx("g",{children:p.jsx("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),p.jsx("g",{children:p.jsx("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),p.jsx("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),p.jsxs("g",{children:[p.jsx("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),p.jsx("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),[hB.id]:t=>p.jsxs("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),[$_.id]:t=>p.jsxs("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),p.jsx("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),[vpe.id]:t=>p.jsxs("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),p.jsx("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),[bpe.id]:t=>p.jsxs("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("rect",{width:"199.4",height:"207.623",fill:"#121212"}),p.jsxs("g",{"clip-path":"url(#clip0_2303_643)",children:[p.jsx("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),p.jsx("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_2303_643",children:p.jsx("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),[W5.id]:t=>p.jsxs("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackgroun
197d:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...t,children:[p.jsx("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),p.jsx("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),p.jsx("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),p.jsx("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),p.jsx("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),[I_.id]:t=>p.jsxs("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),p.jsx("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),p.jsx("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),[T_.id]:t=>p.jsxs("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),p.jsx("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),[_pe.id]:t=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...t,children:[p.jsx("g",{clipPath:"url(#clip0)",children:p.jsx("g",{clipPath:"url(#clip1)",children:p.jsx("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),p.jsxs("defs",{children:[p.jsxs("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[p.jsx("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),p.jsx("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),p.jsx("stop",{offset:"0.4982",stopColor:"#4281D3"}),p.jsx("stop",{offset:"0.666667",stopColor:"#2E427D"}),p.jsx("stop",{offset:"0.822917",stopColor:"#230101"}),p.jsx("stop",{offset:"1",stopColor:"#8F6B40"})]}),p.jsx("clipPath",{id:"clip0",children:p.jsx("rect",{width:"30",height:"30",fill:"white"})}),p.jsx("clipPath",{id:"clip1",children:p.jsx("rect",{width:"30",height:"30",fill:"white"})})]})]})};const p1e=({chainId:t,...e})=>{if(t==="solana")return p.jsx(Jct,{...e});let n=elt[t];return p.jsx(n||fhe,{...e})},eS=({wallet:t,displayName:e,addressToFund:n,chainId:r,chainName:i,isBridging:s,isErc20Flow:o,totalPriceInNativeCurrency:a,totalPriceInUsd:c,gasPriceInNativeCurrency:l,gasPriceInUsd:u})=>{var h;let d=Eh(t.walletClientType);return p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(G2,{}),p.jsx(lh,{style:{marginTop:"16px"},children:p.jsx(zpe,{icon:(h=d==null?void 0:d.image_url)==null?void 0:h.md,name:t.walletClientType})}),p.jsx(ei,{style:{marginTop:"8px",marginBottom:"12px"},title:`${s?"Bridging":"Confirming"} with ${e}`}),!s&&!o&&p.jsxs(Z2,{children:[p.jsxs($n,{children:[p.jsx(An,{children:"Total"}),p.jsx(jn,{children:c||a})]}),p.jsxs($n,{children:[p.jsx(An,{children:"To"}),p.jsx(jn,{children:p.jsx(zi,{address:n,showCopyIcon:!1})})]}),p.jsxs($n,{children:[p.jsx(An,{children:"Network"}),p.jsx(jn,{children:p.jsxs(tlt,{children:[p.jsx(p1e,{chainId:r,height:16,width:16})," ",i]})})]}),l&&p.jsxs($n,{children:[p.jsx(An,{children:"Estimated fee"}),p.jsx(jn,{children:u||l})]})]}),p.jsx(CB,{height:24}),p.jsx(ln,{})]})};let tlt=ue.div.withConfig({displayName:"NetworkColumn",componentId:"sc-ec6320ce-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);const g1e={component:()=>{let{closePrivyModal:t,createAnalyticsEvent:e}=Ht(),{navigate:n,setModalData:r,app:i,data:s}=jt(),{wallets:o}=nx(),a=ex(),[c,l]=E.useState(0n),[u,d]=E.useState(null),[h,f]=E.useState(!1),[m,y]=E.useState(!1),v=E.useRef(!1);if(!(s!=null&&s.funding)||s.funding.chainType!=="solana")throw Error("Invalid funding data");let{address:b,amount:C,cluster:x,connectedWalletAddress:_}=s.funding,$=function({name:k,rpcUrl:M}){if(M)return M;switch(k){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";
197case"devnet":return"https://api.devnet.solana.com"}}(x),{tokenPrice:I}=K2("solana"),{fundingAmountInBaseUnit:R,totalPriceInUsd:N,totalPriceInNativeCurrency:T,feePriceInNativeCurrency:O,feePriceInUsd:U}=Z0e({amount:C,fee:c,tokenPrice:I}),z=_?o.find(({address:k})=>k===_):o[0],L=Eh((z==null?void 0:z.walletClientType)||"unknown"),S=(L==null?void 0:L.name)||"wallet";return E.useEffect(()=>{(async()=>{var k;if((z==null?void 0:z.type)==="solana"&&z.sendTransaction&&!h&&!v.current){v.current=!0;try{let M=a(tx);if(!M)throw new ve("Unable to load solana plugin");let{connection:W,transaction:H}=await M.createTransferTransaction({from:z.address,to:b,amount:R,cluster:x}),D=await H.getEstimatedFee(W);D!=null&&l(BigInt(D)),f(!0);let V=await W.simulateTransaction(H);if(V.value.err)return(k=V.value.logs)!=null&&k.find(P=>/insufficient (lamports|funds)/gi.test(P))?void d(new ve(`Wallet ${po(z.address,void 0,void 0,"solana")} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE)):(console.error("Transaction failed:",V.value.err),void d(new ve("Something went wrong",void 0,Ce.TRANSACTION_FAILURE)));let B=await z.sendTransaction(H,W);e({eventName:kl,payload:{provider:"external",status:"success",txHash:B,rpcEndpoint:$,address:z.address,value:us(R,9),chainType:"solana",clusterName:x.name,token:"SOL",destinationAddress:b,destinationValue:us(R,9),destinationChainType:"solana",destinationClusterName:x.name,destinationToken:"SOL"}}),f(!1),y(!0)}
197catch(M){if(console.error(M),f(!1),/user rejected the request/gi.test(M.message||""))return void d(new ve("Transaction was rejected by the user",void 0,Ce.TRANSACTION_FAILURE));d(new ve("Something went wrong",void 0,Ce.TRANSACTION_FAILURE))}}})().catch(console.error).finally(()=>v.current=!1)},[]),E.useEffect(()=>{u&&(r({funding:s==null?void 0:s.funding,sendTransaction:s==null?void 0:s.sendTransaction,errorModalData:{error:u,previousScreen:Y2}}),n(Hr,!1))},[u]),E.useEffect(()=>{if(!m)return;let k=setTimeout(t,C_);return()=>clearTimeout(k)},[m]),m?p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(sr,{}),p.jsxs(Ch,{children:[p.jsx(Tl,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(ei,{title:"Success!",description:`Youâve successfully added ${C} SOL to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),p.jsx(dr,{}),p.jsx(ln,{})]}):z&&h?p.jsx(eS,{wallet:z,displayName:S,addressToFund:b,isBridging:!1,isErc20Flow:!1,totalPriceInUsd:N,totalPriceInNativeCurrency:T,gasPriceInUsd:U,gasPriceInNativeCurrency:O,chainId:"solana",chainName:x.name}):p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(G2,{}),p.jsx("div",{style:{marginTop:"1rem"}}),p.jsx(ln,{})]})}},JO=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];let nlt=2n**256n-1n;const m1e=({amount:t,decimals:e})=>t===nlt?"Maximum":Intl.NumberFormat(void 0,{maximumFractionDigits:e}).format(Number(t)/10**e),y1e=({chains:t,appId:e,address:n,rpcConfig:r})=>Promise.all(t.map(async i=>({balance:await ap({chain:i,transport:Un(oh(i,r,e))}).getBalance({address:n}).catch(()=>0n),chain:i}))),rlt=({balance:t,className:e,chain:n})=>p.jsx(OB,{className:e,$state:void 0,children:p.jsx(ej,{balance:t,chain:n})}),ej=({balance:t,chain:e})=>p.jsxs(p.Fragment,{children:[p.jsxs(ilt,{children:[p.jsx(olt,{chainId:"id"in e?e.id:"solana"}),p.jsx(jn,{children:e.name})]}),p.jsxs(_l,{isLoading:!1,isPulsing:!1,color:"gray",children:[p.jsx(slt,{children:p.jsx(E5,{})}),t]})]});let ilt=ue.div.withConfig({displayName:"Container",componentId:"sc-6d3c340d-0"})(["display:flex;align-items:center;"]),slt=ue.div.withConfig({displayName:"IconContainer",componentId:"sc-6d3c340d-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),olt=ue(p1e).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-6d3c340d-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);const alt=({options:t,onSelect:e,selected:n,className:r})=>p.jsxs(xit,{as:clt,children:[p.jsxs(Ufe,{as:dlt,children:[p.jsx(ej,{balance:n.balance,chain:n.chain}),p.jsx(tj,{height:16})]}),p.jsx(zfe,{as:llt,className:r,children:t.map((i,s)=>p.jsx(Wfe,{as:ult,onClick:()=>e(s),children:p.jsx(ej,{balance:i.balance,chain:i.chain})},s))})]});let clt=ue.div.withConfig({displayName:"Wrapper",componentId:"sc-7924b61-0"})(["width:100%;position:relative;"]),llt=ue.div.withConfig({displayName:"Popover",componentId:"sc-7924b61-1"})(["width:100%;margin-top:0.5rem;position:absolute;background-color:var(--privy-color-background);border-radius:var(--privy-border-radius-md);overflow-x:hidden;overflow-y:auto;box-shadow:0px 1px 2px 0px rgba(16,24,40,0.05);max-height:11.75rem;&&{border:solid 1px var(--privy-color-foreground-4);}z-index:1;"]),ult=ue.button.withConfig({displayName:"Button",componentId:"sc-7924b61-2"})(["width:100%;display:flex;justify-content:space-between;&&{padding:1rem;}:not(:last-child){border-bottom:solid 1px var(--privy-color-foreground-4);}:hover{background:var(--privy-color-background-2);}"]),tj=ue(x_).withConfig({displayName:"StyledChevronIcon",componentId:"sc-7924b61-3"})(["height:1rem;margin-left:0.5rem;"]),dlt=ue.button.withConfig({displayName:"StyledMenuButton",componentId:"sc-7924b61-4"})([""," span{margin-left:auto;}","{transition:rotate 100ms ease-in;}&[aria-expanded='true']{","{rotate:-180deg;}}"],l1e,tj,tj);const hlt=ue.div.withConfig({displayName:"FundingMethodContainer",componentId:"sc-eaaa12a-0"})(["display:flex;flex-direction:column;gap:12px;padding-top:24px;padding-bottom:24px;"]),Xv=ue.div.withConfig({displayName:"IconContainer",componentId:"sc-eaaa12a-1"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;svg{border-radius:var(--privy-border-radius-sm);}
197"]),w1e=ue.div.withConfig({displayName:"FundingQuantityWrapper",componentId:"sc-eaaa12a-2"})(["display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px;"]),v1e=ue.div.withConfig({displayName:"FundingQuantity",componentId:"sc-eaaa12a-3"})(["display:flex;align-items:center;gap:4px;width:100%;padding:0 16px;border-width:1px !important;border-radius:12px;cursor:text;&:focus-within{border-color:var(--privy-color-accent);}"]),b1e=ue.input.withConfig({displayName:"FundingAmountInput",componentId:"sc-eaaa12a-5"})(["background-color:var(--privy-color-background);width:100%;&:focus{outline:none !important;border:none !important;box-shadow:none !important;}&&{font-size:26px;}"]),flt=ue(b1e).withConfig({displayName:"FundingAmountInputLarge",componentId:"sc-eaaa12a-6"})(["&&{font-size:42px;}"]),x1e=ue.div.withConfig({displayName:"FundingCurrency",componentId:"sc-eaaa12a-8"})(["font-size:18px;"]),E1e=ue.div.withConfig({displayName:"FundingDollars",componentId:"sc-eaaa12a-9"})(["font-size:12px;color:var(--privy-color-foreground-3);height:20px;"]),plt=ue.div.withConfig({displayName:"InfoButtonText",componentId:"sc-eaaa12a-13"})([""]),glt=ue.a.withConfig({displayName:"InfoButtonLink",componentId:"sc-eaaa12a-14"})(["&&{color:var(--privy-color-accent);}cursor:pointer;"]),C1e=({displayName:t,errorMessage:e,configuredFundingChain:n,formattedBalance:r,fundingAmount:i,fundingCurrency:s,fundingAmountInUsd:o,options:a,selectedOption:c,isPreparing:l,isSubmitting:u,addressToFund:d,fundingWalletAddress:h,onSubmit:f,onSelect:m,onAmountChange:y})=>{let v=E.useRef(null);return p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(sr,{}),p.jsx(uh,{children:"Transfer from another network"}),p.jsxs(Sp,{children:["You need more funds on the ",n.name," network. Bridge from another blockchain network."]}),p.jsxs(w1e,{style:{marginTop:"2rem"},children:[p.jsxs(v1e,{onClick:()=>{var b;return(b=v.current)==null?void 0:b.focus()},children:[p.jsx(b1e,{ref:v,value:i,onChange:b=>{let C=b.target.value;if(/^[0-9.]*$/.test(C)&&C.split(".").length-1<=1){let x=/\.$/.test(C)?".":"",_=Number(C.replace(/\.$/,"")||"0");if(Number.isNaN(_))return void y("0");y(_.toString()+x)}}}),p.jsx(x1e,{children:s})]}),o&&p.jsx(E1e,{children:o})]}),p.jsxs($n,{style:{marginTop:"1.5rem"},children:[p.jsx(An,{children:"From"}),p.jsx(An,{children:eK(h)})]}),p.jsx(alt,{selected:{chain:c.chain,balance:bl(c.balance,c.chain.nativeCurrency.symbol,3,!0)},options:a.map(({chain:b,balance:C})=>({chain:b,balance:bl(C,b.nativeCurrency.symbol,3,!0)})),onSelect:m}),p.jsxs($n,{style:{marginTop:"1.5rem"},children:[p.jsx(An,{children:"To"}),p.jsx(An,{children:eK(d)})]}),p.jsx(rlt,{chain:n,balance:r}),p.jsx(hh,{style:{marginTop:"1rem"},children:e}),p.jsxs(d3,{style:{marginTop:"1rem"},loading:u||l,disabled:l||u,onClick:f,children:["Confirm with ",t]}),p.jsx(dr,{}),p.jsx(ln,{})]})},_1e={component:()=>{let{rpcConfig:t,appId:e,closePrivyModal:n,createAnalyticsEvent:r}=Ht(),{navigate:i,setModalData:s,app:o,data:a}=jt(),{wallets:c}=Ap(),[l,u]=E.useState(!1),[d,h]=E.useState(0n),[f,m]=E.useState(!1),[y,v]=E.useState(null),[b,C]=E.useState(null),[x,_]=E.useState([]),[$,I]=E.useState(0),[R,N]=E.useState(!1),[T,O]=E.useState(!1),[U,z]=E.useState(!1),[L,S]=E.useState(!1),[k,M]=E.useState(),[W,H]=E.useState();if(!(a!=null&&a.funding)||a.funding.chainType!=="ethereum")throw Error("Invalid funding data");let{erc20ContractInfo:D,chain:V,connectedWalletAddress:B}=a.funding,P=a.funding.address,j=a.funding.erc20Address,[G,Y]=E.useState(a.funding.amount);E.useEffect(()=>{j&&!D&&v(Error("Unable to fetch token details"))},[]);let te=!!j&&!!D,ae=te?BigInt(parseFloat(G)*10**D.decimals):Doe(G),oe=B?c.find(({address:q})=>q===B):c[0],de=Eh((oe==null?void 0:oe.walletClientType)||"unknown"),ke=(de==null?void 0:de.name)||"wallet",[Be,$e]=E.useState(null);E.useEffect(()=>{(async()=>{if(!oe)return;let q=await oe.getEthereumProvider();$e(pce({account:oe.address,transport:SD(q)}).extend(KD))})().catch(console.error)},[oe]);let[He,Ge]=E.useState(0n);E.useEffect(()=>{ap({chain:V,transport:Un(oh(V,t,e))}).getBalance({address:P}).then(Ge).catch(console.error)},[]);let[je,xt]=E.useState(0n);E.useEffect(()=>{te&&d1e({chain:V,address:P,appId:e,rpcConfig:t,erc20Address:j}).then(q=>xt(q.balance)).catch(console.error)},[]);let{tokenPrice:ft}=K2(V.id),[it,be]=E.useState({to:P,chain:V,value:ae,data:void 0});E.useEffect(()=>{(async()=>{let q,Z;if(!Be||!oe||R||U)return;N(!0);let se=ap({chain:it.chain,transport:Un(oh(it.chain,t,e))});if(te&&!it.data)return await se.simulateContract({address:j,chain:it.chain,abi:JO,functionName:"transfer",args:[P,ae],account:oe.address}
197).catch(he=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",he)})?(N(!1),void be({to:j,chain:it.chain,data:Tc({abi:JO,functionName:"transfer",args:[P,ae]}),value:"0x0"})):(N(!1),void m(!0));try{q=await se.prepareTransactionRequest({account:oe.address,to:it.to,chain:it.chain,data:it.data,value:BigInt(it.value??0)})}catch(he){if(console.error(he),x.length>1)C(he.shortMessage??"Something went wrong");else if(T&&x.length===0)return void v(new ve(`Wallet ${po(oe.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE))}if(!q)return N(!1),void m(!0);N(!1),z(!0),u(!0),h(q.gas);try{await Be.switchChain({id:it.chain.id})}catch{await Be.addChain({chain:it.chain}),await Be.switchChain({id:it.chain.id})}try{Z=await Be.sendTransaction(q)}catch(he){if(console.error(he),he.name==="TransactionExecutionError")if(x.length<1){let fe=he.shortMessage;(he.shortMessage.includes("rejected the request")||he.details.includes("rejected the request"))&&(fe="User rejected the request."),v(new ve(fe,void 0,Ce.TRANSACTION_FAILURE))}else C(he.shortMessage??"Something went wrong")}if(Z)return await Be.waitForTransactionReceipt({hash:Z}),z(!1),T?(M(Z),void H("pending")):(S(!0),void r({eventName:kl,payload:{provider:"external",status:"success",txHash:Z,address:oe.address,chainId:it.chain.id,chainType:"ethereum",value:it.value?us(BigInt(it.value),(D==null?void 0:D.decimals)??18):void 0,token:(D==null?void 0:D.symbol)??j??"ETH",destinationAddress:P,destinationChainId:V.id,destinationChainType:"ethereum",destinationValue:ae?us(ae,(D==null?void 0:D.decimals)??18):void 0,destinationToken:(D==null?void 0:D.symbol)??j??V.nativeCurrency.name}}));z(!1)})().catch(console.error)},[Be,it]),E.useEffect(()=>{(async()=>{if(!f||!Be||!oe)return;let q=gB(o.chains).filter(nt=>nt.id!==V.id&&!!nt.testnet==!!V.testnet);te&&q.unshift(V);let Z=await y1e({chains:q,address:oe.address,appId:e,rpcConfig:t}),se=te?Z.filter(nt=>nt.balance>0n):Z.filter(nt=>nt.balance>ae);if(se.length<1)return void v(new ve(`Wallet ${po(oe.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE));se.sort((nt,vt)=>Number(vt.balance-nt.balance));let he=(await Promise.allSettled(se.map(async nt=>({quote:await f3({isTestnet:!!V.testnet,input:h3({amount:ae.toString(),user:oe.address,recipient:P,destinationChainId:V.id,destinationCurrency:j,originChainId:nt.chain.id})}),...nt})))).filter(nt=>nt.status==="fulfilled").map(nt=>nt.value);if(he.length<1)return void v(new ve(`Wallet ${po(oe.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE));let fe=he.map(nt=>({bridgeTx:U9(nt.quote),balance:nt.balance,chain:nt.chain})).filter(nt=>!!nt.bridgeTx);if(fe.length>1)return void _(fe);let ye=fe[0];ye?(O(!0),be({data:ye.bridgeTx.data,to:ye.bridgeTx.to,value:ye.bridgeTx.value,chain:ye.chain})):v(new ve(`Wallet ${po(oe.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE))})().catch(console.error)},[f]),kB({transactionHash:k,wallet:oe,isTestnet:!!V.testnet,bridgingStatus:W,setBridgingStatus:H,onSuccess({transactionHash:q,wallet:Z}){O(!1),S(!0),r({eventName:kl,payload:{provider:"external",status:"success",txHash:q,address:Z.address,chainId:it.chain.id,chainType:"ethereum",value:it.value?us(BigInt(it.value),(D==null?void 0:D.decimals)??18):void 0,token:(D==null?void 0:D.symbol)??j??"ETH",destinationAddress:P,destinationChainId:V.id,destinationChainType:"ethereum",destinationValue:ae?us(ae,(D==null?void 0:D.decimals)??18):void 0,destinationToken:(D==null?void 0:D.symbol)??j??V.nativeCurrency.name}})},onFailure({error:q}){O(!1),v(q)}}),E.useEffect(()=>{y&&(s({funding:a==null?void 0:a.funding,sendTransaction:a==null?void 0:a.sendTransaction,errorModalData:{error:y,previousScreen:Y2}}),i(Hr,!1))},[y]);let Lt=!te&&ft?K0e(G??"0",ft):void 0,Qe=te?d:PB([d,ae]),Ue=Qe&&ft?i1(Qe,ft):void 0,Ye=Qe?bl(Qe,"ETH"):void 0,tt=d&&ft?i1(d,ft):void 0,ze=d?bl(d,"ETH"):void 0;if(E.useEffect(()=>{if(!L)return;let q=setTimeout(n,C_);return()=>clearTimeout(q)},[L]),L)return p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(sr,{}),p.jsxs(Ch,{children:[p.jsx(Tl,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(ei,{title:"Success!",description:`Youâve successfully added ${G} ${te?D.symbol:V.nativeCurrency.symbol} to your ${o.name} wallet. It may take a minute before the funds are available to use.`})]}),p.jsx(dr,{}),p.jsx(ln,{})]});let Ne=te?`${m1e({amount:je,decimals:D.decimals})} ${D.symbol}`:bl(He,V.nativeCurrency.symbol,3,!0),J=x[$];return x.length>1&&J?p.jsx(C1e,{displayName:ke,configuredFundingChain:V,formattedBalance:Ne,fundingAmount:G,fundingCurrency:te?D.symbol:V.nativeCurrency.symbol,fundingAmountInUsd:Lt,options:x,selectedOption:J,isPreparing:R,isSubmitting:U,addressToFund:P,fundingWalletAddress:(oe==null?void 0:oe.address)||"",errorMessage:b,onSubmit:()=>{var q;((q=a.funding)==null?void 0:q.amount)!==G?async function(){if(oe&&J)try{let Z=await f3({isTestnet:!!V.testnet,input:h3({amount:ae.toString(),user:oe.address,recipient:P,destinationChainId:V.id,destinationCurrency:j,originChainId:J.chain.id})}),se=U9(Z);if(!se)throw Error("Invalid transaction request");O(!0),be({data:se.data,to:se.to,value:se.value,chain:J.chain})}catch(Z){console.error(Z),v(new ve("Unable to fetch quotes for bridging",Z,Ce.INSUFFICIENT_BALANCE))}}().catch(console.error):be({to:J.bridgeTx.to,data:J.bridgeTx.data,value:J.bridgeTx.value,chain:J.chain})},onSelect:q=>{q!==$&&(C(null),I(q))},onAmountChange:Y}):l&&d&&oe&&(a!=null&&a.funding)?p.jsx(eS,{wallet:oe,displayName:ke,addressToFund:P,isBridging:T,isErc20Flow:te,totalPriceInUsd:Ue,totalPriceInNativeCurrency:Ye,gasPriceInUsd:tt,gasPriceInNativeCurrency:ze,chainId:V.id,chainName:V.name}):p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(G2,{}),p.jsx("div",{style:{marginTop:"1rem"}}),p.jsx(ln,{})]})}},S1e={component:function(){let{closePrivyModal:t,createAnalyticsEvent:e}=Ht(),{navigate:n,setModalData:r,app:i,data:s}=jt(),{wallets:o}=nx(),a=E.useRef(!1),c=ex(),[l,u]=E.useState(!1),[d,h]=E.useState(!1),[f,m]=E.useState(null),[y,v]=E.useState(),[b,C]=E.useState();if(!(s!=null&&s.funding)||s.funding.chainType!=="ethereum")throw Error("Invalid funding data");let{amount:x,connectedWalletAddress:_,chain:$,cluster:I,isUSDC:R}=s.funding,N=s.funding.address,T=s.funding.erc20Address,O=s.funding.isUSDC?"USDC":$.nativeCurrency.symbol,U=I??{name:"mainnet-beta"},z=_?o.find(({address:k})=>k===_):o[0],L=Eh((z==null?void 0:z.walletClientType)||"unknown"),S=(L==null?void 0:L.name)||"wallet";return E.useEffect(()=>{(async function(){var D;if(!z||!$||a.current)return;let k=c(tx);if(!k)return void m(new ve("Unable to solana plugin"));a.current=!0,$!=null&&$.testnet&&console.warn("Solana testnets are not supported for bridging");let M=R?1e6*parseFloat(x):Doe(x),W=await f3({isTestnet:!!$.testnet,input:h3({amount:M.toString(),user:z.address,recipient:N,destinationChainId:$.id,originChainId:zO,originCurrency:R?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":WO,destinationCurrency:R?T:void 0})}).catch(console.error);if(!W)return void m(new ve(`Unable to fetch quotes for bridging. Wallet ${VI(z.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE));let H=await k.createBridgeTransactionFromRelayQuote({quote:W,from:z.address,cluster:U});if(H)try{u(!0);
197let{connection:V,transaction:B}=H,P=await V.simulateTransaction(B);if(P.value.err)return(D=P.value.logs)!=null&&D.find(Y=>/insufficient (lamports|funds)/gi.test(Y))?void m(new ve(`Wallet ${VI(z==null?void 0:z.address)} does not have enough funds. ${W.details.currencyIn.amountFormatted} ${O} are needed to complete the transaction.`,void 0,Ce.INSUFFICIENT_BALANCE)):(console.error("Transaction failed:",P.value.err),void m(new ve("Something went wrong",void 0,Ce.TRANSACTION_FAILURE)));let j=await z.sendTransaction(B,V),G=await V.confirmTransaction(j);if(G.value.err)return console.error("Transaction failed:",G.value.err),void m(new ve("Something went wrong",void 0,Ce.TRANSACTION_FAILURE));v(j),C("pending")}catch(V){if(console.error(V),/user rejected the request/gi.test(V.message||""))return void m(new ve("Transaction was rejected by the user",void 0,Ce.TRANSACTION_FAILURE));m(new ve("Something went wrong",void 0,Ce.TRANSACTION_FAILURE))}else m(new ve(`Unable to select bridge option from quotes. Wallet ${VI(z.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE))})().catch(console.error)},[]),kB({transactionHash:y,wallet:z,isTestnet:!1,bridgingStatus:b,setBridgingStatus:C,onSuccess({transactionHash:k,wallet:M}){u(!1),h(!0),e({eventName:kl,payload:{provider:"external",status:"success",txHash:k,address:M.address,chainType:"solana",clusterName:U.name,token:"SOL",destinationAddress:N,destinationChainId:$.id,destinationChainType:"ethereum",destinationValue:x,destinationToken:R?"USDC":"ETH"}})},onFailure({error:k}){u(!1),m(k)}}),E.useEffect(()=>{if(!d)return;let k=setTimeout(t,C_);return()=>clearTimeout(k)},[d]),E.useEffect(()=>{f&&(r({funding:s==null?void 0:s.funding,sendTransaction:s==null?void 0:s.sendTransaction,errorModalData:{error:f,previousScreen:Y2}}),n(Hr,!1))},[f]),d?p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(sr,{}),p.jsxs(Ch,{children:[p.jsx(Tl,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(ei,{title:"Success!",description:`Youâve successfully added ${x} ${O} to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),p.jsx(dr,{}),p.jsx(ln,{})]}):l&&z?p.jsx(eS,{wallet:z,displayName:S,addressToFund:N,isBridging:l,isErc20Flow:!1,chainId:$.id,chainName:$.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(G2,{}),p.jsx("div",{style:{marginTop:"1rem"}}),p.jsx(ln,{})]})}},tX={component:()=>{var h;let{data:t,setModalData:e}=jt(),n=t==null?void 0:t.funding,r=n.chainType==="solana",i=E.useRef(null),{tokenPrice:s}
197=K2(r?"solana":n.chain.id),o=r?void 0:n,a=!(!(o!=null&&o.erc20Address)||o!=null&&o.erc20ContractInfo),c=r?"SOL":n.erc20Address?(h=n.erc20ContractInfo)==null?void 0:h.symbol:n.chain.nativeCurrency.symbol||"ETH",l=parseFloat(n.amount),u=!isNaN(l)&&l>0,d=s?K0e(n.amount,s):void 0;return p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(uh,{children:"Confirm or edit amount"}),p.jsxs(D_,{style:{marginTop:"32px"},children:[p.jsx(w1e,{children:a?p.jsx(G2,{size:"50px"}):p.jsxs(p.Fragment,{children:[p.jsxs(v1e,{onClick:()=>{var f;return(f=i.current)==null?void 0:f.focus()},children:[p.jsx(flt,{ref:i,value:n.amount,onChange:f=>{let m=f.target.value;/^[0-9.]*$/.test(m)&&m.split(".").length-1<=1&&e({...t,funding:{...n,amount:m}})}}),p.jsx(x1e,{children:c})]}),!(o!=null&&o.erc20Address)&&p.jsx(E1e,{children:d&&u?`${d} USD`:""})]})}),p.jsx(d3,{style:{marginTop:"1rem"},disabled:!u,onClick:n.onContinueWithExternalWallet,children:"Continue"})]}),p.jsx(ln,{})]})}},Y2={component:()=>{var $,I,R;let t,{connectors:e}=Ht(),{app:n,setModalData:r,data:i,navigate:s}=jt(),{wallets:o}=Ap(),{wallets:a}=nx(),[c,l]=E.useState("default"),u=(($=i==null?void 0:i.funding)==null?void 0:$.chainType)==="solana",d=!!((I=i==null?void 0:i.funding)!=null&&I.crossChainBridgingEnabled);t=((R=i==null?void 0:i.funding)==null?void 0:R.chainType)==="ethereum"?i.funding.erc20Address&&!i.funding.isUSDC?"ethereum-only":d&&!i.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":d?"ethereum-and-solana":"solana-only";let h=o.filter(N=>N.walletClientType!=="privy"),f=h.map(N=>N.walletClientType),m=a.filter(N=>N.walletClientType!=="privy"),y=m.map(N=>N.walletClientType),v=[],b={...i.funding};b.usingDefaultFundingMethod&&(b.usingDefaultFundingMethod=!1);let C=({address:N,walletChainType:T})=>{r({...i,funding:{...b,connectedWalletAddress:N,onContinueWithExternalWallet:()=>s(_({destChainType:u?"solana":"ethereum",sourceChainType:T}))}}),s(tX)};t!=="solana-only"&&v.push(...h.map((N,T)=>p.jsx(nX,{onClick:()=>C({address:N.address,walletChainType:"ethereum"}),icon:N.meta.icon,name:N.meta.name,chainType:N.type},T))),t!=="ethereum-only"&&v.push(...m.map((N,T)=>p.jsx(nX,{onClick:()=>C({address:N.address,walletChainType:"solana"}),icon:N.meta.icon,name:N.meta.name,chainType:N.type},T))),v.push(...I1({walletList:n.appearance.walletList.filter(N=>!h.some(T=>T.walletClientType===N)&&!m.some(T=>T.walletClientType===N)),walletChainType:t,connectors:e,connectOnly:!0,ignore:[...n.appearance.walletList,...f,...y],walletConnectEnabled:n.externalWallets.walletConnect.enabled}));let x=p.jsx(M0e,{text:"More wallets",onClick:()=>l("overflow")}),_=({sourceChainType:N,destChainType:T})=>N==="ethereum"&&T==="solana"?D1e:N==="ethereum"&&T==="ethereum"?_1e:N==="solana"&&T==="ethereum"?S1e:g1e;return E.useEffect(()=>{r({...i,externalConnectWallet:{onCompleteNavigateTo:({walletChainType:N})=>(r({...i,funding:{...b,onContinueWithExternalWallet:()=>{s(_({destChainType:u?"solana":"ethereum",sourceChainType:N??"ethereum"}))}}}),tX)}})},[]),p.jsxs(p.Fragment,c==="overflow"?{children:[p.jsx(_t,{backFn:()=>l("default")},"header"),p.jsxs(u2,{children:[p.jsx(Sp,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),v]}),p.jsx(ln,{})]}:{children:[p.jsx(ga,{}),p.jsx(ei,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),p.jsxs(u2,{children:[v.length>4?v.slice(0,3):v,v.length>4&&x]}),p.jsx(ln,{})]})}};let nX=({onClick:t,icon:e,name:n,chainType:r})=>p.jsxs(Qr,{onClick:t,children:[p.jsx(Xv,{style:{width:20},children:p.jsx("img",{src:e})}),n,p.jsx(_l,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),r==="solana"&&p.jsx(_l,{color:"gray",children:"Solana"})]});const mlt={component:()=>{let{data:t,setModalData:e,navigate:n,navigateBack:r}=jt(),{closePrivyModal:i,createAnalyticsEvent:s,client:o}=Ht(),[a,c]=E.useState("pending-in-flow"),l=E.useRef(0),u={...t==null?void 0:t.funding,showAlternateFundingMethod:!0};u.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1);let{partnerUserId:d,popup:h}=(t==null?void 0:t.coinbaseOnrampStatus)??{};return E.useEffect(()=>{if(a==="pending-in-flow"||a==="pending-after-flow"){let f=setInterval(async()=>
197{if(d)try{let{status:m}=await o.getCoinbaseOnRampStatus({partnerUserId:d});if(m==="success")return void c("success");if(m==="failure")throw Error("There was an error completing Coinbase Onramp flow.");if(l.current>=3)return e({funding:u}),void n(ca);h!=null&&h.closed&&(l.current=l.current+1,c("pending-after-flow"))}catch(m){console.error(m),c("error"),s({eventName:kl,payload:{status:"failure",provider:"coinbase-onramp",error:m.message}}),e({funding:{...u,errorMessage:"Something went wrong adding funds. Please try again or use another method."}}),n(ca)}},1500);return()=>clearInterval(f)}},[d,h,a]),p.jsxs(p.Fragment,{children:[p.jsx(_t,{title:"Fund account",backFn:()=>{e({funding:u}),r()}},"header"),p.jsx(ylt,{status:a,onClickCta:i}),p.jsx(ln,{})]})}};let ylt=({status:t,onClickCta:e})=>{let{title:n,body:r,cta:i}=E.useMemo(()=>(s=>{switch(s){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(t),[t]);return p.jsxs(p.Fragment,{children:[p.jsxs(blt,{children:[p.jsx(wlt,{isSucccess:t==="success"}),p.jsxs(Fa,{children:[p.jsx("h3",{children:n}),p.jsx(vlt,{children:r})]})]}),i&&p.jsx(tn,{onClick:e,children:i})]})},wlt=({isSucccess:t})=>{if(!t){let r="var(--privy-color-foreground-4)";return p.jsxs("div",{style:{position:"relative"},children:[p.jsx(kc,{color:r,style:{position:"absolute"}}),p.jsx(vB,{color:r}),p.jsx(Qit,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let e=(r=>r?C1:()=>p.jsx(zL,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}))(t),n=(r=>r?"var(--privy-color-success)":"var(--privy-color-foreground-4)")(t);return p.jsx("div",{style:{borderColor:n,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:e&&p.jsx(e,{width:"4rem",height:"4rem",color:n})})},vlt=ue.p.withConfig({displayName:"StatusBody",componentId:"sc-ebf88779-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),blt=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-ebf88779-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]),xlt={[W5.id]:"ethereum",[$_.id]:"base",[I_.id]:"optimism",[T_.id]:"polygon",[k_.id]:"arbitrum"};const rX=(t,e,n,r,i,s)=>new Promise(async(o,a)=>{let c=X_();if(!c)return void a(Error("Unable to initialize flow"));let l=e.chainType==="ethereum"?function(m){let y=xlt[m];if(!y)throw new ve(`Unsupported chainId: ${m} for Coinbase Onramp`);return y}(e.chain.id):"solana",u=e.isUSDC?"USDC":e.chainType==="ethereum"?"ETH":"SOL",d=await t.initCoinbaseOnRamp({addresses:[{address:e.address,blockchains:[l]}],assets:[u]}),{url:h}=QMe({input:d,amount:e.amount,blockchain:l,asset:u,experience:s});c.location=h.toString();let f={...i==null?void 0:i.funding,showAlternateFundingMethod:!0};e.usingDefaultFundingMethod&&(f.usingDefaultFundingMethod=!1),n({funding:f,coinbaseOnrampStatus:{popup:c}}),r(mlt),t.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:e.amount,chainType:e.chainType,chainId:e.chainType==="ethereum"?e.chain.id:e.cluster.name}}),setTimeout(()=>{n({funding:f,coinbaseOnrampStatus:{partnerUserId:d.partner_user_id,popup:c}})},5e3),o()}),iX="moonpay";function Elt(t){return parseFloat(t)}function Clt(t){return!!t&&t.config!==void 0&&t.provider!==void 0}function lT(t){return!!t&&(t.chain!==void 0||t.amount!==void 0)}function _lt(t,e=!1){let[n,r]=E.useState(null),{createAnalyticsEvent:i}=Ht(),{data:s,navigate:o,setModalData:a}=jt(),c=s==null?void 0:s.funding,l=E.useRef(0);return E.useEffect(()=>{let u=setInterval(async()=>{var d,h;if(t)try{let[f]=await async function(y,v){return u5(`https://api.moonpay.com/v1/transactions/ext/${y}`,{query:{apiKey:v?"pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI":"pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL"}})}(t,e),m=f.status==="waitingAuthorization"&&f.paymentMethod==="credit_debit_card"?"pending":f.status;if(["failed","completed","awaitingAuthorization"].includes(m)&&(i({eventName:kl,payload:{status:m,provider:iX,paymentMethod:f.paymentMethod,cardPaymentType:f.cardPaymentType,currency:(d=f.currency)==null?void 0:d.code,baseCurrencyAmount:f.baseCurrencyAmount,quoteCurrencyAmount:f.quoteCurrencyAmount,feeAmount:f.feeAmount,extraFeeAmount:f.extraFeeAmount,networkFeeAmount:f.networkFeeAmount,isSandbox:e}}),clearInterval(u)),m==="failed"||m==="serviceFailure")return a({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),void o(ca);r(m)}catch(f){((h=f.response)==null?void 0:h.status)!==404&&(l.current+=1),l.current>=3&&(i({eventName:kl,payload:{status:"serviceFailure",provider:iX}}),clearInterval(u),a({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),o(ca))}},3e3);return()=>clearInterval(u)},[t,l]),n}const Slt=({size:t=61,...e})=>p.jsx("svg",{width:t,height:t,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:p.jsxs("g",{id:"moonpay_symbol_wht 2",children:[p.jsx("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),p.jsx("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})}),A1e={component:()=>{let{app:t,data:e,setModalData:n,navigateBack:r}=jt(),{closePrivyModal:i}=Ht(),{externalTransactionId:s}=e==null?void 0:e.moonpayStatus,o=_lt(s||null,t.fundingMethodConfig.moonpay.useSandbox??!1);return p.jsxs(p.Fragment,{children:[p.jsx(_t,{title:"Fund account",backFn:()=>{let a={...e==null?void 0:e.funding,showAlternateFundingMethod:!0};a.usingDefaultFundingMethod&&(a.usingDefaultFundingMethod=!1),n({funding:a}),r()}}),p.jsx(Alt,{status:o,onClickCta:i}),p.jsx(ln,{})]})}};let Alt=({status:t,onClickCta:e})=>{let{title:n,body:r,cta:i}=E.useMemo(()=>(s=>{switch(s){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}})(t),[t]);return p.jsxs(p.Fragment,{children:[p.jsxs(Ilt,{children:[p.jsx(klt,{status:t}),p.jsxs(Fa,{children:[p.jsx("h3",{children:n}),p.jsx($lt,{children:r})]})]}),i&&p.jsx(tn,{onClick:e,children:i})]})}
197,klt=({status:t})=>{if(!t||t==="pending"){let r="var(--privy-color-foreground-4)";return p.jsxs("div",{style:{position:"relative"},children:[p.jsx(kc,{color:r,style:{position:"absolute"}}),p.jsx(vB,{color:r}),p.jsx(Slt,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let e=(r=>{switch(r){case"completed":return C1;case"waitingAuthorization":return()=>p.jsx(zL,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}})(t),n=(r=>r?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[r]:"var(--privy-color-foreground-4)")(t);return p.jsx("div",{style:{borderColor:n,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:e&&p.jsx(e,{width:"4rem",height:"4rem",color:n})})},$lt=ue.p.withConfig({displayName:"StatusBody",componentId:"sc-7f0a56e4-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),Ilt=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-7f0a56e4-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]);const Tlt=async(t,e,n,r,i,s,o,a)=>{var f,m;let c=X_();if(!c)throw Error("Unable to initialize flow");let l=e.chainType==="ethereum"?((f=e.moonpayConfigOverride)==null?void 0:f.currencyCode)??NMe(e.chain.id,r):"SOL",{signedUrl:u,externalTransactionId:d}=await t.signMoonpayOnRampUrl({address:e.address,useSandbox:n.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:n.appearance.palette.accent,theme:n.appearance.palette.colorScheme},...e.moonpayConfigOverride,paymentMethod:a,currencyCode:l,quoteCurrencyAmount:((m=e.moonpayConfigOverride)==null?void 0:m.quoteCurrencyAmount)??Elt(e.amount)}});t.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:e.amount,chainType:e.chainType,chainId:e.chainType==="ethereum"?e.chain.id:e.cluster.name}}),c.location=u;let h={...o==null?void 0:o.funding,showAlternateFundingMethod:!0};e.usingDefaultFundingMethod&&(h.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:h}),s(A1e),setTimeout(()=>{i({moonpayStatus:{externalTransactionId:d},funding:h})},8e3)};let k1e=async t=>typeof window<"u"&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:t}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const Plt=()=>k1e("https://apple.com/apple-pay"),Rlt=()=>k1e("https://google.com/pay"),ca={component:()=>{var C,x;let{wallets:t}=Ap(),{wallets:e}=nx(),{navigate:n,data:r,setModalData:i}=jt(),{client:s}=Ht(),o=Vr(),a=r==null?void 0:r.funding,c=JQ(Plt),l=JQ(Rlt),u=a.chainType==="solana",d=u?void 0:a,h=E.useMemo(()=>((_,$,I,R,N,T)=>{var H;let O,U,z=I.chainType==="solana",L=z?void 0:I,S=I.isUSDC?"USDC":L!=null&&L.erc20Address?void 0:"native-currency",k=!!z||S&&jMe(Number(I.chain.id),S),M=!!z||S&&XMe(Number(I.chain.id),S),W=[];for(let D of(I.preferredCardProvider&&I.supportedOptions.sort(V=>V.provider===I.preferredCardProvider?-1:1),I.supportedOptions))D.method==="card"&&D.provider==="coinbase"&&M&&W.push(()=>rX($,I,R,N,T,"buy")),D.method==="card"&&D.provider==="moonpay"&&k&&S&&W.push(()=>Tlt($,I,_,S,R,N,T,"credit_debit_card"));for(let D of I.supportedOptions)D.method==="exchange"&&D.provider==="coinbase"&&M&&(O=()=>rX($,I,R,N,T,"buy"));for(let D of((H=T==null?void 0:T.funding)==null?void 0:H.supportedOptions)??[])D.method==="wallets"&&(U=()=>N(Y2));return{onFundWithCard:W,onFundWithExchange:O,onFundWithWallet:U}})(o,s,a,i,n,r),[o,s,a,r,i,n]);E.useEffect(()=>{if(a!=null&&a.defaultFundingMethod&&a.usingDefaultFundingMethod)switch(i({funding:{...a,usingDefaultFundingMethod:!1}}),a==null?void 0:a.defaultFundingMethod){case"card":h.onFundWithCard[0]&&h.onFundWithCard[0]();break;case"exchange":h.onFundWithExchange&&h.onFundWithExchange();break;case"wallet":h.onFundWithWallet&&h.onFundWithWallet();break;case"manual":n(V9)}},[]),E.useEffect(()=>{d!=null&&d.erc20Address&&!d.erc20ContractInfo&&f1e({address:d.erc20Address,chain:d.chain,rpcConfig:o.rpcConfig,privyAppId:o.id}).then(_=>{i({...r,funding:{...d,erc20ContractInfo:_?{symbol:_.symbol,decimals:_.decimals}:void 0}})}).catch(console.error)},[d==null?void 0:d.erc20Address,d==null?void 0:d.chain]);let f=u?e.find(({address:_})=>_===a.address):t.find(({address:_})=>cr(_)===cr(a.address)),m=Eh((f==null?void 0:f.walletClientType)||"unknown"),y=(m==null?void 0:m.name)||"wallet",v=f&&f.walletClientType!=="privy"?y:o.name,b=!(!(d!=null&&d.erc20Address)||d!=null&&d.erc20ContractInfo);return p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsxs("h3",{children:["Add funds to your"," ",v!=null&&v.toLowerCase().endsWith("wallet")?v:v+" wallet"]}),p.jsxs(hlt,{children:[a.errorMessage&&p.jsx(Wct,{theme:o.appearance.palette.colorScheme,children:a.errorMessage}),((C=h.onFundWithCard)==null?void 0:C[0])&&p.jsxs(Qr,{disabled:b,onClick:h.onFundWithCard[0],children:[p.jsx(Xv,{children:p.jsx(RJe,{style:{width:24}})}),"Pay with card",c?p.jsx(Vct,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):l?p.jsx(qct,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),h.onFundWithExchange&&p.jsxs(Qr,{disabled:b,onClick:h.onFundWithExchange,children:[p.jsx(Xv,{children:p.jsx(zL,{style:{width:24}})}),"Transfer from an exchange"]}),h.onFundWithWallet&&p.jsxs(Qr,{disabled:b,onClick:h.onFundWithWallet,children:[p.jsx(Xv,{children:p.jsx(Kct,{style:{width:24}})}),"Transfer from wallet"]}),p.jsxs(Qr,{disabled:b,onClick:()=>n(V9),children:[p.jsx(Xv,{children:p.jsx(OJe,{style:{width:24}})}),"Receive funds"]}),(a==null?void 0:a.showAlternateFundingMethod)&&((x=h.onFundWithCard)==null?void 0:x[1])&&p.jsx(c1e,{theme:o.appearance.palette.colorScheme,children:p.jsxs(plt,{children:["Having trouble or facing location restrictions?"," ",p.jsx(glt,{onClick:h.onFundWithCard[1],children:"Try a different provider."})]})})]}),p.jsx(ln,{})]})}},V9={component:()=>{var O,U,z;let{wallets:t}=Ap(),{wallets:e}=nx(),{data:n,setModalData:r,navigate:i,lastScreen:s}=jt(),{rpcConfig:o,appId:a,createAnalyticsEvent:c,closePrivyModal:l}=Ht(),u=Vr(),[d,h]=E.useState(void 0),[f,m]=E.useState(!1),y=ex(),v=n==null?void 0:n.funding,{reloadBalance:b}=u1e({rpcConfig:o,appId:a,address:v.chainType==="ethereum"?v.address:void 0,chain:v.chainType==="ethereum"?v.chain:void 0}),C=v.chainType==="solana",x=C?"SOL":v.erc20Address?(O=v.erc20ContractInfo)==null?void 0:O.symbol:v.chain.nativeCurrency.symbol,_=C?e.find(({address:L})=>L===v.address):t.find(({address:L})=>po(L)===po(v.address));
197if(!v)return r({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:s||ca},funding:n==null?void 0:n.funding,sendTransaction:n==null?void 0:n.sendTransaction}),i(Hr),p.jsx(p.Fragment,{});E.useEffect(()=>{let L=C?async function(){if(v.chainType!=="solana")return;let k=y(tx);k?k.getBalance({address:v.address,cluster:v.cluster}).then(M=>{let W=BigInt(M);d&&W>d&&(m(!0),c({eventName:kl,payload:{provider:"manual",status:"success",chainType:"solana",address:_==null?void 0:_.address,value:us(W-d,9),token:"SOL"}})),h(W)}):console.warn("Unable to load solana plugin, skipping balance")}:async function(){v.chainType==="ethereum"&&(async()=>{if(!v.erc20Address)return await b()??BigInt(0);{let{balance:k}=await d1e({chain:v.chain,address:v.address,erc20Address:v.erc20Address,rpcConfig:o,appId:a});return k}})().then(k=>{var M,W;d&&k>d&&(m(!0),c({eventName:kl,payload:{provider:"manual",status:"success",chainType:"ethereum",address:_==null?void 0:_.address,chainId:v.chain.id,value:us(k-d,((M=v.erc20ContractInfo)==null?void 0:M.decimals)??18),token:((W=v.erc20ContractInfo)==null?void 0:W.symbol)??v.erc20Address??"ETH"}})),h(k)}).catch(()=>h(void 0))},S=setInterval(L,2e3);return L(),()=>clearInterval(S)},[d]);let $=E.useMemo(()=>d!==void 0&&d>=parseFloat(v.amount),[d,v.amount]),I=E.useMemo(()=>{var L;return d==null?"":v.isUSDC?tK({amount:d,decimals:6}):C?np(d,3,!0,!0):((L=v.erc20ContractInfo)==null?void 0:L.decimals)!=null?tK({amount:d,decimals:v.erc20ContractInfo.decimals}):eOe({wei:d})},[d,C,v]),R=v.chainType==="ethereum"?v.chain.name:Olt[v.cluster.name],N=E.useMemo(()=>{var L,S;return((L=v.uiConfig)==null?void 0:L.receiveFundsTitle)===""?null:p.jsx(uh,{children:((S=v.uiConfig)==null?void 0:S.receiveFundsTitle)??`Receive ${v.amount} ${x??""}`.trim()})},[(U=v.uiConfig)==null?void 0:U.receiveFundsTitle,v.amount,x]),T=E.useMemo(()=>{var L,S;return((L=v.uiConfig)==null?void 0:L.receiveFundsSubtitle)===""?null:p.jsx(Sp,{children:((S=v.uiConfig)==null?void 0:S.receiveFundsSubtitle)??`Scan this code or copy your wallet address to receive funds on ${R}.`})},[(z=v.uiConfig)==null?void 0:z.receiveFundsSubtitle,R]);return p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),N,T,p.jsxs(D_,{style:{gap:"1rem",margin:N||T?"1rem 0":"0"},children:[p.jsx(G_,{url:`${v.chainType}:${v.address}`,size:200,squareLogoElement:Mlt}),p.jsxs(c1e,{theme:u.appearance.palette.colorScheme,children:["Make sure to send funds on ",R,"."]}),p.jsx(J_,{title:"Your wallet",errMsg:void 0,showIcon:!0,isLoading:!v||d===void 0,isPulsing:!$,balance:`${I} ${x}`,address:v.address,statusColor:$?"green":"gray"}),f&&p.jsx(tn,{onClick:()=>l({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),p.jsx(ln,{})]})}};let Mlt=({...t})=>p.jsx(Ipe,{color:"black",...t}),Olt={devnet:"Devnet","mainnet-beta":"Solana",testnet:"Testnet"},jlt=({data:t})=>{let e=n=>typeof n=="object"&&n!==null?p.jsx(Nlt,{children:Object.entries(n).map(([r,i])=>p.jsxs("li",{children:[p.jsxs("strong",{children:[r,":"]})," ",e(i)]},r))}):p.jsx("span",{children:String(n)});return p.jsx("div",{children:e(t)})};const nj=ue.div.withConfig({displayName:"Message",componentId:"sc-ccf49562-0"})(["margin-top:1.5rem;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);padding:12px;text-align:left;max-height:310px;overflow:scroll;white-space:pre-wrap;width:100%;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]);let Nlt=ue.ul.withConfig({displayName:"MessageList",componentId:"sc-ccf49562-1"})(["margin-left:12px !important;white-space:nowrap;&:first-child{margin-left:0 !important;}strong{font-weight:500 !important;}"]);const $1e=({data:t})=>p.jsx(nj,{children:p.jsx(jlt,{data:t})});let Dlt=ue.div.withConfig({displayName:"Container",componentId:"sc-b3a607dd-0"})(["display:flex;flex-direction:column;min-height:72px;"]);var Llt=({onBack:t,details:e})=>p.jsxs(Dlt,{children:[p.jsx(_t,{backFn:t}),p.jsx($1e,{data:e}),p.jsx(ln,{})]});const I1e=ue(An).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);
197svg{fill:var(--privy-color-accent);}"]);var sX=({iconUrl:t,value:e,symbol:n,usdValue:r,nftName:i,$isLoading:s})=>s?p.jsx(oX,{$isLoading:s}):p.jsxs("div",{children:[p.jsxs(oX,{$isLoading:s,children:[t&&p.jsx(Flt,{src:t,alt:"Token icon"}),i,e," ",n]}),r&&p.jsxs(Blt,{$isLoading:s,children:["$",r]})]});let oX=ue.span.withConfig({displayName:"Value",componentId:"sc-d8e62921-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],j_);const Blt=ue.span.withConfig({displayName:"Subvalue",componentId:"sc-d8e62921-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],j_);let Flt=ue.img.withConfig({displayName:"TokenIcon",componentId:"sc-d8e62921-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const Ult=t=>{var a,c,l,u,d,h,f,m;let{chain:e,transactionDetails:n,isTokenContractInfoLoading:r,symbol:i}=t,{action:s,functionName:o}=n;return p.jsx(OB,{children:p.jsxs(Z2,{children:[s!=="transaction"&&p.jsxs($n,{children:[p.jsx(An,{children:"Action"}),p.jsx(jn,{children:o})]}),o==="mint"&&"args"in n&&n.args.filter(y=>y).map((y,v)=>{var b,C;return p.jsxs($n,{children:[p.jsx(An,{children:`Param ${v}`}),p.jsx(jn,{children:typeof y=="string"&&Wr(y)?p.jsx(zi,{address:y,url:(C=(b=e==null?void 0:e.blockExplorers)==null?void 0:b.default)==null?void 0:C.url,showCopyIcon:!1}):y==null?void 0:y.toString()})]},v)}),o==="setApprovalForAll"&&n.operator&&p.jsxs($n,{children:[p.jsx(An,{children:"Operator"}),p.jsx(jn,{children:p.jsx(zi,{address:n.operator,url:(c=(a=e==null?void 0:e.blockExplorers)==null?void 0:a.default)==null?void 0:c.url,showCopyIcon:!1})})]}),o==="setApprovalForAll"&&n.approved!==void 0&&p.jsxs($n,{children:[p.jsx(An,{children:"Set approval to"}),p.jsx(jn,{children:n.approved?"true":"false"})]}),o==="transfer"||o==="transferFrom"||o==="safeTransferFrom"||o==="approve"?p.jsxs(p.Fragment,{children:["formattedAmount"in n&&n.formattedAmount&&p.jsxs($n,{children:[p.jsx(An,{children:"Amount"}),p.jsxs(jn,{$isLoading:r,children:[n.formattedAmount," ",i]})]}),"tokenId"in n&&n.tokenId&&p.jsxs($n,{children:[p.jsx(An,{children:"Token ID"}),p.jsx(jn,{children:n.tokenId.toString()})]})]}):null,o==="safeBatchTransferFrom"&&p.jsxs(p.Fragment,{children:["amounts"in n&&n.amounts&&p.jsxs($n,{children:[p.jsx(An,{children:"Amounts"}),p.jsx(jn,{children:n.amounts.join(", ")})]}),"tokenIds"in n&&n.tokenIds&&p.jsxs($n,{children:[p.jsx(An,{children:"Token IDs"}),p.jsx(jn,{children:n.tokenIds.join(", ")})]})]}),o==="approve"&&n.spender&&p.jsxs($n,{children:[p.jsx(An,{children:"Spender"}),p.jsx(jn,{children:p.jsx(zi,{address:n.spender,url:(u=(l=e==null?void 0:e.blockExplorers)==null?void 0:l.default)==null?void 0:u.url,showCopyIcon:!1})})]}),(o==="transferFrom"||o==="safeTransferFrom"||o==="safeBatchTransferFrom")&&n.transferFrom&&p.jsxs($n,{children:[p.jsx(An,{children:"Transferring from"}),p.jsx(jn,{children:p.jsx(zi,{address:n.transferFrom,url:(h=(d=e==null?void 0:e.blockExplorers)==null?void 0:d.default)==null?void 0:h.url,showCopyIcon:!1})})]}),(o==="transferFrom"||o==="safeTransferFrom"||o==="safeBatchTransferFrom")&&n.transferTo&&p.jsxs($n,{children:[p.jsx(An,{children:"Transferring to"}),p.jsx(jn,{children:p.jsx(zi,{address:n.transferTo,url:(m=(f=e==null?void 0:e.blockExplorers)==null?void 0:f.default)==null?void 0:m.url,showCopyIcon:!1})})]})]})})};let zlt={success:"background: var(--privy-color-success-lightest, #dcfce7);",warn:"background: var(--privy-color-warn-lightest, #fff7e6);",error:"background: var(--privy-color-error-lightest, #fde8e8);"};const aX=ue.div.withConfig({displayName:"Pill",componentId:"sc-8c138024-0"})(["border-radius:var(--privy-border-radius-md,8px);padding:12px;text-align:left;margin-top:23px;",""],t=>zlt[t.variant]),Wlt=({variant:t,setPreventMaliciousTransaction:e,preventMaliciousTransaction:n})=>t==="warn"?p.jsx(aX,{variant:t,children:p.jsxs("div",{className:"flex flex-row",children:[p.jsx(cX,{variant:t}),p.jsxs("p",{children:[p.jsx("b",{children:"Warning: Suspicious transaction"}),p.jsx("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})]})}):t==="error"?p.jsx(aX,{variant:t,children:p.jsxs("div",{className:"flex flex-col",children:[p.jsxs("div",{className:"flex flex-row",children:[p.jsx(cX,{variant:t}),p.jsxs("p",{children:[p.jsx("b",{children:"This is a malicious transaction"}),p.jsx("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})]}),p.jsxs("div",{className:"mt-3 flex flex-row gap-2",children:[p.jsx(f0e,{color:"var(--privy-color-error)",checked:!n,readOnly:!0,onClick:()=>e(!n)}),p.jsx("p",{children:"I understand and want to proceed anyways."})]})]})}):void 0;let cX=ue(Uu).withConfig({displayName:"StyledExclamationTriangleIcon",componentId:"sc-e6305f32-0"})(["width:20px;height:20px;stroke-width:2px;flex-shrink:0;display:inline-block;margin-right:8px;",";"],t=>t.variant==="error"?"color: var(--privy-color-error)":"color: var(--privy-color-warn)");const T1e=({transactionIndex:t,maxIndex:e})=>typeof t!="number"||e===0?"":` (${t+1} / ${e+1})`,Hlt=({img:t,submitError:e,prepareError:n,onClose:r,action:i,title:s,subtitle:o,txValue:a,to:c,tokenAddress:l,network:u,missingFunds:d,fee:h,from:f,cta:m,disabled:y,chain:v,isSubmitting:b,isPreparing:C,isTokenPriceLoading:x,isTokenContractInfoLoading:_,isSponsored:$,symbol:I,balance:R,onClick:N,transactionDetail
197s:T,transactionIndex:O,maxIndex:U,onBack:z,chainName:L,validation:S,hasScanDetails:k,setIsScanDetailsOpen:M,preventMaliciousTransaction:W,setPreventMaliciousTransaction:H,tokensSent:D,tokensReceived:V,isScanning:B,isCancellable:P})=>{var oe,de,ke,Be,$e,He,Ge,je,xt,ft,it;let{showTransactionDetails:j,setShowTransactionDetails:G,hasMoreDetails:Y,isErc20Ish:te}=(be=>{let[Lt,Qe]=E.useState(!1),Ue=!0,Ye=!1;return(!be||be.isErc20Ish||be.action==="transaction")&&(Ue=!1),Ue&&(Ye=Object.entries(be||{}).some(([tt,ze])=>ze&&!["action","isErc20Ish","isNFTIsh"].includes(tt))),{showTransactionDetails:Lt,setShowTransactionDetails:Qe,hasMoreDetails:Ue&&Ye,isErc20Ish:be==null?void 0:be.isErc20Ish}})(T),ae=te&&_||C||x||B;return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:r,backFn:z}),t&&p.jsx(M1e,{children:t}),p.jsxs(uh,{style:{marginTop:t?"1.5rem":0},children:[s,p.jsx(T1e,{maxIndex:U,transactionIndex:O})]}),p.jsx(Sp,{children:o}),p.jsxs(Z2,{style:{marginTop:"2rem"},children:[(!!D[0]||ae)&&p.jsxs($n,{children:[V.length>0?p.jsx(An,{children:"Send"}):p.jsx(An,{children:"Amount"}),p.jsx(sX,{iconUrl:(oe=D[0])==null?void 0:oe.iconUrl,value:(de=D[0])==null?void 0:de.value,usdValue:(ke=D[0])==null?void 0:ke.usdValue,symbol:(Be=D[0])==null?void 0:Be.symbol,nftName:($e=D[0])==null?void 0:$e.nftName,$isLoading:ae})]}),V.length>0&&p.jsxs($n,{children:[p.jsx(An,{children:"Receive"}),p.jsx("div",{className:"flex flex-col",children:V.map((be,Lt)=>p.jsx(sX,{iconUrl:be.iconUrl,value:be.value,usdValue:be.usdValue,symbol:be.symbol,nftName:be.nftName},Lt))})]}),T&&"spender"in T&&(T!=null&&T.spender)?p.jsxs($n,{children:[p.jsx(An,{children:"Spender"}),p.jsx(jn,{children:p.jsx(zi,{address:T.spender,url:(Ge=(He=v==null?void 0:v.blockExplorers)==null?void 0:He.default)==null?void 0:Ge.url,showCopyIcon:!1})})]}):null,c&&p.jsxs($n,{children:[p.jsx(An,{children:"To"}),p.jsx(jn,{children:p.jsx(zi,{address:c,url:(xt=(je=v==null?void 0:v.blockExplorers)==null?void 0:je.default)==null?void 0:xt.url,showCopyIcon:!1})})]}),l&&p.jsxs($n,{children:[p.jsx(An,{children:"Token address"}),p.jsx(jn,{children:p.jsx(zi,{address:l,url:(it=(ft=v==null?void 0:v.blockExplorers)==null?void 0:ft.default)==null?void 0:it.url,showCopyIcon:!1})})]}),p.jsxs($n,{children:[p.jsx(An,{children:"Network"}),p.jsx(jn,{children:u})]}),p.jsxs($n,{children:[p.jsx(An,{children:"Estimated fee"}),p.jsx(jn,{$isLoading:C||x||$===void 0,children:$?"Sponsored":h})]}),Y&&!k&&p.jsxs(p.Fragment,{children:[p.jsx($n,{className:"cursor-pointer",onClick:()=>G(!j),children:p.jsxs(Xct,{className:"flex items-center gap-x-1",children:["Details"," ",p.jsx(x_,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:j?"rotate(180deg)":void 0}})]})}),j&&T&&p.jsx(Ult,{action:i,chain:v,transactionDetails:T,isTokenContractInfoLoading:_,symbol:I})]}),k&&p.jsx($n,{children:p.jsxs(I1e,{onClick:()=>M(!0),children:[p.jsx("span",{className:"text-color-primary",children:"Details"}),p.jsx(Wce,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),p.jsx(ah,{}),e?p.jsx(hh,{style:{marginTop:"2rem"},children:e.message}):n?p.jsx(hh,{style:{marginTop:"2rem"},children:n.shortMessage??R1e}):null,p.jsx(Wlt,{variant:S,preventMaliciousTransaction:W,setPreventMaliciousTransaction:H}),p.jsx(P1e,{$useSmallMargins:!(!n&&!e&&S!=="warn"&&S!=="error"),title:Number(a)>0?void 0:$!==!1?"Your wallet":void 0,address:f,balance:R,isLoading:C||x,errMsg:C||n||e||!d?void 0:`Add funds on ${(v==null?void 0:v.name)??L} to complete transaction.`}),p.jsx(tn,{style:{marginTop:"1rem"},loading:b,disabled:y||C,onClick:N,children:m}),P&&p.jsx(q5,{style:{marginTop:"1rem"},onClick:r,isSubmitting:!1,children:"Not now"}),p.jsx(ln,{})]})},Vlt=({img:t,title:e,subtitle:n,cta:r,network:i,blockExplorerUrl:s,transactionIndex:o,maxIndex:a,isMissingFunds:c,submitError:l,parseError:u,total:d,amount:h,fee:f,balance:m,from:y,to:v,tokenAddress:b,tokenAccount:C,tokenAccountOwner:x,programAddress:_,transactingWalletAddress:$,disabled:I,isSubmitting:R,isPreparing:N,isTokenPriceLoading:T,onClick:O,onClose:U,onBack:z})=>{let L=N||T;return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:U,backFn:z}),t&&p.jsx(M1e,{children:t}),p.jsxs(uh,{style:{marginTop:t?"1.5rem":0},children:[e,p.jsx(T1e,{maxIndex:a,transactionIndex:o})]}),p.jsx(Sp,{children:n}),p.jsxs(Z2,{style:{marginTop:"2rem"},children:[(d||L)&&p.jsxs($n,{children:[p.jsx(An,{children:"Total"}),p.jsx(jn,{$isLoading:L,children:d})]}),y&&y!==$&&p.jsxs($n,{children:[p.jsx(An,{children:"From"}),p.jsx(jn,{children:p.jsx(zi,{address:y,url:s,showCopyIcon:!1})})]}),v&&p.jsxs($n,{children:[p.jsx(An,{children:"To"}),p.jsx(jn,{children:p.jsx(zi,{address:v,url:s,showCopyIcon:!1})})]}),x&&p.jsxs($n,{children:[p.jsx(An,{children:"Token account owner"}),p.jsx(jn,{children:p.jsx(zi,{address:x,url:s,showCopyIcon:!1})})]}),C&&p.jsxs($n,{children:[p.jsx(An,{children:"Token account"}),p.jsx(jn,{children:p.jsx(zi,{address:C,url:s,showCopyIcon:!1})})]}),b&&p.jsxs($n,{children:[p.jsx(An,{children:"Token address"}),p.jsx(jn,{children:p.jsx(zi,{address:b,url:s,showCopyIcon:!1})})]}),_&&p.jsxs($n,{children:[p.jsx(An,{children:"Program address"}),p.jsx(jn,{children:p.jsx(zi,{address:_,url:s,showCopyIcon:!1})})]}),i&&p.jsxs($n,{children:[p.jsx(An,{children:"Network"}),p.jsx(jn,{children:i})]}),(h||L)&&p.jsxs($n,{children:[p.jsx(An,{children:"Amount"}),p.jsx(jn,{children:p.jsx(jn,{$isLoading:L,children:h})})]}),(f||L)&&p.jsxs($n,{children:[p.jsx(An,{children:"Estimated fee"}),p.jsx(jn,{$isLoading:L,children:f})]})]}),p.jsx(ah,{}),l?p.jsx(hh,{style:{marginTop:"2rem"},children:l.message}):u?p.jsx(hh,{style:{marginTop:"2rem"},children:R1e}):null,p.jsx(P1e,{$useSmallMargins:!(!u&&!l),title:"Your wallet",address:$,balance:m,isLoading:N||T,errMsg:N||u||l||!c?void 0:"Add funds on Solana to complete transaction."}),p.jsx(tn,{style:{marginTop:"1rem"},loading:R,disabled:I||N,onClick:O,children:r}),p.jsx(ln,{})]})};let P1e=ue(J_).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-4bd3bb7d-0"})(["",""],t=>t.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"),R1e="There was an error preparing your transaction. Your transaction request will likely fail.",M1e=ue.div.withConfig({displayName:"ImageContainer",componentId:"sc-4bd3bb7d-1"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),qlt=()=>p.jsxs(Ylt,{children:[p.jsx(Xlt,{}),p.jsx(Qlt,{})]});const O1e=({transactionError:t,chainId:e,onClose:n,onRetry:r,network:i,connection:s,transactionHash:o})=>{let{chains:a}=Ht(),[c,l]=E.useState(!1),{errorCode:u,errorMessage:d}=((f,m)=>{if(m==="ethereum")return{errorCode:f.details??f.message,errorMessage:f.shortMessage};let y=f.txSignature,v=(f==null?void 0:f.transactionMessage)||"Something went wrong.";if(Array.isArray(f.logs)){let b=f.logs.find(C=>/insufficient (lamports|funds)/gi.test(C));b&&(v=b)}return{transactionHash:y,errorMessage:v}})(t,i),h=(({chains:f,chainId:m,network:y,connection:v,transactionHash:b})=>{var C,x;return y==="ethereum"?((x=(C=f.find(_=>_.id===m))==null?void 0:C.blockExplorers)==null?void 0:x.default.url)??"https://etherscan.io":function(_,$){return`https://explorer.solana.com/tx/${_}
197?cluster=${$}`}(b||"",R_((v==null?void 0:v.rpcEndpoint)||""))})({chains:a,chainId:e,network:i,connection:s,transactionHash:o});return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:n}),p.jsxs(Klt,{children:[p.jsx(qlt,{}),p.jsx(Glt,{children:u}),p.jsx(Zlt,{children:"Please try again."}),p.jsxs(uX,{children:[p.jsx(lX,{children:"Error message"}),p.jsx(dX,{$clickable:!1,children:d})]}),o&&p.jsxs(uX,{children:[p.jsx(lX,{children:"Transaction hash"}),p.jsxs(eut,{children:["Copy this hash to view details about the transaction on a"," ",p.jsx("u",{children:p.jsx("a",{href:h,children:"block explorer"})}),"."]}),p.jsxs(dX,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(o),l(!0)},children:[o,p.jsx(rut,{clicked:c})]})]}),p.jsx(Jlt,{onClick:()=>r({resetNonce:!!o}),children:"Retry transaction"})]}),p.jsx(Bn,{})]})};let Klt=ue.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-6e9001c5-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),Glt=ue.span.withConfig({displayName:"ErrorCode",componentId:"sc-6e9001c5-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),Zlt=ue.span.withConfig({displayName:"Subtitle",componentId:"sc-6e9001c5-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),Ylt=ue.div.withConfig({displayName:"CircleContainer",componentId:"sc-6e9001c5-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),Qlt=ue(c_).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-6e9001c5-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),Xlt=ue.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-6e9001c5-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),Jlt=ue(tn).withConfig({displayName:"RetryButton",componentId:"sc-6e9001c5-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),lX=ue.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-6e9001c5-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),uX=ue.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-6e9001c5-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),eut=ue.text.withConfig({displayName:"HelperText",componentId:"sc-6e9001c5-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),dX=ue.span.withConfig({displayName:"TextBox",componentId:"sc-6e9001c5-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],t=>t.$clickable&&`cursor: pointer; 198 transition: background-color 0.3s; 199 padding-right: 45px; 200 201 &:hover { 202 background-color: var(--privy-color-foreground-4); 203 }`),tut=ue($it).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-6e9001c5-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),nut=ue(ahe).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-6e9001c5-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),rut=({clicked:t})=>p.jsx(t?nut:tut,{}),iut=({gasUsed:t,effectiveGasPrice:e})=>{if(t&&e)try{return Qt(t*e)}catch{return}};const sut=({txn:t,receipt:e,transactionInfo:n,onClose:r,tokenPrice:i,tokenSymbol:s,receiptHeader:o,receiptDescription:a})=>p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:r}),p.jsx(O_,{title:o??"Transaction complete!",description:a??"You're all set."}),p.jsx(i1e,{tokenPrice:i,from:e.from,to:e.to,gas:iut(e),txn:t,transactionInfo:n,tokenSymbol:s}),p.jsx(ah,{}),p.jsx(out,{loading:!1,onClick:r,children:"All Done"}),p.jsx(dr,{}),p.jsx(ln,{})]});let out=ue(tn).withConfig({displayName:"SubmitButton",componentId:"sc-f857236b-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);const aut=[{constant:!1,inputs:[{name:"_salt",type:"bytes32"},{name:"_initializer",type:"bytes"}],name:"deployAccount",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],cut=[{name:"from",type:"address"},{name:"param2",type:"address"},{name:"param3",type:"bytes"},{name:"param4",type:"tuple",components:[]},{type:"tuple",components:[{name:"param5",type:"address"},{name:"param6",type:"uint256"},{name:"param7",type:"uint256"},{name:"encodedInitData",type:"bytes"}]}],lut=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],uut=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"payable",type:"function"}],dut=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],hut=[{constant:!1,inputs:[{name:"_operator",type:"address"},{name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],fut=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],put=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenIds",type:"uint256[]"},{name:"_amounts",type:"uint256[]"},{name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],gut=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"},{name:"_amount",type:"uint256"},{name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],j1e=(t,e)=>{let n=ud(lut,t);if(n)return{action:"approve",functionName:"approve",isErc20Ish:!0,isNFTIsh:!1,spender:n.args[0],amount:n.args[
2031]};let r=ud(JO,t);if(r)return{action:"transfer",functionName:"transfer",isErc20Ish:!0,isNFTIsh:!1,transferTo:r.args[0],amount:r.args[1]};if(!e)return{action:"transaction",functionName:"",isErc20Ish:!1,isNFTIsh:!1};let i=ud(aut,t);if(i&&typeof i.args[1]=="string"){let d=mut(i.args[1]);if(d&&d[4].encodedInitData)return j1e(d[4].encodedInitData,e)}let s=ud(hut,t);if(s)return{action:"approve",functionName:"setApprovalForAll",isNFTIsh:!0,isErc20Ish:!1,operator:s.args[0],approved:s.args[1]};let o=ud(fut,t);if(o)return{action:"transfer",functionName:"transferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:o.args[0],transferTo:o.args[1],tokenId:o.args[2]};let a=ud(dut,t);if(a)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:a.args[0],transferTo:a.args[1],tokenId:a.args[2]};let c=ud(gut,t);if(c)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:c.args[0],transferTo:c.args[1],tokenId:c.args[2],amount:c.args[3]};let l=ud(put,t);if(l)return{action:"batch transfer",functionName:"safeBatchTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:l.args[0],transferTo:l.args[1],tokenIds:l.args[2],amounts:l.args[3]};let u=ud(uut,t);return u?{action:"mint",functionName:u.functionName,isNFTIsh:!0,isErc20Ish:!1,args:u.args}:{action:"transaction",isErc20Ish:!1,isNFTIsh:!1}};let ud=(t,e)=>{try{let n=C9e({abi:t,data:e});return{functionName:n.functionName,args:n.args||[]}}catch{return null}},mut=t=>{try{if(typeof t=="string")return I2(cut,`0x${t.slice(10)}`)}catch{return null}};const yut=(t,e,n)=>{let[r,i]=E.useState(null),{getAccessToken:s}=Wn(),{walletProxy:o}=Ht();return E.useEffect(()=>{r&&i(null),(async()=>{if(!await s()||!o||!e)return null;
203let a=[],c=!0,l=await MB(t,n,e.address).catch(u=>(u.details.includes("insufficient funds")?c=!1:a.push(u),t));return{tx:l,totalGasEstimate:l.gas,hasFunds:c,errors:a}})().then(i)},[t]),r};let hX=new Vd(new ty("There was an issue preparing your transaction",cl.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),fX=(t,e)=>t!=null&&t.sendTransaction?"transactionRequest"in t.sendTransaction?t.sendTransaction.transactionRequest:t.sendTransaction.transactionRequests[e]:void 0;const N1e={component:()=>{var En,yr,xn,kt,Ie,It,rt,Zt,yt,pt,St,qe,Et,Ze,wt,ot,qt;let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:n,navigate:r}=jt(),{rpcConfig:i,chains:s,closePrivyModal:o,walletProxy:a,client:c,showFiatPrices:l}=Ht(),{getAccessToken:u,user:d}=Wn(),h=Vr(),[f,m]=E.useState(0),y=(mt=>mt!=null&&mt.sendTransaction?"transactionRequest"in mt.sendTransaction?0:mt.sendTransaction.transactionRequests.length-1:0)(t),[v,b]=E.useState(fX(t,f)),[C,x]=E.useState(null),[_,$]=E.useState(),[I,R]=E.useState(!1),[N,T]=E.useState(null),[O,U]=E.useState(null),[z,L]=E.useState(null),[S,k]=E.useState(void 0),[M,W]=E.useState(void 0),[H,D]=E.useState(!1),[V,B]=E.useState(!1),[P,j]=E.useState([]),[G,Y]=E.useState([]),[te,ae]=E.useState(!1),[oe,de]=E.useState(void 0);if(!v||!(t!=null&&t.sendTransaction)||!(t!=null&&t.sendTransaction.transactingWallet))return p.jsx(K5,{error:Error("Invalid transaction request"),onClick:()=>{var mt;(mt=t==null?void 0:t.sendTransaction)==null||mt.onFailure(hX),o({shouldCallAuthOnSuccess:!1})}});let{entropyId:ke,entropyIdVerifier:Be,transactingWallet:$e}=t.sendTransaction,He=E.useMemo(()=>s.find(mt=>Number(mt.id)===Number(v.chainId)),[v.chainId]),Ge=(He==null?void 0:He.nativeCurrency.symbol)??"ETH",je=E.useMemo(()=>j1e(v.data,!!h.embeddedWallets.extendedCalldataDecoding),[v.data]),{action:xt,isErc20Ish:ft,isNFTIsh:it}=je,{toAddress:be,tokenAddress:Lt}=E.useMemo(()=>({toAddress:je.isErc20Ish?je.transferTo:v.to??void 0,tokenAddress:je.isErc20Ish?v.to:void 0}),[je]);E.useEffect(()=>{v.to&&He&&ft&&f1e({address:v.to,chain:He,rpcConfig:h.rpcConfig,privyAppId:h.id}).then(x).catch(console.error)},[v.to,He]);let{tokenPrice:Qe,isTokenPriceLoading:Ue}=K2(v.chainId),{balance:Ye}=u1e({rpcConfig:h.rpcConfig,appId:h.id,address:$e.address,chain:He}),tt=E.useMemo(()=>l2(Number(v.chainId),s,i,{appId:h.id}),[v.chainId,i]),ze=yut(v,$e,tt);E.useEffect(()=>{b(fX(t,f))},[f]),E.useEffect(()=>{var mt;(mt=t.sendTransaction)!=null&&mt.getIsSponsored?t.sendTransaction.getIsSponsored().then($).catch(console.error):$(!1)},[t.sendTransaction.getIsSponsored]);let Ne=()=>{var mt,Bt,un;if(!I)return N?(mt=t==null?void 0:t.sendTransaction)==null||mt.onSuccess({hash:N}):z||ze!=null&&ze.errors[0]?(Bt=t==null?void 0:t.sendTransaction)==null||Bt.onFailure(z??(ze==null?void 0:ze.errors[0])??hX):(un=t==null?void 0:t.sendTransaction)==null||un.onFailure(new Vd(new ty("The user rejected the request",cl.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1})};e.current=Ne;let J=!!(t.funding&&t.funding.supportedOptions.length>0),q=bl(BigInt((ze==null?void 0:ze.totalGasEstimate)??0n),Ge),Z=l&&Qe?i1(BigInt((ze==null?void 0:ze.totalGasEstimate)??0n),Qe):void 0,se=bl(Ye??0n,Ge,void 0,!0),he=l&&Qe?i1(Ye??0n,Qe):void 0,fe=(xn=(yr=(En=t.sendTransaction)==null?void 0:En.uiOptions)==null?void 0:yr.transactionInfo)==null?void 0:xn.title;fe||(fe=xt==="approve"?ft?"Confirm address":"Confirm action":`Approve ${xt}`);let ye=((Ie=(kt=t.sendTransaction)==null?void 0:kt.uiOptions)==null?void 0:Ie.description)||(ft&&xt==="approve"?`${h.name} would like your permission for ${po(je.spender)} to spend tokens on your behalf.`:`${h.name} wants your permission to approve the following transaction.`),nt=(yt=(Zt=(rt=(It=t.sendTransaction)==null?void 0:It.uiOptions)==null?void 0:rt.transactionInfo)==null?void 0:Zt.contractInfo)!=null&&yt.imgUrl?p.jsx("img",{src:t.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,vt=!(!ze||ze.errors[0]||ze.hasFunds||_!==!1),Nt=vt&&J,mn=Nt?"Add funds":((St=(pt=t.sendTransaction)==null?void 0:pt.uiOptions)==null?void 0:St.buttonText)||(f<y?"Continue":"Approve");
203if(E.useEffect(()=>{let mt=(un,Ve,st)=>{if(Ve.isErc20Ish&&Ve.amount&&st)de(m1e({amount:Ve.amount,decimals:st.decimals})),j([{value:oe,symbol:st==null?void 0:st.symbol}]);else if(un.value){let X=BigInt(un.value),ee=Qe&&i1(X,Qe);j(l&&ee?[{value:ee}]:[{value:G0e(X),symbol:Ge}])}else j(l?[{value:"$0"}]:[{value:"0",symbol:Ge}])},Bt=(ze==null?void 0:ze.tx)??v;h.embeddedWallets.transactionScanning.enabled&&Bt?(ae(!0),(async un=>{var Ve,st,X,ee;if(c)return await c.scanTransaction({metadata:{domain:h.embeddedWallets.transactionScanning.domain},chain_id:un.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:un.from,to:un.to,value:(Ve=un.value)==null?void 0:Ve.toString(),gas:(st=un.gas)==null?void 0:st.toString(),gasPrice:(X=un.gasPrice)==null?void 0:X.toString(),nonce:(ee=un.nonce)==null?void 0:ee.toString(),data:un.data}]}})})(Bt).then(un=>{if(!un)throw Error("Transaction scan failed");if(un.validation.status==="Success"&&(un.validation.result_type==="Benign"?W("safe"):un.validation.result_type==="Warning"?W("warn"):un.validation.result_type==="Malicious"&&(W("error"),B(!0))),un.simulation.status!=="Success")throw Error("Simulation failed");{k(un.simulation.params);let{assetsIn:Ve,assetsOut:st}=function(X,ee){var le,_e,me,we;let ie=[],ce=[];if(X){for(let Te of X)if(Te.in[0]){let Ct;Ct=Te.asset.type==="ERC721"||Te.in[0].value==="approve_for_all"?{nftName:Te.asset.name}:{iconUrl:Te.asset.logo_url,value:Te.in[0].value,symbol:Te.asset.symbol,usdValue:Te.in[0].usd_price},ie.push(Ct)}else if((le=Te.out[0])!=null&&le.value){let Ct;Ct=Te.asset.type==="ERC721"||Te.out[0].value==="approve_for_all"?{nftName:Te.asset.name}:{iconUrl:Te.asset.logo_url,value:Te.out[0].value,symbol:Te.asset.symbol,usdValue:Te.out[0].usd_price},ce.push(Ct)}}for(let Te of ee)for(let Ct of Object.keys(Te.spenders)){let at;at=Te.asset.type==="ERC721"||((_e=Te.spenders[Ct])==null?void 0:_e.value)==="approve_for_all"?{nftName:Te.asset.name}:{iconUrl:Te.asset.logo_url,value:(me=Te.spenders[Ct])==null?void 0:me.value,symbol:Te.asset.symbol,usdValue:(we=Te.spenders[Ct])==null?void 0:we.usd_price},ce.push(at)}return{assetsIn:ie,assetsOut:ce}}(un.simulation.assets_diffs,un.simulation.exposures);if(st.length===0&&Ve.length===0)throw Error("No tokens found");j(st),Y(Ve)}ae(!1)}).catch(()=>{ae(!1),mt(Bt,je,C)})):mt(Bt,je,C)},[v,ze==null?void 0:ze.tx,je,C]),O)return p.jsx(sut,{txn:(ze==null?void 0:ze.tx)??v,onClose:Ne,receipt:O,transactionInfo:(qe=t.sendTransaction)==null?void 0:qe.uiOptions.transactionInfo,tokenPrice:Qe,tokenSymbol:Ge,receiptHeader:(Et=t.sendTransaction)==null?void 0:Et.uiOptions.successHeader,receiptDescription:(Ze=t.sendTransaction)==null?void 0:Ze.uiOptions.successDescription});if(z)return p.jsx(O1e,{transactionError:z,transactionHash:N??void 0,network:"ethereum",chainId:(ze==null?void 0:ze.tx.chainId)??v.chainId,onClose:Ne,onRetry:({resetNonce:mt})=>{L(null);let Bt={...(ze==null?void 0:ze.tx)??v};mt&&(Bt.nonce=void 0),b(Bt)}});let At=y!==0&&typeof f=="number"&&f!==0?()=>{m(f-1)}:void 0;return H&&S?p.jsx(Llt,{details:S,onBack:()=>D(!1)}):p.jsx(Hlt,{transactionIndex:f,onBack:At,maxIndex:y,disabled:vt&&!J||V,isSubmitting:I,submitError:z,isPreparing:!ze,isTokenPriceLoading:Ue,isTokenContractInfoLoading:!it&&!C,prepareError:ze==null?void 0:ze.errors[0],symbol:C==null?void 0:C.symbol,chain:He,img:nt,title:fe,subtitle:ye,txValue:v.value,fee:Z??q,isSponsored:_,from:($e==null?void 0:$e.address)??"",to:be,tokenAddress:Lt??void 0,network:((wt=h.chains.find(mt=>mt.id===v.chainId))==null?void 0:wt.name)??"",transactionDetails:{...je,formattedAmount:oe},cta:mn,missingFunds:vt,action:xt,balance:he??se,onClose:Ne,onClick:Nt?async()=>{var mt;if($e){if(!J)throw Error("Funding wallet is not enabled");n({...t,funding:{...t.funding,methodScreen:ca,chainType:"ethereum",amount:j1(BigInt((ze==null?void 0:ze.tx.value)??0)+BigInt(((mt=ze==null?void 0:ze.totalGasEstimate)==null?void 0:mt.toString())??0)),chain:He}}),r(ca)}}:async()=>{var mt,Bt,un,Ve;if(f<y)m(f+1);else{R(!0);try{let st=await u();if(I||!st||!$e||!a||!d)return;let X=(mt=t==null?void 0:t.sendTransaction)!=null&&mt.onConfirm?await t.sendTransaction.onConfirm():await a1e({accessToken:st,transactingWallet:$e,entropyId:ke,entropyIdVerifier:Be,walletProxy:a,transactionRequest:(ze==null?void 0:ze.tx)??v,publicClient:tt,requesterAppId:(Bt=t.sendTransaction)==null?void 0:Bt.requesterAppId});if(T(X),(un=t.sendTransaction)==null?void 0:un.signOnly)return await new Promise(ie=>setTimeout(ie,Jr)),(Ve=t==null?void 0:t.sendTransaction)==null||Ve.onSuccess({hash:X}),o({shouldCallAuthOnSuccess:!1});let ee=await tt.waitForTransactionReceipt({hash:X});if(ee.status==="reverted")throw Error("Transaction failed");U(ee)}catch(st){console.warn({transaction:(ze==null?void 0:ze.tx)??v,error:st}),L(st)}finally{R(!1)}}}
203,validation:M,hasScanDetails:!!S,setIsScanDetailsOpen:D,preventMaliciousTransaction:V,setPreventMaliciousTransaction:B,tokensSent:P,tokensReceived:G,isScanning:te,isCancellable:((qt=(ot=t.sendTransaction)==null?void 0:ot.uiOptions)==null?void 0:qt.isCancellable)??!1})}};function ga({title:t}){var o,a;let{currentScreen:e,navigateBack:n,navigate:r,data:i,setModalData:s}=jt();return p.jsx(_t,{title:t,backFn:e===V9?n:e===((o=i==null?void 0:i.funding)==null?void 0:o.methodScreen)?i.funding.comingFromSendTransactionScreen?()=>r(N1e):void 0:(a=i==null?void 0:i.funding)!=null&&a.methodScreen?()=>{let c=i.funding;c.usingDefaultFundingMethod&&(c.usingDefaultFundingMethod=!1),s({funding:c}),r(c.methodScreen)}:void 0})}const D1e={component:()=>{let{rpcConfig:t,appId:e,closePrivyModal:n,createAnalyticsEvent:r}=Ht(),{navigate:i,setModalData:s,app:o,data:a}=jt(),{wallets:c}=Ap(),l=ex(),[u,d]=E.useState(null),[h,f]=E.useState(null),[m,y]=E.useState([]),[v,b]=E.useState(0),[C,x]=E.useState(!1),[_,$]=E.useState(!1),[I,R]=E.useState(!1),[N,T]=E.useState(!1),[O,U]=E.useState(),[z,L]=E.useState();if(!(a!=null&&a.funding)||a.funding.chainType!=="solana")throw Error("Invalid funding data");let{address:S,cluster:k,connectedWalletAddress:M}=a.funding,[W,H]=E.useState(a.funding.amount),D=M?c.find(({address:He})=>He===M):c[0],V=Eh((D==null?void 0:D.walletClientType)||"unknown"),B=(V==null?void 0:V.name)||"wallet",[P,j]=E.useState(null);E.useEffect(()=>{(async()=>{if(!D)return;let He=await D.getEthereumProvider();j(pce({account:D.address,transport:SD(He)}).extend(KD))})().catch(console.error)},[D]);let[G,Y]=E.useState(0n),te=np(G);E.useEffect(()=>{let He=l(tx);He?He.getBalance({address:S,cluster:k}).then(Ge=>Y(BigInt(Ge))):console.warn("Unable to load solana plugin, skipping balance")},[]);let[ae,oe]=E.useState(),{tokenPrice:de}=K2("solana"),{fundingAmountInBaseUnit:ke,fundingAmountInUsd:Be}=Z0e({amount:W,fee:0n,tokenPrice:de});if(E.useEffect(()=>{(async()=>{if(!P||!D)return;let He=["testnet","devnet"].includes(k.name);He&&console.warn("Solana testnets are not supported for bridging");let Ge=gB(o.chains).filter(({testnet:be})=>!!be===He),je=(await y1e({chains:Ge,address:D.address,appId:e,rpcConfig:t})).filter(be=>be.balance>0n);if(je.length<1)return void d(new ve(`Wallet ${po(D.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE));je.sort((be,Lt)=>Number(Lt.balance-be.balance));let xt=(await Promise.allSettled(je.map(async be=>({...be,quote:await f3({isTestnet:!1,input:h3({amount:ke.toString(),user:D.address,recipient:S,destinationChainId:zO,destinationCurrency:WO,originChainId:be.chain.id})})})))).filter(be=>be.status==="fulfilled").map(be=>be.value);if(xt.length<1)return void d(new ve(`Unable to fetch quotes for bridging. Wallet ${po(D.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE));let ft=xt.map(({quote:be,balance:Lt,chain:Qe})=>({bridgeTx:U9(be),balance:Lt,chain:Qe})).filter(({bridgeTx:be})=>!!be);if(ft.length>1)return void y(ft);let it=ft.at(0);it?($(!0),oe({data:it.bridgeTx.data,to:it.bridgeTx.to,value:it.bridgeTx.value,chain:it.chain})):d(new ve(`Unable to select bridge option from quotes. Wallet ${po(D.address)} does not have enough funds.`,void 0,Ce.INSUFFICIENT_BALANCE))})().catch(console.error)},[P]),E.useEffect(()=>{(async()=>{let He,Ge;if(!P||!D||C||I||!ae)return;x(!0);let je=ap({chain:ae.chain,transport:Un(oh(ae.chain,t,e))});try{He=await je.prepareTransactionRequest({account:D.address,to:ae.to,chain:ae.chain,data:ae.data,value:BigInt(ae.value??0)})}catch(xt){console.error(xt),m.length>1&&f(xt.shortMessage??"Something went wrong")}if(He){x(!1),R(!0);try{await P.switchChain({id:ae.chain.id})}catch{await P.addChain({chain:ae.chain}),await P.switchChain({id:ae.chain.id})}try{Ge=await P.sendTransaction(He)}catch(xt){console.error(xt),xt.name==="TransactionExecutionError"&&(m.length<1?d(new ve(xt.shortMessage,void 0,Ce.TRANSACTION_FAILURE)):f(xt.shortMessage??"Something went wrong"))}if(Ge)return await P.waitForTransactionReceipt({hash:Ge}),_?(L("pending"),void U(Ge)):(R(!1),T(!0),void r({eventName:kl,payload:{provider:"external",status:"success",txHash:Ge,address:D.address,chainId:ae.chain.id,chainType:"ethereum",value:ae.value?us(BigInt(ae.value),18):void 0,token:"ETH",destination:S,destinationClusterName:"mainnet-beta",de
203stinationChainType:"solana",destinationValue:us(ke,9),destinationToken:"SOL"}}));R(!1)}else x(!1)})().catch(console.error)},[P,ae]),kB({transactionHash:O,wallet:D,isTestnet:!1,bridgingStatus:z,setBridgingStatus:L,onSuccess({transactionHash:He,wallet:Ge}){$(!1),T(!0),r({eventName:kl,payload:{provider:"external",status:"success",txHash:He,address:Ge.address,chainId:ae==null?void 0:ae.chain.id,chainType:"ethereum",value:ae!=null&&ae.value?us(BigInt(ae.value),18):void 0,token:"ETH",destination:S,destinationClusterName:"mainnet-beta",destinationChainType:"solana",destinationValue:us(ke,9),destinationToken:"SOL"}})},onFailure({error:He}){$(!1),d(He)}}),E.useEffect(()=>{u&&(s({funding:a==null?void 0:a.funding,sendTransaction:a==null?void 0:a.sendTransaction,errorModalData:{error:u,previousScreen:Y2}}),i(Hr,!1))},[u]),E.useEffect(()=>{if(!N)return;let He=setTimeout(n,C_);return()=>clearTimeout(He)},[N]),N)return p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(sr,{}),p.jsxs(Ch,{children:[p.jsx(Tl,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(ei,{title:"Success!",description:`Youâve successfully added ${W} SOL to your ${o.name} wallet. It may take a minute before the funds are available to use.`})]}),p.jsx(dr,{}),p.jsx(ln,{})]});let $e=m[v];return m.length>1&&$e?p.jsx(C1e,{displayName:B,configuredFundingChain:k,formattedBalance:te,fundingAmount:W,fundingCurrency:"SOL",fundingAmountInUsd:Be,options:m,selectedOption:$e,isPreparing:C,isSubmitting:I,addressToFund:S,fundingWalletAddress:(D==null?void 0:D.address)||"",errorMessage:h,onSubmit:()=>{var He;((He=a.funding)==null?void 0:He.amount)!==W?async function(){if(D&&$e)try{let Ge=await f3({isTestnet:!1,input:h3({amount:ke.toString(),user:D.address,recipient:S,destinationChainId:zO,destinationCurrency:WO,originChainId:$e.chain.id})}),je=U9(Ge);if(!je)throw Error("Invalid transaction request");$(!0),oe({data:je.data,to:je.to,value:je.value,chain:$e.chain})}catch(Ge){console.error(Ge),d(new ve("Unable to fetch quotes for bridging",Ge,Ce.INSUFFICIENT_BALANCE))}}().catch(console.error):oe({to:$e.bridgeTx.to,data:$e.bridgeTx.data,value:$e.bridgeTx.value,chain:$e.chain})},onSelect:He=>{He!==v&&(f(null),b(He))},onAmountChange:H}):I&&D?p.jsx(eS,{wallet:D,displayName:B,addressToFund:S,isBridging:_,isErc20Flow:!1,chainId:"solana",chainName:k.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):p.jsxs(p.Fragment,{children:[p.jsx(ga,{}),p.jsx(G2,{}),p.jsx("div",{style:{marginTop:"1rem"}}),p.jsx(ln,{})]})}},wut=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3
203V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7
203h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};class Bu{constructor(e,n){this.scope=e,this.module=n}storeObject(e,n){this.setItem(e,JSON.stringify(n))}loadObject(e){const n=this.getItem(e);return n?JSON.parse(n):void 0}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new Bu("CBWSDK").clear(),new Bu("walletlink").clear()}}const Ei={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},rj={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},L1e="Unspecified error message.",vut="Unspecified server error.";function jB(t,e=L1e){if(t&&Number.isInteger(t)){const n=t.toString();if(ij(rj,n))return rj[n].message;if(B1e(t))return vut}return e}function but(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(rj[e]||B1e(t))}function xut(t,{shouldIncludeStack:e=!1}={}){const n={};if(t&&typeof t=="object"&&!Array.isArray(t)&&ij(t,"code")&&but(t.code)){const r=t;n.code=r.code,r.message&&typeof r.message=="string"?(n.message=r.message,ij(r,"data")&&(n.data=r.data)):(n.message=jB(n.co
203de),n.data={originalError:pX(t)})}else n.code=Ei.rpc.internal,n.message=gX(t,"message")?t.message:L1e,n.data={originalError:pX(t)};return e&&(n.stack=gX(t,"stack")?t.stack:void 0),n}function B1e(t){return t>=-32099&&t<=-32e3}function pX(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function ij(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function gX(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const Qn={rpc:{parse:t=>ec(Ei.rpc.parse,t),invalidRequest:t=>ec(Ei.rpc.invalidRequest,t),invalidParams:t=>ec(Ei.rpc.invalidParams,t),methodNotFound:t=>ec(Ei.rpc.methodNotFound,t),internal:t=>ec(Ei.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ec(e,t)},invalidInput:t=>ec(Ei.rpc.invalidInput,t),resourceNotFound:t=>ec(Ei.rpc.resourceNotFound,t),resourceUnavailable:t=>ec(Ei.rpc.resourceUnavailable,t),transactionRejected:t=>ec(Ei.rpc.transactionRejected,t),methodNotSupported:t=>ec(Ei.rpc.methodNotSupported,t),limitExceeded:t=>ec(Ei.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>um(Ei.provider.userRejectedRequest,t),unauthorized:t=>um(Ei.provider.unauthorized,t),unsupportedMethod:t=>um(Ei.provider.unsupportedMethod,t),disconnected:t=>um(Ei.provider.disconnected,t),chainDisconnected:t=>um(Ei.provider.chainDisconnected,t),unsupportedChain:t=>um(Ei.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new z1e(e,n,r)}}};function ec(t,e){const[n,r]=F1e(e);return new U1e(t,n||jB(t),r)}function um(t,e){const[n,r]=F1e(e);return new z1e(t,n||jB(t),r)}function F1e(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;
203if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}class U1e extends Error{constructor(e,n,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,r!==void 0&&(this.data=r)}}class z1e extends U1e{constructor(e,n,r){if(!Eut(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,r)}}function Eut(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function NB(){return t=>t}const g3=NB(),Cut=NB(),_ut=NB();function Cd(t){return Math.floor(t)}const W1e=/^[0-9]*$/,H1e=/^[a-f0-9]*$/;function d0(t){return DB(crypto.getRandomValues(new Uint8Array(t)))}function DB(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function S8(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function Eb(t,e=!1){const n=t.toString("hex");return g3(e?`0x${n}`:n)}function uT(t){return Eb(sj(t),!0)}function Gl(t){return _ut(t.toString(10))}function Kf(t){return g3(`0x${BigInt(t).toString(16)}`)}function V1e(t){return t.startsWith("0x")||t.startsWith("0X")}function LB(t){return V1e(t)?t.slice(2):t}function q1e(t){return V1e(t)?`0x${t.slice(2)}`:`0x${t}`}function tS(t){if(typeof t!="string")return!1;const e=LB(t).toLowerCase();return H1e.test(e)}function Sut(t,e=!1){if(typeof t=="string"){const n=LB(t).toLowerCase();if(H1e.test(n))return g3(e?`0x${n}`:n)}throw Qn.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function BB(t,e=!1){let n=Sut(t,!1);return n.length%2===1&&(n=g3(`0${n}`)),e?g3(`0x${n}`):n}function rf(t){if(typeof t=="string"){const e=LB(t).toLowerCase();if(tS(e)&&e.length===40)return Cut(q1e(e))}throw Qn.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function sj(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(tS(t)){const e=BB(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Qn.rpc.invalidParams(`Not binary data: ${String(t)}`)}function Cb(t){if(typeof t=="number"&&Number.isInteger(t))return Cd(t);if(typeof t=="string"){if(W1e.test(t))return Cd(Number(t));if(tS(t))return Cd(Number(BigInt(BB(t,!0))))}throw Qn.rpc.invalidParams(`Not an integer: ${String(t)}`)}function wv(t){if(t!==null&&(typeof t=="bigint"||kut(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(Cb(t));if(typeof t=="string"){if(W1e.test(t))return BigInt(t);if(tS(t))return BigInt(BB(t,!0))}throw Qn.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Aut(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Qn.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function kut(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}function $ut(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")||r.startsWith("vbscript:")?`${e}//${n}/favicon.ico`:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`}async function Iut(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function Tut(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Put(t,e){const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,new TextEncoder().encode(e));return{iv:n,cipherText:r}}async function Rut(t,{iv:e,cipherText:n}){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,n);return new TextDecoder().decode(r)}function K1e(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function G1e(t,e){const n=K1e(t),r=await crypto.subtle.exportKey(n,e);return DB(new Uint8Array(r))}async function Z1e(t,e){const n=K1e(t),r=S8(e).buffer;return await crypto.subtle.importKey(n,new Uint8Array(r),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function Mut(t,e){const n=JSON.stringify(t,(r,i)=>{if(!(i instanceof Error))return i;const s=i;return Object.assign(Object.assign({},s.code?{code:s.code}:{}),{message:s.message})});return Put(e,n)}async function Out(t,e){return JSON.parse(await Rut(e,t))}const dT={storageKey:"ownPrivateKey",keyType:"private"},hT={storageKey:"ownPublicKey",keyType:"public"},fT={storageKey:"peerPublicKey",keyType:"public"};
203class jut{constructor(){this.storage=new Bu("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(fT,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(hT.storageKey),this.storage.removeItem(dT.storageKey),this.storage.removeItem(fT.storageKey)}async generateKeyPair(){const e=await Iut();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(dT,e.privateKey),await this.storeKey(hT,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(dT)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(hT)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(fT)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await Tut(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const n=this.storage.getItem(e.storageKey);return n?Z1e(e.keyType,n):null}async storeKey(e,n){const r=await G1e(e.keyType,n);this.storage.setItem(e.storageKey,r)}}const rx="4.3.0",Y1e="@coinbase/wallet-sdk";async function FB(t,e){const n=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}
203),r=await window.fetch(e,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":rx,"X-Cbw-Sdk-Platform":Y1e}}),{result:i,error:s}=await r.json();if(s)throw s;return i}function Nut(){return globalThis.coinbaseWalletExtension}function Dut(){var t,e;try{const n=globalThis;return(t=n.ethereum)!==null&&t!==void 0?t:(e=n.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function Lut({metadata:t,preference:e}){var n,r;const{appName:i,appLogoUrl:s,appChainIds:o}=t;if(e.options!=="smartWalletOnly"){const c=Nut();if(c)return(n=c.setAppInfo)===null||n===void 0||n.call(c,i,s,o,e),c}const a=Dut();if(a!=null&&a.isCoinbaseBrowser)return(r=a.setAppInfo)===null||r===void 0||r.call(a,i,s,o,e),a}function But(t){if(!t||typeof t!="object"||Array.isArray(t))throw Qn.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if(typeof e!="string"||e.length===0)throw Qn.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Qn.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw Qn.provider.unsupportedMethod()}}const mX="accounts",yX="activeChain",wX="availableChains",vX="walletCapabilities";class Fut{constructor(e){var n,r,i;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new jut,this.storage=new Bu("CBWSDK","SCWStateManager"),this.accounts=(n=this.storage.loadObject(mX))!==null&&n!==void 0?n:[],this.chain=this.storage.loadObject(yX)||{id:(i=(r=e.metadata.appChainIds)===null||r===void 0?void 0:r[0])!==null&&i!==void 0?i:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var n,r,i,s;await((r=(n=this.communicator).waitForPopupLoaded)===null||r===void 0?void 0:r.call(n));const o=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(i=e.params)!==null&&i!==void 0?i:{})}}),a=await this.communicator.postRequestAndWaitForResponse(o);if("failure"in a.content)throw a.content.failure;const c=await Z1e("public",a.sender);await this.keyManager.setPeerPublicKey(c);const u=(await this.decryptResponseMessage(a)).result;if("error"in u)throw u.error;switch(e.method){case"eth_requestAccounts":{const d=u.value;this.accounts=d,this.storage.storeObject(mX,d),(s=this.callback)===null||s===void 0||s.call(this,"accountsChanged",d);break}}}async request(e){var n;if(this.accounts.length===0)switch(e.method){case"wallet_sendCalls":return this.sendRequestToPopup(e);default:throw Qn.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:Kf(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return Kf(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(vX);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw Qn.rpc.internal("No RPC URL set for chain");return FB(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var n,r;await((r=(n=this.communicator).waitForPopupLoaded)===null||r===void 0?void 0:r.call(n));const i=await this.sendEncryptedRequest(e),o=(await this.decryptResponseMessage(i)).result;if("error"in o)throw o.error;return o.value}async cleanup(){var e,n;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(n=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:1}}async handleSwitchChainRequest(e){var n;const r=e.params;if(!r||!(!((n=r[0])===null||n===void 0)&&n.chainId))throw Qn.rpc.invalidParams();const i=Cb(r[0].chainId);if(this.updateChain(i))return null;const o=await this.sendRequestToPopup(e);return o===null&&this.updateChain(i),o}async sendEncryptedRequest(e){const n=await this.keyManager.getSharedSecret();if(!n)throw Qn.provider.unauthorized("No valid session found, try requestAccounts before other methods");const r=await Mut({action:e,chainId:this.chain.id},n),i=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){const n=await G1e("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:n,content:e,timestamp:new Date}}async decryptResponseMessage(e){var n,r;const i=e.content;if("failure"in i)throw i.failure;
203const s=await this.keyManager.getSharedSecret();if(!s)throw Qn.provider.unauthorized("Invalid session");const o=await Out(i.encrypted,s),a=(n=o.data)===null||n===void 0?void 0:n.chains;if(a){const l=Object.entries(a).map(([u,d])=>({id:Number(u),rpcUrl:d}));this.storage.storeObject(wX,l),this.updateChain(this.chain.id,l)}const c=(r=o.data)===null||r===void 0?void 0:r.capabilities;return c&&this.storage.storeObject(vX,c),o}updateChain(e,n){var r;const i=n??this.storage.loadObject(wX),s=i==null?void 0:i.find(o=>o.id===e);return s?(s!==this.chain&&(this.chain=s,this.storage.storeObject(yX,s),(r=this.callback)===null||r===void 0||r.call(this,"chainChanged",Kf(s.id))),!0):!1}}var Ir={},In={},bX;function Uut(){if(bX)return In;bX=1,Object.defineProperty(In,"__esModule",{value:!0}),In.toBig=In.shrSL=In.shrSH=In.rotrSL=In.rotrSH=In.rotrBL=In.rotrBH=In.rotr32L=In.rotr32H=In.rotlSL=In.rotlSH=In.rotlBL=In.rotlBH=In.add5L=In.add5H=In.add4L=In.add4H=In.add3L=In.add3H=void 0,In.add=b,In.fromBig=n,In.split=r;const t=BigInt(2**32-1),e=BigInt(32);function n(T,O=!1){return O?{h:Number(T&t),l:Number(T>>e&t)}:{h:Number(T>>e&t)|0,l:Number(T&t)|0}}function r(T,O=!1){const U=T.length;let z=new Uint32Array(U),L=new Uint32Array(U);for(let S=0;S<U;S++){const{h:k,l:M}=n(T[S],O);[z[S],L[S]]=[k,M]}return[z,L]}const i=(T,O)=>BigInt(T>>>0)<<e|BigInt(O>>>0);In.toBig=i;const s=(T,O,U)=>T>>>U;In.shrSH=s;const o=(T,O,U)=>T<<32-U|O>>>U;In.shrSL=o;const a=(T,O,U)=>T>>>U|O<<32-U;In.rotrSH=a;const c=(T,O,U)=>T<<32-U|O>>>U;In.rotrSL=c;const l=(T,O,U)=>T<<64-U|O>>>U-32;In.rotrBH=l;const u=(T,O,U)=>T>>>U-32|O<<64-U;In.rotrBL=u;const d=(T,O)=>O;In.rotr32H=d;const h=(T,O)=>T;In.rotr32L=h;const f=(T,O,U)=>T<<U|O>>>32-U;In.rotlSH=f;const m=(T,O,U)=>O<<U|T>>>32-U;In.rotlSL=m;const y=(T,O,U)=>O<<U-32|T>>>64-U;In.rotlBH=y;const v=(T,O,U)=>T<<U-32|O>>>64-U;In.rotlBL=v;function b(T,O,U,z){const L=(O>>>0)+(z>>>0);return{h:T+U+(L/2**32|0)|0,l:L|0}}const C=(T,O,U)=>(T>>>0)+(O>>>0)+(U>>>0);In.add3L=C;const x=(T,O,U,z)=>O+U+z+(T/2**32|0)|0;In.add3H=x;const _=(T,O,U,z)=>(T>>>0)+(O>>>0)+(U>>>0)+(z>>>0);In.add4L=_;const $=(T,O,U,z,L)=>O+U+z+L+(T/2**32|0)|0;In.add4H=$;const I=(T,O,U,z,L)=>(T>>>0)+(O>>>0)+(U>>>0)+(z>>>0)+(L>>>0);In.add5L=I;const R=(T,O,U,z,L,S)=>O+U+z+L+S+(T/2**32|0)|0;In.add5H=R;const N={fromBig:n,split:r,toBig:i,shrSH:s,shrSL:o,rotrSH:a,rotrSL:c,rotrBH:l,rotrBL:u,rotr32H:d,rotr32L:h,rotlSH:f,rotlSL:m,rotlBH:y,rotlBL:v,add:b,add3L:C,add3H:x,add4L:_,add4H:$,add5H:R,add5L:I};return In.default=N,In}var pT={},vv={},xX;function zut(){return xX||(xX=1,Object.defineProperty(vv,"__esMo
203dule",{value:!0}),vv.crypto=void 0,vv.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),vv}var EX;function Wut(){return EX||(EX=1,function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=n,t.anumber=r,t.abytes=i,t.ahash=s,t.aexists=o,t.aoutput=a,t.u8=c,t.u32=l,t.clean=u,t.createView=d,t.rotr=h,t.rotl=f,t.byteSwap=m,t.byteSwap32=y,t.bytesToHex=C,t.hexToBytes=$,t.asyncLoop=R,t.utf8ToBytes=N,t.bytesToUtf8=T,t.toBytes=O,t.kdfInputToBytes=U,t.concatBytes=z,t.checkOpts=L,t.createHasher=k,t.createOptHasher=M,t.createXOFer=W,t.randomBytes=H;const e=zut();function n(D){return D instanceof Uint8Array||ArrayBuffer.isView(D)&&D.constructor.name==="Uint8Array"}function r(D){if(!Number.isSafeInteger(D)||D<0)throw new Error("positive integer expected, got "+D)}function i(D,...V){if(!n(D))throw new Error("Uint8Array expected");if(V.length>0&&!V.includes(D.length))throw new Error("Uint8Array expected of length "+V+", got length="+D.length)}function s(D){if(typeof D!="function"||typeof D.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");r(D.outputLen),r(D.blockLen)}function o(D,V=!0){if(D.destroyed)throw new Error("Hash instance has been destroyed");if(V&&D.finished)throw new Error("Hash#digest() has already been called")}function a(D,V){i(D);const B=V.outputLen;if(D.length<B)throw new Error("digestInto() expects output buffer of length at least "+B)}function c(D){return new Uint8Array(D.buffer,D.byteOffset,D.byteLength)}function l(D){return new Uint32Array(D.buffer,D.byteOffset,Math.floor(D.byteLength/4))}function u(...D){for(let V=0;V<D.length;V++)D[V].fill(0)}function d(D){return new DataView(D.buffer,D.byteOffset,D.byteLength)}function h(D,V){return D<<32-V|D>>>V}function f(D,V){return D<<V|D>>>32-V>>>0}t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function m(D){return D<<24&4278190080|D<<8&16711680|D>>>8&65280|D>>>24&255}t.swap8IfBE=t.isLE?D=>D:D=>m(D),t.byteSwapIfBE=t.swap8IfBE;function y(D){for(let V=0;V<D.length;V++)D[V]=m(D[V]);return D}t.swap32IfBE=t.isLE?D=>D:y;const v=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",b=Array.from({length:256},(D,V)=>V.toString(16).padStart(2,"0"));function C(D){if(i(D),v)return D.toHex();let V="";for(let B=0;B<D.length;B++)V+=b[D[B]];return V}const x={_0:48,_9:57,A:65,F:70,a:97,f:102};function _(D){if(D>=x._0&&D<=x._9)return D-x._0;if(D>=x.A&&D<=x.F)return D-(x.A-10);if(D>=x.a&&D<=x.f)return D-(x.a-10)}function $(D){if(typeof D!="string")throw new Error("hex string expected, got "+typeof D);if(v)return Uint8Array.fromHex(D);const V=D.length,B=V/2;if(V%2)throw new Error("hex string expected, got unpadded hex of length "+V);const P=new Uint8Array(B);for(let j=0,G=0;j<B;j++,G+=2){const Y=_(D.charCodeAt(G)),te=_(D.charCodeAt(G+1));if(Y===void 0||te===void 0){const ae=D[G]+D[G+1];throw new Error('hex string expected, got non-hex character "'+ae+'" at index '+G)}P[j]=Y*16+te}return P}const I=async()=>{};t.nextTick=I;async function R(D,V,B){let P=Date.now();for(let j=0;j<D;j++){B(j);const G=Date.now()-P;G>=0&&G<V||(await(0,t.nextTick)(),P+=G)}}
203function N(D){if(typeof D!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(D))}function T(D){return new TextDecoder().decode(D)}function O(D){return typeof D=="string"&&(D=N(D)),i(D),D}function U(D){return typeof D=="string"&&(D=N(D)),i(D),D}function z(...D){let V=0;for(let P=0;P<D.length;P++){const j=D[P];i(j),V+=j.length}const B=new Uint8Array(V);for(let P=0,j=0;P<D.length;P++){const G=D[P];B.set(G,j),j+=G.length}return B}function L(D,V){if(V!==void 0&&{}.toString.call(V)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(D,V)}class S{}t.Hash=S;function k(D){const V=P=>D().update(O(P)).digest(),B=D();return V.outputLen=B.outputLen,V.blockLen=B.blockLen,V.create=()=>D(),V}function M(D){const V=(P,j)=>D(j).update(O(P)).digest(),B=D({});return V.outputLen=B.outputLen,V.blockLen=B.blockLen,V.create=P=>D(P),V}function W(D){const V=(P,j)=>D(j).update(O(P)).digest(),B=D({});return V.outputLen=B.outputLen,V.blockLen=B.blockLen,V.create=P=>D(P),V}t.wrapConstructor=k,t.wrapConstructorWithOpts=M,t.wrapXOFConstructorWithOpts=W;function H(D=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(D));if(e.crypto&&typeof e.crypto.randomBytes=="function")return Uint8Array.from(e.crypto.randomBytes(D));throw new Error("crypto.getRandomValues must be defined")}}(pT)),pT}var CX;function Hut(){if(CX)return Ir;CX=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.shake256=Ir.shake128=Ir.keccak_512=Ir.keccak_384=Ir.keccak_256=Ir.keccak_224=Ir.sha3_512=Ir.sha3_384=Ir.sha3_256=Ir.sha3_224=Ir.Keccak=void 0,Ir.keccakP=v;const t=Uut(),e=Wut(),n=BigInt(0),r=BigInt(1),i=BigInt(2),s=BigInt(7),o=BigInt(256),a=BigInt(113),c=[],l=[],u=[];for(let _=0,$=r,I=1,R=0;_<24;_++){[I,R]=[R,(2*I+3*R)%5],c.push(2*(5*R+I)),l.push((_+1)*(_+2)/2%64);let N=n;for(let T=0;T<7;T++)$=($<<r^($>>s)*a)%o,$&i&&(N^=r<<(r<<BigInt(T))-r);u.push(N)}const d=(0,t.split)(u,!0),h=d[0],f=d[1],m=(_,$,I)=>I>32?(0,t.rotlBH)(_,$,I):(0,t.rotlSH)(_,$,I),y=(_,$,I)=>I>32?(0,t.rotlBL)(_,$,I):(0,t.rotlSL)(_,$,I);function v(_,$=24){const I=new Uint32Array(10);for(let R=24-$;R<24;R++){for(let O=0;O<10;O++)I[O]=_[O]^_[O+10]^_[O+20]^_[O+30]^_[O+40];for(let O=0;O<10;O+=2){const U=(O+8)%10,z=(O+2)%10,L=I[z],S=I[z+1],k=m(L,S,1)^I[U],M=y(L,S,1)^I[U+1];for(let W=0;W<50;W+=10)_[O+W]^=k,_[O+W+1]^=M}let N=_[2],T=_[3];for(let O=0;O<24;O++){const U=l[O],z=m(N,T,U),L=y(N,T,U),S=c[O];N=_[S],T=_[S+1],_[S]=z,_[S+1]=L}for(let O=0;O<50;O+=10){for(let U=0;U<10;U++)I[U]=_[O+U];for(let U=0;U<10;U++)_[O+U]^=~I[(U+2)%10]&I[(U+4)%10]}_[0]^=h[R],_[1]^=f[R]}(0,e.clean)(I)}class b extends e.Hash{constructor($,I,R,N=!1,T=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=$,this.suffix=I,this.outputLen=R,this.enableXOF=N,this.rounds=T,(0,e.anumber)(R),!(0<$&&$<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,e.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,e.swap32IfBE)(this.state32),v(this.state32,this.rounds),(0,e.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update($){(0,e.aexists)(this),$=(0,e.toBytes)($),(0,e.abytes)($);const{blockLen:I,state:R}=this,N=$.length;for(let T=0;T<N;){const O=Math.min(I-this.pos,N-T);for(let U=0;U<O;U++)R[this.pos++]^=$[T++];this.pos===I&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:$,suffix:I,pos:R,blockLen:N}=this;$[R]^=I,(I&128)!==0&&R===N-1&&this.keccak(),$[N-1]^=128,this.keccak()}writeInto($){(0,e.aexists)(this,!1),(0,e.abytes)($),this.finish();const I=this.state,{blockLen:R}=this;for(let N=0,T=$.length;N<T;){this.posOut>=R&&this.keccak();const O=Math.min(R-this.posOut,T-N);$.set(I.subarray(this.posOut,this.posOut+O),N),this.posOut+=O,N+=O}return $}xofInto($){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto($)}xof($){return(0,e.anumber)($),this.xofInto(new Uint8Array($))}digestInto($){if((0,e.aoutput)($,this),this.finished)throw new Error("digest() was already called");return this.writeInto($),this.destroy(),$}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,e.clean)(this.state)}_cloneInto($){const{blockLen:I,suffix:R,outputLen:N,rounds:T,enableXOF:O}=this;return $||($=new b(I,R,N,O,T)),$.state32.set(this.state32),$.pos=this.pos,$.posOut=this.posOut,$.finished=this.finished,$.rounds=T,$.suffix=R,$.outputLen=N,$.enableXOF=O,$.destroyed=this.destroyed,$}}Ir.Keccak=b;const C=(_,$,I)=>(0,e.createHasher)(()=>new b($,_,I));Ir.sha3_224=C(6,144,224/8),Ir.sha3_256=C(6,136,256/8),Ir.sha3_384=C(6,104,384/8),Ir.sha3_512=C(6,72,512/8),Ir.keccak_224=C(1,144,224/8),Ir.keccak_256=C(1,136,256/8),Ir.keccak_384=C(1,104,384/8),Ir.keccak_512=C(1,72,512/8);const x=(_,$,I)=>(0,e.createXOFer)((R={})=>new b($,_,R.dkLen===void 0?I:R.dkLen,!0));return Ir.shake128=x(31,168,128/8),Ir.shake256=x(31,136,256/8),Ir}var gT,_X;function Q1e(){if(_X)return gT;_X=1;const{keccak_256:t}=Hut();function e(f){return Buffer.allocUnsafe(f).fill(0)}function n(f){return f.toString(2).length}function r(f,m){let y=f.toString(16);y.length%2!==0&&(y="0"+y);const v=y.match(/.{1,2}/g).map(b=>parseInt(b,16));for(;v.length<m;)v.unshift(0);return Buffer.from(v)}function i(f,m){const y=f<0n;let v;if(y){const b=(1n<<BigInt(m))-1n;v=(~f&b)+1n}else v=f;return v&=(1n<<BigInt(m))-1n,v}function s(f,m,y){const v=e(m);return f=a(f),y?f.length<m?(f.copy(v),v):f.slice(0,m):f.length<m?(f.copy(v,m-f.length),v):f.slice(-m)}function o(f,m){return s(f,m,!0)}function a(f){if(!Buffer.isBuffer(f))if(Array.isArray(f))f=Buffer.from(f);else if(typeof f=="string")d(f)?f=Buffer.from(u(h(f)),"hex"):f=Buffer.from(f);else if(typeof f=="number")f=intToBuffer(f);else if(f==null)f=Buffer.allocUnsafe(0);else if(typeof f=="bigint")f=r(f);else if(f.toArray)f=Buffer.from(f.toArray());else throw new Error("invalid type");return f}function c(f){return f=a(f),"0x"+f.toString("hex")}function l(f,m){if(f=a(f),m||(m=256),m!==256)throw new Error("unsupported");
203return Buffer.from(t(new Uint8Array(f)))}function u(f){return f.length%2?"0"+f:f}function d(f){return typeof f=="string"&&f.match(/^0x[0-9A-Fa-f]*$/)}function h(f){return typeof f=="string"&&f.startsWith("0x")?f.slice(2):f}return gT={zeros:e,setLength:s,setLengthRight:o,isHexString:d,stripHexPrefix:h,toBuffer:a,bufferToHex:c,keccak:l,bitLengthFromBigInt:n,bufferBEFromBigInt:r,twosFromBigInt:i},gT}var mT,SX;function Vut(){if(SX)return mT;SX=1;const t=Q1e();function e(h){return h.startsWith("int[")?"int256"+h.slice(3):h==="int"?"int256":h.startsWith("uint[")?"uint256"+h.slice(4):h==="uint"?"uint256":h.startsWith("fixed[")?"fixed128x128"+h.slice(5):h==="fixed"?"fixed128x128":h.startsWith("ufixed[")?"ufixed128x128"+h.slice(6):h==="ufixed"?"ufixed128x128":h}function n(h){return Number.parseInt(/^\D+(\d+)$/.exec(h)[1],10)}function r(h){var f=/^\D+(\d+)x(\d+)$/.exec(h);return[Number.parseInt(f[1],10),Number.parseInt(f[2],10)]}function i(h){var f=h.match(/(.*)\[(.*?)\]$/);return f?f[2]===""?"dynamic":Number.parseInt(f[2],10):null}function s(h){var f=typeof h;if(f==="string"||f==="number")return BigInt(h);if(f==="bigint")return h;throw new Error("Argument is not a number")}function o(h,f){var m,y,v,b;if(h==="address")return o("uint160",s(f));if(h==="bool")return o("uint8",f?1:0);if(h==="string")return o("bytes",new Buffer(f,"utf8"));if(c(h)){if(typeof f.length>"u")throw new Error("Not an array?");if(m=i(h),m!=="dynamic"&&m!==0&&f.length>m)throw new Error("Elements exceed array size: "+m);v=[],h=h.slice(0,h.lastIndexOf("[")),typeof f=="string"&&(f=JSON.parse(f));for(b in f)v.push(o(h,f[b]));if(m==="dynamic"){var C=o("uint256",f.length);v.unshift(C)}return Buffer.concat(v)}else{if(h==="bytes")return f=new Buffer(f),v=Buffer.concat([o("uint256",f.length),f]),f.length%32!==0&&(v=Buffer.concat([v,t.zeros(32-f.length%32)])),v;if(h.startsWith("bytes")){if(m=n(h),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);return t.setLengthRight(f,32)}else if(h.startsWith("uint")){if(m=n(h),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);y=s(f);const x=t.bitLengthFromBigInt(y);if(x>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+x);if(y<0)throw new Error("Supplied uint is negative");return t.bufferBEFromBigInt(y,32)}else if(h.startsWith("int")){if(m=n(h),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);y=s(f);const x=t.bitLengthFromBigInt(y);if(x>m)throw new Error("Supplied int exceeds width: "+m+" vs "+x);const _=t.twosFromBigInt(y,256);return t.bufferBEFromBigInt(_,32)}else if(h.startsWith("ufixed")){if(m=r(h),y=s(f),y<0)throw new Error("Supplied ufixed is negative");return o("uint256",y*BigInt(2)**BigInt(m[1]))}else if(h.startsWith("fixed"))return m=r(h),o("int256",s(f)*BigInt(2)**BigInt(m[1]))}throw new Error("Unsupported or invalid type: "+h)}function a(h){return h==="string"||h==="bytes"||i(h)==="dynamic"}function c(h){return h.lastIndexOf("]")===h.length-1}function l(h,f){var m=[],y=[],v=32*h.length;for(var b in h){var C=e(h[b]),x=f[b],_=o(C,x);a(C)?(m.push(o("uint256",v)),y.push(_),v+=_.length):m.push(_)}return Buffer.concat(m.concat(y))}function u(h,f){if(h.length!==f.length)throw new Error("Number of types are not matching the values");for(var m,y,v=[],b=0;b<h.length;b++){var C=e(h[b]),x=f[b];if(C==="bytes")v.push(x);else if(C==="string")v.push(new Buffer(x,"utf8"));else if(C==="bool")v.push(new Buffer(x?"01":"00","hex"));else if(C==="address")v.push(t.setLength(x,20));else if(C.startsWith("bytes")){if(m=n(C),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);v.push(t.setLengthRight(x,m))}else if(C.startsWith("uint")){if(m=n(C),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);y=s(x);const _=t.bitLengthFromBigInt(y);if(_>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+_);v.push(t.bufferBEFromBigInt(y,m/8))}else if(C.startsWith("int")){if(m=n(C),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);y=s(x);const _=t.bitLengthFromBigInt(y);if(_>m)throw new Error("Supplied int exceeds width: "+m+" vs "+_);const $=t.twosFromBigInt(y,m);v.push(t.bufferBEFromBigInt($,m/8))}else throw new Error("Unsupported or invalid type: "+C)}return Buffer.concat(v)}function d(h,f){return t.keccak(u(h,f))}return mT={rawEncode:l,solidityPack:u,soliditySHA3:d},mT}var yT,AX;function qut(){if(AX)return yT;AX=1;const t=Q1e(),e=Vut(),n={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},r={encodeData(s,o,a,c=!0){const l=["bytes32"],u=[this.hashType(s,a)];if(c){const d=(h,f,m)=>{if(a[f]!==void 0)return["bytes32",m==null?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(f,m,a,c))];if(m===void 0)throw new Error(`missing value for field ${h} of type ${f}`);if(f==="bytes")return["bytes32",t.keccak(m)];if(f==="string")return typeof m=="string"&&(m=Buffer.from(m,"utf8")),["bytes32",t.keccak(m)];if(f.lastIndexOf("]")===f.length-1){const y=f.slice(0,f.lastIndexOf("[")),v=m.map(b=>d(h,y,b));return["bytes32",t.keccak(e.rawEncode(v.map(([b])=>b),v.map(([,b])=>b)))]}return[f,m]};for(const h of a[s]){const[f,m]=d(h.name,h.type,o[h.name]);l.push(f),u.push(m)}}else for(const d of a[s]){let h=o[d.name];if(h!==void 0)if(d.type==="bytes")l.push("bytes32"),h=t.keccak(h),u.push(h);else if(d.type==="string")l.push("bytes32"),typeof h=="string"&&(h=Buffer.from(h,"utf8")),h=t.keccak(h),u.push(h);else if(a[d.type]!==void 0)l.push("bytes32"),h=t.keccak(this.encodeData(d.type,h,a,c)),u.push(h);else{if(d.type.lastIndexOf("]")===d.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");l.push(d.type),u.push(h)}}return e.rawEncode(l,u)},encodeType(s,o){let a="",c=this.findTypeDependencies(s,o).filter(l=>l!==s);c=[s].concat(c.sort());for(const l of c){if(!o[l])throw new Error("No type definition specified: "+l);a+=l+"("+o[l].map(({name:d,type:h})=>h+" "+d).join(",")+")"}return a},findTypeDependencies(s,o,a=[]){if(s=s.match(/^\w*/)[0],a.includes(s)||o[s]===void 0)return a;a.push(s);for(const c of o[s])for(const l of this.findTypeDependencies(c.type,o,a))!a.includes(l)&&a.push(l);return a},hashStruct(s,o,a,c=!0){return t.keccak(this.encodeData(s,o,a,c))},hashType(s,o){return t.keccak(this.encodeType(s,o))},sanitizeData(s){const o={};for(const a in n.properties)s[a]&&(o[a]=s[a]);return o.types&&(o.types=Object.assign({EIP712Domain:[]},o.types)),o},hash(s,o=!0){const a=this.sanitizeData(s),c=[Buffer.from("1901","hex")];return c.push(this.hashStruct("EIP712Domain",a.domain,a.types,o)),a.primaryType!=="EIP712Domain"&&c.push(this.hashStruct(a.primaryType,a.message,a.types,o)),t.keccak(Buffer.concat(c))}};yT={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:r,hashForSignTypedDataLegacy:function(s){return i(s.data)},hashForSignTypedData_v3:function(s){return r.hash(s.data,!1)},hashForSignTypedData_v4:function(s){return r.hash(s.data)}};function i(s){const o=new Error("Expect argument to be non-empty array");if(typeof s!="object"||!s.length)throw o;const a=s.map(function(u){return u.type==="bytes"?t.toBuffer(u.value):u.value}),c=s.map(function(u){return u.type}),l=s.map(function(u){if(!u.name)throw o;return u.type+" "+u.name});return e.soliditySHA3(["bytes32","bytes32"],[e.soliditySHA3(new Array(s.length).fill("string"),l),e.soliditySHA3(c,a)])}return yT}var Kut=qut();const y6=ys(Kut),Gut="walletUsername",oj="Addresses",Zut="AppVersion";function Ts(t){return t.errorMessage!==void 0}class Yut{constructor(e){this.secret=e}async encrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",S8(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},i,s.encode(e)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),u=new Uint8Array(c),d=new Uint8Array(l),h=new Uint8Array([...r,...u,...d]);return DB(h)}async decrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");return new Promise((r,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",S8(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=S8(e),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(d,s,u),f=new TextDecoder;r(f.decode(h))}catch(h){i(h)}})()})}}class Qut{constructor(e,n,r){this.linkAPIUrl=e,this.sessionId=n;const i=`${n}:${r}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var e;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:r,error:i}=await n.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=r==null?void 0:r.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${n.status}`)}}var Od;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(Od||(Od={}));class Xut{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}
203async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,n)=>{var r;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){n(s);return}(r=this.connectionStateListener)===null||r===void 0||r.call(this,Od.CONNECTING),i.onclose=s=>{var o;this.clearWebSocket(),n(new Error(`websocket error ${s.code}: ${s.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Od.DISCONNECTED)},i.onopen=s=>{var o;e(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Od.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},i.onmessage=s=>{var o,a;if(s.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(s.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:n}=this;if(n){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Od.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{n.close()}catch{}}}sendData(e){const{webSocket:n}=this;if(!n){this.pendingData.push(e),this.connect();return}n.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const kX=1e4,Jut=6e4;class edt{constructor({session:e,linkAPIUrl:n,listener:r}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=Cd(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=s=>{if(!s)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",a=>s.JsonRpcUrl&&this.handleChainUpdated(a,s.JsonRpcUrl)]]).forEach((a,c)=>{const l=s[c];l!==void 0&&a(l)})},this.handleDestroyed=s=>{var o;s==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async s=>{var o;const a=await this.cipher.decrypt(s);(o=this.listener)===null||o===void 0||o.accountUpdated(a)},this.handleMetadataUpdated=async(s,o)=>{var a;const c=await this.cipher.decrypt(o);(a=this.listener)===null||a===void 0||a.metadataUpdated(s,c)},this.handleWalletUsernameUpdated=async s=>{this.handleMetadataUpdated(Gut,s)},this.handleAppVersionUpdated=async s=>{this.handleMetadataUpdated(Zut,s)},this.handleChainUpdated=async(s,o)=>{var a;const c=await this.cipher.decrypt(s),l=await this.cipher.decrypt(o);(a=this.listener)===null||a===void 0||a.chainUpdated(c,l)},this.session=e,this.cipher=new Yut(e.secret),this.listener=r;const i=new Xut(`${n}/rpc`,WebSocket);i.setConnectionStateListener(async s=>{let o=!1;switch(s){case Od.DISCONNECTED:if(!this.destroyed){const a=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||i.connect().catch(()=>{a()})};a()}break;case Od.CONNECTED:o=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},kX),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Od.CONNECTING:break}this.connected!==o&&(this.connected=o)}),i.setIncomingDataListener(s=>{var o;switch(s.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const a=s.type==="IsLinkedOK"?s.linked:void 0;this.linked=a||s.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(s.metadata);break}case"Event":{this.handleIncomingEvent(s);break}}s.id!==void 0&&((o=this.requestResolutions.get(s.id))===null||o===void 0||o(s))}),this.ws=i,this.http=new Qut(n,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:Cd(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var n,r;this._linked=e,e&&((n=this.onceLinked)===null||n===void 0||n.call(this)),(r=this.listener)===null||r===void 0||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(n=>{this.linked?e().then(n):this.onceLinked=()=>{e().then(n),this.onceLinked=void 0}})}async handleIncomingEvent(e){var n;if(e.type!=="Event"||e.event!=="Web3Response")return;const r=await this.cipher.decrypt(e.data),i=JSON.parse(r);if(i.type!=="WEB3_RESPONSE")return;const{id:s,response:o}=i;(n=this.listener)===null||n===void 0||n.handleWeb3ResponseMessage(s,o)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEac
203h(n=>this.handleIncomingEvent(n))}async publishEvent(e,n,r=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:Cd(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:r};return this.setOnceLinked(async()=>{const o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>kX*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,n={timeout:Jut}){const r=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,o)=>{i=window.setTimeout(()=>{o(new Error(`request ${r} timed out`))},n.timeout)}),new Promise(s=>{this.requestResolutions.set(r,o=>{clearTimeout(i),s(o),this.requestResolutions.delete(r)})})])}async handleConnected(){return(await this.makeRequest({type:"HostSession",id:Cd(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:Cd(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:Cd(this.nextReqId++),sessionId:this.session.id}),!0)}}class tdt{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=q1e(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}const $X="session:id",IX="session:secret",TX="session:linked";class iy{constructor(e,n,r,i=!1){this.storage=e,this.id=n,this.secret=r,this.key=Jf(WR(`${n}, ${r} WalletLink`)),this._linked=!!i}static create(e){const n=d0(16),r=d0(32);return new iy(e,n,r).save()}static load(e){const n=e.getItem($X),r=e.getItem(TX),i=e.getItem(IX);return n&&i?new iy(e,n,i,r==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem($X,this.id),this.storage.setItem(IX,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(TX,this._linked?"1":"0")}}function ndt(){try{return window.frameElement!==null}catch{return!1}}function rdt(){try{return ndt()&&window.top?window.top.location:window.location}catch{return window.location}}function idt(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}function X1e(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const sdt='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';function J1e(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(sdt)),document.documentElement.appendChild(t)}function ege(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=ege(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function _b(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=ege(t))&&(r&&(r+=" "),r+=e);return r}var nS,zr,tge,h0,PX,nge,rge,ige,UB,aj,cj,m3={},sge=[],odt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rS=Array.isArray;
vendor: 10,097 bytes, line 203
203function jd(t,e){for(var n in e)t[n]=e[n];return t}function zB(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function wr(t,e,n){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?nS.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return A8(t,o,r,i,null)}function A8(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++tge,__i:-1,__u:0};return i==null&&zr.vnode!=null&&zr.vnode(s),s}function iS(t){return t.children}function k8(t,e){this.props=t,this.context=e}function d2(t,e){if(e==null)return t.__?d2(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?d2(t):null}function oge(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return oge(t)}}function RX(t){(!t.__d&&(t.__d=!0)&&h0.push(t)&&!q9.__r++||PX!=zr.debounceRendering)&&((PX=zr.debounceRendering)||nge)(q9)}function q9(){for(var t,e,n,r,i,s,o,a=1;h0.length;)h0.length>a&&h0.sort(rge),t=h0.shift(),a=h0.length,t.__d&&(n=void 0,i=(r=(e=t).__v).__e,s=[],o=[],e.__P&&((n=jd({},r)).__v=r.__v+1,zr.vnode&&zr.vnode(n),WB(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,s,i??d2(r),!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,lge(s,n,o),n.__e!=i&&oge(n)));q9.__r=0}function age(t,e,n,r,i,s,o,a,c,l,u){var d,h,f,m,y,v,b=r&&r.__k||sge,C=e.length;for(c=adt(n,e,b,c,C),d=0;d<C;d++)(f=n.__k[d])!=null&&(h=f.__i==-1?m3:b[f.__i]||m3,f.__i=d,v=WB(t,f,h,i,s,o,a,c,l,u),m=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&HB(h.ref,null,f),u.push(f.ref,f.__c||m,f)),y==null&&m!=null&&(y=m),4&f.__u||h.__k===f.__k?c=cge(f,c,t):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=y,c}function adt(t,e,n,r,i){var s,o,a,c,l,u=n.length,d=u,h=0;for(t.__k=new Array(i),s=0;s<i;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(c=s+h,(o=t.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?A8(null,o,null,null,null):rS(o)?A8(iS,{children:o},null,null,null):o.constructor==null&&o.__b>0?A8(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,a=null,(l=o.__i=cdt(o,n,c,d))!=-1&&(d--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(i>u?h--:i<u&&h++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;s<u;s++)(a=n[s])!=null&&(2&a.__u)==0&&(a.__e==r&&(r=d2(a)),dge(a,a));return r}function cge(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=cge(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=d2(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function cdt(t,e,n,r){var i,s,o,a=t.key,c=t.type,l=e[n],u=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||u&&a==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,s=n+1;i>=0||s<e.length;)if((l=e[o=i>=0?i--:s++])!=null&&(2&l.__u)==0&&a==l.key&&c==l.type)return o}return-1}function MX(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||odt.test(e)?n:n+"px"}function w6(t,e,n,r,i){var s,o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||MX(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||MX(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(ige,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r?n.u=r.u:(n.u=UB,t.addEventListener(e,s?cj:aj,s)):t.removeEventListener(e,s?cj:aj,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function OX(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=UB++;else if(e.t<n.u)return;return n(zr.event?zr.event(e):e)}}}function WB(t,e,n,r,i,s,o,a,c,l){var u,d,h,f,m,y,v,b,C,x,_,$,I,R,N,T,O,U=e.type;if(e.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=e.__e=n.__e]),(u=zr.__b)&&u(e);e:if(typeof U=="function")try{if(b=e.props,C="prototype"in U&&U.prototype.render,x=(u=U.contextType)&&r[u.__c],_=u?x?x.props.value:u.__:r,n.__c?v=(d=e.__c=n.__c).__=d.__E:(C?e.__c=d=new U(b,_):(e.__c=d=new k8(b,_),d.constructor=U,d.render=udt),x&&x.sub(d),d.props=b,d.state||(d.state={}),d.context=_,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),C&&d.__s==null&&(d.__s=d.state),C&&U.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=jd({},d.__s)),jd(d.__s,U.getDerivedStateFromProps(b,d.__s))),f=d.props,m=d.state,d.__v=e,h)C&&U.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),C&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(C&&U.getDerivedStateFromProps==null&&b!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(b,_),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(b,d.__s,_)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(d.props=b,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(z){z&&(z.__=e)}),$=0;$<d._sb.length;$++)d.__h.push(d._sb[$]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(b,d.__s,_),C&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,m,y)})}if(d.context=_,d.props=b,d.__P=t,d.__e=!1,I=zr.__r,R=0,C){for(d.state=d.__s,d.__d=!1,I&&I(e),u=d.render(d.props,d.state,d.context),N=0;N<d._sb.length;N++)d.__h.push(d._sb[N]);d._sb=[]}else do d.__d=!1,I&&I(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++R<25);d.state=d.__s,d.getChildContext!=null&&(r=jd(jd({},r),d.getChildContext())),C&&!h&&d.getSnapshotBeforeUpdate!=null&&(y=d.getSnapshotBeforeUpdate(f,m)),T=u,u!=null&&u.type===iS&&u.key==null&&(T=uge(u.props.children)),a=age(t,rS(T)?T:[T],e,n,r,i,s,o,a,c,l),d.base=e.__e,e.__u&=-161,d.__h.length&&o.push(d),v&&(d.__E=d.__=null)}catch(z){if(e.__v=null,c||s!=null)if(z.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(O=s.length;O--;)zB(s[O]);lj(e)}else e.__e=n.__e,e.__k=n.__k,z.then||lj(e);zr.__e(z,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=ldt(n.__e,e,n,r,i,s,o,c,l);return(u=zr.diffed)&&u(e),128&e.__u?void 0:a}function lj(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(lj)}function lge(t,e,n){for(var r=0;r<n.length;r++)HB(n[r],n[++r],n[++r]);zr.__c&&zr.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){zr.__e(s,i.__v)}})}function uge(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:rS(t)?t.map(uge):jd({},t)}function ldt(t,e,n,r,i,s,o,a,c){var l,u,d,h,f,m,y,v=n.props,b=e.props,C=e.type;if(C=="svg"?i="http://www.w3.org/2000/svg":C=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((f=s[l])&&"setAttribute"in f==!!C&&(C?f.localName==C:f.nodeType==3)){t=f,s[l]=null;break}}if(t==null){if(C==null)return document.createTextNode(b);t=document.createElementNS(i,C,b.is&&b),a&&(zr.__m&&zr.__m(e,s),a=!1),s=null}if(C==null)v===b||a&&t.data==b||(t.data=b);else{if(s=s&&nS.call(t.childNodes),v=n.props||m3,!a&&s!=null)for(v={},l=0;l<t.attributes.length;l++)v[(f=t.attributes[l]).name]=f.value;for(l in v)if(f=v[l],l!="children"){if(l=="dangerouslySetInnerHTML")d=f;else if(!(l in b)){if(l=="value"&&"defaultValue"in b||l=="checked"&&"defaultChecked"in b)continue;w6(t,l,null,f,i)}}for(l in b)f=b[l],l=="children"?h=f:l=="dangerouslySetInnerHTML"?u=f:l=="value"?m=f:l=="checked"?y=f:a&&typeof f!="function"||v[l]===f||w6(t,l,f,v[l],i);if(u)a||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),age(e.type=="template"?t.content:t,rS(h)?h:[h],e,n,r,C=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:n.__k&&d2(n,0),a,c),s!=null)for(l=s.length;l--;)zB(s[l]);a||(l="value",C=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[l]||C=="progress"&&!m||C=="option"&&m!=v[l])&&w6(t,l,m,v[l],i),l="checked",y!=null&&y!=t[l]&&w6(t,l,y,v[l],i))}return t}function HB(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){zr.__e(i,n)}}function dge(t,e,n){var r,i;if(zr.unmount&&zr.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||HB(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){zr.__e(s,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&dge(r[i],e,n||typeof t.type!="function");n||zB(t.__e),t.__c=t.__=t.__e=void 0}function udt(t,e,n){return this.constructor(t,n)}function uj(t,e,n){var r,i,s,o;e==document&&(e=document.documentElement),zr.__&&zr.__(t,e),i=(r=!1)?null:e.__k,s=[],o=[],WB(e,t=e.__k=wr(iS,null,[t]),i||m3,m3,e.namespaceURI,i?null:e.firstChild?nS.call(e.childNodes):null,s,i?i.__e:e.firstChild,r,o),lge(s,t,o)}nS=sge.slice,zr={__e:function(t,e,n,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},tge=0,k8.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=jd({},this.state),typeof t=="function"&&(t=t(jd({},n),this.props)),t&&jd(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),RX(this))},k8.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),RX(this))},k8.prototype.render=iS,h0=[],nge=typeof Promise=="function"?Promise.prototype.then.bind(Prom
vendor: 4,388 bytes, line 203
203ise.resolve()):setTimeout,rge=function(t,e){return t.__v.__b-e.__v.__b},q9.__r=0,ige=/(PointerCapture)$|Capture$/i,UB=0,aj=OX(!1),cj=OX(!0);var K9,Si,wT,jX,dj=0,hge=[],Ni=zr,NX=Ni.__b,DX=Ni.__r,LX=Ni.diffed,BX=Ni.__c,FX=Ni.unmount,UX=Ni.__;function fge(t,e){Ni.__h&&Ni.__h(Si,t,dj||e),dj=0;var n=Si.__H||(Si.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function zX(t){return dj=1,ddt(pge,t)}function ddt(t,e,n){var r=fge(K9++,2);if(r.t=t,!r.__c&&(r.__=[pge(void 0,e),function(a){var c=r.__N?r.__N[0]:r.__[0],l=r.t(c,a);c!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=Si,!Si.__f)){var i=function(a,c,l){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!s||s.call(this,a,c,l);var d=r.__c.props!==a;return u.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(d=!0)}}),s&&s.call(this,a,c,l)||d};Si.__f=!0;var s=Si.shouldComponentUpdate,o=Si.componentWillUpdate;Si.componentWillUpdate=function(a,c,l){if(this.__e){var u=s;s=void 0,i(a,c,l),s=u}o&&o.call(this,a,c,l)},Si.shouldComponentUpdate=i}return r.__N||r.__}function hdt(t,e){var n=fge(K9++,3);!Ni.__s&&gdt(n.__H,e)&&(n.__=t,n.u=e,Si.__H.__h.push(n))}function fdt(){for(var t;t=hge.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach($8),t.__H.__h.forEach(hj),t.__H.__h=[]}catch(e){t.__H.__h=[],Ni.__e(e,t.__v)}}Ni.__b=function(t){Si=null,NX&&NX(t)},Ni.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),UX&&UX(t,e)},Ni.__r=function(t){DX&&DX(t),K9=0;var e=(Si=t.__c).__H;e&&(wT===Si?(e.__h=[],Si.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach($8),e.__h.forEach(hj),e.__h=[],K9=0)),wT=Si},Ni.diffed=function(t){LX&&LX(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(hge.push(e)!==1&&jX===Ni.requestAnimationFrame||((jX=Ni.requestAnimationFrame)||pdt)(fdt)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),wT=Si=null},Ni.__c=function(t,e){e.some(function(n){try{n.__h.forEach($8),n.__h=n.__h.filter(function(r){return!r.__||hj(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Ni.__e(r,n.__v)}}),BX&&BX(t,e)},Ni.unmount=function(t){FX&&FX(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{$8(r)}catch(i){e=i}}),n.__H=void 0,e&&Ni.__e(e,n.__v))};var WX=typeof requestAnimationFrame=="function";function pdt(t){var e,n=function(){clearTimeout(r),WX&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);WX&&(e=requestAnimationFrame(n))}function $8(t){var e=Si,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Si=e}function hj(t){var e=Si;t.__c=t.__(),Si=e}function gdt(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function pge(t,e){return typeof e=="function"?e(t):e}const mdt=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}
203.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",ydt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",wdt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class vdt{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=X1e()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const n=this.nextItemKey++;return this.items.set(n,e),this.render(),()=>{this.items.delete(n),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&uj(wr("div",null,wr(gge,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,n])=>wr(bdt,Object.assign({},n,{key:e}))))),this.root)}}const gge=t=>wr("div",{class:_b("-cbwsdk-snackbar-container")},wr("style",null,mdt),wr("div",{class:"-cbwsdk-snackbar"},t.children)),bdt=({autoExpand:t,message:e,menuItems:n})=>{const[r,i]=zX(!0),[s,o]=zX(t??!1);hdt(()=>{const c=[window.setTimeout(()=>{i(!1)},1),window.setTimeout(()=>{o(!0)},1e4)];return()=>
203{c.forEach(window.clearTimeout)}});const a=()=>{o(!s)};return wr("div",{class:_b("-cbwsdk-snackbar-instance",r&&"-cbwsdk-snackbar-instance-hidden",s&&"-cbwsdk-snackbar-instance-expanded")},wr("div",{class:"-cbwsdk-snackbar-instance-header",onClick:a},wr("img",{src:ydt,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",wr("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),wr("div",{class:"-gear-container"},!s&&wr("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wr("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),wr("img",{src:wdt,class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&wr("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((c,l)=>wr("div",{class:_b("-cbwsdk-snackbar-instance-menu-item",c.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:c.onClick,key:l},wr("svg",{width:c.svgWidth,height:c.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wr("path",{"fill-rule":c.defaultFillRule,"clip-rule":c.defaultClipRule,d:c.path,fill:"#AAAAAA"})),wr("span",{class:_b("-cbwsdk-snackbar-instance-menu-item-info",c.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},c.info)))))};class xdt{constructor(){this.attached=!1,this.snackbar=new vdt}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.snackbar.attach(n),this.attached=!0,J1e()}showConnecting(e){let n;return e.isUnlinkedErrorState?n={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:n={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(n)}}const Edt=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
203.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";class Cdt{constructor(){this.root=null,this.darkMode=X1e()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),J1e()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(uj(null,this.root),e&&uj(wr(_dt,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const _dt=({title:t,buttonText:e,darkMode:n,onButtonClick:r,onDismiss:i})=>{const s=n?"dark":"light";return wr(gge,{darkMode:n},wr("div",{class:"-cbwsdk-redirect-dialog"},wr("style",null,Edt),wr("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),wr("div",{class:_b("-cbwsdk-redirect-dialog-box",s)},wr("p",null,t),wr("button",{onClick:r},e))))},Sdt="https://keys.coinbase.com/connect",Adt="http://rpc.wallet.coinbase.com",HX="https://www.walletlink.org",kdt="https://go.cb-w.com/walletlink";class VX{constructor(){this.attached=!1,this.redirectDialog=new Cdt}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const n=new URL(kdt);n.searchParams.append("redirect_url",rdt().href),e&&n.searchParams.append("wl_url",e);const r=document.createElement("a");r.target="cbw-opener",r.href=n.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class _d{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=idt(),this.linkedUpdated=s=>{this.isLinked=s;const o=this.storage.getItem(oj);if(s&&(this._session.linked=s),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";a[0]!==""&&!s&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(s,o)=>{this.storage.setItem(s,o)},this.chainUpdated=(s,o)=>{this.chainCallbackParams.chainId===s&&this.chainCallbackParams.jsonRpcUrl===o||(this.chainCallbackParams={chainId:s,jsonRpcUrl:o},this.chainCallback&&this.chainCallback(o,Number.parseInt(s,10)))},this.accountUpdated=s=>{this.accountsCallback&&this.accountsCallback([s]),_d.accountRequestCallbackIds.size>0&&(Array.from(_d.accountRequestCallbackIds.values()).forEach(o=>{this.invokeCallback(o,{method:"requestEthereumAccounts",result:[s]})}),_d.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:n,ui:r,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=new tdt,this.ui=r,this.ui.attach()}subscribe(){const e=iy.load(this.storage)||iy.create(this.storage),{linkAPIUrl:n}=this,r=new edt({session:e,linkAPIUrl:n,listener:this}),i=this.isMobileWeb?new VX:new xdt;return r.connect(),{session:e,ui:i,connection:r}}resetAndReload(){this.connection.destroy().then(()=>{const e=iy.load(this.storage);(e==null?void 0:e.id)===this._session.id&&Bu.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:Gl(e.weiValue),data:Eb(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?Gl(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?Gl(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?Gl(e.gasPriceInWei):null,gasLimit:e.gasLim
203it?Gl(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:Gl(e.weiValue),data:Eb(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?Gl(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?Gl(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?Gl(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?Gl(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:Eb(e,!0),chainId:n}})}getWalletLinkSession(){return this._session}sendRequest(e){let n=null;const r=d0(8),i=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s),n==null||n()};return new Promise((s,o)=>{n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,a=>{if(n==null||n(),Ts(a))return o(new Error(a.errorMessage));s(a)}),this.publishWeb3RequestEvent(r,e)})}publishWeb3RequestEvent(e,n){const r={type:"WEB3_REQUEST",id:e,request:n};this.publishEvent("Web3Request",r,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage(r.id,{method:n.method,errorMessage:i.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(n.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof VX)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const n={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",n,!1).then()}publishEvent(e,n,r){return this.connection.publishEvent(e,n,r)}handleWeb3ResponseMessage(e,n){if(n.method==="requestEthereumAccounts"){_d.accountRequestCallbackIds.forEach(r=>this.invokeCallback(r,n)),_d.accountRequestCallbackIds.clear();return}this.invokeCallback(e,n)}handleErrorResponse(e,n,r){var i;const s=(i=r==null?void 0:r.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:n,errorMessage:s})}invokeCallback(e,n){const r=this.relayEventManager.callbacks.get(e);r&&(r(n),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:n}=this.metadata,r={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:n}},i=d0(8);return new Promise((s,o)=>{this.relayEventManager.callbacks.set(i,a=>{if(Ts(a))return o(new Error(a.errorMessage));s(a)}),_d.accountRequestCallbackIds.add(i),this.publishWeb3RequestEvent(i,r)})}watchAsset(e,n,r,i,s,o){const a={method:"watchAsset",params:{type:e,options:{address:n,symbol:r,decimals:i,image:s},chainId:o}};let c=null;const l=d0(8),u=d=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,d),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((d,h)=>{this.relayEventManager.callbacks.set(l,f=>{if(c==null||c(),Ts(f))return h(new Error(f.errorMessage));d(f)}),this.publishWeb3RequestEvent(l,a)})}addEthereumChain(e,n,r,i,s,o){const a={method:"addEthereumChain",params:{chainId:e,rpcUrls:n,blockExplorerUrls:i,chainName:s,iconUrls:r,nativeCurrency:o}};let c=null;const l=d0(8),u=d=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,d),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((d,h)=>{this.relayEventManager.callbacks.set(l,f=>{if(c==null||c(),Ts(f))return h(new Error(f.errorMessage));d(f)}),this.publishWeb3RequestEvent(l,a)})}switchEthereumChain(e,n){const r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:n})};let i=null;const s=d0(8),o=a=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,r.method,a),i==null||i()};return i=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:o,onResetConnection:this.resetAndReload}),new Promise((a,c)=>{this.relayEventManager.callbacks.set(s,l=>{if(i==null||i(),Ts(l)&&l.errorCode)return c(Qn.provider.custom({code:l.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(Ts(l))return c(new Error(l.errorMessage));a(l)}),this.publishWeb3RequestEvent(s,r)})}}_d.accountRequestCallbackIds=new Set;const qX="DefaultChainId",KX="DefaultJsonRpcUrl";class mge{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new Bu("walletlink",HX),this.callback=e.callback||null;const n=this._storage.getItem(oj);if(n){const r=n.split(" ");r[0]!==""&&(this._addresses=r.map(i=>rf(i)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:n,secret:r}=e.getWalletLinkSession();return{id:n,secret:r}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(KX))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(KX,e)}updateProviderInfo(e,n){var r;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(qX,n.toString(10)),Cb(n)!==i&&((r=this.callback)===null||r===void 0||r.call(this,"chainChanged",Kf(n)))}async watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw Qn.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw Qn.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw Qn.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw Qn.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=n.options,l=await this.initializeRelay().watchAsset(n.type,i,s,a,o,r==null?void 0:r.toString());return Ts(l)?!1:!!l.result}async addEthereumChain(e){var n,r;const i=e[0];if(((n=i.rpcUrls)===null||n===void 0?void 0:n.length)===0)throw Qn.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!i.chainName||i.chainName.trim()==="")throw Qn.rpc.invalidParams("chainName is a required field");if(!i.nativeCurrency)throw Qn.rpc.invalidParams("nativeCurrency is a required field");const s=Number.parseInt(i.chainId,16);if(s===this.getChainId())return!1;const o=this.initializeRelay(),{rpcUrls:a=[],blockExplorerUrls:c=[],chainName:l,iconUrls:u=[],nativeCurrency:d}=i,h=await o.addEthereumChain(s.toString(),a,u,c,l,d);if(Ts(h))return!1;if(((r=h.result)===null||r===void 0?void 0:r.isApproved)===!0)return this.updateProviderInfo(a[0],s),null;throw Qn.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const n=e[0],r=Number.parseInt(n.chainId,16),s=await this.initializeRelay().switchEthereumChain(r.toString(10),this.selectedAddress||void 0);if(Ts(s))throw s;const o=s.result;return o.isApproved&&o.rpcUrl.length>0&&this.updateProviderInfo(o.rpcUrl,r),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,n){var r;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(s=>rf(s));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(r=this.callback)===null||r===void 0||r.call(this,"accountsChanged",i),this._storage.setItem(oj,i.join(" ")))}async request(e){const n=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return Kf(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(n);case"wallet_switchEthereumChain":return this.switchEthereumChain(n);case"wallet_watchAsset":return this.watchAsset(n);default:if(!this.jsonRpcUrl)throw Qn.rpc.internal("No RPC URL set for chain");return FB(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const n=rf(e);if(!this._addresses.map(i=>rf(i)).includes(n))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?rf(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const r=e.to?rf(e.to):null,i=e.value!=null?wv(e.value):BigInt(0),s=e.data?sj(e.data):Buffer.alloc(0),o=e.nonce!=null?Cb(e.nonce):null,a=e.gasPrice!=null?wv(e.gasPrice):null,c=e.maxFeePerGas!=null?wv(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?wv(e.maxPriorityFeePerGas):null,u=e.gas!=null?wv(e.gas):null,d=e.chainId?Cb(e.chainId):this.getChainId();return{fromAddress:n,toAddress:r,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLim
203it:u,chainId:d}}async ecRecover(e){const{method:n,params:r}=e;if(!Array.isArray(r))throw Qn.rpc.invalidParams();const s=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:uT(r[0]),signature:uT(r[1]),addPrefix:n==="personal_ecRecover"}});if(Ts(s))throw s;return s.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem(qX))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,n;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:Kf(this.getChainId())}),this._addresses;const i=await this.initializeRelay().requestEthereumAccounts();if(Ts(i))throw i;if(!i.result)throw new Error("accounts received is empty");return this._setAddresses(i.result),(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:Kf(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw Qn.rpc.invalidParams();const n=e[1],r=e[0];this._ensureKnownAddress(n);const s=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:rf(n),message:uT(r),addPrefix:!0,typedDataJson:null}});if(Ts(s))throw s;return s.result}async _eth_signTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signEthereumTransaction(n);if(Ts(i))throw i;return i.result}async _eth_sendRawTransaction(e){const n=sj(e[0]),i=await this.initializeRelay().submitEthereumTransaction(n,this.getChainId());if(Ts(i))throw i;return i.result}async _eth_sendTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signAndSubmitEthereumTransaction(n);if(Ts(i))throw i;return i.result}async signTypedData(e){const{method:n,params:r}=e;if(!Array.isArray(r))throw Qn.rpc.invalidParams();const i=l=>{const u={eth_signTypedData_v1:y6.hashForSignTypedDataLegacy,eth_signTypedData_v3:y6.hashForSignTypedData_v3,eth_signTypedData_v4:y6.hashForSignTypedData_v4,eth_signTypedData:y6.hashForSignTypedData_v4};return Eb(u[n]({data:Aut(l)}),!0)},s=r[n==="eth_signTypedData_v1"?1:0],o=r[n==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(s);const c=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:rf(s),message:i(o),typedDataJson:JSON.stringify(o,null,2),addPrefix:!1}});if(Ts(c))throw c;return c.result}initializeRelay(){return this._relay||(this._relay=new _d({linkAPIUrl:HX,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const yge="SignerType",wge=new Bu("CBWSDK","SignerConfigurator");function $dt(){return wge.getItem(yge)}function Idt(t){wge.setItem(yge,t)}async function Tdt(t){const{communicator:e,metadata:n,handshakeRequest:r,callback:i}=t;Rdt(e,n,i).catch(()=>{});const s={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:r})},{data:o}=await e.postRequestAndWaitForResponse(s);return o}function Pdt(t){const{signerType:e,metadata:n,communicator:r,callback:i}=t;switch(e){case"scw":return new Fut({metadata:n,callback:i,communicator:r});case"walletlink":return new mge({metadata:n,callback:i})}}async function Rdt(t,e,n){await t.onMessage(({event:i})=>i==="WalletLinkSessionRequest");const r=new mge({metadata:e,callback:n});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const Mdt=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app. 204 205Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,Odt=()=>{let t;return{getCrossOriginOpenerPolicy:()=>t===void 0?"undefined":t,checkCrossOriginOpenerPolicy:async()=>{if(typeof window>"u"){t="non-browser-env";return}try{const e=`${window.location.origin}${window.location.pathname}`,n=await fetch(e,{method:"HEAD"});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=n.headers.get("Cross-Origin-Opener-Policy");t=r??"null",t==="same-origin"&&console.error(Mdt)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),t="error"}}}},{checkCrossOriginOpenerPolicy:jdt,getCrossOriginOpenerPolicy:Ndt}=Odt(),GX=420,ZX=540;function Ddt(t){const e=(window.innerWidth-GX)/2+window.screenX,n=(window.innerHeight-ZX)/2+window.screenY;Bdt(t);const r=`wallet_${crypto.randomUUID()}`,i=window.open(t,r,`width=${GX}, height=${ZX}, left=${e}, top=${n}`);if(i==null||i.focus(),!i)throw Qn.rpc.internal("Pop up window failed to open");return i}function Ldt(t){t&&!t.closed&&t.close()}function Bdt(t){const e={sdkName:Y1e,sdkVersion:rx,origin:window.location.origin,coop:Ndt()};for(const[n,r]of Object.entries(e))t.searchParams.append(n,r.toString())}class Fdt{constructor({url:e=Sdt,metadata:n,preference:r}){this.popup=null,this.listeners=new Map,this.postMessage=async i=>{(await this.waitForPopupLoaded()).postMessage(i,this.url.origin)},this.postRequestAndWaitForResponse=async i=>{const s=this.onMessage(({requestId:o})=>o===i.id);return this.postMessage(i),await s},this.onMessage=async i=>new Promise((s,o)=>{const a=c=>{if(c.origin!==this.url.origin)return;const l=c.data;i(l)&&(s(l),window.removeEventListener("message",a),this.listeners.delete(a))};window.addEventListener("message",a),this.listeners.set(a,{reject:o})}),this.disconnect=()=>
205{Ldt(this.popup),this.popup=null,this.listeners.forEach(({reject:i},s)=>{i(Qn.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",s)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=Ddt(this.url),this.onMessage(({event:i})=>i==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:i})=>i==="PopupLoaded").then(i=>{this.postMessage({requestId:i.id,data:{version:rx,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw Qn.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=n,this.preference=r}}function Udt(t){const e=xut(zdt(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return n.searchParams.set("version",rx),n.searchParams.set("code",e.code.toString()),n.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:n.href})}function zdt(t){var e;if(typeof t=="string")return{message:t,code:Ei.rpc.internal};if(Ts(t)){const n=t.errorMessage,r=(e=t.errorCode)!==null&&e!==void 0?e:n.match(/(denied|rejected)/i)?Ei.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},t),{message:n,code:r,data:{method:t.method}})}return t}class Wdt extends wp{}var Hdt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};class Vdt extends Wdt{constructor(e){var{metadata:n}=e,r=e.preference,{keysUrl:i}=r,s=Hdt(r,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=n,this.preference=s,this.communicator=new Fdt({url:i,metadata:n,preference:s});const o=$dt();o&&(this.signer=this.initSigner(o))}async request(e){try{if(But(e),!this.signer)switch(e.method){case"eth_requestAccounts":{const n=await this.requestSignerSelection(e),r=this.initSigner(n);await r.handshake(e),this.signer=r,Idt(n);break}case"wallet_sendCalls":{const n=this.initSigner("scw");await n.handshake({method:"handshake"});const r=await n.request(e);return await n.cleanup(),r}case"wallet_getCallsStatus":return FB(e,Adt);case"net_version":return 1;case"eth_chainId":return Kf(1);default:throw Qn.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(n){const{code:r}=n;return r===Ei.provider.unauthorized&&this.disconnect(),Promise.reject(Udt(n))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await((e=this.signer)===null||e===void 0?void 0:e.cleanup()),this.signer=null,Bu.clearAll(),this.emit("disconnect",Qn.provider.disconnected("User initiated disconnection"))}requestSignerSelection(e){return Tdt({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return Pdt({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}function qdt(t){if(t){if(!["all","smartWalletOnly","eoaOnly"].includes(t.options))throw new Error(`Invalid options: ${t.options}`);if(t.attribution&&t.attribution.auto!==void 0&&t.attribution.dataSuffix!==void 0)throw new Error("Attribution cannot contain both auto and dataSuffix properties")}}class Kdt{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||$ut(),appChainIds:e.appChainIds||[]},this.storeLatestVersion(),jdt()}makeWeb3Provider(e={options:"all"}){var n;qdt(e);const r={metadata:this.metadata,preference:e};return(n=Lut(r))!==null&&n!==void 0?n:new Vdt(r)}getCoinbaseWalletLogo(e,n=240){return wut(e,n)}storeLatestVersion(){new Bu("CBWSDK").setItem("VERSION",rx)}}const I8=()=>{let t=cn.get(npe);return t&&Array.isArray(t)&&t.map(e=>(n=>
205n&&typeof n.address=="string"&&typeof n.connectorType=="string"&&typeof n.walletClientType=="string"&&typeof n.connectedAt=="number")(e)).every(Boolean)?t:[]};let Gdt=["phantom","glow","solflare","backpack","okx_wallet"];function Zdt(t){return t.chainType==="solana"}function YX(t){return t.type==="solana"}let Ydt=class extends $pe{get isInstalled(){return this.adapter.readyState==="Installed"}buildConnectedWallet(e,n){let r,i,s,o;if(e.readyState!=="Installed"||!e.publicKey)throw Error("Wallet is not connected.");return"signMessage"in e&&(r=async(...a)=>{if(!e.connected)throw Error("Wallet is not connected.");return await e.signMessage(a[0])}),"sendTransaction"in e&&(i=async(...a)=>await e.sendTransaction(a[0],a[1],a[2])),"signTransaction"in e&&(s=async a=>await e.signTransaction(a)),"signAllTransactions"in e&&(o=async a=>await e.signAllTransactions(a)),{type:"solana",address:e.publicKey.toBase58(),meta:n,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>e.connected,disconnect:()=>{try{e.disconnect()}catch{console.error("Wallet does not support programmatic disconnect")}},getProvider:Gw(`${this.walletClientType||""} wallet does not support 'getProvider'`),signMessage:r??Gw(`${this.walletClientType||""} wallet does not support 'signMessage'`),sendTransaction:i??Gw(`${this.walletClientType||""} wallet does not support 'sendTransaction'`),signTransaction:s??Gw(`${this.walletClientType||""} wallet does not support 'signTransaction'`),signAllTransactions:o??Gw(`${this.walletClientType||""} wallet does not support 'signAllTransactions'`)}}async syncAccounts(){if(this.adapter.readyState==="Installed"&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find(n=>this.adapter.publicKey&&n.address===this.adapter.publicKey.toBase58())||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAttemptAutoConnect()&&await this.adapter.autoConnect().catch(()=>{}),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort((e,n)=>n.connectedAt-e.connectedAt)[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}shouldAttemptAutoConnect(){return!(!this.autoConnectEnabled||!Gdt.includes(this.walletClientType))&&(this.walletClientType!=="phantom"||I8().some(({walletClientType:e})=>e==="phantom"))}constructor(e,n){super(function(r){return r.name.toLowerCase().split(" ").join("_")}(e)),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then(()=>this.onDisconnect()).catch(r=>console.error("Error disconnecting",r))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(r){throw Z1(r)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=r=>{this.syncAccounts()},this.onError=r=>{this.syncAccounts()},this.onReadyStateChange=r=>{r!=="Installed"&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.autoConnectEnabled=n,this.wallets=[]}};function vge(t){var r,i;let e=new RegExp(RegExp("^eip155:(?<chainId>\\d+)$","gm")),n=(i=(r=e.exec(t))==null?void 0:r.groups)==null?void 0:i.chainId;if(n)return parseInt(n);throw Error("Chain ID not compatible with CAIP-2 format.")}const VB=t=>t.filter(e=>e.method==="wallets"||(e.method==="exchange"?e.provider==="coinbase":e.method==="card"||e.method==="payment-request"?e.provider==="coinbase"||e.provider==="moonpay":(e.method,!1))),QX={[W5.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[Cpe.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[I_.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[xpe.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[T_.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[Epe.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[$_.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[wpe.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[hB.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[ype.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[k_.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[mpe.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},XX=({address:t,appConfig:e,fundWalletConfig:n,methodScreen:r,chainIdOverride:i,comingFromSendTransactionScreen:s=!1})=>{var m;let o,a;if(!e.fundingConfig)throw Error("Wallet funding is not enabled");let c=VB(e.fundingConfig.options);if(c.length<1)throw Error("Wallet funding is not enabled");o=i||(lT(n)&&n.chain?n.chain.id:vge(e.fundingConfig.defaultRecommendedCurrency.chain));let l=e.chains.find(y=>y.id===o);if(!l)throw new ve(`Funding chain ${o} is not in PrivyProvider chains list`);let u=lT(n)&&n.amount?n.amount:e.fundingConfig.defaultRecommendedAmount,d=!1;function h(){if(!o)return;let y=QX[o];c.find(v=>v.method==="wallets")&&!y&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),a=y,d=!0}lT(n)&&"asset"in n?n.asset==="USDC"?h():typeof n.asset!="string"&&"erc20"in n.asset&&(d=((y,v)=>y===QX[v.id])(a=n.asset.erc20,l)):e.fundingConfig.defaultRecommendedCurrency.asset==="USDC"&&h();let f=n==null?void 0:n.defaultFundingMethod;return{chainType:"ethereum",address:t,amount:u,chain:l,erc20Address:a,erc20ContractInfo:d?{symbol:"USDC",decimals:6}:void 0,isUSDC:d,methodScreen:r,supportedOptions:c,comingFromSendTransactionScreen:s,defaultFundingMethod:f,usingDefaultFundingMethod:!!f,preferredCardProvider:(m=n==null?void 0:n.card)==null?void 0:m.preferredProvider,crossChainBridgingEnabled:e.fundingConfig.crossChainBridgingEnabled??!1,cluster:{name:"mainnet-beta",rpcUrl:e.solanaClusters["mainnet-beta"]},...Clt(n)?{moonpayConfigOverride:n.config}:{},uiConfig:n&&"uiConfig"in n?n.uiConfig:void 0}};function Qdt({address:t,fundWalletConfig:e,appConfig:n,comingFromSendTransactionScreen:r,methodScreen:i}){var c,l,u;if(!n.fundingConfig)throw Error("Wallet funding is not enabled");let s=VB(n.fundingConfig.options);if(s.length<1)throw Error("Wallet funding is not enabled");let o=(e==null?void 0:e.amount)??n.fundingConfig.defaultRecommendedAmount,a=e
205==null?void 0:e.defaultFundingMethod;return{chainType:"solana",address:t,supportedOptions:s,amount:o,isUSDC:!1,methodScreen:i,comingFromSendTransactionScreen:r,cluster:{name:((c=e==null?void 0:e.cluster)==null?void 0:c.name)??"mainnet-beta",rpcUrl:n.solanaClusters[((l=e==null?void 0:e.cluster)==null?void 0:l.name)??"mainnet-beta"]},crossChainBridgingEnabled:n.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:a,preferredCardProvider:(u=e==null?void 0:e.card)==null?void 0:u.preferredProvider,usingDefaultFundingMethod:!!a,uiConfig:e==null?void 0:e.uiConfig}}const Xdt=({as:t="div",...e},n)=>p.jsx(t,{...e,ref:n}),Jdt=E.forwardRef(Xdt),eht="https://challenges.cloudflare.com/turnstile/v0/api.js",G9="cf-turnstile-script",tht="cf-turnstile",bge="onloadTurnstileCallback",Z9=t=>!!document.getElementById(t),nht=({render:t="explicit",onLoadCallbackName:e=bge,scriptOptions:{nonce:n="",defer:r=!0,async:i=!0,id:s="",appendTo:o,onError:a,crossOrigin:c=""}={}})=>{const l=s||G9;if(Z9(l))return;const u=document.createElement("script");if(u.id=l,u.src=`${eht}?onload=${e}&render=${t}`,document.querySelector(`script[src="${u.src}"]`))return;u.defer=!!r,u.async=!!i,n&&(u.nonce=n),c&&(u.crossOrigin=c),a&&(u.onerror=a),(o==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(u)},Zl={normal:{width:300,height:65},compact:{width:130,height:120},invisible:{width:0,height:0,overflow:"hidden"},interactionOnly:{width:"fit-content",height:"auto"}};function rht(t){let e;return t!=="invisible"&&(e=t),e}function iht(t=G9){const[e,n]=E.useState(!1);return E.useEffect(()=>{const r=()=>{Z9(t)&&n(!0)},i=new MutationObserver(r);return i.observe(document,{childList:!0,subtree:!0}),r(),()=>{i.disconnect()}},[t]),e}const xge=E.forwardRef((t,e)=>{const{scriptOptions:n,options:r={},siteKey:i,onWidgetLoad:s,onSuccess:o,onExpire:a,onError:c,onBeforeInteractive:l,onAfterInteractive:u,onUnsupported:d,onLoadScript:h,id:f,style:m,as:y="div",injectScript:v=!0,...b}=t,C=r.size??"normal",[x,_]=E.useState(r.execution==="execute"?Zl.invisible:r.appearance==="interaction-only"?Zl.interactionOnly:Zl[C]),$=E.useRef(null),I=E.useRef(!1),[R,N]=E.useState(),[T,O]=E.useState(!1),U=f??tht,z=v?(n==null?void 0:n.id)||`${G9}__${U}`:(n==null?void 0:n.id)||G9,L=iht(z),S=n!=null&&n.onLoadCallbackName?`${n.onLoadCallbackName}__${U}`:`${bge}__${U}`,k=E.useMemo(()=>({sitekey:i,action:r.action,cData:r.cData,callback:o,"error-callback":c,"expired-callback":a,"before-interactive-callback":l,"after-interactive-callback":u,"unsupported-callback":d,theme:r.theme??"auto",language:r.language??"auto",tabindex:r.tabIndex,"response-field":r.responseField,"response-field-name":r.responseFieldName,size:rht(C),retry:r.retry??"auto","retry-interval":r.retryInterval??8e3,"refresh-expired":r.refreshExpired??"auto",execution:r.execution??"render",appearance:r.appearance??"always"}),[i,r,o,c,a,C,l,u,d]),M=E.useMemo(()=>JSON.stringify(k),[k]);return E.useImperativeHandle(e,()=>{if(typeof window>"u"||!L)return;const{turnstile:W}=window;return{getResponse(){if(!(W!=null&&W.getResponse)||!R){console.warn("Turnstile has not been loaded");return}return W.getResponse(R)},reset(){if(!(W!=null&&W.reset)||!R){console.warn("Turnstile has not been loaded");return}r.execution==="execute"&&_(Zl.invisible);try{W.reset(R)}catch(H){console.warn(`Failed to reset Turnstile widget ${R}`,H)}},remove(){if(!(W!=null&&W.remove)||!R){console.warn("Turnstile has not been loaded");return}N(""),_(Zl.invisible),W.remove(R)},render(){if(!(W!=null&&W.render)||!$.current||R){console.warn("Turnstile has not been loaded or widget already rendered");return}const H=W.render($.current,k);return N(H),r.execution!=="execute"&&_(Zl[C]),H},execute(){if(r.execution==="execute"){if(!(W!=null&&W.execute)||!$.current||!R){console.warn("Turnstile has not been loaded or widget has not been rendered");return}W.execute($.current,k),_(Zl[C])}},isExpired(){if(!(W!=null&&W.isExpired)||!R){console.warn("Turnstile has not been loaded");return}return W.isExpired(R)}}},[L,R,r.execution,C,k,$]),E.useEffect(()=>(window[S]=()=>O(!0),()=>{delete window[S]}),[S]),E.useEffect(()=>{v&&!T&&nht({onLoadCallbackName:S,scriptOptions:{...n,id:z}})},[v,T,S,n,z]),E.useEffect(()=>{L&&!T&&window.turnstile&&O(!0)},[T,L]),E.useEffect(()=>{if(!i){console.warn("sitekey was not provided");return}if(!L||!$.current||!T||I.current)return;const W=window.turnstile.render($.current,k);N(W),I.current=!0},[L,i,k,I,T]),E.useEffect(()=>{if(window.turnstile&&$.current&&R){Z9(R)&&window.turnstile.remove(R);const W=window.turnstile.render($.current,k);N(W),I.current=!0}},[M,i]),E.useEffect(()=>{if(window.turnstile&&R&&Z9(R))return s==null||s(R),()=>{window.turnstile.remove(R)}},[R,s]),E.useEffect(()=>{_(r.execution==="execute"?Zl.invisible:k.appearance==="interaction-only"?Zl.interactionOnly:Zl[C])},[r.execution,C,k.appearance]),E.useEffect(()=>{!L||typeof h!="function"||h()},[L,h]),p.jsx(Jdt,{ref:$,as:y,id:U,style:{...x,...m},...b})});xge.displayName="Turnstile";const JX=t=>Symbol.iterator in t,eJ=t=>"entries"in t,tJ=(t,e)=>
205{const n=t instanceof Map?t:new Map(t.entries()),r=e instanceof Map?e:new Map(e.entries());if(n.size!==r.size)return!1;for(const[i,s]of n)if(!Object.is(s,r.get(i)))return!1;return!0},sht=(t,e)=>{const n=t[Symbol.iterator](),r=e[Symbol.iterator]();let i=n.next(),s=r.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=r.next()}return!!i.done&&!!s.done};function oht(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:JX(t)&&JX(e)?eJ(t)&&eJ(e)?tJ(t,e):sht(t,e):tJ({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}const{useSyncExternalStoreWithSelector:aht}=Gxe,cht=t=>t;function lht(t,e=cht,n){const r=aht(t.subscribe,t.getState,t.getInitialState,e,n);return Rt.useDebugValue(r),r}const nJ=(t,e)=>{const n=Vce(t),r=(i,s=e)=>lht(n,i,s);return Object.assign(r,n),r},uht=(t,e)=>t?nJ(t,e):nJ,dht=t=>{let[e,n]=E.useState("auto");return E.useEffect(()=>{let r=new ResizeObserver(i=>{var s;n(((s=i[0])==null?void 0:s.contentRect.height)??"auto")});return t.current&&r.observe(t.current),()=>{t.current&&r.unobserve(t.current)}},[t.current]),e};function Ege(t){let{logout:e}=E.useContext(Cp);return V5("logout",t),{logout:e}}function hht(t){let{login:e}=E.useContext(Cp);return V5("login",t),{login:e}}function fht(t){let{connectWallet:e}=E.useContext(Cp);return V5("connectWallet",t),{connectWallet:e}}C5(()=>({isModalOpen:!1,resolvers:null}));uht(()=>({}),oht);const pht=({children:t,theme:e})=>p.jsxs(ght,{$theme:e,children:[p.jsx(Uu,{width:"1.25rem",color:e==="dark"?"#FDE68A":"var(--privy-color-warn)"}),t]});let ght=ue.div.withConfig({displayName:"Container",componentId:"sc-97f152b3-0"})(["display:flex;gap:0.5rem;background-color:",";"," align-items:flex-start;text-align:left;padding:0.5rem 0.75rem;font-size:0.8125rem;font-weight:400;line-height:1.125rem;padding:0.75rem;&&{border-radius:var(--privy-border-radius-sm);}"],t=>t.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-warn-light)",t=>t.$theme==="dark"?"color: #FDE68A;":"");function mht(t){let[e,n]=E.useState(t.dimensions.width),[r,i]=E.useState(void 0),s=E.useRef(null);E.useEffect(()=>{if(s.current&&e===void 0){let{width:c}=s.current.getBoundingClientRect();n(c)}let a=getComputedStyle(document.documentElement);i({background:a.getPropertyValue("--privy-color-background"),background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]);let o=t.walletToExport.chainType==="ethereum"&&!t.walletToExport.imported;return p.jsx("div",{ref:s,children:e&&p.jsxs(wht,{children:[p.jsx("iframe",{style:{position:"absolute",zIndex:1},width:e,height:t.dimensions.height,allow:"clipboard-write self *",src:Yfe(t.origin,`/apps/${t.appId}/embedded-wallets/export`,{client_id:t.appClientId,primaryAddress:t.primaryWallet.address,address:t.walletToExport.address,walletIndex:t.walletToExport.walletIndex,width:`${e}px`,caid:t.clientAnalyticsId,phrase_export:o,...r},{token:t.accessToken})}),p.jsx(rJ,{children:"Loading..."}),o&&p.jsx(rJ,{children:"Loading..."})]})})}const fj={component:()=>{let[t,e]=E.useState(null),{authenticated:n,user:r,getAccessToken:i}=Wn(),{closePrivyModal:s,createAnalyticsEvent:o,clientAnalyticsId:a}=Ht(),c=Vr(),{data:l,onUserCloseViaDialogOrKeybindRef:u}=jt(),{onFailure:d,onSuccess:h,origin:f,appId:m,appClientId:y,walletToExport:v,primaryWallet:b}=l.keyExport,C=_=>{s({shouldCallAuthOnSuccess:!1}),d(typeof _=="string"?Error(_):_)},x=()=>{s({shouldCallAuthOnSuccess:!1}),h(),o({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:v.address}})};return E.useEffect(()=>{if(!n||!v)return C("User must be authenticated before exporting their wallet");i().then(e,C)},[n,r]),u.current=x,p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:x}),p.jsxs(yht,{children:[p.jsx(uh,{children:"Transfer wallet"}),p.jsxs(Sp,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",p.jsx("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),p.jsx(pht,{theme:c.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),p.jsx(J_,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:v.address,showIcon:!0}),p.jsx("div",{style:{width:"100%"},children:t&&p.jsx(mht,{origin:f,appId:m,appClientId:y,accessToken:t,clientAnalyticsId:a,walletToExport:v,primaryWallet:b,dimensions:{height:"44px"}})})]}),p.jsx(ln,{})]})}};let yht=ue.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-f9e8f1f7-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),wht=ue.div.withConfig({displayName:"ButtonContainer",componentId:"sc-f9e8f1f7-1"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),rJ=ue.div.withConfig({displayName:"LoadingButton",componentId:"sc-f9e8f1f7-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);const sf={component:()=>{let{authenticated:t,user:e,getAccessToken:n}=Wn(),{closePrivyModal:r,createAnalyticsEvent:i,walletProxy:s}=Ht(),{navigate:o,data:a,setModalData:c,onUserCloseViaDialogOrKeybindRef:l}=jt(),u=E.useMemo(()=>Date.now(),[]),[d,h]=E.useState(!1),{onCompleteNavigateTo:f,onFailure:m,shouldForceMFA:y,entropyId:v,entropyIdVerifier:b}=a==null?void 0:a.connectWallet,C=_=>{d||(h(!0),m(typeof _=="string"?Error(_):_))};E.useEffect(()=>{let _,$=j9(e,v);return t&&$?s?((async()=>{let I=await n();if(!I)return C("User must be authenticated and have a Privy wallet before it can be connected");try{await s.connect({accessToken:I,entropyId:v,entropyIdVerifier:b}),y&&await s.verifyMfa({accessToken:I});let R=(Date.now()-u)/1e3;f===fj&&R<1?_=setTimeout(()=>{o(f,!1)}
205,1e3*(1-R)):o(f,!1)}catch(R){if(F9(R)&&$.recoveryMethod==="privy"){let N=await n();if(!N)return C("User must be authenticated and have a Privy wallet before it can be recovered");try{i({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:$.address}});let T=await(s==null?void 0:s.recover({accessToken:N,entropyId:v,entropyIdVerifier:b}));T!=null&&T.entropyId||C(Error("Unable to recover wallet")),f?o(f):r({shouldCallAuthOnSuccess:!1}),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:$.address}}),o(f)}catch{C("An error has occurred, please try again.")}}else F9(R)&&$.recoveryMethod!=="privy"?(c({...a,recoverWallet:{entropyId:v,entropyIdVerifier:b,onCompleteNavigateTo:f,onFailure:m},recoveryOAuthStatus:{provider:$.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),o(C0e($.recoveryMethod))):C(R)}})(),()=>clearTimeout(_)):void 0:C("User must be authenticated and have a Privy wallet before it can be connected")},[t,e,s]);let x=()=>{C("User exited before wallet could be connected"),r({shouldCallAuthOnSuccess:!1})};return l.current=x,p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:x}),d?p.jsxs(p.Fragment,{children:[p.jsxs(Ch,{children:[p.jsx(l_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),p.jsx(ei,{title:"Something went wrong",description:"Weâre on it. Please try again later."})]}),p.jsx(tn,{onClick:()=>r({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):p.jsx(o0e,{}),p.jsx(vht,{})]})}};let vht=ue.div.withConfig({displayName:"BottomSpacing",componentId:"sc-734db565-0"})(["height:44px;"]);const bht=ue.img.withConfig({displayName:"StyledLogo",componentId:"sc-68c1b1ea-0"})(["&&{height:",";width:",";border-radius:16px;margin-bottom:12px;}"],t=>t.size==="sm"?"65px":"140px",t=>t.size==="sm"?"65px":"140px");let xht=t=>{if(!Da(t))return t;try{return k6e(t)}catch{return t}},Eht=t=>{let{types:e,primaryType:n,...r}=t.typedData;return p.jsxs(p.Fragment,{children:[p.jsx($1e,{data:r}),p.jsx(K_,{text:(i=t.typedData,JSON.stringify(i,null,2)),itemName:"full payload to clipboard"})," "]});var i};const vT={component:()=>{let{authenticated:t}=Wn(),{initializeWalletProxy:e,closePrivyModal:n}=Ht(),{navigate:r,data:i,onUserCloseViaDialogOrKeybindRef:s}=jt(),[o,a]=E.useState(!0),[c,l]=E.useState(""),[u,d]=E.useState(),[h,f]=E.useState(null),[m,y]=E.useState(!1),v=h!==null;E.useEffect(()=>{t||r(mo)},[t]),E.useEffect(()=>{e(Em).then(T=>{a(!1),T||(l("An error has occurred, please try again."),d(new Vd(new ty(c,cl.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:b,data:C,confirmAndSign:x,onSuccess:_,onFailure:$,uiOptions:I}=i.signMessage,R={title:(I==null?void 0:I.title)||"Sign message",description:(I==null?void 0:I.description)||"Signing this message will not cost you any fees.",buttonText:(I==null?void 0:I.buttonText)||"Sign and continue"},N=T=>{T?_(T):$(u||new Vd(new ty("The user rejected the request.",cl.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{f(null),l(""),d(void 0)},200)};return s.current=()=>{N(h)},p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:()=>N(h)}),p.jsx(sr,{}),I!=null&&I.iconUrl&&typeof I.iconUrl=="string"?p.jsx(Sht,{children:p.jsx(bht,{size:"sm",src:I.iconUrl,alt:"app image"})}):null,p.jsx(uh,{children:R.title}),p.jsx(Sp,{children:R.description}),b==="personal_sign"&&p.jsx(nj,{children:xht(C)}),b==="eth_signTypedData_v4"&&p.jsx(Eht,{typedData:C}),b==="solana_signMessage"&&p.jsx(nj,{children:C}),p.jsx(Aht,{}),p.jsx(Cht,{$fail:!0,children:c}),p.jsx(d3,{disabled:m||v||o,loading:m,onClick:async()=>{y(!0),l("");try{let T=await x();f(T),y(!1),setTimeout(()=>{N(T)},Jr)}catch(T){console.error(T),l("An error has occurred, please try again."),d(new Vd(new ty(c,cl.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),y(!1)}},children:m?"Signing...":v?p.jsxs(_ht,{children:[p.jsx(A0e,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",p.jsx("span",{children:"Success"})]}):R.buttonText}),(I==null?void 0:I.isCancellable)&&p.jsx(q5,{style:{marginTop:"1rem"},onClick:()=>N(null),isSubmitting:!1,children:"Not now"}),p.jsx(dr,{}),p.jsx(ln,{})]})}};let Cht=ue.div.withConfig({displayName:"InputHelp",componentId:"sc-1a9f17a4-0"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-start;width:100%;margin-top:16px;margin-bottom:4px;"],t=>t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"),_ht=ue.span.withConfig({displayName:"ContentWithIcon",componentId:"sc-1a9f17a4-1"})(["display:flex;align-items:center;gap:8px;"]),Sht=ue.div.withConfig({displayName:"IconContainer",componentId:"sc-1a9f17a4-2"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;"]),Aht=ue.div.withConfig({displayName:"Grow",componentId:"sc-1a9f17a4-3"})(["flex-grow:1;"]);function kht({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
205currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const Cge=E.forwardRef(kht);function $ht({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z",clipRule:"evenodd"}))}const Iht=E.forwardRef($ht);function Tht({title:t,titleId:e,...n},r){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M12.516 2.17a.75.75 0 0 0-1.032 0 11.209 11.209 0 0 1-7.877 3.08.75.75 0 0 0-.722.515A12.74 12.74 0 0 0 2.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 0 0 .374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 0 0-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08Zm3.094 8.016a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const Pht=E.forwardRef(Tht),Rht=async({emitPrivyEvent:t,getAccessToken:e,initializeWalletProxy:n,refreshSessionAndUser:r,user:i},{privateKey:s,chainType:o})=>{if(!i)throw t("linkAccount","onError",Ce.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new ve("User must be authenticated before linking an account.");let[a,c]=await Promise.all([e(),n(15e3)]);if(!c||!a)throw t("linkAccount","onError",Ce.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new ve("User must be authenticated before linking an account.");await c.importWallet({privateKey:s,accessToken:a,chainType:o});let l=await r(),u=o==="solana"?bb(l):FO(l);if(!u)throw t("createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return t("createWallet","onSuccess",{wallet:u}),u};class _ge{async authenticate(){if(!this.api)throw new ve("Auth flow has no API instance");try{return await this.api.post(ZCe,{token:this.meta.token})}catch(e){throw Gn(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}}function y3(t){return t?{"privy-ui":"t"}:void 0}class jm{async authenticate(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new ve("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(bCe,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Gn(e)}}async link(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new ve("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(xCe,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw Gn(e)}}async sendCodeEmail({email:e,captchaToken:n,withPrivyUi:r}){if(!this.api)throw new ve("Auth flow has no API instance");if(e&&(this.meta.email=e),n&&(this.meta.captchaToken=n),!this.meta.email)throw new ve("Email must be set when initialzing authentication.");let i=y3(r);try{return await this.api.post(vCe,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw Gn(s)}}constructor({email:e,captchaToken:n,disableSignup:r}){this.meta={email:e,captchaToken:n,disableSignup:r??!1}}}class Mht extends jm{async link(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new ve("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(CCe,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw Gn(e)}}constructor(e,n,r){super({email:n,captchaToken:r}),this.meta={email:n,captchaToken:r,oldAddress:e,disableSignup:!1}}}class iJ{get meta(){return this._meta}async authenticate(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.channelToken)throw new ve("Auth flow must be initialized first");try{let e=await this.api.post(pCe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new ve("No response from authentication");return e}catch(e){throw Gn(e)}}async link(){if(!this.api)throw new ve("Auth flow has no API instance");try{return await this.api.post(gCe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw Gn(e)}}async _startChannelOnce(){if(!this.api)throw new ve("Auth flow has no API instance");let e=await this.api.post(fCe,{token:this.captchaToken});di.isMobile&&!di.isIOS&&e.connect_uri&&Jfe(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new ve("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.channelToken)throw new ve("Auth flow must be initialized first");let e=await this.api.get(mCe,{headers:{"farcaster-channel-token":this.meta.channelToken}});return e.state==="completed"&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,n=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new ko(this._startChannelOnce.bind(this)),this.pollForReady=new ko(this._pollForReady.bind(this)),this._meta.disableSignup=n}}class Sge{getOrCreateGuestCredential(e){let n=tpe(e);if(TO()){if(cn.get(n))return cn.get(n);{let r=o9(NO(32));return cn.put(n,r),r}}return o9(NO(32))}async authenticate(){if(!this.api)throw new ve("Auth flow has no API instance");try{return await this.api.post(YCe,{guest_credential:this.meta.guestCredential})}catch(e){throw Gn(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}}class Cm{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new ve("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new ve("User denied confirmation during OAuth flow");let e=qit();try{let n=await this.api.post(Koe,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return cn.del(Qv),cn.del(R9),cn.del(M9),n}catch(n){let r=Gn(n);throw r.privyErrorCode?new ve(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.message==="User denied confirmation during OAuth flow"?new ve("Invalid code during oauth flow.",void 0,Ce.OAUTH_USER_DENIED):new ve("Invalid code during OAuth flow.",void 0,Ce.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new ve("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");
205if(this.meta.authorizationCode==="undefined")throw new ve("User denied confirmation during OAuth flow");let e=cn.get(Qv);if(!e)throw new ve("Authentication error.");try{let n=await this.api.post(Goe,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return cn.del(Qv),n}catch(n){throw Gn(n)}}async getAuthorizationUrl(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.provider)throw new ve("Provider must be set when initializing OAuth authentication.");let e=S_();cn.put(Qv,e);let n=uB();cn.put(P9,n);let r=await dB(e);this.meta.withPrivyUi||cn.put(R9,!0),this.meta.disableSignup&&cn.put(M9,!0);let i=y3(this.meta.withPrivyUi);try{return await this.api.post(qoe,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:n},{headers:{...i}})}catch(s){throw Gn(s)}}constructor(e){this.meta=e}}const Oht=({style:t})=>p.jsx(fhe,{style:{color:"var(--privy-color-error)",...t}});let sJ={google:{name:"Google",component:ape},discord:{name:"Discord",component:spe},github:{name:"Github",component:ope},linkedin:{name:"LinkedIn",component:lpe},twitter:{name:"Twitter",component:hpe},spotify:{name:"Spotify",component:upe},instagram:{name:"Instagram",component:cpe},tiktok:{name:"Tiktok",component:dpe},apple:{name:"Apple",component:ipe}};const bT=t=>t in sJ?sJ[t]:{name:"Unknown",component:Oht};function jht(){let t=new URLSearchParams(window.location.search),e=t.get("privy_oauth_code"),n=t.get("privy_oauth_state"),r=t.get("privy_oauth_provider");if(!e||!n||!r)return{inProgress:!1};let i=!1;try{i=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:e,stateCode:n,provider:r,withPrivyUi:!cn.get(R9),popupFlow:window.opener!==null&&i,disableSignup:!!cn.get(M9)}}class dm{async initRegisterFlow(e){if(!this.api)throw new ve("Auth flow has no API instance");this.authenticateForRegistration=!0,this.meta.initRegisterResponse=await this.initRegisterOnce.execute(e)}async initAuthenticationFlow(e){if(!this.api)throw new ve("Auth flow has no API instance");this.authenticateForRegistration=!1,this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new ve("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async register(){var n,r;let e=await mr(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new ve("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new ve("WebAuthn is not supported in this browser");this.meta.initRegisterResponse||(this.meta.initRegisterResponse=await this.initRegisterOnce.execute());try{let i=this.meta.initRegisterResponse.options,s=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(r=(n=this.meta).setPasskeyAuthState)==null||r.call(n,{status:"submitting-response"}),await this.api.post(UCe,{relying_party:this.meta.initRegisterResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(s)})}catch(i){throw i.name==="NotAllowedError"?new ve("Passkey request timed out or rejected by user.",void 0,Ce.PASSKEY_NOT_ALLOWED):Gn(i)}}async authenticate(){var r,i,s;if(this.authenticateForRegistration)return this.register();let e=await mr(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new ve("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new ve("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());let n=((r=this.meta.allowedCredentialsIds)==null?void 0:r.map(o=>({type:"public-key",id:o})))??this.meta.initAuthenticateResponse.options.allow_credentials;try{let o=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase({...this.meta.initAuthenticateResponse.options,allow_credentials:n}));return(s=(i=this.meta).setPasskeyAuthState)==null||s.call(i,{status:"submitting-response"}),await this.api.post(FCe,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(o)})}catch(o){throw o.name==="NotAllowedError"?new ve("Passkey request timed out or rejected by user.",void 0,Ce.PASSKEY_NOT_ALLOWED):Gn(o)}}async link(){var n,r;let e=await mr(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new ve("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new ve("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let i=this.meta.initLinkResponse.options,s=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(r=(n=this.meta).setPasskeyAuthState)==null||r.call(n,{status:"submitting-response"}),await this.api.post(BCe,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(s)})}catch(i){throw i.name==="NotAllowedError"?new ve("Passkey request timed out or rejected by user.",void 0,Ce.PASSKEY_NOT_ALLOWED):Gn(i)}}async _initRegisterOnce(e){if(!this.api)throw new ve("Auth flow has no API instance");let n=y3(e);return await this.api.post(LCe,{token:this.meta.captchaToken},{headers:{...n}})}async _initAuthenticateOnce(e){if(!this.api)throw new ve("Auth flow has no API instance");let n=y3(e);return await this.api.post(DCe,{token:this.meta.captchaToken},{headers:{...n}})}async _initLinkOnce(){if(!this.api)throw new ve("Auth flow has no API instance");return await this.api.post(NCe,{})}_transformInitLinkOptionsToCamelCase(e){var n,r,i,s,o,a,c,l,u;return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map(d=>({type:d.type,alg:d.alg})),timeout:e.timeout,excludeCredentials:(n=e.exclude_credentials)==null?void 0:n.map(d=>({id:d.id,type:d.type,transports:d.transports})),authenticatorSelection:{authenticatorAttachment:(r=e.authenticator_selection)==null?void 0:r.authenticator_attachment,requireResidentKey:(i=e.authenticator_selection)==null?void 0:i.require_resident_key,residentKey:(s=e.authenticator_selection)==null?void 0:s.resident_key,userVerification:(o=e.authenticator_selection)==null?void 0:o.user_verification},attestation:e.attestation,extensions:{appid:(a=e.extensions)==null?void 0:a.app_id,credProps:(l=(c=e.extensions)==null?void 0:c.cred_props)==null?void 0:l.rk,hmacCreateSecret:(u=e.extensions)==null?void 0:u.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_i
205d:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){var n,r,i,s;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((n=e.allow_credentials)==null?void 0:n.map(o=>({id:o.id,type:o.type,transports:o.transports})))||[],timeout:e.timeout,extensions:{appid:(r=e.extensions)==null?void 0:r.app_id,credProps:(i=e.extensions)==null?void 0:i.cred_props,hmacCreateSecret:(s=e.extensions)==null?void 0:s.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor({captchaToken:e,setPasskeyAuthState:n}){this.authenticateForRegistration=!1,this.initRegisterOnce=new ko(this._initRegisterOnce.bind(this)),this.initAuthenticateOnce=new ko(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new ko(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:n}}}class Nm{async authenticate(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new ve("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post($Ce,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Gn(e)}}async link(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new ve("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(ACe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Gn(e)}}async sendSmsCode({phoneNumber:e,captchaToken:n,withPrivyUi:r}){if(!this.api)throw new ve("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),n&&(this.meta.captchaToken=n),!this.meta.phoneNumber)throw new ve("phone nNumber must be set when initialzing authentication.");let i=y3(r);try{return await this.api.post(SCe,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw Gn(s)}}constructor({phoneNumber:e,captchaToken:n,disableSignup:r}){this.meta={phoneNumber:e,captchaToken:n,disableSignup:r??!1}}}class Nht extends Nm{async link(){if(!this.api)throw new ve("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new ve("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(ICe,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Gn(e)}}constructor(e,n,r){super({phoneNumber:n,captchaToken:r}),this.meta={phoneNumber:n,captchaToken:r,oldPhoneNumber:e,disableSignup:!1}}}class Af{static parse(e){try{return new Af(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return Zq(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=Zq(e)}}class qB extends Af{static parse(e){try{return new qB(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}}let v6,Dht=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],oJ=(t,e)=>t.makeWeb3Provider({options:e});
205class Lht extends H2{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Xit,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new li("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Z1(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(oJ(v6,this.connectionOptions))}constructor(e,n,r,i,s,o){if(super("coinbase_wallet",e,n,r),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new Y1(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!v6){let a=[n.id].concat(e.map(l=>l.id)),c=this.connectionOptions!=="eoaOnly"?a.filter(l=>!Dht.includes(l)):[];c.length>0&&!c.every(l=>Spe.has(l))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${c.join(", ")}`),v6=new Kdt({appName:s,appLogoUrl:o,appChainIds:a})}this.proxyProvider.setWalletProvider(oJ(v6,this.connectionOptions))}}class aJ extends H2{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[T9((e==null?void 0:e.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Ipe,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:n,defaultChain:r,rpcConfig:i,imported:s,walletIndex:o}){super("privy",n,r,i),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=o,s&&(this.connectorType="embedded_imported"),this.subscribeListeners()}}const Bht=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"];class of extends Error{constructor(e,n,r){super(e),this.code=n,this.data=r}}class cJ extends wp{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new of(`Invalid params for ${e.method}`,4200);let n=e.params[0];if(!await Nn()||!this.address)throw new of("Disconnected",4900);let{hash:r}=await Dpt(n,{address:this.address});return r}async handleSignTransaction(e){if(!e.params||!Array.isArray(e.params))throw new of(`Invalid params for ${e.method}`,4200);let n=e.params[0];if(!await Nn()||!this.address)throw new of("Disconnected",4900);let{signature:r}=await Npt(n,{address:this.address});return r}handleSwitchEthereumChain(e){let n;if(!e.params||!Array.isArray(e.params))throw new of(`Invalid params for ${e.method}`,4200);if(typeof e.params[0]=="string")n=e.params[0];else{if(!("chainId"in e.params[0])||typeof e.params[0].chainId!="string")throw new of(`Invalid params for ${e.method}`,4200);n=e.params[0].chainId}this.chainId=Number(n),this.publicClient=l2(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",n)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let n=e.params[0],r=e.params[1],{signature:i}=await Opt({message:n},{address:r});return i}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let n=e.params[0],r=typeof e.params[1]=="string"?JSON.parse(e.params[1]):e.params[1],{signature:i}=await jpt(RO(r),{address:n});return i}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let n={...e.params[0],chainId:T9(this.chainId)};return await this.publicClient.estimateGas({account:n.from??this.address,...Tpe(n)})}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return T9(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"eth_signTransaction":return this.handleSignTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!(n=>Bht.includes(n))(e.method))return this.publicClient.request({method:e.method,params:e.params});{let n=await Nn();if(await Lpt(),!n||!this.address)throw new of("Disconnected",4900);try{return(await this.walletProxy.rpc({accessToken:n,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:{method:e.method,params:e.params}})).response.data}catch(r){throw console.error(r),new of("Disconnected",4900)}}}constructor({walletProxy:e,address:n,entropyId:r,entropyIdVerifier:i,rpcConfig:s,chains:o,appId:a,chainId:c=1,walletIndex:l}){super(),this.walletProxy=e,this.address=n,this.entropyId=r,this.entropyIdVerifier=i,this.chainId=c,this.rpcConfig=s,this.chains=o,this.publicClient=l2(c,this.chains,s,{appId:a}),this.rpcTimeoutDuration=fB(s,"privy"),this.appId=a,this.walletIndex=l}}class Fht extends H2{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}
205async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the EthereumNullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the EthereumNullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the EthereumNullConnector for ${e}`)}constructor({id:e,name:n,icon:r,walletClientType:i,defaultChain:s}){super(i,[],s,{}),this.connectorType="null",this.proxyProvider=new Y1(void 0,__),this.id=e,this.name=n,this.icon=r,this.connectorType=i}}const Uht=({style:t,...e})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...t},...e,children:[p.jsx("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),p.jsx("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),p.jsx("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),p.jsx("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),p.jsx("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),p.jsx("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),p.jsx("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),p.jsx("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),p.jsx("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),p.jsx("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),p.jsx("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),p.jsx("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),p.jsx("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),zht=({style:t,...e})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...t},...e,children:[p.jsx("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});function xT(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw TypeError("attempted to use private field on non-instance");return t}var Wht=0;
205class Age extends H2{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new li("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Z1(e)}}constructor(e,n,r,i,s){super(s||"unknown",e,n,r),this.connectorType="injected",this.proxyProvider=new Y1(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let o=i.provider;this.proxyProvider.setWalletProvider(o)}}var Xp="__private_"+Wht+++"__walletBranding";class ET extends H2{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return xT(this,Xp)[Xp]??{name:"Browser Extension",icon:pB,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new li("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Z1(e)}}constructor(e,n,r,i,s){super(s??"unknown",e,n,r),Object.defineProperty(this,Xp,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new Y1(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),s==="metamask"?xT(this,Xp)[Xp]={name:"MetaMask",icon:Uht,id:"io.metamask"}:s==="phantom"&&(xT(this,Xp)[Xp]={name:"Phantom",icon:zht,id:"phantom"})}}class Hht extends Age{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{di.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new li("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Z1(e)}}}class Vht extends Ydt{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the SolanaNullConnector")}constructor({id:e,name:n,icon:r}){super({name:n},!1),this.connectorType="null",this.proxyProvider=new Y1(void 0,__),this.disconnect=async()=>{throw Error("disconnect called for an uninstalled wallet via the SolanaNullConnector")},this.promptConnection=async()=>{throw Error("promptConnection called for an uninstalled wallet via the SolanaNullConnector")},this.id=e,this.name=n,this.icon=r}}class qht extends wp{get wallets(){let e=new Set,n=this.walletConnectors.flatMap(i=>i.wallets).sort((i,s)=>i.connectedAt&&s.connectedAt?s.connectedAt-i.connectedAt:0).filter(i=>{let s=`${i.address}${i.walletClientType}${i.connectorType}${i.meta.id}`;return!e.has(s)&&(e.add(s),!0)}),r=n.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return r>=0&&n.unshift(n.splice(r,1)[0]),n}async initialize(e){var r,i,s;if(this.initialized&&!e)return;e&&this.removeAllConnectors(),cn.get(PQ)&&(cn.getKeys().forEach(o=>{o.startsWith("walletconnect")&&cn.del(o)}),cn.del(PQ));let n=Bit({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then(o=>{o.forEach(({type:a,eip6963InjectedProvider:c,legacyInjectedProvider:l})=>{this.createEthereumWalletConnector({connectorType:"injected",walletClientType:a,providers:{eip6963InjectedProvider:c,legacyInjectedProvider:l}})})});for(let o of(this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector({connectorType:"coinbase_wallet",walletClientType:"coinbase_wallet"}),Object.values(Ppe)))!o.isInstalled&&this.walletList.includes(o.client)&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&o.chainTypes.includes("ethereum")&&this.createEthereumWalletConnector({connectorType:"null",walletClientType:o.client,walletConfig:o}),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&o.chainTypes.includes("solana")&&this.addSolanaWalletConnector(new Vht({id:o.client,name:o.name})));this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector({connectorType:"wallet_connect_v2",walletClientType:"unknown"}),(r=this.externalWalletConfig.solana.connectors)==null||r.get().forEac
205h(this.addSolanaWalletConnector),(s=(i=this.externalWalletConfig.solana.connectors)==null?void 0:i._setOnConnectorsUpdated)==null||s.call(i,o=>{o==null||o.forEach(this.addSolanaWalletConnector)}),await n,this.initialized=!0}findWalletConnector(e,n){return e==="wallet_connect_v2"?this.walletConnectors.filter(gv).find(r=>r.connectorType===e)??null:this.walletConnectors.filter(gv).find(r=>r.connectorType===e&&r.walletClientType===n)??null}findSolanaWalletConnector(e){return this.walletConnectors.filter(Zdt).find(n=>n.walletClientType==="unknown"?n.walletBranding.id===e:n.walletClientType===e)??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter(e=>e.connectorType==="embedded")}onInitialized(e){e.wallets.forEach(n=>{let r=this.storedConnections.find(i=>i.address===n.address&&i.connectorType===n.connectorType&&(n.type==="solana"&&i.walletClientType==="unknown"&&n.walletClientType==="unknown"?n.meta.id===i.id:i.walletClientType===n.walletClientType));r&&(n.connectedAt=r.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:e,rootWallet:n,embeddedWallets:r,defaultChain:i,appId:s}){for(let o of r){let a=this.findEmbeddedWalletConnectors().find(c=>c.walletIndex===o.walletIndex);if(a&&gv(a))a.proxyProvider.walletProxy=e;else{let{entropyId:c,entropyIdVerifier:l}=Gr(n),u=new aJ({provider:new cJ({walletProxy:e,address:o.address,entropyId:c,entropyIdVerifier:l,rpcConfig:this.rpcConfig,chains:this.chains,appId:s,chainId:i.id,walletIndex:o.walletIndex}),chains:this.chains,defaultChain:i,rpcConfig:this.rpcConfig,imported:!1,walletIndex:o.walletIndex});this.addWalletConnector(u)}}}addImportedWalletConnector(e,n,r,i){let s=this.findWalletConnector("embedded_imported","privy");if(s&&gv(s))s.proxyProvider.walletProxy=e;else{let o=new aJ({provider:new cJ({walletProxy:e,address:n,entropyId:n,entropyIdVerifier:"ethereum-address-verifier",walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:r.id}),chains:this.chains,walletIndex:0,defaultChain:r,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(o)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter(e=>e.connectorType!=="embedded"),this.saveConnectionHistory(),this.storedConnections=I8(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let n=this.walletConnectors.indexOf(e);this.walletConnectors.splice(n,1),this.saveConnectionHistory(),this.storedConnections=I8(),this.emit("walletsUpdated")}}async createEthereumWalletConnector({connectorType:e,walletClientType:n,providers:r,walletConfig:i}){let s=this.findWalletConnector(e,n);if(s&&gv(s))return s instanceof ry&&s.resetConnection(n),s;let o=e!=="injected"?e==="coinbase_wallet"?new Lht(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):e!=="null"?new ry(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,n):i?new Fht({id:i.client,name:i.name,defaultChain:this.defaultChain,walletClientType:i.client}):null:n==="metamask"&&(r!=null&&r.eip6963InjectedProvider)?new Hht(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.eip6963InjectedProvider,"metamask"):n==="metamask"&&(r!=null&&r.legacyInjectedProvider)?new ET(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.legacyInjectedProvider,"metamask"):n==="phantom"&&(r!=null&&r.legacyInjectedProvider)?new ET(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.legacyInjectedProvider,"phantom"):r!=null&&r.legacyInjectedProvider&&n==="unknown_browser_extension"?new ET(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.legacyInjectedProvider):r!=null&&r.eip6963InjectedProvider?new Age(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.eip6963InjectedProvider,n):void 0;return o&&this.addWalletConnector(o),o||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",()=>this.onInitialized(e)),e.on("walletsUpdated",()=>this.onWalletsUpdated(e)),e.initialize().catch(n=>{console.debug("Failed to initialize connector",n)})}saveConnectionHistory(){let e=this.wallets.map(n=>({address:n.address,connectorType:n.connectorType,walletClientType:n.walletClientType,connectedAt:n.connectedAt,id:n.meta.id}));cn.put(npe,e)}async activeWalletSign(e){let n=this.wallets,r=n.length>0?n[0]:null;return r&&Ed(r)?r.sign(e):null}
205setActiveWallet(e){this.activeWallet=cr(e),this.emit("walletsUpdated")}setWalletList(e){this.walletList=e,this.initialized&&this.initialize(!0).catch(console.error)}removeAllConnectors(){for(let e of this.walletConnectors)e.removeAllListeners();this.walletConnectors=[]}constructor(e,n,r,i,s,o,a,c,l,u,d,h){super(),this.addSolanaWalletConnector=async f=>{let m=this.findSolanaWalletConnector(f.walletClientType);if(!m||m.connectorType==="null"){if((m==null?void 0:m.connectorType)==="null"){let y=this.walletConnectors.indexOf(m);this.walletConnectors.splice(y,1)}this.addWalletConnector(f)}},this.getEthereumProvider=()=>{let f=this.wallets[0],m=this.walletConnectors.find(y=>y.wallets.find(v=>v.address===(f==null?void 0:f.address)));return f&&m?m.proxyProvider:new Y1},this.privyAppId=e,this.walletConnectCloudProjectId=n,this.rpcConfig=r,this.chains=i,this.defaultChain=s,this.walletConnectors=[],this.initialized=!1,this.store=o,this.walletList=a,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=l,this.privyAppName=u,this.privyAppLogo=d,this.walletChainType=h||"ethereum-only",this.storedConnections=I8()}}let Kht=[Hoe,Voe,Zoe],Ght=class{async get(e,n){try{return await this.baseFetch(e,n)}catch(r){throw Gn(r)}}async post(e,n,r){try{return await this.baseFetch(e,{method:"POST",...n?{body:n}:{},...r})}catch(i){throw Gn(i)}}async delete(e,n){try{return await this.baseFetch(e,{method:"DELETE",...n})}catch(r){throw Gn(r)}}constructor({appId:e,appClientId:n,client:r,defaults:i}){this.appId=e,this.appClientId=n,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=Wit,this.client=r,this.defaults=i,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=u5.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:s,options:o})=>{let a=new Headers(o.headers);a.set("privy-app-id",this.appId),this.appClientId&&a.set("privy-client-id",this.appClientId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let c=Kht.includes(s.toString());if(!a.has("authorization")){let l=await this.client.getAccessToken({disableAutoRefresh:c});l!==null&&a.set("authorization",`Bearer ${l}`)}o.headers=a,o.retryDelay&&typeof o.retryDelay=="number"&&(o.retryDelay=3*o.retryDelay)},onRequestError:({error:s})=>{if(s instanceof DOMException&&s.name==="AbortError")throw new tCe}})}},Zht=/paymaster\.biconomy\.io\/api/i,Yht={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const Qht=(t,e)=>t&&Zht.test(t)?Yht:e&&e.policy_id?{policyId:e.policy_id}:void 0;function CT(){return!(di.isSafari&&window.location.origin.startsWith("http://localhost"))}const lJ=C5(()=>({identityToken:null}));var _T,uJ=((_T={}).PRIVY="privy_access_token",_T.CUSTOMER="customer_access_token",_T);class Xht{get token(){return this.privyAccessToken||this.customerAccessToken}getToken(e){return e==="privy_access_token"?this.privyAccessToken:this.customerAccessToken}get customerAccessToken(){return this._getToken(Yv)}get privyAccessToken(){return this._getToken(v8)}_getToken(e){try{let n=cn.get(e);return typeof n=="string"?Af.throwIfNotWellFormedJwt(n):null}catch(n){return console.error(n),this.destroyLocalState(),null}}get refreshToken(){try{let e=cn.get(qI);return typeof e=="string"?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let n=cn.get(p6(e));if(typeof n!="string")return null;{let r=new Af(n);return r.isExpired()?(cn.del(p6(e)),null):r.value}}catch(n){return console.error(n),null}}get mightHaveServerCookies(){try{let e=ru.get(KI);return e!==void 0&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(e="privy_access_token"){let n=typeof this.getToken(e)=="string",r=typeof this.refreshToken=="string"&&this.refreshToken!==Vit;return this.mightHaveServerCookies||n&&r}hasActiveAccessToken(e){let n=Af.parse(this.getToken(e));return n!==null&&!n.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,n){typeof n=="string"?cn.put(p6(e),n):cn.del(p6(e))}updateIdentityToken(e){typeof e=="string"?this.storeIdentityToken(e):this.clearIdentityToken()}async _authenticate(e){try{let n=await e.authenticate(),{user:r,is_new_user:i,oauth_tokens:s}=n;this.handleTokenResponse(n);let o=s?{provider:s.provider,accessToken:s.access_token,accessTokenExpiresInSeconds:s.access_token_expires_in_seconds,refreshToken:s.refresh_token,refreshTokenExpiresInSeconds:s.refresh_token_expires_in_seconds,scopes:s.scopes}:void 0;return this._trackAuthenticateEvents(e,i),{user:oo(r),isNewUser:i,oAuthTokens:o}}catch(n){throw console.warn("Error authenticating session"),Pr(n)}}_trackAuthenticateEvents(e,n){let r=function(i){return i instanceof jm?"email":i instanceof Nm?"sms":i instanceof O9?"siwe":i instanceof Sge?"guest":i instanceof _ge?"custom_auth":i instanceof Cm?i.meta.provider:null}(e);r&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:r,isNewUser:n}}),r==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}})}async _link(e){try{let n=await e.link(),r=n.oauth_tokens,i=r?{provider:r.provider,accessToken:r.access_token,accessTokenExpiresInSeconds:r.access_token_expires_in_seconds,refreshToken:r.refresh_token,refreshTokenExpiresInSeconds:r.refresh_token_expires_in_seconds,scopes:r.scopes}:void 0;return{user:oo(n),oAuthTokens:i}}catch(n){throw console.warn("Error linking account"),Pr(n)}}async _refresh(){if(!this.api)throw new ve("Session has no API instance");if(!this.client)throw new ve("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,n=this.refreshToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let r;if(!(e&&n||this.mightHaveServerCookies))return null;{let i={};e&&(i.authorization=`Bearer ${e}`),r=await this.api.post(Hoe,n?{refresh_token:n}:{},{headers:i})}return this.handleTokenResponse(r),oo(r.user)}catch(r){if(r instanceof fc&&r.privyErrorCode===Ce.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Pr(r)}}handleTokenResponse(e){e.session_update_action&&e.session_update_action!=="set"?e.session_update_action==="clear"?this.destroyLocalState():e.session_update_action==="ignore"&&(e.token&&(this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token)),e.identity_token&&this.storeIdentityToken(e.identity_token)):this._storeAllTokens(e)}_storeAllTokens(e){this.storeRefreshToken(e.refresh_token),this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token),e.identity_token&&this.storeIdentityToken(e.identity_token)}async _destroy(){var e;try{await((e=this.api)==null?void 0:e.post(Voe,{refresh_token:this.refreshToken}
205))}catch{console.warn("Error destroying session")}this.destroyLocalState()}destroyLocalState(){this.storeRefreshToken(null),this.storeCustomerAccessToken(null),this.storePrivyAccessToken(null),this.clearIdentityToken()}storeCustomerAccessToken(e){var n,r,i,s,o,a;if(typeof e=="string"){let c=cn.get(Yv);if(cn.put(Yv,e),!((n=this.client)!=null&&n.useServerCookies)){let l=(r=Af.parse(e))==null?void 0:r.expiration;ru.set($Q,e,{sameSite:"Strict",secure:CT(),expires:l?new Date(1e3*l):void 0})}c!==e&&((s=(i=this.client)==null?void 0:i.onStoreCustomerAccessToken)==null||s.call(i,e))}else cn.del(Yv),ru.remove($Q),(a=(o=this.client)==null?void 0:o.onDeleteCustomerAccessToken)==null||a.call(o)}storeRefreshToken(e){var n;typeof e=="string"?(cn.put(qI,e),(n=this.client)!=null&&n.useServerCookies||ru.set(KI,"t",{sameSite:"Strict",secure:CT(),expires:30})):(cn.del(qI),ru.remove(Hit),ru.remove(KI))}storePrivyAccessToken(e){typeof e=="string"?cn.put(v8,e):cn.del(v8)}storeIdentityToken(e){var r,i;if(lJ.setState({identityToken:e}),(r=this.client)==null?void 0:r.useServerCookies)return;cn.put(IQ,e);let n=(i=Af.parse(e))==null?void 0:i.expiration;
205ru.set(TQ,e,{sameSite:"Strict",secure:CT(),expires:n?new Date(1e3*n):void 0})}clearIdentityToken(){cn.del(IQ),lJ.setState({identityToken:null}),ru.remove(TQ)}constructor(){this.authenticateOnce=new ko(async e=>this._authenticate(e)),this.linkOnce=new ko(async e=>this._link(e)),this.refreshOnce=new ko(this._refresh.bind(this)),this.destroyOnce=new ko(this._destroy.bind(this))}}let ST;var Jht=0,AT="__private_"+Jht+++"__getOrGenerateClientAnalyticsId";class eft{initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:n,chains:r,defaultChain:i,store:s,walletList:o,shouldEnforceDefaultChainOnConnect:a,externalWalletConfig:c,appName:l,walletChainType:u}){this.connectors||(this.connectors=new qht(this.appId,e,n,r,i,s,o,a,c,l,void 0,u))}generateApi(){let e=new Ght({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new ve("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new ve("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,n){this.session.storeProviderAccessToken(e,n)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter(n=>n.type==="cross_app").forEach(n=>{this.storeProviderAccessToken(n.providerApp.id,null)})}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(qCe,{action:"verify"})}catch(e){throw Gn(e)}}async initMfaPasskeyVerification(){try{return(e=>{var n,r,i,s;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((n=e.allow_credentials)==null?void 0:n.map(o=>({id:o.id,type:o.type,transports:o.transports})))||[],timeout:e.timeout,extensions:{appid:(r=e.extensions)==null?void 0:r.app_id,credProps:(i=e.extensions)==null?void 0:i.cred_props,hmacCreateSecret:(s=e.extensions)==null?void 0:s.hmac_create_secret},userVerification:e.user_verification}})((await this.api.post(KCe,{})).options)}catch(e){throw Gn(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(n){console.error("Error fetching cross app provider details",n)}}async acceptTerms(){try{let e=await this.api.post(GCe,{});return oo(e)}catch(e){throw Pr(e)}}async unlinkEmail(e){try{let n=await this.api.post(ECe,{address:e});return await this.getAuthenticatedUser()??oo(n)}catch(n){throw Pr(n)}}async unlinkPhone(e){try{let n=await this.api.post(kCe,{phoneNumber:e});return await this.getAuthenticatedUser()??oo(n)}catch(n){throw Pr(n)}}async unlinkEthereumWallet(e){try{let n=await this.api.post(aCe,{address:e});return await this.getAuthenticatedUser()??oo(n)}catch(n){throw Pr(n)}}async unlinkSolanaWallet(e){try{let n=await this.api.post(hCe,{address:e});return await this.getAuthenticatedUser()??oo(n)}catch(n){throw Pr(n)}}async unlinkOAuth(e,n){try{let r=await this.api.post(PCe,{provider:e,subject:n});return await this.getAuthenticatedUser()??oo(r)}catch(r){throw Pr(r)}}async unlinkFarcaster(e){try{let n=await this.api.post(yCe,{fid:e});return await this.getAuthenticatedUser()??oo(n)}catch(n){throw Pr(n)}}async unlinkTelegram(e){try{let n=await this.api.post(HCe,{telegram_user_id:e});return await this.getAuthenticatedUser()??oo(n)}catch(n){throw Pr(n)}}async revokeDelegatedWallet(){try{await this.api.post(e_e,{})}catch(e){throw Pr(e)}}async createAnalyticsEvent({eventName:e,payload:n,timestamp:r,options:i}){if(typeof window<"u")try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(Zoe,{event_name:e,client_id:this.clientAnalyticsId,payload:{...n||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}}
205,{retry:-1,keepalive:(i==null?void 0:i.keepAlive)??!1})}catch{console.log("Unable to submit event. This is not an issue.")}}async signMoonpayOnRampUrl(e){try{return this.api.post(QCe,e)}catch(n){throw Pr(n)}}async initCoinbaseOnRamp(e){try{return this.api.post(XCe,e)}catch(n){throw Pr(n)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`${JCe}?partnerUserId=${e}`)}catch(n){throw Pr(n)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(uJ.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(uJ.PRIVY,e)}async _getToken(e,n){var r;return this.session.getToken(e)?this.session.hasActiveAccessToken(e)?this.session.hasRefreshCredentials(e)?((r=qB.parse(this.session.getToken(e)))==null?void 0:r.appId)!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null):!(n!=null&&n.disableAutoRefresh)&&this.session.hasRefreshCredentials(e)?(await this.session.refresh(),this.session.getToken(e)):null:null}async getSmartWalletsConfig(){try{let e={},n=this.session.token;n&&(e.authorization=`Bearer ${n}`);let r=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:e});return r.enabled?{enabled:r.enabled,smartWalletType:r.smart_wallet_type,configuredNetworks:r.configured_networks.map(i=>({chainId:i.chain_id,bundlerUrl:i.bundler_url,paymasterUrl:i.paymaster_url,paymasterContext:Qht(i.paymaster_url,i.paymaster_context)}))}:{enabled:r.enabled}}catch(e){throw Pr(e)}}async getServerConfig(){var e,n;try{let r={},i=this.session.token;i&&(r.authorization=`Bearer ${i}`);let s=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:r}),o=s.telegram_auth_config?{botId:s.telegram_auth_config.bot_id,botName:s.telegram_auth_config.bot_name,linkEnabled:s.telegram_auth_config.link_enabled,seamlessAuthEnabled:s.telegram_auth_config.seamless_auth_enabled}:void 0,a=s.funding_config?{methods:s.funding_config.methods,options:s.funding_config.options,defaultRecommendedAmount:s.funding_config.default_recommended_amount,defaultRecommendedCurrency:s.funding_config.default_recommended_currency,promptFundingOnWalletCreation:s.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:s.funding_config.cross_chain_bridging_enabled}:void 0;return{id:s.id,name:s.name,verificationKey:s.verification_key,logoUrl:s.logo_url||void 0,accentColor:s.accent_color||void 0,showWalletLoginFirst:s.show_wallet_login_first,allowlistConfig:{errorTitle:s.allowlist_config.error_title,errorDetail:s.allowlist_config.error_detail,errorCtaText:s.allowlist_config.cta_text,errorCtaLink:s.allowlist_config.cta_link},walletAuth:s.wallet_auth,solanaWalletAuth:s.solana_wallet_auth,emailAuth:s.email_auth,smsAuth:s.sms_auth,googleOAuth:s.google_oauth,twitterOAuth:s.twitter_oauth,discordOAuth:s.discord_oauth,githubOAuth:s.github_oauth,spotifyOAuth:s.spotify_oauth,instagramOAuth:s.instagram_oauth,tiktokOAuth:s.tiktok_oauth,linkedinOAuth:s.linkedin_oauth,appleOAuth:s.apple_oauth,farcasterAuth:s.farcaster_auth,passkeyAuth:s.passkey_auth,passkeysForSignupEnabled:s.passkeys_for_signup_enabled,telegramAuth:s.telegram_auth,disablePlusEmails:s.disable_plus_emails,termsAndConditionsUrl:s.terms_and_conditions_url,embeddedWalletConfig:{ethereum:{createOnLogin:((e=s.embedded_wallet_config.ethereum)==null?void 0:e.create_on_login)??s.embedded_wallet_config.create_on_login},solana:{createOnLogin:((n=s.embedded_wallet_config.solana)==null?void 0:n.create_on_login)??"off"},userOwnedRecoveryOptions:s.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:s.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:s.privacy_policy_url,requireUsersAcceptTerms:s.require_users_accept_terms,customApiUrl:s.custom_api_url,walletConnectCloudProjectId:s.wallet_connect_cloud_project_id,fiatOnRampEnabled:s.fiat_on_ramp_enabled,captchaEnabled:s.captcha_enabled,captchaSiteKey:s.captcha_site_key,createdAt:new Date(1e3*s.created_at),updatedAt:new Date(1e3*s.updated_at),mfaMethods:s.mfa_methods,enforceWalletUis:s.enforce_wallet_uis,legacyWalletUiConfig:s.legacy_wallet_ui_config,telegramAuthConfiguration:o,fundingConfig:a}}catch(r){throw Pr(r)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch{return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch{return void console.error("Unable to fetch token price for SOL")}}async getSplTokenMetadata({mintAddress:e,cluster:n}){try{return await this.api.get(`/api/v1/spl_token_info?mint_address=${e}
205&cluster=${n}`)}catch{return void console.error(`Unable to fetch token metadata for ${n}:${e}`)}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(n){throw console.error("Unable to fetch Farcaster signer status"),n}}async generateSiweNonce({address:e,captchaToken:n}){try{return(await this.api.post(rCe,{address:e,token:n})).nonce}catch(r){throw Pr(r)}}async authenticateWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:s,mode:o}){return await this.api.post(iCe,{message:e,signature:n,chainId:r,walletClientType:i,connectorType:s,mode:o})}async linkWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:s}){return await this.api.post(sCe,{message:e,signature:n,chainId:r,walletClientType:i,connectorType:s})}async linkSmartWallet({message:e,signature:n,smartWalletType:r}){try{let i=await this.api.post(oCe,{message:e,signature:n,smart_wallet_type:r});return oo(i)}catch(i){throw Pr(i)}}async linkWithSiwe({message:e,signature:n,chainId:r,walletClientType:i,connectorType:s}){try{let o=await this.linkWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:s});return oo(o)}catch(o){throw Pr(o)}}async generateSiwsNonce({address:e,captchaToken:n}){try{return(await this.api.post(lCe,{address:e,token:n})).nonce}catch(r){throw Pr(r)}}async authenticateWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,mode:s}){return await this.api.post(uCe,{message:e,signature:n,walletClientType:r,connectorType:i,mode:s})}async sendAccountTransferRequest({nonce:e,account:n,accountType:r,externalWalletMetadata:i,telegramAuthResult:s,telegramWebAppData:o,farcasterEmbeddedAddress:a,oAuthUserInfo:c}){try{let l,u;switch(r){case"email":l=_Ce,u={nonce:e,email:n};break;case"sms":l=TCe,u={nonce:e,phoneNumber:n};break;case"siwe":if(l=cCe,!i)throw Error("Wallet parameters must be defined");u={nonce:e,address:n,...i};break;case"farcaster":l=wCe,u={nonce:e,farcaster_id:n,farcaster_embedded_address:a};break;case"telegram":l=VCe,u={nonce:e,telegram_auth_result:s,telegram_web_app_data:o};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:l=RCe,u={nonce:e,userInfo:c}}let d=await this.api.post(l,u);return await this.getAuthenticatedUser()??oo(d)}catch(l){throw Pr(l)}}async linkWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i}){return await this.api.post(dCe,{message:e,signature:n,walletClientType:r,connectorType:i})}async linkWithSiws({message:e,signature:n,walletClientType:r,connectorType:i}){try{let s=await this.linkWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i});return oo(s)}catch(s){throw Pr(s)}}async updateUserAndIdToken(){try{let e=await this.api.get(t_e);return this.session.updateIdentityToken(e.identity_token),oo(e.user)}catch(e){throw Pr(e)}}async scanTransaction(e){try{return await this.api.post(n_e,e)}catch(n){throw Pr(n)}}constructor({apiUrl:e=OO,appId:n,appClientId:r,timeout:i=zit}){Object.defineProperty(this,AT,{value:tft}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==OO&&e.startsWith("https://privy."),this.timeout=i,this.appId=n,this.appClientId=r,this.clientAnalyticsId=function(s,o){if(!Object.prototype.hasOwnProperty.call(s,o))throw TypeError("attempted to use private field on non-instance");return s}(this,AT)[AT](),ST||(ST=new Xht),this.session=ST,this.api=this.generateApi(),this.session.client=this}}function tft(){if(typeof window>"u")return null;try{let e=cn.get(jO);if(typeof e=="string"&&e.length>0)return e}catch{}let t=ple();try{return cn.put(jO,t),t}catch{return t}}const nft=t=>{let{enabled:e,siteKey:n,appId:r,setError:i,setToken:s,setExecuting:o,ref:a}=wa(),[,c]=E.useMemo(()=>(n==null?void 0:n.split("t:"))||[],[n]);if(E.useEffect(()=>{var l;return(l=a.current)==null?void 0:l.remove},[]),!e)return null;if(!c)throw Error("Unsupported captcha site key");return p.jsx("div",{className:"hidden h-0 w-0",children:p.jsx(xge,{...t,ref:
205a,siteKey:c,options:{action:r,size:"invisible",...t.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{var l;(l=t.onUnsupported)==null||l.call(t),console.warn("Browser does not support Turnstile.")},onError:()=>{var l;(l=t.onError)==null||l.call(t),i("Captcha failed"),o(!1)},onSuccess:l=>{var u;(u=t.onSuccess)==null||u.call(t,l),s(l),o(!1)},onExpire:()=>{var l,u;(l=t.onExpire)==null||l.call(t);try{(u=a.current)==null||u.reset(),i(void 0),s(void 0)}catch{i("expired_and_failed_reset")}}})})};function rft(t){V5("configureMfa",t)}let ift=Array(6).fill("");var bv,sft=((bv=sft||{})[bv.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",bv[bv.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",bv);function pj(t){return/^[0-9]{1}$/.test(t)}function dJ(t){return t.length===6&&t.every(pj)}const Y9=({onChange:t,disabled:e,errorReasonOverride:n,success:r})=>{let[i,s]=E.useState(ift),[o,a]=E.useState(null),[c,l]=E.useState(null),u=async h=>{var R;h.preventDefault();let f=h.currentTarget.value.replace(/\s+/g,"");if(f==="")return;let m=i.reduce((N,T)=>N+Number(pj(T)),0),y=f.split(""),v=!y.every(pj),b=y.length+m>6;if(v)return a("Passcode can only be numbers"),void l(1);if(b)return a("Passcode must be exactly 6 numbers"),void l(1);a(null),l(null);let C=Number((R=h.currentTarget.name)==null?void 0:R.charAt(4)),x=[...f||[""]].slice(0,6-C),_=[...i.slice(0,C),...x,...i.slice(C+x.length)];s(_);let $=Math.min(Math.max(C+x.length,0),5),I=document.querySelector(`input[name=pin-${$}]`);if(I==null||I.focus(),dJ(_))try{await t(_.join(""));let N=document.querySelector(`input[name=pin-${$}]`);N==null||N.blur()}catch(N){l(1),a(N.message)}else try{await t(null)}catch(N){l(1),a(N.message)}},d=r?"success":!n&&!o?"":"fail";return p.jsx(p.Fragment,{children:p.jsxs(oft,{children:[p.jsx("div",{children:i.map((h,f)=>p.jsx("input",{name:`pin-${f}`,type:"text",value:i[f],onChange:u,onKeyUp:m=>{m.key==="Backspace"&&(y=>{c===1&&(a(null),l(null));let v=[...i.slice(0,y),"",...i.slice(y+1)];if(s(v),y>0){let b=document.querySelector(`input[name=pin-${y-1}]`);b==null||b.focus()}dJ(v)?t(v.join("")):t(null)})(f)},inputMode:"numeric",autoFocus:f===0,pattern:"[0-9]",className:d,autoComplete:di.isMobile?"one-time-code":"off",disabled:e},f))}),p.jsx("div",{children:p.jsx(aft,{$fail:!!n||!!o,children:n||o})})]})})};let oft=ue.div.withConfig({displayName:"PinInputContainer",componentId:"sc-7a171f6-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;@media (max-width:440px){margin-top:8px;margin-bottom:8px;}> div:nth-child(1){display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-md);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);padding:8px 10px;height:58px;width:46px;text-align:center;font-size:18px;}> input:disabled{background:var(--privy-color-background-2);}> input:focus{border:1px solid var(--privy-color-accent);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-success);}> input.fail{border:1px solid var(--privy-color-error);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),aft=ue.div.withConfig({displayName:"InputHelp",componentId:"sc-7a171f6-1"})(["line-height:20px;font-size:13px;display:flex;justify-content:flex-start;width:100%;color:",";"],t=>t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)");const gj=({pendingTransaction:t})=>{let{getAccessToken:e}=Wn(),{wallets:n}=Ap(),{walletProxy:r,rpcConfig:i,chains:s,appId:o,nativeTokenSymbolForChainId:a}=Ht(),[c,l]=E.useState(null),[u,d]=E.useState(t),{tokenPrice:h}=K2(u.chainId),f=a(t.chainId)||"ETH",m=E.useMemo(()=>n.find(y=>y.walletClientType==="privy"),[n]);return E.useEffect(()=>{(async function(){if(!await e()||!r||!m)return u;let y=l2(u.chainId,s,i,{appId:o}),v=await MB(u,y,m.address);return l(Qt(BigInt(v.gas??0))),v})().then(d).catch(console.error)},[r]),m?p.jsx(cft,{children:p.jsx(i1e,{from:m.address,to:u.to,txn:u,gas:c??void 0,tokenPrice:h,tokenSymbol:f})}):null};let cft=ue.div.withConfig({displayName:"TransactionInfoWrapper",componentId:"sc-731f1950-0"})(["width:100%;padding:1rem 0;"]);function kge(){let{promptMfa:t,init:e,submit:n,cancel:r,mfaMethods:i}=E.useContext(Cp);return{promptMfa:t,init:e,submit:n,cancel:r,mfaMethods:i}}const lft=({hasBlockingError:t,error:e,onClose:n,onBack:r,handleSubmit:i,account:s,submitSuccess:o})=>{var c;let{pendingTransaction:a}=Ht();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:n},"header"),p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:o,fail:!!e}),p.jsx(e?Uu:Y5,{style:{width:"38px",height:"38px"}})]})}),p.jsx(pr,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),p.jsxs(q_,{children:[p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(_1,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(Ait,{})}
205),"You last added a passkey on"," ",(c=s==null?void 0:s.firstVerifiedAt)==null?void 0:c.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),a&&p.jsx($1,{children:p.jsx(gj,{pendingTransaction:a})}),e&&p.jsxs(p.Fragment,{children:[p.jsx(S0e,{style:{marginTop:"1.25rem"},children:e.message}),p.jsx(tn,{disabled:t,onClick:i,style:{marginTop:"1.25rem"},children:"Try again"})]}),r&&p.jsx(z9,{style:{marginTop:"1rem"},onClick:r,children:"Choose another method"}),p.jsx(Bn,{})]})},hJ=({open:t,onClose:e})=>{let{user:n}=Wn(),[r,i]=E.useState((n==null?void 0:n.mfaMethods[0])??null),{init:s,cancel:o,submit:a}=kge(),[c,l]=E.useState(!1),[u,d]=E.useState(!1),[h,f]=E.useState(null),[m,y]=E.useState(null);E.useEffect(()=>{i((n==null?void 0:n.mfaMethods[0])??null)},[n==null?void 0:n.mfaMethods]);let v=E.useRef(!1);E.useEffect(()=>{!v.current&&r&&t&&(v.current=!0,x(r).finally(()=>{v.current=!1}))},[t]);let b=$=>zst($)?(l(!0),Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):AB($)?(l(!1),Error("The code you entered is not valid")):SB($)?(l(!0),Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error($),l(!1),Error("Something went wrong."));async function C($){y(null);try{if(!$||!r)return;await a(r,$),d(!0),l(!1),e()}catch(I){throw b(I)}}async function x($){if($!=="passkey")try{i($),await s($)}catch(I){console.error(I)}else try{i($);let I=await s($);if(!I)throw Error("something went wrong");f(I),await a($,I),d(!0),l(!1),e()}catch(I){y(b(I))}}let _=()=>{i(null),y(null),o(),e()};return t&&n?r==="passkey"?p.jsx(lft,{account:n.linkedAccounts.filter($=>$.type==="passkey"&&$.enrolledInMfa).sort(($,I)=>I.firstVerifiedAt.valueOf()-$.firstVerifiedAt.valueOf())[0],selectedMethod:r,submitSuccess:u,hasBlockingError:c,error:m,onClose:_,onBack:()=>{i(null),y(null)},handleSubmit:()=>C(h).catch(y)}):r?p.jsx(uft,{submitSuccess:u,hasBlockingError:c,handleSubmitCode:C,selectedMethod:r,onClose:_,onBack:n.mfaMethods.length>1?()=>i(null):void 0}):p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:_},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(_1,{})}),p.jsx(pr,{children:"Verify your identity"}),p.jsx(gr,{children:"Choose a verification method"}),p.jsxs(_0e,{children:[n.mfaMethods.includes("totp")&&p.jsxs(Qr,{onClick:()=>x("totp"),children:[p.jsx(E_,{}),"Authenticator App"]},"totp"),n.mfaMethods.includes("sms")&&p.jsxs(Qr,{onClick:()=>x("sms"),children:[p.jsx(xl,{}),"SMS"]},"sms"),n.mfaMethods.includes("passkey")&&p.jsxs(Qr,{onClick:()=>x("passkey"),children:[p.jsx(FL,{}),"Passkey"]},"passkey")]}),p.jsx(Bn,{})]}):null};let uft=({selectedMethod:t,submitSuccess:e,hasBlockingError:n,onClose:r,onBack:i,handleSubmitCode:s})=>{let{app:o}=jt(),{pendingTransaction:a}=Ht();switch(t){case"sms":return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:r},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(xl,{})}),p.jsx(pr,{children:"Enter verification code"}),p.jsxs($1,{children:[p.jsx(Y9,{success:e,disabled:n,onChange:s}),p.jsxs(gr,{children:["To continue, please enter the 6-digit code sent to your ",p.jsx("strong",{children:"mobile device"})]}),a&&p.jsx(gj,{pendingTransaction:a})]}),i&&p.jsx(z9,{theme:o==null?void 0:o.appearance.palette.colorScheme,onClick:i,children:"Choose another method"}),p.jsx(ch,{onClick:r,children:"Not now"}),p.jsx(Bn,{})]});case"totp":return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:r},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(E_,{})}),p.jsx(pr,{children:"Enter verification code"}),p.jsxs($1,{children:[p.jsx(Y9,{success:e,disabled:n,onChange:s}),p.jsxs(gr,{children:["To continue, please enter the 6-digit code generated from your"," ",p.jsx("strong",{children:"authenticator app"})]}),a&&p.jsx(gj,{pendingTransaction:a})]}),i&&p.jsx(z9,{theme:o==null?void 0:o.appearance.palette.colorScheme,onClick:i,children:"Choose another method"}),p.jsx(ch,{onClick:r,children:"Not now"}),p.jsx(Bn,{})]});default:return null}};const dft=IIe([":root{--privy-border-radius-sm:6px;--privy-border-radius-md:12px;--privy-border-radius-mdlg:16px;
205--privy-border-radius-lg:24px;--privy-border-radius-full:9999px;--privy-color-background:",";--privy-color-background-2:",";--privy-color-background-3:",";--privy-color-foreground:",";--privy-color-foreground-2:",";--privy-color-foreground-3:",";--privy-color-foreground-4:",";--privy-color-foreground-accent:",";--privy-color-accent:",";--privy-color-accent-light:",";--privy-color-accent-lightest:",";--privy-color-accent-dark:",";--privy-color-accent-darkest:",";--privy-color-success:",";--privy-color-success-dark:",";--privy-color-success-light:",";--privy-color-error:",";--privy-color-error-light:",";--privy-color-warn:",";--privy-color-warn-light:",";--privy-height-modal-full:620px;--privy-height-modal-compact:480px;};"],t=>t.theme.background,t=>t.theme.background2,t=>t.theme.background3,t=>t.theme.foreground,t=>t.theme.foreground2,t=>t.theme.foreground3,t=>t.theme.foreground4,t=>t.theme.foregroundAccent,t=>t.theme.accent,t=>t.theme.accentLight,t=>t.theme.accentLightest,t=>t.theme.accentDark,t=>t.theme.accentDarkest,t=>t.theme.success,t=>t.theme.successDark,t=>t.theme.successLight,t=>t.theme.error,t=>t.theme.errorLight,t=>t.theme.warn,t=>t.theme.warnLight),fJ=ue.div.withConfig({displayName:"StylesWrapper",componentId:"sc-bc1e45b4-0"})([""," color:var(--privy-color-foreground-2);h3{font-size:16px;line-height:24px;font-weight:500;color:var(--privy-color-foreground-2);}h4{font-size:14px;line-height:20px;font-weight:500;color:var(--privy-color-foreground);}p{font-size:13px;line-height:20px;color:var(--privy-color-foreground-2);}button:focus,input:focus,optgroup:focus,select:focus,textarea:focus{outline:none;border-color:var(--privy-color-accent-light);box-shadow:0 0 0 1px var(--privy-color-accent-light);}.mobile-only{@media (min-width:441px){display:none;}}@keyframes fadein{0%{opacity:0;}100%{opacity:1;}}"],` 206 *, 207 ::before, 208 ::after { 209 box-sizing: border-box; 210 border-width: 0; 211 border-style: solid; 212 } 213 214 line-height: 1.15; 215 -webkit-text-size-adjust: 100%; 216 -moz-tab-size: 4; 217 tab-size: 4; 218 font-feature-settings: normal; 219 220 margin: 0; 221 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 222 'Apple Color Emoji', 'Segoe UI Emoji'; 223 224 hr { 225 height: 0; 226 color: inherit; 227 border-top-width: 1px; 228 } 229 230 abbr:where([title]) { 231 text-decoration: underline dotted; 232 } 233 234 h1, 235 h2, 236 h3, 237 h4, 238 h5, 239 h6 { 240 font-size: inherit; 241 font-weight: inherit; 242 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 243 'Apple Color Emoji', 'Segoe UI Emoji'; 244 display: inline; 245 } 246 247 a { 248 color: inherit; 249 text-decoration: inherit; 250 } 251 252 b, 253 strong { 254 font-weight: bolder; 255 } 256 257 code, 258 kbd, 259 samp, 260 pre { 261 font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; 262 font-size: 1em; 263 } 264 265 small { 266 font-size: 80%; 267 } 268 269 sub, 270 sup { 271 font-size: 75%; 272 line-height: 0; 273 position: relative; 274 vertical-align: baseline; 275 } 276 277 sub { 278 bottom: -0.25em; 279 } 280 281 sup { 282 top: -0.5em; 283 } 284 285 table { 286 text-indent: 0; 287 border-color: inherit; 288 border-collapse: collapse; 289 } 290 291 button, 292 input, 293 optgroup, 294 select, 295 textarea { 296 font-family: inherit; 297 font-size: 100%; 298 font-weight: inherit; 299 line-height: inherit; 300 color: inherit; 301 margin: 0; 302 padding: 0; 303 } 304 305 button, 306 select { 307 text-transform: none; 308 } 309 310 button, 311 [type='button'], 312 [type='reset'], 313 [type='submit'] { 314 -webkit-appearance: button; 315 background-color: transparent; 316 background-image: none; 317 } 318 319 ::-moz-focus-inner { 320 border-style: none; 321 padding: 0; 322 } 323 324 :-moz-focusring { 325 outline: 1px dotted ButtonText; 326 } 327 328 :-moz-ui-invalid { 329 box-shadow: none; 330 } 331 332 legend { 333 padding: 0; 334 } 335 336 progress { 337 vertical-align: baseline; 338 } 339 340 ::-webkit-inner-spin-button, 341 ::-webkit-outer-spin-button { 342 height: auto; 343 } 344 345 [type='search'] { 346 -webkit-appearance: textfield; 347 outline-offset: -2px; 348 } 349 350 ::-webkit-search-decoration { 351 -webkit-appearance: none; 352 } 353 354 ::-webkit-file-upload-button { 355 -webkit-appearance: button; 356 font: inherit; 357 } 358 359 summary { 360 display: list-item; 361 } 362 363 blockquote, 364 dl, 365 dd, 366 h1, 367 h2, 368 h3, 369 h4, 370 h5, 371 h6, 372 hr, 373 figure, 374 p, 375 pre { 376 margin: 0; 377 } 378 379 fieldset { 380 margin: 0; 381 padding: 0; 382 } 383 384 legend { 385 padding: 0; 386 } 387 388 ol, 389 ul, 390 menu { 391 list-style: none; 392 margin: 0; 393 padding: 0; 394 } 395 396 textarea { 397 resize: vertical; 398 } 399 400 input::placeholder, 401 textarea::placeholder { 402 opacity: 1; 403 color: #9ca3af; 404 } 405 406 button, 407 [role='button'] { 408 cursor: pointer; 409 } 410 411 :disabled { 412 cursor: default; 413 } 414 415 img, 416 svg, 417 video, 418 canvas, 419 audio, 420 iframe, 421 embed, 422 object { 423 display: block; 424 } 425 426 img, 427 video { 428 max-width: 100%; 429 height: auto; 430 } 431 432 [hidden] { 433 display: none; 434 } 435`),hft=({children:t,open:e,onClick:n,...r})=>p.jsx(Nfe,{show:e,as:Rt.Fragment,children:p.jsxs(Grt,{onClose:n,...r,as:pft,children:[p.jsx(u3,{as:Rt.Fragment,enterFrom:"entering",leaveTo:"leaving",children:p.jsx(fft,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),p.jsx(gft,{children:p.jsx(u3,{as:Rt.Fragment,enterFrom:"entering",leaveTo:"leaving",children:p.jsx(Dfe,{as:mft,children:t})})})]})});let fft=ue.div.withConfig({displayName:"Backdrop",componentId:"sc-3cfde0b5-0"})(["position:fixed;inset:0;transition:backdrop-filter 100ms ease;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);&.entering,&.leaving{backdrop-filter:unset;-webkit-backdrop-filter:unset;}"]),pft=ue.div.withConfig({displayName:"DialogWrapper",componentId:"sc-3cfde0b5-1"})(["position:relative;z-index:999999;"]),gft=ue.div.withConfig({displayName:"DialogContainer",componentId:"sc-3cfde0b5-2"})(["position:fixed;inset:0;display:flex;align-items:center;justify-content:center;width:100vw;min-height:100vh;"]);const mft=ue.div.withConfig({displayName:"Panel",componentId:"sc-3cfde0b5-3"})(["padding:0;background:transparent;border:none;width:100%;pointer-events:auto;outline:none;display:block;@media (max-width:440px){opacity:1;
435transform:translate3d(0,0,0);transition:transform 200ms ease-in;position:fixed;bottom:0;&.entering,&.leaving{opacity:0;transform:translate3d(0,100%,0);transition:transform 150ms ease-in 0ms,opacity 0ms ease 150ms;}}@media (min-width:441px){opacity:1;transition:opacity 100ms ease-in;&.entering,&.leaving{opacity:0;transition-delay:5ms;}margin:auto;width:360px;box-shadow:0px 8px 36px rgba(55,65,81,0.15);border-radius:var(--privy-border-radius-lg);}"]),yft=ue.div.withConfig({displayName:"CenterItem",componentId:"sc-3cfde0b5-4"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;"]);let $ge=({isMfaVerifying:t,onMfaVerificationComplete:e})=>{let{ready:n,isModalOpen:r}=Wn(),{headless:i}=Vr(),{currentScreen:s}=jt(),{status:o,execute:a,reset:c,enabled:l}=wa(),u=r&&s&&s.isCaptchaRequired&&!i&&o==="ready";return E.useEffect(()=>{u&&a()},[u]),E.useEffect(()=>{!r&&l&&c()},[r,l]),s&&!n&&s.isShownBeforeReady?p.jsxs(p.Fragment,{children:[p.jsx(_t,{}),p.jsx(sr,{}),p.jsx(yft,{children:p.jsx(kc,{})}),p.jsx(dr,{}),p.jsx(Bn,{})]}):!s&&t?p.jsx(hJ,{open:t,onClose:e}):s?p.jsxs(p.Fragment,{children:[p.jsx(k1,{$if:!!t,children:p.jsx(s.component,{})}),p.jsx(k1,{$if:!t,children:p.jsx(hJ,{open:t,onClose:e})})]}):null},wft=({isMfaVerifying:t,onMfaVerificationComplete:e})=>{let n=E.useRef(null);return p.jsx(bft,{style:{height:dht(n)},id:"privy-modal-content",children:p.jsx("div",{ref:n,children:p.jsx($ge,{isMfaVerifying:t,onMfaVerificationComplete:e})})})};const vft=({open:t})=>{let e=Vr(),{gracefulClosePrivyModal:n}=(()=>{let{closePrivyModal:o}=Ht(),{onUserCloseViaDialogOrKeybindRef:a}=jt();return{gracefulClosePrivyModal:E.useCallback(()=>{if(!(a!=null&&a.current))return o({shouldCallAuthOnSuccess:!1});a.current()},[o])}})(),[r,i]=E.useState(!1);rft({onMfaRequired:()=>{e.mfa.noPromptOnMfaRequired||i(!0)}});let s=t||r;return e.render.standalone?p.jsx(fJ,{children:p.jsx(Ige,{id:"privy-modal-content",children:p.jsx($ge,{isMfaVerifying:r,onMfaVerificationComplete:()=>i(!1)})})}):p.jsx(hft,{open:s,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>n(),children:p.jsx(fJ,{children:p.jsx(wft,{isMfaVerifying:r,onMfaVerificationComplete:()=>i(!1)})})})};let Ige=ue.div.withConfig({displayName:"ContentWrapper",componentId:"sc-df48cc55-0"})(["display:flex;flex-direction:column;text-align:center;font-size:14px;line-height:20px;width:100%;background:var(--privy-color-background);padding:0 16px;"]),bft=ue(Ige).withConfig({displayName:"BaseModal",componentId:"sc-df48cc55-1"})(["transition:height 150ms ease-out;overflow-x:hidden;overflow-y:auto;scrollbar-width:none;max-height:calc(100svh - 32px);border-radius:var(--privy-border-radius-lg) var(--privy-border-radius-lg) 0 0;box-shadow:0px 0px 36px rgba(55,65,81,0.15);@media (min-width:441px){box-shadow:0px 8px 36px rgba(55,65,81,0.15);border-radius:var(--privy-border-radius-lg);}"]);function xft(t){let e=E.useRef(null),n=E.useRef();return E.useEffect(()=>{var r,i;(r=n.current)==null||r.remove(),n.current=function({botUsername:s,scriptHost:o}){let a=document.createElement("script"),{origin:c}=new URL(o);return a.async=!0,a.src=`${c}/js/telegram-login.js`,a.setAttribute("data-telegram-login",s),a.setAttribute("data-request-access","write"),a.setAttribute("data-lang","en"),a}(t),(i=e.current)==null||i.after(n.current)},[t]),p.jsx("div",{ref:e,hidden:!0})}async function tc(t,e,n,r,i,s=!1){var l,u,d;let o=s,a=async h=>{var f;if(o&&e&&e.length>0){h===(s?0:1)?i("configureMfa","onMfaRequired",{mfaMethods:e}):(f=r.current)==null||f.reject(new ii("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((y,v)=>{n.current={resolve:y,reject:v},setTimeout(()=>{var C;let b=new ii("mfa_timeout","Timed out waiting for MFA code");(C=r.current)==null||C.reject(b),v(b)},3e5)});return await t(m)}return await t()},c=null;for(let h=0;h<4;h++)try{c=await a(h),(l=r.current)==null||l.resolve(void 0);break}catch(f){if(f.type!=="missing_or_invalid_mfa")throw(u=r.current)==null||u.resolve(void 0),f;o=!0}if(c===null){let h=new ii("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw(d=r.current)==null||d.reject(h),h}return c}var pJ;let Eft=(pJ=0,()=>"id-"+pJ++);function Ki(t){return t.error!==void 0}let Mi=new class{enqueue(t,e){this.callbacks[t]=e}dequeue(t,e){let n=this.callbacks[e];if(!n)throw Error(`cannot dequeue ${t} event: no event found for id ${e}`);
435switch(delete this.callbacks[e],t){case"privy:iframe:ready":case"privy:signer:create":case"privy:wallets:add":case"privy:wallets:import":case"privy:wallets:set-recovery":case"privy:wallets:connect":case"privy:wallets:recover":case"privy:wallets:rpc":case"privy:wallet:create":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:auth:unlink-passkey":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:delegated-actions:consent":return n;default:throw Error(`invalid wallet event type ${t}`)}}constructor(){this.callbacks={}}},kT=new Map,Cft=(t,e)=>typeof e=="bigint"?e.toString():e;function Gi(t,e,n,r){let i=n.contentWindow;if(!i)throw Error("iframe not initialized");let s=((a,c)=>`${a}${JSON.stringify(c,Cft)}`)(t,e);if(t==="privy:wallet:create"){let a=kT.get(s);if(a)return a}let o=new Promise((a,c)=>{let l=Eft();Mi.enqueue(l,{resolve:a,reject:c}),i.postMessage({id:l,event:t,data:e},r)}).finally(()=>{kT.delete(s)});return kT.set(s,o),o}function _ft(t){let e=Npe(),n=E.useRef(null),r=E.useRef(t.mfaMethods),i=Vpe(),[s,o]=E.useState(!1);return E.useEffect(()=>{r.current=t.mfaMethods},[t.mfaMethods]),E.useEffect(()=>{if(!s)return;let a=n.current;if(!a)return;function c(d){var h;d&&d.origin===t.origin&&typeof(h=d.data).event=="string"&&/^privy:.+/.test(h.event)&&function(f){switch(f.event){case"privy:iframe:ready":let m=Mi.dequeue(f.event,f.id);return Ki(f)?m.reject(new ii(f.error.type,f.error.message)):m.resolve(f.data);case"privy:signer:create":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:wallets:add":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:wallets:set-recovery":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:wallets:connect":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:wallets:recover":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:wallets:rpc":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:wallet:create":let y=Mi.dequeue(f.event,f.id);return Ki(f)?y.reject(new ii(f.error.type,f.error.message)):y.resolve(f.data);case"privy:wallets:import":let v=Mi.dequeue(f.event,f.id);return Ki(f)?v.reject(new ii(f.error.type,f.error.message)):v.resolve(f.data);case"privy:mfa:verify":let b=Mi.dequeue(f.event,f.id);return Ki(f)?b.reject(new ii(f.error.type,f.error.message)):b.resolve(f.data);case"privy:mfa:init-enrollment":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:mfa:submit-enrollment":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:mfa:unenroll":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:mfa:clear":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:auth:unlink-passkey":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:solana-wallet:create":let C=Mi.dequeue(f.event,f.id);return Ki(f)?C.reject(new ii(f.error.type,f.error.message)):C.resolve(f.data);case"privy:farcaster:init-signer":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:farcaster:sign":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}case"privy:delegated-actions:consent":{let x=Mi.dequeue(f.event,f.id);return Ki(f)?x.reject(new ii(f.error.type,f.error.message)):x.resolve(f.data)}default:console.warn("Unsupported wallet proxy method:",f)}}(d.data)}let l={createSigner:d=>tc(h=>Gi("privy:signer:create",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),addWallet:d=>tc(h=>Gi("privy:wallets:add",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),setRecovery:d=>tc(h=>Gi("privy:wallets:set-recovery",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),connect:d=>tc(h=>Gi("privy:wallets:connect",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),recover:d=>tc(h=>Gi("privy:wallets:recover",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i,!d.recoveryAccessToken&&!d.recoveryPassword&&!d.recoverySecretOverride),rpc:d=>tc(h=>Gi("privy:wallets:rpc",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),create:d=>Gi("privy:wallet:create",d,a,t.origin),importWallet:d=>Gi("privy:wallets:import",d,a,t.origin),createSolana:d=>tc(h=>Gi("privy:solana-wallet:create",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),createDelegatedAction:d=>Gi("privy:delegated-actions:consent",d,a,t.origin),verifyMfa:d=>tc(h=>Gi("privy:mfa:verify",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i,!0),initEnrollMfa:d=>tc(h=>Gi("privy:mfa:init-enrollment",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),submitEnrollMfa:d=>tc(h=>Gi("privy:mfa:submit-enrollment",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),unenrollMfa:d=>tc(h=>Gi("privy:mfa:unenroll",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),clearMfa:d=>Gi("privy:mfa:clear",d,a,t.origin),unlinkPasskeyAccount:d=>tc(h=>Gi("privy:auth:unlink-passkey",{...d,...h},a,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),initFarcasterSigner:d=>Gi("privy:farcaster:init-signer",d,a,t.origin),signFarcasterMessage:d=>Gi("privy:farcaster:sign",d,a,t.origin)};window.addEventListener("message",c);let u=new AbortController;return PO(()=>Gi("privy:iframe:ready",{}
435,a,t.origin),{abortSignal:u.signal}).then(()=>t.onLoad(l),(...d)=>{console.warn("Privy iframe failed to load: ",...d),t.onLoadFailed()}),()=>{window.removeEventListener("message",c),u.abort()}},[s]),e?p.jsx("iframe",{ref:n,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>o(!0),src:Yfe(t.origin,`/apps/${t.appId}/embedded-wallets`,{caid:t.clientAnalyticsId,client_id:t.appClientId})}):null}const gJ=t=>t.linkedAccounts.filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.delegated);class Sft{async handleSignMessage(e){if(!e.params||typeof e.params.message!="string")throw Error("Message must be provided as a string for Solana signMessage RPC");return await Fpt({message:e.params.message,options:{address:this.address,uiOptions:{}}})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await Nn())throw Error("User must be authenticated to use embedded Solana wallet");if(!await Bpt())throw new ve("Unable to connect to Solana embedded wallet");if(e.method==="signMessage")return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}constructor(e,n){this.walletProxy=e,this.address=n}}async function Sb({tx:t,accessToken:e,walletProxy:n,entropyId:r,entropyIdVerifier:i,transactingWalletAddress:s,transactingWalletIndex:o}){let a=fct(t,s),c=p3(t)?Buffer.from(t.message.serialize()):t.serializeMessage(),{response:l}=await n.rpc({accessToken:e,entropyId:r,entropyIdVerifier:i,chainType:"solana",hdWalletIndex:o,request:{method:"signMessage",params:{message:c.toString("base64")}}}),u=l.data.signature,d=Buffer.from(u,"base64");t.addSignature(a,d)}async function Tge({tx:t,connection:e,accessToken:n,walletProxy:r,entropyId:i,entropyIdVerifier:s,transactingWalletAddress:o,transactingWalletIndex:a,transactionOptions:c}){let l;try{await Sb({tx:t,accessToken:n,walletProxy:r,entropyId:i,entropyIdVerifier:s,transactingWalletAddress:o,transactingWalletIndex:a});let u=t.serialize();l=await e.sendRawTransaction(u,c);let d=await e.confirmTransaction(l);if(d.value.err||d.value.err){let h=d.value.err||d.value.err;throw typeof h=="string"?Error(h):h}return{signature:l,signedTransaction:t,receipt:await e.getParsedTransaction(l,{maxSupportedTransactionVersion:0})}}catch(u){throw u.txSignature=l,u}}const Aft=()=>{let t=Vr();E.useEffect(()=>{(async e=>{let n=new URL("v3/wallets","https://explorer-api.walletconnect.com");n.searchParams.append("projectId",e);let r=await fetch(n);return r.ok?Object.values((await r.json()).listings).sort(({slug:i},{slug:s})=>i==="rainbow"&&s==="metamask"?1:i==="metamask"||i==="rainbow"?-1:1):(console.debug(`Failed to fetch WalletConnect listings: ${await r.text().catch(()=>"No response.")}`),[])})(t.walletConnectCloudProjectId).then(e=>tst({listings:e})).catch(console.error)},[t.walletConnectCloudProjectId])},mJ="popup-privy-oauth",yJ="PRIVY_OAUTH_USE_BROADCAST_CHANNEL";class kft{async authenticate(){if(!this.api)throw new ve("Auth flow has no API instance");try{return await this.api.post(Koe,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw Gn(e)}}async link(){if(!this.api)throw new ve("Auth flow has no API instance");try{return await this.api.post(Goe,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw Gn(e)}}constructor({authorizationCode:e,stateCode:n,codeVerifier:r,provider:i}){this.meta={authorizationCode:e,stateCode:n,codeVerifier:r,provider:i}}}async function Pge({api:t,requesterAppId:e,providerAppId:n}){let r=(await t.get(`/api/v1/apps/${e}/cross-app/connections`)).connections.find(i=>i.provider_app_id===n);if(!r)throw new ve("Invalid connected app");return{name:r.provider_app_name,logoUrl:r.provider_app_icon_url||void 0,apiUrl:r.provider_app_custom_api_url,readOnly:r.read_only}}const $T=async({user:t,address:e,client:n,request:r,requesterAppId:i,reconnect:s})=>{n.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:e,method:r.method}});let o=t==null?void 0:t.linkedAccounts.find(d=>d.type==="cross_app"&&(d.embeddedWallets.some(h=>h.address===e)||d.smartWallets.some(h=>h.address===e)));if(!t||!o)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:e}}),new ve("Cannot request a signature with this wallet address");let a=n.getProviderAccessToken(o.providerApp.id),c=await Pge({api:n.api,requesterAppId:i,providerAppId:o.providerApp.id});if(!a){if(c.readOnly)throw console.error("cannot transact against a read-only provider app"),new ve("Cannot transact against a read-only provider app");await s({appId:o.providerApp.id,action:"link"})&&(a=n.getProviderAccessToken(o.providerApp.id))}if(!a)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:e}}),new ve("Transactions require a valid token");let l=X_();if(!l)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:e}}),new ve("Failed to initialize signature request");let u=new URL(`${c.apiUrl}/oauth/transact`);return u.searchParams.set("token",a||""),u.searchParams.set("request",$ft(r)),l.location=u.href,new Promise((d,h)=>{let f=setTimeout(()=>{v(),h(new ve("Request timeout")),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:e}})},12e4),m=setInterval(()=>{l.closed&&(v(),h(new ve("User rejected request")),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:e}}))},300),y=b=>{var C,x,_;b.data&&(((C=b.data.token)==null?void 0:C.action)==="set"&&((x=b.data.token)==null?void 0:x.value)!==void 0?n.storeProviderAccessToken(o.providerApp.id,b.data.token.value):((_=b.data.token)==null?void 0:_.action)==="clear"&&n.storeProviderAccessToken(o.providerApp.id,null),b.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&b.data.result&&(v(),d(b.data.result),n.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:e,method:r.method}})),b.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&b.data.error&&(v(),h(b.data.error),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:b.data.error,address:e}})))};window.addEventListener("message",y);let v=()=>{l.close(),clearInterval(m),clearTimeout(f),window.removeEventListener("message",y)}})};let $ft=t=>JSON.stringify({content:{request:{request:mj(t,Qt)}},timestamp:Date.now(),callbackUrl:window.origin});const mj=(t,e)=>typeof t=="bigint"?e(t):Array.isArray(t)?t.map(n=>mj(n,e)):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([n,r])=>[n,mj(r,e)])):t;let wJ=({passkeys:t,expanded:e,onUnlink:n,onExpand:r})=>{let[i,s]=E.useState([]),o=e?t.length:2,a=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device";return p.jsxs("div",{children:[p.jsx(Nft,{children:"Your passkeys"}),p.jsxs(Rge,{children:[t.slice(0,o).map(c=>p.jsxs(Bft,{children:[p.jsxs("div",{children:[p.jsx(Dft,{children:a(c)}),p.jsxs(Lft,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleStr
435ing()]})]}),p.jsx(Uft,{disabled:i.includes(c.credentialId),onClick:()=>(async l=>{s(u=>u.concat([l])),await n(l),s(u=>u.filter(d=>d!==l))})(c.credentialId),children:i.includes(c.credentialId)?p.jsx(Ep,{}):p.jsx(Dit,{height:"1.6em"})})]},c.credentialId)),t.length>2&&!e&&p.jsx(Mft,{onClick:r,children:"View all"})]})]})},Ift=()=>p.jsxs(Rge,{children:[p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(Cge,{})}),"Log in with Touch ID, Face ID, or a security key."]}),p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(che,{})}),"More secure than a password."]}),p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(Hfe,{})}),"Takes seconds to set up and use."]})]});const Tft={component:()=>{let{user:t,unlinkPasskey:e}=Wn(),{linkWithPasskey:n,closePrivyModal:r}=Ht(),i=t==null?void 0:t.linkedAccounts.filter(m=>m.type==="passkey"),[s,o]=E.useState(!1),[a,c]=E.useState(""),[l,u]=E.useState(!1),[d,h]=E.useState(!1);E.useEffect(()=>{i.length===0&&h(!1)},[i.length]);let f=async m=>(o(!0),await e(m).then(()=>u(!0)).catch(y=>{y instanceof fa&&y.privyErrorCode===Ce.MISSING_MFA_CREDENTIALS?c("Cannot unlink a passkey enrolled in MFA"):c("Unknown error occurred.")}).finally(()=>{o(!1)}));return p.jsxs(p.Fragment,l?{children:[p.jsx(_t,{onClose:()=>r()},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(Tl,{})}),p.jsx(vJ,{style:{marginBottom:"1.5rem"},children:"Passkeys updated"}),p.jsx(Oft,{children:" "}),p.jsx(gc,{children:p.jsx(tn,{onClick:()=>r(),children:"Done"})}),p.jsx(Bn,{})]}:d?{children:[p.jsx(_t,{backFn:()=>h(!1),onClose:()=>r()},"header"),p.jsx(wJ,{passkeys:i,expanded:d,onUnlink:f,onExpand:()=>h(!0)}),p.jsx(Bn,{})]}:{children:[p.jsx(_t,{onClose:()=>r()},"header"),p.jsx(G5,{children:p.jsxs(KB,{children:[p.jsx(Y5,{}),p.jsx(Q5,{})]})}),p.jsx(vJ,{children:"Secure your account with a passkey"}),p.jsx(jft,{}),i.length===0?p.jsx(Ift,{}):p.jsx(wJ,{passkeys:i,expanded:d,onUnlink:f,onExpand:()=>h(!0)}),p.jsxs(gc,{style:{marginTop:"12px"},children:[a&&p.jsx(Pft,{$fail:!0,children:a}),p.jsx(tn,{onClick:()=>{o(!0),n().then(()=>u(!0)).catch(m=>{if(m instanceof fa){if(m.privyErrorCode===Ce.CANNOT_LINK_MORE_OF_TYPE)return void c("Cannot link more passkeys to account.");if(m.privyErrorCode===Ce.PASSKEY_NOT_ALLOWED)return void c("Passkey request timed out or rejected by user.")}c("Unknown error occurred.")}).finally(()=>{o(!1)})},loading:s,children:"Add new passkey"})]}),p.jsx(Bn,{})]})}},KB=ue.div.withConfig({displayName:"DoubleIconWrapper",componentId:"sc-d6832d36-0"})(["display:flex;align-items:center;justify-content:center;width:180px;height:90px;border-radius:50%;svg + svg{margin-left:12px;}> svg{z-index:2;color:var(--privy-color-accent) !important;stroke:var(--privy-color-accent) !important;fill:var(--privy-color-accent) !important;}"]);let Pft=ue.div.withConfig({displayName:"InputHelp",componentId:"sc-d6832d36-1"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-beginngin;width:100%;"],t=>t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"),Rft=gs(["&&{width:100%;font-size:0.875rem;line-height:1rem;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;justify-content:center;padding:6px 8px;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent) !important;:focus{outline:none;box-shadow:none;}}"]);const Mft=ue.button.withConfig({displayName:"LinkButton",componentId:"sc-d6832d36-2"})(["",""],Rft);let Rge=ue.div.withConfig({displayName:"List",componentId:"sc-d6832d36-3"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.8rem;padding:0.5rem 0rem 0rem;flex-grow:1;width:100%;"]),vJ=ue.div.withConfig({displayName:"ModalTitle",componentId:"sc-d6832d36-4"})(["font-size:18px;line-height:18px;text-align:center;font-weight:600;"]),Oft=ue.div.withConfig({displayName:"ModalSubTitle",componentId:"sc-d6832d36-5"})(["font-size:0.875rem;text-align:center;margin-top:10px;"]),jft=ue.div.withConfig({displayName:"SectionSpacer",componentId:"sc-d6832d36-6"})(["height:32px;"]),Nft=ue.div.withConfig({displayName:"PasskeyListTitle",componentId:"sc-d6832d36-7"})(["line-height:20px;height:20px;font-size:1em;font-weight:450;display:flex;justify-content:flex-beginning;width:100%;"]),Dft=ue.div.withConfig({displayName:"PasskeyItemTitle",componentId:"sc-d6832d36-8"})(["font-size:1em;line-height:1.3em;font-weight:500;color:var(--privy-color-foreground-2);padding:0.2em 0;"]),Lft=ue.div.withConfig({displayName:"PasskeyItemSubtitle",componentId:"sc-d6832d36-9"})(["font-size:0.875rem;line-height:1rem;color:#64668b;padding:0.2em 0;"]),Bft=ue.div.withConfig({displayName:"PasskeyListItem",componentId:"sc-d6832d36-10"})(["display:flex;align-items:center;justify-content:space-between;padding:1em;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;border-radius:8px;border:1px solid #e2e3f0 !important;width:100%;height:5em;"]),Fft=gs([":focus,:hover,:active{outline:none;}display:flex;width:2em;height:2em;justify-content:center;align-items:center;svg{color:var(--privy-color-error);}svg:hover{color:var(--privy-color-foreground-3);}
435"]),Uft=ue.button.withConfig({displayName:"PasskeyItemUnlinkButton",componentId:"sc-d6832d36-11"})(["",""],Fft);const IT=new Map([[ca,null],[Y2,"external"],[_1e,"external"],[g1e,"external"],[D1e,"external"],[S1e,"external"],[V9,"manual"],[A1e,"moonpay"]]),bJ=t=>!!t.fundingConfig&&VB(t.fundingConfig.options).length>=1;async function xJ({url:t,popup:e,provider:n}){return e.location=t,new Promise((r,i)=>{function s(){e==null||e.close(),window.removeEventListener("message",o)}function o(a){a.data&&(a.data.type==="PRIVY_OAUTH_RESPONSE"&&a.data.stateCode&&a.data.authorizationCode&&(r(a.data),s()),a.origin==="https://cdn.apple-cloudkit.com"&&a.data.ckSession&&(r({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:a.data.ckSession}),s()),a.data.type==="PRIVY_OAUTH_ERROR"&&(i(a.data.error),s()))}window.addEventListener("message",o)})}const zft={component:()=>{var a,c,l;let{app:t,data:e}=jt(),n=Vr(),r=(a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.suggestedAddress,i=r?`Connect the wallet with address ${po(r)} ${t!=null&&t.name?`to ${t.name}.`:"."}`:`Connect a wallet to ${t==null?void 0:t.name}`,{connectors:s}=Ht(),o=I1({walletList:((c=e==null?void 0:e.externalConnectWallet)==null?void 0:c.walletList)??t.appearance.walletList,walletChainType:((l=e==null?void 0:e.externalConnectWallet)==null?void 0:l.walletChainType)??t.appearance.walletChainType,connectors:s,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),o.length>0&&p.jsx(H5,{title:"Connect your wallet",description:i}),p.jsx(wB,{$colorScheme:n.appearance.palette.colorScheme,children:p.jsx(TB,{wallets:o})}),p.jsx(ln,{})]})}},Wft={component:()=>{let t=Vr(),{data:e,navigate:n,setModalData:r,onUserCloseViaDialogOrKeybindRef:i}=jt(),{crossAppAuthFlow:s,updateWallets:o,closePrivyModal:a,createAnalyticsEvent:c}=Ht(),{logout:l}=Ege(),[u,d]=E.useState({}),h=e==null?void 0:e.crossAppAuth,f={id:h.appId,name:h.name,logoUrl:h.logoUrl},m=new ve(`There was an issue connecting your ${f.name} account. Please try again.`),y=new ko(async x=>{if(h.popup)try{let _=await s({appId:x,popup:h.popup,action:h.action});d({data:_})}catch(_){_ instanceof ve?d({error:_}):(_ instanceof fc&&h.popup&&h.popup.close(),d({error:m}))}else d({error:m})}),v=()=>{u.data&&(o(),h.onSuccess(u.data),a({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h.onError(u.error??new ve("User canceled flow")),a({shouldCallAuthOnSuccess:!1,isSuccess:!1})};i.current=v,E.useEffect(()=>{f.id.length&&y.execute(f.id)},[f.id]),E.useEffect(()=>{if(!u.data)return;let x=u.data;if(t.legal.requireUsersAcceptTerms&&!x.hasAcceptedTerms){let $=setTimeout(()=>{n(X1)},Jr);return()=>clearTimeout($)}if(_p(x,t.embeddedWallets)){let $=setTimeout(()=>{r({createWallet:{onSuccess:()=>{},onFailure:I=>{console.error(I),c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:I,provider:`privy:${f.id}`,screen:"CrossAppAuthScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),n(_h)},Jr);return()=>clearTimeout($)}let _=setTimeout(v,Jr);return()=>clearTimeout(_)},[u.data]);let{title:b,subtitle:C}=E.useMemo(()=>u.data?{title:`Successfully connected with ${f.name}`,subtitle:"You're good to go!"}:u.error?{title:"Authentication failed",subtitle:u.error.message}:{title:`Connecting to ${f.name}`,subtitle:`Please check the pop-up from ${f.name} to continue`},[u,f.name]);return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:v}),p.jsx(sr,{}),p.jsxs(Hft,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:!!u.data,fail:!!u.error}),p.jsx(Ype,{name:f.name,logoUrl:f.logoUrl})]})}),p.jsxs(Fa,{children:[p.jsx("h3",{children:b}),p.jsx("p",{children:C})]})]}),p.jsx(dr,{}),p.jsx(Bn,{})]})}};let Hft=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-33c02367-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);const Vft={component:()=>{let{app:t,data:e}=jt(),{closePrivyModal:n}=Ht(),[r,i]=E.useState(!1),[s,o]=E.useState(),{address:a,onDelegate:c,onSuccess:l,onError:u}=e.delegatedActions.consent,d=async()=>{r?l():u(s??new ve("User declined delegating actions.")),n({shouldCallAuthOnSuccess:!1})};return E.useEffect(()=>{if(!r&&!s)return;let h=setTimeout(d,epe);return()=>clearTimeout(h)},[r,s]),p.jsxs(p.Fragment,r||s?{children:[p.jsx(_t,{onClose:d}),p.jsx(sr,{}),p.jsxs(xB,{children:[s?p.jsx(c_,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):p.jsx(Tl,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(CB,{height:20}),p.jsx(ei,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":`Youâve successfully granted delegated action permissions to ${t.name}.`})]}),p.jsx(dr,{}),p.jsx(ln,{})]}:{children:[p.jsx(_t,{closeable:!0,onClose:d}),p.jsx(Pit,{width:56,height:56,style:{margin:"auto"}}),p.jsx(pr,{style:{marginTop:24,color:"var(--privy-color-foreground)"},children:"Enable offline access"}),p.jsxs(gr,{style:{marginBottom:24,textWrap:"pretty"},children:["By confirming, ",t.name," will be able to use your wallet for you even when you're not around. You can revoke this later."]}),p.jsx(Kft,{showIcon:!0,address:a,title:"Wallet",isLoading:!1}),p.jsxs(qft,{style:{marginTop:24},children:[p.jsx(ch,{onClick:d,children:"Not now"}),p.jsx(tn,{onClick:async()=>{try{await c(),i(!0)}catch(h){o(h)}},children:"Accept"})]}),p.jsx(ln,{})]})}};let qft=ue.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-bdb7bc51-0"})(["display:flex;gap:10px;"]),Kft=ue(J_).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-bdb7bc51-1"})(["margin-top:1.5rem;"]);const Gft={component:()=>{let{app:t,data:e}=jt(),{closePrivyModal:n}=Ht(),[r,i]=E.useState(!1),[s,o]=E.useState(),{onRevoke:a,onSuccess:c,onError:l}=e.delegatedActions.revoke,u=async()=>{r?c():l(s??new ve("User declined revoking access to their delegated
435wallet.")),n({shouldCallAuthOnSuccess:!1})};return E.useEffect(()=>{if(!r&&!s)return;let d=setTimeout(u,epe);return()=>clearTimeout(d)},[r,s]),p.jsxs(p.Fragment,r||s?{children:[p.jsx(_t,{onClose:u}),p.jsx(sr,{}),p.jsxs(xB,{children:[s?p.jsx(c_,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):p.jsx(Tl,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(CB,{height:20}),p.jsx(ei,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":"You've successfully revoked permissions."})]}),p.jsx(dr,{}),p.jsx(ln,{})]}:{children:[p.jsx(_t,{closeable:!0,onClose:u}),p.jsx(jit,{width:56,height:56,style:{margin:"auto"}}),p.jsx(pr,{style:{marginTop:24},children:"Revoke offline access to wallet"}),p.jsxs(gr,{children:["By confirming, ",t.name," will no longer be able to use this wallet on your behalf when you are not online."]}),p.jsxs(Zft,{style:{marginTop:24},children:[p.jsx(ch,{onClick:u,children:"Deny"}),p.jsx(tn,{onClick:async()=>{try{await a(),i(!0)}catch(d){o(d)}},children:"Confirm"})]}),p.jsx(ln,{})]})}};let Zft=ue.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-993a839-0"})(["display:flex;gap:10px;"]),EJ="#8a63d2";const Yft={component:()=>{let{lastScreen:t,navigateBack:e,data:n,app:r}=jt(),{requestFarcasterSignerStatus:i,closePrivyModal:s}=Ht(),[o,a]=E.useState(void 0),[c,l]=E.useState(!1),[u,d]=E.useState(!1),h=E.useRef([]),f=n==null?void 0:n.farcasterSigner;E.useEffect(()=>{let y=Date.now(),v=setInterval(async()=>{if(!(f!=null&&f.public_key))return clearInterval(v),void a({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});f.status==="approved"&&(clearInterval(v),l(!1),d(!0),h.current.push(setTimeout(()=>s({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Jr)));let b=await i(f==null?void 0:f.public_key),C=Date.now()-y;b.status==="approved"?(clearInterval(v),l(!1),d(!0),h.current.push(setTimeout(()=>s({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Jr))):C>3e5?(clearInterval(v),a({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):b.status==="revoked"&&(clearInterval(v),a({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},2e3);return()=>{clearInterval(v),h.current.forEach(b=>clearTimeout(b))}},[]);let m=(f==null?void 0:f.status)==="pending_approval"?f.signer_approval_url:void 0;return p.jsxs(p.Fragment,di.isMobile||c?{children:[p.jsx(_t,{backFn:t?e:void 0,onClose:s},"header"),p.jsx(sr,{}),p.jsx(p.Fragment,di.isIOS?{children:p.jsxs(Qft,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:u,fail:!!o}),p.jsx(r1,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(Fa,{children:[p.jsx(pr,{children:o?o.message:"Add a signer to Farcaster"}),p.jsx(gr,{children:o?o.detail:"This will allow "+r.name+" to add casts, likes, follows, and more on your behalf."})]}),m&&p.jsx(tn,{onClick:y=>{y.preventDefault(),window.location.href=m},children:"Open Warpcast app"})]})}:{children:p.jsxs(CJ,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:u,fail:!!o}),p.jsx(r1,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(Fa,{children:[p.jsx(pr,{children:o?o.message:"Requesting signer from Farcaster"}),p.jsx(gr,{children:o?o.detail:"This should only take a moment"}),p.jsx(lh,{children:m&&di.isMobile&&p.jsx(k0e,{text:"Take me to Warpcast",url:m,color:EJ})})]})]})}),p.jsx(Bn,{})]}:{children:[p.jsx(_t,{backFn:t?e:void 0,onClose:s},"header"),p.jsx(sr,{}),p.jsx(CJ,{children:p.jsxs("div",{children:[p.jsx(pr,{children:"Add a signer to Farcaster"}),p.jsxs(gr,{children:["This will allow ",r.name," to add casts, likes, follows, and more on your behalf."]}),p.jsx(EB,{children:(f==null?void 0:f.status)==="pending_approval"?p.jsx(G_,{url:f.signer_approval_url,size:275,squareLogoElement:r1}):p.jsx(kc,{})}),p.jsxs(lh,{children:[p.jsx(gr,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),(f==null?void 0:f.status)==="pending_approval"&&p.jsx(K_,{text:f.signer_approval_url,itemName:"link",color:EJ})]})]})}),p.jsx(Bn,{})]})}};let CJ=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-6e8f76e5-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),Qft=ue.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-6e8f76e5-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const _J={component:()=>{let{closePrivyModal:t}=Ht();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),p.jsx(Xft,{children:p.jsx(pO,{style:{width:32,height:32}})}),p.jsx(H5,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),p.jsx(Q1,{children:p.jsx(tn,{onClick:()=>t(),children:"Close"})}),p.jsx(dr,{}),p.jsx(ln,{})]})}};let Xft=ue.div.withConfig({displayName:"StyledCircle",componentId:"sc-7bde5742-0"})(["border-radius:50%;height:68px;width:68px;display:flex;align-items:center;justify-content:center;background-color:var(--privy-color-accent);color:white;margin:0 auto 24px auto;"]);const Jft={component:()=>{let{app:t}=jt();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),p.jsx(sr,{}),p.jsx(ei,{title:"Connect your email",description:`Add your email to your ${t==null?void 0:t.name} account`,icon:p.jsx(H1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),p.jsx(Q1,{children:p.jsx(B0e,{stacked:!0})}),p.jsx(dr,{}),p.jsx(ln,{})]})}},GB={component:()=>{let{app:t,currentScreen:e,data:n,navigate:r,setModalData:i}=jt(),{initLoginWithSms:s}=Ht();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),p.jsx(sr,{}),p.jsx(ei,{title:"Connect your phone",description:`Add your number to your ${t==null?void 0:t.name} account`,icon:p.jsx(xl,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),p.jsx(Q1,{children:p.jsx(Y_,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:o}){var a;try{await s({phoneNumber:o,withPrivyUi:!0}),r(dh)}
435catch(c){i({errorModalData:{error:c,previousScreen:((a=n==null?void 0:n.errorModalData)==null?void 0:a.previousScreen)||e||GB}}),r(Hr)}},hideRecent:!0})}),p.jsx(dr,{}),p.jsx(ln,{})]})}},ept={component:()=>{var o,a,c;let{app:t,data:e}=jt(),n=(o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.suggestedAddress,r=n?p.jsxs("span",{children:["Link the wallet with address ",p.jsx(zi,{showCopyIcon:!1,address:n})," ",t!=null&&t.name?`to ${t.name}.`:"."]}):`Link a wallet to your ${t==null?void 0:t.name} account`,{connectors:i}=Ht(),s=I1({walletList:((a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.walletList)??t.appearance.walletList,walletChainType:((c=e==null?void 0:e.externalConnectWallet)==null?void 0:c.walletChainType)??t.appearance.walletChainType,connectors:i,connectOnly:!1,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),s.length>0&&p.jsx(H5,{title:"Link your wallet",description:r}),p.jsx(u2,{children:p.jsx(TB,{wallets:s})}),p.jsx(ln,{})]})}},tpt=({style:t,...e})=>p.jsxs("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...t},...e,children:[p.jsx("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]}),npt={component:()=>{let{closePrivyModal:t}=Ht(),{navigate:e}=jt();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),p.jsx(sr,{}),p.jsx(tpt,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),p.jsx(H5,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),p.jsxs(Q1,{children:[p.jsx(tn,{onClick:()=>e(mo),children:"Try again"}),p.jsx(ch,{onClick:()=>t(),children:"Cancel"})]}),p.jsx(dr,{}),p.jsx(ln,{})]})}};function sy(){let{initEnrollmentWithSms:t,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:n,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:s,unenroll:o,enrollInMfa:a}=E.useContext(Cp);return{initEnrollmentWithSms:t,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:n,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:s,unenrollWithSms:()=>o("sms"),unenrollWithTotp:()=>o("totp"),unenrollWithPasskey:c=>o("passkey",c),showMfaEnrollmentModal:()=>a(!0),closeMfaEnrollmentModal:()=>a(!1)}}const rpt=t=>p.jsxs(ipt,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...t,children:[p.jsx("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]});let ipt=ue.svg.withConfig({displayName:"StyledSvg",componentId:"sc-59fa943f-0"}
435)(["height:90px;width:90px;> rect{","}> path{fill:white;}"],t=>t.color==="success"?"fill: var(--privy-color-success);":"fill: var(--privy-color-accent);");const spt=({showIntro:t,userMfaMethods:e,appMfaMethods:n,userHasAuthSms:r,isTotpLoading:i,isPasskeyLoading:s,error:o,onClose:a,onBackToIntro:c,handleSelectMethod:l,setRemovingMfaMethod:u})=>{let d=e.reduce((f,m)=>({...f,[m]:!0}),{}),h=n.reduce((f,m)=>({...f,[m]:!0}),{});return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:t?c:void 0,onClose:a},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(_1,{})}),p.jsx(pr,{children:"Choose a verification method"}),e.length>0?p.jsx(gr,{children:"To add or delete verification methods, verification is required."}):p.jsx(gr,{children:"How would you like to verify your identity? You can change this later."}),o&&p.jsx(S0e,{style:{marginTop:"1.25rem"},children:o.message}),p.jsxs(_0e,{children:[(h.totp||d.totp)&&p.jsxs(eT,{children:[p.jsx(Qr,{style:{justifyContent:"center"},disabled:d.totp||i,onClick:()=>l("totp"),children:i?p.jsx(kc,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):p.jsxs(iT,{children:[p.jsxs(nT,{children:[p.jsx(E_,{}),"Authenticator app"]}),d.totp?p.jsx(TT,{color:"green",children:"Enabled"}):p.jsx(rT,{children:"Recommended"})]})}),d.totp&&p.jsx(tT,{style:{position:"absolute",right:0},onClick:()=>u("totp"),children:p.jsx(HI,{})})]},"totp"),(h.sms||d.sms)&&p.jsxs(eT,{children:[p.jsx(Qr,{disabled:d.sms||r,onClick:()=>l("sms"),children:p.jsxs(iT,{children:[p.jsxs(nT,{children:[p.jsx(xl,{}),"SMS"]}),d.sms&&p.jsx(TT,{color:"green",children:"Enabled"}),r&&p.jsx(rT,{children:"Disabled"})]})}),d.sms&&p.jsx(tT,{style:{position:"absolute",right:0},onClick:()=>u("sms"),children:p.jsx(HI,{})})]},"sms"),(h.passkey||d.passkey)&&p.jsxs(eT,{children:[p.jsx(Qr,{style:{justifyContent:"center"},onClick:()=>l("passkey"),disabled:d.passkey||s,children:s?p.jsx(kc,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):p.jsxs(iT,{children:[p.jsxs(nT,{children:[p.jsx(FL,{}),"Passkey"]}),d.passkey?p.jsx(TT,{color:"green",children:"Enabled"}):p.jsx(rT,{isAccent:!0,children:p.jsx(UL,{})})]})}),d.passkey&&p.jsx(tT,{style:{position:"absolute",right:0},onClick:()=>u("passkey"),children:p.jsx(HI,{})})]},"passkey")]}),p.jsx(Bn,{})]})};let TT=ue(_l).withConfig({displayName:"StyledChip",componentId:"sc-998ca5bc-0"})(["margin-right:1.5rem;"]);const opt=({appName:t,onComplete:e,onClose:n,onReset:r})=>{let{user:i}=Wn(),{data:s}=jt(),{initLinkWithPasskey:o,linkWithPasskey:a}=Ht(),{initEnrollmentWithPasskey:c,submitEnrollmentWithPasskey:l}=sy(),[u,d]=E.useState(!1),[h,f]=E.useState(!1),[m,y]=E.useState(!1),[v,b]=E.useState(null),C=E.useMemo(()=>(i==null?void 0:i.linkedAccounts.filter(I=>I.type==="passkey"))??[],[i]),x=()=>{var I;(I=s==null?void 0:s.mfaEnrollmentFlow)==null||I.onSuccess(),e()},_=async I=>{var R;d(!0);try{await c(),await l({credentialIds:I},{removeForLogin:(R=s==null?void 0:s.mfaEnrollmentFlow)==null?void 0:R.shouldUnlinkOnUnenrollMfa}),y(!0)}catch(N){b(N)}finally{d(!1)}},$=async()=>{f(!0),b(null);try{await o();let I=await a(),R=(I==null?void 0:I.linkedAccounts.filter(N=>N.type==="passkey").map(N=>N.credentialId))??[];await _(R)}catch(I){b(I)}finally{f(!1)}};return C.length===0||h?p.jsx(apt,{onReset:r,onClose:n,onClick:$,isCreating:h}):m?p.jsx(lpt,{appName:t,onClick:x,onClose:x}):v?p.jsx(K5,{error:v,backFn:()=>b(null),onClick:()=>b(null)}):p.jsx(cpt,{passkeys:C,isSubmitting:u,isCreating:h,onReset:r,onClose:n,onSubmitEnrollment:()=>_(C.map(I=>I.credentialId)),onAddPasskey:$})};let apt=({onReset:t,onClose:e,onClick:n,isCreating:r})=>p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:t,onClose:e},"header"),p.jsx(G5,{children:p.jsxs(KB,{children:[p.jsx(Y5,{}),p.jsx(Q5,{})]})}),p.jsx(pr,{children:"Set up passkey verification"}),p.jsxs(q_,{children:[p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(_1,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(Hfe,{})}),"Takes seconds to set up and use"]}),p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(_it,{})}),"Use your passkey to verify transactions and login to your account"]})]}),p.jsx(tn,{style:{marginTop:"2.25rem"},onClick:n,loading:r,children:"Add a new passkey"}),p.jsx(Bn,{})]}),cpt=({onReset:t,onClose:e,onAddPasskey:n,onSubmitEnrollment:r,passkeys:i,isSubmitting:s,isCreating:o})=>{let[a,c]=E.useState(!1),l=a?i.length:i.length>3?2:3;return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:a?()=>c(!1):t,onClose:e},"header"),!a&&p.jsx(G5,{children:p.jsxs(KB,{children:[p.jsx(Y5,{}),p.jsx(Q5,{})]})}),p.jsx(pr,{children:"Enable your passkeys for verification"}),p.jsxs(q_,{children:[i.slice(0,l).map(u=>{var d;return p.jsxs(upt,{children:[p.jsx(dpt,{children:fpt(u)}),p.jsxs(hpt,{children:["Last used: ",(d=u.latestVerifiedAt)==null?void 0:d.toLocaleStr
435ing()]})]},u.credentialId)}),!a&&i.length>3&&p.jsx(SJ,{onClick:()=>c(!0),children:"View All"})]}),p.jsx(tn,{style:{marginTop:"1.5rem"},onClick:r,loading:s,children:"Enable passkeys"}),i.length<5&&p.jsx(SJ,{style:{marginTop:"0.5rem"},onClick:n,disabled:o,children:o?p.jsx(kc,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),p.jsx(Bn,{})]})},lpt=({appName:t,onClick:e,onClose:n})=>p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:n},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(Tl,{})}),p.jsx(pr,{children:"Passkey verification added"}),p.jsxs(gr,{children:["From now on, you'll use the passkey whenever you use your ",t," wallet."]}),p.jsx(gc,{children:p.jsx(tn,{onClick:e,children:"Done"})}),p.jsx(Bn,{})]}),upt=ue.div.withConfig({displayName:"PasskeyItem",componentId:"sc-d5b2bf9c-0"})(["&&{padding:0.75rem 1rem;text-align:left;border-radius:0.5rem;border:1px solid var(--privy-color-foreground-4);width:100%;}"]),dpt=ue.div.withConfig({displayName:"PasskeyItemTitle",componentId:"sc-d5b2bf9c-1"})(["font-size:0.875rem;line-height:1.375rem;font-weight:500;color:var(--privy-color-foreground-1);"]),hpt=ue.div.withConfig({displayName:"PasskeyItemSubtitle",componentId:"sc-d5b2bf9c-2"})(["font-size:0.75rem;font-weight:400;line-height:1.125rem;color:var(--privy-color-foreground-2);"]),fpt=t=>t.authenticatorName?t.createdWithBrowser?`${t.authenticatorName} on ${t.createdWithBrowser}`:t.authenticatorName:t.createdWithBrowser?t.createdWithOs?`${t.createdWithBrowser} on ${t.createdWithOs}`:`${t.createdWithBrowser}`:"Unknown device";const SJ=ue.button.withConfig({displayName:"StyledLink",componentId:"sc-d5b2bf9c-3"})(["&&{width:100%;font-size:0.875rem;line-height:1rem;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;justify-content:center;padding:0.75rem 1rem;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent);:focus{outline:none;box-shadow:none;}}"]),ppt=({appName:t,onComplete:e,onReset:n,onClose:r})=>{let[i,s]=E.useState(""),[o,a]=E.useState(!1),[c,l]=E.useState(null),[u,d]=E.useState("enroll"),{initEnrollmentWithSms:h,submitEnrollmentWithSms:f}=sy(),{app:m,data:y}=jt();function v(){var b;(b=y==null?void 0:y.mfaEnrollmentFlow)==null||b.onSuccess(),e()}return c?p.jsx(K5,{error:c,backFn:()=>l(null),onClick:()=>l(null)}):p.jsxs(p.Fragment,u==="enroll"?{children:[p.jsx(_t,{backFn:n,onClose:r},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(xl,{})}),p.jsx(pr,{children:"Set up SMS verification"}),p.jsxs(gr,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),p.jsxs($1,{children:[p.jsx(Y_,{onSubmit:async function({qualifiedPhoneNumber:b}){try{await h({phoneNumber:b}),s(b),d("verify")}catch(C){l(C)}},hideRecent:!0}),p.jsxs(zot,{children:["By providing your mobile number, you agree to receive text messages from ",m==null?void 0:m.name,". Some carrier charges may apply"]})]}),p.jsx(Bn,{})]}:o?{children:[p.jsx(_t,{onClose:v},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(Tl,{})}),p.jsx(pr,{children:"SMS verification added"}),p.jsxs(gr,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",t," wallet."]}),p.jsx(gc,{children:p.jsx(tn,{onClick:v,children:"Done"})}),p.jsx(Bn,{})]}:{children:[p.jsx(_t,{backFn:function(){u==="verify"?d("enroll"):n()},onClose:r},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(xl,{})}),p.jsx(pr,{children:"Enter enrollment code"}),p.jsxs($1,{children:[p.jsx(Y9,{onChange:async function(b){try{if(!b)return;await f({phoneNumber:i,mfaCode:b}),a(!0)}catch(C){throw Qpe(C)?Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):AB(C)?Error("The code you entered is not valid"):SB(C)?Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Xpe(C)?Error("Verification canceled"):Error("Unknown error")}}}),p.jsxs(gr,{children:["To continue, enter the 6-digit code sent to ",p.jsx("strong",{children:UMe(i)})]})]}),p.jsx(Bn,{})]})},gpt=({size:t,authUrl:e})=>p.jsx(G_,{url:e,squareLogoElement:Pht,size:t,fgColor:"#1F1F1F"}),mpt=({onComplete:t,onClose:e,onReset:n,totpInfo:r})=>{let[i,s]=E.useState("enroll"),[o,a]=E.useState(!1),{submitEnrollmentWithTotp:c}=sy(),{data:l}=jt();function u(){var d;(d=l==null?void 0:l.mfaEnrollmentFlow)==null||d.onSuccess(),t()}return p.jsxs(p.Fragment,i==="enroll"?{children:[p.jsx(_t,{backFn:n,onClose:e},"header"),p.jsx(pr,{children:"Scan QR code"}),p.jsx(gr,{children:"Open your authenticator app and scan the QR code to continue."}),p.jsx(EB,{children:p.jsx(gpt,{authUrl:r.authUrl,size:200})}),p.jsxs(gc,{children:[p.jsx(lh,{children:p.jsx(K_,{itemName:"setup key",text:r.secret})}),p.jsx(tn,{onClick:function(){s("verify")},children:"Continue"})]}),p.jsx(Bn,{})]}:o?{children:[p.jsx(_t,{onClose:u},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(Tl,{})}),p.jsx(pr,{children:"Authenticator app verification added"}),p.jsxs(gr,{children:["From now on, you'll enter the verification code generated by your authenticator app whenever you use your ",r.appName," wallet."]}
435),p.jsx(gc,{children:p.jsx(tn,{onClick:u,children:"Done"})}),p.jsx(Bn,{})]}:{children:[p.jsx(_t,{backFn:function(){i==="verify"?s("enroll"):n()},onClose:e},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(E_,{})}),p.jsx(pr,{children:"Enter enrollment code"}),p.jsx($1,{children:p.jsx(Y9,{onChange:async function(d){try{if(!d)return;await c({mfaCode:d}),a(!0)}catch(h){throw Qpe(h)?Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):AB(h)?Error("The code you entered is not valid"):SB(h)?Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Xpe(h)?Error("Verification canceled"):Error("Unknown error")}}})}),p.jsxs(gr,{children:["To continue, enter the 6-digit code generated from your ",p.jsx("strong",{children:"authenticator app"})]}),p.jsx(Bn,{})]})},ypt={component:()=>{var D;let{user:t,enrollInMfa:e,ready:n}=Wn(),[r,i]=E.useState(null),{unenrollWithSms:s,unenrollWithTotp:o,unenrollWithPasskey:a}=sy(),{app:c,data:l,onUserCloseViaDialogOrKeybindRef:u}=jt(),{closePrivyModal:d}=Ht(),{promptMfa:h}=kge(),{initEnrollmentWithTotp:f}=sy(),[m,y]=E.useState(!1),[v,b]=E.useState(null),[C,x]=E.useState(null),_=()=>{d({shouldCallAuthOnSuccess:!0}),e(!1),setTimeout(()=>{i(null),b(null)},500)},{initEnrollmentWithPasskey:$,submitEnrollmentWithPasskey:I}=sy(),[R,N]=E.useState(!1),[T,O]=E.useState(null);u.current=_;let U=t==null?void 0:t.mfaMethods.includes("sms"),z=!!(t!=null&&t.phone),L=t==null?void 0:t.mfaMethods.includes("totp"),S=t==null?void 0:t.mfaMethods.includes("passkey"),k=U||L||S,M=(t==null?void 0:t.linkedAccounts.filter(V=>V.type==="passkey").map(V=>V.credentialId))??[];function W(){i(null),b(null)}if(E.useEffect(()=>{k&&y(!0)},[k]),!n||!t||!c)return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:_},"header"),p.jsx(G5,{children:p.jsx(rpt,{})}),p.jsx($1,{children:p.jsx(kc,{})}),p.jsx(Bn,{})]});if(r==="sms")return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:W,onClose:_},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(t1,{})}),p.jsx(pr,{children:"Remove SMS verification?"}),p.jsxs(gr,{children:["MFA adds an extra layer of security to your ",c==null?void 0:c.name," account. Make sure you have other methods to secure your account."]}),p.jsx(gc,{children:p.jsx(tn,{warn:!0,onClick:async function(){i(null);try{await s()}catch{i(null)}},children:"Remove SMS for MFA"})}),p.jsx(Bn,{})]});if(r==="totp")return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:W,onClose:_},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(t1,{})}),p.jsx(pr,{children:"Remove Authenticator App verification?"}),p.jsxs(gr,{children:["MFA adds an extra layer of security to your ",c==null?void 0:c.name," account. Make sure you have other methods to secure your account."]}),p.jsx(gc,{children:p.jsx(tn,{warn:!0,onClick:async function(){i(null);try{await o()}catch{i(null)}},children:"Remove Authenticator App for MFA"})}),p.jsx(Bn,{})]});if(r==="passkey"){let V=((D=l==null?void 0:l.mfaEnrollmentFlow)==null?void 0:D.shouldUnlinkOnUnenrollMfa)??!0;return p.jsxs(p.Fragment,{children:[p.jsx(_t,{backFn:W,onClose:_},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(t1,{})}),p.jsx(pr,{children:"Are you sure you want to remove this passkey?"}),p.jsx(gr,{children:V?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),p.jsx(gc,{children:p.jsx(tn,{warn:!0,onClick:async function(){var B;i(null);try{await a({removeForLogin:(B=l==null?void 0:l.mfaEnrollmentFlow)==null?void 0:B.shouldUnlinkOnUnenrollMfa})}catch{i(null)}},children:"Yes, remove"})}),p.jsx(Bn,{})]})}if(l.mfaEnrollmentFlow.mfaMethods.length===0&&!k)return p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:_},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(_1,{})}),p.jsx(pr,{children:"Add more security"}),p.jsxs(gr,{children:[c==null?void 0:c.name," does not have any verification methods enabled."]}),p.jsx(gc,{children:p.jsx(tn,{onClick:_,children:"Close"})}),p.jsx(Bn,{})]});let H=!k&&!m;return H?p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:_},"header"),p.jsx(uo,{style:{marginBottom:"1.5rem"},children:p.jsx(_1,{})}),p.jsx(pr,{children:"Transaction Protection"}),p.jsx(gr,{children:"Set up transaction protection to add an extra layer of security to your account"}),p.jsxs(q_,{children:[p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(Cge,{})}),"Enable 2-Step verification for your ",c==null?void 0:c.name," wallet."]}
435),p.jsxs(Iu,{children:[p.jsx($u,{children:p.jsx(Iht,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),p.jsxs(gc,{children:[p.jsx(tn,{onClick:()=>y(!0),children:"Continue"}),p.jsx(ch,{onClick:_,children:"Not now"})]}),p.jsx(Bn,{})]}):v==="sms"?p.jsx(ppt,{appName:(c==null?void 0:c.name)||"Privy",onComplete:_,onReset:W,onClose:_}):v==="totp"&&C?p.jsx(mpt,{onComplete:_,onClose:_,onReset:W,totpInfo:{...C,appName:(c==null?void 0:c.name)||"Privy"}}):v==="passkey"?p.jsx(opt,{appName:(c==null?void 0:c.name)||"Privy",onComplete:_,onReset:W,onClose:_}):p.jsx(spt,{showIntro:H,userMfaMethods:t.mfaMethods,appMfaMethods:c.mfa.methods,userHasAuthSms:z,onBackToIntro:function(){y(!1)},handleSelectMethod:async function(V){return await h().catch(O),V==="totp"?(b(V),x(null),void f().then(B=>{x(B)}).catch(()=>{x(null),W()})):V==="passkey"&&M.length===1?await async function(){var B;N(!0);try{await $(),await I({credentialIds:M},{removeForLogin:(B=l==null?void 0:l.mfaEnrollmentFlow)==null?void 0:B.shouldUnlinkOnUnenrollMfa})}catch(P){O(P)}finally{N(!1)}}():void b(V)},isTotpLoading:v==="totp"&&!C,isPasskeyLoading:R,error:T,onClose:_,setRemovingMfaMethod:async V=>{await h().catch(O),i(V)}})}},wpt={component:()=>{var N;let{authenticated:t,logout:e,ready:n,user:r}=Wn(),{app:i,setModalData:s,navigate:o,resetNavigation:a}=jt(),{getAuthMeta:c,initLoginWithOAuth:l,loginWithOAuth:u,updateWallets:d,setReadyToTrue:h,closePrivyModal:f,createAnalyticsEvent:m}=Ht(),[y,v]=E.useState(!1),[b,C]=E.useState(void 0),x=((N=c())==null?void 0:N.provider)||"google",{name:_,component:$}=bT(x);E.useEffect(()=>{u(x).then(()=>{v(!0),h(!0)}).catch(T=>{var z,L,S,k,M,W,H,D,V,B,P,j,G,Y,te,ae;if(h(!1),(T==null?void 0:T.privyErrorCode)===Ce.ALLOWLIST_REJECTED)return C(void 0),a(),void o(Z_);if((T==null?void 0:T.privyErrorCode)===Ce.USER_LIMIT_REACHED)return console.error(new d5(T).toString()),C(void 0),a(),void o(Z5);if((T==null?void 0:T.privyErrorCode)===Ce.USER_DOES_NOT_EXIST)return C(void 0),a(),void o(X5);if((T==null?void 0:T.privyErrorCode)===Ce.ACCOUNT_TRANSFER_REQUIRED&&((L=(z=T.data)==null?void 0:z.data)!=null&&L.nonce))return C(void 0),a(),s({accountTransfer:{nonce:(k=(S=T.data)==null?void 0:S.data)==null?void 0:k.nonce,account:(W=(M=T.data)==null?void 0:M.data)==null?void 0:W.subject,displayName:(V=(D=(H=T.data)==null?void 0:H.data)==null?void 0:D.account)==null?void 0:V.displayName,linkMethod:(B=c())==null?void 0:B.provider,embeddedWalletAddress:(G=(j=(P=T.data)==null?void 0:P.data)==null?void 0:j.otherUser)==null?void 0:G.embeddedWalletAddress,oAuthUserInfo:(ae=(te=(Y=T.data)==null?void 0:Y.data)==null?void 0:te.otherUser)==null?void 0:ae.oAuthUserInfo}}),void o(q2);let{retryable:O,detail:U}=function(oe,de){let ke={detail:"",retryable:!1},Be=rpe(de);if((oe==null?void 0:oe.privyErrorCode)===Ce.LINKED_TO_ANOTHER_USER&&(ke.detail="This account has already been linked to another user."),(oe==null?void 0:oe.privyErrorCode)===Ce.INVALID_CREDENTIALS&&(ke.retryable=!0,ke.detail="Something went wrong. Try again."),oe.privyErrorCode===Ce.OAUTH_USER_DENIED&&(ke.detail=`Retry and check ${Be} to finish connecting your account.`,ke.retryable=!0),(oe==null?void 0:oe.privyErrorCode)===Ce.TOO_MANY_REQUESTS&&(ke.detail="Too many requests. Please wait before trying again."),(oe==null?void 0:oe.privyErrorCode)===Ce.TOO_MANY_REQUESTS&&oe.message.includes("provider rate limit")){let $e=bT(de).name;ke.detail=`Request limit reached for ${$e}. Please wait a moment and try again.`}if((oe==null?void 0:oe.privyErrorCode)===Ce.OAUTH_ACCOUNT_SUSPENDED){let $e=bT(de).name;ke.detail=`Your ${$e} account is suspended. Please try another login method.`}return(oe==null?void 0:oe.privyErrorCode)===Ce.CANNOT_LINK_MORE_OF_TYPE&&(ke.detail="You cannot authorize more than one account for this user."),(oe==null?void 0:oe.privyErrorCode)===Ce.OAUTH_UNEXPECTED&&de.startsWith("privy:")&&(ke.detail="Something went wrong. Please try again."),ke}(T,x);C({retryable:O,detail:U,message:"Authentication failed"})}).finally(()=>{DO()})},[_,x]),E.useEffect(()=>
435{if(n&&t&&y&&r){if(i!=null&&i.legal.requireUsersAcceptTerms&&!r.hasAcceptedTerms){let T=setTimeout(()=>{o(X1)},Jr);return()=>clearTimeout(T)}if(_p(r,i.embeddedWallets)){let T=setTimeout(()=>{s({createWallet:{onSuccess:()=>{},onFailure:O=>{console.error(O),m({eventName:"embedded_wallet_creation_failure_logout",payload:{error:O,provider:x,screen:"OAuthStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),o(_h)},Jr);return()=>clearTimeout(T)}{let T=setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Jr);return d(),()=>clearTimeout(T)}}},[n,t,y,r]);let I=y?`Successfully connected with ${_}`:b?b.message:`Verifying connection to ${_}`,R="";return R=y?"Youâre good to go!":b?b.detail:"Just a few moments more",p.jsxs(p.Fragment,{children:[p.jsx(_t,{}),p.jsx(sr,{}),p.jsxs(vpt,{children:[p.jsx(pa,{children:p.jsxs("div",{children:[p.jsx(Sl,{success:y,fail:!!b}),p.jsx($,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(Fa,{children:[p.jsx("h3",{children:I}),p.jsx("p",{children:R})]}),b&&(b!=null&&b.retryable)?p.jsx(bB,{onClick:()=>{DO(),l(x),C(void 0)},disabled:!y&&!(b!=null&&b.retryable),children:"Retry"}):null]}),p.jsx(dr,{}),p.jsx(Bn,{})]})}};let vpt=ue.div.withConfig({displayName:"ConnectContainer",componentId:"sc-89bb91a9-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);const bpt=({instructions:t,fees:e,transactionInfo:n,solPrice:r,rpcEndpoint:i})=>{let s=t.reduce((d,{amount:h,token:f})=>h&&(f==null?void 0:f.symbol)==="SOL"?d+h:d,0n),[o,a]=E.useState(0),[c,l]=E.useState(!1),u=t[o];return p.jsxs(Z2,{children:[p.jsxs($n,{children:[p.jsx(An,{children:"Total"}),p.jsx(jn,{children:p.jsx(QO,{quantities:[s,e],tokenPrice:r})})]}),n&&n.action&&p.jsxs($n,{children:[p.jsx(An,{children:"Action"}),p.jsx(jn,{children:n.action})]}),p.jsxs($n,{children:[p.jsx(An,{children:"Fees"}),p.jsx(jn,{children:p.jsx(QO,{quantities:[e||0n],tokenPrice:r})})]}),t.length>1?p.jsxs(p.Fragment,{children:[p.jsx($n,{children:p.jsxs(I1e,{onClick:()=>l(d=>!d),children:[p.jsx("span",{children:"Details"}),p.jsx(x_,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:c?"rotate(180deg)":void 0}})]})}),c&&p.jsx($n,{children:p.jsxs(xpt,{children:[p.jsxs(Ept,{children:[p.jsxs(Cpt,{children:[o+1," of ",t.length," instructions"]}),p.jsxs(Spt,{children:[o>0&&p.jsx(Dpe,{backFn:()=>a(d=>d-1)}),o<t.length-1&&p.jsx(lst,{nextFn:()=>a(d=>d+1)})]})]}),p.jsx(_pt,{children:p.jsx(AJ,{instruction:u,rpcEndpoint:i,solPrice:r})})]})})]}):p.jsx(AJ,{instruction:u,rpcEndpoint:i,solPrice:r,hideAmount:!0})]})};function AJ({instruction:t,rpcEndpoint:e,solPrice:n,hideAmount:r}){var i,s;return t?p.jsxs(Z2,{children:[!r&&!!t.amount&&p.jsxs($n,{children:[p.jsx(An,{children:"Amount"}),p.jsx(jn,{children:p.jsx(QO,{quantities:[t.amount],tokenPrice:n,tokenSymbol:((i=t.token)==null?void 0:i.symbol)??"SOL",tokenDecimals:((s=t.token)==null?void 0:s.decimals)??9})})]}),t.to&&p.jsxs($n,{children:[p.jsx(An,{children:"To"}),p.jsx(jn,{children:p.jsx(Om,{walletAddress:t.to,rpcEndpoint:e,network:"solana"})})]}),t.tokenAccount&&p.jsxs($n,{children:[p.jsx(An,{children:"Token account"}),p.jsx(jn,{children:p.jsx(Om,{walletAddress:t.tokenAccount,rpcEndpoint:e,network:"solana"})})]}),t.tokenAccountOwner&&p.jsxs($n,{children:[p.jsx(An,{children:"Token account owner"}),p.jsx(jn,{children:p.jsx(Om,{walletAddress:t.tokenAccountOwner,rpcEndpoint:e,network:"solana"})})]}),t.from&&p.jsxs($n,{children:[p.jsx(An,{children:"From"}),p.jsx(jn,{children:p.jsx(Om,{walletAddress:t.from,rpcEndpoint:e,network:"solana"})})]})]}):null}let xpt=ue.div.withConfig({displayName:"InstructionsBox",componentId:"sc-5a140027-0"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),Ept=ue.header.withConfig({displayName:"InstructionsBoxHeader",componentId:"sc-5a140027-1"})(["display:flex;justify-content:space-between;align-items:center;padding:12px;background-color:var(--privy-color-background-2);"]),Cpt=ue.h4.withConfig({displayName:"HeaderTitle",componentId:"sc-5a140027-2"})(["font-size:14px;font-weight:500;line-height:19.6px;"]),_pt=ue.div.withConfig({displayName:"InstructionsBoxContent",componentId:"sc-5a140027-3"})(["padding:12px;"]),Spt=ue.div.withConfig({displayName:"NavigationButtonsConatiner",componentId:"sc-5a140027-4"})(["display:flex;gap:8px;align-items:center;"]);const Apt=({instructions:t,fees:e,onClose:n,receiptHeader:r,receiptDescription:i,transactionInfo:s,solPrice:o,rpcEndpoint:a,signOnly:c})=>p.jsxs(p.Fragment,{children:[p.jsx(_t,{onClose:n}
435),p.jsx(pa,{style:{marginBottom:"16px"},children:p.jsxs("div",{children:[p.jsx(Gpe,{color:"var(--privy-color-success-light)"}),p.jsx(Tl,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),p.jsx(ei,{title:r??`Transaction ${c?"signed":"complete"}!`,description:i??"You're all set."}),p.jsx(bpt,{solPrice:o,instructions:t,fees:e,transactionInfo:s,rpcEndpoint:a}),p.jsx(ah,{}),p.jsx(kpt,{loading:!1,onClick:n,children:"Close"}),p.jsx(dr,{}),p.jsx(ln,{})]});let kpt=ue(tn).withConfig({displayName:"SubmitButton",componentId:"sc-6f95cdcf-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);const $pt={component:()=>{var te,ae,oe,de,ke,Be,$e,He,Ge,je,xt,ft,it,be,Lt,Qe,Ue,Ye;let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:n,navigate:r}=jt(),{client:i,closePrivyModal:s,walletProxy:o,showFiatPrices:a}=Ht(),c=Vr(),{user:l,getAccessToken:u}=Wn(),[d,h]=E.useState((te=t==null?void 0:t.sendSolanaTransaction)==null?void 0:te.transactionRequest),[f,m]=E.useState(),[y,v]=E.useState(),[b,C]=E.useState(0),[x,_]=E.useState({value:0n,isLoading:!1}),[$,I]=E.useState(!1),[R,N]=E.useState(),[T,O]=E.useState(),U=(ae=t==null?void 0:t.sendSolanaTransaction)==null?void 0:ae.connection,z=(oe=t==null?void 0:t.sendSolanaTransaction)==null?void 0:oe.transactingWallet,L=((de=t==null?void 0:t.sendSolanaTransaction)==null?void 0:de.signOnly)??!1,S=(f==null?void 0:f.instructions.length)??1,k=z!=null&&z.imported?bb(l):$s(l),M=R_((U==null?void 0:U.rpcEndpoint)||""),{solPrice:W,isSolPriceLoa
435ding:H}=s1e({enabled:a}),D=E.useMemo(()=>{let tt,ze;if(!f)return;let Ne=f.spender;b===0&&(z==null?void 0:z.address)===Ne&&(tt=np(f.fee));let J=np(x.value,3,!0),q=f.instructions[b];if(!q)return{fee:tt,spender:Ne,balance:J};if(q.type==="unknown")return{fee:tt,spender:Ne,program:q.program,balance:J};if(q.type==="ata-creation")return{fee:tt,spender:Ne,balance:J,tokenAccountOwner:q.owner,tokenAccount:q.ata,tokenAddress:q.mint};let Z=q.fromAccount,se=q.type==="sol-transfer"?q.toAccount:q.toAccount||q.toAta,he=q.type==="spl-transfer"?q.token.address:void 0;return tt!=null&&q.token.symbol==="SOL"&&(ze=np(q.value+f.fee)),{fee:tt,spender:Ne,from:Z,to:se,tokenAddress:he,amount:`${us(q.value,q.token.decimals)} ${q.token.symbol}`.trim(),total:ze,balance:J}},[f,b,z==null?void 0:z.address,x]),V=E.useMemo(()=>{let tt,ze;if(!f||!a||!W||H)return;function Ne(...Z){return xb(Z.reduce((se,he)=>se+he,0n),W??0)}b===0&&(z==null?void 0:z.address)===f.spender&&(tt=Ne(f.fee));let J=Ne(x.value),q=f.instructions[b];return q&&q.type!=="unknown"&&q.type!=="ata-creation"?(tt!=null&&q.token.symbol==="SOL"&&(ze=Ne(q.value,f.fee)),{fee:tt,amount:q.token.symbol==="SOL"?Ne(q.value):`${us(q.value,q.token.decimals)} ${q.token.symbol}`.trim(),total:ze,balance:J}):{fee:tt,balance:J}},[f,a,W,H,z==null?void 0:z.address,b,x]),B=E.useMemo(()=>{if(L||!f||x.isLoading||b>0)return!1;let tt=f.instructions[b];if(!tt)return!1;let ze=0n;return(z==null?void 0:z.address)===f.spender&&(ze+=f.fee),"value"in tt&&(z==null?void 0:z.address)===tt.fromAccount&&tt.token.symbol==="SOL"&&(ze+=tt.value),x.value<ze},[f,x,b,L]);if(E.useEffect(()=>{(async function(){if(d&&U&&i)try{v(void 0);let tt=await gct({tx:d,connection:U,client:i});m(tt),C(0)}catch(tt){console.error("Failed to prepare transaction",tt),v(tt)}})()},[d,U,i]),E.useEffect(()=>{(async function(){if(!z||!U)return;_({value:x.value,isLoading:!0});let tt=new JMe({name:"mainnet-beta",rpcUrl:U.rpcEndpoint});_({value:await tt.getBalance(z.address).catch(()=>0n)??0n,isLoading:!1})})().catch(console.error)},[f,U]),!(d&&(t!=null&&t.sendSolanaTransaction)&&z&&U)){let tt=Error("Invalid transaction request");return p.jsx(K5,{error:tt,onClick:()=>{var ze;(ze=t==null?void 0:t.sendSolanaTransaction)==null||ze.onFailure(tt),s({shouldCallAuthOnSuccess:!1})}})}let P=()=>{var tt,ze;if(!$)return R?(tt=t==null?void 0:t.sendSolanaTransaction)==null||tt.onSuccess(R):((ze=t==null?void 0:t.sendSolanaTransaction)==null||ze.onFailure(T??y??Error("User exited the modal before submitting the transaction")),C(0)),s({shouldCallAuthOnSuccess:!1})};e.current=P;let j=(He=($e=(Be=(ke=t.sendSolanaTransaction)==null?void 0:ke.uiOptions)==null?void 0:Be.transactionInfo)==null?void 0:$e.contractInfo)!=null&&He.imgUrl?p.jsx("img",{src:t.sendSolanaTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.sendSolanaTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,G=!!(t.funding&&t.funding.supportedOptions.length>0),Y=B&&G;return R?p.jsx(Apt,{instructions:(f==null?void 0:f.instructions.reduce((tt,ze)=>(ze.type==="ata-creation"&&tt.push({tokenAccountOwner:ze.owner,tokenAccount:ze.ata}),ze.type==="spl-transfer"&&tt.push({from:ze.fromAccount,to:ze.toAccount||ze.toAta,amount:ze.value,token:ze.token}),ze.type==="sol-transfer"&&tt.push({from:ze.fromAccount,to:ze.toAccount,amount:ze.value,token:ze.token}),tt),[]))??[],fees:b===0?R.fees:0n,onClose:P,transactionInfo:(Ge=t.sendSolanaTransaction)==null?void 0:Ge.uiOptions.transactionInfo,solPrice:W,receiptHeader:(je=t.sendSolanaTransaction)==null?void 0:je.uiOptions.successHeader,receiptDescription:(xt=t.sendSolanaTransaction)==null?void 0:xt.uiOptions.successDescription,rpcEndpoint:U.rpcEndpoint,signOnly:L}):T?p.jsx(O1e,{transactionError:T,connection:U,onClose:P,network:"solana",onRetry:async()=>{O(void 0);let{blockhash:tt}=await U.getLatestBlockhash();p3(d)?d.message.recentBlockhash=tt:d.recentBlockhash=tt,h(d)}}):p.jsx(Vlt,{img:j,title:((be=(it=(ft=t.sendSolanaTransaction)==null?void 0:ft.uiOptions)==null?void 0:it.transactionInfo)==null?void 0:be.title)||"Confirm transaction",subtitle:((Qe=(Lt=t.sendSolanaTransaction)==null?void 0:Lt.uiOptions)==null?void 0:Qe.description)||`${c.name} wants your permission to approve the following transaction.`,cta:Y?"Add funds":((Ye=(Ue=t.sendSolanaTransaction)==null?void 0:Ue.uiOptions)==null?void 0:Ye.buttonText)||"Approve",transactionIndex:b,maxIndex:S-1,network:M=="mainnet-beta"?"Solana":M,blockExplorerUrl:"https://explorer.solana.com",total:a?V==null?void 0:V.total:D==null?void 0:D.total,amount:a?V==null?void 0:V.amount:D==null?void 0:D.amount,fee:a?V==null?void 0:V.fee:D==null?void 0:D.fee,balance:a?V==null?void 0:V.balance:D==null?void 0:D.balance,from:D==null?void 0:D.from,to:D==null?void 0:D.to,tokenAccount:D==null?void 0:D.tokenAccount,tokenAccountOwner:D==null?void 0:D.tokenAccountOwner,tokenAddress:D==null?void 0:D.tokenAddress,transactingWalletAddress:z.address,programAddress:D==null?void 0:D.program,disabled:B&&!G,isSubmitting:$,
435isPreparing:!f||x.isLoading,isTokenPriceLoading:a&&H,isMissingFunds:B,submitError:T??void 0,parseError:y,onClick:Y?async()=>{if(z){if(!G)throw Error("Funding wallet is not enabled");n({...t,funding:{...t.funding,methodScreen:ca}}),r(ca)}}:async()=>{var tt;if(b<((f==null?void 0:f.instructions.length)??1)-1)C(b+1);else try{I(!0);let ze=await u();if($||!ze||!z||!o||!l||!k)return;let{rootWallet:Ne}=E8(l,z.address);if(!Ne)throw Error("No root wallet for transacting wallet found");let{entropyId:J,entropyIdVerifier:q}=Gr(Ne);if(L)await Sb({tx:d,accessToken:ze,walletProxy:o,entropyId:J,entropyIdVerifier:q,transactingWalletAddress:z.address,transactingWalletIndex:z.walletIndex??0}),N(H9("",d,null));else{let{signature:Z,receipt:se}=await Tge({tx:d,accessToken:ze,connection:U,walletProxy:o,entropyId:J,entropyIdVerifier:q,transactingWalletAddress:z.address,transactingWalletIndex:z.walletIndex??0,transactionOptions:(tt=t.sendSolanaTransaction)==null?void 0:tt.transactionOptions});N(H9(Z,d,se))}}catch(ze){console.warn({transaction:d,error:ze}),O(ze)}finally{I(!1)}},onClose:P,onBack:b>0&&S>1?()=>C(b-1):void 0})}},Ipt=E.forwardRef((t,e)=>{let[n,r]=E.useState(""),[i,s]=E.useState(""),[o,a]=E.useState(!1),{authenticated:c,user:l}=Wn(),{initUpdateEmail:u}=Ht(),{navigate:d,setModalData:h,currentScreen:f}=jt(),{enabled:m,token:y}=wa(),v=Vr(),b=Zfe(n)&&(v.disablePlusEmails&&n.includes("+")?(i||s("Please enter a valid email address without a '+'."),!1):(i&&s(""),!0)),C=o||!b,x=()=>{!m||y||c?(async _=>{if(!(l!=null&&l.email))throw Error("User is required to have an email address to update it.");a(!0);try{await u(l.email.address,n,_),d(dh)}catch($){h({errorModalData:{error:$,previousScreen:f||mo}})}a(!1)})(y):(h({captchaModalData:{callback:_=>{if(!(l!=null&&l.email))throw Error("User is required to have an email address to update it.");return u(l.email.address,n,_)},userIntentRequired:!1,onSuccessNavigateTo:dh,onErrorNavigateTo:Hr}}),d(Al))};return p.jsxs(p.Fragment,{children:[p.jsxs(Tpt,{children:[i&&p.jsx(hh,{style:{marginTop:"0.25rem",textAlign:"left"},children:i}),p.jsxs(Ppt,{$error:!!i,children:[p.jsx(H1,{}),p.jsx("input",{ref:e,id:"email-input",type:"email",placeholder:"[email protected]",onChange:_=>r(_.target.value),onKeyUp:_=>{_.key==="Enter"&&x()},value:n,autoComplete:"email"}),t.stacked?null:p.jsx(q5,{isSubmitting:o,onClick:x,disabled:C,children:"Submit"})]})]}),t.stacked?p.jsx(tn,{loadingText:null,loading:o,disabled:C,onClick:x,children:"Submit"}):null]})});let Tpt=L0e,Ppt=Dat;const Rpt={component:()=>p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),p.jsx(sr,{}),p.jsx(ei,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:p.jsx(H1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),p.jsx(Q1,{children:p.jsx(Ipt,{stacked:!0})}),p.jsx(dr,{}),p.jsx(ln,{})]})},Mpt={component:()=>{let{currentScreen:t,data:e,navigate:n,setModalData:r}=jt(),{user:i}=Wn(),{initUpdatePhone:s}=Ht();return p.jsxs(p.Fragment,{children:[p.jsx(_t,{},"header"),p.jsx(sr,{}),p.jsx(ei,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:p.jsx(xl,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),p.jsx(Q1,{children:p.jsx(Y_,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:o}){var a,c,l;try{if(!((a=i==null?void 0:i.phone)!=null&&a.number))throw Error("User is required to have an phone number to update it.");await s((c=i==null?void 0:i.phone)==null?void 0:c.number,o),n(dh)}catch(u){r({errorModalData:{error:u,previousScreen:((l=e==null?void 0:e.errorModalData)==null?void 0:l.previousScreen)||t||GB}}),n(Hr)}},hideRecent:!0})}),p.jsx(dr,{}),p.jsx(ln,{})]})}};let Nd,Mge,Oge,jge,Nge,Dge,Lge,Bge;async function Nn(){return Nd?Nd.getAccessToken():Promise.resolve(cn.get(v8)||cn.get(Yv)||null)}const Opt=(t,e)=>Mge(t,e),jpt=(t,e)=>Oge(t,e),Npt=(t,e)=>jge(t,e),Dpt=(t,e)=>Nge(t,e),Lpt=()=>Dge(),Bpt=()=>Lge(),Fpt=({message:t,options:e})=>Bge({message:t,options:e}),Upt=({config:t,...e})=>{var n;if(typeof window<"u"&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&window.location.protocol!=="https:")throw new ve("Embedded wallet is only available over HTTPS");if(typeof(n=e.appId)!="string"||n.length!==25)throw new ve("Cannot initialize the Privy provider with an invali
435d Privy app ID");Nd||(Nd=new eft({appId:e.appId,appClientId:e.clientId,apiUrl:e.apiUrl}));let r=Object.assign({},t);return p.jsx(ast,{client:Nd,clientConfig:r,children:p.jsx(zct,{children:p.jsx(zpt,{...e,client:Nd})})})};let zpt=t=>{var mt,Bt,un,Ve,st;let e=t.client,n=ex();Aft();let[r,i]=E.useState(!1),[s,o]=E.useState(!1),[a,c]=E.useState(!1),[l,u]=E.useState(null),[d,h]=E.useState([]),[f,m]=E.useState([]),[y,v]=E.useState([]),[b,C]=E.useState(!1),[x,_]=E.useState(null),[$,I]=E.useState(!1),[R,N]=E.useState({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:Le}),[T,O]=E.useState({status:"initial"}),[U,z]=E.useState({status:"initial"}),[L,S]=E.useState({status:"initial"}),[k,M]=E.useState({status:"initial"}),[W,H]=E.useState({status:"initial"}),[D,V]=E.useState({status:"initial"}),[B,P]=E.useState(null),j=Vr(),G=Npe(),[Y,te]=E.useState({}),[ae,oe]=E.useState(null),[de,ke]=E.useState(null),[Be,$e]=E.useState(!1),[He,Ge]=E.useState(!1),[je,xt]=E.useState((mt=j.customAuth)!=null&&mt.enabled?{status:"initial"}:{status:"not-enabled"}),ft=E.useRef(null),it=E.useRef(null),be=E.useRef(_st),[Lt,Qe]=E.useState(!1);e.onStoreCustomerAccessToken=X=>{X&&We(be,"accessToken","onAccessTokenGranted",{accessToken:X})},e.onDeleteCustomerAccessToken=()=>{u(null),c(!1),We(be,"accessToken","onAccessTokenRemoved")};let Ue=E.useRef(null),Ye=E.useRef(null),tt=E.useRef(!1),ze=({showWalletUIs:X})=>tt.current?tt.current:X!==void 0?!X:!j.embeddedWallets.showWalletUIs,Ne=X=>{_(X),setTimeout(()=>{i(!0)},15)};E.useEffect(()=>{let X=[...x8(l),bb(l)].filter(ee=>!!ee);B&&v(X.map(ee=>({type:"solana",imported:ee.imported,address:ee.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",walletIndex:ee.walletIndex??void 0,meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund(){throw new ve("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:()=>{throw new ve("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new Sft(B,ee.address),async signMessage(ie){let ce=await Nn();if(!ce||!B)throw new ve("Must have valid access token and Privy wallet to send transaction",Ce.MUST_BE_AUTHENTICATED);let le=ee.imported?bb(l):$s(l);if(!le)throw new ve("Attempting to sign a transaction without a root wallet");let{entropyId:_e,entropyIdVerifier:me}=Gr(le);if(!await Ze.recoverPrimaryWallet().catch(()=>!1))throw new ve("Wallet couldn't be connected",Ce.UNKNOWN_CONNECT_WALLET_ERROR);if(!l)throw new ve("Attempting to sign a transaction with no user initialized");let{response:we}=await B.rpc({accessToken:ce,entropyId:_e,entropyIdVerifier:me,chainType:"solana",hdWalletIndex:ee.walletIndex??0,request:{method:"signMessage",params:{message:Buffer.from(ie).toString("base64")}}});return Buffer.from(we.data.signature,"base64")},async sendTransaction(ie,ce,le){let{signature:_e}=await rt({transaction:ie,connection:ce,transactionOptions:le,wallet:this,signOnly:!1});return _e},async signTransaction(ie){let ce=await Nn();if(!ce||!B)throw new ve("Must have valid access token and Privy wallet to send transaction",Ce.MUST_BE_AUTHENTICATED);if(!await Ze.recoverPrimaryWallet().catch(()=>!1))throw new ve("Wallet couldn't be connected",Ce.UNKNOWN_CONNECT_WALLET_ERROR);let le=ee.imported?ee:$s(l);if(!le)throw new ve("Attempting to sign a transaction without a root wallet");let{entropyId:_e,entropyIdVerifier:me}=Gr(le);return await Sb({tx:ie,accessToken:ce,walletProxy:B,entropyId:_e,entropyIdVerifier:me,transactingWalletAddress:ee.address,transactingWalletIndex:ee.walletIndex??0}),ie},async signAllTransactions(ie){let ce=await Nn();if(!ce||!B)throw new ve("Must have valid access token and Privy wallet to send transaction",Ce.MUST_BE_AUTHENTICATED);if(!await Ze.recoverPrimaryWallet().catch(()=>!1))throw new ve("Wallet couldn't be connected",Ce.UNKNOWN_CONNECT_WALLET_ERROR);let le=ee.imported?ee:$s(l);if(!le)throw new ve("Attempting to sign a transaction without a root wallet");let{entropyId:_e,entropyIdVerifier:me}=Gr(le);for(let we of ie)await Sb({tx:we,accessToken:ce,walletProxy:B,entropyId:_e,entropyIdVerifier:me,transactingWalletAddress:ee.address,transactingWalletIndex:ee.walletIndex??0});return ie},loginOrLink:async()=>{throw new ve("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{},isConnected:async()=>!0})))},[B,l]),E.useEffect(()=>{var ce,le,_e;if(!l)return void((ce=e.connectors)==null?void 0:ce.removeEmbeddedWalletConnectors());let X=co(l),ee=b8(l),ie=FO(l);X&&ee.length||((le=e.connectors)==null||le.removeEmbeddedWalletConnectors()),ie||((_e=e.connectors)==null||_e.removeImportedWalletConnector()),e.connectors?B?(X&&e.connectors.addEmbeddedWalletConnectors({w
435alletProxy:B,rootWallet:X,embeddedWallets:ee,defaultChain:j.defaultChain,appId:t.appId}),ie&&e.connectors.addImportedWalletConnector(B,ie.address,j.defaultChain,t.appId)):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")},[B,l]),E.useEffect(()=>{B&&(de==null||de(B))},[B]);let J=E.useRef();E.useEffect(()=>{(async()=>{var ie;if(!((ie=j.customAuth)!=null&&ie.enabled))return void xt({status:"not-enabled"});let{getCustomAccessToken:X,isLoading:ee}=j.customAuth;if(s&&!ee&&je.status!=="loading"){xt({status:"loading"});try{let ce=await X();if(ce===J.current)return void xt({status:"done"});if(!ce&&a)return J.current=ce,await Et.logout(),xt({status:"done"}),void We(be,"customAuth","onUnauthenticated");if(!ce)return J.current=ce,void xt({status:"done"});e.startAuthFlow(new _ge(ce));let{user:le,isNewUser:_e}=await e.authenticate();if(!le)return await Et.logout(),xt({status:"error",error:new ve("Failed to sync with custom auth provider")}),void We(be,"customAuth","onUnauthenticated");_e!==void 0&&We(be,"login","onComplete",{user:le,isNewUser:_e,wasAlreadyAuthenticated:!1,loginMethod:"custom",loginAccount:null}),J.current=ce,We(be,"customAuth","onAuthenticated",{user:le}),xt({status:"done"}),u(le||null),C(_e||!1),c(!0),Ge(!0)}catch(ce){if(console.warn(ce),await Et.logout(),We(be,"customAuth","onUnauthenticated"),ce.message==="User already exists with provided custom JWT account.")return void xt({status:"initial"});We(be,"login","onError",ce.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),xt({status:"error",error:ce})}}})()},[je.status==="initial",(Bt=j.customAuth)==null?void 0:Bt.enabled,(un=j.customAuth)==null?void 0:un.getCustomAccessToken,(Ve=j.customAuth)==null?void 0:Ve.isLoading,s,a]),E.useEffect(()=>{He&&B&&l&&(async()=>{var ce;let X=L9(l,j.embeddedWallets.ethereum.createOnLogin),ee=B9(l,j.embeddedWallets.solana.createOnLogin),ie=await Nn();if(ie){if(X&&ee){let le=await En(l,Em);return await B.createSolana({accessToken:ie,ethereumAddress:le==null?void 0:le.address}),void Ge(!1)}if(ee)return await B.createSolana({accessToken:ie,ethereumAddress:(ce=co(l))==null?void 0:ce.address}),await Ze.refreshSessionAndUser(),void Ge(!1);if(X)return await En(l,Em),void Ge(!1)}})().catch(console.error)},[He&&B&&l]),E.useEffect(()=>{if(j.externalWallets.solana.connectors)return j.externalWallets.solana.connectors.onMount(),()=>{var X;return(X=j.externalWallets.solana.connectors)==null?void 0:X.onUnmount()}},[j.externalWallets.solana.connectors]),E.useEffect(()=>{!s&&G&&async function(){var me,we,Te;let X,ee=q(),ie=Z(),ce=pse();e.initializeConnectorManager({walletConnectCloudProjectId:j.walletConnectCloudProjectId,rpcConfig:j.rpcConfig,chains:j.chains,defaultChain:j.defaultChain,store:ce,walletList:j.appearance.walletList,shouldEnforceDefaultChainOnConnect:j.shouldEnforceDefaultChainOnConnect,externalWalletConfig:j.externalWallets,appName:j.name??"Privy",walletChainType:j.appearance.walletChainType}),(me=e.connectors)==null||me.on("connectorInitialized",()=>{X&&clearTimeout(X);let Ct=e.connectors.walletConnectors.length,at=e.connectors.walletConnectors.reduce((Gt,Dt)=>Gt+(Dt.initialized?1:0),0);at===Ct?Qe(!0):X=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:at,expected:Ct}),Qe(!0)},1500)}),(we=e.connectors)==null||we.initialize().then(()=>{nt()});let le=await e.getAuthenticatedUser(),_e=!!le;j.legal.requireUsersAcceptTerms&&le&&!le.hasAcceptedTerms?(await e.logout(),Ze.setReadyToTrue(!0),We(be,"logout","onSuccess")):((Te=j.customAuth)!=null&&Te.enabled||(c(!!le),le&&We(be,"login","onComplete",{user:le,isNewUser:!1,wasAlreadyAuthenticated:!0,loginMethod:null,loginAccount:null}),u(le)),ee?Ye.current=_e?"link":"login":ie&&!_e?(Ye.current="login",te({telegramAuthModalData:{seamlessAuth:!0}}),Ne(_8)):Ze.setReadyToTrue(!!le))}()},[e,ae,s,G]),E.useEffect(()=>{if(s){if(!l||!l.linkedAccounts.find(X=>X.type==="wallet"&&X.walletClientType==="privy"))return void $e(!0);$e([...d,...y].some(X=>X.walletClientType==="privy"))}},[s,l,d,y]),E.useEffect(()=>{var X;(X=e.connectors)==null||X.setWalletList(j.appearance.walletList)},[j.appearance.walletList.join()]);let q=()=>{let X=jht();return X.inProgress&&X.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):X.authorizationCode==="error"?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:X.stateCode,authorizationCode:X.authorizationCode}):(X.inProgress&&function(ee){return ee.startsWith("privy:")}(X.provider)&&!X.popupFlow&&(new BroadcastChannel(mJ).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:X.stateCode,authorizationCode:X.authorizationCode}),window.close()),!!X.inProgress&&!!X.withPrivyUi&&(e.startAuthFlow(new Cm(X)),Ne(wpt),!0))},Z=()=>{var ie;let X=Git();if(!X||!j.loginMethods.telegram||!((ie=j.loginConfig.telegramAuthConfiguration)!=null&&ie.seamlessAuthEnabled))return;let ee=new pv;return e.startAuthFlow(ee),X.flowType==="login-url"&&(ee.meta.telegramWebAppData=void 0,ee.meta.telegramAuthResult=X.authData),X.flowType==="web-app"&&(ee.meta.telegramAuthResult=void 0,ee.meta.telegramWebAppData=X.authData),!0},se=async(X,ee,ie,ce)=>{var le,_e;if(X!=="solana_adapter")he(await((le=e.connectors)==null?void 0:le.createEthereumWalletConnector({connectorType:X,walletClientType:ee}))||null,ee,ie,ce);else{let me=(_e=e.connectors)==null?void 0:_e.findSolanaWalletConnector(ee);if(!me)return;he(me,ee,ie,ce)}};async function he(X,ee,ie,ce){if(!X)return N({status:"disconnected",connectedWallet:null,connectError:new li("Unable to connect to wallet."),connector:null,connectRetry:Le}),ce==null?void 0:ce(null,ie);N({status:"disconnected",connectedWallet:null,connectError:null,connector:X,connectRetry:Le}),X instanceof ry&&ee&&await X.resetConnection(ee),N({connector:X,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>he(X,ee,ie,ce)});try{let le=await X.connect({showPrompt:!0});if((!le||Ed(le))&&j.shouldEnforceDefaultChainOnConnect&&!j.chains.find(_e=>_e.id===Number(le==null?void 0:le.chainId.replace("eip155:","")))&&((le==null?void 0:le.connectorType)!=="wallet_connect_v2"||(le==null?void 0:le.walletClientType)!=="metamask")){N(_e=>
435({..._e,connector:X,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:Le}));try{await(le==null?void 0:le.switchChain(j.defaultChain.id)),le&&(le.chainId=w8(T9(j.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${j.defaultChain.id}`)}}return N(_e=>({..._e,status:"connected",connectedWallet:le,connectError:null,connectRetry:Le})),le&&We(be,"connectWallet","onSuccess",{wallet:le}),ce==null?void 0:ce(le,ie)}catch(le){return le instanceof fa?(console.warn(le.cause?le.cause:le.message),We(be,"connectWallet","onError",le.privyErrorCode||Ce.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(le),We(be,"connectWallet","onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR)),N(_e=>({..._e,status:"disconnected",connectedWallet:null,connectError:le})),ce==null?void 0:ce(null,ie)}}let fe=async(X,ee,ie)=>{if(X===null||!Ed(X))return;let ce=new O9(X,e,ee,ie);e.startAuthFlow(ce)},ye=async(X,ee,ie)=>{if(X===null||!YX(X))return;let ce=new BO(X,e,ee,ie);e.startAuthFlow(ce)},nt=()=>{let X=new URLSearchParams(window.location.search),ee=X.get("privy_connector"),ie=X.get("privy_wallet_client"),ce=X.get("privy_connect_only")==="true";if(!ee||!ie)return;let le=Rpe({connectorType:ee,walletClientType:ie});if(!le||!le.isInstalled)return Ne(npt);if(!e.connectors)throw new ve("Connector not initialized");Ne(ce?YO:ny);let _e=new URL(window.location.href);_e.searchParams.delete("privy_connector"),_e.searchParams.delete("privy_wallet_client"),_e.searchParams.delete("privy_connect_only"),window.history.pushState({},"",_e),se(ee,ie,void 0,ce?void 0:ee==="solana_adapter"?ye:fe)};E.useEffect(()=>{s&&a&&l===null&&e.getAuthenticatedUser().then(u)},[s,a,l,e]);let vt=X=>{if(!a)throw We(be,"linkAccount","onError",Ce.MUST_BE_AUTHENTICATED,{linkMethod:X}),new ve("User must be authenticated before linking an account.")},Nt=X=>{if(!a||!l)return!1;if(X.walletClientType==="privy")return!0;for(let ee of l.linkedAccounts)if(ee.type==="wallet"&&ee.address===X.address&&ee.walletClientType!=="privy")return!0;return!1},mn=async X=>{let ee;if(!e.connectors)throw new ve("Connector not initialized");ee=X.type==="ethereum"?e.connectors.findWalletConnector(X.connectorType,X.walletClientType)||null:e.connectors.findSolanaWalletConnector(X.walletClientType)||null,N(ie=>({...ie,connector:ee,status:"connected",connectedWallet:X,connectError:null,connectRetry:Le})),j.captchaEnabled&&!a?(te({captchaModalData:{callback:ie=>Ed(X)?fe(X,ie):ye(X,ie),userIntentRequired:!1,onSuccessNavigateTo:ny,onErrorNavigateTo:Hr}}),Ne(Al)):(Ed(X)?await fe(X):await ye(X),Ne(ny))},At=()=>{h(X=>{var ie;let ee=((ie=e.connectors)==null?void 0:ie.wallets.filter(Ed).map(ce=>({...ce,linked:Nt(ce),loginOrLink:async()=>{if(!await ce.isConnected())throw new ve("Wallet is not connected");if(ce.connectorType==="embedded"&&ce.walletClientType==="privy")throw new ve("Cannot link or login with embedded wallet");mn(ce)},fund:async le=>{await Ze.fundWallet(ce.address,le)},unlink:async()=>{if(!a)throw new ve("User is not authenticated.");if(ce.connectorType==="embedded"&&ce.walletClientType==="privy")throw new ve("Cannot unlink an embedded wallet");u(await e.unlinkEthereumWallet(ce.address))}})))||[];return UO(X,ee)?X:ee}),m(X=>{var ie;let ee=(((ie=e.connectors)==null?void 0:ie.wallets)??[]).filter(YX).map(ce=>({...ce,linked:Nt(ce),loginOrLink:async()=>{if(!await ce.isConnected())throw new ve("Wallet is not connected");if(ce.connectorType==="embedded"&&ce.walletClientType==="privy")throw new ve("Cannot link or login with embedded wallet");mn(ce)},fund:async()=>{throw new ve("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:async()=>{if(!a)throw new ve("User is not authenticated.");if(ce.connectorType==="embedded"&&ce.walletClientType==="privy")throw new ve("Cannot unlink an embedded wallet");u(await e.unlinkSolanaWallet(ce.address))}}));return UO(X,ee)?X:ee})};E.useEffect(()=>{At()},[l==null?void 0:l.linkedAccounts,a,s]),E.useEffect(()=>{if(s){if(!e.connectors)throw new ve("Connector not initialized");At(),e.connectors.on("walletsUpdated",At)}},[s]),E.useEffect(()=>{var X,ee;[...((X=j.loginMethodsAndOrder)==null?void 0:X.primary)??[],...((ee=j.loginMethodsAndOrder)==null?void 0:ee.overflow)??[]].filter(ie=>
435ie.startsWith("privy:")).forEach(ie=>e.getCrossAppProviderDetails(ie.replace("privy:","")))},[!!e]);let En=async(X,ee,ie)=>{var Te,Ct,at;let ce=co(X),le=ul(X);if(ie&&"walletIndex"in ie&&typeof ie.walletIndex=="number")return xn(X,ee,ie.walletIndex,ce,le);let _e=ie&&"createAdditional"in ie&&ie.createAdditional;if(ce&&!_e)throw We(be,"createWallet","onError",Ce.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");let[me,we]=await Promise.all([Ze.initializeWalletProxy(ee),Nn()]);if(!me&&((Te=j.customAuth)!=null&&Te.enabled))throw We(be,"createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!me||!we||(Ct=j.embeddedWallets)!=null&&Ct.requireUserOwnedRecoveryOnCreate)return yr();if(!ce)return le&&await Ze.recoverPrimaryWallet(),await me.create({accessToken:we,solanaAddress:le==null?void 0:le.address}),Ie(0,"ethereum");{let Gt=(((at=Zit(X))==null?void 0:at.walletIndex)??0)+1,{entropyId:Dt,entropyIdVerifier:zt}=Gr($s(X));return await Ze.recoverPrimaryWallet(),await me.addWallet({accessToken:we,entropyId:Dt,entropyIdVerifier:zt,chainType:"ethereum",hdWalletIndex:Gt}),Ie(Gt,"ethereum")}},yr=async()=>new Promise((X,ee)=>{te({createWallet:{onSuccess:ie=>{We(be,"createWallet","onSuccess",{wallet:ie}),X(ie)},onFailure:ie=>{We(be,"createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),ee(ie)},callAuthOnSuccessOnClose:!1}}),Ne(_h)}),xn=async(X,ee,ie,ce,le)=>{var we,Te;if(ie<0)throw We(be,"createWallet","onError",Ce.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${ie}
435) is invalid.`);let[_e,me]=await Promise.all([Ze.initializeWalletProxy(ee),Nn()]);if(!_e&&((we=j.customAuth)!=null&&we.enabled))throw We(be,"createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!_e||!me||(Te=j.embeddedWallets)!=null&&Te.requireUserOwnedRecoveryOnCreate){if(ie==0)return yr();throw We(be,"createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Create wallet UI can only be displayed when walletIndex is 0.")}if(ie==0){if(ce)return ce;await _e.create({accessToken:me,solanaAddress:le==null?void 0:le.address})}else{if(!ce)throw We(be,"createWallet","onError",Ce.EMBEDDED_WALLET_CREATE_ERROR),Error("A user must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let Ct=b8(X).find(Dt=>Dt.walletIndex===ie);if(Ct)return Ct;let{entropyId:at,entropyIdVerifier:Gt}=Gr($s(X));await Ze.recoverPrimaryWallet(),await _e.addWallet({accessToken:me,entropyId:at,entropyIdVerifier:Gt,chainType:"ethereum",hdWalletIndex:ie})}return Ie(ie,"ethereum")},kt=async({user:X,wp:ee,accessToken:ie,walletIndex:ce,ethereumWallet:le})=>{let _e=x8(X).find(me=>me.walletIndex===ce);if(_e)return _e;if(ce===0)le&&await Ze.recoverPrimaryWallet(),await ee.createSolana({accessToken:ie,ethereumAddress:le==null?void 0:le.address});else{let me=$s(X);if(!me)throw We(be,"createWallet","onError",Ce.EMBEDDED_WALLET_CREATE_ERROR),Error("User must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let{entropyId:we,entropyIdVerifier:Te}=Gr(me);await Ze.recoverPrimaryWallet(),await ee.addWallet({accessToken:ie,entropyId:we,entropyIdVerifier:Te,chainType:"solana",hdWalletIndex:ce})}return Ie(ce,"solana")},Ie=async(X,ee)=>{let ie=await Ze.refreshSessionAndUser(),ce=(ee==="ethereum"?b8(ie):x8(ie)).find(le=>le.walletIndex===X);if(!ce)throw We(be,"createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");return We(be,"createWallet","onSuccess",{wallet:ce}),ce},It=({transaction:X,uiOptions:ee,fundWalletConfig:ie,address:ce,signOnly:le})=>new Promise(async(_e,me)=>{var hr;let{requesterAppId:we}=ee||{},Te=le?"signTransaction":"sendTransaction";if(!a||!l)return We(be,Te,"onError",Ce.MUST_BE_AUTHENTICATED),void me(Error("User must be authenticated before signing with a Privy wallet"));let Ct=ce??((hr=co(l))==null?void 0:hr.address);if(!Ct)throw new ve("User must have an embedded wallet to send a transaction.");let{signingWallet:at,rootWallet:Gt}=g6(l,Ct);if(!Gt||!at)return We(be,Te,"onError",Ce.EMBEDDED_WALLET_NOT_FOUND),void me(Error("Must have a Privy wallet before signing"));let Dt=wt.wallets.find(Er=>Er.walletClientType==="privy"&&cr(Er.address)===cr(at.address)),zt=await(Dt==null?void 0:Dt.getEthereumProvider());if(!Dt||!zt)throw new ve(`Cannot sendTransaction before embedded wallet ${at.address} is connected`);let kn=X.chainId?Number(X.chainId):vge(Dt.chainId);(Er=>{if(!j.chains.map(Fn=>Fn.id).includes(Er))throw new li(`Chain ID ${Er} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,Ce.UNSUPPORTED_CHAIN_ID)})(kn);let Cn={...X,from:X.from??at.address,chainId:kn},Hn=await Nn();if(!Hn||!B)return We(be,Te,"onError",Ce.EMBEDDED_WALLET_NOT_FOUND),void me(Error("Must have valid access token and Privy wallet to send transaction"));let xr=l2(Cn.chainId,j.chains,j.rpcConfig,{appId:t.appId});if(ze({showWalletUIs:ee==null?void 0:ee.showWalletUIs}))(async()=>{try{if(!await Ze.recoverPrimaryWallet())return We(be,Te,"onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR),void me(Error("Unable to connect to wallet"));let Er=await MB(Cn,xr,Cn.from),{entropyId:Fn,entropyIdVerifier:ti}=Gr(Gt),yo=le?await XO({accessToken:Hn,entropyId:Fn,entropyIdVerifier:ti,transactingWallet:at,walletProxy:B,transactionRequest:Cn,requesterAppId:we}):await a1e({accessToken:Hn,entropyId:Fn,entropyIdVerifier:ti,transactingWallet:at,walletProxy:B,transactionRequest:Er,publicClient:xr,requesterAppId:we});le?We(be,"signTransaction","onSuccess",{signature:yo}):We(be,"sendTransaction","onSuccess",{hash:yo}),_e({hash:yo})}catch(Er){We(be,Te,"onError",Ce.TRANSACTION_FAILURE),me(Er)}})();else{let{entropyId:Er,entropyIdVerifier:Fn}=Gr(Gt),ti=bJ(j)?XX({address:at.address,appConfig:j,fundWalletConfig:ie,methodScreen:ca,chainIdOverride:Cn.chainId,comingFromSendTransactionScreen:!0}):void 0;te({connectWallet:{entropyId:Er,entropyIdVerifier:Fn,onCompleteNavigateTo:N1e,onFailure:yo=>{We(be,Te,"onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR),me(yo)}},sendTransaction:{transactionRequest:Cn,transactingWallet:at,entropyId:Er,entropyIdVerifier:Fn,signOnly:le,onConfirm:le?async()=>await XO({accessToken:Hn,entropyId:Er,entropyIdVerifier:Fn,transactingWallet:at,walletProxy:B,transactionRequest:Cn,requesterAppId:we}):void 0,onSuccess:yo=>{le?We(be,"signTransaction","onSuccess",{signature:yo.hash}):We(be,"sendTransaction","onSuccess",{hash:yo.hash}),_e(yo)},onFailure:yo=>{We(be,Te,"onError",Ce.TRANSACTION_FAILURE),me(yo)},uiOptions:ee||{},fundWalletConfig:ie,requesterAppId:we},funding:ti}),Ne(sf)}}),rt=({transaction:X,connection:ee,transactionOptions:ie,fundWalletConfig:ce,uiOptions:le,wallet:_e,signOnly:me})=>new Promise(async(we,Te)=>{let{requesterAppId:Ct}=le||{},at=me?"signSolanaTransaction":"sendSolanaTransaction";if(!a||!l)return We(be,at,"onError",Ce.MUST_BE_AUTHENTICATED),void Te(new ve("User must be authenticated before signing with a Privy wallet",Ce.MUST_BE_AUTHENTICATED));let Gt=_e?l.linkedAccounts.find(zt=>zt.type==="wallet"&&zt.address===_e.address):ul(l);
435if(!Gt)return We(be,at,"onError",Ce.EMBEDDED_WALLET_NOT_FOUND),void Te(new ve("Must have a Privy wallet before signing",Ce.EMBEDDED_WALLET_NOT_FOUND));let{rootWallet:Dt}=E8(l,Gt.address);if(!await Ze.recoverPrimaryWallet().catch(()=>!1)||!Dt)throw We(be,at,"onError",Ce.EMBEDDED_WALLET_NOT_FOUND),new ve(`Cannot sendSolanaTransaction before embedded wallet ${Gt.address} is connected`,Ce.EMBEDDED_WALLET_NOT_FOUND);if(ze({showWalletUIs:le==null?void 0:le.showWalletUIs}))(async()=>{let zt=await Nn();if(!zt||!B)return We(be,at,"onError",Ce.EMBEDDED_WALLET_NOT_FOUND),void Te(new ve("Must have valid access token and Privy wallet to send transaction",Ce.EMBEDDED_WALLET_NOT_FOUND));try{let kn;if(!await Ze.recoverPrimaryWallet())return We(be,at,"onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR),void Te(new ve("Unable to connect to wallet",Ce.UNKNOWN_CONNECT_WALLET_ERROR));if(ze({showWalletUIs:le==null?void 0:le.showWalletUIs})&&!me)try{if(!await pct(X,ee))return We(be,at,"onError",Ce.INSUFFICIENT_BALANCE),void Te(new ve("Solana wallet has insufficient funds for this transaction.",Ce.INSUFFICIENT_BALANCE))}catch(xr){return console.error(xr),We(be,at,"onError",Ce.TRANSACTION_FAILURE),void Te(new ve(xr instanceof Error?xr.message:"Transaction failed.",Ce.TRANSACTION_FAILURE))}let{entropyId:Cn,entropyIdVerifier:Hn}=OQ(l);if(me)await Sb({accessToken:zt,tx:X,walletProxy:B,entropyId:Cn,entropyIdVerifier:Hn,transactingWalletAddress:Gt.address,transactingWalletIndex:Gt.walletIndex??0}),kn=H9("",X,null),We(be,"signSolanaTransaction","onSuccess",{signedTransaction:X});else{let{signature:xr,receipt:hr}=await Tge({accessToken:zt,tx:X,connection:ee,walletProxy:B,transactionOptions:ie,entropyId:Cn,entropyIdVerifier:Hn,transactingWalletAddress:Gt.address,transactingWalletIndex:Gt.walletIndex??0});kn=H9(xr,X,hr),We(be,"sendSolanaTransaction","onSuccess",{response:kn})}we(kn)}catch(kn){We(be,at,"onError",Ce.TRANSACTION_FAILURE),Te(kn)}})();else{let{entropyId:zt,entropyIdVerifier:kn}=Gr(Dt),Cn=bJ(j)?Qdt({address:Gt.address,appConfig:j,methodScreen:ca,fundWalletConfig:ce,comingFromSendTransactionScreen:!0}):void 0;te({connectWallet:{entropyId:zt,entropyIdVerifier:kn,onCompleteNavigateTo:$pt,onFailure:Hn=>{We(be,at,"onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR),Te(Hn)}},sendSolanaTransaction:{transactionRequest:X,connection:ee,transactionOptions:ie,transactingWallet:Gt,onSuccess:Hn=>{me?We(be,"signSolanaTransaction","onSuccess",{signedTransaction:Hn.signedTransaction}):We(be,"sendSolanaTransaction","onSuccess",{response:Hn}),we(Hn)},onFailure:Hn=>{We(be,at,"onError",Ce.TRANSACTION_FAILURE),Te(Hn)},uiOptions:le||{},requesterAppId:Ct,signOnly:me},funding:Cn}),Ne(sf)}});function Zt(){return new Promise(async(X,ee)=>{let ie=await Nn();if(!ie||!B)throw Error("Must have valid access token to enroll in MFA");try{await B.verifyMfa({accessToken:ie}),X()}catch(ce){ee(ce)}})}let yt=X=>X==null?void 0:X.linkedAccounts.filter(ee=>ee.latestVerifiedAt!==null&&!(ee.type==="wallet"&&ee.walletClientType==="privy")).sort((ee,ie)=>ie.latestVerifiedAt.getTime()-ee.latestVerifiedAt.getTime())[0],pt=X=>{let ee=(l==null?void 0:l.linkedAccounts.filter(le=>le.type===X).length)??0,{displayName:ie,loginMethod:ce}=L_(X);if(X==="passkey"&&ee>=5||X!=="passkey"&&ee>=1)throw We(be,"linkAccount","onError",Ce.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:ce}),new ve(`User already has an account of type ${ie} linked.`)};async function St({showAutomaticRecovery:X=!1,legacySetWalletPasswordFlow:ee=!1}){_(null);let ie=ee?"setWalletPassword":"setWalletRecovery";if(!a||!l)throw We(be,ie,"onError",Ce.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let ce=$s(l);if(!ce||!B)throw We(be,ie,"onError",Ce.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");try{await Zt()}catch(le){throw We(be,ie,"onError",Ce.MISSING_MFA_CREDENTIALS),le}return new Promise((le,_e)=>{let me={onSuccess:Gt=>{We(be,ie,"onSuccess",{method:"user-passcode",wallet:Gt}),le(Gt)},onFailure:Gt=>{We(be,ie,"onError",Ce.USER_EXITED_SET_PASSWORD_FLOW),_e(Gt)},callAuthOnSuccessOnClose:!1},we=ce.recoveryMethod==="user-passcode",Te=E0e({walletAction:"update",availableRecoveryMethods:j.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:ee,isResettingPassword:we,showAutomaticRecovery:X}),{entropyId:Ct,entropyIdVerifier:at}=Gr(ce);te({setWalletPassword:me,recoverWallet:{entropyId:Ct,entropyIdVerifier:at,onFailure:_e},createWallet:me,connectWallet:{onCompleteNavigateTo:Te,shouldForceMFA:!1,entropyId:Ct,entropyIdVerifier:at,onFailure:Gt=>{We(be,ie,"onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR),_e(Gt)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:we}}),Ne(sf)})}async function qe({appId:X,action:ee}){let ie=await Nn();if(ee==="link"&&!ie)throw We(be,"linkAccount","onError",Ce.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${X}`}),new ve("User must be authenticated before linking an account.");if(ee==="login"&&ie)throw We(be,"login","onError",Ce.UNKNOWN_AUTH_ERROR),new ve("Attempted to log in, but user is already logged in. Use a `link` helper instead.");Ue.current=`privy:${X}`,Ye.current=ee;let ce=X_();return e.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:X}}),new Promise(async(le,_e)=>{let{name:me,logoUrl:we}=await Pge({api:e.api,providerAppId:X,requesterAppId:j.id});te({crossAppAuth:{appId:X,name:me,logoUrl:we,action:ee,popup:ce,onSuccess:le,onError:_e}}),Ne(Wft)})}let Et={ready:s,authenticated:a,user:l,walletConnectors:e.connectors||null,connectWallet:X=>
435{X&&"target"in X&&X&&(X=void 0),te({externalConnectWallet:{walletList:X!=null&&X.walletList&&(X==null?void 0:X.walletList.length)>0?X.walletList:void 0,suggestedAddress:X==null?void 0:X.suggestedAddress,walletChainType:X==null?void 0:X.walletChainType}}),Ne(a?zft:H0e)},linkWallet:X=>{X&&"target"in X&&X&&(X=void 0),vt("siwe"),Ue.current="siwe",Ye.current="link",te({...Y,externalConnectWallet:{...Y.externalConnectWallet,suggestedAddress:X==null?void 0:X.suggestedAddress,walletList:X==null?void 0:X.walletList,walletChainType:X==null?void 0:X.walletChainType}}),Ne(ept)},startCrossAppAuthFlow:qe,linkEmail:()=>{vt("email"),pt("email"),Ue.current="email",Ye.current="link",Ne(Jft)},linkPhone:()=>{vt("sms"),pt("phone"),Ue.current="sms",Ye.current="link",Ne(GB)},linkGoogle:async()=>{vt("google"),pt("google_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("google")},linkTwitter:async()=>{vt("twitter"),pt("twitter_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("twitter")},linkDiscord:async()=>{vt("discord"),pt("discord_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("discord")},linkGithub:async()=>{vt("github"),pt("github_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("github")},linkSpotify:async()=>{vt("spotify"),pt("spotify_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("spotify")},linkInstagram:async()=>{vt("instagram"),pt("instagram_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("instagram")},linkTiktok:async()=>{vt("tiktok"),pt("tiktok_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{vt("linkedin"),pt("linkedin_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("linkedin")},linkApple:async()=>{vt("apple"),pt("apple_oauth"),Ye.current="link",await Ze.initLoginWithOAuth("apple")},linkPasskey:async()=>{vt("passkey"),pt("passkey"),await Ze.initLinkWithPasskey(),Ne(Tft)},linkTelegram:async X=>{if(vt("telegram"),pt("telegram"),Ye.current="link",Ue.current="telegram",X==null?void 0:X.launchParams)if(X.launchParams.initDataRaw){let ee=new pv;e.startAuthFlow(ee),ee.meta.telegramAuthResult=void 0,ee.meta.telegramWebAppData=ppe(X.launchParams.initDataRaw),te({telegramAuthModalData:{seamlessAuth:!0}}),Ne(_8)}else We(be,"linkAccount","onError",Ce.INVALID_DATA,{linkMethod:"telegram"});else await Ze.initLoginWithTelegram();Ne(_8)},linkFarcaster:async()=>{vt("farcaster"),pt("farcaster"),await Ze.initLoginWithFarcaster(),Ye.current="link",Ue.current="farcaster",Ne(ZO)},updateEmail:()=>{if(vt("email"),!(l!=null&&l.email))throw new ve("User does not have an email linked to their account.");Ye.current="update",Ue.current="email",Ne(Rpt)},updatePhone:()=>{if(vt("sms"),!(l!=null&&l.phone))throw new ve("User does not have a phone number linked to their account.");Ye.current="update",Ue.current="sms",Ne(Mpt)},login:async X=>{X&&"target"in X&&X&&(X=void 0);let ee="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!s){let ie=await new Promise(ce=>{oe(le=>ce.bind(le))});if(oe(null),ie)return void console.warn(ee)}!l||l.isGuest?(Ye.current="login",te({login:X}),Ne(mo)):console.warn(ee)},connectOrCreateWallet:async()=>{s||(await new Promise(X=>{oe(()=>X)}),oe(null)),a?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(Ye.current="login",Ne(N0e))},logout:async()=>{if(Ye.current=null,Ue.current=null,l&&e.clearProviderAcccessTokens(l),_(null),await e.logout(),l&&B)try{await B.clearMfa({userId:l.id})}catch{}u(null),c(!1),We(be,"logout","onSuccess"),i(!1),cn.del(jO),cn.del(tpe(j.id))},getAccessToken:E.useCallback(()=>e.getCustomerAccessToken(),[e]),unlinkWallet:async X=>{let ee;return u(ee=X.startsWith("0x")?await e.unlinkEthereumWallet(X):await e.unlinkSolanaWallet(X)),ee},unlinkEmail:async X=>{let ee=await e.unlinkEmail(X);return u(ee),ee},unlinkPhone:async X=>{let ee=await e.unlinkPhone(X);return u(ee),ee},unlinkGoogle:async X=>{let ee=await e.unlinkOAuth("google",X);return u(ee),ee},unlinkTwitter:async X=>{let ee=await e.unlinkOAuth("twitter",X);return u(ee),ee},unlinkDiscord:async X=>{let ee=await e.unlinkOAuth("discord",X);return u(ee),ee},unlinkGithub:async X=>{let ee=await e.unlinkOAuth("github",X);return u(ee),ee},unlinkSpotify:async X=>{let ee=await e.unlinkOAuth("spotify",X);return u(ee),ee},unlinkInstagram:async X=>{let ee=await e.unlinkOAuth("instagram",X);return u(ee),ee},unlinkTiktok:async X=>{let ee=await e.unlinkOAuth("tiktok",X);return u(ee),ee},unlinkLinkedIn:async X=>{let ee=await e.unlinkOAuth("linkedin",X);return u(ee),ee},unlinkApple:async X=>{let ee=await e.unlinkOAuth("apple",X);return u(ee),ee},unlinkFarcaster:async X=>{let ee=await e.unlinkFarcaster(X);return u(ee),ee},unlinkTelegram:async X=>{let ee=await e.unlinkTelegram(X);return u(ee),ee},unlinkPasskey:async X=>{let ee=await Nn();
435if(!ee)throw Error("Must have valid access token to enroll in MFA");if(!B)throw Error("Wallet proxy not initialized.");let ie=j.passkeys.shouldUnenrollMfaOnUnlink;await B.unlinkPasskeyAccount({credentialId:X,accessToken:ee,removeAsMfa:ie});let ce=await e.getAuthenticatedUser();return u(ce),ce},unlinkCrossAppAccount:async({subject:X})=>{var ce;let ee=(ce=l==null?void 0:l.linkedAccounts.find(le=>le.type==="cross_app"&&le.subject===X))==null?void 0:ce.providerApp;if(!ee)throw new ve("Invalid subject");e.storeProviderAccessToken(ee.id,null);let ie=await e.unlinkOAuth(`privy:${ee.id}`,X);return u(ie),ie},createWallet:async X=>{X&&"target"in X&&X&&(X=void 0);let ee=await Ze.refreshSessionAndUser();if(!ee)throw We(be,"createWallet","onError",Ce.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return En(ee,15e3,X)},setWalletRecovery:async X=>St({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:(X==null?void 0:X.showAutomaticRecovery)??!1}),setWalletPassword:async()=>St({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(X,ee)=>new Promise(async(ie,ce)=>{var at,Gt;let{requesterAppId:le}=(ee==null?void 0:ee.uiOptions)||{},_e=X.message;if(!a||!l)return We(be,"signMessage","onError",Ce.MUST_BE_AUTHENTICATED),void ce(Error("User must be authenticated before signing with a Privy wallet"));let me=(ee==null?void 0:ee.address)??((at=co(l))==null?void 0:at.address);if(!me)throw new ve("User must have an embedded wallet to sign a message.");let{signingWallet:we,rootWallet:Te}=g6(l,me);if(!we||!Te)return We(be,"signMessage","onError",Ce.EMBEDDED_WALLET_NOT_FOUND),void ce(Error("Must have a Privy wallet before signing"));if(typeof _e!="string"||_e.length<1)return We(be,"signMessage","onError",Ce.INVALID_MESSAGE),void ce(Error("Message must be a non-empty string"));let Ct=async()=>{if(!a)throw Error("User must be authenticated before signing with a Privy wallet");let Dt=await Nn();if(!B||!Dt||!await Ze.recoverPrimaryWallet())throw Error("Unable to connect to wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:we.address,requesterAppId:le}});let{entropyId:zt,entropyIdVerifier:kn}=Gr(Te),{response:Cn}=await B.rpc({accessToken:Dt,entropyId:zt,entropyIdVerifier:kn,chainType:"ethereum",hdWalletIndex:we.walletIndex??0,requesterAppId:le,request:{method:"personal_sign",params:[_e,we.address]}}),Hn=Cn.data;return e.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:we.address,requesterAppId:le}}),Hn};if(ze({showWalletUIs:(Gt=ee==null?void 0:ee.uiOptions)==null?void 0:Gt.showWalletUIs}))try{let Dt=await Ct();We(be,"signMessage","onSuccess",{signature:Dt}),ie({signature:Dt})}catch(Dt){We(be,"signMessage","onError",Ce.UNABLE_TO_SIGN),ce(Dt??new Vd("Unable to sign message"))}else{let Dt={method:"personal_sign",data:_e,confirmAndSign:Ct,onSuccess:Cn=>{We(be,"signMessage","onSuccess",{signature:Cn}),ie({signature:Cn})},onFailure:Cn=>{We(be,"signMessage","onError",Ce.UNABLE_TO_SIGN),ce(Cn)},uiOptions:(ee==null?void 0:ee.uiOptions)||{}},{entropyId:zt,entropyIdVerifier:kn}=Gr(Te);te({signMessage:Dt,connectWallet:{entropyId:zt,entropyIdVerifier:kn,onCompleteNavigateTo:vT,onFailure:Cn=>{We(be,"signMessage","onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR),ce(Cn)}}}),Ne(sf)}}),signTypedData:(X,ee)=>new Promise(async(ie,ce)=>{var at,Gt;let{requesterAppId:le}=(ee==null?void 0:ee.uiOptions)||{};if(!a||!l)return We(be,"signTypedData","onError",Ce.MUST_BE_AUTHENTICATED),void ce(Error("User must be authenticated before signing with a Privy wallet"));let _e=(ee==null?void 0:ee.address)??((at=co(l))==null?void 0:at.address);if(!_e)throw new ve("User must have an embedded wallet to sign a message.");let{signingWallet:me,rootWallet:we}=g6(l,_e);if(!we||!me)return We(be,"signTypedData","onError",Ce.EMBEDDED_WALLET_NOT_FOUND),void ce(Error("Must have a Privy wallet before signing"));let Te=RO(X),Ct=async()=>{if(!a)throw Error("User must be authenticated before signing with a Privy wallet");let Dt=await Nn();if(!B||!Dt||!await Ze.recoverPrimaryWallet())throw Error("Unable to connect to wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:me.address,requesterAppId:le}});
435let{entropyId:zt,entropyIdVerifier:kn}=Gr(we),{response:Cn}=await B.rpc({accessToken:Dt,entropyId:zt,entropyIdVerifier:kn,chainType:"ethereum",hdWalletIndex:me.walletIndex??0,requesterAppId:le,request:{method:"eth_signTypedData_v4",params:[me.address,Te]}}),Hn=Cn.data;return e.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:me.address,requesterAppId:le}}),Hn};if(ze({showWalletUIs:(Gt=ee==null?void 0:ee.uiOptions)==null?void 0:Gt.showWalletUIs}))try{let Dt=await Ct();We(be,"signTypedData","onSuccess",{signature:Dt}),ie({signature:Dt})}catch(Dt){We(be,"signTypedData","onError",Ce.UNABLE_TO_SIGN),ce(Dt??new Vd("Unable to sign message"))}else{let Dt={method:"eth_signTypedData_v4",data:Te,confirmAndSign:Ct,onSuccess:Cn=>{We(be,"signTypedData","onSuccess",{signature:Cn}),ie({signature:Cn})},onFailure:Cn=>{We(be,"signTypedData","onError",Ce.UNABLE_TO_SIGN),ce(Cn)},uiOptions:(ee==null?void 0:ee.uiOptions)||{}},{entropyId:zt,entropyIdVerifier:kn}=Gr(we);te({signMessage:Dt,connectWallet:{entropyId:zt,entropyIdVerifier:kn,onCompleteNavigateTo:vT,onFailure:Cn=>{We(be,"signMessage","onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR),ce(Cn)}}}),Ne(sf)}}),sendTransaction:async(X,ee)=>await It({transaction:X,uiOptions:ee==null?void 0:ee.uiOptions,fundWalletConfig:ee==null?void 0:ee.fundWalletConfig,address:ee==null?void 0:ee.address,signOnly:!1}),signTransaction:async(X,ee)=>({signature:(await It({transaction:X,uiOptions:ee==null?void 0:ee.uiOptions,address:ee==null?void 0:ee.address,signOnly:!0})).hash}),exportWallet:X=>new Promise(async(ee,ie)=>{var Te;if(!a||!l)return void ie(Error("User must be authenticated before exporting their Privy wallet"));X&&"target"in X&&X&&(X=void 0);let ce=(X==null?void 0:X.address)??((Te=co(l))==null?void 0:Te.address);if(!ce)return void ie(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));if(!Wr(ce))return void ie(Error("Must provide a valid Ethereum address."));let{signingWallet:le,rootWallet:_e}=g6(l,ce);if(!le||!_e)return void ie(Error("Must have a Privy wallet before exporting"));let{entropyId:me,entropyIdVerifier:we}=Gr(_e);te(Y),await Nn()&&B?B?(te({keyExport:{appId:t.appId,appClientId:t.clientId,origin:e.apiUrl,walletToExport:le,primaryWallet:_e,onSuccess:ee,onFailure:ie},connectWallet:{entropyId:me,entropyIdVerifier:we,onCompleteNavigateTo:fj,onFailure:ie,shouldForceMFA:!0}}),Ne(sf)):ie(Error("Must have a Privy wallet before exporting")):ie(Error("Must have valid access token to enroll in MFA"))}),promptMfa:Zt,async init(X){switch(X){case"sms":return void await e.initMfaSmsVerification();case"passkey":return await e.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${X}`)}},async submit(X,ee){var ie,ce,le;switch(X){case"totp":case"sms":if(typeof ee!="string")throw new ve("Invalid MFA code");(ie=ft.current)==null||ie.resolve({mfaMethod:X,mfaCode:ee,relyingParty:window.origin}),await new Promise((we,Te)=>{it.current={resolve:we,reject:Te}});break;case"passkey":if(typeof ee=="string")throw new ve("Invalid authenticator response");let _e=await mr(()=>import("./index-Bjltdz_y.js"),[]),me=(we=>({id:we.id,raw_id:we.rawId,response:{client_data_json:we.response.clientDataJSON,authenticator_data:we.response.authenticatorData,signature:we.response.signature,user_handle:we.response.userHandle},authenticator_attachment:we.authenticatorAttachment,client_extension_results:{app_id:we.clientExtensionResults.appid,cred_props:we.clientExtensionResults.credProps,hmac_create_secret:we.clientExtensionResults.hmacCreateSecret},type:we.type}))(await _e.startAuthentication(ee));(ce=ft.current)==null||ce.resolve({mfaMethod:X,mfaCode:me,relyingParty:window.origin}),await new Promise((we,Te)=>{it.current={resolve:we,reject:Te}});break;default:throw(le=ft.current)==null||le.reject(new ve("Unsupported MFA method")),new ve(`Unsupported MFA method: ${X}`)}},cancel(){var X;(X=ft.current)==null||X.reject(new ve("MFA canceled"))},async initEnrollmentWithSms(X){let ee=await Nn();
435if(!ee||!B)throw Error("Must have valid access token to enroll in MFA");await B.initEnrollMfa({method:"sms",accessToken:ee,phoneNumber:X.phoneNumber})},enrollInMfa:X=>new Promise((ee,ie)=>{if(!X)return Ze.closePrivyModal(),void ee();j.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),te({mfaEnrollmentFlow:{mfaMethods:j.mfa.methods,shouldUnlinkOnUnenrollMfa:j.passkeys.shouldUnlinkOnUnenrollMfa,onSuccess:ee,onFailure:ie}}),Ne(ypt)}),async initEnrollmentWithTotp(){let X=await Nn();if(!X||!B)throw Error("Must have valid access token to enroll in MFA");let ee=await B.initEnrollMfa({method:"totp",accessToken:X});return{secret:ee.secret,authUrl:ee.authUrl}},async submitEnrollmentWithSms(X){let ee=await Nn();if(!ee||!B)throw Error("Must have valid access token to enroll in MFA");await B.submitEnrollMfa({method:"sms",accessToken:ee,phoneNumber:X.phoneNumber,code:X.mfaCode}),u(await e.getAuthenticatedUser())},async submitEnrollmentWithTotp(X){let ee=await Nn();if(!ee||!B)throw Error("Must have valid access token to enroll in MFA");await B.submitEnrollMfa({method:"totp",accessToken:ee,code:X.mfaCode}),u(await e.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:X},ee={}){let ie=await Nn();if(!ie||!B)throw Error("Must have valid access token to enroll in MFA");await B.submitEnrollMfa({method:"passkey",accessToken:ie,credentialIds:X,removeForLogin:ee.removeForLogin}),u(await e.getAuthenticatedUser())},async unenroll(X,ee={}){let ie=await Nn();if(!ie||!B)throw Error("Must have valid access token to remove MFA");X==="passkey"?await B.submitEnrollMfa({method:"passkey",accessToken:ie,credentialIds:[],removeForLogin:ee.removeForLogin}):await B.unenrollMfa({method:X,accessToken:ie}),u(await e.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{var ce;let X=await Nn(),ee=l==null?void 0:l.linkedAccounts.find(le=>le.type==="wallet"&&le.walletClientType==="privy");if(!X)throw Error("Must have valid access token to connect with Farcaster");if(!B||!ee)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((ce=l==null?void 0:l.farcaster)!=null&&ce.fid))throw Error("Must have Farcaster account to use Farcaster signers");if(!await Ze.recoverPrimaryWallet())throw Error("Unable to connect to wallet");let ie=await B.initFarcasterSigner({address:ee.address,hdWalletIndex:null,accessToken:X,mfaCode:null,mfaMethod:null,relyingParty:window.origin});ie.status==="approved"&&u(await e.getAuthenticatedUser()||l||null),te({farcasterSigner:ie}),Ne(Yft)},getFarcasterSignerPublicKey:async()=>{var ce,le;let X,ee=await Nn(),ie=l==null?void 0:l.linkedAccounts.find(_e=>_e.type==="wallet"&&_e.walletClientType==="privy");if(!ee)throw Error("Must have valid access token to connect with Farcaster");if(!B||!ie)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((ce=l==null?void 0:l.farcaster)!=null&&ce.fid))throw Error("Must have Farcaster account to use Farcaster signers");if(!await Ze.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!((le=l.farcaster)!=null&&le.signerPublicKey))throw Error("Must have a Farcaster signer public key to sign");return X=l.farcaster.signerPublicKey.slice(2),Uint8Array.from(X.match(/.{1,2}/g).map(_e=>parseInt(_e,16)))},signFarcasterMessage:async X=>{var _e,me;let ee=await Nn(),ie=l==null?void 0:l.linkedAccounts.find(we=>we.type==="wallet"&&we.walletClientType==="privy");if(!ee)throw Error("Must have valid access token to connect with Farcaster");if(!B||!ie)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((_e=l==null?void 0:l.farcaster)!=null&&_e.fid))throw Error("Must have Farcaster account to use Farcaster signers");if(!await Ze.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!((me=l.farcaster)!=null&&me.signerPublicKey))throw Error("Must have a Farcaster signer public key to sign");let ce=await mr(()=>import("./index-Bjltdz_y.js"),[]),le=await B.signFarcasterMessage({address:ie.address,hdWalletIndex:null,accessToken:ee,mfaCode:null,mfaMethod:null,payload:{hash:ce.bufferToBase64URLString(X)},fid:BigInt(l.farcaster.fid),relyingParty:window.origin});return new Uint8Array(ce.base64URLStringToBuffer(le.signature))},createGuestAccount:async()=>
435{if(l&&!l.isGuest)throw Error("User cannot already be authenticated to create a guest account");return l!=null&&l.isGuest?l:Ze.loginWithGuestAccountFlow()},signMessageWithCrossAppWallet(X,{address:ee,chainId:ie}){let ce=l==null?void 0:l.linkedAccounts.some(le=>le.type==="cross_app"&&le.smartWallets.some(_e=>_e.address===ee));return $T({user:l,client:e,address:ee,requesterAppId:j.id,request:{method:ce?"privy_signSmartWalletMessage":"personal_sign",params:[X,ee],chainId:ie},reconnect:qe})},signTypedDataWithCrossAppWallet(X,{address:ee,chainId:ie}){let ce=l==null?void 0:l.linkedAccounts.some(_e=>_e.type==="cross_app"&&_e.smartWallets.some(me=>me.address===ee)),le=RO(X);return $T({user:l,client:e,address:ee,requesterAppId:j.id,request:{method:ce?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[ee,le],chainId:ie},reconnect:qe})},sendTransactionWithCrossAppWallet(X,{address:ee}){let ie=l==null?void 0:l.linkedAccounts.some(ce=>ce.type==="cross_app"&&ce.smartWallets.some(le=>le.address===ee));return $T({user:l,client:e,address:ee,requesterAppId:j.id,request:{method:ie?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[X],chainId:X.chainId},reconnect:qe})},isModalOpen:r,mfaMethods:j.mfa.methods};Mge=Et.signMessage,Oge=Et.signTypedData,Nge=async(X,ee)=>await It({transaction:X,...ee,signOnly:!1}),jge=async(X,ee)=>({signature:(await It({transaction:X,...ee,signOnly:!0})).hash});let Ze={setAuthenticated:c,setUser:u,isNewUserThisSession:b,pendingTransaction:null,walletConnectionStatus:R,connectors:((st=e.connectors)==null?void 0:st.walletConnectors)??[],solanaWallets:f,rpcConfig:j.rpcConfig,chains:j.chains,appId:t.appId,showFiatPrices:j.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:e.clientAnalyticsId,customAuthStatus:je,hideWalletUIs:tt,isHeadlessSigning:E.useCallback(ze,[j.embeddedWallets.showWalletUIs]),emailOtpState:U,setEmailOtpState:z,smsOtpState:L,setSmsOtpState:S,oAuthState:W,setOAuthState:H,telegramAuthState:D,setTelegramAuthState:V,siweState:k,setSiweState:M,isHeadlessOAuthLoading:$,nativeTokenSymbolForChainId:X=>{var ee;return(ee=j.chains.find(ie=>ie.id===Number(X)))==null?void 0:ee.nativeCurrency.symbol},initializeWalletProxy:async X=>{if(B)return B;let ee=new Promise(le=>{ke(()=>_e=>le(_e))}),ie=new Promise(le=>setTimeout(()=>le(null),X)),ce=await Promise.race([ee,ie]);return ke(null),ce},getAuthFlow:()=>e.authFlow,getAuthMeta:()=>{var X;return(X=e.authFlow)==null?void 0:X.meta},client:e,closePrivyModal:async(X={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let ee,ie=s&&a&&l;ie&&Ue.current&&(ee=yt(l)),Ye.current==="login"?X.shouldCallAuthOnSuccess&&ie&&Ue.current?We(be,"login","onComplete",{user:l,isNewUser:b,wasAlreadyAuthenticated:!1,loginMethod:Ue.current,loginAccount:ee??null}):We(be,"login","onError",Ce.USER_EXITED_AUTH_FLOW):Ye.current==="link"&&ee?X.isSuccess&&ie&&Ue.current?We(be,"linkAccount","onSuccess",{user:l,linkMethod:Ue.current,linkedAccount:ee}):Ue.current&&We(be,"linkAccount","onError",Ce.USER_EXITED_LINK_FLOW,{linkMethod:Ue.current}):Ye.current==="update"&&ee&&(X.isSuccess&&ie&&Ue.current?We(be,"update","onSuccess",{user:l,updateMethod:Ue.current,updatedAccount:ee}):Ue.current&&We(be,"update","onError",Ce.USER_EXITED_UPDATE_FLOW,{linkMethod:Ue.current}));let ce=x&&IT.has(x),le=x===Hr&&Y.errorModalData&&IT.has(Y.errorModalData.previousScreen);if((ce||le)&&Y.funding){let _e,me=IT.get(x)??null;if(Y.funding.chainType==="solana"){let we=n(tx);if(we)try{_e=BigInt(await we.getBalance({address:Y.funding.address,cluster:Y.funding.cluster}))}catch{console.error("Unable to pull wallet balance")}else console.warn("Unable to load solana plugin, skipping balance");We(be,"fundSolanaWallet","onUserExited",{address:Y.funding.address,cluster:Y.funding.cluster,fundingMethod:me,balance:_e})}else{let we=l2(Y.funding.chain.id,j.chains,j.rpcConfig,{appId:t.appId});try{_e=await we.getBalance({address:Y.funding.address})}catch{console.error("Unable to pull wallet balance")}We(be,"fundWallet","onUserExited",{address:Y.funding.address,chain:Y.funding.chain,fundingMethod:me,balance:_e})}}te({...Y,externalConnectWallet:{suggestedAddress:void 0}}),Ye.current=null,Ue.current=null,C(!1),i(!1),setTimeout(()=>{e.authFlow=void 0},200)},solanaSignMessage:({message:X,options:ee})=>new Promise(async(ie,ce)=>{var Te,Ct;
435if(!a||!l)return We(be,"signSolanaMessage","onError",Ce.MUST_BE_AUTHENTICATED),void ce(Error("User must be authenticated before signing with a Privy wallet"));let le=(ee==null?void 0:ee.address)??((Te=ul(l))==null?void 0:Te.address);if(!le)throw new ve("User must have an embedded wallet to sign a message.");let{signingWallet:_e,rootWallet:me}=E8(l,le);if(!_e||!me)return We(be,"signSolanaMessage","onError",Ce.EMBEDDED_WALLET_NOT_FOUND),void ce(Error("Must have a Privy wallet before signing"));if(typeof X!="string"||X.length<1)return We(be,"signMessage","onError",Ce.INVALID_MESSAGE),void ce(Error("Message must be a non-empty string"));let we=async()=>{if(!a)throw Error("User must be authenticated before signing with a Privy wallet");let at=await e.getAccessToken();if(!at)throw Error("User must be authenticated to use their embedded wallet.");let Gt=Ze.walletProxy??await Ze.initializeWalletProxy(15e3);if(!Gt)throw Error("Failed to initialize embedded wallet proxy.");if(!await Ze.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!me)throw Error("No root wallet for signing wallet found");let{entropyId:Dt,entropyIdVerifier:zt}=OQ(l),{response:kn}=await Gt.rpc({accessToken:at,entropyId:Dt,entropyIdVerifier:zt,chainType:"solana",hdWalletIndex:_e.walletIndex??0,request:{method:"signMessage",params:{message:X}}});return kn.data.signature};if(ze({showWalletUIs:(Ct=ee==null?void 0:ee.uiOptions)==null?void 0:Ct.showWalletUIs}))try{let at=await we();We(be,"signSolanaMessage","onSuccess",{signature:new Uint8Array(Buffer.from(at,"base64"))}),ie({signature:at})}catch(at){ce(at)}else{let at={method:"solana_signMessage",data:X,confirmAndSign:we,onSuccess:zt=>
435{We(be,"signSolanaMessage","onSuccess",{signature:new Uint8Array(Buffer.from(zt,"base64"))}),ie({signature:zt})},onFailure:zt=>{ce(zt)},uiOptions:ee==null?void 0:ee.uiOptions},{entropyId:Gt,entropyIdVerifier:Dt}=Gr(me);te({signMessage:at,connectWallet:{entropyId:Gt,entropyIdVerifier:Dt,onCompleteNavigateTo:vT,onFailure:zt=>{We(be,"signSolanaMessage","onError",Ce.UNKNOWN_CONNECT_WALLET_ERROR),ce(zt)}}}),Ne(sf)}}),signSolanaTransaction:async({transaction:X,connection:ee,uiOptions:ie,transactionOptions:ce,address:le})=>{let _e=le?y.find(we=>we.address===le):y.slice().sort((we,Te)=>(we.walletIndex??0)-(Te.walletIndex??0))[0];if(!_e)throw We(be,"signSolanaTransaction","onError",Ce.EMBEDDED_WALLET_NOT_FOUND),new ve("Embedded wallet not found",Ce.EMBEDDED_WALLET_NOT_FOUND);let{signedTransaction:me}=await rt({transaction:X,connection:ee,transactionOptions:ce,uiOptions:ie,wallet:_e,signOnly:!0});return me},sendSolanaTransaction:async({transaction:X,connection:ee,uiOptions:ie,transactionOptions:ce,fundWalletConfig:le,address:_e})=>{let me=_e?y.find(we=>we.address===_e):y.slice().sort((we,Te)=>(we.walletIndex??0)-(Te.walletIndex??0))[0];if(!me)throw We(be,"sendSolanaTransaction","onError",Ce.EMBEDDED_WALLET_NOT_FOUND),new ve("Embedded wallet not found",Ce.EMBEDDED_WALLET_NOT_FOUND);return await rt({transaction:X,connection:ee,transactionOptions:ce,uiOptions:ie,fundWalletConfig:le,wallet:me,signOnly:!1})},openPrivyModal:Ne,connectWallet:he,initLoginWithWallet:async(X,ee,ie)=>{Ed(X)?(Ue.current="siwe",fe(X,ee,ie)):(Ue.current="siws",ye(X,ee,ie))},loginWithWallet:async()=>{let X,ee,ie;if(!s)throw new qp;if(e.authFlow instanceof O9?X="siwe":e.authFlow instanceof BO&&(X="siws"),!X)throw new ve("Must initialize SIWE/SIWS flow first.");if(await e.getAccessToken()!==null)try{({user:ee}=await e.link()),Ue.current=X}catch(ce){throw We(be,"linkAccount","onError",ce.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:X}),ce}else try{({user:ee,isNewUser:ie}=await e.authenticate()),Ue.current=X}catch(ce){throw We(be,"login","onError",ce.privyErrorCode||Ce.GENERIC_CONNECT_WALLET_ERROR),ce}u(ee||l||null),C(ie||!1),c(!0)},delegateWallet:async({address:X,chainType:ee,showDelegationUIs:ie})=>new Promise(async(ce,le)=>{let _e=await Nn();if(!a||!l||!_e)throw new ve("User must be authenticated and have an embedded wallet to delegate actions.");if(ee!=="solana"&&ee!=="ethereum")throw new ve("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let me=Ze.walletProxy??await Ze.initializeWalletProxy(15e3);if(!me)throw new ve("Wallet proxy not initialized.");if((({address:at,chainType:Gt,user:Dt})=>!!gJ(Dt).find(zt=>zt.address===at&&zt.chainType===Gt))({address:X,chainType:ee,user:l}))return ce();let we=(({address:at,user:Gt})=>{let Dt=Gt.linkedAccounts.find(zt=>zt.type==="wallet"&&zt.walletClientType==="privy"&&zt.address===at);if(!Dt)throw new ve("Address to delegate is not associated with current user.");return{address:Dt.address,chainType:Dt.chainType,walletIndex:Dt.walletIndex??0}})({address:X,user:l}),Te=(({address:at,user:Gt})=>{let Dt=Gt.linkedAccounts.find(kn=>kn.type==="wallet"&&kn.walletClientType==="privy"&&kn.address===at);if(!Dt)throw new ve("Address to delegate is not associated with current user.");let zt=Dt.imported?Dt:$s(Gt);if(!zt)throw new ve("Unable to determine root address for delegated address.");return{address:zt.address,chainType:zt.chainType,imported:zt.imported}})({address:X,user:l}),Ct=async()=>{await me.createDelegatedAction({accessToken:_e,rootWallet:Te,delegatedWallets:[we]}),await Ze.refreshSessionAndUser()};if(await Ze.recoverPrimaryWallet(),ie)te({delegatedActions:{consent:{address:X,onDelegate:Ct,onSuccess:async()=>{ce()},onError:async at=>{le(at)}}}}),Ne(Vft);else try{await Ct(),ce()}catch(at){le(at)}}),revokeDelegatedWallets:async({showDelegationUIs:X})=>new Promise(async(ee,ie)=>{if(!a||!l)throw new ve("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");
435if(gJ(l).length===0)throw new ve("User has no delegated wallets to revoke.");let ce=async()=>{await e.revokeDelegatedWallet(),await Ze.refreshSessionAndUser()};if(X)te({delegatedActions:{revoke:{onRevoke:ce,onSuccess:async()=>{ee()},onError:async le=>{ie(le)}}}}),Ne(Gft);else try{await ce(),ee()}catch(le){ie(le)}}),initLoginWithFarcaster:async(X,ee)=>{let ie=new iJ(X,ee);e.startAuthFlow(ie);try{Ue.current="farcaster",await ie.initializeFarcasterConnect()}catch(ce){throw Ye.current==="login"?We(be,"login","onError",ce.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR):Ye.current==="link"&&We(be,"linkAccount","onError",ce.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),ce}},loginWithFarcaster:async()=>{let X,ee;if(!s)throw new qp;if(!(e.authFlow instanceof iJ))throw new ve("Must initialize Farcaster flow first.");if(await e.getAccessToken()!==null)try{({user:X}=await e.link()),Ue.current="farcaster"}catch(ie){throw We(be,"linkAccount","onError",ie.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),ie}else try{({user:X,isNewUser:ee}=await e.authenticate()),Ue.current="farcaster"}catch(ie){throw We(be,"login","onError",ie.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),ie}u(X||null),C(ee||!1),c(!0)},async loginWithGuestAccountFlow(){var ee;let X=new Sge(this.appId);e.startAuthFlow(X);try{Ye.current="login",Ue.current="guest";let{user:ie,isNewUser:ce}=await e.authenticate();if(ce=ce||!1,!ie)throw new ve("Unable to authenticate guest account");let le=await Nn(),_e=await Ze.initializeWalletProxy(Em);if(le&&_e)try{let me=L9(ie,j.embeddedWallets.ethereum.createOnLogin),we=B9(ie,j.embeddedWallets.solana.createOnLogin);if(me&&we){let Te=await En(ie,Em);await _e.createSolana({accessToken:le,ethereumAddress:Te==null?void 0:Te.address}),ie=await Ze.refreshSessionAndUser()}else we?(await _e.createSolana({accessToken:le,ethereumAddress:(ee=co(ie))==null?void 0:ee.address}),ie=await Ze.refreshSessionAndUser()):me?(await En(ie,Em),ie=await Ze.refreshSessionAndUser()):u(ie)}catch{u(ie),console.warn("Unable to create embedded wallet for guest account")}return C(ce),c(!0),We(be,"login","onComplete",{user:ie,isNewUser:ce,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),ie}catch(ie){throw We(be,"login","onError",ie.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),ie}},async crossAppAuthFlow({appId:X,popup:ee,action:ie}){let ce=`privy:${X}`;Ue.current=ce;let{url:le,stateCode:_e,codeVerifier:me}=await async function({api:we,appId:Te}){let Ct=S_(),at=uB(),Gt=await dB(Ct);try{let{url:Dt}=await we.post(qoe,{provider:`privy:${Te}`,redirect_to:window.location.href,code_challenge:Gt,state_code:at});return{url:Dt,stateCode:at,codeVerifier:Ct}}catch(Dt){throw Gn(Dt)}}({api:e.api,appId:X});if(!le)throw e.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:X}}),new ve("No authorization URL returned for cross-app auth.");try{let we=await async function({url:Dt,popup:zt}){return zt.location=Dt,new Promise((kn,Cn)=>{let Hn,xr=setTimeout(()=>{Cn(new ve("Authorization request timed out after 2 minutes.")),hr()},12e4);function hr(){zt==null||zt.close(),window.removeEventListener("message",Fn)}let Er=setInterval(()=>{zt!=null&&zt.closed&&!Hn&&(hr(),clearInterval(Er),clearTimeout(xr),Cn(new ve("User rejected request")))},300);function Fn(ti){ti.data&&(ti.data.type==="PRIVY_OAUTH_RESPONSE"&&ti.data.stateCode&&ti.data.authorizationCode&&(clearTimeout(xr),kn(ti.data),hr()),ti.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(xr),Cn(new ve(ti.data.error)),hr()),ti.data.type===yJ&&((Hn=new BroadcastChannel(mJ)).onmessage=Fn))}window.addEventListener("message",Fn)})}({url:le,popup:ee,provider:ce}),Te=we.stateCode,Ct=we.authorizationCode;if(Te!==_e)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:ce,storedStateCode:_e??"",returnedStateCode:Te??""}}),new ve("Unexpected auth flow. This may be a phishing attempt.",void 0,Ce.OAUTH_UNEXPECTED);let at=await async function({appId:Dt,stateCode:zt,codeVerifier:kn,authorizationCode:Cn,action:Hn,client:xr}){var hr;if(!Cn||!zt)throw new ve("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(Cn==="undefined")throw new ve("User denied confirmation during cross-app auth flow");try{let Er=new kft({authorizationCode:Cn,stateCode:zt,codeVerifier:kn,provider:`privy:${Dt}`});xr.startAuthFlow(Er);let Fn=Hn==="link"?await xr.link():await xr.authenticate(),ti=(hr=Fn.oAuthTokens)==null?void 0:hr.accessToken;return console.debug(),ti}catch(Er){let Fn=Gn(Er);throw Fn.privyErrorCode?new ve(Fn.message||"Invalid code during cross-app auth flow.",void 0,Fn.privyErrorCode):Fn.message==="User denied confirmation during cross-app auth flow"?new ve("Invalid code during cross-app auth flow.",void 0,Ce.OAUTH_USER_DENIED):new ve("Invalid code during cross-app auth flow.",void 0,Ce.UNKNOWN_AUTH_ERROR)}}({appId:X,codeVerifier:me,stateCode:Te,authorizationCode:Ct,action:ie,client:e});at&&e.storeProviderAccessToken(X,at);let Gt=await Ze.refreshSessionAndUser();if(!Gt)throw new ve("Unable to update user");return e.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:X}}),Gt}catch(we){throw e.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:we.toString(),provider:ce}}),we}},async initLoginWithOAuth(X,ee,ie){if(Ue.current=X,!TO()||X==="google"&&HO(window.navigator.userAgent))return void Ne(_J);X==="twitter"&&window.opener&&window.opener.postMessage({type:yJ},"*"),cn.del(R9),cn.del(M9);let ce=new Cm({provider:X,disableSignup:!!ie,withPrivyUi:!0});ee&&ce.addCaptchaToken(ee),e.startAuthFlow(ce);let le=await e.authFlow.getAuthorizationUrl();le&&le.url&&(X==="twitter"&&di.isAndroid&&(le.url=le.url.replace("x.com","twitter.com")),window.location.assign(le.url))},async initLoginWithTelegram(X,ee){if(!s)throw new qp;Ue.current="telegram";let ie=new pv(X,ee);e.startAuthFlow(ie),V({status:"loading"}),ie.meta.telegramWebAppData=void 0,ie.meta.telegramAuthResult=await new Promise((ce,le)=>j.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:j.loginConfig.telegramAuthConfiguration.botId,request_access:!0},_e=>_e?ce(_e):le(new ve("Telegram auth failed or was canceled by the client"))):le(new ve("Telegram was not initialized")):le(new ve("Telegram Auth configuration is not loaded")))},async loginWithTelegram(X){var me;let ee,ie;if(!(e.authFlow instanceof pv))throw new ve("Must initialize Telegram flow before calling loginWithTelegram");(me=e.authFlow.meta).captchaToken||(me.captchaToken=X==null?void 0:X.captchaToken);let ce=await Nn(),le=(X==null?void 0:X.intent)||Ye.current;if(le==="login")try{let we=await e.authenticate();ee=we.user,ie=we.isNewUser,Ue.current="telegram"}catch(we){throw We(be,"login","onError",we.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),we}else{if(le!=="link")throw new ve("Unknown auth intent");try{ee=(await e.link()).user,Ue.current="telegram"}catch(we){throw We(be,"linkAccount","onError",we.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),we}}u(ee),C(ie||!1),c(!0),V({status:"done"});let _e=(ee==null?void 0:ee.linkedAccounts.find(({type:we})=>we==="telegram"))||null;return{user:ee,isNewUser:ie||!1,wasAlreadyAuthenticated:!!ce,loginAccount:_e}},async recoveryOAuthFlow(X,ee,ie){var me,we;let ce,le;function _e(Te){if(!Te)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:X}}),new ve("Recovery OAuth failed")}switch(X){case"google-drive":{let Te,Ct,{url:at,codeVerifier:Gt,stateCode:Dt}=await qQ({api:Nd.api,provider:X});_e(at);try{let zt=await xJ({url:at,popup:ie,provider:X});if(Te=zt.stateCode,Ct=zt.authorizationCode,Te!==Dt)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:X,storedStateCode:Dt??"",returnedStateCode:Te??""}}),new ve("Unexpected auth flow. This may be a phishing attempt.",void 0,Ce.OAUTH_UNEXPECTED)}catch(zt){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:zt.toString(),provider:X}}),new ve("Recovery OAuth failed")}[ce,le]=await Promise.all([Nn(),Fot({api:Nd.api,provider:X,codeVerifier:Gt,stateCode:Te,authorizationCode:Ct})]);break}case"icloud":{let{url:Te}=await qQ({api:Nd.api,provider:X});_e(Te);let{ckWebAuthToken:Ct}=await xJ({url:Te,popup:ie,provider:X});le=Ct,ce=await Nn()}}if(!B)throw new ve("Cannot connect to wallet proxy");if(!ce)throw new ve("Unable to authorize user");
435switch(ee){case"recover":{let Te=(me=Y.recoverWallet)==null?void 0:me.entropyId,Ct=(we=Y.recoverWallet)==null?void 0:we.entropyIdVerifier;if(!Te||!Ct)throw new ve("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:Te,recoveryMethod:X}}),await B.recover({accessToken:ce,entropyId:Te,entropyIdVerifier:Ct,recoveryAccessToken:le}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:Te,recoveryMethod:X}});break}case"create-wallet":{e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await B.create({accessToken:ce,recoveryAccessToken:le,recoveryMethod:X});let Te=co(await Ze.refreshSessionAndUser());if(!Te)throw We(be,"createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:Te.address}}),We(be,"createWallet","onSuccess",{wallet:Te});break}case"set-recovery":{let Te=$s(l);if(!Te)throw We(be,"setWalletRecovery","onError",Ce.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:Te.address,existingRecoveryMethod:Te.recoveryMethod,targetRecoveryMethod:X}});let{entropyId:Ct,entropyIdVerifier:at}=Gr(Te);await B.setRecovery({accessToken:ce,entropyId:Ct,entropyIdVerifier:at,recoveryMethod:X,recoveryAccessToken:le});let Gt=$s(await Ze.refreshSessionAndUser());if(!Gt)throw We(be,"createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:Te.address,existingRecoveryMethod:Te.recoveryMethod,targetRecoveryMethod:X}}),We(be,"setWalletRecovery","onSuccess",{method:X,wallet:Gt});break}default:throw new ve("Unsupported recovery action")}},async loginWithOAuth(X){let ee,ie,ce;if(!(e.authFlow instanceof Cm))throw new ve("Must initialize OAuth flow before calling loginWithOAuth");let le=cn.get(P9),_e=e.authFlow.meta.stateCode;if(le!==_e)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:X,storedStateCode:le??"",returnedStateCode:_e??""}}),new ve("Unexpected auth flow. This may be a phishing attempt.",void 0,Ce.OAUTH_UNEXPECTED);if(await e.getAccessToken()!==null)try{let me=await e.link();ee=me.user,ce=me.oAuthTokens,Ue.current=X}catch(me){throw We(be,"linkAccount","onError",me.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:X}),me}else try{let me=await e.authenticate();ee=me.user,ie=me.isNewUser,ce=me.oAuthTokens,Ue.current=X}catch(me){throw Ye.current==="login"?We(be,"login","onError",me.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR):Ye.current==="link"&&We(be,"linkAccount","onError",me.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:X}),me}return u(ee),C(ie||!1),c(!0),ce&&ee&&We(be,"oAuthAuthorization","onOAuthTokenGrant",{oAuthTokens:ce,user:ee}),ce},passkeyAuthState:T,setPasskeyAuthState:O,async initSignupWithPasskey({captchaToken:X,withPrivyUi:ee}){let ie=new dm({captchaToken:X,setPasskeyAuthState:O});e.startAuthFlow(ie),Ye.current="login";try{Ue.current="passkey",O({status:"generating-challenge"}),await ie.initRegisterFlow(ee),O({status:"awaiting-passkey"})}catch(ce){throw O({status:"error",error:ce}),We(be,"login","onError",ce.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),ce}},async signupWithPasskey(){let X,ee;if(!s)throw new qp;if(!(e.authFlow instanceof dm))throw new ve("Must initialize Passkey flow first.");if(Ue.current!=="passkey"){let le=new ve("Must init login with Passkey flow first.");throw O({status:"error",error:le}),le}let ie=await Nn();try{Ue.current="passkey",O({status:"awaiting-passkey"}),{user:X,isNewUser:ee}=await e.authenticate()}catch(le){throw O({status:"error",error:le}),We(be,"login","onError",le.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),le}u(X),C(ee||!1),c(!0),O({status:"done"});let ce=(X==null?void 0:X.linkedAccounts.find(({type:le})=>le==="passkey"))||null;return{user:X,isNewUser:ee||!1,wasAlreadyAuthenticated:!!ie,loginAccount:ce}},async initLoginWithPasskey({captchaToken:X,withPrivyUi:ee}){let ie=new dm({captchaToken:X,setPasskeyAuthState:O});e.startAuthFlow(ie),Ye.current="login";try{Ue.current="passkey",O({status:"generating-challenge"}),await ie.initAuthenticationFlow(ee),O({status:"awaiting-passkey"})}catch(ce){throw O({status:"error",error:ce}),We(be,"login","onError",ce.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),ce}},async loginWithPasskey(X){let ee,ie;if(!s)throw new qp;if(!(e.authFlow instanceof dm))throw new ve("Must initialize Passkey flow first.");if(X!=null&&X.credentialIds&&(e.authFlow.meta.allowedCredentialsIds=X.credentialIds),Ue.current!=="passkey"){let _e=new ve("Must init login
435with Passkey flow first.");throw O({status:"error",error:_e}),_e}let ce=await Nn();try{Ue.current="passkey",O({status:"awaiting-passkey"}),{user:ee,isNewUser:ie}=await e.authenticate()}catch(_e){throw O({status:"error",error:_e}),We(be,"login","onError",_e.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),_e}u(ee),C(ie||!1),c(!0),O({status:"done"});let le=(ee==null?void 0:ee.linkedAccounts.find(({type:_e})=>_e==="passkey"))||null;return{user:ee,isNewUser:ie||!1,wasAlreadyAuthenticated:!!ce,loginAccount:le}},async initLinkWithPasskey(X){let ee=new dm({captchaToken:X});e.startAuthFlow(ee),Ye.current="link",Ue.current="passkey",O({status:"generating-challenge"});try{await ee.initLinkFlow(),O({status:"awaiting-passkey"})}catch(ie){throw We(be,"linkAccount","onError",ie.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),O({status:"error",error:ie}),ie}},async linkWithPasskey(){let X;if(!s)throw new qp;if(!(e.authFlow instanceof dm))throw new ve("Must initialize Passkey flow first.");if(Ue.current!=="passkey")throw new ve("Must init login with Passkey flow first.");try{Ue.current="passkey",{user:X}=await e.link()}catch(ee){throw We(be,"linkAccount","onError",ee.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),ee}return u(X||l||null),O({status:"done"}),X},async initLoginWithHeadlessOAuth(X,ee,ie){if(!TO()||X==="google"&&HO(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let ce=new Cm({provider:X,withPrivyUi:!1,disableSignup:ie??!1});ee&&ce.addCaptchaToken(ee),H({status:"loading"});let le=await e.startAuthFlow(ce).getAuthorizationUrl();le!=null&&le.url&&window.location.assign(le.url)},async loginWithHeadlessOAuth(X){let ee,ie,ce;I(!0),H({status:"loading"}),e.startAuthFlow(new Cm(X));let le=cn.get(P9),_e=X.stateCode;if(le!==_e)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:X.provider,storedStateCode:le??"",returnedStateCode:_e??""}}),I(!1),new ve("Unexpected auth flow. This may be a phishing attempt.",void 0,Ce.OAUTH_UNEXPECTED);if(await e.getAccessToken()!==null)try{({user:ee,oAuthTokens:ce}=await e.link()),Ue.current=X.provider;let me=yt(ee);ee&&me&&We(be,"linkAccount","onSuccess",{user:ee,linkMethod:Ue.current,linkedAccount:me})}catch(me){throw I(!1),We(be,"linkAccount","onError",me.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:X.provider}),me}else try{({user:ee,isNewUser:ie,oAuthTokens:ce}=await e.authenticate()),Ue.current=X.provider;let me=yt(ee);ee&&me&&ie!==void 0&&We(be,"login","onComplete",{user:ee,isNewUser:ie,wasAlreadyAuthenticated:!1,loginMethod:Ue.current,loginAccount:me})}catch(me){throw I(!1),H({status:"error",error:me}),We(be,"login","onError",me.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),me}return u(ee),C(ie||!1),c(!0),I(!1),H({status:"done"}),ce&&ee&&We(be,"oAuthAuthorization","onOAuthTokenGrant",{oAuthTokens:ce,user:ee}),ee??void 0},initLoginWithEmail:async({email:X,captchaToken:ee,disableSignup:ie,withPrivyUi:ce})=>{let le=new jm({email:X,captchaToken:ee,disableSignup:ie});e.startAuthFlow(le);try{Ue.current="email",z({status:"sending-code"}),await le.sendCodeEmail({withPrivyUi:ce}),z({status:"awaiting-code-input"})}catch(_e){throw z({status:"error",error:_e}),Ye.current==="login"?We(be,"login","onError",_e.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR):Ye.current==="link"&&We(be,"linkAccount","onError",_e.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),_e}},initUpdateEmail:async(X,ee,ie)=>{let ce=new Mht(X,ee,ie);e.startAuthFlow(ce);try{await ce.sendCodeEmail({withPrivyUi:!0})}catch(le){We(be,"update","onError",le.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR,{linkMethod:Ue.current})}},initUpdatePhone:async(X,ee,ie)=>{let ce=new Nht(X,ee,ie);e.startAuthFlow(ce);try{await ce.sendSmsCode({withPrivyUi:!0})}catch(le){We(be,"update","onError",le.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR,{linkMethod:Ue.current})}},initLoginWithSms:async({phoneNumber:X,captchaToken:ee,disableSignup:ie,withPrivyUi:ce})=>{S({status:"sending-code"});let le=new Nm({phoneNumber:X,captchaToken:ee,disableSignup:ie});e.startAuthFlow(le);try{Ue.current="sms",await le.sendSmsCode({withPrivyUi:ce}),S({status:"awaiting-code-input"})}catch(_e){throw S({status:"error",error:_e}),Ye.current==="login"?We(be,"login","onError",_e.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR):Ye.current==="link"&&We(be,"linkAccount","onError",_e.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),_e}},resendEmailCode:async()=>{var X;await((X=e.authFlow)==null?void 0:X.sendCodeEmail({withPrivyUi:!0}))},resendSmsCode:async()=>{var X;await((X=e.authFlow)==null?void 0:X.sendSmsCode({withPrivyUi:!0}))},loginWithCode:async X=>{let ee,ie;function ce(we){e.authFlow instanceof jm?z(we):e.authFlow instanceof Nm&&S(we)}if(ce({status:"submitting-code"}),!s){let we=new qp;throw ce({status:"error",error:we}),we}if(e.authFlow instanceof jm)e.authFlow.meta.emailCode=X.trim();else{if(!(e.authFlow instanceof Nm)){let we=new ve("Must initialize a passwordless code flow first");throw ce({status:"error",error:we}),we}e.authFlow.meta.smsCode=X.trim()}let le=await Nn();if(Ye.current==="link")try{({user:ee}=await e.link())}catch(we){throw ce({status:"error",error:we}),We(be,"linkAccount","onError",we.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:Ue.current}),we}else if(Ye.current==="update")try{({user:ee}=await e.link())}catch(we){throw ce({status:"error",error:we}),We(be,"update","onError",we.privyErrorCode||Ce.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:Ue.current}),we}else try{({user:ee,isNewUser:ie}=await e.authenticate())}catch(we){throw ce({status:"error",error:we}),We(be,"login","onError",we.privyErrorCode||Ce.UNKNOWN_AUTH_ERROR),we}let _e=ee||l;u(_e||null),C(ie||!1),c(!0),ce({status:"done"});let me=null;return e.authFlow instanceof jm?me=(_e==null?void 0:_e.linkedAccounts.find(({type:we})=>we==="email"))||null:e.authFlow instanceof Nm&&(me=(_e==null?void 0:_e.linkedAccounts.find(({type:we})=>we==="phone"))||null),{user:_e,isNewUser:ie||!1,wasAlreadyAuthenticated:!!le,linkedAccount:me}},generateSiweMessage:async({address:X,chainId:ee,captchaToken:ie})=>{Ye.current="link",Ue.current="siwe",M({status:"generating-message"});let ce=await e.generateSiweNonce({address:X,captchaToken:ie});return M({status:"awaiting-signature"}),LO({address:X,chainId:ee.replace("eip155:",""),nonce:ce})},generateSiweMessageForSmartWallet:async({address:X,chainId:ee})=>{let ie=await e.generateSiweNonce({address:X});return LO({address:X,chainId:ee.replace("eip155:",""),nonce:ie})},linkSmartWallet:async({message:X,signature:ee,smartWalletType:ie})=>{let ce;ce=await e.linkSmartWallet({message:X,signature:ee,smartWalletType:ie}
435),u((ce=await Ze.refreshSessionAndUser()??ce)||l||null)},linkWithSiwe:async({message:X,signature:ee,chainId:ie,walletClientType:ce,connectorType:le})=>{let _e;vt("siwe");let me=null;try{M({status:"submitting-signature"}),_e=await e.linkWithSiwe({message:X,signature:ee,chainId:ie,walletClientType:ce,connectorType:le}),_e=await Ze.refreshSessionAndUser()??_e,M({status:"done"}),(me=yt(_e)||null)&&We(be,"linkAccount","onSuccess",{user:_e,linkMethod:"siwe",linkedAccount:me})}catch(Te){throw We(be,"linkAccount","onError",Te.privyErrorCode||Ce.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Ye.current=null,Ue.current=null,M({status:"error",error:Te}),Te}let we=_e||l;return u(we||null),Ye.current=null,Ue.current=null,{user:we,linkedAccount:me}},refreshSessionAndUser:async()=>{let X=await e.getAuthenticatedUser();return c(!!X),u(X),X},walletProxy:B,createAnalyticsEvent:({eventName:X,payload:ee,timestamp:ie})=>e.createAnalyticsEvent({eventName:X,payload:ee,timestamp:ie}),acceptTerms:async()=>{let X=await e.acceptTerms();return u(X),X},getUsdTokenPrice:X=>e.getUsdTokenPrice(X),getUsdPriceForSol:()=>e.getUsdPriceForSol(),getSplTokenMetadata:X=>e.getSplTokenMetadata(X),recoverPrimaryWallet:async X=>new Promise(async(ee,ie)=>{let ce=$s((X==null?void 0:X.user)??l)||FO((X==null?void 0:X.user)??l)||bb((X==null?void 0:X.user)??l);ce||ee(!0);let le=await Nn();if(!le||!B||!ce)return void ie(Error("Must have valid access token and Privy wallet to recover wallet"));let{entropyId:_e,entropyIdVerifier:me}=Gr(ce);try{await B.connect({accessToken:le,entropyId:_e,entropyIdVerifier:me}),ee(!0)}catch(we){F9(we)&&ce.recoveryMethod==="privy"?(e.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:ce.address}}),(await B.recover({entropyId:_e,entropyIdVerifier:me,accessToken:le})).entropyId||ie(Error("Unable to recover wallet")),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:ce.address}}),ee(!0)):F9(we)&&ce.recoveryMethod!=="privy"?(te({recoverWallet:{entropyId:_e,entropyIdVerifier:me,onFailure:ie,onSuccess:()=>ee(!0)},recoveryOAuthStatus:{provider:ce.recoveryMethod,action:"recover"}}),Ne(C0e(ce.recoveryMethod))):ie(we)}}),embeddedSolanaWallets:y,createEmbeddedSolanaWallet:async X=>{X&&"target"in X&&(X=void 0);let ee=await Ze.refreshSessionAndUser();if(!ee)throw We(be,"createWallet","onError",Ce.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return(async(ie,ce,le)=>{var Dt;let _e=co(ie),me=ul(ie),we=le&&"createAdditional"in le&&le.createAdditional,Te=le&&"walletIndex"in le?le.walletIndex:void 0,Ct=(((Dt=Yit(ie))==null?void 0:Dt.walletIndex)??-1)+1;if(me&&!we&&typeof Te!="number")throw We(be,"createWallet","onError",Ce.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");if(typeof Te=="number"&&Te<0)throw We(be,"createWallet","onError",Ce.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${Te}
435) is invalid.`);let[at,Gt]=await Promise.all([Ze.initializeWalletProxy(ce),Nn()]);if(!at||!Gt)throw We(be,"createWallet","onError",Ce.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return await kt({user:ie,wp:at,accessToken:Gt,walletIndex:Te??Ct,ethereumWallet:_e})})(ee,15e3,X)},exportSolanaWallet:X=>new Promise(async(ee,ie)=>{var Ct;if(!a||!l)return void ie(Error("User must be authenticated before exporting their Privy wallet"));let ce=(X==null?void 0:X.address)??((Ct=ul(l))==null?void 0:Ct.address);if(!ce)return void ie(Error("User does not have an HD Solana wallet."));let{signingWallet:le,rootWallet:_e}=E8(l,ce);if(!le||!_e)return void ie(Error("Must have a Privy wallet before exporting"));if(!await Nn()||!B)return void ie(Error("Must have valid access token to enroll in MFA"));if(!B)return void ie(Error("Must have a Privy wallet before exporting"));let{entropyId:me,entropyIdVerifier:we}=Gr(_e),Te={appId:t.appId,appClientId:t.clientId,origin:e.apiUrl,walletToExport:le,primaryWallet:_e,onSuccess:ee,onFailure:ie};te({connectWallet:{entropyId:me,entropyIdVerifier:we,onCompleteNavigateTo:fj,onFailure:ie,shouldForceMFA:!0},keyExport:Te}),Ne(sf)}),setReadyToTrue:X=>{o(!0),ae==null||ae(X)},updateWallets:()=>At(),fundWallet:async(X,ee)=>{te({funding:XX({address:X,appConfig:j,fundWalletConfig:ee,methodScreen:ca})}),Ne(ca)},openModal:Ne,requestFarcasterSignerStatus:async X=>{var le;let ee=await Nn(),ie=l==null?void 0:l.linkedAccounts.find(_e=>_e.type==="wallet"&&_e.walletClientType==="privy");if(!ee)throw Error("Must have valid access token to connect with Farcaster");if(!B||!ie)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((le=l==null?void 0:l.farcaster)!=null&&le.fid))throw Error("Must have Farcaster account to use Farcaster signers");let ce=await e.requestFarcasterSignerStatus(X);return ce.status==="approved"&&u(await e.getAuthenticatedUser()||l||null),ce},connectCoinbaseSmartWallet:async()=>{var ee,ie;j.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let X=((ee=e.connectors)==null?void 0:ee.findWalletConnector("coinbase_wallet","coinbase_smart_wallet"))||((ie=e.connectors)==null?void 0:ie.findWalletConnector("coinbase_wallet","coinbase_wallet"));if(X)return X.updateConnectionPreference("smartWalletOnly"),he(X);await se("coinbase_wallet","coinbase_smart_wallet")},initiateAccountTransfer:async({nonce:X,account:ee,accountType:ie,externalWalletMetadata:ce,telegramAuthResult:le,telegramWebAppData:_e,farcasterEmbeddedAddress:me,oAuthUserInfo:we})=>{let Te=await e.sendAccountTransferRequest({nonce:X,account:ee,accountType:ie,externalWalletMetadata:ce,telegramAuthResult:le,telegramWebAppData:_e,farcasterEmbeddedAddress:me,oAuthUserInfo:we});return u(Te),Te}};Dge=Ze.recoverPrimaryWallet,Lge=Ze.recoverPrimaryWallet,Bge=Ze.solanaSignMessage;let wt=E.useMemo(()=>({wallets:d,ready:Be&&Lt}),[d,Be,Lt]),ot=e.authFlow instanceof pv,qt=!j.headless&&j.captchaEnabled&&!a&&(s||ot);return p.jsx(Cp.Provider,{value:Et,children:p.jsx(Wpe.Provider,{value:be,children:p.jsx(o1e.Provider,{value:wt,children:p.jsx(Kit,{...j,children:p.jsxs(Yoe.Provider,{value:Ze,children:[p.jsx(Sst,{children:p.jsxs(act,{data:Y,setModalData:te,setInitialScreen:_,initialScreen:x,authenticated:a,open:r,children:[t.children,qt&&p.jsx(nft,{delayedExecution:!1}),p.jsx(dft,{theme:{...j.appearance.palette||{}}}),!j.render.standalone&&p.jsx(vft,{open:r})]})}),p.jsx(_ft,{appId:t.appId,appClientId:t.clientId,clientAnalyticsId:e.clientAnalyticsId,origin:e.apiUrl,mfaMethods:l==null?void 0:l.mfaMethods,mfaPromise:ft,mfaSubmitPromise:it,onLoad:P,onLoadFailed:()=>null}),j.loginConfig.telegramAuthConfiguration&&p.jsx(k1,{$if:!0,children:p.jsx(xft,{scriptHost:t.apiUrl||OO,botUsername:j.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};const Wpt=()=>{let{getAccessToken:t,user:e}=Wn(),{refreshSessionAndUser:n,initializeWalletProxy:r}=Ht(),i=Vpe();return{importWallet:E.useCallback(({privateKey:s})=>Rht({getAccessToken:t,user:e,initializeWalletProxy:r,refreshSessionAndUser:n,emitPrivyEvent:i},{privateKey:s,chainType:"ethereum"}),[e,t,n,r,i])}},Fge=()=>{let{importWallet:t}=Wpt();return{...E.useContext(Cp),importWallet:t}};function Hpt(t,e,n){const r=t[e.name];if(typeof r=="function")return r;const i=t[n];return typeof i=="function"?i:s=>e(t,s)}const T8="2.14.4",Vpt=()=>`@wagmi/core@${T8}`;var Uge=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Q9,zge;
435let Sh=class yj extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Vpt()}constructor(e,n={}){var s;super(),Q9.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof yj?n.cause.details:(s=n.cause)!=null&&s.message?n.cause.message:n.details,i=n.cause instanceof yj&&n.cause.docsPath||n.docsPath;this.message=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` 436`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return Uge(this,Q9,"m",zge).call(this,this,e)}};Q9=new WeakSet,zge=function t(e,n){return n!=null&&n(e)?e:e.cause?Uge(this,Q9,"m",t).call(this,e.cause,n):e};let wj=class extends Sh{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}};class iRt extends Sh{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class qpt extends Sh{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Kpt extends Sh{constructor({address:e,connector:n}){super(`Account "${e}" not found for connector "${n.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Gpt extends Sh{constructor({connectionChainId:e,connectorChainId:n}){super(`The current chain of the connector (id: ${n}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Zpt extends Sh{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function Ypt(t,e={}){let n;if(e.connector){const{connector:l}=e;if(t.state.status==="reconnecting"&&!l.getAccounts&&!l.getChainId)throw new Zpt({connector:l});const[u,d]=await Promise.all([l.getAccounts(),l.getChainId()]);n={accounts:u,chainId:d,connector:l}}else n=t.state.connections.get(t.state.current);if(!n)throw new qpt;const r=e.chainId??n.chainId,i=await n.connector.getChainId();if(i!==n.chainId)throw new Gpt({connectionChainId:n.chainId,connectorChainId:i});const s=n.connector;if(s.getClient)return s.getClient({chainId:r});const o=zs(e.account??n.accounts[0]);if(o.address=cr(o.address),e.account&&!n.accounts.some(l=>l.toLowerCase()===o.address.toLowerCase()))throw new Kpt({address:o.address,connector:s});const a=t.chains.find(l=>l.id===r),c=await n.connector.getProvider({chainId:r});return bC({account:o,chain:a,name:"Connector Client",transport:l=>SD(c)({...l,retryCount:0})})}async function Qpt(t,e={}){var i,s;let n;if(e.connector)n=e.connector;else{const{connections:o,current:a}=t.state,c=o.get(a);n=c==null?void 0:c.connector}const r=t.state.connections;n&&(await n.disconnect(),n.emitter.off("change",t._internal.events.change),n.emitter.off("disconnect",t._internal.events.disconnect),n.emitter.on("connect",t._internal.events.connect),r.delete(n.uid)),t.setState(o=>{if(r.size===0)return{...o,connections:new Map,current:null,status:"disconnected"};const a=r.values().next().value;return{...o,connections:new Map(r),current:a.connector.uid}});{const o=t.state.current;if(!o)return;const a=(i=t.state.connections.get(o))==null?void 0:i.connector;if(!a)return;await((s=t.storage)==null?void 0:s.setItem("recentConnectorId",a.id
436))}}function Wge(t){const e=t.state.current,n=t.state.connections.get(e),r=n==null?void 0:n.accounts,i=r==null?void 0:r[0],s=t.chains.find(a=>a.id===(n==null?void 0:n.chainId)),o=t.state.status;switch(o){case"connected":return{address:i,addresses:r,chain:s,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:i,addresses:r,chain:s,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:i,addresses:r,chain:s,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}function h2(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let n,r;if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!h2(t[r],e[r]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(s&&!h2(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let b6=[];function vj(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||h2(b6,e)?b6:(b6=e,e)}let PT=!1;async function Hge(t,e={}){var l,u;if(PT)return[];PT=!0,t.setState(d=>({...d,status:d.current?"reconnecting":"connecting"}));const n=[];if((l=e.connectors)!=null&&l.length)for(const d of e.connectors){let h;typeof d=="function"?h=t._internal.connectors.setup(d):h=d,n.push(h)}else n.push(...t.connectors);let r;try{r=await((u=t.storage)==null?void 0:u.getItem("recentConnectorId"))}catch{}const i={};for(const[,d]of t.state.connections)i[d.connector.id]=1;r&&(i[r]=0);const s=Object.keys(i).length>0?[...n].sort((d,h)=>(i[d.id]??10)-(i[h.id]??10)):n;let o=!1;const a=[],c=[];for(const d of s){const h=await d.getProvider().catch(()=>{});if(!h||c.some(y=>y===h)||!await d.isAuthorized())continue;const m=await d.connect({isReconnecting:!0}).catch(()=>null);m&&(d.emitter.off("connect",t._internal.events.connect),d.emitter.on("change",t._internal.events.change),d.emitter.on("disconnect",t._internal.events.disconnect),t.setState(y=>{const v=new Map(o?y.connections:new Map).set(d.uid,{accounts:m.accounts,chainId:m.chainId,connector:d});return{...y,current:o?y.current:d.uid,connections:v}}),a.push({accounts:m.accounts,chainId:m.chainId,connector:d}),c.push(h),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(d=>({...d,status:"connected"})):t.setState(d=>({...d,connections:new Map,current:null,status:"disconnected"}))),PT=!1,a}async function Xpt(t,e){const{account:n,connector:r,...i}=e;let s;return typeof n=="object"&&n.type==="local"?s=t.getClient():s=await Ypt(t,{account:n,connector:r}),Hpt(s,fce,"signMessage")({...i,...n?{account:n}:{}})}let hm=class extends Sh{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}};class oRt extends Sh{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}function Jpt(t,e){const{onChange:n}=e;return t.subscribe(()=>Wge(t),n,{equalityFn(r,i){const{connector:s,...o}=r,{connector:a,...c}=i;return h2(o,c)&&(s==null?void 0:s.id)===(a==null?void 0:a.id)&&(s==null?void 0:s.uid)===(a==null?void 0:a.uid)}})}function e0t(t,e){const{onChange:n}=e;return t.subscribe(()=>vj(t),n,{equalityFn:h2})}function aRt(t){return t}const t0t=/(rabby|trustwallet)/;sS.type="injected";function sS(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:n}=t;function r(){const c=t.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...n0t[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l==null?void 0:l.ethereum}}}let i,s,o,a;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return t0t.test(this.id.toLowerCase())},type:sS.type,async setup(){const l=await this.getProvider();l!=null&&l.on&&t.target&&(o||(o=this.onConnect.bind(this),l.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)))},async connect({chainId:l,isReconnecting:u}={}){var f,m,y,v,b,C;const d=await this.getProvider();if(!d)throw new hm;let h=[];if(u)h=await this.getAccounts().catch(()=>[]);else if(e)try{h=(v=(y=(m=(f=(await d.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:f.caveats)==null?void 0:m[0])==null?void 0:y.value)==null?void 0:v.map(_=>cr(_)),h.length>0&&(h=await this.getAccounts())}catch(x){const _=x;if(_.code===Fr.code)throw new Fr(_);
436if(_.code===ml.code)throw _}try{!(h!=null&&h.length)&&!u&&(h=(await d.request({method:"eth_requestAccounts"})).map($=>cr($))),o&&(d.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),d.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a));let x=await this.getChainId();if(l&&x!==l){const _=await this.switchChain({chainId:l}).catch($=>{if($.code===Fr.code)throw $;return{id:x}});x=(_==null?void 0:_.id)??x}return e&&await((b=c.storage)==null?void 0:b.removeItem(`${this.id}.disconnected`)),t.target||await((C=c.storage)==null?void 0:C.setItem("injected.connected",!0)),{accounts:h,chainId:x}}catch(x){const _=x;throw _.code===Fr.code?new Fr(_):_.code===ml.code?new ml(_):_}},async disconnect(){var u,d;const l=await this.getProvider();if(!l)throw new hm;s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o));try{await fC(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((u=c.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),t.target||await((d=c.storage)==null?void 0:d.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new hm;return(await l.request({method:"eth_accounts"})).map(d=>cr(d))},async getChainId(){const l=await this.getProvider();if(!l)throw new hm;const u=await l.request({method:"eth_chainId"});return Number(u)}
436,async getProvider(){if(typeof window>"u")return;let l;const u=r();return typeof u.provider=="function"?l=u.provider(window):typeof u.provider=="string"?l=P8(window,u.provider):l=u.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){var l,u;try{if(e&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!t.target&&!await((u=c.storage)==null?void 0:u.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const m=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",m),!!await this.getProvider()),y=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(b=>window.addEventListener("ethereum#initialized",()=>b(m()),{once:!0}))]:[],new Promise(b=>setTimeout(()=>b(m()),y))]))return!0}throw new hm}return!!(await Hy(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){var m,y,v,b;const d=await this.getProvider();if(!d)throw new hm;const h=c.chains.find(C=>C.id===u);if(!h)throw new Gd(new wj);const f=new Promise(C=>{const x=_=>{"chainId"in _&&_.chainId===u&&(c.emitter.off("change",x),C())};c.emitter.on("change",x)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:dn(u)}]}).then(async()=>{await this.getChainId()===u&&c.emitter.emit("change",{chainId:u})}),f]),h}catch(C){const x=C;if(x.code===4902||((y=(m=x==null?void 0:x.data)==null?void 0:m.originalError)==null?void 0:y.code)===4902)try{const{default:_,...$}=h.blockExplorers??{};let I;l!=null&&l.blockExplorerUrls?I=l.blockExplorerUrls:_&&(I=[_.url,...Object.values($).map(T=>T.url)]);let R;(v=l==null?void 0:l.rpcUrls)!=null&&v.length?R=l.rpcUrls:R=[((b=h.rpcUrls.default)==null?void 0:b.http[0])??""];const N={blockExplorerUrls:I,chainId:dn(u),chainName:(l==null?void 0:l.chainName)??h.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??h.nativeCurrency,rpcUrls:R};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[N]}).then(async()=>{if(await this.getChainId()===u)c.emitter.emit("change",{chainId:u});else throw new Fr(new Error("User rejected switch after adding network."))}),f]),h}catch(_){throw new Fr(_)}throw x.code===Fr.code?new Fr(x):new Gd(x)}},async onAccountsChanged(l){var u;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),e&&await((u=c.storage)==null?void 0:u.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(d=>cr(d))})},onChainChanged(l){const u=Number(l);c.emitter.emit("change",{chainId:u})},async onConnect(l){const u=await this.getAccounts();if(u.length===0)return;const d=Number(l.chainId);c.emitter.emit("connect",{accounts:u,chainId:d});const h=await this.getProvider();h&&(o&&(h.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),h.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),h.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),h.on("disconnect",a)))},async onDisconnect(l){const u=await this.getProvider();l&&l.code===1013&&u&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),u&&(s&&(u.removeListener("chainChanged",s),s=void 0),a&&(u.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o))))}})}const n0t={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:P8(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return P8(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(e[r])return!1;return!0})}}
436,phantom:{id:"phantom",name:"Phantom",provider(t){var e,n;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(n=t.phantom)==null?void 0:n.ethereum:P8(t,"isPhantom")}}};function P8(t,e){function n(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const r=t.ethereum;if(r!=null&&r.providers)return r.providers.find(i=>n(i));if(r&&n(r))return r}const r0t=t=>(e,n,r)=>{const i=r.subscribe;return r.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let d=o(r.getState());l=h=>{const f=o(h);if(!u(d,f)){const m=d;a(d=f,m)}},c!=null&&c.fireImmediately&&a(d,d)}return i(l)},t(e,n,r)},i0t=r0t;function s0t(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,void 0),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const bj=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return bj(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return bj(r)(n)}}}},o0t=(t,e)=>(n,r,i)=>{let s={storage:s0t(()=>localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...y)},r,i);const u=()=>{const y=s.partialize({...r()});return l.setItem(s.name,{state:y,version:s.version})},d=i.setState;i.setState=(y,v)=>{d(y,v),u()};const h=t((...y)=>{n(...y),u()},r,i);i.getInitialState=()=>h;let f;const m=()=>{var y,v;if(!l)return;o=!1,a.forEach(C=>{var x;return C((x=r())!=null?x:h)});const b=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(y=r())!=null?y:h))||void 0;return bj(l.getItem.bind(l))(s.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==s.version){if(s.migrate)return[!0,s.migrate(C.state,C.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var x;const[_,$]=C;if(f=s.merge($,(x=r())!=null?x:h),n(f,!0),_)return u()}).then(()=>{b==null||b(f,void 0),f=r(),o=!0,c.forEach(C=>C(f))}).catch(C=>{b==null||b(void 0,C)})};return i.persist={setOptions:y=>{s={...s,...y},y.storage&&(l=y.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(c.add(y),()=>{c.delete(y)})},s.skipHydration||m(),f||h},a0t=o0t,kJ=t=>{let e;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(e):l;if(!Object.is(d,e)){const h=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({}
436,e,d),n.forEach(f=>f(e,h))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=e=t(r,i,a);return a},RT=t=>t?kJ(t):kJ;class c0t{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new wp})}on(e,n){this._emitter.on(e,n)}once(e,n){this._emitter.once(e,n)}off(e,n){this._emitter.off(e,n)}emit(e,...n){const r=n[0];this._emitter.emit(e,{uid:this.uid,...r})}listenerCount(e){return this._emitter.listenerCount(e)}}function l0t(t){return new c0t(t)}function u0t(t,e){return JSON.parse(t,(n,r)=>{let i=r;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(n,i))??i})}function $J(t,e){return t.slice(0,e).join(".")||"."}function IJ(t,e){const{length:n}=t;for(let r=0;r<n;++r)if(t[r]===e)return r+1;return 0}function d0t(t,e){const n=typeof t=="function",r=typeof e=="function",i=[],s=[];return function(a,c){if(typeof c=="object")if(i.length){const l=IJ(i,this);l===0?i[i.length]=this:(i.splice(l),s.splice(l)),s[s.length]=a;const u=IJ(i,c);if(u!==0)return r?e.call(this,a,c,$J(s,u)):`[ref=${$J(s,u)}]`}else i[0]=c,s[0]=a;return n?t.call(this,a,c):c}}function h0t(t,e,n,r){return JSON.stringify(t,d0t((i,s)=>{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},r),n??void 0)}function f0t(t){const{deserialize:e=u0t,key:n="wagmi",serialize:r=h0t,storage:i=Vge}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:n,async getItem(o,a){const c=i.getItem(`${n}.${o}`),l=await s(c);return l?e(l)??null:a??null},async setItem(o,a){const c=`${n}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,r(a)))},async removeItem(o){await s(i.removeItem(`${n}.${o}`))}}}const Vge={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},xj=256;let x6=xj,E6;function p0t(t=11){if(!E6||x6+t>xj*2){E6="",x6=0;for(let e=0;e<xj;e++)E6+=(256+Math.random()*256|0).toString(16).substring(1)}return E6.substring(x6,x6+++t)}function qge(t){const{multiInjectedProviderDiscovery:e=!0,storage:n=f0t({storage:typeof window<"u"&&window.localStorage?window.localStorage:Vge}),syncConnectedChain:r=!0,ssr:i=!1,...s}=t,o=typeof window<"u"&&e?pse():void 0,a=RT(()=>s.chains),c=RT(()=>{const $=[],I=new Set;for(const R of s.connectors??[]){const N=l(R);$.push(N),!i&&N.rdns&&I.add(N.rdns)}if(!i&&o){const R=o.getProviders();for(const N of R)I.has(N.info.rdns)||$.push(l(u(N)))}return $});function l($){var N;const I=l0t(p0t()),R={...$({emitter:I,chains:a.getState(),storage:n,transports:s.transports}),emitter:I,uid:I.uid};return I.on("connect",x),(N=R.setup)==null||N.call(R),R}function u($){const{info:I}=$,R=$.provider;return sS({target:{...I,id:I.rdns,provider:R}})}const d=new Map;function h($={}){const I=$.chainId??v.getState().chainId,R=a.getState().find(T=>T.id===I);if($.chainId&&!R)throw new wj;{const T=d.get(v.getState().chainId);if(T&&!R)return T;if(!R)throw new wj}{const T=d.get(I);if(T)return T}let N;if(s.client)N=s.client({chain:R});else{const T=R.id,O=a.getState().map(L=>L.id),U={},z=Object.entries(s);for(const[L,S]of z)if(!(L==="chains"||L==="client"||L==="connectors"||L==="transports"))if(typeof S=="object")if(T in S)U[L]=S[T];else{if(O.some(M=>M in S))continue;U[L]=S}else U[L]=S;N=bC({...U,chain:R,batch:U.batch??{multicall:!0},transport:L=>s.transports[T]({...L,connectors:c})})}return d.set(I,N),N}function f(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let m;const y="0.0.0-canary-";T8.startsWith(y)?m=Number.parseInt(T8.replace(y,"")):m=Number.parseInt(T8.split(".")[0]??"0");const v=RT(i0t(n?a0t(f,{migrate($,I){if(I===m)return $;const R=f(),N=b($,R.chainId);return{...R,chainId:N}},name:"store",partialize($){return{connections:{__type:"Map",value:Array.from($.connections.entries()).map(([I,R])=>{const{id:N,name:T,type:O,uid:U}=R.connector;return[I,{...R,connector:{id:N,name:T,type:O,uid:U}}]})},chainId:$.chainId,current:$.current}},merge($,I){typeof $=="object"&&$&&"status"in $&&delete $.status;const R=b($,I.chainId);return{...I,...$,chainId:R}},skipHydration:i,storage:n,version:m}):f));v.setState(f());function b($,I){return $&&typeof $=="object"&&"chainId"in $&&typeof $.chainId=="number"&&a.getState().some(R=>R.id===$.chainId)?$.chainId:I}r&&v.subscribe(({connections:$,current:I})=>{var R;return I?(R=$.get(I))==null?void 0:R.chainId:void 0},$=>{if(a.getState().some(R=>R.id===$))return v.setState(R=>({...R,chainId:$??R.chainId}))}),o==null||o.subscribe($=>{const I=new Set,R=new Set;for(const T of c.getState())I.add(T.id),T.rdns&&R.add(T.rdns);const N=[];for(const T of $){if(R.has(T.info.rdns))continue;const O=l(u(T));I.has(O.id)||N.push(O)}n&&!v.persist.hasHydrated()||c.setState(T=>[...T,...N],!0)});function C($){v.setState(I=>{const R=I.connections.get($.uid);return R?{...I,connections:new Map(I.connections).set($.uid,{accounts:$.accounts??R.accounts,chainId:$.chainId??R.chainId,connector:R.connector})}:I})}function x($){v.getState().status==="connecting"||v.getState().status==="reconnecting"||v.setState(I=>{const R=c.getState().find(N=>N.uid===$.uid);return R?(R.emitter.listenerCount("connect")&&R.emitter.off("connect",C),R.emitter.listenerCount("change")||R.emitter.on("change",C),R.emitter.listenerCount("disconnect")||R.emitter.on("disconnect",_),{...I,connections:new Map(I.connections).set($.uid,{accounts:$.accounts,chainId:$.chainId,connector:R}),current:$.uid,status:"connected"}):I})}function _($){v.setState(I=>{const R=I.connections.get($.uid);if(R){const T=R.connector;T.emitter.listenerCount("change")&&R.connector.emitter.off("change",C),T.emitter.listenerCount("disconnect")&&R.connector.emitter.off("disconnect",_),T.emitter.listenerCount("connect")||R.connector.emitter.on("connect",x)}if(I.connections.delete($.uid),I.connections.size===0)return{...I,connections:new Map,current:null,status:"disconnected"};const N=I.connections.values().next().value;return{...I,connections:new Map(I.connections),current:N.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:n,getClient:h,get state(){return v.getState()},setState($){let I;typeof $=="function"?I=$(v.getState()):I=$;const R=f();typeof I!="object"&&(I=R),Object.keys(R).some(T=>!(T in I))&&(I=R),v.setState(I,!0)},subscribe($,I,R){return v.subscribe($,I,R?{...R,fireImmediately:R.emitImmediately}:void 0)},_internal:{mipd:o,store:v,ssr:!!i,syncConnectedChain:r,transports:s.transports,chains:{setState($){const I=typeof $=="function"?$(a.getState()):$;if(I.length!==0)return a.setState(I,!0)},subscribe($){return a.subscribe($)}},connectors:{providerDetailToConnector:u,setup:l,setState($){return c.setState(typeof $=="function"?$(c.getState()):$,!0)},subscribe($){return c.subscribe($)}},events:{change:C,connect:x,disconnect:_}}}}function g0t(t,e){const{initialState:n,reconnectOnMount:r}=e;return n&&!t._internal.store.persist.hasHydrated()&&t.setState({...n,chainId:t.chains.some(i=>i.id===n.chainId)?n.chainId:t.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){t._internal.ssr&&(await t._internal.store.persist.rehydrate(),t._internal.mipd&&t._internal.connectors.setState(i=>{var c;const s=new Set;for(const l of i??[])l.rdns&&s.add(l.rdns);const o=[],a=((c=t._internal.mipd)==null?void 0:c.getProviders())??[];for(const l of a){if(s.has(l.info.rdns))continue;const u=t._internal.connectors.providerDetailToConnector(l),d=t._internal.connectors.setup(u);o.push(d)}return[...i,...o]})),r?Hge(t):t.storage&&t.setState(i=>({...i,connections:new Map}))}}}function m0t(t,e={}){const{type:n}=t,{key:r="connector",name:i="Connector",retryDelay:s}=e;return o=>{const{chain:a,connectors:c}=o,l=e.retryCount??o.retryCount;return xC({key:r,name:i,request:async({method:d,params:h})=>{const f=c==null?void 0:c.getState().find(b=>b.type===n);if(!f)throw new u1(new Error(`Could not find connector of type "${n}" in \`connectors\` passed to \`createConfig\`.`));const m=await f.getProvider({chainId:a==null?void 0:a.id});if(!m)throw new u1(new Error("Provider is disconnected."));const y=Ec(await Hy(()=>fC(()=>m.request({method:"eth_chainId"}),{timeout:100})));if(a&&y!==a.id)throw new zy(new Error(`The current chain of the connector (id: ${y}) does not match the target chain for the request (id: ${a.id} â ${a.name}).`));const v={method:d,params:h};return m.request(v)},retryCount:l,retryDelay:s,type:"connector"})}}function nc(t,e){return C_e(t,e)}
436function y0t(t){const{children:e,config:n,initialState:r,reconnectOnMount:i=!0}=t,{onMount:s}=g0t(n,{initialState:r,reconnectOnMount:i});n._internal.ssr||s();const o=E.useRef(!0);return E.useEffect(()=>{if(o.current&&n._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const Kge=E.createContext(void 0);function Gge(t){const{children:e,config:n}=t,r={value:n};return E.createElement(y0t,t,E.createElement(Kge.Provider,r,e))}const w0t="2.12.29",v0t=()=>`wagmi@${w0t}`;let b0t=class extends Sh{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return v0t()}};class x0t extends b0t{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function Q2(t={}){const e=t.config??E.useContext(Kge);if(!e)throw new x0t;return e}var MT={exports:{}},OT={},jT={exports:{}},NT={};/** 437 * @license React 438 * use-sync-external-store-shim.production.min.js 439 * 440 * Copyright (c) Facebook, Inc. and its affiliates. 441 * 442 * This source code is licensed under the MIT license found in the 443 * LICENSE file in the root directory of this source tree. 444 */var TJ;function E0t(){if(TJ)return NT;TJ=1;var t=wh();function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(d,h){var f=h(),m=r({inst:{value:f,getSnapshot:h}}),y=m[0].inst,v=m[1];return s(function(){y.value=f,y.getSnapshot=h,c(y)&&v({inst:y})},[d,f,h]),i(function(){return c(y)&&v({inst:y}),d(function(){c(y)&&v({inst:y})})},[d]),o(f),f}function c(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function l(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return NT.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,NT}var PJ;function C0t(){return PJ||(PJ=1,jT.exports=E0t()),jT.exports}/** 445 * @license React 446 * use-sync-external-store-shim/with-selector.production.min.js 447 * 448 * Copyright (c) Facebook, Inc. and its affiliates. 449 * 450 * This source code is licensed under the MIT license found in the 451 * LICENSE file in the root directory of this source tree. 452 */var RJ;function _0t(){if(RJ)return OT;RJ=1;var t=wh(),e=C0t();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,c=t.useDebugValue;return OT.useSyncExternalStoreWithSelector=function(l,u,d,h,f){var m=s(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function b(I){if(!C){if(C=!0,x=I,I=h(I),f!==void 0&&y.hasValue){var R=y.value;if(f(R,I))return _=R}return _=I}if(R=_,r(x,I))return R;var N=h(I);return f!==void 0&&f(R,N)?R:(x=I,_=N)}var C=!1,x,_,$=d===void 0?null:d;return[function(){return b(u())},$===null?void 0:function(){return b($())}]},[u,d,h,f]);var v=i(l,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=v},[v]),c(v),v},OT}var MJ;function S0t(){return MJ||(MJ=1,MT.exports=_0t()),MT.exports}var A0t=S0t();const DT=t=>typeof t=="object"&&!Array.isArray(t);function k0t(t,e,n=e,r=h2){const i=E.useRef([]),s=A0t.useSyncExternalStoreWithSelector(t,e,n,o=>o,(o,a)=>{if(DT(o)&&DT(a)&&i.current.length){for(const c of i.current)if(!r(o[c],a[c]))return!1;return!0}return r(o,a)});return E.useMemo(()=>{if(DT(s)){const o={...s};let a={};for(const[c,l]of Object.entries(o))a={...a,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}};return Object.defineProperties(o,a),o}return s},[s])}function $0t(t={}){const e=Q2(t);return k0t(n=>Jpt(e,{onChange:n}),()=>Wge(e))}function I0t(t){return{mutationFn(e){return Qpt(t,e)},mutationKey:["disconnect"]}}function T0t(t){return{mutationFn(e){return Hge(t,e)},mutationKey:["reconnect"]}}
vendor: 33,274 bytes, line 452
452function P0t(t){return{mutationFn(e){return Xpt(t,e)},mutationKey:["signMessage"]}}var J1=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},T1=typeof window>"u"||"Deno"in globalThis;function hc(){}function R0t(t,e){return typeof t=="function"?t(e):t}function Ej(t){return typeof t=="number"&&t>=0&&t!==1/0}function Zge(t,e){return Math.max(t+(e||0)-Date.now(),0)}function oy(t,e){return typeof t=="function"?t(e):t}function sl(t,e){return typeof t=="function"?t(e):t}function OJ(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==ZB(o,e.options))return!1}else if(!w3(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function jJ(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(P1(e.options.mutationKey)!==P1(s))return!1}else if(!w3(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function ZB(t,e){return((e==null?void 0:e.queryKeyHashFn)||P1)(t)}function P1(t){return JSON.stringify(t,(e,n)=>Cj(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function w3(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!w3(t[n],e[n])):!1}function YB(t,e){if(t===e)return t;const n=NJ(t)&&NJ(e);if(n||Cj(t)&&Cj(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,a=n?[]:{};let c=0;for(let l=0;l<o;l++){const u=n?l:s[l];(!n&&r.includes(u)||n)&&t[u]===void 0&&e[u]===void 0?(a[u]=void 0,c++):(a[u]=YB(t[u],e[u]),a[u]===t[u]&&t[u]!==void 0&&c++)}return i===o&&c===i?t:a}return e}function X9(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function NJ(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Cj(t){if(!DJ(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!DJ(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function DJ(t){return Object.prototype.toString.call(t)==="[object Object]"}function M0t(t){return new Promise(e=>{setTimeout(e,t)})}function _j(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?YB(t,e):e}function O0t(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function j0t(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var QB=Symbol();function Yge(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===QB?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var D0,If,my,Tie,N0t=(Tie=class extends J1{constructor(){super();Je(this,D0);Je(this,If);Je(this,my);Xe(this,my,e=>{if(!T1&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ne(this,If)||this.setEventListener(ne(this,my))}onUnsubscribe(){var e;this.hasListeners()||((e=ne(this,If))==null||e.call(this),Xe(this,If,void 0))}setEventListener(e){var n;Xe(this,my,e),(n=ne(this,If))==null||n.call(this),Xe(this,If,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){ne(this,D0)!==e&&(Xe(this,D0,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof ne(this,D0)=="boolean"?ne(this,D0):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},D0=new WeakMap,If=new WeakMap,my=new WeakMap,Tie),XB=new N0t,yy,Tf,wy,Pie,D0t=(Pie=class extends J1{constructor(){super();Je(this,yy,!0);Je(this,Tf);Je(this,wy);Xe(this,wy,e=>{if(!T1&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ne(this,Tf)||this.setEventListener(ne(this,wy))}onUnsubscribe(){var e;this.hasListeners()||((e=ne(this,Tf))==null||e.call(this),Xe(this,Tf,void 0))}setEventListener(e){var n;Xe(this,wy,e),(n=ne(this,Tf))==null||n.call(this),Xe(this,Tf,e(this.setOnline.bind(this)))}setOnline(e){ne(this,yy)!==e&&(Xe(this,yy,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return ne(this,yy)}},yy=new WeakMap,Tf=new WeakMap,wy=new WeakMap,Pie),J9=new D0t;function Sj(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function L0t(t){return Math.min(1e3*2**t,3e4)}function Qge(t){return(t??"online")==="online"?J9.isOnline():!0}var Xge=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function LT(t){return t instanceof Xge}function Jge(t){let e=!1,n=0,r=!1,i;const s=Sj(),o=y=>{var v;r||(h(new Xge(y)),(v=t.abort)==null||v.call(t))},a=()=>{e=!0},c=()=>{e=!1},l=()=>XB.isFocused()&&(t.networkMode==="always"||J9.isOnline())&&t.canRun(),u=()=>Qge(t.networkMode)&&t.canRun(),d=y=>{var v;r||(r=!0,(v=t.onSuccess)==null||v.call(t,y),i==null||i(),s.resolve(y))},h=y=>{var v;r||(r=!0,(v=t.onError)==null||v.call(t,y),i==null||i(),s.reject(y))},f=()=>new Promise(y=>{var v;i=b=>{(r||l())&&y(b)},(v=t.onPause)==null||v.call(t)}).then(()=>{var y;i=void 0,r||(y=t.onContinue)==null||y.call(t)}),m=()=>{if(r)return;let y;const v=n===0?t.initialPromise:void 0;try{y=v??t.fn()}catch(b){y=Promise.reject(b)}Promise.resolve(y).then(d).catch(b=>{var I;if(r)return;const C=t.retry??(T1?0:3),x=t.retryDelay??L0t,_=typeof x=="function"?x(n,b):x,$=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,b);if(e||!$){h(b);return}n++,(I=t.onFail)==null||I.call(t,n,b),M0t(_).then(()=>l()?void 0:f()).then(()=>{e?h(b):m()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?m():f().then(m),s)}}var B0t=t=>setTimeout(t,0);function F0t(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=B0t;const s=a=>{e?t.push(a):i(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var wi=F0t(),L0,Rie,eme=(Rie=class{constructor(){Je(this,L0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ej(this.gcTime)&&Xe(this,L0,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(T1?1/0:300*1e3))}clearGcTimeout(){ne(this,L0)&&(clearTimeout(ne(this,L0)),Xe(this,L0,void 0))}},L0=new WeakMap,Rie),vy,by,ac,B0,ao,N3,F0,nl,gd,Mie,U0t=(Mie=class extends eme{constructor(e){super();Je(this,nl);Je(this,vy);Je(this,by);Je(this,ac);Je(this,B0);Je(this,ao);Je(this,N3);Je(this,F0);Xe(this,F0,!1),Xe(this,N3,e.defaultOptions),this.setOptions(e.options),this.observers=[],Xe(this,B0,e.client),Xe(this,ac,ne(this,B0).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Xe(this,vy,z0t(this.options)),this.state=e.state??ne(this,vy),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=ne(this,ao))==null?void 0:e.promise}setOptions(e){this.options={...ne(this,N3),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ne(this,ac).remove(this)}setData(e,n){const r=_j(this.state.data,e,this.options);return Mt(this,nl,gd).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Mt(this,nl,gd).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=ne(this,ao))==null?void 0:r.promise;return(i=ne(this,ao))==null||i.cancel(e),n?n.then(hc).catch(hc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ne(this,vy))}isActive(){return this.observers.some(e=>sl(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===QB||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Zge(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=ne(this,ao))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=ne(this,ao))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ne(this,ac).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(ne(this,ao)&&(ne(this,F0)?ne(this,ao).cancel({revert:!0}):ne(this,ao).cancelRetry()),this.scheduleGc()),ne(this,ac).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Mt(this,nl,gd).call(this,{type:"invalidate"})}fetch(e,n){var c,l,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ne(this,ao))return ne(this,ao).continueRetry(),ne(this,ao).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(Xe(this,F0,!0),r.signal)})},s=()=>{const d=Yge(this.options,n),h={client:ne(this,B0),queryKey:this.queryKey,meta:this.meta};return i(h),Xe(this,F0,!1),this.options.persister?this.options.persister(d,h,this):d(h)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ne(this,B0),state:this.state,fetchFn:s};i(o),(c=this.options.behavior)==null||c.onFetch(o,this),Xe(this,by,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=o.fetchOptions)==null?void 0:l.meta))&&Mt(this,nl,gd).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const a=d=>{var h,f,m,y;LT(d)&&d.silent||Mt(this,nl,gd).call(this,{type:"error",error:d}),LT(d)||((f=(h=ne(this,ac).config).onError)==null||f.call(h,d,this),(y=(m=ne(this,ac).config).onSettled)==null||y.call(m,this.state.data,d,this)),this.scheduleGc()};return Xe(this,ao,Jge({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,f,m,y;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(v){a(v);return}(f=(h=ne(this,ac).config).onSuccess)==null||f.call(h,d,this),(y=(m=ne(this,ac).config).onSettled)==null||y.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,h)=>{Mt(this,nl,gd).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{Mt(this,nl,gd).call(this,{type:"pause"})},onContinue:()=>{Mt(this,nl,gd).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),ne(this,ao).start()}},vy=new WeakMap,by=new WeakMap,ac=new WeakMap,B0=new WeakMap,ao=new WeakMap,N3=new WeakMap,F0=new WeakMap,nl=new WeakSet,gd=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...tme(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return LT(i)&&i.revert&&ne(this,by)?{...ne(this,by),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),wi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ne(this,ac).notify({query:this,type:"updated",action:e})})},Mie);function tme(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qge(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function z0t(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var cu,Oie,W0t=(Oie=class extends J1{constructor(e={}){super();Je(this,cu);this.config=e,Xe(this,cu,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??ZB(i,n);let o=this.get(s);return o||(o=new U0t({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){ne(this,cu).has(e.queryHash)||(ne(this,cu).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=ne(this,cu).get(e.queryHash);n&&(e.destroy(),n===e&&ne(this,cu).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){wi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ne(this,cu).get(e)}getAll(){return[...ne(this,cu).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>OJ(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>OJ(e,r)):n}notify(e){wi.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){wi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){wi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},cu=new WeakMap,Oie),lu,Eo,U0,uu,gf,jie,H0t=(jie=class extends eme{constructor(e){super();Je(this,uu);Je(this,lu);Je(this,Eo);Je(this,U0);this.mutationId=e.mutationId,Xe(this,Eo,e.mutationCache),Xe(this,lu,[]),this.state=e.state||nme(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ne(this,lu).includes(e)||(ne(this,lu).push(e),this.clearGcTimeout(),ne(this,Eo).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Xe(this,lu,ne(this,lu).filter(n=>n!==e)),this.scheduleGc(),ne(this,Eo).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ne(this,lu).length||(this.state.status==="pending"?this.scheduleGc():ne(this,Eo).remove(this))}continue(){var e;return((e=ne(this,U0))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,l,u,d,h,f,m,y,v,b,C,x,_,$,I,R;Xe(this,U0,Jge({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(N,T)=>{Mt(this,uu,gf).call(this,{type:"failed",failureCount:N,error:T})},onPause:()=>{Mt(this,uu,gf).call(this,{type:"pause"})},onContinue:()=>{Mt(this,uu,gf).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ne(this,Eo).canRun(this)}));const n=this.state.status==="pending",r=!ne(this,U0).canStart();try{if(!n){Mt(this,uu,gf).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=ne(this,Eo).config).onMutate)==null?void 0:s.call(i,e,this));const T=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));T!==this.state.context&&Mt(this,uu,gf).call(this,{type:"pending",context:T,variables:e,isPaused:r})}const N=await ne(this,U0).start();return await((l=(c=ne(this,Eo).config).onSuccess)==null?void 0:l.call(c,N,e,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,N,e,this.state.context)),await((f=(h=ne(this,Eo).config).onSettled)==null?void 0:f.call(h,N,null,this.state.variables,this.state.context,this)),await((y=(m=this.options).onSettled)==null?void 0:y.call(m,N,null,e,this.state.context)),Mt(this,uu,gf).call(this,{type:"success",data:N}),N}catch(N){try{throw await((b=(v=ne(this,Eo).config).onError)==null?void 0:b.call(v,N,e,this.state.context,this)),await((x=(C=this.options).onError)==null?void 0:x.call(C,N,e,this.state.context)),await(($=(_=ne(this,Eo).config).onSettled)==null?void 0:$.call(_,void 0,N,this.state.variables,this.state.context,this)),await((R=(I=this.options).onSettled)==null?void 0:R.call(I,void 0,N,e,this.state.context)),N}finally{Mt(this,uu,gf).call(this,{type:"error",error:N})}}finally{ne(this,Eo).runNext(this)}}},lu=new WeakMap,Eo=new WeakMap,U0=new WeakMap,uu=new WeakSet,gf=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),wi.batch(()=>{ne(this,lu).forEach(r=>{r.onMutationUpdate(e)}),ne(this,Eo).notify({mutation:this,type:"updated",action:e})})},jie);function nme(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var kd,rl,D3,Nie,V0t=(Nie=class extends J1{constructor(e={}){super();Je(this,kd);Je(this,rl);Je(this,D3);this.config=e,Xe(this,kd,new Set),Xe(this,rl,new Map),Xe(this,D3,0)}build(e,n,r){const i=new H0t({mutationCache:this,mutationId:++zw(this,D3)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){ne(this,kd).add(e);const n=C6(e);if(typeof n=="string"){const r=ne(this,rl).get(n);r?r.push(e):ne(this,rl).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(ne(this,kd).delete(e)){const n=C6(e);if(typeof n=="string"){const r=ne(this,rl).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&ne(this,rl).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=C6(e);if(typeof n=="string"){const r=ne(this,rl).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=C6(e);if(typeof n=="string"){const i=(r=ne(this,rl).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){wi.batch(()=>{ne(this,kd).forEach(e=>{this.notify({type:"removed",mutation:e})}),ne(this,kd).clear(),ne(this,rl).clear()})}getAll(){return Array.from(ne(this,kd))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>jJ(n,r))}findAll(e={}){return this.getAll().filter(n=>jJ(e,n))}notify(e){wi.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return wi.batch(()=>Promise.all(e.map(n=>n.continue().catch(hc))))}},kd=new WeakMap,rl=new WeakMap,D3=new WeakMap,Nie);function C6(t){var e;return(e=t.options.scope)==null?void 0:e.id}function LJ(t){return{onFetch:(e,n)=>{var u,d,h,f,m;const r=e.options,i=(h=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,s=((f=e.state.data)==null?void 0:f.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let y=!1;const v=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(e.signal.aborted?y=!0:e.signal.addEventListener("abort",()=>{y=!0}),e.signal)})},b=Yge(e.options,e.fetchOptions),C=async(x,_,$)=>{if(y)return Promise.reject();if(_==null&&x.pages.length)return Promise.resolve(x);const I={client:e.client,queryKey:e.queryKey,pageParam:_,direction:$?"backward":"forward",meta:e.options.meta};v(I);const R=await b(I),{maxPages:N}=e.options,T=$?j0t:O0t;return{pages:T(x.pages,R,N),pageParams:T(x.pageParams,_,N)}};if(i&&s.length){const x=i==="backward",_=x?rme:Aj,$={pages:s,pageParams:o},I=_(r,$);a=await C($,I,x)}else{const x=t??s.length;do{const _=c===0?o[0]??r.initialPageParam:Aj(r,a);if(c>0&&_==null)break;a=await C(a,_),c++}while(c<x)}return a};e.options.persister?e.fetchFn=()=>{var y,v;return(v=(y=e.options).persister)==null?void 0:v.call(y,l,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=l}}}function Aj(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function rme(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}function lRt(t,e){return e?Aj(t,e)!=null:!1}function uRt(t,e){return!e||!t.getPreviousPageParam?!1:rme(t,e)!=null}var pi,Pf,Rf,xy,Ey,Mf,Cy,_y,Die,q0t=(Die=class{constructor(t={}){Je(this,pi);Je(this,Pf);Je(this,Rf);Je(this,xy);Je(this,Ey);Je(this,Mf);Je(this,Cy);Je(this,_y);Xe(this,pi,t.queryCache||new W0t),Xe(this,Pf,t.mutationCache||new V0t),Xe(this,Rf,t.defaultOptions||{}),Xe(this,xy,new Map),Xe(this,Ey,new Map),Xe(this,Mf,0)}mount(){zw(this,Mf)._++,ne(this,Mf)===1&&(Xe(this,Cy,XB.subscribe(async t=>{t&&(await this.resumePausedMutations(),ne(this,pi).onFocus())})),Xe(this,_y,J9.subscribe(async t=>{t&&(await this.resumePausedMutations(),ne(this,pi).onOnline())})))}unmount(){var t,e;zw(this,Mf)._--,ne(this,Mf)===0&&((t=ne(this,Cy))==null||t.call(this),Xe(this,Cy,void 0),(e=ne(this,_y))==null||e.call(this),Xe(this,_y,void 0))}isFetching(t){return ne(this,pi).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return ne(this,Pf).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ne(this,pi).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=ne(this,pi).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(oy(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return ne(this,pi).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=ne(this,pi).get(r.queryHash),s=i==null?void 0:i.state.data,o=R0t(e,s);if(o!==void 0)return ne(this,pi).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return wi.batch(()=>ne(this,pi).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ne(this,pi).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=ne(this,pi);wi.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=ne(this,pi);return wi.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=wi.batch(()=>ne(this,pi).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(hc).catch(hc)}invalidateQueries(t,e={}){return wi.batch(()=>(ne(this,pi).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=wi.batch(()=>ne(this,pi).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(hc)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(hc)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=ne(this,pi).build(this,e);return n.isStaleByTime(oy(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(hc).catch(hc)}fetchInfiniteQuery(t){return t.behavior=LJ(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(hc).catch(hc)}ensureInfiniteQueryData(t){return t.behavior=LJ(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return J9.isOnline()?ne(this,Pf).resumePausedMutations():Promise.resolve()}getQueryCache(){return ne(this,pi)}getMutationCache(){return ne(this,Pf)}getDefaultOptions(){return ne(this,Rf)}setDefaultOptions(t){Xe(this,Rf,t)}setQueryDefaults(t,e){ne(this,xy).set(P1(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...ne(this,xy).values()],n={};return e.forEach(r=>{w3(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){ne(this,Ey).set(P1(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...ne(this,Ey).values()],n={};return e.forEach(r=>{w3(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...ne(this,Rf).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=ZB(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===QB&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...ne(this,Rf).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){ne(this,pi).clear(),ne(this,Pf).clear()}},pi=new WeakMap,Pf=new WeakMap,Rf=new WeakMap,xy=new WeakMap,Ey=new WeakMap,Mf=new WeakMap,Cy=new WeakMap,_y=new WeakMap,Die),Qo,Kn,L3,Co,z0,Sy,Of,du,B3,Ay,ky,W0,H0,jf,$y,lr,Jv,kj,$j,Ij,Tj,Pj,Rj,Mj,ime,Lie,JB=(Lie=class extends J1{constructor(e,n){super();Je(this,lr);Je(this,Qo);Je(this,Kn);Je(this,L3);Je(this,Co);Je(this,z0);Je(this,Sy);Je(this,Of);Je(this,du);Je(this,B3);Je(this,Ay);Je(this,ky);Je(this,W0);Je(this,H0);Je(this,jf);Je(this,$y,new Set);this.options=n,Xe(this,Qo,e),Xe(this,du,null),Xe(this,Of,Sj()),this.options.experimental_prefetchInRender||ne(this,Of).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ne(this,Kn).addObserver(this),BJ(ne(this,Kn),this.options)?Mt(this,lr,Jv).call(this):this.updateResult(),Mt(this,lr,Tj).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Oj(ne(this,Kn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Oj(ne(this,Kn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Mt(this,lr,Pj).call(this),Mt(this,lr,Rj).call(this),ne(this,Kn).removeObserver(this)}setOptions(e){const n=this.options,r=ne(this,Kn);if(this.options=ne(this,Qo).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof sl(this.options.enabled,ne(this,Kn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Mt(this,lr,Mj).call(this),ne(this,Kn).setOptions(this.options),n._defaulted&&!X9(this.options,n)&&ne(this,Qo).getQueryCache().notify({type:"observerOptionsUpdated",query:ne(this,Kn),observer:this});const i=this.hasListeners();i&&FJ(ne(this,Kn),r,this.options,n)&&Mt(this,lr,Jv).call(this),this.updateResult(),i&&(ne(this,Kn)!==r||sl(this.options.enabled,ne(this,Kn))!==sl(n.enabled,ne(this,Kn))||oy(this.options.staleTime,ne(this,Kn))!==oy(n.staleTime,ne(this,Kn)))&&Mt(this,lr,kj).call(this);const s=Mt(this,lr,$j).call(this);i&&(ne(this,Kn)!==r||sl(this.options.enabled,ne(this,Kn))!==sl(n.enabled,ne(this,Kn))||s!==ne(this,jf))&&Mt(this,lr,Ij).call(this,s)}getOptimisticResult(e){const n=ne(this,Qo).getQueryCache().build(ne(this,Qo),e),r=this.createResult(n,e);return G0t(this,r)&&(Xe(this,Co,r),Xe(this,Sy,this.options),Xe(this,z0,ne(this,Kn).state)),r}getCurrentResult(){return ne(this,Co)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){ne(this,$y).add(e)}getCurrentQuery(){return ne(this,Kn)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=ne(this,Qo).defaultQueryOptions(e),r=ne(this,Qo).getQueryCache().build(ne(this,Qo),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Mt(this,lr,Jv).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),ne(this,Co)))}createResult(e,n){var N;const r=ne(this,Kn),i=this.options,s=ne(this,Co),o=ne(this,z0),a=ne(this,Sy),l=e!==r?e.state:ne(this,L3),{state:u}=e;let d={...u},h=!1,f;if(n._optimisticResults){const T=this.hasListeners(),O=!T&&BJ(e,n),U=T&&FJ(e,r,n,i);(O||U)&&(d={...d,...tme(u.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:v}=d;if(n.select&&d.data!==void 0)if(s&&d.data===(o==null?void 0:o.data)&&n.select===ne(this,B3))f=ne(this,Ay);else try{Xe(this,B3,n.select),f=n.select(d.data),f=_j(s==null?void 0:s.data,f,n),Xe(this,Ay,f),Xe(this,du,null)}catch(T){Xe(this,du,T)}else f=d.data;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let T;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=s.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((N=ne(this,ky))==null?void 0:N.state.data,ne(this,ky)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),Xe(this,du,null)}catch(O){Xe(this,du,O)}T!==void 0&&(v="success",f=_j(s==null?void 0:s.data,T,n),h=!0)}ne(this,du)&&(m=ne(this,du),f=ne(this,Ay),y=Date.now(),v="error");const b=d.fetchStatus==="fetching",C=v==="pending",x=v==="error",_=C&&b,$=f!==void 0,R={status:v,fetchStatus:d.fetchStatus,isPending:C,isSuccess:v==="success",isError:x,isInitialLoading:_,isLoading:_,data:f,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!C,isLoadingError:x&&!$,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:x&&$,isStale:eF(e,n),refetch:this.refetch,promise:ne(this,Of)};if(this.options.experimental_prefetchInRender){const T=z=>{R.status==="error"?z.reject(R.error):R.data!==void 0&&z.resolve(R.data)},O=()=>{const z=Xe(this,Of,R.promise=Sj());T(z)},U=ne(this,Of);switch(U.status){case"pending":e.queryHash===r.queryHash&&T(U);break;case"fulfilled":(R.status==="error"||R.data!==U.value)&&O();break;case"rejected":(R.status!=="error"||R.error!==U.reason)&&O();break}}return R}updateResult(){const e=ne(this,Co),n=this.createResult(ne(this,Kn),this.options);if(Xe(this,z0,ne(this,Kn).state),Xe(this,Sy,this.options),ne(this,z0).data!==void 0&&Xe(this,ky,ne(this,Kn)),X9(n,e))return;Xe(this,Co,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!ne(this,$y).size)return!0;const o=new Set(s??ne(this,$y));return this.options.throwOnError&&o.add("error"),Object.keys(ne(this,Co)).some(a=>{const c=a;return ne(this,Co)[c]!==e[c]&&o.has(c)})};Mt(this,lr,ime).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Mt(this,lr,Tj).call(this)}},Qo=new WeakMap,Kn=new WeakMap,L3=new WeakMap,Co=new WeakMap,z0=new WeakMap,Sy=new WeakMap,Of=new WeakMap,du=new WeakMap,B3=new WeakMap,Ay=new WeakMap,ky=new WeakMap,W0=new WeakMap,H0=new WeakMap,jf=new WeakMap,$y=new WeakMap,lr=new WeakSet,Jv=function(e){Mt(this,lr,Mj).call(this);let n=ne(this,Kn).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(hc)),n},kj=function(){Mt(this,lr,Pj).call(this);const e=oy(this.options.staleTime,ne(this,Kn));if(T1||ne(this,Co).isStale||!Ej(e))return;const r=Zge(ne(this,Co).dataUpdatedAt,e)+1;Xe(this,W0,setTimeout(()=>{ne(this,Co).isStale||this.updateResult()},r))},$j=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ne(this,Kn)):this.options.refetchInterval)??!1},Ij=function(e){Mt(this,lr,Rj).call(this),Xe(this,jf,e),!(T1||sl(this.options.enabled,ne(this,Kn))===!1||!Ej(ne(this,jf))||ne(this,jf)===0)&&Xe(this,H0,setInterval(()=>
452{(this.options.refetchIntervalInBackground||XB.isFocused())&&Mt(this,lr,Jv).call(this)},ne(this,jf)))},Tj=function(){Mt(this,lr,kj).call(this),Mt(this,lr,Ij).call(this,Mt(this,lr,$j).call(this))},Pj=function(){ne(this,W0)&&(clearTimeout(ne(this,W0)),Xe(this,W0,void 0))},Rj=function(){ne(this,H0)&&(clearInterval(ne(this,H0)),Xe(this,H0,void 0))},Mj=function(){const e=ne(this,Qo).getQueryCache().build(ne(this,Qo),this.options);if(e===ne(this,Kn))return;const n=ne(this,Kn);Xe(this,Kn,e),Xe(this,L3,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},ime=function(e){wi.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(ne(this,Co))}),ne(this,Qo).getQueryCache().notify({query:ne(this,Kn),type:"observerResultsUpdated"})})},Lie);function K0t(t,e){return sl(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function BJ(t,e){return K0t(t,e)||t.state.data!==void 0&&Oj(t,e,e.refetchOnMount)}function Oj(t,e,n){if(sl(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&eF(t,e)}return!1}function FJ(t,e,n,r){return(t!==e||sl(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&eF(t,n)}function eF(t,e){return sl(e.enabled,t)!==!1&&t.isStaleByTime(oy(e.staleTime,t))}function G0t(t,e){return!X9(t.getCurrentResult(),e)}function UJ(t,e){return t.filter(n=>!e.includes(n))}function Z0t(t,e,n){const r=t.slice(0);return r[e]=n,r}var Iy,cc,Ty,Py,lc,Nf,F3,U3,z3,Fs,jj,Nj,Dj,Lj,Bj,Bie,Y0t=(Bie=class extends J1{constructor(e,n,r){super();Je(this,Fs);Je(this,Iy);Je(this,cc);Je(this,Ty);Je(this,Py);Je(this,lc);Je(this,Nf);Je(this,F3);Je(this,U3);Je(this,z3,[]);Xe(this,Iy,e),Xe(this,Py,r),Xe(this,Ty,[]),Xe(this,lc,[]),Xe(this,cc,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&ne(this,lc).forEach(e=>{e.subscribe(n=>{Mt(this,Fs,Lj).call(this,e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,ne(this,lc).forEach(e=>{e.destroy()})}setQueries(e,n){Xe(this,Ty,e),Xe(this,Py,n),wi.batch(()=>{const r=ne(this,lc),i=Mt(this,Fs,Dj).call(this,ne(this,Ty));Xe(this,z3,i),i.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const s=i.map(c=>c.observer),o=s.map(c=>c.getCurrentResult()),a=s.some((c,l)=>c!==r[l]);r.length===s.length&&!a||(Xe(this,lc,s),Xe(this,cc,o),this.hasListeners()&&(UJ(r,s).forEach(c=>{c.destroy()}),UJ(s,r).forEach(c=>{c.subscribe(l=>{Mt(this,Fs,Lj).call(this,c,l)})}),Mt(this,Fs,Bj).call(this)))})}getCurrentResult(){return ne(this,cc)}getQueries(){return ne(this,lc).map(e=>e.getCurrentQuery())}getObservers(){return ne(this,lc)}getOptimisticResult(e,n){const r=Mt(this,Fs,Dj).call(this,e),i=r.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[i,s=>Mt(this,Fs,Nj).call(this,s??i,n),()=>Mt(this,Fs,jj).call(this,i,r)]}},Iy=new WeakMap,cc=new WeakMap,Ty=new WeakMap,Py=new WeakMap,lc=new WeakMap,Nf=new WeakMap,F3=new WeakMap,U3=new WeakMap,z3=new WeakMap,Fs=new WeakSet,jj=function(e,n){return n.map((r,i)=>{const s=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,o=>{n.forEach(a=>{a.observer.trackProp(o)})})})},Nj=function(e,n){return n?((!ne(this,Nf)||ne(this,cc)!==ne(this,U3)||n!==ne(this,F3))&&(Xe(this,F3,n),Xe(this,U3,ne(this,cc)),Xe(this,Nf,YB(ne(this,Nf),n(e)))),ne(this,Nf)):e},Dj=function(e){const n=new Map(ne(this,lc).map(i=>[i.options.queryHash,i])),r=[];return e.forEach(i=>{const s=ne(this,Iy).defaultQueryOptions(i),o=n.get(s.queryHash);o?r.push({defaultedQueryOptions:s,observer:o}):r.push({defaultedQueryOptions:s,observer:new JB(ne(this,Iy),s)})}),r},Lj=function(e,n){const r=ne(this,lc).indexOf(e);r!==-1&&(Xe(this,cc,Z0t(ne(this,cc),r,n)),Mt(this,Fs,Bj).call(this))},Bj=function(){var e;if(this.hasListeners()){const n=ne(this,Nf),r=Mt(this,Fs,jj).call(this,ne(this,cc),ne(this,z3)),i=Mt(this,Fs,Nj).call(this,r,(e=ne(this,Py))==null?void 0:e.combine);n!==i&&wi.batch(()=>{this.listeners.forEach(s=>{s(ne(this,cc))})})}},Bie),Df,Lf,Xo,$d,qd,R8,Fj,Fie,Q0t=(Fie=class extends J1{constructor(n,r){super();Je(this,qd);Je(this,Df);Je(this,Lf);Je(this,Xo);Je(this,$d);Xe(this,Df,n),this.setOptions(r),this.bindMethods(),Mt(this,qd,R8).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=ne(this,Df).defaultMutationOptions(n),X9(this.options,r)||ne(this,Df).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ne(this,Xo),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&P1(r.mutationKey)!==P1(this.options.mutationKey)?this.reset():((i=ne(this,Xo))==null?void 0:i.state.status)==="pending"&&ne(this,Xo).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=ne(this,Xo))==null||n.removeObserver(this)}onMutationUpdate(n){Mt(this,qd,R8).call(this),Mt(this,qd,Fj).call(this,n)}getCurrentResult(){return ne(this,Lf)}reset(){var n;(n=ne(this,Xo))==null||n.removeObserver(this),Xe(this,Xo,void 0),Mt(this,qd,R8).call(this),Mt(this,qd,Fj).call(this)}mutate(n,r){var i;return Xe(this,$d,r),(i=ne(this,Xo))==null||i.removeObserver(this),Xe(this,Xo,ne(this,Df).getMutationCache().build(ne(this,Df),this.options)),ne(this,Xo).addObserver(this),ne(this,Xo).execute(n)}},Df=new WeakMap,Lf=new WeakMap,Xo=new WeakMap,$d=new WeakMap,qd=new WeakSet,R8=function(){var r;const n=((r=ne(this,Xo))==null?void 0:r.state)??nme();Xe(this,Lf,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Fj=function(n){wi.batch(()=>{var r,i,s,o,a,c,l,u;if(ne(this,$d)&&this.hasListeners()){const d=ne(this,Lf).variables,h=ne(this,Lf).context;(n==null?void 0:n.type)==="success"?((i=(r=ne(this,$d)).onSuccess)==null||i.call(r,n.data,d,h),(o=(s=ne(this,$d)).onSettled)==null||o.call(s,n.data,null,d,h)):(n==null?void 0:n.type)==="error"&&((c=(a=ne(this,$d)).onError)==null||c.call(a,n.error,d,h),(u=(l=ne(this,$d)).onSettled)==null||u.call(l,void 0,n.error,d,h))}
452this.listeners.forEach(d=>{d(ne(this,Lf))})})},Fie),sme=E.createContext(void 0),oS=t=>{const e=E.useContext(sme);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},X0t=({client:t,children:e})=>(E.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),p.jsx(sme.Provider,{value:t,children:e})),ome=E.createContext(!1),ame=()=>E.useContext(ome);ome.Provider;function J0t(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var e1t=E.createContext(J0t()),cme=()=>E.useContext(e1t);function lme(t,e){return typeof t=="function"?t(...e):!!t}function eE(){}var ume=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},dme=t=>{E.useEffect(()=>{t.clearReset()},[t])},hme=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||lme(n,[t.error,r])),fme=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},pme=(t,e)=>t.isLoading&&t.isFetching&&!e,Uj=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,tE=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function t1t({queries:t,...e},n){const r=oS(),i=ame(),s=cme(),o=E.useMemo(()=>t.map(y=>{const v=r.defaultQueryOptions(y);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[t,r,i]);o.forEach(y=>{fme(y),ume(y,s)}),dme(s);const[a]=E.useState(()=>new Y0t(r,o,e)),[c,l,u]=a.getOptimisticResult(o,e.combine),d=!i&&e.subscribed!==!1;E.useSyncExternalStore(E.useCallback(y=>d?a.subscribe(wi.batchCalls(y)):eE,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),E.useEffect(()=>{a.setQueries(o,e)},[o,e,a]);const f=c.some((y,v)=>Uj(o[v],y))?c.flatMap((y,v)=>{const b=o[v];if(b){const C=new JB(r,b);if(Uj(b,y))return tE(b,C,s);pme(y,i)&&tE(b,C,s)}return[]}):[];if(f.length>0)throw Promise.all(f);const m=c.find((y,v)=>{const b=o[v];return b&&hme({result:y,errorResetBoundary:s,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(m!=null&&m.error)throw m.error;return l(u())}function n1t(t,e,n){var d,h,f,m,y;const r=oS(),i=ame(),s=cme(),o=r.defaultQueryOptions(t);(h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",fme(o),ume(o,s),dme(s);const a=!r.getQueryCache().get(o.queryHash),[c]=E.useState(()=>new e(r,o)),l=c.getOptimisticResult(o),u=!i&&t.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(v=>{const b=u?c.subscribe(wi.batchCalls(v)):eE;return c.updateResult(),b},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),E.useEffect(()=>{c.setOptions(o)},[o,c]),Uj(o,l))throw tE(o,c,s);if(hme({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((m=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||m.call(f,o,l),o.experimental_prefetchInRender&&!T1&&pme(l,i)){const v=a?tE(o,c,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;v==null||v.catch(eE).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function gme(t,e){return n1t(t,JB)}function au(t,e){const n=oS(),[r]=E.useState(()=>new Q0t(n,t));E.useEffect(()=>{r.setOptions(t)},[r,t]);const i=E.useSyncExternalStore(E.useCallback(o=>r.subscribe(wi.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=E.useCallback((o,a)=>{r.mutate(o,a).catch(eE)},[r]);if(i.error&&lme(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function r1t(t={}){const e=Q2(t);return E.useSyncExternalStore(n=>e0t(e,{onChange:n}),()=>vj(e),()=>vj(e))}function i1t(t={}){const{mutation:e}=t,n=Q2(t),r=I0t(n),{mutate:i,mutateAsync:s,...o}=au({...e,...r});return{...o,connectors:r1t({config:n}).map(a=>a.connector),disconnect:i,disconnectAsync:s}}function s1t(t={}){const{mutation:e}=t,n=Q2(t),r=T0t(n),{mutate:i,mutateAsync:s,...o}=au({...e,...r});return{...o,connectors:n.connectors,reconnect:i,reconnectAsync:s}}function o1t(t={}){const{mutation:e}=t,n=Q2(t),r=P0t(n),{mutate:i,mutateAsync:s,...o}=au({...e,...r});return{...o,signMessage:i,signMessageAsync:s}}var a1t=({setActiveWalletForWagmi:t})=>{let{wallets:e,ready:n}=Ap(),{user:r}=Fge(),i=Q2(),{reconnect:s}=s1t();fht({onSuccess:async o=>{var a,c;await((a=i.storage)==null?void 0:a.removeItem(`${o.meta.id}.disconnected`)),t||(await((c=i.storage)==null?void 0:c.setItem("recentConnectorId",o.meta.id)),s())}}),hht({onComplete:async(o,a,c,l,u)=>{var d;!u||u.type==="wallet"||!o.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")||await((d=i.storage)==null?void 0:d.removeItem("io.privy.wallet.disconnected"))}}),E.useEffect(()=>{t&&(async()=>{let o=t({wallets:e,user:r});if(!o){c1t(i),s();return}let[a]=await zJ([o],i);if(!a){console.error(`Failed to setup connector for ${o.address}`);return}await l1t(o,a,i),s()})()},[e,r,t]),E.useEffect(()=>{t||zJ(e,i).then(()=>{n&&s()})},[e,!t,n])},zJ=async(t,e)=>{let n=await Promise.all(t.map(async r=>{let i=await r.getEthereumProvider(),s=e.connectors.find(a=>a.id===r.meta.id);if(s)return s;let o=sS({target:{provider:i,id:r.meta.id,name:r.meta.name,icon:r.meta.icon}});return e._internal.connectors.setup(o)}));return e._internal.connectors.setState(n),n},c1t=t=>{t._internal.connectors.setState([]),t.setState(e=>({chainId:e.chainId,connections:new Map,current:void 0,status:"disconnected"}))},l1t=async(t,e,n)=>{var s,o;await Promise.all([(s=n.storage)==null?void 0:s.removeItem(`${t.meta.id}.disconnected`),(o=n.storage)==null?void 0:o.setItem("recentConnectorId",e.id)]);let r=Number(t.chainId.replace("eip155:",""));n.chains.find(a=>a.id===r)||(r=n.chains[0].id);let i=new Map([[e.uid,{accounts:[t.address],chainId:r,connector:e}]]);n.setState(a=>({...a,chainId:r,connections:i,current:e.uid,status:"connected"}))},u1t=({children:t,setActiveWalletForWagmi:e})=>(a1t({setActiveWalletForWagmi:e}),p.jsx(p.Fragment,{children:t})),d1t=({children:t,setActiveWalletForWagmi:e,...n})=>p.jsx(Gge,{reconnectOnMount:!1,...n,children:p.jsx(u1t,{setActiveWalletForWagmi:e,children:t})}),h1t=t=>{var e;return qge({ssr:!0,...t,connectors:(e=t.connectors)==null?void 0:e.filter(n=>n.type==="mock"),multiInjectedProviderDiscovery:!1})},f1t={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cac
452he. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function tF(t){return`[nuqs] ${f1t[t]} 453 See https://err.47ng.com/NUQS-${t}`}function p1t(t){if(t.size===0)return"";const e=[];for(const[r,i]of t.entries()){const s=r.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");e.push(`${s}=${g1t(i)}`)}return"?"+e.join("&")}function g1t(t){return t.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}var nF=y1t();function hRt(t,...e){if(!nF)return;const n=m1t(t,...e);performance.mark(n);try{console.log(t,...e)}catch{console.log(n)}}function fRt(t,...e){nF&&console.warn(t,...e)}function m1t(t,...e){return t.replace(/%[sfdO]/g,n=>{const r=e.shift();return n==="%O"&&r?JSON.stringify(r).replace(/"([^"]+)":/g,"$1:"):String(r)})}function y1t(){try{if(typeof localStorage>"u")return!1;const e="nuqs-localStorage-test";localStorage.setItem(e,e);const n=localStorage.getItem(e)===e;if(localStorage.removeItem(e),!n)return!1}catch(e){return console.error("[nuqs]: debug mode is disabled (localStorage unavailable).",e),!1}return(localStorage.getItem("debug")??"").includes("nuqs")}var v3=E.createContext({useAdapter(){throw new Error(tF(404))}});v3.displayName="NuqsAdapterContext";nF&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==v3&&console.error(tF(303)),window.__NuqsAdapterContext=v3);function w1t(t){return({children:e,...n})=>E.createElement(v3.Provider,{...n,value:{useAdapter:t}},e)}function pRt(){const t=E.useContext(v3);if(!("useAdapter"in t))throw new Error(tF(404));return t.useAdapter()}function v1t(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(i){i(n)}),(r=t.get("*"))&&r.slice().map(function(i){i(e,n)})}}}var zj=v1t();function b1t(t){return function(n,r){const i=new URL(location.href);i.search=p1t(n),t&&r.shallow===!1?(r.history==="push"?location.assign:location.replace).call(location,i):(r.history==="push"?history.pushState:history.replaceState).call(history,history.state,"",i),zj.emit("update",n),r.scroll===!0&&window.scrollTo({top:0})}}var mme=E.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function x1t(){const{fullPageNavigationOnShallowFalseUpdates:t}=E.useContext(mme),[e,n]=E.useState(()=>typeof location>"u"?new URLSearchParams:new URLSearchParams(location.search));E.useEffect(()=>{const i=()=>{n(new URLSearchParams(location.search))};return zj.on("update",n),window.addEventListener("popstate",i),()=>{zj.off("update",n),window.removeEventListener("popstate",i)}},[]);const r=E.useMemo(()=>b1t(t),[t]);return{searchParams:e,updateUrl:r}}var E1t=w1t(x1t);function C1t({children:t,fullPageNavigationOnShallowFalseUpdates:e=!1}){return E.createElement(mme.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:e}},E.createElement(E1t,null,t))}function yme(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,void 0),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const Wj=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return Wj(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Wj(r)(n)}}}},_1t=(t,e)=>(n,r,i)=>{let s={storage:yme(()=>localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...y)},r,i);const u=()=>{const y=s.partialize({...r()});return l.setItem(s.name,{state:y,version:s.version})},d=i.setState;i.setState=(y,v)=>{d(y,v),u()};const h=t((...y)=>{n(...y),u()},r,i);i.getInitialState=()=>h;let f;const m=()=>{var y,v;if(!l)return;o=!1,a.forEach(C=>{var x;return C((x=r())!=null?x:h)});const b=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(y=r())!=null?y:h))||void 0;return Wj(l.getItem.bind(l))(s.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==s.version){if(s.migrate){const x=s.migrate(C.state,C.version);return x instanceof Promise?x.then(_=>[!0,_]):[!0,x]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var x;const[_,$]=C;if(f=s.merge($,(x=r())!=null?x:h),n(f,!0),_)return u()}).then(()=>
453{b==null||b(f,void 0),f=r(),o=!0,c.forEach(C=>C(f))}).catch(C=>{b==null||b(void 0,C)})};return i.persist={setOptions:y=>{s={...s,...y},y.storage&&(l=y.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(c.add(y),()=>{c.delete(y)})},s.skipHydration||m(),f||h},S1t=_1t;var xv={exports:{}},BT={},FT,WJ;function A1t(){if(WJ)return FT;WJ=1;function t(e,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return FT=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var n=new Date().getTime();if(e&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},r),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,n){this._fn=e,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},n=null,r=0,i=0;i<this._errors.length;i++){var s=this._errors[i],o=s.message,a=(e[o]||0)+1;e[o]=a,a>=r&&(n=s,r=a)}return n},FT}var HJ;function k1t(){return HJ||(HJ=1,function(t){var e=A1t();t.operation=function(n){var r=t.timeouts(n);return new e(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},t.timeouts=function(n){if(n instanceof Array)return[].concat(n);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in n)r[i]=n[i];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<r.retries;o++)s.push(this.createTimeout(o,r));return n&&n.forever&&!s.length&&s.push(this.createTimeout(o,r)),s.sort(function(a,c){return a-c}),s},t.createTimeout=function(n,r){var i=r.randomize?Math.random()+1:1,s=Math.round(i*Math.max(r.minTimeout,1)*Math.pow(r.factor,n));return s=Math.min(s,r.maxTimeout),s},t.wrap=function(n,r,i){if(r instanceof Array&&(i=r,r=null),!i){i=[];for(var s in n)typeof n[s]=="function"&&i.push(s)}for(var o=0;o<i.length;o++){var a=i[o],c=n[a];n[a]=(function(u){var d=t.operation(r),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(m){d.retry(m)||(m&&(arguments[0]=d.mainError()),f.apply(this,arguments))}),d.attempt(function(){u.apply(n,h)})}).bind(n,c),n[a].options=r}}}(BT)),BT}var UT,VJ;function $1t(){return VJ||(VJ=1,UT=k1t()),UT}var qJ;function I1t(){if(qJ)return xv.exports;qJ=1;const t=$1t(),e=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];
453class n extends Error{constructor(a){super(),a instanceof Error?(this.originalError=a,{message:a}=a):(this.originalError=new Error(a),this.originalError.stack=this.stack),this.name="AbortError",this.message=a}}const r=(o,a,c)=>{const l=c.retries-(a-1);return o.attemptNumber=a,o.retriesLeft=l,o},i=o=>e.includes(o),s=(o,a)=>new Promise((c,l)=>{a={onFailedAttempt:()=>{},retries:10,...a};const u=t.operation(a);u.attempt(async d=>{try{c(await o(d))}catch(h){if(!(h instanceof Error)){l(new TypeError(`Non-error was thrown: "${h}". You should only throw errors.`));return}if(h instanceof n)u.stop(),l(h.originalError);else if(h instanceof TypeError&&!i(h.message))u.stop(),l(h);else{r(h,d,a);try{await a.onFailedAttempt(h)}catch(f){l(f);return}u.retry(h)||l(u.mainError())}}})});return xv.exports=s,xv.exports.default=s,xv.exports.AbortError=n,xv.exports}var T1t=I1t();const P1t=ys(T1t);var _6={},zT={exports:{}},KJ;function R1t(){return KJ||(KJ=1,function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,d,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var f=new i(u,d||c,h),m=n?n+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],f]:c._events[m].push(f):(c._events[m]=f,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,d;if(this._eventsCount===0)return l;for(d in u=this._events)e.call(u,d)&&l.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=n?n+l:l,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,f=d.length,m=new Array(f);h<f;h++)m[h]=d[h].fn;return m},a.prototype.listenerCount=function(l){var u=n?n+l:l,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(l,u,d,h,f,m){var y=n?n+l:l;if(!this._events[y])return!1;var v=this._events[y],b=arguments.length,C,x;if(v.fn){switch(v.once&&this.removeListener(l,v.fn,void 0,!0),b){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,u),!0;case 3:return v.fn.call(v.context,u,d),!0;case 4:return v.fn.call(v.context,u,d,h),!0;case 5:return v.fn.call(v.context,u,d,h,f),!0;case 6:return v.fn.call(v.context,u,d,h,f,m),!0}for(x=1,C=new Array(b-1);x<b;x++)C[x-1]=arguments[x];v.fn.apply(v.context,C)}else{var _=v.length,$;for(x=0;x<_;x++)switch(v[x].once&&this.removeListener(l,v[x].fn,void 0,!0),b){case 1:v[x].fn.call(v[x].context);break;case 2:v[x].fn.call(v[x].context,u);break;case 3:v[x].fn.call(v[x].context,u,d);break;case 4:v[x].fn.call(v[x].context,u,d,h);break;default:if(!C)for($=1,C=new Array(b-1);$<b;$++)C[$-1]=arguments[$];v[x].fn.apply(v[x].context,C)}}return!0},a.prototype.on=function(l,u,d){return s(this,l,u,d,!1)},a.prototype.once=function(l,u,d){return s(this,l,u,d,!0)},a.prototype.removeListener=function(l,u,d,h){var f=n?n+l:l;if(!this._events[f])return this;if(!u)return o(this,f),this;var m=this._events[f];if(m.fn)m.fn===u&&(!h||m.once)&&(!d||m.context===d)&&o(this,f);else{for(var y=0,v=[],b=m.length;y<b;y++)(m[y].fn!==u||h&&!m[y].once||d&&m[y].context!==d)&&v.push(m[y]);v.length?this._events[f]=v.length===1?v[0]:v:o(this,f)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&o(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(zT)),zT.exports}var Ev={exports:{}},WT,GJ;function M1t(){return GJ||(GJ=1,WT=(t,e)=>(e=e||(()=>{}),t.then(n=>new Promise(r=>{r(e())}).then(()=>n),n=>new Promise(r=>{r(e())}).then(()=>{throw n})))),WT}var ZJ;function O1t(){if(ZJ)return Ev.exports;ZJ=1;const t=M1t();class e extends Error{constructor(i){super(i),this.name="TimeoutError"}}const n=(r,i,s)=>new Promise((o,a)=>{if(typeof i!="number"||i<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(i===1/0){o(r);return}const c=setTimeout(()=>{if(typeof s=="function"){try{o(s())}catch(d){a(d)}return}const l=typeof s=="string"?s:`Promise timed out after ${i} milliseconds`,u=s instanceof Error?s:new e(l);typeof r.cancel=="function"&&r.cancel(),a(u)},i);t(r.then(o,a),()=>{clearTimeout(c)})});return Ev.exports=n,Ev.exports.default=n,Ev.exports.TimeoutError=e,Ev.exports}var S6={},A6={},YJ;function j1t(){if(YJ)return A6;YJ=1,Object.defineProperty(A6,"__esModule",{value:!0});function t(e,n,r){let i=0,s=e.length;for(;s>0;){const o=s/2|0;let a=i+o;r(e[a],n)<=0?(i=++a,s-=o+1):s=o}return i}return A6.default=t,A6}var QJ;function N1t(){if(QJ)return S6;QJ=1,Object.defineProperty(S6,"__esModule",{value:!0});const t=j1t();class e{constructor(){this._queue=[]}enqueue(r,i){i=Object.assign({priority:0},i);const s={priority:i.priority,run:r};if(this.size&&this._queue[this.size-1].priority>=i.priority){this._queue.push(s);return}const o=t.default(this._queue,s,(a,c)=>c.priority-a.priority);this._queue.splice(o,0,s)}dequeue(){const r=this._queue.shift();return r==null?void 0:r.run}filter(r){return this._queue.filter(i=>i.priority===r.priority).map(i=>i.run)}get size(){return this._queue.length}}
453return S6.default=e,S6}var XJ;function D1t(){if(XJ)return _6;XJ=1,Object.defineProperty(_6,"__esModule",{value:!0});const t=R1t(),e=O1t(),n=N1t(),r=()=>{},i=new e.TimeoutError;class s extends t{constructor(a){var c,l,u,d;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=r,this._resolveIdle=r,a=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},a),!(typeof a.intervalCap=="number"&&a.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(l=(c=a.intervalCap)===null||c===void 0?void 0:c.toString())!==null&&l!==void 0?l:""}\` (${typeof a.intervalCap})`);if(a.interval===void 0||!(Number.isFinite(a.interval)&&a.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(d=(u=a.interval)===null||u===void 0?void 0:u.toString())!==null&&d!==void 0?d:""}\` (${typeof a.interval})`);this._carryoverConcurrencyCount=a.carryoverConcurrencyCount,this._isIntervalIgnored=a.intervalCap===1/0||a.interval===0,this._intervalCap=a.intervalCap,this._interval=a.interval,this._queue=new a.queueClass,this._queueClass=a.queueClass,this.concurrency=a.concurrency,this._timeout=a.timeout,this._throwOnTimeout=a.throwOnTimeout===!0,this._isPaused=a.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=r,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=r,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const a=Date.now();if(this._intervalId===void 0){const c=this._intervalEnd-a;if(c<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},c)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const a=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const c=this._queue.dequeue();return c?(this.emit("active"),c(),a&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(a){if(!(typeof a=="number"&&a>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${a}\` (${typeof a})`);this._concurrency=a,this._processQueue()}async add(a,c={}){return new Promise((l,u)=>{const d=async()=>{this._pendingCount++,this._intervalCount++;try{const h=this._timeout===void 0&&c.timeout===void 0?a():e.default(Promise.resolve(a()),c.timeout===void 0?this._timeout:c.timeout,()=>{(c.throwOnTimeout===void 0?this._throwOnTimeout:c.throwOnTimeout)&&u(i)});l(await h)}catch(h){u(h)}this._next()};this._queue.enqueue(d,c),this._tryToStartAnother(),this.emit("add")})}async addAll(a,c){return Promise.all(a.map(async l=>this.add(l,c)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(a=>{const c=this._resolveEmpty;this._resolveEmpty=()=>{c(),a()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(a=>{const c=this._resolveIdle;this._resolveIdle=()=>{c(),a()}})}get size(){return this._queue.size}sizeBy(a){return this._queue.filter(a).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(a){this._timeout=a}}return _6.default=s,_6}var L1t=D1t();const HT=ys(L1t),B1t=(...t)=>fetch(...t),F1t=Symbol.for("lg:fetch_implementation"),U1t=()=>globalThis[F1t]??B1t,z1t=[400,401,402,403,404,405,406,407,408,409,422];function W1t(t){return t==null||typeof t!="object"?!1:"status"in t&&"statusText"in t&&"text"in t}
453class b3 extends Error{constructor(e,n,r){super(`HTTP ${e}: ${n}`),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.status=e,this.text=n,this.response=r}static async fromResponse(e,n){try{return new b3(e.status,await e.text(),n!=null&&n.includeResponse?e:void 0)}catch{return new b3(e.status,e.statusText,n!=null&&n.includeResponse?e:void 0)}}}class H1t{constructor(e){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"customFetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??4,"default"in HT?this.queue=new HT.default({concurrency:this.maxConcurrency}):this.queue=new HT({concurrency:this.maxConcurrency}),this.onFailedResponseHook=e==null?void 0:e.onFailedResponseHook,this.customFetch=e.fetch}call(e,...n){const{onFailedResponseHook:r}=this;return this.queue.add(()=>P1t(()=>e(...n).catch(async i=>{throw i instanceof Error?i:W1t(i)?await b3.fromResponse(i,{includeResponse:!!r}):new Error(i)}),{async onFailedAttempt(i){if(i.message.startsWith("Cancel")||i.message.startsWith("TimeoutError")||i.message.startsWith("AbortError")||(i==null?void 0:i.code)==="ECONNABORTED")throw i;if(i instanceof b3){if(z1t.includes(i.status))throw i;r&&i.response&&await r(i.response)}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,n,...r){return e.signal?Promise.race([this.call(n,...r),new Promise((i,s)=>{var o;(o=e.signal)==null||o.addEventListener("abort",()=>{s(new Error("AbortError"))})})]):this.call(n,...r)}fetch(...e){const n=this.customFetch??U1t();return this.call(()=>n(...e).then(r=>r.ok?r:Promise.reject(r)))}}var VT={};function V1t(t){try{return typeof process<"u"?VT==null?void 0:VT[t]:void 0}catch{return}}function q1t(...t){const e=t.filter(r=>r!=null);if(e.length===0)return;if(e.length===1)return e[0];const n=new AbortController;for(const r of t){if(r!=null&&r.aborted)return n.abort(r.reason),n.signal;r==null||r.addEventListener("abort",()=>n.abort(r.reason),{once:!0})}return n.signal}const eb=13,Hj=10,K1t=0,JJ=58,G1t=32,Z1t=[eb,Hj];function x3(){let t=[],e=!1;return new TransformStream({start(){t=[],e=!1},transform(n,r){let i=n;if(e&&(i=M8([[eb],i]),e=!1),i.length>0&&i.at(-1)===eb&&(e=!0,i=i.subarray(0,-1)),!i.length)return;const s=Z1t.includes(i.at(-1)),o=i.length-1,{lines:a}=i.reduce((c,l,u)=>(c.from>u||((l===eb||l===Hj)&&(c.lines.push(i.subarray(c.from,u)),l===eb&&i[u+1]===Hj?c.from=u+2:c.from=u+1),u===o&&c.from<=o&&c.lines.push(i.subarray(c.from))),c),{lines:[],from:0});if(a.length===1&&!s){t.push(a[0]);return}t.length&&(t.push(a[0]),a[0]=M8(t),t=[]),s||a.length&&(t=[a.pop()]);for(const c of a)r.enqueue(c)},flush(n){t.length&&n.enqueue(M8(t))}})}function E3(){let t="",e=[],n="",r=null;const i=new TextDecoder;return new TransformStream({transform(s,o){if(!s.length){if(!t&&!e.length&&!n&&r==null)return;const u={id:n||void 0,event:t,data:e.length?eee(i,e):null};t="",e=[],r=null,o.enqueue(u);return}if(s[0]===JJ)return;const a=s.indexOf(JJ);if(a===-1)return;const c=i.decode(s.subarray(0,a));let l=s.subarray(a+1);if(l[0]===G1t&&(l=l.subarray(1)),c==="event")t=i.decode(l);else if(c==="data")e.push(l);else if(c==="id")l.indexOf(K1t)===-1&&(n=i.decode(l));else if(c==="retry"){const u=Number.parseInt(i.decode(l),10);Number.isNaN(u)||(r=u)}},flush(s){t&&s.enqueue({id:n||void 0,event:t,data:e.length?eee(i,e):null})}})}function M8(t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function eee(t,e){return JSON.parse(t.decode(M8(e)))}class up extends ReadableStream{constructor(){super(...arguments),Object.defineProperty(this,"reader",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{const e=await this.reader.read();return e.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:e.value}}catch(e){throw this.reader.releaseLock(),e}}async return(){if(this.ensureReader(),this.locked){const e=this.reader.cancel();this.reader.releaseLock(),await e}return{done:!0,value:void 0}}async throw(e){if(this.ensureReader(),this.locked){const n=this.reader.cancel();this.reader.releaseLock(),await n}throw e}async[Symbol.asyncDispose](){await this.return()}[Symbol.asyncIterator](){return this}static fromReadableStream(e){const n=e.getReader();return new up({start(r){return i();function i(){return n.read().then(({done:s,value:o})=>{if(s){r.close();return}return r.enqueue(o),i()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(e){return new up({async pull(n){const{value:r,done:i}=await e.next();i&&n.close(),n.enqueue(r)},async cancel(n){await e.return(n)}})}}function*Y1t(t){let e,n=!1;if(t instanceof Headers){const r=[];t.forEach((i,s)=>{r.push([s,i])}),e=r}else Array.isArray(t)?e=t:(n=!0,e=Object.entries(t??{}));for(const r of e){const i=r[0];
453if(typeof i!="string")throw new TypeError(`Expected header name to be a string, got ${typeof i}`);const s=Array.isArray(r[1])?r[1]:[r[1]];let o=!1;for(const a of s)a!==void 0&&(n&&!o&&(o=!0,yield[i,null]),yield[i,a])}}function tee(...t){const e=new Headers;for(const r of t)if(r)for(const[i,s]of Y1t(r))s===null?e.delete(i):e.append(i,s);const n=[];return e.forEach((r,i)=>{n.push([i,r])}),Object.fromEntries(n)}function Q1t(t){if(t)return t;const e=["LANGGRAPH","LANGSMITH","LANGCHAIN"];for(const n of e){const r=V1t(`${n}_API_KEY`);if(r)return r.trim().replace(/^["']|["']$/g,"")}}const X1t=/(\/threads\/(?<thread_id>.+))?\/runs\/(?<run_id>.+)/;function qT(t){var r;const e=t.headers.get("Content-Location");if(!e)return;const n=X1t.exec(e);if((r=n==null?void 0:n.groups)!=null&&r.run_id)return{run_id:n.groups.run_id,thread_id:n.groups.thread_id||void 0}}class X2{constructor(e){var s;Object.defineProperty(this,"asyncCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeoutMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const n={maxRetries:4,maxConcurrency:4,...e==null?void 0:e.callerOptions};let r="http://localhost:8123";if(!(e!=null&&e.apiUrl)&&typeof globalThis=="object"&&globalThis!=null){const o=Symbol.for("langgraph_api:fetch"),a=Symbol.for("langgraph_api:url"),c=globalThis;c[o]&&(n.fetch??(n.fetch=c[o])),c[a]&&(r=c[a])}this.asyncCaller=new H1t(n),this.timeoutMs=e==null?void 0:e.timeoutMs,this.apiUrl=((s=e==null?void 0:e.apiUrl)==null?void 0:s.replace(/\/$/,""))||r,this.defaultHeaders=(e==null?void 0:e.defaultHeaders)||{},this.onRequest=e==null?void 0:e.onRequest;const i=Q1t(e==null?void 0:e.apiKey);i&&(this.defaultHeaders["x-api-key"]=i)}prepareFetchOptions(e,n){const r={...n,headers:tee(this.defaultHeaders,n==null?void 0:n.headers)};r.json&&(r.body=JSON.stringify(r.json),r.headers=tee(r.headers,{"content-type":"application/json"}),delete r.json),r.withResponse&&delete r.withResponse;let i=null;typeof(n==null?void 0:n.timeoutMs)<"u"?n.timeoutMs!=null&&(i=AbortSignal.timeout(n.timeoutMs)):this.timeoutMs!=null&&(i=AbortSignal.timeout(this.timeoutMs)),r.signal=q1t(i,r.signal);const s=new URL(`${this.apiUrl}${e}`);if(r.params){for(const[o,a]of Object.entries(r.params)){if(a==null)continue;const c=typeof a=="string"||typeof a=="number"?a.toString():JSON.stringify(a);s.searchParams.append(o,c)}delete r.params}return[s,r]}async fetch(e,n){const[r,i]=this.prepareFetchOptions(e,n);let s=i;this.onRequest&&(s=await this.onRequest(r,i));const o=await this.asyncCaller.fetch(r,s),a=(()=>{if(!(o.status===202||o.status===204))return o.json()})();return n!=null&&n.withResponse?[await a,o]:a}}class J1t extends X2{async createForThread(e,n,r){const i={schedule:r==null?void 0:r.schedule,input:r==null?void 0:r.input,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring};return this.fetch(`/threads/${e}/runs/crons`,{method:"POST",json:i})}async create(e,n){const r={schedule:n==null?void 0:n.schedule,input:n==null?void 0:n.input,config:n==null?void 0:n.config,metadata:n==null?void 0:n.metadata,assistant_id:e,interrupt_before:n==null?void 0:n.interruptBefore,interrupt_after:n==null?void 0:n.interruptAfter,webhook:n==null?void 0:n.webhook,multitask_strategy:n==null?void 0:n.multitaskStrategy,if_not_exists:n==null?void 0:n.ifNotExists,checkpoint_during:n==null?void 0:n.checkpointDuring};return this.fetch("/runs/crons",{method:"POST",json:r})}async delete(e){await this.fetch(`/runs/crons/${e}`,{method:"DELETE"})}async search(e){return this.fetch("/runs/crons/search",{method:"POST",json:{assistant_id:(e==null?void 0:e.assistantId)??void 0,thread_id:(e==null?void 0:e.threadId)??void 0,limit:(e==null?void 0:e.limit)??10,offset:(e==null?void 0:e.offset)??0,sort_by:(e==null?void 0:e.sortBy)??void 0,sort_order:(e==null?void 0:e.sortOrder)??void 0}})}}class egt extends X2{async get(e){return this.fetch(`/assistants/${e}`)}async getGraph(e,n){return this.fetch(`/assistants/${e}/graph`,{params:{xray:n==null?void 0:n.xray}})}async getSchemas(e){return this.fetch(`/assistants/${e}/schemas`)}async getSubgraphs(e,n){return n!=null&&n.namespace?this.fetch(`/assistants/${e}/subgraphs/${n.namespace}`,{params:{recurse:n==null?void 0:n.recurse}}):this.fetch(`/assistants/${e}/subgraphs`,{params:{recurse:n==null?void 0:n.recurse}})}async create(e){return this.fetch("/assistants",{method:"POST",json:{graph_id:e.graphId,config:e.config,metadata:e.metadata,assistant_id:e.assistantId,if_exists:e.ifExists,name:e.name,description:e.description}})}async update(e,n){return this.fetch(`/assistants/${e}`,{method:"PATCH",json:{graph_id:n.graphId,config:n.config,metadata:n.metadata,name:n.name,description:n.description}})}async delete(e){return this.fetch(`/assistants/${e}`,{method:"DELETE"})}async search(e){return this.fetch("/assistants/search",{method:"POST",json:{graph_id:(e==null?void 0:e.graphId)??void 0,metadata:(e==null?void 0:e.metadata)??void 0,limit:(e==null?void 0:e.limit)??10,offset:(e==null?void 0:e.offset)??0,sort_by:(e==null?void 0:e.sortBy)??void 0,sort_order:(e==null?void 0:e.sortOrder)??void 0}})}async getVersions(e,n){return this.fetch(`/assistants/${e}/versions`,{method:"POST",json:{metadata:(n==null?void 0:n.metadata)??void 0,limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0}})}async setLatest(e,n){return this.fetch(`/assistants/${e}/latest`,{method:"POST",json:{version:n}})}}class tgt extends X2{async get(e){return this.fetch(`/threads/${e}`)}async create(e){var n;return this.fetch("/threads",{method:"POST",json:{metadata:{...e==null?void 0:e.metadata,graph_id:e==null?void 0:e.graphId},thread_id:e==null?void 0:e.threadId,if_exists:e==null?void 0:e.ifExists,supersteps:(n=e==null?void 0:e.supersteps)==null?void 0:n.map(r=>({updates:r.updates.map(i=>({values:i.values,command:i.command,as_node:i.asNode}))}))}})}async copy(e){return this.fetch(`/threads/${e}/copy`,{method:"POST"})}async update(e,n){return this.fetch(`/threads/${e}`,{method:"PATCH",json:{metadata:n==null?void 0:n.metadata}})}async delete(e){return this.fetch(`/threads/${e}`,{method:"DELETE"})}async search(e){return this.fetch("/threads/search",{method:"POST",json:{metadata:(e==null?void 0:e.metadata)??void 0,limit:(e==null?void 0:e.limit)??10,offset:(e==null?void 0:e.offset)??0,status:e==null?void 0:e.status,sort_by:e==null?void 0:e.sortBy,sort_order:e==null?void 0:e.sortOrder}})}
453async getState(e,n,r){return n!=null?typeof n!="string"?this.fetch(`/threads/${e}/state/checkpoint`,{method:"POST",json:{checkpoint:n,subgraphs:r==null?void 0:r.subgraphs}}):this.fetch(`/threads/${e}/state/${n}`,{params:{subgraphs:r==null?void 0:r.subgraphs}}):this.fetch(`/threads/${e}/state`,{params:{subgraphs:r==null?void 0:r.subgraphs}})}async updateState(e,n){return this.fetch(`/threads/${e}/state`,{method:"POST",json:{values:n.values,checkpoint_id:n.checkpointId,checkpoint:n.checkpoint,as_node:n==null?void 0:n.asNode}})}async patchState(e,n){var i;let r;if(typeof e!="string"){if(typeof((i=e.configurable)==null?void 0:i.thread_id)!="string")throw new Error("Thread ID is required when updating state with a config.");r=e.configurable.thread_id}else r=e;return this.fetch(`/threads/${r}/state`,{method:"PATCH",json:{metadata:n}})}async getHistory(e,n){return this.fetch(`/threads/${e}/history`,{method:"POST",json:{limit:(n==null?void 0:n.limit)??10,before:n==null?void 0:n.before,metadata:n==null?void 0:n.metadata,checkpoint:n==null?void 0:n.checkpoint}})}}class wme extends X2{async*stream(e,n,r){var l;const i={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,stream_mode:r==null?void 0:r.streamMode,stream_subgraphs:r==null?void 0:r.streamSubgraphs,stream_resumable:r==null?void 0:r.streamResumable,feedback_keys:r==null?void 0:r.feedbackKeys,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,on_completion:r==null?void 0:r.onCompletion,on_disconnect:r==null?void 0:r.onDisconnect,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring},s=e==null?"/runs/stream":`/threads/${e}/runs/stream`,o=await this.asyncCaller.fetch(...this.prepareFetchOptions(s,{method:"POST",json:i,timeoutMs:null,signal:r==null?void 0:r.signal})),a=qT(o);a&&((l=r==null?void 0:r.onRunCreated)==null||l.call(r,a));const c=(o.body||new ReadableStream({start:u=>u.close()})).pipeThrough(x3()).pipeThrough(E3());yield*up.fromReadableStream(c)}async create(e,n,r){var c,l,u;const i={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,stream_mode:r==null?void 0:r.streamMode,stream_subgraphs:r==null?void 0:r.streamSubgraphs,stream_resumable:r==null?void 0:r.streamResumable,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,webhook:r==null?void 0:r.webhook,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,multitask_strategy:r==null?void 0:r.multitaskStrategy,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring,langsmith_tracer:r!=null&&r._langsmithTracer?{project_name:(c=r==null?void 0:r._langsmithTracer)==null?void 0:c.projectName,example_id:(l=r==null?void 0:r._langsmithTracer)==null?void 0:l.exampleId}:void 0},[s,o]=await this.fetch(`/threads/${e}/runs`,{method:"POST",json:i,signal:r==null?void 0:r.signal,withResponse:!0}),a=qT(o);return a&&((u=r==null?void 0:r.onRunCreated)==null||u.call(r,a)),s}async createBatch(e){const n=e.map(r=>({...r,assistant_id:r.assistantId})).map(r=>Object.fromEntries(Object.entries(r).filter(([i,s])=>s!==void 0)));return this.fetch("/runs/batch",{method:"POST",json:n})}async wait(e,n,r){var u,d,h,f,m;const i={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,on_completion:r==null?void 0:r.onCompletion,on_disconnect:r==null?void 0:r.onDisconnect,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring,langsmith_tracer:r!=null&&r._langsmithTracer?{project_name:(u=r==null?void 0:r._langsmithTracer)==null?void 0:u.projectName,example_id:(d=r==null?void 0:r._langsmithTracer)==null?void 0:d.exampleId}:void 0},s=e==null?"/runs/wait":`/threads/${e}/runs/wait`,[o,a]=await this.fetch(s,{method:"POST",json:i,timeoutMs:null,signal:r==null?void 0:r.signal,withResponse:!0}),c=qT(a);if(c&&((h=r==null?void 0:r.onRunCreated)==null||h.call(r,c)),((r==null?void 0:r.raiseError)!==void 0?r.raiseError:!0)&&"__error__"in o&&typeof o.__error__=="object"&&o.__error__&&"error"in o.__error__&&"message"in o.__error__)throw new Error(`${(f=o.__error__)==null?void 0:f.error}: ${(m=o.__error__)==null?void 0:m.message}`);return o}async list(e,n){return this.fetch(`/threads/${e}/runs`,{params:{limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0,status:(n==null?void 0:n.status)??void 0}})}async get(e,n){return this.fetch(`/threads/${e}/runs/${n}`)}async cancel(e,n,r=!1,i="interrupt"){return this.fetch(`/threads/${e}/runs/${n}/cancel`,{method:"POST",params:{wait:r?"1":"0",action:i}})}async join(e,n,r){return this.fetch(`/threads/${e}/runs/${n}/join`,{timeoutMs:null,signal:r==null?void 0:r.signal})}async*joinStream(e,n,r){const i=typeof r=="object"&&r!=null&&r instanceof AbortSignal?{signal:r}:r,o=((await this.asyncCaller.fetch(...this.prepareFetchOptions(e!=null?`/threads/${e}/runs/${n}/stream`:`/runs/${n}/stream`,{method:"GET",timeoutMs:null,signal:i==null?void 0:i.signal,headers:i!=null&&i.lastEventId?{"Last-Event-ID":i.lastEventId}:void 0,params:{cancel_on_disconnect:i!=null&&i.cancelOnDisconnect?"1":"0",stream_mode:i==null?void 0:i.streamMode}}))).body||new ReadableStream({start:a=>a.close()})).pipeThrough(x3()).pipeThrough(E3());yield*up.fromReadableStream(o)}async delete(e,n){return this.fetch(`/threads/${e}/runs/${n}`,{method:"DELETE"})}}class ngt extends X2{async putItem(e,n,r,i){e.forEach(o=>{if(o.includes("."))throw new Error(`Invalid namespace label '${o}'. Namespace labels cannot contain periods ('.')`)});const s={namespace:e,key:n,value:r,index:i==null?void 0:i.index,ttl:i==null?void 0:i.ttl};return this.fetch("/store/items",{method:"PUT",json:s})}async getItem(e,n,r){e.forEach(o=>{if(o.includes("."))throw new Error(`Invalid namespace label '${o}'. Namespace labels cannot contain periods ('.')`)});const i={namespace:e.join("."),key:n};(r==null?void 0:r.refreshTtl)!==void 0&&(i.refresh_ttl=r.refreshTtl);const s=await this.fetch("/store/items",{params:i});return s?{...s,createdAt:s.created_at,updatedAt:s.updated_at}:null}async deleteItem(e,n){return e.forEach(r=>{if(r.includes("."))throw new Error(`Invalid namespace label '${r}'. Namespace labels cannot contain periods ('.')`)}),this.fetch("/store/items",{method:"DELETE",json:{namespace:e,key:n}})}
453async searchItems(e,n){const r={namespace_prefix:e,filter:n==null?void 0:n.filter,limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0,query:n==null?void 0:n.query,refresh_ttl:n==null?void 0:n.refreshTtl};return{items:(await this.fetch("/store/items/search",{method:"POST",json:r})).items.map(s=>({...s,createdAt:s.created_at,updatedAt:s.updated_at}))}}async listNamespaces(e){const n={prefix:e==null?void 0:e.prefix,suffix:e==null?void 0:e.suffix,max_depth:e==null?void 0:e.maxDepth,limit:(e==null?void 0:e.limit)??100,offset:(e==null?void 0:e.offset)??0};return this.fetch("/store/namespaces",{method:"POST",json:n})}}class S0 extends X2{static getOrCached(e,n){if(S0.promiseCache[e]!=null)return S0.promiseCache[e];const r=n();return S0.promiseCache[e]=r,r}async getComponent(e,n){return S0.getOrCached(`${this.apiUrl}-${e}-${n}`,async()=>(await this.asyncCaller.fetch(...this.prepareFetchOptions(`/ui/${e}`,{headers:{Accept:"text/html","Content-Type":"application/json"},method:"POST",json:{name:n}}))).text())}}Object.defineProperty(S0,"promiseCache",{enumerable:!0,configurable:!0,writable:!0,value:{}});class vme{constructor(e){Object.defineProperty(this,"assistants",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"threads",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"runs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"crons",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"~ui",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"~configHash",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this["~configHash"]=(()=>{var n,r,i,s;return JSON.stringify({apiUrl:e==null?void 0:e.apiUrl,apiKey:e==null?void 0:e.apiKey,timeoutMs:e==null?void 0:e.timeoutMs,defaultHeaders:e==null?void 0:e.defaultHeaders,maxConcurrency:(n=e==null?void 0:e.callerOptions)==null?void 0:n.maxConcurrency,maxRetries:(r=e==null?void 0:e.callerOptions)==null?void 0:r.maxRetries,callbacks:{onFailedResponseHook:((i=e==null?void 0:e.callerOptions)==null?void 0:i.onFailedResponseHook)!=null,onRequest:(e==null?void 0:e.onRequest)!=null,fetch:((s=e==null?void 0:e.callerOptions)==null?void 0:s.fetch)!=null}})})(),this.assistants=new egt(e),this.threads=new tgt(e),this.runs=new wme(e),this.crons=new J1t(e),this.store=new ngt(e),this["~ui"]=new S0(e)}}const nee=4e3,rgt="[REDACTED]",igt=/(authorization|signature|nonce|token|secret|private.?key|password)/i,sgt=[{name:"okx",pattern:/okx|okapp|okxwallet/i,label:"okx"},{name:"tokenpocket",pattern:/tokenpocket/i,label:"tokenpocket"},{name:"bitget",pattern:/bitget|bitkeep/i,label:"bitget"},{name:"metamask",pattern:/metamask/i,label:"metamask"},{name:"trust",pattern:/trust/i,label:"trust"},{name:"rabby",pattern:/rabby/i,label:"rabby"},{name:"coinbase",pattern:/coinbasewallet/i,label:"coinbasewallet"},{name:"imtoken",pattern:/imtoken/i,label:"imtoken"},{name:"binance",pattern:/binance|binancew3w|bnbwallet/i,label:"binance"},{name:"safepal",pattern:/safepal/i,label:"safepal"},{name:"mathwallet",pattern:/mathwallet/i,label:"mathwallet"},{name:"phantom",pattern:/phantom/i,label:"phantom"},{name:"bybit",pattern:/bybit/i,label:"bybit"},{name:"gate",pattern:/gatewallet|gateio/i,label:"gate"},{name:"onekey",pattern:/onekey/i,label:"onekey"},{name:"rainbow",pattern:/rainbow/i,label:"rainbow"},{name:"zerion",pattern:/zerion/i,label:"zerion"}],ogt=["okxwallet","ethereum","trustwallet","tokenpocket","bitkeep","bitgetWallet","BinanceChain","binancew3w","BinanceW3W","rabby","coinbaseWalletExtension","metamask","safepal","SafePalWallet","mathwallet","onekey","phantom","bybitWallet","gatewallet","rainbow","zerion"],agt=["isMetaMask","isOkxWallet","isOKExWallet","isTrust","isTrustWallet","isTokenPocket","isBitKeep","isBitget","isCoinbaseWallet","isRabby","isBinance","isSafePal","isMathWallet","isOneKey","isPhantom","isBybit","isGateWallet","isRainbow","isZerion"];function bme(t){if(t===null)return"null";if(Array.isArray(t))return"array";const e=typeof t;return e==="object"||e==="string"||e==="number"||e==="boolean"?e:"unknown"}function xme(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.keys(t)}function cgt(t){try{return JSON.stringify(t)}catch{return}}function Vj(t,e=new WeakSet){if(t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean")return t;if(typeof t!="object")return String(t);if(e.has(t))return"[Circular]";if(e.add(t),Array.isArray(t))return t.map(r=>Vj(r,e));const n={};for(const[r,i]of Object.entries(t))n[r]=igt.test(r)?rgt:Vj(i,e);return n}function Eme(t){const e=Vj(t),n=cgt(e);return!n||n.length<=nee?{value:e,truncated:!1}:{value:`${n.slice(0,nee)}...`,truncated:!0}}function lgt(){if(typeof navigator>"u")return;const t=navigator.connection;return(t==null?void 0:t.effectiveType)??(t==null?void 0:t.type)}function ugt(){if(typeof navigator>"u")return"";const t=navigator.userAgentData;return(t==null?void 0:t.platform)||navigator.platform||""}function dgt(t){return/win/i.test(t)?!0:/mac/i.test(t)?!(t==="MacIntel"&&typeof navigator<"u"&&navigator.maxTouchPoints>1):/linux/i.test(t)?!/android|arm|aarch/i.test(t):!1}function hgt(t,e){return/win/i.test(e)?"windows":/mac/i.test(e)?e==="MacIntel"&&typeof navigator<"u"&&navigator.maxTouchPoints>1?"ios":"macos":/iphone|ipad|ipod/i.test(e)?"ios":/android/i.test(e)||/android/i.test(t)?"android":/iphone|ipad|ipod/i.test(t)?"ios":/windows/i.test(t)?"windows":/mac os x|macintosh/i.test(t)?"macos":/linux/i.test(t)?"linux":"unknown"}function fgt(t){return/mobi|iphone|ipod|android/i.test(t)}function pgt(t,e){return dgt(e)?"desktop":/ipad|tablet/i.test(t)?"tablet":fgt(t)?"mobile":typeof window<"u"&&window.innerWidth>0?window.innerWidth<768?"mobile":"desktop":"unknown"}function ggt(){if(typeof window>"u")return[];const t=window;return ogt.filter(e=>e in t)}function mgt(){if(typeof window>"u")return[];const t=window.ethereum;if(!t||typeof t!="object")return[];const e=t;return agt.filter(n=>!!e[n])}function ygt(t){var s;const e=sgt.filter(({pattern:o})=>o.test(t)),n=ggt(),r=mgt();return{name:((s=e[0])==null?void 0:s.name)??wgt(n),uaMatched:e.map(({label:o})=>o),injectedKeys:n,providerFlags:r}}function wgt(t){if(t.includes("okxwallet"))return"okx";if(t.includes("tokenpocket"))return"tokenpocket";if(t.includes("bitgetWallet")||t.includes("bitkeep"))return"bitget";if(t.includes("trustwallet"))return"trust";if(t.includes("rabby"))return"rabby";if(t.includes("coinbaseWalletExtension"))return"coinbase";if(t.includes("metamask"))return"metamask";if(t.includes("BinanceChain")||t.includes("binancew3w")||t.includes("BinanceW3W"))return"binance";if(t.includes("safepal")||t.includes("SafePalWallet"))return"safepal";if(t.includes("mathwallet"))return"mathwallet";if(t.includes("onekey"))return"onekey";if(t.includes("phantom"))return"phantom";if(t.includes("bybitWallet"))return"bybit";if(t.includes("gatewallet"))return"gate";if(t.includes("rainbow"))return"rainbow";if(t.includes("zerion"))return"zerion"}function vgt(t,e){const n=/BubbleApp\//i.test(t),r=Db(),i=Ur(),s=i?oa():void 0;return{isApp:r||i||n,platform:r||n&&e==="android"?"android":s==="ios"||n&&e==="ios"?"ios":s==="android"?"android":void 0}}function bgt(t,e,n,r){return{type:r,os:n,userAgent:t,platform:e||void 0}}function xgt(){const t=typeof navigator>"u"?"":navigator.userAgent,e=ugt(),n=hgt(t,e),r=pgt(t,e),i=ygt(t);return{app:vgt(t,n),device:bgt(t,e,n,r),wallet:i,network:{online:typeof navigator>"u"?!0:navigator.onLine,connectionType:lgt()}}}function Egt(){return typeof window>"u"?{origin:"",pathname:""}:{origin:window.location.origin,pathname:window.location.pathname}}function Cgt(t){var e;return((e=t.name.split(".").pop())==null?void 0:e.toLowerCase())||""}function _gt(t){const e=Eme(t),n=t;return{hasUrl:!!(n!=null&&n.url),rawBody:e.value,rawBodyType:bme(t),rawBodyTruncated:e.truncated,bodyKeys:xme(t)}}function nE(t,e){if(!(!t||typeof t!="object"))return t[e]}function ree(t,...e){for(const n of e){const r=nE(t,n);if(typeof r=="number")return r;if(typeof r=="string"&&r.trim()){const i=Number(r);
vendor: 8,709 bytes, line 453
453if(Number.isFinite(i))return i}}}function k6(t,...e){for(const n of e){const r=nE(t,n);if(typeof r=="string"&&r.trim())return r}}function Sgt(t){const e=nE(t,"data");if(e!==void 0)return e;const n=nE(t,"response");if(n&&typeof n=="object")return n._data}function Agt(t){const e=Sgt(t),n=e===void 0?void 0:Eme(e),r=t instanceof Error?t.message:k6(t,"message")||String(t||"Upload failed");return{name:t instanceof Error?t.name:k6(t,"name"),message:r,status:ree(t,"status"),statusCode:ree(t,"statusCode"),statusText:k6(t,"statusText"),code:k6(t,"code"),rawData:n==null?void 0:n.value,rawDataType:e===void 0?void 0:bme(e),rawDataTruncated:n==null?void 0:n.truncated,dataKeys:xme(e)}}function kgt(t){var n,r,i;const e=Date.now();return{event:"upload_failed",time:new Date(e).toISOString(),client:xgt(),page:Egt(),file:{ext:Cgt(t.file),mimeType:t.file.type,size:t.file.size,lastModified:t.file.lastModified||void 0},upload:{startedAt:t.startedAt,endedAt:new Date(e).toISOString(),durationMs:e-t.startedAtMs,timeoutMs:t.timeoutMs},auth:{address:(n=t.session)==null?void 0:n.address,hasSession:!!t.session,hasAddress:!!((r=t.session)!=null&&r.address),hasSignature:!!((i=t.session)!=null&&i.signature),isIncognito:t.isIncognito},response:t.response===void 0?void 0:_gt(t.response),error:t.error===void 0?void 0:Agt(t.error)}}var O8={exports:{}};function $gt(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var j8={exports:{}},Igt=j8.exports,iee;function Zn(){return iee||(iee=1,function(t,e){(function(n,r){t.exports=r()})(Igt,function(){var n=n||function(r,i){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof Oa<"u"&&Oa.crypto&&(s=Oa.crypto),!s&&typeof $gt=="function")try{s=hle}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function C(){}return function(x){var _;return C.prototype=x,_=new C,C.prototype=null,_}}(),c={},l=c.lib={},u=l.Base=function(){return{extend:function(C){var x=a(this);return C&&x.mixIn(C),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var C=this.extend();return C.init.apply(C,arguments),C},init:function(){},mixIn:function(C){for(var x in C)C.hasOwnProperty(x)&&(this[x]=C[x]);C.hasOwnProperty("toString")&&(this.toString=C.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=l.WordArray=u.extend({init:function(C,x){C=this.words=C||[],x!=i?this.sigBytes=x:this.sigBytes=C.length*4},toString:function(C){return(C||f).stringify(this)},concat:function(C){var x=this.words,_=C.words,$=this.sigBytes,I=C.sigBytes;if(this.clamp(),$%4)for(var R=0;R<I;R++){var N=_[R>>>2]>>>24-R%4*8&255;x[$+R>>>2]|=N<<24-($+R)%4*8}else for(var T=0;T<I;T+=4)x[$+T>>>2]=_[T>>>2];return this.sigBytes+=I,this},clamp:function(){var C=this.words,x=this.sigBytes;C[x>>>2]&=4294967295<<32-x%4*8,C.length=r.ceil(x/4)},clone:function(){var C=u.clone.call(this);return C.words=this.words.slice(0),C},random:function(C){for(var x=[],_=0;_<C;_+=4)x.push(o());return new d.init(x,C)}}),h=c.enc={},f=h.Hex={stringify:function(C){for(var x=C.words,_=C.sigBytes,$=[],I=0;I<_;I++){var R=x[I>>>2]>>>24-I%4*8&255;$.push((R>>>4).toString(16)),$.push((R&15).toString(16))}return $.join("")},parse:function(C){for(var x=C.length,_=[],$=0;$<x;$+=2)_[$>>>3]|=parseInt(C.substr($,2),16)<<24-$%8*4;return new d.init(_,x/2)}},m=h.Latin1={stringify:function(C){for(var x=C.words,_=C.sigBytes,$=[],I=0;I<_;I++){var R=x[I>>>2]>>>24-I%4*8&255;$.push(String.fromCharCode(R))}return $.join("")},parse:function(C){for(var x=C.length,_=[],$=0;$<x;$++)_[$>>>2]|=(C.charCodeAt($)&255)<<24-$%4*8;return new d.init(_,x)}},y=h.Utf8={stringify:function(C){try{return decodeURIComponent(escape(m.stringify(C)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(C){return m.parse(unescape(encodeURIComponent(C)))}},v=l.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(C){typeof C=="string"&&(C=y.parse(C)),this._data.concat(C),this._nDataBytes+=C.sigBytes},_process:function(C){var x,_=this._data,$=_.words,I=_.sigBytes,R=this.blockSize,N=R*4,T=I/N;C?T=r.ceil(T):T=r.max((T|0)-this._minBufferSize,0);var O=T*R,U=r.min(O*4,I);if(O){for(var z=0;z<O;z+=R)this._doProcessBlock($,z);x=$.splice(0,O),_.sigBytes-=U}return new d.init(x,U)},clone:function(){var C=u.clone.call(this);return C._data=this._data.clone(),C},_minBufferSize:0});l.Hasher=v.extend({cfg:u.extend(),init:function(C){this.cfg=this.cfg.extend(C),this.reset()},reset:function(){v.reset.call(this),this._doReset()},update:function(C){return this._append(C),this._process(),this},finalize:function(C){C&&this._append(C);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(C){return function(x,_){return new C.init(_).finalize(x)}},_createHmacHelper:function(C){return function(x,_){return new b.HMAC.init(C,_).finalize(x)}}});var b=c.algo={};return c}(Math);return n})}(j8)),j8.exports}var N8={exports:{}},Tgt=N8.exports,see;function aS(){return see||(see=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Tgt,function(n){return function(r){var i=n,s=i.lib,o=s.Base,a=s.WordArray,c=i.x64={};c.Word=o.extend({init:function(l,u){this.high=l,this.low=u}}),c.WordArray=o.extend({init:function(l,u){l=this.words=l||[],u!=r?this.sigBytes=u:this.sigBytes=l.length*8},toX32:function(){for(var l=this.words,u=l.length,d=[],h=0;h<u;h++){var f=l[h];d.push(f.high),d.push(f.low)}return a.create(d,this.sigBytes)},clone:function(){for(var l=o.clone.call(this),u=l.words=this.words.slice(0),d=u.length,h=0;h<d;h++)u[h]=u[h].clone();return l}})}(),n})}(N8)),N8.exports}var D8={exports:{}},Pgt=D8.exports,oee;function Rgt(){return oee||(oee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Pgt,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,s=i.WordArray,o=s.init,a=s.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var l=c.byteLength,u=[],d=0;d<l;d++)u[d>>>2]|=c[d]<<24-d%4*8;o.call(this,u,l)}else o.apply(this,arguments)};a.prototype=s}}(),n.lib.WordArray})}(D8)),D8.exports}var L8={exports:{}},Mgt=L8.exports,aee;function Ogt(){return aee||(aee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Mgt,function(n){return function(){var r=n,i=r.lib,s=i.WordArray,o=r.enc;o.Utf16=o.Utf16BE={stringify:function(c){for(var l=c.words,u=c.sigBytes,d=[],h=0;h<u;h+=2){var f=l[h>>>2]>>>16-h%4*8&65535;d.push(String.fromCharCode(f))}return d.join("")},parse:function(c){for(var l=c.length,u=[],d=0;d<l;d++)u[d>>>1]|=c.charCodeAt(d)<<16-d%2*16;return s.create(u,l*2)}},o.Utf16LE={stringify:function(c){for(var l=c.words,u=c.sigBytes,d=[],h=0;h<u;h+=2){var f=a(l[h>>>2]>>>16-h%4*8&65535);d.push(String.fromCharCode(f))}return d.join("")},parse:function(c){for(var l=c.length,u=[],d=0;d<l;d++)u[d>>>1]|=a(c.charCodeAt(d)<<16-d%2*16);return s.create(u,l*2)}};function a(c){return c<<8&4278255360|c>>>8&16711935}}(),n.enc.Utf16})}(L8)),L8.exports}var B8={exports:{}},jgt=B8.exports,cee;function eg(){return cee||(cee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(jgt,function(n){return function(){var r=n,i=r.lib,s=i.WordArray,o=r.enc;o.Base64={stringify:function(c){var l=c.words,u=c.sigBytes,d=this._map;c.clamp();for(var h=[],f=0;f<u;f+=3)for(var m=l[f>>>2]>>>24-f%4*8&255,y=l[f+1>>>2]>>>24-(f+1)%4*8&255,v=l[f+2>>>2]>>>24-(f+2)%4*8&255,b=m<<16|y<<8|v,C=0;C<4&&f+C*.75<u;C++)h.push(d.charAt(b>>>6*(3-C)&63));var x=d.charAt(64);if(x)for(;h.length%4;)h.push(x);return h.join("")},parse:function(c){var l=c.length,u=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var h=0;h<u.length;h++)d[u.charCodeAt(h)]=h}var f=u.charAt(64);if(f){var m=c.indexOf(f);m!==-1&&(l=m)}return a(c,l,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
453+/="};function a(c,l,u){for(var d=[],h=0,f=0;f<l;f++)if(f%4){var m=u[c.charCodeAt(f-1)]<<f%4*2,y=u[c.charCodeAt(f)]>>>6-f%4*2,v=m|y;d[h>>>2]|=v<<24-h%4*8,h++}return s.create(d,h)}}(),n.enc.Base64})}(B8)),B8.exports}var F8={exports:{}},Ngt=F8.exports,lee;function Dgt(){return lee||(lee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Ngt,function(n){return function(){var r=n,i=r.lib,s=i.WordArray,o=r.enc;o.Base64url={stringify:function(c,l){l===void 0&&(l=!0);var u=c.words,d=c.sigBytes,h=l?this._safe_map:this._map;c.clamp();for(var f=[],m=0;m<d;m+=3)for(var y=u[m>>>2]>>>24-m%4*8&255,v=u[m+1>>>2]>>>24-(m+1)%4*8&255,b=u[m+2>>>2]>>>24-(m+2)%4*8&255,C=y<<16|v<<8|b,x=0;x<4&&m+x*.75<d;x++)f.push(h.charAt(C>>>6*(3-x)&63));var _=h.charAt(64);if(_)for(;f.length%4;)f.push(_);return f.join("")},parse:function(c,l){l===void 0&&(l=!0);var u=c.length,d=l?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var f=0;f<d.length;f++)h[d.charCodeAt(f)]=f}var m=d.charAt(64);if(m){var y=c.indexOf(m);y!==-1&&(u=y)}return a(c,u,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function a(c,l,u){for(var d=[],h=0,f=0;f<l;f++)if(f%4){var m=u[c.charCodeAt(f-1)]<<f%4*2,y=u[c.charCodeAt(f)]>>>6-f%4*2,v=m|y;d[h>>>2]|=v<<24-h%4*8,h++}return s.create(d,h)}}(),n.enc.Base64url})}(F8)),F8.exports}var U8={exports:{}},Lgt=U8.exports,uee;function tg(){return uee||(uee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Lgt,function(n){return function(r){var i=n,s=i.lib,o=s.WordArray,a=s.Hasher,c=i.algo,l=[];(function(){for(var y=0;y<64;y++)l[y]=r.abs(r.sin(y+1))*4294967296|0})();var u=c.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(y,v){for(var b=0;b<16;b++){var C=v+b,x=y[C];y[C]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var _=this._hash.words,$=y[v+0],I=y[v+1],R=y[v+2],N=y[v+3],T=y[v+4],O=y[v+5],U=y[v+6],z=y[v+7],L=y[v+8],S=y[v+9],k=y[v+10],M=y[v+11],W=y[v+12],H=y[v+13],D=y[v+14],V=y[v+15],B=_[0],P=_[1],j=_[2],G=_[3];B=d(B,P,j,G,$,7,l[0]),G=d(G,B,P,j,I,12,l[1]),j=d(j,G,B,P,R,17,l[2]),P=d(P,j,G,B,N,22,l[3]),B=d(B,P,j,G,T,7,l[4]),G=d(G,B,P,j,O,12,l[5]),j=d(j,G,B,P,U,17,l[6]),P=d(P,j,G,B,z,22,l[7]),B=d(B,P,j,G,L,7,l[8]),G=d(G,B,P,j,S,12,l[9]),j=d(j,G,B,P,k,17,l[10]),P=d(P,j,G,B,M,22,l[11]),B=d(B,P,j,G,W,7,l[12]),G=d(G,B,P,j,H,12,l[13]),j=d(j,G,B,P,D,17,l[14]),P=d(P,j,G,B,V,22,l[15]),B=h(B,P,j,G,I,5,l[16]),G=h(G,B,P,j,U,9,l[17]),j=h(j,G,B,P,M,14,l[18]),P=h(P,j,G,B,$,20,l[19]),B=h(B,P,j,G,O,5,l[20]),G=h(G,B,P,j,k,9,l[21]),j=h(j,G,B,P,V,14,l[22]),P=h(P,j,G,B,T,20,l[23]),B=h(B,P,j,G,S,5,l[24]),G=h(G,B,P,j,D,9,l[25]),j=h(j,G,B,P,N,14,l[26]),P=h(P,j,G,B,L,20,l[27]),B=h(B,P,j,G,H,5,l[28]),G=h(G,B,P,j,R,9,l[29]),j=h(j,G,B,P,z,14,l[30]),P=h(P,j,G,B,W,20,l[31]),B=f(B,P,j,G,O,4,l[32]),G=f(G,B,P,j,L,11,l[33]),j=f(j,G,B,P,M,16,l[34]),P=f(P,j,G,B,D,23,l[35]),B=f(B,P,j,G,I,4,l[36]),G=f(G,B,P,j,T,11,l[37]),j=f(j,G,B,P,z,16,l[38]),P=f(P,j,G,B,k,23,l[39]),B=f(B,P,j,G,H,4,l[40]),G=f(G,B,P,j,$,11,l[41]),j=f(j,G,B,P,N,16,l[42]),P=f(P,j,G,B,U,23,l[43]),B=f(B,P,j,G,S,4,l[44]),G=f(G,B,P,j,W,11,l[45]),j=f(j,G,B,P,V,16,l[46]),P=f(P,j,G,B,R,23,l[47]),B=m(B,P,j,G,$,6,l[48]),G=m(G,B,P,j,z,10,l[49]),j=m(j,G,B,P,D,15,l[50]),P=m(P,j,G,B,O,21,l[51]),B=m(B,P,j,G,W,6,l[52]),G=m(G,B,P,j,N,10,l[53]),j=m(j,G,B,P,k,15,l[54]),P=m(P,j,G,B,I,21,l[55]),B=m(B,P,j,G,L,6,l[56]),G=m(G,B,P,j,V,10,l[57]),j=m(j,G,B,P,U,15,l[58]),P=m(P,j,G,B,H,21,l[59]),B=m(B,P,j,G,T,6,l[60]),G=m(G,B,P,j,M,10,l[61]),j=m(j,G,B,P,R,15,l[62]),P=m(P,j,G,B,S,21,l[63]),_[0]=_[0]+B|0,_[1]=_[1]+P|0,_[2]=_[2]+j|0,_[3]=_[3]+G|0},_doFinalize:function(){var y=this._data,v=y.words,b=this._nDataBytes*8,C=y.sigBytes*8;v[C>>>5]|=128<<24-C%32;var x=r.floor(b/4294967296),_=b;v[(C+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,v[(C+64>>>9<<4)+14]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,y.sigBytes=(v.length+1)*4,this._process();for(var $=this._hash,I=$.words,R=0;R<4;R++){var N=I[R];I[R]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360}return $},clone:function(){var y=a.clone.call(this);return y._hash=this._hash.clone(),y}});function d(y,v,b,C,x,_,$){var I=y+(v&b|~v&C)+x+$;return(I<<_|I>>>32-_)+v}function h(y,v,b,C,x,_,$){var I=y+(v&C|b&~C)+x+$;return(I<<_|I>>>32-_)+v}function f(y,v,b,C,x,_,$){var I=y+(v^b^C)+x+$;return(I<<_|I>>>32-_)+v}function m(y,v,b,C,x,_,$){var I=y+(b^(v|~C))+x+$;return(I<<_|I>>>32-_)+v}i.MD5=a._createHelper(u),i.HmacMD5=a._createHmacHelper(u)}(Math),n.MD5})}(U8)),U8.exports}var z8={exports:{}},Bgt=z8.exports,dee;function Cme(){return dee||(dee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Bgt,function(n){return function(){var r=n,i=r.lib,s=i.WordArray,o=i.Hasher,a=r.algo,c=[],l=a.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,d){for(var h=this._hash.words,f=h[0],m=h[1],y=h[2],v=h[3],b=h[4],C=0;C<80;C++){if(C<16)c[C]=u[d+C]|0;else{var x=c[C-3]^c[C-8]^c[C-14]^c[C-16];c[C]=x<<1|x>>>31}var _=(f<<5|f>>>27)+b+c[C];C<20?_+=(m&y|~m&v)+1518500249:C<40?_+=(m^y^v)+1859775393:C<60?_+=(m&y|m&v|y&v)-1894007588:_+=(m^y^v)-899497514,b=v,v=y,y=m<<30|m>>>2,m=f,f=_}h[0]=h[0]+f|0,h[1]=h[1]+m|0,h[2]=h[2]+y|0,h[3]=h[3]+v|0,h[4]=h[4]+b|0},_doFinalize:function(){var u=this._data,d=u.words,h=this._nDataBytes*8,f=u.sigBytes*8;return d[f>>>5]|=128<<24-f%32,d[(f+64>>>9<<4)+14]=Math.floor(h/4294967296),d[(f+64>>>9<<4)+15]=h,u.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u}});r.SHA1=o._createHelper(l),r.HmacSHA1=o._createHmacHelper(l)}(),n.SHA1})}(z8)),z8.exports}var W8={exports:{}},Fgt=W8.exports,hee;function rF(){return hee||(hee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Fgt,function(n){return function(r){var i=n,s=i.lib,o=s.WordArray,a=s.Hasher,c=i.algo,l=[],u=[];(function(){function f(b){for(var C=r.sqrt(b),x=2;x<=C;x++)if(!(b%x))return!1;return!0}function m(b){return(b-(b|0))*4294967296|0}for(var y=2,v=0;v<64;)f(y)&&(v<8&&(l[v]=m(r.pow(y,1/2))),u[v]=m(r.pow(y,1/3)),v++),y++})();var d=[],h=c.SHA256=a.extend({_doReset:function(){this._hash=new o.init(l.slice(0))},_doProcessBlock:function(f,m){for(var y=this._hash.words,v=y[0],b=y[1],C=y[2],x=y[3],_=y[4],$=y[5],I=y[6],R=y[7],N=0;N<64;N++){if(N<16)d[N]=f[m+N]|0;else{var T=d[N-15],O=(T<<25|T>>>7)^(T<<14|T>>>18)^T>>>3,U=d[N-2],z=(U<<15|U>>>17)^(U<<13|U>>>19)^U>>>10;d[N]=O+d[N-7]+z+d[N-16]}var L=_&$^~_&I,S=v&b^v&C^b&C,k=(v<<30|v>>>2)^(v<<19|v>>>13)^(v<<10|v>>>22),M=(_<<26|_>>>6)^(_<<21|_>>>11)^(_<<7|_>>>25),W=R+M+L+u[N]+d[N],H=k+S;R=I,I=$,$=_,_=x+W|0,x=C,C=b,b=v,v=W+H|0}y[0]=y[0]+v|0,y[1]=y[1]+b|0,y[2]=y[2]+C|0,y[3]=y[3]+x|0,y[4]=y[4]+_|0,y[5]=y[5]+$|0,y[6]=y[6]+I|0,y[7]=y[7]+R|0},_doFinalize:function(){var f=this._data,m=f.words,y=this._nDataBytes*8,v=f.sigBytes*8;return m[v>>>5]|=128<<24-v%32,m[(v+64>>>9<<4)+14]=r.floor(y/4294967296),m[(v+64>>>9<<4)+15]=y,f.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var f=a.clone.call(this);return f._hash=this._hash.clone(),f}});i.SHA256=a._createHelper(h),i.HmacSHA256=a._createHmacHelper(h)}(Math),n.SHA256})}(W8)),W8.exports}var H8={exports:{}},Ugt=H8.exports,fee;function zgt(){return fee||(fee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),rF())})(Ugt,function(n){return function(){var r=n,i=r.lib,s=i.WordArray,o=r.algo,a=o.SHA256,c=o.SHA224=a.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var l=a._doFinalize.call(this);return l.sigBytes-=4,l}});r.SHA224=a._createHelper(c),r.HmacSHA224=a._createHmacHelper(c)}(),n.SHA224})}(H8)),H8.exports}var V8={exports:{}},Wgt=V8.exports,pee;function _me(){return pee||(pee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),aS())})(Wgt,function(n){return function(){var r=n,i=r.lib,s=i.Hasher,o=r.x64,a=o.Word,c=o.WordArray,l=r.algo;function u(){return a.create.apply(a,arguments)}var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(18164
vendor: 24,720 bytes, lines 453-466
45302316,1246189591)],h=[];(function(){for(var m=0;m<80;m++)h[m]=u()})();var f=l.SHA512=s.extend({_doReset:function(){this._hash=new c.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(m,y){for(var v=this._hash.words,b=v[0],C=v[1],x=v[2],_=v[3],$=v[4],I=v[5],R=v[6],N=v[7],T=b.high,O=b.low,U=C.high,z=C.low,L=x.high,S=x.low,k=_.high,M=_.low,W=$.high,H=$.low,D=I.high,V=I.low,B=R.high,P=R.low,j=N.high,G=N.low,Y=T,te=O,ae=U,oe=z,de=L,ke=S,Be=k,$e=M,He=W,Ge=H,je=D,xt=V,ft=B,it=P,be=j,Lt=G,Qe=0;Qe<80;Qe++){var Ue,Ye,tt=h[Qe];if(Qe<16)Ye=tt.high=m[y+Qe*2]|0,Ue=tt.low=m[y+Qe*2+1]|0;else{var ze=h[Qe-15],Ne=ze.high,J=ze.low,q=(Ne>>>1|J<<31)^(Ne>>>8|J<<24)^Ne>>>7,Z=(J>>>1|Ne<<31)^(J>>>8|Ne<<24)^(J>>>7|Ne<<25),se=h[Qe-2],he=se.high,fe=se.low,ye=(he>>>19|fe<<13)^(he<<3|fe>>>29)^he>>>6,nt=(fe>>>19|he<<13)^(fe<<3|he>>>29)^(fe>>>6|he<<26),vt=h[Qe-7],Nt=vt.high,mn=vt.low,At=h[Qe-16],En=At.high,yr=At.low;Ue=Z+mn,Ye=q+Nt+(Ue>>>0<Z>>>0?1:0),Ue=Ue+nt,Ye=Ye+ye+(Ue>>>0<nt>>>0?1:0),Ue=Ue+yr,Ye=Ye+En+(Ue>>>0<yr>>>0?1:0),tt.high=Ye,tt.low=Ue}var xn=He&je^~He&ft,kt=Ge&xt^~Ge&it,Ie=Y&ae^Y&de^ae&de,It=te&oe^te&ke^oe&ke,rt=(Y>>>28|te<<4)^(Y<<30|te>>>2)^(Y<<25|te>>>7),Zt=(te>>>28|Y<<4)^(te<<30|Y>>>2)^(te<<25|Y>>>7),yt=(He>>>14|Ge<<18)^(He>>>18|Ge<<14)^(He<<23|Ge>>>9),pt=(Ge>>>14|He<<18)^(Ge>>>18|He<<14)^(Ge<<23|He>>>9),St=d[Qe],qe=St.high,Et=St.low,Ze=Lt+pt,wt=be+yt+(Ze>>>0<Lt>>>0?1:0),Ze=Ze+kt,wt=wt+xn+(Ze>>>0<kt>>>0?1:0),Ze=Ze+Et,wt=wt+qe+(Ze>>>0<Et>>>0?1:0),Ze=Ze+Ue,wt=wt+Ye+(Ze>>>0<Ue>>>0?1:0),ot=Zt+It,qt=rt+Ie+(ot>>>0<Zt>>>0?1:0);be=ft,Lt=it,ft=je,it=xt,je=He,xt=Ge,Ge=$e+Ze|0,He=Be+wt+(Ge>>>0<$e>>>0?1:0)|0,Be=de,$e=ke,de=ae,ke=oe,ae=Y,oe=te,te=Ze+ot|0,Y=wt+qt+(te>>>0<Ze>>>0?1:0)|0}O=b.low=O+te,b.high=T+Y+(O>>>0<te>>>0?1:0),z=C.low=z+oe,C.high=U+ae+(z>>>0<oe>>>0?1:0),S=x.low=S+ke,x.high=L+de+(S>>>0<ke>>>0?1:0),M=_.low=M+$e,_.high=k+Be+(M>>>0<$e>>>0?1:0),H=$.low=H+Ge,$.high=W+He+(H>>>0<Ge>>>0?1:0),V=I.low=V+xt,I.high=D+je+(V>>>0<xt>>>0?1:0),P=R.low=P+it,R.high=B+ft+(P>>>0<it>>>0?1:0),G=N.low=G+Lt,N.high=j+be+(G>>>0<Lt>>>0?1:0)},_doFinalize:function(){var m=this._data,y=m.words,v=this._nDataBytes*8,b=m.sigBytes*8;y[b>>>5]|=128<<24-b%32,y[(b+128>>>10<<5)+30]=Math.floor(v/4294967296),y[(b+128>>>10<<5)+31]=v,m.sigBytes=y.length*4,this._process();var C=this._hash.toX32();return C},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m},blockSize:1024/32});r.SHA512=s._createHelper(f),r.HmacSHA512=s._createHmacHelper(f)}(),n.SHA512})}(V8)),V8.exports}var q8={exports:{}},Hgt=q8.exports,gee;function Vgt(){return gee||(gee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),aS(),_me())})(Hgt,function(n){return function(){var r=n,i=r.x64,s=i.Word,o=i.WordArray,a=r.algo,c=a.SHA512,l=a.SHA384=c.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u}});r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l)}(),n.SHA384})}(q8)),q8.exports}var K8={exports:{}},qgt=K8.exports,mee;function Kgt(){return mee||(mee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),aS())})(qgt,function(n){return function(r){var i=n,s=i.lib,o=s.WordArray,a=s.Hasher,c=i.x64,l=c.Word,u=i.algo,d=[],h=[],f=[];(function(){for(var v=1,b=0,C=0;C<24;C++){d[v+5*b]=(C+1)*(C+2)/2%64;var x=b%5,_=(2*v+3*b)%5;v=x,b=_}for(var v=0;v<5;v++)for(var b=0;b<5;b++)h[v+5*b]=b+(2*v+3*b)%5*5;for(var $=1,I=0;I<24;I++){for(var R=0,N=0,T=0;T<7;T++){if($&1){var O=(1<<T)-1;O<32?N^=1<<O:R^=1<<O-32}$&128?$=$<<1^113:$<<=1}f[I]=l.create(R,N)}})();var m=[];(function(){for(var v=0;v<25;v++)m[v]=l.create()})();var y=u.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var v=this._state=[],b=0;b<25;b++)v[b]=new l.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(v,b){for(var C=this._state,x=this.blockSize/2,_=0;_<x;_++){var $=v[b+2*_],I=v[b+2*_+1];$=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360,I=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360;var R=C[_];R.high^=I,R.low^=$}for(var N=0;N<24;N++){for(var T=0;T<5;T++){for(var O=0,U=0,z=0;z<5;z++){var R=C[T+5*z];O^=R.high,U^=R.low}var L=m[T];L.high=O,L.low=U}for(var T=0;T<5;T++)for(var S=m[(T+4)%5],k=m[(T+1)%5],M=k.high,W=k.low,O=S.high^(M<<1|W>>>31),U=S.low^(W<<1|M>>>31),z=0;z<5;z++){var R=C[T+5*z];R.high^=O,R.low^=U}for(var H=1;H<25;H++){var O,U,R=C[H],D=R.high,V=R.low,B=d[H];B<32?(O=D<<B|V>>>32-B,U=V<<B|D>>>32-B):(O=V<<B-32|D>>>64-B,U=D<<B-32|V>>>64-B);var P=m[h[H]];P.high=O,P.low=U}var j=m[0],G=C[0];j.high=G.high,j.low=G.low;for(var T=0;T<5;T++)for(var z=0;z<5;z++){var H=T+5*z,R=C[H],Y=m[H],te=m[(T+1)%5+5*z],ae=m[(T+2)%5+5*z];R.high=Y.high^~te.high&ae.high,R.low=Y.low^~te.low&ae.low}var R=C[0],oe=f[N];R.high^=oe.high,R.low^=oe.low}},_doFinalize:function(){var v=this._data,b=v.words;this._nDataBytes*8;var C=v.sigBytes*8,x=this.blockSize*32;b[C>>>5]|=1<<24-C%32,b[(r.ceil((C+1)/x)*x>>>5)-1]|=128,v.sigBytes=b.length*4,this._process();for(var _=this._state,$=this.cfg.outputLength/8,I=$/8,R=[],N=0;N<I;N++){var T=_[N],O=T.high,U=T.low;O=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360,U=(U<<8|U>>>24)&16711935|(U<<24|U>>>8)&4278255360,R.push(U),R.push(O)}return new o.init(R,$)},clone:function(){for(var v=a.clone.call(this),b=v._state=this._state.slice(0),C=0;C<25;C++)b[C]=b[C].clone();return v}});i.SHA3=a._createHelper(y),i.HmacSHA3=a._createHmacHelper(y)}(Math),n.SHA3})}(K8)),K8.exports}var G8={exports:{}},Ggt=G8.exports,yee;function Zgt(){return yee||(yee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Ggt,function(n){/** @preserve 454 (c) 2012 by Cédric Mesnil. All rights reserved. 455 456 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 457 458 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 459 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 460 461 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 462 */return function(r){var i=n,s=i.lib,o=s.WordArray,a=s.Hasher,c=i.algo,l=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),h=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=o.create([0,1518500249,1859775393,2400959708,2840853838]),m=o.create([1352829926,1548603684,1836072691,2053994217,0]),y=c.RIPEMD160=a.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(I,R){for(var N=0;N<16;N++){var T=R+N,O=I[T];I[T]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}var U=this._hash.words,z=f.words,L=m.words,S=l.words,k=u.words,M=d.words,W=h.words,H,D,V,B,P,j,G,Y,te,ae;j=H=U[0],G=D=U[1],Y=V=U[2],te=B=U[3],ae=P=U[4];for(var oe,N=0;N<80;N+=1)oe=H+I[R+S[N]]|0,N<16?oe+=v(D,V,B)+z[0]:N<32?oe+=b(D,V,B)+z[1]:N<48?oe+=C(D,V,B)+z[2]:N<64?oe+=x(D,V,B)+z[3]:oe+=_(D,V,B)+z[4],oe=oe|0,oe=$(oe,M[N]),oe=oe+P|0,H=P,P=B,B=$(V,10),V=D,D=oe,oe=j+I[R+k[N]]|0,N<16?oe+=_(G,Y,te)+L[0]:N<32?oe+=x(G,Y,te)+L[1]:N<48?oe+=C(G,Y,te)+L[2]:N<64?oe+=b(G,Y,te)+L[3]:oe+=v(G,Y,te)+L[4],oe=oe|0,oe=$(oe,W[N]),oe=oe+ae|0,j=ae,ae=te,te=$(Y,10),Y=G,G=oe;oe=U[1]+V+te|0,U[1]=U[2]+B+ae|0,U[2]=U[3]+P+j|0,U[3]=U[4]+H+G|0,U[4]=U[0]+D+Y|0,U[0]=oe},_doFinalize:function(){var I=this._data,R=I.words,N=this._nDataBytes*8,T=I.sigBytes*8;R[T>>>5]|=128<<24-T%32,R[(T+64>>>9<<4)+14]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,I.sigBytes=(R.length+1)*4,this._process();for(var O=this._hash,U=O.words,z=0;z<5;z++){var L=U[z];U[z]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return O},clone:function(){var I=a.clone.call(this);return I._hash=this._hash.clone(),I}});function v(I,R,N){return I^R^N}function b(I,R,N){return I&R|~I&N}function C(I,R,N){return(I|~R)^N}function x(I,R,N){return I&N|R&~N}function _(I,R,N){return I^(R|~N)}function $(I,R){return I<<R|I>>>32-R}i.RIPEMD160=a._createHelper(y),i.HmacRIPEMD160=a._createHmacHelper(y)}(),n.RIPEMD160})}(G8)),G8.exports}var Z8={exports:{}},Ygt=Z8.exports,wee;function iF(){return wee||(wee=1,function(t,e){(function(n,r){t.exports=r(Zn())})(Ygt,function(n){(function(){var r=n,i=r.lib,s=i.Base,o=r.enc,a=o.Utf8,c=r.algo;c.HMAC=s.extend({init:function(l,u){l=this._hasher=new l.init,typeof u=="string"&&(u=a.parse(u));var d=l.blockSize,h=d*4;u.sigBytes>h&&(u=l.finalize(u)),u.clamp();for(var f=this._oKey=u.clone(),m=this._iKey=u.clone(),y=f.words,v=m.words,b=0;b<d;b++)y[b]^=1549556828,v[b]^=909522486;f.sigBytes=m.sigBytes=h,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var u=this._hasher,d=u.finalize(l);u.reset();var h=u.finalize(this._oKey.clone().concat(d));return h}})})()})}(Z8)),Z8.exports}var Y8={exports:{}},Qgt=Y8.exports,vee;function Xgt(){return vee||(vee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),rF(),iF())})(Qgt,function(n){return function(){var r=n,i=r.lib,s=i.Base,o=i.WordArray,a=r.algo,c=a.SHA256,l=a.HMAC,u=a.PBKDF2=s.extend({cfg:s.extend({keySize:128/32,hasher:c,iterations:25e4}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,h){for(var f=this.cfg,m=l.create(f.hasher,d),y=o.create(),v=o.create([1]),b=y.words,C=v.words,x=f.keySize,_=f.iterations;b.length<x;){var $=m.update(h).finalize(v);m.reset();for(var I=$.words,R=I.length,N=$,T=1;T<_;T++){N=m.finalize(N),m.reset();for(var O=N.words,U=0;U<R;U++)I[U]^=O[U]}y.concat($),C[0]++}return y.sigBytes=x*4,y}});r.PBKDF2=function(d,h,f){return u.create(f).compute(d,h)}}(),n.PBKDF2})}(Y8)),Y8.exports}var Q8={exports:{}},Jgt=Q8.exports,bee;function kp(){return bee||(bee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),Cme(),iF())})(Jgt,function(n){return function(){var r=n,i=r.lib,s=i.Base,o=i.WordArray,a=r.algo,c=a.MD5,l=a.EvpKDF=s.extend({cfg:s.extend({keySize:128/32,hasher:c,iterations:1}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,d){for(var h,f=this.cfg,m=f.hasher.create(),y=o.create(),v=y.words,b=f.keySize,C=f.iterations;v.length<b;){h&&m.update(h),h=m.update(u).finalize(d),m.reset();for(var x=1;x<C;x++)h=m.finalize(h),m.reset();y.concat(h)}return y.sigBytes=b*4,y}});r.EvpKDF=function(u,d,h){return l.create(h).compute(u,d)}}(),n.EvpKDF})}(Q8)),Q8.exports}var X8={exports:{}},emt=X8.exports,xee;function ws(){return xee||(xee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),kp())})(emt,function(n){n.lib.Cipher||function(r){var i=n,s=i.lib,o=s.Base,a=s.WordArray,c=s.BufferedBlockAlgorithm,l=i.enc;l.Utf8;var u=l.Base64,d=i.algo,h=d.EvpKDF,f=s.Cipher=c.extend({cfg:o.extend(),createEncryptor:function(O,U){return this.create(this._ENC_XFORM_MODE,O,U)},createDecryptor:function(O,U){return this.create(this._DEC_XFORM_MODE,O,U)},init:function(O,U,z){this.cfg=this.cfg.extend(z),this._xformMode=O,this._key=U,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(O){return this._append(O),this._process()},finalize:function(O){O&&this._append(O);var U=this._doFinalize();return U},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function O(U){return typeof U=="string"?T:I}return function(U){return{encrypt:function(z,L,S){return O(L).encrypt(U,z,L,S)},decrypt:function(z,L,S){return O(L).decrypt(U,z,L,S)}}}}()});s.StreamCipher=f.extend({_doFinalize:function(){var O=this._process(!0);return O},blockSize:1});var m=i.mode={},y=s.BlockCipherMode=o.extend({createEncryptor:function(O,U){return this.Encryptor.create(O,U)},createDecryptor:function(O,U){return this.Decryptor.create(O,U)},init:function(O,U){this._cipher=O,this._iv=U}}),v=m.CBC=function(){var O=y.extend();O.Encryptor=O.extend({processBlock:function(z,L){var S=this._cipher,k=S.blockSize;U.call(this,z,L,k),S.encryptBlock(z,L),this._prevBlock=z.slice(L,L+k)}}),O.Decryptor=O.extend({processBlock:function(z,L){var S=this._cipher,k=S.blockSize,M=z.slice(L,L+k);S.decryptBlock(z,L),U.call(this,z,L,k),this._prevBlock=M}});function U(z,L,S){var k,M=this._iv;M?(k=M,this._iv=r):k=this._prevBlock;for(var W=0;W<S;W++)z[L+W]^=k[W]}return O}(),b=i.pad={},C=b.Pkcs7={pad:function(O,U){for(var z=U*4,L=z-O.sigBytes%z,S=L<<24|L<<16|L<<8|L,k=[],M=0;M<L;M+=4)k.push(S);var W=a.create(k,L);O.concat(W)},unpad:function(O){var U=O.words[O.sigBytes-1>>>2]&255;O.sigBytes-=U}};s.BlockCipher=f.extend({cfg:f.cfg.extend({mode:v,padding:C}),reset:function(){var O;f.reset.call(this);var U=this.cfg,z=U.iv,L=U.mode;this._xformMode==this._ENC_XFORM_MODE?O=L.createEncryptor:(O=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==O?this._mode.init(this,z&&z.words):(this._mode=O.call(L,this,z&&z.words),this._mode.__creator=O)},_doProcessBlock:function(O,U){this._mode.processBlock(O,U)},_doFinalize:function(){var O,U=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(U.pad(this._data,this.blockSize),O=this._process(!0)):(O=this._process(!0),U.unpad(O)),O},blockSize:128/32});var x=s.CipherParams=o.extend({init:function(O){this.mixIn(O)},toString:function(O){return(O||this.formatter).stringify(this)}}),_=i.format={},$=_.OpenSSL={stringify:function(O){var U,z=O.ciphertext,L=O.salt;return L?U=a.create([1398893684,1701076831]).concat(L).concat(z):U=z,U.toString(u)},parse:function(O){var U,z=u.parse(O),L=z.words;return L[0]==1398893684&&L[1]==1701076831&&(U=a.create(L.slice(2,4)),L.splice(0,4),z.sigBytes-=16),x.create({ciphertext:z,salt:U})}},I=s.SerializableCipher=o.extend({cfg:o.extend({format:$}),encrypt:function(O,U,z,L){L=this.cfg.extend(L);var S=O.createEncryptor(z,L),k=S.finalize(U),M=S.cfg;return x.create({ciphertext:k,key:z,iv:M.iv,algorithm:O,mode:M.mode,padding:M.padding,blockSize:O.blockSize,formatter:L.format})},decrypt:function(O,U,z,L){L=this.cfg.extend(L),U=this._parse(U,L.format);var S=O.createDecryptor(z,L).finalize(U.ciphertext);return S},_parse:function(O,U){return typeof O=="string"?U.parse(O,this):O}}),R=i.kdf={},N=R.OpenSSL={execute:function(O,U,z,L,S){if(L||(L=a.random(64/8)),S)var k=h.create({keySize:U+z,hasher:S}).compute(O,L);else var k=h.create({keySize:U+z}).compute(O,L);var M=a.create(k.words.slice(U),z*4);return k.sigBytes=U*4,x.create({key:k,iv:M,salt:L})}},T=s.PasswordBasedCipher=I.extend({cfg:I.cfg.extend({kdf:N}),encrypt:function(O,U,z,L){L=this.cfg.extend(L);var S=L.kdf.execute(z,O.keySize,O.ivSize,L.salt,L.hasher);L.iv=S.iv;var k=I.encrypt.call(this,O,U,S.key,L);return k.mixIn(S),k},decrypt:function(O,U,z,L){L=this.cfg.extend(L),U=this._parse(U,L.format);var S=L.kdf.execute(z,O.keySize,O.ivSize,U.salt,L.hasher);L.iv=S.iv;var k=I.decrypt.call(this,O,U,S.key,L);return k}})}()})}(X8)),X8.exports}var J8={exports:{}},tmt=J8.exports,Eee;function nmt(){return Eee||(Eee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(tmt,function(n){return n.mode.CFB=function(){var r=n.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(s,o){var a=this._cipher,c=a.blockSize;i.call(this,s,o,c,a),this._prevBlock=s.slice(o,o+c)}}),r.Decryptor=r.extend({processBlock:function(s,o){var a=this._cipher,c=a.blockSize,l=s.slice(o,o+c);i.call(this,s,o,c,a),this._prevBlock=l}});function i(s,o,a,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var d=0;d<a;d++)s[o+d]^=l[d]}return r}(),n.mode.CFB})}(J8)),J8.exports}var e7={exports:{}},rmt=e7.exports,Cee;function imt(){return Cee||(Cee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(rmt,function(n){return n.mode.CTR=function(){var r=n.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(s,o){var a=this._cipher,c=a.blockSize,l=this._iv,u=this._counter;l&&(u=this._counter=l.slice(0),this._iv=void 0);var d=u.slice(0);a.encryptBlock(d,0),u[c-1]=u[c-1]+1|0;for(var h=0;h<c;h++)s[o+h]^=d[h]}});return r.Decryptor=i,r}(),n.mode.CTR})}(e7)),e7.exports}var t7={exports:{}},smt=t7.exports,_ee;function omt(){return _ee||(_ee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(smt,function(n){/** @preserve 463 * Counter block mode compatible with Dr Brian Gladman fileenc.c 464 * derived from CryptoJS.mode.CTR 465 * Jan Hruby [email protected] 466 */return n.mode.CTRGladman=function(){var r=n.lib.BlockCipherMode.extend();function i(a){if((a>>24&255)===255){var c=a>>16&255,l=a>>8&255,u=a&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,a=0,a+=c<<16,a+=l<<8,a+=u}else a+=1<<24;return a}function s(a){return(a[0]=i(a[0]))===0&&(a[1]=i(a[1])),a}var o=r.Encryptor=r.extend({processBlock:function(a,c){var l=this._cipher,u=l.blockSize,d=this._iv,h=this._counter;d&&(h=this._counter=d.slice(0),this._iv=void 0),s(h);var f=h.slice(0);l.encryptBlock(f,0);for(var m=0;m<u;m++)a[c+m]^=f[m]}});return r.Decryptor=o,r}(),n.mode.CTRGladman})}(t7)),t7.exports}var n7={exports:{}},amt=n7.exports,See;function cmt(){return See||(See=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(amt,function(n){return n.mode.OFB=function(){var r=n.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(s,o){var a=this._cipher,c=a.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),a.encryptBlock(u,0);for(var d=0;d<c;d++)s[o+d]^=u[d]}});return r.Decryptor=i,r}(),n.mode.OFB})}(n7)),n7.exports}var r7={exports:{}},lmt=r7.exports,Aee;function umt(){return Aee||(Aee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(lmt,function(n){return n.mode.ECB=function(){var r=n.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),r.Decryptor=r.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),r}(),n.mode.ECB})}(r7)),r7.exports}var i7={exports:{}},dmt=i7.exports,kee;function hmt(){return kee||(kee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(dmt,function(n){return n.pad.AnsiX923={pad:function(r,i){var s=r.sigBytes,o=i*4,a=o-s%o,c=s+a-1;r.clamp(),r.words[c>>>2]|=a<<24-c%4*8,r.sigBytes+=a},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},n.pad.Ansix923})}(i7)),i7.exports}var s7={exports:{}},fmt=s7.exports,$ee;function pmt(){return $ee||($ee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(fmt,function(n){return n.pad.Iso10126={pad:function(r,i){var s=i*4,o=s-r.sigBytes%s;r.concat(n.lib.WordArray.random(o-1)).concat(n.lib.WordArray.create([o<<24],1))},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},n.pad.Iso10126})}(s7)),s7.exports}var o7={exports:{}},gmt=o7.exports,Iee;function mmt(){return Iee||(Iee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(gmt,function(n){return n.pad.Iso97971={pad:function(r,i){r.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(r,i)},unpad:function(r){n.pad.ZeroPadding.unpad(r),r.sigBytes--}},n.pad.Iso97971})}(o7)),o7.exports}var a7={exports:{}},ymt=a7.exports,Tee;function wmt(){return Tee||(Tee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(ymt,function(n){return n.pad.ZeroPadding={pad:function(r,i){var s=i*4;r.clamp(),r.sigBytes+=s-(r.sigBytes%s||s)},unpad:function(r){for(var i=r.words,s=r.sigBytes-1,s=r.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){r.sigBytes=s+1;break}}},n.pad.ZeroPadding})}(a7)),a7.exports}var c7={exports:{}},vmt=c7.exports,Pee;function bmt(){return Pee||(Pee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(vmt,function(n){return n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding})}(c7)),c7.exports}var l7={exports:{}},xmt=l7.exports,Ree;function Emt(){return Ree||(Ree=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),ws())})(xmt,function(n){return function(r){var i=n,s=i.lib,o=s.CipherParams,a=i.enc,c=a.Hex,l=i.format;l.Hex={stringify:function(u){return u.ciphertext.toString(c)},parse:function(u){var d=c.parse(u);return o.create({ciphertext:d})}}}(),n.format.Hex})}(l7)),l7.exports}var u7={exports:{}},Cmt=u7.exports,Mee;function _mt(){return Mee||(Mee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),eg(),tg(),kp(),ws())})(Cmt,function(n){return function(){var r=n,i=r.lib,s=i.BlockCipher,o=r.algo,a=[],c=[],l=[],u=[],d=[],h=[],f=[],m=[],y=[],v=[];(function(){for(var x=[],_=0;_<256;_++)_<128?x[_]=_<<1:x[_]=_<<1^283;for(var $=0,I=0,_=0;_<256;_++){var R=I^I<<1^I<<2^I<<3^I<<4;R=R>>>8^R&255^99,a[$]=R,c[R]=$;var N=x[$],T=x[N],O=x[T],U=x[R]*257^R*16843008;l[$]=U<<24|U>>>8,u[$]=U<<16|U>>>16,d[$]=U<<8|U>>>24,h[$]=U;var U=O*16843009^T*65537^N*257^$*16843008;f[R]=U<<24|U>>>8,m[R]=U<<16|U>>>16,y[R]=U<<8|U>>>24,v[R]=U,$?($=N^x[x[x[O^N]]],I^=x[x[I]]):$=I=1}})();var b=[0,1,2,4,8,16,32,64,128,27,54],C=o.AES=s.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var _=this._keyPriorReset=this._key,$=_.words,I=_.sigBytes/4,R=this._nRounds=I+6,N=(R+1)*4,T=this._keySchedule=[],O=0;O<N;O++)O<I?T[O]=$[O]:(x=T[O-1],O%I?I>6&&O%I==4&&(x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255]):(x=x<<8|x>>>24,x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255],x^=b[O/I|0]<<24),T[O]=T[O-I]^x);for(var U=this._invKeySchedule=[],z=0;z<N;z++){var O=N-z;if(z%4)var x=T[O];else var x=T[O-4];z<4||O<=4?U[z]=x:U[z]=f[a[x>>>24]]^m[a[x>>>16&255]]^y[a[x>>>8&255]]^v[a[x&255]]}}},encryptBlock:function(x,_){this._doCryptBlock(x,_,this._keySchedule,l,u,d,h,a)},decryptBlock:function(x,_){var $=x[_+1];x[_+1]=x[_+3],x[_+3]=$,this._doCryptBlock(x,_,this._invKeySchedule,f,m,y,v,c);var $=x[_+1];x[_+1]=x[_+3],x[_+3]=$},_doCryptBlock:function(x,_,$,I,R,N,T,O){for(var U=this._nRounds,z=x[_]^$[0],L=x[_+1]^$[1],S=x[_+2]^$[2],k=x[_+3]^$[3],M=4,W=1;W<U;W++){var H=I[z>>>24]^R[L>>>16&255]^N[S>>>8&255]^T[k&255]^$[M++],D=I[L>>>24]^R[S>>>16&255]^N[k>>>8&255]^T[z&255]^$[M++],V=I[S>>>24]^R[k>>>16&255]^N[z>>>8&255]^T[L&255]^$[M++],B=I[k>>>24]^R[z>>>16&255]^N[L>>>8&255]^T[S&255]^$[M++];z=H,L=D,S=V,k=B}var H=(O[z>>>24]<<24|O[L>>>16&255]<<16|O[S>>>8&255]<<8|O[k&255])^$[M++],D=(O[L>>>24]<<24|O[S>>>16&255]<<16|O[k>>>8&255]<<8|O[z&255])^$[M++],V=(O[S>>>24]<<24|O[k>>>16&255]<<16|O[z>>>8&255]<<8|O[L&255])^$[M++],B=(O[k>>>24]<<24|O[z>>>16&255]<<16|O[L>>>8&255]<<8|O[S&255])^$[M++];x[_]=H,x[_+1]=D,x[_+2]=V,x[_+3]=B},keySize:256/32});r.AES=s._createHelper(C)}(),n.AES})}(u7)),u7.exports}var d7={exports:{}},Smt=d7.exports,Oee;function Amt(){return Oee||(Oee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),eg(),tg(),kp(),ws())})(Smt,function(n){return function(){var r=n,i=r.lib,s=i.WordArray,o=i.BlockCipher,a=r.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d
vendor: 7,629 bytes, line 466
466=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],
vendor: 8,050 bytes, line 466
466h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=a.DES=o.extend({_doReset:function(){for(var b=this._key,C=b.words,x=[],_=0;_<56;_++){var $=c[_]-1;x[_]=C[$>>>5]>>>31-$%32&1}for(var I=this._subKeys=[],R=0;R<16;R++){for(var N=I[R]=[],T=u[R],_=0;_<24;_++)N[_/6|0]|=x[(l[_]-1+T)%28]<<31-_%6,N[4+(_/6|0)]|=x[28+(l[_+24]-1+T)%28]<<31-_%6;N[0]=N[0]<<1|N[0]>>>31;for(var _=1;_<7;_++)N[_]=N[_]>>>(_-1)*4+3;N[7]=N[7]<<5|N[7]>>>27}for(var O=this._invSubKeys=[],_=0;_<16;_++)O[_]=I[15-_]},encryptBlock:function(b,C){this._doCryptBlock(b,C,this._subKeys)},decryptBlock:function(b,C){this._doCryptBlock(b,C,this._invSubKeys)},_doCryptBlock:function(b,C,x){this._lBlock=b[C],this._rBlock=b[C+1],m.call(this,4,252645135),m.call(this,16,65535),y.call(this,2,858993459),y.call(this,8,16711935),m.call(this,1,1431655765);for(var _=0;_<16;_++){for(var $=x[_],I=this._lBlock,R=this._rBlock,N=0,T=0;T<8;T++)N|=d[T][((R^$[T])&h[T])>>>0];this._lBlock=R,this._rBlock=I^N}var O=this._lBlock;this._lBlock=this._rBlock,this._rBlock=O,m.call(this,1,1431655765),y.call(this,8,16711935),y.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),b[C]=this._lBlock,b[C+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function m(b,C){var x=(this._lBlock>>>b^this._rBlock)&C;this._rBlock^=x,this._lBlock^=x<<b}function y(b,C){var x=(this._rBlock>>>b^this._lBlock)&C;this._lBlock^=x,this._rBlock^=x<<b}r.DES=o._createHelper(f);var v=a.TripleDES=o.extend({_doReset:function(){var b=this._key,C=b.words;if(C.length!==2&&C.length!==4&&C.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=C.slice(0,2),_=C.length<4?C.slice(0,2):C.slice(2,4),$=C.length<6?C.slice(0,2):C.slice(4,6);this._des1=f.createEncryptor(s.create(x)),this._des2=f.createEncryptor(s.create(_)),this._des3=f.createEncryptor(s.create($))},encryptBlock:function(b,C){this._des1.encryptBlock(b,C),this._des2.decryptBlock(b,C),this._des3.encryptBlock(b,C)},decryptBlock:function(b,C){this._des3.decryptBlock(b,C),this._des2.encryptBlock(b,C),this._des1.decryptBlock(b,C)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=o._createHelper(v)}(),n.TripleDES})}(d7)),d7.exports}var h7={exports:{}},kmt=h7.exports,jee;function $mt(){return jee||(jee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),eg(),tg(),kp(),ws())})(kmt,function(n){return function(){var r=n,i=r.lib,s=i.StreamCipher,o=r.algo,a=o.RC4=s.extend({_doReset:function(){for(var u=this._key,d=u.words,h=u.sigBytes,f=this._S=[],m=0;m<256;m++)f[m]=m;for(var m=0,y=0;m<256;m++){var v=m%h,b=d[v>>>2]>>>24-v%4*8&255;y=(y+f[m]+b)%256;var C=f[m];f[m]=f[y],f[y]=C}this._i=this._j=0},_doProcessBlock:function(u,d){u[d]^=c.call(this)},keySize:256/32,ivSize:0});function c(){for(var u=this._S,d=this._i,h=this._j,f=0,m=0;m<4;m++){d=(d+1)%256,h=(h+u[d])%256;var y=u[d];u[d]=u[h],u[h]=y,f|=u[(u[d]+u[h])%256]<<24-m*8}return this._i=d,this._j=h,f}r.RC4=s._createHelper(a);var l=o.RC4Drop=a.extend({cfg:a.cfg.extend({drop:192}),_doReset:function(){a._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)}});r.RC4Drop=s._createHelper(l)}(),n.RC4})}(h7)),h7.exports}var f7={exports:{}},Imt=f7.exports,Nee;function Tmt(){return Nee||(Nee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),eg(),tg(),kp(),ws())})(Imt,function(n){return function(){var r=n,i=r.lib,s=i.StreamCipher,o=r.algo,a=[],c=[],l=[],u=o.Rabbit=s.extend({_doReset:function(){for(var h=this._key.words,f=this.cfg.iv,m=0;m<4;m++)h[m]=(h[m]<<8|h[m]>>>24)&16711935|(h[m]<<24|h[m]>>>8)&4278255360;var y=this._X=[h[0],h[3]<<16|h[2]>>>16,h[1],h[0]<<16|h[3]>>>16,h[2],h[1]<<16|h[0]>>>16,h[3],h[2]<<16|h[1]>>>16],v=this._C=[h[2]<<16|h[2]>>>16,h[0]&4294901760|h[1]&65535,h[3]<<16|h[3]>>>16,h[1]&4294901760|h[2]&65535,h[0]<<16|h[0]>>>16,h[2]&4294901760|h[3]&65535,h[1]<<16|h[1]>>>16,h[3]&4294901760|h[0]&65535];this._b=0;for(var m=0;m<4;m++)d.call(this);for(var m=0;m<8;m++)v[m]^=y[m+4&7];if(f){var b=f.words,C=b[0],x=b[1],_=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,$=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,I=_>>>16|$&4294901760,R=$<<16|_&65535;v[0]^=_,v[1]^=I,v[2]^=$,v[3]^=R,v[4]^=_,v[5]^=I,v[6]^=$,v[7]^=R;for(var m=0;m<4;m++)d.call(this)}},_doProcessBlock:function(h,f){var m=this._X;d.call(this),a[0]=m[0]^m[5]>>>16^m[3]<<16,a[1]=m[2]^m[7]>>>16^m[5]<<16,a[2]=m[4]^m[1]>>>16^m[7]<<16,a[3]=m[6]^m[3]>>>16^m[1]<<16;for(var y=0;y<4;y++)a[y]=(a[y]<<8|a[y]>>>24)&16711935|(a[y]<<24|a[y]>>>8)&4278255360,h[f+y]^=a[y]},blockSize:128/32,ivSize:64/32});function d(){for(var h=this._X,f=this._C,m=0;m<8;m++)c[m]=f[m];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0<c[0]>>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0<c[1]>>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0<c[2]>>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0<c[3]>>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0<c[4]>>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0<c[5]>>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0<c[6]>>>0?1:0)|0,this._b=f[7]>>>0<c[7]>>>0?1:0;for(var m=0;m<8;m++){var y=h[m]+f[m],v=y&65535,b=y>>>16,C=((v*v>>>17)+v*b>>>15)+b*b,x=((y&4294901760)*y|0)+((y&65535)*y|0);l[m]=C^x}h[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,h[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,h[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,h[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,h[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,h[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,h[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,h[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}r.Rabbit=s._createHelper(u)}(),n.Rabbit})}(f7)),f7.exports}var p7={exports:{}},Pmt=p7.exports,Dee;function Rmt(){return Dee||(Dee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),eg(),tg(),kp(),ws())})(Pmt,function(n){return function(){var r=n,i=r.lib,s=i.StreamCipher,o=r.algo,a=[],c=[],l=[],u=o.RabbitLegacy=s.extend({_doReset:function(){var h=this._key.words,f=this.cfg.iv,m=this._X=[h[0],h[3]<<16|h[2]>>>16,h[1],h[0]<<16|h[3]>>>16,h[2],h[1]<<16|h[0]>>>16,h[3],h[2]<<16|h[1]>>>16],y=this._C=[h[2]<<16|h[2]>>>16,h[0]&4294901760|h[1]&65535,h[3]<<16|h[3]>>>16,h[1]&4294901760|h[2]&65535,h[0]<<16|h[0]>>>16,h[2]&4294901760|h[3]&65535,h[1]<<16|h[1]>>>16,h[3]&4294901760|h[0]&65535];this._b=0;for(var v=0;v<4;v++)d.call(this);for(var v=0;v<8;v++)y[v]^=m[v+4&7];if(f){var b=f.words,C=b[0],x=b[1],_=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,$=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,I=_>>>16|$&4294901760,R=$<<16|_&65535;y[0]^=_,y[1]^=I,y[2]^=$,y[3]^=R,y[4]^=_,y[5]^=I,y[6]^=$,y[7]^=R;for(var v=0;v<4;v++)d.call(this)}},_doProcessBlock:function(h,f){var m=this._X;d.call(this),a[0]=m[0]^m[5]>>>16^m[3]<<16,a[1]=m[2]^m[7]>>>16^m[5]<<16,a[2]=m[4]^m[1]>>>16^m[7]<<16,a[3]=m[6]^m[3]>>>16^m[1]<<16;for(var y=0;y<4;y++)a[y]=(a[y]<<8|a[y]>>>24)&16711935|(a[y]<<24|a[y]>>>8)&4278255360,h[f+y]^=a[y]},blockSize:128/32,ivSize:64/32});function d(){for(var h=this._X,f=this._C,m=0;m<8;m++)c[m]=f[m];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0<c[0]>>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0<c[1]>>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0<c[2]>>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0<c[3]>>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0<c[4]>>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0<c[5]>>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0<c[6]>>>0?1:0)|0,this._b=f[7]>>>0<c[7]>>>0?1:0;for(var m=0;m<8;m++){var y=h[m]+f[m],v=y&65535,b=y>>>16,C=((v*v>>>17)+v*b>>>15)+b*b,x=((y&4294901760)*y|0)+((y&65535)*y|0);l[m]=C^x}h[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,h[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,h[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,h[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,h[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,h[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,h[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,h[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}r.RabbitLegacy=s._createHelper(u)}(),n.RabbitLegacy})}(p7)),p7.exports}var g7={exports:{}},Mmt=g7.exports,Lee;function Omt(){return Lee||(Lee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),eg(),tg(),kp(),ws())})(Mmt,function(n){return function(){var r=n,i=r.lib,s=i.BlockCipher,o=r.algo;const a=16,c
vendor: 11,232 bytes, line 466
466=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],l=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var
vendor: 720 bytes, line 466
466u={pbox:[],sbox:[]};function d(v,b){let C=b>>24&255,x=b>>16&255,_=b>>8&255,$=b&255,I=v.sbox[0][C]+v.sbox[1][x];return I=I^v.sbox[2][_],I=I+v.sbox[3][$],I}function h(v,b,C){let x=b,_=C,$;for(let I=0;I<a;++I)x=x^v.pbox[I],_=d(v,x)^_,$=x,x=_,_=$;return $=x,x=_,_=$,_=_^v.pbox[a],x=x^v.pbox[a+1],{left:x,right:_}}function f(v,b,C){let x=b,_=C,$;for(let I=a+1;I>1;--I)x=x^v.pbox[I],_=d(v,x)^_,$=x,x=_,_=$;return $=x,x=_,_=$,_=_^v.pbox[1],x=x^v.pbox[0],{left:x,right:_}}function m(v,b,C){for(let R=0;R<4;R++){v.sbox[R]=[];for(let N=0;N<256;N++)v.sbox[R][N]=l[R][N]}let x=0;for(let R=0;R<a+2;R++)v.pbox[R]=c[R]^b[x],x++,x>=C&&(x=0);let _=0,$=0,I=0;for(let R=0;R<a+2;R+=2)I=h(v,_,$),_=I.left,$=I.right,v.pbox[R]=_,v.pbox[R+1]=$;
vendor: 6,822 bytes, line 466
466for(let R=0;R<4;R++)for(let N=0;N<256;N+=2)I=h(v,_,$),_=I.left,$=I.right,v.sbox[R][N]=_,v.sbox[R][N+1]=$;return!0}var y=o.Blowfish=s.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var v=this._keyPriorReset=this._key,b=v.words,C=v.sigBytes/4;m(u,b,C)}},encryptBlock:function(v,b){var C=h(u,v[b],v[b+1]);v[b]=C.left,v[b+1]=C.right},decryptBlock:function(v,b){var C=f(u,v[b],v[b+1]);v[b]=C.left,v[b+1]=C.right},blockSize:64/32,keySize:128/32,ivSize:64/32});r.Blowfish=s._createHelper(y)}(),n.Blowfish})}(g7)),g7.exports}var jmt=O8.exports,Bee;function Nmt(){return Bee||(Bee=1,function(t,e){(function(n,r,i){t.exports=r(Zn(),aS(),Rgt(),Ogt(),eg(),Dgt(),tg(),Cme(),rF(),zgt(),_me(),Vgt(),Kgt(),Zgt(),iF(),Xgt(),kp(),ws(),nmt(),imt(),omt(),cmt(),umt(),hmt(),pmt(),mmt(),wmt(),bmt(),Emt(),_mt(),Amt(),$mt(),Tmt(),Rmt(),Omt())})(jmt,function(n){return n})}(O8)),O8.exports}var Dmt=Nmt();const Dd=ys(Dmt);var m7={exports:{}},Lmt=m7.exports,Fee;function Bmt(){return Fee||(Fee=1,function(t,e){(function(n,r){t.exports=r()})(Lmt,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",u="week",d="month",h="quarter",f="year",m="date",y="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(S){var k=["th","st","nd","rd"],M=S%100;return"["+S+(k[(M-20)%10]||k[M]||k[0])+"]"}},x=function(S,k,M){var W=String(S);return!W||W.length>=k?S:""+Array(k+1-W.length).join(M)+S},_={s:x,z:function(S){var k=-S.utcOffset(),M=Math.abs(k),W=Math.floor(M/60),H=M%60;return(k<=0?"+":"-")+x(W,2,"0")+":"+x(H,2,"0")},m:function S(k,M){if(k.date()<M.date())return-S(M,k);var W=12*(M.year()-k.year())+(M.month()-k.month()),H=k.clone().add(W,d),D=M-H<0,V=k.clone().add(W+(D?-1:1),d);return+(-(W+(M-H)/(D?H-V:V-H))||0)},a:function(S){return S<0?Math.ceil(S)||0:Math.floor(S)},p:function(S){return{M:d,y:f,w:u,d:l,D:m,h:c,m:a,s:o,ms:s,Q:h}[S]||String(S||"").toLowerCase().replace(/s$/,"")},u:function(S){return S===void 0}},$="en",I={};I[$]=C;var R="$isDayjsObject",N=function(S){return S instanceof z||!(!S||!S[R])},T=function S(k,M,W){var H;if(!k)return $;if(typeof k=="string"){var D=k.toLowerCase();I[D]&&(H=D),M&&(I[D]=M,H=D);var V=k.split("-");if(!H&&V.length>1)return S(V[0])}else{var B=k.name;I[B]=k,H=B}return!W&&H&&($=H),H||!W&&$},O=function(S,k){if(N(S))return S.clone();var M=typeof k=="object"?k:{};return M.date=S,M.args=arguments,new z(M)},U=_;U.l=T,U.i=N,U.w=function(S,k){return O(S,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var z=function(){function S(M){this.$L=T(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[R]=!0}var k=S.prototype;return k.parse=function(M){this.$d=function(W){var H=W.date,D=W.utc;if(H===null)return new Date(NaN);if(U.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var V=H.match(v);if(V){var B=V[2]-1||0,P=(V[7]||"0").substring(0,3);return D?new Date(Date.UTC(V[1],B,V[3]||1,V[4]||0,V[5]||0,V[6]||0,P)):new Date(V[1],B,V[3]||1,V[4]||0,V[5]||0,V[6]||0,P)}}return new Date(H)}(M),this.init()},k.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},k.$utils=function(){return U},k.isValid=function(){return this.$d.toString()!==y},k.isSame=function(M,W){var H=O(M);return this.startOf(W)<=H&&H<=this.endOf(W)},k.isAfter=function(M,W){return O(M)<this.startOf(W)},k.isBefore=function(M,W){return this.endOf(W)<O(M)},k.$g=function(M,W,H){return U.u(M)?this[W]:this.set(H,M)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(M,W){var H=this,D=!!U.u(W)||W,V=U.p(M),B=function(de,ke){var Be=U.w(H.$u?Date.UTC(H.$y,ke,de):new Date(H.$y,ke,de),H);return D?Be:Be.endOf(l)},P=function(de,ke){return U.w(H.toDate()[de].apply(H.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(ke)),H)},j=this.$W,G=this.$M,Y=this.$D,te="set"+(this.$u?"UTC":"");switch(V){case f:return D?B(1,0):B(31,11);case d:return D?B(1,G):B(0,G+1);case u:var ae=this.$locale().weekStart||0,oe=(j<ae?j+7:j)-ae;return B(D?Y-oe:Y+(6-oe),G);case l:case m:return P(te+"Hours",0);case c:return P(te+"Minutes",1);case a:return P(te+"Seconds",2);case o:return P(te+"Milliseconds",3);default:return this.clone()}},k.endOf=function(M){return this.startOf(M,!1)},k.$set=function(M,W){var H,D=U.p(M),V="set"+(this.$u?"UTC":""),B=(H={},H[l]=V+"Date",H[m]=V+"Date",H[d]=V+"Month",H[f]=V+"FullYear",H[c]=V+"Hours",H[a]=V+"Minutes",H[o]=V+"Seconds",H[s]=V+"Milliseconds",H)[D],P=D===l?this.$D+(W-this.$W):W;if(D===d||D===f){var j=this.clone().set(m,1);j.$d[B](P),j.init(),this.$d=j.set(m,Math.min(this.$D,j.daysInMonth())).$d}else B&&this.$d[B](P);return this.init(),this},k.set=function(M,W){return this.clone().$set(M,W)},k.get=function(M){return this[U.p(M)]()},k.add=function(M,W){var H,D=this;M=Number(M);var V=U.p(W),B=function(G){var Y=O(D);return U.w(Y.date(Y.date()+Math.round(G*M)),D)};if(V===d)return this.set(d,this.$M+M);if(V===f)return this.set(f,this.$y+M);if(V===l)return B(1);if(V===u)return B(7);var P=(H={},H[a]=r,H[c]=i,H[o]=n,H)[V]||1,j=this.$d.getTime()+M*P;return U.w(j,this)},k.subtract=function(M,W){return this.add(-1*M,W)},k.format=function(M){var W=this,H=this.$locale();if(!this.isValid())return H.invalidDate||y;var D=M||"YYYY-MM-DDTHH:mm:ssZ",V=U.z(this),B=this.$H,P=this.$m,j=this.$M,G=H.weekdays,Y=H.months,te=H.meridiem,ae=function(ke,Be,$e,He){return ke&&(ke[Be]||ke(W,D))||$e[Be].slice(0,He)},oe=function(ke){return U.s(B%12||12,ke,"0")},de=te||function(ke,Be,$e){var He=ke<12?"AM":"PM";return $e?He.toLowerCase():He};return D.replace(b,function(ke,Be){return Be||function($e){switch($e){case"YY":return String(W.$y).slice(-2);case"YYYY":return U.s(W.$y,4,"0");case"M":return j+1;case"MM":return U.s(j+1,2,"0");case"MMM":return ae(H.monthsShort,j,Y,3);case"MMMM":return ae(Y,j);case"D":return W.$D;case"DD":return U.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return ae(H.weekdaysMin,W.$W,G,2);case"ddd":return ae(H.weekdaysShort,W.$W,G,3);case"dddd":return G[W.$W];case"H":return String(B);case"HH":return U.s(B,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return de(B,P,!0);case"A":return de(B,P,!1);case"m":return String(P);case"mm":return U.s(P,2,"0");case"s":return String(W.$s);case"ss":return U.s(W.$s,2,"0");case"SSS":return U.s(W.$ms,3,"0");case"Z":return V}return null}(ke)||V.replace(":","")})}
vendor: 5,773 bytes, line 466
466,k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(M,W,H){var D,V=this,B=U.p(W),P=O(M),j=(P.utcOffset()-this.utcOffset())*r,G=this-P,Y=function(){return U.m(V,P)};switch(B){case f:D=Y()/12;break;case d:D=Y();break;case h:D=Y()/3;break;case u:D=(G-j)/6048e5;break;case l:D=(G-j)/864e5;break;case c:D=G/i;break;case a:D=G/r;break;case o:D=G/n;break;default:D=G}return H?D:U.a(D)},k.daysInMonth=function(){return this.endOf(d).$D},k.$locale=function(){return I[this.$L]},k.locale=function(M,W){if(!M)return this.$L;var H=this.clone(),D=T(M,W,!0);return D&&(H.$L=D),H},k.clone=function(){return U.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},S}(),L=z.prototype;return O.prototype=L,[["$ms",s],["$s",o],["$m",a],["$H",c],["$W",l],["$M",d],["$y",f],["$D",m]].forEach(function(S){L[S[1]]=function(k){return this.$g(k,S[0],S[1])}}),O.extend=function(S,k){return S.$i||(S(k,z,O),S.$i=!0),O},O.locale=T,O.isDayjs=N,O.unix=function(S){return O(1e3*S)},O.en=I[$],O.Ls=I,O.p={},O})}(m7)),m7.exports}var Fmt=Bmt();const gRt=ys(Fmt);function sF(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ng=sF();function Sme(t){ng=t}var Ab={exec:()=>null};function ur(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace($o.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,e)};return r}var $o={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Umt=/^(?:[ \t]*(?:\n|$))+/,zmt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wmt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ix=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Hmt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oF=/(?:[*+-]|\d{1,9}[.)])/,Ame=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,kme=ur(Ame).replace(/bull/g,oF).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vmt=ur(Ame).replace(/bull/g,oF).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),aF=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qmt=/^[^\n]+/,cF=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Kmt=ur(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",cF).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gmt=ur(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,oF).getRegex(),cS="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",lF=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zmt=ur("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>
466)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",lF).replace("tag",cS).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$me=ur(aF).replace("hr",ix).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cS).getRegex(),Ymt=ur(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$me).getRegex(),uF={blockquote:Ymt,code:zmt,def:Kmt,fences:Wmt,heading:Hmt,hr:ix,html:Zmt,lheading:kme,list:Gmt,newline:Umt,paragraph:$me,table:Ab,text:qmt},Uee=ur("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ix).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cS).getRegex(),Qmt={...uF,lheading:Vmt,table:Uee,paragraph:ur(aF).replace("hr",ix).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Uee).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cS).getRegex()},Xmt={...uF,html:ur(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",lF).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ab,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ur(aF).replace("hr",ix).replace("heading",` *#{1,6} *[^ 467]`).replace("lheading",kme).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Jmt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,eyt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ime=/^( {2,}|\\)\n(?!\s*$)/,tyt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,lS=/[\p{P}\p{S}]/u,dF=/[\s\p{P}\p{S}]/u,Tme=/[^\s\p{P}\p{S}]/u,nyt=ur(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dF).getRegex(),Pme=/(?!~)[\p{P}\p{S}]/u,ryt=/(?!~)[\s\p{P}\p{S}]/u,iyt=/(?:[^\s\p{P}\p{S}]|~)/u,syt=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,Rme=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,oyt=ur(Rme,"u").replace(/punct/g,lS).getRegex(),ayt=ur(Rme,"u").replace(/punct/g,Pme).getRegex(),Mme="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cyt=ur(Mme,"gu").replace(/notPunctSpace/g,Tme).replace(/punctSpace/g,dF).replace(/punct/g,lS).getRegex(),lyt=ur(Mme,"gu").replace(/notPunctSpace/g,iyt).replace(/punctSpace/g,ryt).replace(/punct/g,Pme).getRegex(),uyt=ur("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Tme).replace(/punctSpace/g,dF).replace(/punct/g,lS).getRegex(),dyt=ur(/\\(punct)/,"gu").replace(/punct/g,lS).getRegex(),hyt=ur(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fyt=ur(lF).replace("(?:-->|$)","-->").getRegex(),pyt=ur("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fyt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rE=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,gyt=ur(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",rE).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ome=ur(/^!?\[(label)\]\[(ref)\]/).replace("label",rE).replace("ref",cF).getRegex(),jme=ur(/^!?\[(ref)\](?:\[\])?/).replace("ref",cF).getRegex(),myt=ur("reflink|nolink(?!\\()","g").replace("reflink",Ome).replace("nolink",jme).getRegex(),hF={_backpedal:Ab,anyPunctuation:dyt,autolink:hyt,blockSkip:syt,br:Ime,code:eyt,del:Ab,emStrongLDelim:oyt,emStrongRDelimAst:cyt,emStrongRDelimUnd:uyt,escape:Jmt,link:gyt,nolink:jme,punctuation:nyt,reflink:Ome,reflinkSearch:myt,tag:pyt,text:tyt,url:Ab},yyt={...hF,link:ur(/^!?\[(label)\]\((.*?)\)/).replace("label",rE).getRegex(),reflink:ur(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",rE).getRegex()},qj={...hF,emStrongRDelimAst:lyt,emStrongLDelim:ayt,url:ur(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},wyt={...qj,br:ur(Ime).replace("{2,}","*").getRegex(),text:ur(qj.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$6={normal:uF,gfm:Qmt,pedantic:Xmt},Cv={normal:hF,gfm:qj,breaks:wyt,pedantic:yyt},vyt={"&":"&","<":"<",">":">",'"':""","'":"'"},zee=t=>
vendor: 25,342 bytes, lines 467-524
467vyt[t];function tu(t,e){if(e){if($o.escapeTest.test(t))return t.replace($o.escapeReplace,zee)}else if($o.escapeTestNoEncode.test(t))return t.replace($o.escapeReplaceNoEncode,zee);return t}function Wee(t){try{t=encodeURI(t).replace($o.percentDecode,"%")}catch{return null}return t}function Hee(t,e){var s;let n=t.replace($o.findPipe,(o,a,c)=>{let l=!1,u=a;for(;--u>=0&&c[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split($o.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace($o.slashPipe,"|");return r}function _v(t,e,n){let r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function byt(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Vee(t,e,n,r,i){let s=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,c}function xyt(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(` 468`).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=i.length?s.slice(i.length):s}).join(` 469`)}var iE=class{constructor(e){Ft(this,"options");Ft(this,"rules");Ft(this,"lexer");this.options=e||ng}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:_v(r,` 470`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],i=xyt(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:i}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let i=_v(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:_v(n[0],` 471`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=_v(n[0],` 472`).split(` 473`),i="",s="",o=[];for(;r.length>0;){let a=!1,c=[],l;for(l=0;l<r.length;l++)if(this.rules.other.blockquoteStart.test(r[l]))c.push(r[l]),a=!0;else if(!a)c.push(r[l]);else break;r=r.slice(l);let u=c.join(` 474`),d=u.replace(this.rules.other.blockquoteSetextReplace,` 475 $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i} 476${u}`:u,s=s?`${s} 477${d}`:d;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,o,!0),this.lexer.state.top=h,r.length===0)break;let f=o.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){let m=f,y=m.raw+` 478`+r.join(` 479`),v=this.blockquote(y);o[o.length-1]=v,i=i.substring(0,i.length-m.raw.length)+v.raw,s=s.substring(0,s.length-m.text.length)+v.text;break}else if((f==null?void 0:f.type)==="list"){let m=f,y=m.raw+` 480`+r.join(` 481`),v=this.list(y);o[o.length-1]=v,i=i.substring(0,i.length-f.raw.length)+v.raw,s=s.substring(0,s.length-m.raw.length)+v.raw,r=y.substring(o.at(-1).raw.length).split(` 482`);continue}}return{type:"blockquote",raw:i,tokens:o,text:s}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim(),i=r.length>1,s={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let o=this.rules.other.listItemRegex(r),a=!1;for(;e;){let l=!1,u="",d="";if(!(n=o.exec(e))||this.rules.block.hr.test(e))break;u=n[0],e=e.substring(u.length);let h=n[2].split(` 483`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),f=e.split(` 484`,1)[0],m=!h.trim(),y=0;if(this.options.pedantic?(y=2,d=h.trimStart()):m?y=n[1].length+1:(y=n[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,d=h.slice(y),y+=n[1].length),m&&this.rules.other.blankLine.test(f)&&(u+=f+` 485`,e=e.substring(f.length+1),l=!0),!l){let C=this.rules.other.nextBulletRegex(y),x=this.rules.other.hrRegex(y),_=this.rules.other.fencesBeginRegex(y),$=this.rules.other.headingBeginRegex(y),I=this.rules.other.htmlBeginRegex(y);for(;e;){let R=e.split(` 486`,1)[0],N;if(f=R,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),N=f):N=f.replace(this.rules.other.tabCharGlobal," "),_.test(f)||$.test(f)||I.test(f)||C.test(f)||x.test(f))break;if(N.search(this.rules.other.nonSpaceChar)>=y||!f.trim())d+=` 487`+N.slice(y);else{if(m||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(h)||$.test(h)||x.test(h))break;d+=` 488`+f}!m&&!f.trim()&&(m=!0),u+=R+` 489`,e=e.substring(R.length+1),h=N.slice(y)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let v=null,b;this.options.gfm&&(v=this.rules.other.listIsTask.exec(d),v&&(b=v[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!v,checked:b,loose:!1,text:d,tokens:[]}),s.raw+=u}let c=s.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){let u=s.items[l].tokens.filter(h=>h.type==="space"),d=u.length>0&&u.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=d}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:s}}}table(e){var a;let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Hee(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=n[3])!=null&&a.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(` 490`):[],o={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===i.length){for(let c of i)this.rules.other.tableAlignRight.test(c)?o.align.push("right"):this.rules.other.tableAlignCenter.test(c)?o.align.push("center"):this.rules.other.tableAlignLeft.test(c)?o.align.push("left"):o.align.push(null);for(let c=0;c<r.length;c++)o.header.push({text:r[c],tokens:this.lexer.inline(r[c]),header:!0,align:o.align[c]});for(let c of s)o.rows.push(Hee(c,o.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[u]})));return o}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===` 491`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=_v(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=byt(n[2],"()");if(o===-2)return;if(o>-1){let a=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let i=n[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),Vee(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=n[i.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Vee(r,s,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!r||this.rules.inline.punctuation.exec(r))){let s=[...i[0]].length-1,o,a,c=s,l=0,u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,n=n.slice(-1*e.length+s);(i=u.exec(n))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(a=[...o].length,i[3]||i[4]){c+=a;continue}else if((i[5]||i[6])&&s%3&&!((s+a)%3)){l+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+l);let d=[...i[0]][0].length,h=e.slice(0,s+i.index+d+a);if(Math.min(s,a)%2){let m=h.slice(1,-1);return{type:"em",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}let f=h.slice(2,-2);return{type:"strong",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,i;return n[2]==="@"?(r=n[1],i="mailto:"+r):(r=n[1],i=r),{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let n;if(n=this.rules.inline.url.exec(e)){let i,s;if(n[2]==="@")i=n[0],s="mailto:"+i;else{let o;do o=n[0],n[0]=((r=this.rules.inline._backpedal.exec(n[0]))==null?void 0:r[0])??"";while(o!==n[0]);i=n[0],n[1]==="www."?s="http://"+n[0]:s=n[0]}return{type:"link",raw:n[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},Ld=class Kj{constructor(e){Ft(this,"tokens");Ft(this,"options");Ft(this,"state");Ft(this,"tokenizer");Ft(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ng,this.options.tokenizer=this.options.tokenizer||new iE,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:$o,block:$6.normal,inline:Cv.normal};this.options.pedantic?(n.block=$6.pedantic,n.inline=Cv.pedantic):this.options.gfm&&(n.block=$6.gfm,this.options.breaks?n.inline=Cv.breaks:n.inline=Cv.gfm),this.tokenizer.rules=n}static get rules(){return{block:$6,inline:Cv}}static lex(e,n){return new Kj(n).lex(e)}static lexInline(e,n){return new Kj(n).inlineTokens(e)}lex(e){e=e.replace($o.carriageReturn,` 492`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var i,s,o;for(this.options.pedantic&&(e=e.replace($o.tabCharGlobal," ").replace($o.spaceLine,""));e;){let a;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(l=>(a=l.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let l=n.at(-1);a.raw.length===1&&l!==void 0?l.raw+=` 493`:n.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let l=n.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(` 494`)?"":` 495`)+a.raw,l.text+=` 496`+a.text,this.inlineQueue.at(-1).src=l.text):n.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let l=n.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(` 497`)?"":` 498`)+a.raw,l.text+=` 499`+a.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),n.push(a);continue}let c=e;if((o=this.options.extensions)!=null&&o.startBlock){let l=1/0,u=e.slice(1),d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},u),typeof d=="number"&&d>=0&&(l=Math.min(l,d))}),l<1/0&&l>=0&&(c=e.substring(0,l+1))}if(this.state.top&&(a=this.tokenizer.paragraph(c))){let l=n.at(-1);r&&(l==null?void 0:l.type)==="paragraph"?(l.raw+=(l.raw.endsWith(` 500`)?"":` 501`)+a.raw,l.text+=` 502`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(a),r=c.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let l=n.at(-1);(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(` 503`)?"":` 504`)+a.raw,l.text+=` 505`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(a);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var a,c,l;let r=e,i=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let u;if((c=(a=this.options.extensions)==null?void 0:a.inline)!=null&&c.some(h=>(u=h.call({lexer:this},e,n))?(e=e.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);let h=n.at(-1);u.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=u.raw,h.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(e,r,o)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),n.push(u);continue}let d=e;if((l=this.options.extensions)!=null&&l.startInline){let h=1/0,f=e.slice(1),m;this.options.extensions.startInline.forEach(y=>{m=y.call({lexer:this},f),typeof m=="number"&&m>=0&&(h=Math.min(h,m))}),h<1/0&&h>=0&&(d=e.substring(0,h+1))}if(u=this.tokenizer.inlineText(d)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(o=u.raw.slice(-1)),s=!0;let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=u.raw,h.text+=u.text):n.push(u);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},sE=class{constructor(e){Ft(this,"options");Ft(this,"parser");this.options=e||ng}space(e){return""}code({text:e,lang:n,escaped:r}){var o;let i=(o=(n||"").match($o.notSpaceStart))==null?void 0:o[0],s=e.replace($o.endingNewline,"")+` 506`;return i?'<pre><code class="language-'+tu(i)+'">'+(r?s:tu(s,!0))+`</code></pre> 507`:"<pre><code>"+(r?s:tu(s,!0))+`</code></pre> 508`}blockquote({tokens:e}){return`<blockquote> 509${this.parser.parse(e)}</blockquote> 510`}html({text:e}){return e}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}> 511`}hr(e){return`<hr> 512`}list(e){let n=e.ordered,r=e.start,i="";for(let a=0;a<e.items.length;a++){let c=e.items[a];i+=this.listitem(c)}let s=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+s+o+`> 513`+i+"</"+s+`> 514`}listitem(e){var r;let n="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((r=e.tokens[0])==null?void 0:r.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+tu(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):n+=i+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li> 515`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p> 516`}table(e){let n="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);n+=this.tablerow({text:r});let i="";for(let s=0;s<e.rows.length;s++){let o=e.rows[s];r="";for(let a=0;a<o.length;a++)r+=this.tablecell(o[a]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table> 517<thead> 518`+n+`</thead> 519`+i+`</table> 520`}tablerow({text:e}){return`<tr> 521${e}</tr> 522`}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}> 523`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${tu(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let i=this.parser.parseInline(r),s=Wee(e);if(s===null)return i;e=s;let o='<a href="'+e+'"';return n&&(o+=' title="'+tu(n)+'"'),o+=">"+i+"</a>",o}image({href:e,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let s=Wee(e);if(s===null)return tu(r);e=s;let o=`<img src="${e}" alt="${r}"`;return n&&(o+=` title="${tu(n)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:tu(e.text)}},fF=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Bd=class Gj{constructor(e){Ft(this,"options");Ft(this,"renderer");Ft(this,"textRenderer");this.options=e||ng,this.options.renderer=this.options.renderer||new sE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new fF}static parse(e,n){return new Gj(n).parse(e)}static parseInline(e,n){return new Gj(n).parseInline(e)}parse(e,n=!0){var i,s;let r="";for(let o=0;o<e.length;o++){let a=e[o];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[a.type]){let l=a,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){r+=u||"";continue}}let c=a;switch(c.type){case"space":{r+=this.renderer.space(c);continue}case"hr":{r+=this.renderer.hr(c);continue}case"heading":{r+=this.renderer.heading(c);continue}case"code":{r+=this.renderer.code(c);continue}case"table":{r+=this.renderer.table(c);continue}case"blockquote":{r+=this.renderer.blockquote(c);continue}case"list":{r+=this.renderer.list(c);continue}case"html":{r+=this.renderer.html(c);continue}case"paragraph":{r+=this.renderer.paragraph(c);continue}case"text":{let l=c,u=this.renderer.text(l);for(;o+1<e.length&&e[o+1].type==="text";)l=e[++o],u+=` 524`+this.renderer.text(l);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{let l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,n=this.renderer){var i,s;let r="";for(let o=0;o<e.length;o++){let a=e[o];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=l||"";continue}}let c=a;switch(c.type){case"escape":{r+=n.text(c);break}case"html":{r+=n.html(c);break}case"link":{r+=n.link(c);break}case"image":{r+=n.image(c);break}case"strong":{r+=n.strong(c);break}case"em":{r+=n.em(c);break}case"codespan":{r+=n.codespan(c);break}case"br":{r+=n.br(c);break}case"del":{r+=n.del(c);break}case"text":{r+=n.text(c);break}default:{let l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},rR,y7=(rR=class{constructor(e){Ft(this,"options");Ft(this,"block");this.options=e||ng}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ld.lex:Ld.lexInline}provideParser(){return this.block?Bd.parse:Bd.parseInline}},Ft(rR,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),rR),Eyt=class{constructor(...e){Ft(this,"defaults",sF());Ft(this,"options",this.setOptions);Ft(this,"parse",this.parseMarkdown(!0));Ft(this,"parseInline",this.parseMarkdown(!1));Ft(this,"Parser",Bd);Ft(this,"Renderer",sE);Ft(this,"TextRenderer",fF);Ft(this,"Lexer",Ld);Ft(this,"Tokenizer",iE);Ft(this,"Hooks",y7);this.use(...e)}walkTokens(e,n){var i,s;let r=[];for(let o of e)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let a=o;for(let c of a.header)r=r.concat(this.walkTokens(c.tokens,n));for(let c of a.rows)for(let l of c)r=r.concat(this.walkTokens(l.tokens,n));break}case"list":{let a=o;r=r.concat(this.walkTokens(a.items,n));break}default:{let a=o;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(c=>{let l=a[c].flat(1/0);r=r.concat(this.walkTokens(l,n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let c=s.renderer.apply(this,a);return c===!1&&(c=o.apply(this,a)),c}:n.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[s.level];o?o.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),i.extensions=n),r.renderer){let s=this.defaults.renderer||new sE(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,c=r.renderer[a],l=s[a];s[a]=(...u)=>{let d=c.apply(s,u);return d===!1&&(d=l.apply(s,u)),d||""}}i.renderer=s}
524if(r.tokenizer){let s=this.defaults.tokenizer||new iE(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,c=r.tokenizer[a],l=s[a];s[a]=(...u)=>{let d=c.apply(s,u);return d===!1&&(d=l.apply(s,u)),d}}i.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new y7;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,c=r.hooks[a],l=s[a];y7.passThroughHooks.has(o)?s[a]=u=>{if(this.defaults.async)return Promise.resolve(c.call(s,u)).then(h=>l.call(s,h));let d=c.call(s,u);return l.call(s,d)}:s[a]=(...u)=>{let d=c.apply(s,u);return d===!1&&(d=l.apply(s,u)),d}}i.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(a){let c=[];return c.push(o.call(this,a)),s&&(c=c.concat(s.call(this,a))),c}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Ld.lex(e,n??this.defaults)}parser(e,n){return Bd.parse(e,n??this.defaults)}parseMarkdown(e){return(n,r)=>{let i={...r},s={...this.defaults,...i},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=e);let a=s.hooks?s.hooks.provideLexer():e?Ld.lex:Ld.lexInline,c=s.hooks?s.hooks.provideParser():e?Bd.parse:Bd.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(l=>a(l,s)).then(l=>s.hooks?s.hooks.processAllTokens(l):l).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>c(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let l=a(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let u=c(l,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(l){return o(l)}}}onError(e,n){return r=>{if(r.message+=` 525Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+tu(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},R1=new Eyt;function vr(t,e){return R1.parse(t,e)}vr.options=vr.setOptions=function(t){return R1.setOptions(t),vr.defaults=R1.defaults,Sme(vr.defaults),vr};vr.getDefaults=sF;vr.defaults=ng;vr.use=function(...t){return R1.use(...t),vr.defaults=R1.defaults,Sme(vr.defaults),vr};vr.walkTokens=function(t,e){return R1.walkTokens(t,e)};vr.parseInline=R1.parseInline;vr.Parser=Bd;vr.parser=Bd.parse;vr.Renderer=sE;vr.TextRenderer=fF;vr.Lexer=Ld;vr.lexer=Ld.lex;vr.Tokenizer=iE;vr.Hooks=y7;vr.parse=vr;vr.options;vr.setOptions;vr.use;vr.walkTokens;vr.parseInline;Bd.parse;Ld.lex;const pF="-",Cyt=t=>{const e=Syt(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(pF);return a[0]===""&&a.length!==1&&a.shift(),Nme(a,e)||_yt(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},Nme=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?Nme(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(pF);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},qee=/^\[(.+)\]$/,_yt=t=>{if(qee.test(t)){const e=qee.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},Syt=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return kyt(Object.entries(t.classGroups),n).forEach(([s,o])=>{Zj(o,r,s,e)}),r},Zj=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:Kee(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(Ayt(i)){Zj(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}
vendor: 4,891 bytes, line 525
525Object.entries(i).forEach(([s,o])=>{Zj(o,Kee(e,s),n,r)})})},Kee=(t,e)=>{let n=t;return e.split(pF).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ayt=t=>t.isThemeGetter,kyt=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,$yt=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},Dme="!",Iyt=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=a=>{const c=[];let l=0,u=0,d;for(let v=0;v<a.length;v++){let b=a[v];if(l===0){if(b===i&&(r||a.slice(v,v+s)===e)){c.push(a.slice(u,v)),u=v+s;continue}if(b==="/"){d=v;continue}}b==="["?l++:b==="]"&&l--}const h=c.length===0?a:a.substring(u),f=h.startsWith(Dme),m=f?h.substring(1):h,y=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:o}):o},Tyt=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},Pyt=t=>({cache:$yt(t.cacheSize),parseClassName:Iyt(t),...Cyt(t)}),Ryt=/\s+/,Myt=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(Ryt);let a="";for(let c=o.length-1;c>=0;c-=1){const l=o[c],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(l);let m=!!f,y=r(m?h.substring(0,f):h);if(!y){if(!m){a=l+(a.length>0?" "+a:a);continue}if(y=r(h),!y){a=l+(a.length>0?" "+a:a);continue}m=!1}const v=Tyt(u).join(":"),b=d?v+Dme:v,C=b+y;if(s.includes(C))continue;s.push(C);const x=i(y,m);for(let _=0;_<x.length;++_){const $=x[_];s.push(b+$)}a=l+(a.length>0?" "+a:a)}return a};function Oyt(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=Lme(e))&&(r&&(r+=" "),r+=n);return r}const Lme=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=Lme(t[r]))&&(n&&(n+=" "),n+=e);return n};function jyt(t,...e){let n,r,i,s=o;function o(c){const l=e.reduce((u,d)=>d(u),t());return n=Pyt(l),r=n.cache.get,i=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=Myt(c,n);return i(c,u),u}return function(){return s(Oyt.apply(null,arguments))}}const Nr=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Bme=/^\[(?:([a-z-]+):)?(.+)\]$/i,Nyt=/^\d+\/\d+$/,Dyt=new Set(["px","full","screen"]),Lyt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Byt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fyt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Uyt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zyt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dd=t=>ay(t)||Dyt.has(t)||Nyt.test(t),af=t=>J2(t,"length",Yyt),ay=t=>!!t&&!Number.isNaN(Number(t)),KT=t=>J2(t,"number",ay),Sv=t=>!!t&&Number.isInteger(Number(t)),Wyt=t=>t.endsWith("%")&&ay(t.slice(0,-1)),Pn=t=>Bme.test(t),cf=t=>Lyt.test(t),Hyt=new Set(["length","size","percentage"]),Vyt=t=>J2(t,Hyt,Fme),qyt=t=>J2(t,"position",Fme),Kyt=new Set(["image","url"]),Gyt=t=>J2(t,Kyt,Xyt),Zyt=t=>J2(t,"",Qyt),Av=()=>!0,J2=(t,e,n)=>{const r=Bme.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},Yyt=t=>Byt.test(t)&&!Fyt.test(t),Fme=()=>!1,Qyt=t=>Uyt.test(t),Xyt=t=>zyt.test(t),Jyt=()=>{const t=Nr("colors"),e=Nr("spacing"),n=Nr("blur"),r=Nr("brightness"),i=Nr("borderColor"),s=Nr("borderRadius"),o=Nr("borderSpacing"),a=Nr("borderWidth"),c=Nr("contrast"),l=Nr("grayscale"),u=Nr("hueRotate"),d=Nr("invert"),h=Nr("gap"),f=Nr("gradientColorStops"),m=Nr("gradientColorStopPositions"),y=Nr("inset"),v=Nr("margin"),b=Nr("opacity"),C=Nr("padding"),x=Nr("saturate"),_=Nr("scale"),$=Nr("sepia"),I=Nr("skew"),R=Nr("space"),N=Nr("translate"),T=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",Pn,e],z=()=>[Pn,e],L=()=>["",dd,af],S=()=>["auto",ay,Pn],k=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Pn],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[ay,Pn];return{cacheSize:500,separator:":",theme:{colors:[Av],spacing:[dd,af],blur:["none","",cf,Pn],brightness:B(),borderColor:[t],borderRadius:["n
525one","","full",cf,Pn],borderSpacing:z(),borderWidth:L(),contrast:B(),grayscale:D(),hueRotate:B(),invert:D(),gap:z(),gradientColorStops:[t],gradientColorStopPositions:[Wyt,af],inset:U(),margin:U(),opacity:B(),padding:z(),saturate:B(),scale:B(),sepia:D(),skew:B(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Pn]}],container:["container"],columns:[{columns:[cf]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...k(),Pn]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Sv,Pn]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pn]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",Sv,Pn]}],"grid-cols":[{"grid-cols":[Av]}],"col-start-end":[{col:["auto",{span:["full",Sv,Pn]},Pn]}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":[Av]}],"row-start-end":[{row:["auto",{span:[Sv,Pn]},Pn]}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pn]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pn,e]}],"min-w":[{"min-w":[Pn,e,"min","max","fit"]}],"max-w":[{"max-w":[Pn,e,"none","full","min","max","fit","prose",{screen:[cf]},cf]}],h:[{h:[Pn,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pn,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pn,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pn,e,"auto","min","max","fit"]}],"font-size":[{text:["base",cf,af]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",KT]}],"font-family":[{font:[Av]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pn]}],"line-clamp":[{"line-clamp":["none",ay,KT]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",dd,Pn]}],"list-image":[{"list-image":["none",Pn]}],"list-style-type":[{list:["none","disc","decimal",Pn]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",dd,af]}],"underline-offset":[{"underline-offset":["auto",dd,Pn]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pn]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...k(),qyt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vyt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Gyt]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}
vendor: 5,181 bytes, line 525
525],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[dd,Pn]}],"outline-w":[{outline:[dd,af]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[dd,af]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",cf,Zyt]}],"shadow-color":[{shadow:[Av]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",cf,Pn]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[$]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pn]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Pn]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Sv,Pn]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pn]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pn]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
525],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pn]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[dd,af,KT]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},e2t=jyt(Jyt);function Xn(...t){return e2t(whe(t))}function xRt(t,e=4,n=4){if(!t)return"";const r=t.length,i=Math.max(0,Math.min(e,r)),s=Math.max(0,Math.min(n,r-i));if(i+s>=r)return t;const o=i>0?t.slice(0,i):"",a=s>0?t.slice(r-s):"";return i>0&&s>0?`${o}...${a}`:i>0?`${o}...`:s>0?`...${a}`:"..."}function Ume(t,e){return!t||!e?!1:t.toLowerCase()===e.toLowerCase()}function ERt(t){return new Promise(e=>setTimeout(e,t))}function t2t(t){switch(t){case 137:return"https://polygonscan.com";case 1:return"https://etherscan.io";case 8453:return"https://basescan.org";case 10:return"https://optimistic.etherscan.io";case 42161:return"https://arbiscan.io";case 56:return"https://bscscan.com";case 43114:return"https://snowtrace.io";default:return"https://etherscan.io"}}function CRt(t,e){switch(t){case 728126428:return`https://tronscan.io/#/token20/${e}`;default:return`${t2t(t)}/token/${e}`}}function _Rt(t,e){switch(e){case 137:return`https://polygonscan.com/tx/${t}`;case 1:return`https://etherscan.io/tx/${t}`;case 8453:return`https://basescan.org/tx/${t}`;case 10:return`https://optimistic.etherscan.io/tx/${t}`;case 42161:return`https://arbiscan.io/tx/${t}`;case 56:return`https://bscscan.com/tx/${t}`;case 43114:return`https://snowtrace.io/tx/${t}`;case 728126428:return`https://tronscan.io/#/transaction/${t}`;default:return`https://etherscan.io/tx/${t}`}}function zme(t){const e=new ArrayBuffer(8),n=new DataView(e);n.setUint32(0,0,!1),n.setUint32(4,t,!1);
525const r=new Uint8Array(e),i=String.fromCharCode(...r);return btoa(i)}function SRt(){return typeof window>"u"?"https://pilot-api.dappos.com":new URLSearchParams(window.location.search).get("agent_backend_url")||"https://pilot-api.dappos.com"}function Jo(){return typeof window>"u"?"https://agent-api.dappos.com":new URLSearchParams(window.location.search).get("backend_url")||"https://agent-api.dappos.com"}function n2t(){return typeof window>"u"?"https://priv-prod-bubble.dappos.com":new URLSearchParams(window.location.search).get("private_url")||"https://priv-prod-bubble.dappos.com"}function Yj(){return typeof window>"u"?"https://payment.dappos.com":new URLSearchParams(window.location.search).get("payment_url")||"https://payment.dappos.com"}function r2t(t){var e;return((e=t.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/))==null?void 0:e[1])||""}function ARt(t,e=64){try{return`https://www.google.com/s2/favicons?domain=${r2t(t)}&sz=${e}`}catch{return null}}const kRt=(t,e)=>{let n=t.toString();if(!n.includes("."))return n+"."+"0".repeat(e);const[r,i=""]=n.split(".");let s=i.substring(0,e);return s.length<e&&(s=s.padEnd(e,"0")),`${r}.${s}`};function $Rt(t){if(t instanceof Error)return t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return"Unknown error"}}function Wme(t=16){if(![16,24,32].includes(t))throw new Error("AES key length must be 16, 24, or 32 bytes");const e=crypto.getRandomValues(new Uint8Array(t));return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function cy(t){return Dd.enc.Hex.parse(i2t(t))}function Qj(t){const e=Dd.enc.Hex.stringify(t);return gF(e)}function i2t(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function gF(t){const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n/2]=parseInt(t.substr(n,2),16);return e}function IRt(t,e,n="abcdef1234567890"){const r=gF(e),i=cy(r),s=cy(new TextEncoder().encode(n).slice(0,16)),o=cy(t),a=Dd.AES.encrypt(o,i,{iv:s,mode:Dd.mode.CBC,padding:Dd.pad.Pkcs7}),c=Qj(a.ciphertext),l=new Uint8Array(16+c.length);return l.set(Qj(s),0),l.set(c,16),l}function s2t(t,e){const n=gF(e),r=cy(n),i=cy(t.slice(0,16)),s=t.slice(16),o=cy(s),a=Dd.lib.CipherParams.create({ciphertext:o}),c=Dd.AES.decrypt(a,r,{iv:i,mode:Dd.mode.CBC,padding:Dd.pad.Pkcs7});return Qj(c)}function o2t(t){if(t.length<8)return"application/octet-stream";if([137,80,78,71,13,10,26,10].every((a,c)=>t[c]===a))return"image/png";if([255,216,255].every((a,c)=>t[c]===a))return"image/jpeg";if(t.length>=12){const a=[82,73,70,70],c=[87,69,66,80];if(a.every((u,d)=>t[d]===u)&&c.every((u,d)=>t[d+8]===u))return"image/webp"}return[71,73,70,56].every((a,c)=>t[c]===a)?"image/gif":(console.warn("image type error"),"application/octet-stream")}async function a2t(t,e,n){const i=await(await fetch(t)).arrayBuffer(),s=new Uint8Array(i),o=s2t(s,e),a=o2t(o),c=n||a,l=new Blob([o.slice()],{type:c}),u=URL.createObjectURL(l);return{url:u,revoke:()=>URL.revokeObjectURL(u)}}async function c2t(t,e,n,r){return n&&e&&t?await a2t(t,e,r):{url:t}}const Gee=["mp4","mov","avi","mkv","webm"],lf={images:[".jpg",".jpeg",".png",".webp",".bmp",".ico"],work:[".jpg",".jpeg",".png",".webp",".bmp",".ico",...Gee.map(t=>`.${t}`)],audio:[".mp3",".wav",".m4a",".ogg",".flac",".aac",".wma",".opus",".amr",".3gp"],docs:[".doc",".docx",".pdf",".txt",".json",".md",".jpg",".jpeg",".png",".webp",".bmp",".ico",".ppt",".pptx"],slide:[".ppt",".pptx",".pdf",".doc",".docx",".txt",".jpg",".jpeg",".png",".webp",".bmp",".ico"],herbalife:[...Gee.map(t=>`.${t}`),".pdf"]};function TRt(t){switch(t){case"image":return lf.images.join(",");case"video":return lf.images.join(",");case"work":return lf.work.join(",");case"audio":return lf.audio.join(",");case"docs":return lf.docs.join(",");case"slide":return lf.slide.join(",");case"herbalife":return lf.herbalife.join(",");default:return lf.images.join(",")}}function PRt(t,e){var s;const n=e==null?void 0:e.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(!(n!=null&&n.length))return!0;const r=`.${((s=t.name.split(".").pop())==null?void 0:s.toLowerCase())||""}`,i=t.type.toLowerCase();return n.some(o=>o.startsWith(".")?o===r:o.endsWith("/*")?i.startsWith(o.slice(0,-1)):o===i)}function RRt(t,e=!0){const n=new Date(t),r=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0");if(!e)return`${r}-${i}-${s}`;const o=String(n.getHours()).padStart(2,"0"),a=String(n.getMinutes()).padStart(2,"0");return`${r}-${i}-${s} ${o}:${a}`}const MRt={1:"Ethereum",56:"BNB Chain",10:"Optimism",43114:"Avalanche",137:"Polygon",169:"Manta Pacific",42161:"Arbitrum",6001:"BounceBit",324:"zkSync Era",204:"opBNB",534352:"Scroll",8453:"Base",728126428:"Tron"},ORt=t=>{const e=new RegExp("\\p{L}
525|\\p{N}","gu"),n=t.match(e);return n?n.length:0};function l2t(t){const e=t.replace(/\/$/,"");return/^https?:\/\//i.test(e)?e:e.startsWith("localhost")||e.startsWith("127.0.0.1")?`http://${e}`:`https://${e}`}const p0=class p0{constructor(){Ft(this,"baseURI","https://data-v3.dappos.com")}static getInstance(){return p0.instance||(p0.instance=new p0),p0.instance}createFetch(e){return u5.create({baseURL:this.baseURI,timeout:(e==null?void 0:e.timeout)??3e4,retry:3,retryDelay:1e3,retryStatusCodes:[500,502,503,504],responseType:e==null?void 0:e.responseType,headers:{Accept:"*/*","Accept-Language":"en","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive"},onRequest({options:n}){const r=ia.getAuthHeader();r&&(n.headers=new Headers(n.headers),n.headers.set("Authorization",r))},onResponseError({response:n,error:r}){throw((n==null?void 0:n.status)===403||(n==null?void 0:n.status)===401)&&(console.warn(`[Auth] ${n.status} - triggering logout`),ia.triggerLogout()),console.error("[API Error]",{error:r,response:n}),r??n},onRequestError({error:n}){throw console.error("[Request Error]",n),new Error("Failed to fetch")}})}get fetch(){return this.createFetch()}get stream(){return this.createFetch({responseType:"stream"})}async reportUploadFailure(e){try{const n=kgt(e);await this.fetch("/defiplannerserver/v2/frontend/upload-failure-reports",{method:"POST",body:n})}catch(n){console.warn("[upload-failure-report] failed to build or send report",n)}}async getTreadByPath(e){const{backendUrl:n,path:r,language:i}=e,s=new Headers;i&&s.set("Language",i);const o=await this.fetch("/defiplannerserver/v2/user_tags",{params:{backend_url:n,path:r,page:1,size:1,is_bubble:1},headers:s});if(!o.dataList.length)throw new Error("Thread not found");return o.dataList[0]}async getPublishedThreadByPath(e){const{path:n,language:r}=e,i=new Headers;r&&i.set("Language",r);const s=await this.fetch("/defiplannerserver/v2/user_tags/published",{params:{path:n},headers:i});if("eCode"in s)throw new Error(s.eMsg);return s.userLastPrompt&&(s.userLastPrompt=s.userLastPrompt.replaceAll(/###[^#]*###/g,"")),s}async getHistory(e){const{account_id:n,backendUrl:r,path:i,page:s,size:o,eoa:a,keyword:c}=e;return await this.fetch("/defiplannerserver/v2/user_tags",{params:{is_bubble:1,accountId:n,eoa:a,backend_url:r,path:i,page:s??1,size:o??20,keyword:c}})}async getBubbleUps(e){const n=(e==null?void 0:e.backendUrl)??Jo();return await this.fetch("/defiplannerserver/v2/thread_issues",{params:{backendUrl:n}})}async privateChatStream(e){const{mode:n,state:r,thread_id:i,signal:s,onRunCreated:o,onMessage:a,onError:c,onComplete:l}=e,u={mode:n,state:r,thread_id:i,stream:!0};return(async()=>{try{const d=n2t(),h=await fetch(`${d}/interactive`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:ia.getAuthHeader()},body:JSON.stringify(u),signal:s});if(!h.ok)throw new Error(`HTTP ${h.status}: ${h.statusText}`);const f=Hme(h);f&&(o==null||o(f));const m=(h.body||new ReadableStream({start:y=>y.close()})).pipeThrough(x3()).pipeThrough(E3());for await(const y of up.fromReadableStream(m)){const v=y.data;if(v.error){const b=new Error(v.error);throw c==null||c(v.error),b}if(v.type==="done"){l==null||l();return}v.state&&(a==null||a(y))}l==null||l()}catch(d){throw c==null||c(d),d}})()}async create(e){const{account_id:n,title:r,threadId:i,backendUrl:s,eoa:o}=e;return await this.fetch("/defiplannerserver/v2/user_tags",{method:"POST",body:JSON.stringify({isBubble:1,accountId:n,eoa:o,title:r,threadId:i,time:new Date().toISOString(),backendUrl:s})})}async continueChat(e){const{threadId:n}=e;return await this.fetch("/defiplannerserver/v2/user_tags/backfill-publish-json",{method:"POST",body:JSON.stringify({threadId:n})})}async delete(e){const{id:n}=e;return await this.fetch(`/defiplannerserver/v2/user_tags/${n}`,{method:"DELETE"})}async update(e){return await this.fetch(`/defiplannerserver/v2/user_tags/${e.id}`,{method:"PUT",body:JSON.stringify(e)})}async checkBind(e){return(await this.fetch(`/aibackend/invite_info/by_eoa/${e.eoa}`)).code}async bindCode(e){const n={eoa:e.eoa,code:e.code},r=await this.fetch("/aibackend/invite_users/bind_code",{method:"POST",body:JSON.stringify(n)});if("eMsg"in r&&r.eCode!==0)throw new Error(r.eMsg);return r}async getChannelAirdropRegistration(e){const n=await this.fetch(`/aibackend/channel_airdrop_registrations?channelEoa=${encodeURIComponent(e.channelEoa)}`);if("eMsg"in n)throw new Error(n.eMsg);return n.registered?n.data??null:null}async bindAirdropClaimAddress(e){const n=await this.fetch("/aibackend/channel_airdrop_registrations",{method:"POST",body:JSON.stringify(e)});if("eMsg"in n&&n.eCode!==0)throw new Error(n.eMsg);return n}async updateAirdropClaimAddress(e){const n=await this.fetch("/aibackend/channel_airdrop_registrations",{method:"PUT",body:JSON.stringify(e)});if("eMsg"in n&&n.eCode!==0)throw new Error(n.eMsg);return n}async getCode(e){const n=`eoa=${e.eoa}&baseUrl=${Yj()}`,r=await this.fetch(`/aibackend/invite_users/by_account?${n}`);if("eMsg"in r&&r.eCode!==0)throw new Error(r.eMsg);return r}async ping(){return await this.fetch("/defiplannerserver/v2/user_tags/ping",{method:"GET"})}async getProjectsByEoa(e){return(await this.fetch(`/defiplannerserver/v2/projects/eoa/${e.eoa}`,{method:"GET",params:{backendUrl:e.backendUrl??Jo()}})).data??[]}async searchProjects(e){return(await this.fetch("/defiplannerserver/v2/projects/search",{method:"GET",params:{keyword:e.keyword,...e.backendUrl?{backendUrl:e.backendUrl}:{}}})).data??[]}async updateProject(e){const{id:n,...r}=e;return(await this.fetch(`/defiplannerserver/v2/projects/${n}`,{method:"PUT",body:JSON.stringify(r)})).data}async publishThread(e){const n=await this.fetch(`/defiplannerserver/v2/user_tags/${e.id}/publish`,{method:"POST",timeout:0,body:JSON.stringify({logo:e.logo,title:e.title,delOpportunityIds:e.opportunityIndex})});
525if(n.eCode!==0){if(n.eMsg.includes("already published"))return"already published";throw new Error(n.eMsg)}return n}async getPublishImage(e){const n=await this.fetch("/defiplannerserver/v2/user_tags/logo",{method:"GET",params:{path:e.path}});if("eCode"in n)throw new Error(n.eMsg);return n}async generatePublishData(e){const n=await this.fetch("/defiplannerserver/v2/user_tags/logo-title",{method:"GET",timeout:1e5,params:{path:e.path}});if("eCode"in n)throw new Error(n.eMsg);return n}async getPublishedThread(e){const n=new Headers;return e.language&&n.set("Language",e.language),await this.fetch("/defiplannerserver/v2/user_tags?is_publish=1&is_audit=1",{method:"GET",params:{page:e.page,size:e.size,backend_url:e.backendUrl},headers:n})}async getPublishedPaths(){return await this.fetch("/defiplannerserver/v2/user_tags/published-paths",{method:"GET"})}async createFourmemeToken(e){return await this.fetch("/defiplannerserver/v2/meme_tokens",{method:"POST",body:JSON.stringify(e)})}async queryFourmemeToken(e){const n=await this.fetch("/defiplannerserver/v2/meme_tokens/search",{method:"GET",params:{logoUrl:e.logoUrl}});if("tokenAddress"in n)return Ume(n.tokenAddress,Gc)?void 0:n.tokenAddress}threads(e){const n=e||Jo(),r=()=>{let l=e||Jo();return l.includes("agent-api.dappos.com")&&(l=void 0),l},i={getState:async l=>{const d={base_url:r(),thread_id:l};return d.base_url||delete d.base_url,await this.fetch("/defiplannerserver/v2/threads/state",{params:d})},get:async l=>{const d={base_url:r(),thread_id:l};return d.base_url||delete d.base_url,await this.fetch("/defiplannerserver/v2/threads/history",{params:d})},list:async(l,u)=>{const h={base_url:r(),thread_id:l,limit:(u==null?void 0:u.limit)??10,offset:(u==null?void 0:u.offset)??0};return h.base_url||delete h.base_url,await this.fetch("/defiplannerserver/v2/threads/runs",{params:h})},create:async l=>{const d={base_url:r()};return d.base_url||delete d.base_url,await this.fetch("/defiplannerserver/v2/threads",{method:"POST",params:d,body:JSON.stringify(l)})},cancel:async(l,u)=>{const h={base_url:r(),thread_id:l,run_id:u,wait:0,action:"interrupt"};return h.base_url||delete h.base_url,await this.fetch("/defiplannerserver/v2/threads/runs/cancel",{method:"PUT",params:h}),!0},getThoughts:async(l,u)=>{const d=await fetch(`${l2t(n)}/threads/${encodeURIComponent(l)}/runs/${encodeURIComponent(u)}/thoughts`,{headers:{Accept:"application/json",Authorization:ia.getAuthHeader()}});if(!d.ok)throw new Error(`Thought history query failed: ${d.status}`);return await d.json()},stream:(l,u,d)=>{const h=r();return new Zee({apiUrl:this.baseURI+"/defiplannerserver/v2",baseURL:h,apiKey:ia.getAuthHeader(),timeoutMs:5e3,callerOptions:{maxRetries:3,maxConcurrency:3}}).stream(l,u,d)},joinStream:(l,u,d)=>{const h=r();return new Zee({apiUrl:this.baseURI+"/defiplannerserver/v2",baseURL:h,apiKey:ia.getAuthHeader()}).joinStream(l,u,d)}},s=Math.floor(Date.now()/1e3),o=zme(s),a=new vme({apiUrl:n,apiKey:o});let c=!1;return(n.startsWith("http://localhost")||n.startsWith("http://127.0.0.1"))&&(c=!0),{getState:async l=>c?a.threads.getState(l):i.getState(l),get:async l=>c?a.threads.get(l):i.get(l),list:async(l,u)=>c?a.runs.list(l,u):i.list(l,u),create:async l=>c?a.threads.create(l):i.create(l).catch(u=>{throw u._data.error?new Error(u._data.error):typeof u.message=="string"&&u.message.includes("tasks can run at once")?new Error(u):new Error(u)}),cancel:async(l,u)=>c?a.runs.cancel(l,u):i.cancel(l,u),getThoughts:async(l,u)=>i.getThoughts(l,u),stream:async(l,u,d)=>c?a.runs.stream(l,u,d):i.stream(l,u,d),joinStream:(l,u,d)=>c?a.runs.joinStream(l,u,d):i.joinStream(l,u,d)}}async getMemory(e){const n=`eoa=${e.eoa}&baseUrl=${Yj()}`,r=await this.fetch(`/aibackend/invite_users/by_account?${n}`);if("eMsg"in r)throw new Error(r.eMsg);return r}async getVoiceClones(){return await this.fetch("/defiplannerserver/v2/voice_clones",{method:"GET"})}async createVoiceClone(e){const n=await this.fetch("/defiplannerserver/v2/voice_clones",{method:"POST",body:JSON.stringify(e),timeout:3e5});if("eMsg"in n&&n.eCode!==0)throw new Error(n.eMsg);return n}async updateVoiceCloneName(e){return await this.fetch(`/defiplannerserver/v2/voice_clones/${e.id}/name`,{method:"PUT",body:JSON.stringify({name:e.name})})}async deleteVoiceClone(e){return await this.fetch(`/defiplannerserver/v2/voice_clones/${e.id}`,{method:"DELETE"})}async setMemory(e){const n={eoa:e.eoa,memoryAnalyze:!0,memoryEnabled:e.memoryEnabled},r=await this.fetch("/defiplannerserver/v2/user_infos/memory_switch",{method:"POST",body:JSON.stringify(n)});if("eMsg"in r&&r.eCode!==0)throw new Error(r.eMsg);return r}async getMemoryList(e){const{eoa:n}=e,r=Jo();return await this.fetch(`/defiplannerserver/v2/user_memories/eoa/${n}`,{params:{backendUrl:r}})}async deleteMemory(e){const{id:n}=e;return await this.fetch(`/defiplannerserver/v2/user_memories/${n}`,{method:"DELETE"})}async deleteAllMemory(e){const{eoa:n}=e,r=Jo();return await this.fetch(`/defiplannerserver/v2/user_memories/eoa/${n}`,{method:"DELETE",params:{backendUrl:r}})}async uploadPortraitImage(e){const{file:n}=e,r=Jo(),i=new FormData;i.append("file",n);const s=await this.fetch("/defiplannerserver/v2/portrait_images",{method:"POST",body:i,params:{backendUrl:r}});if("eCode"in s&&s.eCode!==0)throw new Error(s.eMsg);return s.data}async getPortraitImages(e){const n=await this.fetch(`/defiplannerserver/v2/portrait_images/eoa/${e.eoa}`,{method:"GET"});if("eMsg"in n)throw new Error(n.eMsg);return n}async deletePortraitImage(e){const n=await this.fetch(`/defiplannerserver/v2/portrait_images/${e.id}`,{method:"DELETE"});if("eMsg"in n&&n.eCode!==0)throw new Error(n.eMsg);return!0}async getUserProfile(e){return await this.fetch(`/defiplannerserver/v2/user_infos/eoa/${e.eoa}`,{method:"GET"})}async updateUserProfile(e){if(!e.nickname&&!e.file&&!e.language)throw new Error("nickname, avatar or language is required");const n="/defiplannerserver/v2/user_infos",r={...e.nickname?{nickname:e.nickname}:{},...e.language?{language:e.language}:{}};if(e.file){const s=new FormData;return s.append("file",e.file),Object.keys(r).length>0&&s.append("payload",JSON.stringify(r)),await this.fetch(n,{method:"POST",body:s})}return await this.fetch(n,{method:"POST",body:JSON.stringify(r)})}async createScheduleTask(e,n){const r={baseUrl:Jo(),...e},i=await this.fetch("/defiplannerserver/v2/user_schedule_tasks",{method:"POST",body:JSON.stringify(r),headers:n!=null&&n.source?{source:n.source}:void 0});if(i.eCode!==0)throw new Error(i.eMsg);return i.data}async getScheduleTasks(e){const n=await this.fetch("/defiplannerserver/v2/user_schedule_tasks",{params:{page:e.page??1,size:e.size??20,...e.status!==void 0?{status:e.status}:{}}});if("eCode"in n)throw new Error(n.eMsg);return n}async getScheduleExecutedConversations(e){const n=await this.fetch("/defiplannerserver/v2/user_schedule_tasks/executed-conversations",{params:{page:e.page??1,size:e.size??20}});if("eCode"in n)throw new Error(n.eMsg);return n}async updateScheduleTask(e){const n=await this.fetch(`/defiplannerserver/v2/user_schedule_tasks/${e.id}`,{method:"PUT",body:JSON.stringify(e.body),headers:e.source?{source:e.source}:void 0});if("eCode"in n&&n.eCode!==0)throw new Error(n.eMsg)}async deleteScheduleTask(e){const n=await this.fetch(`/defiplannerserver/v2/user_schedule_tasks/${e.id}`,{method:"DELETE",headers:e.source?{source:e.source}:void 0});if("eCode"in n&&n.eCode!==0)throw new Error(n.eMsg)}async pdfToDocs(e,n){const r={sourceUrl:e};n&&(r.key=n);const i=await this.fetch("/convert/pdf-to-docx",{method:"POST",body:JSON.stringify(r)});if("eMsg"in i)throw new Error(i.eMsg);return i}async pptToPdf(e,n){const r={sourceUrl:e};n&&(r.key=n);const i=await this.fetch("/convert/pptx-to-pdf",{method:"POST",body:JSON.stringify(r)});if("eMsg"in i)throw new Error(i.eMsg);return i}get feedback(){return{submit:async e=>{const n=Jo();await this.fetch("/defiplannerserver/v2/thread_issues",{method:"POST",body:JSON.stringify({...e,backendUrl:n})})},get:async e=>{const n=Jo(),r=await this.fetch("/defiplannerserver/v2/thread_issues",{method:"GET",params:{messageId:e.messageId,threadId:e.threadId,path:e.path,backendUrl:n}});if(r.eCode!==0)throw new Error(r.eMsg);return r.data}}}};Ft(p0,"instance");let oE=p0;const u2t=/(\/threads\/(?<thread_id>.+))?\/runs\/(?<run_id>.+)/;function Hme(t){var r;const e=t.headers.get("Content-Location");if(!e)return;const n=u2t.exec(e);if((r=n==null?void 0:n.groups)!=null&&r.run_id)return{run_id:n.groups.run_id,thread_id:n.groups.thread_id||void 0}}class Zee extends wme{constructor(n){super({callerOptions:n.callerOptions});Ft(this,"apiUrl");Ft(this,"apiKey");Ft(this,"baseURL");this.apiUrl=n.apiUrl,this.baseURL=n.baseURL,this.apiKey=n.apiKey}async*stream(n,r,i){var d;const s={input:i==null?void 0:i.input,command:i==null?void 0:i.command,config:i==null?void 0:i.config,metadata:i==null?void 0:i.metadata,stream_mode:i==null?void 0:i.streamMode,stream_subgraphs:i==null?void 0:i.streamSubgraphs,stream_resumable:i==null?void 0:i.streamResumable,feedback_keys:i==null?void 0:i.feedbackKeys,assistant_id:r,interrupt_before:i==null?void 0:i.interruptBefore,interrupt_after:i==null?void 0:i.interruptAfter,checkpoint:i==null?void 0:i.checkpoint,checkpoint_id:i==null?void 0:i.checkpointId,webhook:i==null?void 0:i.webhook,multitask_strategy:i==null?void 0:i.multitaskStrategy,on_completion:i==null?void 0:i.onCompletion,on_disconnect:i==null?void 0:i.onDisconnect,after_seconds:i==null?void 0:i.afterSeconds,if_not_exists:i==null?void 0:i.ifNotExists,checkpoint_during:i==null?void 0:i.checkpointDuring,base_url:this.baseURL}
525,o=n==null?"/runs/stream":`/threads/${n}/runs/stream`,a={base_url:this.baseURL};a.base_url||delete a.base_url;const c=await this.asyncCaller.fetch(...this.prepareFetchOptions(o,{params:a,method:"POST",json:s,headers:{Authorization:this.apiKey},timeoutMs:null,signal:i==null?void 0:i.signal})),l=Hme(c);l&&((d=i==null?void 0:i.onRunCreated)==null||d.call(i,l));const u=(c.body||new ReadableStream({start:h=>h.close()})).pipeThrough(x3()).pipeThrough(E3());yield*up.fromReadableStream(u)}async*joinStream(n,r,i){const s=typeof i=="object"&&i!=null&&i instanceof AbortSignal?{signal:i}:i,o={base_url:this.baseURL,cancel_on_disconnect:s!=null&&s.cancelOnDisconnect?"1":"0",stream_mode:s==null?void 0:s.streamMode,thread_id:n,run_id:r};o.base_url||delete o.base_url,n||delete o.thread_id;const a=n!=null?"/threads/runs/stream":"/runs/stream",l=((await this.asyncCaller.fetch(...this.prepareFetchOptions(a,{params:o,method:"GET",timeoutMs:null,signal:s==null?void 0:s.signal,headers:s!=null&&s.lastEventId?{"Last-Event-ID":s.lastEventId,Authorization:this.apiKey}:{Authorization:this.apiKey}}))).body||new ReadableStream({start:u=>u.close()})).pipeThrough(x3()).pipeThrough(E3());yield*up.fromReadableStream(l)}}var d2t=(t=>(t[t.Recharge=0]="Recharge",t[t.Usage=1]="Usage",t))(d2t||{}),h2t=(t=>(t[t.Pending=0]="Pending",t[t.Paid=1]="Paid",t[t.Canceled=2]="Canceled",t[t.PartiallyPaid=3]="PartiallyPaid",t[t.Expired=4]="Expired",t[t.Credited=5]="Credited",t))(h2t||{});function jRt(t){return typeof t=="object"&&t!==null&&"eCode"in t&&typeof t.eCode=="number"}class f2t{constructor(){Ft(this,"baseURI","https://payment.dappos.com")}createFetch(){return u5.create({baseURL:Yj(),timeout:3e4,retry:3,retryDelay:1e3,retryStatusCodes:[500,502,503,504],headers:{Accept:"*/*","Accept-Language":"en"},onRequest({options:e}){const n=ia.getAuthHeader();n&&(e.headers=new Headers(e.headers),e.headers.set("Authorization",n))},onResponseError({response:e,error:n}){throw((e==null?void 0:e.status)===403||(e==null?void 0:e.status)===401)&&(console.warn(`[Auth] ${e.status} - triggering logout`),ia.triggerLogout()),console.error("[API Error]",n),new Error((n==null?void 0:n.name)??`Request failed: ${e==null?void 0:e.status}`)},onRequestError({error:e}){throw console.error("[Request Error]",e),new Error("Failed to fetch")}})}get fetch(){return this.createFetch()}async createPackageOrder(e){const n=await this.fetch("/membercenter/package_orders/",{method:"POST",body:e});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async getUserByEoa(e){const n=await this.fetch("/membercenter/user_invites/by_eoa",{params:{eoaAddress:e.eoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async getServiceProvider(e){const n={hasProvider:!1,nickname:"",eoaAddress:e.eoa,emails:"",websiteUrl:""},r=await this.fetch("/membercenter/user_invites/service_provider",{params:{eoa:e.eoa}});return r.eCode===0?r.data??n:n}async getUserByInviteCode(e){const n=await this.fetch("/membercenter/user_invites/by_invite_code",{params:{inviteCode:e.inviteCode}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return!n.data||Object.keys(n.data).length===0?null:n.data}async getActivityPendingStatus(e){const n=await this.fetch("/membercenter/user_invites/activity_pending_status",{params:{eoaAddress:e.eoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async acceptInvite(e){const n=await this.fetch("/membercenter/user_invites/accept_invite",{method:"POST",body:{eoaAddress:e.eoa,inviteCode:e.code}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async updateOwnInviteParent(e){const n=await this.fetch("/membercenter/user_invites/update_own_invite_parent",{method:"PUT",body:{inviteCode:e.inviteCode}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async bindInviteCode(e){const n=await this.fetch("/membercenter/user_invites/bind_code",{method:"PUT",body:{eoaAddress:e.eoa,code:e.code}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async getPendingOrders(e){const n=await this.fetch("/membercenter/package_orders",{params:{eoa:e.eoa,status:"0,3,5",page:e.page??1,size:e.size??10}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async getCreditsHistory(e){var i;const n=new URLSearchParams;n.append("eoa",e.eoa),n.append("page",String(e.page??1)),n.append("size",String(e.size??10)),(i=e.dateValue)!=null&&i.length&&e.dateValue.forEach(s=>
525{n.append("dateValue[]",s)}),e.type!==void 0&&n.append("type",String(e.type));const r=await this.fetch(`/membercenter/credit_logs?${n.toString()}`);if(r.eCode!==0)throw{eCode:r.eCode,eMsg:r.eMsg};return r.data}async getAccountInfo(e){const n=await this.fetch("/membercenter/user_invites/account_info",{params:{eoa:e.eoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async completeAppleIapAddOnCreditsPurchase(e){const n=await this.fetch("/membercenter/apple_iap/add_on_credits/complete",{method:"POST",body:e});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async grantAppleIapIntroAddOnCredits(e){const n=await this.fetch("/membercenter/apple_iap/add_on_credits/intro_grant",{method:"POST",body:e});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async getBillingHistory(e){var i;const n=new URLSearchParams;n.append("eoa",e.eoa),e.active_now?n.append("active_now","true"):(n.append("page",String(e.page??1)),n.append("size",String(e.size??10)),(i=e.dateValue)!=null&&i.length&&e.dateValue.forEach(s=>{n.append("dateValue[]",s)}),e.status!==void 0&&n.append("status",String(e.status)));const r=await this.fetch(`/membercenter/package_orders?${n.toString()}`);if(r.eCode!==0)throw{eCode:r.eCode,eMsg:r.eMsg};return r.data}async getReferralList(e){const n=await this.fetch("/membercenter/user_invites/invitees",{params:{eoaAddress:e.eoa,page:e.page??1,size:e.size??10}});if("dataList"in n)return n;throw{eCode:n.eCode,eMsg:n.eMsg}}async getPackages(){const e=await this.fetch("/membercenter/packages");if(e.eCode!==0)throw{eCode:e.eCode,eMsg:e.eMsg};return e.data}async getPaymentChainToken(){const e=await this.fetch("/membercenter/chain_tokens");if(e.eCode!==0)throw{eCode:e.eCode,eMsg:e.eMsg};return e.data}async getOrder(e){const n=await this.fetch(`/membercenter/package_orders/${e.id}`);if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async cancelOrder(e){const n=`/membercenter/package_orders/${e}/cancel`,r=await this.fetch(n,{method:"PUT"});if(r.eCode!==0)throw{eCode:r.eCode,eMsg:r.eMsg};return r.data}async getRedeemRecords(e){const n=await this.fetch("/membercenter/redeem_records",{params:{eoa:e.eoa}});if("eCode"in n){if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}return n}async getRedeemExchangeRates(){const e=await this.fetch("/membercenter/redeem_exchange_rates");if("eCode"in e){if(e.eCode!==0)throw{eCode:e.eCode,eMsg:e.eMsg};return e.data}return e}async createRedeemRecord(e){const n=await this.fetch("/membercenter/redeem_records",{method:"POST",body:e});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async exportReferralList(e){return await this.fetch("/membercenter/package_orders/invite_purchase_status",{params:{eoa_address:e.eoa}})??""}async updateWorkspaceStatus(e){const n=await this.fetch("/membercenter/user_invites/update_workspace_status",{method:"PUT",body:{eoaAddress:e.eoaAddress,workspaceStatus:e.workspaceStatus}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async checkSubAccount(e){const n=await this.fetch("/membercenter/user_invites/check_sub_account",{params:{enterpriseEoa:e.enterpriseEoa,subEoa:e.subEoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async inviteSubAccounts(e){const n=await this.fetch("/membercenter/user_invites/invite_sub_accounts",{method:"PUT",body:{enterpriseEoa:e.enterpriseEoa,subEoas:e.subEoas}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async cancelInviteSubAccount(e){const n=await this.fetch("/membercenter/user_invites/cancel_invite_sub_account",{method:"PUT",body:{enterpriseEoa:e.enterpriseEoa,subEoa:e.subEoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async removeSubAccount(e){const n=await this.fetch("/membercenter/user_invites/remove_sub_account",{method:"PUT",body:{enterpriseEoa:e.enterpriseEoa,subEoa:e.subEoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async ApplyEnterprise(e){const n=await this.fetch("/membercenter/user_invites/apply_enterprise",{method:"PUT",body:{eoaAddress:e.eoaAddress}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async getSubAccounts(e){const n=await this.fetch("/membercenter/user_invites/enterprise_sub_accounts",{params:{enterpriseEoa:e.eoaAddress}});if("eCode"in n){if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}return n}async getSubAccountLogs(e){const n=await this.fetch("/membercenter/sub_account_logs",{params:{page:e.page,size:e.size,eoa:e.eoa,status:e.status,dateValue:e.dateValue}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async getGoldCreditExchangeInfo(e){const n=await this.fetch("/membercenter/member_mall/gold_credit_exchange_info",{params:{eoaAddress:e==null?void 0:e.eoaAddress,eoa:e==null?void 0:e.eoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async getFormerMembers(e){const n=await this.fetch("/membercenter/user_invites/former_member",{params:{page:e.page,size:e.size,eoa:e.eoa,enterpriseEoa:e.enterpriseEoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async AcceptEnterprice(e){const n=await this.fetch("/membercenter/user_invites/accept_sub_account",{method:"PUT",body:{enterpriseEoa:e.enterpriseEoa,subEoa:e.subAddress}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async RejectEnterprice(e){const n=await this.fetch("/membercenter/user_invites/reject_sub_account",{method:"PUT",body:{enterpriseEoa:e.enterpriseEoa,subEoa:e.subAddress}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async ExitEnterprice(e){const n=await this.fetch("/membercenter/user_invites/exit_sub_account",{method:"PUT",body:{subEoa:e.subEoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data??null}async getGoldCreditExchangeLogs(e){const n=await this.fetch("/membercenter/member_mall/gold_credit_exchange_logs",{params:{eoaAddress:e==null?void 0:e.eoaAddress,eoa:e==null?void 0:e.eoa,page:(e==null?void 0:e.page)??1,size:(e==null?void 0:e.size)??10}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async createGoldCreditExchange(e){const n=await this.fetch("/membercenter/member_mall/gold_credit_exchange",{method:"POST",body:e});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async updateGoldCreditAutoExchangePause(e){const n=await this.fetch("/membercenter/member_mall/gold_credit_auto_exchange_pause",{method:"POST",body:e});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}async getGoldCreditAutoExchange(e){const n=await this.fetch("/membercenter/member_mall/gold_credit_auto_exchange",{params:{eoaAddress:e==null?void 0:e.eoaAddress,eoa:e==null?void 0:e.eoa}});if(n.eCode!==0)throw{eCode:n.eCode,eMsg:n.eMsg};return n.data}}const p2t=t=>({message:`Sign this message to authenticate with BUBBLE. 526Nonce: `,fullMessage:`Sign this message to authenticate with BUBBLE. 527Nonce: ${t}`,nonce:t,timestamp:Date.now()});function g2t(t){return new TextEncoder().encode(t)}function m2t(t){let e="";return t.forEach(n=>{e+=String.fromCharCode(n)}),btoa(e)}function y2t(t,e="evm"){return typeof t=="string"?t:e==="solana"?m2t(t):Ii(t)}function fh(t,e){return!(t!=null&&t.address)||!(e!=null&&e.address)||t.chain&&e.chain&&t.chain!==e.chain?!1:t.chain==="evm"||e.chain==="evm"?Ume(t.address,e.address):t.address===e.address}function w2t({activeWallet:t,session:e,loginIntent:n}){return t?e&&fh(e,t)||(n==null?void 0:n.chain)===t.chain&&!n.address?!0:fh(n,t):!1}function Vme({activeWallet:t,session:e,loginIntent:n}){return e&&t&&fh(e,t)?!0:n!=null&&n.consumed?!1:w2t({activeWallet:t,session:e,loginIntent:n})}function v2t({solanaWallet:t,evmWallet:e,loginIntent:n,session:r}){return(n==null?void 0:n.chain)==="evm"&&e?e:(n==null?void 0:n.chain)==="solana"&&t?t:r&&e&&fh(r,e)?e:r&&t&&fh(r,t)?t:t??e}function b2t(t){return t==="idle"||t==="error"}function x2t({activeWallet:t,currentSession:e,loginIntent:n}){return!t||!e||fh(e,t)?!1:Vme({activeWallet:t,session:null,loginIntent:n})}function E2t({state:t,loginIntent:e}){return(e==null?void 0:e.consumed)===!0&&(t==="connected"||t==="signing"||t==="signed"||t==="fetchingUserData"||t==="needsInviteCode"||t==="authorized")}function C2t(t,e){return!!(t&&e&&fh(t,e))}function kv(t){return t&&{...t,consumed:!0}}function I6(t){return t&&Wr(t)?t:void 0}function Yee(t){return Wr(t)?cr(t):t}function Qee(t){return t?{...t,chain:t.chain??"evm"}:null}const _2t=ase.AUTH.replaceAll(":","_").toLowerCase(),S2t=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function GT(t,e){S2t&&e===null&&console.trace(`[Auth Trace] ${t} cleared session`)}function ZT(t){typeof document>"u"||(ru.remove(t,{path:"/"}),ru.remove(t,{path:JN}))}const YT=new Map,QT=()=>typeof localStorage>"u"?null:localStorage,A2t=yme(()=>({getItem:t=>{var e;return ZT(t),((e=QT())==null?void 0:e.getItem(t))??YT.get(t)??null},setItem:(t,e)=>{ZT(t);const n=QT();
527n?n.setItem(t,e):YT.set(t,e)},removeItem:t=>{var e;ZT(t),(e=QT())==null||e.removeItem(t),YT.delete(t)}}));let $v=null;const wd=C5()(S1t((t,e)=>({session:null,_hasHydrated:!1,setSession:n=>{GT("setSession",n),t({session:Qee(n)})},setHasHydrated:n=>{t({_hasHydrated:n})},clear:()=>{GT("clear",null),t({session:null})},registerLogoutHandler:n=>($v=n,()=>{$v===n&&($v=null)}),triggerLogout:()=>{$v?$v():(GT("triggerLogout",null),t({session:null}))}}),{name:_2t,storage:A2t,partialize:t=>({session:t.session}),merge:(t,e)=>{const n=t??{};return{...e,...n,session:Qee(n.session)}},onRehydrateStorage:()=>t=>{t&&t.setHasHydrated(!0)}})),ia={getSession:()=>wd.getState().session,setSession:t=>wd.getState().setSession(t),getAuthHeader:()=>{const t=wd.getState().session;return t?JSON.stringify({chain:t.chain,signature:t.signature,address:t.address,nonce:t.nonce,fullMessage:t.fullMessage,message:t.message}):""},isAuthenticated:()=>wd.getState().session!==null,getAddress:()=>{var t;return((t=wd.getState().session)==null?void 0:t.address)??null},triggerLogout:()=>wd.getState().triggerLogout(),registerLogoutHandler:t=>wd.getState().registerLogoutHandler(t)};let qme=class{constructor(e,n){this.operator=e,this.value=n,Object.defineProperty(this,"t",{writable:!0})}get notes(){return this.t}addNote(e){this.t=this.t||[],this.t.push(e)}},mF=class extends qme{};class uS extends mF{constructor(e,n){if(!Array.isArray(n))throw new Error(`"${e}" operator expects to receive an array of conditions`);super(e,n)}}const sx="__itself__";let dS=class extends qme{constructor(e,n,r){super(e,r),this.field=n}};const Kme=new mF("__null__",null),Xj=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);function k2t(t,e){return e instanceof uS&&e.operator===t}function Gme(t,e){return e.length===1?e[0]:new uS(t,function n(r,i,s){const o=s||[];for(let a=0,c=i.length;a<c;a++){const l=i[a];k2t(r,l)?n(r,l.value,o):o.push(l)}return o}(t,e))}const $2t=t=>t,Zme=()=>Object.create(null),Yme=Object.defineProperty(Zme(),"__@type@__",{value:"ignore value"});function I2t(t,e,n=!1){if(!t||t&&t.constructor!==Object)return!1;for(const r in t)if(Xj(t,r)&&Xj(e,r)&&(!n||t[r]!==Yme))return!0;return!1}function T2t(t){const e=[];for(const n in t)Xj(t,n)&&t[n]!==Yme&&e.push(n);return e}function XT(t,e){e!==Kme&&t.push(e)}const Qme=t=>Gme("and",t),Xme={compound(t,e,n){const r=(Array.isArray(e)?e:[e]).map(i=>n.parse(i));return new uS(t.name,r)},field:(t,e,n)=>new dS(t.name,n.field,e),document:(t,e)=>new mF(t.name,e)};let P2t=class{constructor(e,n=Zme()){this.o=void 0,this.s=void 0,this.i=void 0,this.u=void 0,this.h=void 0,this.parse=this.parse.bind(this),this.u={operatorToConditionName:n.operatorToConditionName||$2t,defaultOperatorName:n.defaultOperatorName||"eq",mergeFinalConditions:n.mergeFinalConditions||Qme},this.o=Object.keys(e).reduce((r,i)=>(r[i]=Object.assign({name:this.u.operatorToConditionName(i)},e[i]),r),{}),this.s=Object.assign({},n.fieldContext,{field:"",query:{},parse:this.parse,hasOperators:r=>I2t(r,this.o,n.useIgnoreValue)}),this.i=Object.assign({},n.documentContext,{parse:this.parse,query:{}}),this.h=n.useIgnoreValue?T2t:Object.keys}setParse(e){this.parse=e,this.s.parse=e,this.i.parse=e}parseField(e,n,r,i){const s=this.o[n];if(!s)throw new Error(`Unsupported operator "${n}"`);if(s.type!=="field")throw new Error(`Unexpected ${s.type} operator "${n}" at field level`);return this.s.field=e,this.s.query=i,this.parseInstruction(s,r,this.s)}parseInstruction(e,n,r){return typeof e.validate=="function"&&e.validate(e,n),(e.parse||Xme[e.type])(e,n,r)}parseFieldOperators(e,n){const r=[],i=this.h(n);for(let s=0,o=i.length;s<o;s++){const a=i[s];if(!this.o[a])throw new Error(`Field query for "${e}" may contain only operators or a plain object as a value`);XT(r,this.parseField(e,a,n[a],n))}return r}parse(e){const n=[],r=this.h(e);this.i.query=e;for(let i=0,s=r.length;i<s;i++){const o=r[i],a=e[o],c=this.o[o];if(c){if(c.type!=="document"&&c.type!=="compound")throw new Error(`Cannot use parsing instruction for operator "${o}" in "document" context as it is supposed to be used in "${c.type}" context`);XT(n,this.parseInstruction(c,a,this.i))}else this.s.hasOperators(a)?n.push(...this.parseFieldOperators(o,a)):XT(n,this.parseField(o,this.u.defaultOperatorName,a,e))}return this.u.mergeFinalConditions(n)}};function JT(t,e){const n=t[e];if(typeof n!="function")throw new Error(`Unable to interpret "${e}" condition. Did you forget to register interpreter for it?`);return n}function R2t(t){return t.operator}function M2t(t,e){const n=e,r=n&&n.getInterpreterName||R2t;let i;switch(n?n.numberOfArguments:0){case 1:i=o=>{const a=r(o,n);return JT(t,a)(o,s)};break;case 3:i=(o,a,c)=>{const l=r(o,n);return JT(t,l)(o,a,c,s)};break;default:i=(o,a)=>{const c=r(o,n);return JT(t,c)(o,a,s)}}const s=Object.assign({},n,{interpret:i});return s.interpret}function O2t(t,e){return(n,...r)=>
527{const i=t(n,...r),s=e.bind(null,i);return s.ast=i,s}}function Jme(t,e){if(!Array.isArray(e))throw new Error(`"${t.name}" expects value to be an array`)}function eye(t,e){if(Jme(t,e),!e.length)throw new Error(`"${t.name}" expects to have at least one element in array`)}const yF=t=>(e,n)=>{if(typeof n!==t)throw new Error(`"${e.name}" expects value to be a "${t}"`)},tye={type:"compound",validate:eye,parse(t,e,{parse:n}){const r=e.map(i=>n(i));return Gme(t.name,r)}},j2t=tye,N2t={type:"compound",validate:eye},D2t={type:"field",validate(t,e){if(!(e&&(e instanceof RegExp||e.constructor===Object)))throw new Error(`"${t.name}" expects to receive either regular expression or object of field operators`)},parse(t,e,n){const r=e instanceof RegExp?new dS("regex",n.field,e):n.parse(e,n);return new uS(t.name,[r])}},nye={type:"field",validate(t,e){if(!e||e.constructor!==Object)throw new Error(`"${t.name}" expects to receive an object with nested query or field level operators`)},parse(t,e,{parse:n,field:r,hasOperators:i}){const s=i(e)?n(e,{field:sx}):n(e);return new dS(t.name,r,s)}},rye={type:"field",validate:yF("number")},hS={type:"field",validate:Jme},iye=hS,sye=hS,L2t={type:"field",validate(t,e){if(!Array.isArray(e)||e.length!==2)throw new Error(`"${t.name}" expects an array with 2 numeric elements`)}},oye={type:"field",validate:yF("boolean")},wF={type:"field",validate:function(t,e){if(!(typeof e=="string"||typeof e=="number"||e instanceof Date))throw new Error(`"${t.name}" expects value to be comparable (i.e., string, number or date)`)}},fS=wF,aye=fS,cye=fS,vF={type:"field"},lye=vF,uye={type:"field",validate(t,e){if(!(e instanceof RegExp)&&typeof e!="string")throw new Error(`"${t.name}" expects value to be a regular expression or a string that represents regular expression`)},parse(t,e,n){const r=typeof e=="string"?new RegExp(e,n.query.$options||""):e;return new dS(t.name,n.field,r)}},dye={type:"field",parse:()=>Kme},B2t={type:"document",validate:yF("function")};var F2t=Object.freeze({__proto__:null,$and:tye,$or:j2t,$nor:N2t,$not:D2t,$elemMatch:nye,$size:rye,$in:hS,$nin:iye,$all:sye,$mod:L2t,$exists:oye,$gte:wF,$gt:fS,$lt:aye,$lte:cye,$eq:vF,$ne:lye,$regex:uye,$options:dye,$where:B2t});class U2t extends P2t{constructor(e){super(e,{defaultOperatorName:"$eq",operatorToConditionName:n=>n.slice(1)})}parse(e,n){return n&&n.field?Qme(this.parseFieldOperators(n.field,e)):super.parse(e)}}const Jj=F2t;function bF(t,e,n){for(let r=0,i=t.length;r<i;r++)if(n(t[r],e)===0)return!0;return!1}function xF(t,e){return Array.isArray(t)&&Number.isNaN(Number(e))}function Xee(t,e,n){if(!xF(t,e))return n(t,e);let r=[];for(let i=0;i<t.length;i++){const s=n(t[i],e);s!==void 0&&(r=r.concat(s))}return r}function rg(t){return(e,n,r)=>{const i=r.get(n,e.field);return Array.isArray(i)?i.some(s=>t(e,s,r)):t(e,i,r)}}const z2t=(t,e)=>t[e];function hye(t,e,n){const r=e.lastIndexOf(".");return r===-1?[t,e]:[n(t,e.slice(0,r)),e.slice(r+1)]}function W2t(t,e,n=z2t){if(e===sx)return t;if(!t)throw new Error(`Unable to get field "${e}" out of ${String(t)}.`);return function(r,i,s){if(i.indexOf(".")===-1)return Xee(r,i,s);const o=i.split(".");let a=r;for(let c=0,l=o.length;c<l;c++)if(a=Xee(a,o[c],s),!a||typeof a!="object")return a;return a}(t,e,n)}function fye(t,e){return t===e?0:t>e?1:-1}function pye(t,e={}){return M2t(t,Object.assign({get:W2t,compare:fye},e))}const gye=(t,e,{interpret:n})=>t.value.some(r=>n(r,e)),H2t=(t,e,n)=>!gye(t,e,n),mye=(t,e,{interpret:n})=>t.value.every(r=>n(r,e)),V2t=(t,e,{interpret:n})=>!n(t.value[0],e),EF=(t,e,{compare:n,get:r})=>{const i=r(e,t.field);return Array.isArray(i)&&!Array.isArray(t.value)?bF(i,t.value,n):n(i,t.value)===0},yye=(t,e,n)=>!EF(t,e,n),wye=rg((t,e,n)=>{const r=n.compare(e,t.value);return r===0||r===-1}),vye=rg((t,e,n)=>n.compare(e,t.value)===-1),bye=rg((t,e,n)=>n.compare(e,t.value)===1),xye=rg((t,e,n)=>{const r=n.compare(e,t.value);return r===0||r===1}),Eye=(t,e,{get:n})=>{if(t.field===sx)return e!==void 0;const[r,i]=hye(e,t.field,n),s=o=>o==null?!!o===t.value:o.hasOwnProperty(i)===t.value;return xF(r,i)?r.some(s):s(r)},q2t=rg((t,e)=>typeof e=="number"&&e%t.value[0]===t.value[1]),Cye=(t,e,{get:n})=>{const[r,i]=hye(e,t.field,n),s=o=>{const a=n(o,i);return Array.isArray(a)&&a.length===t.value};return t.field!==sx&&xF(r,i)?r.some(s):s(r)},_ye=rg((t,e)=>typeof e=="string"&&t.value.test(e)),pS=rg((t,e,{compare:n})=>bF(t.value,e,n)),Sye=(t,e,n)=>!pS(t,e,n),Aye=(t,e,{compare:n,get:r})=>{const i=r(e,t.field);return Array.isArray(i)&&t.value.every(s=>bF(i,s,n))},kye=(t,e,{interpret:n,get:r})=>{const i=r(e,t.field);return Array.isArray(i)&&i.some(s=>n(t.value,s))},K2t=(t,e)=>t.value.call(e);var G2t=Object.freeze({__proto__:null,or:gye,nor:H2t,and:mye,not:V2t,eq:EF,ne:yye,lte:wye,lt:vye,gt:bye,gte:xye,exists:Eye,mod:q2t,size:Cye,regex:_ye,within:pS,nin:Sye,all:Aye,elemMatch:kye,where:K2t});const CF=Object.assign({},G2t,{in:pS});pye(CF);function Jee(t){return t===null||typeof t!="object"?t:t instanceof Date?t.getTime():t&&typeof t.toJSON=="function"?t.toJSON():t}const Z2t=(t,e)=>fye(Jee(t),Jee(e));
527function _F(t,e,n){const r=new U2t(t),i=pye(e,Object.assign({compare:Z2t},n));if(n&&n.forPrimitives){const s={field:sx},o=r.parse;r.setParse(a=>o(a,s))}return O2t(r.parse,i)}_F(Jj,CF);_F(["$and","$or"].reduce((t,e)=>(t[e]=Object.assign({},t[e],{type:"field"}),t),Object.assign({},Jj,{$nor:Object.assign({},Jj.$nor,{type:"field",parse:Xme.compound})})),CF,{forPrimitives:!0});const Y2t=Object.hasOwn||((t,e)=>Object.prototype.hasOwnProperty.call(t,e));function eN(t){return Array.isArray(t)?t:[t]}const ete="__caslSubjectType__",w7=t=>{const e=typeof t;return e==="string"||e==="function"},Q2t=t=>t.modelName||t.name;function $ye(t){return Y2t(t,ete)?t[ete]:Q2t(t.constructor)}const tte={function:t=>t.constructor,string:$ye};function nte(t,e,n){for(let r=n;r<e.length;r++)t.push(e[r])}function rte(t,e){if(!t||!t.length)return e||[];if(!e||!e.length)return t||[];let n=0,r=0;const i=[];for(;n<t.length&&r<e.length;)t[n].priority<e[r].priority?(i.push(t[n]),n++):(i.push(e[r]),r++);return nte(i,t,n),nte(i,e,r),i}function T6(t,e,n){let r=t.get(e);return r||(r=n(),t.set(e,r)),r}const X2t=t=>t;function J2t(t,e){if(Array.isArray(t.fields)&&!t.fields.length)throw new Error("`rawRule.fields` cannot be an empty array. https://bit.ly/390miLa");if(t.fields&&!e.fieldMatcher)throw new Error('You need to pass "fieldMatcher" option in order to restrict access by fields');if(t.conditions&&!e.conditionsMatcher)throw new Error('You need to pass "conditionsMatcher" option in order to restrict access by conditions')}class ewt{constructor(e,n,r=0){J2t(e,n),this.action=n.resolveAction(e.action),this.subject=e.subject,this.inverted=!!e.inverted,this.conditions=e.conditions,this.reason=e.reason,this.origin=e,this.fields=e.fields?eN(e.fields):void 0,this.priority=r,this.t=n}i(){return this.conditions&&!this.o&&(this.o=this.t.conditionsMatcher(this.conditions)),this.o}get ast(){const e=this.i();return e?e.ast:void 0}matchesConditions(e){return this.conditions?!e||w7(e)?!this.inverted:this.i()(e):!0}matchesField(e){return this.fields?e?(this.u||(this.u=this.t.fieldMatcher(this.fields)),this.u(e)):!this.inverted:!0}}function twt(t,e){const n={value:t,prev:e,next:null};return e&&(e.next=n),n}function nwt(t){t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t.next=t.prev=null}const rwt=t=>({value:t.value,prev:t.prev,next:t.next}),ite=()=>({rules:[],merged:!1}),ste=()=>new Map;class iwt{constructor(e=[],n={}){this.h=!1,this.l=new Map,this.p={conditionsMatcher:n.conditionsMatcher,fieldMatcher:n.fieldMatcher,resolveAction:n.resolveAction||X2t},this.$=n.anyAction||"manage",this.A=n.anySubjectType||"all",this.m=e,this.M=!!n.detectSubjectType,this.j=n.detectSubjectType||$ye,this.v(e)}get rules(){return this.m}detectSubjectType(e){return w7(e)?e:e?this.j(e):this.A}update(e){const n={rules:e,ability:this,target:this};return this._("update",n),this.m=e,this.v(e),this._("updated",n),this}v(e){const n=new Map;let r;for(let i=e.length-1;i>=0;i--){const s=e.length-i-1,o=new ewt(e[i],this.p,s),a=eN(o.action),c=eN(o.subject||this.A);!this.h&&o.fields&&(this.h=!0);for(let l=0;l<c.length;l++){const u=T6(n,c[l],ste);r===void 0&&(r=typeof c[l]),typeof c[l]!==r&&r!=="mixed"&&(r="mixed");for(let d=0;d<a.length;d++)T6(u,a[d],ite).rules.push(o)}}if(this.l=n,r!=="mixed"&&!this.M){const i=tte[r]||tte.string;this.j=i}}possibleRulesFor(e,n=this.A){if(!w7(n))throw new Error('"possibleRulesFor" accepts only subject types (i.e., string or class) as the 2nd parameter');const r=T6(this.l,n,ste),i=T6(r,e,ite);if(i.merged)return i.rules;const s=e!==this.$&&r.has(this.$)?r.get(this.$).rules:void 0;let o=rte(i.rules,s);return n!==this.A&&(o=rte(o,this.possibleRulesFor(e,this.A))),i.rules=o,i.merged=!0,o}rulesFor(e,n,r){const i=this.possibleRulesFor(e,n);if(r&&typeof r!="string")throw new Error("The 3rd, `field` parameter is expected to be a string. See https://stalniy.github.io/casl/en/api/casl-ability#can-of-pure-ability for details");return this.h?i.filter(s=>s.matchesField(r)):i}actionsFor(e){if(!w7(e))throw new Error('"actionsFor" accepts only subject types (i.e., string or class) as a parameter');const n=new Set,r=this.l.get(e);
527r&&Array.from(r.keys()).forEach(s=>n.add(s));const i=e!==this.A?this.l.get(this.A):void 0;return i&&Array.from(i.keys()).forEach(s=>n.add(s)),Array.from(n)}on(e,n){this.F=this.F||new Map;const r=this.F,i=r.get(e)||null,s=twt(n,i);return r.set(e,s),()=>{const o=r.get(e);!s.next&&!s.prev&&o===s?r.delete(e):s===o&&r.set(e,s.prev),nwt(s)}}_(e,n){if(!this.F)return;let r=this.F.get(e)||null;for(;r!==null;){const i=r.prev?rwt(r.prev):null;r.value(n),r=i}}}class swt extends iwt{can(e,n,r){const i=this.relevantRuleFor(e,n,r);return!!i&&!i.inverted}relevantRuleFor(e,n,r){const i=this.detectSubjectType(n),s=this.rulesFor(e,i,r);for(let o=0,a=s.length;o<a;o++)if(s[o].matchesConditions(n))return s[o];return null}cannot(e,n,r){return!this.can(e,n,r)}}const owt={$eq:vF,$ne:lye,$lt:aye,$lte:cye,$gt:fS,$gte:wF,$in:hS,$nin:iye,$all:sye,$size:rye,$regex:uye,$options:dye,$elemMatch:nye,$exists:oye},awt={eq:EF,ne:yye,lt:vye,lte:wye,gt:bye,gte:xye,in:pS,nin:Sye,all:Aye,size:Cye,regex:_ye,elemMatch:kye,exists:Eye,and:mye},cwt=_F(owt,awt),lwt=/[-/\\^$+?.()|[\]{}]/g,uwt=/\.?\*+\.?/g,dwt=/\*+/,hwt=/\./g;function fwt(t,e,n){const r=n[0]==="*"||t[0]==="."&&t[t.length-1]==="."?"+":"*",i=t.indexOf("**")===-1?"[^.]":".",s=t.replace(hwt,"\\$&").replace(dwt,i+r);return e+t.length===n.length?`(?:${s})?`:s}function pwt(t,e,n){return t==="."&&(n[e-1]==="*"||n[e+1]==="*")?t:`\\${t}`}function gwt(t){const e=t.map(r=>r.replace(lwt,pwt).replace(uwt,fwt)),n=e.length>1?`(?:${e.join("|")})`:e[0];return new RegExp(`^${n}$`)}const mwt=t=>{let e;return n=>(typeof e>"u"&&(e=t.every(r=>r.indexOf("*")===-1)?null:gwt(t)),e===null?t.indexOf(n)!==-1:e.test(n))};function ywt(t=[],e={}){return new swt(t,Object.assign({conditionsMatcher:cwt,fieldMatcher:mwt},e))}function wwt(t){return t.prototype!==void 0&&typeof t.prototype.possibleRulesFor=="function"}class vwt{constructor(e){this.O=e}because(e){return this.O.reason=e,this}}class bwt{constructor(e){this.rules=[],this.C=e,this.can=(n,r,i,s)=>this.R(n,r,i,s,!1),this.cannot=(n,r,i,s)=>this.R(n,r,i,s,!0),this.build=n=>wwt(this.C)?new this.C(this.rules,n):this.C(this.rules,n)}R(e,n,r,i,s){const o={action:e};return s&&(o.inverted=s),n&&(o.subject=n,Array.isArray(r)||typeof r=="string"?o.fields=r:typeof r<"u"&&(o.conditions=r),typeof i<"u"&&(o.conditions=i)),this.rules.push(o),new vwt(o)}}function FRt({pathname:t}){return t==="/"||t==="/c"||t.startsWith("/c/")||t.startsWith("/chat")||t.startsWith("/bubbleup")||t.startsWith("/schedule")||t.startsWith("/agent")||t==="/pilot"||t.startsWith("/pilot/")?{subject:"chat"}:t.startsWith("/pricing")||t.startsWith("/mall")?{subject:"pricing"}:t.startsWith("/checkout")?{subject:"checkout"}:t.startsWith("/account")?{subject:"account"}:t.startsWith("/invite")?{subject:"invite"}:t.startsWith("/devices")?{subject:"devices"}:t.startsWith("/code-projects")?{subject:"codeMode"}:{subject:"public"}}function xwt({activationCode:t,isNeedsInviteCode:e,hasAvailableCredit:n,hasServiceProvider:r,isActivityPendingStatusLoading:i,isActivityPendingUser:s,isAppleGreenMode:o,showHerbalife:a,session:c,purchasePermission:l}){const{can:u,build:d}=new bwt(ywt),h=!t&&!i&&!s&&n===0&&l!==void 0&&l!==3,f=n>0;return!c||e&&!h&&!f?(u("view","invite"),{ability:d()}):(u("update","profile"),(t||l===3||h||f)&&(u("view","chat"),u("view","history")),u("view","codeMode"),u("use","codeMode"),r&&u("use","assistance"),u("view","pricing"),u("view","mall"),u("view","checkout"),u("view","account"),u("view","devices"),{ability:d()})}var eP={},Iv={},ote;function Ewt(){if(ote)return Iv;ote=1,Iv.byteLength=a,Iv.toByteArray=l,Iv.fromByteArray=h;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)t[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(f){var m=f.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=f.indexOf("=");y===-1&&(y=m);var v=y===m?0:4-y%4;return[y,v]}function a(f){var m=o(f),y=m[0],v=m[1];return(y+v)*3/4-v}function c(f,m,y){return(m+y)*3/4-y}function l(f){var m,y=o(f),v=y[0],b=y[1],C=new n(c(f,v,b)),x=0,_=b>0?v-4:v,$;for($=0;$<_;$+=4)m=e[f.charCodeAt($)]<<18|e[f.charCodeAt($+1)]<<12|e[f.charCodeAt($+2)]<<6|e[f.charCodeAt($+3)],C[x++]=m>>16&255,C[x++]=m>>8&255,C[x++]=m&255;return b===2&&(m=e[f.charCodeAt($)]<<2|e[f.charCodeAt($+1)]>>4,C[x++]=m&255),b===1&&(m=e[f.charCodeAt($)]<<10|e[f.charCodeAt($+1)]<<4|e[f.charCodeAt($+2)]>>2,C[x++]=m>>8&255,C[x++]=m&255),C}function u(f){return t[f>>18&63]+t[f>>12&63]+t[f>>6&63]+t[f&63]}function d(f,m,y){for(var v,b=[],C=m;C<y;
vendor: 23,940 bytes, lines 527-532
527C+=3)v=(f[C]<<16&16711680)+(f[C+1]<<8&65280)+(f[C+2]&255),b.push(u(v));return b.join("")}function h(f){for(var m,y=f.length,v=y%3,b=[],C=16383,x=0,_=y-v;x<_;x+=C)b.push(d(f,x,x+C>_?_:x+C));return v===1?(m=f[y-1],b.push(t[m>>2]+t[m<<4&63]+"==")):v===2&&(m=(f[y-2]<<8)+f[y-1],b.push(t[m>>10]+t[m>>4&63]+t[m<<2&63]+"=")),b.join("")}return Iv}var P6={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var ate;function Cwt(){return ate||(ate=1,P6.read=function(t,e,n,r,i){var s,o,a=i*8-r-1,c=(1<<a)-1,l=c>>1,u=-7,d=n?i-1:0,h=n?-1:1,f=t[e+d];for(d+=h,s=f&(1<<-u)-1,f>>=-u,u+=a;u>0;s=s*256+t[e+d],d+=h,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=r;u>0;o=o*256+t[e+d],d+=h,u-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(f?-1:1)*o*Math.pow(2,s-r)},P6.write=function(t,e,n,r,i,s){var o,a,c,l=s*8-i-1,u=(1<<l)-1,d=u>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,m=r?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=h/c:e+=h*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(e*c-1)*Math.pow(2,i),o=o+d):(a=e*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;t[n+f]=a&255,f+=m,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[n+f]=o&255,f+=m,o/=256,l-=8);t[n+f-m]|=y*128}),P6}/*! 528 * The buffer module from node.js, for the browser. 529 * 530 * @author Feross Aboukhadijeh <https://feross.org> 531 * @license MIT 532 */var cte;function SF(){return cte||(cte=1,function(t){const e=Ewt(),n=Cwt(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=C,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.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 s(){try{const J=new Uint8Array(1),q={foo:function(){return 42}};return Object.setPrototypeOf(q,Uint8Array.prototype),Object.setPrototypeOf(J,q),J.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(J){if(J>i)throw new RangeError('The value "'+J+'" is invalid for option "size"');const q=new Uint8Array(J);return Object.setPrototypeOf(q,a.prototype),q}function a(J,q,Z){if(typeof J=="number"){if(typeof q=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(J)}return c(J,q,Z)}a.poolSize=8192;function c(J,q,Z){if(typeof J=="string")return h(J,q);if(ArrayBuffer.isView(J))return m(J);if(J==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof J);if(Ue(J,ArrayBuffer)||J&&Ue(J.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ue(J,SharedArrayBuffer)||J&&Ue(J.buffer,SharedArrayBuffer)))return y(J,q,Z);if(typeof J=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const se=J.valueOf&&J.valueOf();if(se!=null&&se!==J)return a.from(se,q,Z);const he=v(J);if(he)return he;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof J[Symbol.toPrimitive]=="function")return a.from(J[Symbol.toPrimitive]("string"),q,Z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof J)}a.from=function(J,q,Z){return c(J,q,Z)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(J){if(typeof J!="number")throw new TypeError('"size" argument must be of type number');if(J<0)throw new RangeError('The value "'+J+'" is invalid for option "size"')}function u(J,q,Z){return l(J),J<=0?o(J):q!==void 0?typeof Z=="string"?o(J).fill(q,Z):o(J).fill(q):o(J)}a.alloc=function(J,q,Z){return u(J,q,Z)};function d(J){return l(J),o(J<0?0:b(J)|0)}a.allocUnsafe=function(J){return d(J)},a.allocUnsafeSlow=function(J){return d(J)};function h(J,q){if((typeof q!="string"||q==="")&&(q="utf8"),!a.isEncoding(q))throw new TypeError("Unknown encoding: "+q);const Z=x(J,q)|0;let se=o(Z);const he=se.write(J,q);return he!==Z&&(se=se.slice(0,he)),se}function f(J){const q=J.length<0?0:b(J.length)|0,Z=o(q);for(let se=0;se<q;se+=1)Z[se]=J[se]&255;return Z}function m(J){if(Ue(J,Uint8Array)){const q=new Uint8Array(J);return y(q.buffer,q.byteOffset,q.byteLength)}return f(J)}function y(J,q,Z){if(q<0||J.byteLength<q)throw new RangeError('"offset" is outside of buffer bounds');if(J.byteLength<q+(Z||0))throw new RangeError('"length" is outside of buffer bounds');let se;return q===void 0&&Z===void 0?se=new Uint8Array(J):Z===void 0?se=new Uint8Array(J,q):se=new Uint8Array(J,q,Z),Object.setPrototypeOf(se,a.prototype),se}function v(J){if(a.isBuffer(J)){const q=b(J.length)|0,Z=o(q);return Z.length===0||J.copy(Z,0,0,q),Z}if(J.length!==void 0)return typeof J.length!="number"||Ye(J.length)?o(0):f(J);if(J.type==="Buffer"&&Array.isArray(J.data))return f(J.data)}function b(J){if(J>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return J|0}function C(J){return+J!=J&&(J=0),a.alloc(+J)}a.isBuffer=function(q){return q!=null&&q._isBuffer===!0&&q!==a.prototype},a.compare=function(q,Z){if(Ue(q,Uint8Array)&&(q=a.from(q,q.offset,q.byteLength)),Ue(Z,Uint8Array)&&(Z=a.from(Z,Z.offset,Z.byteLength)),!a.isBuffer(q)||!a.isBuffer(Z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(q===Z)return 0;let se=q.length,he=Z.length;for(let fe=0,ye=Math.min(se,he);fe<ye;++fe)if(q[fe]!==Z[fe]){se=q[fe],he=Z[fe];break}return se<he?-1:he<se?1:0},a.isEncoding=function(q){switch(String(q).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}},a.concat=function(q,Z){if(!Array.isArray(q))throw new TypeError('"list" argument must be an Array of Buffers');if(q.length===0)return a.alloc(0);let se;if(Z===void 0)for(Z=0,se=0;se<q.length;++se)Z+=q[se].length;const he=a.allocUnsafe(Z);let fe=0;for(se=0;se<q.length;++se){let ye=q[se];if(Ue(ye,Uint8Array))fe+ye.length>he.length?(a.isBuffer(ye)||(ye=a.from(ye)),ye.copy(he,fe)):Uint8Array.prototype.set.call(he,ye,fe);else if(a.isBuffer(ye))ye.copy(he,fe);else throw new TypeError('"list" argument must be an Array of Buffers');fe+=ye.length}return he};function x(J,q){if(a.isBuffer(J))return J.length;if(ArrayBuffer.isView(J)||Ue(J,ArrayBuffer))return J.byteLength;if(typeof J!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof J);const Z=J.length,se=arguments.length>2&&arguments[2]===!0;if(!se&&Z===0)return 0;let he=!1;for(;;)switch(q){case"ascii":case"latin1":case"binary":return Z;case"utf8":case"utf-8":return ft(J).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z*2;case"hex":return Z>>>1;case"base64":return Lt(J).length;default:if(he)return se?-1:ft(J).length;q=(""+q).toLowerCase(),he=!0}}a.byteLength=x;function _(J,q,Z){let se=!1;if((q===void 0||q<0)&&(q=0),q>this.length||((Z===void 0||Z>this.length)&&(Z=this.length),Z<=0)||(Z>>>=0,q>>>=0,Z<=q))return"";for(J||(J="utf8");;)switch(J){case"hex":return D(this,q,Z);case"utf8":case"utf-8":return S(this,q,Z);case"ascii":return W(this,q,Z);case"latin1":case"binary":return H(this,q,Z);case"base64":return L(this,q,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,q,Z);default:if(se)throw new TypeError("Unknown encoding: "+J);J=(J+"").toLowerCase(),se=!0}}a.prototype._isBuffer=!0;function $(J,q,Z){const se=J[q];J[q]=J[Z],J[Z]=se}a.prototype.swap16=function(){const q=this.length;if(q%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Z=0;Z<q;Z+=2)$(this,Z,Z+1);return this},a.prototype.swap32=function(){const q=this.length;if(q%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Z=0;Z<q;Z+=4)$(this,Z,Z+3),$(this,Z+1,Z+2);return this},a.prototype.swap64=function(){const q=this.length;if(q%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Z=0;Z<q;Z+=8)$(this,Z,Z+7),$(this,Z+1,Z+6),$(this,Z+2,Z+5),$(this,Z+3,Z+4);return this},a.prototype.toString=function(){const q=this.length;return q===0?"":arguments.length===0?S(this,0,q):_.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(q){if(!a.isBuffer(q))throw new TypeError("Argument must be a Buffer");return this===q?!0:a.compare(this,q)===0},a.prototype.inspect=function(){let q="";const Z=t.INSPECT_MAX_BYTES;return q=this.toString("hex",0,Z).replace(/(.{2})/g,"$1 ").trim(),this.length>Z&&(q+=" ... "),"<Buffer "+q+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(q,Z,se,he,fe){if(Ue(q,Uint8Array)&&(q=a.from(q,q.offset,q.byteLength)),!a.isBuffer(q))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof q);if(Z===void 0&&(Z=0),se===void 0&&(se=q?q.length:0),he===void 0&&(he=0),fe===void 0&&(fe=this.length),Z<0||se>q.length||he<0||fe>this.length)throw new RangeError("out of range index");if(he>=fe&&Z>=se)return 0;if(he>=fe)return-1;if(Z>=se)return 1;if(Z>>>=0,se>>>=0,he>>>=0,fe>>>=0,this===q)return 0;let ye=fe-he,nt=se-Z;const vt=Math.min(ye,nt),Nt=this.slice(he,fe),mn=q.slice(Z,se);for(let At=0;At<vt;++At)if(Nt[At]!==mn[At]){ye=Nt[At],nt=mn[At];break}return ye<nt?-1:nt<ye?1:0};function I(J,q,Z,se,he){if(J.length===0)return-1;if(typeof Z=="string"?(se=Z,Z=0):Z>2147483647?Z=2147483647:Z<-2147483648&&(Z=-2147483648),Z=+Z,Ye(Z)&&(Z=he?0:J.length-1),Z<0&&(Z=J.length+Z),Z>=J.length){if(he)return-1;Z=J.length-1}else if(Z<0)if(he)Z=0;else return-1;if(typeof q=="string"&&(q=a.from(q,se)),a.isBuffer(q))return q.length===0?-1:R(J,q,Z,se,he);if(typeof q=="number")return q=q&255,typeof Uint8Array.prototype.indexOf=="function"?he?Uint8Array.prototype.indexOf.call(J,q,Z):Uint8Array.prototype.lastIndexOf.call(J,q,Z):R(J,[q],Z,se,he);throw new TypeError("val must be string, number or Buffer")}function R(J,q,Z,se,he){let fe=1,ye=J.length,nt=q.length;if(se!==void 0&&(se=String(se).toLowerCase(),se==="ucs2"||se==="ucs-2"||se==="utf16le"||se==="utf-16le")){if(J.length<2||q.length<2)return-1;fe=2,ye/=2,nt/=2,Z/=2}function vt(mn,At){return fe===1?mn[At]:mn.readUInt16BE(At*fe)}let Nt;if(he){let mn=-1;for(Nt=Z;Nt<ye;Nt++)if(vt(J,Nt)===vt(q,mn===-1?0:Nt-mn)){if(mn===-1&&(mn=Nt),Nt-mn+1===nt)return mn*fe}else mn!==-1&&(Nt-=Nt-mn),mn=-1}else for(Z+nt>ye&&(Z=ye-nt),Nt=Z;Nt>=0;Nt--){let mn=!0;for(let At=0;At<nt;At++)if(vt(J,Nt+At)!==vt(q,At)){mn=!1;break}if(mn)return Nt}return-1}a.prototype.includes=function(q,Z,se){return this.indexOf(q,Z,se)!==-1},a.prototype.indexOf=function(q,Z,se){return I(this,q,Z,se,!0)},a.prototype.lastIndexOf=function(q,Z,se){return I(this,q,Z,se,!1)};function N(J,q,Z,se){Z=Number(Z)||0;const he=J.length-Z;se?(se=Number(se),se>he&&(se=he)):se=he;const fe=q.length;se>fe/2&&(se=fe/2);let ye;for(ye=0;ye<se;++ye){const nt=parseInt(q.substr(ye*2,2),16);if(Ye(nt))return ye;J[Z+ye]=nt}return ye}function T(J,q,Z,se){return Qe(ft(q,J.length-Z),J,Z,se)}function O(J,q,Z,se){return Qe(it(q),J,Z,se)}function U(J,q,Z,se){return Qe(Lt(q),J,Z,se)}function z(J,q,Z,se){return Qe(be(q,J.length-Z),J,Z,se)}a.prototype.write=function(q,Z,se,he){if(Z===void 0)he="utf8",se=this.length,Z=0;else if(se===void 0&&typeof Z=="string")he=Z,se=this.length,Z=0;else if(isFinite(Z))Z=Z>>>0,isFinite(se)?(se=se>>>0,he===void 0&&(he="utf8")):(he=se,se=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const fe=this.length-Z;if((se===void 0||se>fe)&&(se=fe),q.length>0&&(se<0||Z<0)||Z>this.length)throw new RangeError("Attempt to write outside buffer bounds");he||(he="utf8");let ye=!1;for(;;)switch(he){case"hex":return N(this,q,Z,se);case"utf8":case"utf-8":return T(this,q,Z,se);case"ascii":case"latin1":case"binary":return O(this,q,Z,se);case"base64":return U(this,q,Z,se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,q,Z,se);default:if(ye)throw new TypeError("Unknown encoding: "+he);he=(""+he).toLowerCase(),ye=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(J,q,Z){return q===0&&Z===J.length?e.fromByteArray(J):e.fromByteArray(J.slice(q,Z))}function S(J,q,Z){Z=Math.min(J.length,Z);const se=[];let he=q;for(;he<Z;){const fe=J[he];let ye=null,nt=fe>239?4:fe>223?3:fe>191?2:1;if(he+nt<=Z){let vt,Nt,mn,At;switch(nt){case 1:fe<128&&(ye=fe);break;case 2:vt=J[he+1],(vt&192)===128&&(At=(fe&31)<<6|vt&63,At>127&&(ye=At));break;case 3:vt=J[he+1],Nt=J[he+2],(vt&192)===128&&(Nt&192)===128&&(At=(fe&15)<<12|(vt&63)<<6|Nt&63,At>2047&&(At<55296||At>57343)&&(ye=At));break;case 4:vt=J[he+1],Nt=J[he+2],mn=J[he+3],(vt&192)===128&&(Nt&192)===128&&(mn&192)===128&&(At=(fe&15)<<18|(vt&63)<<12|(Nt&63)<<6|mn&63,At>65535&&At<1114112&&(ye=At))}}ye===null?(ye=65533,nt=1):ye>65535&&(ye-=65536,se.push(ye>>>10&1023|55296),ye=56320|ye&1023),se.push(ye),he+=nt}return M(se)}const k=4096;function M(J){const q=J.length;if(q<=k)return String.fromCharCode.apply(String,J);let Z="",se=0;for(;se<q;)Z+=String.fromCharCode.apply(String,J.slice(se,se+=k));return Z}function W(J,q,Z){let se="";Z=Math.min(J.length,Z);for(let he=q;he<Z;++he)se+=String.fromCharCode(J[he]&127);return se}function H(J,q,Z){let se="";Z=Math.min(J.length,Z);for(let he=q;he<Z;++he)se+=String.fromCharCode(J[he]);return se}function D(J,q,Z){const se=J.length;(!q||q<0)&&(q=0),(!Z||Z<0||Z>se)&&(Z=se);let he="";for(let fe=q;fe<Z;++fe)he+=tt[J[fe]];return he}function V(J,q,Z){const se=J.slice(q,Z);let he="";for(let fe=0;fe<se.length-1;fe+=2)he+=String.fromCharCode(se[fe]+se[fe+1]*256);return he}a.prototype.slice=function(q,Z){const se=this.length;q=~~q,Z=Z===void 0?se:~~Z,q<0?(q+=se,q<0&&(q=0)):q>se&&(q=se),Z<0?(Z+=se,Z<0&&(Z=0)):Z>se&&(Z=se),Z<q&&(Z=q);const he=this.subarray(q,Z);return Object.setPrototypeOf(he,a.prototype),he};function B(J,q,Z){if(J%1!==0||J<0)throw new RangeError("offset is not uint");if(J+q>Z)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(q,Z,se){q=q>>>0,Z=Z>>>0,se||B(q,Z,this.length);let he=this[q],fe=1,ye=0;for(;++ye<Z&&(fe*=256);)he+=this[q+ye]*fe;return he},a.prototype.readUintBE=a.prototype.readUIntBE=function(q,Z,se){q=q>>>0,Z=Z>>>0,se||B(q,Z,this.length);let he=this[q+--Z],fe=1;for(;Z>0&&(fe*=256);)he+=this[q+--Z]*fe;return he},a.prototype.readUint8=a.prototype.readUInt8=function(q,Z){return q=q>>>0,Z||B(q,1,this.length),this[q]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(q,Z){return q=q>>>0,Z||B(q,2,this.length),this[q]|this[q+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(q,Z){return q=q>>>0,Z||B(q,2,this.length),this[q]<<8|this[q+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(q,Z){return q=q>>>0,Z||B(q,4,this.length),(this[q]|this[q+1]<<8|this[q+2]<<16)+this[q+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(q,Z){return q=q>>>0,Z||B(q,4,this.length),this[q]*16777216+(this[q+1]<<16|this[q+2]<<8|this[q+3])},a.prototype.readBigUInt64LE=ze(function(q){q=q>>>0,He(q,"offset");const Z=this[q],se=this[q+7];(Z===void 0||se===void 0)&&Ge(q,this.length-8);const he=Z+this[++q]*2**8+this[++q]*2**16+this[++q]*2**24,fe=this[++q]+this[++q]*2**8+this[++q]*2**16+se*2**24;return BigInt(he)+(BigInt(fe)<<BigInt(32))}),a.prototype.readBigUInt64BE=ze(function(q){q=q>>>0,He(q,"offset");const Z=this[q],se=this[q+7];(Z===void 0||se===void 0)&&Ge(q,this.length-8);const he=Z*2**24+this[++q]*2**16+this[++q]*2**8+this[++q],fe=this[++q]*2**24+this[++q]*2**16+this[++q]*2**8+se;return(BigInt(he)<<BigInt(32))+BigInt(fe)}),a.prototype.readIntLE=function(q,Z,se){q=q>>>0,Z=Z>>>0,se||B(q,Z,this.length);let he=this[q],fe=1,ye=0;for(;++ye<Z&&(fe*=256);)he+=this[q+ye]*fe;return fe*=128,he>=fe&&(he-=Math.pow(2,8*Z)),he},a.prototype.readIntBE=function(q,Z,se){q=q>>>0,Z=Z>>>0,se||B(q,Z,this.length);let he=Z,fe=1,ye=this[q+--he];for(;he>0&&(fe*=256);)ye+=this[q+--he]*fe;return fe*=128,ye>=fe&&(ye-=Math.pow(2,8*Z)),ye},a.prototype.readInt8=function(q,Z){return q=q>>>0,Z||B(q,1,this.length),this[q]&128?(255-this[q]+1)*-1:this[q]},a.prototype.readInt16LE=function(q,Z){q=q>>>0,Z||B(q,2,this.length);const se=this[q]|this[q+1]<<8;return se&32768?se|4294901760:se},a.prototype.readInt16BE=function(q,Z){q=q>>>0,Z||B(q,2,this.length);const se=this[q+1]|this[q]<<8;return se&32768?se|4294901760:se},a.prototype.readInt32LE=function(q,Z){return q=q>>>0,Z||B(q,4,this.length),this[q]|this[q+1]<<8|this[q+2]<<16|this[q+3]<<24},a.prototype.readInt32BE=function(q,Z){return q=q>>>0,Z||B(q,4,this.length),this[q]<<24|this[q+1]<<16|this[q+2]<<8|this[q+3]},a.prototype.readBigInt64LE=ze(function(q){q=q>>>0,He(q,"offset");const Z=this[q],se=this[q+7];(Z===void 0||se===void 0)&&Ge(q,this.length-8);const he=this[q+4]+this[q+5]*2**8+this[q+6]*2**16+(se<<24);return(BigInt(he)<<BigInt(32))+BigInt(Z+this[++q]*2**8+this[++q]*2**16+this[++q]*2**24)}),a.prototype.readBigInt64BE=ze(function(q){q=q>>>0,He(q,"offset");const Z=this[q],se=this[q+7];(Z===void 0||se===void 0)&&Ge(q,this.length-8);const he=(Z<<24)+this[++q]*2**16+this[++q]*2**8+this[++q];return(BigInt(he)<<BigInt(32))+BigInt(this[++q]*2**24+this[++q]*2**16+this[++q]*2**8+se)}),a.prototype.readFloatLE=function(q,Z){return q=q>>>0,Z||B(q,4,this.length),n.read(this,q,!0,23,4)},a.prototype.readFloatBE=function(q,Z){return q=q>>>0,Z||B(q,4,this.length),n.read(this,q,!1,23,4)},a.prototype.readDoubleLE=function(q,Z){return q=q>>>0,Z||B(q,8,this.length),n.read(this,q,!0,52,8)},a.prototype.readDoubleBE=function(q,Z){return q=q>>>0,Z||B(q,8,this.length),n.read(this,q,!1,52,8)};function P(J,q,Z,se,he,fe){if(!a.isBuffer(J))throw new TypeError('"buffer" argument must be a Buffer instance');if(q>he||q<fe)throw new RangeError('"value" argument is out of bounds');if(Z+se>J.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(q,Z,se,he){if(q=+q,Z=Z>>>0,se=se>>>0,!he){const nt=Math.pow(2,8*se)-1;P(this,q,Z,se,nt,0)}let fe=1,ye=0;for(this[Z]=q&255;++ye<se&&(fe*=256);)this[Z+ye]=q/fe&255;return Z+se},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(q,Z,se,he){if(q=+q,Z=Z>>>0,se=se>>>0,!he){const nt=Math.pow(2,8*se)-1;P(this,q,Z,se,nt,0)}let fe=se-1,ye=1;for(this[Z+fe]=q&255;--fe>=0&&(ye*=256);)this[Z+fe]=q/ye&255;return Z+se},a.prototype.writeUint8=a.prototype.writeUInt8=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,1,255,0),this[Z]=q&255,Z+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,2,65535,0),this[Z]=q&255,this[Z+1]=q>>>8,Z+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,2,65535,0),this[Z]=q>>>8,this[Z+1]=q&255,Z+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,4,4294967295,0),this[Z+3]=q>>>24,this[Z+2]=q>>>16,this[Z+1]=q>>>8,this[Z]=q&255,Z+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,4,4294967295,0),this[Z]=q>>>24,this[Z+1]=q>>>16,this[Z+2]=q>>>8,this[Z+3]=q&255,Z+4};function j(J,q,Z,se,he){$e(q,se,he,J,Z,7);let fe=Number(q&BigInt(4294967295));J[Z++]=fe,fe=fe>>8,J[Z++]=fe,fe=fe>>8,J[Z++]=fe,fe=fe>>8,J[Z++]=fe;let ye=Number(q>>BigInt(32)&BigInt(4294967295));return J[Z++]=ye,ye=ye>>8,J[Z++]=ye,ye=ye>>8,J[Z++]=ye,ye=ye>>8,J[Z++]=ye,Z}function G(J,q,Z,se,he){$e(q,se,he,J,Z,7);let fe=Number(q&BigInt(4294967295));J[Z+7]=fe,fe=fe>>8,J[Z+6]=fe,fe=fe>>8,J[Z+5]=fe,fe=fe>>8,J[Z+4]=fe;let ye=Number(q>>BigInt(32)&BigInt(4294967295));return J[Z+3]=ye,ye=ye>>8,J[Z+2]=ye,ye=ye>>8,J[Z+1]=ye,ye=ye>>8,J[Z]=ye,Z+8}a.prototype.writeBigUInt64LE=ze(function(q,Z=0){return j(this,q,Z,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ze(function(q,Z=0){return G(this,q,Z,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(q,Z,se,he){if(q=+q,Z=Z>>>0,!he){const vt=Math.pow(2,8*se-1);P(this,q,Z,se,vt-1,-vt)}let fe=0,ye=1,nt=0;for(this[Z]=q&255;++fe<se&&(ye*=256);)q<0&&nt===0&&this[Z+fe-1]!==0&&(nt=1),this[Z+fe]=(q/ye>>0)-nt&255;return Z+se},a.prototype.writeIntBE=function(q,Z,se,he){if(q=+q,Z=Z>>>0,!he){const vt=Math.pow(2,8*se-1);P(this,q,Z,se,vt-1,-vt)}let fe=se-1,ye=1,nt=0;for(this[Z+fe]=q&255;--fe>=0&&(ye*=256);)q<0&&nt===0&&this[Z+fe+1]!==0&&(nt=1),this[Z+fe]=(q/ye>>0)-nt&255;return Z+se},a.prototype.writeInt8=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,1,127,-128),q<0&&(q=255+q+1),this[Z]=q&255,Z+1},a.prototype.writeInt16LE=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,2,32767,-32768),this[Z]=q&255,this[Z+1]=q>>>8,Z+2},a.prototype.writeInt16BE=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,2,32767,-32768),this[Z]=q>>>8,this[Z+1]=q&255,Z+2},a.prototype.writeInt32LE=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,4,2147483647,-2147483648),this[Z]=q&255,this[Z+1]=q>>>8,this[Z+2]=q>>>16,this[Z+3]=q>>>24,Z+4},a.prototype.writeInt32BE=function(q,Z,se){return q=+q,Z=Z>>>0,se||P(this,q,Z,4,2147483647,-2147483648),q<0&&(q=4294967295+q+1),this[Z]=q>>>24,this[Z+1]=q>>>16,this[Z+2]=q>>>8,this[Z+3]=q&255,Z+4},a.prototype.writeBigInt64LE=ze(function(q,Z=0){return j(this,q,Z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ze(function(q,Z=0){return G(this,q,Z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Y(J,q,Z,se,he,fe){if(Z+se>J.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("Index out of range")}function te(J,q,Z,se,he){return q=+q,Z=Z>>>0,he||Y(J,q,Z,4),n.write(J,q,Z,se,23,4),Z+4}a.prototype.writeFloatLE=function(q,Z,se){return te(this,q,Z,!0,se)},a.prototype.writeFloatBE=function(q,Z,se){return te(this,q,Z,!1,se)};function ae(J,q,Z,se,he){return q=+q,Z=Z>>>0,he||Y(J,q,Z,8),n.write(J,q,Z,se,52,8),Z+8}a.prototype.writeDoubleLE=function(q,Z,se){return ae(this,q,Z,!0,se)},a.prototype.writeDoubleBE=function(q,Z,se){return ae(this,q,Z,!1,se)},a.prototype.copy=function(q,Z,se,he){if(!a.isBuffer(q))throw new TypeError("argument should be a Buffer");if(se||(se=0),!he&&he!==0&&(he=this.length),Z>=q.length&&(Z=q.length),Z||(Z=0),he>0&&he<se&&(he=se),he===se||q.length===0||this.length===0)return 0;if(Z<0)throw new RangeError("targetStart out of bounds");if(se<0||se>=this.length)throw new RangeError("Index out of range");if(he<0)throw new RangeError("sourceEnd out of bounds");he>this.length&&(he=this.length),q.length-Z<he-se&&(he=q.length-Z+se);const fe=he-se;return this===q&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Z,se,he):Uint8Array.prototype.set.call(q,this.subarray(se,he),Z),fe},a.prototype.fill=function(q,Z,se,he){if(typeof q=="string"){if(typeof Z=="string"?(he=Z,Z=0,se=this.length):typeof se=="string"&&(he=se,se=this.length),he!==void 0&&typeof he!="string")throw new TypeError("encoding must be a string");if(typeof he=="string"&&!a.isEncoding(he))throw new TypeError("Unknown encoding: "+he);if(q.length===1){const ye=q.charCodeAt(0);(he==="utf8"&&ye<128||he==="latin1")&&(q=ye)}}else typeof q=="number"?q=q&255:typeof q=="boolean"&&(q=Number(q));if(Z<0||this.length<Z||this.length<se)throw new RangeError("Out of range index");if(se<=Z)return this;Z=Z>>>0,se=se===void 0?this.length:se>>>0,q||(q=0);let fe;if(typeof q=="number")for(fe=Z;fe<se;++fe)this[fe]=q;else{const ye=a.isBuffer(q)?q:a.from(q,he),nt=ye.length;
vendor: 4,770 bytes, line 532
532if(nt===0)throw new TypeError('The value "'+q+'" is invalid for argument "value"');for(fe=0;fe<se-Z;++fe)this[fe+Z]=ye[fe%nt]}return this};const oe={};function de(J,q,Z){oe[J]=class extends Z{constructor(){super(),Object.defineProperty(this,"message",{value:q.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${J}]`,this.stack,delete this.name}get code(){return J}set code(he){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:he,writable:!0})}toString(){return`${this.name} [${J}]: ${this.message}`}}}de("ERR_BUFFER_OUT_OF_BOUNDS",function(J){return J?`${J} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),de("ERR_INVALID_ARG_TYPE",function(J,q){return`The "${J}" argument must be of type number. Received type ${typeof q}`},TypeError),de("ERR_OUT_OF_RANGE",function(J,q,Z){let se=`The value of "${J}" is out of range.`,he=Z;return Number.isInteger(Z)&&Math.abs(Z)>2**32?he=ke(String(Z)):typeof Z=="bigint"&&(he=String(Z),(Z>BigInt(2)**BigInt(32)||Z<-(BigInt(2)**BigInt(32)))&&(he=ke(he)),he+="n"),se+=` It must be ${q}. Received ${he}`,se},RangeError);function ke(J){let q="",Z=J.length;const se=J[0]==="-"?1:0;for(;Z>=se+4;Z-=3)q=`_${J.slice(Z-3,Z)}${q}`;return`${J.slice(0,Z)}${q}`}function Be(J,q,Z){He(q,"offset"),(J[q]===void 0||J[q+Z]===void 0)&&Ge(q,J.length-(Z+1))}function $e(J,q,Z,se,he,fe){if(J>Z||J<q){const ye=typeof q=="bigint"?"n":"";let nt;throw q===0||q===BigInt(0)?nt=`>= 0${ye} and < 2${ye} ** ${(fe+1)*8}${ye}`:nt=`>= -(2${ye} ** ${(fe+1)*8-1}${ye}) and < 2 ** ${(fe+1)*8-1}${ye}`,new oe.ERR_OUT_OF_RANGE("value",nt,J)}Be(se,he,fe)}function He(J,q){if(typeof J!="number")throw new oe.ERR_INVALID_ARG_TYPE(q,"number",J)}function Ge(J,q,Z){throw Math.floor(J)!==J?(He(J,Z),new oe.ERR_OUT_OF_RANGE("offset","an integer",J)):q<0?new oe.ERR_BUFFER_OUT_OF_BOUNDS:new oe.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${q}`,J)}const je=/[^+/0-9A-Za-z-_]/g;function xt(J){if(J=J.split("=")[0],J=J.trim().replace(je,""),J.length<2)return"";for(;J.length%4!==0;)J=J+"=";return J}function ft(J,q){q=q||1/0;let Z;const se=J.length;let he=null;const fe=[];for(let ye=0;ye<se;++ye){if(Z=J.charCodeAt(ye),Z>55295&&Z<57344){if(!he){if(Z>56319){(q-=3)>-1&&fe.push(239,191,189);continue}else if(ye+1===se){(q-=3)>-1&&fe.push(239,191,189);continue}he=Z;continue}if(Z<56320){(q-=3)>-1&&fe.push(239,191,189),he=Z;continue}Z=(he-55296<<10|Z-56320)+65536}else he&&(q-=3)>-1&&fe.push(239,191,189);if(he=null,Z<128){if((q-=1)<0)break;fe.push(Z)}else if(Z<2048){if((q-=2)<0)break;fe.push(Z>>6|192,Z&63|128)}else if(Z<65536){if((q-=3)<0)break;fe.push(Z>>12|224,Z>>6&63|128,Z&63|128)}else if(Z<1114112){if((q-=4)<0)break;fe.push(Z>>18|240,Z>>12&63|128,Z>>6&63|128,Z&63|128)}else throw new Error("Invalid code point")}return fe}function it(J){const q=[];for(let Z=0;Z<J.length;++Z)q.push(J.charCodeAt(Z)&255);return q}function be(J,q){let Z,se,he;const fe=[];for(let ye=0;ye<J.length&&!((q-=2)<0);++ye)Z=J.charCodeAt(ye),se=Z>>8,he=Z%256,fe.push(he),fe.push(se);return fe}function Lt(J){return e.toByteArray(xt(J))}function Qe(J,q,Z,se){let he;for(he=0;he<se&&!(he+Z>=q.length||he>=J.length);++he)q[he+Z]=J[he];return he}function Ue(J,q){return J instanceof q||J!=null&&J.constructor!=null&&J.constructor.name!=null&&J.constructor.name===q.name}function Ye(J){return J!==J}const tt=function(){const J="0123456789abcdef",q=new Array(256);for(let Z=0;Z<16;++Z){const se=Z*16;for(let he=0;he<16;++he)q[se+he]=J[Z]+J[he]}return q}();function ze(J){return typeof BigInt>"u"?Ne:J}function Ne(){throw new Error("BigInt not supported")}}(eP)),eP}var Dn=SF();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const la=BigInt(0),Ls=BigInt(1),A0=BigInt(2),Iye=BigInt(3),Tye=BigInt(4),Pye=BigInt(5),_wt=BigInt(7),Rye=BigInt(8),Swt=BigInt(9),Mye=BigInt(16);function Li(t,e){const n=t%e;return n>=la?n:e+n}function gi(t,e,n){let r=t;for(;e-- >la;)r*=r,r%=n;return r}function lte(t,e){if(t===la)throw new Error("invert: expected non-zero number");if(e<=la)throw new Error("invert: expected positive modulus, got "+e);let n=Li(t,e),r=e,i=la,s=Ls;for(;n!==la;){const a=r/n,c=r%n,l=i-s*a;r=n,n=c,i=s,s=l}if(r!==Ls)throw new Error("invert: does not exist");return Li(i,e)}function AF(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function Oye(t,e){const n=(t.ORDER+Ls)/Tye,r=t.pow(e,n);return AF(t,r,e),r}function Awt(t,e){const n=(t.ORDER-Pye)/Rye,r=t.mul(e,A0),i=t.pow(r,n),s=t.mul(e,i),o=t.mul(t.mul(s,A0),i),a=t.mul(s,t.sub(o,t.ONE));return AF(t,a,e),a}function kwt(t){const e=ig(t),n=jye(t),r=n(e,e.neg(e.ONE)),i=n(e,r),s=n(e,e.neg(r)),o=(t+_wt)/Mye;return(a,c)=>{let l=a.pow(c,o),u=a.mul(l,r);const d=a.mul(l,i),h=a.mul(l,s),f=a.eql(a.sqr(u),c),m=a.eql(a.sqr(d
vendor: 9,386 bytes, line 532
532),c);l=a.cmov(l,u,f),u=a.cmov(h,d,m);const y=a.eql(a.sqr(u),c),v=a.cmov(l,u,y);return AF(a,v,c),v}}function jye(t){if(t<Iye)throw new Error("sqrt is not defined for small field");let e=t-Ls,n=0;for(;e%A0===la;)e/=A0,n++;let r=A0;const i=ig(t);for(;ute(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Oye;let s=i.pow(r,e);const o=(e+Ls)/A0;return function(c,l){if(c.is0(l))return l;if(ute(c,l)!==1)throw new Error("Cannot find square root");let u=n,d=c.mul(c.ONE,s),h=c.pow(l,e),f=c.pow(l,o);for(;!c.eql(h,c.ONE);){if(c.is0(h))return c.ZERO;let m=1,y=c.sqr(h);for(;!c.eql(y,c.ONE);)if(m++,y=c.sqr(y),m===u)throw new Error("Cannot find square root");const v=Ls<<BigInt(u-m-1),b=c.pow(d,v);u=m,d=c.sqr(b),h=c.mul(h,d),f=c.mul(f,b)}return f}}function $wt(t){return t%Tye===Iye?Oye:t%Rye===Pye?Awt:t%Mye===Swt?kwt(t):jye(t)}const Iwt=(t,e)=>(Li(t,e)&Ls)===Ls,Twt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Pwt(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=Twt.reduce((r,i)=>(r[i]="function",r),e);return w5(t,n),t}function Rwt(t,e,n){if(n<la)throw new Error("invalid exponent, negatives unsupported");if(n===la)return t.ONE;if(n===Ls)return e;let r=t.ONE,i=e;for(;n>la;)n&Ls&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Ls;return r}function Nye(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((o,a,c)=>t.is0(a)?o:(r[c]=o,t.mul(o,a)),t.ONE),s=t.inv(i);return e.reduceRight((o,a,c)=>t.is0(a)?o:(r[c]=t.mul(o,r[c]),t.mul(o,a)),s),r}function ute(t,e){const n=(t.ORDER-Ls)/A0,r=t.pow(e,n),i=t.eql(r,t.ONE),s=t.eql(r,t.ZERO),o=t.eql(r,t.neg(t.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function Dye(t,e){e!==void 0&&Zb(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function ig(t,e,n=!1,r={}){if(t<=la)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,s,o=!1,a;if(typeof e=="object"&&e!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const h=e;h.BITS&&(i=h.BITS),h.sqrt&&(s=h.sqrt),typeof h.isLE=="boolean"&&(n=h.isLE),typeof h.modFromBytes=="boolean"&&(o=h.modFromBytes),a=h.allowedLengths}else typeof e=="number"&&(i=e),r.sqrt&&(s=r.sqrt);const{nBitLength:c,nByteLength:l}=Dye(t,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:t,isLE:n,BITS:c,BYTES:l,MASK:y5(c),ZERO:la,ONE:Ls,allowedLengths:a,create:h=>Li(h,t),isValid:h=>{if(typeof h!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof h);return la<=h&&h<t},is0:h=>h===la,isValidNot0:h=>!d.is0(h)&&d.isValid(h),isOdd:h=>(h&Ls)===Ls,neg:h=>Li(-h,t),eql:(h,f)=>h===f,sqr:h=>Li(h*h,t),add:(h,f)=>Li(h+f,t),sub:(h,f)=>Li(h-f,t),mul:(h,f)=>Li(h*f,t),pow:(h,f)=>Rwt(d,h,f),div:(h,f)=>Li(h*lte(f,t),t),sqrN:h=>h*h,addN:(h,f)=>h+f,subN:(h,f)=>h-f,mulN:(h,f)=>h*f,inv:h=>lte(h,t),sqrt:s||(h=>(u||(u=$wt(t)),u(d,h))),toBytes:h=>n?mae(h,l):OD(h,l),fromBytes:(h,f=!0)=>{if(a){if(!a.includes(h.length)||h.length>l)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+h.length);const y=new Uint8Array(l);y.set(h,n?0:y.length-h.length),h=y}if(h.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+h.length);let m=n?Yb(h):_C(h);if(o&&(m=Li(m,t)),!f&&!d.isValid(m))throw new Error("invalid field element: outside of range 0..ORDER");return m},invertBatch:h=>Nye(d,h),cmov:(h,f,m)=>m?f:h});return Object.freeze(d)}function Lye(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Bye(t){const e=Lye(t);return e+Math.ceil(e/2)}function Mwt(t,e,n=!1){const r=t.length,i=Lye(e),s=Bye(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=n?Yb(t):_C(t),a=Li(o,e-Ls)+Ls;return n?mae(a,i):OD(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const f2=BigInt(0),k0=BigInt(1);function aE(t,e){const n=e.negate();return t?n:e}function $0(t,e){const n=Nye(t.Fp,e.map(r=>r.Z));return e.map((r,i)=>t.fromAffine(r.toAffine(n[i])))}function Fye(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function tP(t,e){Fye(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),i=2**t,s=y5(t),o=BigInt(t);return{windows:n,windowSize:r,mask:s,maxNumber:i,shiftBy:o}}function dte(t,e,n){const{windowSize:r,mask:i,maxNumber:s,shiftBy:o}=n;let a=Number(t&i),c=t>>o;a>r&&(a-=s,c+=k0);const l=e*r,u=l+Math.abs(a)-1,d=a===0,h=a<0,f=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:h,isNegF:f,offsetF:l}}function Owt(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function jwt(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const nP=new WeakMap,Uye=new WeakMap;function rP(t){return Uye.get(t)||1}function hte(t){if(t!==f2)throw new Error("invalid wNAF")}class zye{constructor(e,n){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=n}_unsafeLadder(e,n,r=this.ZERO){let i=e;for(;n>f2;)n&k0&&(r=r.add(i)),i=i.double(),n>>=k0;return r}precomputeWindow(e,n){const{windows:r,windowSize:i}=tP(n,this.bits),s=[];let o=e,a=o;for(let c=0;c<r;c++){a=o,s.push(a);for(let l=1;l<i;l++)a=a.add(o),s.push(a);o=a.double()}return s}wNAF(e,n,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let i=this.ZERO,s=this.BASE;const o=tP(e,this.bits);for(let a=0;a<o.windows;a++){const{nextN:c,offset:l,isZero:u,isNeg:d,isNegF:h,offsetF:f}=dte(r,a,o);r=c,u?s=s.add(aE(h,n[f])):i=i.add(aE(d,n[l]))}return hte(r),{p:i,f:s}}wNAFUnsafe(e,n,r,i=this.ZERO){const s=tP(e,this.bits);for(let o=0;o<s.windows&&r!==f2;o++){const{nextN:a,offset:c,isZero:l,isNeg:u}=dte(r,o,s);if(r=a,!l){const d=n[c];i=i.add(u?d.negate():d)}}return hte(r),i}getPrecomputes(e,n,r){let i=nP.get(n);return i||(i=this.precomputeWindow(n,e),e!==1&&(typeof r=="function"&&(i=r(i)),nP.set(n,i))),i}cached(e,n,r){const i=rP(e);return this.wNAF(i,this.getPrecomputes(i,e,r),n)}unsafe(e,n,r,i){const s=rP(e);return s===1?this._unsafeLadder(e,n,i):this.wNAFUnsafe(s,this.getPrecomputes(s,e,r),n,i)}createCache(e,n){Fye(n,this.bits),Uye.set(e,n),nP.delete(e)}hasCache(e){return rP(e)!==1}}function Nwt(t,e,n,r){let i=e,s=t.ZERO,o=t.ZERO;for(;n>f2||r>f2;)n&k0&&(s=s.add(i)),r&k0&&(o=o.add(i)),i=i.double(),n>>=k0,r>>=k0;return{p1:s,p2:o}}function Wye(t,e,n,r){Owt(n,t),jwt(r,e);const i=n.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,a=yae(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=y5(c),u=new Array(Number(l)+1).fill(o),d=Math.floor((e.BITS-1)/c)*c;let h=o;for(let f=d;f>=0;f-=c){u.fill(o);for(let y=0;y<s;y++){const v=r[y],b=Number(v>>BigInt(f)&l);u[b]=u[b].add(n[y])}let m=o;for(let y=u.length-1,v=o;y>0;y--)v=v.add(u[y]),m=m.add(v);if(h=h.add(m),f!==0)for(let y=0;y<c;y++)h=h.double()}return h}function fte(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Pwt(e),e}else return ig(t,{isLE:n})}function Hye(t,e,n={},r){if(r===void 0&&(r=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const c of["p","n","h"]){const l=e[c];if(!(typeof l=="bigint"&&l>f2))throw new Error(`CURVE.${c} must be positive bigint`)}const i=fte(e.p,n.Fp,r),s=fte(e.n,n.Fn,r),a=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(const c of a)if(!i.isValid(e[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:i,Fn:s}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const uf=BigInt(0),rs=BigInt(1),iP=BigInt(2),Dwt=BigInt(8);function Lwt(t,e,n,r){const i=t.sqr(n),s=t.sqr(r),o=t.add(t.mul(e.a,i),s),a=t.add(t.ONE,t.mul(e.d,t.mul(i,s)));return t.eql(o,a)}function Bwt(t,e={}){const n=Hye("edwards",t,e,e.FpFnLE),{Fp:r,Fn:i}=n;let s=n.CURVE;const{h:o}=s;w5(e,{},{uvRatio:"function"});const a=iP<<BigInt(i.BYTES*8)-rs,c=v=>r.create(v),l=e.uvRatio||((v,b)=>{try{return{isValid:!0,value:r.sqrt(r.div(v,b))}}catch{return{isValid:!1,value:uf}}});if(!Lwt(r,s,s.Gx,s.Gy))throw new Error("bad curve params: generator point");function u(v,b,C=!1){const x=C?rs:uf;return NR("coordinate "+v,b,x,a),b}function d(v){if(!(v instanceof m))throw new Error("ExtendedPoint expected")}const h=Q7((v,b)=>{const{X:C,Y:x,Z:_}=v,$=v.is0();b==null&&(b=$?Dwt:r.inv(_));const I=c(C*b),R=c(x*b),N=r.mul(_,b);if($)return{x:uf,y:rs};if(N!==rs)throw new Error("invZ was invalid");return{x:I,y:R}}),f=Q7(v=>{const{a:b,d:C}=s;if(v.is0())throw new Error("bad point: ZERO");const{X:x,Y:_,Z:$,T:I}=v,R=c(x*x),N=c(_*_),T=c($*$),O=c(T*T),U=c(R*b),z=c(T*c(U+N)),L=c(O+c(C*c(R*N)));if(z!==L)throw new Error("bad point: equation left != right (1)");const S=c(x*_),k=c($*I);if(S!==k)throw new Error("bad point: equation left != right (2)");return!0});class m{constructor(b,C,x,_){this.X=u("x",b),this.Y=u("y",C),this.Z=u("z",x,!0),this.T=u("t",_),Object.freeze(this)}static CURVE(){return s}static fromAffine(b){if(b instanceof m)throw new Error("extended point not allowed");const{x:C,y:x}=b||{};
532return u("x",C),u("y",x),new m(C,x,rs,c(C*x))}static fromBytes(b,C=!1){const x=r.BYTES,{a:_,d:$}=s;b=CV(hl(b,x,"point")),g1(C,"zip215");const I=CV(b),R=b[x-1];I[x-1]=R&-129;const N=Yb(I),T=C?a:r.ORDER;NR("point.y",N,uf,T);const O=c(N*N),U=c(O-rs),z=c($*O-_);let{isValid:L,value:S}=l(U,z);if(!L)throw new Error("bad point: invalid y coordinate");const k=(S&rs)===rs,M=(R&128)!==0;if(!C&&S===uf&&M)throw new Error("bad point: x=0 and x_0=1");return M!==k&&(S=c(-S)),m.fromAffine({x:S,y:N})}static fromHex(b,C=!1){return m.fromBytes(mi("point",b),C)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(b=8,C=!0){return y.createCache(this,b),C||this.multiply(iP),this}assertValidity(){f(this)}equals(b){d(b);const{X:C,Y:x,Z:_}=this,{X:$,Y:I,Z:R}=b,N=c(C*R),T=c($*_),O=c(x*R),U=c(I*_);return N===T&&O===U}is0(){return this.equals(m.ZERO)}negate(){return new m(c(-this.X),this.Y,this.Z,c(-this.T))}double(){const{a:b}=s,{X:C,Y:x,Z:_}=this,$=c(C*C),I=c(x*x),R=c(iP*c(_*_)),N=c(b*$),T=C+x,O=c(c(T*T)-$-I),U=N+I,z=U-R,L=N-I,S=c(O*z),k=c(U*L),M=c(O*L),W=c(z*U);return new m(S,k,W,M)}add(b){d(b);const{a:C,d:x}=s,{X:_,Y:$,Z:I,T:R}=this,{X:N,Y:T,Z:O,T:U}=b,z=c(_*N),L=c($*T),S=c(R*x*U),k=c(I*O),M=c((_+$)*(N+T)-z-L),W=k-S,H=k+S,D=c(L-C*z),V=c(M*W),B=c(H*D),P=c(M*D),j=c(W*H);return new m(V,B,j,P)}subtract(b){return this.add(b.negate())}multiply(b){if(!i.isValidNot0(b))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:C,f:x}=y.cached(this,b,_=>$0(m,_));return $0(m,[C,x])[0]}multiplyUnsafe(b,C=m.ZERO){if(!i.isValid(b))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return b===uf?m.ZERO:this.is0()||b===rs?this:y.unsafe(this,b,x=>$0(m,x),C)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}isTorsionFree(){return y.unsafe(this,s.n).is0()}toAffine(b){return h(this,b)}clearCofactor(){return o===rs?this:this.multiplyUnsafe(o)}toBytes(){const{x:b,y:C}=this.toAffine(),x=r.toBytes(C);return x[x.length-1]|=b&rs?128:0,x}toHex(){return Jf(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(b){return $0(m,b)}static msm(b,C){return Wye(m,i,b,C)}_setWindowSize(b){this.precompute(b)}toRawBytes(){return this.toBytes()}}m.BASE=new m(s.Gx,s.Gy,rs,c(s.Gx*s.Gy)),m.ZERO=new m(uf,rs,rs,uf),m.Fp=r,m.Fn=i;const y=new zye(m,i.BITS);return m.BASE.precompute(8),m}function Fwt(t,e,n={}){if(typeof e!="function")throw new Error('"hash" function param is required');w5(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r}=n,{BASE:i,Fp:s,Fn:o}=t,a=n.randomBytes||RD,c=n.adjustScalarBytes||(T=>T),l=n.domain||((T,O,U)=>{if(g1(U,"phflag"),O.length||U)throw new Error("Contexts/pre-hash are not supported");return T});function u(T){return o.create(Yb(T))}function d(T){const O=x.secretKey;T=mi("private key",T,O);const U=mi("hashed private key",e(T),2*O),z=c(U.slice(0,O)),L=U.slice(O,2*O),S=u(z);return{head:z,prefix:L,scalar:S}}function h(T){const{head:O,prefix:U,scalar:z}=d(T),L=i.multiply(z),S=L.toBytes();return{head:O,prefix:U,scalar:z,point:L,pointBytes:S}}function f(T){return h(T).pointBytes}function m(T=Uint8Array.of(),...O){const U=yu(...O);return u(e(l(U,mi("context",T),!!r)))}function y(T,O,U={}){T=mi("message",T),r&&(T=r(T));const{prefix:z,scalar:L,pointBytes:S}=h(O),k=m(U.context,z,T),M=i.multiply(k).toBytes(),W=m(U.context,M,S,T),H=o.create(k+W*L);if(!o.isValid(H))throw new Error("sign failed: invalid s");const D=yu(M,o.toBytes(H));return hl(D,x.signature,"result")}const v={zip215:!0};function b(T,O,U,z=v){const{context:L,zip215:S}=z,k=x.signature;T=mi("signature",T,k),O=mi("message",O),U=mi("publicKey",U,x.publicKey),S!==void 0&&g1(S,"zip215"),r&&(O=r(O));const M=k/2,W=T.subarray(0,M),H=Yb(T.subarray(M,k));let D,V,B;try{D=t.fromBytes(U,S),V=t.fromBytes(W,S),B=i.multiplyUnsafe(H)}catch{return!1}if(!S&&D.isSmallOrder())return!1;const P=m(L,V.toBytes(),D.toBytes(),O);return V.add(D.multiplyUnsafe(P)).subtract(B).clearCofactor().is0()}const C=s.BYTES,x={secretKey:C,publicKey:C,signature:2*C,seed:C};function _(T=a(x.seed)){return hl(T,x.seed,"seed")}function $(T){const O=N.randomSecretKey(T);return{secretKey:O,publicKey:f(O)}}function I(T){return m5(T)&&T.length===o.BYTES}function R(T,O){try{return!!t.fromBytes(T,O)}catch{return!1}}const N={getExtendedPublicKey:h,randomSecretKey:_,isValidSecretKey:I,isValidPublicKey:R,toMontgomery(T){const{y:O}=t.fromBytes(T),U=x.publicKey,z=U===32;if(!z&&U!==57)throw new Error("only defined for 25519 and 448");const L=z?s.div(rs+O,rs-O):s.div(O-rs,O+rs);return s.toBytes(L)},toMontgomeryPriv(T){const O=x.secretKey;hl(T,O);const U=e(T.subarray(0,O));return c(U).subarray(0,O)},randomPrivateKey:_,precompute(T=8,O=t.BASE){return O.precompute(T,!1)}};return Object.freeze({keygen:$,getPublicKey:f,sign:y,verify:b,utils:N,Point:t,lengths:x})}function Uwt(t){const e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy}
532,n=t.Fp,r=ig(e.n,t.nBitLength,!0),i={Fp:n,Fn:r,uvRatio:t.uvRatio},s={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve};return{CURVE:e,curveOpts:i,hash:t.hash,eddsaOpts:s}}function zwt(t,e){const n=e.Point;return Object.assign({},e,{ExtendedPoint:n,CURVE:t,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}function Wwt(t){const{CURVE:e,curveOpts:n,hash:r,eddsaOpts:i}=Uwt(t),s=Bwt(e,n),o=Fwt(s,r,i);return zwt(t,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Hwt=BigInt(1),pte=BigInt(2);BigInt(3);const Vwt=BigInt(5),qwt=BigInt(8),kF=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Vye={p:kF,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:qwt,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Kwt(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=kF,a=t*t%s*t%s,c=gi(a,pte,s)*a%s,l=gi(c,Hwt,s)*t%s,u=gi(l,Vwt,s)*l%s,d=gi(u,e,s)*u%s,h=gi(d,n,s)*d%s,f=gi(h,r,s)*h%s,m=gi(f,i,s)*f%s,y=gi(m,i,s)*f%s,v=gi(y,e,s)*u%s;return{pow_p_5_8:gi(v,pte,s)*t%s,b2:a}}function Gwt(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const gte=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Zwt(t,e){const n=kF,r=Li(e*e*e,n),i=Li(r*r*e,n),s=Kwt(t*i).pow_p_5_8;let o=Li(t*r*s,n);const a=Li(e*o*o,n),c=o,l=Li(o*gte,n),u=a===t,d=a===Li(-t,n),h=a===Li(-t*gte,n);return u&&(o=c),(d||h)&&(o=l),Iwt(o,n)&&(o=Li(-o,n)),{isValid:u||d,value:o}}const Ywt=ig(Vye.p,{isLE:!0}),Qwt={...Vye,Fp:Ywt,hash:YAe,adjustScalarBytes:Gwt,uvRatio:Zwt},ox=Wwt(Qwt);var R6={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var mte;function Xwt(){return mte||(mte=1,function(t,e){var n=SF(),r=n.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=s);function s(o,a,c){return r(o,a,c)}s.prototype=Object.create(r.prototype),i(r,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=r(o);
vendor: 6,919 bytes, line 532
532return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(o)}}(R6,R6.exports)),R6.exports}var sP,yte;function Jwt(){if(yte)return sP;yte=1;var t=Xwt().Buffer;function e(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<n.length;s++){var o=n.charAt(s),a=o.charCodeAt(0);if(r[a]!==255)throw new TypeError(o+" is ambiguous");r[a]=s}var c=n.length,l=n.charAt(0),u=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function h(y){if((Array.isArray(y)||y instanceof Uint8Array)&&(y=t.from(y)),!t.isBuffer(y))throw new TypeError("Expected Buffer");if(y.length===0)return"";for(var v=0,b=0,C=0,x=y.length;C!==x&&y[C]===0;)C++,v++;for(var _=(x-C)*d+1>>>0,$=new Uint8Array(_);C!==x;){for(var I=y[C],R=0,N=_-1;(I!==0||R<b)&&N!==-1;N--,R++)I+=256*$[N]>>>0,$[N]=I%c>>>0,I=I/c>>>0;if(I!==0)throw new Error("Non-zero carry");b=R,C++}for(var T=_-b;T!==_&&$[T]===0;)T++;for(var O=l.repeat(v);T<_;++T)O+=n.charAt($[T]);return O}function f(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return t.alloc(0);for(var v=0,b=0,C=0;y[v]===l;)b++,v++;for(var x=(y.length-v)*u+1>>>0,_=new Uint8Array(x);v<y.length;){var $=y.charCodeAt(v);if($>255)return;var I=r[$];if(I===255)return;for(var R=0,N=x-1;(I!==0||R<C)&&N!==-1;N--,R++)I+=c*_[N]>>>0,_[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=R,v++}for(var T=x-C;T!==x&&_[T]===0;)T++;var O=t.allocUnsafe(b+(x-T));O.fill(0,0,b);for(var U=b;T!==x;)O[U++]=_[T++];return O}function m(y){var v=f(y);if(v)return v;throw new Error("Non-base"+c+" character")}return{encode:h,decodeUnsafe:f,decode:m}}return sP=e,sP}var oP,wte;function qye(){if(wte)return oP;wte=1;var t=Jwt(),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return oP=t(e),oP}var evt=qye();const Os=ys(evt);var fr={};function Rd(t,e,n){return e<=t&&t<=n}function gS(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function tvt(t){for(var e=String(t),n=e.length,r=0,i=[];r<n;){var s=e.charCodeAt(r);if(s<55296||s>57343)i.push(s);else if(56320<=s&&s<=57343)i.push(65533);else if(55296<=s&&s<=56319)if(r===n-1)i.push(65533);else{var o=t.charCodeAt(r+1);if(56320<=o&&o<=57343){var a=s&1023,c=o&1023;i.push(65536+(a<<10)+c),r+=1}else i.push(65533)}r+=1}return i}function nvt(t){for(var e="",n=0;n<t.length;++n){var r=t[n];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var cE=-1;function $F(t){this.tokens=[].slice.call(t)}$F.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():cE},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var p2=-1;function aP(t,e){if(t)throw TypeError("Decoder error");return e||65533}var lE="utf-8";function uE(t,e){if(!(this instanceof uE))return new uE(t,e);if(t=t!==void 0?String(t).toLowerCase():lE,t!==lE)throw new Error("Encoding not supported. Only utf-8 is supported");e=gS(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}uE.prototype={decode:function(e,n){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),n=gS(n),this._streaming||(this._decoder=new rvt({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!n.stream;for(var i=new $F(r),s=[],o;!i.endOfStream()&&(o=this._decoder.handler(i,i.read()),o!==p2);)o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o));if(!this._streaming){do{if(o=this._decoder.handler(i,i.read()),o===p2)break;o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!i.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),nvt(s)}};function dE(t,e){if(!(this instanceof dE))return new dE(t,e);if(t=t!==void 0?String(t).toLowerCase():lE,t!==lE)throw new Error("Encoding not supported. Only utf-8 is supported");e=gS(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}dE.prototype={encode:function(e,n){e=e?String(e):"",n=gS(n),this._streaming||(this._encoder=new ivt(this._options)),this._streaming=!!n.stream;for(var r=[],i=new $F(tvt(e)),s;!i.endOfStream()&&(s=this._encoder.handler(i,i.read()),s!==p2);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(i,i.read()),s!==p2;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)}};function rvt(t){var e=t.fatal,n=0,r=0,i=0,s=128,o=191;this.handler=function(a,c){if(c===cE&&i!==0)return i=0,aP(e);if(c===cE)return p2;if(i===0){if(Rd(c,0,127))return c;if(Rd(c,194,223))i=1,n=c-192;else if(Rd(c,224,239))c===224&&(s=160),c===237&&(o=159),i=2,n=c-224;else if(Rd(c,240,244))c===240&&(s=144),c===244&&(o=143),i=3,n=c-240;else return aP(e);return n=n<<6*i,null}if(!Rd(c,s,o))return n=i=r=0,s=128,o=191,a.prepend(c),aP(e);if(s=128,o=191,r+=1,n+=c-128<<6*(i-r),r!==i)return null;var l=n;return n=i=r=0,l}}function ivt(t){t.fatal,this.handler=function(e,n){if(n===cE)return p2;if(Rd(n,0,127))return n;var r,i;Rd(n,128,2047)?(r=1,i=192):Rd(n,2048,65535)?(r=2,i=224):Rd(n,65536,1114111)&&(r=3,i=240);for(var s=[(n>>6*r)+i];r>0;){var o=n>>6*(r-1);s.push(128|o&63),r-=1}return s}}const svt=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:uE,TextEncoder:dE},Symbol.toStringTag,{value:"Module"})),ovt=qE(svt);var vte;function avt(){if(vte)return fr;vte=1;var t=fr&&fr.__createBinding||(Object.create?function(T,O,U,z){z===void 0&&(z=U),Object.defineProperty(T,z,{enumerable:!0,get:function(){return O[U]}})}:function(T,O,U,z){z===void 0&&(z=U),T[z]=O[U]}),e=fr&&fr.__setModuleDefault||(Object.create?function(T,O){Object.defineProperty(T,"default",{enumerable:!0,value:O})}:function(T,O){T.default=O}),n=fr&&fr.__decorate||function(T,O,U,z){var L=arguments.length,S=L<3?O:z===null?z=Object.getOwnPropertyDescriptor(O,U):z,k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(T,O,U,z);else for(var M=T.length-1;M>=0;
532M--)(k=T[M])&&(S=(L<3?k(S):L>3?k(O,U,S):k(O,U))||S);return L>3&&S&&Object.defineProperty(O,U,S),S},r=fr&&fr.__importStar||function(T){if(T&&T.__esModule)return T;var O={};if(T!=null)for(var U in T)U!=="default"&&Object.hasOwnProperty.call(T,U)&&t(O,T,U);return e(O,T),O},i=fr&&fr.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(fr,"__esModule",{value:!0}),fr.deserializeUnchecked=fr.deserialize=fr.serialize=fr.BinaryReader=fr.BinaryWriter=fr.BorshError=fr.baseDecode=fr.baseEncode=void 0;const s=i(fle()),o=i(qye()),a=r(ovt),c=typeof TextDecoder!="function"?a.TextDecoder:TextDecoder,l=new c("utf-8",{fatal:!0});function u(T){return typeof T=="string"&&(T=Buffer.from(T,"utf8")),o.default.encode(Buffer.from(T))}fr.baseEncode=u;function d(T){return Buffer.from(o.default.decode(T))}fr.baseDecode=d;const h=1024;class f extends Error{constructor(O){super(O),this.fieldPath=[],this.originalMessage=O}addToFieldPath(O){this.fieldPath.splice(0,0,O),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}fr.BorshError=f;class m{constructor(){this.buf=Buffer.alloc(h),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(h)]))}writeU8(O){this.maybeResize(),this.buf.writeUInt8(O,this.length),this.length+=1}writeU16(O){this.maybeResize(),this.buf.writeUInt16LE(O,this.length),this.length+=2}writeU32(O){this.maybeResize(),this.buf.writeUInt32LE(O,this.length),this.length+=4}writeU64(O){this.maybeResize(),this.writeBuffer(Buffer.from(new s.default(O).toArray("le",8)))}writeU128(O){this.maybeResize(),this.writeBuffer(Buffer.from(new s.default(O).toArray("le",16)))}writeU256(O){this.maybeResize(),this.writeBuffer(Buffer.from(new s.default(O).toArray("le",32)))}writeU512(O){this.maybeResize(),this.writeBuffer(Buffer.from(new s.default(O).toArray("le",64)))}writeBuffer(O){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),O,Buffer.alloc(h)]),this.length+=O.length}writeString(O){this.maybeResize();const U=Buffer.from(O,"utf8");this.writeU32(U.length),this.writeBuffer(U)}writeFixedArray(O){this.writeBuffer(Buffer.from(O))}writeArray(O,U){this.maybeResize(),this.writeU32(O.length);for(const z of O)this.maybeResize(),U(z)}toArray(){return this.buf.subarray(0,this.length)}}fr.BinaryWriter=m;function y(T,O,U){const z=U.value;U.value=function(...L){try{return z.apply(this,L)}catch(S){if(S instanceof RangeError){const k=S.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(k)>=0)throw new f("Reached the end of buffer when deserializing")}throw S}}}class v{constructor(O){this.buf=O,this.offset=0}readU8(){const O=this.buf.readUInt8(this.offset);return this.offset+=1,O}readU16(){const O=this.buf.readUInt16LE(this.offset);return this.offset+=2,O}readU32(){const O=this.buf.readUInt32LE(this.offset);return this.offset+=4,O}readU64(){const O=this.readBuffer(8);return new s.default(O,"le")}readU128(){const O=this.readBuffer(16);return new s.default(O,"le")}readU256(){const O=this.readBuffer(32);return new s.default(O,"le")}readU512(){const O=this.readBuffer(64);return new s.default(O,"le")}readBuffer(O){if(this.offset+O>this.buf.length)throw new f(`Expected buffer length ${O} isn't within bounds`);const U=this.buf.slice(this.offset,this.offset+O);return this.offset+=O,U}readString(){const O=this.readU32(),U=this.readBuffer(O);try{return l.decode(U)}catch(z){throw new f(`Error decoding UTF-8 string: ${z}`)}}readFixedArray(O){return new Uint8Array(this.readBuffer(O))}readArray(O){const U=this.readU32(),z=Array();for(let L=0;L<U;++L)z.push(O());return z}}n([y],v.prototype,"readU8",null),n([y],v.prototype,"readU16",null),n([y],v.prototype,"readU32",null),n([y],v.prototype,"readU64",null),n([y],v.prototype,"readU128",null),n([y],v.prototype,"readU256",null),n([y],v.prototype,"readU512",null),n([y],v.prototype,"readString",null),n([y],v.prototype,"readFixedArray",null),n([y],v.prototype,"readArray",null),fr.BinaryReader=v;function b(T){return T.charAt(0).toUpperCase()+T.slice(1)}function C(T,O,U,z,L){try{if(typeof z=="string")L[`write${b(z)}`](U);else if(z instanceof Array)if(typeof z[0]=="number"){if(U.length!==z[0])throw new f(`Expecting byte array of length ${z[0]}, but got ${U.length} bytes`);L.writeFixedArray(U)}else if(z.length===2&&typeof z[1]=="number"){if(U.length!==z[1])throw new f(`Expecting byte array of length ${z[1]}, but got ${U.length} bytes`);for(let S=0;S<z[1];S++)C(T,null,U[S],z[0],L)}else L.writeArray(U,S=>{C(T,O,S,z[0],L)});else if(z.kind!==void 0)switch(z.kind){case"option":{U==null?L.writeU8(0):(L.writeU8(1),C(T,O,U,z.type,L));break}
532case"map":{L.writeU32(U.size),U.forEach((S,k)=>{C(T,O,k,z.key,L),C(T,O,S,z.value,L)});break}default:throw new f(`FieldType ${z} unrecognized`)}else x(T,U,L)}catch(S){throw S instanceof f&&S.addToFieldPath(O),S}}function x(T,O,U){if(typeof O.borshSerialize=="function"){O.borshSerialize(U);return}const z=T.get(O.constructor);if(!z)throw new f(`Class ${O.constructor.name} is missing in schema`);if(z.kind==="struct")z.fields.map(([L,S])=>{C(T,L,O[L],S,U)});else if(z.kind==="enum"){const L=O[z.field];for(let S=0;S<z.values.length;++S){const[k,M]=z.values[S];if(k===L){U.writeU8(S),C(T,k,O[k],M,U);break}}}else throw new f(`Unexpected schema kind: ${z.kind} for ${O.constructor.name}`)}function _(T,O,U=m){const z=new U;return x(T,O,z),z.toArray()}fr.serialize=_;function $(T,O,U,z){try{if(typeof U=="string")return z[`read${b(U)}`]();if(U instanceof Array){if(typeof U[0]=="number")return z.readFixedArray(U[0]);if(typeof U[1]=="number"){const L=[];for(let S=0;S<U[1];S++)L.push($(T,null,U[0],z));return L}else return z.readArray(()=>$(T,O,U[0],z))}if(U.kind==="option")return z.readU8()?$(T,O,U.type,z):void 0;if(U.kind==="map"){let L=new Map;const S=z.readU32();for(let k=0;k<S;k++){const M=$(T,O,U.key,z),W=$(T,O,U.value,z);L.set(M,W)}return L}return I(T,U,z)}catch(L){throw L instanceof f&&L.addToFieldPath(O),L}}function I(T,O,U){if(typeof O.borshDeserialize=="function")return O.borshDeserialize(U);const z=T.get(O);if(!z)throw new f(`Class ${O.name} is missing in schema`);if(z.kind==="struct"){const L={};for(const[S,k]of T.get(O).fields)L[S]=$(T,S,k,U);return new O(L)}if(z.kind==="enum"){const L=U.readU8();if(L>=z.values.length)throw new f(`Enum index: ${L} is out of range`);const[S,k]=z.values[L],M=$(T,S,k,U);return new O({[S]:M})}throw new f(`Unexpected schema kind: ${z.kind} for ${O.constructor.name}`)}function R(T,O,U,z=v){const L=new z(U),S=I(T,O,L);if(L.offset<U.length)throw new f(`Unexpected ${U.length-L.offset} bytes after deserialized data`);return S}fr.deserialize=R;function N(T,O,U,z=v){const L=new z(U);return I(T,O,L)}return fr.deserializeUnchecked=N,fr}var cP=avt(),De={},bte;function cvt(){if(bte)return De;bte=1,Object.defineProperty(De,"__esModule",{value:!0}),De.s16=De.s8=De.nu64be=De.u48be=De.u40be=De.u32be=De.u24be=De.u16be=De.nu64=De.u48=De.u40=De.u32=De.u24=De.u16=De.u8=De.offset=De.greedy=De.Constant=De.UTF8=De.CString=De.Blob=De.Boolean=De.BitField=De.BitStructure=De.VariantLayout=De.Union=De.UnionLayoutDiscriminator=De.UnionDiscriminator=De.Structure=De.Sequence=De.DoubleBE=De.Double=De.FloatBE=De.Float=De.NearInt64BE=De.NearInt64=De.NearUInt64BE=De.NearUInt64=De.IntBE=De.Int=De.UIntBE=De.UInt=De.OffsetLayout=De.GreedyCount=De.ExternalLayout=De.bindConstructorLayout=De.nameWithProperty=De.Layout=De.uint8ArrayToBuffer=De.checkUint8Array=void 0,De.constant=De.utf8=De.cstr=De.blob=De.unionLayoutDiscriminator=De.union=De.seq=De.bits=De.struct=De.f64be=De.f64=De.f32be=De.f32=De.ns64be=De.s48be=De.s40be=De.s32be=De.s24be=De.s16be=De.ns64=De.s48=De.s40=De.s32=De.s24=void 0;const t=SF();function e(P){if(!(P instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}De.checkUint8Array=e;function n(P){return e(P),t.Buffer.from(P.buffer,P.byteOffset,P.length)}De.uint8ArrayToBuffer=n;let r=class{constructor(j,G){if(!Number.isInteger(j))throw new TypeError("span must be an integer");this.span=j,this.property=G}makeDestinationObject(){return{}}getSpan(j,G){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(j){const G=Object.create(this.constructor.prototype);return Object.assign(G,this),G.property=j,G}fromArray(j){}};De.Layout=r;function i(P,j){return j.property?P+"["+j.property+"]":P}De.nameWithProperty=i;function s(P,j){if(typeof P!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(P,"layout_"))throw new Error("Class is already bound to a layout");if(!(j&&j instanceof r))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(j,"boundConstructor_"))throw new Error("layout is already bound to a constructor");P.layout_=j,j.boundConstructor_=P,j.makeDestinationObject=()=>new P,Object.defineProperty(P.prototype,"encode",{value(G,Y){return j.encode(this,G,Y)},writable:!0}),Object.defineProperty(P,"decode",{value(G,Y){return j.decode(G,Y)},writable:!0})}De.bindConstructorLayout=s;class o extends r{isCount(){throw new Error("ExternalLayout is abstract")}}De.ExternalLayout=o;class a extends o{constructor(j=1,G){if(!Number.isInteger(j)||0>=j)throw new TypeError("elementSpan must be a (positive) integer");super(-1,G),this.elementSpan=j}isCount(){return!0}decode(j,G=0){e(j);const Y=j.length-G;return Math.floor(Y/this.elementSpan)}encode(j,G,Y){return 0}}De.GreedyCount=a;class c extends o{constructor(j,G=0,Y){if(!(j instanceof r))throw new TypeError("layout must be a Layout");if(!Number.isInteger(G))throw new TypeError("offset must be integer or undefined");super(j.span,Y||j.property),this.layout=j,this.offset=G}isCount(){return this.layout instanceof l||this.layout instanceof u}decode(j,G=0){return this.layout.decode(j,G+this.offset)}encode(j,G,Y=0){return this.layout.encode(j,G,Y+this.offset)}}De.OffsetLayout=c;class l extends r{constructor(j,G){if(super(j,G),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(j,G=0){return n(j).readUIntLE(G,this.span)}encode(j,G,Y=0){return n(G).writeUIntLE(j,Y,this.span),this.span}}De.UInt=l;class u extends r{constructor(j,G){if(super(j,G),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(j,G=0){return n(j).readUIntBE(G,this.span)}encode(j,G,Y=0){return n(G).writeUIntBE(j,Y,this.span),this.span}}De.UIntBE=u;class d extends r{constructor(j,G){if(super(j,G),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(j,G=0){return n(j).readIntLE(G,this.span)}encode(j,G,Y=0){return n(G).writeIntLE(j,Y,this.span),this.span}}De.Int=d;class h extends r{constructor(j,G){if(super(j,G),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(j,G=0){return n(j).readIntBE(G,this.span)}encode(j,G,Y=0){return n(G).writeIntBE(j,Y,this.span),this.span}}De.IntBE=h;const f=Math.pow(2,32);function m(P){const j=Math.floor(P/f),G=P-j*f;return{hi32:j,lo32:G}}function y(P,j){return P*f+j}class v extends r{constructor(j){super(8,j)}decode(j,G=0){const Y=n(j),te=Y.readUInt32LE(G),ae=Y.readUInt32LE(G+4);return y(ae,te)}encode(j,G,Y=0){const te=m(j),ae=n(G);return ae.writeUInt32LE(te.lo32,Y),ae.writeUInt32LE(te.hi32,Y+4),8}}De.NearUInt64=v;class b extends r{constructor(j){super(8,j)}decode(j,G=0){const Y=n(j),te=Y.readUInt32BE(G),ae=Y.readUInt32BE(G+4);return y(te,ae)}encode(j,G,Y=0){const te=m(j),ae=n(G);return ae.writeUInt32BE(te.hi32,Y),ae.writeUInt32BE(te.lo32,Y+4),8}}De.NearUInt64BE=b;class C extends r{constructor(j){super(8,j)}decode(j,G=0){const Y=n(j),te=Y.readUInt32LE(G),ae=Y.readInt32LE(G+4);return y(ae,te)}encode(j,G,Y=0){const te=m(j),ae=n(G);return ae.writeUInt32LE(te.lo32,Y),ae.writeInt32LE(te.hi32,Y+4),8}}De.NearInt64=C;class x extends r{constructor(j){super(8,j)}decode(j,G=0){const Y=n(j),te=Y.readInt32BE(G),ae=Y.readUInt32BE(G+4);return y(te,ae)}encode(j,G,Y=0){const te=m(j),ae=n(G);return ae.writeInt32BE(te.hi32,Y),ae.writeUInt32BE(te.lo32,Y+4),8}}De.NearInt64BE=x;class _ extends r{constructor(j){super(4,j)}decode(j,G=0){return n(j).readFloatLE(G)}encode(j,G,Y=0){return n(G).writeFloatLE(j,Y),4}}De.Float=_;class $ extends r{constructor(j){super(4,j)}decode(j,G=0){return n(j).readFloatBE(G)}encode(j,G,Y=0){return n(G).writeFloatBE(j,Y),4}}De.FloatBE=$;class I extends r{constructor(j){super(8,j)}decode(j,G=0){return n(j).readDoubleLE(G)}encode(j,G,Y=0){return n(G).writeDoubleLE(j,Y),8}}De.Double=I;class R extends r{constructor(j){super(8,j)}decode(j,G=0){return n(j).readDoubleBE(G)}encode(j,G,Y=0){return n(G).writeDoubleBE(j,Y),8}}De.DoubleBE=R;class N extends r{constructor(j,G,Y){if(!(j instanceof r))throw new TypeError("elementLayout must be a Layout");if(!(G instanceof o&&G.isCount()||Number.isInteger(G)&&0<=G))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let te=-1;!(G instanceof o)&&0<j.span&&(te=G*j.span),super(te,Y),this.elementLayout=j,this.count=G}
532getSpan(j,G=0){if(0<=this.span)return this.span;let Y=0,te=this.count;if(te instanceof o&&(te=te.decode(j,G)),0<this.elementLayout.span)Y=te*this.elementLayout.span;else{let ae=0;for(;ae<te;)Y+=this.elementLayout.getSpan(j,G+Y),++ae}return Y}decode(j,G=0){const Y=[];let te=0,ae=this.count;for(ae instanceof o&&(ae=ae.decode(j,G));te<ae;)Y.push(this.elementLayout.decode(j,G)),G+=this.elementLayout.getSpan(j,G),te+=1;return Y}encode(j,G,Y=0){const te=this.elementLayout,ae=j.reduce((oe,de)=>oe+te.encode(de,G,Y+oe),0);return this.count instanceof o&&this.count.encode(j.length,G,Y),ae}}De.Sequence=N;class T extends r{constructor(j,G,Y){if(!(Array.isArray(j)&&j.reduce((ae,oe)=>ae&&oe instanceof r,!0)))throw new TypeError("fields must be array of Layout instances");typeof G=="boolean"&&Y===void 0&&(Y=G,G=void 0);for(const ae of j)if(0>ae.span&&ae.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let te=-1;try{te=j.reduce((ae,oe)=>ae+oe.getSpan(),0)}catch{}super(te,G),this.fields=j,this.decodePrefixes=!!Y}
vendor: 2,501 bytes, line 532
532getSpan(j,G=0){if(0<=this.span)return this.span;let Y=0;try{Y=this.fields.reduce((te,ae)=>{const oe=ae.getSpan(j,G);return G+=oe,te+oe},0)}catch{throw new RangeError("indeterminate span")}return Y}decode(j,G=0){e(j);const Y=this.makeDestinationObject();for(const te of this.fields)if(te.property!==void 0&&(Y[te.property]=te.decode(j,G)),G+=te.getSpan(j,G),this.decodePrefixes&&j.length===G)break;return Y}encode(j,G,Y=0){const te=Y;let ae=0,oe=0;for(const de of this.fields){let ke=de.span;if(oe=0<ke?ke:0,de.property!==void 0){const Be=j[de.property];Be!==void 0&&(oe=de.encode(Be,G,Y),0>ke&&(ke=de.getSpan(G,Y)))}ae=Y,Y+=ke}return ae+oe-te}fromArray(j){const G=this.makeDestinationObject();for(const Y of this.fields)Y.property!==void 0&&0<j.length&&(G[Y.property]=j.shift());return G}layoutFor(j){if(typeof j!="string")throw new TypeError("property must be string");for(const G of this.fields)if(G.property===j)return G}offsetOf(j){if(typeof j!="string")throw new TypeError("property must be string");let G=0;for(const Y of this.fields){if(Y.property===j)return G;0>Y.span?G=-1:0<=G&&(G+=Y.span)}}}De.Structure=T;class O{constructor(j){this.property=j}decode(j,G){throw new Error("UnionDiscriminator is abstract")}encode(j,G,Y){throw new Error("UnionDiscriminator is abstract")}}De.UnionDiscriminator=O;class U extends O{constructor(j,G){if(!(j instanceof o&&j.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(G||j.property||"variant"),this.layout=j}decode(j,G){return this.layout.decode(j,G)}encode(j,G,Y){return this.layout.encode(j,G,Y)}}De.UnionLayoutDiscriminator=U;class z extends r{constructor(j,G,Y){let te;if(j instanceof l||j instanceof u)te=new U(new c(j));else if(j instanceof o&&j.isCount())te=new U(j);else if(j instanceof O)te=j;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(G===void 0&&(G=null),!(G===null||G instanceof r))throw new TypeError("defaultLayout must be null or a Layout");if(G!==null){if(0>G.span)throw new Error("defaultLayout must have constant span");G.property===void 0&&(G=G.replicate("content"))}let ae=-1;G&&(ae=G.span,0<=ae&&(j instanceof l||j instanceof u)&&(ae+=te.layout.span)),super(ae,Y),this.discriminator=te,this.usesPrefixDiscriminator=j instanceof l||j instanceof u,this.defaultLayout=G,this.registry={};let oe=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(de){return oe(de)},this.configGetSourceVariant=function(de){oe=de.bind(this)}}
532getSpan(j,G=0){if(0<=this.span)return this.span;const Y=this.getVariant(j,G);if(!Y)throw new Error("unable to determine span for unrecognized variant");return Y.getSpan(j,G)}defaultGetSourceVariant(j){if(Object.prototype.hasOwnProperty.call(j,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(j,this.defaultLayout.property))return;const G=this.registry[j[this.discriminator.property]];if(G&&(!G.layout||G.property&&Object.prototype.hasOwnProperty.call(j,G.property)))return G}else for(const G in this.registry){const Y=this.registry[G];if(Y.property&&Object.prototype.hasOwnProperty.call(j,Y.property))return Y}throw new Error("unable to infer src variant")}decode(j,G=0){let Y;const te=this.discriminator,ae=te.decode(j,G),oe=this.registry[ae];if(oe===void 0){const de=this.defaultLayout;let ke=0;this.usesPrefixDiscriminator&&(ke=te.layout.span),Y=this.makeDestinationObject(),Y[te.property]=ae,Y[de.property]=de.decode(j,G+ke)}else Y=oe.decode(j,G);return Y}encode(j,G,Y=0){const te=this.getSourceVariant(j);if(te===void 0){const ae=this.discriminator,oe=this.defaultLayout;let de=0;return this.usesPrefixDiscriminator&&(de=ae.layout.span),ae.encode(j[ae.property],G,Y),de+oe.encode(j[oe.property],G,Y+de)}return te.encode(j,G,Y)}addVariant(j,G,Y){const te=new L(this,j,G,Y);return this.registry[j]=te,te}getVariant(j,G=0){let Y;return j instanceof Uint8Array?Y=this.discriminator.decode(j,G):Y=j,this.registry[Y]}}De.Union=z;class L extends r{constructor(j,G,Y,te){if(!(j instanceof z))throw new TypeError("union must be a Union");if(!Number.isInteger(G)||0>G)throw new TypeError("variant must be a (non-negative) integer");if(typeof Y=="string"&&te===void 0&&(te=Y,Y=null),Y){if(!(Y instanceof r))throw new TypeError("layout must be a Layout");if(j.defaultLayout!==null&&0<=Y.span&&Y.span>j.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof te!="string")throw new TypeError("variant must have a String property")}let ae=j.span;0>j.span&&(ae=Y?Y.span:0,0<=ae&&j.usesPrefixDiscriminator&&(ae+=j.discriminator.layout.span)),super(ae,te),this.union=j,this.variant=G,this.layout=Y||null}
vendor: 4,443 bytes, line 532
532getSpan(j,G=0){if(0<=this.span)return this.span;let Y=0;this.union.usesPrefixDiscriminator&&(Y=this.union.discriminator.layout.span);let te=0;return this.layout&&(te=this.layout.getSpan(j,G+Y)),Y+te}decode(j,G=0){const Y=this.makeDestinationObject();if(this!==this.union.getVariant(j,G))throw new Error("variant mismatch");let te=0;return this.union.usesPrefixDiscriminator&&(te=this.union.discriminator.layout.span),this.layout?Y[this.property]=this.layout.decode(j,G+te):this.property?Y[this.property]=!0:this.union.usesPrefixDiscriminator&&(Y[this.union.discriminator.property]=this.variant),Y}encode(j,G,Y=0){let te=0;if(this.union.usesPrefixDiscriminator&&(te=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(j,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,G,Y);let ae=te;if(this.layout&&(this.layout.encode(j[this.property],G,Y+te),ae+=this.layout.getSpan(G,Y+te),0<=this.union.span&&ae>this.union.span))throw new Error("encoded variant overruns containing union");return ae}fromArray(j){if(this.layout)return this.layout.fromArray(j)}}De.VariantLayout=L;function S(P){return 0>P&&(P+=4294967296),P}class k extends r{constructor(j,G,Y){if(!(j instanceof l||j instanceof u))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof G=="string"&&Y===void 0&&(Y=G,G=!1),4<j.span)throw new RangeError("word cannot exceed 32 bits");super(j.span,Y),this.word=j,this.msb=!!G,this.fields=[];let te=0;this._packedSetValue=function(ae){return te=S(ae),this},this._packedGetValue=function(){return te}}decode(j,G=0){const Y=this.makeDestinationObject(),te=this.word.decode(j,G);this._packedSetValue(te);for(const ae of this.fields)ae.property!==void 0&&(Y[ae.property]=ae.decode(j));return Y}encode(j,G,Y=0){const te=this.word.decode(G,Y);this._packedSetValue(te);for(const ae of this.fields)if(ae.property!==void 0){const oe=j[ae.property];oe!==void 0&&ae.encode(oe)}return this.word.encode(this._packedGetValue(),G,Y)}addField(j,G){const Y=new M(this,j,G);return this.fields.push(Y),Y}addBoolean(j){const G=new W(this,j);return this.fields.push(G),G}fieldFor(j){if(typeof j!="string")throw new TypeError("property must be string");for(const G of this.fields)if(G.property===j)return G}}De.BitStructure=k;class M{constructor(j,G,Y){if(!(j instanceof k))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(G)||0>=G)throw new TypeError("bits must be positive integer");const te=8*j.span,ae=j.fields.reduce((oe,de)=>oe+de.bits,0);if(G+ae>te)throw new Error("bits too long for span remainder ("+(te-ae)+" of "+te+" remain)");this.container=j,this.bits=G,this.valueMask=(1<<G)-1,G===32&&(this.valueMask=4294967295),this.start=ae,this.container.msb&&(this.start=te-ae-G),this.wordMask=S(this.valueMask<<this.start),this.property=Y}decode(j,G){const Y=this.container._packedGetValue();return S(Y&this.wordMask)>>>this.start}encode(j){if(typeof j!="number"||!Number.isInteger(j)||j!==S(j&this.valueMask))throw new TypeError(i("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const G=this.container._packedGetValue(),Y=S(j<<this.start);this.container._packedSetValue(S(G&~this.wordMask)|Y)}}De.BitField=M;class W extends M{constructor(j,G){super(j,1,G)}decode(j,G){return!!super.decode(j,G)}encode(j){typeof j=="boolean"&&(j=+j),super.encode(j)}}De.Boolean=W;class H extends r{constructor(j,G){if(!(j instanceof o&&j.isCount()||Number.isInteger(j)&&0<=j))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let Y=-1;j instanceof o||(Y=j),super(Y,G),this.length=j}getSpan(j,G){let Y=this.span;return 0>Y&&(Y=this.length.decode(j,G)),Y}decode(j,G=0){let Y=this.span;return 0>Y&&(Y=this.length.decode(j,G)),n(j).slice(G,G+Y)}encode(j,G,Y){let te=this.length;if(this.length instanceof o&&(te=j.length),!(j instanceof Uint8Array&&te===j.length))throw new TypeError(i("Blob.encode",this)+" requires (length "+te+") Uint8Array as src");if(Y+te>G.length)throw new RangeError("encoding overruns Uint8Array");const ae=n(j);return n(G).write(ae.toString("hex"),Y,te,"hex"),this.length instanceof o&&this.length.encode(te,G,Y),te}}De.Blob=H;class D extends r{constructor(j){super(-1,j)}getSpan(j,G=0){e(j);let Y=G;for(;Y<j.length&&j[Y]!==0;)Y+=1;return 1+Y-G}decode(j,G=0){const Y=this.getSpan(j,G);return n(j).slice(G,G+Y-1).toString("utf-8")}
532encode(j,G,Y=0){typeof j!="string"&&(j=String(j));const te=t.Buffer.from(j,"utf8"),ae=te.length;if(Y+ae>G.length)throw new RangeError("encoding overruns Buffer");const oe=n(G);return te.copy(oe,Y),oe[Y+ae]=0,ae+1}}De.CString=D;class V extends r{constructor(j,G){if(typeof j=="string"&&G===void 0&&(G=j,j=void 0),j===void 0)j=-1;else if(!Number.isInteger(j))throw new TypeError("maxSpan must be an integer");super(-1,G),this.maxSpan=j}getSpan(j,G=0){return e(j),j.length-G}decode(j,G=0){const Y=this.getSpan(j,G);if(0<=this.maxSpan&&this.maxSpan<Y)throw new RangeError("text length exceeds maxSpan");return n(j).slice(G,G+Y).toString("utf-8")}encode(j,G,Y=0){typeof j!="string"&&(j=String(j));const te=t.Buffer.from(j,"utf8"),ae=te.length;if(0<=this.maxSpan&&this.maxSpan<ae)throw new RangeError("text length exceeds maxSpan");if(Y+ae>G.length)throw new RangeError("encoding overruns Buffer");return te.copy(n(G),Y),ae}}De.UTF8=V;class B extends r{constructor(j,G){super(0,G),this.value=j}decode(j,G){return this.value}encode(j,G,Y){return 0}}return De.Constant=B,De.greedy=(P,j)=>new a(P,j),De.offset=(P,j,G)=>new c(P,j,G),De.u8=P=>new l(1,P),De.u16=P=>new l(2,P),De.u24=P=>new l(3,P),De.u32=P=>new l(4,P),De.u40=P=>new l(5,P),De.u48=P=>new l(6,P),De.nu64=P=>new v(P),De.u16be=P=>new u(2,P),De.u24be=P=>new u(3,P),De.u32be=P=>new u(4,P),De.u40be=P=>new u(5,P),De.u48be=P=>new u(6,P),De.nu64be=P=>new b(P),De.s8=P=>new d(1,P),De.s16=P=>new d(2,P),De.s24=P=>new d(3,P),De.s32=P=>new d(4,P),De.s40=P=>new d(5,P),De.s48=P=>new d(6,P),De.ns64=P=>new C(P),De.s16be=P=>new h(2,P),De.s24be=P=>new h(3,P),De.s32be=P=>new h(4,P),De.s40be=P=>new h(5,P),De.s48be=P=>new h(6,P),De.ns64be=P=>new x(P),De.f32=P=>new _(P),De.f32be=P=>new $(P),De.f64=P=>new I(P),De.f64be=P=>new R(P),De.struct=(P,j,G)=>new T(P,j,G),De.bits=(P,j,G)=>new k(P,j,G),De.seq=(P,j,G)=>new N(P,j,G),De.union=(P,j,G)=>new z(P,j,G),De.unionLayoutDiscriminator=(P,j)=>new U(P,j),De.blob=(P,j)=>new H(P,j),De.cstr=P=>new D(P),De.utf8=(P,j)=>new V(P,j),De.constant=(P,j)=>new B(P,j),De}var xe=cvt(),lvt=8078e3,uvt=8078001,dvt=8078004,hvt=8078005,fvt=8078006,pvt=8078011;function Kye(t){return Array.isArray(t)?"%5B"+t.map(Kye).join("%2C%20")+"%5D":typeof t=="bigint"?`${t}n`:encodeURIComponent(String(t!=null&&Object.getPrototypeOf(t)===null?{...t}:t))}function gvt([t,e]){return`${t}=${Kye(e)}`}function mvt(t){const e=Object.entries(t).map(gvt).join("&");return btoa(e)}function yvt(t,e={}){{let n=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(n+=` '${mvt(e)}'`),`${n}\``}}var ly=class extends Error{constructor(...[e,n]){let r,i;if(n){const{cause:o,...a}=n;o&&(i={cause:o}),Object.keys(a).length>0&&(r=a)}const s=yvt(e,r);super(s,i);Ft(this,"cause",this.cause);Ft(this,"context");this.context={__code:e,...r},this.name="SolanaError"}};function wvt(t,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(t)}function vvt(t){return Object.freeze({...t,encode:e=>{const n=new Uint8Array(wvt(e,t));return t.write(e,n,0),n}})}function bvt(t){return Object.freeze({...t,decode:(e,n=0)=>t.read(e,n)[0]})}function fm(t){return"fixedSize"in t&&typeof t.fixedSize=="number"}function xvt(t,e){if(fm(t)!==fm(e))throw new ly(dvt);if(fm(t)&&fm(e)&&t.fixedSize!==e.fixedSize)throw new ly(hvt,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!fm(t)&&!fm(e)&&t.maxSize!==e.maxSize)throw new ly(fvt,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}}function Evt(t,e,n=0){if(e.length-n<=0)throw new ly(lvt,{codecDescription:t})}function Cvt(t,e,n,r=0){const i=n.length-r;if(i<e)throw new ly(uvt,{bytesLength:i,codecDescription:t,expected:e})}function _vt(t,e,n,r){if(r<e||r>n)throw new ly(pvt,{codecDescription:t,max:n,min:e,value:r})}function Gye(t){return(t==null?void 0:t.endian)!==1}function Svt(t){return vvt({fixedSize:t.size,write(e,n,r){t.range&&_vt(t.name,t.range[0],t.range[1],e);const i=new ArrayBuffer(t.size);return t.set(new DataView(i),e,Gye(t.config)),n.set(new Uint8Array(i),r),r+t.size}})}function Avt(t){return bvt({fixedSize:t.size,read(e,n=0){Evt(t.name,e,n),
vendor: 12,983 bytes, line 532
532Cvt(t.name,t.size,e,n);const r=new DataView(kvt(e,n,t.size));return[t.get(r,Gye(t.config)),n+t.size]}})}function kvt(t,e,n){const r=t.byteOffset+(e??0),i=n??t.byteLength;return t.buffer.slice(r,r+i)}var $vt=(t={})=>Svt({config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,n,r)=>e.setBigUint64(0,BigInt(n),r),size:8}),Ivt=(t={})=>Avt({config:t,get:(e,n)=>e.getBigUint64(0,n),name:"u64",size:8}),Tvt=(t={})=>xvt($vt(t),Ivt(t));class Pvt extends TypeError{constructor(e,n){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}}function Rvt(t){return ax(t)&&typeof t[Symbol.iterator]=="function"}function ax(t){return typeof t=="object"&&t!=null}function hE(t){return ax(t)&&!Array.isArray(t)}function $l(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Mvt(t){const{done:e,value:n}=t.next();return e?void 0:n}function Ovt(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${$l(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*xte(t,e,n,r){Rvt(t)||(t=[t]);for(const i of t){const s=Ovt(i,e,n,r);s&&(yield s)}}function*IF(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i,mask:o};s&&(t=e.coercer(t,a));let c="valid";for(const l of e.validator(t,a))l.explanation=n.message,c="not_valid",yield[l,void 0];for(let[l,u,d]of e.entries(t,a)){const h=IF(u,d,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,u],coerce:s,mask:o,message:n.message});for(const f of h)f[0]?(c=f[0].refinement!=null?"not_refined":"not_valid",yield[f[0],void 0]):s&&(u=f[1],l===void 0?t=u:t instanceof Map?t.set(l,u):t instanceof Set?t.add(u):ax(t)&&(u!==void 0||l in t)&&(t[l]=u))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=n.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}let Wu=class{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const u=i(c,l);return xte(u,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const u=s(c,l);return xte(u,l,this,c)}:this.refiner=()=>[]}assert(e,n){return jvt(e,this,n)}create(e,n){return Ot(e,this,n)}is(e){return Zye(e,this)}mask(e,n){return Nvt(e,this,n)}validate(e,n={}){return cx(e,this,n)}};function jvt(t,e,n){const r=cx(t,e,{message:n});if(r[0])throw r[0]}function Ot(t,e,n){const r=cx(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function Nvt(t,e,n){const r=cx(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function Zye(t,e){return!cx(t,e)[0]}function cx(t,e,n={}){const r=IF(t,e,n),i=Mvt(r);return i[0]?[new Pvt(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function sg(t,e){return new Wu({type:t,schema:null,validator:e})}function Dvt(){return sg("any",()=>!0)}function Ut(t){return new Wu({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${$l(e)}`}})}function Fu(){return sg("boolean",t=>typeof t=="boolean")}function TF(t){return sg("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${$l(e)}`)}function ai(t){const e=$l(t),n=typeof t;return new Wu({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${$l(r)}`}})}function Lvt(){return sg("never",()=>!1)}function Wt(t){return new Wu({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function Me(){return sg("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${$l(t)}`)}function hn(t){return new Wu({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function Yye(t,e){return new Wu({type:"record",schema:null,*entries(n){if(ax(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return hE(n)||`Expected an object, but received: ${$l(n)}`},coercer(n){return hE(n)?{...n}:n}})}function $t(){return sg("string",t=>typeof t=="string"||`Expected a string, but received: ${$l(t)}`)}function PF(t){const e=Lvt();return new Wu({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${$l(n)}`},coercer(n){return Array.isArray(n)?n.slice():n}})}function dt(t){const e=Object.keys(t);return new Wu({type:"type",schema:t,*entries(n){if(ax(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return hE(n)||`Expected an object, but received: ${$l(n)}`},coercer(n){return hE(n)?{...n}:n}})}function Oo(t){const e=t.map(n=>n.type).join(" | ");return new Wu({type:"union",schema:null,coercer(n,r){for(const i of t){const[s,o]=i.validate(n,{coerce:!0,mask:r.mask});if(!s)return o}return n},validator(n,r){const i=[];for(const s of t){const[...o]=IF(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${$l(n)}`,...i]}})}function ew(){return sg("unknown",()=>!0)}function lx(t,e,n){return new Wu({...t,coercer:(r,i)=>Zye(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}var M6,Bvt=new Uint8Array(16);function Qye(){if(!M6&&(M6=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!M6))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return M6(Bvt)}const Fvt=/^(?:[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 mS(t){return typeof t=="string"&&Fvt.test(t)}var Ss=[];for(var lP=0;lP<256;++lP)Ss.push((lP+256).toString(16).substr(1));function yS(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Ss[t[e+0]]+Ss[t[e+1]]+Ss[t[e+2]]+Ss[t[e+3]]+"-"+Ss[t[e+4]]+Ss[t[e+5]]+"-"+Ss[t[e+6]]+Ss[t[e+7]]+"-"+Ss[t[e+8]]+Ss[t[e+9]]+"-"+Ss[t[e+10]]+Ss[t[e+11]]+Ss[t[e+12]]+Ss[t[e+13]]+Ss[t[e+14]]+Ss[t[e+15]]).toLowerCase();if(!mS(n))throw TypeError("Stringified UUID is invalid");return n}var Ete,uP,dP=0,hP=0;function Uvt(t,e,n){var r=e&&n||0,i=e||new Array(16);t=t||{};var s=t.node||Ete,o=t.clockseq!==void 0?t.clockseq:uP;if(s==null||o==null){var a=t.random||(t.rng||Qye)();s==null&&(s=Ete=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=uP=(a[6]<<8|a[7])&16383)}var c=t.msecs!==void 0?t.msecs:Date.now(),l=t.nsecs!==void 0?t.nsecs:hP+1,u=c-dP+(l-hP)/1e4;if(u<0&&t.clockseq===void 0&&(o=o+1&16383),(u<0||c>dP)&&t.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");dP=c,hP=l,uP=o,c+=122192928e5;var d=((c&268435455)*1e4+l)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;var h=c/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=h&255,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=o>>>8|128,i[r++]=o&255;for(var f=0;f<6;++f)i[r+f]=s[f];return e||yS(i)}function Xye(t){if(!mS(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}function zvt(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}var Wvt="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Hvt="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Jye(t,e,n){function r(i,s,o,a){if(typeof i=="string"&&(i=zvt(i)),typeof s=="string"&&(s=Xye(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+i.length);if(c.set(s),c.set(i,s.length),c=n(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,o){a=a||0;for(var l=0;l<16;++l)o[a+l]=c[l];return o}return yS(c)}try{r.name=t}catch{}return r.DNS=Wvt,r.URL=Hvt,r}function Vvt(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return qvt(Kvt(Gvt(t),t.length*8))}function qvt(t){for(var e=[],n=t.length*32,r="0123456789abcdef",i=0;i<n;i+=8){var s=t[i>>5]>>>i%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);e.push(o)}return e}function e2e(t){return(t+64>>>9<<4)+14+1}function Kvt(t,e){t[e>>5]|=128<<e%32,t[e2e(e)-1]=e;for(var n=1732584193,r=-271733879,i=-1732584194,s=271733878,o=0;o<t.length;o+=16){var a=n,c=r,l=i,u=s;n=no(n,r,i,s,t[o],7,-680876936),s=no(s,n,r,i,t[o+1],12,-389564586),i=no(i,s,n,r,t[o+2],17,606105819),r=no(r,i,s,n,t[o+3],22,-1044525330),n=no(n,r,i,s,t[o+4],7,-176418897),s=no(s,n,r,i,t[o+5],12,1200080426),i=no(i,s,n,r,t[o+6],17,-1473231341),r=no(r,i,s,n,t[o+7],22,-45705983),n=no(n,r,i,s,t[o+8],7,1770035416),s=no(s,n,r,i,t[o+9],12,-1958414417),i=no(i,s,n,r,t[o+10],17,-42063),r=no(r,i,s,n,t[o+11],22,-1990404162),n=no(n,r,i,s,t[o+12],7,1804603682),s=no(s,n,r,i,t[o+13],12,-40341101),i=no(i,s,n,r,t[o+14],17,-1502002290),r=no(r,i,s,n,t[o+15],22,1236535329),n=ro(n,r,i,s,t[o+1],5,-165796510),s=ro(s,n,r,i,t[o+6],9,-1069501632),i=ro(i,s,n,r,t[o+11],14,643717713),r=ro(r,i,s,n,t[o],20,-373897302),n=ro(n,r,i,s,t[o+5],5,-701558691),s=ro(s,n,r,i,t[o+10],9,38016083),i=ro(i,s,n,r,t[o+15],14,-660478335),r=ro(r,i,s,n,t[o+4],20,-405537848),n=ro(n,r,i,s,t[o+9],5,568446438),s=ro(s,n,r,i,t[o+14],9,-1019803690),i=ro(i,s,n,r,t[o+3],14,-187363961),r=ro(r,i,s,n,t[o+8],20,1163531501),n=ro(n,r,i,s,t[o+13],5,-1444681467),s=ro(s,n,r,i,t[o+2],9,-51403784),i=ro(i,s,n,r,t[o+7],14,1735328473),r=ro(r,i,s,n,t[o+12],20,-1926607734),n=io(n,r,i,s,t[o+5],4,-378558),s=io(s,n,r,i,t[o+8],11,-2022574463),i=io(i,s,n,r,t[o+11],16,1839030562),r=io(r,i,s,n,t[o+14],23,-35309556),n=io(n,r,i,s,t[o+1],4,-1530992060),s=io(s,n,r,i,t[o+4],11,1272893353),i=io(i,s,n,r,t[o+7],16,-155497632),r=io(r,i,s,n,t[o+10],23,-1094730640),n=io(n,r,i,s,t[o+13],4,681279174),s=io(s,n,r,i,t[o],11,-358537222),i=io(i,s,n,r,t[o+3],16,-722521979),r=io(r,i,s,n,t[o+6],23,76029189),n=io(n,r,i,s,t[o+9],4,-640364487),s=io(s,n,r,i,t[o+12],11,-421815835),i=io(i,s,n,r,t[o+15],16,530742520),r=io(r,i,s,n,t[o+2],23,-995338651),n=so(n,r,i,s,t[o],6,-198630844),s=so(s,n,r,i,t[o+7],10,1126891415),i=so(i,s,n,r,t[o+14],15,-1416354905),r=so(r,i,s,n,t[o+5],21,-57434055),n=so(n,r,i,s,t[o+12],6,1700485571),s=so(s,n,r,i,t[o+3],10,-1894986606),i=so(i,s,n,r,t[o+10],15,-1051523),r=so(r,i,s,n,t[o+1],21,-2054922799),n=so(n,r,i,s,t[o+8],6,1873313359),s=so(s,n,r,i,t[o+15],10,-30611744),i=so(i,s,n,r,t[o+6],15,-1560198380),r=so(r,i,s,n,t[o+13],21,1309151649),n=so(n,r,i,s,t[o+4],6,-145523070),s=so(s,n,r,i,t[o+11],10,-1120210379),i=so(i,s,n,r,t[o+2],15,718787259),r=so(r,i,s,n,t[o+9],21,-343485551),n=Gf(n,a),r=Gf(r,c),i=Gf(i,l),s=Gf(s,u)}return[n,r,i,s]}function Gvt(t){if(t.length===0)return[];for(var e=t.length*8,n=new Uint32Array(e2e(e)),r=0;r<e;r+=8)n[r>>5]|=(t[r/8]&255)<<r%32;return n}function Gf(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function Zvt(t,e){return t<<e|t>>>32-e}function wS(t,e,n,r,i,s){return Gf(Zvt(Gf(Gf(e,t),Gf(r,s)),i),n)}function no(t,e,n,r,i,s,o){return wS(e&n|~e&r,t,e,i,s,o)}function ro(t,e,n,r,i,s,o){return wS(e&r|n&~r,t,e,i,s,o)}function io(t,e,n,r,i,s,o){return wS(e^n^r,t,e,i,s,o)}function so(t,e,n,r,i,s,o){return wS(n^(e|~r),t,e,i,s,o)}var Yvt=Jye("v3",48,Vvt);function Qvt(t,e,n){t=t||{};var r=t.random||(t.rng||Qye)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return yS(r)}function Xvt(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function fP(t,e){return t<<e|t>>>32-e}function Jvt(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=[];for(var i=0;i<r.length;++i)t.push(r.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var s=t.length/4+2,o=Math.ceil(s/16),a=new Array(o),c=0;c<o;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=t[c*64+u*4]<<24|t[c*64+u*4+1]<<16|t[c*64+u*4+2]<<8|t[c*64+u*4+3];a[c]=l}a[o-1][14]=(t.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][
53214]),a[o-1][15]=(t.length-1)*8&4294967295;for(var d=0;d<o;++d){for(var h=new Uint32Array(80),f=0;f<16;++f)h[f]=a[d][f];for(var m=16;m<80;++m)h[m]=fP(h[m-3]^h[m-8]^h[m-14]^h[m-16],1);for(var y=n[0],v=n[1],b=n[2],C=n[3],x=n[4],_=0;_<80;++_){var $=Math.floor(_/20),I=fP(y,5)+Xvt($,v,b,C)+x+e[$]+h[_]>>>0;x=C,C=b,b=fP(v,30)>>>0,v=y,y=I}n[0]=n[0]+y>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+b>>>0,n[3]=n[3]+C>>>0,n[4]=n[4]+x>>>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]>>8&255,n[4]&255]}var ebt=Jye("v5",80,Jvt);const tbt="00000000-0000-0000-0000-000000000000";function nbt(t){if(!mS(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}const rbt=Object.freeze(Object.defineProperty({__proto__:null,NIL:tbt,parse:Xye,stringify:yS,v1:Uvt,v3:Yvt,v4:Qvt,v5:ebt,validate:mS,version:nbt},Symbol.toStringTag,{value:"Module"})),t2e=qE(rbt);var pP,Cte;function ibt(){if(Cte)return pP;Cte=1;const t=t2e.v4;return pP=function(n,r,i,s){if(typeof n!="string")throw new TypeError(n+" must be a string");s=s||{};const o=typeof s.version=="number"?s.version:2;if(o!==1&&o!==2)throw new TypeError(o+" must be 1 or 2");const a={method:n};if(o===2&&(a.jsonrpc="2.0"),r){if(typeof r!="object"&&!Array.isArray(r))throw new TypeError(r+" must be an object, array or omitted");a.params=r}if(typeof i>"u"){const c=typeof s.generator=="function"?s.generator:function(){return t()};a.id=c(a,s)}else o===2&&i===null?s.notificationIdNull&&(a.id=null):a.id=i;return a},pP}var gP,_te;function sbt(){if(_te)return gP;_te=1;const t=t2e.v4,e=ibt(),n=function(r,i){if(!(this instanceof n))return new n(r,i);i||(i={}),this.options={reviver:typeof i.reviver<"u"?i.reviver:null,replacer:typeof i.replacer<"u"?i.replacer:null,generator:typeof i.generator<"u"?i.generator:function(){return t()},version:typeof i.version<"u"?i.version:2,notificationIdNull:typeof i.notificationIdNull=="boolean"?i.notificationIdNull:!1},this.callServer=r};return gP=n,n.prototype.request=function(r,i,s,o){const a=this;let c=null;const l=Array.isArray(r)&&typeof i=="function";if(this.options.version===1&&l)throw new TypeError("JSON-RPC 1.0 does not support batching");if(l||!l&&r&&typeof r=="object"&&typeof i=="function")o=i,c=r;else{typeof s=="function"&&(o=s,s=void 0);const h=typeof o=="function";try{c=e(r,i,s,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(f){if(h)return o(f);throw f}if(!h)return c}let d;try{d=JSON.stringify(c,this.options.replacer)}catch(h){return o(h)}return this.callServer(d,function(h,f){a._parseResponse(h,f,o)}),c},n.prototype._parseResponse=function(r,i,s){if(r){s(r);return}if(!i)return s();let o;try{o=JSON.parse(i,this.options.reviver)}catch(a){return s(a)}if(s.length===3)if(Array.isArray(o)){const a=function(l){return typeof l.error<"u"},c=function(l){return!a(l)};return s(null,o.filter(a),o.filter(c))}else return s(null,o.error,o.result);s(null,o)},gP}var obt=sbt();const abt=ys(obt);var cbt=class extends wp{constructor(e,n,r){super();Ft(this,"socket");this.socket=new window.WebSocket(e,r),this.socket.onopen=()=>
vendor: 4,134 bytes, line 532
532this.emit("open"),this.socket.onmessage=i=>this.emit("message",i.data),this.socket.onerror=i=>this.emit("error",i),this.socket.onclose=i=>{this.emit("close",i.code,i.reason)}}send(e,n,r){const i=r||n;try{this.socket.send(e),i()}catch(s){i(s)}}close(e,n){this.socket.close(e,n)}addEventListener(e,n,r){this.socket.addEventListener(e,n,r)}};function lbt(t,e){return new cbt(t,e)}var ubt=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},dbt=class extends wp{constructor(e,n="ws://localhost:8080",{autoconnect:r=!0,reconnect:i=!0,reconnect_interval:s=1e3,max_reconnects:o=5,...a}={},c,l){super();Ft(this,"address");Ft(this,"rpc_id");Ft(this,"queue");Ft(this,"options");Ft(this,"autoconnect");Ft(this,"ready");Ft(this,"reconnect");Ft(this,"reconnect_timer_id");Ft(this,"reconnect_interval");Ft(this,"max_reconnects");Ft(this,"rest_options");Ft(this,"current_reconnects");Ft(this,"generate_request_id");Ft(this,"socket");Ft(this,"webSocketFactory");Ft(this,"dataPack");this.webSocketFactory=e,this.queue={},this.rpc_id=0,this.address=n,this.autoconnect=r,this.ready=!1,this.reconnect=i,this.reconnect_timer_id=void 0,this.reconnect_interval=s,this.max_reconnects=o,this.rest_options=a,this.current_reconnects=0,this.generate_request_id=c||(()=>typeof this.rpc_id=="number"?++this.rpc_id:Number(this.rpc_id)+1),l?this.dataPack=l:this.dataPack=new ubt,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,n,r,i){return!i&&typeof r=="object"&&(i=r,r=null),new Promise((s,o)=>{if(!this.ready)return o(new Error("socket not ready"));const a=this.generate_request_id(e,n),c={jsonrpc:"2.0",method:e,params:n||void 0,id:a};this.socket.send(this.dataPack.encode(c),i,l=>{if(l)return o(l);this.queue[a]={promise:[s,o]},r&&(this.queue[a].timeout=setTimeout(()=>{delete this.queue[a],o(new Error("reply timeout"))},r))})})}async login(e){const n=await this.call("rpc.login",e);if(!n)throw new Error("authentication failed");return n}async listMethods(){return await this.call("__listMethods")}notify(e,n){return new Promise((r,i)=>{if(!this.ready)return i(new Error("socket not ready"));const s={jsonrpc:"2.0",method:e,params:n};this.socket.send(this.dataPack.encode(s),o=>{if(o)return i(o);r()})})}async subscribe(e){typeof e=="string"&&(e=[e]);const n=await this.call("rpc.on",e);if(typeof e=="string"&&n[e]!=="ok")throw new Error("Failed subscribing to an event '"+e+"' with: "+n[e]);return n}async unsubscribe(e){typeof e=="string"&&(e=[e]);const n=await this.call("rpc.off",e);if(typeof e=="string"&&n[e]!=="ok")throw new Error("Failed unsubscribing from an event with: "+n);return n}close(e,n){this.socket&&this.socket.close(e||1e3,n)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}getCurrentReconnects(){return this.current_reconnects}getMaxReconnects(){return this.max_reconnects}isReconnecting(){return this.reconnect_timer_id!==void 0}willReconnect(){return this.reconnect&&(this.max_reconnects===0||this.current_reconnects<this.max_reconnects)}_connect(e,n){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,n),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:r})=>{r instanceof ArrayBuffer&&(r=Dn.Buffer.from(r).toString());try{r=this.dataPack.decode(r)}catch{return}if(r.notification&&this.listeners(r.notification).length){if(!Object.keys(r.params).length)return this.emit(r.notification);const i=[r.notification];if(r.params.constructor===Object)i.push(r.params);else for(let s=0;s<r.params.length;s++)i.push(r.params[s]);return Promise.resolve().then(()=>{this.emit.apply(this,i)})}if(!this.queue[r.id])return r.method?Promise.resolve().then(()=>
532{this.emit(r.method,r==null?void 0:r.params)}):void 0;"error"in r=="result"in r&&this.queue[r.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[r.id].timeout&&clearTimeout(this.queue[r.id].timeout),r.error?this.queue[r.id].promise[1](r.error):this.queue[r.id].promise[0](r.result),delete this.queue[r.id]}),this.socket.addEventListener("error",r=>this.emit("error",r)),this.socket.addEventListener("close",({code:r,reason:i})=>{this.ready&&setTimeout(()=>this.emit("close",r,i),0),this.ready=!1,this.socket=void 0,r!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)?this.reconnect_timer_id=setTimeout(()=>this._connect(e,n),this.reconnect_interval):this.reconnect&&this.max_reconnects>0&&this.current_reconnects>=this.max_reconnects&&setTimeout(()=>this.emit("max_reconnects_reached",r,i),1))})}};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ste=(t,e)=>(t+(t>=0?e:-e)/n2e)/e;function hbt(t,e,n){const[[r,i],[s,o]]=e,a=Ste(o*t,n),c=Ste(-i*t,n);let l=t-a*r-c*s,u=-a*i-c*o;const d=l<Fd,h=u<Fd;d&&(l=-l),h&&(u=-u);const f=y5(Math.ceil(yae(n)/2))+uy;if(l<Fd||l>=f||u<Fd||u>=f)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:d,k1:l,k2neg:h,k2:u}}function tN(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function mP(t,e){const n={};for(let r of Object.keys(e))n[r]=t[r]===void 0?e[r]:t[r];return g1(n.lowS,"lowS"),g1(n.prehash,"prehash"),n.format!==void 0&&tN(n.format),n}class fbt extends Error{constructor(e=""){super(e)}}const Sd={Err:fbt,_tlv:{encode:(t,e)=>{const{Err:n}=Sd;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=M4(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?M4(i.length/2|128):"";return M4(t)+s+i+e},decode(t,e){const{Err:n}=Sd;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=e.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)o=o<<8|u;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(t){const{Err:e}=Sd;if(t<Fd)throw new e("integer: negative integers are not allowed");let n=M4(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=Sd;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return _C(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=Sd,i=mi("signature",t),{v:s,l:o}=r.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:l,l:u}=r.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(t){const{_tlv:e,_int:n}=Sd,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),s=r+i;return e.encode(48,s)}},Fd=BigInt(0),uy=BigInt(1),n2e=BigInt(2),O6=BigInt(3),pbt=BigInt(4);function Dm(t,e){const{BYTES:n}=t;let r;if(typeof e=="bigint")r=e;else{let i=mi("private key",e);try{r=t.fromBytes(i)}catch{throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function gbt(t,e={}){const n=Hye("weierstrass",t,e),{Fp:r,Fn:i}=n;let s=n.CURVE;const{h:o,n:a}=s;w5(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});
vendor: 15,253 bytes, line 532
532const{endo:c}=e;if(c&&(!r.is0(s.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=i2e(r,i);function u(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(z,L,S){const{x:k,y:M}=L.toAffine(),W=r.toBytes(k);if(g1(S,"isCompressed"),S){u();const H=!r.isOdd(M);return yu(r2e(H),W)}else return yu(Uint8Array.of(4),W,r.toBytes(M))}function h(z){hl(z,void 0,"Point");const{publicKey:L,publicKeyUncompressed:S}=l,k=z.length,M=z[0],W=z.subarray(1);if(k===L&&(M===2||M===3)){const H=r.fromBytes(W);if(!r.isValid(H))throw new Error("bad point: is not on curve, wrong x");const D=y(H);let V;try{V=r.sqrt(D)}catch(j){const G=j instanceof Error?": "+j.message:"";throw new Error("bad point: is not on curve, sqrt error"+G)}u();const B=r.isOdd(V);return(M&1)===1!==B&&(V=r.neg(V)),{x:H,y:V}}else if(k===S&&M===4){const H=r.BYTES,D=r.fromBytes(W.subarray(0,H)),V=r.fromBytes(W.subarray(H,H*2));if(!v(D,V))throw new Error("bad point: is not on curve");return{x:D,y:V}}else throw new Error(`bad point: got length ${k}, expected compressed=${L} or uncompressed=${S}`)}const f=e.toBytes||d,m=e.fromBytes||h;function y(z){const L=r.sqr(z),S=r.mul(L,z);return r.add(r.add(S,r.mul(z,s.a)),s.b)}function v(z,L){const S=r.sqr(L),k=y(z);return r.eql(S,k)}if(!v(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const b=r.mul(r.pow(s.a,O6),pbt),C=r.mul(r.sqr(s.b),BigInt(27));if(r.is0(r.add(b,C)))throw new Error("bad curve params: a or b");function x(z,L,S=!1){if(!r.isValid(L)||S&&r.is0(L))throw new Error(`bad point coordinate ${z}`);return L}function _(z){if(!(z instanceof T))throw new Error("ProjectivePoint expected")}function $(z){if(!c||!c.basises)throw new Error("no endo");return hbt(z,c.basises,i.ORDER)}const I=Q7((z,L)=>{const{X:S,Y:k,Z:M}=z;if(r.eql(M,r.ONE))return{x:S,y:k};const W=z.is0();L==null&&(L=W?r.ONE:r.inv(M));const H=r.mul(S,L),D=r.mul(k,L),V=r.mul(M,L);if(W)return{x:r.ZERO,y:r.ZERO};if(!r.eql(V,r.ONE))throw new Error("invZ was invalid");return{x:H,y:D}}),R=Q7(z=>{if(z.is0()){if(e.allowInfinityPoint&&!r.is0(z.Y))return;throw new Error("bad point: ZERO")}const{x:L,y:S}=z.toAffine();if(!r.isValid(L)||!r.isValid(S))throw new Error("bad point: x or y not field elements");if(!v(L,S))throw new Error("bad point: equation left != right");if(!z.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function N(z,L,S,k,M){return S=new T(r.mul(S.X,z),S.Y,S.Z),L=aE(k,L),S=aE(M,S),L.add(S)}class T{constructor(L,S,k){this.X=x("x",L),this.Y=x("y",S,!0),this.Z=x("z",k),Object.freeze(this)}static CURVE(){return s}static fromAffine(L){const{x:S,y:k}=L||{};if(!L||!r.isValid(S)||!r.isValid(k))throw new Error("invalid affine point");if(L instanceof T)throw new Error("projective point not allowed");return r.is0(S)&&r.is0(k)?T.ZERO:new T(S,k,r.ONE)}static fromBytes(L){const S=T.fromAffine(m(hl(L,void 0,"point")));return S.assertValidity(),S}static fromHex(L){return T.fromBytes(mi("pointHex",L))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(L=8,S=!0){return U.createCache(this,L),S||this.multiply(O6),this}assertValidity(){R(this)}hasEvenY(){const{y:L}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(L)}equals(L){_(L);const{X:S,Y:k,Z:M}=this,{X:W,Y:H,Z:D}=L,V=r.eql(r.mul(S,D),r.mul(W,M)),B=r.eql(r.mul(k,D),r.mul(H,M));return V&&B}negate(){return new T(this.X,r.neg(this.Y),this.Z)}double(){const{a:L,b:S}=s,k=r.mul(S,O6),{X:M,Y:W,Z:H}=this;let D=r.ZERO,V=r.ZERO,B=r.ZERO,P=r.mul(M,M),j=r.mul(W,W),G=r.mul(H,H),Y=r.mul(M,W);return Y=r.add(Y,Y),B=r.mul(M,H),B=r.add(B,B),D=r.mul(L,B),V=r.mul(k,G),V=r.add(D,V),D=r.sub(j,V),V=r.add(j,V),V=r.mul(D,V),D=r.mul(Y,D),B=r.mul(k,B),G=r.mul(L,G),Y=r.sub(P,G),Y=r.mul(L,Y),Y=r.add(Y,B),B=r.add(P,P),P=r.add(B,P),P=r.add(P,G),P=r.mul(P,Y),V=r.add(V,P),G=r.mul(W,H),G=r.add(G,G),P=r.mul(G,Y),D=r.sub(D,P),B=r.mul(G,j),B=r.add(B,B),B=r.add(B,B),new T(D,V,B)}add(L){_(L);const{X:S,Y:k,Z:M}=this,{X:W,Y:H,Z:D}=L;let V=r.ZERO,B=r.ZERO,P=r.ZERO;const j=s.a,G=r.mul(s.b,O6);let Y=r.mul(S,W),te=r.mul(k,H),ae=r.mul(M,D),oe=r.add(S,k),de=r.add(W,H);oe=r.mul(oe,de),de=r.add(Y,te),oe=r.sub(oe,de),de=r.add(S,M);let ke=r.add(W,D);return de=r.mul(de,ke),ke=r.add(Y,ae),de=r.sub(de,ke),ke=r.add(k,M),V=r.add(H,D),ke=r.mul(ke,V),V=r.add(te,ae),ke=r.sub(ke,V),P=r.mul(j,de),V=r.mul(G,ae),P=r.add(V,P),V=r.sub(te,P),P=r.add(te,P),B=r.mul(V,P),te=r.add(Y,Y),te=r.add(te,Y),ae=r.mul(j,ae),de=r.mul(G,de),te=r.add(te,ae),ae=r.sub(Y,ae),ae=r.mul(j,ae),de=r.add(de,ae),Y=r.mul(te,de),B=r.add(B,Y),Y=r.mul(ke,de),V=r.mul(oe,V),V=r.sub(V,Y),Y=r.mul(oe,te),P=r.mul(ke,P),P=r.add(P,Y),new T(V,B,P)}subtract(L){return this.add(L.negate())}is0(){return this.equals(T.ZERO)}multiply(L){const{endo:S}=e;if(!i.isValidNot0(L))throw new Error("invalid scalar: out of range");let k,M;const W=H=>U.cached(this,H,D=>$0(T,D));if(S){const{k1neg:H,k1:D,k2neg:V,k2:B}=$(L),{p:P,f:j}=W(D),{p:G,f:Y}=W(B);M=j.add(Y),k=N(S.beta,P,G,H,V)}else{const{p:H,f:D}=W(L);k=H,M=D}return $0(T,[k,M])[0]}multiplyUnsafe(L){const{endo:S}=e,k=this;if(!i.isValid(L))throw new Error("invalid scalar: out of range");if(L===Fd||k.is0())return T.ZERO;if(L===uy)return k;if(U.hasCache(this))return this.multiply(L);if(S){const{k1neg:M,k1:W,k2neg:H,k2:D}=$(L),{p1:V,p2:B}=Nwt(T,k,W,D);return N(S.beta,V,B,M,H)}else return U.unsafe(k,L)}multiplyAndAddUnsafe(L,S,k){const M=this.multiplyUnsafe(S).add(L.multiplyUnsafe(k));return M.is0()?void 0:M}toAffine(L){return I(this,L)}isTorsionFree(){const{isTorsionFree:L}=e;return o===uy?!0:L?L(T,this):U.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:L}=e;return o===uy?this:L?L(T,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(L=!0){return g1(L,"isCompressed"),this.assertValidity(),f(T,this,L)}toHex(L=!0){return Jf(this.toBytes(L))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(L=!0){return this.toBytes(L)}_setWindowSize(L){this.precompute(L)}static normalizeZ(L){return $0(T,L)}static msm(L,S){return Wye(T,i,L,S)}static fromPrivateKey(L){return T.BASE.multiply(Dm(i,L))}}T.BASE=new T(s.Gx,s.Gy,r.ONE),T.ZERO=new T(r.ZERO,r.ONE,r.ZERO),T.Fp=r,T.Fn=i;const O=i.BITS,U=new zye(T,e.endo?Math.ceil(O/2):O);return T.BASE.precompute(8),T}function r2e(t){return Uint8Array.of(t?2:3)}function i2e(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function mbt(t,e={}){const{Fn:n}=t,r=e.randomBytes||RD,i=Object.assign(i2e(t.Fp,n),{seed:Bye(n.ORDER)});function s(f){try{return!!Dm(n,f)}catch{return!1}}function o(f,m){const{publicKey:y,publicKeyUncompressed:v}=i;try{const b=f.length;return m===!0&&b!==y||m===!1&&b!==v?!1:!!t.fromBytes(f)}catch{return!1}}function a(f=r(i.seed)){return Mwt(hl(f,i.seed,"seed"),n.ORDER)}function c(f,m=!0){return t.BASE.multiply(Dm(n,f)).toBytes(m)}function l(f){const m=a(f);return{secretKey:m,publicKey:c(m)}}function u(f){if(typeof f=="bigint")return!1;if(f instanceof t)return!0;const{secretKey:m,publicKey:y,publicKeyUncompressed:v}=i;if(n.allowedLengths||m===y)return;const b=mi("key",f).length;return b===y||b===v}function d(f,m,y=!0){if(u(f)===!0)throw new Error("first arg must be private key");if(u(m)===!1)throw new Error("second arg must be public key");const v=Dm(n,f);return t.fromHex(m).multiply(v).toBytes(y)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:t,utils:{isValidSecretKey:s,isValidPublicKey:o,randomSecretKey:a,isValidPrivateKey:s,randomPrivateKey:a,normPrivateKeyToScalar:f=>Dm(n,f),precompute(f=8,m=t.BASE){return m.precompute(f,!1)}},lengths:i})}function ybt(t,e,n={}){hae(e),w5(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||RD,i=n.hmac||((S,...k)=>$le(e,S,yu(...k))),{Fp:s,Fn:o}=t,{ORDER:a,BITS:c}=o,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:h,lengths:f}=mbt(t,n),m={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},y="compact";function v(S){const k=a>>uy;return S>k}function b(S,k){if(!o.isValidNot0(k))throw new Error(`invalid signature ${S}: out of range 1..Point.Fn.ORDER`);return k}function C(S,k){tN(k);const M=f.signature,W=k==="compact"?M:k==="recovered"?M+1:void 0;return hl(S,W,`${k} signature`)}class x{constructor(k,M,W){this.r=b("r",k),this.s=b("s",M),W!=null&&(this.recovery=W),Object.freeze(this)}static fromBytes(k,M=y){C(k,M);let W;if(M==="der"){const{r:B,s:P}=Sd.toSig(hl(k));return new x(B,P)}M==="recovered"&&(W=k[0],M="compact",k=k.subarray(1));const H=o.BYTES,D=k.subarray(0,H),V=k.subarray(H,H*2);return new x(o.fromBytes(D),o.fromBytes(V),W)}static fromHex(k,M){return this.fromBytes(Y7(k),M)}addRecoveryBit(k){return new x(this.r,this.s,k)}recoverPublicKey(k){const M=s.ORDER,{r:W,s:H,recovery:D}=this;if(D==null||![0,1,2,3].includes(D))throw new Error("recovery id invalid");if(a*n2e<M&&D>1)throw new Error("recovery id is ambiguous for h>1 curve");const B=D===2||D===3?W+a:W;if(!s.isValid(B))throw new Error("recovery id 2 or 3 invalid");const P=s.toBytes(B),j=t.fromBytes(yu(r2e((D&1)===0),P)),G=o.inv(B),Y=$(mi("msgHash",k)),te=o.create(-Y*G),ae=o.create(H*G),oe=t.BASE.multiplyUnsafe(te).add(j.multiplyUnsafe(ae));if(oe.is0())throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return v(this.s)}toBytes(k=y){if(tN(k),k==="der")return Y7(Sd.hexFromSig(this));const M=o.toBytes(this.r),W=o.toBytes(this.s);if(k==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return yu(Uint8Array.of(this.recovery),M,W)}return yu(M,W)}toHex(k){return Jf(this.toBytes(k))}assertValidity(){}static fromCompact(k){return x.fromBytes(mi("sig",k),"compact")}static fromDER(k){return x.fromBytes(mi("sig",k),"der")}normalizeS(){return this.hasHighS()?new x(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Jf(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Jf(this.toBytes("compact"))}}const _=n.bits2int||function(k){if(k.length>8192)throw new Error("input is too large");const M=_C(k),W=k.length*8-c;return W>0?M>>BigInt(W):M},$=n.bits2int_modN||function(k){return o.create(_(k))},I=y5(c);function R(S){return NR("num < 2^"+c,S,Fd,I),o.toBytes(S)}function N(S,k){return hl(S,void 0,"message"),k?hl(e(S),void 0,"prehashed message"):S}function T(S,k,M){if(["recovered","canonical"].some(te=>te in M))throw new Error("sign() legacy options not supported");const{lowS:W,prehash:H,extraEntropy:D}=mP(M,m);S=N(S,H);const V=$(S),B=Dm(o,k),P=[R(B),R(V)];if(D!=null&&D!==!1){const te=D===!0?r(f.secretKey):D;P.push(mi("extraEntropy",te))}const j=yu(...P),G=V;function Y(te){const ae=_(te);if(!o.isValidNot0(ae))return;const oe=o.inv(ae),de=t.BASE.multiply(ae).toAffine(),ke=o.create(de.x);if(ke===Fd)return;const Be=o.create(oe*o.create(G+ke*B));if(Be===Fd)return;let $e=(de.x===ke?0:2)|Number(de.y&uy),He=Be;return W&&v(Be)&&(He=o.neg(Be),$e^=1),new x(ke,He,$e)}return{seed:j,k2sig:Y}}function O(S,k,M={}){S=mi("message",S);const{seed:W,k2sig:H}=T(S,k,M);return uSe(e.outputLen,o.BYTES,i)(W,H)}function U(S){let k;const M=typeof S=="string"||m5(S),W=!M&&S!==null&&typeof S=="object"&&typeof S.r=="bigint"&&typeof S.s=="bigint";if(!M&&!W)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(W)k=new x(S.r,S.s);else if(M){try{k=x.fromBytes(mi("sig",S),"der")}catch(H){if(!(H instanceof Sd.Err))throw H}if(!k)try{k=x.fromBytes(mi("sig",S),"compact")}catch{return!1}}return k||!1}function z(S,k,M,W={}){const{lowS:H,prehash:D,format:V}=mP(W,m);if(M=mi("publicKey",M),k=N(mi("message",k),D),"strict"in W)throw new Error("options.strict was renamed to lowS");const B=V===void 0?U(S):x.fromBytes(mi("sig",S),V);if(B===!1)return!1;try{const P=t.fromBytes(M);if(H&&B.hasHighS())return!1;const{r:j,s:G}=B,Y=$(k),te=o.inv(G),ae=o.create(Y*te),oe=o.create(j*te),de=t.BASE.multiplyUnsafe(ae).add(P.multiplyUnsafe(oe));return de.is0()?!1:o.create(de.x)===j}catch{return!1}}function L(S,k,M={}){const{prehash:W}=mP(M,m);return k=N(k,W),x.fromBytes(S,"recovered").recoverPublicKey(k).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:h,lengths:f,Point:t,sign:O,verify:z,recoverPublicKey:L,Signature:x,hash:e})}function wbt(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(o=>Math.ceil(o/2)))):void 0;const i=ig(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),s={Fp:n,Fn:i,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:s}}function vbt(t){const{CURVE:e,curveOpts:n}=wbt(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}function bbt(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,Dye(n.Fn.ORDER,n.Fn.BITS))})}function xbt(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:i}=vbt(t),s=gbt(e,n),o=ybt(s,r,i);return bbt(t,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ebt(t,e){const n=r=>xbt({...t,hash:r});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const RF={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Cbt={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Ate=BigInt(2);function _bt(t){const e=RF.p,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,d=gi(u,n,e)*u%e,h=gi(d,n,e)*u%e,f=gi(h,Ate,e)*l%e,m=gi(f,i,e)*f%e,y=gi(m,s,e)*m%e,v=gi(y,a,e)*y%e,b=gi(v,c,e)*v%e,C=gi(b,a,e)*y%e,x=gi(C,n,e)*u%e,_=gi(x,o,e)*m%e,$=gi(_,r,e)*l%e,I=gi($,Ate,e);if(!nN.eql(nN.sqr(I),t))throw new Error("Cannot find square root");return I}const nN=ig(RF.p,{sqrt:_bt}),Sbt=Ebt({...RF,Fp:nN,lowS:!0,endo:Cbt},Hae);ox.utils.randomPrivateKey;ox.getPublicKey;function kte(t){try{return ox.ExtendedPoint.fromHex(t),!0}catch{return!1}}const s2e=(t,e)=>ox.sign(t,e.slice(0,32)),Abt=ox.verify,g2=t=>Dn.Buffer.isBuffer(t)?t:t instanceof Uint8Array?Dn.Buffer.from(t.buffer,t.byteOffset,t.byteLength):Dn.Buffer.from(t);class kbt{constructor(e){Object.assign(this,e)}encode(){return Dn.Buffer.from(cP.serialize(v7,this))}static decode(e){return cP.deserialize(v7,this,e)}
532static decodeUnchecked(e){return cP.deserializeUnchecked(v7,this,e)}}const v7=new Map;var o2e;const $bt=32,rp=32;function Ibt(t){return t._bn!==void 0}let $te=1;class bn extends kbt{constructor(e){if(super({}),this._bn=void 0,Ibt(e))this._bn=e._bn;else{if(typeof e=="string"){const n=Os.decode(e);if(n.length!=rp)throw new Error("Invalid public key input");this._bn=new Qq(n)}else this._bn=new Qq(e);if(this._bn.byteLength()>rp)throw new Error("Invalid public key input")}}static unique(){const e=new bn($te);return $te+=1,new bn(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return Os.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(Dn.Buffer);if(e.length===rp)return e;const n=Dn.Buffer.alloc(32);return e.copy(n,32-e.length),n}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,n,r){const i=Dn.Buffer.concat([e.toBuffer(),Dn.Buffer.from(n),r.toBuffer()]),s=WR(i);return new bn(s)}static createProgramAddressSync(e,n){let r=Dn.Buffer.alloc(0);e.forEach(function(s){if(s.length>$bt)throw new TypeError("Max seed length exceeded");r=Dn.Buffer.concat([r,g2(s)])}),r=Dn.Buffer.concat([r,n.toBuffer(),Dn.Buffer.from("ProgramDerivedAddress")]);const i=WR(r);if(kte(i))throw new Error("Invalid seeds, address must fall off the curve");return new bn(i)}static async createProgramAddress(e,n){return this.createProgramAddressSync(e,n)}static findProgramAddressSync(e,n){let r=255,i;for(;r!=0;){try{const s=e.concat(Dn.Buffer.from([r]));i=this.createProgramAddressSync(s,n)}catch(s){if(s instanceof TypeError)throw s;r--;continue}return[i,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,n){return this.findProgramAddressSync(e,n)}static isOnCurve(e){const n=new bn(e);return kte(n.toBytes())}}o2e=bn;bn.default=new o2e("11111111111111111111111111111111");v7.set(bn,{kind:"struct",fields:[["_bn","u256"]]});new bn("BPFLoader1111111111111111111111111111111111");const dy=1232,MF=127,fE=64;class a2e extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(a2e.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class c2e extends Error{constructor(e,n){super(`Transaction was not confirmed in ${n.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(c2e.prototype,"name",{value:"TransactionExpiredTimeoutError"});class tb extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(tb.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class pE{constructor(e,n){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=n}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const n of this.keySegments()){if(e<n.length)return n[e];e-=n.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((s,o)=>{r.set(s.toBase58(),o)});const i=s=>{const o=r.get(s.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return e.map(s=>({programIdIndex:i(s.programId),accountKeyIndexes:s.keys.map(o=>i(o.pubkey)),data:s.data}))}}const zn=(t="publicKey")=>xe.blob(32,t),Tbt=(t="signature")=>xe.blob(64,t),Lm=(t="string")=>{const e=xe.struct([xe.u32("length"),xe.u32("lengthPadding"),xe.blob(xe.offset(xe.u32(),-8),"chars")],t),n=e.decode.bind(e),r=e.encode.bind(e),i=e;return i.decode=(s,o)=>n(s,o).chars.toString(),i.encode=(s,o,a)=>{const c={chars:Dn.Buffer.from(s,"utf8")};return r(c,o,a)},i.alloc=s=>xe.u32().span+xe.u32().span+Dn.Buffer.from(s,"utf8").length,i},Pbt=(t="authorized")=>xe.struct([zn("staker"),zn("withdrawer")],t),Rbt=(t="lockup")=>xe.struct([xe.ns64("unixTimestamp"),xe.ns64("epoch"),zn("custodian")],t),Mbt=(t="voteInit")=>xe.struct([zn("nodePubkey"),zn("authorizedVoter"),zn("authorizedWithdrawer"),xe.u8("commission")],t),Obt=(t="voteAuthorizeWithSeedArgs")=>xe.struct([xe.u32("voteAuthorizationType"),zn("currentAuthorityDerivedKeyOwnerPubkey"),Lm("currentAuthorityDerivedKeySeed"),zn("newAuthorized")],t);function Pa(t){let e=0,n=0;for(;;){let r=t.shift();if(e|=(r&127)<<n*7,n+=1,(r&128)===0)break}return e}function Ra(t,e){let n=e;for(;;){let r=n&127;if(n>>=7,n==0){t.push(r);break}else r|=128,t.push(r)}}function Yr(t,e){if(!t)throw new Error(e||"Assertion failed")}class vS{constructor(e,n){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=n}static compile(e,n){const r=new Map,i=o=>{const a=o.toBase58();let c=r.get(a);return c===void 0&&(c={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,c)),c},s=i(n);s.isSigner=!0,s.isWritable=!0;for(const o of e){i(o.programId).isInvoked=!0;for(const a of o.keys){const c=i(a.pubkey);c.isSigner||(c.isSigner=a.isSigner),c.isWritable||(c.isWritable=a.isWritable)}}return new vS(n,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Yr(e.length<=256,"Max static account keys length exceeded");const n=e.filter(([,c])=>c.isSigner&&c.isWritable),r=e.filter(([,c])=>c.isSigner&&!c.isWritable),i=e.filter(([,c])=>!c.isSigner&&c.isWritable),s=e.filter(([,c])=>!c.isSigner&&!c.isWritable),o={numRequiredSignatures:n.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:s.length};{Yr(n.length>0,"Expected at least one writable signer key");const[c]=n[0];Yr(c===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...n.map(([c])=>new bn(c)),...r.map(([c])=>new bn(c)),...i.map(([c])=>new bn(c)),...s.map(([c])=>new bn(c))];return[o,a]}extractTableLookup(e){const[n,r]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[i,s]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(n.length===0&&i.length===0))return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:i},{writable:r,readonly:s}]}drainKeysFoundInLookupTable(e,n){const r=new Array,i=new Array;for(const[s,o]of this.keyMetaMap.entries())if(n(o)){const a=new bn(s),c=e.f
532indIndex(l=>l.equals(a));c>=0&&(Yr(c<256,"Max lookup table index exceeded"),r.push(c),i.push(a),this.keyMetaMap.delete(s))}return[r,i]}}const l2e="Reached end of buffer unexpectedly";function Md(t){if(t.length===0)throw new Error(l2e);return t.shift()}function Ma(t,...e){const[n]=e;if(e.length===2?n+(e[1]??0)>t.length:n>=t.length)throw new Error(l2e);return t.splice(...e)}class ph{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(n=>new bn(n)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.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(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Os.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new pE(this.staticAccountKeys)}static compile(e){const n=vS.compile(e.instructions,e.payerKey),[r,i]=n.getMessageComponents(),o=new pE(i).compileInstructions(e.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:Os.encode(a.data)}));return new ph({header:r,accountKeys:i,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const r=e-n,s=this.accountKeys.length-n-this.header.numReadonlyUnsignedAccounts;return r<s}else{const r=n-this.header.numReadonlySignedAccounts;return e<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,n)=>!this.isProgramId(n))}serialize(){const e=this.accountKeys.length;let n=[];Ra(n,e);const r=this.instructions.map(d=>{const{accounts:h,programIdIndex:f}=d,m=Array.from(Os.decode(d.data));let y=[];Ra(y,h.length);let v=[];return Ra(v,m.length),{programIdIndex:f,keyIndicesCount:Dn.Buffer.from(y),keyIndices:h,dataLength:Dn.Buffer.from(v),data:m}});let i=[];Ra(i,r.length);let s=Dn.Buffer.alloc(dy);Dn.Buffer.from(i).copy(s);let o=i.length;r.forEach(d=>{const f=xe.struct([xe.u8("programIdIndex"),xe.blob(d.keyIndicesCount.length,"keyIndicesCount"),xe.seq(xe.u8("keyIndex"),d.keyIndices.length,"keyIndices"),xe.blob(d.dataLength.length,"dataLength"),xe.seq(xe.u8("userdatum"),d.data.length,"data")]).encode(d,s,o);o+=f}),s=s.slice(0,o);const a=xe.struct([xe.blob(1,"numRequiredSignatures"),xe.blob(1,"numReadonlySignedAccounts"),xe.blob(1,"numReadonlyUnsignedAccounts"),xe.blob(n.length,"keyCount"),xe.seq(zn("key"),e,"keys"),zn("recentBlockhash")]),c={numRequiredSignatures:Dn.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Dn.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Dn.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Dn.Buffer.from(n),keys:this.accountKeys.map(d=>g2(d.toBytes())),recentBlockhash:Os.decode(this.recentBlockhash)};let l=Dn.Buffer.alloc(2048);const u=a.encode(c,l);return s.copy(l,u),l.slice(0,u+s.length)}static from(e){let n=[...e];const r=Md(n);if(r!==(r&MF))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=Md(n),s=Md(n),o=Pa(n);let a=[];for(let h=0;h<o;h++){const f=Ma(n,0,rp);a.push(new bn(Dn.Buffer.from(f)))}const c=Ma(n,0,rp),l=Pa(n);let u=[];for(let h=0;h<l;h++){const f=Md(n),m=Pa(n),y=Ma(n,0,m),v=Pa(n),b=Ma(n,0,v),C=Os.encode(Dn.Buffer.from(b));u.push({programIdIndex:f,accounts:y,data:C})}const d={header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:s},recentBlockhash:Os.encode(Dn.Buffer.from(c)),accountKeys:a,instructions:u};return new ph(d)}}class C3{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const n of this.addressTableLookups)e+=n.readonlyIndexes.length+n.writableIndexes.length;return e}getAccountKeys(e){let n;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");n=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)n=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new pE(this.staticAccountKeys,n)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>
532=r){const i=e-r,s=this.addressTableLookups.reduce((o,a)=>o+a.writableIndexes.length,0);return i<s}else if(e>=this.header.numRequiredSignatures){const i=e-n,o=r-n-this.header.numReadonlyUnsignedAccounts;return i<o}else{const i=n-this.header.numReadonlySignedAccounts;return e<i}}resolveAddressTableLookups(e){const n={writable:[],readonly:[]};for(const r of this.addressTableLookups){const i=e.find(s=>s.key.equals(r.accountKey));if(!i)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const s of r.writableIndexes)if(s<i.state.addresses.length)n.writable.push(i.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`);for(const s of r.readonlyIndexes)if(s<i.state.addresses.length)n.readonly.push(i.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`)}return n}static compile(e){const n=vS.compile(e.instructions,e.payerKey),r=new Array,i={writable:new Array,readonly:new Array},s=e.addressLookupTableAccounts||[];for(const u of s){const d=n.extractTableLookup(u);if(d!==void 0){const[h,{writable:f,readonly:m}]=d;r.push(h),i.writable.push(...f),i.readonly.push(...m)}}const[o,a]=n.getMessageComponents(),l=new pE(a,i).compileInstructions(e.instructions);return new C3({header:o,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:l,addressTableLookups:r})}serialize(){const e=Array();Ra(e,this.staticAccountKeys.length);const n=this.serializeInstructions(),r=Array();Ra(r,this.compiledInstructions.length);const i=this.serializeAddressTableLookups(),s=Array();Ra(s,this.addressTableLookups.length);const o=xe.struct([xe.u8("prefix"),xe.struct([xe.u8("numRequiredSignatures"),xe.u8("numReadonlySignedAccounts"),xe.u8("numReadonlyUnsignedAccounts")],"header"),xe.blob(e.length,"staticAccountKeysLength"),xe.seq(zn(),this.staticAccountKeys.length,"staticAccountKeys"),zn("recentBlockhash"),xe.blob(r.length,"instructionsLength"),xe.blob(n.length,"serializedInstructions"),xe.blob(s.length,"addressTableLookupsLength"),xe.blob(i.length,"serializedAddressTableLookups")]),a=new Uint8Array(dy),l=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(u=>u.toBytes()),recentBlockhash:Os.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:n,addressTableLookupsLength:new Uint8Array(s),serializedAddressTableLookups:i},a);return a.slice(0,l)}serializeInstructions(){let e=0;const n=new Uint8Array(dy);for(const r of this.compiledInstructions){const i=Array();Ra(i,r.accountKeyIndexes.length);const s=Array();Ra(s,r.data.length);const o=xe.struct([xe.u8("programIdIndex"),xe.blob(i.length,"encodedAccountKeyIndexesLength"),xe.seq(xe.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),xe.blob(s.length,"encodedDataLength"),xe.blob(r.data.length,"data")]);e+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(s),data:r.data},n,e)}return n.slice(0,e)}serializeAddressTableLookups(){let e=0;const n=new Uint8Array(dy);for(const r of this.addressTableLookups){const i=Array();Ra(i,r.writableIndexes.length);const s=Array();Ra(s,r.readonlyIndexes.length);const o=xe.struct([zn("accountKey"),xe.blob(i.length,"encodedWritableIndexesLength"),xe.seq(xe.u8(),r.writableIndexes.length,"writableIndexes"),xe.blob(s.length,"encodedReadonlyIndexesLength"),xe.seq(xe.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(s),readonlyIndexes:r.readonlyIndexes},n,e)}return n.slice(0,e)}static deserialize(e){let n=[...e];const r=Md(n),i=r&MF;Yr(r!==i,"Expected versioned message but received legacy message");const s=i;Yr(s===0,`Expected versioned message with version 0 but found version ${s}`);const o={numRequiredSignatures:Md(n),numReadonlySignedAccounts:Md(n),numReadonlyUnsignedAccounts:Md(n)},a=[],c=Pa(n);for(let m=0;m<c;m++)a.push(new bn(Ma(n,0,rp)));const l=Os.encode(Ma(n,0,rp)),u=Pa(n),d=[];for(let m=0;m<u;m++){const y=Md(n),v=Pa(n),b=Ma(n,0,v),C=Pa(n),x=new Uint8Array(Ma(n,0,C));d.push({programIdIndex:y,accountKeyIndexes:b,data:x})}const h=Pa(n),f=[];for(let m=0;m<h;m++){const y=new bn(Ma(n,0,rp)),v=Pa(n),b=Ma(n,0,v),C=Pa(n),x=Ma(n,0,C);f.push({accountKey:y,writableIndexes:b,readonlyIndexes:x})}return new C3({header:o,staticAccountKeys:a,recentBlockhash:l,compiledInstructions:d,addressTableLookups:f})}}const OF={deserializeMessageVersion(t){const e=t[0],n=e&MF;return n===e?"legacy":n},deserialize:t=>{const e=OF.deserializeMessageVersion(t);if(e==="legacy")return ph.from(t);if(e===0)return C3.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let df=function(t){return t[t.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",t[t.PROCESSED=1]="PROCESSED",t[t.TIMED_OUT=2]="TIMED_OUT",t[t.NONCE_INVALID=3]="NONCE_INVALID",t}({});const jbt=Dn.Buffer.alloc(fE).fill(0);class Ite{constructor(e){this.keys=void 0,this.programId=void 0,this.data=Dn.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:n,isWritable:r})=>({pubkey:e.toJSON(),isSigner:n,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class dl{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){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,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:n,nonceInfo:r}=e;this.minNonceContextSlot=n,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:n,lastValidBlockHeight:r}=e;this.recentBlockhash=n,this.lastValidBlockHeight=r}else{const{recentBlockhash:n,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=n}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstru
vendor: 4,090 bytes, line 532
532ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.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 Ite(n))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?n=[this.nonceInfo.nonceInstruction,...this.instructions]:n=this.instructions):(e=this.recentBlockhash,n=this.instructions),!e)throw new Error("Transaction recentBlockhash required");n.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let y=0;y<n.length;y++)if(n[y].programId===void 0)throw new Error(`Transaction instruction index ${y} has undefined program id`);const i=[],s=[];n.forEach(y=>{y.keys.forEach(b=>{s.push({...b})});const v=y.programId.toString();i.includes(v)||i.push(v)}),i.forEach(y=>{s.push({pubkey:new bn(y),isSigner:!1,isWritable:!1})});const o=[];s.forEach(y=>{const v=y.pubkey.toString(),b=o.findIndex(C=>C.pubkey.toString()===v);b>-1?(o[b].isWritable=o[b].isWritable||y.isWritable,o[b].isSigner=o[b].isSigner||y.isSigner):o.push(y)}),o.sort(function(y,v){if(y.isSigner!==v.isSigner)return y.isSigner?-1:1;if(y.isWritable!==v.isWritable)return y.isWritable?-1:1;const b={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return y.pubkey.toBase58().localeCompare(v.pubkey.toBase58(),"en",b)});const a=o.findIndex(y=>y.pubkey.equals(r));if(a>-1){const[y]=o.splice(a,1);y.isSigner=!0,y.isWritable=!0,o.unshift(y)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const y of this.signatures){const v=o.findIndex(b=>b.pubkey.equals(y.publicKey));if(v>-1)o[v].isSigner||(o[v].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: ${y.publicKey.toString()}`)}let c=0,l=0,u=0;const d=[],h=[];o.forEach(({pubkey:y,isSigner:v,isWritable:b})=>{v?(d.push(y.toString()),c+=1,b||(l+=1)):(h.push(y.toString()),b||(u+=1))});const f=d.concat(h),m=n.map(y=>{const{data:v,programId:b}=y;return{programIdIndex:f.indexOf(b.toString()),accounts:y.keys.map(C=>f.indexOf(C.pubkey.toString())),data:Os.encode(v)}});return m.forEach(y=>{Yr(y.programIdIndex>=0),y.accounts.forEach(v=>Yr(v>=0))}),new ph({header:{numRequiredSignatures:c,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:u},accountKeys:f,recentBlockhash:e,instructions:m})}_compile(){const e=this.compileMessage(),n=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===n.length&&this.signatures.every((i,s)=>n[s].equals(i.publicKey))||(this.signatures=n.map(r=>({signature:null,publicKey:r}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const n=new Set;this.signatures=e.filter(r=>{const i=r.toString();return n.has(i)?!1:(n.add(i),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,r=[];for(const s of e){const o=s.publicKey.toString();n.has(o)||(n.add(o),r.push(s))}this.signatures=r.map(s=>({signature:null,publicKey:s.publicKey}));const i=this._compile();this._partialSign(i,...r)}partialSign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,r=[];for(const s of e){const o=s.publicKey.toString();
532n.has(o)||(n.add(o),r.push(s))}const i=this._compile();this._partialSign(i,...r)}_partialSign(e,...n){const r=e.serialize();n.forEach(i=>{const s=s2e(r,i.secretKey);this._addSignature(i.publicKey,g2(s))})}addSignature(e,n){this._compile(),this._addSignature(e,n)}_addSignature(e,n){Yr(n.length===64);const r=this.signatures.findIndex(i=>e.equals(i.publicKey));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=Dn.Buffer.from(n)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,n){const r={};for(const{signature:i,publicKey:s}of this.signatures)i===null?n&&(r.missing||(r.missing=[])).push(s):Abt(i,e,s.toBytes())||(r.invalid||(r.invalid=[])).push(s);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:n,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),i=this.serializeMessage();if(r){const s=this._getMessageSignednessErrors(i,n);if(s){let o="Signature verification failed.";throw s.invalid&&(o+=` 533Invalid signature for public key${s.invalid.length===1?"":"(s)"} [\`${s.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),s.missing&&(o+=` 534Missing signature for public key${s.missing.length===1?"":"(s)"} [\`${s.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(o)}}return this._serialize(i)}_serialize(e){const{signatures:n}=this,r=[];Ra(r,n.length);const i=r.length+n.length*64+e.length,s=Dn.Buffer.alloc(i);return Yr(n.length<256),Dn.Buffer.from(r).copy(s,0),n.forEach(({signature:o},a)=>{o!==null&&(Yr(o.length===64,"signature has invalid length"),Dn.Buffer.from(o).copy(s,r.length+a*64))}),e.copy(s,r.length+n.length*64),Yr(s.length<=dy,`Transaction too large: ${s.length} > ${dy}`),s}get keys(){return Yr(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return Yr(this.instructions.length===1),this.instructions[0].programId}get data(){return Yr(this.instructions.length===1),this.instructions[0].data}static from(e){let n=[...e];const r=Pa(n);let i=[];for(let s=0;s<r;s++){const o=Ma(n,0,fE);i.push(Os.encode(Dn.Buffer.from(o)))}return dl.populate(ph.from(n),i)}static populate(e,n=[]){const r=new dl;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),n.forEach((i,s)=>{const o={signature:i==Os.encode(jbt)?null:Os.decode(i),publicKey:e.accountKeys[s]};r.signatures.push(o)}),e.instructions.forEach(i=>{const s=i.accounts.map(o=>{const a=e.accountKeys[o];return{pubkey:a,isSigner:r.signatures.some(c=>c.publicKey.toString()===a.toString())||e.isAccountSigner(o),isWritable:e.isAccountWritable(o)}});r.instructions.push(new Ite({keys:s,programId:e.accountKeys[i.programIdIndex],data:Os.decode(i.data)}))}),r._message=e,r._json=r.toJSON(),r}}class _3{get version(){return this.message.version}constructor(e,n){if(this.signatures=void 0,this.message=void 0,n!==void 0)Yr(n.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{const r=[];for(let i=0;i<e.header.numRequiredSignatures;i++)r.push(new Uint8Array(fE));this.signatures=r}this.message=e}serialize(){const e=this.message.serialize(),n=Array();Ra(n,this.signatures.length);const r=xe.struct([xe.blob(n.length,"encodedSignaturesLength"),xe.seq(Tbt(),this.signatures.length,"signatures"),xe.blob(e.length,"serializedMessage")]),i=new Uint8Array(2048),s=r.encode({encodedSignaturesLength:new Uint8Array(n),signatures:this.signatures,serializedMessage:e},i);return i.slice(0,s)}static deserialize(e){let n=[...e];const r=[],i=Pa(n);for(let o=0;o<i;o++)r.push(new Uint8Array(Ma(n,0,fE)));const s=OF.deserialize(new Uint8Array(n));return new _3(s,r)}sign(e){const n=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const i of e){const s=r.findIndex(o=>o.equals(i.publicKey));Yr(s>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[s]=s2e(n,i.secretKey)}}addSignature(e,n){Yr(n.byteLength===64,"Signature must be 64 bytes long");const i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(s=>s.equals(e));Yr(i>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[i]=n}}const Nbt=160,Dbt=64,Lbt=Nbt/Dbt,Bbt=1e3/Lbt;new bn("SysvarC1ock11111111111111111111111111111111");new bn("SysvarEpochSchedu1e111111111111111111111111");new bn("Sysvar1nstructions1111111111111111111111111");new bn("SysvarRecentB1ockHashes11111111111111111111");new bn("SysvarRent111111111111111111111111111111111");new bn("SysvarRewards111111111111111111111111111111");new bn("SysvarS1otHashes111111111111111111111111111");new bn("SysvarS1otHistory11111111111111111111111111");new bn("SysvarStakeHistory1111111111111111111111111");
534class Tte extends Error{constructor({action:e,signature:n,transactionMessage:r,logs:i}){const s=i?`Logs: 535${JSON.stringify(i.slice(-10),null,2)}. `:"",o="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";let a;switch(e){case"send":a=`Transaction ${n} resulted in an error. 536${r}. `+s+o;break;case"simulate":a=`Simulation failed. 537Message: ${r}. 538`+s+o;break;default:a=`Unknown action '${(c=>c)(e)}'`}super(a),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=n,this.transactionMessage=r,this.transactionLogs=i||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(!(e!=null&&typeof e=="object"&&"then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((n,r)=>{e.getTransaction(this.signature).then(i=>{if(i&&i.meta&&i.meta.logMessages){const s=i.meta.logMessages;this.transactionLogs=s,n(s)}else r(new Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}class an extends Error{constructor({code:e,message:n,data:r},i){super(i!=null?`${i}: ${n}`:n),this.code=void 0,this.data=void 0,this.code=e,this.data=r,this.name="SolanaJSONRPCError"}}function _m(t){return new Promise(e=>setTimeout(e,t))}const Fbt=xe.nu64("lamportsPerSignature"),u2e=xe.struct([xe.u32("version"),xe.u32("state"),zn("authorizedPubkey"),zn("nonce"),xe.struct([Fbt],"feeCalculator")]);u2e.span;class jF{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const n=u2e.decode(g2(e),0);return new jF({authorizedPubkey:new bn(n.authorizedPubkey),nonce:new bn(n.nonce).toString(),feeCalculator:n.feeCalculator})}}function m2(t){const e=xe.blob(8,t),n=e.decode.bind(e),r=e.encode.bind(e),i=e,s=Tvt();return i.decode=(o,a)=>{const c=n(o,a);return s.decode(c)},i.encode=(o,a,c)=>{const l=s.encode(o);return r(l,a,c)},i}Object.freeze({Create:{index:0,layout:xe.struct([xe.u32("instruction"),xe.ns64("lamports"),xe.ns64("space"),zn("programId")])},Assign:{index:1,layout:xe.struct([xe.u32("instruction"),zn("programId")])},Transfer:{index:2,layout:xe.struct([xe.u32("instruction"),m2("lamports")])},CreateWithSeed:{index:3,layout:xe.struct([xe.u32("instruction"),zn("base"),Lm("seed"),xe.ns64("lamports"),xe.ns64("space"),zn("programId")])},AdvanceNonceAccount:{index:4,layout:xe.struct([xe.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:xe.struct([xe.u32("instruction"),xe.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:xe.struct([xe.u32("instruction"),zn("authorized")])},AuthorizeNonceAccount:{index:7,layout:xe.struct([xe.u32("instruction"),zn("authorized")])},Allocate:{index:8,layout:xe.struct([xe.u32("instruction"),xe.ns64("space")])},AllocateWithSeed:{index:9,layout:xe.struct([xe.u32("instruction"),zn("base"),Lm("seed"),xe.ns64("space"),zn("programId")])},AssignWithSeed:{index:10,layout:xe.struct([xe.u32("instruction"),zn("base"),Lm("seed"),zn("programId")])},TransferWithSeed:{index:11,layout:xe.struct([xe.u32("instruction"),m2("lamports"),Lm("seed"),zn("programId")])},UpgradeNonceAccount:{index:12,layout:xe.struct([xe.u32("instruction")])}});new bn("11111111111111111111111111111111");new bn("BPFLoader2111111111111111111111111111111111");function Ubt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yP,Pte;function zbt(){if(Pte)return yP;Pte=1;var t=Object.prototype.toString,e=Object.keys||function(r){var i=[];for(var s in r)i.push(s);return i};function n(r,i){var s,o,a,c,l,u,d;if(r===!0)return"true";if(r===!1)return"false";switch(typeof r){case"object":if(r===null)return null;if(r.toJSON&&typeof r.toJSON=="function")return n(r.toJSON(),i);if(d=t.call(r),d==="[object Array]"){for(a="[",o=r.length-1,s=0;s<o;s++)a+=n(r[s],!0)+",";return o>-1&&(a+=n(r[s],!0)),a+"]"}else if(d==="[object Object]"){for(c=e(r).sort(),o=c.length,a="",s=0;s<o;)l=c[s],u=n(r[l],!1),u!==void 0&&(a&&(a+=","),a+=JSON.stringify(l)+":"+u),s++;return"{"+a+"}"}else return JSON.stringify(r);case"function":case"undefined":return i?null:void 0;case"string":return JSON.stringify(r);default:return isFinite(r)?r:null}}return yP=function(r){var i=n(r,!1);if(i!==void 0)return""+i},yP}var Wbt=zbt(),Rte=Ubt(Wbt);const Tv=32;function wP(t){let e=0;for(;t>1;)t/=2,e++;return e}function Hbt(t){return t===0?1:(t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t+1)}class Vbt{constructor(e,n,r,i,s){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=s}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const n=wP(Hbt(e+Tv+1))-wP(Tv)-1,r=this.getSlotsInEpoch(n),i=e-(r-Tv);return[n,i]}else{const n=e-this.firstNormalSlot,r=Math.floor(n/this.slotsPerEpoch),i=this.firstNormalEpoch+r,s=n%this.slotsPerEpoch;return[i,s]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*Tv:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+wP(Tv)):this.slotsPerEpoch}}var qbt=globalThis.fetch;class Kbt extends dbt{constructor(e,n,r){const i=s=>{const o=lbt(s,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...n});return"socket"in o?this.underlyingSocket=o.socket:this.underlyingSocket=o,o};super(i,e,n,r),this.underlyingSocket=void 0}call(...e){var r;const n=(r=this.underlyingSocket)==null?void 0:r.readyState;
vendor: 15,815 bytes, line 538
538return n===1?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+n+")"))}notify(...e){var r;const n=(r=this.underlyingSocket)==null?void 0:r.readyState;return n===1?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+n+")"))}}function Gbt(t,e){let n;try{n=t.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(n.typeIndex!==t.index)throw new Error(`invalid account data; account type mismatch ${n.typeIndex} != ${t.index}`);return n}const Mte=56;class Ote{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const n=Gbt(Zbt,e),r=e.length-Mte;Yr(r>=0,"lookup table is invalid"),Yr(r%32===0,"lookup table is invalid");const i=r/32,{addresses:s}=xe.struct([xe.seq(zn(),i,"addresses")]).decode(e.slice(Mte));return{deactivationSlot:n.deactivationSlot,lastExtendedSlot:n.lastExtendedSlot,lastExtendedSlotStartIndex:n.lastExtendedStartIndex,authority:n.authority.length!==0?new bn(n.authority[0]):void 0,addresses:s.map(o=>new bn(o))}}}const Zbt={index:1,layout:xe.struct([xe.u32("typeIndex"),m2("deactivationSlot"),xe.nu64("lastExtendedSlot"),xe.u8("lastExtendedStartIndex"),xe.u8(),xe.seq(zn(),xe.offset(xe.u8(),-1),"authority")])},Ybt=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function Qbt(t){const e=t.match(Ybt);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${t}\``);const[n,r,i,s]=e,o=t.startsWith("https:")?"wss:":"ws:",a=i==null?null:parseInt(i.slice(1),10),c=a==null?"":`:${a+1}`;return`${o}//${r}${c}${s}`}const hi=lx(TF(bn),$t(),t=>new bn(t)),d2e=PF([$t(),ai("base64")]),NF=lx(TF(Dn.Buffer),d2e,t=>Dn.Buffer.from(t[0],"base64")),Xbt=30*1e3;function Jbt(t){if(/^https?:/.test(t)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}function Tr(t){let e,n;if(typeof t=="string")e=t;else if(t){const{commitment:r,...i}=t;e=r,n=i}return{commitment:e,config:n}}function jte(t){return t.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function h2e(t){return Oo([dt({jsonrpc:ai("2.0"),id:$t(),result:t}),dt({jsonrpc:ai("2.0"),id:$t(),error:dt({code:ew(),message:$t(),data:hn(Dvt())})})])}const e3t=h2e(ew());function On(t){return lx(h2e(t),e3t,e=>"error"in e?e:{...e,result:Ot(e.result,t)})}function _i(t){return On(dt({context:dt({slot:Me()}),value:t}))}function bS(t){return dt({context:dt({slot:Me()}),value:t})}function vP(t,e){return t===0?new C3({header:e.header,staticAccountKeys:e.accountKeys.map(n=>new bn(n)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(n=>({programIdIndex:n.programIdIndex,accountKeyIndexes:n.accounts,data:Os.decode(n.data)})),addressTableLookups:e.addressTableLookups}):new ph(e)}const t3t=dt({foundation:Me(),foundationTerm:Me(),initial:Me(),taper:Me(),terminal:Me()}),n3t=On(Ut(Wt(dt({epoch:Me(),effectiveSlot:Me(),amount:Me(),postBalance:Me(),commission:hn(Wt(Me()))})))),r3t=Ut(dt({slot:Me(),prioritizationFee:Me()})),i3t=dt({total:Me(),validator:Me(),foundation:Me(),epoch:Me()}),s3t=dt({epoch:Me(),slotIndex:Me(),slotsInEpoch:Me(),absoluteSlot:Me(),blockHeight:hn(Me()),transactionCount:hn(Me())}),o3t=dt({slotsPerEpoch:Me(),leaderScheduleSlotOffset:Me(),warmup:Fu(),firstNormalEpoch:Me(),firstNormalSlot:Me()}),a3t=Yye($t(),Ut(Me())),og=Wt(Oo([dt({}),$t()])),c3t=dt({err:og}),l3t=ai("receivedSignature"),u3t=dt({"solana-core":$t(),"feature-set":hn(Me())}),d3t=dt({program:$t(),programId:hi,parsed:ew()}),h3t=dt({programId:hi,accounts:Ut(hi),data:$t()}),Nte=_i(dt({err:Wt(Oo([dt({}),$t()])),logs:Wt(Ut($t())),accounts:hn(Wt(Ut(Wt(dt({executable:Fu(),owner:$t(),lamports:Me(),data:Ut($t()),rentEpoch:hn(Me())}))))),unitsConsumed:hn(Me()),returnData:hn(Wt(dt({programId:$t(),data:PF([$t(),ai("base64")])}))),innerInstructions:hn(Wt(Ut(dt({index:Me(),instructions:Ut(Oo([d3t,h3t]))}))))})),f3t=_i(dt({byIdentity:Yye($t(),Ut(Me())),range:dt({firstSlot:Me(),lastSlot:Me()})}));function p3t(t,e,n,r,i,s){const o=n||qbt;let a;s!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let c;return r&&(c=async(u,d)=>{const h=await new Promise((f,m)=>{try{r(u,d,(y,v)=>f([y,v]))}catch(y){m(y)}});return await o(...h)}),new abt(async(u,d)=>{const h={method:"POST",body:u,agent:a,headers:Object.assign({"Content-Type":"application/json"},e||{},p5t)};try{let f=5,m,y=500;for(;c?m=await c(t,h):m=await o(t,h),!(m.status!==429||i===!0||(f-=1,f===0));)console.error(`Server responded with ${m.status} ${m.statusText}. Retrying after ${y}ms delay...`),await _m(y),y*=2;const v=await m.text();m.ok?d(null,v):d(new Error(`${m.status} ${m.statusText}: ${v}`))}catch(f){f instanceof Error&&d(f)}},{})}function g3t(t){return(e,n)=>new Promise((r,i)=>{t.request(e,n,(s,o)=>{if(s){i(s);return}r(o)})})}function m3t(t){return e=>new Promise((n,r)=>{e.length===0&&n([]);const i=e.map(s=>t.request(s.methodName,s.args));t.request(i,(s,o)=>{if(s){r(s);return}n(o)})})}const y3t=On(t3t),w3t=On(i3t),v3t=On(r3t),b3t=On(s3t),x3t=On(o3t),E3t=On(a3t),C3t=On(Me()),_3t=_i(dt({total:Me(),circulating:Me(),nonCirculating:Me(),nonCirculatingAccounts:Ut(hi)})),rN=dt({amount:$t(),uiAmount:Wt(Me()),decimals:Me(),uiAmountString:hn($t())}),S3t=_i(Ut(dt({address:hi,amount:$t(),uiAmount:Wt(Me()),decimals:Me(),uiAmountString:hn($t())}))),A3t=_i(Ut(dt({pubkey:hi,account:dt({executable:Fu(),owner:hi,lamports:Me(),data:NF,rentEpoch:Me()})}))),iN=dt({program:$t(),parsed:ew(),space:Me()}),k3t=_i(Ut(dt({pubkey:hi,account:dt({executable:Fu(),owner:hi,lamports:Me(),data:iN,rentEpoch:Me()})}))),$3t=_i(Ut(dt({lamports:Me(),address:hi}))),S3=dt({executable:Fu(),owner:hi,lamports:Me(),data:NF,rentEpoch:Me()}),I3t=dt({pubkey:hi,account:S3}),T3t=lx(Oo([TF(Dn.Buffer),iN]),Oo([d2e,iN]),t=>Array.isArray(t)?Ot(t,NF):t),sN=dt({executable:Fu(),owner:hi,lamports:Me(),data:T3t,rentEpoch:Me()}),P3t=dt({pubkey:hi,account:sN}),R3t=dt({state:Oo([ai("active"),ai("inactive"),ai("activating"),ai("deactivating")]),active:Me(),inactive:Me()}),M3t=On(Ut(dt({signature:$t(),slot:Me(),err:og,memo:Wt($t()),blockTime:hn(Wt(Me()))}))),O3t=On(Ut(dt({signature:$t(),slot:Me(),err:og,memo:Wt($t()),blockTime:hn(Wt(Me()))}))),j3t=dt({subscription:Me(),result:bS(S3)}),N3t=dt({pubkey:hi,account:S3}),D3t=dt({subscription:Me(),result:bS(N3t)}),L3t=dt({parent:Me(),slot:Me(),root:Me()}),B3t=dt({subscription:Me(),result:L3t}),F3t=Oo([dt({type:Oo([ai("firstShredReceived"),ai("completed"),ai("optimisticConfirmation"),ai("root")]),slot:Me(),timestamp:Me()}),dt({type:ai("createdBank"),parent:Me(),slot:Me(),timestamp:Me()}),dt({type:ai("frozen"),slot:Me(),timestamp:Me(),stats:dt({numTransactionEntries:Me(),numSuccessfulTransactions:Me(),numFailedTransactions:Me(),maxTransactionsPerEntry:Me()})}),dt({type:ai("dead"),slot:Me(),timestamp:Me(),err:$t()})]),U3t=dt({subscription:Me(),result:F3t}),z3t=dt({subscription:Me(),result:bS(Oo([c3t,l3t]))}),W3t=dt({subscription:Me(),result:Me()}),H3t=dt({pubkey:$t(),gossip:Wt($t()),tpu:Wt($t()),rpc:Wt($t()),version:Wt($t())}),Dte=dt({votePubkey:$t(),nodePubkey:$t(),activatedStake:Me(),epochVoteAccount:Fu(),epochCredits:Ut(PF([Me(),Me(),Me()])),commission:Me(),lastVote:Me(),rootSlot:Wt(Me())}),V3t=On(dt({current:Ut(Dte),delinquent:Ut(Dte)})),q3t=Oo([ai("processed"),ai("confirmed"),ai("finalized")]),K3t=dt({slot:Me(),confirmations:Wt(Me()),err:og,confirmationStatus:hn(q3t)}),G3t=_i(Ut(Wt(K3t))),Z3t=On(Me()),f2e=dt({accountKey:hi,writableIndexes:Ut(Me()),readonlyIndexes:Ut(Me())}),DF=dt({signatures:Ut($t()),message:dt({accountKeys:Ut($t()),header:dt({numRequiredSignatures:Me(),numReadonlySignedAccounts:Me(),numReadonlyUnsignedAccounts:Me()}),instructions:Ut(dt({accounts:Ut(Me()),data:$t(),programIdIndex:Me()})),recentBlockhash:$t(),addressTableLookups:hn(Ut(f2e))})}),p2e=dt({pubkey:hi,signer:Fu(),writable:Fu(),source:hn(Oo([ai("transaction"),ai("lookupTable")]))}),g2e=dt({accountKeys:Ut(p2e),signatures:Ut($t())}),m2e=dt({parsed:ew(),program:$t(),programId:hi}),y2e=dt({accounts:Ut(hi),data:$t(),programId:hi}),Y3t=Oo([y2e,m2e]),Q3t=Oo([dt({parsed:ew(),program:$t(),programId:$t()}),dt({accounts:Ut($t()),data:$t(),programId:$t()})]),w2e=lx(Y3t,Q3t,t=>"accounts"in t?Ot(t,y2e):Ot(t,m2e)),v2e=dt({signatures:Ut($t()),message:dt({accountKeys:Ut(p2e),instructions:Ut(w2e),recentBlockhash:$t(),addressTableLookups:hn(Wt(Ut(f2e)))})}),gE=dt({accountIndex:Me(),mint:$t(),owner:hn($t()),programId:hn($t()),uiTokenAmount:rN}),b2e=dt({writable:Ut(hi),readonly:Ut(hi)}),xS=dt({err:og,fee:Me(),innerInstructions:hn(Wt(Ut(dt({index:Me(),instructions:Ut(dt({accounts:Ut(Me()),data:$t(),programIdIndex:Me()}))})))),preBalances:Ut(Me()),postBalances:Ut(Me()),logMessages:hn(Wt(Ut($t()))),preTokenBalances:hn(Wt(Ut(gE))),postTokenBalances:hn(Wt(Ut(gE))),loadedAddresses:hn(b2e),computeUnitsConsumed:hn(Me()),costUnits:hn(Me())}),LF=dt({err:og,fee:Me(),innerInstructions:hn(Wt(Ut(dt({index:Me(),instructions:Ut(w2e)})))),preBalances:Ut(Me()),postBalances:Ut(Me()),logMessages:hn(Wt(Ut($t()))),preTokenBalances:hn(Wt(Ut(gE))),postTokenBalances:hn(Wt(Ut(gE))),loadedAddresses:hn(b2e),computeUnitsConsumed:hn(Me()),costUnits:hn(Me())}),tw=Oo([ai(0),ai("legacy")]),ag=dt({pubkey:$t(),lamports:Me(),postBalance:Wt(Me()),rewardType:Wt($t()),commission:hn(Wt(Me()))}),X3t=On(Wt(dt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Me(),transactions:Ut(dt({transaction:DF,meta:Wt(xS),version:hn(tw)})),rewards:hn(Ut(ag)),blockTime:Wt(Me()),blockHeight:Wt(Me())}))),J3t=On(Wt(dt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Me(),rewards:hn(Ut(ag)),blockTime:Wt(Me()),blockHeight:Wt(Me())}))),e5t=On(Wt(dt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Me(),transactions:Ut(dt({transaction:g2e,meta:Wt(xS),version:hn(tw)})),rewards:hn(Ut(ag)),blockTime:Wt(Me()),blockHeight:Wt(Me())}))),t5t=On(Wt(dt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Me(),transactions:Ut(dt({transaction:v2e,meta:Wt(LF),version:hn(tw)})),rewards:hn(Ut(ag)),blockTime:Wt(Me()),blockHeight:Wt(Me())}))),n5t=On(Wt(dt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Me(),transactions:Ut(dt({transaction:g2e,meta:Wt(LF),version:hn(tw)})),rewards:hn(Ut(ag)),blockTime:Wt(Me()),blockHeight:Wt(Me())}))),r5t=On(Wt(dt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Me(),rewards:hn(Ut(ag)),blockTime:Wt(Me()),blockHeight:Wt(Me())}))),i5t=On(Wt(dt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Me(),transactions:Ut(dt({transaction:DF,meta:Wt(xS)})),rewards:hn(Ut(ag)),blockTime:Wt(Me())}))),Lte=On(Wt(dt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Me(),signatures:Ut($t()),blockTime:Wt(Me())}))),bP=On(Wt(dt({slot:Me(),meta:Wt(xS),blockTime:hn(Wt(Me())),transaction:DF,version:hn(tw)}))),j6=On(Wt(dt({slot:Me(),transaction:v2e,meta:Wt(LF),blockTime:hn(Wt(Me())),version:hn(tw)}))),s5t=_i(dt({blockhash:$t(),lastValidBlockHeight:Me()})),o5t=_i(Fu()),a5t=dt({slot:Me(),numTransactions:Me(),numSlots:Me(),samplePeriodSecs:Me()}),c5t=On(Ut(a5t)),l5t=_i(Wt(dt({feeCalculator:dt({lamportsPerSignature:Me()})}))),u5t=On($t()),d5t=On($t()),h5t=dt({err:og,logs:Ut($t()),signature:$t()}),f5t=dt({result:bS(h5t),subscription:Me()}),p5t={"solana-client":"js/1.0.0-maintenance"};class g5t{constructor(e,n){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const l={};return async u=>{const{commitment:d,config:h}=Tr(u),f=this._buildArgs([],d,void 0,h),m=Rte(f);return l[m]=l[m]??(async()=>{try{const y=await this._rpcRequest("getBlockHeight",f),v=Ot(y,On(Me()));if("error"in v)throw new an(v.error,"failed to get block height information");return v.result}finally{delete l[m]}})(),await l[m]}})();let r,i,s,o,a,c;n&&typeof n=="string"?this._commitment=n:n&&(this._commitment=n.commitment,this._confirmTransactionInitialTimeout=n.confirmTransactionInitialTimeout,r=n.wsEndpoint,i=n.httpHeaders,s=n.fetch,o=n.fetchMiddleware,a=n.disableRetryOnRateLimit,c=n.httpAgent),this._rpcEndpoint=Jbt(e),this._rpcWsEndpoint=r||Qbt(e),this._rpcClient=p3t(e,i,s,o,a,c),this._rpcRequest=g3t(this._rpcClient),this._rpcBatchRequest=m3t(this._rpcClient),this._rpcWebSocket=new Kbt(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgs([e.toBase58()],r,void 0,i),o=await this._rpcRequest("getBalance",s),a=Ot(o,_i(Me()));if("error"in a)throw new an(a.error,`failed to get balance for ${e.toBase58()}`);return a.result}async getBalance(e,n){return await this.getBalanceAndContext(e,n).then(r=>r.value).catch(r=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+r)})}async getBlockTime(e){const n=await this._rpcRequest("getBlockTime",[e]),r=Ot(n,On(Wt(Me())));if("error"in r)throw new an(r.error,`failed to get block time for slot ${e}`);return r.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),n=Ot(e,On(Me()));if("error"in n)throw new an(n.error,"failed to get minimum ledger slot");return n.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),n=Ot(e,C3t);if("error"in n)throw new an(n.error,"failed to get first available block");return n.result}async getSupply(e){let n={};typeof e=="string"?n={commitment:e}:e?n={...e,commitment:e&&e.commitment||this.commitment}:n={commitment:this.commitment};const r=await this._rpcRequest("getSupply",[n]),i=Ot(r,_3t);if("error"in i)throw new an(i.error,"failed to get supply");return i.result}async getTokenSupply(e,n){const r=this._buildArgs([e.toBase58()],n),i=await this._rpcRequest("getTokenSupply",r),s=Ot(i,_i(rN));if("error"in s)throw new an(s.error,"failed to get token supply");return s.result}async getTokenAccountBalance(e,n){const r=this._buildArgs([e.toBase58()],n),i=await this._rpcRequest("getTokenAccountBalance",r),s=Ot(i,_i(rN));if("error"in s)throw new an(s.error,"failed to get token account balance");return s.result}
538async getTokenAccountsByOwner(e,n,r){const{commitment:i,config:s}=Tr(r);let o=[e.toBase58()];"mint"in n?o.push({mint:n.mint.toBase58()}):o.push({programId:n.programId.toBase58()});const a=this._buildArgs(o,i,"base64",s),c=await this._rpcRequest("getTokenAccountsByOwner",a),l=Ot(c,A3t);if("error"in l)throw new an(l.error,`failed to get token accounts owned by account ${e.toBase58()}`);return l.result}async getParsedTokenAccountsByOwner(e,n,r){let i=[e.toBase58()];"mint"in n?i.push({mint:n.mint.toBase58()}):i.push({programId:n.programId.toBase58()});const s=this._buildArgs(i,r,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",s),a=Ot(o,k3t);if("error"in a)throw new an(a.error,`failed to get token accounts owned by account ${e.toBase58()}`);return a.result}async getLargestAccounts(e){const n={...e,commitment:e&&e.commitment||this.commitment},r=n.filter||n.commitment?[n]:[],i=await this._rpcRequest("getLargestAccounts",r),s=Ot(i,$3t);if("error"in s)throw new an(s.error,"failed to get largest accounts");return s.result}async getTokenLargestAccounts(e,n){const r=this._buildArgs([e.toBase58()],n),i=await this._rpcRequest("getTokenLargestAccounts",r),s=Ot(i,S3t);if("error"in s)throw new an(s.error,"failed to get token largest accounts");return s.result}async getAccountInfoAndContext(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgs([e.toBase58()],r,"base64",i),o=await this._rpcRequest("getAccountInfo",s),a=Ot(o,_i(Wt(S3)));if("error"in a)throw new an(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getParsedAccountInfo(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgs([e.toBase58()],r,"jsonParsed",i),o=await this._rpcRequest("getAccountInfo",s),a=Ot(o,_i(Wt(sN)));if("error"in a)throw new an(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getAccountInfo(e,n){try{return(await this.getAccountInfoAndContext(e,n)).value}catch(r){throw new Error("failed to get info about account "+e.toBase58()+": "+r)}}async getMultipleParsedAccounts(e,n){const{commitment:r,config:i}=Tr(n),s=e.map(l=>l.toBase58()),o=this._buildArgs([s],r,"jsonParsed",i),a=await this._rpcRequest("getMultipleAccounts",o),c=Ot(a,_i(Ut(Wt(sN))));if("error"in c)throw new an(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfoAndContext(e,n){const{commitment:r,config:i}=Tr(n),s=e.map(l=>l.toBase58()),o=this._buildArgs([s],r,"base64",i),a=await this._rpcRequest("getMultipleAccounts",o),c=Ot(a,_i(Ut(Wt(S3))));if("error"in c)throw new an(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfo(e,n){return(await this.getMultipleAccountsInfoAndContext(e,n)).value}async getStakeActivation(e,n,r){const{commitment:i,config:s}=Tr(n),o=this._buildArgs([e.toBase58()],i,void 0,{...s,epoch:r??(s==null?void 0:s.epoch)}),a=await this._rpcRequest("getStakeActivation",o),c=Ot(a,On(R3t));if("error"in c)throw new an(c.error,`failed to get Stake Activation ${e.toBase58()}`);return c.result}async getProgramAccounts(e,n){const{commitment:r,config:i}=Tr(n),{encoding:s,...o}=i||{},a=this._buildArgs([e.toBase58()],r,s||"base64",{...o,...o.filters?{filters:jte(o.filters)}:null}),c=await this._rpcRequest("getProgramAccounts",a),l=Ut(I3t),u=o.withContext===!0?Ot(c,_i(l)):Ot(c,On(l));if("error"in u)throw new an(u.error,`failed to get accounts owned by program ${e.toBase58()}`);return u.result}async getParsedProgramAccounts(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgs([e.toBase58()],r,"jsonParsed",i),o=await this._rpcRequest("getProgramAccounts",s),a=Ot(o,On(Ut(P3t)));if("error"in a)throw new an(a.error,`failed to get accounts owned by program ${e.toBase58()}`);return a.result}async confirmTransaction(e,n){var s;let r;if(typeof e=="string")r=e;else{const o=e;if((s=o.abortSignal)!=null&&s.aborted)return Promise.reject(o.abortSignal.reason);r=o.signature}let i;try{i=Os.decode(r)}catch{throw new Error("signature must be base58 encoded: "+r)}return Yr(i.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:n||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:n||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:n||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((n,r)=>{e!=null&&(e.aborted?r(e.reason):e.addEventListener("abort",()=>{r(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:n}){let r,i,s=!1;const o=new Promise((c,l)=>{try{r=this.onSignature(n,(d,h)=>{r=void 0;const f={context:h,value:d};c({__type:df.PROCESSED,response:f})},e);const u=new Promise(d=>{r==null?d():i=this._onSubscriptionStateChange(r,h=>{h==="subscribed"&&d()})});(async()=>
538{if(await u,s)return;const d=await this.getSignatureStatus(n);if(s||d==null)return;const{context:h,value:f}=d;if(f!=null)if(f!=null&&f.err)l(f.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(f.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(f.confirmationStatus==="processed"||f.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}s=!0,c({__type:df.PROCESSED,response:{context:h,value:f}})}})()}catch(u){l(u)}});return{abortConfirmation:()=>{i&&(i(),i=void 0),r!=null&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:n,lastValidBlockHeight:r,signature:i}}){let s=!1;const o=new Promise(d=>{const h=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let f=await h();if(!s){for(;f<=r;)if(await _m(1e3),s||(f=await h(),s))return;d({__type:df.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:e,signature:i}),l=this.getCancellationPromise(n);let u;try{const d=await Promise.race([l,c,o]);if(d.__type===df.PROCESSED)u=d.response;else throw new a2e(i)}finally{s=!0,a()}return u}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:n,minContextSlot:r,nonceAccountPubkey:i,nonceValue:s,signature:o}}){let a=!1;const c=new Promise(f=>{let m=s,y=null;const v=async()=>{try{const{context:b,value:C}=await this.getNonceAndContext(i,{commitment:e,minContextSlot:r});return y=b.slot,C==null?void 0:C.nonce}catch{return m}};(async()=>{if(m=await v(),!a)for(;;){if(s!==m){f({__type:df.NONCE_INVALID,slotInWhichNonceDidAdvance:y});return}if(await _m(2e3),a||(m=await v(),a))return}})()}),{abortConfirmation:l,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:e,signature:o}),d=this.getCancellationPromise(n);let h;try{const f=await Promise.race([d,u,c]);if(f.__type===df.PROCESSED)h=f.response;else{let m;for(;;
538){const y=await this.getSignatureStatus(o);if(y==null)break;if(y.context.slot<(f.slotInWhichNonceDidAdvance??r)){await _m(400);continue}m=y;break}if(m!=null&&m.value){const y=e||"finalized",{confirmationStatus:v}=m.value;switch(y){case"processed":case"recent":if(v!=="processed"&&v!=="confirmed"&&v!=="finalized")throw new tb(o);break;case"confirmed":case"single":case"singleGossip":if(v!=="confirmed"&&v!=="finalized")throw new tb(o);break;case"finalized":case"max":case"root":if(v!=="finalized")throw new tb(o);break;default:}h={context:m.context,value:{err:m.value.err}}}else throw new tb(o)}}finally{a=!0,l()}return h}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:n}){let r;const i=new Promise(c=>{let l=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{l=this._confirmTransactionInitialTimeout||3e4;break}}r=setTimeout(()=>c({__type:df.TIMED_OUT,timeoutMs:l}),l)}),{abortConfirmation:s,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:e,signature:n});let a;try{const c=await Promise.race([o,i]);if(c.__type===df.PROCESSED)a=c.response;else throw new c2e(n,c.timeoutMs/1e3)}finally{clearTimeout(r),s()}return a}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),n=Ot(e,On(Ut(H3t)));if("error"in n)throw new an(n.error,"failed to get cluster nodes");return n.result}async getVoteAccounts(e){const n=this._buildArgs([],e),r=await this._rpcRequest("getVoteAccounts",n),i=Ot(r,V3t);if("error"in i)throw new an(i.error,"failed to get vote accounts");return i.result}async getSlot(e){const{commitment:n,config:r}=Tr(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getSlot",i),o=Ot(s,On(Me()));if("error"in o)throw new an(o.error,"failed to get slot");return o.result}async getSlotLeader(e){const{commitment:n,config:r}=Tr(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getSlotLeader",i),o=Ot(s,On($t()));if("error"in o)throw new an(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(e,n){const r=[e,n],i=await this._rpcRequest("getSlotLeaders",r),s=Ot(i,On(Ut(hi)));if("error"in s)throw new an(s.error,"failed to get slot leaders");return s.result}async getSignatureStatus(e,n){const{context:r,value:i}
538=await this.getSignatureStatuses([e],n);Yr(i.length===1);const s=i[0];return{context:r,value:s}}async getSignatureStatuses(e,n){const r=[e];n&&r.push(n);const i=await this._rpcRequest("getSignatureStatuses",r),s=Ot(i,G3t);if("error"in s)throw new an(s.error,"failed to get signature status");return s.result}async getTransactionCount(e){const{commitment:n,config:r}=Tr(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getTransactionCount",i),o=Ot(s,On(Me()));if("error"in o)throw new an(o.error,"failed to get transaction count");return o.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const n=this._buildArgs([],e),r=await this._rpcRequest("getInflationGovernor",n),i=Ot(r,y3t);if("error"in i)throw new an(i.error,"failed to get inflation");return i.result}async getInflationReward(e,n,r){const{commitment:i,config:s}=Tr(r),o=this._buildArgs([e.map(l=>l.toBase58())],i,void 0,{...s,epoch:n??(s==null?void 0:s.epoch)}),a=await this._rpcRequest("getInflationReward",o),c=Ot(a,n3t);if("error"in c)throw new an(c.error,"failed to get inflation reward");return c.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),n=Ot(e,w3t);if("error"in n)throw new an(n.error,"failed to get inflation rate");return n.result}async getEpochInfo(e){const{commitment:n,config:r}=Tr(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getEpochInfo",i),o=Ot(s,b3t);if("error"in o)throw new an(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),n=Ot(e,x3t);if("error"in n)throw new an(n.error,"failed to get epoch schedule");const r=n.result;return new Vbt(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),n=Ot(e,E3t);if("error"in n)throw new an(n.error,"failed to get leader schedule");return n.result}async getMinimumBalanceForRentExemption(e,n){const r=this._buildArgs([e],n),i=await this._rpcRequest("getMinimumBalanceForRentExemption",r),s=Ot(i,Z3t);return"error"in s?(console.warn("Unable to fetch minimum balance for rent exemption"),0):s.result}async getRecentBlockhashAndContext(e){const{context:n,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(e);return{context:n,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){const n=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),r=Ot(n,c5t);if("error"in r)throw new an(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(e,n){const r=this._buildArgs([e],n),i=await this._rpcRequest("getFeeCalculatorForBlockhash",r),s=Ot(i,l5t);if("error"in s)throw new an(s.error,"failed to get fee calculator");const{context:o,value:a}=s.result;return{context:o,value:a!==null?a.feeCalculator:null}}async getFeeForMessage(e,n){const r=g2(e.serialize()).toString("base64"),i=this._buildArgs([r],n),s=await this._rpcRequest("getFeeForMessage",i),o=Ot(s,_i(Wt(Me())));if("error"in o)throw new an(o.error,"failed to get fee for message");if(o.result===null)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(e){var o;const n=(o=e==null?void 0:e.lockedWritableAccounts)==null?void 0:o.map(a=>a.toBase58()),r=n!=null&&n.length?[n]:[],i=await this._rpcRequest("getRecentPrioritizationFees",r),s=Ot(i,v3t);if("error"in s)throw new an(s.error,"failed to get recent prioritization fees");return s.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(n){throw new Error("failed to get recent blockhash: "+n)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(n){throw new Error("failed to get recent blockhash: "+n)}}async getLatestBlockhashAndContext(e){const{commitment:n,config:r}=Tr(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getLatestBlockhash",i),o=Ot(s,s5t);if("error"in o)throw new an(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgs([e],r,void 0,i),o=await this._rpcRequest("isBlockhashValid",s),a=Ot(o,o5t);if("error"in a)throw new an(a.error,"failed to determine if the blockhash `"+e+"`is valid");return a.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),n=Ot(e,On(u3t));if("error"in n)throw new an(n.error,"failed to get version");return n.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),n=Ot(e,On($t()));if("error"in n)throw new an(n.error,"failed to get genesis hash");return n.result}async getBlock(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgsAtLeastConfirmed([e],r,void 0,i),o=await this._rpcRequest("getBlock",s);
538try{switch(i==null?void 0:i.transactionDetails){case"accounts":{const a=Ot(o,e5t);if("error"in a)throw a.error;return a.result}case"none":{const a=Ot(o,J3t);if("error"in a)throw a.error;return a.result}default:{const a=Ot(o,X3t);if("error"in a)throw a.error;const{result:c}=a;return c?{...c,transactions:c.transactions.map(({transaction:l,meta:u,version:d})=>({meta:u,transaction:{...l,message:vP(d,l.message)},version:d}))}:null}}}catch(a){throw new an(a,"failed to get confirmed block")}}async getParsedBlock(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",i),o=await this._rpcRequest("getBlock",s);try{switch(i==null?void 0:i.transactionDetails){case"accounts":{const a=Ot(o,n5t);if("error"in a)throw a.error;return a.result}case"none":{const a=Ot(o,r5t);if("error"in a)throw a.error;return a.result}default:{const a=Ot(o,t5t);if("error"in a)throw a.error;return a.result}}}catch(a){throw new an(a,"failed to get block")}}async getBlockProduction(e){let n,r;if(typeof e=="string")r=e;else if(e){const{commitment:a,...c}=e;r=a,n=c}const i=this._buildArgs([],r,"base64",n),s=await this._rpcRequest("getBlockProduction",i),o=Ot(s,f3t);if("error"in o)throw new an(o.error,"failed to get block production information");return o.result}async getTransaction(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgsAtLeastConfirmed([e],r,void 0,i),o=await this._rpcRequest("getTransaction",s),a=Ot(o,bP);if("error"in a)throw new an(a.error,"failed to get transaction");const c=a.result;return c&&{...c,transaction:{...c.transaction,message:vP(c.version,c.transaction.message)}}}async getParsedTransaction(e,n){const{commitment:r,config:i}=Tr(n),s=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",i),o=await this._rpcRequest("getTransaction",s),a=Ot(o,j6);if("error"in a)throw new an(a.error,"failed to get transaction");return a.result}async getParsedTransactions(e,n){const{commitment:r,config:i}=Tr(n),s=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],r,"jsonParsed",i)}));return(await this._rpcBatchRequest(s)).map(c=>{const l=Ot(c,j6);if("error"in l)throw new an(l.error,"failed to get transactions");return l.result})}async getTransactions(e,n){const{commitment:r,config:i}=Tr(n),s=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],r,void 0,i)}));return(await this._rpcBatchRequest(s)).map(c=>{const l=Ot(c,bP);if("error"in l)throw new an(l.error,"failed to get transactions");const u=l.result;return u&&{...u,transaction:{...u.transaction,message:vP(u.version,u.transaction.message)}}})}async getConfirmedBlock(e,n){const r=this._buildArgsAtLeastConfirmed([e],n),i=await this._rpcRequest("getBlock",r),s=Ot(i,i5t);if("error"in s)throw new an(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+e+" not found");const a={...o,transactions:o.transactions.map(({transaction:c,meta:l})=>{const u=new ph(c.message);return{meta:l,transaction:{...c,message:u}}})};return{...a,transactions:a.transactions.map(({transaction:c,meta:l})=>({meta:l,transaction:dl.populate(c.message,c.signatures)}))}}async getBlocks(e,n,r){const i=this._buildArgsAtLeastConfirmed(n!==void 0?[e,n]:[e],r),s=await this._rpcRequest("getBlocks",i),o=Ot(s,On(Ut(Me())));if("error"in o)throw new an(o.error,"failed to get blocks");return o.result}async getBlockSignatures(e,n){const r=this._buildArgsAtLeastConfirmed([e],n,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",r),s=Ot(i,Lte);if("error"in s)throw new an(s.error,"failed to get block");const o=s.result;if(!o)throw new Error("Block "+e+" not found");return o}async getConfirmedBlockSignatures(e,n){const r=this._buildArgsAtLeastConfirmed([e],n,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",r),s=Ot(i,Lte);if("error"in s)throw new an(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+e+" not found");return o}async getConfirmedTransaction(e,n){const r=this._buildArgsAtLeastConfirmed([e],n),i=await this._rpcRequest("getTransaction",r),s=Ot(i,bP);if("error"in s)throw new an(s.error,"failed to get transaction");const o=s.result;if(!o)return o;const a=new ph(o.transaction.message),c=o.transaction.signatures;return{...o,transaction:dl.populate(a,c)}}async getParsedConfirmedTransaction(e,n){const r=this._buildArgsAtLeastConfirmed([e],n,"jsonParsed"),i=await this._rpcRequest("getTransaction",r),s=Ot(i,j6);if("error"in s)throw new an(s.error,"failed to get confirmed transaction");return s.result}async getParsedConfirmedTransactions(e,n){const r=e.map(o=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([o],n,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(o=>{const a=Ot(o,j6);if("error"in a)throw new an(a.error,"failed to get confirmed transactions");return a.result})}async getConfirmedSignaturesForAddress(e,n,r){let i={},s=await this.getFirstAvailableBlock();for(;!("until"in i)&&(n--,!(n<=0||n<s));)try{const c=await this.getConfirmedBlockSignatures(n,"finalized");c.signatures.length>0&&(i.until=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}
vendor: 3,470 bytes, line 538
538let o=await this.getSlot("finalized");for(;!("before"in i)&&(r++,!(r>o));)try{const c=await this.getConfirmedBlockSignatures(r);c.signatures.length>0&&(i.before=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}return(await this.getConfirmedSignaturesForAddress2(e,i)).map(c=>c.signature)}async getConfirmedSignaturesForAddress2(e,n,r){const i=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,n),s=await this._rpcRequest("getConfirmedSignaturesForAddress2",i),o=Ot(s,M3t);if("error"in o)throw new an(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(e,n,r){const i=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,n),s=await this._rpcRequest("getSignaturesForAddress",i),o=Ot(s,O3t);if("error"in o)throw new an(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(e,n){const{context:r,value:i}=await this.getAccountInfoAndContext(e,n);let s=null;return i!==null&&(s=new Ote({key:e,state:Ote.deserialize(i.data)})),{context:r,value:s}}async getNonceAndContext(e,n){const{context:r,value:i}=await this.getAccountInfoAndContext(e,n);let s=null;return i!==null&&(s=jF.fromAccountData(i.data)),{context:r,value:s}}async getNonce(e,n){return await this.getNonceAndContext(e,n).then(r=>r.value).catch(r=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+r)})}async requestAirdrop(e,n){const r=await this._rpcRequest("requestAirdrop",[e.toBase58(),n]),i=Ot(r,u5t);if("error"in i)throw new an(i.error,`airdrop to ${e.toBase58()} failed`);return i.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await _m(100);const r=Date.now()-this._blockhashInfo.lastFetch>=Xbt;if(this._blockhashInfo.latestBlockhash!==null&&!r)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),n=this._blockhashInfo.latestBlockhash,r=n?n.blockhash:null;for(let i=0;i<50;i++){const s=await this.getLatestBlockhash("finalized");if(r!==s.blockhash)return this._blockhashInfo={latestBlockhash:s,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},s;await _m(Bbt/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:n,config:r}=Tr(e),i=this._buildArgs([],n,"base64",r),s=await this._rpcRequest("getStakeMinimumDelegation",i),o=Ot(s,_i(Me()));if("error"in o)throw new an(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(e,n,r){if("message"in e){const y=e.serialize(),v=Dn.Buffer.from(y).toString("base64");if(Array.isArray(n)||r!==void 0)throw new Error("Invalid arguments");const b=n||{};b.encoding="base64","commitment"in b||(b.commitment=this.commitment),n&&typeof n=="object"&&"innerInstructions"in n&&(b.innerInstructions=n.innerInstructions);const C=[v,b],x=await this._rpcRequest("simulateTransaction",C),_=Ot(x,Nte);if("error"in _)throw new Error("failed to simulate transaction: "+_.error.message);return _.result}let i;if(e instanceof dl){let m=e;i=new dl,i.feePayer=m.feePayer,i.instructions=e.instructions,i.nonceInfo=m.nonceInfo,i.signatures=m.signatures}else i=dl.populate(e),i._message=i._json=void 0;if(n!==void 0&&!Array.isArray(n))throw new Error("Invalid arguments");const s=n;
538if(i.nonceInfo&&s)i.sign(...s);else{let m=this._disableBlockhashCaching;for(;;){const y=await this._blockhashWithExpiryBlockHeight(m);if(i.lastValidBlockHeight=y.lastValidBlockHeight,i.recentBlockhash=y.blockhash,!s)break;if(i.sign(...s),!i.signature)throw new Error("!signature");const v=i.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(v)&&!this._blockhashInfo.transactionSignatures.includes(v)){this._blockhashInfo.simulatedSignatures.push(v);break}else m=!0}}const o=i._compile(),a=o.serialize(),l=i._serialize(a).toString("base64"),u={encoding:"base64",commitment:this.commitment};if(r){const m=(Array.isArray(r)?r:o.nonProgramIds()).map(y=>y.toBase58());u.accounts={encoding:"base64",addresses:m}}s&&(u.sigVerify=!0),n&&typeof n=="object"&&"innerInstructions"in n&&(u.innerInstructions=n.innerInstructions);const d=[l,u],h=await this._rpcRequest("simulateTransaction",d),f=Ot(h,Nte);if("error"in f){let m;if("data"in f.error&&(m=f.error.data.logs,m&&Array.isArray(m))){const y=` 539 `,v=y+m.join(y);console.error(f.error.message,v)}throw new Tte({action:"simulate",signature:"",transactionMessage:f.error.message,logs:m})}return f.result}async sendTransaction(e,n,r){if("version"in e){if(n&&Array.isArray(n))throw new Error("Invalid arguments");const o=e.serialize();return await this.sendRawTransaction(o,n)}if(n===void 0||!Array.isArray(n))throw new Error("Invalid arguments");const i=n;if(e.nonceInfo)e.sign(...i);else{let o=this._disableBlockhashCaching;for(;;){const a=await this._blockhashWithExpiryBlockHeight(o);if(e.lastValidBlockHeight=a.lastValidBlockHeight,e.recentBlockhash=a.blockhash,e.sign(...i),!e.signature)throw new Error("!signature");const c=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(c))o=!0;else{this._blockhashInfo.transactionSignatures.push(c);break}}}const s=e.serialize();return await this.sendRawTransaction(s,r)}async sendRawTransaction(e,n){const r=g2(e).toString("base64");return await this.sendEncodedTransaction(r,n)}async sendEncodedTransaction(e,n){const r={encoding:"base64"},i=n&&n.skipPreflight,s=i===!0?"processed":n&&n.preflightCommitment||this.commitment;n&&n.maxRetries!=null&&(r.maxRetries=n.maxRetries),n&&n.minContextSlot!=null&&(r.minContextSlot=n.minContextSlot),i&&(r.skipPreflight=i),s&&(r.preflightCommitment=s);const o=[e,r],a=await this._rpcRequest("sendTransaction",o),c=Ot(a,d5t);if("error"in c){let l;throw"data"in c.error&&(l=c.error.data.logs),new Tte({action:i?"send":"simulate",signature:"",transactionMessage:c.error.message,logs:l})}return c.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([n,r])=>{this._setSubscription(n,{...r,state:"pending"})})}_setSubscription(e,n){var i;const r=(i=this._subscriptionsByHash[e])==null?void 0:i.state;if(this._subscriptionsByHash[e]=n,r!==n.state){const s=this._subscriptionStateChangeCallbacksByHash[e];s&&s.forEach(o=>{try{o(n.state)}catch{}})}}_onSubscriptionStateChange(e,n){var s;const r=this._subscriptionHashByClientSubscriptionId[e];if(r==null)return()=>{};const i=(s=this._subscriptionStateChangeCallbacksByHash)[r]||(s[r]=new Set);return i.add(n),()=>{i.delete(n),i.size===0&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(r){r instanceof Error&&console.log(`Error when closing socket connection: ${r.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const e=this._rpcWebSocketGeneration,n=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async r=>{const i=this._subscriptionsByHash[r];
vendor: 5,528 bytes, line 539
539if(i!==void 0)switch(i.state){case"pending":case"unsubscribed":if(i.callbacks.size===0){delete this._subscriptionsByHash[r],i.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:s,method:o}=i;try{this._setSubscription(r,{...i,state:"subscribing"});const a=await this._rpcWebSocket.call(o,s);this._setSubscription(r,{...i,serverSubscriptionId:a,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[a]=i.callbacks,await this._updateSubscriptions()}catch(a){if(console.error(`Received ${a instanceof Error?"":"JSON-RPC "}error calling \`${o}\``,{args:s,error:a}),!n())return;this._setSubscription(r,{...i,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":i.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:s,unsubscribeMethod:o}=i;if(this._subscriptionsAutoDisposedByRpc.has(s))this._subscriptionsAutoDisposedByRpc.delete(s);else{this._setSubscription(r,{...i,state:"unsubscribing"}),this._setSubscription(r,{...i,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[s])}catch(a){if(a instanceof Error&&console.error(`${o} error:`,a.message),!n())return;this._setSubscription(r,{...i,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(r,{...i,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,n){const r=this._subscriptionCallbacksByServerSubscriptionId[e];r!==void 0&&r.forEach(i=>{try{i(...n)}catch(s){console.error(s)}})}_wsOnAccountNotification(e){const{result:n,subscription:r}=Ot(e,j3t);this._handleServerNotification(r,[n.value,n.context])}_makeSubscription(e,n){const r=this._nextClientSubscriptionId++,i=Rte([e.method,n]),s=this._subscriptionsByHash[i];return s===void 0?this._subscriptionsByHash[i]={...e,args:n,callbacks:new Set([e.callback]),state:"pending"}:s.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const o=this._subscriptionsByHash[i];Yr(o!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),o.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,n,r){const{commitment:i,config:s}=Tr(r),o=this._buildArgs([e.toBase58()],i||this._commitment||"finalized","base64",s);return this._makeSubscription({callback:n,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:n,subscription:r}=Ot(e,D3t);this._handleServerNotification(r,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}onProgramAccountChange(e,n,r,i){const{commitment:s,config:o}=Tr(r),a=this._buildArgs([e.toBase58()],s||this._commitment||"finalized","base64",o||(i?{filters:jte(i)}:void 0));return this._makeSubscription({callback:n,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},a)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,n,r){const i=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:n,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},i)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:n,subscription:r}=Ot(e,f5t);this._handleServerNotification(r,[n.value,n.context])}_wsOnSlotNotification(e){const{result:n,subscription:r}=Ot(e,B3t);this._handleServerNotification(r,[n])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:n,subscription:r}=Ot(e,U3t);this._handleServerNotification(r,[n])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,n){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${n}' events could not be found.`)}_buildArgs(e,n,r,i){const s=n||this._commitment;if(s||r||i){let o={};r&&(o.encoding=r),s&&(o.commitment=s),i&&(o=Object.assign(o,i)),e.push(o)}return e}_buildArgsAtLeastConfirmed(e,n,r,i){const s=n||this._commitment;if(s&&!["confirmed","finalized"].includes(s))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,n,r,i)}_wsOnSignatureNotification(e){const{result:n,subscription:r}=Ot(e,z3t);n.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,n.value==="receivedSignature"?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}onSignature(e,n,r){const i=this._buildArgs([e],r||this._commitment||"finalized"),s=this._makeSubscription({callback:(o,a)=>
539{if(o.type==="status"){n(o.result,a);try{this.removeSignatureListener(s)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return s}onSignatureWithOptions(e,n,r){const{commitment:i,...s}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([e],i,void 0,s),a=this._makeSubscription({callback:(c,l)=>{n(c,l);try{this.removeSignatureListener(a)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:n,subscription:r}=Ot(e,W3t);this._handleServerNotification(r,[n])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}Object.freeze({CreateLookupTable:{index:0,layout:xe.struct([xe.u32("instruction"),m2("recentSlot"),xe.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:xe.struct([xe.u32("instruction")])},ExtendLookupTable:{index:2,layout:xe.struct([xe.u32("instruction"),m2(),xe.seq(zn(),xe.offset(xe.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:xe.struct([xe.u32("instruction")])},CloseLookupTable:{index:4,layout:xe.struct([xe.u32("instruction")])}});new bn("AddressLookupTab1e1111111111111111111111111");Object.freeze({RequestUnits:{index:0,layout:xe.struct([xe.u8("instruction"),xe.u32("units"),xe.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:xe.struct([xe.u8("instruction"),xe.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:xe.struct([xe.u8("instruction"),xe.u32("units")])},SetComputeUnitPrice:{index:3,layout:xe.struct([xe.u8("instruction"),m2("microLamports")])}});new bn("ComputeBudget111111111111111111111111111111");xe.struct([xe.u8("numSignatures"),xe.u8("padding"),xe.u16("signatureOffset"),xe.u16("signatureInstructionIndex"),xe.u16("publicKeyOffset"),xe.u16("publicKeyInstructionIndex"),xe.u16("messageDataOffset"),xe.u16("messageDataSize"),xe.u16("messageInstructionIndex")]);new bn("Ed25519SigVerify111111111111111111111111111");Sbt.utils.isValidPrivateKey;xe.struct([xe.u8("numSignatures"),xe.u16("signatureOffset"),xe.u8("signatureInstructionIndex"),xe.u16("ethAddressOffset"),xe.u8("ethAddressInstructionIndex"),xe.u16("messageDataOffset"),xe.u16("messageDataSize"),xe.u8("messageInstructionIndex"),xe.blob(20,"ethAddress"),xe.blob(64,"signature"),xe.u8("recoveryId")]);new bn("KeccakSecp256k11111111111111111111111111111");var x2e;new bn("StakeConfig11111111111111111111111111111111");class E2e{constructor(e,n,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=n,this.custodian=r}}x2e=E2e;E2e.default=new x2e(0,0,bn.default);Object.freeze({Initialize:{index:0,layout:xe.struct([xe.u32("instruction"),Pbt(),Rbt()])},Authorize:{index:1,layout:xe.struct([xe.u32("instruction"),zn("newAuthorized"),xe.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:xe.struct([xe.u32("instruction")])},Split:{index:3,layout:xe.struct([xe.u32("instruction"),xe.ns64("lamports")])},Withdraw:{index:4,layout:xe.struct([xe.u32("instruction"),xe.ns64("lamports")])},Deactivate:{index:5,layout:xe.struct([xe.u32("instruction")])},Merge:{index:7,layout:xe.struct([xe.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:xe.struct([xe.u32("instruction"),zn("newAuthorized"),xe.u32("stakeAuthorizationType"),Lm("authoritySeed"),zn("authorityOwner")])}});new bn("Stake11111111111111111111111111111111111111");Object.freeze({InitializeAccount:{index:0,layout:xe.struct([xe.u32("instruction"),Mbt()])},Authorize:{index:1,layout:xe.struct([xe.u32("instruction"),zn("newAuthorized"),xe.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:xe.struct([xe.u32("instruction"),xe.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:xe.struct([xe.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:xe.struct([xe.u32("instruction"),Obt()])}});new bn("Vote111111111111111111111111111111111111111");new bn("Va1idator1nfo111111111111111111111111111111");dt({name:$t(),website:hn($t()),details:hn($t()),iconUrl:hn($t()),keybaseUsername:hn($t())});
539new bn("Vote111111111111111111111111111111111111111");xe.struct([zn("nodePubkey"),zn("authorizedWithdrawer"),xe.u8("commission"),xe.nu64(),xe.seq(xe.struct([xe.nu64("slot"),xe.u32("confirmationCount")]),xe.offset(xe.u32(),-8),"votes"),xe.u8("rootSlotValid"),xe.nu64("rootSlot"),xe.nu64(),xe.seq(xe.struct([xe.nu64("epoch"),zn("authorizedVoter")]),xe.offset(xe.u32(),-8),"authorizedVoters"),xe.struct([xe.seq(xe.struct([zn("authorizedPubkey"),xe.nu64("epochOfLastAuthorizedSwitch"),xe.nu64("targetEpoch")]),32,"buf"),xe.nu64("idx"),xe.u8("isEmpty")],"priorVoters"),xe.nu64(),xe.seq(xe.struct([xe.nu64("epoch"),xe.nu64("credits"),xe.nu64("prevCredits")]),xe.offset(xe.u32(),-8),"epochCredits"),xe.struct([xe.nu64("slot"),xe.nu64("timestamp")],"lastTimestamp")]);const Bte={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function m5t(t,e){const n="https";if(!t)return Bte[n].devnet;const r=Bte[n][t];if(!r)throw new Error(`Unknown ${n} cluster: ${t}`);return r}const C2e=E.createContext({});function y5t(){return E.useContext(C2e)}const w5t=({children:t,endpoint:e,config:n={commitment:"confirmed"}})=>{const r=E.useMemo(()=>new g5t(e,n),[e,n]);return Rt.createElement(C2e.Provider,{value:{connection:r}},t)};class Bs extends Error{constructor(e,n){super(e),this.error=n}}class A3 extends Bs{constructor(){super(...arguments),this.name="WalletNotReadyError"}}class nb extends Bs{constructor(){super(...arguments),this.name="WalletConfigError"}}class b7 extends Bs{constructor(){super(...arguments),this.name="WalletConnectionError"}}class v5t extends Bs{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}class b5t extends Bs{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class Bm extends Bs{constructor(){super(...arguments),this.name="WalletAccountError"}}class _2e extends Bs{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}class xu extends Bs{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}class I0 extends Bs{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}class T0 extends Bs{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class S2e extends Bs{constructor(){super(...arguments),this.name="WalletSignMessageError"}}class Fte extends Bs{constructor(){super(...arguments),this.name="WalletSignInError"}}var oi;(function(t){t.Installed="Installed",t.NotDetected="NotDetected",t.Loadable="Loadable",t.Unsupported="Unsupported"})(oi||(oi={}));class A2e extends wp{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(e,n,r={}){const i=this.publicKey;if(!i)throw new xu;return e.feePayer=e.feePayer||i,e.recentBlockhash=e.recentBlockhash||(await n.getLatestBlockhash({commitment:r.preflightCommitment,minContextSlot:r.minContextSlot})).blockhash,e}}function P0(t){return"version"in t}class x5t extends A2e{async sendTransaction(e,n,r={}){let i=!0;try{if(P0(e)){if(!this.supportedTransactionVersions)throw new I0("Sending versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(e.version))throw new I0(`Sending transaction version ${e.version} isn't supported by this wallet`);try{e=await this.signTransaction(e);const s=e.serialize();return await n.sendRawTransaction(s,r)}catch(s){throw s instanceof T0?(i=!1,s):new I0(s==null?void 0:s.message,s)}}else try{const{signers:s,...o}=r;e=await this.prepareTransaction(e,n,o),s!=null&&s.length&&e.partialSign(...s),e=await this.signTransaction(e);const a=e.serialize();return await n.sendRawTransaction(a,o)}catch(s){throw s instanceof T0?(i=!1,s):new I0(s==null?void 0:s.message,s)}}catch(s){throw i&&this.emit("error",s),s}}async signAllTransactions(e){for(const r of e)if(P0(r)){if(!this.supportedTransactionVersions)throw new T0("Signing versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(r.version))throw new T0(`Signing transaction version ${r.version} isn't supported by this wallet`)}const n=[];for(const r of e)n.push(await this.signTransaction(r));return n}}class E5t extends x5t{}
539class C5t extends E5t{}const sa="solana:signAndSendTransaction",s1="solana:signIn",kf="solana:signMessage",si="solana:signTransaction",hy="standard:connect",mE="standard:disconnect",ES="standard:events";function _5t(t){return hy in t.features&&ES in t.features&&(sa in t.features||si in t.features)}var oN;(function(t){t.Mainnet="mainnet-beta",t.Testnet="testnet",t.Devnet="devnet"})(oN||(oN={}));class Ute extends Bs{constructor(){super(...arguments),this.name="WalletNotSelectedError"}}const S5t=[],CS={autoConnect:!1,connecting:!1,connected:!1,disconnecting:!1,select(){tl("call","select")},connect(){return Promise.reject(tl("call","connect"))},disconnect(){return Promise.reject(tl("call","disconnect"))},sendTransaction(){return Promise.reject(tl("call","sendTransaction"))},signTransaction(){return Promise.reject(tl("call","signTransaction"))},signAllTransactions(){return Promise.reject(tl("call","signAllTransactions"))},signMessage(){return Promise.reject(tl("call","signMessage"))},signIn(){return Promise.reject(tl("call","signIn"))}};Object.defineProperty(CS,"wallets",{get(){return tl("read","wallets"),S5t}});Object.defineProperty(CS,"wallet",{get(){return tl("read","wallet"),null}});Object.defineProperty(CS,"publicKey",{get(){return tl("read","publicKey"),null}});function tl(t,e){const n=new Error(`You have tried to ${t} "${e}" on a WalletContext without providing one. Make sure to render a WalletProvider as an ancestor of the component that uses WalletContext.`);return console.error(n),n}const k2e=E.createContext(CS);function A5t(){return E.useContext(k2e)}function k5t(t,e){const n=E.useState(()=>{try{const s=localStorage.getItem(t);if(s)return JSON.parse(s)}catch(s){typeof window<"u"&&console.error(s)}return e}),r=n[0],i=E.useRef(!0);return E.useEffect(()=>{if(i.current){i.current=!1;return}try{r===null?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(r))}catch(s){typeof window<"u"&&console.error(s)}},[r,t]),n}function $5t(t){return Object.freeze({...t,decode:(e,n=0)=>t.read(e,n)[0]})}var I5t=t=>$5t({read(e,n){const r=n===0||n<=-e.byteLength?e:e.slice(n);if(r.length===0)return["",0];let i=r.findIndex(c=>c!==0);i=i===-1?r.length:i;const s=t[0].repeat(i);if(i===r.length)return[s,e.length];const o=r.slice(i).reduce((c,l)=>c*256n+BigInt(l),0n),a=T5t(o,t);return[s+a,e.length]}});function T5t(t,e){const n=BigInt(e.length),r=[];for(;t>0n;)r.unshift(e[Number(t%n)]),t/=n;return r.join("")}var P5t="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",R5t=()=>I5t(P5t);function xP(t){switch(t){case"processed":case"confirmed":case"finalized":case void 0:return t;case"recent":return"processed";case"single":case"singleGossip":return"confirmed";case"max":case"root":return"finalized";default:return}}const yE="solana:mainnet",M5t="solana:devnet",O5t="solana:testnet",j5t="solana:localnet",N5t="https://api.mainnet-beta.solana.com";function D5t(t){return t.includes(N5t)?yE:/\bdevnet\b/i.test(t)?M5t:/\btestnet\b/i.test(t)?O5t:/\blocalhost\b/i.test(t)||/\b127\.0\.0\.1\b/.test(t)?j5t:yE}function L5t(t){let e=`${t.domain} wants you to sign in with your Solana account: 540`;e+=`${t.address}`,t.statement&&(e+=` 541 542${t.statement}`);const n=[];if(t.uri&&n.push(`URI: ${t.uri}`),t.version&&n.push(`Version: ${t.version}`),t.chainId&&n.push(`Chain ID: ${t.chainId}`),t.nonce&&n.push(`Nonce: ${t.nonce}`),t.issuedAt&&n.push(`Issued At: ${t.issuedAt}`),t.expirationTime&&n.push(`Expiration Time: ${t.expirationTime}`),t.notBefore&&n.push(`Not Before: ${t.notBefore}`),t.requestId&&n.push(`Request ID: ${t.requestId}`),t.resources){n.push("Resources:");for(const r of t.resources)n.push(`- ${r}`)}return n.length&&(e+=` 543 544${n.join(` 545`)}`),e}const ho={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:"ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",ERROR_REFLECTOR_ID_OUT_OF_RANGE:"ERROR_REFLECTOR_ID_OUT_OF_RANGE",ERROR_FORBIDDEN_WALLET_BASE_URL:"ERROR_FORBIDDEN_WALLET_BASE_URL",ERROR_SECURE_CONTEXT_REQUIRED:"ERROR_SECURE_CONTEXT_REQUIRED",ERROR_SESSION_CLOSED:"ERROR_SESSION_CLOSED",ERROR_SESSION_TIMEOUT:"ERROR_SESSION_TIMEOUT",ERROR_WALLET_NOT_FOUND:"ERROR_WALLET_NOT_FOUND",ERROR_INVALID_PROTOCOL_VERSION:"ERROR_INVALID_PROTOCOL_VERSION",ERROR_BROWSER_NOT_SUPPORTED:"ERROR_BROWSER_NOT_SUPPORTED",ERROR_LOOPBACK_ACCESS_BLOCKED:"ERROR_LOOPBACK_ACCESS_BLOCKED",ERROR_ASSOCIATION_CANCELLED:"ERROR_ASSOCIATION_CANCELLED"};
545var js=class extends Error{constructor(...e){const[n,r,i]=e;super(r);Ft(this,"data");Ft(this,"code");this.code=n,this.data=i,this.name="SolanaMobileWalletAdapterError"}},$2e=class extends Error{constructor(...e){const[n,r,i,s]=e;super(i);Ft(this,"data");Ft(this,"code");Ft(this,"jsonRpcMessageId");this.code=r,this.data=s,this.jsonRpcMessageId=n,this.name="SolanaMobileWalletAdapterProtocolError"}};function B5t(t){return window.btoa(t)}function zte(t,e){return window.btoa(String.fromCharCode.call(null,...t))}function I2e(t){return new Uint8Array(window.atob(t).split("").map(e=>e.charCodeAt(0)))}async function EP(t,e){const n=await crypto.subtle.exportKey("raw",t),r=await crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},e,n),i=new Uint8Array(n.byteLength+r.byteLength);return i.set(new Uint8Array(n),0),i.set(new Uint8Array(r),n.byteLength),i}function F5t(t){return R5t().decode(t)}function U5t(t){return F5t(I2e(t))}function z5t(t){return L5t(t)}function W5t(t){return B5t(z5t(t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const H5t="solana:signTransactions",Wte="solana:cloneAuthorization";function V5t(t,e){return new Proxy({},{get(n,r){return r==="then"?null:(n[r]==null&&(n[r]=async function(i){const{method:s,params:o}=q5t(r,i,t),a=await e(s,o);return s==="authorize"&&o.sign_in_payload&&!a.sign_in_result&&(a.sign_in_result=await G5t(o.sign_in_payload,a,e)),K5t(r,a,t)}),n[r])},defineProperty(){return!1},deleteProperty(){return!1}})}function q5t(t,e,n){let r=e,i=t.toString().replace(/[A-Z]/g,s=>`_${s.toLowerCase()}`).toLowerCase();switch(t){case"authorize":{const s=r;let{chain:o}=s;if(n==="legacy"){switch(o){case"solana:testnet":o="testnet";break;case"solana:devnet":o="devnet";break;case"solana:mainnet":o="mainnet-beta";break;default:o=s.cluster}s.cluster=o,r=s}else{switch(o){case"testnet":case"devnet":o=`solana:${o}`;break;case"mainnet-beta":o="solana:mainnet";break}s.chain=o,r=s}}case"reauthorize":{const{auth_token:s,identity:o}=r;if(s)switch(n){case"legacy":i="reauthorize",r={auth_token:s,identity:o};break;default:i="authorize";break}break}}return{method:i,params:r}}function K5t(t,e,n){switch(t){case"getCapabilities":{const r=e;switch(n){case"legacy":{const i=[H5t];return r.supports_clone_authorization===!0&&i.push(Wte),{...r,features:i}}case"v1":return{...r,supports_sign_and_send_transactions:!0,supports_clone_authorization:r.features.includes(Wte)}}}}return e}async function G5t(t,e,n){const r=t.domain??window.location.host,i=e.accounts[0].address,s=W5t({...t,domain:r,address:U5t(i)}),o=I2e((await n("sign_messages",{addresses:[i],payloads:[s]})).signed_payloads[0]),a=zte(o.slice(0,o.length-64)),c=zte(o.slice(o.length-64));return{address:i,signed_message:a.length==0?s:a,signature:c}}function Z5t(t){if(t>=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");const e=new ArrayBuffer(4);return new DataView(e).setUint32(0,t,!1),new Uint8Array(e)}const aN=12;async function Y5t(t,e,n){const r=Z5t(e),i=new Uint8Array(aN);crypto.getRandomValues(i);const s=await crypto.subtle.encrypt(P2e(r,i),n,new TextEncoder().encode(t)),o=new Uint8Array(r.byteLength+i.byteLength+s.byteLength);return o.set(new Uint8Array(r),0),o.set(new Uint8Array(i),r.byteLength),o.set(new Uint8Array(s),r.byteLength+i.byteLength),o}async function T2e(t,e){const n=t.slice(0,4),r=t.slice(4,4+aN),i=t.slice(4+aN),s=await crypto.subtle.decrypt(P2e(n,r),e,i);return Q5t().decode(s)}function P2e(t,e){return{additionalData:t,iv:e,name:"AES-GCM",tagLength:128}}let CP;function Q5t(){return CP===void 0&&(CP=new TextDecoder("utf-8")),CP}async function X5t(){return await crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"])}async function _P(){return await crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"])}function J5t(t){let e="";const n=new Uint8Array(t),r=n.byteLength;for(let i=0;i<r;i++)e+=String.fromCharCode(n[i]);return window.btoa(e)}function ext(){return R2e(49152+Math.floor(Math.random()*16384))}function R2e(t){if(t<49152||t>65535)throw new js(ho.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,`Association port number must be between 49152 and 65535. ${t} given.`,{port:t});return t}function txt(t){return t.replace(/[/+=]/g,e=>({"/":"_","+":"-","=":"."})[e])}const nxt="solana-wallet";function Hte(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function rxt(t,e){let n=null;if(e){try{n=new URL(e)}catch{}if((n==null?void 0:n.protocol)!=="https:")throw new js(ho.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}n||(n=new URL(`${nxt}:/`));const r=t.startsWith("/")?t:[...Hte(n.pathname),...Hte(t)].join("/");return new URL(r,n)}
545async function ixt(t,e,n,r=["v1"]){const i=R2e(e),s=J5t(await crypto.subtle.exportKey("raw",t)),o=rxt("v1/associate/local",n);return o.searchParams.set("association",txt(s)),o.searchParams.set("port",`${i}`),r.forEach(a=>{o.searchParams.set("v",a)}),o}async function sxt(t,e){const n=JSON.stringify(t),r=t.id;return Y5t(n,r,e)}async function oxt(t,e){const n=await T2e(t,e),r=JSON.parse(n);if(Object.hasOwnProperty.call(r,"error"))throw new $2e(r.id,r.error.code,r.error.message);return r}async function axt(t,e,n){const[r,i]=await Promise.all([crypto.subtle.exportKey("raw",e),crypto.subtle.importKey("raw",t.slice(0,65),{name:"ECDH",namedCurve:"P-256"},!1,[])]),s=await crypto.subtle.deriveBits({name:"ECDH",public:i},n,256),o=await crypto.subtle.importKey("raw",s,"HKDF",!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(r),info:new Uint8Array},o,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"])}async function cxt(t,e){const n=await T2e(t,e),r=JSON.parse(n);let i="legacy";if(Object.hasOwnProperty.call(r,"v"))switch(r.v){case 1:case"1":case"v1":i="v1";break;case"legacy":i="legacy";break;default:throw new js(ho.ERROR_INVALID_PROTOCOL_VERSION,`Unknown/unsupported protocol version: ${r.v}`)}return{protocol_version:i}}const wE={Firefox:0,Other:1};function lxt(){return navigator.userAgent.indexOf("Firefox/")!==-1?wE.Firefox:wE.Other}function uxt(){return new Promise((t,e)=>{function n(){clearTimeout(i),window.removeEventListener("blur",r)}function r(){n(),t()}window.addEventListener("blur",r);const i=setTimeout(()=>{n(),e()},3e3)})}let Pv=null;function dxt(t){Pv==null&&(Pv=document.createElement("iframe"),Pv.style.display="none",document.body.appendChild(Pv)),Pv.contentWindow.location.href=t.toString()}async function hxt(t){if(t.protocol==="https:")window.location.assign(t);else try{const e=lxt();switch(e){case wE.Firefox:dxt(t);break;case wE.Other:{const n=uxt();window.location.assign(t),await n;break}default:}}catch{throw new js(ho.ERROR_WALLET_NOT_FOUND,"Found no installed wallet that supports the mobile wallet protocol.")}}async function fxt(t,e){const n=ext();return await hxt(await ixt(t,n,e)),n}const Vte={retryDelayScheduleMs:[150,150,200,500,500,750,750,1e3],timeoutMs:3e4},pxt="com.solana.mobilewalletadapter.v1";function gxt(){if(typeof window>"u"||window.isSecureContext!==!0)throw new js(ho.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}function mxt(t){let e;try{e=new URL(t)}catch{throw new js(ho.ERROR_FORBIDDEN_WALLET_BASE_URL,"Invalid base URL supplied by wallet")}if(e.protocol!=="https:")throw new js(ho.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}function qte(t){return new DataView(t).getUint32(0,!1)}async function yxt(t){gxt();const e=await X5t(),n=`ws://localhost:${await fxt(e.publicKey,t==null?void 0:t.baseUri)}/solana-wallet`;let r;const i=(()=>{const d=[...Vte.retryDelayScheduleMs];return()=>d.length>1?d.shift():d[0]})();let s=1,o=0,a={__type:"disconnected"},c,l=!1,u;return{close:()=>{c.close(),u()},wallet:new Promise((d,h)=>{const f={},m=async()=>{if(a.__type!=="connecting"){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${a.__type}\`.`);return}c.removeEventListener("open",m);const{associationKeypair:$}=a,I=await _P();c.send(await EP(I.publicKey,$.privateKey)),a={__type:"hello_req_sent",associationPublicKey:$.publicKey,ecdhPrivateKey:I.privateKey}},y=$=>{$.wasClean?a={__type:"disconnected"}:h(new js(ho.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${$.code}: ${$.reason}).`,{closeEvent:$})),C()},v=async $=>{C(),Date.now()-r>=Vte.timeoutMs?h(new js(ho.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket at ${n}.`)):(await new Promise(I=>{const R=i();x=window.setTimeout(I,R)}),_())},b=async $=>{const I=await $.data.arrayBuffer();switch(a.__type){case"connecting":{if(I.byteLength!==0)throw new Error("Encountered unexpected message while connecting");const R=await _P();c.send(await EP(R.publicKey,e.privateKey)),a={__type:"hello_req_sent",associationPublicKey:e.publicKey,ecdhPrivateKey:R.privateKey};break}case"connected":try{const R=qte(I.slice(0,4));
545if(R!==o+1)throw new Error("Encrypted message has invalid sequence number");o=R;const N=await oxt(I,a.sharedSecret),T=f[N.id];delete f[N.id],T.resolve(N.result)}catch(R){if(R instanceof $2e){const N=f[R.jsonRpcMessageId];delete f[R.jsonRpcMessageId],N.reject(R)}else throw R}break;case"hello_req_sent":{if(I.byteLength===0){const U=await _P();c.send(await EP(U.publicKey,e.privateKey)),a={__type:"hello_req_sent",associationPublicKey:e.publicKey,ecdhPrivateKey:U.privateKey};break}const R=await axt(I,a.associationPublicKey,a.ecdhPrivateKey),N=I.slice(65),T=N.byteLength!==0?await(async()=>{const U=qte(N.slice(0,4));if(U!==o+1)throw new Error("Encrypted message has invalid sequence number");return o=U,cxt(N,R)})():{protocol_version:"legacy"};a={__type:"connected",sharedSecret:R,sessionProperties:T};const O=V5t(T.protocol_version,async(U,z)=>{const L=s++;return c.send(await sxt({id:L,jsonrpc:"2.0",method:U,params:z??{}},R)),new Promise((S,k)=>{f[L]={resolve(M){switch(U){case"authorize":case"reauthorize":{const{wallet_uri_base:W}=M;if(W!=null)try{mxt(W)}catch(H){k(H);return}break}}S(M)},reject:k}})});l=!0;try{d(O)}catch(U){h(U)}break}}};u=()=>{c.removeEventListener("message",b),C(),l||h(new js(ho.ERROR_SESSION_CLOSED,"The wallet session was closed before connection.",{closeEvent:new CloseEvent("socket was closed before connection")}))};let C,x;const _=()=>{C&&C(),a={__type:"connecting",associationKeypair:e},r===void 0&&(r=Date.now()),c=new WebSocket(n,[pxt]),c.addEventListener("open",m),c.addEventListener("close",y),c.addEventListener("error",v),c.addEventListener("message",b),C=()=>{window.clearTimeout(x),c.removeEventListener("open",m),c.removeEventListener("close",y),c.removeEventListener("error",v),c.removeEventListener("message",b)}};_()})}}function wxt(t,e){if(t===e)return!0;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function N6(t){return window.btoa(String.fromCharCode.call(null,...t))}function hf(t){return new Uint8Array(window.atob(t).split("").map(e=>e.charCodeAt(0)))}const vxt=` 546<div class="mobile-wallet-adapter-embedded-loading-indicator" role="dialog" aria-modal="true" aria-labelledby="modal-title"> 547 <div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div> 548 <div class="mobile-wallet-adapter-embedded-loading-container"> 549 <div class="mobile-wallet-adapter-embedded-loading-animation"></div> 550 </div> 551</div> 552`,bxt=` 553.mobile-wallet-adapter-embedded-loading-indicator { 554 display: flex; /* Use flexbox to center content */ 555 justify-content: center; /* Center horizontally */ 556 align-items: start; /* Center vertically */ 557 position: fixed; /* Stay in place */ 558 z-index: 1; /* Sit on top */ 559 left: 0; 560 top: 0; 561 width: 100%; /* Full width */ 562 height: 100%; /* Full height */ 563 background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ 564 overflow-y: auto; /* enable scrolling */ 565} 566 567.mobile-wallet-adapter-embedded-loading-container { 568 display: flex; 569 margin: auto; 570} 571 572.mobile-wallet-adapter-embedded-loading-animation { 573 position: relative; 574 left: -9999px; 575 width: 10px; 576 height: 10px; 577 border-radius: 5px; 578 background-color: var(--spinner-color); 579 color: var(--spinner-color); 580 box-shadow: 9984px 0 0 0 var(--spinner-color), 581 9999px 0 0 0 var(--spinner-color), 582 10014px 0 0 0 var(--spinner-color); 583 animation: dot-typing 1.5s infinite linear; 584} 585 586@keyframes dot-typing { 587 0% { 588 box-shadow: 9984px 0 0 0 var(--spinner-color), 589 9999px 0 0 0 var(--spinner-color), 590 10014px 0 0 0 var(--spinner-color); 591 } 592 16.667% { 593 box-shadow: 9984px -10px 0 0 var(--spinner-color), 594 9999px 0 0 0 var(--spinner-color), 595 10014px 0 0 0 var(--spinner-color); 596 } 597 33.333% { 598 box-shadow: 9984px 0 0 0 var(--spinner-color), 599 9999px 0 0 0 var(--spinner-color), 600 10014px 0 0 0 var(--spinner-color); 601 } 602 50% { 603 box-shadow: 9984px 0 0 0 var(--spinner-color), 604 9999px -10px 0 0 var(--spinner-color), 605 10014px 0 0 0 var(--spinner-color); 606 } 607 66.667% { 608 box-shadow: 9984px 0 0 0 var(--spinner-color), 609 9999px 0 0 0 var(--spinner-color), 610 10014px 0 0 0 var(--spinner-color); 611 } 612 83.333% { 613 box-shadow: 9984px 0 0 0 var(--spinner-color), 614 9999px 0 0 0 var(--spinner-color), 615 10014px -10px 0 0 var(--spinner-color); 616 } 617 100% { 618 box-shadow: 9984px 0 0 0 var(--spinner-color), 619 9999px 0 0 0 var(--spinner-color), 620 10014px 0 0 0 var(--spinner-color); 621 } 622} 623`;var As,Bf,V0,mp,M2e,O2e,j2e,W3,Uie,xxt=(Uie=class{constructor(){Je(this,mp);Je(this,As,null);Je(this,Bf,{});Je(this,V0,!1);Ft(this,"dom",null);Ft(this,"open",()=>{console.debug("Modal open"),Mt(this,mp,O2e).call(this),ne(this,As)&&(ne(this,As).style.display="flex")});Ft(this,"close",(t=void 0)=>{var e;console.debug("Modal close"),Mt(this,mp,j2e).call(this),ne(this,As)&&(ne(this,As).style.display="none"),(e=ne(this,Bf).close)==null||e.forEach(n=>n(t))});Je(this,W3,t=>{t.key==="Escape"&&this.close(t)});this.init=this.init.bind(this),Xe(this,As,document.getElementById("mobile-wallet-adapter-embedded-root-ui"))}
623async init(){console.log("Injecting modal"),Mt(this,mp,M2e).call(this)}addEventListener(t,e){var n;return(n=ne(this,Bf)[t])!=null&&n.push(e)||(ne(this,Bf)[t]=[e]),()=>this.removeEventListener(t,e)}removeEventListener(t,e){var n;ne(this,Bf)[t]=(n=ne(this,Bf)[t])==null?void 0:n.filter(r=>e!==r)}},As=new WeakMap,Bf=new WeakMap,V0=new WeakMap,mp=new WeakSet,M2e=function(){if(this.dom)return;Xe(this,As,document.createElement("div")),ne(this,As).id="mobile-wallet-adapter-embedded-root-ui",ne(this,As).innerHTML=vxt,ne(this,As).style.display="none";const t=document.createElement("style");t.id="mobile-wallet-adapter-embedded-modal-styles",t.textContent=bxt;const e=document.createElement("div");this.dom=e.attachShadow({mode:"closed"}),e.style.setProperty("--spinner-color","#FFFFFF"),this.dom.appendChild(t),this.dom.appendChild(ne(this,As)),document.body.appendChild(e)},O2e=function(){!ne(this,As)||ne(this,V0)||([...ne(this,As).querySelectorAll("[data-modal-close]")].forEach(t=>t==null?void 0:t.addEventListener("click",e=>{this.close(e)})),window.addEventListener("load",this.close),document.addEventListener("keydown",ne(this,W3)),Xe(this,V0,!0))},j2e=function(){ne(this,V0)&&(window.removeEventListener("load",this.close),document.removeEventListener("keydown",ne(this,W3)),ne(this,As)&&([...ne(this,As).querySelectorAll("[data-modal-close]")].forEach(t=>t==null?void 0:t.removeEventListener("click",this.close)),Xe(this,V0,!1)))},W3=new WeakMap,Uie);const Ext=` 624<div class="mobile-wallet-adapter-embedded-modal-container" role="dialog" aria-modal="true" aria-labelledby="modal-title"> 625 <div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div> 626 <div class="mobile-wallet-adapter-embedded-modal-card"> 627 <div> 628 <button data-modal-close class="mobile-wallet-adapter-embedded-modal-close"> 629 <svg width="14" height="14"> 630 <path d="M 6.7125,8.3036995 1.9082,13.108199 c -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 C 0.1056,12.896899 0,12.631699 0,12.312499 c 0,-0.3192 0.1056,-0.5844 0.3167,-0.7958 L 5.1212,6.7124995 0.3167,1.9082 C 0.1056,1.6969 0,1.4317 0,1.1125 0,0.7933 0.1056,0.5281 0.3167,0.3167 0.5281,0.1056 0.7933,0 1.1125,0 1.4317,0 1.6969,0.1056 1.9082,0.3167 L 6.7125,5.1212 11.5167,0.3167 C 11.7281,0.1056 11.9933,0 12.3125,0 c 0.3192,0 0.5844,0.1056 0.7957,0.3167 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 L 8.3037001,6.7124995 13.1082,11.516699 c 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 z" /> 631 </svg> 632 </button> 633 </div> 634 <div class="mobile-wallet-adapter-embedded-modal-content"></div> 635 </div> 636</div> 637`,Cxt=` 638.mobile-wallet-adapter-embedded-modal-container { 639 display: flex; /* Use flexbox to center content */ 640 justify-content: center; /* Center horizontally */ 641 align-items: center; /* Center vertically */ 642 position: fixed; /* Stay in place */ 643 z-index: 2147483647; /* Sit on top */ 644 left: 0; 645 top: 0; 646 width: 100%; /* Full width */ 647 height: 100%; /* Full height */ 648 background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ 649 overflow-y: auto; /* enable scrolling */ 650} 651 652.mobile-wallet-adapter-embedded-modal-card { 653 display: flex; 654 flex-direction: column; 655 margin: auto 20px; 656 max-width: 780px; 657 padding: 20px; 658 border-radius: 24px; 659 background: #ffffff; 660 font-family: "Inter Tight", "PT Sans", Calibri, sans-serif; 661 transform: translateY(-200%); 662 animation: slide-in 0.5s forwards; 663} 664 665@keyframes slide-in { 666 100% { transform: translateY(0%); } 667} 668 669.mobile-wallet-adapter-embedded-modal-close { 670 display: flex; 671 align-items: center; 672 justify-content: center; 673 width: 32px; 674 height: 32px; 675 cursor: pointer; 676 background: #e4e9e9; 677 border: none; 678 border-radius: 50%; 679} 680 681.mobile-wallet-adapter-embedded-modal-close:focus-visible { 682 outline-color: red; 683} 684 685.mobile-wallet-adapter-embedded-modal-close svg { 686 fill: #546266; 687 transition: fill 200ms ease 0s; 688} 689
690.mobile-wallet-adapter-embedded-modal-close:hover svg { 691 fill: #fff; 692} 693`,_xt=` 694<link rel="preconnect" href="https://fonts.googleapis.com"> 695<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 696<link href="https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet"> 697`;var Oi,Ff,q0,yp,N2e,D2e,L2e,H3,zie,_S=(zie=class{constructor(){Je(this,yp);Je(this,Oi,null);Je(this,Ff,{});Je(this,q0,!1);Ft(this,"dom",null);Ft(this,"open",()=>{console.debug("Modal open"),Mt(this,yp,D2e).call(this),ne(this,Oi)&&(ne(this,Oi).style.display="flex")});Ft(this,"close",(t=void 0)=>{var e;console.debug("Modal close"),Mt(this,yp,L2e).call(this),ne(this,Oi)&&(ne(this,Oi).style.display="none"),(e=ne(this,Ff).close)==null||e.forEach(n=>n(t))});Je(this,H3,t=>{t.key==="Escape"&&this.close(t)});this.init=this.init.bind(this),Xe(this,Oi,document.getElementById("mobile-wallet-adapter-embedded-root-ui"))}async init(){console.log("Injecting modal"),Mt(this,yp,N2e).call(this)}addEventListener(t,e){var n;return(n=ne(this,Ff)[t])!=null&&n.push(e)||(ne(this,Ff)[t]=[e]),()=>this.removeEventListener(t,e)}removeEventListener(t,e){var n;ne(this,Ff)[t]=(n=ne(this,Ff)[t])==null?void 0:n.filter(r=>e!==r)}},Oi=new WeakMap,Ff=new WeakMap,q0=new WeakMap,yp=new WeakSet,N2e=function(){if(document.getElementById("mobile-wallet-adapter-embedded-root-ui")){ne(this,Oi)||Xe(this,Oi,document.getElementById("mobile-wallet-adapter-embedded-root-ui"));return}Xe(this,Oi,document.createElement("div")),ne(this,Oi).id="mobile-wallet-adapter-embedded-root-ui",ne(this,Oi).innerHTML=Ext,ne(this,Oi).style.display="none";const t=ne(this,Oi).querySelector(".mobile-wallet-adapter-embedded-modal-content");t&&(t.innerHTML=this.contentHtml);const e=document.createElement("style");e.id="mobile-wallet-adapter-embedded-modal-styles",e.textContent=Cxt+this.contentStyles;const n=document.createElement("div");n.innerHTML=_xt,this.dom=n.attachShadow({mode:"closed"}),this.dom.appendChild(e),this.dom.appendChild(ne(this,Oi)),document.body.appendChild(n)},D2e=function(){!ne(this,Oi)||ne(this,q0)||([...ne(this,Oi).querySelectorAll("[data-modal-close]")].forEach(t=>t==null?void 0:t.addEventListener("click",this.close)),window.addEventListener("load",this.close),document.addEventListener("keydown",ne(this,H3)),Xe(this,q0,!0))},L2e=function(){ne(this,q0)&&(window.removeEventListener("load",this.close),document.removeEventListener("keydown",ne(this,H3)),ne(this,Oi)&&([...ne(this,Oi).querySelectorAll("[data-modal-close]")].forEach(t=>t==null?void 0:t.removeEventListener("click",this.close)),Xe(this,q0,!1)))},H3=new WeakMap,zie),RE,B2e,Wie,Sxt=(Wie=class extends _S{constructor(){super(...arguments);Je(this,RE);Ft(this,"contentStyles",kxt);Ft(this,"contentHtml",Axt)}initWithCallback(e){super.init(),Mt(this,RE,B2e).call(this,e)}},RE=new WeakSet,B2e=function(e){var i;const n=(i=this.dom)==null?void 0:i.getElementById("mobile-wallet-adapter-launch-action"),r=async()=>{n==null||n.removeEventListener("click",r),this.close(),e()};n==null||n.addEventListener("click",r)},Wie);const Axt=` 698<svg class="mobile-wallet-adapter-embedded-modal-launch-icon" width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> 699 <path d="M21.6 48C7.2 48 0 40.8 0 26.4V21.6C0 7.2 7.2 0 21.6 0H26.4C40.8 0 48 7.2 48 21.6V26.4C48 40.8 40.8 48 26.4 48H21.6Z" fill="#15994E"/> 700 <mask id="mask0_189_522" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32"> 701 <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/> 702 </mask> 703 <g mask="url(#mask0_189_522)"> 704 <mask id="mask1_189_522" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32"> 705 <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/> 706 </mask> 707 <g mask="url(#mask1_189_522)"> 708 <path d="M22.1092 26.1208L19.4498 23.4615C19.1736 23.1851 18.8253 23.0468 18.4048 23.0468C17.9846 23.0468 17.6363 23.1851 17.3598 23.4615C17.0836 23.7377 16.9468 24.0861 16.9495 24.5065C16.9522 24.9267 17.0916 25.275 17.3678 25.5512L21.0405 29.2238C21.3463 29.5276 21.7031 29.6795 22.1108 29.6795C22.5184 29.6795 22.8742 29.5276 23.1782 29.2238L30.5918 21.8098C30.8683 21.5336 31.0065 21.1867 31.0065 20.7692C31.0065 20.3514 30.8683 20.0044 30.5918 19.7282C30.3156 19.4517 29.9673 19.3135 29.5468 19.3135C29.1266 19.3135 28.7784 19.4517 28.5022 19.7282L22.1092 26.1208ZM23.9998 37.6042C22.113 37.6042 20.3425 37.2473 18.6885 36.5335C17.0343 35.8197 15.5954 34.8512 14.3718 33.6278C13.1485 32.4043 12.18 30.9654 11.4662 29.3112C10.7524 27.6572 10.3955 25.8867 10.3955 23.9998C10.3955 22.113 10.7524 20.3425 11.4662 18.6885C12.18 17.0343 13.1485 15.5954 14.3718 14.3718C15.5954 13.1485 17.0343 12.18 18.6885 11.4662C20.3425 10.7524 22.113 10.3955 23.9998 10.3955C25.8867 10.3955 27.6572 10.7524 29.3112 11.4662C30.9654 12.18 32.4043 13.1485 33.6278 14.3718C34.8512 15.5954 35.8197 17.0343 36.5335 18.6885C37.2473 20.3425 37.6042 22.113 37.6042 23.9998C37.6042 25.8867 37.2473 27.6572 36.5335 29.3112C35.8197 30.9654 34.8512 32.4043 33.6278 33.6278C32.4043 34.8512 30.9654 35.8197 29.3112 36.5335C27.6572 37.2473 25.8867 37.6042 23.9998 37.6042Z" fill="white"/> 709 </g> 710 </g> 711</svg> 712<div class="mobile-wallet-adapter-embedded-modal-title">Ready to connect!</div> 713<div> 714 <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action"> 715 Connect Wallet 716 </button> 717</div> 718`,kxt=` 719.mobile-wallet-adapter-embedded-modal-close { 720 display: none; 721} 722.mobile-wallet-adapter-embedded-modal-content { 723 text-align: center; 724 min-width: 300px; 725} 726.mobile-wallet-adapter-embedded-modal-launch-icon { 727 margin-top: 24px; 728} 729.mobile-wallet-adapter-embedded-modal-title { 730 margin: 18px 100px 30px 100px; 731 color: #000000;
732 font-size: 2.75em; 733 font-weight: 600; 734} 735.mobile-wallet-adapter-embedded-modal-launch-action { 736 display: block; 737 width: 100%; 738 height: 56px; 739 font-size: 1.25em; 740 background: #000000; 741 color: #FFFFFF; 742 border-radius: 18px; 743} 744/* Smaller screens */ 745@media all and (max-width: 600px) { 746 .mobile-wallet-adapter-embedded-modal-title { 747 font-size: 1.5em; 748 margin-right: 12px; 749 margin-left: 12px; 750 } 751} 752`;var ME,F2e,Hie,$xt=(Hie=class extends _S{constructor(){super(...arguments);Je(this,ME);Ft(this,"contentStyles",Txt)}get contentHtml(){const e=jxt()?"Long press the app icon on your home screen to open site settings":"Tap the lock or settings icon in the address bar to open site settings";return Ixt.replace("{{PERMISSION_INSTRUCTION_DETAIL}}",e)}async init(){super.init(),Mt(this,ME,F2e).call(this)}},ME=new WeakSet,F2e=function(){var r;const e=(r=this.dom)==null?void 0:r.getElementById("mobile-wallet-adapter-launch-action"),n=async i=>{e==null||e.removeEventListener("click",n),this.close(i)};e==null||e.addEventListener("click",n)},Hie);const Ixt=` 753<div class="mobile-wallet-adapter-embedded-modal-header"> 754 Local Wallet Connection 755</div> 756<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> 757 <path d="M21.6 48C7.2 48 0 40.8 0 26.4V21.6C0 7.2 7.2 0 21.6 0H26.4C40.8 0 48 7.2 48 21.6V26.4C48 40.8 40.8 48 26.4 48H21.6Z" fill="#ED1515"/> 758 <mask id="mask0_147_1364" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32"> 759 <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/> 760 </mask> 761 <g mask="url(#mask0_147_1364)"> 762 <path d="M20.1398 36.2705C19.7363 36.2705 19.3508 36.1945 18.9835 36.0425C18.6162 35.8907 18.2916 35.674 18.0098 35.3922L12.6072 29.9895C12.3254 29.7077 12.1086 29.3832 11.9568 29.0158C11.8048 28.6485 11.7288 28.2631 11.7288 27.8595V20.1395C11.7288 19.736 11.8048 19.3505 11.9568 18.9832C12.1086 18.6158 12.3254 18.2913 12.6072 18.0095L18.0098 12.6068C18.2916 12.3251 18.6162 12.1083 18.9835 11.9565C19.3508 11.8045 19.7363 11.7285 20.1398 11.7285H27.8598C28.2634 11.7285 28.6488 11.8045 29.0162 11.9565C29.3835 12.1083 29.708 12.3251 29.9898 12.6068L35.3925 18.0095C35.6743 18.2913 35.891 18.6158 36.0428 18.9832C36.1948 19.3505 36.2708 19.736 36.2708 20.1395V27.8595C36.2708 28.2631 36.1948 28.6485 36.0428 29.0158C35.891 29.3832 35.6743 29.7077 35.3925 29.9895L29.9898 35.3922C29.708 35.674 29.3835 35.8907 29.0162 36.0425C28.6488 36.1945 28.2634 36.2705 27.8598 36.2705H20.1398ZM20.1732 33.2372H27.8265L33.2375 27.8262V20.1728L27.8265 14.7618H20.1732L14.7622 20.1728V27.8262L20.1732 33.2372ZM23.9998 25.9538L26.7868 28.7408C27.0473 29.0013 27.3729 29.1302 27.7638 29.1275C28.1549 29.1248 28.4807 28.9933 28.7412 28.7328C29.0016 28.4724 29.1318 28.1466 29.1318 27.7555C29.1318 27.3646 29.0016 27.039 28.7412 26.7785L25.9542 23.9995L28.7412 21.2125C29.0016 20.9521 29.1318 20.6264 29.1318 20.2355C29.1318 19.8444 29.0016 19.5186 28.7412 19.2582C28.4807 18.9977 28.1549 18.8675 27.7638 18.8675C27.3729 18.8675 27.0473 18.9977 26.7868 19.2582L23.9998 22.0452L21.2128 19.2582C20.9524 18.9977 20.628 18.8675 20.2398 18.8675C19.8514 18.8675 19.5269 18.9977 19.2665 19.2582C19.006 19.5186 18.8758 19.8444 18.8758 20.2355C18.8758 20.6264 19.006 20.9521 19.2665 21.2125L22.0455 23.9995L19.2585 26.7865C18.998 27.047 18.8692 27.3713 18.8718 27.7595C18.8745 28.148 19.006 28.4724 19.2665 28.7328C19.5269 28.9933 19.8527 29.1235 20.2438 29.1235C20.6347 29.1235 20.9604 28.9933 21.2208 28.7328L23.9998 25.9538Z" fill="black"/> 763 </g> 764</svg> 765<div class="mobile-wallet-adapter-embedded-modal-title"> 766 Your wallet connection is blocked 767</div> 768<div id="mobile-wallet-adapter-local-launch-message" class="mobile-wallet-adapter-embedded-modal-subtitle"> 769 Visit site settings in the address bar and allow "Apps on Device". 770</div> 771 772<div class="mobile-wallet-adapter-embedded-modal-divider"><hr></div> 773<div class="mobile-wallet-adapter-embedded-modal-footer"> 774 <div class="mobile-wallet-adapter-embedded-modal-details"> 775 <!-- Clickable header (label associated with the checkbox) --> 776 <label for="collapsible-1" class="mobile-wallet-adapter-embedded-modal-details-collapsible-header"> 777 <!-- Hidden checkbox to track state --> 778 <input type="checkbox" id="collapsible-1" class="mobile-wallet-adapter-embedded-modal-details-collapsible-input">
779 <span class="mobile-wallet-adapter-embedded-modal-details-collapsible-header-label"> 780 See details 781 </span> 782 <svg class="mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 783 <mask id="mask0_147_1382" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"> 784 <rect width="24" height="24" fill="#D9D9D9"/> 785 </mask> 786 <g mask="url(#mask0_147_1382)"> 787 <path d="M11.9999 17.0811C11.8506 17.0811 11.7087 17.0563 11.5741 17.0067C11.4395 16.957 11.3162 16.8762 11.2042 16.7643L6.57924 12.1393C6.36801 11.9281 6.26656 11.667 6.27489 11.3561C6.28322 11.0453 6.39301 10.7842 6.60424 10.573C6.81547 10.3618 7.08069 10.2561 7.39989 10.2561C7.71909 10.2561 7.9843 10.3618 8.19554 10.573L11.9999 14.3773L15.8292 10.548C16.0405 10.3368 16.3015 10.2353 16.6124 10.2436C16.9233 10.252 17.1843 10.3618 17.3955 10.573C17.6068 10.7842 17.7124 11.0494 17.7124 11.3686C17.7124 11.6878 17.6068 11.9531 17.3955 12.1643L12.7955 16.7643C12.6836 16.8762 12.5603 16.957 12.4257 17.0067C12.2911 17.0563 12.1492 17.0811 11.9999 17.0811Z" fill="black"/> 788 </g> 789 </svg> 790 </label> 791 792 <!-- Content to show/hide --> 793 <ul class="mobile-wallet-adapter-embedded-modal-details-collapsible-content"> 794 <li>{{PERMISSION_INSTRUCTION_DETAIL}}</li> 795 <li>Allow "Apps on Device"</li> 796 </ul> 797 </div> 798</div> 799<div> 800 <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action"> 801 Got it 802 </button> 803</div> 804`,Txt=` 805.mobile-wallet-adapter-embedded-modal-close { 806 display: none; 807} 808.mobile-wallet-adapter-embedded-modal-content { 809 text-align: center; 810} 811.mobile-wallet-adapter-embedded-modal-header { 812 margin: 18px auto 30px auto; 813 color: #7D9093; 814 font-size: 1.0em; 815 font-weight: 500; 816} 817.mobile-wallet-adapter-embedded-modal-title { 818 margin: 18px 100px auto 100px; 819 color: #000000; 820 font-size: 2.75em; 821 font-weight: 600; 822} 823.mobile-wallet-adapter-embedded-modal-subtitle { 824 margin: 12px 60px 30px 60px; 825 color: #7D9093; 826 font-size: 1.25em; 827 font-weight: 400; 828} 829.mobile-wallet-adapter-embedded-modal-details-collapsible-header { 830 display: flex; 831 flex-direction: row; 832 justify-content: space-between; 833 margin: 10px auto 10px auto; 834 color: #000000; 835 font-size: 1.5em; 836 font-weight: 600; 837 cursor: pointer; /* Show pointer on hover */ 838 transition: background 0.2s ease; /* Smooth background change */ 839} 840.mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon { 841 transition: rotate 0.3s ease; 842} 843.mobile-wallet-adapter-embedded-modal-details-collapsible-input { 844 display: none; /* Hide the checkbox */ 845} 846.mobile-wallet-adapter-embedded-modal-details-collapsible-content { 847 margin: 0px auto 40px auto; 848 max-height: 0px; /* Collapse content */ 849 overflow: hidden; /* Hide overflow when collapsed */ 850 transition: max-height 0.3s ease; /* Smooth transition */ 851} 852.mobile-wallet-adapter-embedded-modal-details-collapsible-content li { 853 margin: 20px auto; 854 color: #000000; 855 font-size: 1.25em; 856 font-weight: 400; 857 text-align: left; 858} 859/* When checkbox is checked, show content */ 860.mobile-wallet-adapter-embedded-modal-details-collapsible-header:has(> input:checked) ~ .mobile-wallet-adapter-embedded-modal-details-collapsible-content { 861 max-height: 300px; 862} 863.mobile-wallet-adapter-embedded-modal-details-collapsible-header:has(> input:checked) > .mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon { 864 rotate: 180deg; 865} 866.mobile-wallet-adapter-embedded-modal-launch-action { 867 display: block; 868 width: 100%; 869 height: 56px; 870 /*margin-top: 40px;*/ 871 font-size: 1.25em; 872 /*line-height: 24px;*/ 873 /*letter-spacing: -1%;*/ 874 background: #000000; 875 color: #FFFFFF; 876 border-radius: 18px; 877} 878/* Smaller screens */ 879@media all and (max-width: 600px) { 880 .mobile-wallet-adapter-embedded-modal-title { 881 font-size: 1.75em; 882 margin-right: 12px; 883 margin-left: 12px; 884 } 885 .mobile-wallet-adapter-embedded-modal-subtitle { 886 margin-right: 12px; 887 margin-left: 12px; 888 } 889} 890`;var OE,U2e,Vie,Pxt=(Vie=class extends _S{constructor(){super(...arguments);Je(this,OE);Ft(this,"contentStyles",Mxt);Ft(this,"contentHtml",Rxt)}
890async init(){super.init(),Mt(this,OE,U2e).call(this)}},OE=new WeakSet,U2e=function(){var r;const e=(r=this.dom)==null?void 0:r.getElementById("mobile-wallet-adapter-launch-action"),n=async()=>{e==null||e.removeEventListener("click",n);try{await fetch("http://localhost")}catch{}this.close()};e==null||e.addEventListener("click",n)},Vie);const Rxt=` 891<div class="mobile-wallet-adapter-embedded-modal-title">Allow connections to your wallet</div> 892<div id="mobile-wallet-adapter-local-launch-message" class="mobile-wallet-adapter-embedded-modal-subtitle"> 893 Tap "Allow" on the next screen 894</div> 895<svg class="mobile-wallet-adapter-embedded-modal-permission-prompt-mock" xmlns="http://www.w3.org/2000/svg" width="281" height="83" viewBox="0 0 281 83" fill="none"> 896 <rect width="281" height="83" rx="22" fill="#F0F3F5"/> 897 <path d="M254.194 64L252.626 56.657H254.047L254.866 61.452L254.985 62.278H255.02L255.146 61.452L255.993 57.497H257.4L258.254 61.431L258.373 62.278H258.415L258.534 61.431L259.346 56.657H260.718L259.143 64H257.673L256.826 59.961L256.693 59.093H256.651L256.511 59.961L255.664 64H254.194Z" fill="black"/> 898 <path d="M248.837 64.231C248.147 64.231 247.54 64.07 247.017 63.748C246.495 63.426 246.086 62.978 245.792 62.404C245.498 61.83 245.351 61.1673 245.351 60.416V60.241C245.351 59.4897 245.498 58.827 245.792 58.253C246.086 57.679 246.495 57.2333 247.017 56.916C247.54 56.594 248.147 56.433 248.837 56.433C249.528 56.433 250.135 56.594 250.657 56.916C251.18 57.2333 251.588 57.679 251.882 58.253C252.176 58.827 252.323 59.4897 252.323 60.241V60.416C252.323 61.1673 252.176 61.83 251.882 62.404C251.588 62.978 251.18 63.426 250.657 63.748C250.135 64.07 249.528 64.231 248.837 64.231ZM248.837 62.824C249.43 62.824 249.897 62.607 250.237 62.173C250.583 61.7343 250.755 61.1417 250.755 60.395V60.262C250.755 59.5107 250.583 58.918 250.237 58.484C249.897 58.05 249.43 57.833 248.837 57.833C248.249 57.833 247.783 58.05 247.437 58.484C247.092 58.918 246.919 59.5107 246.919 60.262V60.395C246.919 61.1417 247.092 61.7343 247.437 62.173C247.783 62.607 248.249 62.824 248.837 62.824Z" fill="black"/> 899 <path d="M242.298 64.231C241.467 64.231 240.814 63.993 240.338 63.517C239.866 63.0364 239.631 62.3737 239.631 61.529V53.78H241.178V61.389C241.178 62.3317 241.591 62.803 242.417 62.803C242.65 62.803 242.865 62.7587 243.061 62.67C243.257 62.5814 243.464 62.4367 243.684 62.236L244.538 63.377C244.225 63.6664 243.884 63.881 243.516 64.021C243.152 64.161 242.746 64.231 242.298 64.231ZM237.51 55.061V53.78H240.611V55.061H237.51Z" fill="black"/> 900 <path d="M234.463 64.231C233.633 64.231 232.979 63.993 232.503 63.517C232.032 63.0364 231.796 62.3737 231.796 61.529V53.78H233.343V61.389C233.343 62.3317 233.756 62.803 234.582 62.803C234.816 62.803 235.03 62.7587 235.226 62.67C235.422 62.5814 235.63 62.4367 235.849 62.236L236.703 63.377C236.391 63.6664 236.05 63.881 235.681 64.021C235.317 64.161 234.911 64.231 234.463 64.231ZM229.675 55.061V53.78H232.776V55.061H229.675Z" fill="black"/> 901 <path d="M221.442 64L224.557 53.976H226.132L229.233 64H227.581L225.642 56.972L225.341 55.761H225.299L225.005 56.972L223.073 64H221.442ZM222.835 61.634L223.255 60.29H227.371L227.805 61.634H222.835Z" fill="black"/> 902 <path d="M178.261 64L175.034 60.066V60.024L178.121 56.657H180.011L176.504 60.423V59.632L180.165 64H178.261ZM173.543 64V53.78H175.097V64H173.543Z" fill="#7D9093" fill-opacity="0.5"/> 903 <path d="M169.306 64.224C168.588 64.224 167.958 64.0653 167.416 63.748C166.88 63.426 166.462 62.9803 166.163 62.411C165.865 61.837 165.715 61.1673 165.715 60.402V60.248C165.715 59.4873 165.862 58.8223 166.156 58.253C166.45 57.679 166.863 57.2333 167.395 56.916C167.927 56.594 168.546 56.433 169.25 56.433C169.978 56.433 170.59 56.6056 171.084 56.951C171.579 57.2917 171.955 57.777 172.211 58.407L170.874 58.995C170.72 58.6123 170.508 58.323 170.237 58.127C169.967 57.9263 169.633 57.826 169.236 57.826C168.63 57.826 168.149 58.0383 167.794 58.463C167.444 58.883 167.269 59.4616 167.269 60.199V60.465C167.269 61.1837 167.454 61.7577 167.822 62.187C168.196 62.6163 168.69 62.831 169.306 62.831C169.712 62.831 170.06 62.733 170.349 62.537C170.639 62.341 170.877 62.0423 171.063 61.641L172.379 62.285C172.188 62.6957 171.941 63.0457 171.637 63.335C171.334 63.6243 170.986 63.846 170.594 64C170.202 64.1493 169.773 64.224 169.306 64.224Z" fill="#7D9093" fill-opacity="0.5"/> 904 <path d="M161.003 64.231C160.312 64.231 159.706 64.07 159.183 63.748C158.66 63.426 158.252 62.978 157.958 62.404C157.664 61.83 157.517 61.1673 157.517 60.416V60.241C157.517 59.4897 157.664 58.827 157.958 58.253C158.252 57.679 158.66 57.2333 159.183 56.916C159.706 56.594
904160.312 56.433 161.003 56.433C161.694 56.433 162.3 56.594 162.823 56.916C163.346 57.2333 163.754 57.679 164.048 58.253C164.342 58.827 164.489 59.4897 164.489 60.241V60.416C164.489 61.1673 164.342 61.83 164.048 62.404C163.754 62.978 163.346 63.426 162.823 63.748C162.3 64.07 161.694 64.231 161.003 64.231ZM161.003 62.824C161.596 62.824 162.062 62.607 162.403 62.173C162.748 61.7343 162.921 61.1417 162.921 60.395V60.262C162.921 59.5107 162.748 58.918 162.403 58.484C162.062 58.05 161.596 57.833 161.003 57.833C160.415 57.833 159.948 58.05 159.603 58.484C159.258 58.918 159.085 59.5107 159.085 60.262V60.395C159.085 61.1417 159.258 61.7343 159.603 62.173C159.948 62.607 160.415 62.824 161.003 62.824Z" fill="#7D9093" fill-opacity="0.5"/> 905 <path d="M154.463 64.231C153.633 64.231 152.979 63.993 152.503 63.517C152.032 63.0364 151.796 62.3737 151.796 61.529V53.78H153.343V61.389C153.343 62.3317 153.756 62.803 154.582 62.803C154.816 62.803 155.03 62.7587 155.226 62.67C155.422 62.5814 155.63 62.4367 155.849 62.236L156.703 63.377C156.391 63.6664 156.05 63.881 155.681 64.021C155.317 64.161 154.911 64.231 154.463 64.231ZM149.675 55.061V53.78H152.776V55.061H149.675Z" fill="#7D9093" fill-opacity="0.5"/> 906 <path d="M142.24 64V53.976H145.544C146.421 53.976 147.112 54.1953 147.616 54.634C148.12 55.0726 148.372 55.6583 148.372 56.391V56.566C148.372 57.0886 148.246 57.5366 147.994 57.91C147.742 58.2833 147.38 58.5586 146.909 58.736V58.792C147.492 58.9226 147.947 59.2003 148.274 59.625C148.605 60.045 148.771 60.5606 148.771 61.172V61.361C148.771 61.893 148.645 62.3573 148.393 62.754C148.145 63.1506 147.795 63.4586 147.343 63.678C146.895 63.8926 146.365 64 145.754 64H142.24ZM143.794 62.656H145.572C146.085 62.656 146.482 62.5253 146.762 62.264C147.042 62.0026 147.182 61.6293 147.182 61.144V60.99C147.182 60.5046 147.037 60.1313 146.748 59.87C146.463 59.604 146.05 59.471 145.509 59.471H143.36V58.183H145.32C145.791 58.183 146.153 58.064 146.405 57.826C146.657 57.588 146.783 57.2496 146.783 56.811V56.685C146.783 56.2416 146.657 55.9033 146.405 55.67C146.157 55.4366 145.796 55.32 145.32 55.32H143.794V62.656Z" fill="#7D9093" fill-opacity="0.5"/> 907 <rect x="18" y="17" width="246" height="7" rx="3.5" fill="#7D9093" fill-opacity="0.26"/> 908 <rect x="18" y="33" width="82" height="7" rx="3.5" fill="#7D9093" fill-opacity="0.26"/> 909</svg> 910<div> 911 <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action"> 912 Continue to Allow 913 </button> 914</div> 915`,Mxt=` 916.mobile-wallet-adapter-embedded-modal-close { 917 display: none; 918} 919.mobile-wallet-adapter-embedded-modal-content { 920 text-align: center; 921} 922.mobile-wallet-adapter-embedded-modal-title { 923 margin: 18px 100px auto 100px; 924 color: #000000; 925 font-size: 2.75em; 926 font-weight: 600; 927} 928.mobile-wallet-adapter-embedded-modal-subtitle { 929 margin: 20px 60px 40px 60px; 930 color: #7D9093; 931 font-size: 1.25em; 932 font-weight: 400; 933} 934.mobile-wallet-adapter-embedded-modal-permission-prompt-mock { 935 width: 90%; 936 height: auto; 937 margin: 0 auto 30px auto; 938 display: block; 939} 940.mobile-wallet-adapter-embedded-modal-launch-action { 941 display: block; 942 width: 100%; 943 height: 56px; 944 font-size: 1.25em; 945 background: #000000; 946 color: #FFFFFF; 947 border-radius: 18px; 948} 949/* Smaller screens */ 950@media all and (max-width: 600px) { 951 .mobile-wallet-adapter-embedded-modal-title { 952 font-size: 1.5em; 953 margin-right: 12px; 954 margin-left: 12px; 955 } 956 .mobile-wallet-adapter-embedded-modal-subtitle { 957 margin-right: 12px; 958 margin-left: 12px; 959 } 960} 961`;function Oxt(t){return t.includes("Solana Mobile Web Shell")}function jxt(){const t=typeof document<"u"&&document.referrer.startsWith("android-app://");if(typeof window>"u")return t;const e=window.matchMedia("(display-mode: standalone)").matches,n=window.matchMedia("(display-mode: fullscreen)").matches,r=window.matchMedia("(display-mode: minimal-ui)").matches;return t||e||n||r}async function z2e(){if(!(typeof navigator<"u"&&Oxt(navigator.userAgent)))try{const t=await navigator.permissions.query({name:"loopback-network"});if(t.state==="granted")return;if(t.state==="denied"){const e=new $xt;throw e.init(),e.open(),new js(ho.ERROR_LOOPBACK_ACCESS_BLOCKED,"Local Network Access permission denied")}else if(t.state==="prompt"){const e=new Pxt;if(await new Promise((n,r)=>{e.addEventListener("close",i=>{i&&r(new js(ho.ERROR_ASSOCIATION_CANCELLED,"Wallet connection cancelled by user",{event:i}))}),t.onchange=()=>{t.onchange=null,n(t.state)}
961,e.init(),e.open()})==="granted"){const n=new Sxt;await new Promise((r,i)=>{n.addEventListener("close",s=>{s&&i(new js(ho.ERROR_ASSOCIATION_CANCELLED,"Wallet connection cancelled by user",{event:s}))}),n.initWithCallback(async()=>{r(!0)}),n.open()});return}else return await z2e()}throw new js(ho.ERROR_LOOPBACK_ACCESS_BLOCKED,"Local Network Access permission unknown")}catch(t){if(t instanceof TypeError&&(t.message.includes("loopback-network")||t.message.includes("local-network-access")))return;throw t instanceof js?t:new js(ho.ERROR_LOOPBACK_ACCESS_BLOCKED,t instanceof Error?t.message:"Local Network Access permission unknown")}}const Nxt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDIuNUgxN0MxNy44Mjg0IDIuNSAxOC41IDMuMTcxNTcgMTguNSA0VjIwQzE4LjUgMjAuODI4NCAxNy44Mjg0IDIxLjUgMTcgMjEuNUg3QzYuMTcxNTcgMjEuNSA1LjUgMjAuODI4NCA1LjUgMjBWNEM1LjUgMy4xNzE1NyA2LjE3MTU3IDIuNSA3IDIuNVpNMyA0QzMgMS43OTA4NiA0Ljc5MDg2IDAgNyAwSDE3QzE5LjIwOTEgMCAyMSAxLjc5MDg2IDIxIDRWMjBDMjEgMjIuMjA5MSAxOS4yMDkxIDI0IDE3IDI0SDdDNC43OTA4NiAyNCAzIDIyLjIwOTEgMyAyMFY0Wk0xMSA0LjYxNTM4QzEwLjQ0NzcgNC42MTUzOCAxMCA1LjA2MzEgMTAgNS42MTUzOFY2LjM4NDYyQzEwIDYuOTM2OSAxMC40NDc3IDcuMzg0NjIgMTEgNy4zODQ2MkgxM0MxMy41NTIzIDcuMzg0NjIgMTQgNi45MzY5IDE0IDYuMzg0NjJWNS42MTUzOEMxNCA1LjA2MzEgMTMuNTUyMyA0LjYxNTM4IDEzIDQuNjE1MzhIMTFaIiBmaWxsPSIjRENCOEZGIi8+Cjwvc3ZnPgo=",W2e="Mobile Wallet Adapter",Dxt=64,Lxt=[sa,si,kf,s1],Bxt=3e4;function Jp(t){return t instanceof Error?t.message:"Unknown error"}var Uf,jE,NE,DE,LE,Ry,ks,hu,Id,My,zf,V3,Oy,q3,BE,ip,x7,H2e,FE,K3,K0,G3,jy,Z3,G0,Ny,Y3,UE,zE,Q3,X3,WE,HE,J3,qie,Fxt=(qie=class{constructor(t){Je(this,ip);Je(this,Uf,{});Je(this,jE,"1.0.0");Je(this,NE,W2e);Je(this,DE,"https://solanamobile.com/wallets");Je(this,LE,Nxt);Je(this,Ry);Je(this,ks);Je(this,hu);Je(this,Id,!1);Je(this,My,0);Je(this,zf,[]);Je(this,V3);Je(this,Oy);Je(this,q3);Je(this,BE,(t,e)=>{var n;return(n=ne(this,Uf)[t])!=null&&n.push(e)||(ne(this,Uf)[t]=[e]),()=>Mt(this,ip,H2e).call(this,t,e)});Je(this,FE,async({silent:t}={})=>
961{if(ne(this,Id)||this.connected)return{accounts:this.accounts};Xe(this,Id,!0);try{if(t){const e=await ne(this,hu).get();if(e)await ne(this,G3).call(this,e.capabilities),await ne(this,K0).call(this,e);else return{accounts:this.accounts}}else await ne(this,K3).call(this)}catch(e){throw new Error(Jp(e),{cause:e})}finally{Xe(this,Id,!1)}return{accounts:this.accounts}});Je(this,K3,async t=>{try{const e=await ne(this,hu).get();if(e)return ne(this,K0).call(this,e),e;const n=await ne(this,V3).select(ne(this,zf));return await ne(this,G0).call(this,async r=>{const[i,s]=await Promise.all([r.getCapabilities(),r.authorize({chain:n,identity:ne(this,Ry),sign_in_payload:t})]),o=ne(this,Y3).call(this,s.accounts),a={...s,accounts:o,chain:n,capabilities:i};return Promise.all([ne(this,G3).call(this,i),ne(this,hu).set(a),ne(this,K0).call(this,a)]),a})}catch(e){throw new Error(Jp(e),{cause:e})}});Je(this,K0,async t=>{var n;const e=ne(this,ks)==null||((n=ne(this,ks))==null?void 0:n.accounts.length)!==t.accounts.length||ne(this,ks).accounts.some((r,i)=>r.address!==t.accounts[i].address);Xe(this,ks,t),e&&Mt(this,ip,x7).call(this,"change",{accounts:this.accounts})});Je(this,G3,async t=>{const e=t.features.includes("solana:signTransactions"),n=t.supports_sign_and_send_transactions,r=sa in this.features!==n||si in this.features!==e;Xe(this,Oy,{...(n||!n&&!e)&&{[sa]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:ne(this,Q3)}},...e&&{[si]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:ne(this,X3)}}}),r&&Mt(this,ip,x7).call(this,"change",{features:this.features})});Je(this,jy,async(t,e,n)=>{var r;try{const[i,s]=await Promise.all([((r=ne(this,ks))==null?void 0:r.capabilities)??await t.getCapabilities(),t.authorize({auth_token:e,identity:ne(this,Ry),chain:n})]),o=ne(this,Y3).call(this,s.accounts),a={...s,accounts:o,chain:n,capabilities:i};Promise.all([ne(this,hu).set(a),ne(this,K0).call(this,a)])}catch(i){throw ne(this,Z3).call(this),new Error(Jp(i),{cause:i})}});Je(this,Z3,async()=>{ne(this,hu).clear(),Xe(this,Id,!1),zw(this,My)._++,Xe(this,ks,void 0),Mt(this,ip,x7).call(this,"change",{accounts:this.accounts})});Je(this,G0,async t=>{var s;const e=(s=ne(this,ks))==null?void 0:s.wallet_uri_base,n=e?{baseUri:e}:void 0,r=ne(this,My),i=new xxt;try{let o=!0,a;const c=await Promise.race([z2e().then(async()=>{i.init();const{wallet:l,close:u}=await yxt(n);o=!1,i.addEventListener("close",h=>{h&&u()}),i.open();const d=await t(await l);return i.close(),u(),d}),new Promise((l,u)=>{a=setTimeout(()=>{o&&u(new js(ho.ERROR_ASSOCIATION_CANCELLED,"Wallet connection timed out",{event:void 0}))},Bxt)})]);return clearTimeout(a),c}catch(o){throw i.close(),ne(this,My)!==r&&await new Promise(()=>{}),o instanceof Error&&o.name==="SolanaMobileWalletAdapterError"&&o.code==="ERROR_WALLET_NOT_FOUND"&&await ne(this,q3).call(this,this),o}});Je(this,Ny,()=>{if(!ne(this,ks))throw new Error("Wallet not connected");return{authToken:ne(this,ks).auth_token,chain:ne(this,ks).chain}});Je(this,Y3,t=>t.map(e=>{const n=hf(e.address);return{address:th.encode(n),publicKey:n,label:e.label,icon:e.icon,chains:e.chains??ne(this,zf),features:e.features??Lxt}}));Je(this,UE,async t=>{const{authToken:e,chain:n}=ne(this,Ny).call(this);try{const r=t.map(i=>N6(i));return await ne(this,G0).call(this,async i=>(await ne(this,jy).call(this,i,e,n),(await i.signTransactions({payloads:r})).signed_payloads.map(hf)))}catch(r){throw new Error(Jp(r),{cause:r})}});Je(this,zE,async(t,e)=>{const{authToken:n,chain:r}=ne(this,Ny).call(this);try{return await ne(this,G0).call(this,async i=>{const[s]=await Promise.all([i.getCapabilities(),ne(this,jy).call(this,i,n,r)]);if(s.supports_sign_and_send_transactions){const o=N6(t);return(await i.signAndSendTransactions({...e,payloads:[o]})).signatures.map(hf)[0]}else throw new Error("connected wallet does not support signAndSendTransaction")})}catch(i){throw new Error(Jp(i),{cause:i})}});Je(this,Q3,async(...t)=>{const e=[];for(const n of t){const r=await ne(this,zE).call(this,n.transaction,n.options);e.push({signature:r})}return e});Je(this,X3,async(...t)=>(await ne(this,UE).call(this,t.map(({transaction:e})=>e))).map(e=>({signedTransaction:e})));Je(this,WE,async(...t)=>{const{authToken:e,chain:n}=ne(this,Ny).call(this),r=t.map(({account:s})=>N6(new Uint8Array(s.publicKey))),i=t.map(({message:s})=>N6(s));try{return await ne(this,G0).call(this,async s=>
961(await ne(this,jy).call(this,s,e,n),(await s.signMessages({addresses:r,payloads:i})).signed_payloads.map(hf).map(o=>({signedMessage:o,signature:o.slice(-Dxt)}))))}catch(s){throw new Error(Jp(s),{cause:s})}});Je(this,HE,async(...t)=>{const e=[];if(t.length>1)for(const n of t)e.push(await ne(this,J3).call(this,n));else return[await ne(this,J3).call(this,t[0])];return e});Je(this,J3,async t=>{Xe(this,Id,!0);try{const e=await ne(this,K3).call(this,{...t,domain:(t==null?void 0:t.domain)??window.location.host});if(!e.sign_in_result)throw new Error("Sign in failed, no sign in result returned by wallet");const n=e.sign_in_result.address,r=e.accounts.find(i=>i.address==n);return{account:{...r??{address:th.encode(hf(n))},publicKey:hf(n),chains:(r==null?void 0:r.chains)??ne(this,zf),features:(r==null?void 0:r.features)??e.capabilities.features},signedMessage:hf(e.sign_in_result.signed_message),signature:hf(e.sign_in_result.signature)}}catch(e){throw new Error(Jp(e),{cause:e})}finally{Xe(this,Id,!1)}});Xe(this,hu,t.authorizationCache),Xe(this,Ry,t.appIdentity),Xe(this,zf,t.chains),Xe(this,V3,t.chainSelector),Xe(this,q3,t.onWalletNotFound),Xe(this,Oy,{[sa]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:ne(this,Q3)},[si]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:ne(this,X3)}})}get version(){return ne(this,jE)}get name(){return ne(this,NE)}get url(){return ne(this,DE)}get icon(){return ne(this,LE)}get chains(){return ne(this,zf)}get features(){return{[hy]:{version:"1.0.0",connect:ne(this,FE)},[mE]:{version:"1.0.0",disconnect:ne(this,Z3)},[ES]:{version:"1.0.0",on:ne(this,BE)},[kf]:{version:"1.0.0",signMessage:ne(this,WE)},[s1]:{version:"1.0.0",signIn:ne(this,HE)},...ne(this,Oy)}}get accounts(){var t;return((t=ne(this,ks))==null?void 0:t.accounts)??[]}get connected(){return!!ne(this,ks)}get isAuthorized(){return!!ne(this,ks)}get currentAuthorization(){return ne(this,ks)}get cachedAuthorizationResult(){return ne(this,hu).get()}},Uf=new WeakMap,jE=new WeakMap,NE=new WeakMap,DE=new WeakMap,LE=new WeakMap,Ry=new WeakMap,ks=new WeakMap,hu=new WeakMap,Id=new WeakMap,My=new WeakMap,zf=new WeakMap,V3=new WeakMap,Oy=new WeakMap,q3=new WeakMap,BE=new WeakMap,ip=new WeakSet,x7=function(t,...e){var n;(n=ne(this,Uf)[t])==null||n.forEach(r=>r.apply(null,e))},H2e=function(t,e){var n;ne(this,Uf)[t]=(n=ne(this,Uf)[t])==null?void 0:n.filter(r=>e!==r)},FE=new WeakMap,K3=new WeakMap,K0=new WeakMap,G3=new WeakMap,jy=new WeakMap,Z3=new WeakMap,G0=new WeakMap,Ny=new WeakMap,Y3=new WeakMap,UE=new WeakMap,zE=new WeakMap,Q3=new WeakMap,X3=new WeakMap,WE=new WeakMap,HE=new WeakMap,J3=new WeakMap,qie);const Uxt="To use mobile wallet adapter, you must have a compatible mobile wallet application installed on your device.",zxt="This browser appears to be incompatible with mobile wallet adapter. Open this page in a compatible mobile browser app and try again.";var Wxt=class extends _S{constructor(){super(...arguments);Ft(this,"contentStyles",Vxt);Ft(this,"contentHtml",Hxt)}initWithError(e){super.init(),this.populateError(e)}populateError(e){var i,s;const n=(i=this.dom)==null?void 0:i.getElementById("mobile-wallet-adapter-error-message"),r=(s=this.dom)==null?void 0:s.getElementById("mobile-wallet-adapter-error-action");if(n){if(e.name==="SolanaMobileWalletAdapterError")switch(e.code){case"ERROR_WALLET_NOT_FOUND":n.innerHTML=Uxt,r&&r.addEventListener("click",()=>{window.location.href="https://solanamobile.com/wallets"});return;case"ERROR_BROWSER_NOT_SUPPORTED":n.innerHTML=zxt,r&&(r.style.display="none");return}n.innerHTML=`An unexpected error occurred: ${e.message}`}else console.log("Failed to locate error dialog element")}};const Hxt=` 962<svg class="mobile-wallet-adapter-embedded-modal-error-icon" xmlns="http://www.w3.org/2000/svg" height="50px" viewBox="0 -960 960 960" width="50px" fill="#000000"><path d="M 280,-80 Q 197,-80 138.5,-138.5 80,-197 80,-280 80,-363 138.5,-421.5 197,-480 280,-480 q 83,0 141.5,58.5 58.5,58.5 58.5,141.5 0,83 -58.5,141.5 Q 363,-80 280,-80 Z M 824,-120 568,-376 Q 556,-389 542.5,-402.5 529,-416 516,-428 q 38,-24 61,-64 23,-40 23,-88 0,-75 -52.5,-127.5 Q 495,-760 420,-760 345,-760 292.5,-707.5 240,-655 240,-580 q 0,6 0.5,11.5 0.5,5.5 1.5,11.5 -18,2 -39.5,8 -21.5,6 -38.5,14 -2,-11 -3,-22 -1,-11 -1,-23 0,-109 75.5,-184.5 Q 311,-840 420,-840 q 109,0 184.5,75.5 75.5,75.5 75.5,184.5 0,43 -13.5,81.5 Q 653,-460 629,-428 l 251,252 z m -615,-61 71,-71 70,71 29,-28 -71,-71 71,-71 -28,-28 -71,71 -71,-71 -28,28 71,71 -71,71 z"/></svg> 963<div class="mobile-wallet-adapter-embedded-modal-title">We can't find a wallet.</div> 964<div id="mobile-wallet-adapter-error-message" class="mobile-wallet-adapter-embedded-modal-subtitle"></div> 965<div> 966 <button data-error-action id="mobile-wallet-adapter-error-action" class="mobile-wallet-adapter-embedded-modal-error-action"> 967 Find a wallet 968 </button> 969</div> 970`,Vxt=` 971.mobile-wallet-adapter-embedded-modal-content { 972 text-align: center; 973} 974 975.mobile-wallet-adapter-embedded-modal-error-icon { 976 margin-top: 24px; 977} 978 979.mobile-wallet-adapter-embedded-modal-title { 980 margin: 18px 100px auto 100px; 981 color: #000000;
982 font-size: 2.75em; 983 font-weight: 600; 984} 985 986.mobile-wallet-adapter-embedded-modal-subtitle { 987 margin: 30px 60px 40px 60px; 988 color: #000000; 989 font-size: 1.25em; 990 font-weight: 400; 991} 992 993.mobile-wallet-adapter-embedded-modal-error-action { 994 display: block; 995 width: 100%; 996 height: 56px; 997 /*margin-top: 40px;*/ 998 font-size: 1.25em; 999 /*line-height: 24px;*/ 1000 /*letter-spacing: -1%;*/ 1001 background: #000000; 1002 color: #FFFFFF; 1003 border-radius: 18px; 1004} 1005 1006/* Smaller screens */ 1007@media all and (max-width: 600px) { 1008 .mobile-wallet-adapter-embedded-modal-title { 1009 font-size: 1.5em; 1010 margin-right: 12px; 1011 margin-left: 12px; 1012 } 1013 .mobile-wallet-adapter-embedded-modal-subtitle { 1014 margin-right: 12px; 1015 margin-left: 12px; 1016 } 1017} 1018`;async function qxt(){if(typeof window<"u"){const t=window.navigator.userAgent.toLowerCase(),e=new Wxt;t.includes("wv")?e.initWithError({name:"SolanaMobileWalletAdapterError",code:"ERROR_BROWSER_NOT_SUPPORTED",message:""}):e.initWithError({name:"SolanaMobileWalletAdapterError",code:"ERROR_WALLET_NOT_FOUND",message:""}),e.open()}}const SP="SolanaMobileWalletAdapterDefaultAuthorizationCache";function Kxt(){let t;try{t=window.localStorage}catch{}return{async clear(){if(t)try{t.removeItem(SP)}catch{}},async get(){if(t)try{const e=JSON.parse(t.getItem(SP));if(e&&e.accounts){const n=e.accounts.map(r=>({...r,publicKey:"publicKey"in r?new Uint8Array(Object.values(r.publicKey)):th.decode(r.address)}));return{...e,accounts:n}}else return e||void 0}catch{}},async set(e){if(t)try{t.setItem(SP,JSON.stringify(e))}catch{}}}}function Gxt(){return{async select(t){return t.length===1?t[0]:t.includes(yE)?yE:t[0]}}}var Zxt=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Yxt=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},E7;let Ta;const SS=new Set;function Qxt(t){kb=void 0,SS.add(t)}function Xxt(t){kb=void 0,SS.delete(t)}const Fm={};function Jxt(){if(Ta||(Ta=Object.freeze({register:Kte,get:e4t,on:t4t}),typeof window>"u"))return Ta;const t=Object.freeze({register:Kte});try{window.addEventListener("wallet-standard:register-wallet",({detail:e})=>e(t))}catch(e){console.error(`wallet-standard:register-wallet event listener could not be added 1019`,e)}try{window.dispatchEvent(new n4t(t))}catch(e){console.error(`wallet-standard:app-ready event could not be dispatched 1020`,e)}return Ta}function Kte(...t){var e;return t=t.filter(n=>!SS.has(n)),t.length?(t.forEach(n=>Qxt(n)),(e=Fm.register)==null||e.forEach(n=>cN(()=>n(...t))),function(){var r;t.forEach(i=>Xxt(i)),(r=Fm.unregister)==null||r.forEach(i=>cN(()=>i(...t)))}):()=>{}}let kb;function e4t(){return kb||(kb=[...SS]),kb}function t4t(t,e){var n;return(n=Fm[t])!=null&&n.push(e)||(Fm[t]=[e]),function(){var i;Fm[t]=(i=Fm[t])==null?void 0:i.filter(s=>e!==s)}}function cN(t){try{t()}catch(e){console.error(e)}}class n4t extends Event{get detail(){return Zxt(this,E7,"f")}get type(){return"wallet-standard:app-ready"}constructor(e){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),E7.set(this,void 0),Yxt(this,E7,e,"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")}}E7=new WeakMap;function r4t(){if(Ta||(Ta=Jxt(),typeof window>"u"))return Ta;const t=window.navigator.wallets||[];if(!Array.isArray(t))return console.error("window.navigator.wallets is not an array"),Ta;const{register:e}=Ta,n=(...r)=>r.forEach(i=>
1020cN(()=>i({register:e})));try{Object.defineProperty(window.navigator,"wallets",{value:Object.freeze({push:n})})}catch{return console.error("window.navigator.wallets could not be set"),Ta}return n(...t),Ta}function AP(t){return window.btoa(String.fromCharCode.call(null,...t))}function i4t(){return typeof window<"u"&&window.isSecureContext&&typeof document<"u"&&/android/i.test(navigator.userAgent)}const C7=W2e,s4t=64;function o4t(t){return"version"in t}function V2e(t){switch(t){case"mainnet-beta":return"solana:mainnet";case"testnet":return"solana:testnet";case"devnet":return"solana:devnet";default:return t}}function D6(t){return t instanceof Error?t.message:"Unknown error"}var Kr,Td,fu,e5,pu,Wf,VE,ci,lN,q2e,_7,S7,mf,Kie,a4t=(Kie=class extends C5t{constructor(e,n){super();Je(this,ci);Ft(this,"supportedTransactionVersions",new Set(["legacy",0]));Ft(this,"name");Ft(this,"icon");Ft(this,"url");Je(this,Kr);Je(this,Td,!1);Je(this,fu,i4t()?oi.Loadable:oi.Unsupported);Je(this,e5);Je(this,pu);Je(this,Wf);Je(this,VE,async e=>{if(e.accounts&&e.accounts.length>0){Mt(this,ci,q2e).call(this);const n=await ne(this,e5).call(this,e.accounts);n!==ne(this,pu)&&(Xe(this,pu,n),Xe(this,Wf,void 0),this.emit("connect",this.publicKey))}});Xe(this,e5,async r=>{const i=await n.addressSelector.select(r.map(({publicKey:s})=>AP(new Uint8Array(s))));return r.find(({publicKey:s})=>AP(new Uint8Array(s))===i)??r[0]}),Xe(this,Kr,e),ne(this,Kr).features[ES].on("change",ne(this,VE)),this.name=ne(this,Kr).name,this.icon=ne(this,Kr).icon,this.url=ne(this,Kr).url}get publicKey(){if(!ne(this,Wf)&&ne(this,pu))try{Xe(this,Wf,new bn(ne(this,pu).publicKey))}catch(e){throw new _2e(e instanceof Error&&(e==null?void 0:e.message)||"Unknown error",e)}return ne(this,Wf)??null}get connected(){return ne(this,Kr).connected}get connecting(){return ne(this,Td)}get readyState(){return ne(this,fu)}async autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(){return await this.autoConnect()}async autoConnect(){Mt(this,ci,lN).call(this,!0)}async connect(){Mt(this,ci,lN).call(this)}async performAuthorization(e){try{const n=await ne(this,Kr).cachedAuthorizationResult;return n?(await ne(this,Kr).features[hy].connect({silent:!0}),n):(e?await ne(this,Kr).features[s1].signIn(e):await ne(this,Kr).features[hy].connect(),await await ne(this,Kr).cachedAuthorizationResult)}catch(n){throw new b7(n instanceof Error&&n.message||"Unknown error",n)}}async disconnect(){return await Mt(this,ci,mf).call(this,async()=>{Xe(this,Td,!1),Xe(this,Wf,void 0),Xe(this,pu,void 0),await ne(this,Kr).features[mE].disconnect(),this.emit("disconnect")})}async signIn(e){return Mt(this,ci,mf).call(this,async()=>{if(ne(this,fu)!==oi.Installed&&ne(this,fu)!==oi.Loadable)throw new A3;Xe(this,Td,!0);try{const n=await ne(this,Kr).features[s1].signIn({...e,domain:(e==null?void 0:e.domain)??window.location.host});if(n.length>0)return n[0];throw new Error("Sign in failed, no sign in result returned by wallet")}catch(n){throw new b7(n instanceof Error&&n.message||"Unknown error",n)}finally{Xe(this,Td,!1)}})}async signMessage(e){return await Mt(this,ci,mf).call(this,async()=>{const n=Mt(this,ci,_7).call(this);try{return(await ne(this,Kr).features[kf].signMessage({account:n,message:e}))[0].signature}catch(r){throw new S2e(D6(r),r)}})}async sendTransaction(e,n,r){return await Mt(this,ci,mf).call(this,async()=>{const i=Mt(this,ci,_7).call(this);try{let s=function(){let o;switch(n.commitment){case"confirmed":case"finalized":case"processed":o=n.commitment;break;default:o="finalized"}let a;switch(r==null?void 0:r.preflightCommitment){case"confirmed":case"finalized":case"processed":a=r.preflightCommitment;break;case void 0:a=o;break;default:a="finalized"}return(a==="finalized"?2:a==="confirmed"?1:0)<(o==="finalized"?2:o==="confirmed"?1:0)?a:o};if(sa in ne(this,Kr).features){const o=V2e(ne(this,Kr).currentAuthorization.chain),[a]=(await ne(this,Kr).features[sa].signAndSendTransaction({account:i,transaction:e.serialize(),chain:o,options:r?{skipPreflight:r.skipPreflight,maxRetries:r.maxRetries}:void 0})).map(c=>AP(c.signature));return a}else{const[o]=await Mt(this,ci,S7).call(this,[e]);if(o4t(o))return await n.sendTransaction(o);{const a=o.serialize();return await n.sendRawTransaction(a,{...r,preflightCommitment:s()})}}}catch(s){throw new I0(D6(s),s)}})}async signTransaction(e){return await Mt(this,ci,mf).call(this,async()=>{const[n]=await Mt(this,ci,S7).call(this,[e]);return n})}async signAllTransactions(e){return await Mt(this,ci,mf).call(this,async()=>await Mt(this,ci,S7).call(this,e))}},Kr=new WeakMap,Td=new WeakMap,fu=new WeakMap,e5=new WeakMap,pu=new WeakMap,Wf=new WeakMap,VE=new WeakMap,ci=new WeakSet,lN=async function(e=!1){if(!(this.connecting||this.connected))return await Mt(this,ci,mf).call(this,async()=>
1020{if(ne(this,fu)!==oi.Installed&&ne(this,fu)!==oi.Loadable)throw new A3;Xe(this,Td,!0);try{await ne(this,Kr).features[hy].connect({silent:e})}catch(n){throw new b7(n instanceof Error&&n.message||"Unknown error",n)}finally{Xe(this,Td,!1)}})},q2e=function(){ne(this,fu)!==oi.Installed&&this.emit("readyStateChange",Xe(this,fu,oi.Installed))},_7=function(){if(!ne(this,Kr).isAuthorized||!ne(this,pu))throw new xu;return ne(this,pu)},S7=async function(e){const n=Mt(this,ci,_7).call(this);try{if(si in ne(this,Kr).features)return ne(this,Kr).features[si].signTransaction(...e.map(r=>({account:n,transaction:r.serialize()}))).then(r=>r.map(i=>{const s=i.signedTransaction,o=s[0]*s4t+1;return OF.deserializeMessageVersion(s.slice(o,s.length))==="legacy"?dl.from(s):_3.deserialize(s)}));throw new Error("Connected wallet does not support signing transactions")}catch(r){throw new T0(D6(r),r)}},mf=async function(e){try{return await e()}catch(n){throw this.emit("error",n instanceof Bs?n:new Bs(D6(n),n)),n}},Kie),c4t=class extends a4t{constructor(t){const e=V2e(t.chain??t.cluster);super(new Fxt({appIdentity:t.appIdentity,authorizationCache:{set:t.authorizationResultCache.set,get:async()=>await t.authorizationResultCache.get(),clear:t.authorizationResultCache.clear},chains:[e],chainSelector:Gxt(),onWalletNotFound:async()=>{t.onWalletNotFound(this)}}),{addressSelector:t.addressSelector,chain:e})}},l4t=class extends c4t{};function u4t(){return{async select(t){return t[0]}}}function d4t(){return Kxt()}async function h4t(t){return qxt()}function f4t(){return h4t}var sn=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},ji=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Ps,ta,R0,M0,i0,rb,vE,nr,bE,uN,A7,dN,$b,hN,Gte,Zte,Yte,Qte;class p4t extends A2e{get name(){return sn(this,nr,"f").name}get url(){return"https://github.com/solana-labs/wallet-standard"}get icon(){return sn(this,nr,"f").icon}get readyState(){return sn(this,bE,"f")}get publicKey(){return sn(this,R0,"f")}get connecting(){return sn(this,M0,"f")}get supportedTransactionVersions(){return sn(this,vE,"f")}get wallet(){return sn(this,nr,"f")}get standard(){return!0}constructor({wallet:e}){super(),Ps.add(this),ta.set(this,void 0),R0.set(this,void 0),M0.set(this,void 0),i0.set(this,void 0),rb.set(this,void 0),vE.set(this,void 0),nr.set(this,void 0),bE.set(this,typeof window>"u"||typeof document>"u"?oi.Unsupported:oi.Installed),hN.set(this,n=>{if("accounts"in n){const r=sn(this,nr,"f").accounts[0];sn(this,ta,"f")&&!sn(this,i0,"f")&&r!==sn(this,ta,"f")&&(r?sn(this,Ps,"m",A7).call(this,r):(this.emit("error",new v5t),sn(this,Ps,"m",dN).call(this)))}"features"in n&&sn(this,Ps,"m",$b).call(this)}),ji(this,nr,e,"f"),ji(this,ta,null,"f"),ji(this,R0,null,"f"),ji(this,M0,!1,"f"),ji(this,i0,!1,"f"),ji(this,rb,sn(this,nr,"f").features[ES].on("change",sn(this,hN,"f")),"f"),sn(this,Ps,"m",$b).call(this)}destroy(){ji(this,ta,null,"f"),ji(this,R0,null,"f"),ji(this,M0,!1,"f"),ji(this,i0,!1,"f");const e=sn(this,rb,"f");e&&(ji(this,rb,null,"f"),e())}async autoConnect(){return sn(this,Ps,"m",uN).call(this,{silent:!0})}async connect(){return sn(this,Ps,"m",uN).call(this)}async disconnect(){if(mE in sn(this,nr,"f").features)try{ji(this,i0,!0,"f"),await sn(this,nr,"f").features[mE].disconnect()}catch(e){this.emit("error",new b5t(e==null?void 0:e.message,e))}finally{ji(this,i0,!1,"f")}sn(this,Ps,"m",dN).call(this)}async sendTransaction(e,n,r={}){try{const i=sn(this,ta,"f");if(!i)throw new xu;let s;if(sa in sn(this,nr,"f").features)if(i.features.includes(sa))s=sa;else if(si in sn(this,nr,"f").features&&i.features.includes(si))s=si;else throw new Bm;else if(si in sn(this,nr,"f").features){if(!i.features.includes(si))throw new Bm;s=si}else throw new nb;const o=D5t(n.rpcEndpoint);if(!i.chains.includes(o))throw new I0;try{const{signers:a,...c}=r;let l;if(P0(e)?(a!=null&&a.length&&e.sign(a),l=e.serialize()):(e=await this.prepareTransaction(e,n,c),a!=null&&a.length&&e.partialSign(...a),l=new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))),s===sa){const[u]=await sn(this,nr,"f").features[sa].signAndSendTransaction({account:i,chain:o,transaction:l,options:{preflightCommitment:xP(c.preflightCommitment||n.commitment),skipPreflight:c.skipPreflight,maxRetries:c.maxRetries,minContextSlot:c.minContextSlot}});return th.encode(u.signature)}else{const[u]=await sn(this,nr,"f").features[si].signTransaction({account:i,chain:o,transaction:l,options:{preflightCommitment:xP(c.preflightCommitment||n.commitment),minContextSlot:c.minContextSlot}});return await n.sendRawTransaction(u.signedTransaction,{...c,preflightCommitment:xP(c.preflightCommitment||n.commitment)})}}catch(a){throw a instanceof Bs?a:new I0(a==null?void 0:a.message,a)}}
1020catch(i){throw this.emit("error",i),i}}}ta=new WeakMap,R0=new WeakMap,M0=new WeakMap,i0=new WeakMap,rb=new WeakMap,vE=new WeakMap,nr=new WeakMap,bE=new WeakMap,hN=new WeakMap,Ps=new WeakSet,uN=async function(e){try{if(this.connected||this.connecting)return;if(sn(this,bE,"f")!==oi.Installed)throw new A3;if(ji(this,M0,!0,"f"),!sn(this,nr,"f").accounts.length)try{await sn(this,nr,"f").features[hy].connect(e)}catch(r){throw new b7(r==null?void 0:r.message,r)}const n=sn(this,nr,"f").accounts[0];if(!n)throw new Bm;sn(this,Ps,"m",A7).call(this,n)}catch(n){throw this.emit("error",n),n}finally{ji(this,M0,!1,"f")}},A7=function(e){let n;try{n=new bn(e.address)}catch(r){throw new _2e(r==null?void 0:r.message,r)}ji(this,ta,e,"f"),ji(this,R0,n,"f"),sn(this,Ps,"m",$b).call(this),this.emit("connect",n)},dN=function(){ji(this,ta,null,"f"),ji(this,R0,null,"f"),sn(this,Ps,"m",$b).call(this),this.emit("disconnect")},$b=function(){var n,r;const e=sa in sn(this,nr,"f").features?sn(this,nr,"f").features[sa].supportedTransactionVersions:sn(this,nr,"f").features[si].supportedTransactionVersions;ji(this,vE,wxt(e,["legacy"])?null:new Set(e),"f"),si in sn(this,nr,"f").features&&((n=sn(this,ta,"f"))!=null&&n.features.includes(si))?(this.signTransaction=sn(this,Ps,"m",Gte),this.signAllTransactions=sn(this,Ps,"m",Zte)):(delete this.signTransaction,delete this.signAllTransactions),kf in sn(this,nr,"f").features&&((r=sn(this,ta,"f"))!=null&&r.features.includes(kf))?this.signMessage=sn(this,Ps,"m",Yte):delete this.signMessage,s1 in sn(this,nr,"f").features?this.signIn=sn(this,Ps,"m",Qte):delete this.signIn},Gte=async function(e){try{const n=sn(this,ta,"f");if(!n)throw new xu;if(!(si in sn(this,nr,"f").features))throw new nb;if(!n.features.includes(si))throw new Bm;try{const i=(await sn(this,nr,"f").features[si].signTransaction({account:n,transaction:P0(e)?e.serialize():new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))[0].signedTransaction;return P0(e)?_3.deserialize(i):dl.from(i)}catch(r){throw r instanceof Bs?r:new T0(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}},Zte=async function(e){try{const n=sn(this,ta,"f");if(!n)throw new xu;if(!(si in sn(this,nr,"f").features))throw new nb;if(!n.features.includes(si))throw new Bm;try{const r=await sn(this,nr,"f").features[si].signTransaction(...e.map(i=>({account:n,transaction:P0(i)?i.serialize():new Uint8Array(i.serialize({requireAllSignatures:!1,verifySignatures:!1}))})));return e.map((i,s)=>{const o=r[s].signedTransaction;return P0(i)?_3.deserialize(o):dl.from(o)})}catch(r){throw new T0(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}},Yte=async function(e){try{const n=sn(this,ta,"f");if(!n)throw new xu;if(!(kf in sn(this,nr,"f").features))throw new nb;if(!n.features.includes(kf))throw new Bm;try{return(await sn(this,nr,"f").features[kf].signMessage({account:n,message:e}))[0].signature}catch(r){throw new S2e(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}},Qte=async function(e={}){try{if(!(s1 in sn(this,nr,"f").features))throw new nb;let n;try{[n]=await sn(this,nr,"f").features[s1].signIn(e)}catch(r){throw new Fte(r==null?void 0:r.message,r)}if(!n)throw new Fte;return sn(this,Ps,"m",A7).call(this,n.account),n}catch(n){throw this.emit("error",n),n}};const g4t=_5t;function m4t(t){const e=Xte(()=>new Set),{get:n,on:r}=Xte(()=>r4t()),[i,s]=E.useState(()=>Jte(n()));E.useEffect(()=>{const a=[r("register",(...c)=>s(l=>[...l,...Jte(c)])),r("unregister",(...c)=>s(l=>l.filter(u=>c.some(d=>d===u.wallet))))];return()=>a.forEach(c=>c())},[r]);const o=y4t(i);return E.useEffect(()=>{if(!o)return;const a=new Set(i);new Set(o.filter(l=>!a.has(l))).forEach(l=>l.destroy())},[o,i]),E.useEffect(()=>()=>i.forEach(a=>a.destroy()),[]),E.useMemo(()=>[...i,...t.filter(({name:a})=>i.some(c=>c.name===a)?(e.has(a)||(e.add(a),console.warn(`${a} was registered as a Standard Wallet. The Wallet Adapter for ${a} can be removed from your app.`)),!1):!0)],[i,t,e])}function Xte(t){const e=E.useRef(void 0);return e.current===void 0&&(e.current={value:t()}),e.current.value}function y4t(t){const e=E.useRef(void 0);return E.useEffect(()=>{e.current=t}),e.current}function Jte(t){return t.filter(g4t).map(e=>new p4t({wallet:e}))}var fy;(function(t){t[t.DESKTOP_WEB=0]="DESKTOP_WEB",t[t.MOBILE_WEB=1]="MOBILE_WEB"})(fy||(fy={}));function w4t(t){return/(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(t)}function v4t({adapters:t,userAgentString:e}){return t.some(n=>n.name!==C7&&n.readyState===oi.Installed)?fy.DESKTOP_WEB:e&&/android/i.test(e)&&!w4t(e)?fy.MOBILE_WEB:fy.DESKTOP_WEB}
1020function b4t(t){return t?/devnet/i.test(t)?"devnet":/testnet/i.test(t)?"testnet":"mainnet-beta":"mainnet-beta"}function x4t({children:t,wallets:e,adapter:n,isUnloadingRef:r,onAutoConnectRequest:i,onConnectError:s,onError:o,onSelectWallet:a}){const c=E.useRef(!1),[l,u]=E.useState(!1),d=E.useRef(!1),[h,f]=E.useState(!1),[m,y]=E.useState(()=>(n==null?void 0:n.publicKey)??null),[v,b]=E.useState(()=>(n==null?void 0:n.connected)??!1),C=E.useRef(o);E.useEffect(()=>(C.current=o,()=>{C.current=void 0}),[o]);const x=E.useRef((k,M)=>(r.current||(C.current?C.current(k,M):(console.error(k,M),k instanceof A3&&typeof window<"u"&&M&&window.open(M.url,"_blank"))),k)),[_,$]=E.useState(()=>e.map(k=>({adapter:k,readyState:k.readyState})).filter(({readyState:k})=>k!==oi.Unsupported));E.useEffect(()=>{$(M=>e.map((W,H)=>{const D=M[H];return D&&D.adapter===W&&D.readyState===W.readyState?D:{adapter:W,readyState:W.readyState}}).filter(({readyState:W})=>W!==oi.Unsupported));function k(M){$(W=>{const H=W.findIndex(({adapter:V})=>V===this);if(H===-1)return W;const{adapter:D}=W[H];return[...W.slice(0,H),{adapter:D,readyState:M},...W.slice(H+1)].filter(({readyState:V})=>V!==oi.Unsupported)})}return e.forEach(M=>M.on("readyStateChange",k,M)),()=>{e.forEach(M=>M.off("readyStateChange",k,M))}},[n,e]);const I=E.useMemo(()=>_.find(k=>k.adapter===n)??null,[n,_]);E.useEffect(()=>{if(!n)return;const k=H=>{y(H),c.current=!1,u(!1),b(!0),d.current=!1,f(!1)},M=()=>{r.current||(y(null),c.current=!1,u(!1),b(!1),d.current=!1,f(!1))},W=H=>{x.current(H,n)};return n.on("connect",k),n.on("disconnect",M),n.on("error",W),()=>{n.off("connect",k),n.off("disconnect",M),n.off("error",W),M()}},[n,r]);const R=E.useRef(!1);E.useEffect(()=>()=>{R.current=!1},[n]),E.useEffect(()=>{R.current||c.current||v||!i||!((I==null?void 0:I.readyState)===oi.Installed||(I==null?void 0:I.readyState)===oi.Loadable)||(c.current=!0,u(!0),R.current=!0,async function(){try{await i()}catch{s()}finally{u(!1),c.current=!1}}())},[v,i,s,I]);const N=E.useCallback(async(k,M,W)=>{if(!n)throw x.current(new Ute);if(!v)throw x.current(new xu,n);return await n.sendTransaction(k,M,W)},[n,v]),T=E.useMemo(()=>n&&"signTransaction"in n?async k=>{if(!v)throw x.current(new xu,n);return await n.signTransaction(k)}:void 0,[n,v]),O=E.useMemo(()=>n&&"signAllTransactions"in n?async k=>{if(!v)throw x.current(new xu,n);return await n.signAllTransactions(k)}:void 0,[n,v]),U=E.useMemo(()=>n&&"signMessage"in n?async k=>{if(!v)throw x.current(new xu,n);return await n.signMessage(k)}:void 0,[n,v]),z=E.useMemo(()=>n&&"signIn"in n?async k=>await n.signIn(k):void 0,[n]),L=E.useCallback(async()=>{if(c.current||d.current||I!=null&&I.adapter.connected)return;if(!I)throw x.current(new Ute);const{adapter:k,readyState:M}=I;if(!(M===oi.Installed||M===oi.Loadable))throw x.current(new A3,k);c.current=!0,u(!0);try{await k.connect()}catch(W){throw s(),W}finally{u(!1),c.current=!1}},[s,I]),S=E.useCallback(async()=>{if(!d.current&&n){d.current=!0,f(!0);try{await n.disconnect()}finally{f(!1),d.current=!1}}},[n]);return Rt.createElement(k2e.Provider,{value:{autoConnect:!!i,wallets:_,wallet:I,publicKey:m,connected:v,connecting:l,disconnecting:h,select:a,connect:L,disconnect:S,sendTransaction:N,signTransaction:T,signAllTransactions:O,signMessage:U,signIn:z}},t)}let kP;function E4t(){var t;return kP===void 0&&(kP=((t=globalThis.navigator)==null?void 0:t.userAgent)??null),kP}function ene(t){const e=E4t();return v4t({adapters:t,userAgentString:e})===fy.MOBILE_WEB}function C4t(){const t=globalThis.location;if(t)return`${t.protocol}//${t.host}`}function _4t({children:t,wallets:e,autoConnect:n,localStorageKey:r="walletName",onError:i}){const{connection:s}=y5t(),o=m4t(e),a=E.useMemo(()=>{if(!ene(o))return null;const C=o.find(x=>x.name===C7);return C||new l4t({addressSelector:u4t(),appIdentity:{uri:C4t()},authorizationResultCache:d4t(),cluster:b4t(s==null?void 0:s.rpcEndpoint),onWalletNotFound:f4t()})},[o,s==null?void 0:s.rpcEndpoint]),c=E.useMemo(()=>a==null||o.indexOf(a)!==-1?o:[a,...o],[o,a]),[l,u]=k5t(r,null),d=E.useMemo(()=>c.find(C=>C.name===l)??null,[c,l]),h=E.useCallback(C=>{l!==C&&(d&&d.name!==C7&&d.disconnect(),u(C))},[d,u,l]);E.useEffect(()=>{if(!d)return;function C(){y.current||u(null)}return d.on("disconnect",C),()=>{d.off("disconnect",C)}},[d,o,u,l]);const f=E.useRef(!1),m=E.useMemo(()=>
1020{if(!(!n||!d))return async()=>{(n===!0||await n(d))&&(f.current?await d.connect():await d.autoConnect())}},[n,d]),y=E.useRef(!1);E.useEffect(()=>{if(l===C7&&ene(o)){y.current=!1;return}function C(){y.current=!0}return window.addEventListener("beforeunload",C),()=>{window.removeEventListener("beforeunload",C)}},[o,l]);const v=E.useCallback(()=>{d&&h(null)},[d,h]),b=E.useCallback(C=>{f.current=!0,h(C)},[h]);return Rt.createElement(x4t,{wallets:c,adapter:d,isUnloadingRef:y,onAutoConnectRequest:m,onConnectError:v,onError:i,onSelectWallet:b},t)}var S4t=E.useLayoutEffect;function A4t(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function k4t(){const t=A4t();if(t.__xstate__)return t.__xstate__}const $4t=t=>{if(typeof window>"u")return;const e=k4t();e&&e.register(t)};class tne{constructor(e){this._process=e,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(e){const n={value:e,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush()}flush(){for(;this._current;){const e=this._current;this._process(e.value),this._current=e.next}this._last=null}}const K2e=".",I4t="",G2e="",T4t="#",P4t="*",Z2e="xstate.init",R4t="xstate.error",xE="xstate.stop";function M4t(t,e){return{type:`xstate.after.${t}.${e}`}}function fN(t,e){return{type:`xstate.done.state.${t}`,output:e}}function O4t(t,e){return{type:`xstate.done.actor.${t}`,output:e,actorId:t}}function Y2e(t,e){return{type:`xstate.error.actor.${t}`,error:e,actorId:t}}function Q2e(t){return{type:Z2e,input:t}}function Yl(t){setTimeout(()=>{throw t})}const j4t=typeof Symbol=="function"&&Symbol.observable||"@@observable";function X2e(t,e){const n=nne(t),r=nne(e);return typeof r=="string"?typeof n=="string"?r===n:!1:typeof n=="string"?n in r:Object.keys(n).every(i=>i in r?X2e(n[i],r[i]):!1)}function BF(t){if(ewe(t))return t;const e=[];let n="";for(let r=0;r<t.length;r++){switch(t.charCodeAt(r)){case 92:n+=t[r+1],r++;continue;case 46:e.push(n),n="";continue}n+=t[r]}return e.push(n),e}function nne(t){if(p6t(t))return t.value;if(typeof t!="string")return t;const e=BF(t);return N4t(e)}function N4t(t){if(t.length===1)return t[0];const e={};let n=e;for(let r=0;r<t.length-1;r++)if(r===t.length-2)n[t[r]]=t[r+1];else{const i=n;n={},i[t[r]]=n}return e}function rne(t,e){const n={},r=Object.keys(t);for(let i=0;i<r.length;i++){const s=r[i];n[s]=e(t[s],s,t,i)}return n}function J2e(t){return ewe(t)?t:[t]}function Zf(t){return t===void 0?[]:J2e(t)}function pN(t,e,n,r){return typeof t=="function"?t({context:e,event:n,self:r}):t}function ewe(t){return Array.isArray(t)}function D4t(t){return t.type.startsWith("xstate.error.actor")}function Sm(t){return J2e(t).map(e=>typeof e>"u"||typeof e=="string"?{target:e}:e)}function twe(t){if(!(t===void 0||t===I4t))return Zf(t)}function gN(t,e,n){var s,o,a;const r=typeof t=="object",i=r?t:void 0;return{next:(s=r?t.next:t)==null?void 0:s.bind(i),error:(o=r?t.error:e)==null?void 0:o.bind(i),complete:(a=r?t.complete:n)==null?void 0:a.bind(i)}}function ine(t,e){return`${e}.${t}`}function FF(t,e){const n=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return t.implementations.actors[e];const[,r,i]=n,o=t.getStateNodeById(i).config.invoke;return(Array.isArray(o)?o[r]:o).src}function L4t(t,e){if(e===t||e===P4t)return!0;if(!e.endsWith(".*"))return!1;const n=e.split("."),r=t.split(".");for(let i=0;i<n.length;i++){const s=n[i],o=r[i];if(s==="*")return i===n.length-1;if(s!==o)return!1}return!0}function sne(t,e){return`${t.sessionId}.${e}`}let B4t=0;function F4t(t,e){const n=new Map,r=new Map,i=new WeakMap,s=new Set,o={},{clock:a,logger:c}=e,l={schedule:(h,f,m,y,v=Math.random().toString(36).slice(2))=>{const b={source:h,target:f,event:m,delay:y,id:v,startedAt:Date.now()},C=sne(h,v);d._snapshot._scheduledEvents[C]=b;const x=a.setTimeout(()=>{delete o[C],delete d._snapshot._scheduledEvents[C],d._relay(h,f,m)},y);o[C]=x},cancel:(h,f)=>{const m=sne(h,f),y=o[m];delete o[m],delete d._snapshot._scheduledEvents[m],y!==void 0&&a.clearTimeout(y)}
1020,cancelAll:h=>{for(const f in d._snapshot._scheduledEvents){const m=d._snapshot._scheduledEvents[f];m.source===h&&l.cancel(h,m.id)}}},u=h=>{if(!s.size)return;const f={...h,rootId:t.sessionId};s.forEach(m=>{var y;return(y=m.next)==null?void 0:y.call(m,f)})},d={_snapshot:{_scheduledEvents:((e==null?void 0:e.snapshot)&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${B4t++}`,_register:(h,f)=>(n.set(h,f),h),_unregister:h=>{n.delete(h.sessionId);const f=i.get(h);f!==void 0&&(r.delete(f),i.delete(h))},get:h=>r.get(h),getAll:()=>Object.fromEntries(r.entries()),_set:(h,f)=>{const m=r.get(h);if(m&&m!==f)throw new Error(`Actor with system ID '${h}' already exists.`);r.set(h,f),i.set(f,h)},inspect:h=>{const f=gN(h);return s.add(f),{unsubscribe(){s.delete(f)}}},_sendInspectionEvent:u,_relay:(h,f,m)=>{d._sendInspectionEvent({type:"@xstate.event",sourceRef:h,actorRef:f,event:m}),f._send(m)},scheduler:l,getSnapshot:()=>({_scheduledEvents:{...d._snapshot._scheduledEvents}}),start:()=>{const h=d._snapshot._scheduledEvents;d._snapshot._scheduledEvents={};for(const f in h){const{source:m,target:y,event:v,delay:b,id:C}=h[f];l.schedule(m,y,v,b,C)}},_clock:a,_logger:c};return d}let $P=!1;const UF=1;let Yo=function(t){return t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped",t}({});const U4t={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};class z4t{constructor(e,n){this.logic=e,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new tne(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=Yo.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const r={...U4t,...n},{clock:i,logger:s,parent:o,syncSnapshot:a,id:c,systemId:l,inspect:u}=r;this.system=o?o.system:F4t(this,{clock:i,logger:s}),u&&!o&&this.system.inspect(gN(u)),this.sessionId=this.system._bookId(),this.id=c??this.sessionId,this.logger=(n==null?void 0:n.logger)??this.system._logger,this.clock=(n==null?void 0:n.clock)??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=r,this.src=r.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:d=>{this._deferred.push(d)},system:this.system,stopChild:d=>{if(d._parent!==this)throw new Error(`Cannot stop child actor ${d.id} of ${this.id} because it is not a child`);d._stop()},emit:d=>{const h=this.eventListeners.get(d.type),f=this.eventListeners.get("*");if(!h&&!f)return;const m=[...h?h.values():[],...f?f.values():[]];for(const y of m)try{y(d)}catch(v){Yl(v)}},actionExecutor:d=>{const h=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:d.type,params:d.params}}),!d.exec)return;const f=$P;try{$P=!0,d.exec(d.info,d.params)}finally{$P=f}};this._processingStatus===Yo.Running?h():this._deferred.push(h)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this.systemId=l,this.system._set(l,this)),this._initState((n==null?void 0:n.snapshot)??(n==null?void 0:n.state)),l&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(e){var n;try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,(n=this.options)==null?void 0:n.input)}catch(r){this._snapshot={status:"error",output:void 0,error:r}}}update(e,n){var i,s;this._snapshot=e;let r;for(;r=this._deferred.shift();)try{r()}catch(o){this._deferred.length=0,this._snapshot={...e,status:"error",error:o}}switch(this._snapshot.status){case"active":for(const o of this.observers)try{(i=o.next)==null||i.call(o,e)}catch(a){Yl(a)}break;case"done":for(const o of this.observers)try{(s=o.next)==null||s.call(o,e)}catch(a){Yl(a)}this._stopProcedure(),this._complete(),this._doneEvent=O4t(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:e})}subscribe(e,n,r){var s;const i=gN(e,n,r);if(this._processingStatus!==Yo.Stopped)this.observers.add(i);else switch(this._snapshot.status){case"done":try{(s=i.complete)==null||s.call(i)}catch(o){Yl(o)}break;case"error":{const o=this._snapshot.error;if(!i.error)Yl(o);else try{i.error(o)}catch(a){Yl(a)}break}}return{unsubscribe:()=>{this.observers.delete(i)}}}on(e,n){let r=this.eventListeners.get(e);r||(r=new Set,this.eventListeners.set(e,r));const i=n.bind(void 0);return r.add(i),{unsubscribe:()=>{r.delete(i)}}}
1020start(){if(this._processingStatus===Yo.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=Yo.Running;const e=Q2e(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case"done":return this.update(this._snapshot,e),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let n,r;try{n=this.logic.transition(this._snapshot,e,this._actorScope)}catch(i){r={err:i}}if(r){const{err:i}=r;this._snapshot={...this._snapshot,status:"error",error:i},this._error(i);return}this.update(n,e),e.type===xE&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===Yo.Stopped?this:(this.mailbox.clear(),this._processingStatus===Yo.NotStarted?(this._processingStatus=Yo.Stopped,this):(this.mailbox.enqueue({type:xE}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var e;for(const n of this.observers)try{(e=n.complete)==null||e.call(n)}catch(r){Yl(r)}this.observers.clear()}_reportError(e){if(!this.observers.size){this._parent||Yl(e);return}let n=!1;for(const r of this.observers){const i=r.error;n||(n=!i);try{i==null||i(e)}catch(s){Yl(s)}}this.observers.clear(),n&&Yl(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,Y2e(this.id,e))}_stopProcedure(){return this._processingStatus!==Yo.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new tne(this._process.bind(this)),this._processingStatus=Yo.Stopped,this.system._unregister(this),this)}_send(e){this._processingStatus!==Yo.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){const{devTools:e}=this.options;e&&(typeof e=="function"?e:$4t)(this)}toJSON(){return{xstate$$type:UF,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[j4t](){return this}getSnapshot(){return this._snapshot}}function y2(t,...[e]){return new z4t(t,e)}function W4t(t,e,n,r,{sendId:i}){const s=typeof i=="function"?i(n,r):i;return[e,{sendId:s},void 0]}function H4t(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e.sendId)})}function zF(t){function e(n,r){}return e.type="xstate.cancel",e.sendId=t,e.resolve=W4t,e.execute=H4t,e}function V4t(t,e,n,r,{id:i,systemId:s,src:o,input:a,syncSnapshot:c}){const l=typeof o=="string"?FF(e.machine,o):o,u=typeof i=="function"?i(n):i;let d,h;return l&&(h=typeof a=="function"?a({context:e.context,event:n.event,self:t.self}):a,d=y2(l,{id:u,src:o,parent:t.self,syncSnapshot:c,systemId:s,input:h})),[M1(e,{children:{...e.children,[u]:d}}),{id:i,systemId:s,actorRef:d,src:o,input:h},void 0]}function q4t(t,{actorRef:e}){e&&t.defer(()=>{e._processingStatus!==Yo.Stopped&&e.start()})}function WF(...[t,{id:e,systemId:n,input:r,syncSnapshot:i=!1}={}]){function s(o,a){}return s.type="xstate.spawnChild",s.id=e,s.systemId=n,s.src=t,s.input=r,s.syncSnapshot=i,s.resolve=V4t,s.execute=q4t,s}function K4t(t,e,n,r,{actorRef:i}){const s=typeof i=="function"?i(n,r):i,o=typeof s=="string"?e.children[s]:s;let a=e.children;return o&&(a={...a},delete a[o.id]),[M1(e,{children:a}),o,void 0]}function G4t(t,e){if(e){if(t.system._unregister(e),e._processingStatus!==Yo.Running){t.stopChild(e);return}t.defer(()=>{t.stopChild(e)})}}function AS(t){function e(n,r){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=K4t,e.execute=G4t,e}function kS(t,e,n,r){const{machine:i}=r,s=typeof t=="function",o=s?t:i.implementations.guards[typeof t=="string"?t:t.type];if(!s&&!o)throw new Error(`Guard '${typeof t=="string"?t:t.type}' is not implemented.'.`);if(typeof o!="function")return kS(o,e,n,r);const a={context:e,event:n},c=s||typeof t=="string"?void 0:"params"in t?typeof t.params=="function"?t.params({context:e,event:n}):t.params:void 0;return"check"in o?o.check(r,a,o):o(a,c)}const HF=t=>t.type==="atomic"||t.type==="final";function w2(t){return Object.values(t.states).filter(e=>e.type!=="history")}function ux(t,e){const n=[];if(e===t)return n;let r=t.parent;for(;r&&r!==e;)n.push(r),r=r.parent;return n}function EE(t){const e=new Set(t),n=rwe(e);for(const r of e)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))one(r).forEach(i=>
1020e.add(i));else if(r.type==="parallel"){for(const i of w2(r))if(i.type!=="history"&&!e.has(i)){const s=one(i);for(const o of s)e.add(o)}}for(const r of e){let i=r.parent;for(;i;)e.add(i),i=i.parent}return e}function nwe(t,e){const n=e.get(t);if(!n)return{};if(t.type==="compound"){const i=n[0];if(i){if(HF(i))return i.key}else return{}}const r={};for(const i of n)r[i.key]=nwe(i,e);return r}function rwe(t){const e=new Map;for(const n of t)e.has(n)||e.set(n,[]),n.parent&&(e.has(n.parent)||e.set(n.parent,[]),e.get(n.parent).push(n));return e}function iwe(t,e){const n=EE(e);return nwe(t,rwe(n))}function VF(t,e){return e.type==="compound"?w2(e).some(n=>n.type==="final"&&t.has(n)):e.type==="parallel"?w2(e).every(n=>VF(t,n)):e.type==="final"}const $S=t=>t[0]===T4t;function Z4t(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(r=>L4t(e,r)).sort((r,i)=>i.length-r.length).flatMap(r=>t.transitions.get(r))}function Y4t(t){const e=t.config.after;if(!e)return[];const n=i=>{const s=M4t(i,t.id),o=s.type;return t.entry.push(GF(s,{id:o,delay:i})),t.exit.push(zF(o)),o};return Object.keys(e).flatMap(i=>{const s=e[i],o=typeof s=="string"?{target:s}:s,a=Number.isNaN(+i)?i:+i,c=n(a);return Zf(o).map(l=>({...l,event:c,delay:a}))}).map(i=>{const{delay:s}=i;return{...f0(t,i.event,i),delay:s}})}function f0(t,e,n){const r=twe(n.target),i=n.reenter??!1,s=J4t(t,r),o={...n,actions:Zf(n.actions),guard:n.guard,target:s,source:t,reenter:i,eventType:e,toJSON:()=>({...o,source:`#${t.id}`,target:s?s.map(a=>`#${a.id}`):void 0})};return o}function Q4t(t){const e=new Map;if(t.config.on)for(const n of Object.keys(t.config.on)){if(n===G2e)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const r=t.config.on[n];e.set(n,Sm(r).map(i=>f0(t,n,i)))}if(t.config.onDone){const n=`xstate.done.state.${t.id}`;e.set(n,Sm(t.config.onDone).map(r=>f0(t,n,r)))}for(const n of t.invoke){if(n.onDone){const r=`xstate.done.actor.${n.id}`;e.set(r,Sm(n.onDone).map(i=>f0(t,r,i)))}if(n.onError){const r=`xstate.error.actor.${n.id}`;e.set(r,Sm(n.onError).map(i=>f0(t,r,i)))}if(n.onSnapshot){const r=`xstate.snapshot.${n.id}`;e.set(r,Sm(n.onSnapshot).map(i=>f0(t,r,i)))}}for(const n of t.after){let r=e.get(n.eventType);r||(r=[],e.set(n.eventType,r)),r.push(n)}return e}function X4t(t,e){const n=typeof e=="string"?t.states[e]:e?t.states[e.target]:void 0;if(!n&&e)throw new Error(`Initial state node "${e}" not found on parent state node #${t.id}`);const r={source:t,actions:!e||typeof e=="string"?[]:Zf(e.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${t.id}`,target:n?[`#${n.id}`]:[]})};return r}function J4t(t,e){if(e!==void 0)return e.map(n=>{if(typeof n!="string")return n;if($S(n))return t.machine.getStateNodeById(n);const r=n[0]===K2e;if(r&&!t.parent)return CE(t,n.slice(1));const i=r?t.key+n:n;if(t.parent)try{return CE(t.parent,i)}catch(s){throw new Error(`Invalid transition definition for state node '${t.id}': 1021${s.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function swe(t){const e=twe(t.config.target);return e?{target:e.map(n=>typeof n=="string"?CE(t.parent,n):n)}:t.parent.initial}function O0(t){return t.type==="history"}function one(t){const e=owe(t);for(const n of e)for(const r of ux(n,t))e.add(r);return e}function owe(t){const e=new Set;function n(r){if(!e.has(r)){if(e.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(const i of w2(r))n(i)}}return n(t),e}function v2(t,e){if($S(e))return t.machine.getStateNodeById(e);if(!t.states)throw new Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);const n=t.states[e];if(!n)throw new Error(`Child state '${e}' does not exist on '${t.id}'`);return n}function CE(t,e){if(typeof e=="string"&&$S(e))try{return t.machine.getStateNodeById(e)}catch{}const n=BF(e).slice();let r=t;for(;n.length;){const i=n.shift();if(!i.length)break;r=v2(r,i)}return r}function _E(t,e){if(typeof e=="string"){const i=t.states[e];if(!i)throw new Error(`State '${e}' does not exist on '${t.id}'`);return[t,i]}const n=Object.keys(e),r=n.map(i=>
1021v2(t,i)).filter(Boolean);return[t.machine.root,t].concat(r,n.reduce((i,s)=>{const o=v2(t,s);if(!o)return i;const a=_E(o,e[s]);return i.concat(a)},[]))}function e6t(t,e,n,r){const s=v2(t,e).next(n,r);return!s||!s.length?t.next(n,r):s}function t6t(t,e,n,r){const i=Object.keys(e),s=v2(t,i[0]),o=qF(s,e[i[0]],n,r);return!o||!o.length?t.next(n,r):o}function n6t(t,e,n,r){const i=[];for(const s of Object.keys(e)){const o=e[s];if(!o)continue;const a=v2(t,s),c=qF(a,o,n,r);c&&i.push(...c)}return i.length?i:t.next(n,r)}function qF(t,e,n,r){return typeof e=="string"?e6t(t,e,n,r):Object.keys(e).length===1?t6t(t,e,n,r):n6t(t,e,n,r)}function r6t(t){return Object.keys(t.states).map(e=>t.states[e]).filter(e=>e.type==="history")}function dp(t,e){let n=t;for(;n.parent&&n.parent!==e;)n=n.parent;return n.parent===e}function i6t(t,e){const n=new Set(t),r=new Set(e);for(const i of n)if(r.has(i))return!0;for(const i of r)if(n.has(i))return!0;return!1}function awe(t,e,n){const r=new Set;for(const i of t){let s=!1;const o=new Set;for(const a of r)if(i6t(mN([i],e,n),mN([a],e,n)))if(dp(i.source,a.source))o.add(a);else{s=!0;break}if(!s){for(const a of o)r.delete(a);r.add(i)}}return Array.from(r)}function s6t(t){const[e,...n]=t;for(const r of ux(e,void 0))if(n.every(i=>dp(i,r)))return r}function KF(t,e){if(!t.target)return[];const n=new Set;for(const r of t.target)if(O0(r))if(e[r.id])for(const i of e[r.id])n.add(i);else for(const i of KF(swe(r),e))n.add(i);else n.add(r);return[...n]}function cwe(t,e){const n=KF(t,e);if(!n)return;if(!t.reenter&&n.every(i=>i===t.source||dp(i,t.source)))return t.source;const r=s6t(n.concat(t.source));if(r)return r;if(!t.reenter)return t.source.machine.root}function mN(t,e,n){var i;const r=new Set;for(const s of t)if((i=s.target)!=null&&i.length){const o=cwe(s,n);s.reenter&&s.source===o&&r.add(o);for(const a of e)dp(a,o)&&r.add(a)}return[...r]}function o6t(t,e){if(t.length!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function yN(t,e,n,r,i,s){if(!t.length)return e;const o=new Set(e._nodes);let a=e.historyValue;const c=awe(t,o,a);let l=e;i||([l,a]=u6t(l,r,n,c,o,a,s,n.actionExecutor)),l=b2(l,r,n,c.flatMap(d=>d.actions),s,void 0),l=c6t(l,r,n,c,o,s,a,i);const u=[...o];l.status==="done"&&(l=b2(l,r,n,u.sort((d,h)=>h.order-d.order).flatMap(d=>d.exit),s,void 0));try{return a===e.historyValue&&o6t(e._nodes,o)?l:M1(l,{_nodes:u,historyValue:a})}catch(d){throw d}}function a6t(t,e,n,r,i){if(r.output===void 0)return;const s=fN(i.id,i.output!==void 0&&i.parent?pN(i.output,t.context,e,n.self):void 0);return pN(r.output,t.context,s,n.self)}function c6t(t,e,n,r,i,s,o,a){let c=t;const l=new Set,u=new Set;l6t(r,o,u,l),a&&u.add(t.machine.root);const d=new Set;for(const h of[...l].sort((f,m)=>f.order-m.order)){i.add(h);const f=[];f.push(...h.entry);for(const m of h.invoke)f.push(WF(m.src,{...m,syncSnapshot:!!m.onSnapshot}));if(u.has(h)){const m=h.initial.actions;f.push(...m)}if(c=b2(c,e,n,f,s,h.invoke.map(m=>m.id)),h.type==="final"){const m=h.parent;let y=(m==null?void 0:m.type)==="parallel"?m:m==null?void 0:m.parent,v=y||h;for((m==null?void 0:m.type)==="compound"&&s.push(fN(m.id,h.output!==void 0?pN(h.output,c.context,e,n.self):void 0));(y==null?void 0:y.type)==="parallel"&&!d.has(y)&&VF(i,y);)d.add(y),s.push(fN(y.id)),v=y,y=y.parent;if(y)continue;c=M1(c,{status:"done",output:a6t(c,e,n,c.machine.root,v)})}}return c}function l6t(t,e,n,r){for(const i of t){const s=cwe(i,e);for(const a of i.target||[])!O0(a)&&(i.source!==a||i.source!==s||i.reenter)&&(r.add(a),n.add(a)),Um(a,e,n,r);const o=KF(i,e);for(const a of o){const c=ux(a,s);(s==null?void 0:s.type)==="parallel"&&c.push(s),lwe(r,e,n,c,!i.source.parent&&i.reenter?void 0:s)}}}function Um(t,e,n,r){var i;if(O0(t))if(e[t.id]){const s=e[t.id];for(const o of s)r.add(o),Um(o,e,n,r);for(const o of s)IP(o,t.parent,r,e,n)}else{const s=swe(t);for(const o of s.target)r.add(o),s===((i=t.parent)==null?void 0:i.initial)&&n.add(t.parent),Um(o,e,n,r);for(const o of s.target)IP(o,t.parent,r,e,n)}else if(t.type==="compound"){const[s]=t.initial.target;O0(s)||(r.add(s),n.add(s)),Um(s,e,n,r),IP(s,t,r,e,n)}else if(t.type==="parallel")for(const s of w2(t).filter(o=>!O0(o)))[...r].some(o=>dp(o,s))||(O0(s)||(r.add(s),n.add(s)),Um(s,e,n,r))}function lwe(t,e,n,r,i){for(const s of r)if((!i||dp(s,i))&&t.add(s),s.type==="parallel")for(const o of w2(s).filter(a=>!O0(a)))[...t].some(a=>dp(a,o))||(t.add(o),Um(o,e,n,t))}function IP(t,e,n,r,i){lwe(n,r,i,ux(t,e))}function u6t(t,e,n,r,i,s,o,a){let c=t;const l=mN(r,i,s);l.sort((d,h)=>h.order-d.order);let u;for(const d of l)for(const h of r6t(d)){let f;h.history==="deep"?f=m=>HF(m)&&dp(m,d):f=m=>m.parent===d,u??(u={...s}),u[h.id]=Array.from(i).filter(f)}for(const d of l)c=b2(c,e,n,[...d.exit,...d.invoke.map(h=>
1021AS(h.id))],o,void 0),i.delete(d);return[c,u||s]}function d6t(t,e){return t.implementations.actions[e]}function uwe(t,e,n,r,i,s){const{machine:o}=t;let a=t;for(const c of r){const l=typeof c=="function",u=l?c:d6t(o,typeof c=="string"?c:c.type),d={context:a.context,event:e,self:n.self,system:n.system},h=l||typeof c=="string"?void 0:"params"in c?typeof c.params=="function"?c.params({context:a.context,event:e}):c.params:void 0;if(!u||!("resolve"in u)){n.actionExecutor({type:typeof c=="string"?c:typeof c=="object"?c.type:c.name||"(anonymous)",info:d,params:h,exec:u});continue}const f=u,[m,y,v]=f.resolve(n,a,d,h,u,i);a=m,"retryResolve"in f&&(s==null||s.push([f,y])),"execute"in f&&n.actionExecutor({type:f.type,info:d,params:y,exec:f.execute.bind(null,n,y)}),v&&(a=uwe(a,e,n,v,i,s))}return a}function b2(t,e,n,r,i,s){const o=s?[]:void 0,a=uwe(t,e,n,r,{internalQueue:i,deferredActorIds:s},o);return o==null||o.forEach(([c,l])=>{c.retryResolve(n,a,l)}),a}function TP(t,e,n,r){let i=t;const s=[];function o(l,u,d){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:u,snapshot:l,_transitions:d}),s.push(l)}if(e.type===xE)return i=M1(ane(i,e,n),{status:"stopped"}),o(i,e,[]),{snapshot:i,microstates:s};let a=e;if(a.type!==Z2e){const l=a,u=D4t(l),d=cne(l,i);if(u&&!d.length)return i=M1(t,{status:"error",error:l.error}),o(i,l,[]),{snapshot:i,microstates:s};i=yN(d,t,n,a,!1,r),o(i,l,d)}let c=!0;for(;i.status==="active";){let l=c?h6t(i,a):[];const u=l.length?i:void 0;if(!l.length){if(!r.length)break;a=r.shift(),l=cne(a,i)}i=yN(l,i,n,a,!1,r),c=i!==u,o(i,a,l)}return i.status!=="active"&&ane(i,a,n),{snapshot:i,microstates:s}}function ane(t,e,n){return b2(t,e,n,Object.values(t.children).map(r=>AS(r)),[],void 0)}function cne(t,e){return e.machine.getTransitionData(e,t)}function h6t(t,e){const n=new Set,r=t._nodes.filter(HF);for(const i of r)e:for(const s of[i].concat(ux(i,void 0)))if(s.always){for(const o of s.always)if(o.guard===void 0||kS(o.guard,t.context,e,t)){n.add(o);break e}}return awe(Array.from(n),new Set(t._nodes),t.historyValue)}function f6t(t,e){const n=EE(_E(t,e));return iwe(t,[...n])}function p6t(t){return!!t&&typeof t=="object"&&"machine"in t&&"value"in t}const g6t=function(e){return X2e(e,this.value)},m6t=function(e){return this.tags.has(e)},y6t=function(e){const n=this.machine.getTransitionData(this,e);return!!(n!=null&&n.length)&&n.some(r=>r.target!==void 0||r.actions.length)},w6t=function(){const{_nodes:e,tags:n,machine:r,getMeta:i,toJSON:s,can:o,hasTag:a,matches:c,...l}=this;return{...l,tags:Array.from(n)}},v6t=function(){return this._nodes.reduce((e,n)=>(n.meta!==void 0&&(e[n.id]=n.meta),e),{})};function k7(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:iwe(e.root,t._nodes),tags:new Set(t._nodes.flatMap(n=>n.tags)),children:t.children,historyValue:t.historyValue||{},matches:g6t,hasTag:m6t,can:y6t,getMeta:v6t,toJSON:w6t}}function M1(t,e={}){return k7({...t,...e},t.machine)}function b6t(t){if(typeof t!="object"||t===null)return{};const e={};for(const n in t){const r=t[n];Array.isArray(r)&&(e[n]=r.map(i=>({id:i.id})))}return e}function x6t(t,e){const{_nodes:n,tags:r,machine:i,children:s,context:o,can:a,hasTag:c,matches:l,getMeta:u,toJSON:d,...h}=t,f={};for(const y in s){const v=s[y];f[y]={snapshot:v.getPersistedSnapshot(e),src:v.src,systemId:v.systemId,syncSnapshot:v._syncSnapshot}}return{...h,context:dwe(o),children:f,historyValue:b6t(h.historyValue)}}function dwe(t){let e;for(const n in t){const r=t[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)e??(e=Array.isArray(t)?t.slice():{...t}),e[n]={xstate$$type:UF,id:r.id};else{const i=dwe(r);i!==r&&(e??(e=Array.isArray(t)?t.slice():{...t}),e[n]=i)}}return e??t}function E6t(t,e,n,r,{event:i,id:s,delay:o},{internalQueue:a}){const c=e.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);const l=typeof i=="function"?i(n,r):i;let u;if(typeof o=="string"){const d=c&&c[o];u=typeof d=="function"?d(n,r):d}else u=typeof o=="function"?o(n,r):o;return typeof u!="number"&&a.push(l),[e,{event:l,id:s,delay:u},void 0]}function C6t(t,e){const{event:n,delay:r,id:i}=e;if(typeof r=="number"){t.defer(()=>{const s=t.self;t.system.scheduler.schedule(s,s,n,r,i)});return}}function GF(t,e){function n(r,i){}return n.type="xstate.raise",n.event=t,n.id=e==null?void 0:e.id,n.delay=e==null?void 0:e.delay,n.resolve=E6t,n.execute=C6t,n}const lne="xstate.promise.resolve",une="xstate.promise.reject",L6=new WeakMap;function dne(t){return{config:t,transition:(n,r,i)=>{var s;if(n.status!=="active")return n;switch(r.type){case lne:{const o=r.data;
1021return{...n,status:"done",output:o,input:void 0}}case une:return{...n,status:"error",error:r.data,input:void 0};case xE:return(s=L6.get(i.self))==null||s.abort(),{...n,status:"stopped",input:void 0};default:return n}},start:(n,{self:r,system:i,emit:s})=>{if(n.status!=="active")return;const o=new AbortController;L6.set(r,o),Promise.resolve(t({input:n.input,system:i,self:r,signal:o.signal,emit:s})).then(c=>{r.getSnapshot().status==="active"&&(L6.delete(r),i._relay(r,r,{type:lne,data:c}))},c=>{r.getSnapshot().status==="active"&&(L6.delete(r),i._relay(r,r,{type:une,data:c}))})},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}function _6t(t,{machine:e,context:n},r,i){const s=(o,a)=>{if(typeof o=="string"){const c=FF(e,o);if(!c)throw new Error(`Actor logic '${o}' not implemented in machine '${e.id}'`);const l=y2(c,{id:a==null?void 0:a.id,parent:t.self,syncSnapshot:a==null?void 0:a.syncSnapshot,input:typeof(a==null?void 0:a.input)=="function"?a.input({context:n,event:r,self:t.self}):a==null?void 0:a.input,src:o,systemId:a==null?void 0:a.systemId});return i[l.id]=l,l}else return y2(o,{id:a==null?void 0:a.id,parent:t.self,syncSnapshot:a==null?void 0:a.syncSnapshot,input:a==null?void 0:a.input,src:o,systemId:a==null?void 0:a.systemId})};return(o,a)=>{const c=s(o,a);return i[c.id]=c,t.defer(()=>{c._processingStatus!==Yo.Stopped&&c.start()}),c}}function S6t(t,e,n,r,{assignment:i}){if(!e.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const s={},o={context:e.context,event:n.event,spawn:_6t(t,e,n.event,s),self:t.self,system:t.system};let a={};if(typeof i=="function")a=i(o,r);else for(const l of Object.keys(i)){const u=i[l];a[l]=typeof u=="function"?u(o,r):u}const c=Object.assign({},e.context,a);return[M1(e,{context:c,children:Object.keys(s).length?{...e.children,...s}:e.children}),void 0,void 0]}function $f(t){function e(n,r){}return e.type="xstate.assign",e.assignment=t,e.resolve=S6t,e}const hne=new WeakMap;function pm(t,e,n){let r=hne.get(t);return r?e in r||(r[e]=n()):(r={[e]:n()},hne.set(t,r)),r[e]}const A6t={},Rv=t=>typeof t=="string"?{type:t}:typeof t=="function"?"resolve"in t?{type:t.type}:{type:t.name}:t;class SE{constructor(e,n){if(this.config=e,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(K2e),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?rne(this.config.states,(r,i)=>new SE(r,{_parent:this,_key:i,_machine:this.machine})):A6t,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=Zf(this.config.entry).slice(),this.exit=Zf(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=Zf(e.tags).slice()}_initialize(){this.transitions=Q4t(this),this.config.always&&(this.always=Sm(this.config.always).map(e=>f0(this,G2e,e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.t
1021ype,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(Rv),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(Rv),eventType:null})}:void 0,history:this.history,states:rne(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(Rv)})),entry:this.entry.map(Rv),exit:this.exit.map(Rv),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return pm(this,"invoke",()=>Zf(this.config.invoke).map((e,n)=>{const{src:r,systemId:i}=e,s=e.id??ine(this.id,n),o=typeof r=="string"?r:`xstate.invoke.${ine(this.id,n)}`;return{...e,src:o,id:s,systemId:i,toJSON(){const{onDone:a,onError:c,...l}=e;return{...l,type:"xstate.invoke",src:o,id:s}}}}))}get on(){return pm(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(i=>[n,i])).reduce((n,[r,i])=>(n[r]=n[r]||[],n[r].push(i),n),{}))}get after(){return pm(this,"delayedTransitions",()=>Y4t(this))}get initial(){return pm(this,"initial",()=>X4t(this,this.config.initial))}next(e,n){const r=n.type,i=[];let s;const o=pm(this,`candidates-${r}`,()=>Z4t(this,r));for(const a of o){const{guard:c}=a,l=e.context;let u=!1;try{u=!c||kS(c,l,n,e)}catch(d){const h=typeof c=="string"?c:typeof c=="object"?c.type:void 0;throw new Error(`Unable to evaluate guard ${h?`'${h}' `:""}in transition for event '${r}' in state node '${this.id}': 1022${d.message}`)}if(u){i.push(...a.actions),s=a;break}}return s?[s]:void 0}get events(){return pm(this,"events",()=>{const{states:e}=this,n=new Set(this.ownEvents);if(e)for(const r of Object.keys(e)){const i=e[r];if(i.states)for(const s of i.events)n.add(`${s}`)}return Array.from(n)})}get ownEvents(){const e=Object.keys(Object.fromEntries(this.transitions)),n=new Set(e.filter(r=>this.transitions.get(r).some(i=>!(!i.target&&!i.actions.length&&!i.reenter))));return Array.from(n)}}const k6t="#";class ZF{constructor(e,n){this.config=e,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=e.id||"(machine)",this.implementations={actors:(n==null?void 0:n.actors)??{},actions:(n==null?void 0:n.actions)??{},delays:(n==null?void 0:n.delays)??{},guards:(n==null?void 0:n.guards)??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new SE(e,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(e){const{actions:n,guards:r,actors:i,delays:s}=this.implementations;return new ZF(this.config,{actions:{...n,...e.actions},guards:{...r,...e.guards},actors:{...i,...e.actors},delays:{...s,...e.delays}})}resolveState(e){const n=f6t(this.root,e.value),r=EE(_E(this.root,n));return k7({_nodes:[...r],context:e.context||{},children:{},status:VF(r,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,n,r){return TP(e,n,r,[]).snapshot}microstep(e,n,r){return TP(e,n,r,[]).microstates}getTransitionData(e,n){return qF(this.root,e.value,e,n)||[]}getPreInitialState(e,n,r){const{context:i}=this.config,s=k7({context:typeof i!="function"&&i?i:{},_nodes:[this.root],children:{},status:"active"},this);return typeof i=="function"?b2(s,n,e,[$f(({spawn:a,event:c,self:l})=>i({spawn:a,input:c.input,self:l}))],r,void 0):s}getInitialSnapshot(e,n){const r=Q2e(n),i=[],s=this.getPreInitialState(e,r,i),o=yN([{target:[...owe(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],s,e,r,!0,i),{snapshot:a}=TP(o,r,e,i);return a}start(e){Object.values(e.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start()})}getStateNodeById(e){const n=BF(e),r=n.slice(1),i=$S(n[0])?n[0].slice(k6t.length):n[0],s=this.idMap.get(i);if(!s)throw new Error(`Child state node '#${i}' does not exist on machine '${this.id}'`);return CE(s,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,n){return x6t(e,n)}restoreSnapshot(e,n){const r={},i=e.children;
1022Object.keys(i).forEach(d=>{const h=i[d],f=h.snapshot,m=h.src,y=typeof m=="string"?FF(this,m):m;if(!y)return;const v=y2(y,{id:d,parent:n.self,syncSnapshot:h.syncSnapshot,snapshot:f,src:m,systemId:h.systemId});r[d]=v});function s(d,h){if(h instanceof SE)return h;try{return d.machine.getStateNodeById(h.id)}catch{}}function o(d,h){if(!h||typeof h!="object")return{};const f={};for(const m in h){const y=h[m];for(const v of y){const b=s(d,v);b&&(f[m]??(f[m]=[]),f[m].push(b))}}return f}const a=o(this.root,e.historyValue),c=k7({...e,children:r,_nodes:Array.from(EE(_E(this.root,e.value))),historyValue:a},this),l=new Set;function u(d,h){if(!l.has(d)){l.add(d);for(const f in d){const m=d[f];if(m&&typeof m=="object"){if("xstate$$type"in m&&m.xstate$$type===UF){d[f]=h[m.id];continue}u(m,h)}}}}return u(c.context,r),c}}function $6t(t,e,n,r,{event:i}){const s=typeof i=="function"?i(n,r):i;return[e,{event:s},void 0]}function I6t(t,{event:e}){t.defer(()=>t.emit(e))}function hwe(t){function e(n,r){}return e.type="xstate.emit",e.event=t,e.resolve=$6t,e.execute=I6t,e}let wN=function(t){return t.Parent="#_parent",t.Internal="#_internal",t}({});function T6t(t,e,n,r,{to:i,event:s,id:o,delay:a},c){var m;const l=e.machine.implementations.delays;if(typeof s=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${s}" }) instead`);const u=typeof s=="function"?s(n,r):s;let d;if(typeof a=="string"){const y=l&&l[a];d=typeof y=="function"?y(n,r):y}else d=typeof a=="function"?a(n,r):a;const h=typeof i=="function"?i(n,r):i;let f;if(typeof h=="string"){if(h===wN.Parent?f=t.self._parent:h===wN.Internal?f=t.self:h.startsWith("#_")?f=e.children[h.slice(2)]:f=(m=c.deferredActorIds)!=null&&m.includes(h)?h:e.children[h],!f)throw new Error(`Unable to send event to actor '${h}' from machine '${e.machine.id}'.`)}else f=h||t.self;return[e,{to:f,targetId:typeof h=="string"?h:void 0,event:u,id:o,delay:d},void 0]}function P6t(t,e,n){typeof n.to=="string"&&(n.to=e.children[n.to])}function R6t(t,e){t.defer(()=>{const{to:n,event:r,delay:i,id:s}=e;if(typeof i=="number"){t.system.scheduler.schedule(t.self,n,r,i,s);return}t.system._relay(t.self,n,r.type===R4t?Y2e(t.self.id,r.data):r)})}function YF(t,e,n){function r(i,s){}return r.type="xstate.sendTo",r.to=t,r.event=e,r.id=n==null?void 0:n.id,r.delay=n==null?void 0:n.delay,r.resolve=T6t,r.retryResolve=P6t,r.execute=R6t,r}function M6t(t,e){return YF(wN.Parent,t,e)}function O6t(t,e,n,r,{collect:i}){const s=[],o=function(c){s.push(c)};return o.assign=(...a)=>{s.push($f(...a))},o.cancel=(...a)=>{s.push(zF(...a))},o.raise=(...a)=>{s.push(GF(...a))},o.sendTo=(...a)=>{s.push(YF(...a))},o.sendParent=(...a)=>{s.push(M6t(...a))},o.spawnChild=(...a)=>{s.push(WF(...a))},o.stopChild=(...a)=>{s.push(AS(...a))},o.emit=(...a)=>{s.push(hwe(...a))},i({context:n.context,event:n.event,enqueue:o,check:a=>kS(a,e.context,n.event,e),self:t.self,system:t.system},r),[e,void 0,s]}function j6t(t){function e(n,r){}return e.type="xstate.enqueueActions",e.collect=t,e.resolve=O6t,e}function N6t(t,e,n,r,{value:i,label:s}){return[e,{value:typeof i=="function"?i(n,r):i,label:s},void 0]}function D6t({logger:t},{value:e,label:n}){n?t(n,e):t(e)}function L6t(t=({context:n,event:r})=>({context:n,event:r}),e){function n(r,i){}return n.type="xstate.log",n.value=t,n.label=e,n.resolve=N6t,n.execute=D6t,n}function B6t(t,e){return new ZF(t,e)}function fwe({schemas:t,actors:e,actions:n,guards:r,delays:i}
1022){return{assign:$f,sendTo:YF,raise:GF,log:L6t,cancel:zF,stopChild:AS,enqueueActions:j6t,emit:hwe,spawnChild:WF,createStateConfig:s=>s,createAction:s=>s,createMachine:s=>B6t({...s,schemas:t},{actors:e,actions:n,guards:r,delays:i}),extend:s=>fwe({schemas:t,actors:e,actions:{...n,...s.actions},guards:{...r,...s.guards},delays:{...i,...s.delays}})}}var F6t=ese();const pwe=(t,e)=>{e(t);const n=t.getSnapshot().children;n&&Object.values(n).forEach(r=>{pwe(r,e)})};function U6t(t){var r,i;const e=[];pwe(t,s=>{e.push([s,s.getSnapshot()]),s.observers=new Set});const n=(i=(r=t.system).getSnapshot)==null?void 0:i.call(r);t.stop(),t.system._snapshot=n,e.forEach(([s,o])=>{s._processingStatus=0,s._snapshot=o})}function z6t(t,...[e]){let[[n,r],i]=E.useState(()=>{const s=y2(t,e);return[t.config,s]});if(t.config!==n){const s=y2(t,{...e,snapshot:r.getPersistedSnapshot({__unsafeAllowInlineActors:!0})});i([t.config,s]),r=s}return S4t(()=>{r.logic.implementations=t.implementations}),r}function W6t(t,...[e]){const n=z6t(t,e),r=E.useCallback(()=>n.getSnapshot(),[n]),i=E.useCallback(o=>{const{unsubscribe:a}=n.subscribe(o);return a},[n]),s=F6t.useSyncExternalStore(i,r,r);return E.useEffect(()=>(n.start(),()=>{U6t(n)}),[n]),[s,n.send,n]}function H6t(t,...[e]){return W6t(t,e)}const hp={locales:["en","zh-CN","zh-TW","ja","ko","ru","vi"],defaultLocale:"en"},V6t=new Set(["","account","agent","bubbleup","c","checkout","code-projects","devices","invite","mall","pilot","pricing","schedule"]);function QF(t){return T4e(t)}function q6t(t){const[e]=QF(t).split("/").filter(Boolean);return hp.locales.includes(e)?e:hp.defaultLocale}function fne(t,e){if(/^(https?:|mailto:|tel:|#)/.test(t))return t;const n=QF(t),i=n.split("/").filter(Boolean)[0]??"";return hp.locales.includes(i)||!V6t.has(i)?n:`/${q6t(e)}${n==="/"?"":n}`}function XF(){const t=XE(),e=$c(),n=ose();return{push:r=>t({to:fne(r,n.pathname)}),replace:r=>t({to:fne(r,n.pathname),replace:!0}),back:()=>history.back(),forward:()=>history.forward(),refresh:()=>e.invalidate()}}function K6t(){return ose({select:t=>QF(t.pathname)})}function G6t(){return QE({strict:!1})}const gwe=E.createContext(void 0);function Z6t({children:t}){const[e,n]=E.useState(!1),[r,i]=E.useState(null),[s,o]=E.useState("en"),[a,c]=E.useState(),[l,u]=E.useState(!1),[d,h]=E.useState({isOpen:!1,image:void 0}),[f,m]=E.useState({isOpen:!1,video:void 0}),[y,v]=E.useState({isOpen:!1,url:void 0,title:void 0}),[b,C]=E.useState(!1),[x,_]=E.useState(),[$,I]=E.useState(!1),[R,N]=E.useState(null),[T,O]=E.useState(!1),[U,z]=E.useState(!1),[L,S]=E.useState(!1),[k,M]=E.useState(null),[W,H]=E.useState(!1),[D,V]=E.useState(!1),[B,P]=E.useState(),j=E.useCallback(it=>{H(it),P(be=>it?be??Wme():void 0)},[]),[G,Y]=E.useState("bubbleAi"),[te,ae]=E.useState("chat"),[oe,de]=E.useState(null),[ke,Be]=E.useState(!1),[$e,He]=E.useState(null),[Ge,je]=E.useState(null),xt=E.useCallback(()=>{He(null)},[]),ft=E.useMemo(()=>({deleteDialogIsOpen:e,setDeleteDialogIsOpen:n,connectDialogIsOpen:l,setConnectDialogIsOpen:u,activeThread:r,setActiveThread:i,lang:s,setLang:o,completeNow:b,setCompleteNow:C,chatPageKey:a,setChatPageKey:c,threadId:x,setThreadId:_,imagePreviewDialog:d,setImagePreviewDialog:h,videoPreviewDialog:f,setVideoPreviewDialog:m,filePreviewDialog:y,setFilePreviewDialog:v,langDialogIsOpen:$,setLangDialogIsOpen:I,memoryDialogIsOpen:T,setMemoryDialogIsOpen:O,memoryManageDialogIsOpen:U,setMemoryManageDialogIsOpen:z,memoryDeleteDialogIsOpen:L,setMemoryDeleteDialogIsOpen:S,memoryToDelete:k,setMemoryToDelete:M,isIncognito:W,setIsIncognito:j,isHistory:D,setIsHistory:V,mediaKey:B,setMediaKey:P,brand:G,setBrand:Y,mobileRootView:te,setMobileRootView:ae,mobileAccountReadyKey:oe,setMobileAccountReadyKey:de,streamError:R,setStreamError:N,pendingPricingPurchase:$e,setPendingPricingPurchase:He,closeAllPageDialog:xt,codeModePrefix:Ge,setCodeModePrefix:je,needPurchaseDialog:ke,setNeedPurchaseDialogIsOpen:Be}),[e,l,r,s,b,a,x,d,f,y,$,T,U,L,k,W,j,D,B,G,te,oe,R,$e,xt,Ge,ke]);return p.jsx(gwe.Provider,{value:ft,children:t})}function Ah(){const t=E.useContext(gwe);if(t===void 0)throw new Error("useRuntime must be used within a RuntimeProvider");return t}function HRt(){const{deleteDialogIsOpen:t,setDeleteDialogIsOpen:e}=Ah();return{isOpen:t,onOpenChange:e}}function JF(t){return Math.max(t??0,0)}function Y6t(t){var e,n;return JF((n=(e=t==null?void 0:t.user)==null?void 0:e.creditAccount)==null?void 0:n.availableCredit)}function VRt(t){var e,n;return JF((n=(e=t==null?void 0:t.user)==null?void 0:e.creditAccount)==null?void 0:n.unsnapsh
1022ottedCredit)}function qRt(t){var e,n;return JF((n=(e=t==null?void 0:t.user)==null?void 0:e.creditAccount)==null?void 0:n.snapshotCredit)}function Q6t(t){var e,n;return((n=(e=t==null?void 0:t.user)==null?void 0:e.creditAccount)==null?void 0:n.onlyAvailableCredit)??0}function X6t(t){var e;return((e=t==null?void 0:t.retailAccount)==null?void 0:e.availableCredit)??0}function J6t(t){return Q6t(t)+X6t(t)}function e8t({accountInfo:t}){const e=J6t(t);return Y6t(t)+e}const pne={error:1,warn:2,info:3,debug:4,trace:5},PP="debug";function t8t(){return typeof window>"u"?"":window.localStorage.getItem("debug")??""}function n8t(t){if(typeof window>"u")return PP;const e=window.localStorage.getItem(`debug:${t}:level`),n=window.localStorage.getItem("debug:level");return(e??n??PP)||PP}function gne(t,e){if(t==="*")return!0;const n=t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${n}$`).test(e)}function r8t(t,e){const n=t8t();if(!n)return!1;const r=n.split(/[\s,]+/).map(o=>o.trim()).filter(Boolean);return r.some(o=>o.startsWith("-")&&gne(o.slice(1),t))?!1:r.some(o=>gne(o,t))&&pne[n8t(t)]>=pne[e]}function Mv(t,e,n,r){if(!r8t(t,e))return;const i=`[${t}] ${n}`,s=r===void 0?[]:[r];if(e==="trace"){console.debug(i,...s);return}console[e](i,...s)}function i8t(t){return{error:(e,n)=>Mv(t,"error",e,n),warn:(e,n)=>Mv(t,"warn",e,n),info:(e,n)=>Mv(t,"info",e,n),debug:(e,n)=>Mv(t,"debug",e,n),trace:(e,n)=>Mv(t,"trace",e,n)}}function s8t({activationCode:t,accountInfo:e}){const n=e==null?void 0:e.user;return!!t||!!(n!=null&&n.inviteCode)}function o8t({isAppleIapOnlyMode:t,hasInviteRelationship:e}){return t&&!e}function KRt({sessionAddress:t,hasAccountInfo:e,isAppleGreenMode:n}){return!!t&&e&&!n}function GRt({hasPendingOrder:t,sessionAddress:e,canAccessCheckout:n,isAppleGreenMode:r}){return t&&!!e&&n&&!r}function ZRt({sessionAddress:t,isAppleGreenMode:e}){return!!t&&e}function a8t(){return $0t()}const c8t=t=>({signMessage:dne(async()=>{const e=Math.floor(Math.random()*1e6).toString(),n=p2t(e);try{const r=await t.signMessageAsync({message:n.fullMessage,address:t.address,chain:t.chain});return{...n,chain:t.chain,address:t.address,connectorId:t.connectorId,signature:y2t(r,t.chain)}}catch(r){throw{code:"SIGN_REJECTED",message:r instanceof Error?r.message:"Signature rejected"}}}),fetchUserData:dne(async({input:e})=>{if(!e.address)return{activationCode:"",accountInfo:null};const n=e.address;try{const r=t.queryClient.ensureQueryData({queryKey:["activationCode",n],queryFn:async()=>{const l=await t.agentApi.getCode({eoa:n});return(l==null?void 0:l.isActivated)===0?null:l?{code:l.code??""}:null},staleTime:1/0,retry:2}).catch(()=>null),i=t.queryClient.ensureQueryData({queryKey:["accountInfo",n],queryFn:async()=>await t.packageApi.getAccountInfo({eoa:n}).catch(()=>null)??null,staleTime:l=>l.state.data?1/0:0,retry:!1}).catch(()=>null),[s,o]=await Promise.all([r,i]);return{activationCode:(s==null?void 0:s.code)??"",accountInfo:o}}catch{return{activationCode:"",accountInfo:null}}})}),l8t=fwe({actions:{clearAll:$f(({context:t})=>{var e;if(ia.setSession(null),(e=t.session)!=null&&e.address){const n=t.session.address;is.removeQueries({queryKey:["activationCode",n]}),is.removeQueries({queryKey:["accountInfo",n]}),is.removeQueries({queryKey:["active-plan",n]}),is.removeQueries({queryKey:["billing-history",n]})}return{session:null,connectorId:null,error:null}}),clearError:$f({error:null}),setSession:$f(({context:t},e)=>{const n={...e.session,connectorId:e.session.connectorId??t.connectorId??void 0};return ia.setSession(n),{session:n,connectorId:n.connectorId??null}}),setError:$f({error:(t,e)=>e.error}),setConnector:$f({connectorId:(t,e)=>e.connectorId})},actors:{signMessage:{},fetchUserData:{}}}).createMachine({id:"auth",initial:"idle",context:{session:null,connectorId:null,error:null},states:{idle:{on:{WALLET_CONNECTED:[{guard:()=>!!ia.getSession(),target:"signed",actions:{type:"setSession",params:()=>({session:ia.getSession()})}},{target:"connected",actions:{type:"setConnector",params:({event:t})=>({connectorId:t.connectorId})}}],RESTORE_SESSION:{target:"signed",actions:[{type:"setSession",params:({event:t})=>({session:t.session})}]}}},connected:{always:{target:"signing"},on:{SIGN:"signing",WALLET_DISCONNECTED:{target:"idle",actions:"clearAll"},ADDRESS_CHANGED:{target:"signing",actions:"clearAll"}}},signing:{invoke:{id:"signMessage",src:"signMessage",onDone:{target:"signed",actions:{type:"setSession",params:({event:t})=>({session:t.output})}},onError:{target:"error",actions:{type:"setError",params:({event:t})=>({error:t.error})}}},on:{WALLET_DISCONNECTED:{target:"idle",actions:"clearAll"},ADDRESS_CHANGED:{target:"signing",actions:"clearAll"},RESTART_SIGNING:{target:"signing",actions:"clearError"}}},signed:{always:{target:"fetchingUserData"},on:{WALLET_DISCONNECTED:{target:"idle",actions:"clearAll"},ADDRESS_CHANGED:{target:"signing",actions:"clearAll"}
1022,RESTART_SIGNING:{target:"signing",actions:"clearError",reenter:!0}}},fetchingUserData:{invoke:{id:"fetchUserData",src:"fetchUserData",input:({context:t})=>{var e;return{address:(e=t.session)==null?void 0:e.address}},onDone:[{guard:({event:t})=>{var e,n,r,i;return!!((e=t.output)!=null&&e.activationCode)||((i=(r=(n=t.output)==null?void 0:n.accountInfo)==null?void 0:r.user)==null?void 0:i.inviteCode)},target:"authorized"},{target:"needsInviteCode"}],onError:{target:"needsInviteCode"}},on:{WALLET_DISCONNECTED:{target:"idle",actions:"clearAll"},ADDRESS_CHANGED:{target:"signing",actions:"clearAll"}}},needsInviteCode:{on:{REFRESH_USER_DATA:{target:"fetchingUserData"},WALLET_DISCONNECTED:{target:"idle",actions:"clearAll"},ADDRESS_CHANGED:{target:"signing",actions:"clearAll"}}},authorized:{on:{WALLET_DISCONNECTED:{target:"idle",actions:"clearAll"},ADDRESS_CHANGED:{target:"signing",actions:"clearAll"}}},error:{on:{WALLET_CONNECTED:{target:"connected",actions:["clearError",{type:"setConnector",params:({event:t})=>({connectorId:t.connectorId})}]},RETRY:"connected",RESET:{target:"idle",actions:"clearAll"},WALLET_DISCONNECTED:{target:"idle",actions:"clearAll"}}}}});function mwe(t){return t.find(e=>e.readyState===oi.Installed)??t.find(e=>e.readyState===oi.Loadable)}function YRt(t,e){return t??mwe(e)}function mne(t,e,n){var r;if((r=t==null?void 0:t.adapter)!=null&&r.connected&&t.adapter.publicKey)return t.adapter.publicKey.toBase58();if(n&&e)return e.toBase58()}function u8t(t){if(t&&typeof t=="object"&&"signMessage"in t&&typeof t.signMessage=="function")return e=>t.signMessage(e)}const d8t=500,h8t=120,f8t=500,p8t=60;function yne(){return new Promise(t=>{window.setTimeout(t,d8t)})}function wne(){return new Promise(t=>{window.setTimeout(t,f8t)})}async function g8t(t){let e=0;for(;e<h8t;){if(document.visibilityState==="hidden"){await yne();continue}e+=1;const n=await ou.getConnectedWallet().catch(()=>null);if((n==null?void 0:n.chain)===t)return n;await yne()}throw new Error("native-wallet-connect-timeout")}async function m8t(t){let e=0;for(;!t()&&e<p8t;){if(document.visibilityState==="hidden"){await wne();continue}e+=1;const n=await ou.getConnectedWallet().catch(()=>null);if(n)return n;await wne()}return null}function y8t(t){const e=[ou.connect(t),g8t(t)];return new Promise((n,r)=>{const i=[];e.forEach(s=>{s.then(n).catch(o=>{i.push(o),i.length===e.length&&r(i[0])})})})}function w8t(){const[t,e]=E.useState(!1),[n,r]=E.useState(),[i,s]=E.useState(null);E.useEffect(()=>{let m=!1,y=0;async function v(){const C=++y;if(!Ur()&&!wf())return;const x=await ou.isAvailable();if(m||C!==y||(e(x.available),r(x.reason),!x.available))return;const _=await m8t(()=>m||C!==y);!m&&C===y&&s(_)}const b=()=>{document.visibilityState!=="hidden"&&v()};return v(),window.addEventListener("focus",b),window.addEventListener("pageshow",b),document.addEventListener("visibilitychange",b),()=>{m=!0,window.removeEventListener("focus",b),window.removeEventListener("pageshow",b),document.removeEventListener("visibilitychange",b)}},[]);const o=E.useCallback(async(m="evm")=>{const y=await y8t(m);return s(y),y},[]),a=E.useCallback(async m=>{const y=await ou.getConnectedWallet();return y?(s(y),m&&y.chain!==m?null:y):(s(null),null)},[]),c=E.useCallback(()=>{s(null)},[]),l=E.useCallback(async()=>{await ou.resumePendingRequest()},[]),u=E.useCallback(async()=>{await ou.cancelPendingRequest()},[]),d=E.useCallback(async m=>ou.signMessage(m),[]),h=E.useCallback(async m=>ou.sendTransaction(m),[]),f=E.useCallback(async()=>{s(null),await ou.disconnect()},[]);return E.useMemo(()=>({isNative:Ur()||wf(),isAvailable:t,unavailableReason:n,wallet:i,connect:o,resumePendingRequest:l,cancelPendingRequest:u,getConnectedWallet:a,clearLocalWallet:c,signMessage:d,sendTransaction:h,disconnect:f}),[c,u,o,f,a,l,t,h,d,n,i])}const IS=E.createContext(null),vne=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function v8t(t,e){return t===e?!0:!t||!e?!1:t.address===e.address&&t.chain===e.chain&&t.connectorId===e.connectorId&&t.signature===e.signature&&t.nonce===e.nonce&&t.fullMessage===e.fullMessage&&t.message===e.message}function RP(){if(typeof window>"u")return"/";
1022const e=window.location.pathname.split("/").filter(Boolean).find(n=>hp.locales.includes(n));return e?`/${e}`:"/"}const MP=i8t("xbubble:auth:state");function b8t({children:t}){var qt,mt,Bt,un;const{session:e,_hasHydrated:n,setSession:r,clear:i,registerLogoutHandler:s}=wd(),{address:o,isConnected:a,connector:c}=a8t(),{signMessageAsync:l}=o1t(),{disconnectAsync:u}=i1t(),{logout:d}=Ege(),{user:h}=Fge(),f=A5t(),m=w8t(),y=Ah(),{setThreadId:v,setActiveThread:b,closeAllPageDialog:C}=y,x=XF(),_=oS(),$=E.useMemo(()=>oE.getInstance(),[]),I=E.useMemo(()=>new f2t,[]),R=E.useRef(null),N=E.useRef(!1),T=E.useRef(!1),[O,U]=E.useState(null),[z,L]=E.useState(null),S=E.useMemo(()=>{var st,X;if(((st=m.wallet)==null?void 0:st.chain)==="solana")return m.wallet;const Ve=mne(f.wallet,f.publicKey,f.connected);return Ve?{address:Ve,chain:"solana",connectorId:((X=f.wallet)==null?void 0:X.adapter.name)??"solana-wallet-adapter"}:null},[m.wallet,f.connected,f.publicKey,f.wallet]),k=E.useMemo(()=>{var Ve;return((Ve=m.wallet)==null?void 0:Ve.chain)==="evm"?m.wallet:!a||!o?null:{address:o,chain:"evm",connectorId:(c==null?void 0:c.id)??"unknown"}},[a,m.wallet,o,c==null?void 0:c.id]),M=E.useMemo(()=>v2t({solanaWallet:S,evmWallet:k,loginIntent:O,session:e}),[S,k,O,e]),W=Ur()&&oa()==="ios",H=t1t({queries:[{queryKey:["activationCode",e==null?void 0:e.address],queryFn:async()=>{if(!(e!=null&&e.address))return null;const Ve=await $.getCode({eoa:e==null?void 0:e.address});let st;return(Ve==null?void 0:Ve.isActivated)===0?null:(st=Ve.code??"",{code:st,showHerbalife:(Ve==null?void 0:Ve.showHerbalife)??0})},enabled:!!(e!=null&&e.address),staleTime:1/0,refetchOnWindowFocus:!1,retry:2},{queryKey:["accountInfo",e==null?void 0:e.address],queryFn:async()=>e!=null&&e.address?await I.getAccountInfo({eoa:e==null?void 0:e.address}).catch(()=>null)??null:null,enabled:!!(e!=null&&e.address),staleTime:1/0,refetchOnWindowFocus:!1,retry:!1},{queryKey:["service-provider",e==null?void 0:e.address],queryFn:async()=>e!=null&&e.address?I.getServiceProvider({eoa:e.address}):null,enabled:!!(e!=null&&e.address),staleTime:1/0,refetchOnWindowFocus:!1,retry:!1},{queryKey:["active-plan",e==null?void 0:e.address],queryFn:async()=>e!=null&&e.address?(await I.getBillingHistory({eoa:e==null?void 0:e.address,active_now:!0})).dataList??[]:[],enabled:!!(e!=null&&e.address),refetchOnWindowFocus:!1,staleTime:1e4,retry:2},{queryKey:["billing-history",e==null?void 0:e.address],queryFn:async()=>e!=null&&e.address?(await I.getBillingHistory({eoa:e==null?void 0:e.address,size:1,status:"1,5"})).dataList??[]:[],enabled:!!(e!=null&&e.address),refetchOnWindowFocus:!1,staleTime:1e4,retry:2},{queryKey:["user-profile",e==null?void 0:e.address],queryFn:async()=>e!=null&&e.address?$.getUserProfile({eoa:e.address}):null,enabled:!!(e!=null&&e.address),refetchOnWindowFocus:!1,staleTime:300*1e3,retry:1},{queryKey:["purchase-permission",e==null?void 0:e.address],queryFn:async()=>e!=null&&e.address?I.getUserByEoa({eoa:e==null?void 0:e.address}):null,enabled:!!(e!=null&&e.address),staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!1,retry:1},{queryKey:["gold-exchange-info",e==null?void 0:e.address],queryFn:async()=>e!=null&&e.address?I.getGoldCreditExchangeInfo({eoaAddress:e.address}).catch(()=>null):null,enabled:!!(e!=null&&e.address),staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!1,retry:1},{queryKey:["activity-pending-status",e==null?void 0:e.address],queryFn:async()=>e!=null&&e.address?I.getActivityPendingStatus({eoa:e.address}).catch(()=>null):null,enabled:!!(e!=null&&e.address),staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!1,retry:1}]}),[D,V,B,P,j,G,Y,te,ae]=H,oe=D.data,de=V.data,ke=((qt=B.data)==null?void 0:qt.hasProvider)===!0,Be=P.data??[],$e=j.data??[],He=G.data??null,Ge=te.data??null,je=!!((mt=ae.data)!=null&&mt.isActivityPendingUser),xt=ae.isLoading,ft=de!=null&&de.user?(({creditAccount:Ve,...st})=>st)(de.user):null,it=(oe==null?void 0:oe.code)??"",be=(oe==null?void 0:oe.showHerbalife)??0,Lt=$e.length>0,Qe=D.isLoading||V.isLoading||B.isLoading||P.isLoading||j.isLoading||G.isLoading||Y.isLoading||te.isLoading,Ue=Y.data??null,Ye=!!Ue&&Object.keys(Ue).length===0,tt=Ue==null?void 0:Ye?it?1:0:Ue.purchasePermission,ze=e8t({accountInfo:de}),Ne=s8t({activationCode:it,accountInfo:de}),J=!!(e!=null&&e.address)&&!D.isLoading&&!V.isLoading&&!j.isLoading&&!Y.isLoading&&!ae.isLoading,q=!it&&tt===3&&!Lt&&ze===0,Z=M??e,se=E.useMemo(()=>Z?c8t({address:Z.address,chain:Z.chain,connectorId:Z.connectorId,signMessageAsync:async({message:Ve,address:st,chain:X})=>{var ie;if(MP.info("signMessage actor start",{address:st,chain:X,activeWallet:M}),!M)throw new Error("Wallet is not connected");if(M.connectorId==="native-wallet")return m.signMessage({message:Ve,address:st,chain:X});if(X==="solana"){const ce=u8t((ie=f.wallet)==null?void 0:ie.adapter)??f.signMessage;if(!ce)throw new Error("Solana wallet does not support message signing");return ce(g2t(Ve))}const ee=I6(st);if(!ee)throw new Error("EVM address unavailable");return l({message:Ve,account:ee})},agentApi:$,packageApi:I,queryClient:_}):null,[Z,M,m,f,l,$,I,_]),[he,fe]=H6t(l8t.provide({actors:se??{}})),ye=he.value,nt=he.context;E.useEffect(()=>{var Ve;MP.trace("state snapshot",{state:ye,contextSession:(Ve=nt.session)==null?void 0:Ve.address,storeSession:e==null?void 0:e.address,walletLoginIntent:O,activeWallet:M,wagmiAddress:o,isWagmiConnected:a,wagmiConnectorId:c==null?void 0:c.id,error:nt.error})},[M,nt.error,(Bt=nt.session)==null?void 0:Bt.address,a,e==null?void 0:e.address,ye,o,c==null?void 0:c.id,O]);const vt=E.useCallback(()=>{MP.info("requestEvmWalletLogin",{state:ye,sessionAddress:e==null?void 0:e.address,wagmiAddress:o,wagmiConnectorId:c==null?void 0:c.id,activeWallet:M}),L(null),U({chain:"evm",consumed:!1})},[M,e==null?void 0:e.address,ye,o,c==null?void 0:c.id]),Nt=E.useCallback(async()=>{var X;const Ve=f.wallet??mwe(f.wallets);if(!Ve)throw new Error("Solana wallet not found");((X=f.wallet)==null?void 0:X.adapter.name)!==Ve.adapter.name&&f.select(Ve.adapter.name),Ve.adapter.connected||await Ve.adapter.connect(),localStorage.setItem("lastConnectedWallet",Ve.adapter.name),L(null);const st=mne(Ve,f.publicKey,f.connected);st&&U({address:st,chain:"solana",consumed:!1}),ye==="error"&&st&&(U(kv),fe({type:"WALLET_CONNECTED",address:st,chain:"solana",connectorId:Ve.adapter.name}))},[fe,f,ye]),mn=E.useCallback(async Ve=>{var ee;Ve!=null&&Ve.forceReconnect&&await m.disconnect().catch(()=>{});const st=Ve!=null&&Ve.forceReconnect?null:((ee=m.wallet)==null?void 0:ee.chain)==="evm"?m.wallet:await m.getConnectedWallet("evm").
1022catch(()=>null),X=st&&I6(st.address)?st:await m.connect("evm");return L(null),U({address:X.address,chain:X.chain,consumed:!1}),ye==="error"&&(U(kv),fe({type:"WALLET_CONNECTED",address:X.address,chain:X.chain,connectorId:X.connectorId})),X},[m,fe,ye]),At=E.useCallback(async()=>{U(null),L(M),await m.cancelPendingRequest().catch(()=>{}),await m.disconnect().catch(()=>{}),i(),fe({type:"WALLET_DISCONNECTED"})},[M,i,m,fe]),En=E.useCallback(async()=>{await m.resumePendingRequest()},[m]),yr=E.useCallback(async()=>{L(null),await m.cancelPendingRequest().catch(()=>{}),fe({type:"RESTART_SIGNING"})},[m,fe]),xn=E.useCallback(async()=>{T.current=!0,U(null),L(M);try{fe({type:"WALLET_DISCONNECTED"}),i(),e!=null&&e.address&&(_.removeQueries({queryKey:["activationCode",e==null?void 0:e.address]}),_.removeQueries({queryKey:["accountInfo",e==null?void 0:e.address]}),_.removeQueries({queryKey:["active-plan",e==null?void 0:e.address]}),_.removeQueries({queryKey:["pendingOrders",e==null?void 0:e.address,0]}),_.removeQueries({queryKey:["billing-history",e==null?void 0:e.address]}),_.removeQueries({queryKey:["purchase-permission",e==null?void 0:e.address]}),_.removeQueries({queryKey:["gold-exchange-info",e==null?void 0:e.address]})),v(void 0),b(null),y.setChatPageKey(crypto.randomUUID()),x.replace(RP()),await f.disconnect().catch(()=>{}),await m.disconnect().catch(()=>{}),await u().catch(()=>{}),h&&await d().catch(()=>{})}finally{T.current=!1}},[i,y,v,b,u,d,f,m,h,fe,e==null?void 0:e.address,_,M,x]);E.useEffect(()=>s(xn),[xn,s]),E.useEffect(()=>{if(T.current||(M&&(N.current=!0),!n))return;if(!M){if(e&&ye==="idle"){fe({type:"RESTORE_SESSION",session:e});return}return E2t({state:ye,loginIntent:O}),void 0}const Ve=Vme({activeWallet:M,session:e,loginIntent:O});C2t(M,z)||!e&&!Ve||b2t(ye)&&(e&&fh(e,M)?fe({type:"RESTORE_SESSION",session:e}):e&&!fh(e,M)?(U(kv),console.warn("[Auth] Address mismatch, clearing session"),vne&&console.trace("[Auth Trace] clearing session because restored address mismatched"),i(),v(void 0),b(null),y.setChatPageKey(crypto.randomUUID()),x.replace(RP()),fe({type:"WALLET_CONNECTED",address:M.address,chain:M.chain,connectorId:M.connectorId??M.chain})):(U(kv),fe({type:"WALLET_CONNECTED",address:M.address,chain:M.chain,connectorId:M.connectorId??M.chain})))},[n,M,ye,e,O,z,fe,i,y,v,b,x]),E.useEffect(()=>{var Ve;T.current||M&&x2t({activeWallet:M,currentSession:nt.session,loginIntent:O})&&(((Ve=nt.session)==null?void 0:Ve.chain)!==M.chain&&U(kv),fe({type:"ADDRESS_CHANGED",address:M.address,chain:M.chain}),v(void 0),b(null),y.setChatPageKey(crypto.randomUUID()),x.replace(RP()))},[M,nt.session,O,fe,y,v,b,x]),E.useEffect(()=>{nt.session&&!v8t(nt.session,e)&&r(nt.session??null)},[nt.session,e,r]),E.useEffect(()=>{e||C()},[e,C]);const kt=e??nt.session,Ie=(kt==null?void 0:kt.address)??(M==null?void 0:M.address),It=kt&&(kt.chain??"evm")==="evm"?I6(kt.address):I6(M==null?void 0:M.address),rt=W&&!!(kt!=null&&kt.address),Zt=rt&&!!(kt!=null&&kt.address)&&(D.isLoading||V.isLoading),yt=o8t({isAppleIapOnlyMode:rt,hasInviteRelationship:Ne}),pt=yt?!1:Qe,St=rt&&!Zt&&!Ne,qe=ye==="authorized",Et=E.useCallback(()=>
1022{kt!=null&&kt.address&&_.invalidateQueries({queryKey:["accountInfo",kt.address]})},[_,kt==null?void 0:kt.address]);E.useEffect(()=>{const Ve=kt==null?void 0:kt.address;if(!Ve||!St||R.current===Ve)return;R.current=Ve;let st=!1;return I.grantAppleIapIntroAddOnCredits({eoaAddress:Ve,platform:"ios"}).then(()=>{st||Et()}).catch(X=>{st||(R.current=null,vne&&console.warn("[Apple IAP] failed to grant intro add-on credits",X))}),()=>{st=!0}},[kt==null?void 0:kt.address,I,Et,St]);const Ze=E.useCallback(()=>{if(!(kt!=null&&kt.address))return;const Ve=kt.address;Promise.all([_.refetchQueries({queryKey:["activationCode",Ve]}),_.refetchQueries({queryKey:["accountInfo",Ve]}),_.refetchQueries({queryKey:["user-profile",Ve]}),_.refetchQueries({queryKey:["purchase-permission",Ve]})]).finally(()=>{fe({type:"REFRESH_USER_DATA"})})},[kt==null?void 0:kt.address,_,fe]),wt=E.useCallback(()=>{kt!=null&&kt.address&&_.invalidateQueries({queryKey:["gold-exchange-info",kt.address]})},[kt==null?void 0:kt.address,_]),ot={state:ye,isIdle:ye==="idle"&&!e,isConnected:ye==="connected",isSigning:ye==="signing",isSigned:ye==="signed",isFetchingUserData:ye==="fetchingUserData",isNeedsInviteCode:ye==="needsInviteCode",isAuthorized:qe,isError:ye==="error",isPending:ye==="signing"||ye==="signed"||ye==="fetchingUserData",isLoadingUserInfo:pt,hasHydrated:n,session:kt,error:nt.error,address:Ie,evmAddress:It,userInfo:ft,userProfile:He,activePlan:yt?[]:Be,accountInfo:de??null,hasServiceProvider:ke,activationCode:it,purchasePermission:tt,isActivityPendingStatusLoading:xt,isActivityPendingUser:je,goldInfo:yt?null:Ge,hasAvailableCredit:ze,isPurchaseGateReady:J,isNeedPurchase:q,isNativeIosShell:W,hasInviteRelationship:Ne,isAppleIapOnlyMode:rt,isAppleGreenMode:yt,sign:()=>fe({type:"SIGN"}),requestEvmWalletLogin:vt,connectSolanaWallet:Nt,connectNativeWallet:mn,resumeNativeWalletRequest:En,restartNativeWalletSigning:yr,cancelNativeWalletLogin:At,disconnect:xn,refreshUserData:()=>fe({type:"REFRESH_USER_DATA"}),retry:()=>fe({type:"RETRY"}),refreshAccountInfo:()=>Et(),refreshGoldInfo:()=>wt(),refreshBindCodeData:Ze,isNativeShell:z7(),isNativeWalletAvailable:m.isAvailable,nativeWalletAddress:(un=m.wallet)==null?void 0:un.address,nativeWalletUnavailableReason:m.unavailableReason,hasBillingHistory:yt?!1:Lt,showHerbalife:be,agentApi:$,packageApi:I};return p.jsx(IS.Provider,{value:ot,children:t})}function dx(){const t=E.useContext(IS);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}function ywe(){const t=E.useContext(IS);if(!t)throw new Error("useSession must be used within AuthProvider");return{session:t.session,evmAddress:t.evmAddress}}function x8t(){const t=E.useContext(IS);if(!t)throw new Error("useApi must be used within AuthProvider");return{agentApi:t.agentApi,packageApi:t.packageApi}}const wwe=E.createContext(null);function E8t({children:t}){const{activationCode:e,hasAvailableCredit:n,hasServiceProvider:r,isActivityPendingStatusLoading:i,isActivityPendingUser:s,isAppleGreenMode:o,isNeedsInviteCode:a,showHerbalife:c,session:l,purchasePermission:u}=dx(),{ability:d}=E.useMemo(()=>xwt({activationCode:e,hasAvailableCredit:n,hasServiceProvider:r,isActivityPendingStatusLoading:i,isActivityPendingUser:s,isAppleGreenMode:o,isNeedsInviteCode:a,showHerbalife:c,session:l,purchasePermission:u}),[e,n,r,i,s,o,a,c,l,u]);return p.jsx(wwe.Provider,{value:d,children:t})}function QRt(){const t=E.useContext(wwe);if(!t)throw new Error("useAbility must be used within AbilityProvider");const e=E.useCallback(({action:n,subject:r})=>t.can(n,r),[t]);return{ability:t,can:e}}const XRt="cr0frr";function C8t(t){const e=t.replace(/^#/,"").toUpperCase();return e==="A1"?"btvtn0":e==="A2"?"rxmgae":""}function _8t({search:t,hash:e}){var r;return!!(((r=new URLSearchParams(t).get("referral"))==null?void 0:r.trim())||C8t(e))}function vwe({activationCode:t,hasInviteEntry:e=!1,hasAvailableCredit:n,isActivityPendingStatusLoading:r=!1,isActivityPendingUser:i=!1,purchasePermission:s}){return!e&&!r&&!i&&!t&&n===0&&s!==void 0&&s!==3}function S8t({session:t,activationCode:e,hasInviteEntry:n,hasAvailableCredit:r,isActivityPendingStatusLoading:i,isActivityPendingUser:s,purchasePermission:o}){return!!(t!=null&&t.address)&&vwe({activationCode:e,hasInviteEntry:n,hasAvailableCredit:r,isActivityPendingStatusLoading:i,isActivityPendingUser:s,purchasePermission:o})}function JRt({activationCode:t,hasInviteEntry:e,hasAvailableCredit:n,isActivityPendingStatusLoading:r,isActivityPendingUser:i,purchasePermission:s}){return vwe({activationCode:t,hasInviteEntry:e,hasAvailableCredit:n,isActivityPendingStatusLoading:r,isActivityPendingUser:i,purchasePermission:s})}function A8t(){const{activationCode:t,hasAvailableCredit:e,isActivityPendingStatusLoading:n,isActivityPendingUser:r,purchasePermission:i,session:s}=dx(),o=typeof window<"u"?_8t({search:window.location.search,hash:window.location.hash}):!1;return S8t({session:s,activationCode:t,hasInviteEntry:o,hasAvailableCredit:e,isActivityPendingStatusLoading:n,isActivityPendingUser:r,purchasePermission:i})}/** 1023 * @license lucide-react v0.372.0 - ISC 1024 * 1025 * This source code is licensed under the ISC license. 1026 * See the LICENSE file in the root directory of this source tree. 1027 */var k8t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 1028 * @license lucide-react v0.372.0 - ISC 1029 * 1030 * This source code is licensed under the ISC license. 1031 * See the LICENSE file in the root directory of this source tree. 1032 */const $8t=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** 1033 * @license lucide-react v0.372.0 - ISC 1034 * 1035 * This source code is licensed under the ISC license. 1036 * See the LICENSE file in the root directory of this source tree. 1037 */const nw=(t,e)=>{const n=E.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:c,...l},u)=>E.createElement("svg",{ref:u,...k8t,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${$8t(t)}`,a].join(" "),...l},[...e.map(([d,h])=>
1037E.createElement(d,h)),...Array.isArray(c)?c:[c]]));return n.displayName=`${t}`,n};/** 1038 * @license lucide-react v0.372.0 - ISC 1039 * 1040 * This source code is licensed under the ISC license. 1041 * See the LICENSE file in the root directory of this source tree. 1042 */const bwe=nw("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 1043 * @license lucide-react v0.372.0 - ISC 1044 * 1045 * This source code is licensed under the ISC license. 1046 * See the LICENSE file in the root directory of this source tree. 1047 */const I8t=nw("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 1048 * @license lucide-react v0.372.0 - ISC 1049 * 1050 * This source code is licensed under the ISC license. 1051 * See the LICENSE file in the root directory of this source tree. 1052 */const T8t=nw("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 1053 * @license lucide-react v0.372.0 - ISC 1054 * 1055 * This source code is licensed under the ISC license. 1056 * See the LICENSE file in the root directory of this source tree. 1057 */const P8t=nw("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** 1058 * @license lucide-react v0.372.0 - ISC 1059 * 1060 * This source code is licensed under the ISC license. 1061 * See the LICENSE file in the root directory of this source tree. 1062 */const eU=nw("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 1063 * @license lucide-react v0.372.0 - ISC 1064 * 1065 * This source code is licensed under the ISC license. 1066 * See the LICENSE file in the root directory of this source tree. 1067 */const TS=nw("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),bne=1,R8t=1e6;let OP=0;function M8t(){return OP=(OP+1)%Number.MAX_SAFE_INTEGER,OP.toString()}const jP=new Map,xne=t=>{if(jP.has(t))return;const e=setTimeout(()=>{jP.delete(t),Ib({type:"REMOVE_TOAST",toastId:t})},R8t);jP.set(t,e)},O8t=(t,e)=>{switch(e.type){case"ADD_TOAST":{const n=[e.toast,...t.toasts];if(e.toast.position==="top-right"){const s=n.filter(a=>a.position==="top-right").slice(0,3),o=n.filter(a=>a.position!=="top-right").slice(0,bne);return{...t,toasts:[...s,...o]}}const r=n.filter(s=>s.position==="top-right").slice(0,3),i=n.filter(s=>s.position!=="top-right").slice(0,bne);return{...t,toasts:[...r,...i]}}case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?xne(n):t.toasts.forEach(r=>{xne(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},$7=[];let I7={toasts:[]};function Ib(t){I7=O8t(I7,t),$7.forEach(e=>{e(I7)})}function rw({...t}){const e=M8t(),n=i=>Ib({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Ib({type:"DISMISS_TOAST",toastId:e});return Ib({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function eMt(){const[t,e]=E.useState(I7);return E.useEffect(()=>($7.push(e),()=>{const n=$7.indexOf(e);n>-1&&$7.splice(n,1)}),[]),{...t,toast:rw,dismiss:n=>Ib({type:"DISMISS_TOAST",toastId:n})}}const j8t=E.forwardRef(function({href:e,children:n,keepParams:r=!0,newParams:i={},removeParams:s=[],...o},a){const l=G6t().locale??hp.defaultLocale,[u,d]=E.useState(!1);E.useEffect(()=>d(!0),[]);const h=()=>{if(!u)return e;const[f,m=""]=e.split("?"),y=new URLSearchParams(r?window.location.search:"");return new URLSearchParams(m).forEach((C,x)=>y.set(x,C)),s.forEach(C=>y.delete(C)),Object.entries(i).forEach(([C,x])=>y.set(C,x)),`${f.startsWith(`/${l}`)?f:`/${l}${f}`}${y.size>0?`?${y.toString()}`:""}`};return p.jsx(QN,{ref:a,to:h(),...o,lang:l,children:n})});function md(t,e){rw({variant:"error",description:p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(eU,{className:"flex-none w-4 h-4 text-white"}),p.jsx("span",{className:"text-sm font-medium text-white",children:t})]}),duration:e??3e3,swipeDirection:"none"})}function tMt(t,e){rw({variant:"default",description:p.jsxs("div",{className:"flex items-center space-x-[10px]",children:[p.jsx(bwe,{className:"size-4 text-[#00a186]"}),p.jsx("span",{className:"text-[16px] font-medium text-customs",children:t})]}),style:{background:"linear-gradient(0deg, rgba(42, 174, 103, 0.1), rgba(42, 174, 103, 0.1)), #FFFFFF"},className:"shadow-[0px_12px_32px_0px_#00000005] rounded-[10px] py-4",duration:3e3,swipeDirection:"none"})}function nMt(t){const{message:e,isOnline:n,viewLabel:r="View",onView:i,duration:s}=t;rw({variant:"default",position:"top-right",description:p.jsxs("div",{className:"flex items-start gap-4 pr-4",children:[n?p.jsx(bwe,{className:"size-4 shrink-0 text-[#00A186]",strokeWidth:2.5}
vendor: 24,696 bytes, line 1067
1067):p.jsx(eU,{className:"size-4 shrink-0 text-[#EFA201]",strokeWidth:2.2}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("p",{className:"text-[16px] font-semibold leading-[1.35] text-[#1D1C1B]",children:e}),i?p.jsx("button",{type:"button",onClick:i,className:"mt-3 text-[14px] font-medium leading-none text-[#20C06E] hover:opacity-85",children:r}):null]})]}),className:"sm:min-w-[350px] rounded-[10px] border border-[#E7EDF2] bg-white py-4 px-4 pr-6 shadow-[0px_6px_20px_0px_#0000000F]",duration:5e3,swipeDirection:"none"})}function rMt(t,e){return rw({variant:"default",description:p.jsxs("div",{className:"flex items-start space-x-2",children:[p.jsx(T8t,{className:"size-4 shrink-0 animate-spin text-[#EFA201] mt-[2px]"}),p.jsx("span",{className:"text-[16px] font-medium text-[#EFA201]",children:t})]}),className:"shadow-[0px_12px_32px_0px_#00000005] rounded-[10px] p-4 bg-[#FDF6E6]",duration:e,swipeDirection:"none"})}function Ene(t,e,n){const r=t.split("History"),i=rw({variant:"error",description:p.jsx(j8t,{href:"/",onClick:()=>{n==null||n(),i.dismiss()},children:p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(eU,{className:"flex-none text-white size-4"}),p.jsxs("span",{className:"text-sm font-medium text-white",children:[r[0],"History",r[1]]})]})}),duration:e,swipeDirection:"none"})}const tU=E.createContext({});function nU(t){const e=E.useRef(null);return e.current===null&&(e.current=t()),e.current}const rU=typeof window<"u",xwe=rU?E.useLayoutEffect:E.useEffect,PS=E.createContext(null);function iU(t,e){t.indexOf(e)===-1&&t.push(e)}function sU(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const gh=(t,e,n)=>n>e?e:n<t?t:n;let oU=()=>{};const mh={},Ewe=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Cwe(t){return typeof t=="object"&&t!==null}const _we=t=>/^0[^.\s]+$/u.test(t);function aU(t){let e;return()=>(e===void 0&&(e=t()),e)}const vc=t=>t,N8t=(t,e)=>n=>e(t(n)),hx=(...t)=>t.reduce(N8t),k3=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class cU{constructor(){this.subscriptions=[]}add(e){return iU(this.subscriptions,e),()=>sU(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Tu=t=>t*1e3,Pu=t=>t/1e3;function Swe(t,e){return e?t*(1e3/e):0}const Awe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,D8t=1e-7,L8t=12;function B8t(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=Awe(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>D8t&&++a<L8t);return o}function fx(t,e,n,r){if(t===e&&n===r)return vc;const i=s=>B8t(s,0,1,t,n);return s=>s===0||s===1?s:Awe(i(s),e,r)}const kwe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,$we=t=>e=>1-t(1-e),Iwe=fx(.33,1.53,.69,.99),lU=$we(Iwe),Twe=kwe(lU),Pwe=t=>(t*=2)<1?.5*lU(t):.5*(2-Math.pow(2,-10*(t-1))),uU=t=>1-Math.sin(Math.acos(t)),Rwe=$we(uU),Mwe=kwe(uU),F8t=fx(.42,0,1,1),U8t=fx(0,0,.58,1),Owe=fx(.42,0,.58,1),z8t=t=>Array.isArray(t)&&typeof t[0]!="number",jwe=t=>Array.isArray(t)&&typeof t[0]=="number",W8t={linear:vc,easeIn:F8t,easeInOut:Owe,easeOut:U8t,circIn:uU,circInOut:Mwe,circOut:Rwe,backIn:lU,backInOut:Twe,backOut:Iwe,anticipate:Pwe},H8t=t=>typeof t=="string",Cne=t=>{if(jwe(t)){oU(t.length===4);const[e,n,r,i]=t;return fx(e,n,r,i)}else if(H8t(t))return W8t[t];return t},B6=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function V8t(t,e){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){o.has(u)&&(l.schedule(u),t()),u(a)}const l={schedule:(u,d=!1,h=!1)=>{const m=h&&i?n:r;return d&&o.add(u),m.has(u)||m.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),n.clear(),i=!1,s&&(s=!1,l.process(u))}};return l}const q8t=40;function Nwe(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=B6.reduce((x,_)=>(x[_]=V8t(s),x),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:h,render:f,postRender:m}=o,y=()=>{const x=mh.useManualTiming?i.timestamp:performance.now();n=!1,mh.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,q8t),1)),i.timestamp=x,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),u.process(i),d.process(i),h.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(y))},v=()=>{n=!0,r=!0,i.isProcessing||t(y)};return{schedule:B6.reduce((x,_)=>{const $=o[_];return x[_]=(I,R=!1,N=!1)=>(n||v(),$.schedule(I,R,N)),x},{}),cancel:x=>{for(let _=0;_<B6.length;_++)o[B6[_]].cancel(x)},state:i,steps:o}}const{schedule:Xr,cancel:fp,state:Is,steps:NP}=Nwe(typeof requestAnimationFrame<"u"?requestAnimationFrame:vc,!0);let T7;function K8t(){T7=void 0}const ua={now:()=>(T7===void 0&&ua.set(Is.isProcessing||mh.useManualTiming?Is.timestamp:performance.now()),T7),set:t=>{T7=t,queueMicrotask(K8t)}},Dwe=t=>e=>typeof e=="string"&&e.startsWith(t),dU=Dwe("--"),G8t=Dwe("var(--"),hU=t=>G8t(t)?Z8t.test(t.split("/*")[0].trim()):!1,Z8t=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,iw={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},$3={...iw,transform:t=>gh(0,1,t)},F6={...iw,default:1},Tb=t=>Math.round(t*1e5)/1e5,fU=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Y8t(t){return t==null}const Q8t=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,pU=(t,e)=>n=>!!(typeof n=="string"&&Q8t.test(n)&&n.startsWith(t)||e&&!Y8t(n)&&Object.prototype.hasOwnProperty.call(n,e)),Lwe=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(fU);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},X8t=t=>gh(0,255,t),DP={...iw,transform:t=>Math.round(X8t(t))},j0={test:pU("rgb","red"),parse:Lwe("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+DP.transform(t)+", "+DP.transform(e)+", "+DP.transform(n)+", "+Tb($3.transform(r))+")"};function J8t(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const vN={test:pU("#"),parse:J8t,transform:j0.transform},px=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),yf=px("deg"),Ru=px("%"),_n=px("px"),e7t=px("vh"),t7t=px("vw"),_ne={...Ru,parse:t=>Ru.parse(t)/100,transform:t=>Ru.transform(t*100)},zm={test:pU("hsl","hue"),parse:Lwe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Ru.transform(Tb(e))+", "+Ru.transform(Tb(n))+", "+Tb($3.transform(r))+")"},Di={test:t=>j0.test(t)||vN.test(t)||zm.test(t),parse:t=>j0.test(t)?j0.parse(t):zm.test(t)?zm.parse(t):vN.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?j0.transform(t):zm.transform(t),getAnimatableNone:t=>{const e=Di.parse(t);return e.alpha=0,Di.transform(e)}},n7t=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function r7t(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(fU))==null?void 0:e.length)||0)+(((n=t.match(n7t))==null?void 0:n.length)||0)>0}const Bwe="number",Fwe="color",i7t="var",s7t="var(",Sne="${}",o7t=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function I3(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(o7t,c=>(Di.test(c)?(r.color.push(s),i.push(Fwe),n.push(Di.parse(c))):c.startsWith(s7t)?(r.var.push(s),i.push(i7t),n.push(c)):(r.number.push(s),i.push(Bwe),n.push(parseFloat(c))),++s,Sne)).split(Sne);return{values:n,split:a,indexes:r,types:i}}function Uwe(t){return I3(t).values}function zwe(t){const{split:e,types:n}=I3(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===Bwe?s+=Tb(i[o]):a===Fwe?s+=Di.transform(i[o]):s+=i[o]}return s}}const a7t=t=>typeof t=="number"?0:Di.test(t)?Di.getAnimatableNone(t):t;function c7t(t){const e=Uwe(t);return zwe(t)(e.map(a7t))}const pp={test:r7t,parse:Uwe,createTransformer:zwe,getAnimatableNone:c7t};function LP(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function l7t({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=LP(c,a,t+1/3),s=LP(c,a,t),o=LP(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function AE(t,e){return n=>n>0?e:t}const ui=(t,e,n)=>t+(e-t)*n,BP=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},u7t=[vN,j0,zm],d7t=t=>u7t.find(e=>e.test(t));function Ane(t){const e=d7t(t);if(!e)return!1;let n=e.parse(t);return e===zm&&(n=l7t(n)),n}const kne=(t,e)=>{const n=Ane(t),r=Ane(e);if(!n||!r)return AE(t,e);const i={...n};return s=>(i.red=BP(n.red,r.red,s),i.green=BP(n.green,r.green,s),i.blue=BP(n.blue,r.blue,s),i.alpha=ui(n.alpha,r.alpha,s),j0.transform(i))},bN=new Set(["none","hidden"]);function h7t(t,e){return bN.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function f7t(t,e){return n=>ui(t,e,n)}function gU(t){return typeof t=="number"?f7t:typeof t=="string"?hU(t)?AE:Di.test(t)?kne:m7t:Array.isArray(t)?Wwe:typeof t=="object"?Di.test(t)?kne:p7t:AE}function Wwe(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>gU(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function p7t(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=gU(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function g7t(t,e){const n=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const s=e.types[i],o=t.indexes[s][r[s]],a=t.values[o]??0;n[i]=a,r[s]++}return n}const m7t=(t,e)=>{const n=pp.createTransformer(e),r=I3(t),i=I3(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?bN.has(t)&&!i.values.length||bN.has(e)&&!r.values.length?h7t(t,e):hx(Wwe(g7t(r,i),i.values),n):AE(t,e)};function Hwe(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ui(t,e,n):gU(t)(t,e)}const y7t=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Xr.update(e,n),stop:()=>fp(e),now:()=>Is.isProcessing?Is.timestamp:ua.now()}},Vwe=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=Math.round(t(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},kE=2e4;function mU(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<kE;)e+=n,r=t.next(e);return e>=kE?1/0:e}function w7t(t,e=100,n){const r=n({...t,keyframes:[0,e]}),i=Math.min(mU(r),kE);return{type:"keyframes",ease:s=>r.next(i*s).value/e,duration:Pu(i)}}const v7t=5;function qwe(t,e,n){const r=Math.max(e-v7t,0);return Swe(n-t(r),e-r)}const yi={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},FP=.001;function b7t({duration:t=yi.duration,bounce:e=yi.bounce,velocity:n=yi.velocity,mass:r=yi.mass}){let i,s,o=1-e;o=gh(yi.minDamping,yi.maxDamping,o),t=gh(yi.minDuration,yi.maxDuration,Pu(t)),o<1?(i=l=>{const u=l*o,d=u*t,h=u-n,f=xN(l,o),m=Math.exp(-d);return FP-h/f*m},s=l=>{const d=l*o*t,h=d*n+n,f=Math.pow(o,2)*Math.pow(l,2)*t,m=Math.exp(-d),y=xN(Math.pow(l,2),o);return(-i(l)+FP>0?-1:1)*((h-f)*m)/y}):(i=l=>{const u=Math.exp(-l*t),d=(l-n)*t+1;return-FP+u*d},s=l=>{const u=Math.exp(-l*t),d=(n-l)*(t*t);return u*d});const a=5/t,c=E7t(i,s,a);if(t=Tu(t),isNaN(c))return{stiffness:yi.stiffness,damping:yi.damping,duration:t};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:t}}}const x7t=12;function E7t(t,e,n){let r=n;for(let i=1;i<x7t;i++)r=r-t(r)/e(r);return r}function xN(t,e){return t*Math.sqrt(1-e*e)}const C7t=["duration","bounce"],_7t=["stiffness","damping","mass"];function $ne(t,e){return e.some(n=>t[n]!==void 0)}function S7t(t){let e={velocity:yi.velocity,stiffness:yi.stiffness,damping:yi.damping,mass:yi.mass,isResolvedFromDuration:!1,...t};if(!$ne(t,_7t)&&$ne(t,C7t))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*gh(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:yi.mass,stiffness:i,damping:s}}else{const n=b7t(t);e={...e,...n,mass:yi.mass},e.isResolvedFromDuration=!0}return e}function $E(t=yi.visualDuration,e=yi.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:l,mass:u,duration:d,velocity:h,isResolvedFromDuration:f}=S7t({...n,velocity:-Pu(n.velocity||0)}),m=h||0,y=l/(2*Math.sqrt(c*u)),v=o-s,b=Pu(Math.sqrt(c/u)),C=Math.abs(v)<5;r||(r=C?yi.restSpeed.granular:yi.restSpeed.default),i||(i=C?yi.restDelta.granular:yi.restDelta.default);let x;if(y<1){const $=xN(b,y);x=I=>{const R=Math.exp(-y*b*I);return o-R*((m+y*b*v)/$*Math.sin($*I)+v*Math.cos($*I))}}else if(y===1)x=$=>o-Math.exp(-b*$)*(v+(m+b*v)*$);else{const $=b*Math.sqrt(y*y-1);x=I=>{const R=Math.exp(-y*b*I),N=Math.min($*I,300);return o-R*((m+y*b*v)*Math.sinh(N)+$*v*Math.cosh(N))/$}}const _={calculatedDuration:f&&d||null,next:$=>{const I=x($);if(f)a.done=$>=d;else{let R=$===0?m:0;y<1&&(R=$===0?Tu(m):qwe(x,$,I));const N=Math.abs(R)<=r,T=Math.abs(o-I)<=i;a.done=N&&T}return a.value=a.done?o:I,a},toString:()=>{const $=Math.min(mU(_),kE),I=Vwe(R=>_.next($*R).value,$,30);return $+"ms "+I},toTransition:()=>{}};return _}$E.applyToOptions=t=>{const e=w7t(t,100,$E);return t.ease=e.ease,t.duration=Tu(e.duration),t.type="keyframes",t};function EN({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=t[0],h={done:!1,value:d},f=N=>a!==void 0&&N<a||c!==void 0&&N>c,m=N=>a===void 0?c:c===void 0||Math.abs(a-N)<Math.abs(c-N)?a:c;let y=n*e;const v=d+y,b=o===void 0?v:o(v);b!==v&&(y=b-d);const C=N=>-y*Math.exp(-N/r),x=N=>b+C(N),_=N=>{const T=C(N),O=x(N);h.done=Math.abs(T)<=l,h.value=h.done?b:O};let $,I;const R=N=>{f(h.value)&&($=N,I=$E({keyframes:[h.value,m(h.value)],velocity:qwe(x,N,h.value),damping:i,stiffness:s,restDelta:l,restSpeed:u}))};return R(0),{calculatedDuration:null,next:N=>{let T=!1;return!I&&$===void 0&&(T=!0,_(N),R(N)),$!==void 0&&N>=$?I.next(N-$):(!T&&_(N),h)}}}function A7t(t,e,n){const r=[],i=n||mh.mix||Hwe,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||vc:e;a=hx(c,a)}r.push(a)}return r}function k7t(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(oU(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=A7t(e,r,i),c=a.length,l=u=>{if(o&&u<t[0])return e[0];let d=0;if(c>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const h=k3(t[d],t[d+1],u);return a[d](h)};return n?u=>l(gh(t[0],t[s-1],u)):l}function $7t(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=k3(0,e,r);t.push(ui(n,1,i))}}function I7t(t){const e=[0];return $7t(e,t.length-1),e}function T7t(t,e){return t.map(n=>n*e)}function P7t(t,e){return t.map(()=>e||Owe).splice(0,t.length-1)}function Pb({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=z8t(r)?r.map(Cne):Cne(r),s={done:!1,value:e[0]},o=T7t(n&&n.length===e.length?n:I7t(e),t),a=k7t(o,e,{ease:Array.isArray(i)?i:P7t(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const R7t=t=>t!==null;function yU(t,{repeat:e,repeatType:n="loop"},r,i=1){const s=t.filter(R7t),a=i<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const M7t={decay:EN,inertia:EN,tween:Pb,keyframes:Pb,spring:$E};function Kwe(t){typeof t.type=="string"&&(t.type=M7t[t.type])}class wU{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const O7t=t=>t/100;class vU extends wU{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==ua.now()&&this.tick(ua.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Kwe(e);const{type:n=Pb,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=e;let{keyframes:a}=e;const c=n||Pb;c!==Pb&&typeof a[0]!="number"&&(this.mixKeyframes=hx(O7t,Hwe(a[0],a[1])),a=[0,100]);const l=c({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=mU(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:h,repeatDelay:f,type:m,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-l*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,_=r;if(d){const N=Math.min(this.currentTime,i)/a;let T=Math.floor(N),O=N%1;!O&&N>=1&&(O=1),O===1&&T--,T=Math.min(T,d+1),!!(T%2)&&(h==="reverse"?(O=1-O,f&&(O-=f/a)):h==="mirror"&&(_=o)),x=gh(0,1,O)*a}const $=C?{done:!1,value:u[0]}:_.next(x);s&&($.value=s($.value));let{done:I}=$;!C&&c!==null&&(I=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return R&&m!==EN&&($.value=yU(u,this.options,v,this.speed)),y&&y($.value),R&&this.finish(),$}then(e,n){return this.finished.then(e,n)}get duration(){return Pu(this.calculatedDuration)}get time(){return Pu(this.currentTime)}set time(e){var n;e=Tu(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(ua.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Pu(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:e=y7t,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ua.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function j7t(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const N0=t=>t*180/Math.PI,CN=t=>{const e=N0(Math.atan2(t[1],t[0]));return _N(e)},N7t={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:CN,rotateZ:CN,skewX:t=>N0(Math.atan(t[1])),skewY:t=>N0(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},_N=t=>(t=t%360,t<0&&(t+=360),t),Ine=CN,Tne=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Pne=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),D7t={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Tne,scaleY:Pne,scale:t=>(Tne(t)+Pne(t))/2,rotateX:t=>_N(N0(Math.atan2(t[6],t[5]))),rotateY:t=>_N(N0(Math.atan2(-t[2],t[0]))),rotateZ:Ine,rotate:Ine,skewX:t=>N0(Math.atan(t[4])),skewY:t=>N0(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function SN(t){return t.includes("scale")?1:0}function AN(t,e){if(!t||t==="none")return SN(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=D7t,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=N7t,i=a}if(!i)return SN(e);const s=r[e],o=i[1].split(",").map(B7t);return typeof s=="function"?s(o):o[s]}const L7t=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return AN(n,e)};function B7t(t){return parseFloat(t.trim())}const sw=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ow=new Set(sw),Rne=t=>t===iw||t===_n,F7t=new Set(["x","y","z"]),U7t=sw.filter(t=>!F7t.has(t));function z7t(t){const e=[];return U7t.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const o1={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>AN(e,"x"),y:(t,{transform:e})=>AN(e,"y")};o1.translateX=o1.x;o1.translateY=o1.y;const a1=new Set;let kN=!1,$N=!1,IN=!1;function Gwe(){if($N){const t=Array.from(a1).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=z7t(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}$N=!1,kN=!1,a1.forEach(t=>t.complete(IN)),a1.clear()}function Zwe(){a1.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&($N=!0)})}function W7t(){IN=!0,Zwe(),Gwe(),IN=!1}class bU{constructor(e,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(a1.add(this),kN||(kN=!0,Xr.read(Zwe),Xr.resolveKeyframes(Gwe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const s=i==null?void 0:i.get(),o=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&s===void 0&&i.set(e[0])}j7t(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),a1.delete(this)}cancel(){this.state==="scheduled"&&(a1.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const H7t=t=>t.startsWith("--");function V7t(t,e,n){H7t(e)?t.style.setProperty(e,n):t.style[e]=n}const q7t=aU(()=>window.ScrollTimeline!==void 0),K7t={};function G7t(t,e){const n=aU(t);return()=>K7t[e]??n()}const Ywe=G7t(()=>{try{document.createElement("div").animate({opacity:0}
1067,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ib=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Mne={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ib([0,.65,.55,1]),circOut:ib([.55,0,1,.45]),backIn:ib([.31,.01,.66,-.59]),backOut:ib([.33,1.53,.69,.99])};function Qwe(t,e){if(t)return typeof t=="function"?Ywe()?Vwe(t,e):"ease-out":jwe(t)?ib(t):Array.isArray(t)?t.map(n=>Qwe(n,e)||Mne.easeOut):Mne[t]}function Z7t(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[e]:n};c&&(u.offset=c);const d=Qwe(a,i);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return l&&(h.pseudoElement=l),t.animate(u,h)}function Xwe(t){return typeof t=="function"&&"applyToOptions"in t}function Y7t({type:t,...e}){return Xwe(t)&&Ywe()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Q7t extends wU{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=e,oU(typeof e.type!="string");const l=Y7t(e);this.animation=Z7t(n,r,i,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=yU(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):V7t(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Pu(Number(e))}get time(){return Pu(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Tu(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&q7t()?(this.animation.timeline=e,vc):n(this)}}const Jwe={anticipate:Pwe,backInOut:Twe,circInOut:Mwe};function X7t(t){return t in Jwe}function J7t(t){typeof t.ease=="string"&&X7t(t.ease)&&(t.ease=Jwe[t.ease])}const One=10;class e9t extends Q7t{constructor(e){J7t(e),Kwe(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new vU({...o,autoplay:!1}),c=Tu(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-One).value,a.sample(c).value,One),a.stop()}}const jne=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(pp.test(t)||t==="0")&&!t.startsWith("url("));function t9t(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function n9t(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=jne(i,e),a=jne(s,e);return!o||!a?!1:t9t(t)||(n==="spring"||Xwe(n))&&r}function TN(t){t.duration=0,t.type}const r9t=new Set(["opacity","clipPath","filter","transform"]),i9t=aU(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function s9t(t){var u;const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=t;if(!(((u=e==null?void 0:e.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=e.owner.getProps();return i9t()&&n&&r9t.has(n)&&(n!=="transform"||!l)&&!c&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const o9t=40;class a9t extends wU{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:
1067o="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var m;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=ua.now();const h={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:c,motionValue:l,element:u,...d},f=(u==null?void 0:u.KeyframeResolver)||bU;this.keyframeResolver=new f(a,(y,v,b)=>this.onKeyframesResolved(y,v,h,!b),c,l,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,r,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=ua.now(),n9t(e,s,o,a)||((mh.instantAnimations||!c)&&(u==null||u(yU(e,r,n))),e[0]=e[e.length-1],TN(r),r.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>o9t?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},f=!l&&s9t(h)?new e9t({...h,element:h.motionValue.owner.current}):new vU(h);f.finished.then(()=>this.notifyFinished()).catch(vc),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),W7t()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const c9t=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function l9t(t){const e=c9t.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function eve(t,e,n=1){const[r,i]=l9t(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return Ewe(o)?parseFloat(o):o}return hU(i)?eve(i,e,n+1):i}function xU(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const tve=new Set(["width","height","top","left","right","bottom",...sw]),u9t={test:t=>t==="auto",parse:t=>t},nve=t=>e=>e.test(t),rve=[iw,_n,Ru,yf,t7t,e7t,u9t],Nne=t=>rve.find(nve(t));function d9t(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||_we(t):!0}const h9t=new Set(["brightness","contrast","saturate","opacity"]);function f9t(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(fU)||[];if(!r)return t;const i=n.replace(r,"");let s=h9t.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const p9t=/\b([a-z-]*)\(.*?\)/gu,PN={...pp,getAnimatableNone:t=>{const e=t.match(p9t);return e?e.map(f9t).join(" "):t}},Dne={...iw,transform:Math.round},g9t={rotate:yf,rotateX:yf,rotateY:yf,rotateZ:yf,scale:F6,scaleX:F6,scaleY:F6,scaleZ:F6,skew:yf,skewX:yf,skewY:yf,distance:_n,translateX:_n,translateY:_n,translateZ:_n,x:_n,y:_n,z:_n,perspective:_n,transformPerspective:_n,opacity:$3,originX:_ne,originY:_ne,originZ:_n},EU={borderWidth:_n,borderTopWidth:_n,borderRightWidth:_n,borderBottomWidth:_n,borderLeftWidth:_n,borderRadius:_n,radius:_n,borderTopLeftRadius:_n,borderTopRightRadius:_n,borderBottomRightRadius:_n,borderBottomLeftRadius:_n,width:_n,maxWidth:_n,height:_n,maxHeight:_n,top:_n,right:_n,bottom:_n,left:_n,padding:_n,paddingTop:_n,paddingRight:_n,paddingBottom:_n,paddingLeft:_n,margin:_n,marginTop:_n,marginRight:_n,marginBottom:_n,marginLeft:_n,backgroundPositionX:_n,backgroundPositionY:_n,...g9t,zIndex:Dne,fillOpacity:$3,strokeOpacity:$3,numOctaves:Dne},m9t={...EU,color:Di,backgroundColor:Di,outlineColor:Di,fill:Di,stroke:Di,borderColor:Di,borderTopColor:Di,borderRightColor:Di,borderBottomColor:Di,borderLeftColor:Di,filter:PN,WebkitFilter:PN},ive=t=>m9t[t];function sve(t,e){let n=ive(t);return n!==PN&&(n=pp),n.getAnimatableNone?n.getAnimatableNone(e):void 0}
vendor: 13,683 bytes, lines 1067-1075
1067const y9t=new Set(["auto","none","0"]);function w9t(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!y9t.has(s)&&I3(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=sve(n,i)}class v9t extends bU{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let l=e[c];if(typeof l=="string"&&(l=l.trim(),hU(l))){const u=eve(l,n.current);u!==void 0&&(e[c]=u),c===e.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!tve.has(r)||e.length!==2)return;const[i,s]=e,o=Nne(i),a=Nne(s);if(o!==a)if(Rne(o)&&Rne(a))for(let c=0;c<e.length;c++){const l=e[c];typeof l=="string"&&(e[c]=parseFloat(l))}else o1[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||d9t(e[i]))&&r.push(i);r.length&&w9t(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=o1[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=o1[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{e.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function b9t(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const i=(n==null?void 0:n[t])??r.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const ove=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function ave(t){return Cwe(t)&&"offsetHeight"in t}const Lne=30,x9t=t=>!isNaN(parseFloat(t));class E9t{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=ua.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ua.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=x9t(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new cU);const r=this.events[e].add(n);return e==="change"?()=>{r(),Xr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ua.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Lne)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Lne);return Swe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function x2(t,e){return new E9t(t,e)}const{schedule:CU}=Nwe(queueMicrotask,!1),Jc={x:!1,y:!1};function cve(){return Jc.x||Jc.y}function C9t(t){return t==="x"||t==="y"?Jc[t]?null:(Jc[t]=!0,()=>{Jc[t]=!1}):Jc.x||Jc.y?null:(Jc.x=Jc.y=!0,()=>{Jc.x=Jc.y=!1})}function lve(t,e){const n=b9t(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function Bne(t){return!(t.pointerType==="touch"||cve())}function _9t(t,e,n={}){const[r,i,s]=lve(t,n),o=a=>{if(!Bne(a))return;const{target:c}=a,l=e(c,a);if(typeof l!="function"||!c)return;const u=d=>{Bne(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const uve=(t,e)=>e?t===e?!0:uve(t,e.parentElement):!1,_U=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,S9t=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function A9t(t){return S9t.has(t.tagName)||t.tabIndex!==-1}const P7=new WeakSet;function Fne(t){return e=>{e.key==="Enter"&&t(e)}}function UP(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const k9t=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Fne(()=>{if(P7.has(n))return;UP(n,"down");const i=Fne(()=>{UP(n,"up")}),s=()=>UP(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Une(t){return _U(t)&&!cve()}function $9t(t,e,n={}){const[r,i,s]=lve(t,n),o=a=>{const c=a.currentTarget;if(!Une(a))return;P7.add(c);const l=e(c,a),u=(f,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),P7.has(c)&&P7.delete(c),Une(f)&&typeof l=="function"&&l(f,{success:m})},d=f=>{u(f,c===window||c===document||n.useGlobalTarget||uve(c,f.target))},h=f=>{u(f,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),ave(a)&&(a.addEventListener("focus",l=>k9t(l,i)),!A9t(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function dve(t){return Cwe(t)&&"ownerSVGElement"in t}function I9t(t){return dve(t)&&t.tagName==="svg"}const go=t=>!!(t&&t.getVelocity),T9t=[...rve,Di,pp],P9t=t=>T9t.find(nve(t)),SU=E.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class R9t extends E.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=ave(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function M9t({children:t,isPresent:e,anchorX:n,root:r}){const i=E.useId(),s=E.useRef(null),o=E.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=E.useContext(SU);return E.useInsertionEffect(()=>{const{width:c,height:l,top:u,left:d,right:h}=o.current;if(e||!s.current||!c||!l)return;const f=n==="left"?`left: ${d}`:`right: ${h}`;s.current.dataset.motionPopId=i;const m=document.createElement("style");a&&(m.nonce=a);const y=r??document.head;return y.appendChild(m),m.sheet&&m.sheet.insertRule(` 1068 [data-motion-pop-id="${i}"] { 1069 position: absolute !important; 1070 width: ${c}px !important; 1071 height: ${l}px !important; 1072 ${f}px !important; 1073 top: ${u}px !important; 1074 } 1075 `),()=>{y.contains(m)&&y.removeChild(m)}},[e]),p.jsx(R9t,{isPresent:e,childRef:s,sizeRef:o,children:E.cloneElement(t,{ref:s})})}const O9t=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a,root:c})=>{const l=nU(j9t),u=E.useId();let d=!0,h=E.useMemo(()=>(d=!1,{id:u,initial:e,isPresent:n,custom:i,onExitComplete:f=>{l.set(f,!0);for(const m of l.values())if(!m)return;r&&r()},register:f=>(l.set(f,!1),()=>l.delete(f))}),[n,l,r]);return s&&d&&(h={...h}),E.useMemo(()=>{l.forEach((f,m)=>l.set(m,!1))},[n]),E.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(t=p.jsx(M9t,{isPresent:n,anchorX:a,root:c,children:t})),p.jsx(PS.Provider,{value:h,children:t})};function j9t(){return new Map}function hve(t=!0){const e=E.useContext(PS);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=E.useId();E.useEffect(()=>{if(t)return i(s)},[t]);const o=E.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,o]:[!0]}const U6=t=>t.key||"";function zne(t){const e=[];return E.Children.forEach(t,n=>{E.isValidElement(n)&&e.push(n)}),e}const gx=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left",root:c})=>{const[l,u]=hve(o),d=E.useMemo(()=>zne(t),[t]),h=o&&!l?[]:d.map(U6),f=E.useRef(!0),m=E.useRef(d),y=nU(()=>new Map),[v,b]=E.useState(d),[C,x]=E.useState(d);xwe(()=>{f.current=!1,m.current=d;for(let I=0;I<C.length;I++){const R=U6(C[I]);h.includes(R)?y.delete(R):y.get(R)!==!0&&y.set(R,!1)}},[C,h.length,h.join("-")]);const _=[];if(d!==v){let I=[...d];for(let R=0;R<C.length;R++){const N=C[R],T=U6(N);h.includes(T)||(I.splice(R,0,N),_.push(N))}return s==="wait"&&_.length&&(I=_),x(zne(I)),b(d),null}const{forceRender:$}=E.useContext(tU);return p.jsx(p.Fragment,{children:C.map(I=>{const R=U6(I),N=o&&!l?!1:d===C||h.includes(R),T=()=>{if(y.has(R))y.set(R,!0);else return;let O=!0;y.forEach(U=>{U||(O=!1)}),O&&($==null||$(),x(m.current),o&&(u==null||u()),r&&r())};return p.jsx(O9t,{isPresent:N,initial:!f.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:s,root:c,onExitComplete:N?void 0:T,anchorX:a,children:I},R)})})},fve=E.createContext({strict:!1}),Wne={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},E2={};for(const t in Wne)E2[t]={isEnabled:e=>Wne[t].some(n=>!!e[n])};function N9t(t){for(const e in t)E2[e]={...E2[e],...t[e]}}const D9t=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function IE(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||D9t.has(t)}let pve=t=>!IE(t);function L9t(t){typeof t=="function"&&(pve=e=>e.startsWith("on")?!IE(e):t(e))}try{L9t(require("@emotion/is-prop-valid").default)}catch{}function B9t(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(pve(i)||n===!0&&IE(i)||!e&&!IE(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}const RS=E.createContext({});function MS(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function T3(t){return typeof t=="string"||Array.isArray(t)}const AU=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kU=["initial",...AU];function OS(t){return MS(t.animate)||kU.some(e=>T3(t[e]))}function gve(t){return!!(OS(t)||t.variants)}function F9t(t,e){if(OS(t)){const{initial:n,animate:r}=t;return{initial:n===!1||T3(n)?n:void 0,animate:T3(r)?r:void 0}}return t.inherit!==!1?e:{}}function U9t(t){const{initial:e,animate:n}=F9t(t,E.useContext(RS));return E.useMemo(()=>({initial:e,animate:n}),[Hne(e),Hne(n)])}function Hne(t){return Array.isArray(t)?t.join(" "):t}const P3={};function z9t(t){for(const e in t)P3[e]=t[e],dU(e)&&(P3[e].isCSSVariable=!0)}function mve(t,{layout:e,layoutId:n}){return ow.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!P3[t]||t==="opacity")}const W9t={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H9t=sw.length;function V9t(t,e,n){let r="",i=!0;for(let s=0;s<H9t;s++){const o=sw[s],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=ove(a,EU[o]);if(!c){i=!1;const u=W9t[o]||o;r+=`${u}(${l}) `}n&&(e[o]=l)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function $U(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(ow.has(c)){o=!0;continue}else if(dU(c)){i[c]=l;continue}else{const u=ove(l,EU[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(e.transform||(o||n?r.transform=V9t(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}const IU=()=>({style:{},transform:{},transformOrigin:{},vars:{}});
vendor: 4,739 bytes, line 1075
1075function yve(t,e,n){for(const r in e)!go(e[r])&&!mve(r,n)&&(t[r]=e[r])}function q9t({transformTemplate:t},e){return E.useMemo(()=>{const n=IU();return $U(n,e,t),Object.assign({},n.vars,n.style)},[e])}function K9t(t,e){const n=t.style||{},r={};return yve(r,n,t),Object.assign(r,q9t(t,e)),r}function G9t(t,e){const n={},r=K9t(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const Z9t={offset:"stroke-dashoffset",array:"stroke-dasharray"},Y9t={offset:"strokeDashoffset",array:"strokeDasharray"};function Q9t(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?Z9t:Y9t;t[s.offset]=_n.transform(-r);const o=_n.transform(e),a=_n.transform(n);t[s.array]=`${o} ${a}`}function wve(t,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},c,l,u){if($U(t,a,l),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h}=t;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Q9t(d,i,s,o,!1)}const vve=()=>({...IU(),attrs:{}}),bve=t=>typeof t=="string"&&t.toLowerCase()==="svg";function X9t(t,e,n,r){const i=E.useMemo(()=>{const s=vve();return wve(s,e,bve(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};yve(s,t.style,t),i.style={...s,...i.style}}return i}const J9t=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function TU(t){return typeof t!="string"||t.includes("-")?!1:!!(J9t.indexOf(t)>-1||/[A-Z]/u.test(t))}function eEt(t,e,n,{latestValues:r},i,s=!1){const a=(TU(t)?X9t:G9t)(e,r,i,t),c=B9t(e,typeof t=="string",s),l=t!==E.Fragment?{...c,...a,ref:n}:{},{children:u}=e,d=E.useMemo(()=>go(u)?u.get():u,[u]);return E.createElement(t,{...l,children:d})}function Vne(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function PU(t,e,n,r){if(typeof e=="function"){const[i,s]=Vne(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Vne(r);e=e(n!==void 0?n:t.custom,i,s)}return e}function R7(t){return go(t)?t.get():t}function tEt({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,i){return{latestValues:nEt(n,r,i,t),renderState:e()}}function nEt(t,e,n,r){const i={},s=r(t,{});for(const h in s)i[h]=R7(s[h]);let{initial:o,animate:a}=t;const c=OS(t),l=gve(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!MS(d)){const h=Array.isArray(d)?d:[d];for(let f=0;f<h.length;f++){const m=PU(t,h[f]);if(m){const{transitionEnd:y,transition:v,...b}=m;for(const C in b){let x=b[C];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(i[C]=x)}for(const C in y)i[C]=y[C]}}}return i}const xve=t=>(e,n)=>{const r=E.useContext(RS),i=E.useContext(PS),s=()=>tEt(t,e,r,i);return n?s():nU(s)};function RU(t,e,n){var s;const{style:r}=t,i={};for(const o in r)(go(r[o])||e.style&&go(e.style[o])||mve(o,t)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const rEt=xve({scrapeMotionValuesFromProps:RU,createRenderState:IU});function Eve(t,e,n){const r=RU(t,e,n);for(const i in t)if(go(t[i])||go(e[i])){const s=sw.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}const iEt=xve({scrapeMotionValuesFromProps:Eve,createRenderState:vve}),sEt=Symbol.for("motionComponentSymbol");function Wm(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function oEt(t,e,n){return E.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):Wm(n)&&(n.current=r))},[e])}const MU=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),aEt="framerAppearId",Cve="data-"+MU(aEt),_ve=E.createContext({});function cEt(t,e,n,r,i){var y,v;const{visualElement:s}=E.useContext(RS),o=E.useContext(fve),a=E.useContext(PS),c=E.useContext(SU).reducedMotion,l=E.useRef(null);r=r||o.renderer,!l.current&&r&&(l.current=r(t,{visualState:e,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}
vendor: 18,660 bytes, line 1075
1075));const u=l.current,d=E.useContext(_ve);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&lEt(l.current,n,i,d);const h=E.useRef(!1);E.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const f=n[Cve],m=E.useRef(!!f&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,f))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,f)));return xwe(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),m.current&&u.animationState&&u.animationState.animateChanges())}),E.useEffect(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,f)}),m.current=!1),u.enteringChildren=void 0)}),u}function lEt(t,e,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Sve(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Wm(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Sve(t){if(t)return t.options.allowProjection!==!1?t.projection:Sve(t.parent)}function zP(t,{forwardMotionProps:e=!1}={},n,r){n&&N9t(n);const i=TU(t)?iEt:rEt;function s(a,c){let l;const u={...E.useContext(SU),...a,layoutId:uEt(a)},{isStatic:d}=u,h=U9t(a),f=i(a,d);if(!d&&rU){dEt();const m=hEt(u);l=m.MeasureLayout,h.visualElement=cEt(t,f,u,r,m.ProjectionNode)}return p.jsxs(RS.Provider,{value:h,children:[l&&h.visualElement?p.jsx(l,{visualElement:h.visualElement,...u}):null,eEt(t,a,oEt(f,h.visualElement,c),f,d,e)]})}s.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const o=E.forwardRef(s);return o[sEt]=t,o}function uEt({layoutId:t}){const e=E.useContext(tU).id;return e&&t!==void 0?e+"-"+t:t}function dEt(t,e){E.useContext(fve).strict}function hEt(t){const{drag:e,layout:n}=E2;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function fEt(t,e){if(typeof Proxy>"u")return zP;const n=new Map,r=(s,o)=>zP(s,o,t,e),i=(s,o)=>r(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?r:(n.has(o)||n.set(o,zP(o,void 0,t,e)),n.get(o))})}function Ave({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function pEt({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function gEt(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function WP(t){return t===void 0||t===1}function RN({scale:t,scaleX:e,scaleY:n}){return!WP(t)||!WP(e)||!WP(n)}function s0(t){return RN(t)||kve(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function kve(t){return qne(t.x)||qne(t.y)}function qne(t){return t&&t!=="0%"}function TE(t,e,n){const r=t-n,i=e*r;return n+i}function Kne(t,e,n,r,i){return i!==void 0&&(t=TE(t,i,r)),TE(t,n,r)+e}function MN(t,e=0,n=1,r,i){t.min=Kne(t.min,e,n,r,i),t.max=Kne(t.max,e,n,r,i)}function $ve(t,{x:e,y:n}){MN(t.x,e.translate,e.scale,e.originPoint),MN(t.y,n.translate,n.scale,n.originPoint)}const Gne=.999999999999,Zne=1.0000000000001;function mEt(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Vm(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,$ve(t,o)),r&&s0(s.latestValues)&&Vm(t,s.latestValues))}e.x<Zne&&e.x>Gne&&(e.x=1),e.y<Zne&&e.y>Gne&&(e.y=1)}function Hm(t,e){t.min=t.min+e,t.max=t.max+e}function Yne(t,e,n,r,i=.5){const s=ui(t.min,t.max,i);MN(t,e,n,s,r)}function Vm(t,e){Yne(t.x,e.x,e.scaleX,e.scale,e.originX),Yne(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ive(t,e){return Ave(gEt(t.getBoundingClientRect(),e))}function yEt(t,e,n){const r=Ive(t,n),{scroll:i}=e;return i&&(Hm(r.x,i.offset.x),Hm(r.y,i.offset.y)),r}const Qne=()=>({translate:0,scale:1,origin:0,originPoint:0}),qm=()=>({x:Qne(),y:Qne()}),Xne=()=>({min:0,max:0}),Ci=()=>({x:Xne(),y:Xne()}),ON={current:null},Tve={current:!1};function wEt(){if(Tve.current=!0,!!rU)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ON.current=t.matches;t.addEventListener("change",e),e()}else ON.current=!1}const vEt=new WeakMap;function bEt(t,e,n){for(const r in e){const i=e[r],s=n[r];if(go(i))t.addValue(r,i);else if(go(s))t.addValue(r,x2(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,x2(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Jne=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class xEt{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bU,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ua.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Xr.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=OS(n),this.isVariantNode=gve(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in d){const f=d[h];c[h]!==void 0&&go(f)&&f.set(c[h])}}mount(e){var n;this.current=e,vEt.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),Tve.current||wEt(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ON.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),fp(this.notifyUpdate),fp(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=ow.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Xr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in E2){const n=E2[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ci()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Jne.length;r++){const i=Jne[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=bEt(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=x2(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(Ewe(r)||_we(r))?r=parseFloat(r):!P9t(r)&&pp.test(n)&&(r=sve(e,n)),this.setBaseTarget(e,go(r)?r.get():r)),go(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=PU(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!go(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new cU),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){CU.render(this.render)}}class Pve extends xEt{constructor(){super(...arguments),this.KeyframeResolver=v9t}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;go(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rve(t,{style:e,vars:n},r,i){const s=t.style;let o;for(o in e)s[o]=e[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function EEt(t){return window.getComputedStyle(t)}class CEt extends Pve{constructor(){super(...arguments),this.type="html",this.renderInstance=Rve}readValueFromInstance(e,n){var r;if(ow.has(n))return(r=this.projection)!=null&&r.isProjecting?SN(n):L7t(e,n);{const i=EEt(e),s=(dU(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ive(e,n)}build(e,n,r){$U(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return RU(e,n,r)}}const Mve=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function _Et(t,e,n,r){Rve(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(Mve.has(i)?i:MU(i),e.attrs[i])}class SEt extends Pve{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ci}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ow.has(n)){const r=ive(n);return r&&r.default||0}return n=Mve.has(n)?n:MU(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return Eve(e,n,r)}build(e,n,r){wve(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){_Et(e,n,r,i)}mount(e){this.isSVGTag=bve(e.tagName),super.mount(e)}}const AEt=(t,e)=>TU(t)?new SEt(e):new CEt(e,{allowProjection:t!==E.Fragment});function py(t,e,n){const r=t.getProps();return PU(r,e,n!==void 0?n:r.custom,t)}const jN=t=>Array.isArray(t);function kEt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,x2(n))}function $Et(t){return jN(t)?t[t.length-1]||0:t}function IEt(t,e){const n=py(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=$Et(s[o]);kEt(t,o,a)}}function TEt(t){return!!(go(t)&&t.add)}function NN(t,e){const n=t.getValue("willChange");if(TEt(n))return n.add(e);if(!n&&mh.WillChange){const r=new mh.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Ove(t){return t.props[Cve]}const PEt=t=>t!==null;function REt(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(PEt),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[s]}const MEt={type:"spring",stiffness:500,damping:25,restSpeed:10},OEt=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),jEt={type:"keyframes",duration:.8},NEt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},DEt=(t,{keyframes:e})=>e.length>2?jEt:ow.has(t)?t.startsWith("scale")?OEt(e[1]):MEt:NEt;function LEt({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const OU=(t,e,n,r={},i,s)=>o=>{const a=xU(r,t)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-Tu(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i};LEt(a)||Object.assign(u,DEt(t,u)),u.duration&&(u.duration=Tu(u.duration)),u.repeatDelay&&(u.repeatDelay=Tu(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(TN(u),u.delay===0&&(d=!0)),(mh.instantAnimations||mh.skipAnimations)&&(d=!0,TN(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&e.get()!==void 0){const h=REt(u.keyframes,a);if(h!==void 0){Xr.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new vU(u):new a9t(u)};function BEt({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function jve(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:o,...a}=e;r&&(s=r);const c=[],l=i&&t.animationState&&t.animationState.getState()[i];for(const u in a){const d=t.getValue(u,t.latestValues[u]??null),h=a[u];if(h===void 0||l&&BEt(l,u))continue;const f={delay:n,...xU(s||{},u)},m=d.get();if(m!==void 0&&!d.isAnimating&&!Array.isArray(h)&&h===m&&!f.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const b=Ove(t);if(b){const C=window.MotionHandoffAnimation(b,u,Xr);C!==null&&(f.startTime=C,y=!0)}}NN(t,u),d.start(OU(u,d,h,t.shouldReduceMotion&&tve.has(u)?{type:!1}:f,t,y));const v=d.animation;v&&c.push(v)}return o&&Promise.all(c).then(()=>{Xr.update(()=>{o&&IEt(t,o)})}),c}function Nve(t,e,n,r=0,i=1){const s=Array.from(t).sort((l,u)=>l.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*r;return typeof n=="function"?n(s,o):i===1?s*r:a-s*r}function DN(t,e,n={}){var c;const r=py(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(jve(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=i;return FEt(t,e,l,u,d,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function FEt(t,e,n=0,r=0,i=0,s=1,o){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(DN(c,e,{...o,delay:n+(typeof r=="function"?0:r)+Nve(t.variantChildren,c,r,i,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function UEt(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>DN(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=DN(t,e,n);else{const i=typeof e=="function"?py(t,e,n.custom):e;r=Promise.all(jve(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function Dve(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const zEt=kU.length;function Lve(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Lve(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<zEt;n++){const r=kU[n],i=t.props[r];(T3(i)||i===!1)&&(e[r]=i)}return e}const WEt=[...AU].reverse(),HEt=AU.length;function VEt(t){return e=>Promise.all(e.map(({animation:n,options:r})=>UEt(t,n,r)))}function qEt(t){let e=VEt(t),n=ere(),r=!0;const i=c=>(l,u)=>{var h;const d=py(t,u,c==="exit"?(h=t.presenceContext)==null?void 0:h.custom:void 0);if(d){const{transition:f,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function s(c){e=c(t)}function o(c){const{props:l}=t,u=Lve(t.parent)||{},d=[],h=new Set;let f={},m=1/0;for(let v=0;v<HEt;
vendor: 21,372 bytes, line 1075
1075v++){const b=WEt[v],C=n[b],x=l[b]!==void 0?l[b]:u[b],_=T3(x),$=b===c?C.isActive:null;$===!1&&(m=v);let I=x===u[b]&&x!==l[b]&&_;if(I&&r&&t.manuallyAnimateOnMount&&(I=!1),C.protectedKeys={...f},!C.isActive&&$===null||!x&&!C.prevProp||MS(x)||typeof x=="boolean")continue;const R=KEt(C.prevProp,x);let N=R||b===c&&C.isActive&&!I&&_||v>m&&_,T=!1;const O=Array.isArray(x)?x:[x];let U=O.reduce(i(b),{});$===!1&&(U={});const{prevResolvedValues:z={}}=C,L={...z,...U},S=W=>{N=!0,h.has(W)&&(T=!0,h.delete(W)),C.needsAnimating[W]=!0;const H=t.getValue(W);H&&(H.liveStyle=!1)};for(const W in L){const H=U[W],D=z[W];if(f.hasOwnProperty(W))continue;let V=!1;jN(H)&&jN(D)?V=!Dve(H,D):V=H!==D,V?H!=null?S(W):h.add(W):H!==void 0&&h.has(W)?S(W):C.protectedKeys[W]=!0}C.prevProp=x,C.prevResolvedValues=U,C.isActive&&(f={...f,...U}),r&&t.blockInitialAnimation&&(N=!1);const k=I&&R;N&&(!k||T)&&d.push(...O.map(W=>{const H={type:b};if(typeof W=="string"&&r&&!k&&t.manuallyAnimateOnMount&&t.parent){const{parent:D}=t,V=py(D,W);if(D.enteringChildren&&V){const{delayChildren:B}=V.transition||{};H.delay=Nve(D.enteringChildren,t,B)}}return{animation:W,options:H}}))}if(h.size){const v={};if(typeof l.initial!="boolean"){const b=py(t,Array.isArray(l.initial)?l.initial[0]:l.initial);b&&b.transition&&(v.transition=b.transition)}h.forEach(b=>{const C=t.getBaseTarget(b),x=t.getValue(b);x&&(x.liveStyle=!0),v[b]=C??null}),d.push({animation:v})}let y=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(y=!1),r=!1,y?e(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=t.variantChildren)==null||d.forEach(h=>{var f;return(f=h.animationState)==null?void 0:f.setActive(c,l)}),n[c].isActive=l;const u=o(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=ere(),r=!0}}}function KEt(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Dve(e,t):!1}function e0(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ere(){return{animate:e0(!0),whileInView:e0(),whileHover:e0(),whileTap:e0(),whileDrag:e0(),whileFocus:e0(),exit:e0()}}class $p{constructor(e){this.isMounted=!1,this.node=e}update(){}}class GEt extends $p{constructor(e){super(e),e.animationState||(e.animationState=qEt(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();MS(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let ZEt=0;class YEt extends $p{constructor(){super(...arguments),this.id=ZEt++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const QEt={animation:{Feature:GEt},exit:{Feature:YEt}};function R3(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function mx(t){return{point:{x:t.pageX,y:t.pageY}}}const XEt=t=>e=>_U(e)&&t(e,mx(e));function Rb(t,e,n,r){return R3(t,e,XEt(n),r)}const Bve=1e-4,JEt=1-Bve,eCt=1+Bve,Fve=.01,tCt=0-Fve,nCt=0+Fve;function Io(t){return t.max-t.min}function rCt(t,e,n){return Math.abs(t-e)<=n}function tre(t,e,n,r=.5){t.origin=r,t.originPoint=ui(e.min,e.max,t.origin),t.scale=Io(n)/Io(e),t.translate=ui(n.min,n.max,t.origin)-t.originPoint,(t.scale>=JEt&&t.scale<=eCt||isNaN(t.scale))&&(t.scale=1),(t.translate>=tCt&&t.translate<=nCt||isNaN(t.translate))&&(t.translate=0)}function Mb(t,e,n,r){tre(t.x,e.x,n.x,r?r.originX:void 0),tre(t.y,e.y,n.y,r?r.originY:void 0)}function nre(t,e,n){t.min=n.min+e.min,t.max=t.min+Io(e)}function iCt(t,e,n){nre(t.x,e.x,n.x),nre(t.y,e.y,n.y)}function rre(t,e,n){t.min=e.min-n.min,t.max=t.min+Io(e)}function Ob(t,e,n){rre(t.x,e.x,n.x),rre(t.y,e.y,n.y)}function oc(t){return[t("x"),t("y")]}const Uve=({current:t})=>t?t.ownerDocument.defaultView:null,ire=(t,e)=>Math.abs(t-e);function sCt(t,e){const n=ire(t.x,e.x),r=ire(t.y,e.y);return Math.sqrt(n**2+r**2)}class zve{constructor(e,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=VP(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=sCt(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!m)return;const{point:y}=h,{timestamp:v}=Is;this.history.push({...y,timestamp:v});const{onStart:b,onMove:C}=this.handlers;f||(b&&b(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=HP(f,this.transformPagePoint),Xr.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=VP(h.type==="pointercancel"?this.lastMoveEventInfo:HP(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,b),y&&y(h,b)},!_U(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const a=mx(e),c=HP(a,this.transformPagePoint),{point:l}=c,{timestamp:u}=Is;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(e,VP(c,this.history)),this.removeListeners=hx(Rb(this.contextWindow,"pointermove",this.handlePointerMove),Rb(this.contextWindow,"pointerup",this.handlePointerUp),Rb(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),fp(this.updatePoint)}}function HP(t,e){return e?{point:e(t.point)}:t}function sre(t,e){return{x:t.x-e.x,y:t.y-e.y}}function VP({point:t},e){return{point:t,delta:sre(t,Wve(e)),offset:sre(t,oCt(e)),velocity:aCt(e,.1)}}function oCt(t){return t[0]}function Wve(t){return t[t.length-1]}function aCt(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Wve(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Tu(e)));)n--;if(!r)return{x:0,y:0};const s=Pu(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function cCt(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?ui(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?ui(n,t,r.max):Math.min(t,n)),t}function ore(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function lCt(t,{top:e,left:n,bottom:r,right:i}){return{x:ore(t.x,n,i),y:ore(t.y,e,r)}}function are(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function uCt(t,e){return{x:are(t.x,e.x),y:are(t.y,e.y)}}function dCt(t,e){let n=.5;const r=Io(t),i=Io(e);return i>r?n=k3(e.min,e.max-r,t.min):r>i&&(n=k3(t.min,t.max-i,e.min)),gh(0,1,n)}function hCt(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const LN=.35;function fCt(t=LN){return t===!1?t=0:t===!0&&(t=LN),{x:cre(t,"left","right"),y:cre(t,"top","bottom")}}function cre(t,e,n){return{min:lre(t,e),max:lre(t,n)}}function lre(t,e){return typeof t=="number"?t:t[e]||0}const pCt=new WeakMap;class gCt{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ci(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(mx(d).point)},o=(d,h)=>{const{drag:f,dragPropagation:m,onDragStart:y}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=C9t(f),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),oc(b=>{let C=this.getAxisMotionValue(b).get()||0;if(Ru.test(C)){const{projection:x}=this.visualElement;if(x&&x.layout){const _=x.layout.layoutBox[b];_&&(C=Io(_)*(parseFloat(C)/100))}}this.originPoint[b]=C}),y&&Xr.postRender(()=>y(d,h)),NN(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:y,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:b}=h;if(m&&this.currentDirection===null){this.currentDirection=mCt(b),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,b),this.updateAxis("y",h.point,b),this.visualElement.render(),v&&v(d,h)},c=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>oc(d=>{var h;return this.getAnimationState(d)==="paused"&&((h=this.getAxisMotionValue(d).animation)==null?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new zve(e,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Uve(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Xr.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!z6(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=cCt(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;e&&Wm(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=lCt(r.layoutBox,e):this.constraints=!1,this.elastic=fCt(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&oc(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=hCt(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Wm(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=yEt(r,i.root,this.visualElement.getTransformPagePoint());let o=uCt(i.layout.layoutBox,s);if(n){const a=n(pEt(o));this.hasMutatedConstraints=!!a,a&&(o=Ave(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=oc(u=>{if(!z6(u,n,this.currentDirection))return;let d=c&&c[u]||{};o&&(d={min:0,max:0});const h=i?200:1e6,f=i?40:1e7,m={type:"inertia",velocity:r?e[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return NN(this.visualElement,e),r.start(OU(e,r,0,n,this.visualElement,!1))}stopAnimation(){oc(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){oc(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){oc(n=>{const{drag:r}=this.getProps();if(!z6(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(e[n]-ui(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Wm(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};oc(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=dCt({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),oc(o=>{if(!z6(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(ui(c,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;pCt.set(this.visualElement,this);const e=this.visualElement.current,n=Rb(e,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Wm(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Xr.read(r);const o=R3(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(oc(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=LN,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function z6(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function mCt(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class yCt extends $p{constructor(e){super(e),this.removeGroupControls=vc,this.removeListeners=vc,this.controls=new gCt(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vc}unmount(){this.removeGroupControls(),this.removeListeners()}}const ure=t=>(e,n)=>{t&&Xr.postRender(()=>t(e,n))};class wCt extends $p{constructor(){super(...arguments),this.removePointerDownListener=vc}onPointerDown(e){this.session=new zve(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Uve(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ure(e),onStart:ure(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Xr.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Rb(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const M7={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function dre(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ov={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(_n.test(t))t=parseFloat(t);else return t;const n=dre(t,e.target.x),r=dre(t,e.target.y);return`${n}% ${r}%`}},vCt={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=pp.parse(t);if(i.length>5)return r;const s=pp.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=ui(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),s(i)}};let qP=!1;class bCt extends E.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;z9t(xCt),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),qP&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),M7.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:o}=r;return o&&(o.isPresent=s,qP=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Xr.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),CU.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;qP=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Hve(t){const[e,n]=hve(),r=E.useContext(tU);return p.jsx(bCt,{...t,layoutGroup:r,switchLayoutGroup:E.useContext(_ve),isPresent:e,safeToRemove:n})}const xCt={borderRadius:{...Ov,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ov,borderTopRightRadius:Ov,borderBottomLeftRadius:Ov,borderBottomRightRadius:Ov,boxShadow:vCt};function ECt(t,e,n){const r=go(t)?t:x2(t);return r.start(OU("",r,e,n)),r.animation}const CCt=(t,e)=>t.depth-e.depth;class _Ct{constructor(){this.children=[],this.isDirty=!1}add(e){iU(this.children,e),this.isDirty=!0}remove(e){sU(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(CCt),this.isDirty=!1,this.children.forEach(e)}}function SCt(t,e){const n=ua.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(fp(r),t(s-e))};return Xr.setup(r,!0),()=>fp(r)}const Vve=["TopLeft","TopRight","BottomLeft","BottomRight"],ACt=Vve.length,hre=t=>typeof t=="string"?parseFloat(t):t,fre=t=>typeof t=="number"||_n.test(t);function kCt(t,e,n,r,i,s){i?(t.opacity=ui(0,n.opacity??1,$Ct(r)),t.opacityExit=ui(e.opacity??1,0,ICt(r))):s&&(t.opacity=ui(e.opacity??1,n.opacity??1,r));for(let o=0;o<ACt;o++){const a=`border${Vve[o]}Radius`;let c=pre(e,a),l=pre(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||fre(c)===fre(l)?(t[a]=Math.max(ui(hre(c),hre(l),r),0),(Ru.test(l)||Ru.test(c))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=ui(e.rotate||0,n.rotate||0,r))}function pre(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const $Ct=qve(0,.5,Rwe),ICt=qve(.5,.95,vc);function qve(t,e,n){return r=>r<t?0:r>e?1:n(k3(t,e,r))}function gre(t,e){t.min=e.min,t.max=e.max}function rc(t,e){gre(t.x,e.x),gre(t.y,e.y)}function mre(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function yre(t,e,n,r,i){return t-=e,t=TE(t,1/n,r),i!==void 0&&(t=TE(t,1/i,r)),t}function TCt(t,e=0,n=1,r=.5,i,s=t,o=t){if(Ru.test(e)&&(e=parseFloat(e),e=ui(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=ui(s.min,s.max,r);t===s&&(a-=e),t.min=yre(t.min,e,n,a,i),t.max=yre(t.max,e,n,a,i)}function wre(t,e,[n,r,i],s,o){TCt(t,e[n],e[r],e[i],e.scale,s,o)}const PCt=["x","scaleX","originX"],RCt=["y","scaleY","originY"];function vre(t,e,n,r){wre(t.x,e,PCt,n?n.x:void 0,r?r.x:void 0),wre(t.y,e,RCt,n?n.y:void 0,r?r.y:void 0)}function bre(t){return t.translate===0&&t.scale===1}function Kve(t){return bre(t.x)&&bre(t.y)}function xre(t,e){return t.min===e.min&&t.max===e.max}function MCt(t,e){return xre(t.x,e.x)&&xre(t.y,e.y)}function Ere(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Gve(t,e){return Ere(t.x,e.x)&&Ere(t.y,e.y)}function Cre(t){return Io(t.x)/Io(t.y)}function _re(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class OCt{constructor(){this.members=[]}add(e){iU(this.members,e),e.scheduleRender()}remove(e){if(sU(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,
vendor: 5,300 bytes, line 1075
1075n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function jCt(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:h,skewX:f,skewY:m}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),f&&(r+=`skewX(${f}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const KP=["","X","Y","Z"],NCt=1e3;let DCt=0;function GP(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function Zve(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ove(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Xr,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&Zve(r)}function Yve({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=DCt++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(FCt),this.nodes.forEach(HCt),this.nodes.forEach(VCt),this.nodes.forEach(UCt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new _Ct)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new cU),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=dve(o)&&!I9t(o),this.instance=o;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let u,d=0;const h=()=>this.root.updateBlockedByResize=!1;Xr.read(()=>{d=window.innerWidth}),t(o,()=>{const f=window.innerWidth;f!==d&&(d=f,this.root.updateBlockedByResize=!0,u&&u(),u=SCt(h,250),M7.hasAnimatedSinceResize&&(M7.hasAnimatedSinceResize=!1,this.nodes.forEach(kre)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||YCt,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=l.getProps(),b=!this.targetLayout||!Gve(this.targetLayout,f),C=!d&&h;if(this.options.layoutRoot||this.resumeFrom||C||d&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...xU(m,"layout"),onPlay:y,onComplete:v};(l.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,C)}else d||kre(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),fp(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEac
vendor: 7,717 bytes, line 1075
1075h(qCt),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Zve(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Sre);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Are);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(WCt),this.nodes.forEach(LCt),this.nodes.forEach(BCt)):this.nodes.forEach(Are),this.clearAllSnapshots();const a=ua.now();Is.delta=gh(0,1e3/60,a-Is.timestamp),Is.timestamp=a,Is.isProcessing=!0,NP.update.process(Is),NP.preRender.process(Is),NP.render.process(Is),Is.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,CU.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zCt),this.sharedNodes.forEach(KCt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Io(this.snapshot.measuredBox.x)&&!Io(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ci(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Kve(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||s0(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),QCt(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:o}=this.options;if(!o)return Ci();const a=o.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(XCt))){const{scroll:u}=this.root;u&&(Hm(a.x,u.offset.x),Hm(a.y,u.offset.y))}return a}removeElementScroll(o){var c;const a=Ci();if(rc(a,o),(c=this.scroll)!=null&&c.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&rc(a,o),Hm(a.x,d.offset.x),Hm(a.y,d.offset.y))}return a}applyTransform(o,a=!1){const c=Ci();rc(c,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Vm(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),s0(u.latestValues)&&Vm(c,u.latestValues)}return s0(this.latestValues)&&Vm(c,this.latestValues),c}removeTransform(o){const a=Ci();rc(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!s0(l.latestValues))continue;RN(l.latestValues)&&l.updateSnapshot();const u=Ci(),d=l.measurePageBox();rc(u,d),vre(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return s0(this.latestValues)&&vre(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Is.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Is.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ci(),this.relativeTargetOrigin=Ci(),Ob(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),rc(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ci(),this.targetWithTransforms=Ci()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),iCt(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rc(this.target,this.layout.layoutBox),$ve(this.target,this.targetDelta)):rc(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ci(),this.relativeTargetOrigin=Ci(),Ob(this.relativeTargetOrigin,this.target,f.target),rc(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||RN(this.parent.latestValues)||kve(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&
vendor: 4,172 bytes, line 1075
1075(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Is.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;rc(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;mEt(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ci());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mre(this.prevProjectionDelta.x,this.projectionDelta.x),mre(this.prevProjectionDelta.y,this.projectionDelta.y)),Mb(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!_re(this.projectionDelta.x,this.prevProjectionDelta.x)||!_re(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qm(),this.projectionDelta=qm(),this.projectionDeltaWithTransform=qm()}setAnimationOrigin(o,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=qm();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Ci(),f=c?c.source:void 0,m=this.layout?this.layout.source:void 0,y=f!==m,v=this.getStack(),b=!v||v.members.length<=1,C=!!(y&&!b&&this.options.crossfade===!0&&!this.path.some(ZCt));this.animationProgress=0;let x;this.mixTargetDelta=_=>{const $=_/1e3;$re(d.x,o.x,$),$re(d.y,o.y,$),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ob(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),GCt(this.relativeTarget,this.relativeTargetOrigin,h,$),x&&MCt(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Ci()),rc(x,this.relativeTarget)),y&&(this.animationValues=u,kCt(u,l,this.latestValues,$,C,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=$},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(),this.pendingAnimation&&(fp(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xr.update(()=>{M7.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=x2(0)),this.currentAnimation=ECt(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(NCt),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&Qve(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Ci();const d=Io(this.layout.layoutBox.x);
vendor: 9,656 bytes, line 1075
1075c.x.min=o.target.x.min,c.x.max=c.x.min+d;const h=Io(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}rc(a,c),Vm(a,u),Mb(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new OCt),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&GP("z",o,l,this.animationValues);for(let u=0;u<KP.length;u++)GP(`rotate${KP[u]}`,o,l,this.animationValues),GP(`skew${KP[u]}`,o,l,this.animationValues);o.render();for(const u in l)o.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=R7(a==null?void 0:a.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=R7(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!s0(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=jCt(this.projectionDeltaWithTransform,this.treeScale,u);c&&(d=c(u,d)),o.transform=d;const{x:h,y:f}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${f.origin*100}% 0`,l.animationValues?o.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in P3){if(u[m]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:b}=P3[m],C=d==="none"?u[m]:y(u[m],l);if(v){const x=v.length;for(let _=0;_<x;_++)o[v[_]]=C}else b?this.options.visualElement.renderState.vars[m]=C:o[m]=C}this.options.layoutId&&(o.pointerEvents=l===this?R7(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Sre),this.root.sharedNodes.clear()}}}function LCt(t){t.updateLayout()}function BCt(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;s==="size"?oc(d=>{const h=o?e.measuredBox[d]:e.layoutBox[d],f=Io(h);h.min=r[d].min,h.max=h.min+f}):Qve(s,e.layoutBox,r)&&oc(d=>{const h=o?e.measuredBox[d]:e.layoutBox[d],f=Io(r[d]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+f)});const a=qm();Mb(a,r,e.layoutBox);const c=qm();o?Mb(c,t.applyTransform(i,!0),e.measuredBox):Mb(c,r,e.layoutBox);const l=!Kve(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const m=Ci();Ob(m,e.layoutBox,h.layoutBox);const y=Ci();Ob(y,r,f.layoutBox),Gve(m,y)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=m,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function FCt(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function UCt(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function zCt(t){t.clearSnapshot()}function Sre(t){t.clearMeasurements()}function Are(t){t.isLayoutDirty=!1}function WCt(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function kre(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function HCt(t){t.resolveTargetDelta()}function VCt(t){t.calcProjection()}function qCt(t){t.resetSkewAndRotation()}function KCt(t){t.removeLeadSnapshot()}function $re(t,e,n){t.translate=ui(e.translate,0,n),t.scale=ui(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ire(t,e,n,r){t.min=ui(e.min,n.min,r),t.max=ui(e.max,n.max,r)}function GCt(t,e,n,r){Ire(t.x,e.x,n.x,r),Ire(t.y,e.y,n.y,r)}function ZCt(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const YCt={duration:.45,ease:[.4,0,.1,1]},Tre=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Pre=Tre("applewebkit/")&&!Tre("chrome/")?Math.round:vc;function Rre(t){t.min=Pre(t.min),t.max=Pre(t.max)}function QCt(t){Rre(t.x),Rre(t.y)}function Qve(t,e,n){return t==="position"||t==="preserve-aspect"&&!rCt(Cre(e),Cre(n),.2)}function XCt(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const JCt=Yve({attachResizeListener:(t,e)=>R3(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ZP={current:void 0},Xve=Yve({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ZP.current){const t=new JCt({});t.mount(window),t.setOptions({layoutScroll:!0}),ZP.current=t}return ZP.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),e_t={pan:{Feature:wCt},drag:{Feature:yCt,ProjectionNode:Xve,MeasureLayout:Hve}};function Mre(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Xr.postRender(()=>s(e,mx(e)))}class t_t extends $p{mount(){const{current:e}=this.node;e&&(this.unmount=_9t(e,(n,r)=>(Mre(this.node,r,"Start"),i=>Mre(this.node,i,"End"))))}unmount(){}}class n_t extends $p{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=hx(R3(this.node.current,"focus",()=>this.onFocus()),R3(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ore(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Xr.postRender(()=>s(e,mx(e)))}class r_t extends $p{mount(){const{current:e}=this.node;e&&(this.unmount=$9t(e,(n,r)=>(Ore(this.node,r,"Start"),(i,{success:s})=>Ore(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const BN=new WeakMap,YP=new WeakMap,i_t=t=>{const e=BN.get(t.target);e&&e(t)},s_t=t=>{t.forEach(i_t)};function o_t({root:t,...e}){const n=t||document;YP.has(n)||YP.set(n,{});const r=YP.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(s_t,{root:t,...e})),r[i]}function a_t(t,e,n){const r=o_t(e);return BN.set(t,n),r.observe(t),()=>{BN.delete(t),r.unobserve(t)}}const c_t={some:0,all:1};class l_t extends $p{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:c_t[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=l?u:d;h&&h(c)};return a_t(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(u_t(e,n))&&this.startObserver()}unmount(){}}function u_t({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const d_t={inView:{Feature:l_t},tap:{Feature:r_t},focus:{Feature:n_t},hover:{Feature:t_t}},h_t={layout:{ProjectionNode:Xve,MeasureLayout:Hve}},f_t={...QEt,...d_t,...e_t,...h_t}
1075,yh=fEt(f_t,AEt),p_t="/xbubble/assets/native-installation-bg-BZgCzRJc.png",g_t="/xbubble/assets/rocket-CclqOr0p.png",Jve="https://pub-resource.dappos.com/configFile/dappos-config-native-app-interaction.json",m_t="https://apps.apple.com/app/id6772127388";function y_t(){const[t,e]=E.useState(!1),[n,r]=E.useState(null),[i,s]=E.useState(null),o=E.useCallback(()=>{},[]);E.useEffect(()=>{if(typeof window>"u")return;window.bubbleAi&&(e(!0),window.googleAuthCallback=o,window.setPlatformToAndroid=d=>{r(d)}),navigator.userAgent.toLowerCase().includes("bubbleapp/")&&e(!0)},[o]);const a=E.useCallback(()=>{var u;(u=window.bubbleAi)!=null&&u.googleLogin?window.bubbleAi.googleLogin():console.warn("[AndroidApp] googleLogin not available")},[]),c=E.useCallback(async()=>{var u;try{const d=await fetch(Jve,{cache:"no-store"});if(!d.ok)throw new Error(`HTTP ${d.status}`);const h=await d.json(),f=(u=h==null?void 0:h.bubble)==null?void 0:u.latestVersion;return f&&(s(f),console.info("[AndroidApp] Latest version:",f)),f}catch(d){return console.error("[AndroidApp] Failed to fetch latest version:",d),null}},[]),l=E.useCallback(()=>{i?window.open(`https://pub-resource.dappos.com/app/android/production/bubble-v${i}.apk`,"_blank"):console.warn("No latestAndroidVersion")},[i]);return{isAndroidApp:t,appVersion:n,latestAndroidVersion:i,triggerGoogleLogin:a,openAndroidDownLoadLink:l,fetchLatestVersion:c}}const ebe=E.createContext(null),w_t=({children:t})=>{const e=y_t();return p.jsx(ebe.Provider,{value:e,children:t})},tbe=()=>{const t=E.useContext(ebe);if(!t)throw new Error("â useAndroidAppContext must be used within AndroidAppProvider");return t};function v_t(){const{isAndroidApp:t,appVersion:e,latestAndroidVersion:n,openAndroidDownLoadLink:r,fetchLatestVersion:i}=tbe(),[s,o]=E.useState(!1);E.useEffect(()=>{i()},[]),E.useEffect(()=>{if(!t||!e||!n)return;((l,u)=>{const d=l.split(".").map(Number),h=u.split(".").map(Number);for(let f=0;f<Math.max(d.length,h.length);f++){const m=d[f]||0,y=h[f]||0;if(y>m)return!0;if(y<m)return!1}return!1})(e,n)&&o(!0)},[t,e,n]);const a=()=>{r()};return p.jsx(gx,{children:s&&p.jsxs(p.Fragment,{children:[p.jsx(yh.div,{className:"fixed inset-0 bg-black/40 z-[2000]",initial:{opacity:0}
1075,animate:{opacity:1},exit:{opacity:0}}),p.jsx(yh.div,{className:"fixed bottom-0 left-0 right-0 z-[2001] flex justify-center items-end",initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",stiffness:260,damping:25},children:p.jsxs("div",{className:"bg-white w-full max-w-full h-[400px] rounded-t-2xl overflow-hidden relative",children:[p.jsx("img",{src:p_t,alt:"bg",className:"absolute inset-0 w-full h-full object-cover pointer-events-none"}),p.jsxs("div",{className:"flex flex-col items-center justify-center mt-14 relative z-10",children:[p.jsx("img",{src:g_t,alt:"rocket",className:"w-[100px] h-[100px]"}),p.jsx("div",{className:"mt-6 text-[24px] font-bold text-[#1D1C1B]",children:"Discover the new version"}),p.jsxs("div",{className:"mt-2 text-[12px] text-[#646362]",children:["V",n]}),p.jsx("div",{className:"mt-8 w-[270px] h-[48px] flex items-center justify-center rounded-md text-white font-semibold cursor-pointer",style:{backgroundImage:"linear-gradient(#02cb9b, #02c251)"},onClick:a,children:"Upgrade Now"})]})]})})]})})}const b_t="https://upload-api.dappos.com/dapposdata/proxy/download";function x_t(t){return!!(t&&typeof t=="object")}function C2(t){return t?typeof t=="string"?t:t.url??"":""}function sMt(t,e="download"){var s;if(!t)return e;if(typeof t=="object"){const o=t.title||t.name||t.filename||((s=t.fileInfo)==null?void 0:s.name);if(o)return o}const r=C2(t).split(/[?#]/,1)[0]??"";return decodeURIComponent(r.split("/").filter(Boolean).pop()??"")||e}function E_t(t){return t&&typeof t=="object"?t.mime_type??"":""}function nbe(t){return x_t(t)?(t.kind??t.type??"").toLowerCase().replace(/^\./,""):""}const C_t=["site","website","webapp","frontend_site","classroom","link","url","external_link","external-url"];function jre(t){return C_t.includes(nbe(t))}function jU(t){if(!t)return"";if(typeof t=="object"&&t.artifact_id)return t.artifact_id;const e=C2(t),n=e.match(/^dappos-artifact:\/\/([^/?#]+)/i);if(n!=null&&n[1])return n[1];try{const i=(e.startsWith("http")?new URL(e):new URL(e,"https://artifact.local")).pathname.split("/").filter(Boolean),s=i.indexOf("artifacts");if(s>=0&&i[s+1])return i[s+1]}catch{return""}return""}function oMt(t){var i;const e=t&&typeof t=="object"?[(i=t.fileInfo)==null?void 0:i.name,t.filename,C2(t).split(/[?#]/,1)[0],t.name,t.title]:[C2(t).split(/[?#]/,1)[0]];for(const s of e){const o=__t(s);if(o)return o}const n=E_t(t).toLowerCase();if(n==="application/pdf")return"pdf";if(n==="application/vnd.ms-powerpoint"||n==="application/vnd.openxmlformats-officedocument.presentationml.presentation")return"pptx";if(n==="text/csv")return"csv";if(n==="application/json")return"json";if(n==="text/markdown")return"md";if(n==="text/plain")return"txt";if(n.startsWith("image/")||n.startsWith("video/")||n.startsWith("audio/"))return n.slice(6);const r=nbe(t);return r==="presentation"?"pptx":r?r.replace(/^\./,""):""}function __t(t){if(!t)return"";const e=t.split(/[?#]/,1)[0]??"",n=e.split("/").filter(Boolean).pop()??e,r=n.lastIndexOf(".");return r<=0||r===n.length-1?"":n.slice(r+1).toLowerCase()}function S_t(t){const e=t.lastIndexOf("/"),n=t.lastIndexOf(".");return n<=e+1?t:t.slice(0,n)}function aMt(t,e){const n=new URL(b_t);n.searchParams.set("url",t);const r=e==null?void 0:e.trim();return r&&n.searchParams.set("title",S_t(r)),n.toString()}async function rbe(t){const e=jU(t),n=C2(t);if(!e)return n;const r=ia.getAuthHeader();if(!r)throw new Error("Missing authentication for artifact access");const i=Jo().replace(/\/$/,""),s=await fetch(`${i}/artifacts/${encodeURIComponent(e)}/resolve`,{method:"POST",headers:{Authorization:r,"Content-Type":"application/json"},body:"{}"});
1075if(!s.ok)throw new Error(`Artifact resolve failed: ${s.status}`);const o=await s.json();if(!o.url)throw new Error("Artifact resolve response missing url");return o.url}async function cMt(t,e,n={}){if(!jU(t))return null;const i=await rbe(t),s=await fetch(i);if(!s.ok)throw new Error(`Artifact download failed: ${s.status}`);const o=await s.blob();if(n.triggerBrowserDownload===!1)return o;const a=URL.createObjectURL(o);try{const c=document.createElement("a");c.href=a,c.download=e,document.body.appendChild(c),c.click(),document.body.removeChild(c)}finally{window.setTimeout(()=>URL.revokeObjectURL(a),3e4)}return o}function ibe(t,e){const[n,r]=E.useState(null),i=E.useRef(void 0),{mediaKey:s,isIncognito:o}=Ah(),a=C2(t),c=jU(t);return E.useEffect(()=>{let l=!0;async function u(){try{const d=c?await rbe(t):a,h=(d==null?void 0:d.startsWith("blob:"))||(d==null?void 0:d.startsWith("data:"));if(o&&s&&d&&!h){const{url:f,revoke:m}=await c2t(d,s,o,e);l&&(r(f),i.current=m)}else l&&r(d)}catch(d){console.error("resolveMediaError:",d),l&&r(c?null:a)}}return u(),()=>{var d;l=!1,(d=i.current)==null||d.call(i)}},[t,a,c,s,o,e]),n}function A_t({children:t,container:e}){return xc.createPortal(t,e??document.body)}function k_t(){const[t,e]=E.useState(!1);return E.useEffect(()=>{e(!0)},[]),t}function sbe(t){const e=k_t();function n(){t.onClose()}return e?p.jsx(A_t,{container:document.body,children:p.jsx(gx,{children:t.isOpen&&p.jsx("div",{className:Xn("fixed top-0 left-0 w-full h-full z-[900]"),children:p.jsxs(yh.div,{initial:{opacity:0}
1075,animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},className:"flex absolute inset-0 flex-col justify-end items-center w-full h-full md:justify-center md:py-2 md:pr-2",children:[p.jsx("div",{className:"absolute inset-0",onClick:()=>{n()},onMouseDown:r=>{n(),r.stopPropagation()},children:p.jsx(yh.div,{initial:{opacity:0,y:0,x:0},animate:{opacity:100,y:0,x:0},exit:{opacity:0,y:0,x:0},transition:{duration:.3},className:"w-full h-full bg-black/50"},"account-drawer-mobile")}),t.children]},"account-drawer")})})}):null}function $_t(){const{imagePreviewDialog:t,setImagePreviewDialog:e}=Ah(),n=ibe(t.image),[r,i]=E.useState(!0),[s,o]=E.useState(null),a=()=>{e({isOpen:!1,image:void 0})};E.useEffect(()=>{i(!0),o(null)},[t.image]),E.useEffect(()=>{const l=u=>{u.key==="Escape"&&a()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const c=l=>{const u=l.currentTarget;o({width:u.naturalWidth,height:u.naturalHeight}),i(!1)};return p.jsx(p.Fragment,{children:p.jsxs(sbe,{isOpen:t.isOpen,onClose:a,children:[p.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-white",children:p.jsxs("div",{className:"relative flex items-center justify-center w-full h-full p-4",children:[r&&p.jsxs("div",{className:"absolute inset-4 rounded-[16px]",children:[p.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(135deg, #E1E4E8 0%, #ECEEEF 45%, #F5F6F6 50%, #ECEEEF 55%, #E1E4E8 100%)",backgroundSize:"200% 200%",borderRadius:"16px",animation:"shimmer 3s linear infinite"}}),p.jsx("style",{jsx:!0,children:` 1076 @keyframes shimmer { 1077 0% { 1078 background-position: 100% 100%; 1079 } 1080 100% { 1081 background-position: 0 0; 1082 } 1083 } 1084 `})]}),n?p.jsx("img",{src:n,alt:"preview",loading:"lazy",onLoad:c,className:Xn("max-w-full max-h-full rounded-[16px] object-contain transition-opacity",r?"opacity-0":"opacity-100")}):null]})}),p.jsx("button",{onClick:a,className:`fixed top-6 right-6 z-[9999] 1085 flex h-8 w-8 items-center justify-center 1086 rounded-[8px] bg-black/40 text-white 1087 backdrop-blur-sm hover:bg-black/60 transition`,"aria-label":"Close",children:p.jsx(TS,{className:"h-4 w-4"})})]})})}const I_t="--app-keyboard-inset-bottom",T_t="--app-composer-safe-area-bottom";function P_t(){if(!Ur()||oa()!=="ios")return;const t=document.documentElement,e=()=>{t.style.setProperty(I_t,"0px"),t.style.removeProperty(T_t)};e(),window.setTimeout(e,120),window.setTimeout(e,320)}function R_t(){const{videoPreviewDialog:t,setVideoPreviewDialog:e}=Ah(),n=ibe(t.video,"video/mp4"),[r,i]=E.useState(!0),s=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur(),document.querySelectorAll("video").forEach(o=>{o.pause()}),P_t(),e({isOpen:!1,video:void 0})};return E.useEffect(()=>{i(!0)},[t.video]),E.useEffect(()=>{const o=a=>{a.key==="Escape"&&s()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[]),p.jsxs(sbe,{isOpen:t.isOpen,onClose:s,children:[p.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-white",children:p.jsxs("div",{className:"relative flex items-center justify-center w-full h-full p-4",children:[r&&p.jsxs("div",{className:"absolute inset-4 rounded-[16px]",children:[p.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(135deg, #E1E4E8 0%, #ECEEEF 45%, #F5F6F6 50%, #ECEEEF 55%, #E1E4E8 100%)",backgroundSize:"200% 200%",borderRadius:"16px",animation:"shimmer 3s linear infinite"}}),p.jsx("style",{jsx:!0,children:` 1088 @keyframes shimmer { 1089 0% { 1090 background-position: 100% 100%; 1091 } 1092 100% { 1093 background-position: 0 0; 1094 } 1095 `})]}),p.jsx("video",{src:n||"",controls:!0,preload:"metadata",onLoadedData:()=>i(!1),className:Xn("max-w-full max-h-full rounded-[16px] bg-black object-contain transition-opacity",r?"opacity-0":"opacity-100")})]})}),p.jsx("button",{onClick:s,className:`fixed top-6 right-6 z-[9999] 1096 flex h-8 w-8 items-center justify-center 1097 rounded-[8px] bg-black/40 text-white 1098 backdrop-blur-sm hover:bg-black/60 transition`,"aria-label":"Close",children:p.jsx(TS,{className:"h-4 w-4"})})]})}const Nre="xbubble:ios-update-dismissed:",Dre={en:{close:"Close",title:"New version available",forceTitle:"Update required",description:"Update xBubble to get the latest fixes and improvements.",forceDescription:"This version is no longer supported. Please update to continue using xBubble.",currentVersion:"Current version",latestVersion:"Latest version",updateNow:"Update now",later:"Later"},zh:{close:"å ³é",title:"åç°æ°çæ¬",forceTitle:"éè¦æ´æ°",description:"æ´æ° xBubble 以è·å¾ææ°ä¿®å¤åä½éªä¼åã",forceDescription:"å½åçæ¬å·²ä¸åæ¯æï¼è¯·æ´æ°åç»§ç»ä½¿ç¨ xBubbleã",currentVersion:"å½åçæ¬",latestVersion:"ææ°çæ¬",updateNow:"ç«å³æ´æ°",later:"ç¨åå说"}};function W6(t){return typeof t=="string"&&t.trim()?t:void 0}function Lre(t){return typeof t=="boolean"?t:void 0}function Bre(t,e){const n=t.split(".").map(s=>Number.parseInt(s,10)||0),r=e.split(".").map(s=>Number.parseInt(s,10)||0),i=Math.max(n.length,r.length);for(let s=0;s<i;
1098s+=1){const o=n[s]??0,a=r[s]??0;if(o<a)return-1;if(o>a)return 1}return 0}function M_t(t){if(!t||typeof t!="object")return null;const e=t,n=e.bubble&&typeof e.bubble=="object"?e.bubble:{},r="ios"in n&&n.ios&&typeof n.ios=="object"?n.ios:e.ios&&typeof e.ios=="object"?e.ios:{},i=n,s=r;return{enabled:Lre(s.enabled),latestVersion:W6(s.latestVersion??i.latestIosVersion??i.iosLatestVersion),minSupportedVersion:W6(s.minSupportedVersion??i.minSupportedIosVersion??i.iosMinSupportedVersion),forceUpdate:Lre(s.forceUpdate??i.forceIosUpdate??i.iosForceUpdate),storeUrl:W6(s.storeUrl??i.iosStoreUrl),releaseNotes:W6(s.releaseNotes??i.iosReleaseNotes)}}function O_t(){const[t,e]=E.useState(null),n=typeof navigator<"u"&&navigator.language.toLowerCase().startsWith("zh")?Dre.zh:Dre.en;E.useEffect(()=>{let o=!1;async function a(){const c=await s6e();if(!(!c.isNative||c.platform!=="ios"||!c.shellVersion))try{const l=await fetch(Jve,{cache:"no-store"});if(!l.ok)return;const u=await l.json(),d=M_t(u);if(!d||d.enabled===!1)return;const h=c.shellVersion,f=d.latestVersion,m=d.minSupportedVersion,y=typeof m=="string"&&Bre(h,m)<0,v=typeof f=="string"&&Bre(h,f)<0;if(!y&&!v)return;const b=f||m;if(!b)return;const C=!!d.forceUpdate||y,x=`${Nre}${b}`;if(!C&&window.localStorage.getItem(x)==="1")return;o||e({currentVersion:h,latestVersion:b,forceUpdate:C,storeUrl:d.storeUrl||m_t,releaseNotes:d.releaseNotes})}catch(l){console.warn("[iOS Update] Failed to check update:",l)}}return a(),()=>{o=!0}},[]);const r=E.useMemo(()=>t?`${Nre}${t.latestVersion}`:"",[t]),i=()=>{!t||t.forceUpdate||(window.localStorage.setItem(r,"1"),e(null))},s=async()=>{t&&await o6e(t.storeUrl)};return p.jsx(gx,{children:t&&p.jsxs("div",{className:"fixed inset-0 z-[3100] flex items-center justify-center px-5",children:[p.jsx(yh.div,{className:"absolute inset-0 bg-black/45 backdrop-blur-sm",initial:{opacity:0}
1098,animate:{opacity:1},exit:{opacity:0}}),p.jsxs(yh.div,{className:"relative w-full max-w-[335px] overflow-hidden rounded-[24px] bg-white shadow-2xl",initial:{opacity:0,y:24,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.98},transition:{type:"spring",stiffness:320,damping:28},children:[!t.forceUpdate&&p.jsx("button",{type:"button","aria-label":n.close,onClick:i,className:"absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-[#F4F5F2] text-[#646362] active:opacity-70",children:p.jsx(TS,{className:"h-4 w-4"})}),p.jsxs("div",{className:"px-6 pb-6 pt-8 text-center",children:[p.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-[18px] bg-[#E8FFF1] text-[#2aae67]",children:p.jsx(I8t,{className:"h-8 w-8"})}),p.jsx("h2",{className:"mt-5 text-[20px] font-semibold leading-7 text-[#1D1C1B]",children:t.forceUpdate?n.forceTitle:n.title}),p.jsx("p",{className:"mt-2 text-[13px] leading-5 text-[#646362]",children:t.forceUpdate?n.forceDescription:n.description}),p.jsxs("div",{className:"mt-5 rounded-[14px] bg-[#F6F8F3] px-4 py-3 text-left",children:[p.jsxs("div",{className:"flex items-center justify-between text-[13px]",children:[p.jsx("span",{className:"text-[#858481]",children:n.currentVersion}),p.jsxs("span",{className:"font-medium text-[#34322d]",children:["V",t.currentVersion]})]}),p.jsxs("div",{className:"mt-2 flex items-center justify-between text-[13px]",children:[p.jsx("span",{className:"text-[#858481]",children:n.latestVersion}),p.jsxs("span",{className:"font-medium text-[#2aae67]",children:["V",t.latestVersion]})]})]}),t.releaseNotes&&p.jsx("p",{className:"mt-4 text-left text-[13px] leading-5 text-[#646362]",children:t.releaseNotes}),p.jsx("button",{type:"button",onClick:s,className:"mt-6 flex h-12 w-full items-center justify-center rounded-[12px] bg-[#2aae67] text-[16px] font-semibold text-white active:opacity-80",children:n.updateNow}),!t.forceUpdate&&p.jsx("button",{type:"button",onClick:i,className:"mt-3 h-10 w-full text-[14px] font-medium text-[#858481] active:opacity-70",children:n.later})]})]})]})})}const obe=768,j_t="DAPPOS_VIEWPORT_WIDTH";function N_t(t){return t<obe}function D_t(){return Ur()&&oa()==="ios"}function Fre(){return D_t()||N_t(window.innerWidth)}function jS(){const[t,e]=E.useState(()=>typeof window>"u"?void 0:Fre());return E.useEffect(()=>{const n=window.matchMedia(`(max-width: ${obe-1}px)`),r=()=>{document.cookie=`${j_t}=${window.innerWidth}; path=/; max-age=31536000; SameSite=Lax`,e(Fre())};return n.addEventListener("change",r),r(),()=>n.removeEventListener("change",r)},[]),!!t}const L_t=(t,e)=>p.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M4.66406 4.66797H11.3307V11.3346",stroke:"#2AAE67",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M4.66406 11.3346L11.3307 4.66797",stroke:"#2AAE67",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})]}),B_t=E.forwardRef(L_t);function F_t(){const[t,e]=E.useState(!1),n=jS(),{isAndroidApp:r}=tbe(),[i,s]=E.useState(!1),o=E.useMemo(()=>typeof navigator>"u"?!1:/MicroMessenger/i.test(navigator.userAgent),[]);return E.useEffect(()=>{s(window==null?void 0:window.matchMedia("(display-mode: standalone)").matches)},[]),E.useEffect(()=>{if(z7()||!n||i||r||o){e(!1);return}e(!0);const c=setTimeout(()=>{e(!1)},1e4);return()=>clearTimeout(c)},[n,i,r,o]),{visible:t,close:()=>e(!1)}}function U_t(){const{visible:t,close:e}=F_t(),n=XF(),r=()=>{n.push("/download")};return p.jsx(gx,{children:t&&p.jsx("div",{className:"absolute top-[80px] left-1/2 -translate-x-1/2 z-50",children:p.jsx(yh.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:[0,-2,0],transition:{duration:.5,y:{repeat:1/0,repeatType:"mirror",duration:1.5}}},exit:{opacity:0,y:-20,transition:{duration:.3,repeat:0}},children:p.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-black bg-white",style:{borderRadius:"20px",boxShadow:"0px 2px 9px 0px #524F4F3D",width:"320px"},children:[p.jsxs("span",{className:"text-xs text-[#2aae67] flex items-center select-none active:scale-95 transition-transform duration-150 cursor-pointer",onClick:r,children:[p.jsx("span",{children:"Open from Home Screen"}),p.jsx(B_t,{})]}),p.jsx("button",{onClick:e,className:"ml-4",title:"Close",children:p.jsx(TS,{size:16,className:"text-[#b0b4bb]"})})]})},"floating-hint")})})}function Ure(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function abe(...t){return e=>{let n=!1;const r=t.map(i=>{const s=Ure(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Ure(t[i],null)}}}}function cg(...t){return E.useCallback(abe(...t),t)}function cbe(t){const e=z_t(t),n=E.forwardRef((r,i)=>{const{children:s,...o}=r,a=E.Children.toArray(s),c=a.find(H_t);if(c){const l=c.props.children,u=a.map(d=>d===c?E.Children.count(l)>1?E.Children.only(null):E.isValidElement(l)?l.props.children:null:d);return p.jsx(e,{...o,ref:i,children:E.isValidElement(l)?E.cloneElement(l,void 0,u):null})}return p.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var aw=cbe("Slot");function z_t(t){const e=E.forwardRef((n,r)=>{const{children:i,...s}=n;
vendor: 3,073 bytes, line 1098
1098if(E.isValidElement(i)){const o=q_t(i),a=V_t(s,i.props);return i.type!==E.Fragment&&(a.ref=r?abe(r,o):o),E.cloneElement(i,a)}return E.Children.count(i)>1?E.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var lbe=Symbol("radix.slottable");function W_t(t){const e=({children:n})=>p.jsx(p.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=lbe,e}function H_t(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===lbe}function V_t(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function q_t(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const zre=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Wre=whe,ube=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Wre(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const h=zre(u)||zre(d);return i[l][h]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,h]=u;return h===void 0||(l[d]=h),l},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(m=>{let[y,v]=m;return Array.isArray(v)?v.includes({...s,...a}[y]):{...s,...a}[y]===v})?[...l,d,h]:l},[]);return Wre(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},K_t=ube("inline-flex items-center justify-center whitespace-nowrap rounded-[8px] text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-80",{variants:{variant:{default:"bg-customs text-primary-foreground hover:bg-customs/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),dbe=E.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},s)=>{const o=r?aw:"button";return p.jsx(o,{className:Xn(K_t({variant:e,size:n,className:t})),ref:s,...i})});dbe.displayName="Button";const hbe=E.forwardRef(({className:t,type:e,...n},r)=>p.jsx("input",{type:e,className:Xn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1098ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));hbe.displayName="Input";var G_t=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kh=G_t.reduce((t,e)=>{const n=cbe(`Primitive.${e}`),r=E.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Z_t(t,e){t&&xc.flushSync(()=>t.dispatchEvent(e))}var Y_t="Separator",Hre="horizontal",Q_t=["horizontal","vertical"],fbe=E.forwardRef((t,e)=>{const{decorative:n,orientation:r=Hre,...i}=t,s=X_t(r)?r:Hre,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return p.jsx(kh.div,{"data-orientation":s,...a,...i,ref:e})});fbe.displayName=Y_t;function X_t(t){return Q_t.includes(t)}var pbe=fbe;const gbe=E.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>p.jsx(pbe,{ref:i,decorative:n,orientation:e,className:Xn("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));gbe.displayName=pbe.displayName;function Vre({className:t,...e}){return p.jsx("div",{className:Xn("animate-pulse rounded-md bg-muted",t),...e})}function Ad(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function lMt(t,e){const n=E.createContext(e),r=s=>{const{children:o,...a}=s,c=E.useMemo(()=>a,Object.values(a));return p.jsx(n.Provider,{value:c,children:o})};r.displayName=t+"Provider";function i(s){const o=E.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function mbe(t,e=[]){let n=[];function r(s,o){const a=E.createContext(o),c=n.length;n=[...n,o];const l=d=>{var b;const{scope:h,children:f,...m}=d,y=((b=h==null?void 0:h[t])==null?void 0:b[c])||a,v=E.useMemo(()=>m,Object.values(m));return p.jsx(y.Provider,{value:v,children:f})};l.displayName=s+"Provider";function u(d,h){var y;const f=((y=h==null?void 0:h[t])==null?void 0:y[c])||a,m=E.useContext(f);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const i=()=>{const s=n.map(o=>E.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return E.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[r,J_t(i,...e)]}function J_t(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return E.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function NS(t){const e=E.useRef(t);return E.useEffect(()=>{e.current=t}),E.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function eSt(t,e=globalThis==null?void 0:globalThis.document){const n=NS(t);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var tSt="DismissableLayer",FN="dismissableLayer.update",nSt="dismissableLayer.pointerDownOutside",rSt="dismissableLayer.focusOutside",qre,ybe=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),NU=E.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=E.useContext(ybe),[u,d]=E.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=E.useState({}),m=cg(e,R=>d(R)),y=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),C=u?y.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,_=C>=b,$=sSt(R=>{const N=R.target,T=[...l.branches].some(O=>O.contains(N));!_||T||(i==null||i(R),o==null||o(R),R.defaultPrevented||a==null||a())},h),I=oSt(R=>{const N=R.target;[...l.branches].some(O=>O.contains(N))||(s==null||s(R),o==null||o(R),R.defaultPrevented||a==null||a())},h);return eSt(R=>{C===l.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),E.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(qre=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Kre(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=qre)}},[u,h,n,l]),E.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Kre())},[u,l]),E.useEffect(()=>{const R=()=>f({});return document.addEventListener(FN,R),()=>document.removeEventListener(FN,R)},[]),p.jsx(kh.div,{...c,ref:m,style:{pointerEvents:x?_?"auto":"none":void 0,...t.style},onFocusCapture:Ad(t.onFocusCapture,I.onFocusCapture),onBlurCapture:Ad(t.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Ad(t.onPointerDownCapture,$.onPointerDownCapture)})});NU.displayName=tSt;var iSt="DismissableLayerBranch",wbe=E.forwardRef((t,e)=>{const n=E.useContext(ybe),r=E.useRef(null),i=cg(e,r);return E.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(kh.div,{...t,ref:i})});wbe.displayName=iSt;function sSt(t,e=globalThis==null?void 0:globalThis.document){const n=NS(t),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const s=a=>
vendor: 5,023 bytes, line 1098
1098{if(a.target&&!r.current){let c=function(){vbe(nSt,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function oSt(t,e=globalThis==null?void 0:globalThis.document){const n=NS(t),r=E.useRef(!1);return E.useEffect(()=>{const i=s=>{s.target&&!r.current&&vbe(rSt,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kre(){const t=new CustomEvent(FN);document.dispatchEvent(t)}function vbe(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?Z_t(i,s):i.dispatchEvent(s)}var uMt=NU,dMt=wbe,gp=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},aSt=GE[" useId ".trim().toString()]||(()=>{}),cSt=0;function lSt(t){const[e,n]=E.useState(aSt());return gp(()=>{n(r=>r??String(cSt++))},[t]),e?`radix-${e}`:""}var uSt="Arrow",bbe=E.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return p.jsx(kh.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});bbe.displayName=uSt;var dSt=bbe;function hSt(t){const[e,n]=E.useState(void 0);return gp(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var DU="Popper",[xbe,Ebe]=mbe(DU),[fSt,Cbe]=xbe(DU),_be=t=>{const{__scopePopper:e,children:n}=t,[r,i]=E.useState(null);return p.jsx(fSt,{scope:e,anchor:r,onAnchorChange:i,children:n})};_be.displayName=DU;var Sbe="PopperAnchor",Abe=E.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=Cbe(Sbe,n),o=E.useRef(null),a=cg(e,o);return E.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:p.jsx(kh.div,{...i,ref:a})});Abe.displayName=Sbe;var LU="PopperContent",[pSt,gSt]=xbe(LU),kbe=E.forwardRef((t,e)=>{var ae,oe,de,ke,Be,$e;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:m,...y}=t,v=Cbe(LU,n),[b,C]=E.useState(null),x=cg(e,He=>C(He)),[_,$]=E.useState(null),I=hSt(_),R=(I==null?void 0:I.width)??0,N=(I==null?void 0:I.height)??0,T=r+(s!=="center"?"-"+s:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},U=Array.isArray(l)?l:[l],z=U.length>0,L={padding:O,boundary:U.filter(ySt),altBoundary:z},{refs:S,floatingStyles:k,placement:M,isPositioned:W,middlewareData:H}=ffe({strategy:"fixed",placement:T,whileElementsMounted:(...He)=>dfe(...He,{animationFrame:f==="always"}),elements:{reference:v.anchor},middleware:[iB({mainAxis:i+N,alignmentAxis:o}),c&&pfe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Int():void 0,...L}),c&&gfe({...L}),mfe({...L,apply:({elements:He,rects:Ge,availableWidth:je,availableHeight:xt})=>{const{width:ft,height:it}=Ge.reference,be=He.floating.style;be.setProperty("--radix-popper-available-width",`${je}px`),be.setProperty("--radix-popper-available-height",`${xt}px`),be.setProperty("--radix-popper-anchor-width",`${ft}px`),be.setProperty("--radix-popper-anchor-height",`${it}px`)}}),_&&Pnt({element:_,padding:a}),wSt({arrowWidth:R,arrowHeight:N}),h&&Tnt({strategy:"referenceHidden",...L})]}),[D,V]=Tbe(M),B=NS(m);gp(()=>{W&&(B==null||B())},[W,B]);const P=(ae=H.arrow)==null?void 0:ae.x,j=(oe=H.arrow)==null?void 0:oe.y,G=((de=H.arrow)==null?void 0:de.centerOffset)!==0,[Y,te]=E.useState();return gp(()=>{b&&te(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:W?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(ke=H.transformOrigin)==null?void 0:ke.x,(Be=H.transformOrigin)==null?void 0:Be.y].join(" "),...(($e=H.hide)==null?void 0:$e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:p.jsx(pSt,{scope:n,placedSide:D,onArrowChange:$,arrowX:P,arrowY:j,shouldHideArrow:G,children:p.jsx(kh.div,{"data-side":D,"data-align":V,...y,ref:x,style:{...y.style,animation:W?void 0:"none"}})})})});kbe.displayName=LU;var $be="PopperArrow",mSt={top:"bottom",right:"left",bottom:"top",left:"r
1098ight"},Ibe=E.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=gSt($be,r),o=mSt[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(dSt,{...i,ref:n,style:{...i.style,display:"block"}})})});Ibe.displayName=$be;function ySt(t){return t!==null}var wSt=t=>({name:"transformOrigin",options:t,fn(e){var v,b,C;const{placement:n,rects:r,middlewareData:i}=e,o=((v=i.arrow)==null?void 0:v.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[l,u]=Tbe(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(((b=i.arrow)==null?void 0:b.x)??0)+a/2,f=(((C=i.arrow)==null?void 0:C.y)??0)+c/2;let m="",y="";return l==="bottom"?(m=o?d:`${h}px`,y=`${-c}px`):l==="top"?(m=o?d:`${h}px`,y=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,y=o?d:`${f}px`):l==="left"&&(m=`${r.floating.width+c}px`,y=o?d:`${f}px`),{data:{x:m,y}}}});function Tbe(t){const[e,n="center"]=t.split("-");return[e,n]}var vSt=_be,bSt=Abe,xSt=kbe,ESt=Ibe,CSt="Portal",Pbe=E.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=E.useState(!1);gp(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?t4e.createPortal(p.jsx(kh.div,{...r,ref:e}),o):null});Pbe.displayName=CSt;function _St(t,e){return E.useReducer((n,r)=>e[n][r]??n,t)}var BU=t=>{const{present:e,children:n}=t,r=SSt(e),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),s=cg(r.ref,ASt(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:s}):null};BU.displayName="Presence";function SSt(t){const[e,n]=E.useState(),r=E.useRef(null),i=E.useRef(t),s=E.useRef("none"),o=t?"mounted":"unmounted",[a,c]=_St(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const l=H6(r.current);s.current=a==="mounted"?l:"none"},[a]),gp(()=>{const l=r.current,u=i.current;if(u!==t){const h=s.current,f=H6(l);t?c("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),gp(()=>{if(e){let l;const u=e.ownerDocument.defaultView??window,d=f=>{const y=H6(r.current).includes(f.animationName);if(f.target===e&&y&&(c("ANIMATION_END"),!i.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",l=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},h=f=>{f.target===e&&(s.current=H6(r.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(l),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function H6(t){return(t==null?void 0:t.animationName)||"none"}function ASt(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var kSt=GE[" useInsertionEffect ".trim().toString()]||gp;function $St({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,o]=ISt({defaultProp:e,onChange:n}),a=t!==void 0,c=a?t:i;{const u=E.useRef(t!==void 0);E.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=E.useCallback(u=>{var d;if(a){const h=TSt(u)?u(t):u;h!==t&&((d=o.current)==null||d.call(o,h))}else s(u)},[a,t,s,o]);return[c,l]}function ISt({defaultProp:t,onChange:e}){const[n,r]=E.useState(t),i=E.useRef(n),s=E.useRef(e);return kSt(()=>{s.current=e},[e]),E.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function TSt(t){return typeof t=="function"}var PSt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),RSt="VisuallyHidden",Rbe=E.forwardRef((t,e)=>p.jsx(kh.span,{...t,ref:e,style:{...PSt,...t.style}}));Rbe.displayName=RSt;var MSt=Rbe,[DS,hMt]=mbe("Tooltip",[Ebe]),LS=Ebe(),Mbe="TooltipProvider",OSt=700,UN="tooltip.open",[jSt,FU]=DS(Mbe),Obe=t=>{const{__scopeTooltip:e,delayDuration:n=OSt,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,o=E.useRef(!0),a=E.useRef(!1),c=E.useRef(0);return E.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),p.jsx(jSt,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 7,055 bytes, line 1098
1098o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:E.useCallback(l=>{a.current=l},[]),disableHoverableContent:i,children:s})};Obe.displayName=Mbe;var M3="Tooltip",[NSt,yx]=DS(M3),jbe=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,c=FU(M3,t.__scopeTooltip),l=LS(e),[u,d]=E.useState(null),h=lSt(),f=E.useRef(0),m=o??c.disableHoverableContent,y=a??c.delayDuration,v=E.useRef(!1),[b,C]=$St({prop:r,defaultProp:i??!1,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(UN))):c.onClose(),s==null||s(R)},caller:M3}),x=E.useMemo(()=>b?v.current?"delayed-open":"instant-open":"closed",[b]),_=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v.current=!1,C(!0)},[C]),$=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,C(!1)},[C]),I=E.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{v.current=!0,C(!0),f.current=0},y)},[y,C]);return E.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),p.jsx(vSt,{...l,children:p.jsx(NSt,{scope:e,contentId:h,open:b,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:E.useCallback(()=>{c.isOpenDelayedRef.current?I():_()},[c.isOpenDelayedRef,I,_]),onTriggerLeave:E.useCallback(()=>{m?$():(window.clearTimeout(f.current),f.current=0)},[$,m]),onOpen:_,onClose:$,disableHoverableContent:m,children:n})})};jbe.displayName=M3;var zN="TooltipTrigger",Nbe=E.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=yx(zN,n),s=FU(zN,n),o=LS(n),a=E.useRef(null),c=cg(e,a,i.onTriggerChange),l=E.useRef(!1),u=E.useRef(!1),d=E.useCallback(()=>l.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),p.jsx(bSt,{asChild:!0,...o,children:p.jsx(kh.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:Ad(t.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ad(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Ad(t.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ad(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:Ad(t.onBlur,i.onClose),onClick:Ad(t.onClick,i.onClose)})})});Nbe.displayName=zN;var UU="TooltipPortal",[DSt,LSt]=DS(UU,{forceMount:void 0}),Dbe=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,s=yx(UU,e);return p.jsx(DSt,{scope:e,forceMount:n,children:p.jsx(BU,{present:n||s.open,children:p.jsx(Pbe,{asChild:!0,container:i,children:r})})})};Dbe.displayName=UU;var _2="TooltipContent",Lbe=E.forwardRef((t,e)=>{const n=LSt(_2,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=yx(_2,t.__scopeTooltip);return p.jsx(BU,{present:r||o.open,children:o.disableHoverableContent?p.jsx(Bbe,{side:i,...s,ref:e}):p.jsx(BSt,{side:i,...s,ref:e})})}),BSt=E.forwardRef((t,e)=>{const n=yx(_2,t.__scopeTooltip),r=FU(_2,t.__scopeTooltip),i=E.useRef(null),s=cg(e,i),[o,a]=E.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,h=E.useCallback(()=>{a(null),d(!1)},[d]),f=E.useCallback((m,y)=>{const v=m.currentTarget,b={x:m.clientX,y:m.clientY},C=WSt(b,v.getBoundingClientRect()),x=HSt(b,C),_=VSt(y.getBoundingClientRect()),$=KSt([...x,..._]);a($),d(!0)},[d]);return E.useEffect(()=>()=>h(),[h]),E.useEffect(()=>{if(c&&u){const m=v=>f(v,u),y=v=>f(v,c);return c.addEventListener("pointerleave",m),u.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",y)}}},[c,u,f,h]),E.useEffect(()=>{if(o){const m=y=>{const v=y.target,b={x:y.clientX,y:y.clientY},C=(c==null?void 0:c.contains(v))||(u==null?void 0:u.contains(v)),x=!qSt(b,o);C?h():x&&(h(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,u,o,l,h]),p.jsx(Bbe,{...t,ref:s})}),[FSt,USt]=DS(M3,{isInside:!1}),zSt=W_t("TooltipContent"),Bbe=E.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,c=yx(_2,n),l=LS(n),{onClose:u}=c;return E.useEffect(()=>(document.addEventListener(UN,u),()=>document.removeEventListener(UN,u)),[u]),E.useEffect(()=>{if(c.trigger){const d=h=>{const f=h.target;f!=null&&f.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),p.jsx(NU,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:p.jsxs(xSt,{"data-state":c.stateAttribute,...l,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(zSt,{children:r}),p.jsx(FSt,{scope:n,isInside:!0,children:p.jsx(MSt,{id:c.contentId,role:"tooltip",children:i||r})})]})})});Lbe.displayName=_2;var Fbe="TooltipArrow",Ube=E.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=LS(n);return USt(Fbe,n).isInside?null:p.jsx(ESt,{...i,...r,ref:e})});Ube.displayName=Fbe;function WSt(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function HSt(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function VSt(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function qSt(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],c=e[o],l=a.x,u=a.y,d=c.x,h=c.y;u>r!=h>r&&n<(d-l)*(r-u)/(h-u)+l&&(i=!i)}return i}function KSt(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),GSt(e)}function GSt(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var ZSt=Obe,YSt=jbe,QSt=Nbe,XSt=Dbe,zbe=Lbe,fMt=Ube;const JSt=ZSt,eAt=YSt,tAt=QSt,Wbe=E.forwardRef(({className:t,sideOffset:e=4,...n},r)=>
1098p.jsx(XSt,{children:p.jsx(zbe,{ref:r,sideOffset:e,className:Xn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Wbe.displayName=zbe.displayName;const nAt=ase.SIDEBAR_STATE,rAt=3600*24*7,iAt="300px",sAt="100%",oAt="3.125rem",aAt="b";let QP=null;const Hbe=E.createContext(null);function wx(){const t=E.useContext(Hbe);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Vbe=E.forwardRef(({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:i,children:s,...o},a)=>{const c=jS(),[l,u]=E.useState(()=>QP??!1),d=E.useCallback(x=>{u(_=>{const $=typeof x=="function"?x(_):x;return QP=$,$})},[]),[h,f]=E.useState(t),m=e??h,y=E.useCallback(x=>{const _=typeof x=="function"?x(m):x;n?n(_):f(_),document.cookie=`${nAt}=${_}; path=/; max-age=${rAt}`},[n,m]),v=E.useCallback(()=>c?d(x=>!x):y(x=>!x),[c,y,d]);E.useEffect(()=>{QP=l},[l]),E.useEffect(()=>{const x=_=>{_.key===aAt&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),v())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[v]);const b=m||c?"expanded":"collapsed",C=E.useMemo(()=>({state:b,open:m,setOpen:y,isMobile:c,openMobile:l,setOpenMobile:d,toggleSidebar:v}),[b,m,y,c,l,d,v]);return p.jsx(Hbe.Provider,{value:C,children:p.jsx(JSt,{delayDuration:0,children:p.jsx("div",{style:{"--sidebar-width":iAt,"--sidebar-width-icon":oAt,...i},className:Xn("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:a,...o,children:s})})})});Vbe.displayName="SidebarProvider";const cAt=E.forwardRef(({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:i,...s},o)=>{const{isMobile:a,state:c,openMobile:l,setOpenMobile:u}=wx();return n==="none"?p.jsx("div",{className:Xn("flex flex-col h-full w-[--sidebar-width] bg-sidebar text-sidebar-foreground",r),ref:o,...s,children:i}):a?p.jsx(gx,{children:l&&p.jsxs("div",{className:"fixed inset-0 z-50",children:[p.jsx(yh.div,{initial:{opacity:0}
1098,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:"easeInOut"},className:"absolute inset-0 bg-black/30",onClick:()=>u(!1)}),p.jsx(yh.div,{initial:{x:t==="left"?"-100%":"100%"},animate:{x:0},exit:{x:t==="left"?"-100%":"100%"},transition:{duration:.3,ease:"easeInOut"},className:Xn("absolute top-0 bottom-0 w-[--sidebar-width] bg-[#f8f8f7] text-sidebar-foreground flex flex-col",t==="left"?"left-0":"right-0",r),style:{"--sidebar-width":sAt,paddingTop:"var(--app-safe-area-top)",paddingBottom:"env(safe-area-inset-bottom, 0px)"},onClick:d=>d.stopPropagation(),children:p.jsx("div",{className:"overflow-hidden flex-1",children:i})})]})}):p.jsxs("div",{ref:o,className:"hidden group peer text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":e,"data-side":t,children:[p.jsx("div",{className:Xn("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),p.jsx("div",{className:Xn("fixed inset-y-0 z-20 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:p.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});cAt.displayName="Sidebar";const lAt=E.forwardRef(({className:t,onClick:e,...n},r)=>{const{toggleSidebar:i}=wx();return p.jsxs(dbe,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Xn("w-7 h-7",t),onClick:s=>{e==null||e(s),i()},...n,children:[p.jsx(P8t,{}),p.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});lAt.displayName="SidebarTrigger";const uAt=E.forwardRef(({className:t,...e},n)=>{const{toggleSidebar:r}=wx();return p.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Xn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})});uAt.displayName="SidebarRail";const dAt=E.forwardRef(({className:t,...e},n)=>p.jsx("main",{ref:n,className:Xn("flex relative flex-col flex-1 w-full bg-background","md:ml-[var(--sidebar-width-icon)]",t),...e}));dAt.displayName="SidebarInset";const hAt=E.forwardRef(({className:t,...e},n)=>p.jsx(hbe,{ref:n,"data-sidebar":"input",className:Xn("w-full h-8 shadow-none bg-background focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...e}));hAt.displayName="SidebarInput";const fAt=E.forwardRef(({className:t,...e},n)=>p.jsx("div",{ref:n,"data-sidebar":"header",className:Xn("flex flex-col gap-2 p-2",t),...e}));fAt.displayName="SidebarHeader";const pAt=E.forwardRef(({className:t,...e},n)=>p.jsx("div",{ref:n,"data-sidebar":"footer",className:Xn("flex flex-col gap-2 p-2",t),...e}));pAt.displayName="SidebarFooter";const gAt=E.forwardRef(({className:t,...e},n)=>p.jsx(gbe,{ref:n,"data-sidebar":"separator",className:Xn("mx-2 w-auto bg-sidebar-border",t),...e}));gAt.displayName="SidebarSeparator";const mAt=E.forwardRef(({className:t,...e},n)=>p.jsx("div",{ref:n,"data-sidebar":"content",className:Xn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e}));mAt.displayName="SidebarContent";const yAt=E.forwardRef(({className:t,...e},n)=>p.jsx("div",{ref:n,"data-sidebar":"group",className:Xn("flex overflow-auto relative flex-col items-start pr-0 pl-0 w-full min-w-0 h-full md:flex-row",t),style:{scrollbarGutter:"stable"},...e}));yAt.displayName="SidebarGroup";const wAt=E.forwardRef(({className:t,asChild:e=!1,...n},r)=>{const i=e?aw:"div";return p.jsx(i,{ref:r,"data-sidebar":"group-label",className:Xn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground
1098/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})});wAt.displayName="SidebarGroupLabel";const vAt=E.forwardRef(({className:t,asChild:e=!1,...n},r)=>{const i=e?aw:"button";return p.jsx(i,{ref:r,"data-sidebar":"group-action",className:Xn("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...n})});vAt.displayName="SidebarGroupAction";const bAt=E.forwardRef(({className:t,...e},n)=>p.jsx("div",{ref:n,"data-sidebar":"group-content",className:Xn("w-full text-sm",t),...e}));bAt.displayName="SidebarGroupContent";const xAt=E.forwardRef(({className:t,...e},n)=>p.jsx("ul",{ref:n,"data-sidebar":"menu",className:Xn("flex flex-col gap-1 w-full min-w-0",t),...e}));xAt.displayName="SidebarMenu";const EAt=E.forwardRef(({className:t,...e},n)=>p.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Xn("relative group/menu-item",t),...e}));EAt.displayName="SidebarMenuItem";const CAt=ube("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--color-sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--color-sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),_At=E.forwardRef(({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:i,className:s,...o},a)=>{const c=t?aw:"button",{isMobile:l,state:u}=wx(),d=p.jsx(c,{ref:a,"data-sidebar":"menu-button","data-size":r,"data-active":e,className:Xn(CAt({variant:n,size:r}),s),...o});return i?(typeof i=="string"&&(i={children:i}),p.jsxs(eAt,{children:[p.jsx(tAt,{asChild:!0,children:d}),p.jsx(Wbe,{side:"right",align:"center",hidden:u!=="collapsed"||l,...i})]})):d});_At.displayName="SidebarMenuButton";const SAt=E.forwardRef(({className:t,asChild:e=!1,showOnHover:n=!1,...r},i)=>{const s=e?aw:"button";return p.jsx(s,{ref:i,"data-sidebar":"menu-action",className:Xn("absolute right-2 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...r})});SAt.displayName="SidebarMenuAction";const AAt=E.forwardRef(({className:t,...e},n)=>p.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Xn("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e}));AAt.displayName="SidebarMenuBadge";const kAt=E.forwardRef(({className:t,showIcon:e=!1,...n},r)=>{const i=E.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return p.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Xn("flex gap-2 items-center px-2 h-8 rounded-md",t),...n,children:[e&&p.jsx(Vre,{className:"rounded-md size-4","data-sidebar":"menu-skeleton-icon"}),p.jsx(Vre,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});kAt.displayName="SidebarMenuSkeleton";const $At=E.forwardRef(({className:t,...e},n)=>p.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Xn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e}));$At.displayName="SidebarMenuSub";const IAt=E.forwardRef(({...t},e)=>p.jsx("li",{ref:e,...t}));IAt.displayName="SidebarMenuSubItem";const TAt=E.forwardRef(({asChild:t=!1,size:e="md",isActive:n,className:r,...i},s)=>{const o=t?aw:"a";return p.jsx(o,{ref:s,"data-sidebar":"menu-sub-button","data-size":e,"data-active":n,className:Xn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...i})});TAt.displayName="SidebarMenuSubButton";const PAt="2.14.4",RAt=()=>`@wagmi/core@${PAt}`;var qbe=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},PE,Kbe;
1098class O3 extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return RAt()}constructor(e,n={}){var s;super(),PE.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof O3?n.cause.details:(s=n.cause)!=null&&s.message?n.cause.message:n.details,i=n.cause instanceof O3&&n.cause.docsPath||n.docsPath;this.message=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` 1099`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return qbe(this,PE,"m",Kbe).call(this,this,e)}}PE=new WeakSet,Kbe=function t(e,n){return n!=null&&n(e)?e:e.cause?qbe(this,PE,"m",t).call(this,e.cause,n):e};class MAt extends O3{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class gm extends O3{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}const OAt=/(rabby|trustwallet)/;zU.type="injected";function zU(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:n}=t;function r(){const c=t.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...jAt[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l==null?void 0:l.ethereum}}}let i,s,o,a;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return OAt.test(this.id.toLowerCase())},type:zU.type,async setup(){const l=await this.getProvider();l!=null&&l.on&&t.target&&(o||(o=this.onConnect.bind(this),l.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)))},async connect({chainId:l,isReconnecting:u}={}){var f,m,y,v,b,C;const d=await this.getProvider();if(!d)throw new gm;let h=[];if(u)h=await this.getAccounts().catch(()=>[]);else if(e)try{h=(v=(y=(m=(f=(await d.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:f.caveats)==null?void 0:m[0])==null?void 0:y.value)==null?void 0:v.map(_=>cr(_)),h.length>0&&(h=await this.getAccounts())}catch(x){const _=x;if(_.code===Fr.code)throw new Fr(_);if(_.code===ml.code)throw _}try{!(h!=null&&h.length)&&!u&&(h=(await d.request({method:"eth_requestAccounts"})).map($=>cr($))),o&&(d.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),d.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a));let x=await this.getChainId();if(l&&x!==l){const _=await this.switchChain({chainId:l}).catch($=>{if($.code===Fr.code)throw $;return{id:x}});x=(_==null?void 0:_.id)??x}return e&&await((b=c.storage)==null?void 0:b.removeItem(`${this.id}.disconnected`)),t.target||await((C=c.storage)==null?void 0:C.setItem("injected.connected",!0)),{accounts:h,chainId:x}}catch(x){const _=x;throw _.code===Fr.code?new Fr(_):_.code===ml.code?new ml(_):_}},async disconnect(){var u,d;const l=await this.getProvider();if(!l)throw new gm;s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o));try{await fC(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((u=c.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),t.target||await((d=c.storage)==null?void 0:d.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new gm;return(await l.request({method:"eth_accounts"})).map(d=>cr(d))},async getChainId(){const l=await this.getProvider();if(!l)throw new gm;const u=await l.request({method:"eth_chainId"});return Number(u)}
1099,async getProvider(){if(typeof window>"u")return;let l;const u=r();return typeof u.provider=="function"?l=u.provider(window):typeof u.provider=="string"?l=O7(window,u.provider):l=u.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){var l,u;try{if(e&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!t.target&&!await((u=c.storage)==null?void 0:u.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const m=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",m),!!await this.getProvider()),y=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(b=>window.addEventListener("ethereum#initialized",()=>b(m()),{once:!0}))]:[],new Promise(b=>setTimeout(()=>b(m()),y))]))return!0}throw new gm}return!!(await Hy(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){var m,y,v,b;const d=await this.getProvider();if(!d)throw new gm;const h=c.chains.find(C=>C.id===u);if(!h)throw new Gd(new MAt);const f=new Promise(C=>{const x=_=>{"chainId"in _&&_.chainId===u&&(c.emitter.off("change",x),C())};c.emitter.on("change",x)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:dn(u)}]}).then(async()=>{await this.getChainId()===u&&c.emitter.emit("change",{chainId:u})}),f]),h}catch(C){const x=C;if(x.code===4902||((y=(m=x==null?void 0:x.data)==null?void 0:m.originalError)==null?void 0:y.code)===4902)try{const{default:_,...$}=h.blockExplorers??{};let I;l!=null&&l.blockExplorerUrls?I=l.blockExplorerUrls:_&&(I=[_.url,...Object.values($).map(T=>T.url)]);let R;(v=l==null?void 0:l.rpcUrls)!=null&&v.length?R=l.rpcUrls:R=[((b=h.rpcUrls.default)==null?void 0:b.http[0])??""];const N={blockExplorerUrls:I,chainId:dn(u),chainName:(l==null?void 0:l.chainName)??h.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??h.nativeCurrency,rpcUrls:R};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[N]}).then(async()=>{if(await this.getChainId()===u)c.emitter.emit("change",{chainId:u});else throw new Fr(new Error("User rejected switch after adding network."))}),f]),h}catch(_){throw new Fr(_)}throw x.code===Fr.code?new Fr(x):new Gd(x)}},async onAccountsChanged(l){var u;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),e&&await((u=c.storage)==null?void 0:u.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(d=>cr(d))})},onChainChanged(l){const u=Number(l);c.emitter.emit("change",{chainId:u})},async onConnect(l){const u=await this.getAccounts();if(u.length===0)return;const d=Number(l.chainId);c.emitter.emit("connect",{accounts:u,chainId:d});const h=await this.getProvider();h&&(o&&(h.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),h.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),h.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),h.on("disconnect",a)))},async onDisconnect(l){const u=await this.getProvider();l&&l.code===1013&&u&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),u&&(s&&(u.removeListener("chainChanged",s),s=void 0),a&&(u.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o))))}})}const jAt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:O7(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return O7(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(e[r])return!1;return!0})}}
1099,phantom:{id:"phantom",name:"Phantom",provider(t){var e,n;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(n=t.phantom)==null?void 0:n.ethereum:O7(t,"isPhantom")}}};function O7(t,e){function n(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const r=t.ethereum;if(r!=null&&r.providers)return r.providers.find(i=>n(i));if(r&&n(r))return r}const WU=50000n,Gre=s9e*32n,Gbe={block:xoe({format(t){var n;const e=(n=t.transactions)==null?void 0:n.map(r=>{var s;if(typeof r=="string")return r;const i=(s=Gbe.transaction)==null?void 0:s.format(r);return i.typeHex==="0x71"?i.type="eip712":i.typeHex==="0xff"&&(i.type="priority"),i});return{l1BatchNumber:t.l1BatchNumber?Sr(t.l1BatchNumber):null,l1BatchTimestamp:t.l1BatchTimestamp?Sr(t.l1BatchTimestamp):null,transactions:e}}}),transaction:boe({format(t){const e={};return t.type==="0x71"?e.type="eip712":t.type==="0xff"&&(e.type="priority"),{...e,l1BatchNumber:t.l1BatchNumber?Sr(t.l1BatchNumber):null,l1BatchTxIndex:t.l1BatchTxIndex?Sr(t.l1BatchTxIndex):null}}}),transactionReceipt:Coe({format(t){return{l1BatchNumber:t.l1BatchNumber?Sr(t.l1BatchNumber):null,l1BatchTxIndex:t.l1BatchTxIndex?Sr(t.l1BatchTxIndex):null,logs:t.logs.map(e=>({...Ou(e),l1BatchNumber:e.l1BatchNumber?Sr(e.l1BatchNumber):null,transactionLogIndex:Ec(e.transactionLogIndex),logType:e.logType})),l2ToL1Logs:t.l2ToL1Logs.map(e=>({blockNumber:Sr(e.blockHash),blockHash:e.blockHash,l1BatchNumber:e.l1BatchNumber?Sr(e.l1BatchNumber):null,transactionIndex:Sr(e.transactionIndex),shardId:Sr(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:Sr(e.logIndex)}))}}}),transactionRequest:n9e({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format(t){return t.gasPerPubdata||t.paymaster&&t.paymasterInput||t.factoryDeps||t.customSignature?{eip712Meta:{...t.gasPerPubdata?{gasPerPubdata:Qt(t.gasPerPubdata)}:{gasPerPubdata:Qt(WU)},...t.paymaster&&t.paymasterInput?{paymasterParams:{paymaster:t.paymaster,paymasterInput:Array.from(To(t.paymasterInput))}}:{},...t.factoryDeps?{factoryDeps:t.factoryDeps.map(e=>Array.from(To(e)))}:{},...t.customSignature?{customSignature:Array.from(To(t.customSignature))}:{}},type:"0x71"}:{}}})};class NAt extends et{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join(` 1100`),{name:"InvalidEip712TransactionError"})}}function Zbe(t){return!!(t.type==="eip712"||"customSignature"in t&&t.customSignature||"paymaster"in t&&t.paymaster||"paymasterInput"in t&&t.paymasterInput||"gasPerPubdata"in t&&typeof t.gasPerPubdata=="bigint"||"factoryDeps"in t&&t.factoryDeps)}function Ybe(t){const{chainId:e,to:n,from:r,paymaster:i,paymasterInput:s}=t;if(!Zbe(t))throw new NAt;if(!e||e<=0)throw new t5({chainId:e});if(n&&!Wr(n))throw new ps({address:n});if(r&&!Wr(r))throw new ps({address:r});if(i&&!Wr(i))throw new ps({address:i});if(i&&!s)throw new et("`paymasterInput` must be provided when `paymaster` is defined");if(!i&&s)throw new et("`paymaster` must be provided when `paymasterInput` is defined")}function DAt(t,e){return Zbe(t)?BAt(t):Noe(t,e)}const LAt={transaction:DAt};function BAt(t){const{chainId:e,gas:n,nonce:r,to:i,from:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:h,gasPerPubdata:f,data:m}=t;Ybe(t);const y=[r?Qt(r):"0x",c?Qt(c):"0x",a?Qt(a):"0x",n?Qt(n):"0x",i??"0x",o?Qt(o):"0x",m??"0x",Qt(e),Qt(""),Qt(""),Qt(e),s??"0x",Qt(f||WU),u??[],l??"0x",d&&h?[d,h]:[]];return Il(["0x71",Yd(y)])}class FAt extends et{constructor({givenLength:e,maxBytecodeSize:n}){super(`Bytecode cannot be longer than ${n} bytes. Given length: ${e}`,{name:"BytecodeLengthExceedsMaxSizeError"})}}class UAt extends et{constructor({givenLengthInWords:e}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${e}`,{name:"BytecodeLengthInWordsMustBeOddError"})}}class zAt extends et{constructor({givenLength:e}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${e}`,{name:"BytecodeLengthMustBeDivisibleBy32Error"})}}function WAt(t){const e=Ud(t);if(e.length%32!==0)throw new zAt({givenLength:e.length});if(e.length>Gre)throw new FAt({givenLength:e.length,maxBytecodeSize:Gre});const n=Soe(e),r=Ud(n),i=e.length/32;if(i%2===0)throw new UAt({givenLengthInWords:i});const s=Ud(i),o=O1(s,{size:2}),a=new Uint8Array([1,0]);return r.set(a,0),r.set(o,2),r}const HAt=t=>{Ybe(t);const e=VAt(t);return{domain:{name:"zkSync",version:"2",chainId:t.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:e}};function VAt(t){const{gas:e,nonce:n,to:r,from:i,value:s,maxFeePerGas:o,maxPriorityFeePerGas:a,factoryDeps:c,paymaster:l,paymasterInput:u,gasPerPubdata:d,data:h}=t;return{txType:113n,from:BigInt(i),to:r?BigInt(r):0n,gasLimit:e??0n,gasPerPubdataByteLimit:d??WU,maxFeePerGas:o??0n,maxPriorityFeePerGas:a??0n,paymaster:l?BigInt(l):0n,nonce:n?BigInt(n):0n,value:s??0n,data:h||"0x0",factoryDeps:(c==null?void 0:c.map(f=>Qt(WAt(f))))??[],paymasterInput:u||"0x"}}const qAt={formatters:Gbe,serializers:LAt,custom:{getEip712Domain:HAt}},KAt={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"}
1100,l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},GAt={block:xoe({format(t){var n;return{transactions:(n=t.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const i=pC(r);return i.typeHex==="0x7e"&&(i.isSystemTx=r.isSystemTx,i.mint=r.mint?Sr(r.mint):void 0,i.sourceHash=r.sourceHash,i.type="deposit"),i}),stateRoot:t.stateRoot}}}),transaction:boe({format(t){const e={};return t.type==="0x7e"&&(e.isSystemTx=t.isSystemTx,e.mint=t.mint?Sr(t.mint):void 0,e.sourceHash=t.sourceHash,e.type="deposit"),e}}),transactionReceipt:Coe({format(t){return{l1GasPrice:t.l1GasPrice?Sr(t.l1GasPrice):null,l1GasUsed:t.l1GasUsed?Sr(t.l1GasUsed):null,l1Fee:t.l1Fee?Sr(t.l1Fee):null,l1FeeScalar:t.l1FeeScalar?Number(t.l1FeeScalar):null}}})};function ZAt(t,e){return XAt(t)?QAt(t):Noe(t,e)}const YAt={transaction:ZAt};function QAt(t){JAt(t);const{sourceHash:e,data:n,from:r,gas:i,isSystemTx:s,mint:o,to:a,value:c}=t,l=[e,r,a??"0x",o?Qt(o):"0x",c?Qt(c):"0x",i?Qt(i):"0x",s?"0x1":"0x",n??"0x"];return Il(["0x7e",Yd(l)])}function XAt(t){return t.type==="deposit"||typeof t.sourceHash<"u"}function JAt(t){const{from:e,to:n}=t;if(e&&!Wr(e))throw new ps({address:e});if(n&&!Wr(n))throw new ps({address:n})}const j3={contracts:KAt,formatters:GAt,serializers:YAt},Zre=Pc({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),Yre=Pc({id:43114,name:"Avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),jv=1,Qre=Pc({...j3,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...j3.contracts,disputeGameFactory:{[jv]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[jv]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[jv]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[jv]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:jv}),Xre=Pc({id:6001,name:"BounceBit Mainnet",nativeCurrency:{name:"BounceBit",symbol:"BB",decimals:18},rpcUrls:{default:{http:["https://fullnode-mainnet.bouncebitapi.com"]}}
1100,blockExplorers:{default:{name:"BB Scan",url:"https://bbscan.io"}},testnet:!1}),Jre=Pc({id:56,name:"BNB Smart Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),eie=Pc({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),tie=Pc({id:169,name:"Manta Pacific Mainnet",network:"manta",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://pacific-rpc.manta.network/http"]}},blockExplorers:{default:{name:"Manta Explorer",url:"https://pacific-explorer.manta.network",apiUrl:"https://pacific-explorer.manta.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:332890}}}),V6=56,nie=Pc({id:204,name:"opBNB",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opBNB (BSCScan)",url:"https://opbnb.bscscan.com",apiUrl:"https://api-opbnb.bscscan.com/api"}},contracts:{...j3.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:512881},l2OutputOracle:{[V6]:{address:"0x153CAB79f4767E2ff862C94aa49573294B13D169"}},portal:{[V6]:{address:"0x1876EA7702C0ad0C6A2ae6036DE7733edfBca519"}},l1StandardBridge:{[V6]:{address:"0xF05F0e4362859c3331Cb9395CBC201E3Fa6757Ea"}}},sourceId:V6}),Nv=1,rie=Pc({...j3,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...j3.contracts,disputeGameFactory:{[Nv]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[Nv]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[Nv]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[Nv]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:Nv}),iie=Pc({id:137,name:"Polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),sie=Pc({id:534352,name:"Scroll",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.scroll.io"],webSocket:["wss://wss-rpc.scroll.io/ws"]}},blockExplorers:{default:{name:"Scrollscan",url:"https://scrollscan.com",apiUrl:"https://api.scrollscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14}},testnet:!1}),oie=Pc({...qAt,id:324,name:"ZKsync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://era.zksync.network/",apiUrl:"https://api-era.zksync.network/api"},native:{name:"ZKsync Explorer",url:"https://explorer.zksync.io/",apiUrl:"https://block-explorer-api.mainnet.zksync.io/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},universalSignatureVerifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:45659388}}}),Qbe={[eie.id]:{network:eie,transport:nc([Un("https://mainnet.gateway.tenderly.co"),Un(),Un("https://eth.llamarpc.com")])},[Zre.id]:{network:Zre,transport:nc([Un("https://arbitrum.drpc.org"),Un("https://arbitrum-one.rpc.grove.city/v1/01fdb492"),Un("https://arb1.arbitrum.
1100io/rpc"),Un("https://rpc.ankr.com/arbitrum"),Un()])},[rie.id]:{network:rie,transport:nc([Un()])},[Qre.id]:{network:Qre,transport:nc([Un("https://base.llamarpc.com"),Un()])},[oie.id]:{network:oie,transport:nc([Un()])},[tie.id]:{network:tie,transport:nc([Un()])},[Jre.id]:{network:Jre,transport:nc([m0t(zU),Un("https://bsc-dataseed1.binance.org"),Un("https://bsc-dataseed2.binance.org"),Un("https://binance.llamarpc.com"),Un("https://bsc-dataseed3.binance.org")])},[Xre.id]:{network:Xre,transport:nc([Un()])},[sie.id]:{network:sie,transport:nc([Un()])},[Yre.id]:{network:Yre,transport:nc([Un("https://1rpc.io/avax/c"),Un()])},[iie.id]:{network:iie,transport:nc([Un("https://polygon-rpc.com"),Un("https://polygon.therpc.io"),Un()])},[nie.id]:{network:nie,transport:nc([Un("https://opbnb-mainnet-rpc.bnbchain.org"),Un("https://opbnb-mainnet.nodereal.io/v1/e9a36765eb8a40b9bd12e680a1fd2bc5"),Un("https://opbnb-mainnet.infura.io/v3/bd4216db4b0e471088d366a9eb68fa02"),Un("https://rpc.ankr.com/opbnb"),Un()])}},HU=Object.values(Qbe).map(t=>t.network),Xbe=Object.fromEntries(Object.values(Qbe).map(t=>[t.network.id,t.transport])),ekt=h1t({chains:HU,transports:Xbe,ssr:!0}),tkt=qge({chains:HU,transports:Xbe,ssr:!0}),nkt="8ed6e00cedaf668184ba014145e8f2d8",{origin:rkt,prefix:ikt}=lse(),aie={appId:"cm6aelb1p045u13rd64nxga1b",config:{loginMethods:["email"],appearance:{theme:"light",accentColor:"#2AAE67",logo:P4e(rkt,ikt,"/logo.png")},embeddedWallets:{showWalletUIs:!1,createOnLogin:"users-without-wallets"},supportedChains:HU,walletConnectCloudProjectId:nkt}};function skt({children:t}){const[e]=V7("REGION_BLOCK"),[n,r]=V7("WEB3_WALLET"),i=K6t(),s=XF();return E.useEffect(()=>{typeof window>"u"||(z7()||typeof window.ethereum<"u")&&r("1")},[r]),E.useEffect(()=>{if(!(typeof window>"u")&&!(e!=="1"||!e||n==="1")&&i!=="/disable"){if(z7()||typeof window.ethereum<"u"){r("1");return}s.replace("/disable")}},[e,n,i,s,r]),t}function okt({children:t}){const e=oN.Mainnet,n=E.useMemo(()=>m5t(e),[e]),r=E.useMemo(()=>[],[]);return p.jsx(w5t,{endpoint:n,children:p.jsx(_4t,{wallets:r,autoConnect:!0,children:t})})}var ff={},mm={},cie;function akt(){if(cie)return mm;cie=1;var t=mm&&mm.__assign||function(){return t=Object.assign||function(r){for(var i,s=1,o=arguments.length;s<o;s++){i=arguments[s];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},t.apply(this,arguments)};Object.defineProperty(mm,"__esModule",{value:!0});var e={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function n(r){var i=t(t({},e),r);return i.numOfAttempts<1&&(i.numOfAttempts=1),i}return mm.getSanitizedOptions=n,mm}var q6={},Ql={},K6={},G6={},Z6={},lie;function ckt(){if(lie)return Z6;lie=1,Object.defineProperty(Z6,"__esModule",{value:!0});function t(e){var n=Math.random()*e;return Math.round(n)}return Z6.fullJitter=t,Z6}var Y6={},uie;function lkt(){if(uie)return Y6;uie=1,Object.defineProperty(Y6,"__esModule",{value:!0});function t(e){return e}return Y6.noJitter=t,Y6}var die;function ukt(){if(die)return G6;die=1,Object.defineProperty(G6,"__esModule",{value:!0});var t=ckt(),e=lkt();function n(r){switch(r.jitter){case"full":return t.fullJitter;case"none":default:return e.noJitter}}return G6.JitterFactory=n,G6}var hie;function Jbe(){if(hie)return K6;hie=1,Object.defineProperty(K6,"__esModule",{value:!0});var t=ukt(),e=function(){function n(r){this.options=r,this.attempt=0}return n.prototype.apply=function(){var r=this;return new Promise(function(i){return setTimeout(i,r.jitteredDelay)})},n.prototype.setAttemptNumber=function(r){this.attempt=r},Object.defineProperty(n.prototype,"jitteredDelay",{get:function(){var r=t.JitterFactory(this.options);return r(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"delay",{get:function(){var r=this.options.startingDelay,i=this.options.timeMultiple,s=this.numOfDelayedAttempts,o=r*Math.pow(i,s);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),n}();return K6.Delay=e,K6}var fie;function dkt(){if(fie)return Ql;fie=1;var t=Ql&&Ql.__extends||function(){var s=function(o,a){return s=Object.
1100setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,l){c.__proto__=l}||function(c,l){for(var u in l)l.hasOwnProperty(u)&&(c[u]=l[u])},s(o,a)};return function(o,a){s(o,a);function c(){this.constructor=o}o.prototype=a===null?Object.create(a):(c.prototype=a.prototype,new c)}}(),e=Ql&&Ql.__awaiter||function(s,o,a,c){function l(u){return u instanceof a?u:new a(function(d){d(u)})}return new(a||(a=Promise))(function(u,d){function h(y){try{m(c.next(y))}catch(v){d(v)}}function f(y){try{m(c.throw(y))}catch(v){d(v)}}function m(y){y.done?u(y.value):l(y.value).then(h,f)}m((c=c.apply(s,o||[])).next())})},n=Ql&&Ql.__generator||function(s,o){var a={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},c,l,u,d;return d={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function h(m){return function(y){return f([m,y])}}function f(m){if(c)throw new TypeError("Generator is already executing.");for(;a;)try{if(c=1,l&&(u=m[0]&2?l.return:m[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,m[1])).done)return u;switch(l=0,u&&(m=[m[0]&2,u.value]),m[0]){case 0:case 1:u=m;break;case 4:return a.label++,{value:m[1],done:!1};case 5:a.label++,l=m[1],m=[0];continue;case 7:m=a.ops.pop(),a.trys.pop();continue;default:if(u=a.trys,!(u=u.length>0&&u[u.length-1])&&(m[0]===6||m[0]===2)){a=0;continue}if(m[0]===3&&(!u||m[1]>u[0]&&m[1]<u[3])){a.label=m[1];break}if(m[0]===6&&a.label<u[1]){a.label=u[1],u=m;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(m);break}u[2]&&a.ops.pop(),a.trys.pop();continue}m=o.call(s,a)}catch(y){m=[6,y],l=0}finally{c=u=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Ql,"__esModule",{value:!0});var r=Jbe(),i=function(s){t(o,s);function o(){return s!==null&&s.apply(this,arguments)||this}return o.prototype.apply=function(){return e(this,void 0,void 0,function(){return n(this,function(a){return[2,this.isFirstAttempt?!0:s.prototype.apply.call(this)]})})},Object.defineProperty(o.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),o}(r.Delay);return Ql.SkipFirstDelay=i,Ql}var ym={},pie;function hkt(){if(pie)return ym;pie=1;var t=ym&&ym.__extends||function(){var r=function(i,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var c in a)a.hasOwnProperty(c)&&(o[c]=a[c])},r(i,s)};return function(i,s){r(i,s);function o(){this.constructor=i}i.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)}}();Object.defineProperty(ym,"__esModule",{value:!0});var e=Jbe(),n=function(r){t(i,r);function i(){return r!==null&&r.apply(this,arguments)||this}return i}(e.Delay);return ym.AlwaysDelay=n,ym}var gie;function fkt(){if(gie)return q6;gie=1,Object.defineProperty(q6,"__esModule",{value:!0});var t=dkt(),e=hkt();function n(i,s){var o=r(i);return o.setAttemptNumber(s),o}q6.DelayFactory=n;function r(i){return i.delayFirstAttempt?new e.AlwaysDelay(i):new t.SkipFirstDelay(i)}return q6}var mie;function pkt(){if(mie)return ff;mie=1;var t=ff&&ff.__awaiter||function(o,a,c,l){function u(d){return d instanceof c?d:new c(function(h){h(d)})}return new(c||(c=Promise))(function(d,h){function f(v){try{y(l.next(v))}catch(b){h(b)}}function m(v){try{y(l.throw(v))}catch(b){h(b)}}function y(v){v.done?d(v.value):u(v.value).then(f,m)}y((l=l.apply(o,a||[])).next())})},e=ff&&ff.__generator||function(o,a){var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},l,u,d,h;return h={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function f(y){return function(v){return m([y,v])}}function m(y){if(l)throw new TypeError("Generator is already executing.");for(;c;)try{if(l=1,u&&(d=y[0]&2?u.return:y[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,y[1])).done)return d;switch(u=0,d&&(y=[y[0]&2,d.value]),y[0]){case 0:case 1:d=y;break;case 4:return c.label++,{value:y[1],done:!1};case 5:c.label++,u=y[1],y=[0];continue;case 7:y=c.ops.pop(),c.trys.pop();continue;default:if(d=c.trys,!(d=d.length>0&&d[d.length-1])&&(y[0]===6||y[0]===2)){c=0;continue}if(y[0]===3&&(!d||y[1]>d[0]&&y[1]<d[3])){c.label=y[1];break}if(y[0]===6&&c.label<d[1]){c.label=d[1],d=y;break}if(d&&c.label<d[2]){c.label=d[2],c.ops.push(y);break}d[2]&&c.ops.pop(),c.trys.pop();continue}y=a.call(o,c)}catch(v){y=[6,v],u=0}finally{l=d=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}};
vendor: 4,281 bytes, line 1100
1100Object.defineProperty(ff,"__esModule",{value:!0});var n=akt(),r=fkt();function i(o,a){return a===void 0&&(a={}),t(this,void 0,void 0,function(){var c,l;return e(this,function(u){switch(u.label){case 0:return c=n.getSanitizedOptions(a),l=new s(o,c),[4,l.execute()];case 1:return[2,u.sent()]}})})}ff.backOff=i;var s=function(){function o(a,c){this.request=a,this.options=c,this.attemptNumber=0}return o.prototype.execute=function(){return t(this,void 0,void 0,function(){var a,c;return e(this,function(l){switch(l.label){case 0:if(this.attemptLimitReached)return[3,7];l.label=1;case 1:return l.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return l.sent(),[4,this.request()];case 3:return[2,l.sent()];case 4:return a=l.sent(),this.attemptNumber++,[4,this.options.retry(a,this.attemptNumber)];case 5:if(c=l.sent(),!c||this.attemptLimitReached)throw a;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(o.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),o.prototype.applyDelay=function(){return t(this,void 0,void 0,function(){var a;return e(this,function(c){switch(c.label){case 0:return a=r.DelayFactory(this.options,this.attemptNumber),[4,a.apply()];case 1:return c.sent(),[2]}})})},o}();return ff}var gkt=pkt();const mkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.664062 5.53594C0.664062 4.41594 0.664063 3.85594 0.882063 3.42794C1.07381 3.05163 1.37976 2.74568 1.75606 2.55394C2.18406 2.33594 2.74406 2.33594 3.86406 2.33594H8.13073C9.25073 2.33594 9.81073 2.33594 10.2387 2.55394C10.615 2.74568 10.921 3.05163 11.1127 3.42794C11.2727 3.7426 11.3154 4.1286 11.3267 4.75627L13.5517 3.96694C14.4194 3.65927 15.3307 4.3026 15.3307 5.2236V10.4086C15.3307 11.3406 14.3991 11.9849 13.5274 11.6563L11.3307 10.8286C11.3281 11.7143 11.3061 12.1979 11.1127 12.5773C10.921 12.9536 10.615 13.2595 10.2387 13.4513C9.81073 13.6693 9.25073 13.6693 8.13073 13.6693H3.86406C2.74406 13.6693 2.18406 13.6693 1.75606 13.4513C1.37976 13.2595 1.07381 12.9536 0.882063 12.5773C0.664063 12.1493 0.664062 11.5893 0.664062 10.4693V5.53594ZM3.86406 3.66927H8.13073C8.71273 3.66927 9.06906 3.67027 9.33573 3.69227C9.46006 3.70227 9.53506 3.71494 9.58073 3.7256C9.59864 3.72983 9.61624 3.73529 9.6334 3.74194C9.75883 3.80585 9.86082 3.90783 9.92473 4.03327L9.92906 4.0436C9.9314 4.05094 9.93573 4.06427 9.94106 4.08594C9.95173 4.1316 9.9644 4.2066 9.9744 4.33094C9.9964 4.5976 9.9974 4.95394 9.9974 5.53594V10.4693C9.9974 11.0513 9.9964 11.4076 9.9744 11.6743C9.96923 11.7566 9.95809 11.8385 9.94106 11.9193C9.93784 11.9336 9.93384 11.9477 9.92906 11.9616L9.92473 11.9719C9.86082 12.0974 9.75883 12.1994 9.6334 12.2633L9.62306 12.2676C9.61573 12.2699 9.6024 12.2743 9.58073 12.2796C9.49998 12.2966 9.4181 12.3078 9.33573 12.3129C9.06906 12.3349 8.71273 12.3359 8.13073 12.3359H3.86406C3.28206 12.3359 2.92573 12.3349 2.65906 12.3129C2.5767 12.3078 2.49481 12.2966 2.41406 12.2796C2.39974 12.2764 2.38561 12.2724 2.37173 12.2676L2.3614 12.2633C2.23596 12.1994 2.13398 12.0974 2.07006 11.9719L2.06573 11.9616C2.06095 11.9477 2.05695 11.9336 2.05373 11.9193C2.03671 11.8385 2.02557 11.7566 2.0204 11.6743C1.99806 11.4076 1.9974 11.0513 1.9974 10.4693V5.53594C1.9974 4.95394 1.9984 4.5976 2.02006 4.33094C2.03006 4.2066 2.0434 4.1316 2.05373 4.08594C2.05906 4.06427 2.0634 4.05094 2.06573 4.0436L2.07006 4.03327C2.13398 3.90783 2.23596 3.80585 2.3614 3.74194L2.37173 3.7376C2.37906 3.73527 2.3924 3.73094 2.41406 3.7256C2.45973 3.71494 2.53473 3.70227 2.65906 3.69227C2.92573 3.67027 3.28206 3.66927 3.86406 3.66927ZM11.3307 9.4036L13.9974 10.4086V5.2236L11.3307 6.16927V9.4036Z",fill:"#858481",stroke:"#F8F8F7",strokeWidth:.2}),p.jsx("path",{d:"M6.21615 8.0026C6.95253 8.0026 7.54948 7.40565 7.54948 6.66927C7.54948 5.93289 6.95253 5.33594 6.21615 5.33594C5.47977 5.33594 4.88281 5.93289 4.88281 6.66927C4.88281 7.40565 5.47977 8.0026 6.21615 8.0026Z",stroke:"#858481",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M8.00087 10.6684C8.00087 9.68555 7.20408 8.89062 6.22309 8.89062
1100C5.2421 8.89062 4.44531 9.68555 4.44531 10.6684",stroke:"#858481",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})]}),ykt=E.forwardRef(mkt),wkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsxs("g",{clipPath:"url(#clip0_15821_11232)",children:[p.jsx("path",{d:"M14.0011 7.33333C14.0026 7.64673 14.0026 7.97953 14.0026 8.33333C14.0026 11.3189 14.0026 12.8117 13.0752 13.7392C12.1476 14.6667 10.6548 14.6667 7.66928 14.6667C4.68371 14.6667 3.19093 14.6667 2.26343 13.7392C1.33594 12.8117 1.33594 11.3189 1.33594 8.33333C1.33594 5.34777 1.33594 3.85499 2.26343 2.92749C3.19093 2 4.68371 2 7.66928 2C8.02308 2 8.35588 2 8.66928 2.00154",stroke:"#4B50E8",strokeWidth:1.3,strokeLinecap:"round"}),p.jsx("path",{d:"M4.66406 8.66797H10.6641",stroke:"#4B50E8",strokeWidth:1.3,strokeLinecap:"round"}),p.jsx("path",{d:"M4.66406 10.668H7.9974",stroke:"#4B50E8",strokeWidth:1.3,strokeLinecap:"round"}),p.jsx("path",{d:"M4.66406 6.66797H10.6641",stroke:"#4B50E8",strokeWidth:1.3,strokeLinecap:"round"}),p.jsx("path",{d:"M12.3333 1.33203L12.5053 1.79672C12.7307 2.40604 12.8435 2.71071 13.0657 2.93296C13.288 3.15521 13.5927 3.26794 14.202 3.49342L14.6667 3.66536L14.202 3.83731C13.5927 4.06278 13.288 4.17552 13.0657 4.39777C12.8435 4.62002 12.7307 4.92468 12.5053 5.53401L12.3333 5.9987L12.1614 5.53401C11.9359 4.92468 11.8232 4.62002 11.6009 4.39777C11.3787 4.17552 11.074 4.06278 10.4647 3.83731L10 3.66536L10.4647 3.49342C11.074 3.26794 11.3787 3.15521 11.6009 2.93296C11.8232 2.71071 11.9359 2.40604 12.1614 1.79672L12.3333 1.33203Z",stroke:"#4B50E8",strokeWidth:1.3,strokeLinejoin:"round"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_15821_11232",children:p.jsx("rect",{width:16,height:16,fill:"white"})})})]}),vkt=E.forwardRef(wkt),bkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M20.9977 11C21 11.4701 21 11.9693 21 12.5C21 16.9783 21 19.2175 19.6088 20.6088C18.2175 22 15.9783 22 11.5 22C7.02166 22 4.78249 22 3.39124 20.6088C2 19.2175 2 16.9783 2 12.5C2 8.02166 2 5.78249 3.39124 4.39124C4.78249 3 7.02166 3 11.5 3C12.0307 3 12.5299 3 13 3.00231",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round"}),p.jsx("path",{d:"M7 13H16",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round"}),p.jsx("path",{d:"M7 16H12",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round"}),p.jsx("path",{d:"M7 10H16",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round"}),p.jsx("path",{d:"M18.5 2L18.7579 2.69703C19.0961 3.61102 19.2652 4.06802 19.5986 4.40139C19.932 4.73477 20.389 4.90387 21.303 5.24208L22 5.5L21.303 5.75792C20.389 6.09613 19.932 6.26524 19.5986 6.59861C19.2652 6.93198 19.0961 7.38898 18.7579 8.30297L18.5 9L18.2421 8.30297C17.9039 7.38898 17.7348 6.93198 17.4014 6.59861C17.068 6.26524 16.611 6.09613 15.697 5.75792L15 5.5L15.697 5.24208C16.611 4.90387 17.068 4.73477 17.4014 4.40139C17.7348 4.06802 17.9039 3.61102 18.2421 2.69703L18.5 2Z",stroke:"#34322D",strokeWidth:1.5,strokeLinejoin:"round"})]}),yie=E.forwardRef(bkt),xkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M8.25 5.92188H11.75",stroke:"#D43ABA",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M4.25 5.92188L4.75 6.42188L6.25 4.92188",stroke:"#D43ABA",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M8.25 10.5859H11.75",stroke:"#D43ABA",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M4.25 10.5859L4.75 11.0859L6.25 9.58594",stroke:"#D43ABA",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M6.0026 14.6654H10.0026C13.3359 14.6654 14.6693 13.332 14.6693 9.9987V5.9987C14.6693 2.66536 13.3359 1.33203 10.0026 1.33203H6.0026C2.66927 1.33203 1.33594 2.66536 1.33594 5.9987V9.9987C1.33594 13.332 2.66927 14.6654 6.0026 14.6654Z",stroke:"#D43ABA",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),Ekt=E.forwardRef(xkt),Ckt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M12.3672 8.87891H17.6172",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M6.38281 8.87891L7.13281 9.62891L9.38281 7.37891",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M12.3672 15.8789H17.6172",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M6.38281 15.8789L7.13281 16.6289L9.38281 14.3789",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M9 22H15C20 22 22 20 22 15V9C22 4 20 2 15 2H9C4 2 2 4 2 9V15C2 20 4 22 9 22Z",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),wie=E.forwardRef(Ckt),_kt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M7.50908 6.82625C8.05597 6.74939 8.56189 7.13091 8.63877 7.67782C8.71549 8.22455 8.33461 8.72967 7.78799 8.80671C7.24108 8.88359 6.73517 8.50287 6.6583 7.95594C6.58144 7.40909 6.96227 6.9032 7.50908 6.82625Z",fill:"#FF9500"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.3103 4.46886C8.6775 4.45393 9.00806 4.47745 9.3259 4.59308L9.51102 4.66886C9.93422 4.86195 10.2971 5.16866 10.5587 5.55636L10.6259 5.66339C10.7733 5.91638 10.8601 6.19686 10.9251 6.51183C10.9981 6.86564 11.
11000517 7.30795 11.1189 7.8548L11.3954 10.1048L11.4837 10.8494C11.5076 11.0733 11.5248 11.2743 11.5321 11.4548C11.5452 11.7762 11.5289 12.0698 11.447 12.3509L11.4079 12.4704C11.2479 12.9098 10.9695 13.2956 10.6056 13.5853L10.4446 13.7032C10.1643 13.8922 9.84902 13.9953 9.48918 14.0696C9.3123 14.1062 9.11294 14.1378 8.88998 14.1689L8.14622 14.2634L5.8962 14.5399C5.3494 14.6071 4.90714 14.662 4.5462 14.6767C4.22482 14.6897 3.93126 14.6734 3.65011 14.5915L3.53058 14.5525C3.09105 14.3924 2.70548 14.114 2.41574 13.7501L2.29777 13.5892C2.10866 13.3088 2.00572 12.9936 1.93136 12.6337C1.89482 12.4568 1.86313 12.2575 1.83214 12.0345L1.73761 11.2907L1.46105 9.04073C1.3939 8.49393 1.33906 8.05169 1.32433 7.69074C1.30939 7.32359 1.33299 6.99285 1.44854 6.67511L1.52433 6.48995C1.71734 6.06698 2.02434 5.70386 2.41183 5.4423L2.51886 5.37511C2.77176 5.22781 3.05246 5.14095 3.3673 5.0759C3.72106 5.00283 4.16346 4.94928 4.71026 4.88214L6.96026 4.60558L7.7048 4.5173C7.9287 4.4934 8.12982 4.47622 8.3103 4.46886ZM5.4048 10.447C5.11256 10.3818 4.80696 10.4079 4.5298 10.5212C4.40246 10.5733 4.26232 10.667 4.0548 10.8658C3.84264 11.0689 3.59262 11.3491 3.23214 11.754L2.91808 12.1056C2.93599 12.2205 2.95402 12.3243 2.97354 12.4189C3.03453 12.7138 3.10051 12.8763 3.1798 12.9938L3.24854 13.0876C3.41649 13.2984 3.63998 13.4597 3.89464 13.5525L4.00323 13.5845C4.1223 13.6113 4.27669 13.6226 4.50246 13.6134C4.80995 13.6009 5.20218 13.553 5.76652 13.4837L8.01654 13.2079L8.7439 13.115C8.81326 13.1054 8.87918 13.0949 8.9415 13.0853L6.89152 11.4446C6.46807 11.1059 6.17387 10.8718 5.93058 10.7071C5.75231 10.5865 5.62123 10.517 5.51026 10.4774L5.4048 10.447ZM8.35398 5.53215C8.2003 5.53841 8.02494 5.55375 7.81808 5.5759L7.08995 5.66183L4.83995 5.93762C4.27563 6.0069 3.88353 6.05582 3.58214 6.11808C3.36081 6.16384 3.21384 6.21246 3.1048 6.2673L3.00714 6.32433C2.78238 6.47605 2.60419 6.68675 2.4923 6.93214L2.44854 7.03918C2.40015 7.1724 2.37539 7.34615 2.38761 7.64698C2.40014 7.9545 2.44801 8.34673 2.5173 8.91105L2.73761 10.711L2.91495 10.5142C3.06046 10.3558 3.19386 10.2166 3.31886 10.097C3.57356 9.85313 3.82581 9.65929 4.12746 9.53609L4.3087 9.46961C4.7366 9.33185 5.195 9.31041 5.63605 9.40873L5.75402 9.43841C6.02462 9.51705 6.27134 9.65305 6.52667 9.82593C6.81331 10.0199 7.14542 10.286 7.55558 10.6142L10.0767 12.6306C10.2223 12.482 10.3359 12.3039 10.4079 12.1063L10.44 11.9978C10.4668 11.8787 10.478 11.7243 10.4689 11.4986C10.4626 11.3448 10.4473 11.1694 10.4251 10.9626L10.3392 10.2345L10.0634 7.98449C9.99406 7.42012 9.94518 7.0281 9.88294 6.72667C9.83718 6.5052 9.78854 6.35843 9.73374 6.24933L9.6767 6.15167C9.52494 5.92671 9.31438 5.7488 9.06886 5.63683L8.96182 5.59308C8.82854 5.54463 8.65502 5.51992 8.35398 5.53215Z",fill:"#FF9500"}),p.jsx("path",{d:"M7.7814 1.27355C8.14244 1.28827 8.58444 1.34311 9.1314 1.41027L11.3814 1.68683L12.1252 1.78136C12.3484 1.81237 12.5474 1.84403 12.7244 1.88059C13.0844 1.95495 13.3994 2.05784 13.6799 2.24699L13.8408 2.36496C14.2048 2.65474 14.4831 3.04021 14.6432 3.4798L14.6822 3.59933C14.764 3.88055 14.7804 4.17395 14.7673 4.49543C14.76 4.67598 14.742 4.87684 14.7181 5.1009L14.6306 5.84543L14.354 8.09539C14.2869 8.64235 14.2334 9.08459 14.1603 9.43843C14.0952 9.75339 14.0084 10.0339 13.8611 10.2868L13.7939 10.3939C13.6753 10.5696 13.5355 10.7287 13.3791 10.8681L13.2924 10.9314C13.0784 11.0557 12.7994 11.017 12.6283 10.8252C12.4328 10.6058 12.452 10.269 12.6712 10.0736L12.8001 9.94387C12.8402 9.89803 12.8776 9.84939 12.9119 9.79851L12.9689 9.70091C13.0237 9.59179 13.0724 9.44507 13.1181 9.22355C13.1804 8.92211 13.2293 8.53019 13.2986 7.96574L13.5744 5.71574L13.6603 4.98762C13.6824 4.78065 13.6978 4.60547 13.704 4.45167C13.7132 4.22577 13.702 4.07157 13.6752 3.95246L13.6432 3.84387C13.5504 3.58915 13.3892 3.36574 13.1783 3.19777L13.0845 3.12902C12.9669 3.04972 12.8047 2.98375 12.5096 2.92277C12.3588 2.89164 12.1852 2.86384 11.9791 2.83527L11.2517 2.7423L9.00172 2.46652C8.43716 2.3972 8.04524 2.34935 7.73765 2.33683C7.51171 2.32765 7.35756 2.33893 7.23844 2.36574L7.12984 2.39777C6.87496 2.49054 6.65098 2.65159 6.48296 2.86262L6.415 2.95636C6.36102 3.03639 6.31297 3.1374 6.2689 3.28605L6.22828 3.38605C6.1119 3.60426 5.85432 3.71821 5.60796 3.64543C5.32626 3.56195 5.16511 3.26541 5.24859 2.98371L5.30328 2.81808C5.36243 2.65588 5.43658 2.50395 5.53296 2.36105L5.65093 2.20011C5.94072 1.83615 6.32617 1.55777 6.76578 1.39777L6.88531 1.35871C7.16652 1.27687 7.45992 1.26047 7.7814 1.27355Z",fill:"#FF9500"})]}),Skt=E.forwardRef(_kt),Akt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M11.2675 10.2413C12.0879 10.126 12.8467 10.6983 12.9621 11.5187C13.0771 12.3388 12.5058 13.0965 11.6859 13.212C10.8655 13.3273 10.1067 12.7563 9.99135 11.9359C9.87607 11.1156 10.4473 10.3568 11.2675 10.2413Z",fill:"#34322D"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4694 6.70525C13.0202 6.68285 13.516 6.71813 13.9928 6.89157L14.2704 7.00525C14.9052 7.29488 15.4495 7.75495 15.8419 8.33649L15.9427 8.49704C16.1638 8.87653 16.294 9.29725 16.3916 9.7697C16.5011 10.3004 16.5815 10.9639 16.6822 11.7842L17.097 15.1592L17.2295 16.276C17.2653 16.6119 17.2911 16.9134 17.3021 17.1842C17.3217 17.6662 17.2972 18.1066 17.1744 18.5283L17.1158 18.7076C16.8758 19.3667 16.4581 19.9454 15.9123 20.3799L15.6708 20.5568C15.2504 20.8403 14.7774 20.9949 14.2377 21.1064C13.9724 21.1612 13.6733 21.2087 13.3389 21.2553L12.2232 21.397L8.84821 21.8118C8.02801 21.9126 7.36462 21.995 6.82321 22.0169C6.34114 22.0365 5.90079 22.012 5.47907 21.8892L5.29977 21.8307C4.64048 21.5906 4.06213 21.173 3.62751 20.6271L3.45056 20.3858C3.16689 19.9652 3.01249 19.4924 2.90095 18.9525C2.84614 18.6872 2.7986 18.3882 2.75212 18.0537L2.61032 16.938L2.19548 13.563C2.09476 12.7428 2.01249 12.0795 1.9904 11.5381C1.96799 10.9873 2.00339 10.4912 2.17672 10.0146L2.2904 9.73688C2.57992 9.10242 3.04041 8.55774 3.62165 8.1654L3.78219 8.06462C4.16155 7.84367 4.58259 7.71338 5.05485 7.6158C5.5855 7.5062 6.2491 7.42587 7.0693 7.32517L10.4443 6.91033L11.5611 6.7779C11.897 6.74205 12.1986 6.71629 12.4694 6.70525ZM8.11111 15.6724C7.67275 15.5747 7.21435 15.6138 6.79861 15.7838C6.60759 15.8619 6.39739 16.0025 6.08611 16.3006C5.76787 16.6053 5.39284 17.0256 4.85212 17.633L4.38103 18.1604C4.40789 18.3327 4.43493 18.4884 4.46422 18.6303C4.5557 19.0727 4.65467 19.3164 4.77361 19.4927L4.87672 19.6334C5.12864 19.9496 5.46387 20.1915 5.84587 20.3307L6.00875 20.3787C6.18735 20.4189 6.41894 20.4358 6.75759 20.422C7.21883 20.4033 7.80718 20.3314 8.65369 20.2275L12.0287 19.8138L13.1198 19.6744C13.2238 19.66 13.3227 19.6443 13.4162 19.6299L10.3412 17.1689C9.70601 16.6608 9.26471 16.3097 8.89977 16.0626C8.63237 15.8817 8.435
110075 15.7774 8.2693 15.7181L8.11111 15.6724ZM12.5349 8.30017C12.3043 8.30957 12.0413 8.33258 11.731 8.3658L10.6388 8.4947L7.26383 8.90838C6.41735 9.01231 5.8292 9.08569 5.37712 9.17907C5.04512 9.24771 4.82467 9.32064 4.66111 9.4029L4.51462 9.48845C4.17748 9.71603 3.91019 10.0321 3.74235 10.4002L3.67672 10.5607C3.60413 10.7606 3.56699 11.0212 3.58532 11.4724C3.60412 11.9337 3.67592 12.522 3.77985 13.3685L4.11032 16.0685L4.37633 15.7732C4.5946 15.5356 4.7947 15.3269 4.98219 15.1474C5.36425 14.7816 5.74262 14.4909 6.19509 14.3061L6.46696 14.2064C7.10881 13.9997 7.79641 13.9676 8.45798 14.115L8.63493 14.1596C9.04084 14.2775 9.41091 14.4815 9.79391 14.7408C10.2239 15.0318 10.722 15.431 11.3373 15.9232L15.1189 18.9478C15.3373 18.725 15.5078 18.4578 15.6158 18.1614L15.6639 17.9986C15.7041 17.82 15.7209 17.5884 15.7072 17.2498C15.6978 17.0192 15.6748 16.7561 15.6416 16.4459L15.5127 15.3537L15.099 11.9787C14.995 11.1321 14.9217 10.5441 14.8283 10.092C14.7597 9.75975 14.6867 9.5396 14.6045 9.37595L14.5189 9.22946C14.2913 8.89202 13.9755 8.62515 13.6072 8.4572L13.4466 8.39157C13.2467 8.31889 12.9864 8.28183 12.5349 8.30017Z",fill:"#34322D"}),p.jsx("path",{d:"M11.676 1.90838C12.2176 1.93045 12.8806 2.01272 13.701 2.11346L17.076 2.5283L18.1916 2.67009C18.5264 2.7166 18.825 2.7641 19.0904 2.81893C19.6304 2.93047 20.103 3.08481 20.5237 3.36853L20.765 3.54549C21.311 3.98015 21.7285 4.55836 21.9686 5.21775L22.0272 5.39704C22.15 5.81888 22.1746 6.25897 22.1549 6.74119C22.1438 7.01201 22.117 7.31331 22.0811 7.64939L21.9498 8.76619L21.535 12.1411C21.4343 12.9616 21.354 13.6249 21.2443 14.1557C21.1468 14.6281 21.0166 15.0489 20.7955 15.4283L20.6947 15.5889C20.5169 15.8525 20.3071 16.0911 20.0725 16.3002L19.9424 16.3951C19.6214 16.5816 19.203 16.5235 18.9463 16.2358C18.6532 15.9067 18.6818 15.4015 19.0108 15.1084L19.2041 14.9139C19.2642 14.8451 19.3202 14.7721 19.3717 14.6958L19.4573 14.5494C19.5395 14.3857 19.6124 14.1657 19.6811 13.8334C19.7744 13.3812 19.8479 12.7933 19.9518 11.9467L20.3654 8.57165L20.4943 7.47947C20.5276 7.16902 20.5506 6.90626 20.56 6.67556C20.5738 6.3367 20.5568 6.1054 20.5166 5.92673L20.4686 5.76385C20.3294 5.38178 20.0876 5.04665 19.7713 4.7947L19.6307 4.69157C19.4543 4.57263 19.2109 4.47368 18.7682 4.3822C18.5422 4.33551 18.2816 4.29381 17.9725 4.25096L16.8815 4.11149L13.5065 3.69783C12.6596 3.59385 12.0718 3.52207 11.6104 3.5033C11.2715 3.48952 11.0403 3.50644 10.8616 3.54665L10.6987 3.5947C10.3164 3.73385 9.98038 3.97543 9.72835 4.29197L9.6264 4.43259C9.54544 4.55263 9.47336 4.70415 9.40726 4.92712L9.34632 5.07712C9.17176 5.40443 8.78538 5.57536 8.41585 5.46619C7.9933 5.34097 7.75157 4.89616 7.87679 4.47361L7.95882 4.22517C8.04755 3.98187 8.15878 3.75397 8.30335 3.53962L8.4803 3.29822C8.91499 2.75227 9.49317 2.3347 10.1526 2.0947L10.3319 2.03611C10.7537 1.91336 11.1938 1.88876 11.676 1.90838Z",fill:"#34322D"})]}),kkt=E.forwardRef(Akt),$kt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M7.50908 6.83016C8.05597 6.7533 8.56189 7.13482 8.63877 7.68173C8.71549 8.22846 8.33461 8.73357 7.78799 8.81061C7.24108 8.8875 6.73517 8.50678 6.6583 7.95985C6.58144 7.413 6.96227 6.90711 7.50908 6.83016Z",fill:"#858481"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.3103 4.47277C8.6775 4.45784 9.00806 4.48136 9.3259 4.59699L9.51102 4.67277C9.93422 4.86586 10.2971 5.17257 10.5587 5.56027L10.6259 5.6673C10.7733 5.92029 10.8601 6.20077 10.9251 6.51574C10.9981 6.86955 11.0517 7.31186 11.1189 7.85871L11.3954 10.1087L11.4837 10.8533C11.5076 11.0772 11.5248 11.2782 11.5321 11.4587C11.5452 11.7801 11.5289 12.0737 11.447 12.3548L11.4079 12.4743C11.2479 12.9138 10.9695 13.2995 10.6056 13.5892L10.4446 13.7071C10.1643 13.8962 9.84902 13.9992 9.48918 14.0735C9.3123 14.1101 9.11294 14.1418 8.88998 14.1728L8.14622 14.2673L5.8962 14.5438C5.3494 14.611 4.90714 14.6659 4.5462 14.6806C4.22482 14.6936 3.93126 14.6773 3.65011 14.5954L3.53058 14.5564C3.09105 14.3963 2.70548 14.1179 2.41574 13.754L2.29777 13.5931C2.10866 13.3127 2.00572 12.9975 1.93136 12.6376C1.89482 12.4607 1.86313 12.2614 1.83214 12.0384L1.73761 11.2946L1.46105 9.04464C1.3939 8.49784 1.33906 8.0556 1.32433 7.69464C1.30939 7.3275 1.33299 6.99675 1.44854 6.67902L1.52433 6.49386C1.71734 6.07088 2.02434 5.70776 2.41183 5.4462L2.51886 5.37902C2.77176 5.23172 3.05246 5.14486 3.3673 5.0798C3.72106 5.00674 4.16346 4.95319 4.71026 4.88605L6.96026 4.60949L7.7048 4.5212C7.9287 4.49731 8.12982 4.48013 8.3103 4.47277ZM5.4048 10.4509C5.11256 10.3858 4.80696 10.4118 4.5298 10.5251C4.40246 10.5772 4.26232 10.671 4.0548 10.8697C3.84264 11.0728 3.59262 11.353 3.23214 11.7579L2.91808 12.1095C2.93599 12.2244 2.95402 12.3282 2.97354 12.4228C3.03453 12.7178 3.10051 12.8802 3.1798 12.9978L3.24854 13.0915C3.41649 13.3023 3.63998 13.4636 3.89464 13.5564L4.00323 13.5884C4.1223 13.6152 4.27669 13.6265 4.50246 13.6173C4.80995 13.6048 5.20218 13.5569 5.76652 13.4876L8.01654 13.2118L8.7439 13.1189C8.81326 13.1093 8.87918 13.0988 8.9415 13.0892L6.89152 11.4486C6.46807 11.1098 6.17387 10.8758 5.93058 10.711C5.75231 10.5904 5.62123 10.5209 5.51026 10.4814L5.4048 10.4509ZM8.35398 5.53605C8.2003 5.54232 8.02494 5.55766 7.81808 5.5798L7.08995 5.66574L4.83995 5.94152C4.27563 6.01081 3.88353 6.05973 3.58214 6.12199C3.36081 6.16775 3.21384 6.21636 3.1048 6.2712L3.00714 6.32823C2.78238 6.47995 2.60419 6.69066 2.4923 6.93605L2.44854 7.04308C2.40015 7.17631 2.37539 7.35006 2.38761 7.65089C2.40014 7.95841 2.44801 8.35063 2.5173 8.91495L2.73761 10.715L2.91495 10.5181C3.06046 10.3597 3.19386 10.2206 3.31886 10.1009C3.57356 9.85703 3.82581 9.6632 4.12746 9.54L4.3087 9.47352C4.7366 9.33575 5.195 9.31431 5.63605 9.41263L5.75402 9.44232C6.02462 9.52096 6.27134 9.65696 6.52667 9.82984C6.81331 10.0238 7.14542 10.2899 7.55558 10.6181L10.0767 12.6345C10.2223 12.4859 10.3359 12.3078 10.4079 12.1102L10.44 12.0017C10.4668 11.8826 10.478 11.7282 10.4689 11.5025C10.4626 11.3487 10.4473 11.1734 10.4251 10.9666L10.3392 10.2384L10.0634 7.9884C9.99406 7.42403 9.94518 7.032 9.88294 6.73058C9.83718 6.50911 9.78854 6.36234 9.73374 6.25323L9.6767 6.15558C9.52494 5.93062 9.31438 5.75271 9.06886 5.64074L8.96182 5.59699C8.82854 5.54853 8.65502 5.52383 8.35398 5.53605Z",fill:"#858481"}),p.jsx("path",{d:"M7.7814 1.26965C8.14244 1.28436 8.58444 1.33921 9.1314 1.40637L11.3814 1.68293L12.1252 1.77746C12.3484 1.80846 12.5474 1.84013 12.7244 1.87668C13.0844 1.95104 13.3994 2.05394 13.6799 2.24308L13.8408 2.36106C14.2048 2.65083 14.4831 3.0363 14.6432 3.4759L14.6822 3.59542C14.764 3.87665 14.7804 4.17004 14.7673 4.49152C14.76 4.67207 14.742 4.87294 14.7181 5.09699L14.6306 5.84152L14.354 8.09149C14.2869 8.63845 14.2334 9.08069 14.1603 9.43453C14.0952 9.74949 14.0084 10.03 13.8611 10.2829L13.7939 10.39C13.6753 10.5657 13.5355 10.7248 13.3791 10.8642L13.2924 10.9275C13.0784 11.0518 12.7994 11.0131 12.6283 10.8212C12.4328 10.6019 12.452 10.2651 12.6712 10.0696L12.8001 9.93997C12.8402 9.89413 12.8776 9.84549 12.9119 9.79461L12.9689 9.69701C13.0237 9.58789 13.0724 9.44117 13.1181 9.21965C13.1804 8.91821 13.2293 8.52629 13.2986 7.96183L13.5744 5.71183L13.6603 4.98371C13.6824 4.77674 13.6978 4.60157 13.704 4.44777C13.7132 4.22186 13.702 4.06766 13.6752 3.94855L13.6432 3.83996C13.5504 3.58525 13.3892 3.36183 13.1783 3.19386L13.0845 3.12511C12.9669 3.04582 12.8047 2.97985 12.5096 2.91886C12.3588 2.88774 12.1852 2.85994 11.9791 2.83137L11.2517 2.73839L9.00172 2.46262C8.43716 2.3933 8.04524 2.34544 7.73765 2.33293C7.51171 2.32374 7.35756 2.33502 7.23844 2.36183L7.12984 2.39386C6.87496 2.48663 6.65098 2.64768 6.48296 2.85871L6.415 2.95246C6.36102 3.03248 6.31297 3.1335 6.2689 3.28214L6.22828 3.38214C6.1119 3.60035 5.85432 3.7143 5.60796 3.64152C5.32626 3.55804 5.16511 3.2615 5.24859 2.9798L5.30328 2.81418C5.36243 2.65198 5.43658 2.50004 5.53296 2.35714L5.65093 2.19621C5.94072 1.83224 6.32617 1.55386 6.76578 1.39386L6.88531 1.3548C7.166
110052 1.27297 7.45992 1.25657 7.7814 1.26965Z",fill:"#858481"})]}),Ikt=E.forwardRef($kt),Tkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M3 4.30979C3 3.84007 3.29192 3.42642 3.71717 3.29357L7.71717 2.04393C8.3578 1.8438 9 2.35253 9 3.06015V12.9399C9 13.6475 8.35779 14.1562 7.71717 13.9561L3.71717 12.7064C3.29192 12.5736 3 12.1599 3 11.6903V4.30979Z",stroke:"#007AFF",strokeWidth:1.25}),p.jsx("path",{d:"M9 4.07845L11.6699 3.06191C12.3201 2.81439 13 3.33985 13 4.0898V11.9102C13 12.6602 12.3201 13.1857 11.6699 12.938L9 11.9216",stroke:"#007AFF",strokeWidth:1.25})]}),Pkt=E.forwardRef(Tkt),Rkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M4.5 6.46469C4.5 5.76011 4.93788 5.13963 5.57576 4.94036L11.5758 3.0659C12.5367 2.7657 13.5 3.52879 13.5 4.59023V19.4099C13.5 20.4713 12.5367 21.2343 11.5758 20.9341L5.57576 19.0596C4.93788 18.8603 4.5 18.2399 4.5 17.5354V6.46469Z",stroke:"#34322D",strokeWidth:1.5}),p.jsx("path",{d:"M13.5 6.11768L17.5048 4.59287C18.4801 4.22159 19.5 5.00978 19.5 6.1347V17.8654C19.5 18.9902 18.4801 19.7785 17.5048 19.4071L13.5 17.8823",stroke:"#34322D",strokeWidth:1.5})]}),Mkt=E.forwardRef(Rkt),Okt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M3 4.30979C3 3.84007 3.29192 3.42642 3.71717 3.29357L7.71717 2.04393C8.3578 1.8438 9 2.35253 9 3.06015V12.9399C9 13.6475 8.35779 14.1562 7.71717 13.9561L3.71717 12.7064C3.29192 12.5736 3 12.1599 3 11.6903V4.30979Z",stroke:"#858481",strokeWidth:1.25}),p.jsx("path",{d:"M9 4.07845L11.6699 3.06191C12.3201 2.81439 13 3.33985 13 4.0898V11.9102C13 12.6602 12.3201 13.1857 11.6699 12.938L9 11.9216",stroke:"#858481",strokeWidth:1.25})]}),jkt=E.forwardRef(Okt),Nkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M6.2 14H9.8C12.8 14 14 12.8 14 9.8V6.2C14 3.2 12.8 2 9.8 2H6.2C3.2 2 2 3.2 2 6.2V9.8C2 12.8 3.2 14 6.2 14Z",stroke:"#2FBC52",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M6 8.00049V7.18186C6 6.12539 6.79441 5.69948 7.76536 6.22495L8.51857 6.63427L9.27179 7.04358C10.2427 7.56905 10.2427 8.43194 9.27179 8.95741L8.51857 9.36672L7.76536 9.77604C6.79441 10.3015 6 9.87007 6 8.81913V8.00049Z",stroke:"#2FBC52",strokeWidth:1.25,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"})]}),Dkt=E.forwardRef(Nkt),Lkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M9.30781 21H14.7078C19.2078 21 21.0078 19.2 21.0078 14.7V9.3C21.0078 4.8 19.2078 3 14.7078 3H9.30781C4.80781 3 3.00781 4.8 3.00781 9.3V14.7C3.00781 19.2 4.80781 21 9.30781 21Z",stroke:"#34322D",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M9.00781 12.0007V10.7728C9.00781 9.18808 10.1994 8.54922 11.6558 9.33743L12.7857 9.9514L13.9155 10.5654C15.3719 11.3536 15.3719 12.6479 13.9155 13.4361L12.7857 14.0501L11.6558 14.6641C10.1994 15.4523 9.00781 14.8051 9.00781 13.2287V12.0007Z",stroke:"#34322D",strokeWidth:1.5,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"})]}),Bkt=E.forwardRef(Lkt),Fkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{d:"M6.2 14H9.8C12.8 14 14 12.8 14 9.8V6.2C14 3.2 12.8 2 9.8 2H6.2C3.2 2 2 3.2 2 6.2V9.8C2 12.8 3.2 14 6.2 14Z",stroke:"#858481",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M6 8.00049V7.18186C6 6.12539 6.79441 5.69948 7.76536 6.22495L8.51857 6.63427L9.27179 7.04358C10.2427 7.56905 10.2427 8.43194 9.27179 8.95741L8.51857 9.36672L7.76536 9.77604C6.79441 10.3015 6 9.87007 6 8.81913V8.00049Z",stroke:"#858481",strokeWidth:1.25,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"})]}),Ukt=E.forwardRef(Fkt),zkt=(t,e)=>p.jsx("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:p.jsx("path",{d:"M11.8335 1.3125C12.3398 1.31245 12.8285 1.49865 13.2064 1.83563L13.2802 1.905L15.6967 4.28325C16.0651 4.64583 16.2839 5.13351 16.3099 5.64975L16.3125 5.75325V15.2115C16.3125 15.5903 16.2679 15.8092 16.14 16.0365C16.0201 16.2495 15.8394 16.4218 15.621 16.5315C15.4114 16.638 15.2107 16.6804 14.8815 16.6867L14.7885 16.6875H3.2115C2.82525 16.6875 2.60775 16.6474 2.379
110016.5315C2.16059 16.4218 1.97988 16.2495 1.86 16.0365C1.74262 15.828 1.69538 15.6266 1.68863 15.303L1.6875 15.2115V2.7885C1.6875 2.40975 1.73212 2.19075 1.86 1.9635C1.98 1.74975 2.1585 1.581 2.379 1.4685C2.58863 1.362 2.78925 1.31963 3.1185 1.31325L3.2115 1.3125H11.8335ZM11.8335 2.4375H3.1545L3.05513 2.44012L3.01762 2.44238L2.95988 2.44875C2.93504 2.45247 2.91098 2.46019 2.88863 2.47163C2.86822 2.48069 2.85126 2.49607 2.84025 2.5155C2.83584 2.52254 2.83231 2.5301 2.82975 2.538L2.82263 2.57475L2.81888 2.60475L2.81438 2.68275L2.81288 2.75025L2.8125 15.2115L2.81438 15.3173L2.81925 15.3956L2.823 15.4256L2.82975 15.462L2.83537 15.4755C2.84595 15.4991 2.86493 15.518 2.88863 15.5284L2.90887 15.5378L2.9325 15.5452L2.97225 15.5531L2.99775 15.5561L3.06375 15.5602L3.1545 15.5621L14.7885 15.5625L14.9362 15.5602L15.0022 15.5565L15.0278 15.5531L15.0675 15.5456C15.0827 15.5415 15.0974 15.5357 15.1114 15.5284C15.1318 15.5193 15.1487 15.5039 15.1597 15.4845C15.1642 15.4775 15.1677 15.4699 15.1702 15.462L15.1774 15.4252L15.1811 15.3952L15.1856 15.3173L15.1875 15.2115V5.8125H13.1978C12.8621 5.81253 12.5392 5.68396 12.2954 5.45323C12.0517 5.2225 11.9055 4.90714 11.8871 4.572L11.8853 4.5V2.43938L11.8335 2.4375ZM9 5.0625C9.13983 5.06251 9.27465 5.11459 9.37816 5.20861C9.48167 5.30262 9.54645 5.43182 9.55987 5.571L9.5625 5.625V12.375C9.56243 12.5195 9.50678 12.6583 9.4071 12.7629C9.30741 12.8674 9.17132 12.9296 9.02703 12.9366C8.88274 12.9435 8.74131 12.8947 8.63205 12.8002C8.52279 12.7057 8.45406 12.5728 8.44012 12.429L8.4375 12.375V5.625C8.4375 5.47582 8.49676 5.33274 8.60225 5.22725C8.70774 5.12176 8.85082 5.0625 9 5.0625ZM6.375 6.5625C6.51483 6.56251 6.64965 6.61459 6.75316 6.70861C6.85667 6.80262 6.92145 6.93181 6.93488 7.071L6.9375 7.125V11.25C6.93743 11.3945 6.88178 11.5333 6.7821 11.6379C6.68241 11.7424 6.54632 11.8046 6.40203 11.8116C6.25774 11.8185 6.11631 11.7697 6.00705 11.6752C5.89779 11.5807 5.82906 11.4478 5.81512 11.304L5.8125 11.25V7.125C5.8125 6.97582 5.87176 6.83274 5.97725 6.72725C6.08274 6.62176 6.22582 6.5625 6.375 6.5625ZM11.625 7.3125C11.7648 7.31251 11.8996 7.36459 12.0032 7.45861C12.1067 7.55262 12.1715 7.68182 12.1849 7.821L12.1875 7.875V10.5C12.1874 10.6445 12.1318 10.7833 12.0321 10.8879C11.9324 10.9924 11.7963 11.0546 11.652 11.0616C11.5077 11.0685 11.3663 11.0197 11.257 10.9252C11.1478 10.8307 11.0791 10.6978 11.0651 10.554L11.0625 10.5V7.875C11.0625 7.72582 11.1218 7.58274 11.2273 7.47725C11.3327 7.37176 11.4758 7.3125 11.625 7.3125ZM13.0103 3.21788V4.5C13.0102 4.54388 13.0256 4.58638 13.0537 4.6201C13.0818 4.65381 13.1208 4.6766 13.164 4.6845L13.1978 4.6875H14.5035L13.0103 3.21788Z",fill:"#2FBC52"})}),Wkt=E.forwardRef(zkt),Hkt=(t,e)=>p.jsx("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:p.jsx("path",{d:"M15.778 1.75C16.4531 1.74993 17.1046 1.9982 17.6085 2.4475L17.707 2.54L20.929 5.711C21.4202 6.19444 21.7119 6.84469 21.7465 7.533L21.75 7.671V20.282C21.75 20.787 21.6905 21.079 21.52 21.382C21.3602 21.666 21.1192 21.8958 20.828 22.042C20.5485 22.184 20.281 22.2405 19.842 22.249L19.718 22.25H4.282C3.767 22.25 3.477 22.1965 3.172 22.042C2.88078 21.8958 2.63983 21.666 2.48 21.382C2.3235 21.104 2.2605 20.8355 2.2515 20.404L2.25 20.282V3.718C2.25 3.213 2.3095 2.921 2.48 2.618C2.64 2.333 2.878 2.108 3.172 1.958C3.4515 1.816 3.719 1.7595 4.158 1.751L4.282 1.75H15.778ZM15.778 3.25H4.206L4.0735 3.2535L4.0235 3.2565L3.9465 3.265C3.91339 3.26995 3.88131 3.28025 3.8515 3.2955C3.82429 3.30759 3.80168 3.3281 3.787 3.354C3.78112 3.36339 3.77642 3.37346 3.773 3.384L3.7635 3.433L3.7585 3.473L3.7525 3.577L3.7505 3.667L3.75 20.282L3.7525 20.423L3.759 20.5275L3.764 20.5675L3.773 20.616L3.7805 20.634C3.79459 20.6655 3.8199 20.6906 3.8515 20.7045L3.8785 20.717L3.91 20.727L3.963 20.7375L3.997 20.7415L4.085 20.747L4.206 20.7495L19.718 20.75L19.915 20.747L20.003 20.742L20.037 20.7375L20.09 20.7275C20.1103 20.722 20.1299 20.7143 20.1485 20.7045C20.1757 20.6924 20.1983 20.6719 20.213 20.646C20.2189 20.6366 20.2236 20.6265 20.227 20.616L20.2365 20.567L20.2415 20.527L20.2475 20.423L20.25 20.282V7.75H17.597C17.1495 7.75003 16.7189 7.57861 16.3939 7.27097C16.0689 6.96333 15.8741 6.54286 15.8495 6.096L15.847 6V3.2525L15.778 3.25ZM12 6.75C12.1864 6.75001 12.3662 6.81946 12.5042 6.94481C12.6422 7.07016 12.7286 7.24242 12.7465 7.428L12.75 7.5V16.5C12.7499 16.6926 12.6757 16.8778 12.5428 17.0172C12.4099 17.1566 12.2284 17.2395 12.036 17.2488C11.8437 17.258 11.6551 17.1929 11.5094 17.0669C11.3637 16.9409 11.2721 16.7637 11.2535 16.572L11.25 16.5V7.5C11.25 7.30109 11.329 7.11032 11.4697 6.96967C11.6103 6.82902 11.8011 6.75 12 6.75ZM8.5 8.75C8.68644 8.75001 8.8662 8.81946 9.00421 8.94481C9.14222 9.07016 9.2286 9.24242 9.2465 9.428L9.25 9.5V15C9.2499 15.1926 9.17571 15.3778 9.0428 15.5172C8.90988 15.6566 8.72843 15.7395 8.53604 15.7488C8.34366 15.758 8.15508 15.6929 8.0094 15.5669C7.86371 15.4409 7.77209 15.2637 7.7535 15.072L7.75 15V9.5C7.75 9.30109 7.82902 9.11032 7.96967 8.96967C8.11032 8.82902 8.30109 8.75 8.5 8.75ZM15.5 9.75C15.6864 9.75001 15.8662 9.81946 16.0042 9.94481C16.1422 10.0702 16.2286 10.2424 16.2465 10.428L16.25 10.5V14C16.2499 14.1926 16.1757 14.3778 16.0428 14.5172C15.9099 14.6566 15.7284 14.7395 15.536 14.7488C15.3437 14.758 15.1551 14.6929 15.0094 14.5669C14.8637 14.4409 14.7721 14.2637 14.7535 14.072L14.75 14V10.5C14.75 10.3011 14.829 10.1103 14.9697 9.96967C15.1103 9.82902 15.3011 9.75 15.5 9.75ZM17.347 4.2905V6C17.347 6.05851 17.3675 6.11518 17.4049 6.16013C17.4424 6.20508 17.4944 6.23547 17.552 6.246L17.597 6.25H19.338L17.347 4.2905Z",fill:"#34322D"})}),vie=E.forwardRef(Hkt),Vkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 6.225C0.75 4.965 0.75 4.335 0.99525 3.8535C1.21096 3.43015 1.55515 3.08596 1.9785 2.87025C2.46 2.625 3.09 2.625 4.35 2.625H9.15C10.41 2.625 11.04 2.625 11.5215 2.87025C11.9448 3.08596 12.289 3.43015 12.5048 3.8535C12.6848 4.2075 12.7327 4.64175 12.7455 5.34787L1
11005.2486 4.45987C16.2247 4.11375 17.25 4.8375 17.25 5.87363V11.7067C17.25 12.7552 16.2019 13.4801 15.2213 13.1104L12.75 12.1793C12.747 13.1756 12.7222 13.7197 12.5048 14.1465C12.289 14.5698 11.9448 14.914 11.5215 15.1298C11.04 15.375 10.41 15.375 9.15 15.375H4.35C3.09 15.375 2.46 15.375 1.9785 15.1298C1.55515 14.914 1.21096 14.5698 0.99525 14.1465C0.75 13.665 0.75 13.035 0.75 11.775V6.225ZM4.35 4.125H9.15C9.80475 4.125 10.2056 4.12613 10.5056 4.15088C10.6455 4.16213 10.7299 4.17637 10.7812 4.18837C10.8014 4.19313 10.8212 4.19927 10.8405 4.20675C10.9816 4.27865 11.0963 4.39338 11.1683 4.5345L11.1731 4.54613C11.1757 4.55438 11.1806 4.56938 11.1866 4.59375C11.1986 4.64512 11.2129 4.7295 11.2241 4.86937C11.2489 5.16937 11.25 5.57025 11.25 6.225V11.775C11.25 12.4297 11.2489 12.8306 11.2241 13.1306C11.2183 13.2233 11.2058 13.3154 11.1866 13.4062C11.183 13.4224 11.1785 13.4383 11.1731 13.4539L11.1683 13.4655C11.0963 13.6066 10.9816 13.7213 10.8405 13.7933L10.8289 13.7981C10.8206 13.8007 10.8056 13.8056 10.7812 13.8116C10.6904 13.8308 10.5983 13.8433 10.5056 13.8491C10.2056 13.8739 9.80475 13.875 9.15 13.875H4.35C3.69525 13.875 3.29437 13.8739 2.99437 13.8491C2.90171 13.8433 2.8096 13.8308 2.71875 13.8116C2.70264 13.808 2.68674 13.8035 2.67113 13.7981L2.6595 13.7933C2.51838 13.7213 2.40365 13.6066 2.33175 13.4655L2.32687 13.4539C2.3215 13.4383 2.317 13.4224 2.31337 13.4062C2.29423 13.3154 2.2817 13.2233 2.27587 13.1306C2.25075 12.8306 2.25 12.4297 2.25 11.775V6.225C2.25 5.57025 2.25112 5.16937 2.2755 4.86937C2.28675 4.7295 2.30175 4.64512 2.31337 4.59375C2.31938 4.56938 2.32425 4.55438 2.32687 4.54613L2.33175 4.5345C2.40365 4.39338 2.51838 4.27865 2.6595 4.20675L2.67113 4.20187C2.67938 4.19925 2.69438 4.19437 2.71875 4.18837C2.77012 4.17637 2.8545 4.16213 2.99437 4.15088C3.29437 4.12613 3.69525 4.125 4.35 4.125ZM12.75 10.5761L15.75 11.7067V5.87363L12.75 6.9375V10.5761Z",fill:"#FF9500",stroke:"#F8F8F7",strokeWidth:.2}),p.jsx("path",{d:"M7 9C7.82843 9 8.5 8.32843 8.5 7.5C8.5 6.67157 7.82843 6 7 6C6.17157 6 5.5 6.67157 5.5 7.5C5.5 8.32843 6.17157 9 7 9Z",stroke:"#FF9500",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M9 12C9 10.8943 8.10361 10 7 10C5.89639 10 5 10.8943 5 12",stroke:"#FF9500",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})]}),qkt=E.forwardRef(Vkt),Kkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 8.3C1 6.62 1 5.78 1.327 5.138C1.61462 4.57354 2.07354 4.11462 2.638 3.827C3.28 3.5 4.12 3.5 5.8 3.5H12.2C13.88 3.5 14.72 3.5 15.362 3.827C15.9265 4.11462 16.3854 4.57354 16.673 5.138C16.913 5.61 16.977 6.189 16.994 7.1305L20.3315 5.9465C21.633 5.485 23 6.45 23 7.8315V15.609C23 17.007 21.6025 17.9735 20.295 17.4805L17 16.239C16.996 17.5675 16.963 18.293 16.673 18.862C16.3854 19.4265 15.9265 19.8854 15.362 20.173C14.72 20.5 13.88 20.5 12.2 20.5H5.8C4.12 20.5 3.28 20.5 2.638 20.173C2.07354 19.8854 1.61462 19.4265 1.327 18.862C1 18.22 1 17.38 1 15.7V8.3ZM5.8 5.5H12.2C13.073 5.5 13.6075 5.5015 14.0075 5.5345C14.194 5.5495 14.3065 5.5685 14.375 5.5845C14.4019 5.59083 14.4283 5.59902 14.454 5.609C14.6422 5.70487 14.7951 5.85785 14.891 6.046L14.8975 6.0615C14.901 6.0725 14.9075 6.0925 14.9155 6.125C14.9315 6.1935 14.9505 6.306 14.9655 6.4925C14.9985 6.8925 15 7.427 15 8.3V15.7C15 16.573 14.9985 17.1075 14.9655 17.5075C14.9578 17.631 14.941 17.7539 14.9155 17.875C14.9107 17.8965 14.9047 17.9177 14.8975 17.9385L14.891 17.954C14.7951 18.1422 14.6422 18.2951 14.454 18.391L14.4385 18.3975C14.4275 18.401 14.4075 18.4075 14.375 18.4155C14.2539 18.441 14.131 18.4578 14.0075 18.4655C13.6075 18.4985 13.073 18.5 12.2 18.5H5.8C4.927 18.5 4.3925 18.4985 3.9925 18.4655C3.86895 18.4578 3.74613 18.441 3.625 18.4155C3.60352 18.4107 3.58232 18.4047 3.5615 18.3975L3.546 18.391C3.35785 18.2951 3.20487 18.1422 3.109 17.954L3.1025 17.9385C3.09534 17.9177 3.08933 17.8965 3.0845 17.875C3.05898 17.7539 3.04227 17.631 3.0345 17.5075C3.001 17.1075 3 16.573 3 15.7V8.3C3 7.427 3.0015 6.8925 3.034 6.4925C3.049 6.306 3.069 6.1935 3.0845 6.125C3.0925 6.0925 3.099 6.0725 3.1025 6.0615L3.109 6.046C3.20487 5.85785 3.35785 5.70487 3.546 5.609L3.5615 5.6025C3.5725 5.599 3.5925 5.5925 3.625 5.5845C3.6935 5.5685 3.806 5.5495 3.9925 5.5345C4.3925 5.5015 4.927 5.5 5.8 5.5
1100ZM17 14.1015L21 15.609V7.8315L17 9.25V14.1015Z",fill:"#34322D",stroke:"#F8F8F7",strokeWidth:.6}),p.jsx("path",{d:"M9.33594 12C10.4405 12 11.3359 11.1046 11.3359 10C11.3359 8.89543 10.4405 8 9.33594 8C8.23137 8 7.33594 8.89543 7.33594 10C7.33594 11.1046 8.23137 12 9.33594 12Z",stroke:"#34322D",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M11.9974 15.9987C11.9974 14.5244 10.8022 13.332 9.33073 13.332C7.85925 13.332 6.66406 14.5244 6.66406 15.9987",stroke:"#34322D",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})]}),Gkt=E.forwardRef(Kkt),Zkt=(t,e)=>p.jsxs("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsxs("g",{clipPath:"url(#clip0_17184_18519)",children:[p.jsx("mask",{id:"mask0_17184_18519",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:0,y:0,width:24,height:24,children:p.jsx("path",{d:"M23.5 0.5V23.5H0.5V0.5H23.5Z",fill:"white",stroke:"white"})}),p.jsxs("g",{mask:"url(#mask0_17184_18519)",children:[p.jsx("path",{d:"M20 15.0143V8.98571V15.0143ZM16 19V5V19ZM12 17V7V17ZM4 15V9V15ZM8 21V3V21Z",fill:"black"}),p.jsx("path",{d:"M20 15.0143V8.98571M16 19V5M12 17V7M4 15V9M8 21V3",stroke:"#007AFF",strokeWidth:2})]})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_17184_18519",children:p.jsx("rect",{width:24,height:24,fill:"white"})})})]}),Ykt=E.forwardRef(Zkt),Qkt=(t,e)=>p.jsxs("svg",{width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t,children:[p.jsxs("g",{clipPath:"url(#clip0_18380_21466)",children:[p.jsx("mask",{id:"mask0_18380_21466",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:0,y:0,width:24,height:24,children:p.jsx("path",{d:"M23.5 0.5V23.5H0.5V0.5H23.5Z",fill:"white",stroke:"white"})}),p.jsxs("g",{mask:"url(#mask0_18380_21466)",children:[p.jsx("path",{d:"M20 15.0143V8.98571V15.0143ZM16 19V5V19ZM12 17V7V17ZM4 15V9V15ZM8 21V3V21Z",fill:"#34322D"}),p.jsx("path",{d:"M20 15.0143V8.98571M16 19V5M12 17V7M4 15V9M8 21V3",stroke:"#34322D",strokeWidth:1.5})]})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_18380_21466",children:p.jsx("rect",{width:24,height:24,fill:"white"})})})]}),bie=E.forwardRef(Qkt),fn={image:"create_image",video:"create_video",audio:"create_audio",docs:"create_docs",slide:"create_slide",factCheck:"factCheck",speechVideo:"create_speech_video",voiceDictation:"create_voiceDictation"},pMt=[{type:fn.image,icon:Skt,iconGray:kkt,iconSmall:Ikt},{type:fn.video,icon:Dkt,iconGray:Bkt,iconSmall:Ukt},{type:fn.slide,icon:Pkt,iconGray:Mkt,iconSmall:jkt},{type:fn.docs,icon:vkt,iconGray:yie,iconSmall:yie},{type:fn.factCheck,icon:Ekt,iconGray:wie,iconSmall:wie},{type:fn.speechVideo,icon:qkt,iconGray:Gkt,iconSmall:ykt},{type:fn.audio,icon:Wkt,iconGray:vie,iconSmall:vie},{type:fn.voiceDictation,icon:Ykt,iconGray:bie,iconSmall:bie}];function Xkt(){const{isNeedPurchase:t,isPurchaseGateReady:e,session:n}=dx(),r=A8t(),i=Ah(),s=jS();return E.useCallback(()=>n!=null&&n.address&&s&&!e?!1:e&&(t||r)?(s||i.setNeedPurchaseDialogIsOpen(!0),!1):!0,[t,s,e,r,i,n==null?void 0:n.address])}function WN(t){if(typeof t=="string")return/^https:\/\/[a-z0-9]+(?:-[a-z0-9]+)*\.trycloudflare\.com\/vnc\.html(?:\?autoconnect=true&resize=scale)?$/.test(t)?t:void 0}function xie(t){const e=t.kind==="browser_ready"?WN(t.browser_url):void 0;if(e)return e;if(typeof t.msg!="string")return;const n=t.msg.match(/https:\/\/[^\s<>"'`\\ï¼ãï¼ï¼ï¼ï¼ï¼ãã]+/g)??[];for(const r of n.reverse()){const i=WN(r.replace(/[)\]},.;:!]+$/,"").replace(/&/g,"&"));if(i)return i}}function Q6(t){try{if(!t||typeof t!="object"||!("additional_data"in t))return;const e=typeof t.additional_data=="string"?JSON.parse(t.additional_data):t.additional_data;if(!e||typeof e!="object"||!("work_mode"in e))return;const n=e.work_mode;return!n||typeof n!="object"||!("browser_url"in n)?void 0:WN(n.browser_url)}catch{return}}const Jkt=()=>{const t=Jo(),e=Math.floor(Date.now()/1e3),n=zme(e);return new vme({apiUrl:t,apiKey:n})},e3e="c",e$t="pilot";function t$t(t){return`/${e3e}/${encodeURIComponent(t)}`}function gMt(){return`/${e$t}`}function t3e(t,e){const n=JE(t,eD(e));return n&&(t===n||t.startsWith(`${n}
1100/`))?{prefix:n,pathname:t.slice(n.length)||"/"}:{prefix:n,pathname:t}}function Eie(t,e=""){const{pathname:n}=t3e(t,e),r=n.split("/").filter(Boolean),i=hp.locales.includes(r[0])?1:0;if(r[i]!==e3e||!r[i+1])return null;try{return decodeURIComponent(r[i+1])}catch{return r[1]}}function Cie(t){var e,n;return((e=t.get("thread_id"))==null?void 0:e.trim())||((n=t.get("threadId"))==null?void 0:n.trim())||null}function mMt(t){const e=t==null?void 0:t.trim();if(!e)return null;const n=typeof window<"u"?window.location.origin:"https://xbubble.ai";try{const r=new URL(e,n);return Eie(r.pathname,r.host)??Cie(r.searchParams)}catch{const[r]=e.split("#"),[i,s=""]=r.split("?"),o=i.startsWith("/")?i:`/${i}`;return Eie(o)??Cie(new URLSearchParams(s))}}function n$t(t){if(typeof window>"u")return;const{prefix:e}=lse(),{pathname:n}=t3e(window.location.pathname,window.location.host),r=n.split("/").filter(Boolean),i=hp.locales.includes(r[0])?r[0]:hp.defaultLocale,s=`${e}/${i}${t$t(t)}`,o=new URLSearchParams(window.location.search);o.delete("_rsc");const a=`${s}${o.size>0?`?${o.toString()}`:""}`;`${window.location.pathname}${window.location.search||""}`!==a&&window.history.replaceState(window.history.state,"",a)}function r$t(t,e){return t instanceof Error&&t.message?t.message:e}function nu(t){return t.trim()}class i$t{constructor(){Ft(this,"baseURI","https://gateway-api.dappos.com")}createFetch(){return u5.create({baseURL:this.baseURI,timeout:3e4,retry:1,headers:{Accept:"application/json"},onRequest({options:e}){const n=ia.getAuthHeader();n&&(e.headers=new Headers(e.headers),e.headers.set("Authorization",n))},onResponseError({response:e}){var i;(e==null?void 0:e.status)===403||(e==null||e.status);const n=e==null?void 0:e._data,r=((i=n==null?void 0:n.error)==null?void 0:i.message)??`Request failed: ${e==null?void 0:e.status}`;throw new Error(r)},onRequestError({error:e}){throw new Error(r$t(e,"Failed to fetch"))}})}get fetch(){return this.createFetch()}async ensureUserByEoa(e){const n=nu(e.eoa);if(!n)throw new Error("EOA address is required");return(await this.fetch("/api/v1/users/eoa",{method:"POST",body:{eoa_address:n}})).user}async listUserDevices(e){const n=nu(e.eoa);if(!n)throw new Error("EOA address is required");return(await this.fetch(`/api/v1/users/eoa/${n}/devices`)).items??[]}async createUserDevice(e){var i,s;const n=nu(e.eoa);if(!n)throw new Error("EOA address is required");const r={};return(i=e.deviceId)!=null&&i.trim()&&(r.device_id=e.deviceId.trim()),(s=e.name)!=null&&s.trim()&&(r.name=e.name.trim()),this.fetch(`/api/v1/users/eoa/${n}/devices`,{method:"POST",body:r})}async createPairingCode(e){var i;const n=nu(e.eoa);if(!n)throw new Error("EOA address is required");const r={};return(i=e.name)!=null&&i.trim()&&(r.name=e.name.trim()),this.fetch(`/api/v1/users/eoa/${n}/pairing-codes`,{method:"POST",body:r})}async regeneratePairingCode(e){var i;const n=nu(e.eoa);if(!n)throw new Error("EOA address is required");const r={};return(i=e.name)!=null&&i.trim()&&(r.name=e.name.trim()),this.fetch(`/api/v1/users/eoa/${n}/pairing-codes/regenerate`,{method:"POST",body:r})}async bindDevice(e){const n=nu(e.eoa),r=e.deviceId.trim();if(!n)throw new Error("EOA address is required");if(!r)throw new Error("Device id is required");return this.fetch(`/api/v1/users/eoa/${n}/devices/${r}/bind`,{method:"POST",body:{}})}async unbindDevice(e){const n=nu(e.eoa),r=e.deviceId.trim();if(!n)throw new Error("EOA address is required");if(!r)throw new Error("Device id is required");return this.fetch(`/api/v1/users/eoa/${n}/devices/${r}/unbind`,{method:"POST",body:{}})}async disableDevice(e){var s;const n=nu(e.eoa),r=e.deviceId.trim();if(!n)throw new Error("EOA address is required");if(!r)throw new Error("Device id is required");const i=(s=e.reason)==null?void 0:s.trim();return this.fetch(`/api/v1/users/eoa/${n}/devices/${r}/disable`,{method:"POST",body:i?{reason:i}:{}})}async renameDevice(e){const n=nu(e.eoa),r=e.deviceId.trim(),i=e.name.trim();if(!n)throw new Error("EOA address is required");if(!r)throw new Error("Device id is required");if(!i)throw new Error("Device name is required");return this.fetch(`/api/v1/users/eoa/${n}/devices/${r}/rename`,{method:"PUT",body:{name:i}})}}const s$t=new i$t;function o$t(){var s,o;const{session:t}=ywe(),e=E.useMemo(()=>nu((t==null?void 0:t.address)??""),[t==null?void 0:t.address]),n=gme({queryKey:["gateway_devices",e],enabled:!!e,queryFn:()=>s$t.listUserDevices({eoa:e}),staleTime:6e4,refetchOnWindowFocus:!1}),r=((s=n.data)==null?void 0:s.length)??0,i=((o=n.data)==null?void 0:o.filter(a=>a.device.status==="online").length)??0;return{eoa:e,linkedDeviceCount:r,onlineDeviceCount:i,hasLinkedDevices:r>0,hasOnlineDevices:i>0,isLoadingLinkedDevices:n.isLoading,devicesQuery:n}}const XP="account-storage-sync";function yMt(t,e){const n=E.useMemo(()=>`${U7}${t.toUpperCase()}`,[t]),[r,i]=hse(n,e);return[r,i]}function n3e(t,e,n={}){const i=wd(h=>{var f;return(f=h.session)==null?void 0:f.address}),{maxKeyLength:s=3,syncAcrossComponents:o=!1}=n,a=E.useMemo(()=>`${U7}${t.toUpperCase()}`,[t]),[c,l]=hse(a,{});E.useEffect(()=>{if(!o||typeof window>"u"||!a)return;const h=f=>{var b;if(((b=f.detail)==null?void 0:b.key)!==a)return;const y=window.localStorage.getItem(a),v=y?JSON.parse(y):{};l(v)};return window.addEventListener(XP,h),()=>{window.removeEventListener(XP,h)}},[a,l,o]);const u=E.useMemo(()=>!i||!c?e:c[Yee(i)]??e,[c,i,e]),d=E.useCallback((h,f)=>{const m=f||i;if(!a||!m)return;const y=Yee(m);let v=c??{};Object.keys(v).length>s&&(v=Object.fromEntries(Object.entries(v).slice(1)));const b={...v,[y]:h};l(b),o&&typeof window<"u"&&window.dispatchEvent(new CustomEvent(XP,{detail:{key:a}}))},[i,a,l,c,s,o]);return[u,d]}var a$t=(t=>(t.NETWORK_LIST="networkList",t.TOKEN_WHITE_LIST="tokenWhiteList",t.INTENT_TOKEN_LIST="intentTokenList",t.NODE_LIST="nodeList",t.APP_STATISTIC="appStatistic",t.DAPP_LIST="dappList",t.INTENT_POOL="intentPool",t.USER_BALANCE="userBalance",t.TWEET="TWEET",t.PUBLISHED_THREADS="PUBLISHED_THREADS",t.INVITE_CODE="INVITE_CODE",t.AUTH_SESSION="AUTH_SESSION_2",t.CONVERSATIONS_EXPANDED="conversationsExpanded",t.BUBBLES_UP_EXPANDED="bubblesUpExpanded",t))(a$t||{});function c$t(){const[t,e]=n3e("personal_mode",!1);return{isPersonalMode:E.useMemo(()=>typeof t=="boolean"?t:!1,[t]),setIsPersonalMode:e}}function l$t(t,e=2e3,n=5){const r=E.useRef(null),i=E.useRef(0),s=E.useCallback(()=>{r.current!==null&&(clearInterval(r.current),r.current=null),i.current=0,r.current=setInterval(()=>{i.current+=1,t(),i.current>=n&&r.current!==null&&(clearInterval(r.current),r.current=null)},e)},[t,e,n]),o=E.useCallback(()=>{r.current!==null&&(clearInterval(r.current),r.current=null),i.current=0},[]);return E.useEffect(()=>()=>{o()},[o]),{startPolling:s,stopPolling:o}}function wm(t){return t&&{[fn.image]:"Generating image...",[fn.video]:"Generating video...",[f
1100n.audio]:"Generating audio...",[fn.docs]:"Generating document...",[fn.slide]:"Generating slide...",[fn.speechVideo]:"Generating speech video...",[fn.factCheck]:"Fact checking...",[fn.voiceDictation]:"Processing voice dictation..."}[t]||"Generating content..."}function _ie(t){return t===fn.image?"image":t===fn.video||t===fn.speechVideo?"video":t===fn.slide||t===fn.docs?"file":t===fn.audio||t===fn.voiceDictation?"audio":"content"}function u$t(t,e){const n=t==null?void 0:t.media_kind;return n==="image"||n==="video"||n==="file"||n==="audio"||n==="site"?n:(t==null?void 0:t.type)==="image_generating"?"image":(t==null?void 0:t.type)==="file_generating"?"file":((t==null?void 0:t.type)==="content_generating",_ie(e))}function d$t(t,e){return e==="file"?t===fn.slide?wm(fn.slide):t===fn.docs?wm(fn.docs):"Generating file...":e==="image"?wm(fn.image):e==="video"?wm(t===fn.speechVideo?t:fn.video):e==="audio"?wm(fn.audio):e==="site"?"Building and deploying your website...":wm(t)}function JP(t,e){const n=u$t(e,t),r=crypto.randomUUID();return xo({type:"ai",content:[{type:"text",text:d$t(t,n)}],mediaGenerating:!0,mediaGenerated:!1,placeholderMessageId:r,id:r},n==="image",n==="video",n==="file",n==="audio",n==="site")}function Sie(t){return t.type==="image_generating"||t.type==="content_generating"||t.type==="file_generating"}function h$t(t){return t.type==="image_generated"||t.type==="content_generated"||t.type==="file_generated"}const f$t="###CODE_MODE###",p$t={search:{label:"search",value:"search",description:"searchDescription",msg:"BUBBLE_CHAT"},reSearch:{label:"reSearch",value:"reSearch",description:"reSearchDescription",msg:"DEEP_BUBBLE_CHAT"},code:{label:"code",value:"code",description:"codeDescription",msg:"CODE_MODE"}},r3e="code_mode_confirmation";function wMt(t){return t.name===r3e&&typeof t.args.original_prompt=="string"&&typeof t.args.enriched_prompt=="string"}function g$t(t){return JSON.stringify({action:"confirm",approved_prompt:t})}function m$t(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>!e||typeof e!="object"?"":"text"in e&&typeof e.text=="string"?e.text:"").join(""):""}function y$t(t){return t.type!=="human"?!1:("additional_kwargs"in t&&t.additional_kwargs?t.additional_kwargs:{}).mode==="code"?!0:m$t(t.content).includes(f$t)}function w$t(t){return t.some(y$t)}function v$t(t){return{id:t,eoa:"",title:"",time:"",threadId:t,path:t,isPublish:0,publishTime:"",backendUrl:"",summary:"",logo:"",publishSummary:"",publishTitle:"",publishJson:null}}const Aie=["videogen_status","tutorial_image_status","imagen_status","speech_videogen_status","audio_status","language_transform_status","code_mode_status"];function eR(t){const e=t==null?void 0:t.additional_data;if(typeof e!="string")return null;try{const r=JSON.parse(e).code_mode_result;return r&&typeof r=="object"?r:null}catch{return null}}function tR(t){return(Array.isArray(t==null?void 0:t.artifacts)?t.artifacts:[]).some(n=>{const r=n==null?void 0:n.code_mode_result;return(r==null?void 0:r.kind)==="code_mode_text_answer"&&(r==null?void 0:r.read_only)===!0&&(r==null?void 0:r.deployment_skipped)===!0})}function nR(t){return t.filter(e=>!e.mediaGenerating||e.mediaGenerated||!e.sites?!0:e.placeholderMessageId!==e.id)}function gy(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim().length>0){const e=Date.parse(t);if(Number.isFinite(e))return e;const n=Number(t);if(Number.isFinite(n))return n}}function VU(t){var e;return gy(t.createdAt)??gy(t.created_at)??gy((e=t.additional_kwargs)==null?void 0:e.createdAt)}function b$t(t,e){return e===void 0?!0:(VU(t)??Number.MAX_SAFE_INTEGER)>=e}function S2(t){return t==="running"||t==="pending"}function i3e(t){var e;return typeof((e=t==null?void 0:t.metadata)==null?void 0:e.human_message_id)=="string"?t.metadata.human_message_id:void 0}function x$t(t,e){const n=t.find(r=>S2(r.status));return n?{isRunning:!0,runId:n.run_id,humanMessageId:i3e(n)??e}:{isRunning:!1}}function E$t(t,e){const n=[...t],r=new Set(n.map(i=>i.id).filter(Boolean));return e.forEach(i=>{i.id&&r.has(i.id)||(n.push(i),i.id&&r.add(i.id))}),n}function HN(t){return{...t,parts:t.parts.map(e=>({...e})),images:t.images?[...t.images]:t.images,videos:t.videos?[...t.videos]:t.videos,files:t.files?[...t.files]:t.files,audios:t.audios?[...t.audios]:t.audios,additional_kwargs:t.additional_kwargs?{...t.additional_kwargs}:void 0}}function kie(t){let e=-1;for(let i=t.length-1;i>=0;i--)if(t[i].type==="human"){e=i;break}if(e===-1)return;let n=-1;for(let i=e+1;i<t.length;i++)t[i].mediaGenerating&&(n=i);if(n===-1||n===t.length-1)return;const[r]=t.splice(n,1);r._rawMsg.additional_kwargs={...r._rawMsg.additional_kwargs??{},modified_at:Date.now()},t.push(r)}function C$t(t,e,n){var c;if(!((c=e==null?void 0:e.messages)!=null&&c.length))return t;const r=t.map(HN),i=new Set(r.map(l=>l.id)),s=e.messages.reduce((l,u,d)=>i.has(u.id)?d:l,-1),o=n!==void 0?e.messages.findIndex(l=>l.id===n):-1,a=s>=0?s+1:o>=0?o:e.messages.length;
1100return e.messages.slice(a).forEach(l=>{i.has(l.id)||(r.push(HN(l)),i.add(l.id))}),r}function _$t(t,e,n=!1){var i;if(!n||!((i=e==null?void 0:e.customEvents)!=null&&i.length))return t;const r=new Set;return[...t,...e.customEvents].filter(s=>{const o=`${s.createdAt}:${s.type}:${s.msg}`;return r.has(o)?!1:(r.add(o),!0)}).sort((s,o)=>s.createdAt-o.createdAt)}function $ie(t,e){const n=e.map(u=>{const d=gy(u.created_at),h=gy(u.updated_at);return d===void 0||h===void 0?null:{...u,createdAtMs:d,updatedAtMs:h}}).filter(u=>u!==null).sort((u,d)=>u.createdAtMs-d.createdAtMs);if(n.length===0)return t;const r=t.filter(u=>u.type==="human");if(r.length===0)return t;const i=new Set,s=new Set,o=new Map(r.map(u=>[u.id,u])),a=(u,d)=>{const{thought_duration_ms:h,...f}=u.additional_kwargs??{},m=S2(d.status);u.additional_kwargs={...f,run_id:d.run_id,thought_started_at_ms:d.createdAtMs,...m?{}:{thought_duration_ms:Math.max(0,d.updatedAtMs-d.createdAtMs)}}};n.forEach(u=>{var f;const d=typeof((f=u.metadata)==null?void 0:f.human_message_id)=="string"?u.metadata.human_message_id:void 0;if(!d)return;const h=o.get(d);h&&(a(h,u),i.add(d),s.add(u.run_id))});const c=r.filter(u=>!i.has(u.id)),l=n.filter(u=>!s.has(u.run_id)&&!S2(u.status));return c.slice(0,l.length).forEach((u,d)=>{a(u,l[d])}),t}function s3e(t,e){return{type:"tool_call",id:t.id??crypto.randomUUID(),name:t.name,args:t.args,status:"pending",_rawResultMsg:e,result:e==null?void 0:e.content.toString()}}function xo(t,e,n,r,i,s){var m;let o=typeof t.content=="string"?t.content:t.content.map(y=>"text"in y?y.text:void 0).join(""),a,c,l,u,d,h=t.mediaGenerating,f=t.mediaGenerated;if(Array.isArray(t.content)){a=t.content.map(b=>"image_url"in b?b.image_url:void 0).filter(b=>b!==void 0),a.length===0&&(a=void 0),c=t.content.map(b=>"video"in b?b.video:void 0).filter(b=>b!==void 0),c.length===0&&(c=void 0);const y=t.content.map(b=>"file"in b?b.file:void 0).filter(b=>b!==void 0),v=y.filter(b=>jre(b));l=y.filter(b=>!jre(b)),l.length===0&&(l=void 0),u=[...t.content.map(b=>"site"in b?b.site:void 0).filter(b=>b!==void 0),...v],u.length===0&&(u=void 0),d=t.content.map(b=>"audio"in b?b.audio:void 0).filter(b=>b!==void 0),d.length===0&&(d=void 0),(a&&a.length>0||c&&c.length>0||l&&l.length>0||u&&u.length>0||d&&d.length>0)&&(h=!1,f=!0),a===void 0&&c===void 0&&l===void 0&&u===void 0&&d===void 0&&(s?u=[]:i?d=[]:n?c=[]:r?l=[]:e&&(a=[]))}return{type:t.type,id:t.id??crypto.randomUUID(),content:o,images:a,videos:c,files:l,sites:u,audios:d,mediaGenerating:h,mediaGenerated:f,placeholderMessageId:t.placeholderMessageId,additional_kwargs:t.additional_kwargs,parts:"tool_calls"in t?((m=t.tool_calls)==null?void 0:m.map(y=>s3e(y,void 0)))??[]:[],createdAt:VU(t)??Date.now(),updateAt:gy(t.updated_at)??Date.now(),_rawMsg:t}}function S$t(t){var kt;const e=k$t(),n=c$t(),{isPersonalMode:r}=n,{hasOnlineDevices:i}=o$t(),s=Ah(),{setActiveThread:o,setThreadId:a}=s,{address:c,refreshAccountInfo:l,accountInfo:u}=dx(),d=Xkt(),{startPolling:h}=l$t(l,2e3,5),[f,m]=E.useState(t.threadPath),[y,v]=E.useState(t.threadId),[b,C]=E.useState(null),[x,_]=E.useState([]),[$,I]=E.useState(),[R,N]=E.useState([]);E.useEffect(()=>{(t.threadPath||t.threadId)&&o(null),t.threadId&&(v(t.threadId),a(t.threadId))},[t.threadId,t.threadPath,o,a]);const T=jS(),[O,U]=E.useState([]),z=E.useMemo(()=>w$t(O),[O]),L=z?"code":e.searchMode,S=E.useCallback(Ie=>{z&&Ie!=="code"||e.setSearchMode(Ie)},[z,e]),[k,M]=E.useState(),[W,H]=E.useState("idle"),[D,V]=E.useState([]),[B,P]=E.useState([]),[j,G]=E.useState(""),[Y,te]=E.useState(),[ae,oe]=E.useState();ywe();const{agentApi:de}=x8t(),{setOpen:ke,setOpenMobile:Be}=wx();E.useMemo(()=>Jkt(),[]);const[$e,He]=E.useState(void 0),Ge=E.useMemo(()=>Jo(),[]);E.useLayoutEffect(()=>{var Zt;const Ie=(b==null?void 0:b.path)??((Zt=s.activeThread)==null?void 0:Zt.path),It=y??s.threadId;if(!Ie&&!It||O.length===0)return;const rt={messages:O.map(HN),customEvents:x.map(yt=>({...yt})),runningMessages:D.map(yt=>({...yt})),activeRunHumanMessageId:ae};Ie&&is.setQueryData(["thread-live-snapshot",Ie],rt),It&&is.setQueryData(["thread-live-snapshot-by-id",It],rt)},[ae,(kt=s.activeThread)==null?void 0:kt.path,s.threadId,b==null?void 0:b.path,y,x,D,O]);const je=E.useMemo(()=>de.threads(Ge),[Ge]),xt=E.useCallback(Ie=>{const It=xie(Ie);It&&I(It);const rt=Date.now();_(Zt=>[...Zt,{type:Ie.type,msg:Ie.msg,kind:Ie.kind,browser_url:Ie.browser_url,createdAt:rt}])},[]),ft=E.useCallback(async(Ie,It)=>{const rt=await je.list(Ie),Zt=x$t(rt,It??ae);return U(yt=>{const pt=yt.map(St=>({...St,additional_kwargs:St.additional_kwargs?{...St.additional_kwargs}:St.additional_kwargs}));return $ie(pt,rt)}),Zt.isRunning?(H("running"),oe(Zt.humanMessageId)):(H("end"),oe(void 0)),Zt},[ae,je]),it=E.useCallback(Ie=>Ie!=null&&Ie.isRunning?(H("running"),oe(Ie.humanMessageId),!0):(H("end"),oe(void 0),!1),[]),be=gme({queryKey:["thread",t.threadPath,t.threadId,c],queryFn:async()=>{var ee,ie,ce;const Ie=t.threadPath,It=t.threadId;if(!Ie&&!It)return{messages:[],threadId:y,threadPath:null};let rt=It?is.getQueryData(["history-by-id",It]):is.getQueryData(["history",Ie]);
1100if(Ie&&!(rt!=null&&rt.threadId)&&(rt=await de.getTreadByPath({backendUrl:Ge,path:Ie})),It&&(!(rt!=null&&rt.threadId)||!rt.backendUrl)){const le=c;if(le){const _e=await de.getHistory({eoa:le,page:1,size:100});_e.dataList.forEach(me=>{is.setQueryData(["history",me.path],me),is.setQueryData(["history-by-id",me.threadId],me)}),rt=_e.dataList.find(me=>me.threadId===It)??rt}}const Zt=(rt==null?void 0:rt.threadId)??It;if(!Zt)throw md("Unable to load conversation",5e3),new Error("Unable to load conversation");const yt=rt??v$t(Zt);s.setThreadId(Zt);const pt=de.threads((rt==null?void 0:rt.backendUrl)||Ge),[St,qe,Et]=await Promise.all([pt.get(Zt),pt.getState(Zt),pt.list(Zt)]).catch(le=>{throw console.error("Thread get error",le),md("Unable to load conversation",5e3),le}),Ze=((ee=St==null?void 0:St.values)==null?void 0:ee.messages)??[],wt=((ie=(qe==null?void 0:qe.values)??qe.values)==null?void 0:ie.messages)??[],ot=E$t(Ze,wt);C(yt),v(Zt),is.setQueryData(["history-by-id",Zt],yt),yt.path&&is.setQueryData(["history",yt.path],yt),!s.activeThread&&yt&&s.setActiveThread({...yt});let qt=[],mt=[],Bt=new Map;ot.map(le=>{le.type==="tool"&&(Bt.has(le.tool_call_id)||Bt.set(le.tool_call_id,le))}),ot.map(le=>{var Ct,at,Gt,Dt;if(le.type==="tool"){qt.flatMap(zt=>zt.parts).map(zt=>{zt.id===le.tool_call_id&&(zt.status="success",zt._rawResultMsg=le,zt.result=le.content.toString())});return}const _e=Math.max(((Ct=qt.at(-1))==null?void 0:Ct.createdAt)??0,((at=mt.at(-1))==null?void 0:at.createdAt)??0),me=VU(le),we=me!==void 0&&me>_e?me:_e+1,Te=xo({...le,created_at:we});qt.push(Te),"progressMsg"in(le.additional_kwargs??{})&&Array.isArray((Gt=le.additional_kwargs)==null?void 0:Gt.progressMsg)&&((Dt=le.additional_kwargs)==null?void 0:Dt.progressMsg).map(kn=>{var Hn;const Cn=Math.max(Te.createdAt,((Hn=mt.at(-1))==null?void 0:Hn.createdAt)??0)+1;mt.push({type:kn.type,msg:kn.msg,kind:kn.kind,browser_url:kn.browser_url,createdAt:Cn})})}),qt.map(le=>{le.parts.map(_e=>{if(_e.type==="tool_call"){const me=Bt.get(_e.id);me&&_e.status!=="success"&&(console.log("pick",me),_e.status="success",_e._rawResultMsg=me,_e.result=me.content.toString())}})}),St.interrupts&&Object.entries(St.interrupts).forEach(([le,_e])=>{_e.map(we=>{typeof we.value=="object"&&"type"in we.value&&we.value.type==="ai"&&qt.push(xo(we.value))})});const un=Et.find(le=>S2(le.status)),Ve=i3e(un),st=(Ie?is.getQueryData(["thread-live-snapshot",Ie]):void 0)??is.getQueryData(["thread-live-snapshot-by-id",Zt]),X=Ve??(st==null?void 0:st.activeRunHumanMessageId);return qt=C$t(qt,st,X),$ie(qt,Et),tR(eR((qe==null?void 0:qe.values)??null))&&(qt=nR(qt)),mt=_$t(mt,st,!!un),I(Q6(qe==null?void 0:qe.values)??Q6(St==null?void 0:St.values)??mt.map(xie).findLast(le=>!!le)),un?(H("running"),oe(X),V((st==null?void 0:st.runningMessages)??[])):(oe(void 0),V([])),U(qt),_(mt),s.setActiveThread({...yt}),un&&!mn.isPending&&mn.mutate({runId:un.run_id,thread:yt,endMessageId:(ce=ot.at(-1))==null?void 0:ce.id}),{interrupts:St==null?void 0:St.interrupts,messages:ot.map((le,_e,me)=>({...le,createdAt:Date.now(),id:le.id??crypto.randomUUID()})),threadId:Zt}},staleTime:0,gcTime:0,refetchOnWindowFocus:!1,enabled:!!t.threadPath||!!t.threadId}),Lt=E.useMemo(()=>f||t.threadId?be.isPending:!1,[be.isPending,t.threadId,f]),Qe=E.useRef(null),Ue=E.useCallback(async Ie=>{Qe.current&&(Qe.current.abort(Ie??"abort"),Qe.current=null,U(It=>It.map(rt=>rt.mediaGenerating&&!rt.mediaGenerated?{...rt,mediaGenerating:!1,mediaGenerated:!1,placeholderMessageId:void 0,content:"Generation aborted"}:rt)))},[]),Ye=E.useRef(!1),tt=E.useRef(!1),ze=E.useRef(null),Ne=E.useRef(null),J=({messages:Ie,createdThread:It,finallyOutput:rt,sources:Zt})=>{const yt=Ie.filter(St=>{var qe;return!!((qe=St.id)!=null&&qe.startsWith("run-")&&!rt)}),pt=Ie.filter(St=>{var qe,Et,Ze,wt;return!((qe=St.id)!=null&&qe.startsWith("msg_")||(Et=St.id)!=null&&Et.startsWith("run-")&&!rt||(Ze=St.id)!=null&&Ze.startsWith("00000000-")||(wt=St.id)!=null&&wt.startsWith("lc_run--"))});rt&&H("end"),yt.length>0&&V(St=>{for(const qe of yt){const Et=qe.id,Ze=St.findIndex(ot=>ot.id===Et),wt=Date.now();return Ze===-1?[...St,{...qe,content:qe.content,createdAt:wt,updateAt:wt}]:St.map((ot,qt)=>qt===Ze?{...ot,additional_kwargs:qe.additional_kwargs,content:qe.content,id:ot.id,updateAt:wt}:ot)}return St}),pt.length>0&&(console.log("newUiMessages",JSON.parse(JSON.stringify(pt))),U(St=>{var Et,Ze,wt;const qe=[...St];for(const ot of pt){const qt=qe.findLast(ie=>ie.mediaGenerating),mt=Aie.some(ie=>{var ce;return((ce=ot.additional_kwargs)==null?void 0:ce[ie])==="failed"})||Object.keys(ot.additional_kwargs??{}).some(ie=>{var ce;return((ce=ot.additional_kwargs)==null?void 0:ce[ie])==="failed"&&ie.endsWith("_status")}),Bt=tt.current===!0,un=qe.some(ie=>ie.id===ot.id);if((mt||Bt)&&qt&&qt.placeholderMessageId){const ie=qe.findLastIndex(ce=>ce.id===qt.placeholderMessageId);ie!==-1&&(qe[ie]={...qe[ie],mediaGenerating:!1,mediaGenerated:!0})}const Ve=qe.find(ie=>ie.mediaGenerating)??(Bt&&qt?qe.find(ie=>ie.id===(qt==null?void 0:qt.placeholderMessageId)):void 0);if(Ve&&Ve.placeholderMessageId&&Array.isArray(ot.content)&&!un&&b$t(ot,Ve.createdAt)){const ie=Array.isArray(ot.content)?ot.content:[];
1100if(ie.find(we=>we.type==="image_url")){const we=xo(ot),Te=qe.findIndex(Ct=>Ct.id===Ve.placeholderMessageId);Te!==-1&&(qe[Te]={...qe[Te],mediaGenerating:!1,mediaGenerated:!0,content:we.content,images:we.images,updateAt:Date.now(),id:we.id})}if(ie.find(we=>we.type==="video_url")){const we=xo(ot),Te=qe.findIndex(Ct=>Ct.id===Ve.placeholderMessageId);Te!==-1&&(qe[Te]={...qe[Te],mediaGenerating:!1,mediaGenerated:!0,content:we.content,videos:we.videos,updateAt:Date.now(),id:we.id})}if(ie.find(we=>we.type==="file_url"||we.type==="site_url")){const we=xo(ot),Te=qe.findIndex(Ct=>Ct.id===Ve.placeholderMessageId);Te!==-1&&(qe[Te]={...qe[Te],mediaGenerating:!1,mediaGenerated:!0,content:we.content,files:we.files,sites:we.sites,updateAt:Date.now(),id:we.id})}if(ie.find(we=>we.type==="audio_url")){const we=xo(ot),Te=qe.findIndex(Ct=>Ct.id===Ve.placeholderMessageId);Te!==-1&&(qe[Te]={...qe[Te],mediaGenerating:!1,mediaGenerated:!0,content:we.content,audios:we.audios,updateAt:Date.now(),id:we.id})}}const st=xo(ot),X=Math.max(st.createdAt,Math.max(...qe.map(ie=>ie.createdAt))+1);if(st.createdAt=X,ot.type==="tool"){const ie=qe.flatMap(ce=>ce.parts).find(ce=>ce.id===ot.tool_call_id);ie&&!ie.result&&(ie.result=st.content,ie._rawResultMsg=ot,ie.status="success");continue}const ee=qe.findIndex(ie=>ie.id===ot.id);if(ee===-1){if(console.log("push uiMessage",st,qe),st.type==="AIMessageChunk"&&Zt){const ie=s3e(Zt,void 0);st.parts=[...st.parts,ie]}if((Et=qe.at(-1))!=null&&Et.id.startsWith("10000000-")&&((Ze=qe.at(-2))==null?void 0:Ze.type)==="human"&&st.type==="ai"){const ie=qe.pop();ie&&ie.id.startsWith("10000000-")&&(qe.push(st),qe.push(ie))}else qe.push(st),kie(qe)}else qe.forEach((ie,ce)=>{ce===ee&&(ie.content=st.content,ie.updateAt=st.updateAt)})}return((wt=qe.at(-1))==null?void 0:wt.type)==="ai"?qe.filter(ot=>ot.type!=="AIMessageChunk"):[...qe]}))},q=async(Ie,It)=>{if(At)return;const rt=Ie.findLast(qe=>qe.type==="human"),Zt=c;if(!Zt)throw new Error("Account address is required");const yt=s.mediaKey??Wme();if(s.mediaKey||s.setMediaKey(yt),!d())return;rt&&(te(rt.id),oe(rt.id)),U(qe=>(Ie.map(Et=>{if(Et.type==="tool"){const Ze=qe.flatMap(wt=>wt.parts).find(wt=>wt.id===Et.tool_call_id);Ze&&(Ze.result=Et.content.toString(),Ze._rawResultMsg=Et,Ze.status="success")}else qe.findIndex(wt=>wt.id===Et.id)===-1&&qe.push(xo(Et))}),[...qe])),G("");let pt={};k?pt={...k,language:s.lang,data_key:yt,create_image:$e===fn.image?!0:k==null?void 0:k.create_image,create_video:$e===fn.video?!0:k==null?void 0:k.create_video,create_docs:$e===fn.docs?!0:k==null?void 0:k.create_docs,create_slide:$e===fn.slide?!0:k==null?void 0:k.create_slide,messages:[...k.messages,...Ie]}:pt={eoa_address:Zt,data_key:yt,language:s.lang,create_image:$e===fn.image?!0:void 0,create_video:$e===fn.video?!0:void 0,create_docs:$e===fn.docs?!0:void 0,create_slide:$e===fn.slide?!0:void 0,messages:Ie},H("running");const St=new AbortController;if(Qe.current=St,$e===fn.image||$e===fn.video||$e===fn.slide||$e===fn.docs||$e===fn.audio||$e===fn.speechVideo||$e===fn.voiceDictation){const qe=JP($e);U(Et=>[...Et,qe])}await de.privateChatStream({mode:"stream",state:{...pt},thread_id:"",signal:St.signal,onRunCreated:qe=>console.error("Run created",qe),onMessage:qe=>{const Et=qe.data;if(Et.state)try{Et.thread_id&&(v(Et.thread_id),s.setThreadId(Et.thread_id)),M(Et.state),Et.state&&Et.state.messages.length>0&&U(Ze=>{const wt=[...Ze];if(!Et.state)return[...wt];const ot=wt.find(mt=>mt.mediaGenerating),qt=Et.state.messages.at(-1);if(qt&&qt.type==="ai"){if(Aie.some(Ve=>{var st;return((st=qt.additional_kwargs)==null?void 0:st[Ve])==="failed"})&&ot&&ot.placeholderMessageId){const Ve=wt.findIndex(st=>st.id===ot.placeholderMessageId);Ve!==-1&&(wt[Ve]={...wt[Ve],mediaGenerating:!1,mediaGenerated:!0})}if(ot&&ot.placeholderMessageId&&Array.isArray(qt.content)){const Ve=Array.isArray(qt.content)?qt.content:[];if(Ve.find(ce=>ce.type==="image_url")){const ce=xo(qt),le=wt.findIndex(_e=>_e.id===ot.placeholderMessageId);le!==-1&&(wt[le]={...wt[le],mediaGenerating:!1,mediaGenerated:!0,content:ce.content,images:ce.images,updateAt:D
1100ate.now(),id:ce.id})}if(Ve.find(ce=>ce.type==="video_url")){const ce=xo(qt),le=wt.findIndex(_e=>_e.id===ot.placeholderMessageId);le!==-1&&(wt[le]={...wt[le],mediaGenerating:!1,mediaGenerated:!0,content:ce.content,videos:ce.videos,updateAt:Date.now(),id:ce.id})}if(Ve.find(ce=>ce.type==="file_url"||ce.type==="site_url")){const ce=xo(qt),le=wt.findIndex(_e=>_e.id===ot.placeholderMessageId);le!==-1&&(wt[le]={...wt[le],mediaGenerating:!1,mediaGenerated:!0,content:ce.content,files:ce.files,sites:ce.sites,updateAt:Date.now(),id:ce.id})}if(Ve.find(ce=>ce.type==="audio_url")){const ce=xo(qt),le=wt.findIndex(_e=>_e.id===ot.placeholderMessageId);le!==-1&&(wt[le]={...wt[le],mediaGenerating:!1,mediaGenerated:!0,content:ce.content,audios:ce.audios,updateAt:Date.now(),id:ce.id})}}const mt=wt.findIndex(Ve=>Ve.id===qt.id),Bt=xo(qt),un=Math.max(Bt.createdAt,Math.max(...wt.map(Ve=>Ve.createdAt))+1);Bt.createdAt=un,mt===-1?(wt.push(Bt),kie(wt)):wt.forEach((Ve,st)=>{st===mt&&(Ve.content=Bt.content,Ve.updateAt=Bt.updateAt)})}return[...wt]})}catch{console.warn("Non-JSON chunk:",qe)}},onError:qe=>{U(Et=>Et.map(Ze=>Ze.mediaGenerating&&!Ze.mediaGenerated?{...Ze,mediaGenerating:!1,mediaGenerated:!1,placeholderMessageId:void 0,content:"Image generation aborted"}:Ze)),console.error(qe,111111)},onComplete:()=>{console.log("â Stream completed")}})},Z=async({newHumanMessages:Ie,content:It,inputState:rt,inlineSkillName:Zt})=>{var ee,ie,ce,le,_e;if(At)return;H("running");const yt=Zt??$e,pt=((ce=(ie=(ee=B.at(-1))==null?void 0:ee.ns)==null?void 0:ie[0])==null?void 0:ce.split(":")[1])??null,St=Ie.findLast(me=>me.type==="human"),qe=c;if(!qe)throw new Error("Account address is required");St&&(te(St.id),oe(St.id)),U(me=>(Ie.map(we=>{if(we.type==="tool"){const Te=me.flatMap(Ct=>Ct.parts).find(Ct=>Ct.id===we.tool_call_id);Te&&(Te.result=we.content.toString(),Te._rawResultMsg=we,Te.status="success")}else me.findIndex(Ct=>Ct.id===we.id)===-1&&me.push(xo(we))}),[...me])),G("");const Et=y??await je.create({metadata:{eoaAddress:qe,language:s.lang,teamId:(le=u==null?void 0:u.retailUser)==null?void 0:le.dealerUserId}}).then(me=>(v(me.thread_id),n$t(me.thread_id),me.thread_id)).catch(me=>{throw me});if(!Et)throw new Error("Thread ID is required");if(s.setThreadId(Et),typeof window<"u"){const me=sessionStorage.getItem("pending_schedule_run_id");if(me)try{const we=Number(me);!Number.isNaN(we)&&we>0&&await de.updateScheduleTask({id:we,body:{threadId:Et}})}catch(we){console.error("Failed to update schedule task threadId",we)}finally{sessionStorage.removeItem("pending_schedule_run_id")}}H("running");const Ze=await je.getState(Et).catch(me=>{console.error("Thread state error",me)}),wt=new AbortController;Qe.current=wt,console.log("Thread state",Ze);const qt=(await je.list(Et)).find(me=>S2(me.status));if(qt&&console.log("Running ID",qt),!b){let me=It;if(!me)if(typeof(St==null?void 0:St.content)=="string")me=St.content;else{const we=(St==null?void 0:St.content)??[];we[0].type==="text"&&(me=we[0].text),we[0].type==="image_url"&&(me=we[0].type),we[0].type==="video_url"&&(me=we[0].type),we[0].type==="file_url"&&(me=we[0].type),we[0].type==="site_url"&&(me=we[0].type),we[0].type==="audio_url"&&yt===fn.voiceDictation&&(me=we[0].audio.name)}if(typeof window<"u"){const we=sessionStorage.getItem("pending_schedule_run_title");we&&(me=we,sessionStorage.removeItem("pending_schedule_run_title"))}de.create({eoa:qe,title:me??"",threadId:Et,backendUrl:Jo(),time:new Date().toISOString()}).then(we=>(C(we.data),is.setQueryData(["history-by-id",we.data.threadId],we.data),is.setQueryData(["history",we.data.path],we.data),is.invalidateQueries({queryKey:["historyList",qe==null?void 0:qe.toLowerCase()]}),we.data,we.data))}pt&&P(me=>(me.pop(),me));let mt;U(me=>{var we;return mt=(we=me.at(-1))==null?void 0:we.id,[...me]});let Bt=!1,un=null;const Ve=(rt==null?void 0:rt.create_video)===!0&&((_e=St==null?void 0:St.additional_kwargs)==null?void 0:_e.video_duration)==="auto";let st=pt?{command:{resume:{[pt]:It}}}:{input:{...rt,...Ve?{enable_video_router:!0}:{},messages:Ie}},X={isRunning:!1};try{await Iie({client:je,threadId:Et,assistantId:"agent",endMessageId:mt,payload:{streamMode:["messages-tuple","values","updates","custom"],streamSubgraphs:!0,streamResumable:!0,onDisconnect:"continue",metadata:St?{human_message_id:St.id,human_message_created_at:St.createdAt,skill_name:yt,eoaAddress:qe}:void 0,...st,signal:wt.signal},onCustom:me=>{if(console.log("custom",me),me.type&&me.type!=="sources")if(me.type==="final_output_stop")Bt=!1;else if(me.type==="final_output")Bt=!0;else if(Sie(me)){Ye.current=!0;const we=JP(yt,me);U(Te=>Te.some(Ct=>Ct.mediaGenerating&&!Ct.mediaGenerated)?Te:[...Te,we])}else me.type==="image_generated"||me.type==="file_generated"||me.type==="content_generated"?tt.current=!0:(me.type==="progress"||me.type==="refresh")&&xt({type:me.type,msg:me.msg,kind:me.kind,browser_url:me.browser_url});else me.type==="sources"&&me.citation_list&&(un={name:"ui_tool_source",args:{sources:me.citation_list}})},onValues:me=>{const we=Q6(me);we&&I(we),tR(eR(me))&&U(Te=>nR(Te))},onMessages:me=>{J({messages:me,finallyOutput:Bt,sources:un})},onMetadata:me=>{!(St!=null&&St.id)||!me.run_id||U(we=>we.map(Te=>Te.id===St.id?{...Te,additional_kwargs:{...Te.additional_kwargs??{},run_id:me.run_id}}:Te))},onError(me){"name"in me&&me.name==="AbortError"||(console.error("Stream error",me),md(`${me.message}`,5e3))}})}finally{!s.activeThread&&b&&s.setActiveThread({...b}),Ye.current=!1,tt.current=!1,wt.signal.aborted?(H("end"),oe(void 0)):X=await ft(Et,St==null?void 0:St.id)}return X},se=au({mutationFn:Z,onError:Ie=>{Ie.name!=="AbortError"&&console.error("Submit error",Ie)},onSettled:Ie=>{it(Ie)}}),he=au({mutationFn:async Ie=>{const It=[Ie].map(yt=>({type:"tool",name:yt.name,tool_call_id:yt.toolCallId,content:yt.value??yt.result,status:"success",id:crypto.randomUUID(),createdAt:Date.now()}));let rt=crypto.randomUUID();Ie.humanInput&&(rt=rt.replace(rt.slice(0,8),"00000001"));const Zt={type:"human",content:Ie.humanInput??[Ie].map(yt=>yt.result).join(` 1101 1102`),id:rt,createdAt:Date.now()};return Z({newHumanMessages:[...It,Zt],content:Zt.content,inputState:{enable_slot_fill:!Ie.skip_slot_fill,enable_smart_router:!1}})},onSettled:Ie=>{it(Ie)}}),fe=au({mutationFn:async Ie=>{const It=g$t(Ie.approvedPrompt),rt={type:"tool",name:r3e,tool_call_id:Ie.toolCallId,content:It,status:"success",id:crypto.randomUUID(),createdAt:Date.now()},Zt=crypto.randomUUID(),yt={type:"human",content:Ie.approvedPrompt,id:Zt.replace(Zt.slice(0,8),"00000002"),createdAt:Date.now()};return Z({newHumanMessages:[rt,yt],content:Ie.approvedPrompt,inputState:{}})},onSettled:Ie=>{it(Ie)},onError:Ie=>{Ie.name!=="AbortError"&&(console.error("Code mode confirmation error",Ie),md(Ie.message??"Unable to confirm code mode prompt",5e3))}}),ye=au({mutationFn:async Ie=>{var yt;const It=Ie.toolCall?{type:"tool",name:Ie.toolCall.name,tool_call_id:Ie.toolCall.toolCallId,content:Ie.toolCall.result,status:"success",id:crypto.randomUUID(),createdAt:Date.now()}:void 0;let rt=crypto.randomUUID();Ie.autoSubmitted&&(rt=rt.replace(rt.slice(0,8),"00000001"));const Zt={type:"human",content:Ie.content,id:rt,createdAt:Date.now(),additional_kwargs:Ie.additional_kwargs||{}};
1102return Z({newHumanMessages:[It,Zt].filter(Boolean),content:Zt.content,inlineSkillName:Ie.spec.skill,inputState:((yt=Ie.spec)==null?void 0:yt.state)??{}})},onSettled:Ie=>{it(Ie)},onError:Ie=>{if(Ie.name!=="AbortError"){if(Ie.message.includes("Click to view in")){console.log("123"),Ene(Ie.message??"Unable to create new chat",9e4,()=>{T?Be(!0):ke(!0)});return}if(Ie.message.includes("ReadableStream")||Ie.message.includes("releaseLock")||Ie.message.includes("Cannot release a readable stream reader")){console.warn("Suppressed ReadableStream error:",Ie.message);return}if(console.error("Stream error",{error:Ie}),Ie.message.includes("Package expired")||Ie.message.includes("Insufficient credits")){s.setStreamError(Ie.message);return}md(Ie.message??"Unable to chat now",5e3)}}}),nt=au({mutationFn:async()=>(await Ue("stop"),!0)}),vt=E.useCallback(Ie=>{G(Ie.target.value)},[$e]),Nt=au({mutationFn:async Ie=>{var Zt;if(!d())return;H("running");const It={type:"human",content:Ie.content,id:crypto.randomUUID(),createdAt:Date.now(),additional_kwargs:Ie.additional_kwargs||{}},rt="";if(s.isIncognito){await q([It]),H("end");return}return console.log("submit",{newHumanMessage:It,message:Ie}),Z({newHumanMessages:[It],content:rt,inputState:{enable_smart_router:Ie.skillType==="default"&&((Zt=Ie.additional_kwargs)==null?void 0:Zt.mode)==="reSearch",create_agent_gateway:r&&i,create_image:Ie.skillType===fn.image?!0:void 0,create_video:Ie.skillType===fn.video?!0:void 0,create_audio:Ie.skillType===fn.audio?!0:void 0,create_docs:Ie.skillType===fn.docs?!0:void 0,create_slide:void 0,create_speech_video:Ie.skillType===fn.speechVideo?!0:void 0,create_herbalife:s.brand==="herbalife"?!0:void 0,create_voiceDictation:Ie.skillType===fn.voiceDictation?!0:void 0}})},onError:Ie=>{if(Ie.name!=="AbortError"){if(Ie.message.includes("Click to view in")){console.log("123"),Ene(Ie.message??"Unable to create new chat",9e4,()=>{T?Be(!0):ke(!0)});return}if(Ie.message.includes("ReadableStream")||Ie.message.includes("releaseLock")||Ie.message.includes("Cannot release a readable stream reader")){console.warn("Suppressed ReadableStream error:",Ie.message);return}if(console.error("Stream error",{error:Ie}),Ie.message.includes("Package expired")||Ie.message.includes("Insufficient credits")){s.setStreamError(Ie.message);return}md(Ie.message??"Unable to chat now",5e3)}},onSettled:Ie=>{it(Ie);const It=O.filter(rt=>rt.type==="ai").length>1;y&&It&&de.continueChat({threadId:y}),h()}}),mn=au({mutationFn:async Ie=>{let It=!1,rt=null;const Zt=new AbortController;Qe.current=Zt;let yt={isRunning:!1};try{await Iie({client:je,threadId:Ie.thread.threadId,runId:Ie.runId,assistantId:"agent",endMessageId:Ie.endMessageId,payload:{streamMode:["messages-tuple","values","updates","custom"],streamSubgraphs:!0,streamResumable:!0,onDisconnect:"continue",signal:Zt.signal},onCustom:pt=>{if(pt.type&&pt.type!=="sources")if(pt.type==="final_output_stop")It=!1;else if(pt.type==="final_output")It=!0;else if(Sie(pt)){const St=JP($e,pt);U(qe=>[...qe,St])}else h$t(pt)||(pt.type==="progress"||pt.type==="refresh")&&xt({type:pt.type,msg:pt.msg,kind:pt.kind,browser_url:pt.browser_url});else pt.type==="sources"&&pt.citation_list&&(rt={name:"ui_tool_source",args:{sources:pt.citation_list}})},onUpdates:pt=>{},onValues:pt=>{const St=Q6(pt);St&&I(St),tR(eR(pt))&&U(qe=>nR(qe))},onMessages:pt=>{J({messages:pt,createdThread:Ie.thread,finallyOutput:It,sources:rt})},onError:pt=>{"name"in pt&&pt.name==="AbortError"||(console.error("Stream error",pt),md(`${pt.message}`,5e3))}})}finally{Zt.signal.aborted||(yt=await ft(Ie.thread.threadId))}return yt},onMutate:()=>{H("running")},onError:Ie=>{Ie.name!=="AbortError"&&md(Ie.message,5e3)},onSettled:(Ie,It,rt)=>{if(!s.activeThread&&b&&s.setActiveThread({...b}),!It&&(Ie!=null&&Ie.isRunning)&&Ie.runId&&(rt!=null&&rt.thread)){const Zt=Ie.runId;if(it(Ie),typeof window>"u")return;const yt=Qe.current;window.setTimeout(()=>{!yt||Qe.current!==yt||yt.signal.aborted||mn.mutate({...rt,runId:Zt})},1500);return}it(void 0)}});E.useCallback(async()=>{var Ie;(Ie=Qe.current)==null||Ie.abort("create new thread"),U([]),H("idle"),oe(void 0),_([]),I(void 0),N([]),V([]),G(""),m(void 0),v(void 0),C(null),ze.current=null,Ne.current=null,se.isPending&&await nt.mutateAsync(),se.reset(),he.reset(),fe.reset(),nt.reset(),Nt.reset()},[Nt,nt,he,fe,se]);const At=E.useMemo(()=>W==="running",[W]),En=E.useCallback(async Ie=>{if(At){ze.current=Ie;return}await he.mutateAsync(Ie)},[At,he]),yr=E.useCallback(async Ie=>{if(At){Ne.current=Ie;return}await fe.mutateAsync(Ie)},[At,fe]);E.useEffect(()=>{if(At)return;const Ie=ze.current;Ie&&(ze.current=null,he.mutateAsync(Ie))},[At,he]),E.useEffect(()=>{if(At)return;const Ie=Ne.current;Ie&&(Ne.current=null,fe.mutateAsync(Ie))},[At,fe]),E.useEffect(()=>()=>{l(),Ue()},[f]);const xn=E.useMemo(()=>O.map(Ie=>({...Ie})).filter(Ie=>Ie!==null),[O]);return{...e,...n,searchMode:L,setSearchMode:S,isCodeModeLocked:z,isHistoryThread:!!(t.threadId||t.threadPath),threadId:y,thread:b,threadUpdateEvents:R,threadCustomEvents:x,setThreadCustomEvents:_,browserUrl:$,setThreadEventStatus:H,threadRunningMessages:D,threadEventStatus:W,lastSubmittedHumanMessageId:Y,activeRunHumanMessageId:ae,messages:xn,isInitializing:Lt,isRunning:At,submit:se.mutateAsync,stop:nt.mutateAsync,input:j,handleInputChange:vt,addUiToolResult:En,handleSubmit:Nt.mutateAsync,addSkillResult:ye.mutateAsync,confirmCodeMode:yr,skillName:$e,setSkillName:He}}oE.getInstance().threads;function A$t(t){return t.split("|",1)[0]??t}async function Iie(t){var c,l,u;const{client:e}=t;let n=t.runId,r,i=t.endMessageId,s=!0,o;(l=(c=t.payload)==null?void 0:c.signal)==null||l.addEventListener("abort",d=>{n&&d.target.reason==="stop"&&e.cancel(t.threadId,n)}),await gkt.backOff(async()=>{var m,y,v,b,C;if((y=(m=t.payload)==null?void 0:m.signal)!=null&&y.aborted)throw{name:"AbortError",message:"Stream aborted"};if(!n&&!s&&await e.list(t.threadId).then(x=>{var $;console.log("runs",x);const _=($=x.find(I=>S2(I.status)))==null?void 0:$.run_id;console.log("runId",_),_&&(n=_)}),o&&o.abort("Create new thread"),o=new AbortController,(b=(v=t.payload)==null?void 0:v.signal)==null||b.addEventListener("abort",()=>{o==null||o.abort()}),!n){s=!1;const x=await e.stream(t.threadId,t.assistantId,{...t.payload,signal:o.signal});let _=0,$="0";for await(const I of x){const{event:R,data:N,id:T}=I;if(Number(T)<Number($))return;if(T===$){if(_++,_>8)throw new Error(`Missed heartbeat count: ${_}`)}else _=0;R==="metadata"&&(n=N.run_id),$=T,a({event:R,data:N,id:T},{...t})}return!0}
1102const d=e.joinStream(t.threadId,n,{signal:o.signal,streamMode:(C=t.payload)==null?void 0:C.streamMode});console.log("newJoinStream",{runId:n,newJoinStream:d});let h="0",f=0;for await(const x of d){const{event:_,data:$,id:I}=x;if(Number(I)<Number(h))return;if(I===h){if(f++,f>8)throw new Error(`Missed heartbeat count: ${f}`)}else f=0;_==="metadata"&&(n=$.run_id),h=I,a({event:_,data:$,id:I},{...t})}return!0},{numOfAttempts:99999,startingDelay:100,timeMultiple:1.1,retry:(d,h)=>{if("name"in d&&d.name==="AbortError")return!1;if(h<99999)return!0;throw new Error("Retry limit reached")}}).then(async()=>{var m,y;const d=await e.get(t.threadId).catch(v=>{throw console.error("Thread get error",v),md("Unable to load conversation",5e3),v}),h=((m=d==null?void 0:d.values)==null?void 0:m.messages)??[],f=h.slice(h.findIndex(v=>v.id===i)+1);console.log("newMessagesHistory",i,f),(y=t.onMessages)==null||y.call(t,f)}).catch(d=>{var h;console.error("Stream error",d),(h=t.onError)==null||h.call(t,d)}),(u=t.onEnd)==null||u.call(t);function a(d,h){var b,C,x,_,$,I,R,N,T,O,U,z,L,S;const{event:f,data:m,id:y}=d,v=A$t(f);if((C=(b=t.payload)==null?void 0:b.signal)!=null&&C.aborted)throw console.log("Stream aborted"),new Error("Stream aborted");if(v==="error"){console.error("Stream error",m);const k=new Error(`${m.error} ${m.message}`);throw(x=h==null?void 0:h.onError)==null||x.call(h,k),k}else v==="metadata"&&(n=m.run_id,(_=h==null?void 0:h.onMetadata)==null||_.call(h,m));if(v==="custom"){const k=m;($=h==null?void 0:h.onCustom)==null||$.call(h,k)}else if(v==="updates"){const k=m;(I=h==null?void 0:h.onUpdates)==null||I.call(h,k)}else if(v==="values"){if((R=h==null?void 0:h.onValues)==null||R.call(h,m),"messages"in m){const k=m.messages;console.log("event:values",k);for(const M of k)i=M.id;(N=t.onMessages)==null||N.call(t,k)}}else if(v.startsWith("messages")&&Array.isArray(m)){const k=m[0],M=k.content;if(!r||r.id!==k.id)r={...k,content:M};else if(Array.isArray(M)?(typeof r.content=="string"&&(r.content=[{type:"text",text:r.content},...M]),r.content=r.content.concat(M)):r.content+=M,k.additional_kwargs){const W=k.additional_kwargs??{};if("reasoning"in(W??{})){const H=(T=W==null?void 0:W.reasoning)==null?void 0:T.summary,D=(O=r==null?void 0:r.additional_kwargs)==null?void 0:O.reasoning;H&&(H==null?void 0:H.length)>0&&(!(D!=null&&D.summary)||((U=D==null?void 0:D.summary)==null?void 0:U.length)===0?r.additional_kwargs={...r.additional_kwargs,reasoning:{summary:H}}:D!=null&&D.summary&&D.summary[0]&&(D.summary[0].text+=((z=H.at(0))==null?void 0:z.text)??""))}"reasoning_content"in(W??{})&&(W.reasoning_content=(((L=r==null?void 0:r.additional_kwargs)==null?void 0:L.reasoning_content)??"")+((W==null?void 0:W.reasoning_content)??""),r.additional_kwargs={...r.additional_kwargs,reasoning_content:W.reasoning_content})}(S=h==null?void 0:h.onMessages)==null||S.call(h,[r])}}return{runId:n}}function k$t(){const[t,e]=n3e("research_mode","search");return{searchMode:E.useMemo(()=>t&&Object.values(p$t).some(r=>r.value===t)?t:"search",[t]),setSearchMode:e}}const o3e=C5(t=>({threadPath:void 0,deleteToolIds:[],setThreadPath:e=>t(()=>({threadPath:e,deleteToolIds:[]})),setDeleteToolIds:e=>t(n=>({deleteToolIds:typeof e=="function"?e(n.deleteToolIds):e}))})),$$t=()=>o3e(),vMt=()=>{const t=E.useContext(vx);if(!t)throw new Error("useStreamMode must be used within a StreamModeProvider");const{searchMode:e,setSearchMode:n,isCodeModeLocked:r}=t;return{searchMode:e,setSearchMode:n,isCodeModeLocked:r}},bMt=()=>{const t=E.useContext(vx);if(!t)throw new Error("useThinkingTimeline must be used within a ThreadProvider");const{threadCustomEvents:e,threadRunningMessages:n,messages:r,threadEventStatus:i}=t;return{threadCustomEvents:e,threadRunningMessages:n,messages:r,threadEventStatus:i}},vx=E.createContext(void 0);function I$t({children:t,threadPath:e,threadId:n}){const r=S$t({threadPath:e,threadId:n});return p.jsx(vx.Provider,{value:r,children:t})}function xMt(){const t=E.useContext(vx);if(!t)throw new Error("useThreadContext must be used within a ThreadProvider");return t}function EMt(){return E.useContext(vx)}function T$t({children:t}){const e=Ah(),{threadPath:n}=o3e();return p.jsx(I$t,{threadPath:n,children:t},`${e.chatPageKey??"default"}:${n??"new"}`)}function P$t({children:t}){const{chatPageKey:e,setActiveThread:n,setThreadId:r,setChatPageKey:i,setIsHistory:s,setIsIncognito:o}=Ah(),{session:a}=dx(),c=a==null?void 0:a.address,{setThreadPath:l}=$$t(),u=E.useRef(void 0);return E.useEffect(()=>{const d=u.current,h=c==null?void 0:c.toLowerCase();d&&d!==h&&(n(null),r(void 0),l(void 0),i(crypto.randomUUID()),s(!1),o(!1)),u.current=h},[c,n,r,l,i,s,o]),p.jsx(T$t,{children:t},e)}const is=new q0t;function R$t({children:t}){return p.jsx(Vbe,{children:p.jsx(Z6t,{children:p.jsx(skt,{children:p.jsx(X0t,{client:is,children:p.jsx(Gge,{config:tkt,reconnectOnMount:!0,children:p.jsx(Upt,{appId:aie.appId,config:aie.config,children:p.jsx(d1t,{config:ekt,reconnectOnMount:!0,children:p.jsx(w_t,{children:p.jsx(C1t,{children:p.jsx(okt,{children:p.jsx(b8t,{children:p.jsxs(E8t,{children:[p.jsx(U_t,{}),p.jsx(v_t,{}),p.jsx(O_t,{}),p.jsx(P$t,{children:t}),p.jsx($_t,{}),p.jsx(R_t,{})]})})})})})})})})})})})})}const cw=l4e({component:()=>p.jsxs(R$t,{children:[p.jsx(M$t,{}),p.jsx(XN,{})]})});function M$t(){const t=E.useRef(!1),e=Ds({select:n=>n.status==="pending"||n.isLoading});return E.useEffect(()=>{t.current||e||(t.current=!0,dse())},[e]),null}const O$t=()=>mr(()=>import("./pilot-DUfhDNwv.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])),a3e=$i("/pilot")({component:Us(O$t,"component",()=>
1102a3e.ssr)}),j$t=()=>mr(()=>import("./_locale-Cu3WlYy6.js"),__vite__mapDeps([26,21,5,22,7,23,6,10,11,12,13,14,20,24,16,25])),c3e=$i("/$locale")({component:Us(j$t,"component",()=>c3e.ssr)}),N$t=()=>mr(()=>import("./index-BUt8qw9r.js"),[]),l3e=$i("/")({component:Us(N$t,"component",()=>l3e.ssr)}),D$t=()=>mr(()=>import("./index-CZymfhBC.js"),__vite__mapDeps([27,6,28,12,25])),u3e=$i("/download/")({component:Us(D$t,"component",()=>u3e.ssr)}),L$t=()=>mr(()=>import("./index-CAtkfuLI.js"),__vite__mapDeps([29,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,30,22,31,32,33,34,35,36])),d3e=$i("/$locale/")({component:Us(L$t,"component",()=>d3e.ssr)}),B$t=()=>mr(()=>import("./schedule-D7KdZ_Vl.js"),__vite__mapDeps([37,30,5,22,6,14,9,38,35,11,32,39,34])),h3e=$i("/$locale/schedule")({component:Us(B$t,"component",()=>h3e.ssr)}),F$t=()=>mr(()=>import("./pricing-BbrTUh_H.js"),__vite__mapDeps([40,5,8,34,6,11,10,12,13,30,22,14,9,24,41,42])),f3e=$i("/$locale/pricing")({component:Us(F$t,"component",()=>f3e.ssr)}),U$t=()=>mr(()=>import("./pilot-XRVujXsR.js"),__vite__mapDeps([43,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),p3e=$i("/$locale/pilot")({component:Us(U$t,"component",()=>p3e.ssr)}),z$t=()=>mr(()=>import("./mall-BnhY56fK.js"),__vite__mapDeps([44,5,10,6,11,12,13,32,45,35,42,30,22,14,9])),g3e=$i("/$locale/mall")({component:Us(z$t,"component",()=>g3e.ssr)}),W$t=$i("/$locale/invite")({beforeLoad:({params:t,search:e})=>{throw Rxe({to:"/$locale",params:t,search:e,replace:!0})}}),H$t=()=>mr(()=>import("./devices-DOrP3Be4.js"),__vite__mapDeps([46,5,30,22,6,14,9,13,47,32,48,34,49])),m3e=$i("/$locale/devices")({component:Us(H$t,"component",()=>m3e.ssr)}),V$t=()=>mr(()=>import("./code-projects-DtA9F8E6.js"),__vite__mapDeps([50,10,5,6,11,12,13,32,33,16,48,39])),y3e=$i("/$locale/code-projects")({component:Us(V$t,"component",()=>y3e.ssr)}),q$t=()=>mr(()=>import("./checkout-LvfcJT7f.js"),__vite__mapDeps([51,5,28,6,12,10,11,13,41,45,36,19,17,30,22,14,9])),w3e=$i("/$locale/checkout")({component:Us(q$t,"component",()=>w3e.ssr)}),K$t=()=>mr(()=>import("./agent-CLYCrU5H.js"),[]),v3e=$i("/$locale/agent")({component:Us(K$t,"component",()=>v3e.ssr)}),G$t=()=>mr(()=>import("./account-D6CzTY4y.js"),__vite__mapDeps([52,6,23,10,5,11,12,13,9,17,38,32,34,15,22,30,14,47])),b3e=$i("/$locale/account")({component:Us(G$t,"component",()=>b3e.ssr)}),Z$t=()=>mr(()=>import("./mall.history-DBkb8lr5.js"),__vite__mapDeps([53,5,10,6,11,12,13,32,34,49,30,22,14,9])),x3e=$i("/$locale/mall/history")({component:Us(Z$t,"component",()=>x3e.ssr)}),Y$t=()=>mr(()=>import("./_threadId-CRSDCNd0.js"),__vite__mapDeps([54,30,5,22,6,14,9,31,4,7,8,10,11,12,13,15,16,17,18,32,33,34,35,36])),E3e=$i("/$locale/c/$threadId")({component:Us(Y$t,"component",()=>E3e.ssr)}),Q$t=()=>mr(()=>import("./_messageId-Djf9ydQL.js"),__vite__mapDeps([55,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,30,22])),C3e=$i("/$locale/bubbleup/$messageId")({component:Us(Q$t,"component",()=>C3e.ssr)}),X$t=a3e.update({id:"/pilot",path:"/pilot",getParentRoute:()=>cw}),J$t=u6e.update({id:"/disable",path:"/disable",getParentRoute:()=>cw}),va=c3e.update({id:"/$locale",path:"/$locale",getParentRoute:()=>cw}),eIt=l3e.update({id:"/",path:"/",getParentRoute:()=>cw}),tIt=u3e.update({id:"/download/",path:"/download/",getParentRoute:()=>cw}),nIt=d3e.update({id:"/",path:"/",getParentRoute:()=>va}),rIt=h3e.update({id:"/schedule",path:"/schedule",getParentRoute:()=>va}),iIt=f3e.update({id:"/pricing",path:"/pricing",getParentRoute:()=>va}),sIt=p3e.update({id:"/pilot",path:"/pilot",getParentRoute:()=>va}),_3e=g3e.update({id:"/mall",path:"/mall",getParentRoute:()=>va}),oIt=W$t.update({id:"/invite",path:"/invite",getParentRoute:()=>va}),aIt=m3e.update({id:"/devices",path:"/devices",getParentRoute:()=>va}),cIt=y3e.update({id:"/code-projects",path:"/code-projects",getParentRoute:()=>va}),lIt=w3e.update({id:"/checkout",path:"/checkout",getParentRoute:()=>va}),uIt=v3e.update({id:"/agent",path:"/agent",getParentRoute:()=>va}),dIt=b3e.update({id:"/account",path:"/account",getParentRoute:()=>va}),hIt=x3e.update({id:"/history",path:"/history",getParentRoute:()=>_3e}),fIt=E3e.update({id:"/c/$threadId",path:"/c/$threadId",getParentRoute:()=>va}),pIt=C3e.update({id:"/bubbleup/$messageId",path:"/bubbleup/$messageId",getParentRoute:()=>va}),gIt={LocaleMallHistoryRoute:hIt},mIt=_3e._addFileChildren(gIt),yIt={LocaleAccountRoute:dIt,LocaleAgentRoute:uIt,LocaleCheckoutRoute:lIt,LocaleCodeProjectsRoute:cIt,LocaleDevicesRoute:aIt,LocaleInviteRoute:oIt,LocaleMallRoute:mIt,LocalePilotRoute:sIt,LocalePricingRoute:iIt,LocaleScheduleRoute:rIt,LocaleIndexRoute:nIt,LocaleBubbleupMessageIdRoute:pIt,LocaleCThreadIdRoute:fIt}
1102,wIt=va._addFileChildren(yIt),vIt={IndexRoute:eIt,LocaleRoute:wIt,DisableRoute:J$t,PilotRoute:X$t,DownloadIndexRoute:tIt},bIt=cw._addFileChildren(vIt)._addFileTypes(),xIt=E4e({routeTree:bIt,basepath:cse()});function EIt(){const t=E.useRef(!1),{countryCode:e,error:n,isLoading:r}=L4e(),i=typeof window<"u"&&M4e(window),s=typeof navigator<"u"&&O4e(navigator.userAgent||""),o=j4e({countryCode:e,hasGeoError:!!n,hasInjectedWallet:i,isWeChat:s});return E.useEffect(()=>{r||t.current||o&&(t.current=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{dse(),t6e()})}))},[o,r]),r?p.jsx("div",{className:"h-full w-full bg-[#f8f8f7]"}):o?p.jsx(fse,{blockedByRegion:!!n||use(e)&&!i}):p.jsx(S4e,{router:xIt})}k4e.createRoot(document.getElementById("root")).render(p.jsx(EIt,{}));export{JSt as $,gx as A,dbe as B,wx as C,$$t as D,HRt as E,_At as F,tAt as G,SAt as H,Wbe as I,gRt as J,Jo as K,T8t as L,A8t as M,e8t as N,XN as O,j8t as P,yMt as Q,c3e as R,EAt as S,eAt as T,a$t as U,cAt as V,tD as W,TS as X,mAt as Y,yAt as Z,mr as _,E as a,w8t as a$,gMt as a0,bwe as a1,JN as a2,XF as a3,Ds as a4,t6e as a5,tbe as a6,dAt as a7,mbe as a8,cg as a9,vSt as aA,lSt as aB,PSt as aC,bSt as aD,cbe as aE,NU as aF,xSt as aG,ESt as aH,hSt as aI,MRt as aJ,Obe as aK,_8t as aL,ZSt as aM,YSt as aN,QSt as aO,zbe as aP,JRt as aQ,f3e as aR,Xkt as aS,Vre as aT,mMt as aU,t$t as aV,ibe as aW,SRt as aX,ia as aY,a8t as aZ,o1t as a_,dMt as aa,kh as ab,$St as ac,BU as ad,Ad as ae,NS as af,Rbe as ag,xc as ah,uMt as ai,Pbe as aj,Z_t as ak,gp as al,ube as am,eMt as an,XE as ao,m_t as ap,Jve as aq,$4e as ar,xRt as as,Vbe as at,d3e as au,jRt as av,RRt as aw,hbe as ax,h3e as ay,Ebe as az,vh as b,Ztt as b$,A5t as b0,u8t as b1,g2t as b2,y2t as b3,e6e as b4,I6 as b5,Pkt as b6,vkt as b7,XSt as b8,g3e as b9,lRt as bA,n1t as bB,kIt as bC,fRt as bD,hRt as bE,tF as bF,pRt as bG,v1t as bH,Y6t as bI,qRt as bJ,VRt as bK,kRt as bL,_Rt as bM,X6t as bN,J6t as bO,d2t as bP,$It as bQ,G6t as bR,AIt as bS,Yee as bT,b3e as bU,cr as bV,Wr as bW,GE as bX,Ytt as bY,Jtt as bZ,c3 as b_,ose as ba,nu as bb,s$t as bc,m3e as bd,h2 as be,KD as bf,Ypt as bg,I$e as bh,oRt as bi,wj as bj,Q2 as bk,A0t as bl,$0t as bm,Tc as bn,cEe as bo,Fge as bp,h2t as bq,Ume as br,rMt as bs,CRt as bt,w3e as bu,Rt as bv,v3e as bw,JB as bx,LJ as by,uRt as bz,nw as c,S8t as c$,So as c0,zu as c1,ku as c2,Na as c3,_O as c4,Cl as c5,A9 as c6,Gtt as c7,h6 as c8,lo as c9,fn as cA,bMt as cB,Gee as cC,I8t as cD,C3e as cE,TRt as cF,PRt as cG,IRt as cH,u5 as cI,fMt as cJ,ys as cK,Oa as cL,F6t as cM,wMt as cN,aw as cO,n3e as cP,ORt as cQ,pMt as cR,C2 as cS,sMt as cT,oMt as cU,rbe as cV,cMt as cW,aMt as cX,jU as cY,ARt as cZ,FRt as c_,Du as ca,l3 as cb,XL as cc,p_ as cd,lp as ce,a2 as cf,Itt as cg,QL as ch,Ott as ci,ih as cj,U2 as ck,F5 as cl,g_ as cm,whe as cn,t4e as co,W_t as cp,K_t as cq,x3e as cr,EMt as cs,I$t as ct,E3e as cu,vMt as cv,p$t as cw,xMt as cx,o$t as cy,lf as cz,dx as d,FK as d$,A_t as d0,XRt as d1,ZRt as d2,aRt as d3,hm as d4,Gd as d5,dn as d6,Fr as d7,sbe as d8,sS as d9,ERt as dA,hht as dB,B1 as dC,h7e as dD,qOe as dE,Pt as dF,eh as dG,VBe as dH,uOe as dI,OM as dJ,th as dK,Wa as dL,n_ as dM,iVe as dN,jo as dO,hHe as dP,UHe as dQ,ya as dR,Vf as dS,F1 as dT,j5 as dU,Rc as dV,KVe as dW,OL as dX,s_ as dY,r_ as dZ,aL as d_,lse as da,P4e as db,k_t as dc,YRt as dd,gbe as de,tkt as df,nMt as dg,wd as dh,GRt as di,Hpt as dj,W_e as dk,a8e as dl,OIt as dm,ap as dn,C_e as dp,Un as dq,Jre as dr,KRt as ds,T4e as dt,lMt as du,abe as dv,iRt as dw,Ap as dx,Ege as dy,i8t as dz,oS as e,due as e0,GLe as e1,nh as e2,b1 as e3,E0 as e4,i_ as e5,su as e6,dc as e7,iu as e8,Pl as e9,vJe as eA,a$e as eB,et as ea,nD as eb,fs as ec,F7e as ed,uD as ee,hC as ef,Zd as eg,$2 as eh,ob as ei,Da as ej,Zb as ek,RD as el,$le as em,yu as en,Hae as eo,Kd as ep,$gt as eq,hle as er,mc as es,ha as et,lb as eu,sZ as ev,jVe as ew,WVe as ex,bde as ey,UK as ez,jS as f,oa as g,gme as h,Ur as i,p as j,au as k,tMt as l,Yj as m,Ah as n,x8t as o,SIt as p,yh as q,hp as r,md as s,is as t,K6t as u,V7 as v,Xn as w,$Rt as x,QRt as y,ywe 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.