@tokenflight/swap 0.0.3-rc.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.d.ts +0 -12
- package/dist/index.d.ts +6 -103
- package/dist/tokenflight-swap.css +1 -1
- package/dist/tokenflight-swap.js +3034 -4530
- package/dist/tokenflight-swap.umd.cjs +3 -3
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TokenFlightSwap={})}(this,function(e){"use strict";var t,r,n,i,o,s,a,l,c,d,u,f,h,p,g,v,m,b,y,w,x,k,T,I,C,S,E,A,O,R,P,N,F,_,D,U,$,q,M,L,j,z,W,B,H,Q,K,V,G,Y,X,J,Z,ee,te,re,ne,ie,oe,se,ae,le,ce,de,ue,fe,he,pe,ge,ve,me,be,ye,we,xe,ke,Te,Ie,Ce,Se,Ee,Ae,Oe,Re,Pe,Ne,Fe,_e,De,Ue,$e,qe=Object.defineProperty,Me=e=>{throw TypeError(e)},Le=(e,t,r)=>((e,t,r)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),je=(e,t,r)=>t.has(e)||Me("Cannot "+r),ze=(e,t,r)=>(je(e,t,"read from private field"),r?r.call(e):t.get(e)),We=(e,t,r)=>t.has(e)?Me("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Be=(e,t,r,n)=>(je(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),He=(e,t,r)=>(je(e,t,"access private method"),r),Qe=(e,t,r,n)=>({set _(n){Be(e,t,n,r)},get _(){return ze(e,t,n)}});const Ke=["filled","refunded","failed"],Ve={INVALID_CONFIG:"TF1001",INVALID_TOKEN_IDENTIFIER:"TF1002",INVALID_AMOUNT:"TF1003",MISSING_REQUIRED_CONFIG:"TF1004",WALLET_NOT_CONNECTED:"TF2001",WALLET_CONNECTION_FAILED:"TF2002",WALLET_ACTION_FAILED:"TF2003",WALLET_ACTION_REJECTED:"TF2004",UNSUPPORTED_ACTION_TYPE:"TF2005",API_REQUEST_FAILED:"TF3001",API_TIMEOUT:"TF3002",API_INVALID_RESPONSE:"TF3003",QUOTE_FAILED:"TF3004",QUOTE_EXPIRED:"TF3005",DEPOSIT_BUILD_FAILED:"TF3006",DEPOSIT_SUBMIT_FAILED:"TF3007",ORDER_FAILED:"TF3008",TRANSACTION_FAILED:"TF4001",TRANSACTION_REJECTED:"TF4002",INSUFFICIENT_BALANCE:"TF4003",ELEMENT_NOT_FOUND:"TF5001",INITIALIZATION_FAILED:"TF5002"},Ge={[Ve.INVALID_CONFIG]:"Invalid configuration provided",[Ve.INVALID_TOKEN_IDENTIFIER]:"Invalid token identifier format",[Ve.INVALID_AMOUNT]:"Invalid amount value",[Ve.MISSING_REQUIRED_CONFIG]:"Missing required configuration field",[Ve.WALLET_NOT_CONNECTED]:"Wallet is not connected",[Ve.WALLET_CONNECTION_FAILED]:"Failed to connect wallet",[Ve.WALLET_ACTION_FAILED]:"Wallet action failed",[Ve.WALLET_ACTION_REJECTED]:"Wallet action was rejected by user",[Ve.UNSUPPORTED_ACTION_TYPE]:"Unsupported wallet action type",[Ve.API_REQUEST_FAILED]:"API request failed",[Ve.API_TIMEOUT]:"API request timed out",[Ve.API_INVALID_RESPONSE]:"Invalid API response",[Ve.QUOTE_FAILED]:"Failed to get quote",[Ve.QUOTE_EXPIRED]:"Quote has expired",[Ve.DEPOSIT_BUILD_FAILED]:"Failed to build deposit transaction",[Ve.DEPOSIT_SUBMIT_FAILED]:"Failed to submit deposit",[Ve.ORDER_FAILED]:"Order processing failed",[Ve.TRANSACTION_FAILED]:"Transaction failed",[Ve.TRANSACTION_REJECTED]:"Transaction was rejected",[Ve.INSUFFICIENT_BALANCE]:"Insufficient balance",[Ve.ELEMENT_NOT_FOUND]:"Target DOM element not found",[Ve.INITIALIZATION_FAILED]:"Widget initialization failed"};class Ye extends Error{constructor(e,t,r){super("string"==typeof t?t:t instanceof Error||"object"==typeof t&&null!==t&&"message"in t&&"string"==typeof t.message?t.message:Ge[e]??"Unknown error"),this.name="TokenFlightError",this.code=e,this.details=r}}const Xe=Symbol("solid-proxy"),Je="function"==typeof Proxy,Ze=Symbol("solid-track"),et={equals:(e,t)=>e===t};let tt=Ut;const rt=1,nt=2,it={owned:null,cleanups:null,context:null,owner:null},ot={};var st=null;let at=null,lt=null,ct=null,dt=null,ut=0;function ft(e,t){const r=lt,n=st,i=0===e.length,o=void 0===t?n:t,s=i?it:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=i?e:()=>e(()=>wt(()=>Lt(s)));st=s,lt=null;try{return Dt(a,!0)}finally{lt=r,st=n}}function ht(e,t){const r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},et,t):et).equals||void 0};return[Rt.bind(r),e=>("function"==typeof e&&(e=e(r.value)),Pt(r,e))]}function pt(e,t,r){Nt(Ft(e,t,!0,rt))}function gt(e,t,r){Nt(Ft(e,t,!1,rt))}function vt(e,t,r){tt=$t;const n=Ft(e,t,!1,rt);n.user=!0,dt?dt.push(n):Nt(n)}function mt(e,t,r){r=r?Object.assign({},et,r):et;const n=Ft(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Nt(n),Rt.bind(n)}function bt(e,t,r){let n,i,o;"function"==typeof t?(n=e,i=t,o={}):(n=!0,i=e,o=t||{});let s=null,a=ot,l=!1,c="initialValue"in o,d="function"==typeof n&&mt(n);const u=new Set,[f,h]=(o.storage||ht)(o.initialValue),[p,g]=ht(void 0),[v,m]=ht(void 0,{equals:!1}),[b,y]=ht(c?"ready":"unresolved");function w(e,t,r,n){return s===e&&(s=null,void 0!==n&&(c=!0),e!==a&&t!==a||!o.onHydrated||queueMicrotask(()=>o.onHydrated(n,{value:t})),a=ot,function(e,t){Dt(()=>{void 0===t&&h(()=>e),y(void 0!==t?"errored":c?"ready":"unresolved"),g(t);for(const e of u.keys())e.decrement();u.clear()},!1)}(t,r)),t}function x(){const e=f(),t=p();if(void 0!==t&&!s)throw t;return lt&<.user,e}function k(e=!0){if(!1!==e&&l)return;l=!1;const t=d?d():n;if(null==t||!1===t)return void w(s,wt(f));let r;const o=a!==ot?a:wt(()=>{try{return i(t,{value:f(),refetching:e})}catch(n){r=n}});var u;if(void 0===r)return(u=o)&&"object"==typeof u&&"then"in u?(s=o,"v"in o?(1===o.s?w(s,o.v,void 0,t):w(s,void 0,jt(o.v),t),o):(l=!0,queueMicrotask(()=>l=!1),Dt(()=>{y(c?"refreshing":"pending"),m()},!1),o.then(e=>w(o,e,void 0,t),e=>w(o,void 0,jt(e),t)))):(w(s,o,void 0,t),o);w(s,void 0,jt(r),t)}Object.defineProperties(x,{state:{get:()=>b()},error:{get:()=>p()},loading:{get(){const e=b();return"pending"===e||"refreshing"===e}},latest:{get(){if(!c)return x();const e=p();if(e&&!s)throw e;return f()}}});let T=st;return d?pt(()=>(T=st,k(!1))):k(!1),[x,{refetch:e=>function(t){const r=st,n=lt;st=t,lt=null;try{return Dt(()=>k(e),!0)}catch(i){zt(i)}finally{st=r,lt=n}}(T),mutate:h}]}function yt(e){return Dt(e,!1)}function wt(e){if(null===lt)return e();const t=lt;lt=null;try{return e()}finally{lt=t}}function xt(e,t,r){const n=Array.isArray(e);let i,o=r&&r.defer;return r=>{let s;if(n){s=Array(e.length);for(let t=0;t<e.length;t++)s[t]=e[t]()}else s=e();if(o)return o=!1,r;const a=wt(()=>t(s,i,r));return i=s,a}}function kt(e){vt(()=>wt(e))}function Tt(e){return null===st||(null===st.cleanups?st.cleanups=[e]:st.cleanups.push(e)),e}function It(){return lt}const[Ct,St]=ht(!1);function Et(e,t){const r=Symbol("context");return{id:r,Provider:Bt(r),defaultValue:e}}function At(e){let t;return st&&st.context&&void 0!==(t=st.context[e.id])?t:e.defaultValue}function Ot(e){const t=mt(e),r=mt(()=>Wt(t()));return r.toArray=()=>{const e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function Rt(){if(this.sources&&this.state)if(this.state===rt)Nt(this);else{const e=ct;ct=null,Dt(()=>qt(this),!1),ct=e}if(lt){const e=this.observers?this.observers.length:0;lt.sources?(lt.sources.push(this),lt.sourceSlots.push(e)):(lt.sources=[this],lt.sourceSlots=[e]),this.observers?(this.observers.push(lt),this.observerSlots.push(lt.sources.length-1)):(this.observers=[lt],this.observerSlots=[lt.sources.length-1])}return this.value}function Pt(e,t,r){let n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&Dt(()=>{for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t],n=at&&at.running;n&&at.disposed.has(r),(n?r.tState:r.state)||(r.pure?ct.push(r):dt.push(r),r.observers&&Mt(r)),n||(r.state=rt)}if(ct.length>1e6)throw ct=[],new Error},!1)),t}function Nt(e){if(!e.fn)return;Lt(e);const t=ut;!function(e,t,r){let n;const i=st,o=lt;lt=st=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=rt,e.owned&&e.owned.forEach(Lt),e.owned=null),e.updatedAt=r+1,zt(s)}finally{lt=o,st=i}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?Pt(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}function Ft(e,t,r,n=rt,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:st,context:st?st.context:null,pure:r};return null===st||st!==it&&(st.owned?st.owned.push(o):st.owned=[o]),o}function _t(e){if(0===e.state)return;if(e.state===nt)return qt(e);if(e.suspense&&wt(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ut);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if((e=t[r]).state===rt)Nt(e);else if(e.state===nt){const r=ct;ct=null,Dt(()=>qt(e,t[0]),!1),ct=r}}function Dt(e,t){if(ct)return e();let r=!1;t||(ct=[]),dt?r=!0:dt=[],ut++;try{const t=e();return function(e){if(ct&&(Ut(ct),ct=null),e)return;const t=dt;dt=null,t.length&&Dt(()=>tt(t),!1)}(r),t}catch(n){r||(dt=null),ct=null,zt(n)}}function Ut(e){for(let t=0;t<e.length;t++)_t(e[t])}function $t(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:_t(n)}for(t=0;t<r;t++)_t(e[t])}function qt(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const e=n.state;e===rt?n!==t&&(!n.updatedAt||n.updatedAt<ut)&&_t(n):e===nt&&qt(n,t)}}}function Mt(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=nt,r.pure?ct.push(r):dt.push(r),r.observers&&Mt(r))}}function Lt(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),r=e.sourceSlots.pop(),n=t.observers;if(n&&n.length){const e=n.pop(),i=t.observerSlots.pop();r<n.length&&(e.sourceSlots[i]=r,n[r]=e,t.observerSlots[r]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Lt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Lt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function jt(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function zt(e,t=st){throw jt(e)}function Wt(e){if("function"==typeof e&&!e.length)return Wt(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=Wt(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function Bt(e,t){return function(t){let r;return gt(()=>r=wt(()=>(st.context={...st.context,[e]:t.value},Ot(()=>t.children))),void 0),r}}const Ht=Symbol("fallback");function Qt(e){for(let t=0;t<e.length;t++)e[t]()}function Kt(e,t){return wt(()=>e(t||{}))}function Vt(){return!0}const Gt={get:(e,t,r)=>t===Xe?r:e.get(t),has:(e,t)=>t===Xe||e.has(t),set:Vt,deleteProperty:Vt,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:Vt,deleteProperty:Vt}),ownKeys:e=>e.keys()};function Yt(e){return(e="function"==typeof e?e():e)?e:{}}function Xt(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function Jt(...e){let t=!1;for(let s=0;s<e.length;s++){const r=e[s];t=t||!!r&&Xe in r,e[s]="function"==typeof r?(t=!0,mt(r)):r}if(Je&&t)return new Proxy({get(t){for(let r=e.length-1;r>=0;r--){const n=Yt(e[r])[t];if(void 0!==n)return n}},has(t){for(let r=e.length-1;r>=0;r--)if(t in Yt(e[r]))return!0;return!1},keys(){const t=[];for(let r=0;r<e.length;r++)t.push(...Object.keys(Yt(e[r])));return[...new Set(t)]}},Gt);const r={},n=Object.create(null);for(let s=e.length-1;s>=0;s--){const t=e[s];if(!t)continue;const i=Object.getOwnPropertyNames(t);for(let e=i.length-1;e>=0;e--){const o=i[e];if("__proto__"===o||"constructor"===o)continue;const s=Object.getOwnPropertyDescriptor(t,o);if(n[o]){const e=r[o];e&&(s.get?e.push(s.get.bind(t)):void 0!==s.value&&e.push(()=>s.value))}else n[o]=s.get?{enumerable:!0,configurable:!0,get:Xt.bind(r[o]=[s.get.bind(t)])}:void 0!==s.value?s:void 0}}const i={},o=Object.keys(n);for(let s=o.length-1;s>=0;s--){const e=o[s],t=n[e];t&&t.get?Object.defineProperty(i,e,t):i[e]=t?t.value:void 0}return i}function Zt(e,...t){const r=t.length;if(Je&&Xe in e){const n=r>1?t.flat():t[0],i=t.map(t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter(t=>t in e)},Gt));return i.push(new Proxy({get:t=>n.includes(t)?void 0:e[t],has:t=>!n.includes(t)&&t in e,keys:()=>Object.keys(e).filter(e=>!n.includes(e))},Gt)),i}const n=[];for(let i=0;i<=r;i++)n[i]={};for(const i of Object.getOwnPropertyNames(e)){let o=r;for(let e=0;e<t.length;e++)if(t[e].includes(i)){o=e;break}const s=Object.getOwnPropertyDescriptor(e,i);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?n[o][i]=s.value:Object.defineProperty(n[o],i,s)}return n}const er=e=>`Stale read from <${e}>.`;function tr(e){const t="fallback"in e&&{fallback:()=>e.fallback};return mt(function(e,t,r={}){let n=[],i=[],o=[],s=0,a=t.length>1?[]:null;return Tt(()=>Qt(o)),()=>{let l,c,d=e()||[],u=d.length;return d[Ze],wt(()=>{let e,t,h,p,g,v,m,b,y;if(0===u)0!==s&&(Qt(o),o=[],n=[],i=[],s=0,a&&(a=[])),r.fallback&&(n=[Ht],i[0]=ft(e=>(o[0]=e,r.fallback())),s=1);else if(0===s){for(i=new Array(u),c=0;c<u;c++)n[c]=d[c],i[c]=ft(f);s=u}else{for(h=new Array(u),p=new Array(u),a&&(g=new Array(u)),v=0,m=Math.min(s,u);v<m&&n[v]===d[v];v++);for(m=s-1,b=u-1;m>=v&&b>=v&&n[m]===d[b];m--,b--)h[b]=i[m],p[b]=o[m],a&&(g[b]=a[m]);for(e=new Map,t=new Array(b+1),c=b;c>=v;c--)y=d[c],l=e.get(y),t[c]=void 0===l?-1:l,e.set(y,c);for(l=v;l<=m;l++)y=n[l],c=e.get(y),void 0!==c&&-1!==c?(h[c]=i[l],p[c]=o[l],a&&(g[c]=a[l]),c=t[c],e.set(y,c)):o[l]();for(c=v;c<u;c++)c in h?(i[c]=h[c],o[c]=p[c],a&&(a[c]=g[c],a[c](c))):i[c]=ft(f);i=i.slice(0,s=u),n=d.slice(0)}return i});function f(e){if(o[c]=e,a){const[e,r]=ht(c);return a[c]=r,t(d[c],e)}return t(d[c])}}}(()=>e.each,e.children,t||void 0))}function rr(e){const t=e.keyed,r=mt(()=>e.when,void 0,void 0),n=t?r:mt(r,void 0,{equals:(e,t)=>!e==!t});return mt(()=>{const i=n();if(i){const o=e.children;return"function"==typeof o&&o.length>0?wt(()=>o(t?i:()=>{if(!wt(n))throw er("Show");return r()})):o}return e.fallback},void 0,void 0)}function nr(e){const t=Ot(()=>e.children),r=mt(()=>{const e=t(),r=Array.isArray(e)?e:[e];let n=()=>{};for(let t=0;t<r.length;t++){const e=t,i=r[t],o=n,s=mt(()=>o()?void 0:i.when,void 0,void 0),a=i.keyed?s:mt(s,void 0,{equals:(e,t)=>!e==!t});n=()=>o()||(a()?[e,s,i]:void 0)}return n});return mt(()=>{const t=r()();if(!t)return e.fallback;const[n,i,o]=t,s=o.children;return"function"==typeof s&&s.length>0?wt(()=>s(o.keyed?i():()=>{if(wt(r)()?.[0]!==n)throw er("Match");return i()})):s},void 0,void 0)}function ir(e){return e}const or=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable","allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"]),sr=new Set(["innerHTML","textContent","innerText","children"]),ar=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),lr=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}}),cr=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),dr=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ur={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},fr=e=>mt(()=>e()),hr="_$DX_DELEGATE";function pr(e,t,r,n={}){let i;return ft(n=>{i=n,t===document?e():Tr(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}function gr(e,t,r,n){let i;const o=()=>{const t=document.createElement("template");return t.innerHTML=e,t.content.firstChild},s=t?()=>wt(()=>document.importNode(i||(i=o()),!0)):()=>(i||(i=o())).cloneNode(!0);return s.cloneNode=s,s}function vr(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function mr(e,t){null==t?e.removeAttribute("class"):e.className=t}function br(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const n=r[0];e.addEventListener(t,r[0]=t=>n.call(e,r[1],t))}else e.addEventListener(t,r,"function"!=typeof r&&r)}function yr(e,t,r){if(!t)return r?vr(e,"style"):t;const n=e.style;if("string"==typeof t)return n.cssText=t;let i,o;for(o in"string"==typeof r&&(n.cssText=r=void 0),r||(r={}),t||(t={}),r)null==t[o]&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function wr(e,t,r){null!=r?e.style.setProperty(t,r):e.style.removeProperty(t)}function xr(e,t={},r,n){const i={};return n||gt(()=>i.children=Er(e,t.children,i.children)),gt(()=>"function"==typeof t.ref&&kr(t.ref,e)),gt(()=>function(e,t,r,n,i={},o=!1){t||(t={});for(const s in i)if(!(s in t)){if("children"===s)continue;i[s]=Cr(e,s,null,i[s],r,o,t)}for(const s in t){if("children"===s)continue;const n=t[s];i[s]=Cr(e,s,n,i[s],r,o,t)}}(e,t,r,0,i,!0)),i}function kr(e,t,r){return wt(()=>e(t,r))}function Tr(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return Er(e,t,n,r);gt(n=>Er(e,t(),n,r),n)}function Ir(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i<o;i++)e.classList.toggle(n[i],r)}function Cr(e,t,r,n,i,o,s){let a,l,c,d,u;if("style"===t)return yr(e,r,n);if("classList"===t)return function(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,s;for(o=0,s=i.length;o<s;o++){const n=i[o];n&&"undefined"!==n&&!t[n]&&(Ir(e,n,!1),delete r[n])}for(o=0,s=n.length;o<s;o++){const i=n[o],s=!!t[i];i&&"undefined"!==i&&r[i]!==s&&s&&(Ir(e,i,!0),r[i]=s)}return r}(e,r,n);if(r===n)return n;if("ref"===t)o||r(e);else if("on:"===t.slice(0,3)){const i=t.slice(3);n&&e.removeEventListener(i,n,"function"!=typeof n&&n),r&&e.addEventListener(i,r,"function"!=typeof r&&r)}else if("oncapture:"===t.slice(0,10)){const i=t.slice(10);n&&e.removeEventListener(i,n,!0),r&&e.addEventListener(i,r,!0)}else if("on"===t.slice(0,2)){const i=t.slice(2).toLowerCase(),o=cr.has(i);if(!o&&n){const t=Array.isArray(n)?n[0]:n;e.removeEventListener(i,t)}(o||r)&&(br(e,i,r,o),o&&function(e,t=window.document){const r=t[hr]||(t[hr]=new Set);for(let n=0,i=e.length;n<i;n++){const i=e[n];r.has(i)||(r.add(i),t.addEventListener(i,Sr))}}([i]))}else if("attr:"===t.slice(0,5))vr(e,t.slice(5),r);else if("bool:"===t.slice(0,5))!function(e,t,r){r?e.setAttribute(t,""):e.removeAttribute(t)}(e,t.slice(5),r);else if((u="prop:"===t.slice(0,5))||(c=sr.has(t))||!i&&((d=function(e,t){const r=lr[e];return"object"==typeof r?r[t]?r.$:void 0:r}(t,e.tagName))||(l=or.has(t)))||(a=e.nodeName.includes("-")||"is"in s))u&&(t=t.slice(5),l=!0),"class"===t||"className"===t?mr(e,r):!a||l||c?e[d||t]=r:e[(f=t,f.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase()))]=r;else{const n=i&&t.indexOf(":")>-1&&ur[t.split(":")[0]];n?function(e,t,r,n){null==n?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}(e,n,t,r):vr(e,ar[t]||t,r)}var f;return r}function Sr(e){let t=e.target;const r=`$$${e.type}`,n=e.target,i=e.currentTarget,o=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),s=()=>{const n=t[r];if(n&&!t.disabled){const i=t[`${r}Data`];if(void 0!==i?n.call(t,i,e):n.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){const r=e.composedPath();o(r[0]);for(let e=0;e<r.length-2&&(t=r[e],s());e++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();o(n)}function Er(e,t,r,n,i){for(;"function"==typeof r;)r=r();if(t===r)return r;const o=typeof t,s=void 0!==n;if(e=s&&r[0]&&r[0].parentNode||e,"string"===o||"number"===o){if("number"===o&&(t=t.toString())===r)return r;if(s){let i=r[0];i&&3===i.nodeType?i.data!==t&&(i.data=t):i=document.createTextNode(t),r=Rr(e,r,n,i)}else r=""!==r&&"string"==typeof r?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===o)r=Rr(e,r,n);else{if("function"===o)return gt(()=>{let i=t();for(;"function"==typeof i;)i=i();r=Er(e,i,r,n)}),()=>r;if(Array.isArray(t)){const o=[],a=r&&Array.isArray(r);if(Ar(o,t,r,i))return gt(()=>r=Er(e,o,r,n,!0)),()=>r;if(0===o.length){if(r=Rr(e,r,n),s)return r}else a?0===r.length?Or(e,o,n):function(e,t,r){let n=r.length,i=t.length,o=n,s=0,a=0,l=t[i-1].nextSibling,c=null;for(;s<i||a<o;)if(t[s]!==r[a]){for(;t[i-1]===r[o-1];)i--,o--;if(i===s){const t=o<n?a?r[a-1].nextSibling:r[o-a]:l;for(;a<o;)e.insertBefore(r[a++],t)}else if(o===a)for(;s<i;)c&&c.has(t[s])||t[s].remove(),s++;else if(t[s]===r[o-1]&&r[a]===t[i-1]){const n=t[--i].nextSibling;e.insertBefore(r[a++],t[s++].nextSibling),e.insertBefore(r[--o],n),t[i]=r[o]}else{if(!c){c=new Map;let e=a;for(;e<o;)c.set(r[e],e++)}const n=c.get(t[s]);if(null!=n)if(a<n&&n<o){let l,d=s,u=1;for(;++d<i&&d<o&&null!=(l=c.get(t[d]))&&l===n+u;)u++;if(u>n-a){const i=t[s];for(;a<n;)e.insertBefore(r[a++],i)}else e.replaceChild(r[a++],t[s++])}else s++;else t[s++].remove()}}else s++,a++}(e,r,o):(r&&Rr(e),Or(e,o));r=o}else if(t.nodeType){if(Array.isArray(r)){if(s)return r=Rr(e,r,n,t);Rr(e,r,null,t)}else null!=r&&""!==r&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);r=t}}return r}function Ar(e,t,r,n){let i=!1;for(let o=0,s=t.length;o<s;o++){let s,a=t[o],l=r&&r[e.length];if(null==a||!0===a||!1===a);else if("object"==(s=typeof a)&&a.nodeType)e.push(a);else if(Array.isArray(a))i=Ar(e,a,l)||i;else if("function"===s)if(n){for(;"function"==typeof a;)a=a();i=Ar(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const t=String(a);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return i}function Or(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Rr(e,t,r,n){if(void 0===r)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let n=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const t=s.parentNode===e;n||o?t&&s.remove():t?e.replaceChild(i,s):e.insertBefore(i,r)}else n=!0}}else e.insertBefore(i,r);return[i]}function Pr(e){const[,t]=Zt(e,["component"]);return function(e,t){const r=mt(e);return mt(()=>{const e=r();switch(typeof e){case"function":return wt(()=>e(t));case"string":const r=dr.has(e),n=function(e,t=!1,r){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e,{is:r})}(e,r,wt(()=>t.is));return xr(n,t,r),n}})}(()=>e.component,t)}var Nr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_r=new(n=class{constructor(){We(this,t,Fr),We(this,r,!1)}setTimeoutProvider(e){"production"!==process.env.NODE_ENV&&ze(this,r)&&ze(this,t),Be(this,t,e),"production"!==process.env.NODE_ENV&&Be(this,r,!1)}setTimeout(e,n){return"production"!==process.env.NODE_ENV&&Be(this,r,!0),ze(this,t).setTimeout(e,n)}clearTimeout(e){ze(this,t).clearTimeout(e)}setInterval(e,n){return"production"!==process.env.NODE_ENV&&Be(this,r,!0),ze(this,t).setInterval(e,n)}clearInterval(e){ze(this,t).clearInterval(e)}},t=new WeakMap,r=new WeakMap,n),Dr="undefined"==typeof window||"Deno"in globalThis;function Ur(){}function $r(e){return"number"==typeof e&&e>=0&&e!==1/0}function qr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Mr(e,t){return"function"==typeof e?e(t):e}function Lr(e,t){return"function"==typeof e?e(t):e}function jr(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s)if(n){if(t.queryHash!==Wr(s,t.options))return!1}else if(!Hr(t.queryKey,s))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function zr(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Br(t.options.mutationKey)!==Br(o))return!1}else if(!Hr(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Wr(e,t){return(t?.queryKeyHashFn||Br)(e)}function Br(e){return JSON.stringify(e,(e,t)=>Yr(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function Hr(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>Hr(e[r],t[r]))}var Qr=Object.prototype.hasOwnProperty;function Kr(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Gr(e)&&Gr(t);if(!(n||Yr(e)&&Yr(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),s=o.length,a=n?new Array(s):{};let l=0;for(let c=0;c<s;c++){const s=n?c:o[c],d=e[s],u=t[s];if(d===u){a[s]=d,(n?c<i:Qr.call(e,s))&&l++;continue}if(null===d||null===u||"object"!=typeof d||"object"!=typeof u){a[s]=u;continue}const f=Kr(d,u,r+1);a[s]=f,f===d&&l++}return i===s&&l===i?e:a}function Vr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Gr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yr(e){if(!Xr(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!Xr(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function Xr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Jr(e,t,r){if("function"==typeof r.structuralSharing)return r.structuralSharing(e,t);if(!1!==r.structuralSharing){if("production"!==process.env.NODE_ENV)try{return Kr(e,t)}catch(n){throw n}return Kr(e,t)}return t}function Zr(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function en(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var tn=Symbol();function rn(e,t){return"production"!==process.env.NODE_ENV&&e.queryFn,!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==tn?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var nn=new(a=class extends Nr{constructor(){super(),We(this,i),We(this,o),We(this,s),Be(this,s,e=>{if(!Dr&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ze(this,o)||this.setEventListener(ze(this,s))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=ze(this,o))||e.call(this),Be(this,o,void 0))}setEventListener(e){var t;Be(this,s,e),null==(t=ze(this,o))||t.call(this),Be(this,o,e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){ze(this,i)!==e&&(Be(this,i,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof ze(this,i)?ze(this,i):"hidden"!==globalThis.document?.visibilityState}},i=new WeakMap,o=new WeakMap,s=new WeakMap,a);function on(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function sn(e){return e}var an=function(e){setTimeout(e,0)},ln=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=an;const o=n=>{t?e.push(n):i(()=>{r(n)})};return{batch:o=>{let s;t++;try{s=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&i(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return s},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}(),cn=new(u=class extends Nr{constructor(){super(),We(this,l,!0),We(this,c),We(this,d),Be(this,d,e=>{if(!Dr&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ze(this,c)||this.setEventListener(ze(this,d))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=ze(this,c))||e.call(this),Be(this,c,void 0))}setEventListener(e){var t;Be(this,d,e),null==(t=ze(this,c))||t.call(this),Be(this,c,e(this.setOnline.bind(this)))}setOnline(e){ze(this,l)!==e&&(Be(this,l,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return ze(this,l)}},l=new WeakMap,c=new WeakMap,d=new WeakMap,u);function dn(e){return Math.min(1e3*2**e,3e4)}function un(e){return"online"!==(e??"online")||cn.isOnline()}var fn=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function hn(e){let t,r=!1,n=0;const i=on(),o=()=>"pending"!==i.status,s=()=>nn.isFocused()&&("always"===e.networkMode||cn.isOnline())&&e.canRun(),a=()=>un(e.networkMode)&&e.canRun(),l=e=>{o()||(t?.(),i.resolve(e))},c=e=>{o()||(t?.(),i.reject(e))},d=()=>new Promise(r=>{t=e=>{(o()||s())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),u=()=>{if(o())return;let t;const i=0===n?e.initialPromise:void 0;try{t=i??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(l).catch(t=>{if(o())return;const i=e.retry??(Dr?0:3),a=e.retryDelay??dn,l="function"==typeof a?a(n,t):a,f=!0===i||"number"==typeof i&&n<i||"function"==typeof i&&i(n,t);var h;!r&&f?(n++,e.onFail?.(n,t),(h=l,new Promise(e=>{_r.setTimeout(e,h)})).then(()=>s()?void 0:d()).then(()=>{r?c(t):u()})):c(t)})};return{promise:i,status:()=>i.status,cancel:t=>{if(!o()){const r=new fn(t);c(r),e.onCancel?.(r)}},continue:()=>(t?.(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?u():d().then(u),i)}}var pn=(h=class{constructor(){We(this,f)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$r(this.gcTime)&&Be(this,f,_r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Dr?1/0:3e5))}clearGcTimeout(){ze(this,f)&&(_r.clearTimeout(ze(this,f)),Be(this,f,void 0))}},f=new WeakMap,h),gn=(T=class extends pn{constructor(e){super(),We(this,x),We(this,p),We(this,g),We(this,v),We(this,m),We(this,b),We(this,y),We(this,w),Be(this,w,!1),Be(this,y,e.defaultOptions),this.setOptions(e.options),this.observers=[],Be(this,m,e.client),Be(this,v,ze(this,m).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Be(this,p,bn(this.options)),this.state=e.state??ze(this,p),this.scheduleGc()}get meta(){return this.options.meta}get promise(){return ze(this,b)?.promise}setOptions(e){if(this.options={...ze(this,y),...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=bn(this.options);void 0!==e.data&&(this.setState(mn(e.data,e.dataUpdatedAt)),Be(this,p,e))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||ze(this,v).remove(this)}setData(e,t){const r=Jr(this.state.data,e,this.options);return He(this,x,k).call(this,{data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){He(this,x,k).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){const t=ze(this,b)?.promise;return ze(this,b)?.cancel(e),t?t.then(Ur).catch(Ur):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ze(this,p))}isActive(){return this.observers.some(e=>!1!==Lr(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===Mr(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!qr(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),ze(this,b)?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),ze(this,b)?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ze(this,v).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(ze(this,b)&&(ze(this,w)?ze(this,b).cancel({revert:!0}):ze(this,b).cancelRetry()),this.scheduleGc()),ze(this,v).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,x,k).call(this,{type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==ze(this,b)?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(ze(this,b))return ze(this,b).continueRetry(),ze(this,b).promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}"production"!==process.env.NODE_ENV&&Array.isArray(this.options.queryKey);const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(Be(this,w,!0),r.signal)})},i=()=>{const e=rn(this.options,t),r=(()=>{const e={client:ze(this,m),queryKey:this.queryKey,meta:this.meta};return n(e),e})();return Be(this,w,!1),this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:ze(this,m),state:this.state,fetchFn:i};return n(e),e})();this.options.behavior?.onFetch(o,this),Be(this,g,this.state),"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||He(this,x,k).call(this,{type:"fetch",meta:o.fetchOptions?.meta}),Be(this,b,hn({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof fn&&e.revert&&this.setState({...ze(this,g),fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{He(this,x,k).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{He(this,x,k).call(this,{type:"pause"})},onContinue:()=>{He(this,x,k).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const e=await ze(this,b).start();if(void 0===e)throw process.env.NODE_ENV,new Error(`${this.queryHash} data is undefined`);return this.setData(e),ze(this,v).config.onSuccess?.(e,this),ze(this,v).config.onSettled?.(e,this.state.error,this),e}catch(s){if(s instanceof fn){if(s.silent)return ze(this,b).promise;if(s.revert){if(void 0===this.state.data)throw s;return this.state.data}}throw He(this,x,k).call(this,{type:"error",error:s}),ze(this,v).config.onError?.(s,this),ze(this,v).config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}},p=new WeakMap,g=new WeakMap,v=new WeakMap,m=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,x=new WeakSet,k=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...vn(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...mn(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Be(this,g,e.manual?r:void 0),r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),ln.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),ze(this,v).notify({query:this,type:"updated",action:e})})},T);function vn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:un(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function mn(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bn(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var yn=(G=class extends Nr{constructor(e,t){super(),We(this,M),We(this,I),We(this,C),We(this,S),We(this,E),We(this,A),We(this,O),We(this,R),We(this,P),We(this,N),We(this,F),We(this,_),We(this,D),We(this,U),We(this,$),We(this,q,new Set),this.options=t,Be(this,I,e),Be(this,P,null),Be(this,R,on()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(ze(this,C).addObserver(this),wn(ze(this,C),this.options)?He(this,M,L).call(this):this.updateResult(),He(this,M,B).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xn(ze(this,C),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xn(ze(this,C),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,M,H).call(this),He(this,M,Q).call(this),ze(this,C).removeObserver(this)}setOptions(e){const t=this.options,r=ze(this,C);if(this.options=ze(this,I).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof Lr(this.options.enabled,ze(this,C)))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,M,K).call(this),ze(this,C).setOptions(this.options),t._defaulted&&!Vr(this.options,t)&&ze(this,I).getQueryCache().notify({type:"observerOptionsUpdated",query:ze(this,C),observer:this});const n=this.hasListeners();n&&kn(ze(this,C),r,this.options,t)&&He(this,M,L).call(this),this.updateResult(),!n||ze(this,C)===r&&Lr(this.options.enabled,ze(this,C))===Lr(t.enabled,ze(this,C))&&Mr(this.options.staleTime,ze(this,C))===Mr(t.staleTime,ze(this,C))||He(this,M,j).call(this);const i=He(this,M,z).call(this);!n||ze(this,C)===r&&Lr(this.options.enabled,ze(this,C))===Lr(t.enabled,ze(this,C))&&i===ze(this,$)||He(this,M,W).call(this,i)}getOptimisticResult(e){const t=ze(this,I).getQueryCache().build(ze(this,I),e),r=this.createResult(t,e);return n=r,!Vr(this.getCurrentResult(),n)&&(Be(this,E,r),Be(this,O,this.options),Be(this,A,ze(this,C).state)),r;var n}getCurrentResult(){return ze(this,E)}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==ze(this,R).status||ze(this,R).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){ze(this,q).add(e)}getCurrentQuery(){return ze(this,C)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=ze(this,I).defaultQueryOptions(e),r=ze(this,I).getQueryCache().build(ze(this,I),t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return He(this,M,L).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),ze(this,E)))}createResult(e,t){const r=ze(this,C),n=this.options,i=ze(this,E),o=ze(this,A),s=ze(this,O),a=e!==r?e.state:ze(this,S),{state:l}=e;let c,d={...l},u=!1;if(t._optimisticResults){const i=this.hasListeners(),o=!i&&wn(e,t),s=i&&kn(e,r,t,n);(o||s)&&(d={...d,...vn(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:p}=d;c=d.data;let g=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===p){let e;i?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=i.data,g=!0):e="function"==typeof t.placeholderData?t.placeholderData(ze(this,_)?.state.data,ze(this,_)):t.placeholderData,void 0!==e&&(p="success",c=Jr(i?.data,e,t),u=!0)}if(t.select&&void 0!==c&&!g)if(i&&c===o?.data&&t.select===ze(this,N))c=ze(this,F);else try{Be(this,N,t.select),c=t.select(c),c=Jr(i?.data,c,t),Be(this,F,c),Be(this,P,null)}catch(k){Be(this,P,k)}ze(this,P)&&(f=ze(this,P),c=ze(this,F),h=Date.now(),p="error");const v="fetching"===d.fetchStatus,m="pending"===p,b="error"===p,y=m&&v,w=void 0!==c,x={status:p,fetchStatus:d.fetchStatus,isPending:m,isSuccess:"success"===p,isError:b,isInitialLoading:y,isLoading:y,data:c,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>a.dataUpdateCount||d.errorUpdateCount>a.errorUpdateCount,isFetching:v,isRefetching:v&&!m,isLoadingError:b&&!w,isPaused:"paused"===d.fetchStatus,isPlaceholderData:u,isRefetchError:b&&w,isStale:Tn(e,t),refetch:this.refetch,promise:ze(this,R),isEnabled:!1!==Lr(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==x.data,n="error"===x.status&&!t,i=e=>{n?e.reject(x.error):t&&e.resolve(x.data)},o=()=>{const e=Be(this,R,x.promise=on());i(e)},s=ze(this,R);switch(s.status){case"pending":e.queryHash===r.queryHash&&i(s);break;case"fulfilled":(n||x.data!==s.value)&&o();break;case"rejected":n&&x.error===s.reason||o()}}return x}updateResult(){const e=ze(this,E),t=this.createResult(ze(this,C),this.options);Be(this,A,ze(this,C).state),Be(this,O,this.options),void 0!==ze(this,A).data&&Be(this,_,ze(this,C)),Vr(t,e)||(Be(this,E,t),He(this,M,V).call(this,{listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!ze(this,q).size)return!0;const n=new Set(r??ze(this,q));return this.options.throwOnError&&n.add("error"),Object.keys(ze(this,E)).some(t=>{const r=t;return ze(this,E)[r]!==e[r]&&n.has(r)})})()}))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,M,B).call(this)}},I=new WeakMap,C=new WeakMap,S=new WeakMap,E=new WeakMap,A=new WeakMap,O=new WeakMap,R=new WeakMap,P=new WeakMap,N=new WeakMap,F=new WeakMap,_=new WeakMap,D=new WeakMap,U=new WeakMap,$=new WeakMap,q=new WeakMap,M=new WeakSet,L=function(e){He(this,M,K).call(this);let t=ze(this,C).fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ur)),t},j=function(){He(this,M,H).call(this);const e=Mr(this.options.staleTime,ze(this,C));if(Dr||ze(this,E).isStale||!$r(e))return;const t=qr(ze(this,E).dataUpdatedAt,e)+1;Be(this,D,_r.setTimeout(()=>{ze(this,E).isStale||this.updateResult()},t))},z=function(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(ze(this,C)):this.options.refetchInterval)??!1},W=function(e){He(this,M,Q).call(this),Be(this,$,e),!Dr&&!1!==Lr(this.options.enabled,ze(this,C))&&$r(ze(this,$))&&0!==ze(this,$)&&Be(this,U,_r.setInterval(()=>{(this.options.refetchIntervalInBackground||nn.isFocused())&&He(this,M,L).call(this)},ze(this,$)))},B=function(){He(this,M,j).call(this),He(this,M,W).call(this,He(this,M,z).call(this))},H=function(){ze(this,D)&&(_r.clearTimeout(ze(this,D)),Be(this,D,void 0))},Q=function(){ze(this,U)&&(_r.clearInterval(ze(this,U)),Be(this,U,void 0))},K=function(){const e=ze(this,I).getQueryCache().build(ze(this,I),this.options);if(e===ze(this,C))return;const t=ze(this,C);Be(this,C,e),Be(this,S,e.state),this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))},V=function(e){ln.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(ze(this,E))}),ze(this,I).getQueryCache().notify({query:ze(this,C),type:"observerResultsUpdated"})})},G);function wn(e,t){return function(e,t){return!1!==Lr(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&xn(e,t,t.refetchOnMount)}function xn(e,t,r){if(!1!==Lr(t.enabled,e)&&"static"!==Mr(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&Tn(e,t)}return!1}function kn(e,t,r,n){return(e!==t||!1===Lr(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&Tn(e,r)}function Tn(e,t){return!1!==Lr(t.enabled,e)&&e.isStaleByTime(Mr(t.staleTime,e))}function In(e){return{onFetch:(t,r)=>{const n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let r=!1;const c=e=>{!function(e,r,n){let i,o=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t.signal),o||(o=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)})}(e,0,()=>r=!0)},d=rn(t.options,t.fetchOptions),u=async(e,n,i)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const o=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta};return c(e),e})(),s=await d(o),{maxPages:a}=t.options,l=i?en:Zr;return{pages:l(e.pages,s,a),pageParams:l(e.pageParams,n,a)}};if(i&&o.length){const e="backward"===i,t={pages:o,pageParams:s},r=(e?Sn:Cn)(n,t);a=await u(t,r,e)}else{const t=e??o.length;do{const e=0===l?s[0]??n.initialPageParam:Cn(n,a);if(l>0&&null==e)break;a=await u(a,e),l++}while(l<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function Cn(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Sn(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var En=(re=class extends pn{constructor(e){super(),We(this,ee),We(this,Y),We(this,X),We(this,J),We(this,Z),Be(this,Y,e.client),this.mutationId=e.mutationId,Be(this,J,e.mutationCache),Be(this,X,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ze(this,X).includes(e)||(ze(this,X).push(e),this.clearGcTimeout(),ze(this,J).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Be(this,X,ze(this,X).filter(t=>t!==e)),this.scheduleGc(),ze(this,J).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ze(this,X).length||("pending"===this.state.status?this.scheduleGc():ze(this,J).remove(this))}continue(){return ze(this,Z)?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{He(this,ee,te).call(this,{type:"continue"})},r={client:ze(this,Y),meta:this.options.meta,mutationKey:this.options.mutationKey};Be(this,Z,hn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{He(this,ee,te).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{He(this,ee,te).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ze(this,J).canRun(this)}));const n="pending"===this.state.status,i=!ze(this,Z).canStart();try{if(n)t();else{He(this,ee,te).call(this,{type:"pending",variables:e,isPaused:i}),ze(this,J).config.onMutate&&await ze(this,J).config.onMutate(e,this,r);const t=await(this.options.onMutate?.(e,r));t!==this.state.context&&He(this,ee,te).call(this,{type:"pending",context:t,variables:e,isPaused:i})}const o=await ze(this,Z).start();return await(ze(this,J).config.onSuccess?.(o,e,this.state.context,this,r)),await(this.options.onSuccess?.(o,e,this.state.context,r)),await(ze(this,J).config.onSettled?.(o,null,this.state.variables,this.state.context,this,r)),await(this.options.onSettled?.(o,null,e,this.state.context,r)),He(this,ee,te).call(this,{type:"success",data:o}),o}catch(o){try{await(ze(this,J).config.onError?.(o,e,this.state.context,this,r))}catch(s){Promise.reject(s)}try{await(this.options.onError?.(o,e,this.state.context,r))}catch(s){Promise.reject(s)}try{await(ze(this,J).config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,r))}catch(s){Promise.reject(s)}try{await(this.options.onSettled?.(void 0,o,e,this.state.context,r))}catch(s){Promise.reject(s)}throw He(this,ee,te).call(this,{type:"error",error:o}),o}finally{ze(this,J).runNext(this)}}},Y=new WeakMap,X=new WeakMap,J=new WeakMap,Z=new WeakMap,ee=new WeakSet,te=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),ln.batch(()=>{ze(this,X).forEach(t=>{t.onMutationUpdate(e)}),ze(this,J).notify({mutation:this,type:"updated",action:e})})},re),An=(se=class extends Nr{constructor(e={}){super(),We(this,ne),We(this,ie),We(this,oe),this.config=e,Be(this,ne,new Set),Be(this,ie,new Map),Be(this,oe,0)}build(e,t,r){const n=new En({client:e,mutationCache:this,mutationId:++Qe(this,oe)._,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){ze(this,ne).add(e);const t=On(e);if("string"==typeof t){const r=ze(this,ie).get(t);r?r.push(e):ze(this,ie).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(ze(this,ne).delete(e)){const t=On(e);if("string"==typeof t){const r=ze(this,ie).get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&ze(this,ie).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=On(e);if("string"==typeof t){const r=ze(this,ie).get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}return!0}runNext(e){const t=On(e);if("string"==typeof t){const r=ze(this,ie).get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}return Promise.resolve()}clear(){ln.batch(()=>{ze(this,ne).forEach(e=>{this.notify({type:"removed",mutation:e})}),ze(this,ne).clear(),ze(this,ie).clear()})}getAll(){return Array.from(ze(this,ne))}find(e){const t={exact:!0,...e};return this.getAll().find(e=>zr(t,e))}findAll(e={}){return this.getAll().filter(t=>zr(e,t))}notify(e){ln.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return ln.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ur))))}},ne=new WeakMap,ie=new WeakMap,oe=new WeakMap,se);function On(e){return e.options.scope?.id}var Rn=(le=class extends Nr{constructor(e={}){super(),We(this,ae),this.config=e,Be(this,ae,new Map)}build(e,t,r){const n=t.queryKey,i=t.queryHash??Wr(n,t);let o=this.get(i);return o||(o=new gn({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(o)),o}add(e){ze(this,ae).has(e.queryHash)||(ze(this,ae).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=ze(this,ae).get(e.queryHash);t&&(e.destroy(),t===e&&ze(this,ae).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ln.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ze(this,ae).get(e)}getAll(){return[...ze(this,ae).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>jr(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>jr(e,t)):t}notify(e){ln.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ln.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ln.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ae=new WeakMap,le),Pn=(me=class{constructor(e={}){We(this,ce),We(this,de),We(this,ue),We(this,fe),We(this,he),We(this,pe),We(this,ge),We(this,ve),Be(this,ce,e.queryCache||new Rn),Be(this,de,e.mutationCache||new An),Be(this,ue,e.defaultOptions||{}),Be(this,fe,new Map),Be(this,he,new Map),Be(this,pe,0)}mount(){Qe(this,pe)._++,1===ze(this,pe)&&(Be(this,ge,nn.subscribe(async e=>{e&&(await this.resumePausedMutations(),ze(this,ce).onFocus())})),Be(this,ve,cn.subscribe(async e=>{e&&(await this.resumePausedMutations(),ze(this,ce).onOnline())})))}unmount(){var e,t;Qe(this,pe)._--,0===ze(this,pe)&&(null==(e=ze(this,ge))||e.call(this),Be(this,ge,void 0),null==(t=ze(this,ve))||t.call(this),Be(this,ve,void 0))}isFetching(e){return ze(this,ce).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ze(this,de).findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return ze(this,ce).get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=ze(this,ce).build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Mr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return ze(this,ce).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=ze(this,ce).get(n.queryHash),o=i?.state.data,s=function(e,t){return"function"==typeof e?e(t):e}(t,o);if(void 0!==s)return ze(this,ce).build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return ln.batch(()=>ze(this,ce).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return ze(this,ce).get(t.queryHash)?.state}removeQueries(e){const t=ze(this,ce);ln.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const r=ze(this,ce);return ln.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=ln.batch(()=>ze(this,ce).findAll(e).map(e=>e.cancel(r)));return Promise.all(n).then(Ur).catch(Ur)}invalidateQueries(e,t={}){return ln.batch(()=>(ze(this,ce).findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=ln.batch(()=>ze(this,ce).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(Ur)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(n).then(Ur)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=ze(this,ce).build(this,t);return r.isStaleByTime(Mr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ur).catch(Ur)}fetchInfiniteQuery(e){return e.behavior=In(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ur).catch(Ur)}ensureInfiniteQueryData(e){return e.behavior=In(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cn.isOnline()?ze(this,de).resumePausedMutations():Promise.resolve()}getQueryCache(){return ze(this,ce)}getMutationCache(){return ze(this,de)}getDefaultOptions(){return ze(this,ue)}setDefaultOptions(e){Be(this,ue,e)}setQueryDefaults(e,t){ze(this,fe).set(Br(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ze(this,fe).values()],r={};return t.forEach(t=>{Hr(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){ze(this,he).set(Br(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ze(this,he).values()],r={};return t.forEach(t=>{Hr(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ze(this,ue).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Wr(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===tn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...ze(this,ue).mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ze(this,ce).clear(),ze(this,de).clear()}},ce=new WeakMap,de=new WeakMap,ue=new WeakMap,fe=new WeakMap,he=new WeakMap,pe=new WeakMap,ge=new WeakMap,ve=new WeakMap,me);const Nn=Symbol("store-raw"),Fn=Symbol("store-node"),_n=Symbol("store-has"),Dn=Symbol("store-self");function Un(e){let t=e[Xe];if(!t&&(Object.defineProperty(e,Xe,{value:t=new Proxy(e,zn)}),!Array.isArray(e))){const r=Object.keys(e),n=Object.getOwnPropertyDescriptors(e);for(let i=0,o=r.length;i<o;i++){const o=r[i];n[o].get&&Object.defineProperty(e,o,{enumerable:n[o].enumerable,get:n[o].get.bind(t)})}}return t}function $n(e){let t;return null!=e&&"object"==typeof e&&(e[Xe]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function qn(e,t=new Set){let r,n,i,o;if(r=null!=e&&e[Nn])return r;if(!$n(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let r=0,o=e.length;r<o;r++)i=e[r],(n=qn(i,t))!==i&&(e[r]=n)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const r=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let a=0,l=r.length;a<l;a++)o=r[a],s[o].get||(i=e[o],(n=qn(i,t))!==i&&(e[o]=n))}return e}function Mn(e,t){let r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function Ln(e,t,r){if(e[t])return e[t];const[n,i]=ht(r,{equals:!1,internal:!0});return n.$=i,e[t]=n}function jn(e){It()&&Ln(Mn(e,Fn),Dn)()}const zn={get(e,t,r){if(t===Nn)return e;if(t===Xe)return r;if(t===Ze)return jn(e),r;const n=Mn(e,Fn),i=n[t];let o=i?i():e[t];if(t===Fn||t===_n||"__proto__"===t)return o;if(!i){const r=Object.getOwnPropertyDescriptor(e,t);!It()||"function"==typeof o&&!e.hasOwnProperty(t)||r&&r.get||(o=Ln(n,t,o)())}return $n(o)?Un(o):o},has:(e,t)=>t===Nn||t===Xe||t===Ze||t===Fn||t===_n||"__proto__"===t||(It()&&Ln(Mn(e,_n),t)(),t in e),set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return jn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const r=Reflect.getOwnPropertyDescriptor(e,t);return r&&!r.get&&r.configurable&&t!==Xe&&t!==Fn?(delete r.value,delete r.writable,r.get=()=>e[Xe][t],r):r}};function Wn(e,t,r,n=!1){if(!n&&e[t]===r)return;const i=e[t],o=e.length;void 0===r?(delete e[t],e[_n]&&e[_n][t]&&void 0!==i&&e[_n][t].$()):(e[t]=r,e[_n]&&e[_n][t]&&void 0===i&&e[_n][t].$());let s,a=Mn(e,Fn);if((s=Ln(a,t,i))&&s.$(()=>r),Array.isArray(e)&&e.length!==o){for(let t=e.length;t<o;t++)(s=a[t])&&s.$();(s=Ln(a,"length",o))&&s.$(e.length)}(s=a[Dn])&&s.$()}function Bn(e,t){const r=Object.keys(t);for(let n=0;n<r.length;n+=1){const i=r[n];Wn(e,i,t[i])}}function Hn(e,t,r=[]){let n,i=e;if(t.length>1){n=t.shift();const o=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let i=0;i<n.length;i++)Hn(e,[n[i]].concat(t),r);return}if(s&&"function"===o){for(let i=0;i<e.length;i++)n(e[i],i)&&Hn(e,[i].concat(t),r);return}if(s&&"object"===o){const{from:i=0,to:o=e.length-1,by:s=1}=n;for(let n=i;n<=o;n+=s)Hn(e,[n].concat(t),r);return}if(t.length>1)return void Hn(e[n],t,[n].concat(r));i=e[n],r=[n].concat(r)}let o=t[0];"function"==typeof o&&(o=o(i,r),o===i)||void 0===n&&null==o||(o=qn(o),void 0===n||$n(i)&&$n(o)&&!Array.isArray(o)?Bn(i,o):Wn(e,n,o))}function Qn(...[e,t]){const r=qn(e||{}),n=Array.isArray(r);return[Un(r),function(...e){yt(()=>{n&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=qn(t),Array.isArray(t)){if(e===t)return;let r=0,n=t.length;for(;r<n;r++){const n=t[r];e[r]!==n&&Wn(e,r,n)}Wn(e,"length",n)}else Bn(e,t)}(r,e[0]):Hn(r,e)})}]}const Kn=Symbol("store-root");function Vn(e,t,r,n,i){const o=t[r];if(e===o)return;const s=Array.isArray(e);if(r!==Kn&&(!$n(e)||!$n(o)||s!==Array.isArray(o)||i&&e[i]!==o[i]))return void Wn(t,r,e);if(s){if(e.length&&o.length&&(!n||i&&e[0]&&null!=e[0][i])){let t,r,s,a,l,c,d,u;for(s=0,a=Math.min(o.length,e.length);s<a&&(o[s]===e[s]||i&&o[s]&&e[s]&&o[s][i]&&o[s][i]===e[s][i]);s++)Vn(e[s],o,s,n,i);const f=new Array(e.length),h=new Map;for(a=o.length-1,l=e.length-1;a>=s&&l>=s&&(o[a]===e[l]||i&&o[a]&&e[l]&&o[a][i]&&o[a][i]===e[l][i]);a--,l--)f[l]=o[a];if(s>l||s>a){for(r=s;r<=l;r++)Wn(o,r,e[r]);for(;r<e.length;r++)Wn(o,r,f[r]),Vn(e[r],o,r,n,i);return void(o.length>e.length&&Wn(o,"length",e.length))}for(d=new Array(l+1),r=l;r>=s;r--)c=e[r],u=i&&c?c[i]:c,t=h.get(u),d[r]=void 0===t?-1:t,h.set(u,r);for(t=s;t<=a;t++)c=o[t],u=i&&c?c[i]:c,r=h.get(u),void 0!==r&&-1!==r&&(f[r]=o[t],r=d[r],h.set(u,r));for(r=s;r<e.length;r++)r in f?(Wn(o,r,f[r]),Vn(e[r],o,r,n,i)):Wn(o,r,e[r])}else for(let t=0,r=e.length;t<r;t++)Vn(e[t],o,t,n,i);return void(o.length>e.length&&Wn(o,"length",e.length))}const a=Object.keys(e);for(let c=0,d=a.length;c<d;c++)Vn(e[a[c]],o,a[c],n,i);const l=Object.keys(o);for(let c=0,d=l.length;c<d;c++)void 0===e[l[c]]&&Wn(o,l[c],void 0)}function Gn(e,t={}){const{merge:r,key:n="id"}=t,i=qn(e);return e=>{if(!$n(e)||!$n(i))return i;const t=Vn(i,{[Kn]:e},Kn,r,n);return void 0===t?e:t}}var Yn=Et(void 0),Xn=e=>(gt(t=>(t?.(),e.client.mount(),e.client.unmount.bind(e.client))),Tt(()=>e.client.unmount()),Kt(Yn.Provider,{value:()=>e.client,get children(){return e.children}})),Jn=Et(()=>!1);function Zn(e,t,r){const n=mt(()=>(e=>{if(e)return e;const t=At(Yn);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()})(r?.())),i=At(Jn),o=mt(()=>{const t=n().defaultQueryOptions(e());return t._optimisticResults=i()?"isRestoring":"optimistic",t.structuralSharing=!1,t}),s=o(),[a,l]=ht(new t(n(),o()));let c=a().getOptimisticResult(o());const[d,u]=Qn(c),f=()=>a().subscribe(e=>{c=e,queueMicrotask(()=>{p&&m()})});function h(e){const t=a().options,r=t.reconcile;u(n=>function(e,t,r){if(!1===r)return t;if("function"==typeof r){const n=r(e.data,t.data);return{...t,data:n}}let n=t.data;if(void 0===e.data)try{n=structuredClone(n)}catch(o){}const i=Gn(n,{key:r})(e.data);return{...t,data:i}}(n,e,void 0!==r&&r,t.queryHash))}let p=null,g=null;const[v,{refetch:m}]=bt(()=>{const e=a();return new Promise((t,r)=>{return g=t,p||i()||(p=f()),e.updateResult(),c.isError&&!c.isFetching&&!i()&&(n=e.options.throwOnError,o=[c.error,e.getCurrentQuery()],"function"==typeof n?n(...o):n)?(h(c),r(c.error)):c.isLoading?void h(c):(g=null,t((e.getCurrentQuery(),c)));var n,o})},{storage:function(){return[()=>d,e=>{const t=qn(d);if("function"==typeof e&&(e=e(t)),e?.hydrationData){const{hydrationData:t,...r}=e;e=r}h(e)}]},get deferStream(){return e().deferStream},onHydrated(e,t){if(t.value&&"hydrationData"in t.value&&function(e,t,r){if("object"!=typeof t||null===t)return;const n=e.getMutationCache(),i=e.getQueryCache(),o=e.getDefaultOptions().hydrate?.deserializeData??sn,s=t.mutations||[],a=t.queries||[];s.forEach(({state:t,...i})=>{n.build(e,{...e.getDefaultOptions().hydrate?.mutations,...r?.defaultOptions?.mutations,...i},t)}),a.forEach(({queryKey:t,state:n,queryHash:s,meta:a,promise:l,dehydratedAt:c})=>{const d=l?function(e){let t;if(e.then(e=>(t=e,e),Ur)?.catch(Ur),void 0!==t)return{data:t}}(l):void 0,u=void 0===n.data?d?.data:n.data,f=void 0===u?u:o(u);let h=i.get(s);const p="pending"===h?.state.status,g="fetching"===h?.state.fetchStatus;if(h){const e=d&&void 0!==c&&c>h.state.dataUpdatedAt;if(n.dataUpdatedAt>h.state.dataUpdatedAt||e){const{fetchStatus:e,...t}=n;h.setState({...t,data:f})}}else h=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...r?.defaultOptions?.queries,queryKey:t,queryHash:s,meta:a},{...n,data:f,fetchStatus:"idle",status:void 0!==f?"success":n.status});l&&!p&&!g&&(void 0===c||c>h.state.dataUpdatedAt)&&h.fetch(void 0,{initialPromise:Promise.resolve(l).then(o)}).catch(Ur)})}(n(),{queries:[{...t.value.hydrationData}]}),p)return;const r={...s};!s.staleTime&&s.initialData||!t.value||(r.refetchOnMount=!1),a().setOptions(r),h(a().getOptimisticResult(r)),p=f()}});return pt(xt(n,e=>{p&&p();const r=new t(e,o());p=f(),l(r)},{defer:!0})),pt(xt(i,e=>{e||m()},{defer:!0})),Tt(()=>{p&&(p(),p=null),g&&(g(c),g=null)}),pt(xt([a,o],([e,t])=>{e.setOptions(t),h(e.getOptimisticResult(t)),m()},{defer:!0})),new Proxy(d,{get:(e,t)=>"data"===t?void 0!==d.data?v.latest?.data:v()?.data:Reflect.get(e,t)})}function ei(e,t){return Zn(mt(()=>e()),yn,t)}var ti={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"},ri=gr("<svg>"),ni=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ii=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},oi=e=>{const[t,r]=Zt(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return xr(n=ri(),Jt(ti,{get width(){return t.size??ti.width},get height(){return t.size??ti.height},get stroke(){return t.color??ti.stroke},get"stroke-width"(){return fr(()=>!!t.absoluteStrokeWidth)()?24*Number(t.strokeWidth??ti["stroke-width"])/Number(t.size):Number(t.strokeWidth??ti["stroke-width"])},get class(){return((...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim())("lucide","lucide-icon",...null!=t.name?[`lucide-${ni(ii(t.name))}`,`lucide-${ni(t.name)}`]:[],null!=t.class?t.class:"")},get"aria-hidden"(){return t.children||(e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(r)?void 0:"true"}},r),!0,!0),Tr(n,Kt(tr,{get each(){return t.iconNode},children:([e,t])=>Kt(Pr,Jt({component:e},t))})),n;var n},si=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ai=e=>Kt(oi,Jt(e,{iconNode:si,name:"arrow-down"})),li=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ci=e=>Kt(oi,Jt(e,{iconNode:li,name:"chevron-down"})),di=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ui=e=>Kt(oi,Jt(e,{iconNode:di,name:"arrow-right"})),fi=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hi=e=>Kt(oi,Jt(e,{iconNode:fi,name:"check"})),pi=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gi=e=>Kt(oi,Jt(e,{iconNode:pi,name:"x"})),vi=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],mi=e=>Kt(oi,Jt(e,{iconNode:vi,name:"external-link"})),bi=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yi=e=>Kt(oi,Jt(e,{iconNode:bi,name:"search"})),wi=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],xi=e=>Kt(oi,Jt(e,{iconNode:wi,name:"pencil"}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TokenFlightSwap={})}(this,function(e){"use strict";var t,r,n,i,o,s,a,c,l,d,f,u,h,p,g,v,b,m,y,w,x,k,T,I,S,C,E,A,O,R,P,N,D,_,F,U,q,$,M,j,L,z,W,B,H,Q,K,V,G,Y,X,J,Z,ee,te,re,ne,ie,oe,se,ae,ce,le,de,fe,ue,he,pe,ge,ve,be,me,ye,we,xe,ke,Te,Ie,Se,Ce,Ee,Ae,Oe,Re,Pe,Ne,De,_e,Fe,Ue,qe,$e=Object.defineProperty,Me=e=>{throw TypeError(e)},je=(e,t,r)=>((e,t,r)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Le=(e,t,r)=>t.has(e)||Me("Cannot "+r),ze=(e,t,r)=>(Le(e,t,"read from private field"),r?r.call(e):t.get(e)),We=(e,t,r)=>t.has(e)?Me("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Be=(e,t,r,n)=>(Le(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),He=(e,t,r)=>(Le(e,t,"access private method"),r),Qe=(e,t,r,n)=>({set _(n){Be(e,t,n,r)},get _(){return ze(e,t,n)}});const Ke=["filled","refunded","failed"],Ve={INVALID_CONFIG:"TF1001",INVALID_TOKEN_IDENTIFIER:"TF1002",INVALID_AMOUNT:"TF1003",MISSING_REQUIRED_CONFIG:"TF1004",WALLET_NOT_CONNECTED:"TF2001",WALLET_CONNECTION_FAILED:"TF2002",WALLET_ACTION_FAILED:"TF2003",WALLET_ACTION_REJECTED:"TF2004",UNSUPPORTED_ACTION_TYPE:"TF2005",API_REQUEST_FAILED:"TF3001",API_TIMEOUT:"TF3002",API_INVALID_RESPONSE:"TF3003",QUOTE_FAILED:"TF3004",QUOTE_EXPIRED:"TF3005",DEPOSIT_BUILD_FAILED:"TF3006",DEPOSIT_SUBMIT_FAILED:"TF3007",ORDER_FAILED:"TF3008",TRANSACTION_FAILED:"TF4001",TRANSACTION_REJECTED:"TF4002",INSUFFICIENT_BALANCE:"TF4003",ELEMENT_NOT_FOUND:"TF5001",INITIALIZATION_FAILED:"TF5002"},Ge={[Ve.INVALID_CONFIG]:"Invalid configuration provided",[Ve.INVALID_TOKEN_IDENTIFIER]:"Invalid token identifier format",[Ve.INVALID_AMOUNT]:"Invalid amount value",[Ve.MISSING_REQUIRED_CONFIG]:"Missing required configuration field",[Ve.WALLET_NOT_CONNECTED]:"Wallet is not connected",[Ve.WALLET_CONNECTION_FAILED]:"Failed to connect wallet",[Ve.WALLET_ACTION_FAILED]:"Wallet action failed",[Ve.WALLET_ACTION_REJECTED]:"Wallet action was rejected by user",[Ve.UNSUPPORTED_ACTION_TYPE]:"Unsupported wallet action type",[Ve.API_REQUEST_FAILED]:"API request failed",[Ve.API_TIMEOUT]:"API request timed out",[Ve.API_INVALID_RESPONSE]:"Invalid API response",[Ve.QUOTE_FAILED]:"Failed to get quote",[Ve.QUOTE_EXPIRED]:"Quote has expired",[Ve.DEPOSIT_BUILD_FAILED]:"Failed to build deposit transaction",[Ve.DEPOSIT_SUBMIT_FAILED]:"Failed to submit deposit",[Ve.ORDER_FAILED]:"Order processing failed",[Ve.TRANSACTION_FAILED]:"Transaction failed",[Ve.TRANSACTION_REJECTED]:"Transaction was rejected",[Ve.INSUFFICIENT_BALANCE]:"Insufficient balance",[Ve.ELEMENT_NOT_FOUND]:"Target DOM element not found",[Ve.INITIALIZATION_FAILED]:"Widget initialization failed"};class Ye extends Error{constructor(e,t,r){super("string"==typeof t?t:t instanceof Error||"object"==typeof t&&null!==t&&"message"in t&&"string"==typeof t.message?t.message:Ge[e]??"Unknown error"),this.name="TokenFlightError",this.code=e,this.details=r}}const Xe=Symbol("solid-proxy"),Je="function"==typeof Proxy,Ze=Symbol("solid-track"),et={equals:(e,t)=>e===t};let tt=Ut;const rt=1,nt=2,it={owned:null,cleanups:null,context:null,owner:null},ot={};var st=null;let at=null,ct=null,lt=null,dt=null,ft=0;function ut(e,t){const r=ct,n=st,i=0===e.length,o=void 0===t?n:t,s=i?it:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=i?e:()=>e(()=>wt(()=>jt(s)));st=s,ct=null;try{return Ft(a,!0)}finally{ct=r,st=n}}function ht(e,t){const r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},et,t):et).equals||void 0};return[Rt.bind(r),e=>("function"==typeof e&&(e=e(r.value)),Pt(r,e))]}function pt(e,t,r){Nt(Dt(e,t,!0,rt))}function gt(e,t,r){Nt(Dt(e,t,!1,rt))}function vt(e,t,r){tt=qt;const n=Dt(e,t,!1,rt);n.user=!0,dt?dt.push(n):Nt(n)}function bt(e,t,r){r=r?Object.assign({},et,r):et;const n=Dt(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Nt(n),Rt.bind(n)}function mt(e,t,r){let n,i,o;"function"==typeof t?(n=e,i=t,o={}):(n=!0,i=e,o=t||{});let s=null,a=ot,c=!1,l="initialValue"in o,d="function"==typeof n&&bt(n);const f=new Set,[u,h]=(o.storage||ht)(o.initialValue),[p,g]=ht(void 0),[v,b]=ht(void 0,{equals:!1}),[m,y]=ht(l?"ready":"unresolved");function w(e,t,r,n){return s===e&&(s=null,void 0!==n&&(l=!0),e!==a&&t!==a||!o.onHydrated||queueMicrotask(()=>o.onHydrated(n,{value:t})),a=ot,function(e,t){Ft(()=>{void 0===t&&h(()=>e),y(void 0!==t?"errored":l?"ready":"unresolved"),g(t);for(const e of f.keys())e.decrement();f.clear()},!1)}(t,r)),t}function x(){const e=u(),t=p();if(void 0!==t&&!s)throw t;return ct&&ct.user,e}function k(e=!0){if(!1!==e&&c)return;c=!1;const t=d?d():n;if(null==t||!1===t)return void w(s,wt(u));let r;const o=a!==ot?a:wt(()=>{try{return i(t,{value:u(),refetching:e})}catch(n){r=n}});var f;if(void 0===r)return(f=o)&&"object"==typeof f&&"then"in f?(s=o,"v"in o?(1===o.s?w(s,o.v,void 0,t):w(s,void 0,Lt(o.v),t),o):(c=!0,queueMicrotask(()=>c=!1),Ft(()=>{y(l?"refreshing":"pending"),b()},!1),o.then(e=>w(o,e,void 0,t),e=>w(o,void 0,Lt(e),t)))):(w(s,o,void 0,t),o);w(s,void 0,Lt(r),t)}Object.defineProperties(x,{state:{get:()=>m()},error:{get:()=>p()},loading:{get(){const e=m();return"pending"===e||"refreshing"===e}},latest:{get(){if(!l)return x();const e=p();if(e&&!s)throw e;return u()}}});let T=st;return d?pt(()=>(T=st,k(!1))):k(!1),[x,{refetch:e=>function(t){const r=st,n=ct;st=t,ct=null;try{return Ft(()=>k(e),!0)}catch(i){zt(i)}finally{st=r,ct=n}}(T),mutate:h}]}function yt(e){return Ft(e,!1)}function wt(e){if(null===ct)return e();const t=ct;ct=null;try{return e()}finally{ct=t}}function xt(e,t,r){const n=Array.isArray(e);let i,o=r&&r.defer;return r=>{let s;if(n){s=Array(e.length);for(let t=0;t<e.length;t++)s[t]=e[t]()}else s=e();if(o)return o=!1,r;const a=wt(()=>t(s,i,r));return i=s,a}}function kt(e){vt(()=>wt(e))}function Tt(e){return null===st||(null===st.cleanups?st.cleanups=[e]:st.cleanups.push(e)),e}function It(){return ct}const[St,Ct]=ht(!1);function Et(e,t){const r=Symbol("context");return{id:r,Provider:Bt(r),defaultValue:e}}function At(e){let t;return st&&st.context&&void 0!==(t=st.context[e.id])?t:e.defaultValue}function Ot(e){const t=bt(e),r=bt(()=>Wt(t()));return r.toArray=()=>{const e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function Rt(){if(this.sources&&this.state)if(this.state===rt)Nt(this);else{const e=lt;lt=null,Ft(()=>$t(this),!1),lt=e}if(ct){const e=this.observers?this.observers.length:0;ct.sources?(ct.sources.push(this),ct.sourceSlots.push(e)):(ct.sources=[this],ct.sourceSlots=[e]),this.observers?(this.observers.push(ct),this.observerSlots.push(ct.sources.length-1)):(this.observers=[ct],this.observerSlots=[ct.sources.length-1])}return this.value}function Pt(e,t,r){let n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&Ft(()=>{for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t],n=at&&at.running;n&&at.disposed.has(r),(n?r.tState:r.state)||(r.pure?lt.push(r):dt.push(r),r.observers&&Mt(r)),n||(r.state=rt)}if(lt.length>1e6)throw lt=[],new Error},!1)),t}function Nt(e){if(!e.fn)return;jt(e);const t=ft;!function(e,t,r){let n;const i=st,o=ct;ct=st=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=rt,e.owned&&e.owned.forEach(jt),e.owned=null),e.updatedAt=r+1,zt(s)}finally{ct=o,st=i}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?Pt(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}function Dt(e,t,r,n=rt,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:st,context:st?st.context:null,pure:r};return null===st||st!==it&&(st.owned?st.owned.push(o):st.owned=[o]),o}function _t(e){if(0===e.state)return;if(e.state===nt)return $t(e);if(e.suspense&&wt(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ft);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if((e=t[r]).state===rt)Nt(e);else if(e.state===nt){const r=lt;lt=null,Ft(()=>$t(e,t[0]),!1),lt=r}}function Ft(e,t){if(lt)return e();let r=!1;t||(lt=[]),dt?r=!0:dt=[],ft++;try{const t=e();return function(e){if(lt&&(Ut(lt),lt=null),e)return;const t=dt;dt=null,t.length&&Ft(()=>tt(t),!1)}(r),t}catch(n){r||(dt=null),lt=null,zt(n)}}function Ut(e){for(let t=0;t<e.length;t++)_t(e[t])}function qt(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:_t(n)}for(t=0;t<r;t++)_t(e[t])}function $t(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const e=n.state;e===rt?n!==t&&(!n.updatedAt||n.updatedAt<ft)&&_t(n):e===nt&&$t(n,t)}}}function Mt(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=nt,r.pure?lt.push(r):dt.push(r),r.observers&&Mt(r))}}function jt(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),r=e.sourceSlots.pop(),n=t.observers;if(n&&n.length){const e=n.pop(),i=t.observerSlots.pop();r<n.length&&(e.sourceSlots[i]=r,n[r]=e,t.observerSlots[r]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)jt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)jt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Lt(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function zt(e,t=st){throw Lt(e)}function Wt(e){if("function"==typeof e&&!e.length)return Wt(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=Wt(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function Bt(e,t){return function(t){let r;return gt(()=>r=wt(()=>(st.context={...st.context,[e]:t.value},Ot(()=>t.children))),void 0),r}}const Ht=Symbol("fallback");function Qt(e){for(let t=0;t<e.length;t++)e[t]()}function Kt(e,t){return wt(()=>e(t||{}))}function Vt(){return!0}const Gt={get:(e,t,r)=>t===Xe?r:e.get(t),has:(e,t)=>t===Xe||e.has(t),set:Vt,deleteProperty:Vt,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:Vt,deleteProperty:Vt}),ownKeys:e=>e.keys()};function Yt(e){return(e="function"==typeof e?e():e)?e:{}}function Xt(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function Jt(...e){let t=!1;for(let s=0;s<e.length;s++){const r=e[s];t=t||!!r&&Xe in r,e[s]="function"==typeof r?(t=!0,bt(r)):r}if(Je&&t)return new Proxy({get(t){for(let r=e.length-1;r>=0;r--){const n=Yt(e[r])[t];if(void 0!==n)return n}},has(t){for(let r=e.length-1;r>=0;r--)if(t in Yt(e[r]))return!0;return!1},keys(){const t=[];for(let r=0;r<e.length;r++)t.push(...Object.keys(Yt(e[r])));return[...new Set(t)]}},Gt);const r={},n=Object.create(null);for(let s=e.length-1;s>=0;s--){const t=e[s];if(!t)continue;const i=Object.getOwnPropertyNames(t);for(let e=i.length-1;e>=0;e--){const o=i[e];if("__proto__"===o||"constructor"===o)continue;const s=Object.getOwnPropertyDescriptor(t,o);if(n[o]){const e=r[o];e&&(s.get?e.push(s.get.bind(t)):void 0!==s.value&&e.push(()=>s.value))}else n[o]=s.get?{enumerable:!0,configurable:!0,get:Xt.bind(r[o]=[s.get.bind(t)])}:void 0!==s.value?s:void 0}}const i={},o=Object.keys(n);for(let s=o.length-1;s>=0;s--){const e=o[s],t=n[e];t&&t.get?Object.defineProperty(i,e,t):i[e]=t?t.value:void 0}return i}function Zt(e,...t){const r=t.length;if(Je&&Xe in e){const n=r>1?t.flat():t[0],i=t.map(t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter(t=>t in e)},Gt));return i.push(new Proxy({get:t=>n.includes(t)?void 0:e[t],has:t=>!n.includes(t)&&t in e,keys:()=>Object.keys(e).filter(e=>!n.includes(e))},Gt)),i}const n=[];for(let i=0;i<=r;i++)n[i]={};for(const i of Object.getOwnPropertyNames(e)){let o=r;for(let e=0;e<t.length;e++)if(t[e].includes(i)){o=e;break}const s=Object.getOwnPropertyDescriptor(e,i);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?n[o][i]=s.value:Object.defineProperty(n[o],i,s)}return n}const er=e=>`Stale read from <${e}>.`;function tr(e){const t="fallback"in e&&{fallback:()=>e.fallback};return bt(function(e,t,r={}){let n=[],i=[],o=[],s=0,a=t.length>1?[]:null;return Tt(()=>Qt(o)),()=>{let c,l,d=e()||[],f=d.length;return d[Ze],wt(()=>{let e,t,h,p,g,v,b,m,y;if(0===f)0!==s&&(Qt(o),o=[],n=[],i=[],s=0,a&&(a=[])),r.fallback&&(n=[Ht],i[0]=ut(e=>(o[0]=e,r.fallback())),s=1);else if(0===s){for(i=new Array(f),l=0;l<f;l++)n[l]=d[l],i[l]=ut(u);s=f}else{for(h=new Array(f),p=new Array(f),a&&(g=new Array(f)),v=0,b=Math.min(s,f);v<b&&n[v]===d[v];v++);for(b=s-1,m=f-1;b>=v&&m>=v&&n[b]===d[m];b--,m--)h[m]=i[b],p[m]=o[b],a&&(g[m]=a[b]);for(e=new Map,t=new Array(m+1),l=m;l>=v;l--)y=d[l],c=e.get(y),t[l]=void 0===c?-1:c,e.set(y,l);for(c=v;c<=b;c++)y=n[c],l=e.get(y),void 0!==l&&-1!==l?(h[l]=i[c],p[l]=o[c],a&&(g[l]=a[c]),l=t[l],e.set(y,l)):o[c]();for(l=v;l<f;l++)l in h?(i[l]=h[l],o[l]=p[l],a&&(a[l]=g[l],a[l](l))):i[l]=ut(u);i=i.slice(0,s=f),n=d.slice(0)}return i});function u(e){if(o[l]=e,a){const[e,r]=ht(l);return a[l]=r,t(d[l],e)}return t(d[l])}}}(()=>e.each,e.children,t||void 0))}function rr(e){const t=e.keyed,r=bt(()=>e.when,void 0,void 0),n=t?r:bt(r,void 0,{equals:(e,t)=>!e==!t});return bt(()=>{const i=n();if(i){const o=e.children;return"function"==typeof o&&o.length>0?wt(()=>o(t?i:()=>{if(!wt(n))throw er("Show");return r()})):o}return e.fallback},void 0,void 0)}function nr(e){const t=Ot(()=>e.children),r=bt(()=>{const e=t(),r=Array.isArray(e)?e:[e];let n=()=>{};for(let t=0;t<r.length;t++){const e=t,i=r[t],o=n,s=bt(()=>o()?void 0:i.when,void 0,void 0),a=i.keyed?s:bt(s,void 0,{equals:(e,t)=>!e==!t});n=()=>o()||(a()?[e,s,i]:void 0)}return n});return bt(()=>{const t=r()();if(!t)return e.fallback;const[n,i,o]=t,s=o.children;return"function"==typeof s&&s.length>0?wt(()=>s(o.keyed?i():()=>{if(wt(r)()?.[0]!==n)throw er("Match");return i()})):s},void 0,void 0)}function ir(e){return e}const or=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable","allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"]),sr=new Set(["innerHTML","textContent","innerText","children"]),ar=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),cr=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}}),lr=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),dr=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),fr={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},ur=e=>bt(()=>e()),hr="_$DX_DELEGATE";function pr(e,t,r,n){let i;const o=()=>{const t=document.createElement("template");return t.innerHTML=e,t.content.firstChild},s=t?()=>wt(()=>document.importNode(i||(i=o()),!0)):()=>(i||(i=o())).cloneNode(!0);return s.cloneNode=s,s}function gr(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function vr(e,t){null==t?e.removeAttribute("class"):e.className=t}function br(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const n=r[0];e.addEventListener(t,r[0]=t=>n.call(e,r[1],t))}else e.addEventListener(t,r,"function"!=typeof r&&r)}function mr(e,t,r){if(!t)return r?gr(e,"style"):t;const n=e.style;if("string"==typeof t)return n.cssText=t;let i,o;for(o in"string"==typeof r&&(n.cssText=r=void 0),r||(r={}),t||(t={}),r)null==t[o]&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function yr(e,t,r){null!=r?e.style.setProperty(t,r):e.style.removeProperty(t)}function wr(e,t={},r,n){const i={};return n||gt(()=>i.children=Cr(e,t.children,i.children)),gt(()=>"function"==typeof t.ref&&xr(t.ref,e)),gt(()=>function(e,t,r,n,i={},o=!1){t||(t={});for(const s in i)if(!(s in t)){if("children"===s)continue;i[s]=Ir(e,s,null,i[s],r,o,t)}for(const s in t){if("children"===s)continue;const n=t[s];i[s]=Ir(e,s,n,i[s],r,o,t)}}(e,t,r,0,i,!0)),i}function xr(e,t,r){return wt(()=>e(t,r))}function kr(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return Cr(e,t,n,r);gt(n=>Cr(e,t(),n,r),n)}function Tr(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i<o;i++)e.classList.toggle(n[i],r)}function Ir(e,t,r,n,i,o,s){let a,c,l,d,f;if("style"===t)return mr(e,r,n);if("classList"===t)return function(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,s;for(o=0,s=i.length;o<s;o++){const n=i[o];n&&"undefined"!==n&&!t[n]&&(Tr(e,n,!1),delete r[n])}for(o=0,s=n.length;o<s;o++){const i=n[o],s=!!t[i];i&&"undefined"!==i&&r[i]!==s&&s&&(Tr(e,i,!0),r[i]=s)}return r}(e,r,n);if(r===n)return n;if("ref"===t)o||r(e);else if("on:"===t.slice(0,3)){const i=t.slice(3);n&&e.removeEventListener(i,n,"function"!=typeof n&&n),r&&e.addEventListener(i,r,"function"!=typeof r&&r)}else if("oncapture:"===t.slice(0,10)){const i=t.slice(10);n&&e.removeEventListener(i,n,!0),r&&e.addEventListener(i,r,!0)}else if("on"===t.slice(0,2)){const i=t.slice(2).toLowerCase(),o=lr.has(i);if(!o&&n){const t=Array.isArray(n)?n[0]:n;e.removeEventListener(i,t)}(o||r)&&(br(e,i,r,o),o&&function(e,t=window.document){const r=t[hr]||(t[hr]=new Set);for(let n=0,i=e.length;n<i;n++){const i=e[n];r.has(i)||(r.add(i),t.addEventListener(i,Sr))}}([i]))}else if("attr:"===t.slice(0,5))gr(e,t.slice(5),r);else if("bool:"===t.slice(0,5))!function(e,t,r){r?e.setAttribute(t,""):e.removeAttribute(t)}(e,t.slice(5),r);else if((f="prop:"===t.slice(0,5))||(l=sr.has(t))||!i&&((d=function(e,t){const r=cr[e];return"object"==typeof r?r[t]?r.$:void 0:r}(t,e.tagName))||(c=or.has(t)))||(a=e.nodeName.includes("-")||"is"in s))f&&(t=t.slice(5),c=!0),"class"===t||"className"===t?vr(e,r):!a||c||l?e[d||t]=r:e[(u=t,u.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase()))]=r;else{const n=i&&t.indexOf(":")>-1&&fr[t.split(":")[0]];n?function(e,t,r,n){null==n?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}(e,n,t,r):gr(e,ar[t]||t,r)}var u;return r}function Sr(e){let t=e.target;const r=`$$${e.type}`,n=e.target,i=e.currentTarget,o=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),s=()=>{const n=t[r];if(n&&!t.disabled){const i=t[`${r}Data`];if(void 0!==i?n.call(t,i,e):n.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){const r=e.composedPath();o(r[0]);for(let e=0;e<r.length-2&&(t=r[e],s());e++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();o(n)}function Cr(e,t,r,n,i){for(;"function"==typeof r;)r=r();if(t===r)return r;const o=typeof t,s=void 0!==n;if(e=s&&r[0]&&r[0].parentNode||e,"string"===o||"number"===o){if("number"===o&&(t=t.toString())===r)return r;if(s){let i=r[0];i&&3===i.nodeType?i.data!==t&&(i.data=t):i=document.createTextNode(t),r=Or(e,r,n,i)}else r=""!==r&&"string"==typeof r?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===o)r=Or(e,r,n);else{if("function"===o)return gt(()=>{let i=t();for(;"function"==typeof i;)i=i();r=Cr(e,i,r,n)}),()=>r;if(Array.isArray(t)){const o=[],a=r&&Array.isArray(r);if(Er(o,t,r,i))return gt(()=>r=Cr(e,o,r,n,!0)),()=>r;if(0===o.length){if(r=Or(e,r,n),s)return r}else a?0===r.length?Ar(e,o,n):function(e,t,r){let n=r.length,i=t.length,o=n,s=0,a=0,c=t[i-1].nextSibling,l=null;for(;s<i||a<o;)if(t[s]!==r[a]){for(;t[i-1]===r[o-1];)i--,o--;if(i===s){const t=o<n?a?r[a-1].nextSibling:r[o-a]:c;for(;a<o;)e.insertBefore(r[a++],t)}else if(o===a)for(;s<i;)l&&l.has(t[s])||t[s].remove(),s++;else if(t[s]===r[o-1]&&r[a]===t[i-1]){const n=t[--i].nextSibling;e.insertBefore(r[a++],t[s++].nextSibling),e.insertBefore(r[--o],n),t[i]=r[o]}else{if(!l){l=new Map;let e=a;for(;e<o;)l.set(r[e],e++)}const n=l.get(t[s]);if(null!=n)if(a<n&&n<o){let c,d=s,f=1;for(;++d<i&&d<o&&null!=(c=l.get(t[d]))&&c===n+f;)f++;if(f>n-a){const i=t[s];for(;a<n;)e.insertBefore(r[a++],i)}else e.replaceChild(r[a++],t[s++])}else s++;else t[s++].remove()}}else s++,a++}(e,r,o):(r&&Or(e),Ar(e,o));r=o}else if(t.nodeType){if(Array.isArray(r)){if(s)return r=Or(e,r,n,t);Or(e,r,null,t)}else null!=r&&""!==r&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);r=t}}return r}function Er(e,t,r,n){let i=!1;for(let o=0,s=t.length;o<s;o++){let s,a=t[o],c=r&&r[e.length];if(null==a||!0===a||!1===a);else if("object"==(s=typeof a)&&a.nodeType)e.push(a);else if(Array.isArray(a))i=Er(e,a,c)||i;else if("function"===s)if(n){for(;"function"==typeof a;)a=a();i=Er(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||i}else e.push(a),i=!0;else{const t=String(a);c&&3===c.nodeType&&c.data===t?e.push(c):e.push(document.createTextNode(t))}}return i}function Ar(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Or(e,t,r,n){if(void 0===r)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let n=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const t=s.parentNode===e;n||o?t&&s.remove():t?e.replaceChild(i,s):e.insertBefore(i,r)}else n=!0}}else e.insertBefore(i,r);return[i]}function Rr(e){const[,t]=Zt(e,["component"]);return function(e,t){const r=bt(e);return bt(()=>{const e=r();switch(typeof e){case"function":return wt(()=>e(t));case"string":const r=dr.has(e),n=function(e,t=!1,r){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e,{is:r})}(e,r,wt(()=>t.is));return wr(n,t,r),n}})}(()=>e.component,t)}var Pr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Nr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Dr=new(n=class{constructor(){We(this,t,Nr),We(this,r,!1)}setTimeoutProvider(e){"production"!==process.env.NODE_ENV&&ze(this,r)&&ze(this,t),Be(this,t,e),"production"!==process.env.NODE_ENV&&Be(this,r,!1)}setTimeout(e,n){return"production"!==process.env.NODE_ENV&&Be(this,r,!0),ze(this,t).setTimeout(e,n)}clearTimeout(e){ze(this,t).clearTimeout(e)}setInterval(e,n){return"production"!==process.env.NODE_ENV&&Be(this,r,!0),ze(this,t).setInterval(e,n)}clearInterval(e){ze(this,t).clearInterval(e)}},t=new WeakMap,r=new WeakMap,n),_r="undefined"==typeof window||"Deno"in globalThis;function Fr(){}function Ur(e){return"number"==typeof e&&e>=0&&e!==1/0}function qr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $r(e,t){return"function"==typeof e?e(t):e}function Mr(e,t){return"function"==typeof e?e(t):e}function jr(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s)if(n){if(t.queryHash!==zr(s,t.options))return!1}else if(!Br(t.queryKey,s))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function Lr(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Wr(t.options.mutationKey)!==Wr(o))return!1}else if(!Br(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function zr(e,t){return(t?.queryKeyHashFn||Wr)(e)}function Wr(e){return JSON.stringify(e,(e,t)=>Gr(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function Br(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>Br(e[r],t[r]))}var Hr=Object.prototype.hasOwnProperty;function Qr(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Vr(e)&&Vr(t);if(!(n||Gr(e)&&Gr(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),s=o.length,a=n?new Array(s):{};let c=0;for(let l=0;l<s;l++){const s=n?l:o[l],d=e[s],f=t[s];if(d===f){a[s]=d,(n?l<i:Hr.call(e,s))&&c++;continue}if(null===d||null===f||"object"!=typeof d||"object"!=typeof f){a[s]=f;continue}const u=Qr(d,f,r+1);a[s]=u,u===d&&c++}return i===s&&c===i?e:a}function Kr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Vr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Gr(e){if(!Yr(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!Yr(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function Yr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Xr(e,t,r){if("function"==typeof r.structuralSharing)return r.structuralSharing(e,t);if(!1!==r.structuralSharing){if("production"!==process.env.NODE_ENV)try{return Qr(e,t)}catch(n){throw n}return Qr(e,t)}return t}function Jr(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Zr(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var en=Symbol();function tn(e,t){return"production"!==process.env.NODE_ENV&&e.queryFn,!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==en?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var rn=new(a=class extends Pr{constructor(){super(),We(this,i),We(this,o),We(this,s),Be(this,s,e=>{if(!_r&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ze(this,o)||this.setEventListener(ze(this,s))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=ze(this,o))||e.call(this),Be(this,o,void 0))}setEventListener(e){var t;Be(this,s,e),null==(t=ze(this,o))||t.call(this),Be(this,o,e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){ze(this,i)!==e&&(Be(this,i,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof ze(this,i)?ze(this,i):"hidden"!==globalThis.document?.visibilityState}},i=new WeakMap,o=new WeakMap,s=new WeakMap,a);function nn(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function on(e){return e}var sn=function(e){setTimeout(e,0)},an=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=sn;const o=n=>{t?e.push(n):i(()=>{r(n)})};return{batch:o=>{let s;t++;try{s=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&i(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return s},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}(),cn=new(f=class extends Pr{constructor(){super(),We(this,c,!0),We(this,l),We(this,d),Be(this,d,e=>{if(!_r&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ze(this,l)||this.setEventListener(ze(this,d))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=ze(this,l))||e.call(this),Be(this,l,void 0))}setEventListener(e){var t;Be(this,d,e),null==(t=ze(this,l))||t.call(this),Be(this,l,e(this.setOnline.bind(this)))}setOnline(e){ze(this,c)!==e&&(Be(this,c,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return ze(this,c)}},c=new WeakMap,l=new WeakMap,d=new WeakMap,f);function ln(e){return Math.min(1e3*2**e,3e4)}function dn(e){return"online"!==(e??"online")||cn.isOnline()}var fn=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function un(e){let t,r=!1,n=0;const i=nn(),o=()=>"pending"!==i.status,s=()=>rn.isFocused()&&("always"===e.networkMode||cn.isOnline())&&e.canRun(),a=()=>dn(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),i.resolve(e))},l=e=>{o()||(t?.(),i.reject(e))},d=()=>new Promise(r=>{t=e=>{(o()||s())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),f=()=>{if(o())return;let t;const i=0===n?e.initialPromise:void 0;try{t=i??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(o())return;const i=e.retry??(_r?0:3),a=e.retryDelay??ln,c="function"==typeof a?a(n,t):a,u=!0===i||"number"==typeof i&&n<i||"function"==typeof i&&i(n,t);var h;!r&&u?(n++,e.onFail?.(n,t),(h=c,new Promise(e=>{Dr.setTimeout(e,h)})).then(()=>s()?void 0:d()).then(()=>{r?l(t):f()})):l(t)})};return{promise:i,status:()=>i.status,cancel:t=>{if(!o()){const r=new fn(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?f():d().then(f),i)}}var hn=(h=class{constructor(){We(this,u)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ur(this.gcTime)&&Be(this,u,Dr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_r?1/0:3e5))}clearGcTimeout(){ze(this,u)&&(Dr.clearTimeout(ze(this,u)),Be(this,u,void 0))}},u=new WeakMap,h),pn=(T=class extends hn{constructor(e){super(),We(this,x),We(this,p),We(this,g),We(this,v),We(this,b),We(this,m),We(this,y),We(this,w),Be(this,w,!1),Be(this,y,e.defaultOptions),this.setOptions(e.options),this.observers=[],Be(this,b,e.client),Be(this,v,ze(this,b).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Be(this,p,bn(this.options)),this.state=e.state??ze(this,p),this.scheduleGc()}get meta(){return this.options.meta}get promise(){return ze(this,m)?.promise}setOptions(e){if(this.options={...ze(this,y),...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=bn(this.options);void 0!==e.data&&(this.setState(vn(e.data,e.dataUpdatedAt)),Be(this,p,e))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||ze(this,v).remove(this)}setData(e,t){const r=Xr(this.state.data,e,this.options);return He(this,x,k).call(this,{data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){He(this,x,k).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){const t=ze(this,m)?.promise;return ze(this,m)?.cancel(e),t?t.then(Fr).catch(Fr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ze(this,p))}isActive(){return this.observers.some(e=>!1!==Mr(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===en||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===$r(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!qr(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),ze(this,m)?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),ze(this,m)?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ze(this,v).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(ze(this,m)&&(ze(this,w)?ze(this,m).cancel({revert:!0}):ze(this,m).cancelRetry()),this.scheduleGc()),ze(this,v).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,x,k).call(this,{type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==ze(this,m)?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(ze(this,m))return ze(this,m).continueRetry(),ze(this,m).promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}"production"!==process.env.NODE_ENV&&Array.isArray(this.options.queryKey);const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(Be(this,w,!0),r.signal)})},i=()=>{const e=tn(this.options,t),r=(()=>{const e={client:ze(this,b),queryKey:this.queryKey,meta:this.meta};return n(e),e})();return Be(this,w,!1),this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:ze(this,b),state:this.state,fetchFn:i};return n(e),e})();this.options.behavior?.onFetch(o,this),Be(this,g,this.state),"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||He(this,x,k).call(this,{type:"fetch",meta:o.fetchOptions?.meta}),Be(this,m,un({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof fn&&e.revert&&this.setState({...ze(this,g),fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{He(this,x,k).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{He(this,x,k).call(this,{type:"pause"})},onContinue:()=>{He(this,x,k).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const e=await ze(this,m).start();if(void 0===e)throw process.env.NODE_ENV,new Error(`${this.queryHash} data is undefined`);return this.setData(e),ze(this,v).config.onSuccess?.(e,this),ze(this,v).config.onSettled?.(e,this.state.error,this),e}catch(s){if(s instanceof fn){if(s.silent)return ze(this,m).promise;if(s.revert){if(void 0===this.state.data)throw s;return this.state.data}}throw He(this,x,k).call(this,{type:"error",error:s}),ze(this,v).config.onError?.(s,this),ze(this,v).config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}},p=new WeakMap,g=new WeakMap,v=new WeakMap,b=new WeakMap,m=new WeakMap,y=new WeakMap,w=new WeakMap,x=new WeakSet,k=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...gn(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...vn(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Be(this,g,e.manual?r:void 0),r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),an.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),ze(this,v).notify({query:this,type:"updated",action:e})})},T);function gn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dn(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function vn(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bn(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var mn=(G=class extends Pr{constructor(e,t){super(),We(this,M),We(this,I),We(this,S),We(this,C),We(this,E),We(this,A),We(this,O),We(this,R),We(this,P),We(this,N),We(this,D),We(this,_),We(this,F),We(this,U),We(this,q),We(this,$,new Set),this.options=t,Be(this,I,e),Be(this,P,null),Be(this,R,nn()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(ze(this,S).addObserver(this),yn(ze(this,S),this.options)?He(this,M,j).call(this):this.updateResult(),He(this,M,B).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wn(ze(this,S),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wn(ze(this,S),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,M,H).call(this),He(this,M,Q).call(this),ze(this,S).removeObserver(this)}setOptions(e){const t=this.options,r=ze(this,S);if(this.options=ze(this,I).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof Mr(this.options.enabled,ze(this,S)))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,M,K).call(this),ze(this,S).setOptions(this.options),t._defaulted&&!Kr(this.options,t)&&ze(this,I).getQueryCache().notify({type:"observerOptionsUpdated",query:ze(this,S),observer:this});const n=this.hasListeners();n&&xn(ze(this,S),r,this.options,t)&&He(this,M,j).call(this),this.updateResult(),!n||ze(this,S)===r&&Mr(this.options.enabled,ze(this,S))===Mr(t.enabled,ze(this,S))&&$r(this.options.staleTime,ze(this,S))===$r(t.staleTime,ze(this,S))||He(this,M,L).call(this);const i=He(this,M,z).call(this);!n||ze(this,S)===r&&Mr(this.options.enabled,ze(this,S))===Mr(t.enabled,ze(this,S))&&i===ze(this,q)||He(this,M,W).call(this,i)}getOptimisticResult(e){const t=ze(this,I).getQueryCache().build(ze(this,I),e),r=this.createResult(t,e);return n=r,!Kr(this.getCurrentResult(),n)&&(Be(this,E,r),Be(this,O,this.options),Be(this,A,ze(this,S).state)),r;var n}getCurrentResult(){return ze(this,E)}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==ze(this,R).status||ze(this,R).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){ze(this,$).add(e)}getCurrentQuery(){return ze(this,S)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=ze(this,I).defaultQueryOptions(e),r=ze(this,I).getQueryCache().build(ze(this,I),t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return He(this,M,j).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),ze(this,E)))}createResult(e,t){const r=ze(this,S),n=this.options,i=ze(this,E),o=ze(this,A),s=ze(this,O),a=e!==r?e.state:ze(this,C),{state:c}=e;let l,d={...c},f=!1;if(t._optimisticResults){const i=this.hasListeners(),o=!i&&yn(e,t),s=i&&xn(e,r,t,n);(o||s)&&(d={...d,...gn(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:u,errorUpdatedAt:h,status:p}=d;l=d.data;let g=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===p){let e;i?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=i.data,g=!0):e="function"==typeof t.placeholderData?t.placeholderData(ze(this,_)?.state.data,ze(this,_)):t.placeholderData,void 0!==e&&(p="success",l=Xr(i?.data,e,t),f=!0)}if(t.select&&void 0!==l&&!g)if(i&&l===o?.data&&t.select===ze(this,N))l=ze(this,D);else try{Be(this,N,t.select),l=t.select(l),l=Xr(i?.data,l,t),Be(this,D,l),Be(this,P,null)}catch(k){Be(this,P,k)}ze(this,P)&&(u=ze(this,P),l=ze(this,D),h=Date.now(),p="error");const v="fetching"===d.fetchStatus,b="pending"===p,m="error"===p,y=b&&v,w=void 0!==l,x={status:p,fetchStatus:d.fetchStatus,isPending:b,isSuccess:"success"===p,isError:m,isInitialLoading:y,isLoading:y,data:l,dataUpdatedAt:d.dataUpdatedAt,error:u,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>a.dataUpdateCount||d.errorUpdateCount>a.errorUpdateCount,isFetching:v,isRefetching:v&&!b,isLoadingError:m&&!w,isPaused:"paused"===d.fetchStatus,isPlaceholderData:f,isRefetchError:m&&w,isStale:kn(e,t),refetch:this.refetch,promise:ze(this,R),isEnabled:!1!==Mr(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==x.data,n="error"===x.status&&!t,i=e=>{n?e.reject(x.error):t&&e.resolve(x.data)},o=()=>{const e=Be(this,R,x.promise=nn());i(e)},s=ze(this,R);switch(s.status){case"pending":e.queryHash===r.queryHash&&i(s);break;case"fulfilled":(n||x.data!==s.value)&&o();break;case"rejected":n&&x.error===s.reason||o()}}return x}updateResult(){const e=ze(this,E),t=this.createResult(ze(this,S),this.options);Be(this,A,ze(this,S).state),Be(this,O,this.options),void 0!==ze(this,A).data&&Be(this,_,ze(this,S)),Kr(t,e)||(Be(this,E,t),He(this,M,V).call(this,{listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!ze(this,$).size)return!0;const n=new Set(r??ze(this,$));return this.options.throwOnError&&n.add("error"),Object.keys(ze(this,E)).some(t=>{const r=t;return ze(this,E)[r]!==e[r]&&n.has(r)})})()}))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,M,B).call(this)}},I=new WeakMap,S=new WeakMap,C=new WeakMap,E=new WeakMap,A=new WeakMap,O=new WeakMap,R=new WeakMap,P=new WeakMap,N=new WeakMap,D=new WeakMap,_=new WeakMap,F=new WeakMap,U=new WeakMap,q=new WeakMap,$=new WeakMap,M=new WeakSet,j=function(e){He(this,M,K).call(this);let t=ze(this,S).fetch(this.options,e);return e?.throwOnError||(t=t.catch(Fr)),t},L=function(){He(this,M,H).call(this);const e=$r(this.options.staleTime,ze(this,S));if(_r||ze(this,E).isStale||!Ur(e))return;const t=qr(ze(this,E).dataUpdatedAt,e)+1;Be(this,F,Dr.setTimeout(()=>{ze(this,E).isStale||this.updateResult()},t))},z=function(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(ze(this,S)):this.options.refetchInterval)??!1},W=function(e){He(this,M,Q).call(this),Be(this,q,e),!_r&&!1!==Mr(this.options.enabled,ze(this,S))&&Ur(ze(this,q))&&0!==ze(this,q)&&Be(this,U,Dr.setInterval(()=>{(this.options.refetchIntervalInBackground||rn.isFocused())&&He(this,M,j).call(this)},ze(this,q)))},B=function(){He(this,M,L).call(this),He(this,M,W).call(this,He(this,M,z).call(this))},H=function(){ze(this,F)&&(Dr.clearTimeout(ze(this,F)),Be(this,F,void 0))},Q=function(){ze(this,U)&&(Dr.clearInterval(ze(this,U)),Be(this,U,void 0))},K=function(){const e=ze(this,I).getQueryCache().build(ze(this,I),this.options);if(e===ze(this,S))return;const t=ze(this,S);Be(this,S,e),Be(this,C,e.state),this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))},V=function(e){an.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(ze(this,E))}),ze(this,I).getQueryCache().notify({query:ze(this,S),type:"observerResultsUpdated"})})},G);function yn(e,t){return function(e,t){return!1!==Mr(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&wn(e,t,t.refetchOnMount)}function wn(e,t,r){if(!1!==Mr(t.enabled,e)&&"static"!==$r(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&kn(e,t)}return!1}function xn(e,t,r,n){return(e!==t||!1===Mr(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&kn(e,r)}function kn(e,t){return!1!==Mr(t.enabled,e)&&e.isStaleByTime($r(t.staleTime,e))}function Tn(e){return{onFetch:(t,r)=>{const n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let r=!1;const l=e=>{!function(e,r,n){let i,o=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t.signal),o||(o=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)})}(e,0,()=>r=!0)},d=tn(t.options,t.fetchOptions),f=async(e,n,i)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const o=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta};return l(e),e})(),s=await d(o),{maxPages:a}=t.options,c=i?Zr:Jr;return{pages:c(e.pages,s,a),pageParams:c(e.pageParams,n,a)}};if(i&&o.length){const e="backward"===i,t={pages:o,pageParams:s},r=(e?Sn:In)(n,t);a=await f(t,r,e)}else{const t=e??o.length;do{const e=0===c?s[0]??n.initialPageParam:In(n,a);if(c>0&&null==e)break;a=await f(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function In(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Sn(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var Cn=(re=class extends hn{constructor(e){super(),We(this,ee),We(this,Y),We(this,X),We(this,J),We(this,Z),Be(this,Y,e.client),this.mutationId=e.mutationId,Be(this,J,e.mutationCache),Be(this,X,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ze(this,X).includes(e)||(ze(this,X).push(e),this.clearGcTimeout(),ze(this,J).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Be(this,X,ze(this,X).filter(t=>t!==e)),this.scheduleGc(),ze(this,J).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ze(this,X).length||("pending"===this.state.status?this.scheduleGc():ze(this,J).remove(this))}continue(){return ze(this,Z)?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{He(this,ee,te).call(this,{type:"continue"})},r={client:ze(this,Y),meta:this.options.meta,mutationKey:this.options.mutationKey};Be(this,Z,un({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{He(this,ee,te).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{He(this,ee,te).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ze(this,J).canRun(this)}));const n="pending"===this.state.status,i=!ze(this,Z).canStart();try{if(n)t();else{He(this,ee,te).call(this,{type:"pending",variables:e,isPaused:i}),ze(this,J).config.onMutate&&await ze(this,J).config.onMutate(e,this,r);const t=await(this.options.onMutate?.(e,r));t!==this.state.context&&He(this,ee,te).call(this,{type:"pending",context:t,variables:e,isPaused:i})}const o=await ze(this,Z).start();return await(ze(this,J).config.onSuccess?.(o,e,this.state.context,this,r)),await(this.options.onSuccess?.(o,e,this.state.context,r)),await(ze(this,J).config.onSettled?.(o,null,this.state.variables,this.state.context,this,r)),await(this.options.onSettled?.(o,null,e,this.state.context,r)),He(this,ee,te).call(this,{type:"success",data:o}),o}catch(o){try{await(ze(this,J).config.onError?.(o,e,this.state.context,this,r))}catch(s){Promise.reject(s)}try{await(this.options.onError?.(o,e,this.state.context,r))}catch(s){Promise.reject(s)}try{await(ze(this,J).config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,r))}catch(s){Promise.reject(s)}try{await(this.options.onSettled?.(void 0,o,e,this.state.context,r))}catch(s){Promise.reject(s)}throw He(this,ee,te).call(this,{type:"error",error:o}),o}finally{ze(this,J).runNext(this)}}},Y=new WeakMap,X=new WeakMap,J=new WeakMap,Z=new WeakMap,ee=new WeakSet,te=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),an.batch(()=>{ze(this,X).forEach(t=>{t.onMutationUpdate(e)}),ze(this,J).notify({mutation:this,type:"updated",action:e})})},re),En=(se=class extends Pr{constructor(e={}){super(),We(this,ne),We(this,ie),We(this,oe),this.config=e,Be(this,ne,new Set),Be(this,ie,new Map),Be(this,oe,0)}build(e,t,r){const n=new Cn({client:e,mutationCache:this,mutationId:++Qe(this,oe)._,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){ze(this,ne).add(e);const t=An(e);if("string"==typeof t){const r=ze(this,ie).get(t);r?r.push(e):ze(this,ie).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(ze(this,ne).delete(e)){const t=An(e);if("string"==typeof t){const r=ze(this,ie).get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&ze(this,ie).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=An(e);if("string"==typeof t){const r=ze(this,ie).get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}return!0}runNext(e){const t=An(e);if("string"==typeof t){const r=ze(this,ie).get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}return Promise.resolve()}clear(){an.batch(()=>{ze(this,ne).forEach(e=>{this.notify({type:"removed",mutation:e})}),ze(this,ne).clear(),ze(this,ie).clear()})}getAll(){return Array.from(ze(this,ne))}find(e){const t={exact:!0,...e};return this.getAll().find(e=>Lr(t,e))}findAll(e={}){return this.getAll().filter(t=>Lr(e,t))}notify(e){an.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return an.batch(()=>Promise.all(e.map(e=>e.continue().catch(Fr))))}},ne=new WeakMap,ie=new WeakMap,oe=new WeakMap,se);function An(e){return e.options.scope?.id}var On=(ce=class extends Pr{constructor(e={}){super(),We(this,ae),this.config=e,Be(this,ae,new Map)}build(e,t,r){const n=t.queryKey,i=t.queryHash??zr(n,t);let o=this.get(i);return o||(o=new pn({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(o)),o}add(e){ze(this,ae).has(e.queryHash)||(ze(this,ae).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=ze(this,ae).get(e.queryHash);t&&(e.destroy(),t===e&&ze(this,ae).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){an.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ze(this,ae).get(e)}getAll(){return[...ze(this,ae).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>jr(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>jr(e,t)):t}notify(e){an.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){an.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){an.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ae=new WeakMap,ce),Rn=(be=class{constructor(e={}){We(this,le),We(this,de),We(this,fe),We(this,ue),We(this,he),We(this,pe),We(this,ge),We(this,ve),Be(this,le,e.queryCache||new On),Be(this,de,e.mutationCache||new En),Be(this,fe,e.defaultOptions||{}),Be(this,ue,new Map),Be(this,he,new Map),Be(this,pe,0)}mount(){Qe(this,pe)._++,1===ze(this,pe)&&(Be(this,ge,rn.subscribe(async e=>{e&&(await this.resumePausedMutations(),ze(this,le).onFocus())})),Be(this,ve,cn.subscribe(async e=>{e&&(await this.resumePausedMutations(),ze(this,le).onOnline())})))}unmount(){var e,t;Qe(this,pe)._--,0===ze(this,pe)&&(null==(e=ze(this,ge))||e.call(this),Be(this,ge,void 0),null==(t=ze(this,ve))||t.call(this),Be(this,ve,void 0))}isFetching(e){return ze(this,le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ze(this,de).findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return ze(this,le).get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=ze(this,le).build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime($r(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return ze(this,le).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=ze(this,le).get(n.queryHash),o=i?.state.data,s=function(e,t){return"function"==typeof e?e(t):e}(t,o);if(void 0!==s)return ze(this,le).build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return an.batch(()=>ze(this,le).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return ze(this,le).get(t.queryHash)?.state}removeQueries(e){const t=ze(this,le);an.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const r=ze(this,le);return an.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=an.batch(()=>ze(this,le).findAll(e).map(e=>e.cancel(r)));return Promise.all(n).then(Fr).catch(Fr)}invalidateQueries(e,t={}){return an.batch(()=>(ze(this,le).findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=an.batch(()=>ze(this,le).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(Fr)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(n).then(Fr)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=ze(this,le).build(this,t);return r.isStaleByTime($r(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fr).catch(Fr)}fetchInfiniteQuery(e){return e.behavior=Tn(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fr).catch(Fr)}ensureInfiniteQueryData(e){return e.behavior=Tn(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cn.isOnline()?ze(this,de).resumePausedMutations():Promise.resolve()}getQueryCache(){return ze(this,le)}getMutationCache(){return ze(this,de)}getDefaultOptions(){return ze(this,fe)}setDefaultOptions(e){Be(this,fe,e)}setQueryDefaults(e,t){ze(this,ue).set(Wr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ze(this,ue).values()],r={};return t.forEach(t=>{Br(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){ze(this,he).set(Wr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ze(this,he).values()],r={};return t.forEach(t=>{Br(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ze(this,fe).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=zr(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===en&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...ze(this,fe).mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ze(this,le).clear(),ze(this,de).clear()}},le=new WeakMap,de=new WeakMap,fe=new WeakMap,ue=new WeakMap,he=new WeakMap,pe=new WeakMap,ge=new WeakMap,ve=new WeakMap,be);const Pn=Symbol("store-raw"),Nn=Symbol("store-node"),Dn=Symbol("store-has"),_n=Symbol("store-self");function Fn(e){let t=e[Xe];if(!t&&(Object.defineProperty(e,Xe,{value:t=new Proxy(e,Ln)}),!Array.isArray(e))){const r=Object.keys(e),n=Object.getOwnPropertyDescriptors(e);for(let i=0,o=r.length;i<o;i++){const o=r[i];n[o].get&&Object.defineProperty(e,o,{enumerable:n[o].enumerable,get:n[o].get.bind(t)})}}return t}function Un(e){let t;return null!=e&&"object"==typeof e&&(e[Xe]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function qn(e,t=new Set){let r,n,i,o;if(r=null!=e&&e[Pn])return r;if(!Un(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let r=0,o=e.length;r<o;r++)i=e[r],(n=qn(i,t))!==i&&(e[r]=n)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const r=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let a=0,c=r.length;a<c;a++)o=r[a],s[o].get||(i=e[o],(n=qn(i,t))!==i&&(e[o]=n))}return e}function $n(e,t){let r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function Mn(e,t,r){if(e[t])return e[t];const[n,i]=ht(r,{equals:!1,internal:!0});return n.$=i,e[t]=n}function jn(e){It()&&Mn($n(e,Nn),_n)()}const Ln={get(e,t,r){if(t===Pn)return e;if(t===Xe)return r;if(t===Ze)return jn(e),r;const n=$n(e,Nn),i=n[t];let o=i?i():e[t];if(t===Nn||t===Dn||"__proto__"===t)return o;if(!i){const r=Object.getOwnPropertyDescriptor(e,t);!It()||"function"==typeof o&&!e.hasOwnProperty(t)||r&&r.get||(o=Mn(n,t,o)())}return Un(o)?Fn(o):o},has:(e,t)=>t===Pn||t===Xe||t===Ze||t===Nn||t===Dn||"__proto__"===t||(It()&&Mn($n(e,Dn),t)(),t in e),set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return jn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const r=Reflect.getOwnPropertyDescriptor(e,t);return r&&!r.get&&r.configurable&&t!==Xe&&t!==Nn?(delete r.value,delete r.writable,r.get=()=>e[Xe][t],r):r}};function zn(e,t,r,n=!1){if(!n&&e[t]===r)return;const i=e[t],o=e.length;void 0===r?(delete e[t],e[Dn]&&e[Dn][t]&&void 0!==i&&e[Dn][t].$()):(e[t]=r,e[Dn]&&e[Dn][t]&&void 0===i&&e[Dn][t].$());let s,a=$n(e,Nn);if((s=Mn(a,t,i))&&s.$(()=>r),Array.isArray(e)&&e.length!==o){for(let t=e.length;t<o;t++)(s=a[t])&&s.$();(s=Mn(a,"length",o))&&s.$(e.length)}(s=a[_n])&&s.$()}function Wn(e,t){const r=Object.keys(t);for(let n=0;n<r.length;n+=1){const i=r[n];zn(e,i,t[i])}}function Bn(e,t,r=[]){let n,i=e;if(t.length>1){n=t.shift();const o=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let i=0;i<n.length;i++)Bn(e,[n[i]].concat(t),r);return}if(s&&"function"===o){for(let i=0;i<e.length;i++)n(e[i],i)&&Bn(e,[i].concat(t),r);return}if(s&&"object"===o){const{from:i=0,to:o=e.length-1,by:s=1}=n;for(let n=i;n<=o;n+=s)Bn(e,[n].concat(t),r);return}if(t.length>1)return void Bn(e[n],t,[n].concat(r));i=e[n],r=[n].concat(r)}let o=t[0];"function"==typeof o&&(o=o(i,r),o===i)||void 0===n&&null==o||(o=qn(o),void 0===n||Un(i)&&Un(o)&&!Array.isArray(o)?Wn(i,o):zn(e,n,o))}function Hn(...[e,t]){const r=qn(e||{}),n=Array.isArray(r);return[Fn(r),function(...e){yt(()=>{n&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=qn(t),Array.isArray(t)){if(e===t)return;let r=0,n=t.length;for(;r<n;r++){const n=t[r];e[r]!==n&&zn(e,r,n)}zn(e,"length",n)}else Wn(e,t)}(r,e[0]):Bn(r,e)})}]}const Qn=Symbol("store-root");function Kn(e,t,r,n,i){const o=t[r];if(e===o)return;const s=Array.isArray(e);if(r!==Qn&&(!Un(e)||!Un(o)||s!==Array.isArray(o)||i&&e[i]!==o[i]))return void zn(t,r,e);if(s){if(e.length&&o.length&&(!n||i&&e[0]&&null!=e[0][i])){let t,r,s,a,c,l,d,f;for(s=0,a=Math.min(o.length,e.length);s<a&&(o[s]===e[s]||i&&o[s]&&e[s]&&o[s][i]&&o[s][i]===e[s][i]);s++)Kn(e[s],o,s,n,i);const u=new Array(e.length),h=new Map;for(a=o.length-1,c=e.length-1;a>=s&&c>=s&&(o[a]===e[c]||i&&o[a]&&e[c]&&o[a][i]&&o[a][i]===e[c][i]);a--,c--)u[c]=o[a];if(s>c||s>a){for(r=s;r<=c;r++)zn(o,r,e[r]);for(;r<e.length;r++)zn(o,r,u[r]),Kn(e[r],o,r,n,i);return void(o.length>e.length&&zn(o,"length",e.length))}for(d=new Array(c+1),r=c;r>=s;r--)l=e[r],f=i&&l?l[i]:l,t=h.get(f),d[r]=void 0===t?-1:t,h.set(f,r);for(t=s;t<=a;t++)l=o[t],f=i&&l?l[i]:l,r=h.get(f),void 0!==r&&-1!==r&&(u[r]=o[t],r=d[r],h.set(f,r));for(r=s;r<e.length;r++)r in u?(zn(o,r,u[r]),Kn(e[r],o,r,n,i)):zn(o,r,e[r])}else for(let t=0,r=e.length;t<r;t++)Kn(e[t],o,t,n,i);return void(o.length>e.length&&zn(o,"length",e.length))}const a=Object.keys(e);for(let l=0,d=a.length;l<d;l++)Kn(e[a[l]],o,a[l],n,i);const c=Object.keys(o);for(let l=0,d=c.length;l<d;l++)void 0===e[c[l]]&&zn(o,c[l],void 0)}function Vn(e,t={}){const{merge:r,key:n="id"}=t,i=qn(e);return e=>{if(!Un(e)||!Un(i))return i;const t=Kn(i,{[Qn]:e},Qn,r,n);return void 0===t?e:t}}var Gn=Et(void 0),Yn=e=>(gt(t=>(t?.(),e.client.mount(),e.client.unmount.bind(e.client))),Tt(()=>e.client.unmount()),Kt(Gn.Provider,{value:()=>e.client,get children(){return e.children}})),Xn=Et(()=>!1);function Jn(e,t,r){const n=bt(()=>(e=>{if(e)return e;const t=At(Gn);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()})(r?.())),i=At(Xn),o=bt(()=>{const t=n().defaultQueryOptions(e());return t._optimisticResults=i()?"isRestoring":"optimistic",t.structuralSharing=!1,t}),s=o(),[a,c]=ht(new t(n(),o()));let l=a().getOptimisticResult(o());const[d,f]=Hn(l),u=()=>a().subscribe(e=>{l=e,queueMicrotask(()=>{p&&b()})});function h(e){const t=a().options,r=t.reconcile;f(n=>function(e,t,r){if(!1===r)return t;if("function"==typeof r){const n=r(e.data,t.data);return{...t,data:n}}let n=t.data;if(void 0===e.data)try{n=structuredClone(n)}catch(o){}const i=Vn(n,{key:r})(e.data);return{...t,data:i}}(n,e,void 0!==r&&r,t.queryHash))}let p=null,g=null;const[v,{refetch:b}]=mt(()=>{const e=a();return new Promise((t,r)=>{return g=t,p||i()||(p=u()),e.updateResult(),l.isError&&!l.isFetching&&!i()&&(n=e.options.throwOnError,o=[l.error,e.getCurrentQuery()],"function"==typeof n?n(...o):n)?(h(l),r(l.error)):l.isLoading?void h(l):(g=null,t((e.getCurrentQuery(),l)));var n,o})},{storage:function(){return[()=>d,e=>{const t=qn(d);if("function"==typeof e&&(e=e(t)),e?.hydrationData){const{hydrationData:t,...r}=e;e=r}h(e)}]},get deferStream(){return e().deferStream},onHydrated(e,t){if(t.value&&"hydrationData"in t.value&&function(e,t,r){if("object"!=typeof t||null===t)return;const n=e.getMutationCache(),i=e.getQueryCache(),o=e.getDefaultOptions().hydrate?.deserializeData??on,s=t.mutations||[],a=t.queries||[];s.forEach(({state:t,...i})=>{n.build(e,{...e.getDefaultOptions().hydrate?.mutations,...r?.defaultOptions?.mutations,...i},t)}),a.forEach(({queryKey:t,state:n,queryHash:s,meta:a,promise:c,dehydratedAt:l})=>{const d=c?function(e){let t;if(e.then(e=>(t=e,e),Fr)?.catch(Fr),void 0!==t)return{data:t}}(c):void 0,f=void 0===n.data?d?.data:n.data,u=void 0===f?f:o(f);let h=i.get(s);const p="pending"===h?.state.status,g="fetching"===h?.state.fetchStatus;if(h){const e=d&&void 0!==l&&l>h.state.dataUpdatedAt;if(n.dataUpdatedAt>h.state.dataUpdatedAt||e){const{fetchStatus:e,...t}=n;h.setState({...t,data:u})}}else h=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...r?.defaultOptions?.queries,queryKey:t,queryHash:s,meta:a},{...n,data:u,fetchStatus:"idle",status:void 0!==u?"success":n.status});c&&!p&&!g&&(void 0===l||l>h.state.dataUpdatedAt)&&h.fetch(void 0,{initialPromise:Promise.resolve(c).then(o)}).catch(Fr)})}(n(),{queries:[{...t.value.hydrationData}]}),p)return;const r={...s};!s.staleTime&&s.initialData||!t.value||(r.refetchOnMount=!1),a().setOptions(r),h(a().getOptimisticResult(r)),p=u()}});return pt(xt(n,e=>{p&&p();const r=new t(e,o());p=u(),c(r)},{defer:!0})),pt(xt(i,e=>{e||b()},{defer:!0})),Tt(()=>{p&&(p(),p=null),g&&(g(l),g=null)}),pt(xt([a,o],([e,t])=>{e.setOptions(t),h(e.getOptimisticResult(t)),b()},{defer:!0})),new Proxy(d,{get:(e,t)=>"data"===t?void 0!==d.data?v.latest?.data:v()?.data:Reflect.get(e,t)})}function Zn(e,t){return Jn(bt(()=>e()),mn,t)}var ei={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"},ti=pr("<svg>"),ri=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ni=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},ii=e=>{const[t,r]=Zt(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return wr(n=ti(),Jt(ei,{get width(){return t.size??ei.width},get height(){return t.size??ei.height},get stroke(){return t.color??ei.stroke},get"stroke-width"(){return ur(()=>!!t.absoluteStrokeWidth)()?24*Number(t.strokeWidth??ei["stroke-width"])/Number(t.size):Number(t.strokeWidth??ei["stroke-width"])},get class(){return((...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim())("lucide","lucide-icon",...null!=t.name?[`lucide-${ri(ni(t.name))}`,`lucide-${ri(t.name)}`]:[],null!=t.class?t.class:"")},get"aria-hidden"(){return t.children||(e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(r)?void 0:"true"}},r),!0,!0),kr(n,Kt(tr,{get each(){return t.iconNode},children:([e,t])=>Kt(Rr,Jt({component:e},t))})),n;var n},oi=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],si=e=>Kt(ii,Jt(e,{iconNode:oi,name:"chevron-down"})),ai=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ci=e=>Kt(ii,Jt(e,{iconNode:ai,name:"arrow-right"})),li=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],di=e=>Kt(ii,Jt(e,{iconNode:li,name:"check"})),fi=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ui=e=>Kt(ii,Jt(e,{iconNode:fi,name:"x"})),hi=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],pi=e=>Kt(ii,Jt(e,{iconNode:hi,name:"external-link"})),gi=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vi=e=>Kt(ii,Jt(e,{iconNode:gi,name:"search"})),bi=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],mi=e=>Kt(ii,Jt(e,{iconNode:bi,name:"pencil"}));
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-solid v0.574.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/var ki=gr("<span aria-label=TokenFlight role=img style=line-height:1>✈️"),Ti=gr("<div>"),Ii=gr("<img>"),Ci=gr("<img alt>"),Si=gr('<a href=https://tokenflight.ai target=_blank rel="noopener noreferrer"part=fee-info data-testid=footer><span>Powered by</span><span>✈️</span><span>Token<span>Flight');function Ei(e,t){if(e)return`${e.replace(/\/$/,"")}/v1/chain/${t}/icon`}function Ai(e){return t=ki(),gt(r=>wr(t,"font-size",`${e.size??28}px`)),t;var t}const Oi={USDC:"$",ETH:"Ξ",USDT:"₮",WBTC:"₿",DAI:"◈",ARB:"A",SOL:"◎"};function Ri(e){const t=()=>e.size??36,[r,n]=ht(!1),i=()=>!!e.logoURI&&!r();return Tr(s=Ti(),(o=fr(()=>!!i()),()=>{return o()?(br(r=Ii(),"error",()=>n(!0)),gt(n=>{var i=e.logoURI,o=e.symbol,s=t(),a=t(),l="tf-59aca7";return i!==n.e&&vr(r,"src",n.e=i),o!==n.t&&vr(r,"alt",n.t=o),s!==n.a&&vr(r,"width",n.a=s),a!==n.o&&vr(r,"height",n.o=a),l!==n.i&&mr(r,n.i=l),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r):Oi[e.symbol]??e.symbol[0]??"?";var r})),gt(r=>{var n="tf-c63ac0",o={width:`${t()}px`,height:`${t()}px`,...i()?{}:{background:`linear-gradient(135deg, ${e.color}, ${e.color}cc)`,"font-size":.42*t()+"px","box-shadow":`0 2px 8px ${e.color}33`}};return n!==r.e&&mr(s,r.e=n),r.t=yr(s,o,r.t),r},{e:void 0,t:void 0}),s;var o,s}function Pi(e){const t=()=>e.size??8,[r,n]=ht(!1),i=()=>!!e.iconUrl&&!r();return Tr(s=Ti(),(o=fr(()=>!!i()),()=>{return o()&&(br(r=Ci(),"error",()=>n(!0)),gt(n=>{var i=e.iconUrl,o=t(),s=t(),a="tf-f89395";return i!==n.e&&vr(r,"src",n.e=i),o!==n.t&&vr(r,"width",n.t=o),s!==n.a&&vr(r,"height",n.a=s),a!==n.o&&mr(r,n.o=a),n},{e:void 0,t:void 0,a:void 0,o:void 0}),r);var r})),gt(r=>{var n="tf-dbfbb3",o={width:`${t()}px`,height:`${t()}px`,...i()?{}:{background:e.color?e.color:"conic-gradient(#627EEA 0deg 90deg, #0052FF 90deg 180deg, #28A0F0 180deg 270deg, #9945FF 270deg 360deg)"}};return n!==r.e&&mr(s,r.e=n),r.t=yr(s,o,r.t),r},{e:void 0,t:void 0}),s;var o,s}function Ni(){return e=Si(),t=e.firstChild,r=t.nextSibling,n=r.nextSibling,i=n.firstChild.nextSibling,Tr(e,Kt(mi,{size:12,get class(){return"tf-b35860"}}),null),gt(o=>{var s="tf-cdfe94",a="tf-7c0c36",l="tf-26d5ea",c="tf-8b1e15",d="tf-3852e5";return s!==o.e&&mr(e,o.e=s),a!==o.t&&mr(t,o.t=a),l!==o.a&&mr(r,o.a=l),c!==o.o&&mr(n,o.o=c),d!==o.i&&mr(i,o.i=d),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e;var e,t,r,n,i}const Fi={"swap.title":"TokenFlight","swap.youPay":"You pay","swap.youReceive":"You receive","swap.balance":"Balance: {balance}","swap.selectToken":"Select token","swap.connectWallet":"Connect Wallet","swap.reviewSwap":"Review Swap","swap.confirmSwap":"Confirm Swap","swap.executing":"Executing...","swap.success":"Swap Successful","swap.error.generic":"Transaction failed — Retry","swap.viewExplorer":"View on Explorer","swap.max":"MAX","swap.rate":"Rate","swap.fee":"Fee","swap.estTime":"Est. time","swap.poweredBy":"Powered by","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"Wallet account","swap.recipient":"Recipient","swap.required":"Required","swap.recipientPlaceholder":"Enter destination address","swap.enterRecipient":"Enter Recipient Address","swap.recipientTitle":"Recipient Address","swap.recipientConfirm":"Confirm","swap.recipientInvalid":"Invalid address for this chain","swap.noRoutesAvailable":"No routes available","receive.title":"TokenFlight","receive.youReceive":"You receive","receive.payWith":"Pay with","receive.buy":"Buy {amount} {symbol}","receive.processing":"Processing...","receive.success":"Purchase Complete","receive.noPaymentOptions":"No tokens available","receive.noPaymentHint":"Browse tokens to select a payment method","receive.connectToSeeTokens":"Connect your wallet to see payment options","receive.findingBestSource":"Finding best source...","receive.noOfferAvailable":"No offer available","receive.browseAll":"Browse all tokens","receive.changePayment":"Change payment token","receive.best":"BEST","receive.fee":"fee: {value}","receive.viewExplorer":"View on Explorer","selector.title.from":"Select payment token","selector.title.to":"Select destination token","selector.search":"Search by name or address","selector.allChains":"All Chains","selector.noResults":"No tokens found","tracking.step1.title":"Signed in wallet","tracking.step1.subtitle":"Signature submitted","tracking.step1.signing":"Sign in wallet","tracking.step1.signingSubtitle":"Confirm in your wallet...","tracking.step2.title":"Deposit on {chain}","tracking.step2.waiting":"Waiting for confirmation...","tracking.step2.confirmed":"Confirmed on-chain","tracking.step3.title":"Provider filling your order","tracking.step3.subtitle":"Via {provider}","tracking.step3.expired":"Order expired","tracking.step3.expiredSubtitle":"No filler accepted the order","tracking.step3.failed":"Order failed","tracking.step3.failedSubtitle":"Could not be completed","tracking.step4.title":"Filled on {chain}","tracking.step4.subtitle":"Tokens delivered","tracking.step4.refundPending":"Refund in progress","tracking.step4.refundSubtitle":"Returning tokens on {chain}","tracking.step4.failed":"Order failed","tracking.step4.failedSubtitle":"Delivery unsuccessful","tracking.viewOnExplorer":"View","tracking.retry":"Retry","tracking.via":"via {provider}","failure.title":"Order Failed","failure.refundedTitle":"Order Refunded","failure.subtitle":"Your order could not be completed.","failure.refundedSubtitle":"Your funds have been returned to your wallet.","failure.refundAmount":"Refunded","failure.refundTx":"Refund tx","success.title":"Transaction Complete","success.tokensLanded":"Tokens Landed!","success.deliveredIn":"Delivered in {seconds}s","success.delivered":"Your tokens have been delivered","success.onChain":"on {chain}","success.journeyDetails":"Journey details","success.from":"From","success.to":"To","success.sender":"Sender","success.recipient":"Recipient","success.depositTx":"Deposit tx","success.fillTx":"Fill tx","success.provider":"Provider","success.sent":"Sent","success.received":"Received","success.viewExplorer":"View on Explorer","success.newSwap":"New Swap","success.newPurchase":"New Purchase","error.invalidConfig":"Invalid configuration","error.walletNotConnected":"Wallet not connected","error.transactionFailed":"Transaction failed","error.quoteFailed":"Failed to get quote","error.timeout":"Request timed out","error.insufficientBalance":"Insufficient balance","error.walletChainMismatch":"Wallet doesn't match source chain","swap.swapTokens":"Swap tokens","selector.close":"Close","time.seconds":"~{value}s","time.minutes":"~{value}m","quote.refresh":"Quote refreshes in","amount.zero":"0"},[_i,Di]=ht("en-US"),[Ui,$i]=ht(Fi),qi={"zh-CN":()=>Promise.resolve().then(()=>Pd),"zh-TW":()=>Promise.resolve().then(()=>Nd),"ja-JP":()=>Promise.resolve().then(()=>Fd),"ko-KR":()=>Promise.resolve().then(()=>_d)};async function Mi(e){if("en-US"===e||"en"===e)return Di("en-US"),void $i(Fi);const t=qi[e];if(t){const r=await t();Di(e),$i(r.default)}else Di("en-US"),$i(Fi)}function Li(e,t){let r=Ui()[e]??Fi[e]??e;if(t)for(const[n,i]of Object.entries(t))r=r.replace(new RegExp(`\\{${n}\\}`,"g"),String(i));return r}const ji="tf-59b76a";var zi=gr("<input type=number inputmode=decimal part=input>");function Wi(e){let t=null;const[r,n]=ht(e.value);vt(()=>{n(e.value)});return Tt(()=>{t&&clearTimeout(t)}),br(i=zi(),"input",r=>{let i=r.target.value;i=i.replace(/[^0-9.]/g,"");const o=i.indexOf(".");-1!==o&&(i=i.slice(0,o+1)+i.slice(o+1).replace(/\./g,"")),n(i),t&&clearTimeout(t),t=setTimeout(()=>{e.onChange(i)},500)}),gt(t=>{var r=ji,n=e.disabled,o=e.placeholder??Li("amount.zero");return r!==t.e&&mr(i,t.e=r),n!==t.t&&(i.disabled=t.t=n),o!==t.a&&vr(i,"placeholder",t.a=o),t},{e:void 0,t:void 0,a:void 0}),gt(()=>i.value=r()),i;var i}function Bi(e,t){if(!e||t<0)return"0";let r;try{e.startsWith("0x"),r=BigInt(e).toString()}catch{return"0"}const n=r.startsWith("-"),i=n?r.slice(1):r;if(0===t)return n?`-${i}`:i;const o=i.padStart(t+1,"0"),s=o.slice(0,o.length-t),a=o.slice(o.length-t).replace(/0+$/,""),l=a?`${s}.${a}`:s;return n?`-${l}`:l}function Hi(e,t){if(!e)return"0";if(!/^-?\d+(?:\.\d*)?$/.test(e))return"0";const r=e.startsWith("-"),n=(r?e.slice(1):e).split("."),i=((n[0]??"0")+(n[1]??"").slice(0,t).padEnd(t,"0")).replace(/^0+/,"")||"0";return r?`-${i}`:i}function Qi(e,t,r,n){if(!e||!r||"0"===e)return"0";if(t<0||n<0)return"0";let i,o;try{i=BigInt(e),o=BigInt(r)}catch{return"0"}if(0n===i)return"0";const s=10n**BigInt(8),a=(o*10n**BigInt(t)*s/(i*10n**BigInt(n))).toString().padStart(9,"0"),l=a.slice(0,a.length-8),c=a.slice(a.length-8).replace(/0+$/,"");return c?`${l}.${c}`:l}function Ki(e,t=6){if(!e||"0"===e)return"0";const r=e.split("."),n=r[0]??"0";if(!r[1])return e;const i=r[1];if("0"!==n&&"-0"!==n){const e=i.slice(0,t).replace(/0+$/,"");return e?`${n}.${e}`:n}const o=i.search(/[1-9]/);if(-1===o)return"0";const s=o+t,a=i.slice(0,s).replace(/0+$/,"");return a?`${n}.${a}`:"0"}const Vi={1:{symbol:"ETH",decimals:18},10:{symbol:"ETH",decimals:18},8453:{symbol:"ETH",decimals:18},42161:{symbol:"ETH",decimals:18},324:{symbol:"ETH",decimals:18},59144:{symbol:"ETH",decimals:18},11155111:{symbol:"ETH",decimals:18},11155420:{symbol:"ETH",decimals:18},1313161554:{symbol:"ETH",decimals:18},56:{symbol:"BNB",decimals:18},137:{symbol:"POL",decimals:18},43114:{symbol:"AVAX",decimals:18},20011e6:{symbol:"SOL",decimals:9}};function Gi(e){const t=Number(e);return Number.isFinite(t)?0===t?"0":Ki(e,t>=1?4:t>=.01?6:8):e}var Yi=gr("<span><span></span><span aria-hidden=true></span><span>"),Xi=gr("<span>");function Ji(e){return e.includes(".")?e.replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"").replace(/\.$/,""):e}function Zi(e,t,r){if(!Number.isFinite(e))return null;if(void 0!==r)return e.toFixed(r);if(0===e)return"0";const n=Math.abs(e)<1?e.toPrecision(t):e.toLocaleString("en-US",{useGrouping:!1,maximumSignificantDigits:t});if(!/[eE]/.test(n))return n;const[i,o]=n.toLowerCase().split("e");if(!i||void 0===o)return n;const s=Number(o);if(!Number.isFinite(s))return n;const a=i.startsWith("-")?"-":"",l=a?i.slice(1):i,[c,d=""]=l.split("."),u=`${c??""}${d}`,f=(c?.length??0)+s;return f<=0?`${a}0.${"0".repeat(Math.abs(f))}${u}`:f>=u.length?`${a}${u}${"0".repeat(f-u.length)}`:`${a}${u.slice(0,f)}.${u.slice(f)}`}function eo(e){const t=mt(()=>function(e,t,r){const n=function(e){if(null==e)return null;if("bigint"==typeof e)return e.toString();const t=String(e).trim();if(!t)return null;const r=Number(t);return Number.isFinite(r)?t:null}(e);if(!n)return null;const i=Zi(Number(n),t,r);if(!i)return null;const o=Ji(i),s=o.match(/^(-?\d+)\.(0+)(\d*)$/);if(!s)return o;const a=s[1],l=s[2],c=s[3]??"";return!a||!l||l.length<3?o:{prefix:`${a}.${l.charAt(0)}`,zeroCount:l.length,suffix:c}}(e.value,e.digits??8,e.fixedDecimals)),r=mt(()=>{const r=t();if(null===r||"string"==typeof r)return null;const n=Zi(Number(e.value??0),18);return n?Ji(n):null});return fr(()=>{const e=t();if(null===e)return null;if("string"==typeof e)return e;const n=(o=(i=Yi()).firstChild,a=(s=o.nextSibling).nextSibling,Tr(o,()=>e.prefix),Tr(s,()=>e.zeroCount),Tr(a,()=>e.suffix),gt(e=>{var t="tf-ba406b",r="tf-9d81a4";return t!==e.e&&mr(i,e.e=t),r!==e.t&&mr(s,e.t=r),e},{e:void 0,t:void 0}),i);var i,o,s,a;const l=r();return l?(vr(c=Xi(),"title",l),Tr(c,n),gt(()=>mr(c,"tf-7977ef")),c):n;var c})}var to=gr('<div><span>s</span><svg width=14 height=14 viewBox="0 0 16 16"><circle cx=8 cy=8 r=6 fill=none stroke=var(--tf-border) stroke-width=2></circle><circle cx=8 cy=8 r=6 fill=none stroke=var(--tf-accent) stroke-width=2 stroke-linecap=round transform="rotate(-90 8 8)"style="transition:stroke-dashoffset 1s linear">');function ro(e){const t=2*Math.PI*6;return r=to(),i=(n=r.firstChild).firstChild,o=n.nextSibling,s=o.firstChild.nextSibling,Tr(n,()=>e.secondsRemaining(),i),gt(i=>{var a="tf-216412",l="tf-fd32be",c="tf-52dc68",d=String(t),u=t*(1-e.secondsRemaining()/e.totalSeconds);return a!==i.e&&mr(r,i.e=a),l!==i.t&&mr(n,i.t=l),c!==i.a&&vr(o,"class",i.a=c),d!==i.o&&vr(s,"stroke-dasharray",i.o=d),u!==i.i&&vr(s,"stroke-dashoffset",i.i=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r;var r,n,i,o,s}const no="tf-1019c2",io="tf-4922f1",oo="tf-57f45f",so="tf-d74ccc",ao="tf-92e7a8",lo="tf-a9a96f",co="tf-0134eb",uo="tf-1ac2ef",fo="tf-68a980",ho="tf-e7b9c7",po="tf-b4f391",go="tf-118b57",vo="tf-07225e",mo="tf-04e1e2",bo="tf-d01908",yo="tf-1cc72b",wo="tf-d9b7b4",xo="tf-9398ea",ko="tf-2d9323";var To=gr("<div part=price-preview aria-hidden=true><div><div></div><div></div></div><div><div></div><div></div></div><div><div></div><div></div></div><div><div></div><div>"),Io=gr("<div><span></span><span>1 <!> = <!> "),Co=gr("<div><span></span><span>"),So=gr("<div><span>"),Eo=gr("<div part=price-preview>");function Ao(){return e=To(),t=e.firstChild,r=t.firstChild,n=r.nextSibling,i=t.nextSibling,o=i.firstChild,s=o.nextSibling,a=i.nextSibling,l=a.firstChild,c=l.nextSibling,d=a.nextSibling,u=d.firstChild,f=u.nextSibling,gt(h=>{var p=`${no} tf-a57ec8`,g=so,v=`${uo} ${ao}`,m=`${uo} ${lo}`,b=so,y=`${uo} ${ao}`,w=`${uo} ${lo} ${co}`,x=so,k=`${uo} ${ao} tf-d20f50`,T=`${uo} ${lo} tf-91635c`,I=so,C=`${uo} ${ao}`,S=`${uo} ${lo} ${co}`;return p!==h.e&&mr(e,h.e=p),g!==h.t&&mr(t,h.t=g),v!==h.a&&mr(r,h.a=v),m!==h.o&&mr(n,h.o=m),b!==h.i&&mr(i,h.i=b),y!==h.n&&mr(o,h.n=y),w!==h.s&&mr(s,h.s=w),x!==h.h&&mr(a,h.h=x),k!==h.r&&mr(l,h.r=k),T!==h.d&&mr(c,h.d=T),I!==h.l&&mr(d,h.l=I),C!==h.u&&mr(u,h.u=C),S!==h.c&&mr(f,h.c=S),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0}),e;var e,t,r,n,i,o,s,a,l,c,d,u,f}function Oo(e){const t=mt(()=>function(e,t){const{symbol:r,decimals:n}=function(e){return Vi[e]??{symbol:"ETH",decimals:18}}(t),i=(e??"").trim();if(!i)return{amount:"0",symbol:r};try{return i.includes(".")?{amount:Gi(i),symbol:r}:{amount:Gi(Bi(i,n)),symbol:r}}catch{return{amount:i,symbol:r}}}(e.route.quote.estimatedGas,e.fromToken.chainId)),r=[(c=Io(),d=c.firstChild,u=d.nextSibling,f=u.firstChild.nextSibling,h=f.nextSibling.nextSibling,h.nextSibling,Tr(d,()=>Li("swap.rate")),Tr(u,()=>e.fromToken.symbol??"?",f),Tr(u,()=>{const t=e.fromToken.decimals??18,r=e.toToken.decimals??18;return Ki(Qi(e.route.quote.amountIn,t,e.route.quote.amountOut,r),4)},h),Tr(u,()=>e.toToken.symbol??"?",null),gt(e=>{var t=io,r=oo;return t!==e.e&&mr(c,e.e=t),r!==e.t&&mr(u,e.t=r),e},{e:void 0,t:void 0}),c),(s=Co(),a=s.firstChild,l=a.nextSibling,Tr(a,()=>Li("swap.fee")),Tr(l,Kt(rr,{get when(){return e.route.quote.estimatedGas},fallback:"-",get children(){return["~",Kt(eo,{get value(){return t().amount},digits:8})," ",fr(()=>t().symbol)]}})),gt(e=>{var t=io,r=oo;return t!==e.e&&mr(s,e.e=t),r!==e.t&&mr(l,e.t=r),e},{e:void 0,t:void 0}),s),(n=Co(),i=n.firstChild,o=i.nextSibling,Tr(i,()=>Li("swap.estTime")),Tr(o,()=>{return(t=e.route.quote.expectedDurationSeconds)>=60?Li("time.minutes",{value:Math.round(t/60)}):Li("time.seconds",{value:t});var t}),gt(e=>{var t=io,r=oo;return t!==e.e&&mr(n,e.e=t),r!==e.t&&mr(o,e.t=r),e},{e:void 0,t:void 0}),n)];var n,i,o,s,a,l,c,d,u,f,h;return Kt(rr,{get when(){return!e.inline},get fallback(){return[r,Kt(rr,{get when(){return e.showCountdown?.()},get children(){var t=So();return Tr(t.firstChild,()=>Li("quote.refresh")),Tr(t,Kt(ro,{get secondsRemaining(){return e.countdownSeconds},get totalSeconds(){return e.countdownTotal??30}}),null),gt(()=>mr(t,io)),t}})]},get children(){var t=Eo();return Tr(t,r,null),Tr(t,Kt(rr,{get when(){return e.showCountdown?.()},get children(){var t=So();return Tr(t.firstChild,()=>Li("quote.refresh")),Tr(t,Kt(ro,{get secondsRemaining(){return e.countdownSeconds},get totalSeconds(){return e.countdownTotal??30}}),null),gt(()=>mr(t,io)),t}}),null),gt(()=>mr(t,no)),t}})}const Ro="tf-2de115";var Po=gr("<div part=button-primary data-testid=btn-primary>"),No=gr("<button part=button-primary data-testid=btn-primary>"),Fo=gr("<button part=button-secondary data-testid=btn-connect>"),_o=gr("<button part=button-primary data-testid=btn-primary disabled><span><span>"),Do=gr("<button part=button-primary data-testid=btn-recipient>"),Uo=gr("<button part=button-primary data-testid=btn-primary disabled style=opacity:0.6>");function $o(e){return Kt(nr,{get children(){return[Kt(ir,{get when(){return"success"===e.phase},get children(){var t=Po();return Tr(t,Kt(hi,{size:18}),null),Tr(t,()=>e.label??Li("swap.success"),null),gt(()=>mr(t,"tf-65cf23")),t}}),Kt(ir,{get when(){return"error"===e.phase},get children(){var t=No();return br(t,"click",e.onRetry),Tr(t,Kt(gi,{size:16}),null),Tr(t,()=>e.errorLabel||Li("swap.error.generic"),null),gt(()=>mr(t,"tf-2f0314")),t}}),Kt(ir,{get when(){return!e.isConnected},get children(){var t=Fo();return br(t,"click",e.onConnect),Tr(t,()=>Li("swap.connectWallet")),gt(()=>mr(t,"tf-44b8f1")),t}}),Kt(ir,{get when(){return"submitting"===e.phase||"building"===e.phase||"awaiting-wallet"===e.phase||"tracking"===e.phase},get children(){var e=_o(),t=e.firstChild,r=t.firstChild;return Tr(t,()=>Li("swap.executing"),null),gt(n=>{var i=`${Ro} tf-47dc2a`,o="tf-20b1ac",s="tf-e6dae0";return i!==n.e&&mr(e,n.e=i),o!==n.t&&mr(t,n.t=o),s!==n.a&&mr(r,n.a=s),n},{e:void 0,t:void 0,a:void 0}),e}}),Kt(ir,{get when(){return e.needsRecipient},get children(){var t=Do();return br(t,"click",e.onEnterRecipient),Tr(t,()=>Li("swap.enterRecipient")),gt(()=>mr(t,"tf-04fe16")),t}}),Kt(ir,{get when(){return e.insufficientBalance},get children(){var e=Uo();return Tr(e,()=>Li("error.insufficientBalance")),gt(()=>mr(e,Ro)),e}}),Kt(ir,{get when(){return e.hasQuote},get children(){var t=No();return br(t,"click",e.onConfirm),Tr(t,()=>e.label??Li("swap.confirmSwap")),gt(()=>mr(t,Ro)),t}}),Kt(ir,{get when(){return"idle"===e.phase||"quoting"===e.phase||"quoted"===e.phase},get children(){var e=Uo();return Tr(e,()=>Li("swap.reviewSwap")),gt(()=>mr(e,Ro)),e}})]}})}const qo=20011e6;function Mo(e){return e===qo}function Lo(e){return e!==qo}function jo(e){return Mo(e)?"solana":"evm"}function zo(e,t){return t?.get(e)?.name??`Chain ${e}`}function Wo(e,t){return"evm"===t?/^0x[0-9a-fA-F]{40}$/.test(e):/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e)}function Bo(e,t,r){if(!t)return null;const n=r?.get(e)?.blockExplorers?.default?.url;return n?`${n}/tx/${t}`:null}const Ho="tf-7d5519",Qo="tf-bfbd0b",Ko="tf-7e8fdf",Vo="tf-37f3cf",Go="tf-9401fd",Yo="tf-832fae",Xo="tf-b557fc",Jo="tf-4b9be7";var Zo=gr("<div><div><div><div><div></div></div><div><div></div><span></span></div></div></div><div></div><div><div><div><div></div></div><div><div></div><span>"),es=gr("<img>"),ts=gr("<div>"),rs=gr("<div><button>"),ns=gr('<a target=_blank rel="noopener noreferrer"> '),is=gr("<button>"),os=gr("<div><div>"),ss=gr("<div part=progress><div>"),as=gr("<div><div></div><div><div></div><div><span>"),ls=gr("<span style=font-size:14px>!"),cs=gr("<span>");function ds(e){if(e.style.transform="",e.scrollWidth>e.clientWidth){const t=e.clientWidth/e.scrollWidth;e.style.transform=`scale(${t})`,e.style.transformOrigin="left"}}function us(e){const t=()=>e.fromToken?zo(e.fromToken.chainId,e.chainMap):"",r=()=>e.toToken?zo(e.toToken.chainId,e.chainMap):"",n=mt(()=>{const n=e.order,i=n?.status??null,o="deposited"===i||"published"===i||"filled"===i||"refund_pending"===i||!0===n?.stepsCompleted?.includes("deposited")||!!n?.transactions?.deposit,s="refund_pending"===i||"refunded"===i,a="filled"===i,l="failed"===i,c="building"===e.phase||"awaiting-wallet"===e.phase,d={title:Li(c?"tracking.step1.signing":"tracking.step1.title"),subtitle:Li(c?"tracking.step1.signingSubtitle":"tracking.step1.subtitle"),status:c?"active":"completed",explorerUrl:null,isWarning:!1},u=n?.depositTxHash??"",f=n?.transactions?.deposit?.chainId??e.fromToken?.chainId,h=f&&u?Bo(f,u,e.chainMap):null,p=c?"pending":o?"completed":"active",g=c?Li("tracking.step2.waiting"):o?Li("tracking.step2.confirmed"):u?`${Li("tracking.step2.waiting")} · ${v=u,v.length<=14?v:`${v.slice(0,6)}...${v.slice(-4)}`}`:Li("tracking.step2.waiting");var v;const m={title:Li("tracking.step2.title",{chain:t()}),subtitle:g,status:p,explorerUrl:h,isWarning:!1};let b="pending",y=Li("tracking.step3.title"),w=e.providerName?Li("tracking.step3.subtitle",{provider:e.providerName}):Li("tracking.step3.subtitle",{provider:"Provider"}),x=!1;s?(y=Li("tracking.step3.expired"),w=Li("tracking.step3.expiredSubtitle"),b="completed",x=!0):l?(y=Li("tracking.step3.failed"),w=Li("tracking.step3.failedSubtitle"),b="completed",x=!0):a?b="completed":"deposited"!==i&&"published"!==i||(b="active");const k={title:y,subtitle:w,status:b,explorerUrl:null,isWarning:x};let T="pending",I=Li("tracking.step4.title",{chain:r()}),C=Li("tracking.step4.subtitle"),S=!1,E=null;if(a){T="completed";const t=n?.transactions?.fill?.txHash,r=n?.transactions?.fill?.chainId??e.toToken?.chainId;t&&r&&(E=Bo(r,t,e.chainMap))}else if("refund_pending"===i)I=Li("tracking.step4.refundPending"),C=Li("tracking.step4.refundSubtitle",{chain:t()}),T="active",S=!0;else if("refunded"===i){I=Li("tracking.step4.refundPending"),C=Li("tracking.step4.refundSubtitle",{chain:t()}),T="completed",S=!0;const r=n?.transactions?.refund?.txHash,i=n?.transactions?.refund?.chainId??e.fromToken?.chainId;r&&i&&(E=Bo(i,r,e.chainMap))}else l&&(I=Li("tracking.step4.failed"),C=Li("tracking.step4.failedSubtitle"),T="completed",S=!0);const A=[d,m,k,{title:I,subtitle:C,status:T,explorerUrl:E,isWarning:S}];if(e.executionError){for(let r=A.length-1;r>=0;r--){const t=A[r];if(t&&"active"===t.status){A[r]={...t,subtitle:e.executionError,isWarning:!0};break}}const t=A[0];t&&!A.some(e=>e.isWarning&&"active"===e.status)&&(A[0]={...t,subtitle:e.executionError,status:"active",isWarning:!0})}return A}),i=()=>{const t=e.order?.transactions?.refund?.txHash,r=e.order?.transactions?.refund?.chainId??e.fromToken?.chainId;return t&&r?Bo(r,t,e.chainMap):null};return o=ss(),s=o.firstChild,Tr(o,Kt(rr,{get when(){return fr(()=>!!e.fromToken)()&&e.toToken},get children(){return[(n=Zo(),i=n.firstChild,o=i.firstChild,s=o.firstChild,a=s.firstChild,l=s.nextSibling,c=l.firstChild,d=c.nextSibling,u=i.nextSibling,f=u.nextSibling,h=f.firstChild,p=h.firstChild,g=p.firstChild,v=p.nextSibling,m=v.firstChild,b=m.nextSibling,Tr(s,Kt(Ri,{get symbol(){return e.fromToken.symbol??"?"},color:"#2775CA",size:32,get logoURI(){return e.fromToken.logoURI}}),a),Tr(a,Kt(Pi,{color:null,size:14,get iconUrl(){return Ei(e.apiEndpoint,e.fromToken.chainId)}})),kr(t=>vt(()=>{e.inputAmount,e.fromToken,ds(t)}),c),Tr(c,Kt(rr,{get when(){return e.inputAmount},get children(){return[Kt(eo,{get value(){return e.inputAmount},digits:6})," "]}}),null),Tr(c,()=>e.fromToken.symbol??"",null),Tr(d,t),Tr(u,Kt(ui,{size:14})),Tr(p,Kt(Ri,{get symbol(){return e.toToken.symbol??"?"},color:"#0052FF",size:32,get logoURI(){return e.toToken.logoURI}}),g),Tr(g,Kt(Pi,{color:null,size:14,get iconUrl(){return Ei(e.apiEndpoint,e.toToken.chainId)}})),kr(t=>vt(()=>{e.outputAmount,e.toToken,ds(t)}),m),Tr(m,Kt(rr,{get when(){return e.outputAmount},get children(){return[Kt(eo,{get value(){return e.outputAmount},digits:6})," "]}}),null),Tr(m,()=>e.toToken.symbol??"",null),Tr(b,r),gt(e=>{var t="tf-9322ae",r=`${Ho} tf-0b8d30`,y=Qo,w=Ko,x=Vo,k=Go,T=Yo,I=Xo,C="tf-5953e8",S=Ho,E=Qo,A=Ko,O=Vo,R=Go,P=Yo,N=Xo;return t!==e.e&&mr(n,e.e=t),r!==e.t&&mr(i,e.t=r),y!==e.a&&mr(o,e.a=y),w!==e.o&&mr(s,e.o=w),x!==e.i&&mr(a,e.i=x),k!==e.n&&mr(l,e.n=k),T!==e.s&&mr(c,e.s=T),I!==e.h&&mr(d,e.h=I),C!==e.r&&mr(u,e.r=C),S!==e.d&&mr(f,e.d=S),E!==e.l&&mr(h,e.l=E),A!==e.u&&mr(p,e.u=A),O!==e.c&&mr(g,e.c=O),R!==e.w&&mr(v,e.w=R),P!==e.m&&mr(m,e.m=P),N!==e.f&&mr(b,e.f=N),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0}),n),Kt(rr,{get when(){return e.providerName},get children(){var t=ts();return Tr(t,Kt(rr,{get when(){return e.providerIcon},get children(){var t=es();return gt(r=>{var n=e.providerIcon,i=e.providerName,o="tf-062404";return n!==r.e&&vr(t,"src",r.e=n),i!==r.t&&vr(t,"alt",r.t=i),o!==r.a&&mr(t,r.a=o),r},{e:void 0,t:void 0,a:void 0}),t}}),null),Tr(t,()=>Li("tracking.via",{provider:e.providerName}),null),gt(()=>mr(t,"tf-a168c7")),t}})];var n,i,o,s,a,l,c,d,u,f,h,p,g,v,m,b}}),s),Tr(s,Kt(tr,{get each(){return n()},children:(e,t)=>{return n=as(),i=n.firstChild,o=i.nextSibling,s=o.firstChild,l=(a=s.nextSibling).firstChild,Tr(i,(r=fr(()=>!("completed"!==e.status||e.isWarning)),()=>{return r()?Kt(hi,{size:14}):fr(()=>!("active"!==e.status||!e.isWarning))()?ls():fr(()=>"active"===e.status)()?(i=ts(),gt(()=>mr(i,"tf-9efe7c")),i):fr(()=>!(!e.isWarning||"completed"!==e.status))()?ls():(Tr(n=cs(),()=>t()+1),n);var n,i})),Tr(s,()=>e.title),Tr(l,()=>e.subtitle),Tr(a,Kt(rr,{get when(){return e.explorerUrl},get children(){var t=ns(),r=t.firstChild;return Tr(t,()=>Li("tracking.viewOnExplorer"),r),Tr(t,Kt(mi,{size:10}),null),gt(r=>{var n=e.explorerUrl,i="tf-0aa291";return n!==r.e&&vr(t,"href",r.e=n),i!==r.t&&mr(t,r.t=i),r},{e:void 0,t:void 0}),t}}),null),gt(t=>{var r=e.isWarning?`${Jo} tf-417d35`:"completed"===e.status?`${Jo} tf-84527b`:"active"===e.status?`${Jo} tf-16cfdc`:`${Jo} tf-8de1c6`,l="tf-036db2 "+(!e.isWarning||"completed"!==e.status&&"active"!==e.status?"completed"===e.status?"tf-09b7bb":"active"===e.status?"tf-aef7e0":"tf-5c628c":"tf-a5abdf"),c="tf-185719",d="tf-aad7e9",u="tf-bcb46a";return r!==t.e&&mr(n,t.e=r),l!==t.t&&mr(i,t.t=l),c!==t.a&&mr(o,t.a=c),d!==t.o&&mr(s,t.o=d),u!==t.i&&mr(a,t.i=u),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n;var r,n,i,o,s,a,l}})),Tr(o,Kt(rr,{get when(){return e.onRetry},get children(){var t=rs(),r=t.firstChild;return br(r,"click",e.onRetry),Tr(r,()=>Li("tracking.retry")),gt(n=>{var i="tf-c918a2"+(e.executionError?"":" tf-ad7aab"),o="tf-1e22cb";return i!==n.e&&mr(t,n.e=i),o!==n.t&&mr(r,n.t=o),n},{e:void 0,t:void 0}),t}}),null),Tr(o,Kt(rr,{get when(){return(()=>{const t=e.order?.status;return"failed"===t||"refunded"===t})()},get children(){var t,r=os(),n=r.firstChild;return Tr(n,(t=fr(()=>"refunded"===e.order?.status),()=>t()?Li("failure.refundedSubtitle"):Li("failure.subtitle"))),Tr(r,Kt(rr,{get when(){return i()},get children(){var e=ns(),t=e.firstChild;return Tr(e,()=>Li("failure.refundTx"),t),Tr(e,Kt(mi,{size:10}),null),gt(t=>{var r=i(),n="tf-11fa21";return r!==t.e&&vr(e,"href",t.e=r),n!==t.t&&mr(e,t.t=n),t},{e:void 0,t:void 0}),e}}),null),Tr(r,Kt(rr,{get when(){return e.onNewSwap},get children(){var t,r=is();return br(r,"click",e.onNewSwap),Tr(r,(t=fr(()=>"receive"===e.mode),()=>t()?Li("success.newPurchase"):Li("success.newSwap"))),gt(()=>mr(r,"tf-4f7573")),r}}),null),gt(e=>{var t="tf-234e31",i="tf-adb588";return t!==e.e&&mr(r,e.e=t),i!==e.t&&mr(n,e.t=i),e},{e:void 0,t:void 0}),r}}),null),gt(e=>{var t="tf-5835df",r="tf-26af4c";return t!==e.e&&mr(o,e.e=t),r!==e.t&&mr(s,e.t=r),e},{e:void 0,t:void 0}),o;var o,s}const fs="tf-6e8c3e",hs="tf-4b5396",ps="tf-63cca1",gs="tf-18c122";var vs=gr("<div><div>"),ms=gr("<div><span></span><span>"),bs=gr('<div><span></span><a target=_blank rel="noopener noreferrer"> '),ys=gr("<div>"),ws=gr("<div><button><span> <span style=font-family:var(--tf-font-family-mono);font-weight:600;color:var(--tf-text)> </span> </span><span>"),xs=gr("<div part=success data-testid=success-page><div><div></div></div><div data-testid=success-title></div><div></div><div><div><span></span><span></span></div></div><button data-testid=success-primary-btn>");function ks(e){const[t,r]=ht(!1),n=()=>{const t=Date.parse(e.order.createdAt),r=Date.parse(e.order.updatedAt);if(Number.isNaN(t)||Number.isNaN(r))return null;const n=Math.round((r-t)/1e3);return n>0?n:null},i=()=>{const t=e.order.transactions?.deposit?.txHash??e.order.depositTxHash,r=e.order.transactions?.deposit?.chainId??e.order.fromChainId;return t?Bo(r,t,e.chainMap):null},o=()=>{const t=e.order.transactions?.fill?.txHash,r=e.order.transactions?.fill?.chainId??e.order.toChainId;return t?Bo(r,t,e.chainMap):null},s=e=>e.length>14?`${e.slice(0,6)}...${e.slice(-4)}`:e;return l=xs(),c=l.firstChild,d=c.firstChild,u=c.nextSibling,f=u.nextSibling,h=f.nextSibling,p=h.firstChild,g=p.firstChild,v=g.nextSibling,m=h.nextSibling,Tr(d,Kt(Ai,{size:28})),Tr(u,()=>Li("success.tokensLanded")),Tr(f,(a=fr(()=>null!==n()),()=>a()?Li("success.deliveredIn",{seconds:String(n())}):Li("success.delivered"))),Tr(h,Kt(rr,{get when(){return e.toToken},get children(){var t=vs(),r=t.firstChild;return Tr(t,Kt(Ri,{get symbol(){return e.toToken.symbol??"?"},color:"#0052FF",size:40,get logoURI(){return e.toToken.logoURI}}),r),Tr(r,Kt(Pi,{color:null,size:14,get iconUrl(){return Ei(e.apiEndpoint,e.order.toChainId)}})),gt(e=>{var n="tf-7b3b5b",i="tf-651299";return n!==e.e&&mr(t,e.e=n),i!==e.t&&mr(r,e.t=i),e},{e:void 0,t:void 0}),t}}),p),Tr(p,Kt(eo,{get value(){return e.order.destAmount&&"number"==typeof e.toToken?.decimals?Ki(Bi(e.order.destAmount,e.toToken.decimals),6):e.order.destAmount??"0"},digits:8}),g),Tr(g,()=>e.toToken?.symbol??""),Tr(v,()=>Li("success.onChain",{chain:zo(e.order.toChainId,e.chainMap)})),Tr(l,Kt(rr,{get when(){return e.fromToken},get children(){var n=ws(),a=n.firstChild,l=a.firstChild,c=l.firstChild,d=c.nextSibling,u=d.firstChild;d.nextSibling;var f=l.nextSibling;return br(a,"click",()=>r(!t())),Tr(l,()=>Li("success.from"),c),Tr(d,Kt(eo,{get value(){return e.order.srcAmount&&"number"==typeof e.fromToken?.decimals?Ki(Bi(e.order.srcAmount,e.fromToken.decimals),6):e.order.srcAmount??"0"},digits:6}),u),Tr(d,()=>e.fromToken.symbol??"",null),Tr(l,()=>Li("success.onChain",{chain:zo(e.order.fromChainId,e.chainMap)}),null),Tr(f,Kt(ci,{size:14})),Tr(n,Kt(rr,{get when(){return t()},get children(){var t=ys();return Tr(t,Kt(rr,{get when(){return e.order.author},get children(){var t=ms(),r=t.firstChild,n=r.nextSibling;return Tr(r,()=>Li("success.sender")),Tr(n,()=>s(e.order.author)),gt(e=>{var i=fs,o=hs,s=ps;return i!==e.e&&mr(t,e.e=i),o!==e.t&&mr(r,e.t=o),s!==e.a&&mr(n,e.a=s),e},{e:void 0,t:void 0,a:void 0}),t}}),null),Tr(t,Kt(rr,{get when(){return e.order.recipient},get children(){var t=ms(),r=t.firstChild,n=r.nextSibling;return Tr(r,()=>Li("success.recipient")),Tr(n,()=>s(e.order.recipient)),gt(e=>{var i=fs,o=hs,s=ps;return i!==e.e&&mr(t,e.e=i),o!==e.t&&mr(r,e.t=o),s!==e.a&&mr(n,e.a=s),e},{e:void 0,t:void 0,a:void 0}),t}}),null),Tr(t,Kt(rr,{get when(){return i()},get children(){var e=bs(),t=e.firstChild,r=t.nextSibling,n=r.firstChild;return Tr(t,()=>Li("success.depositTx")),Tr(r,()=>Li("success.viewExplorer"),n),Tr(r,Kt(mi,{size:10}),null),gt(n=>{var o=fs,s=hs,a=i(),l=gs;return o!==n.e&&mr(e,n.e=o),s!==n.t&&mr(t,n.t=s),a!==n.a&&vr(r,"href",n.a=a),l!==n.o&&mr(r,n.o=l),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e}}),null),Tr(t,Kt(rr,{get when(){return o()},get children(){var e=bs(),t=e.firstChild,r=t.nextSibling,n=r.firstChild;return Tr(t,()=>Li("success.fillTx")),Tr(r,()=>Li("success.viewExplorer"),n),Tr(r,Kt(mi,{size:10}),null),gt(n=>{var i=fs,s=hs,a=o(),l=gs;return i!==n.e&&mr(e,n.e=i),s!==n.t&&mr(t,n.t=s),a!==n.a&&vr(r,"href",n.a=a),l!==n.o&&mr(r,n.o=l),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e}}),null),Tr(t,Kt(rr,{get when(){return e.providerName},get children(){var t=ms(),r=t.firstChild,n=r.nextSibling;return Tr(r,()=>Li("success.provider")),Tr(n,()=>e.providerName),gt(e=>{var i=fs,o=hs,s=ps;return i!==e.e&&mr(t,e.e=i),o!==e.t&&mr(r,e.t=o),s!==e.a&&mr(n,e.a=s),e},{e:void 0,t:void 0,a:void 0}),t}}),null),gt(()=>mr(t,"tf-92a530")),t}}),null),gt(e=>{var r="tf-75f592",i="tf-73910d"+(t()?" tf-ae94a0":""),o="tf-1afb0a"+(t()?" tf-7737cf":"");return r!==e.e&&mr(n,e.e=r),i!==e.t&&mr(a,e.t=i),o!==e.a&&mr(f,e.a=o),e},{e:void 0,t:void 0,a:void 0}),n}}),m),br(m,"click",e.onNewSwap),Tr(m,()=>"receive"===e.mode?Li("success.newPurchase"):Li("success.newSwap")),gt(e=>{var t="tf-e98a9a",r="tf-1f9019",n="tf-73631f",i="tf-9e3a66",o="tf-db06d4",s="tf-c9a5e1",a="tf-f52291",b="tf-8cfc86",y="tf-5f768d",w="tf-d7e813";return t!==e.e&&mr(l,e.e=t),r!==e.t&&mr(c,e.t=r),n!==e.a&&mr(d,e.a=n),i!==e.o&&mr(u,e.o=i),o!==e.i&&mr(f,e.i=o),s!==e.n&&mr(h,e.n=s),a!==e.s&&mr(p,e.s=a),b!==e.h&&mr(g,e.h=b),y!==e.r&&mr(v,e.r=y),w!==e.d&&mr(m,e.d=w),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),l;var a,l,c,d,u,f,h,p,g,v,m}const Ts="tf-140273",Is="tf-45030f",Cs="tf-ce0622",Ss="tf-0c1692",Es="tf-64aa3f",As="tf-25e112",Os="tf-478cb9",Rs="tf-125be5",Ps="tf-9171a2",Ns="tf-43fbf4",Fs="tf-61ca3c";function _s(e){return new Map(e.map(e=>[e.id,e]))}class Ds extends Error{constructor(e,t,r){const n=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${n?`status code ${n}`:"an unknown error"}: ${t.method} ${t.url}`),Le(this,"response"),Le(this,"request"),Le(this,"options"),this.name="HTTPError",this.response=e,this.request=t,this.options=r}}class Us extends Error{constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),Le(this,"name","NonError"),Le(this,"value"),this.value=e}}class $s extends Error{constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new Us(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),Le(this,"name","ForceRetryError"),Le(this,"customDelay"),Le(this,"code"),Le(this,"customRequest"),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}const qs=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,n="function"==typeof globalThis.Request;if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&"unsupported BodyInit type"===i.message)return!1;throw i}return e&&!t})(),Ms="function"==typeof globalThis.AbortController,Ls="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,js="function"==typeof globalThis.ReadableStream,zs="function"==typeof globalThis.FormData,Ws=["get","post","put","patch","head","delete"],Bs={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Hs=2147483647,Qs=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ks=Symbol("stop");class Vs{constructor(e){Le(this,"options"),this.options=e}}const Gs=e=>new Vs(e),Ys={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Xs={next:!0},Js={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Zs=(e,t,r)=>{let n,i=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),n){i+=n.byteLength;let e=0===t?0:i/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,i),transferredBytes:i},n)}n=e},flush(){n&&(i+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},n))}}))},ea=e=>null!==e&&"object"==typeof e,ta=(...e)=>{for(const t of e)if((!ea(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return sa({},...e)},ra=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(const[o,s]of i.entries())n&&"undefined"===s||void 0===s?r.delete(o):r.set(o,s);return r};function na(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:sa(e[r]??[],t[r]??[])}const ia=(e={},t={})=>({beforeRequest:na(e,t,"beforeRequest"),beforeRetry:na(e,t,"beforeRetry"),afterResponse:na(e,t,"afterResponse"),beforeError:na(e,t,"beforeError")}),oa=(e,t)=>{const r=new URLSearchParams;for(const n of[e,t])if(void 0!==n)if(n instanceof URLSearchParams)for(const[e,t]of n.entries())r.append(e,t);else if(Array.isArray(n))for(const e of n){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(ea(n))for(const[e,t]of Object.entries(n))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(n);for(const[t,n]of e.entries())r.append(t,n)}return r},sa=(...e)=>{let t,r={},n={},i={};const o=[];for(const s of e)if(Array.isArray(s))Array.isArray(r)||(r=[]),r=[...r,...s];else if(ea(s)){for(let[e,n]of Object.entries(s))if("signal"===e&&n instanceof globalThis.AbortSignal)o.push(n);else if("context"!==e)"searchParams"!==e?(ea(n)&&e in r&&(n=sa(r[e],n)),r={...r,[e]:n}):t=null==n?void 0:void 0===t?n:oa(t,n);else{if(null!=n&&(!ea(n)||Array.isArray(n)))throw new TypeError("The `context` option must be an object");r={...r,context:null==n?{}:{...r.context,...n}}}ea(s.hooks)&&(i=ia(i,s.hooks),r.hooks=i),ea(s.headers)&&(n=ra(n,s.headers),r.headers=n)}return void 0!==t&&(r.searchParams=t),o.length>0&&(1===o.length?r.signal=o[0]:r.signal=Ls?AbortSignal.any(o):o.at(-1)),r},aa=e=>Ws.includes(e)?e.toUpperCase():e,la={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},ca=(e={})=>{if("number"==typeof e)return{...la,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&(e.methods=e.methods.map(e=>e.toLowerCase())),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...la,...t}};class da extends Error{constructor(e){super(`Request timed out: ${e.method} ${e.url}`),Le(this,"request"),this.name="TimeoutError",this.request=e}}const ua=class e{constructor(t,r={}){var n;if(We(this,Ee),Le(this,"request"),We(this,we),We(this,xe,0),We(this,ke),We(this,Te),We(this,Ie),We(this,Ce),We(this,Se),Be(this,ke,t),Be(this,Te,{...r,headers:ra(ze(this,ke).headers,r.headers),hooks:ia({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:aa(r.method??ze(this,ke).method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:ca(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}}),"string"!=typeof ze(this,ke)&&!(ze(this,ke)instanceof URL||ze(this,ke)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(ze(this,Te).prefixUrl&&"string"==typeof ze(this,ke)){if(ze(this,ke).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");ze(this,Te).prefixUrl.endsWith("/")||(ze(this,Te).prefixUrl+="/"),Be(this,ke,ze(this,Te).prefixUrl+ze(this,ke))}Ms&&Ls&&(Be(this,Ce,ze(this,Te).signal??ze(this,ke).signal),Be(this,we,new globalThis.AbortController),ze(this,Te).signal=ze(this,Ce)?AbortSignal.any([ze(this,Ce),ze(this,we).signal]):ze(this,we).signal),qs&&(ze(this,Te).duplex="half"),void 0!==ze(this,Te).json&&(ze(this,Te).body=ze(this,Te).stringifyJson?.(ze(this,Te).json)??JSON.stringify(ze(this,Te).json),ze(this,Te).headers.set("content-type",ze(this,Te).headers.get("content-type")??"application/json"));const i=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(ze(this,ke)instanceof globalThis.Request&&(zs&&ze(this,Te).body instanceof globalThis.FormData||ze(this,Te).body instanceof URLSearchParams)&&!i&&ze(this,Te).headers.delete("content-type"),this.request=new globalThis.Request(ze(this,ke),ze(this,Te)),void 0!==(o=ze(this,Te).searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0:"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t="?"+("string"==typeof ze(this,Te).searchParams?ze(this,Te).searchParams.replace(/^\?/,""):new URLSearchParams(He(n=e,be,ye).call(n,ze(this,Te).searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,ze(this,Te))}var o;if(ze(this,Te).onUploadProgress){if("function"!=typeof ze(this,Te).onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!qs)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=He(this,Ee,$e).call(this,this.request,ze(this,Te).body??void 0)}}static create(t,r){var n;const i=new e(t,r),o=He(n=i,Ee,Fe).call(n,async()=>{var e,t,r,n,o,s,a,l,c,d,u,f;if("number"==typeof ze(i,Te).timeout&&ze(i,Te).timeout>Hs)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let h=await He(e=i,Ee,_e).call(e);for(const g of ze(i,Te).hooks.afterResponse){const e=He(t=i,Ee,Re).call(t,h.clone());let d;try{d=await g(i.request,He(r=i,Ee,De).call(r),e,{retryCount:ze(i,xe)})}catch(p){throw He(n=i,Ee,Ne).call(n,e),He(o=i,Ee,Ne).call(o,h),p}if(d instanceof Vs)throw He(s=i,Ee,Ne).call(s,e),He(a=i,Ee,Ne).call(a,h),new $s(d.options);const u=d instanceof globalThis.Response?d:h;e!==u&&He(l=i,Ee,Ne).call(l,e),h!==u&&He(c=i,Ee,Ne).call(c,h),h=u}if(He(d=i,Ee,Re).call(d,h),!h.ok&&("function"==typeof ze(i,Te).throwHttpErrors?ze(i,Te).throwHttpErrors(h.status):ze(i,Te).throwHttpErrors)){let e=new Ds(h,i.request,He(u=i,Ee,De).call(u));for(const t of ze(i,Te).hooks.beforeError)e=await t(e,{retryCount:ze(i,xe)});throw e}if(ze(i,Te).onDownloadProgress){if("function"!=typeof ze(i,Te).onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!js)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=h.clone();return He(f=i,Ee,Ne).call(f,h),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(Zs(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(e,ze(i,Te).onDownloadProgress)}return h}).finally(()=>{var e,t;const r=ze(i,Ie);He(e=i,Ee,Pe).call(e,r?.body??void 0),He(t=i,Ee,Pe).call(t,i.request.body??void 0)});for(const[e,s]of Object.entries(Bs))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(o[e]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||s);const t=await o;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return o}};be=new WeakSet,ye=function(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))},we=new WeakMap,xe=new WeakMap,ke=new WeakMap,Te=new WeakMap,Ie=new WeakMap,Ce=new WeakMap,Se=new WeakMap,Ee=new WeakSet,Ae=function(){const e=ze(this,Te).retry.delay(ze(this,xe));let t=e;!0===ze(this,Te).retry.jitter?t=Math.random()*e:"function"==typeof ze(this,Te).retry.jitter&&(t=ze(this,Te).retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=ze(this,Te).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)},Oe=async function(e){if(Qe(this,xe)._++,ze(this,xe)>ze(this,Te).retry.limit)throw e;const t=e instanceof Error?e:new Us(e);if(t instanceof $s)return t.customDelay??He(this,Ee,Ae).call(this);if(!ze(this,Te).retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==ze(this,Te).retry.shouldRetry){const r=await ze(this,Te).retry.shouldRetry({error:t,retryCount:ze(this,xe)});if(!1===r)throw e;if(!0===r)return He(this,Ee,Ae).call(this)}if(function(e){return e instanceof da||e?.name===da.name}(e)&&!ze(this,Te).retry.retryOnTimeout)throw e;if(function(e){return e instanceof Ds||e?.name===Ds.name}(e)){if(!ze(this,Te).retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&ze(this,Te).retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=ze(this,Te).retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return He(this,Ee,Ae).call(this)},Re=function(e){return ze(this,Te).parseJson&&(e.json=async()=>ze(this,Te).parseJson(await e.text())),e},Pe=function(e){e&&e.cancel().catch(()=>{})},Ne=function(e){He(this,Ee,Pe).call(this,e.body??void 0)},Fe=async function(e){try{return await e()}catch(t){const r=Math.min(await He(this,Ee,Oe).call(this,t),Hs);if(ze(this,xe)<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,n)=>{function i(){clearTimeout(o),n(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));const o=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}(r,ze(this,Ce)?{signal:ze(this,Ce)}:{}),t instanceof $s&&t.customRequest){const e=ze(this,Te).signal?new globalThis.Request(t.customRequest,{signal:ze(this,Te).signal}):new globalThis.Request(t.customRequest);He(this,Ee,Ue).call(this,e)}for(const e of ze(this,Te).hooks.beforeRetry){const r=await e({request:this.request,options:He(this,Ee,De).call(this),error:t,retryCount:ze(this,xe)});if(r instanceof globalThis.Request){He(this,Ee,Ue).call(this,r);break}if(r instanceof globalThis.Response)return r;if(r===Ks)return}return He(this,Ee,Fe).call(this,e)}},_e=async function(){ze(this,we)?.signal.aborted&&(Be(this,we,new globalThis.AbortController),ze(this,Te).signal=ze(this,Ce)?AbortSignal.any([ze(this,Ce),ze(this,we).signal]):ze(this,we).signal,this.request=new globalThis.Request(this.request,{signal:ze(this,Te).signal}));for(const t of ze(this,Te).hooks.beforeRequest){const e=await t(this.request,He(this,Ee,De).call(this),{retryCount:ze(this,xe)});if(e instanceof Response)return e;if(e instanceof globalThis.Request){He(this,Ee,Ue).call(this,e);break}}const e=((e,t)=>{const r={};for(const n in t)Object.hasOwn(t,n)&&(n in Js||n in Ys||n in e&&!(n in Xs)||(r[n]=t[n]));return r})(this.request,ze(this,Te));return Be(this,Ie,this.request),this.request=ze(this,Ie).clone(),!1===ze(this,Te).timeout?ze(this,Te).fetch(ze(this,Ie),e):async function(e,t,r,n){return new Promise((i,o)=>{const s=setTimeout(()=>{r&&r.abort(),o(new da(e))},n.timeout);n.fetch(e,t).then(i).catch(o).then(()=>{clearTimeout(s)})})}(ze(this,Ie),e,ze(this,we),ze(this,Te))},De=function(){if(!ze(this,Se)){const{hooks:e,...t}=ze(this,Te);Be(this,Se,Object.freeze(t))}return ze(this,Se)},Ue=function(e){Be(this,Se,void 0),this.request=He(this,Ee,$e).call(this,e)},$e=function(e,t){return ze(this,Te).onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const n=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=Qs,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof n?(new TextEncoder).encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:Zs(e.body,n,t)})})(e,ze(this,Te).onUploadProgress,t??ze(this,Te).body??void 0):e},We(ua,be);let fa=ua;
|
|
8
|
-
/*! MIT License © Sindre Sorhus */const ha=e=>{const t=(t,r)=>fa.create(t,ta(e,r));for(const r of Ws)t[r]=(t,n)=>fa.create(t,ta(e,n,{method:r}));return t.create=e=>ha(ta(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),ha(ta(e,t))),t.stop=Ks,t.retry=Gs,t},pa=ha(),ga="https://api.hyperstream.dev";class va{constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,""),this.ky=pa.create({prefixUrl:this.baseUrl,timeout:15e3,retry:0,headers:{"X-TF-SDK-Version":"0.0.3-rc.1"}})}async request(e){try{return await e}catch(t){if(t instanceof Ye)throw t;if(t instanceof da)throw new Ye(Ve.API_TIMEOUT,"API request timed out",t);if(t instanceof Ds){let e="";try{e=await t.response.json()}catch{e=await t.response.text().catch(()=>"")}const r="object"==typeof e&&null!==e&&"message"in e?String(e.message):`API request failed: ${t.response.status} ${t.response.statusText}`;throw new Ye(Ve.API_REQUEST_FAILED,r,{status:t.response.status,body:e})}throw new Ye(Ve.API_REQUEST_FAILED,`API request failed: ${String(t)}`,t)}}getQuotes(e,t){return this.request(this.ky.post("v1/quotes",{json:e,signal:t}).json())}buildDeposit(e,t){return this.request(this.ky.post("v1/deposit/build",{json:e,signal:t}).json())}submitDeposit(e,t){return this.request(this.ky.put("v1/deposit/submit",{json:e,signal:t}).json())}getOrdersByAddress(e,t){const r={};return t?.orderIds?.length&&(r.orderIds=t.orderIds.join(",")),t?.limit&&(r.limit=t.limit.toString()),t?.cursor&&(r.cursor=t.cursor.toString()),this.request(this.ky.get(`v1/orders/${encodeURIComponent(e)}`,{searchParams:r}).json())}async getOrderById(e,t){return(await this.getOrdersByAddress(e,{orderIds:[t]})).data[0]??null}getTokens(e){const t={};return e?.q&&(t.q=e.q),e?.chainIds?.length&&(t.chainIds=e.chainIds.join(",")),e?.limit&&(t.limit=e.limit.toString()),e?.cursor&&(t.cursor=e.cursor.toString()),this.request(this.ky.get("v1/tokens",{searchParams:t}).json())}searchTokens(e,t){const r={q:e};return t?.chainIds?.length&&(r.chainIds=t.chainIds.join(",")),this.request(this.ky.get("v1/tokens/search",{searchParams:r}).json())}getTopTokens(e){const t={};return e?.chainIds?.length&&(t.chainIds=e.chainIds.join(",")),this.request(this.ky.get("v1/tokens/top",{searchParams:t}).json())}getTokenBalances(e,t){const r={};return t?.chainIds?.length&&(r.chainIds=t.chainIds.join(",")),this.request(this.ky.get(`v1/tokens/balances/${encodeURIComponent(e)}`,{searchParams:r}).json())}getChains(){return this.request(this.ky.get("v1/chains").json())}}const ma=new class extends Pn{constructor(e={}){super(e)}}({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}}),ba="tf:token:";function ya(e,t,r){return["tokenInfo",r??"__default__",e,t.toLowerCase()]}function wa(e,t){return`${ba}${e}:${t.toLowerCase()}`}function xa(e,t){ma.setQueryData(ya(e.chainId,e.address,t),e)}function ka(e,t){(function(e){try{const t=wa(e.chainId,e.address),r={token:e,timestamp:Date.now()};localStorage.setItem(t,JSON.stringify(r)),function(){const e=[];for(let r=0;r<localStorage.length;r++){const t=localStorage.key(r);if(t?.startsWith(ba))try{const r=localStorage.getItem(t);if(r){const n=JSON.parse(r);e.push({key:t,timestamp:n.timestamp})}}catch{t&&localStorage.removeItem(t)}}if(e.length<=200)return;e.sort((e,t)=>e.timestamp-t.timestamp);const t=e.length-200;for(let r=0;r<t;r++)localStorage.removeItem(e[r].key)}()}catch{}})(e),xa(e,t)}async function Ta(e,t,r,n){const i=(n?.baseUrl??r)?.replace(/\/$/,""),o=function(e,t,r){return ma.getQueryData(ya(e,t,r))??null}(e,t,i);if(o)return o;const s=function(e,t){try{const r=wa(e,t),n=localStorage.getItem(r);if(!n)return null;const i=JSON.parse(n);return Date.now()-i.timestamp>864e5?(localStorage.removeItem(r),null):i.token}catch{return null}}(e,t);if(s)return xa(s,i),s;if(n||r)try{const o=n??new va({baseUrl:r}),s=(r=>{const n=t.toLowerCase();return r.find(t=>Number(t.chainId)===e&&t.address.toLowerCase()===n)})((await o.searchTokens(t,{chainIds:[e]})).data??[]);if(s){const r={chainId:(a=s).chainId??e,address:a.address??t,symbol:a.symbol,name:a.name,decimals:a.decimals,logoURI:a.logoURI,...Number.isFinite(Number(a.extensions?.price?.usd??""))?{priceUsd:Number(a.extensions?.price?.usd??"")}:{}};return ka(r,i),r}throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,`Token not found for chain ${e}: ${t}`)}catch(l){if(l instanceof Ye)throw l}var a;return{chainId:e,address:t,decimals:void 0}}const Ia=[{thresholdMs:1e4,intervalMs:1e3},{thresholdMs:3e4,intervalMs:2e3},{thresholdMs:6e4,intervalMs:3e3},{thresholdMs:12e4,intervalMs:5e3}];function Ca(e,t){return ei(()=>({queryKey:["chains",e()?.baseUrl??"__default__"],queryFn:async()=>{const t=e();if(!t)throw new Error("Missing client");return t.getChains()},enabled:t()&&!!e(),staleTime:6e5}))}function Sa(e,t,r){return ei(()=>({queryKey:["quote",e()?.baseUrl??"__default__",t()],queryFn:async({signal:r})=>{const n=e(),i=t();if(!n||!i)throw new Error("Missing client or request");return n.getQuotes(i,r)},enabled:r()&&!!e()&&!!t(),staleTime:15e3,refetchOnWindowFocus:!1}))}function Ea(e,t,r,n){return ei(()=>({queryKey:["tokenBalances",e()?.baseUrl??"__default__",t(),n?.()?.join(",")??"all"],queryFn:async()=>{const r=e(),i=t();if(!r||!i)throw new Error("Missing client or address");const o=Wo(i,"solana"),s=n?.()?.filter(o?Mo:Lo);return r.getTokenBalances(i,s?.length?{chainIds:s}:void 0)},enabled:r()&&!!e()&&!!t(),staleTime:3e4}))}function Aa(e,t=500){const[r,n]=ht(e);let i=null;return Tt(()=>{null!==i&&clearTimeout(i)}),[r,e=>{null!==i&&clearTimeout(i),i=setTimeout(()=>{n(()=>e),i=null},t)},e=>{null!==i&&(clearTimeout(i),i=null),n(()=>e)}]}var Oa=gr("<div><button data-testid=chain-filter-btn>All Chains"),Ra=gr("<div role=dialog part=token-selector data-testid=selector><div><div><span data-testid=selector-title></span><button data-testid=selector-close></button></div><div><span></span><input data-testid=selector-search-input></div></div><div></div><div>"),Pa=gr("<div aria-hidden=true>"),Na=gr("<div>"),Fa=gr("<button data-testid=chain-filter-btn>"),_a=gr("<div><div><div></div><div><div></div><div></div></div></div><div><div></div><div>"),Da=gr("<div style=padding:20px;text-align:center;color:var(--tf-text-tertiary);font-size:var(--tf-font-md)>"),Ua=gr("<div><div></div><div>"),$a=gr("<button data-testid=token-list-item><div><div><div></div></div><div><span></span><span>");const qa=["108px","80px","92px","84px"],Ma=[0,1,2,3,4];function La(e,t){const r=Number(e.chainId),n=Number.isFinite(r)?r:0,i=n>0?t?.get(n):void 0,o="number"==typeof e.decimals&&e.decimals>=0?e.decimals:18,s=e.extensions?.balance,a=void 0!==s&&"0"!==s,l=void 0!==s?a?Ki(Bi(s,o),2):"0":null,c=Number(e.extensions?.price?.usd??""),d=a?Number(Bi(s,o)):0,u=Number.isFinite(c)&&Number.isFinite(d)?d*c:0;return{symbol:e.symbol,name:e.name,chain:i?.name??(n>0?`Chain ${n}`:"Unknown Chain"),chainId:n,color:"#888",balance:l,usd:null!==l?(f=u,!Number.isFinite(f)||f<=0?"$0":f<.01?"<$0.01":`$${f.toFixed(2).replace(/\.?0+$/,"")}`):"",address:e.address,decimals:o,logoURI:e.logoURI,priceUsd:Number.isFinite(c)?c:void 0};var f}function ja(e){const t=()=>"from"===e.selectingFor,[r,n]=ht(""),[i,o]=Aa("",300),[s,a]=ht("All Chains"),[l,c]=ht(!1),d=Ca(()=>e.client??null,()=>!!e.client),u=mt(()=>{const t=d.data,r=e.supportedChainIds;if(!t)return[];if(r?.length){const e=new Set(r);return t.filter(t=>e.has(t.id))}return t}),f=mt(()=>d.isPending&&!d.data),h=()=>e.client?.baseUrl,p=mt(()=>{if("All Chains"===s())return e.supportedChainIds?.length?e.supportedChainIds:void 0;const t=u().find(e=>e.name===s());return t?[t.id]:void 0}),g=mt(()=>p()??(e.supportedChainIds?.length?e.supportedChainIds:void 0)),v=(m=()=>e.client??null,b=()=>!!e.client&&!t(),y=()=>p(),ei(()=>({queryKey:["topTokens",m()?.baseUrl??"__default__",y?.()?.join(",")??"all"],queryFn:async()=>{const e=m();if(!e)throw new Error("Missing client");const t=y?.();return e.getTopTokens(t?.length?{chainIds:t}:void 0)},enabled:b()&&!!m(),staleTime:3e5})));var m,b,y;const w=Ea(()=>e.client??null,()=>e.walletAddress??null,()=>!!e.client&&!!e.walletAddress,()=>p()),x=function(r,n,o,s){return ei(()=>({queryKey:["searchTokens",r()?.baseUrl??"__default__",n(),s?.()?.join(",")??"all"],queryFn:async()=>{const e=r(),t=n();if(!e||!t)throw new Error("Missing client or query");const i=s?.();return e.searchTokens(t,i?.length?{chainIds:i}:void 0)},select:e=>e.data,enabled:!(!e.client||t()||!i().trim()||!r()||!n()),staleTime:3e4}))}(()=>e.client??null,()=>i().trim(),0,()=>g()),k=mt(()=>{const e=d.data;return e?_s(e):new Map}),T=mt(()=>{const e=w.data;if(!e)return new Map;const t=new Map;for(const r of e)t.set(`${r.chainId}:${r.address.toLowerCase()}`,r);return t}),I=(e,t)=>{if(void 0!==e.extensions?.balance)return e;const r=t.get(`${e.chainId}:${e.address.toLowerCase()}`);return r?.extensions?.balance?{...e,extensions:{...e.extensions,balance:r.extensions.balance}}:e},C=mt(()=>{const e=k(),t=T(),r=v.data;return r?r.map(r=>La(I(r,t),e)):[]}),S=mt(()=>{const e=k(),t=w.data;return t?t.map(t=>La(t,e)):[]}),E=mt(()=>{const e=k(),t=T(),r=x.data;return r?r.map(r=>La(I(r,t),e)):null}),A=mt(()=>{if(null!==E())return E();const r=t()?S():C();return r.length>0?r:e.tokens??[]}),O=mt(()=>A().filter(e=>{if("All Chains"!==s()&&e.chain!==s())return!1;if(!x.data&&r()){const t=r().toLowerCase();if(!e.symbol.toLowerCase().includes(t)&&!e.name.toLowerCase().includes(t))return!1}return!0})),R=mt(()=>t()?(w.isPending||w.isFetching)&&!w.data:(v.isPending||v.isFetching)&&!v.data),P=mt(()=>x.isFetching&&!x.data),N=mt(()=>P()||R());return F=Ra(),_=F.firstChild,D=_.firstChild,U=D.firstChild,$=U.nextSibling,q=D.nextSibling,M=q.firstChild,L=M.nextSibling,j=_.nextSibling,z=j.nextSibling,br(F,"keydown",t=>{"Escape"===t.key&&e.onClose()}),Tr(U,()=>Li("from"===e.selectingFor?"selector.title.from":"selector.title.to")),br($,"click",e.onClose),Tr($,Kt(gi,{size:18})),Tr(M,Kt(yi,{size:14})),br(L,"blur",()=>c(!1)),br(L,"focus",()=>c(!0)),br(L,"input",e=>{const t=e.target.value;n(t),o(t)}),Tr(_,Kt(rr,{get when(){return!f()},get fallback(){return Tr(e=Pa(),Kt(tr,{each:qa,children:e=>{return wr(t=Na(),"width",e),gt(()=>mr(t,`${uo} tf-bb4fb1`)),t;var t}})),gt(()=>mr(e,As)),e;var e},get children(){var e=Oa(),t=e.firstChild,r=t.firstChild;return br(t,"click",()=>a("All Chains")),Tr(t,Kt(Pi,{size:14}),r),Tr(e,Kt(tr,{get each(){return u()},children:e=>{return br(t=Fa(),"click",()=>a(e.name)),Tr(t,Kt(Pi,{size:14,get iconUrl(){return Ei(h(),e.id)}}),null),Tr(t,()=>e.name,null),gt(()=>mr(t,`${Os} ${s()===e.name?Rs:""}`)),t;var t}}),null),gt(r=>{var n=As,i=`${Os} ${"All Chains"===s()?Rs:""}`;return n!==r.e&&mr(e,r.e=n),i!==r.t&&mr(t,r.t=i),r},{e:void 0,t:void 0}),e}}),null),Tr(z,Kt(rr,{get when(){return!N()},get fallback(){return Tr(e=Pa(),Kt(tr,{each:Ma,children:()=>{return e=_a(),t=e.firstChild,r=t.firstChild,n=r.nextSibling,i=n.firstChild,o=i.nextSibling,s=t.nextSibling,a=s.firstChild,l=a.nextSibling,gt(c=>{var d="tf-c6ef08",u="tf-3643cf",f=`${uo} tf-9b3d59`,h="tf-a4cc17",p=`${uo} ${Ps} tf-71ea5d`,g=`${uo} ${Ps} tf-dfb33a`,v="tf-7f1baf",m=`${uo} ${Ps} ${Ns}`,b=`${uo} ${Ps} ${Fs}`;return d!==c.e&&mr(e,c.e=d),u!==c.t&&mr(t,c.t=u),f!==c.a&&mr(r,c.a=f),h!==c.o&&mr(n,c.o=h),p!==c.i&&mr(i,c.i=p),g!==c.n&&mr(o,c.n=g),v!==c.s&&mr(s,c.s=v),m!==c.h&&mr(a,c.h=m),b!==c.r&&mr(l,c.r=b),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),e;var e,t,r,n,i,o,s,a,l}})),gt(()=>mr(e,"tf-7ac0fe")),e;var e},get children(){return Kt(tr,{get each(){return O()},get fallback(){return Tr(e=Da(),()=>Li("selector.noResults")),e;var e},children:t=>{return r=$a(),n=r.firstChild,i=n.firstChild,o=i.firstChild,s=i.nextSibling,a=s.firstChild,l=a.nextSibling,br(r,"click",()=>(t=>{t.address&&ka({chainId:t.chainId,address:t.address,symbol:t.symbol,name:t.name,decimals:t.decimals,logoURI:t.logoURI,priceUsd:t.priceUsd}),e.onSelect(t)})(t)),Tr(i,Kt(Ri,{get symbol(){return t.symbol},get color(){return t.color},size:36,get logoURI(){return t.logoURI}}),o),Tr(o,Kt(Pi,{get color(){return null},size:11,get iconUrl(){return fr(()=>t.chainId>0)()?Ei(h(),t.chainId):void 0}})),Tr(a,()=>t.symbol),Tr(l,()=>t.chain),Tr(r,Kt(rr,{get when(){return null!==t.balance},get children(){var e=Ua(),r=e.firstChild,n=r.nextSibling;return Tr(r,()=>t.balance),Tr(n,()=>t.usd),gt(i=>{var o="tf-87740a",s=`${Ns} ${null===t.balance||"0"===t.balance?"tf-2ee375":""}`,a=Fs;return o!==i.e&&mr(e,i.e=o),s!==i.t&&mr(r,i.t=s),a!==i.a&&mr(n,i.a=a),i},{e:void 0,t:void 0,a:void 0}),e}}),null),gt(e=>{var t="tf-512365",c="tf-a0b0d9",d="tf-1e7a62",u="tf-67f18a",f="tf-cd76b9",h="tf-8f4efd",p="tf-51bf2b";return t!==e.e&&mr(r,e.e=t),c!==e.t&&mr(n,e.t=c),d!==e.a&&mr(i,e.a=d),u!==e.o&&mr(o,e.o=u),f!==e.i&&mr(s,e.i=f),h!==e.n&&mr(a,e.n=h),p!==e.s&&mr(l,e.s=p),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),r;var r,n,i,o,s,a,l}})}})),gt(t=>{var r=Ts,n=Li("from"===e.selectingFor?"selector.title.from":"selector.title.to"),i=Is,o=Cs,s=Ss,a=Es,c=Li("selector.close"),d="tf-9819ca "+(l()?"tf-d9fcd6":""),u="tf-4ad0e7",f="tf-9ea859",h=Li("selector.search"),p="tf-ad5703",g="tf-de9986";return r!==t.e&&mr(F,t.e=r),n!==t.t&&vr(F,"aria-label",t.t=n),i!==t.a&&mr(_,t.a=i),o!==t.o&&mr(D,t.o=o),s!==t.i&&mr(U,t.i=s),a!==t.n&&mr($,t.n=a),c!==t.s&&vr($,"aria-label",t.s=c),d!==t.h&&mr(q,t.h=d),u!==t.r&&mr(M,t.r=u),f!==t.d&&mr(L,t.d=f),h!==t.l&&vr(L,"placeholder",t.l=h),p!==t.u&&mr(j,t.u=p),g!==t.c&&mr(z,t.c=g),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0}),gt(()=>L.value=r()),F;var F,_,D,U,$,q,M,L,j,z}var za=gr("<div><div><span></span><button aria-label=Close></button></div><div><textarea rows=3 autocomplete=off></textarea></div><div><button>"),Wa=gr("<span>");function Ba(e){const[t,r]=ht(e.initialValue),n=mt(()=>{const r=t().trim();return!!r&&Wo(r,e.chainType)}),i=mt(()=>{const r=t().trim();return r.length>0&&!Wo(r,e.chainType)}),o=()=>{const r=t().trim();r&&n()&&e.onConfirm(r)};return a=za(),l=a.firstChild,c=l.firstChild,d=c.nextSibling,u=l.nextSibling,f=u.firstChild,h=u.nextSibling,p=h.firstChild,Tr(c,()=>Li("swap.recipientTitle")),br(d,"click",()=>e.onClose()),Tr(d,Kt(gi,{size:18})),br(f,"keydown",e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),o())}),br(f,"input",e=>r(e.target.value)),vr(f,"spellcheck",!1),Tr(u,(s=fr(()=>!!i()),()=>{return s()&&(Tr(e=Wa(),()=>Li("swap.recipientInvalid")),gt(()=>mr(e,"tf-9d4bba")),e);var e}),null),br(p,"click",o),Tr(p,()=>Li("swap.recipientConfirm")),gt(e=>{var t="tf-636daf",r="tf-fddfab",o="tf-970eb9",s="tf-de123a",g="tf-0445e3",v="tf-9a65ec "+(i()?"tf-c5ea21":""),m=Li("swap.recipientPlaceholder"),b="tf-cb9b60",y=`${Ro} tf-2cba65`,w=!n();return t!==e.e&&mr(a,e.e=t),r!==e.t&&mr(l,e.t=r),o!==e.a&&mr(c,e.a=o),s!==e.o&&mr(d,e.o=s),g!==e.i&&mr(u,e.i=g),v!==e.n&&mr(f,e.n=v),m!==e.s&&vr(f,"placeholder",e.s=m),b!==e.h&&mr(h,e.h=b),y!==e.r&&mr(p,e.r=y),w!==e.d&&(p.disabled=e.d=w),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),gt(()=>f.value=t()),a;var s,a,l,c,d,u,f,h,p}const Ha={eip155:{1:1,137:137,42161:42161,8453:8453,10:10,56:56,43114:43114},solana:{"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":20011e6}};function Qa(e){if("object"==typeof e&&null!==e){if("number"!=typeof e.chainId||"string"!=typeof e.address)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"Token target must have numeric chainId and string address",e);return{chainId:e.chainId,address:e.address}}if("string"!=typeof e)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"Token identifier must be a string or TokenTarget object",e);if(e.startsWith("{")){try{const t=JSON.parse(e);if("number"==typeof t.chainId&&"string"==typeof t.address)return{chainId:t.chainId,address:t.address}}catch{}throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"Invalid JSON token identifier",e)}const t=e.split(":");if(3!==t.length)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,`Invalid CAIP-10 format: expected "namespace:reference:address", got "${e}"`,e);const[r,n,i]=t;if(!r||!n||!i)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"CAIP-10 parts cannot be empty",e);const o=Ha[r];let s;if(o&&void 0!==o[n])s=o[n];else{if("eip155"!==r)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,`Unknown CAIP-10 namespace: "${r}"`,e);if(s=parseInt(n,10),isNaN(s))throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,`Invalid EIP-155 chain reference: "${n}"`,e)}return{chainId:s,address:i}}function Ka(e){return e?.includes("1-click")??!1}function Va(e){try{return e.startsWith("0x"),BigInt(e)}catch{return null}}function Ga(e){const t=[];for(const r of e){const e=Va(r.quote.amountOut);null!==e&&t.push({routeId:r.routeId,amountOut:e,etaSeconds:Number.isFinite(r.quote.expectedDurationSeconds)?r.quote.expectedDurationSeconds:Number.MAX_SAFE_INTEGER,isGuaranteedOutput:!1,isOneClick:Ka(r.tags)})}return t}function Ya(e,t){const r=[];for(const n of e){const e=Va(n.quote.amountIn);if(null===e)continue;const i="EXACT_OUTPUT"===t&&"native"===n.exactOutMethod;r.push({routeId:n.routeId,amountIn:e,etaSeconds:Number.isFinite(n.quote.expectedDurationSeconds)?n.quote.expectedDurationSeconds:Number.MAX_SAFE_INTEGER,isGuaranteedOutput:i,isOneClick:Ka(n.tags)})}return r}function Xa(e){if(0===e.length)return[];let t=e[0].amountOut;for(const s of e)s.amountOut>t&&(t=s.amountOut);const r=999n*t/1000n,n=[...e.filter(e=>e.amountOut>=r)].sort((e,t)=>{if(e.isGuaranteedOutput!==t.isGuaranteedOutput)return e.isGuaranteedOutput?-1:1;if(e.isOneClick!==t.isOneClick)return e.isOneClick?-1:1;const r=e.etaSeconds-t.etaSeconds;return 0!==r?r:t.amountOut>e.amountOut?1:t.amountOut<e.amountOut?-1:0}),i=new Set(n.map(e=>e.routeId)),o=e.filter(e=>!i.has(e.routeId)).sort((e,t)=>t.amountOut>e.amountOut?1:t.amountOut<e.amountOut?-1:0);return[...n.map(e=>e.routeId),...o.map(e=>e.routeId)]}function Ja(e){if(0===e.length)return[];let t=e[0].amountIn;for(const s of e)s.amountIn<t&&(t=s.amountIn);const r=1001n*t/1000n,n=[...e.filter(e=>e.amountIn<=r)].sort((e,t)=>{if(e.isGuaranteedOutput!==t.isGuaranteedOutput)return e.isGuaranteedOutput?-1:1;if(e.isOneClick!==t.isOneClick)return e.isOneClick?-1:1;const r=e.etaSeconds-t.etaSeconds;return 0!==r?r:e.amountIn>t.amountIn?1:e.amountIn<t.amountIn?-1:0}),i=new Set(n.map(e=>e.routeId)),o=e.filter(e=>!i.has(e.routeId)).sort((e,t)=>e.amountIn>t.amountIn?1:e.amountIn<t.amountIn?-1:0);return[...n.map(e=>e.routeId),...o.map(e=>e.routeId)]}function Za(e){return Xa(Ga(e))[0]??null}function el(e){const[t,r]=ht(!1),[n,i]=ht(null),o=()=>{const t=e.walletAdapter();return t&&t.supportedActionTypes.some(e=>e.startsWith("solana_"))?"solana":"evm"};let s;return vt(xt(e.walletAdapter,a=>{if(s?.(),s=void 0,!a)return;const l=a.isConnected();r(l),l&&a.getAddress().then(t=>{i(t),e.onAddressChange(t),e.callbacks()?.onWalletConnected?.({address:t??"",chainType:o()})});const c=async()=>{const s=await a.getAddress();t()&&n()===s||(yt(()=>{r(!0),i(s),e.onAddressChange(s)}),e.callbacks()?.onWalletConnected?.({address:s??"",chainType:o()}))},d=()=>{t()&&(yt(()=>{r(!1),i(null),e.onAddressChange(null)}),e.onDisconnect?.())};a.on("connect",c),a.on("disconnect",d),s=()=>{a.off("connect",c),a.off("disconnect",d)}})),Tt(()=>s?.()),{isConnected:t,walletAddress:n,detectChainType:o,handleConnect:async()=>{const t=e.walletAdapter();if(t)try{await t.connect()}catch{e.onConnectError?.("Failed to connect wallet",Ve.WALLET_CONNECTION_FAILED)}else e.callbacks()?.onConnectWallet?.()}}}function tl(e){const t=e.intervalSeconds??30,[r,n]=ht(t);return vt(xt(e.phase,r=>{if("quoted"!==r)return void n(t);n(t);const i=setInterval(()=>{n(r=>r<=1?(e.onExpired(),t):r-1)},1e3);Tt(()=>clearInterval(i))})),{countdownSeconds:r}}function rl(e){const t=mt(()=>{const t=e.toToken();if(!t||!e.isConnected())return!1;const r=e.walletAddress();return!!r&&!Wo(r,jo(t.chainId))}),r=mt(()=>e.recipient()||(e.isConnected()&&e.walletAddress()&&!t()?e.walletAddress():null));return vt(xt(t,r=>{if(r&&!e.recipient()&&e.walletAdapter()){const r=e.toToken();if(!r)return;const n=jo(r.chainId);e.walletAdapter().getAddress(n).then(r=>{r&&Wo(r,n)&&!e.recipient()&&t()&&e.setRecipient(r)}).catch(()=>{})}})),{needRecipient:t,recipientDisplay:r,handleRecipientChange:t=>{e.setRecipient(t.trim()||null)}}}function nl(e){const t=(r=e.client,n=e.walletAddress,i=e.trackingOrderId,o=()=>"tracking"===e.phase()&&!!e.trackingOrderId(),ei(()=>{const e=i(),t=n();return{queryKey:["order",r()?.baseUrl??"__default__",t,e],queryFn:async()=>{const n=r();if(!n||!e||!t)throw new Error("Missing client, address, or orderId");return n.getOrderById(t,e)},enabled:o()&&!!r()&&!!e&&!!t,staleTime:5e3,refetchInterval:e=>function(e){const{orderStatus:t,dataUpdatedAt:r,now:n=Date.now()}=e;if(t&&Ke.includes(t))return!1;if(0===r)return Ia[0].intervalMs;const i=n-r;for(const o of Ia)if(i<o.thresholdMs)return o.intervalMs;return 1e4}({orderStatus:e.state.data?.status,dataUpdatedAt:e.state.dataUpdatedAt??0})}}));var r,n,i,o;return vt(xt(()=>t.data,t=>{if(!t||"tracking"!==e.execPhase())return;const r="filled"===t.status||t.stepsCompleted?.includes("filled"),n="failed"===t.status||"refunded"===t.status;yt(()=>{e.setOrder(t),r?(e.setExecPhase("success"),ma.invalidateQueries({queryKey:["tokenBalances",e.client().baseUrl]}),e.onOrderFilled(t)):n&&(ma.invalidateQueries({queryKey:["tokenBalances",e.client().baseUrl]}),e.onOrderFailed(t))})})),{orderQuery:t}}const il="tf-68123c",ol="tf-43dda9",sl="tf-532d07",al="tf-b7936a",ll="tf-883305",cl="tf-6da3db",dl="tf-d25568",ul="tf-11bb1d",fl="tf-677ece",hl="tf-635915",pl="tf-0d1ef8",gl="tf-d7140f",vl="tf-dcd620",ml="tf-e25a5c",bl="tf-038cf1",yl="tf-33c9cb",wl="tf-b1e4a6",xl="tf-92acfd",kl="tf-bd2f5c",Tl="tf-a04b23",Il="tf-57762e";var Cl=gr("<div data-testid=selector-overlay>"),Sl=gr("<div>"),El=gr("<div part=container><div part=accent-line data-testid=accent-line>"),Al=gr("<img width=22 height=22>"),Ol=gr("<button part=wallet-info><div data-testid=wallet-dot></div><span data-testid=wallet-address>"),Rl=gr("<div part=header><div><span data-testid=header-title>"),Pl=gr("<div><span part=balance data-testid=panel-balance></span><button data-testid=max-btn>"),Nl=gr("<button part=token-display data-testid=token-btn><div data-testid=token-icon-wrap><div data-testid=token-chain-dot></div></div><span data-testid=token-name></span><span data-testid=caret>"),Fl=gr("<div part=panel-from><div><div><span data-testid=panel-label></span></div><div></div><div><span data-testid=fiat>"),_l=gr("<div part=swap-arrow><button type=button data-testid=swap-arrow-inner>"),Dl=gr("<button part=recipient-badge data-testid=recipient-badge><span>"),Ul=gr("<span part=amount-display data-testid=amount style=cursor:default>"),$l=gr("<div part=panel-to data-testid=panel-wrapper-to><div><div><span data-testid=panel-label></span></div><div></div><div><span data-testid=fiat>"),ql=gr("<div part=price-preview data-testid=quote>"),Ml=gr('<div part=no-offer><div><svg width=28 height=28 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round><circle cx=11 cy=11 r=8></circle><path d="m21 21-4.35-4.35"></path><path d="M8 11h6"></path></svg></div><span>'),Ll=gr("<div part=cta-wrapper>"),jl=gr("<span>Flight"),zl=gr("<button data-testid=token-btn><span data-testid=token-name></span><span data-testid=caret>"),Wl=gr("<div style=width:120px;height:28px>");function Bl(e){const t=function(){const[e,t]=ht(null),[r,n]=ht(null),[i,o]=ht(""),[s,a]=ht(null),[l,c]=ht(null),[d,u]=ht(null),[f,h]=ht(null),[p,g]=ht(null),[v,m]=ht(null);return{fromToken:e,toToken:r,inputAmount:i,recipient:s,walletAddress:l,execPhase:d,order:f,error:p,errorCode:v,setFromToken:t,setToToken:n,setInputAmount:o,setRecipient:function(e){s()!==e&&a(e)},setWalletAddress:function(e){l()!==e&&c(e)},setExecPhase:u,setOrder:h,setError:g,setErrorCode:m,clearError:function(){yt(()=>{g(null),m(null)})},reset:function(){yt(()=>{o(""),h(null),u(null),g(null),m(null)})}}}(),[r,n]=ht(null),[i,o]=ht(!1),{isConnected:s,walletAddress:a,handleConnect:l}=el({walletAdapter:()=>e.walletAdapter,callbacks:()=>e.callbacks,onAddressChange:e=>t.setWalletAddress(e),onConnectError:(e,r)=>{t.setError(e),t.setErrorCode(r)}}),[c,d,u]=Aa("",300),f=mt(()=>{const t=e.config.apiEndpoint??ga;return new va({baseUrl:t})}),h=Ea(f,a,()=>s()&&!!a(),()=>e.walletAdapter?.supportedChainIds),p=mt(()=>{const e=t.fromToken();if(!e||"number"!=typeof e.decimals||!h.data)return null;const r=h.data.find(t=>t.address.toLowerCase()===e.address.toLowerCase()&&t.chainId===e.chainId);return r?.extensions?.balance?Ki(Bi(r.extensions.balance,r.decimals),2):"0"}),g=mt(()=>{const e=t.fromToken();if(!e||"number"!=typeof e.decimals||!h.data)return null;const r=h.data.find(t=>t.address.toLowerCase()===e.address.toLowerCase()&&t.chainId===e.chainId);return r?.extensions?.balance??"0"}),v=mt(()=>{const e=t.inputAmount(),r=t.fromToken(),n=g();if(!r||"number"!=typeof r.decimals||!n||!e||"0"===e||""===e)return!1;try{return BigInt(Hi(e,r.decimals))>BigInt(n)}catch{return!1}}),m=mt(()=>{const e=t.fromToken();if(!e)return null;if("number"==typeof e.priceUsd&&Number.isFinite(e.priceUsd))return e.priceUsd;const r=h.data?.find(t=>t.address.toLowerCase()===e.address.toLowerCase()&&t.chainId===e.chainId),n=Number(r?.extensions?.price?.usd??"");return Number.isFinite(n)?n:null}),b=mt(()=>{const e=t.toToken();return e&&"number"==typeof e.priceUsd&&Number.isFinite(e.priceUsd)?e.priceUsd:null}),y=e=>!Number.isFinite(e)||e<=0?"0":e<.01?"<0.01":e.toFixed(2).replace(/\.?0+$/,""),{needRecipient:w,recipientDisplay:x,handleRecipientChange:k}=rl({fromToken:t.fromToken,toToken:t.toToken,recipient:t.recipient,isConnected:s,walletAddress:a,walletAdapter:()=>e.walletAdapter,setRecipient:t.setRecipient}),T=mt(()=>{const e=c(),r=t.fromToken(),n=t.toToken(),i=t.recipient();return e&&!(parseFloat(e)<=0)&&r&&"number"==typeof r.decimals&&n&&f()?w()&&!i?null:{tradeType:"EXACT_INPUT",fromChainId:r.chainId,fromToken:r.address,toChainId:n.chainId,toToken:n.address,amount:Hi(e,r.decimals),fromAddress:a()??(o=r.chainId,Mo(o)?"11111111111111111111111111111111":"0x0000000000000000000000000000000000000000"),...i&&{recipient:i}}:null;var o}),I=mt(()=>!!T()&&!t.execPhase()),C=Sa(f,T,I),S=mt(()=>{const e=t.inputAmount();return!e||parseFloat(e)<=0?[]:t.fromToken()&&t.toToken()?C.data?.routes??[]:[]}),E=mt(()=>C.data?.quoteId??null),A=mt(()=>{const e=S();return e.length>0?Za(e):null}),O=mt(()=>{const e=S(),t=A();return e.find(e=>e.routeId===t)??e[0]??null}),R=mt(()=>{const e=O(),r=t.toToken();return e&&r&&"number"==typeof r.decimals?Ki(Bi(e.quote.amountOut,r.decimals)):""}),P=mt(()=>{return e=t.execPhase(),r=t.error(),n=C.isFetching,i=S().length,o=!!T(),e||(r?"error":n&&0===i&&o?"quoting":i>0?"quoted":"idle");var e,r,n,i,o}),N=mt(()=>!t.execPhase()&&!!T()&&!C.isFetching&&C.isSuccess&&0===S().length),F=mt(()=>{const e=P();return"quoted"===e||"building"===e||"awaiting-wallet"===e||"submitting"===e||"tracking"===e||"success"===e}),_=mt(()=>{const e=P();return"building"===e||"awaiting-wallet"===e||"submitting"===e||"tracking"===e}),D=mt(()=>!(!t.fromToken()||!t.toToken())&&"quoting"===P()&&parseFloat(t.inputAmount())>0&&0===S().length),U=mt(()=>{const e=Number(t.inputAmount()),r=m();return!Number.isFinite(e)||e<=0||null===r?null:Li("swap.fiatValue",{value:y(e*r)})}),$=mt(()=>{const e=Number(R()||"0"),t=b();return!F()||!Number.isFinite(e)||e<=0||null===t?null:Li("swap.fiatValue",{value:y(e*t)})}),{trackingOrderId:q,trackingProviderName:M,trackingProviderIcon:L,executionError:j,handleConfirm:z,handleRetry:W,handleNewSwap:B}=function(e){const[t,r]=ht(null),[n,i]=ht(null),[o,s]=ht(null),[a,l]=ht(null);return{trackingOrderId:t,trackingProviderName:n,trackingProviderIcon:o,executionError:a,handleConfirm:async()=>{const t=e.routes(),n=e.quoteId(),o=t.find(t=>t.routeId===e.selectedRouteId())??t[0];if(!(o&&n&&e.client()&&e.walletAdapter()))return;if(e.needRecipient()&&!e.recipient())return e.setError("Recipient address is required for cross-chain swaps"),void e.setErrorCode(Ve.INVALID_CONFIG);const a=jo(e.fromToken().chainId),c=e.walletAddress();if(!c)return e.setError("Wallet not connected"),void e.setErrorCode(Ve.WALLET_CONNECTION_FAILED);if(!Wo(c,a))return e.setError(Li("error.walletChainMismatch")),void e.setErrorCode(Ve.INVALID_CONFIG);i(o.routeId??null);const d=e.apiEndpoint()??ga;s(o.icon?`${d}${o.icon}`:null),l(null),e.setExecPhase("building");try{const t=await e.client().buildDeposit({from:c,quoteId:n,routeId:o.routeId});let i,s;if(e.setExecPhase("awaiting-wallet"),"CONTRACT_CALL"===t.kind&&t.approvals)for(const r of t.approvals)if("eip1193_request"===r.type){const t=await e.walletAdapter().executeWalletAction({type:"eip1193_request",chainId:e.fromToken().chainId,method:r.request.method,params:r.request.params});if(!t.success)throw new Ye(Ve.WALLET_ACTION_FAILED,t.error??"Wallet action failed");r.deposit&&(i=t.txHash??i)}else if("solana_sendTransaction"===r.type){const t=await e.walletAdapter().executeWalletAction({type:"solana_signTransaction",transaction:r.transaction});if(!t.success)throw new Ye(Ve.WALLET_ACTION_FAILED,t.error??"Wallet action failed");r.deposit&&(s="string"==typeof t.data?t.data:void 0)}if(!i&&!s)throw new Ye(Ve.TRANSACTION_FAILED,"No deposit transaction received");e.setExecPhase("submitting");const a=await e.client().submitDeposit(s?{quoteId:n,routeId:o.routeId,signedTransaction:s}:{quoteId:n,routeId:o.routeId,txHash:i});e.setExecPhase("tracking"),r(a.orderId)}catch(u){const t=u instanceof Error?u.message:"string"==typeof u?u:"Transaction failed";l(t),u instanceof Ye?e.callbacks()?.onSwapError?.({code:u.code,message:u.message,details:u.details}):e.callbacks()?.onSwapError?.({code:Ve.TRANSACTION_FAILED,message:String(u)})}},handleRetry:()=>{l(null),e.setExecPhase(null)},handleNewSwap:()=>{e.storeReset(),r(null),i(null),s(null),l(null),ma.removeQueries({queryKey:["quote",e.client().baseUrl]}),ma.removeQueries({queryKey:["order",e.client().baseUrl]}),e.onReset?.()}}}({client:f,walletAdapter:()=>e.walletAdapter,callbacks:()=>e.callbacks,apiEndpoint:()=>e.config.apiEndpoint,fromToken:t.fromToken,recipient:t.recipient,needRecipient:w,walletAddress:a,routes:S,quoteId:E,selectedRouteId:A,setExecPhase:t.setExecPhase,setError:t.setError,setErrorCode:t.setErrorCode,storeReset:t.reset,onReset:()=>u("")});nl({client:f,walletAddress:a,trackingOrderId:q,phase:P,execPhase:t.execPhase,setOrder:t.setOrder,setExecPhase:t.setExecPhase,onOrderFilled:r=>{e.callbacks?.onSwapSuccess?.({orderId:r.id,fromToken:t.fromToken().symbol??t.fromToken().address,toToken:t.toToken().symbol??t.toToken().address,fromAmount:r.srcAmount,toAmount:r.destAmount,txHash:r.depositTxHash})},onOrderFailed:t=>{e.callbacks?.onSwapError?.({code:Ve.ORDER_FAILED,message:"Order "+t.status})}}),vt(xt(()=>C.data,t=>{t&&e.callbacks?.onQuoteReceived?.(t)})),vt(xt(()=>({isError:C.isError,error:C.error,data:C.data}),({isError:e,error:r,data:n})=>{t.execPhase()||(e&&!n?r instanceof Ye?(t.setError(r.message),t.setErrorCode(r.code)):(t.setError(String(r)),t.setErrorCode(null)):t.error()&&!e&&t.clearError())}));const{countdownSeconds:H}=tl({phase:P,onExpired:()=>{C.refetch()}});kt(()=>{e.config.locale&&Mi(e.config.locale)});const Q=Ca(f,()=>!0),K=mt(()=>{const e=Q.data;return e?_s(e):new Map});kt(async()=>{const r=f();if(e.config.fromToken)try{const n=Qa(e.config.fromToken),i=await Ta(n.chainId,n.address,e.config.apiEndpoint,r);if("number"!=typeof i.decimals)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"Failed to resolve fromToken metadata");t.setFromToken(i)}catch(n){e.callbacks?.onSwapError?.({code:Ve.INVALID_TOKEN_IDENTIFIER,message:`Failed to resolve fromToken: ${n instanceof Error?n.message:String(n)}`})}if(e.config.toToken)try{const n=Qa(e.config.toToken),i=await Ta(n.chainId,n.address,e.config.apiEndpoint,r);if("number"!=typeof i.decimals)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"Failed to resolve toToken metadata");t.setToToken(i)}catch(n){e.callbacks?.onSwapError?.({code:Ve.INVALID_TOKEN_IDENTIFIER,message:`Failed to resolve toToken: ${n instanceof Error?n.message:String(n)}`})}}),kt(()=>{e.config.recipient&&t.setRecipient(e.config.recipient)});const V=r=>{t.setInputAmount(r),e.callbacks?.onAmountChanged?.({amount:r,direction:"from"}),t.error()&&t.clearError(),d(r)},G=e=>{const i={chainId:e.chainId,address:e.address??"",symbol:e.symbol,name:e.name,decimals:e.decimals,logoURI:e.logoURI,priceUsd:e.priceUsd};"from"===r()?t.setFromToken(i):t.setToToken(i),n(null)},Y=()=>{if(_()||!t.fromToken()||!t.toToken())return;const e=t.fromToken(),r=t.toToken();yt(()=>{t.setFromToken(r),t.setToToken(e),"success"===t.execPhase()&&t.setExecPhase(null)})},X=()=>{const e=t.fromToken(),r=g();if(!e||"number"!=typeof e.decimals||!r||"0"===r)return;const n=Bi(r,e.decimals);n&&"0"!==n&&V(n)},J=async()=>{e.walletAdapter?.openAccountModal?await e.walletAdapter.openAccountModal():e.callbacks?.onAccountModal?.()},Z=e=>`${e.slice(0,6)}...${e.slice(-4)}`,ee=mt(()=>{const e=O();return e&&t.fromToken()&&t.toToken()&&("quoting"===P()||F())?e:null}),te=mt(()=>{const t=e.config.titleText?.trim();return t&&t.length>0?t:"TokenFlight"}),re=mt(()=>{const t=e.config.titleText?.trim();return!!t&&t.length>0}),ne=mt(()=>{const t=e.config.titleImageUrl?.trim();return t&&t.length>0?t:null});return ie=El(),oe=ie.firstChild,Tr(ie,Kt(rr,{get when(){return fr(()=>"success"===P())()&&t.order()},get fallback(){return Kt(rr,{get when(){return _()},get fallback(){return[(O=Rl(),q=O.firstChild,M=q.firstChild,Tr(q,Kt(rr,{get when(){return ne()},get fallback(){return Kt(Ai,{size:22})},get children(){var e=Al();return gt(t=>{var r=ne(),n=te(),i=sl;return r!==t.e&&vr(e,"src",t.e=r),n!==t.t&&vr(e,"alt",t.t=n),i!==t.a&&mr(e,t.a=i),t},{e:void 0,t:void 0,a:void 0}),e}}),M),Tr(M,Kt(rr,{get when(){return re()},get fallback(){return["Token",(e=jl(),gt(()=>mr(e,ll)),e)];var e},get children(){return te()}})),Tr(O,Kt(rr,{get when(){return fr(()=>!!s())()&&a()},get children(){var e=Ol(),t=e.firstChild,r=t.nextSibling;return br(e,"click",J),Tr(r,()=>Z(a())),gt(n=>{var i=cl,o=Li("swap.account"),s=dl,a=ul;return i!==n.e&&mr(e,n.e=i),o!==n.t&&vr(e,"aria-label",n.t=o),s!==n.a&&mr(t,n.a=s),a!==n.o&&mr(r,n.o=a),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e}}),null),gt(t=>{var r="tf-dc5721",n=`${il} ${e.config.hideTitle?ol:""}`,i=e.config.hideTitle?"true":void 0,o=al;return r!==t.e&&mr(O,t.e=r),n!==t.t&&mr(q,t.t=n),i!==t.a&&vr(q,"aria-hidden",t.a=i),o!==t.o&&mr(M,t.o=o),t},{e:void 0,t:void 0,a:void 0,o:void 0}),O),(k=Fl(),T=k.firstChild,I=T.firstChild,C=I.firstChild,S=I.nextSibling,E=S.nextSibling,A=E.firstChild,Tr(C,()=>Li("swap.youPay")),Tr(I,Kt(rr,{get when(){return fr(()=>!!s())()&&p()},get children(){var e=Pl(),t=e.firstChild,r=t.nextSibling;return Tr(t,()=>Li("swap.balance",{balance:p()})),br(r,"click",X),Tr(r,()=>Li("swap.max")),gt(n=>{var i="tf-b8a04a",o="tf-d04a4e",s="tf-5f8805";return i!==n.e&&mr(e,n.e=i),o!==n.t&&mr(t,n.t=o),s!==n.a&&mr(r,n.a=s),n},{e:void 0,t:void 0,a:void 0}),e}}),null),Tr(S,Kt(Wi,{get value(){return t.inputAmount()},onChange:V,get disabled(){return _()}}),null),Tr(S,Kt(rr,{get when(){return t.fromToken()},get fallback(){return e=zl(),t=e.firstChild,r=t.nextSibling,br(e,"click",()=>s()?n("from"):l()),Tr(t,()=>Li("swap.selectToken")),Tr(r,Kt(ci,{size:14})),gt(n=>{var i=`${vl} ${ml}`,o=yl,s=wl;return i!==n.e&&mr(e,n.e=i),o!==n.t&&mr(t,n.t=o),s!==n.a&&mr(r,n.a=s),n},{e:void 0,t:void 0,a:void 0}),e;var e,t,r},get children(){var e=Nl(),r=e.firstChild,i=r.firstChild,o=r.nextSibling,s=o.nextSibling;return br(e,"click",()=>n("from")),Tr(r,Kt(Ri,{get symbol(){return t.fromToken().symbol??"?"},color:"#2775CA",size:24,get logoURI(){return t.fromToken().logoURI}}),i),Tr(i,Kt(Pi,{size:10,get iconUrl(){return Ei(f().baseUrl,t.fromToken().chainId)}})),Tr(o,()=>t.fromToken().symbol),Tr(s,Kt(ci,{size:14})),gt(t=>{var n=vl,a=Tl,l=Il,c=bl,d=wl;return n!==t.e&&mr(e,t.e=n),a!==t.t&&mr(r,t.t=a),l!==t.a&&mr(i,t.a=l),c!==t.o&&mr(o,t.o=c),d!==t.i&&mr(s,t.i=d),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e}}),null),Tr(A,()=>U()??" "),gt(e=>{var t="tf-98d625",r=fl,n=hl,i=pl,o=gl,s="tf-d168ae",a=`${xl} ${U()?"":kl}`;return t!==e.e&&mr(k,e.e=t),r!==e.t&&mr(T,e.t=r),n!==e.a&&mr(I,e.a=n),i!==e.o&&mr(C,e.o=i),o!==e.i&&mr(S,e.i=o),s!==e.n&&mr(E,e.n=s),a!==e.s&&mr(A,e.s=a),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),k),(b=_l(),y=b.firstChild,br(y,"click",Y),Tr(y,Kt(ai,{size:14})),gt(e=>{var t="tf-af41ab",r="tf-18c3f4",n=Li("swap.swapTokens");return t!==e.e&&mr(b,e.e=t),r!==e.t&&mr(y,e.t=r),n!==e.a&&vr(y,"aria-label",e.a=n),e},{e:void 0,t:void 0,a:void 0}),b),(i=$l(),c=i.firstChild,d=c.firstChild,u=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,Tr(u,()=>Li("swap.youReceive")),Tr(d,Kt(rr,{get when(){return fr(()=>!!s())()&&t.toToken()},get children(){var e,t=Dl(),r=t.firstChild;return br(t,"click",()=>!_()&&o(!0)),Tr(r,(e=fr(()=>!!x()),()=>e()?Z(x()):Li("swap.recipientPlaceholder"))),Tr(t,Kt(xi,{size:10}),null),gt(e=>{var n=`${wo} ${x()?"":xo}`,i=ko;return n!==e.e&&mr(t,e.e=n),i!==e.t&&mr(r,e.t=i),e},{e:void 0,t:void 0}),t}}),null),Tr(h,Kt(rr,{get when(){return!D()},get fallback(){return e=Wl(),gt(()=>mr(e,uo)),e;var e},get children(){var e=Ul();return Tr(e,Kt(eo,{get value(){return fr(()=>!(!F()&&"quoting"!==P()))()&&R()||"0"},digits:8})),gt(()=>mr(e,`${ji} ${F()||"quoting"===P()?"":"tf-a859d8"}`)),e}}),null),Tr(h,Kt(rr,{get when(){return t.toToken()},get fallback(){return e=zl(),t=e.firstChild,r=t.nextSibling,br(e,"click",()=>s()?n("to"):l()),Tr(t,()=>Li("swap.selectToken")),Tr(r,Kt(ci,{size:14})),gt(n=>{var i=`${vl} ${ml}`,o=yl,s=wl;return i!==n.e&&mr(e,n.e=i),o!==n.t&&mr(t,n.t=o),s!==n.a&&mr(r,n.a=s),n},{e:void 0,t:void 0,a:void 0}),e;var e,t,r},get children(){var e=Nl(),r=e.firstChild,i=r.firstChild,o=r.nextSibling,s=o.nextSibling;return br(e,"click",()=>n("to")),Tr(r,Kt(Ri,{get symbol(){return t.toToken().symbol??"?"},color:"#0052FF",size:24,get logoURI(){return t.toToken().logoURI}}),i),Tr(i,Kt(Pi,{size:10,get iconUrl(){return Ei(f().baseUrl,t.toToken().chainId)}})),Tr(o,()=>t.toToken().symbol),Tr(s,Kt(ci,{size:14})),gt(t=>{var n=vl,a=Tl,l=Il,c=bl,d=wl;return n!==t.e&&mr(e,t.e=n),a!==t.t&&mr(r,t.t=a),l!==t.a&&mr(i,t.a=l),c!==t.o&&mr(o,t.o=c),d!==t.i&&mr(s,t.i=d),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e}}),null),Tr(m,()=>$()??" "),gt(e=>{var t="tf-8b7743",r=fl,n=hl,o=pl,s=gl,a="tf-b2b098",l=`${xl} ${$()?"":kl}`;return t!==e.e&&mr(i,e.e=t),r!==e.t&&mr(c,e.t=r),n!==e.a&&mr(d,e.a=n),o!==e.o&&mr(u,e.o=o),s!==e.i&&mr(h,e.i=s),a!==e.n&&mr(g,e.n=a),l!==e.s&&mr(m,e.s=l),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i),Kt(rr,{get when(){return D()},get children(){return Kt(Ao,{})}}),Kt(rr,{get when(){return fr(()=>!(!ee()||!t.fromToken()))()&&t.toToken()},get children(){var e=ql();return Tr(e,Kt(Oo,{get route(){return ee()},get fromToken(){return t.fromToken()},get toToken(){return t.toToken()},inline:!0,countdownSeconds:H,countdownTotal:30,showCountdown:()=>"quoted"===P()})),gt(()=>mr(e,no)),e}}),Kt(rr,{get when(){return fr(()=>!!N())()&&!D()},get children(){var e=Ml(),t=e.firstChild,r=t.nextSibling;return Tr(r,()=>Li("swap.noRoutesAvailable")),gt(n=>{var i=mo,o=bo,s=yo;return i!==n.e&&mr(e,n.e=i),o!==n.t&&mr(t,n.t=o),s!==n.a&&mr(r,n.a=s),n},{e:void 0,t:void 0,a:void 0}),e}}),(r=Ll(),Tr(r,Kt($o,{get phase(){return P()},get isConnected(){return s()},get hasQuote(){return F()},onConnect:l,onConfirm:z,onRetry:W,get errorLabel(){return t.error()??void 0},get needsRecipient(){return fr(()=>!!w())()&&!t.recipient()},onEnterRecipient:()=>o(!0),get insufficientBalance(){return v()}})),gt(()=>mr(r,"tf-d01dff")),r)];var r,i,c,d,u,h,g,m,b,y,k,T,I,C,S,E,A,O,q,M},get children(){return Kt(us,{get order(){return t.order()},get fromToken(){return t.fromToken()},get toToken(){return t.toToken()},get providerName(){return M()},get providerIcon(){return L()},get apiEndpoint(){return e.config.apiEndpoint??ga},get inputAmount(){return t.inputAmount()},get outputAmount(){return R()},onNewSwap:B,onRetry:W,get executionError(){return j()},mode:"swap",get phase(){return P()},get chainMap(){return K()}})}})},get children(){return Kt(ks,{get order(){return t.order()},get fromToken(){return t.fromToken()},get toToken(){return t.toToken()},onNewSwap:B,get apiEndpoint(){return e.config.apiEndpoint??ga},get providerName(){return M()},mode:"swap",get chainMap(){return K()}})}}),null),Tr(ie,Kt(rr,{get when(){return!e.config.hidePoweredBy},get children(){return Kt(Ni,{})}}),null),Tr(ie,Kt(rr,{get when(){return null!==r()},get children(){var t=Cl();return Tr(t,Kt(ja,{get client(){return f()},get walletAddress(){return a()},get selectingFor(){return r()},onSelect:G,onClose:()=>n(null),get supportedChainIds(){return e.walletAdapter?.supportedChainIds}})),gt(()=>mr(t,fo)),t}}),null),Tr(ie,Kt(rr,{get when(){return fr(()=>!!i())()&&t.toToken()},get children(){var e=Sl();return Tr(e,Kt(Ba,{get initialValue(){return t.recipient()??""},get chainType(){return jo(t.toToken().chainId)},onConfirm:e=>{k(e),o(!1)},onClose:()=>o(!1)})),gt(()=>mr(e,fo)),e}}),null),gt(t=>{var r=`${ho}${e.config.noBackground?` ${po}`:""}${e.config.noBorder?` ${go}`:""}`,n=vo;return r!==t.e&&mr(ie,t.e=r),n!==t.t&&mr(oe,t.t=n),t},{e:void 0,t:void 0}),ie;var ie,oe}const Hl="tf-6c1e97",Ql="tf-142024",Kl="tf-3b42da",Vl="tf-2f811b",Gl="tf-c7ba0f",Yl="tf-66007c",Xl="tf-12c6bb";var Jl=gr("<div>"),Zl=gr("<button data-testid=pay-selected><div><div data-testid=pay-token-icon-wrap><div data-testid=pay-token-chain-dot></div></div><div><div><span data-testid=pay-token-symbol></span></div><span data-testid=pay-token-chain-name></span></div></div><div><div data-testid=pay-selected-amount></div></div><span data-testid=pay-selected-caret>"),ec=gr("<div><button data-testid=browse-all> "),tc=gr("<div><div><div><div><span data-testid=selector-title></span><button data-testid=selector-close></button></div></div><div data-testid=pay-selector-list>"),rc=gr("<div part=payment-list>"),nc=gr('<div data-testid=pay-empty-icon><svg width=32 height=32 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round><circle cx=12 cy=12 r=10></circle><path d="M12 6v6l4 2">'),ic=gr("<span data-testid=pay-empty-text>"),oc=gr("<span>"),sc=gr("<div data-testid=pay-empty>"),ac=gr('<div data-testid=pay-empty-icon><svg width=32 height=32 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round><rect x=1 y=5 width=22 height=16 rx=2></rect><path d="M16 14h.01"></path><path d="M1 10h22">'),lc=gr("<span data-testid=best-badge>"),cc=gr("<button><div><div data-testid=pay-token-icon-wrap><div data-testid=pay-token-chain-dot></div></div><div><div><span data-testid=pay-selector-item-symbol></span></div><span data-testid=pay-selector-item-chain></span></div></div><div><div data-testid=pay-selector-item-amount>");function dc(e){const t=()=>e.tokens[e.selectedIndex]??e.tokens[0];return Tr(r=rc(),Kt(rr,{get when(){return e.tokens.some(e=>!e.disabled)},get fallback(){return Tr(t=sc(),Kt(rr,{get when(){return e.isConnected},get fallback(){return[(t=ac(),gt(()=>mr(t,Yl)),t),(e=ic(),Tr(e,()=>Li("receive.connectToSeeTokens")),gt(()=>mr(e,Xl)),e)];var e,t},get children(){return[(r=nc(),gt(()=>mr(r,Yl)),r),(t=ic(),Tr(t,()=>Li("receive.noPaymentOptions")),gt(()=>mr(t,Xl)),t),(e=oc(),Tr(e,()=>Li("receive.noPaymentHint")),gt(()=>mr(e,"tf-7a8fe0")),e)];var e,t,r}})),gt(()=>mr(t,"tf-5fb6ad")),t;var t},get children(){var r,n=Zl(),i=n.firstChild,o=i.firstChild,s=o.firstChild,a=o.nextSibling,l=a.firstChild,c=l.firstChild,d=l.nextSibling,u=i.nextSibling,f=u.firstChild,h=u.nextSibling;return br(n,"click",e.onOpenSelector),Tr(o,Kt(Ri,{get symbol(){return t().symbol},get color(){return t().color},size:32,get logoURI(){return t().logoURI}}),s),Tr(s,Kt(Pi,{color:null,size:12,get iconUrl(){return fr(()=>void 0!==t().chainId)()?Ei(e.apiEndpoint,t().chainId):void 0}})),Tr(c,()=>t().symbol),Tr(l,(r=fr(()=>!!t().best),()=>{return r()&&(Tr(e=lc(),()=>Li("receive.best")),gt(()=>mr(e,Vl)),e);var e}),null),Tr(d,()=>t().chain),Tr(f,()=>t().amount),Tr(u,Kt(rr,{get when(){return t().amountUsd},get children(){var e=Jl();return Tr(e,()=>t().amountUsd),gt(()=>mr(e,"tf-c11354")),e}}),null),Tr(h,Kt(ci,{size:16})),gt(e=>{var t="tf-09818b",r=Li("receive.changePayment"),p=Gl,g=Ql,v=Kl,m="tf-dea0cb",b="tf-41931a",y="tf-b949b8",w="tf-6542b9",x="tf-3d2f5a",k="tf-9a379d",T="tf-864468";return t!==e.e&&mr(n,e.e=t),r!==e.t&&vr(n,"aria-label",e.t=r),p!==e.a&&mr(i,e.a=p),g!==e.o&&mr(o,e.o=g),v!==e.i&&mr(s,e.i=v),m!==e.n&&mr(a,e.n=m),b!==e.s&&mr(l,e.s=b),y!==e.h&&mr(c,e.h=y),w!==e.r&&mr(d,e.r=w),x!==e.d&&mr(u,e.d=x),k!==e.l&&mr(f,e.l=k),T!==e.u&&mr(h,e.u=T),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),n}}),null),Tr(r,Kt(rr,{get when(){return e.selectorOpen},get children(){var t=tc(),r=t.firstChild,n=r.firstChild,i=n.firstChild,o=i.firstChild,s=o.nextSibling,a=n.nextSibling;return Tr(o,()=>Li("receive.payWith")),br(s,"click",e.onCloseSelector),Tr(s,Kt(gi,{size:16})),Tr(a,Kt(tr,{get each(){return e.tokens},children:(t,r)=>{return i=cc(),o=i.firstChild,s=o.firstChild,a=s.firstChild,l=s.nextSibling,c=l.firstChild,d=c.firstChild,u=c.nextSibling,f=o.nextSibling,h=f.firstChild,br(i,"click",()=>{t.disabled||(e.onSelect(r()),e.onCloseSelector())}),Tr(s,Kt(Ri,{get symbol(){return t.symbol},get color(){return t.color},size:36,get logoURI(){return t.logoURI}}),a),Tr(a,Kt(Pi,{color:null,size:11,get iconUrl(){return fr(()=>void 0!==t.chainId)()?Ei(e.apiEndpoint,t.chainId):void 0}})),Tr(d,()=>t.symbol),Tr(c,(n=fr(()=>!!t.best),()=>{return n()&&(Tr(e=lc(),()=>Li("receive.best")),gt(()=>mr(e,Vl)),e);var e}),null),Tr(u,()=>t.chain),Tr(h,()=>t.balance),Tr(f,Kt(rr,{get when(){return t.balanceUsd},get children(){var e=Jl();return Tr(e,()=>t.balanceUsd),gt(()=>mr(e,"tf-7474a9")),e}}),null),gt(n=>{var p=`tf-176d77 ${r()===e.selectedIndex?"tf-2df5d9":""} ${t.disabled?"tf-dc503e":""}`,g=t.disabled,v="tf-ebbc44",m=Ql,b=Kl,y="tf-5f455f",w="tf-15ee78",x="tf-976d83",k="tf-ba2eec",T="tf-a37921",I="tf-cf71b6";return p!==n.e&&mr(i,n.e=p),g!==n.t&&(i.disabled=n.t=g),v!==n.a&&mr(o,n.a=v),m!==n.o&&mr(s,n.o=m),b!==n.i&&mr(a,n.i=b),y!==n.n&&mr(l,n.n=y),w!==n.s&&mr(c,n.s=w),x!==n.h&&mr(d,n.h=x),k!==n.r&&mr(u,n.r=k),T!==n.d&&mr(f,n.d=T),I!==n.l&&mr(h,n.l=I),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),i;var n,i,o,s,a,l,c,d,u,f,h}})),Tr(r,Kt(rr,{get when(){return e.isConnected},get children(){var t=ec(),r=t.firstChild,n=r.firstChild;return br(r,"click",()=>{e.onCloseSelector(),e.onBrowseAll()}),Tr(r,()=>Li("receive.browseAll"),n),Tr(r,Kt(ui,{size:14}),null),gt(e=>{var n="tf-772a9c",i="tf-22f94f";return n!==e.e&&mr(t,e.e=n),i!==e.t&&mr(r,e.t=i),e},{e:void 0,t:void 0}),t}}),null),gt(e=>{var l=fo,c=Ts,d=Is,u=Cs,f=Ss,h=Es,p="tf-8299cf";return l!==e.e&&mr(t,e.e=l),c!==e.t&&mr(r,e.t=c),d!==e.a&&mr(n,e.a=d),u!==e.o&&mr(i,e.o=u),f!==e.i&&mr(o,e.i=f),h!==e.n&&mr(s,e.n=h),p!==e.s&&mr(a,e.s=p),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),t}}),null),gt(()=>mr(r,"tf-d61a98")),r;var r}const uc={ETH:["ETH","WETH"],USDC:["USDC","USDC.e","USDbC"],USDT:["USDT","USDT.e"]},fc={STABLES_MAJOR:["USDT","USDC","USDE","DAI","USDS","USD1","BUIDL","USDF","USDTB","PYUSD"],STABLE_WRAPPED:["USDE","SUSDE","USDS","SUSDS","DAI","SDAI"],BTC:["BTC","WBTC","TBTC","CBBTC","BTC.B","CKBTC"],ETH_LST_LRT:["ETH","WETH","STETH","WSTETH","RETH","CBETH","FRXETH","SFRXETH","OSETH","ETHX","METH","EETH","WEETH","EZETH","PUFETH","RSETH","WBETH"]},hc=new Set(["BTC","ETH","WETH","WBTC","USDC","USDT","DAI","BNB","XRP","SOL","TRX","DOGE","ADA","BCH","HYPE","XMR","LEO","LINK","MATIC","AVAX"]),pc=new Set(["USDC","USDT","DAI","USDE","USDS","USD1","USDF","USDG","RLUSD","USDD","BUSD","TUSD","USDP","FRAX","LUSD","GUSD","PYUSD"]),gc=new Set([1]),vc=new Set(["0x0000000000000000000000000000000000000000","0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","11111111111111111111111111111111"]);function mc(e){return!!e&&vc.has(e.toLowerCase())}function bc(e){return pc.has(e.toUpperCase())}function yc(e,t){const r=e.chainId===t.chainId,n=function(e,t){const r=e.toUpperCase(),n=t.toUpperCase();if(r===n)return!0;for(const i of Object.values(uc)){const e=i.some(e=>e.toUpperCase()===r),t=i.some(e=>e.toUpperCase()===n);if(e&&t)return!0}return!1}(e.symbol,t.symbol),i=function(e,t){const r=e.toUpperCase(),n=t.toUpperCase();for(const i of Object.values(fc)){const e=i.some(e=>e.toUpperCase()===r),t=i.some(e=>e.toUpperCase()===n);if(e&&t)return!0}return!1}(e.symbol,t.symbol),o=bc(e.symbol),s=bc(t.symbol),a=(l=e.symbol,hc.has(l.toUpperCase()));var l;return r&&n?1:n?2:i||o&&s?r?3:4:o&&!s?5:a?6:r?7:8}function wc(e){return gc.has(e)?1:0}function xc(e,t,r){return!!mc(e)||(r.get(t)??0)>=.1}function kc(e){return mc(e)&&(e.startsWith("0x")||e.startsWith("0X"))?"0x0000000000000000000000000000000000000000":e.toLowerCase()}function Tc(e,t){return e.chainId===t.chainId&&kc(e.address)===kc(t.address)}function Ic(e,t){return e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}const Cc="tf-4c9136",Sc="tf-febe61";var Ec=gr("<div data-testid=selector-overlay>"),Ac=gr("<div>"),Oc=gr("<div part=container><div part=accent-line data-testid=accent-line>"),Rc=gr("<img width=22 height=22>"),Pc=gr("<button part=wallet-info><div data-testid=wallet-dot></div><span data-testid=wallet-address>"),Nc=gr("<div part=header><div><span data-testid=header-title>"),Fc=gr("<button part=recipient-badge data-testid=recipient-badge><span>"),_c=gr("<div><div data-testid=receive-section-label style=display:flex;justify-content:space-between;align-items:center><span></span></div><div part=target-token><div data-testid=receive-target-icon></div><span data-testid=receive-amount></span><span data-testid=receive-symbol></span><span>"),Dc=gr('<div style="padding:0 20px"><div>'),Uc=gr("<div part=price-preview data-testid=quote>"),$c=gr("<div part=cta-wrapper>"),qc=gr("<span>Flight"),Mc=gr('<div style="padding:0 20px"><div><div><div></div><div><div></div><div></div></div></div><div><div></div><div>'),Lc=gr('<div part=no-offer><div><svg width=28 height=28 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round><circle cx=11 cy=11 r=8></circle><path d="m21 21-4.35-4.35"></path><path d="M8 11h6"></path></svg></div><span>');function jc(e){return mc(e)&&(e.startsWith("0x")||e.startsWith("0X"))?"0x0000000000000000000000000000000000000000":e.toLowerCase()}function zc(e,t){return e.chainId===t.chainId&&jc(e.address)===jc(t.address)}function Wc(e){const t=function(){const[e,t]=ht(null),[r,n]=ht(""),[i,o]=ht(null),[s,a]=ht(null),[l,c]=ht(null),[d,u]=ht(null),[f,h]=ht(null),[p,g]=ht(null),[v,m]=ht(null);return{targetToken:e,targetAmount:r,fromToken:i,recipient:s,walletAddress:l,execPhase:d,order:f,error:p,errorCode:v,setTargetToken:t,setTargetAmount:n,setFromToken:o,setRecipient:function(e){s()!==e&&a(e)},setWalletAddress:function(e){l()!==e&&c(e)},setExecPhase:u,setOrder:h,setError:g,setErrorCode:m,clearError:function(){yt(()=>{g(null),m(null)})},reset:function(){yt(()=>{o(null),h(null),u(null),g(null),m(null)})}}}(),[r,n]=ht(0),[i,o]=ht(!1),[s,a]=ht(!1),[l,c]=ht([]),[d,u]=ht(!1),[f,h]=ht(null),{isConnected:p,walletAddress:g,handleConnect:v}=el({walletAdapter:()=>e.walletAdapter,callbacks:()=>e.callbacks,onAddressChange:e=>t.setWalletAddress(e),onDisconnect:()=>{c([]),h(null)},onConnectError:(e,r)=>{t.setError(e),t.setErrorCode(r)}}),m=mt(()=>{const t=e.config.apiEndpoint??ga;return new va({baseUrl:t})}),b=()=>m().baseUrl,y=mt(()=>function(e,t,r,n){return e||(t?"error":r&&0===n?"quoting":n>0?"quoted":"idle")}(t.execPhase(),t.error(),d(),l().length)),w=mt(()=>{const e=y();return"building"===e||"awaiting-wallet"===e||"submitting"===e||"tracking"===e}),[x,k]=ht(!1),T=mt(()=>!!e.config.recipient),{needRecipient:I,recipientDisplay:C,handleRecipientChange:S}=rl({fromToken:f,toToken:t.targetToken,recipient:t.recipient,isConnected:p,walletAddress:g,walletAdapter:()=>e.walletAdapter,setRecipient:t.setRecipient}),E=Ea(m,g,()=>p()&&!!g(),()=>e.walletAdapter?.supportedChainIds);kt(()=>{e.config.locale&&Mi(e.config.locale),e.config.recipient&&t.setRecipient(e.config.recipient)});const A=Ca(m,()=>!0),O=mt(()=>{const e=A.data;return e?_s(e):new Map});kt(async()=>{const r=m(),n=Number(e.config.amount);if(!Number.isFinite(n)||n<=0)return t.setError("Invalid amount: must be greater than zero"),void t.setErrorCode(Ve.INVALID_AMOUNT);try{const n=Qa(e.config.target),o=await Ta(n.chainId,n.address,e.config.apiEndpoint,r);if("number"!=typeof o.decimals)return t.setError("Failed to resolve target token metadata"),void t.setErrorCode(Ve.INVALID_CONFIG);if(t.setTargetToken(o),t.setTargetAmount(e.config.amount),e.config.fromToken)try{const t=Qa(e.config.fromToken),n=await Ta(t.chainId,t.address,e.config.apiEndpoint,r);"number"==typeof n.decimals&&h({address:n.address,chainId:n.chainId,symbol:n.symbol??n.address.slice(0,6),name:n.name??n.symbol??n.address,decimals:n.decimals,logoURI:n.logoURI,...void 0!==n.priceUsd?{extensions:{price:{usd:String(n.priceUsd)}}}:{}})}catch(i){e.callbacks?.onSwapError?.({code:Ve.INVALID_TOKEN_IDENTIFIER,message:`Failed to resolve fromToken: ${i instanceof Error?i.message:String(i)}`})}}catch(i){t.setError(i instanceof Error?i.message:"Failed to resolve target token"),t.setErrorCode(Ve.INVALID_CONFIG)}});const R=mt(()=>{const r=E.data,n=t.targetToken();if(!r||0===r.length||!n)return[];const i=e.walletAdapter?.supportedChainIds,o=i?.length?r.filter(e=>i.includes(e.chainId)):r;if(0===o.length)return[];const s=n.priceUsd??1,a=Number(e.config.amount)*s;return function(e,t,r,n,i){if(0===e.length)return[];const o=function(e){const t=new Map;for(const r of e){if(!mc(r.address))continue;const e=r.extensions?.balance??"0";if("0"===e)continue;const n=Number(Bi(e,r.decimals)),i=Number(r.extensions?.price?.usd??"0");if(i<=0)continue;const o=n*i,s=t.get(r.chainId)??0;t.set(r.chainId,s+o)}return t}(e),s={address:n,chainId:r},a=[];for(const l of e){if(Tc(l,s))continue;const e=l.extensions?.balance;if(!e||"0"===e)continue;const n=Number(l.extensions?.price?.usd??"0");if(n<=0)continue;const c=Number(Bi(e,l.decimals))*n;if(c<1)continue;if(void 0!==i&&c<i)continue;if(!xc(l.address,l.chainId,o))continue;const d=yc({symbol:l.symbol,chainId:l.chainId},{symbol:t,chainId:r});a.push({token:l,tier:d,gasCostScore:wc(l.chainId)})}return a.sort((e,t)=>e.tier!==t.tier?e.tier-t.tier:e.gasCostScore-t.gasCostScore),a.map(e=>e.token)}(o,n.symbol??"",n.chainId,n.address,a>0?a:void 0)});vt(xt(R,e=>{const t=y();e.length>0&&("idle"===t||"error"===t)&&$(e)})),vt(xt(()=>t.recipient(),()=>{const e=R(),t=y();e.length>0&&("idle"===t||"quoted"===t||"error"===t)&&$(e)},{defer:!0}));const P=mt(()=>{const r=f();if(!r)return null;const n=t.targetToken(),i=g(),o=t.recipient();return n&&"number"==typeof n.decimals&&i?I()&&!o?null:{tradeType:"EXACT_OUTPUT",fromChainId:r.chainId,fromToken:r.address,toChainId:n.chainId,toToken:n.address,amount:Hi(e.config.amount,n.decimals),fromAddress:i,...o&&{recipient:o}}:null}),N=mt(()=>!!P()&&"quoted"===y()),F=Sa(m,P,N);vt(xt(()=>F.data,t=>{if(t&&e.callbacks?.onQuoteReceived?.(t),!t||"quoted"!==y())return;const r=f();if(r&&t.routes.length>0){const e=Ja(Ya(t.routes,"EXACT_OUTPUT"))[0],n=t.routes.find(t=>t.routeId===e)??t.routes[0],i=l(),o=i.findIndex(e=>e.token.address.toLowerCase()===r.address.toLowerCase()&&e.token.chainId===r.chainId);if(o>=0){const e=[...i];e[o]={token:r,route:n,quoteId:t.quoteId},c(e)}}}));const{countdownSeconds:_}=tl({phase:y,onExpired:()=>{F.refetch()}}),D=async(e,t,r,n,i,o,s)=>{try{const a={tradeType:"EXACT_OUTPUT",fromChainId:t.chainId,fromToken:t.address,toChainId:i.chainId,toToken:i.address,amount:r,fromAddress:n,...o&&{recipient:o}},l=await ma.fetchQuery({queryKey:["quote",e.baseUrl,a],queryFn:({signal:t})=>e.getQuotes(a,s??t),staleTime:15e3});if(l.routes.length>0){const e=Ja(Ya(l.routes,"EXACT_OUTPUT"))[0];return{token:t,route:l.routes.find(t=>t.routeId===e)??l.routes[0],quoteId:l.quoteId}}}catch(a){}return null};let U=null;const $=async r=>{const i=m(),o=g(),s=t.targetToken();if(!i||!o||!s||"number"!=typeof s.decimals||0===r.length)return;l().length>0&&c([]),t.error()&&t.clearError(),u(!0),U?.abort();const a=new AbortController;U=a;try{const l=Hi(e.config.amount,s.decimals),d=f(),p=d?r.find(e=>zc(e,d)):void 0,g=p?[p,...r.filter(e=>!zc(e,p))]:r;for(const e of g){if(a.signal.aborted)return;const d=await D(i,e,l,o,s,t.recipient(),a.signal);if(a.signal.aborted)return;if(d){c([d]);const t=r.findIndex(t=>zc(t,e));return n(t>=0?t:0),h(e),void u(!1)}}a.signal.aborted||c([])}catch{}finally{u(!1)}};Tt(()=>{U?.abort()});const q=mt(()=>{const e=R(),r=l(),n=t.targetToken(),i=O();if(0===e.length||!n)return[];const o=new Map;for(const t of r)o.set(`${t.token.chainId}:${t.token.address.toLowerCase()}`,t);const s=r.map(e=>({routeId:e.route.routeId,amountIn:BigInt(e.route.quote.amountIn||"0"),etaSeconds:e.route.quote.expectedDurationSeconds,isGuaranteedOutput:"native"===e.route.exactOutMethod,isOneClick:e.route.tags?.includes("1-click")??!1})),a=(s.length>0?Ja(s):[])[0];return e.map(e=>{const t=`${e.chainId}:${e.address.toLowerCase()}`,r=o.get(t),n=i.get(e.chainId),s=e.decimals,l=Number(e.extensions?.price?.usd??"0"),c=e.extensions?.balance?Bi(e.extensions.balance,s):"0",d=Ki(c,2);let u="";if(l>0&&e.extensions?.balance){const e=Number(c)*l;u=e<.01?"<$0.01":`$${e.toFixed(2).replace(/\.?0+$/,"")}`}let f="",h="",p=!0,g=!1;if(r){const t=Bi(r.route.quote.amountIn,s);if(f=Ki(t,2),l>0){const e=Number(t)*l;h=e<.01?"<$0.01":`$${e.toFixed(2).replace(/\.?0+$/,"")}`}p=BigInt(e.extensions?.balance??"0")>=BigInt(r.route.quote.amountIn||"0"),g=r.route.routeId===a}return{symbol:e.symbol,chain:n?.name??`Chain ${e.chainId}`,color:"#888",amount:f,amountUsd:h,balance:d,balanceUsd:u,best:g,disabled:!p,logoURI:e.logoURI,chainId:e.chainId}})}),M=mt(()=>{const e=f();return e?l().find(t=>zc(t.token,e))??null:null}),L=mt(()=>M()?.route??null),j=mt(()=>{const e=M();return e?{chainId:e.token.chainId,address:e.token.address,symbol:e.token.symbol,name:e.token.name,decimals:e.token.decimals,logoURI:e.token.logoURI}:null}),{trackingOrderId:z,trackingProviderName:W,trackingProviderIcon:B,trackingInputAmount:H,executionError:Q,handleConfirm:K,handleRetry:V,handleNewSwap:G}=function(e){const[t,r]=ht(null),[n,i]=ht(null),[o,s]=ht(null),[a,l]=ht(null),[c,d]=ht(null);return{trackingOrderId:t,trackingProviderName:n,trackingProviderIcon:o,trackingInputAmount:a,executionError:c,handleConfirm:async()=>{const t=e.selectedPayToken(),n=t?e.payTokenQuotes().find(e=>Ic(e.token,t)):null,o=e.walletAddress();if(!(n&&e.client()&&e.walletAdapter()&&o))return;if(e.needRecipient()&&!e.recipient())return e.setError("Recipient address is required for cross-chain swaps"),void e.setErrorCode(Ve.INVALID_CONFIG);const a=n.route.quote.validBefore;if(a&&Date.now()/1e3>a){e.setLoadingQuotes(!0);try{const t=e.targetToken();if(!t||"number"!=typeof t.decimals)return;const r=Hi(e.configAmount(),t.decimals),i=await e.fetchSingleQuote(e.client(),n.token,r,o,t,e.recipient());if(!i)return e.setError("Quote expired and could not be refreshed"),void e.setErrorCode(Ve.QUOTE_EXPIRED);{const t=[...e.payTokenQuotes()],r=t.findIndex(e=>Ic(e.token,n.token));r>=0?t[r]=i:t.push(i),e.setPayTokenQuotes(t)}}catch{return e.setError("Quote expired and could not be refreshed"),void e.setErrorCode(Ve.QUOTE_EXPIRED)}finally{e.setLoadingQuotes(!1)}}const c=e.selectedPayToken(),u=c?e.payTokenQuotes().find(e=>Ic(e.token,c)):null;if(!u)return;e.setFromToken({chainId:u.token.chainId,address:u.token.address,symbol:u.token.symbol,name:u.token.name,decimals:u.token.decimals,logoURI:u.token.logoURI}),i(u.route.routeId??null);const f=e.apiEndpoint()??ga;s(u.route.icon?`${f}${u.route.icon}`:null),l(Bi(u.route.quote.amountIn,u.token.decimals)),d(null),e.setExecPhase("building");try{const t=await e.client().buildDeposit({from:o,quoteId:u.quoteId,routeId:u.route.routeId});let n,i;if(e.setExecPhase("awaiting-wallet"),"CONTRACT_CALL"===t.kind&&t.approvals)for(const r of t.approvals)if("eip1193_request"===r.type){const t=await e.walletAdapter().executeWalletAction({type:"eip1193_request",chainId:u.token.chainId,method:r.request.method,params:r.request.params});if(!t.success)throw new Ye(Ve.WALLET_ACTION_FAILED,t.error??"Wallet action failed");r.deposit&&(n=t.txHash??n)}else if("solana_sendTransaction"===r.type){const t=await e.walletAdapter().executeWalletAction({type:"solana_signTransaction",transaction:r.transaction});if(!t.success)throw new Ye(Ve.WALLET_ACTION_FAILED,t.error??"Wallet action failed");r.deposit&&(i="string"==typeof t.data?t.data:void 0)}if(!n&&!i)throw new Ye(Ve.TRANSACTION_FAILED,"No deposit transaction received");e.setExecPhase("submitting");const s=await e.client().submitDeposit(i?{quoteId:u.quoteId,routeId:u.route.routeId,signedTransaction:i}:{quoteId:u.quoteId,routeId:u.route.routeId,txHash:n});e.setExecPhase("tracking"),r(s.orderId)}catch(h){const t=h instanceof Error?h.message:"string"==typeof h?h:"Transaction failed";d(t),h instanceof Ye?e.callbacks()?.onSwapError?.({code:h.code,message:h.message,details:h.details}):e.callbacks()?.onSwapError?.({code:Ve.TRANSACTION_FAILED,message:String(h)})}},handleRetry:()=>{yt(()=>{d(null),e.setExecPhase(null),e.storeClearError(),e.setPayTokenQuotes([])}),e.onRetry?.()},handleNewSwap:()=>{yt(()=>{e.storeReset(),r(null),i(null),s(null),l(null),d(null),e.setPayTokenQuotes([])}),ma.removeQueries({queryKey:["quote",e.client().baseUrl]}),ma.removeQueries({queryKey:["order",e.client().baseUrl]}),e.onReset?.()}}}({client:m,walletAdapter:()=>e.walletAdapter,callbacks:()=>e.callbacks,apiEndpoint:()=>e.config.apiEndpoint,recipient:t.recipient,needRecipient:I,walletAddress:g,targetToken:t.targetToken,selectedPayToken:f,payTokenQuotes:l,setPayTokenQuotes:c,setLoadingQuotes:u,fetchSingleQuote:D,configAmount:()=>e.config.amount,setExecPhase:t.setExecPhase,setFromToken:t.setFromToken,setError:t.setError,setErrorCode:t.setErrorCode,storeReset:t.reset,storeClearError:t.clearError,onRetry:()=>{h(null);const e=R();e.length>0&&$(e)},onReset:()=>{n(0),h(null);const e=R();e.length>0&&$(e)}});nl({client:m,walletAddress:g,trackingOrderId:z,phase:y,execPhase:t.execPhase,setOrder:t.setOrder,setExecPhase:t.setExecPhase,onOrderFilled:r=>{const n=f();e.callbacks?.onSwapSuccess?.({orderId:r.id,fromToken:n?.symbol??"",toToken:t.targetToken()?.symbol??"",fromAmount:r.srcAmount,toAmount:r.destAmount,txHash:r.depositTxHash})},onOrderFailed:t=>{e.callbacks?.onSwapError?.({code:Ve.ORDER_FAILED,message:"Order "+t.status})}});const Y=r=>{n(r),o(!1);const i=R()[r];i&&(h(i),(async r=>{const n=m(),i=g(),o=t.targetToken();if(!n||!i||!o||"number"!=typeof o.decimals)return;const s=Hi(e.config.amount,o.decimals),a=await D(n,r,s,i,o,t.recipient());if(a){const e=l(),t=[...e],n=e.findIndex(e=>e.token.address.toLowerCase()===r.address.toLowerCase()&&e.token.chainId===r.chainId);n>=0?t[n]=a:t.push(a),c(t)}})(i))},X=async r=>{a(!1),o(!1);const i=m(),s=g(),d=t.targetToken();if(i&&s&&d&&"number"==typeof d.decimals&&r.address&&"number"==typeof r.decimals){u(!0);try{const o=Hi(e.config.amount,d.decimals),a={address:r.address,chainId:r.chainId,name:r.name,symbol:r.symbol,decimals:r.decimals,logoURI:r.logoURI,extensions:null!==r.balance&&"0"!==r.balance?{balance:Hi(r.balance,r.decimals)}:void 0},u=await D(i,a,o,s,d,t.recipient());if(u){const e=l(),t=e.findIndex(e=>e.token.address.toLowerCase()===r.address.toLowerCase()&&e.token.chainId===r.chainId);let i;t>=0?(i=[...e],i[t]=u):i=[...e,u],c(i),h(a);const o=R().findIndex(e=>zc(e,a));o>=0&&n(o)}}catch{}finally{u(!1)}}},J=async()=>{e.walletAdapter?.openAccountModal?await e.walletAdapter.openAccountModal():e.callbacks?.onAccountModal?.()},Z=e=>`${e.slice(0,6)}...${e.slice(-4)}`,ee=()=>t.targetToken()?.symbol??"USDC",te=()=>t.targetAmount()||e.config.amount,re=mt(()=>{const t=e.config.titleText?.trim();return t&&t.length>0?t:"TokenFlight"}),ne=mt(()=>{const t=e.config.titleText?.trim();return!!t&&t.length>0}),ie=mt(()=>{const t=e.config.titleImageUrl?.trim();return t&&t.length>0?t:null});return oe=Oc(),se=oe.firstChild,Tr(oe,Kt(rr,{get when(){return fr(()=>"success"===y())()&&t.order()},get fallback(){return Kt(rr,{get when(){return w()},get fallback(){return[(O=Nc(),R=O.firstChild,P=R.firstChild,Tr(R,Kt(rr,{get when(){return ie()},get fallback(){return Kt(Ai,{size:22})},get children(){var e=Rc();return gt(t=>{var r=ie(),n=re(),i=sl;return r!==t.e&&vr(e,"src",t.e=r),n!==t.t&&vr(e,"alt",t.t=n),i!==t.a&&mr(e,t.a=i),t},{e:void 0,t:void 0,a:void 0}),e}}),P),Tr(P,Kt(rr,{get when(){return ne()},get fallback(){return["Token",(e=qc(),gt(()=>mr(e,ll)),e)];var e},get children(){return re()}})),Tr(O,Kt(rr,{get when(){return fr(()=>!!p())()&&g()},get children(){var e=Pc(),t=e.firstChild,r=t.nextSibling;return br(e,"click",J),Tr(r,()=>Z(g())),gt(n=>{var i=cl,o=Li("swap.account"),s=dl,a=ul;return i!==n.e&&mr(e,n.e=i),o!==n.t&&vr(e,"aria-label",n.t=o),s!==n.a&&mr(t,n.a=s),a!==n.o&&mr(r,n.o=a),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e}}),null),gt(t=>{var r="tf-9b71d6",n=`${il} ${e.config.hideTitle?ol:""}`,i=e.config.hideTitle?"true":void 0,o=al;return r!==t.e&&mr(O,t.e=r),n!==t.t&&mr(R,t.t=n),i!==t.a&&vr(R,"aria-hidden",t.a=i),o!==t.o&&mr(P,t.o=o),t},{e:void 0,t:void 0,a:void 0,o:void 0}),O),(u=_c(),f=u.firstChild,h=f.firstChild,m=f.nextSibling,x=m.firstChild,S=x.nextSibling,E=S.nextSibling,A=E.nextSibling,Tr(h,()=>Li("receive.youReceive")),Tr(f,Kt(rr,{get when(){return p()},get children(){var e,t=Fc(),r=t.firstChild;return br(t,"click",()=>!w()&&!T()&&k(!0)),Tr(r,(e=fr(()=>!!C()),()=>e()?Z(C()):Li("swap.recipientPlaceholder"))),Tr(t,Kt(rr,{get when(){return!T()},get children(){return Kt(xi,{size:10})}}),null),gt(e=>{var n=`${wo} ${C()?"":xo}${T()?" tf-4567e1":""}`,i=T(),o=ko;return n!==e.e&&mr(t,e.e=n),i!==e.t&&(t.disabled=e.t=i),o!==e.a&&mr(r,e.a=o),e},{e:void 0,t:void 0,a:void 0}),t}}),null),Tr(x,Kt(Ri,{get symbol(){return ee()},color:"#0052FF",size:32,get logoURI(){return t.targetToken()?.logoURI}}),null),Tr(x,Kt(rr,{get when(){return t.targetToken()?.chainId},get children(){var e=Ac();return Tr(e,Kt(Pi,{size:12,get iconUrl(){return Ei(b(),t.targetToken().chainId)}})),gt(()=>mr(e,"tf-7a6fbc")),e}}),null),Tr(S,te),Tr(E,ee),Tr(A,()=>Li("swap.fiatValue",{value:te()})),gt(e=>{var t=Cc,r=Sc,n="tf-a27aab",i="tf-f0b3f5",o="tf-e9e9a1",s="tf-f3baad",a="tf-0131e4";return t!==e.e&&mr(u,e.e=t),r!==e.t&&mr(f,e.t=r),n!==e.a&&mr(m,e.a=n),i!==e.o&&mr(x,e.o=i),o!==e.i&&mr(S,e.i=o),s!==e.n&&mr(E,e.n=s),a!==e.s&&mr(A,e.s=a),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),u),(s=Dc(),c=s.firstChild,Tr(c,()=>Li("receive.payWith")),gt(e=>{var t=Cc,r=Sc;return t!==e.e&&mr(s,e.e=t),r!==e.t&&mr(c,e.t=r),e},{e:void 0,t:void 0}),s),Kt(rr,{get when(){return!d()||l().length>0},get fallback(){return[(e=Mc(),t=e.firstChild,r=t.firstChild,n=r.firstChild,i=n.nextSibling,o=i.firstChild,s=o.nextSibling,a=r.nextSibling,l=a.firstChild,c=l.nextSibling,gt(e=>{var d="tf-c3e864",u=Gl,f=`${uo} tf-d7d776`,h="tf-44450a",p=`${uo} ${Hl} tf-2174f1`,g=`${uo} ${Hl} tf-2d3530`,v="tf-2733a9",m=`${uo} ${Hl} tf-54150b`,b=`${uo} ${Hl} tf-7aabe1`;return d!==e.e&&mr(t,e.e=d),u!==e.t&&mr(r,e.t=u),f!==e.a&&mr(n,e.a=f),h!==e.o&&mr(i,e.o=h),p!==e.i&&mr(o,e.i=p),g!==e.n&&mr(s,e.n=g),v!==e.s&&mr(a,e.s=v),m!==e.h&&mr(l,e.h=m),b!==e.r&&mr(c,e.r=b),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),e),Kt(Ao,{})];var e,t,r,n,i,o,s,a,l,c},get children(){return Kt(dc,{get tokens(){return q()},get selectedIndex(){return r()},onSelect:Y,onBrowseAll:()=>a(!0),get apiEndpoint(){return b()},get isConnected(){return p()},get selectorOpen(){return i()},onOpenSelector:()=>o(!0),onCloseSelector:()=>o(!1)})}}),Kt(rr,{get when(){return fr(()=>!(!L()||!j()))()&&t.targetToken()},get fallback(){return Kt(rr,{get when(){return fr(()=>!(d()||!(q().length>0)))()&&!L()},get children(){var e=Lc(),t=e.firstChild,r=t.nextSibling;return Tr(r,()=>Li("receive.noOfferAvailable")),gt(n=>{var i=mo,o=bo,s=yo;return i!==n.e&&mr(e,n.e=i),o!==n.t&&mr(t,n.t=o),s!==n.a&&mr(r,n.a=s),n},{e:void 0,t:void 0,a:void 0}),e}})},get children(){var e=Uc();return Tr(e,Kt(Oo,{get route(){return L()},get fromToken(){return j()},get toToken(){return t.targetToken()},inline:!0,countdownSeconds:_,countdownTotal:30,showCountdown:()=>"quoted"===y()})),gt(()=>mr(e,no)),e}}),(n=$c(),Tr(n,Kt($o,{get phase(){return y()},get isConnected(){return p()},get hasQuote(){return!!L()},onConnect:v,onConfirm:K,onRetry:V,get needsRecipient(){return fr(()=>!!I())()&&!t.recipient()},onEnterRecipient:()=>k(!0),get label(){return fr(()=>!!w())()?void 0:Li("receive.buy",{amount:te(),symbol:ee()})}})),gt(()=>mr(n,"tf-5bb68c")),n)];var n,s,c,u,f,h,m,x,S,E,A,O,R,P},get children(){return Kt(us,{get order(){return t.order()},get fromToken(){return t.fromToken()},get toToken(){return t.targetToken()},get providerName(){return W()},get providerIcon(){return B()},get apiEndpoint(){return e.config.apiEndpoint??ga},get inputAmount(){return H()??""},get outputAmount(){return t.targetAmount()},onNewSwap:G,mode:"receive",get executionError(){return Q()},onRetry:V,get phase(){return y()},get chainMap(){return O()}})}})},get children(){return Kt(ks,{get order(){return t.order()},get fromToken(){return t.fromToken()},get toToken(){return t.targetToken()},onNewSwap:G,get apiEndpoint(){return e.config.apiEndpoint??ga},get providerName(){return W()},mode:"receive",get chainMap(){return O()}})}}),null),Tr(oe,Kt(rr,{get when(){return!e.config.hidePoweredBy},get children(){return Kt(Ni,{})}}),null),Tr(oe,Kt(rr,{get when(){return s()},get children(){var t=Ec();return Tr(t,Kt(ja,{get client(){return m()},get walletAddress(){return g()},selectingFor:"from",onSelect:X,onClose:()=>a(!1),get supportedChainIds(){return e.walletAdapter?.supportedChainIds}})),gt(()=>mr(t,fo)),t}}),null),Tr(oe,Kt(rr,{get when(){return fr(()=>!!x())()&&t.targetToken()},get children(){var e=Ac();return Tr(e,Kt(Ba,{get initialValue(){return t.recipient()??""},get chainType(){return jo(t.targetToken().chainId)},onConfirm:e=>{S(e),k(!1)},onClose:()=>k(!1)})),gt(()=>mr(e,fo)),e}}),null),gt(t=>{var r=`${ho}${e.config.noBackground?` ${po}`:""}${e.config.noBorder?` ${go}`:""}`,n=vo;return r!==t.e&&mr(oe,t.e=r),n!==t.t&&mr(se,t.t=n),t},{e:void 0,t:void 0}),oe;var oe,se}const Bc=".tf-2de115{width:100%;padding:14px 0;border-radius:14px;border:none;background:linear-gradient(135deg,var(--tf-primary),color-mix(in srgb,var(--tf-primary) 80%,#000));color:var(--tf-text-on-primary);font-weight:600;font-size:var(--tf-font-xl);cursor:pointer;box-shadow:0 4px 16px var(--tf-primary-glow);letter-spacing:-.01em;font-family:var(--tf-font-family);transition:transform .15s ease,opacity .15s ease,box-shadow .15s ease}.tf-2de115:hover{opacity:.95;transform:translateY(-1px);box-shadow:0 6px 20px var(--tf-primary-glow)}.tf-2de115:active{transform:translateY(0)}.tf-47dc2a{background:var(--tf-primary);cursor:wait;opacity:.85}.tf-44b8f1{width:100%;padding:14px 0;border-radius:14px;border:1px solid var(--tf-primary);background:var(--tf-primary-light);color:var(--tf-primary);font-weight:600;font-size:var(--tf-font-xl);cursor:pointer;font-family:var(--tf-font-family);transition:transform .15s ease,background .15s ease}.tf-44b8f1:hover{transform:translateY(-1px)}.tf-44b8f1:active{transform:translateY(0)}.tf-04fe16{width:100%;padding:14px 0;border-radius:14px;border:1.5px dashed var(--tf-primary);background:var(--tf-primary-light);color:var(--tf-primary);font-weight:600;font-size:var(--tf-font-xl);cursor:pointer;font-family:var(--tf-font-family);transition:transform .15s ease,background .15s ease;animation:tf-d53743 2s ease-in-out infinite}.tf-04fe16:hover{transform:translateY(-1px);background:var(--tf-primary-glow)}.tf-04fe16:active{transform:translateY(0)}.tf-65cf23{width:100%;padding:14px 0;border-radius:14px;text-align:center;background:var(--tf-success-bg);color:var(--tf-success);font-weight:600;font-size:var(--tf-font-xl);display:flex;align-items:center;justify-content:center;gap:8px;border:none}.tf-2f0314{width:100%;padding:14px 0;border-radius:14px;text-align:center;background:var(--tf-error-bg);color:var(--tf-error);font-weight:600;font-size:var(--tf-font-xl);display:flex;align-items:center;justify-content:center;gap:8px;border:none;cursor:pointer}.tf-20b1ac{display:flex;align-items:center;justify-content:center;gap:8px}.tf-e6dae0{display:inline-block;width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,255,255,.3);border-top-color:var(--tf-text-on-primary, #fff);animation:tf-8a3bc2 .8s linear infinite}.tf-90e712{width:14px;height:14px}",Hc='@keyframes tf-d36961{to{transform:rotate(360deg)}}.tf-5835df{width:100%;min-width:0;padding:24px 20px 16px;animation:tf-e061c9 .3s ease both;overflow:hidden;box-sizing:border-box}.tf-9322ae{display:flex;align-items:center;justify-content:center;gap:12px;padding-bottom:20px;margin-bottom:4px;border-bottom:1px solid var(--tf-border-light)}.tf-7d5519{display:flex;align-items:center;justify-content:flex-start;min-width:0;flex:1}.tf-0b8d30{justify-content:flex-end}.tf-bfbd0b{display:flex;align-items:center;gap:8px;min-width:0}.tf-7e8fdf{position:relative;width:32px;height:32px;flex-shrink:0}.tf-37f3cf{position:absolute;bottom:-2px;right:-2px;width:16px;height:16px;border-radius:50%;background:var(--tf-bg);display:flex;align-items:center;justify-content:center;border:1.5px solid var(--tf-bg)}.tf-9401fd{display:flex;flex-direction:column;min-width:0;overflow:hidden}.tf-832fae{font-family:var(--tf-font-family-mono);font-weight:600;font-size:var(--tf-font-lg);color:var(--tf-text);white-space:nowrap;line-height:1.2}.tf-b557fc{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-weight:500;line-height:1.2}.tf-5953e8{color:var(--tf-text-tertiary);flex-shrink:0}.tf-a168c7{display:flex;align-items:center;justify-content:center;gap:6px;text-align:center;font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);padding-bottom:16px}.tf-062404{width:16px;height:16px;border-radius:4px;object-fit:contain}.tf-26af4c{display:flex;flex-direction:column}.tf-4b9be7{display:flex;gap:12px}.tf-036db2{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:var(--tf-font-base);font-weight:600;z-index:1}.tf-09b7bb{background:var(--tf-success-bg);color:var(--tf-success)}.tf-aef7e0{background:var(--tf-primary-light)}.tf-5c628c{background:var(--tf-input-bg);color:var(--tf-text-tertiary);border:1px solid var(--tf-border-light)}.tf-a5abdf{background:var(--tf-error-bg);color:var(--tf-error)}.tf-9efe7c{width:14px;height:14px;border-radius:50%;border:2px solid var(--tf-primary-light);border-top-color:var(--tf-primary);animation:tf-d36961 .8s linear infinite}.tf-5c7806{border-color:#ff475733;border-top-color:var(--tf-error)}.tf-185719{flex:1;min-width:0;padding-bottom:20px;position:relative}.tf-185719:before{content:"";position:absolute;left:-26px;top:28px;bottom:0;width:2px;background:var(--tf-border-light)}.tf-4b9be7:last-child .tf-185719:before{display:none}.tf-4b9be7:last-child .tf-185719{padding-bottom:4px}.tf-84527b .tf-185719:before{background:var(--tf-success)}.tf-417d35 .tf-185719:before{background:var(--tf-error)}.tf-aad7e9{font-size:var(--tf-font-md);font-weight:600;color:var(--tf-text);line-height:28px}.tf-8de1c6 .tf-aad7e9{color:var(--tf-text-tertiary)}.tf-417d35 .tf-aad7e9{color:var(--tf-error)}.tf-bcb46a{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);margin-top:2px;display:flex;align-items:center;gap:6px;flex-wrap:wrap;word-break:break-word;overflow-wrap:break-word}.tf-16cfdc .tf-bcb46a{color:var(--tf-primary)}.tf-0aa291{font-size:var(--tf-font-sm);color:var(--tf-primary);text-decoration:none;display:inline-flex;align-items:center;gap:3px;transition:opacity .15s}.tf-0aa291:hover{opacity:.7}.tf-234e31{margin-top:20px;padding:16px;border-radius:12px;background:var(--tf-error-alpha, rgba(239, 68, 68, .06));border:1px solid var(--tf-error-bg);text-align:center}.tf-adb588{font-size:var(--tf-font-md);color:var(--tf-text-secondary);line-height:1.5;margin-bottom:12px}.tf-11fa21{display:inline-flex;align-items:center;gap:4px;font-size:var(--tf-font-base);color:var(--tf-primary);text-decoration:none;margin-bottom:12px;transition:opacity .15s}.tf-11fa21:hover{opacity:.7}.tf-4f7573{width:100%;padding:12px;border-radius:12px;background:linear-gradient(135deg,var(--tf-success),color-mix(in srgb,var(--tf-success) 80%,#000));color:var(--tf-text-on-primary);font-size:var(--tf-font-lg);font-weight:600;cursor:pointer;border:none;transition:opacity .2s,transform .15s}.tf-4f7573:hover{opacity:.9;transform:translateY(-1px)}.tf-4f7573:active{transform:scale(.98)}.tf-c918a2{margin-top:16px;text-align:center}.tf-ad7aab{visibility:hidden;pointer-events:none}.tf-1e22cb{width:100%;padding:12px;border-radius:12px;background:var(--tf-bg-secondary);color:var(--tf-text);font-size:var(--tf-font-lg);font-weight:600;cursor:pointer;border:1px solid var(--tf-border);transition:opacity .2s,transform .15s}.tf-1e22cb:hover{opacity:.85;transform:translateY(-1px)}.tf-1e22cb:active{transform:scale(.98)}',Qc=".tf-216412{display:inline-flex;align-items:center;gap:4px}.tf-52dc68{flex-shrink:0}.tf-fd32be{font-size:var(--tf-font-sm);color:var(--tf-text-secondary);min-width:20px}",Kc=".tf-1019c2{margin:12px 20px 0;padding:14px;background:var(--tf-primary-light);border-radius:10px;font-size:var(--tf-font-base);color:var(--tf-text-secondary);animation:tf-42889f .25s ease both}.tf-4922f1{display:flex;justify-content:space-between;align-items:center;min-height:16px;margin-bottom:4px}.tf-4922f1:last-child{margin-bottom:0}.tf-57f45f{font-family:var(--tf-font-family-mono);font-size:var(--tf-font-sm)}.tf-a57ec8{display:block;height:118px;box-sizing:border-box}.tf-d74ccc{display:flex;justify-content:space-between;align-items:center;height:22px}.tf-92e7a8{width:68px;height:14px}.tf-d20f50{width:56px}.tf-a9a96f{width:150px;height:14px}.tf-0134eb{width:126px}.tf-91635c{width:80px}.tf-ca1291{cursor:pointer;border-bottom:1px solid var(--tf-border-light);margin-bottom:10px;transition:opacity .15s}.tf-ca1291:hover{opacity:.7}.tf-ca1291 .tf-57f45f{display:inline-flex;align-items:center;gap:4px}.tf-ca1291 .tf-57f45f svg{opacity:.35;flex-shrink:0;transition:opacity .15s}.tf-ca1291:hover .tf-57f45f svg{opacity:.7}.tf-a249b3 .tf-recipient-placeholder{color:var(--tf-error)}.tf-adeddd{border:1px dashed var(--tf-primary);border-radius:var(--tf-radius, 10px);padding:8px 12px;margin-bottom:10px;animation:tf-d990e5 2s ease-in-out infinite}.tf-adeddd .tf-recipient-placeholder{color:var(--tf-primary);font-style:normal}",Vc=".tf-636daf{width:100%;height:100%;background:var(--tf-bg);display:flex;flex-direction:column;border-radius:20px;overflow:hidden}.tf-fddfab{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--tf-border-light)}.tf-970eb9{font-size:var(--tf-font-2xl);font-weight:600;color:var(--tf-text)}.tf-de123a{background:none;border:none;padding:4px;cursor:pointer;color:var(--tf-text-secondary);display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background .15s}.tf-de123a:hover{background:var(--tf-bg-elevated)}.tf-0445e3{flex:1;padding:20px;display:flex;flex-direction:column;gap:8px}.tf-9a65ec{width:100%;min-height:80px;background:var(--tf-input-bg);border:1px solid var(--tf-border-light);border-radius:12px;padding:12px 14px;font-size:var(--tf-font-lg);font-family:var(--tf-font-family-mono);color:var(--tf-text);outline:none;resize:none;transition:border-color .2s,box-shadow .2s;box-sizing:border-box}.tf-9a65ec::placeholder{color:var(--tf-text-tertiary)}.tf-9a65ec:focus{border-color:var(--tf-primary);box-shadow:0 0 0 3px var(--tf-primary-alpha)}.tf-c5ea21{border-color:var(--tf-error)}.tf-c5ea21:focus{border-color:var(--tf-error);box-shadow:0 0 0 3px var(--tf-error-alpha)}.tf-9d4bba{font-size:var(--tf-font-base);color:var(--tf-error);padding:0 2px}.tf-cb9b60{padding:16px 20px 20px}.tf-2cba65{width:100%}.tf-2cba65:disabled{opacity:.5;cursor:not-allowed}",Gc=".tf-ba406b{display:inline-flex;align-items:baseline}.tf-9d81a4{font-size:.7em;line-height:1;opacity:.85}.tf-7977ef{cursor:help}",Yc="@keyframes tf-07c947{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.tf-dc5721{padding:18px 20px 0;display:flex;justify-content:space-between;align-items:center}.tf-68123c{display:flex;align-items:center;gap:7px}.tf-43dda9{visibility:hidden}.tf-532d07{width:22px;height:22px;object-fit:contain;flex-shrink:0}.tf-b7936a{font-size:var(--tf-font-xl);font-weight:600;letter-spacing:-.01em}.tf-883305{color:var(--tf-primary)}.tf-6da3db{display:flex;gap:6px;align-items:center;cursor:pointer;background:none;border:none;padding:4px 8px;border-radius:8px;font-family:inherit;transition:background .15s ease}.tf-6da3db:hover{background:var(--tf-surface-hover)}.tf-6da3db:focus-visible{outline:2px solid var(--tf-primary);outline-offset:2px}.tf-d25568{width:8px;height:8px;border-radius:50%;background:var(--tf-primary);box-shadow:0 0 8px var(--tf-primary-glow)}.tf-16ce7d{background:var(--tf-success);box-shadow:0 0 8px var(--tf-success)}.tf-11bb1d{font-size:var(--tf-font-base);color:var(--tf-text-secondary);font-family:var(--tf-font-family-mono)}.tf-98d625{padding:14px 20px 0;animation:tf-07c947 .3s ease both}.tf-8b7743{padding:0 20px;animation:tf-07c947 .35s ease both}.tf-677ece{background:var(--tf-input-bg);border-radius:14px;padding:14px 16px;border:1px solid var(--tf-border-light);transition:border-color .2s,background .25s ease,box-shadow .2s ease}.tf-635915{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.tf-b8a04a{display:inline-flex;align-items:center;gap:8px}.tf-0d1ef8{font-size:var(--tf-font-base);color:var(--tf-text-tertiary);font-weight:500;text-align:left}.tf-d04a4e{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-d7140f{display:flex;justify-content:space-between;align-items:center}.tf-dcd620{display:flex;align-items:center;gap:8px;background:var(--tf-surface);border-radius:10px;padding:6px 12px 6px 8px;height:36px;box-sizing:border-box;border:1px solid var(--tf-border);cursor:pointer;flex-shrink:0;font-family:var(--tf-font-family);transition:background .15s ease,border-color .15s ease,transform .1s ease}.tf-dcd620:hover{background:var(--tf-surface-hover);transform:scale(1.02)}.tf-e25a5c{padding:0 12px}.tf-038cf1{font-size:var(--tf-font-lg);font-weight:600;color:var(--tf-text)}.tf-33c9cb{font-size:var(--tf-font-md);font-weight:600;color:var(--tf-primary)}.tf-b1e4a6{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary)}.tf-d168ae{display:flex;justify-content:space-between;align-items:center;margin-top:6px;min-height:16px;font-size:var(--tf-font-base);line-height:100%}.tf-b2b098{margin-top:6px;min-height:16px;display:flex;align-items:center}.tf-92acfd{display:inline-block;min-height:16px;font-size:var(--tf-font-base);line-height:100%;color:var(--tf-text-tertiary)}.tf-bd2f5c{visibility:hidden}.tf-5f8805{font-size:var(--tf-font-sm);font-weight:600;color:var(--tf-primary);background:var(--tf-primary-light);border:none;padding:2px 8px;border-radius:6px;cursor:pointer;font-family:var(--tf-font-family)}.tf-5f8805:hover{opacity:.8}.tf-af41ab{display:flex;justify-content:center;margin:-6px 0;position:relative;z-index:2}.tf-18c3f4{width:36px;height:36px;padding:0;appearance:none;-webkit-appearance:none;border-radius:10px;background:var(--tf-surface);border:3px solid var(--tf-bg);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 8px #0000000f;font-size:var(--tf-font-lg);color:var(--tf-text-secondary);transition:transform .2s ease,background .15s ease,color .15s ease}.tf-18c3f4:hover{transform:scale(1.1);color:var(--tf-primary)}.tf-18c3f4:active{transform:scale(.95) rotate(180deg)}.tf-a04b23{position:relative;flex-shrink:0}.tf-57762e{position:absolute;bottom:-2px;right:-2px}",Xc=".tf-140273{width:100%;max-width:400px;border-radius:20px;overflow:hidden;background:var(--tf-bg);border:1px solid var(--tf-border);box-shadow:var(--tf-shadow-lg);font-family:var(--tf-font-family);color:var(--tf-text);height:100%;display:flex;flex-direction:column}.tf-45030f{padding:18px 20px 14px;flex-shrink:0}.tf-ce0622{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.tf-0c1692{font-size:var(--tf-font-xl);font-weight:600}.tf-64aa3f{width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--tf-text-tertiary);font-size:var(--tf-font-2xl);font-weight:300;background:var(--tf-input-bg);border:none;font-family:var(--tf-font-family)}.tf-9819ca{display:flex;align-items:center;gap:10px;background:var(--tf-input-bg);border-radius:12px;padding:10px 14px;border:1px solid var(--tf-border-light);transition:border-color .15s}.tf-9819ca.tf-d9fcd6{border-color:var(--tf-primary)}.tf-4ad0e7{color:var(--tf-text-tertiary);font-size:var(--tf-font-lg);flex-shrink:0}.tf-9ea859{flex:1;border:none;background:none;outline:none;font-size:var(--tf-font-lg);color:var(--tf-text);font-family:var(--tf-font-family)}.tf-9ea859::placeholder{color:var(--tf-text-tertiary)}.tf-25e112{display:flex;gap:4px;margin-top:12px;overflow-x:auto;padding-bottom:2px}.tf-478cb9{display:flex;align-items:center;gap:5px;padding:4px 10px;border-radius:8px;border:none;font-size:var(--tf-font-sm);font-weight:500;cursor:pointer;white-space:nowrap;font-family:var(--tf-font-family);background:var(--tf-input-bg);color:var(--tf-text-secondary)}.tf-478cb9.tf-125be5{background:var(--tf-primary-light);color:var(--tf-primary);outline:1px solid var(--tf-primary);outline-offset:-1px}.tf-bb4fb1{height:24px;border-radius:8px;flex-shrink:0}.tf-ad5703{height:1px;background:var(--tf-border);margin:0 20px;flex-shrink:0}.tf-de9986{flex:1;min-height:0;overflow-y:auto;padding:6px 8px}.tf-7ac0fe{display:flex;flex-direction:column}.tf-c6ef08{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px}.tf-3643cf{display:flex;align-items:center;gap:12px}.tf-9b3d59{width:36px;height:36px;border-radius:50%}.tf-a4cc17{display:flex;flex-direction:column;gap:6px}.tf-7f1baf{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.tf-9171a2{height:10px}.tf-9171a2.tf-71ea5d{width:88px}.tf-9171a2.tf-dfb33a{width:64px}.tf-9171a2.tf-43fbf4{width:56px}.tf-9171a2.tf-61ca3c{width:44px}.tf-512365{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px;cursor:pointer;background:transparent;transition:background .1s;border:none;width:100%;font-family:var(--tf-font-family)}.tf-512365:hover{background:var(--tf-surface-hover)}.tf-512365.tf-9f601f{background:var(--tf-primary-light)}.tf-a0b0d9{display:flex;align-items:center;gap:12px}.tf-1e7a62{position:relative}.tf-67f18a{position:absolute;bottom:-1px;right:-1px;width:13px;height:13px;border-radius:50%;background:var(--tf-surface);border:1px solid var(--tf-border);display:flex;align-items:center;justify-content:center}.tf-cd76b9{text-align:left;display:flex;flex-direction:column;align-items:flex-start}.tf-8f4efd{font-size:var(--tf-font-lg);font-weight:600;color:var(--tf-text)}.tf-51bf2b{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary)}.tf-87740a{text-align:right}.tf-43fbf4{color:var(--tf-text);font-size:var(--tf-font-md);font-weight:500;font-family:var(--tf-font-family-mono)}.tf-43fbf4.tf-2ee375{color:var(--tf-text-tertiary)}.tf-61ca3c{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}",Jc="@keyframes tf-72a7b4{0%{transform:scale(.3);opacity:0}50%{transform:scale(1.05)}70%{transform:scale(.95)}to{transform:scale(1);opacity:1}}@keyframes tf-7ca8ca{0%{transform:translateY(0) rotate(0)}to{transform:translateY(-4px) rotate(8deg)}}@keyframes tf-2b6de5{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes tf-5b8ef8{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}.tf-e98a9a{width:100%;min-width:0;padding:28px 20px 24px;display:flex;flex-direction:column;align-items:center;animation:tf-2b6de5 .35s ease both;box-sizing:border-box}.tf-1f9019{width:64px;height:64px;border-radius:50%;background:linear-gradient(135deg,var(--tf-success),#00E6A0);display:flex;align-items:center;justify-content:center;margin-bottom:16px;animation:tf-72a7b4 .6s ease both;box-shadow:0 8px 32px #00c48c40;color:var(--tf-text-on-primary)}.tf-73631f{animation:tf-7ca8ca 2s ease-in-out infinite alternate;display:flex}.tf-9e3a66{font-size:var(--tf-font-heading);font-weight:700;color:var(--tf-text);margin-bottom:4px;letter-spacing:-.01em}.tf-db06d4{font-size:var(--tf-font-md);color:var(--tf-text-secondary);margin-bottom:20px}.tf-c9a5e1{width:100%;padding:20px;border-radius:16px;background:linear-gradient(135deg,#00c48c14,#00e6a00a);border:1px solid rgba(0,196,140,.15);display:flex;flex-direction:column;align-items:center;gap:6px;margin-bottom:16px;animation:tf-2b6de5 .4s ease .2s both}.tf-7b3b5b{position:relative;width:40px;height:40px;margin-bottom:4px}.tf-651299{position:absolute;bottom:-2px;right:-2px;width:16px;height:16px;border-radius:50%;background:var(--tf-bg);display:flex;align-items:center;justify-content:center;border:1.5px solid rgba(0,196,140,.15)}.tf-f52291{font-size:var(--tf-font-amount-lg);font-weight:700;color:var(--tf-text);font-family:var(--tf-font-family-mono);letter-spacing:-.02em;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;justify-content:center}.tf-8cfc86{font-size:var(--tf-font-lg);font-weight:500;color:var(--tf-text-secondary)}.tf-5f768d{font-size:var(--tf-font-sm);font-weight:500;font-family:var(--tf-font-family);color:var(--tf-text-tertiary);letter-spacing:0}.tf-75f592{width:100%;margin-bottom:16px}.tf-73910d{width:100%;display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--tf-input-bg);border:1px solid var(--tf-border-light);border-radius:10px;cursor:pointer;font-size:var(--tf-font-base);font-weight:500;color:var(--tf-text-secondary);font-family:var(--tf-font-family);transition:background .15s}.tf-73910d:hover{background:var(--tf-bg-secondary)}.tf-ae94a0{border-radius:10px 10px 0 0}.tf-1afb0a{transition:transform .2s ease;color:var(--tf-text-tertiary)}.tf-7737cf{transform:rotate(180deg)}.tf-92a530{padding:8px 14px 12px;border:1px solid var(--tf-border-light);border-top:none;border-radius:0 0 10px 10px;background:var(--tf-input-bg);animation:tf-5b8ef8 .15s ease both}.tf-6e8c3e{display:flex;justify-content:space-between;align-items:center;font-size:var(--tf-font-sm);padding:5px 0}.tf-4b5396{color:var(--tf-text-tertiary);font-weight:500}.tf-63cca1{color:var(--tf-text-secondary);font-family:var(--tf-font-family-mono);font-size:var(--tf-font-sm);display:flex;align-items:center;gap:4px}.tf-18c122{color:var(--tf-primary);text-decoration:none;font-size:var(--tf-font-sm);font-family:var(--tf-font-family-mono);display:inline-flex;align-items:center;gap:3px;transition:opacity .15s}.tf-18c122:hover{opacity:.7}.tf-d7e813{width:100%;padding:14px 0;border-radius:14px;border:none;background:var(--tf-primary);color:var(--tf-text-on-primary);font-weight:600;font-size:var(--tf-font-xl);cursor:pointer;font-family:var(--tf-font-family);box-shadow:0 4px 16px color-mix(in srgb,var(--tf-primary) 25%,transparent);transition:transform .15s ease,opacity .15s ease}.tf-d7e813:hover{opacity:.95;transform:translateY(-1px)}.tf-d7e813:active{transform:translateY(0)}",Zc=".tf-c63ac0{border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--tf-text-on-primary);font-weight:700;font-family:var(--tf-font-family);flex-shrink:0;overflow:hidden}.tf-59aca7{width:100%;height:100%;object-fit:cover;border-radius:50%}.tf-dbfbb3{border-radius:50%;flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center}.tf-f89395{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}.tf-cdfe94{display:flex;align-items:center;justify-content:center;gap:6px;padding:12px 0 14px;border-top:1px solid var(--tf-border-light);margin:8px 20px 0;text-decoration:none}.tf-7c0c36{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary)}.tf-26d5ea{font-size:var(--tf-font-base);line-height:1}.tf-8b1e15{font-size:var(--tf-font-sm);font-weight:600;letter-spacing:.02em;color:var(--tf-text-secondary)}.tf-3852e5,.tf-b35860{color:var(--tf-primary)}",ed='@keyframes tf-80a677{to{transform:rotate(360deg)}}@keyframes tf-d97ff2{0%,to{opacity:1}50%{opacity:.4}}@keyframes tf-c3558b{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes tf-89a83e{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(6px)}}@keyframes tf-ca9155{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes tf-d2dbc4{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@keyframes tf-54b7e7{0%,to{border-color:var(--tf-primary)}50%{border-color:var(--tf-primary-light)}}@keyframes tf-194f18{to{transform:rotate(360deg)}}@keyframes tf-cdef4a{0%{transform:scale(.3);opacity:0}50%{transform:scale(1.05)}70%{transform:scale(.95)}to{transform:scale(1);opacity:1}}@keyframes tf-fd8795{0%{transform:translateY(0) rotate(0)}to{transform:translateY(-4px) rotate(8deg)}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{display:block;color:var(--tf-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--tf-font-family: "DM Sans", sans-serif;--tf-font-family-mono: "JetBrains Mono", monospace;font-family:var(--tf-font-family);--tf-font-2xs: 10px;--tf-font-xs: 11px;--tf-font-sm: 12px;--tf-font-base: 13px;--tf-font-md: 14px;--tf-font-lg: 15px;--tf-font-xl: 16px;--tf-font-2xl: 17px;--tf-font-heading: 20px;--tf-font-amount: 28px;--tf-font-amount-lg: 24px;--tf-font-amount-sm: 22px}button:focus-visible,a:focus-visible{outline:2px solid var(--tf-primary);outline-offset:2px;border-radius:4px}',td=".tf-1ac2ef{border-radius:6px;background:var(--tf-skeleton);animation:tf-90e981 1.5s infinite}.tf-68a980{position:absolute;inset:0;border-radius:20px;display:flex;align-items:flex-start;z-index:10;overflow:hidden;animation:tf-552c66 .2s ease both}.tf-e7b9c7{width:100%;max-width:400px;min-width:360px;border-radius:20px;overflow:hidden;background:var(--tf-bg);border:1px solid var(--tf-border);box-shadow:var(--tf-shadow-lg);font-family:var(--tf-font-family);color:var(--tf-text);position:relative;transition:background .25s ease,border-color .25s ease,box-shadow .25s ease}.tf-b4f391{background:transparent}.tf-118b57{border:none;box-shadow:none}.tf-118b57 .tf-07225e{display:none}.tf-07225e{height:2px;background:linear-gradient(90deg,transparent,var(--tf-primary),transparent);opacity:.6}.tf-d01dff{padding:16px 20px 20px;animation:tf-ed0355 .3s ease .1s both}.tf-5bb68c{padding:12px 20px 0}.tf-04e1e2{margin:12px 20px 0;padding:14px;background:var(--tf-primary-light);border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;height:131px;box-sizing:border-box;animation:tf-b61e63 .25s ease both}.tf-d01908{color:var(--tf-text-tertiary);opacity:.4}.tf-1cc72b{font-size:var(--tf-font-base);color:var(--tf-text-secondary)}.tf-480f1a{padding:0 20px 16px;text-align:center}.tf-480f1a a{font-size:var(--tf-font-base);color:var(--tf-primary);text-decoration:none;font-family:var(--tf-font-family-mono)}.tf-bc7950{text-align:center;margin-top:8px;margin-bottom:10px}.tf-bc7950 a{font-size:var(--tf-font-sm);color:var(--tf-primary);text-decoration:none;font-family:var(--tf-font-family-mono)}.tf-d9b7b4{display:inline-flex;align-items:center;gap:4px;background:var(--tf-surface);border:1px solid var(--tf-border);border-radius:6px;padding:2px 8px;cursor:pointer;font-size:var(--tf-font-sm);font-family:var(--tf-font-family-mono);color:var(--tf-text-secondary);transition:background .15s,border-color .15s}.tf-d9b7b4:hover{background:var(--tf-surface-hover)}.tf-d9b7b4 svg{opacity:.4;transition:opacity .15s}.tf-d9b7b4:hover svg{opacity:.7}.tf-9398ea{border-style:dashed;border-color:var(--tf-primary)}.tf-9398ea .tf-2d9323{color:var(--tf-primary);font-style:italic;font-family:var(--tf-font-family)}.tf-4567e1{cursor:default;opacity:.8}.tf-4567e1:hover{background:var(--tf-surface)}.tf-58881e{color:var(--tf-text-tertiary);font-style:italic}",rd=[Bc,".tf-59b76a{font-size:var(--tf-font-amount);font-weight:700;line-height:100%;letter-spacing:-.02em;color:var(--tf-text);font-family:var(--tf-font-family);background:none;border:none;outline:none;width:100%;min-width:0;text-align:left}.tf-59b76a::-webkit-outer-spin-button,.tf-59b76a::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.tf-59b76a{-moz-appearance:textfield}.tf-59b76a::placeholder{color:var(--tf-text-tertiary)}.tf-a859d8{color:var(--tf-text-tertiary)}",Hc,Qc,Kc,Vc,Gc,Yc,Xc,Jc,Zc,ed,td].join("\n"),nd=[Bc,Hc,"@keyframes tf-540423{to{transform:rotate(360deg)}}.tf-d61a98{padding:0 20px}.tf-4574e9{height:162px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--tf-border) transparent}.tf-4574e9::-webkit-scrollbar{width:4px}.tf-4574e9::-webkit-scrollbar-track{background:transparent}.tf-4574e9::-webkit-scrollbar-thumb{background:var(--tf-border);border-radius:2px}.tf-2f8db2{display:flex;align-items:center;justify-content:space-between;padding:9px 11px;border-radius:11px;margin-bottom:4px;cursor:pointer;border:1px solid var(--tf-border-light);background:transparent;width:100%;font-family:var(--tf-font-family);transition:background .15s ease,border-color .15s ease}.tf-aaf1d0{border-color:var(--tf-primary);outline:.5px solid var(--tf-primary);outline-offset:-1px;background:var(--tf-primary-light)}.tf-328e9e{opacity:.4;cursor:not-allowed}.tf-af2c71{cursor:default;pointer-events:none}.tf-d7d776{width:32px;height:32px;border-radius:50%}.tf-c3e864{display:flex;align-items:center;padding:11px 14px;border-radius:12px;border:1px solid var(--tf-border-light);background:var(--tf-input-bg);cursor:default;pointer-events:none}.tf-44450a{display:flex;flex-direction:column;gap:6px}.tf-6c1e97{height:10px}.tf-2174f1{width:52px}.tf-2d3530{width:40px}.tf-2733a9{display:flex;flex-direction:column;align-items:flex-end;gap:6px;margin-left:auto}.tf-54150b{width:60px}.tf-7aabe1{width:44px}.tf-c41b7c{display:flex;align-items:center;gap:9px}.tf-142024{position:relative}.tf-3b42da{position:absolute;bottom:-1px;right:-1px;width:11px;height:11px;border-radius:50%;background:var(--tf-surface);border:1px solid var(--tf-border);display:flex;align-items:center;justify-content:center}.tf-b7faa4{text-align:left}.tf-1ae7a3{display:flex;align-items:center;gap:5px}.tf-b949b8{font-size:var(--tf-font-base);font-weight:600;color:var(--tf-text)}.tf-2f811b{font-size:var(--tf-font-2xs);font-weight:700;padding:1px 4px;border-radius:3px;background:var(--tf-success-bg);color:var(--tf-success);letter-spacing:.03em}.tf-6542b9{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary)}.tf-e613ff{text-align:right}.tf-630df3{font-size:var(--tf-font-base);font-weight:600;font-family:var(--tf-font-family-mono);color:var(--tf-text)}.tf-0be2ff{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-dad192{font-size:var(--tf-font-base);font-weight:600;font-family:var(--tf-font-family-mono);color:var(--tf-text)}.tf-840c29{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-09818b{display:flex;align-items:center;padding:10px 14px;border-radius:12px;border:1px solid var(--tf-border-light);background:var(--tf-input-bg);cursor:pointer;width:100%;font-family:var(--tf-font-family);transition:background .15s ease,border-color .15s ease}.tf-09818b:hover{border-color:var(--tf-primary);background:var(--tf-primary-light)}.tf-c7ba0f{display:flex;align-items:center;gap:9px}.tf-dea0cb{text-align:left}.tf-41931a{display:flex;align-items:center;gap:5px}.tf-3d2f5a{margin-left:auto;text-align:right;margin-right:8px}.tf-9a379d{font-size:var(--tf-font-lg);font-weight:500;font-family:var(--tf-font-family-mono);color:var(--tf-text);letter-spacing:-.02em}.tf-c11354{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-864468{color:var(--tf-text-tertiary);display:flex;align-items:center;flex-shrink:0;transition:transform .2s ease}.tf-8299cf{flex:1;overflow-y:auto;padding:0 8px 8px;scrollbar-width:thin;scrollbar-color:var(--tf-border) transparent}.tf-176d77{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px;cursor:pointer;background:transparent;transition:background .1s;border:none;width:100%;font-family:var(--tf-font-family);color:var(--tf-text)}.tf-176d77:hover{background:var(--tf-surface-hover)}.tf-2df5d9{background:var(--tf-primary-light)}.tf-dc503e{opacity:.4;cursor:not-allowed}.tf-ebbc44{display:flex;align-items:center;gap:12px}.tf-5f455f{text-align:left}.tf-15ee78{display:flex;align-items:center;gap:6px}.tf-976d83{font-size:var(--tf-font-lg);font-weight:600;color:var(--tf-text)}.tf-ba2eec{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary)}.tf-a37921{text-align:right}.tf-cf71b6{font-size:var(--tf-font-md);font-weight:600;font-family:var(--tf-font-family-mono);color:var(--tf-text)}.tf-7474a9{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-772a9c{flex-shrink:0;padding:4px 8px 12px;border-top:1px solid var(--tf-border-light)}.tf-5fb6ad{display:flex;flex-direction:column;align-items:center;justify-content:center;height:197px;gap:8px;padding:16px 20px}.tf-86e8e0{flex-direction:row;gap:10px}.tf-66007c{color:var(--tf-text-tertiary);opacity:.5}.tf-73bbbc{width:24px;height:24px;display:flex;align-items:center;justify-content:center;opacity:.6;color:var(--tf-primary);animation:tf-540423 1s linear infinite}.tf-12c6bb{font-size:var(--tf-font-md);font-weight:600;color:var(--tf-text-secondary)}.tf-7a8fe0{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);text-align:center;line-height:1.4}.tf-22f94f{display:flex;align-items:center;justify-content:center;gap:4px;padding:4px 0 2px;font-size:var(--tf-font-sm);color:var(--tf-primary);cursor:pointer;font-weight:500;background:none;border:none;width:100%;font-family:var(--tf-font-family)}",Qc,Kc,".tf-9b71d6{padding:16px 20px 12px;display:flex;justify-content:space-between;align-items:center;gap:7px}.tf-4c9136{padding:0 20px 10px}.tf-febe61{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-weight:500;margin-bottom:6px;text-align:left}.tf-a27aab{display:flex;align-items:center;gap:10px;padding:8px 14px;background:var(--tf-input-bg);border-radius:12px;border:1px solid var(--tf-border-light)}.tf-f0b3f5{position:relative;flex-shrink:0}.tf-7a6fbc{position:absolute;bottom:-1px;right:-1px;width:12px;height:12px}.tf-e9e9a1{font-size:var(--tf-font-amount-sm);font-weight:700;letter-spacing:-.02em}.tf-f3baad{font-size:var(--tf-font-lg);font-weight:500;color:var(--tf-text-secondary)}.tf-0131e4{margin-left:auto;font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}",Vc,Gc,Yc,Xc,Jc,Zc,ed,td].join("\n"),id={"--tf-bg":"#ffffff","--tf-bg-secondary":"#f8f9fb","--tf-bg-elevated":"#ffffff","--tf-surface":"#ffffff","--tf-surface-hover":"#f3f4f8","--tf-text":"#0f1419","--tf-text-secondary":"#5e6673","--tf-text-tertiary":"#9ba3af","--tf-text-on-primary":"#ffffff","--tf-border":"#e8eaef","--tf-border-light":"#f0f1f5","--tf-primary":"#6C5CE7","--tf-primary-alpha":"rgba(108,92,231,0.12)","--tf-primary-light":"rgba(108,92,231,0.1)","--tf-primary-glow":"rgba(108,92,231,0.15)","--tf-success":"#00C48C","--tf-success-bg":"rgba(0,196,140,0.08)","--tf-error":"#FF4757","--tf-error-bg":"rgba(255,71,87,0.08)","--tf-error-alpha":"rgba(255,71,87,0.06)","--tf-warning":"#FFAA00","--tf-warning-bg":"rgba(255,170,0,0.08)","--tf-shadow":"0 2px 16px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.1)","--tf-shadow-lg":"0 8px 40px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.1)","--tf-input-bg":"#f5f6f8","--tf-glass":"rgba(255,255,255,0.7)","--tf-skeleton":"#e8eaef","--tf-radius-sm":"8px","--tf-radius":"12px","--tf-radius-lg":"16px","--tf-radius-xl":"20px","--tf-accent":"var(--tf-primary)","--tf-accent-light":"var(--tf-primary-light)","--tf-accent-glow":"var(--tf-primary-glow)"},od={"--tf-bg":"#0d0f14","--tf-bg-secondary":"#141720","--tf-bg-elevated":"#1e2230","--tf-surface":"#181b25","--tf-surface-hover":"#1e2230","--tf-text":"#eef0f6","--tf-text-secondary":"#8b93a5","--tf-text-tertiary":"#555d6e","--tf-text-on-primary":"#ffffff","--tf-border":"#252a38","--tf-border-light":"#1e2230","--tf-primary":"#8B7CF6","--tf-primary-alpha":"rgba(139,124,246,0.15)","--tf-primary-light":"rgba(139,124,246,0.1)","--tf-primary-glow":"rgba(139,124,246,0.2)","--tf-success":"#34D399","--tf-success-bg":"rgba(52,211,153,0.1)","--tf-error":"#F87171","--tf-error-bg":"rgba(248,113,113,0.1)","--tf-error-alpha":"rgba(248,113,113,0.06)","--tf-warning":"#FBBF24","--tf-warning-bg":"rgba(251,191,36,0.1)","--tf-shadow":"0 2px 16px rgba(0,0,0,0.3), 0 0 1px rgba(0,0,0,0.5)","--tf-shadow-lg":"0 8px 40px rgba(0,0,0,0.4), 0 0 1px rgba(0,0,0,0.5)","--tf-input-bg":"#141720","--tf-glass":"rgba(13,15,20,0.7)","--tf-skeleton":"#252a38","--tf-radius-sm":"8px","--tf-radius":"12px","--tf-radius-lg":"16px","--tf-radius-xl":"20px","--tf-accent":"var(--tf-primary)","--tf-accent-light":"var(--tf-primary-light)","--tf-accent-glow":"var(--tf-primary-glow)"};function sd(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join("\n ")}function ad(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>e(t.matches?od:id);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)}function ld(e,t){for(const[r,n]of Object.entries(t))void 0!==n&&e.style.setProperty(r,n)}function cd(e){if("string"==typeof e){const t=document.querySelector(e);if(!t)throw new Ye(Ve.ELEMENT_NOT_FOUND,`Element not found: ${e}`);return t}return e}function dd(e){if(e)try{return JSON.parse(e)}catch(t){return e}}function ud(e,t,r,n){if(null==r||!1===r)return e.removeAttribute(t);let i=n?JSON.stringify(r):r;e.__updating[t]=!0,"true"===i&&(i=""),e.setAttribute(t,i),Promise.resolve().then(()=>delete e.__updating[t])}function fd(e){return null!=e&&("object"==typeof e||"function"==typeof e)}let hd;function pd(e,t){const r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(e=>t[e].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};for(let e of r)this[e]=void 0}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=function(e,t){const r=function(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];var i;return t[r]=Object.assign({},n),fd(n.value)&&(i=n.value,"[object Function]"!==Object.prototype.toString.call(i))&&!Array.isArray(n.value)&&(t[r].value=Object.assign({},n.value)),Array.isArray(n.value)&&(t[r].value=n.value.slice(0)),t},{})}(t);return Object.keys(t).forEach(t=>{const n=r[t],i=e.getAttribute(n.attribute),o=e[t];null!=i&&(n.value=n.parse?dd(i):i),null!=o&&(n.value=Array.isArray(o)?o.slice(0):o),n.reflect&&ud(e,n.attribute,n.value,!!n.parse),Object.defineProperty(e,t,{get:()=>n.value,set(e){const r=n.value;n.value=e,n.reflect&&ud(this,n.attribute,n.value,!!n.parse);for(let n=0,i=this.__propertyChangedCallbacks.length;n<i;n++)this.__propertyChangedCallbacks[n](t,e,r)},enumerable:!0,configurable:!0})}),r}(this,t);const e=function(e){return Object.keys(e).reduce((t,r)=>(t[r]=e[r].value,t),{})}(this.props),r=this.Component,n=hd;try{hd=this,this.__initialized=!0,"function"==typeof(i=r)&&0===i.toString().indexOf("class")?new r(e,{element:this}):r(e,{element:this})}finally{hd=n}var i}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let e=null;for(;e=this.__releaseCallbacks.pop();)e(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(e,r,n){if(this.__initialized&&!this.__updating[e]&&(e=this.lookupProp(e))in t){if(null==n&&!this[e])return;this[e]=t[e].parse?dd(n):n}}lookupProp(e){if(t)return r.find(r=>e===r||e===t[r].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(e){this.__releaseCallbacks.push(e)}addPropertyChangedCallback(e){this.__propertyChangedCallbacks.push(e)}}}function gd(e,t,r){return 2===arguments.length&&(r=t,t={}),function(e,t={},r={}){const{BaseElement:n=HTMLElement,extension:i,customElements:o=window.customElements}=r;return r=>{if(!e)throw new Error("tag is required to register a Component");let s=o.get(e);return s?(s.prototype.Component=r,s):(s=pd(n,function(e){return e?Object.keys(e).reduce((t,r)=>{const n=e[r];return t[r]=fd(n)&&"value"in n?n:{value:n},t[r].attribute||(t[r].attribute=r.replace(/\.?([A-Z]+)/g,(e,t)=>"-"+t.toLowerCase()).replace("_","-").replace(/^-/,"")),t[r].parse="parse"in t[r]?t[r].parse:"string"!=typeof t[r].value,t},{}):{}}(t)),s.prototype.Component=r,s.prototype.registeredTag=e,o.define(e,s,i),s)}}(e,t)(function(e){return(t,r)=>{const{element:n}=r;return ft(i=>{const o=function(e){const t=Object.keys(e),r={};for(let n=0;n<t.length;n++){const[i,o]=ht(e[t[n]]);Object.defineProperty(r,t[n],{get:i,set(e){o(()=>e)}})}return r}(t);n.addPropertyChangedCallback((e,t)=>o[e]=t),n.addReleaseCallback(()=>{n.renderRoot.textContent="",i()});const s=e(o,r);return Tr(n.renderRoot,s)},function(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&(!t.assignedSlot||!t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}(n))}}(r))}var vd=gr("<style>");function md(e){if(null!=e){if("boolean"==typeof e)return e;if("string"==typeof e){const t=e.trim().toLowerCase();if(""===t||"true"===t||"1"===t||"yes"===t)return!0;if("false"===t||"0"===t||"no"===t)return!1}}}const[bd,yd]=ht(),[wd,xd]=ht(),[kd,Td]=ht(),[Id,Cd]=ht(),[Sd,Ed]=ht(),[Ad,Od]=ht();function Rd(e={}){"walletAdapter"in e&&yd(()=>e.walletAdapter),"callbacks"in e&&xd(()=>e.callbacks),"customColors"in e&&Td(()=>e.customColors),"apiEndpoint"in e&&Cd(e.apiEndpoint),"theme"in e&&Ed(e.theme),"locale"in e&&Od(e.locale),"undefined"!=typeof customElements&&(customElements.get("tokenflight-swap")||gd("tokenflight-swap",{"api-endpoint":"","from-token":"","to-token":"",recipient:"","title-text":"","title-image":"",theme:"",locale:"","csp-nonce":"","hide-title":!1,"hide-powered-by":!1,"no-background":!1,"no-border":!1},(e,{element:t})=>{const r={apiEndpoint:e["api-endpoint"]||Id()||void 0,fromToken:e["from-token"]||void 0,toToken:e["to-token"]||void 0,recipient:e.recipient||void 0,titleText:e["title-text"]||void 0,titleImageUrl:e["title-image"]||void 0,theme:e.theme||Sd()||"light",locale:e.locale||Ad()||"en-US",hideTitle:md(e["hide-title"]),hidePoweredBy:md(e["hide-powered-by"]),noBackground:md(e["no-background"]),noBorder:md(e["no-border"])},n=e["csp-nonce"]||void 0,[i,o]=ht("undefined"!=typeof window&&!0===window.matchMedia?.("(prefers-color-scheme: dark)").matches);Tt(ad(e=>{o(e===od)}));const s=t.__customColors,a=mt(()=>{const t=e.theme||Sd()||"light",r=("auto"===t?i():"dark"===t)?od:id,n=kd();return`:host { ${sd(n||s?{...r,...n,...s}:r)} }\n${rd}`}),l=t.__walletAdapter,c=t.__callbacks;return[(d=vd(),vr(d,"nonce",n),Tr(d,a),d),Kt(Xn,{client:ma,get children(){return Kt(Bl,{config:r,get walletAdapter(){return l??bd()},get callbacks(){return c?{...wd(),...c}:wd()}})}})];var d}),customElements.get("tokenflight-receive")||gd("tokenflight-receive",{"api-endpoint":"",target:"",amount:"","from-token":"",recipient:"","title-text":"","title-image":"",theme:"",locale:"","csp-nonce":"",icon:"","hide-title":!1,"hide-powered-by":!1,"no-background":!1,"no-border":!1},(e,{element:t})=>{const r={apiEndpoint:e["api-endpoint"]||Id()||void 0,target:e.target||"",amount:e.amount||"",fromToken:e["from-token"]||void 0,recipient:e.recipient||void 0,titleText:e["title-text"]||void 0,titleImageUrl:e["title-image"]||void 0,theme:e.theme||Sd()||"light",locale:e.locale||Ad()||"en-US",icon:e.icon||void 0,hideTitle:md(e["hide-title"]),hidePoweredBy:md(e["hide-powered-by"]),noBackground:md(e["no-background"]),noBorder:md(e["no-border"])},n=e["csp-nonce"]||void 0,[i,o]=ht("undefined"!=typeof window&&!0===window.matchMedia?.("(prefers-color-scheme: dark)").matches);Tt(ad(e=>{o(e===od)}));const s=t.__customColors,a=mt(()=>{const t=e.theme||Sd()||"light",r=("auto"===t?i():"dark"===t)?od:id,n=kd();return`:host { ${sd(n||s?{...r,...n,...s}:r)} }\n${nd}`}),l=t.__walletAdapter,c=t.__callbacks;return[(d=vd(),vr(d,"nonce",n),Tr(d,a),d),Kt(Xn,{client:ma,get children(){return Kt(Wc,{config:r,get walletAdapter(){return l??bd()},get callbacks(){return c?{...wd(),...c}:wd()}})}})];var d}))}"undefined"!=typeof window&&Rd();const Pd=Object.freeze(Object.defineProperty({__proto__:null,default:{"swap.title":"TokenFlight","swap.youPay":"支付","swap.youReceive":"收到","swap.balance":"余额: {balance}","swap.selectToken":"选择代币","swap.connectWallet":"连接钱包","swap.reviewSwap":"查看兑换","swap.confirmSwap":"确认兑换","swap.executing":"执行中...","swap.success":"兑换成功","swap.error.generic":"交易失败 — 重试","swap.viewExplorer":"在浏览器中查看","swap.max":"最大","swap.rate":"汇率","swap.fee":"费用","swap.estTime":"预计时间","swap.poweredBy":"由","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"钱包账户","swap.recipient":"接收地址","swap.required":"必填","swap.recipientPlaceholder":"输入目标地址","swap.enterRecipient":"输入收款地址","swap.recipientTitle":"收款地址","swap.recipientConfirm":"确认","swap.recipientInvalid":"此链地址格式无效","swap.noRoutesAvailable":"暂无可用路由","receive.title":"TokenFlight","receive.youReceive":"您将收到","receive.payWith":"使用支付","receive.buy":"购买 {amount} {symbol}","receive.processing":"处理中...","receive.success":"购买完成","receive.noPaymentOptions":"没有可用的代币","receive.noPaymentHint":"浏览代币以选择支付方式","receive.connectToSeeTokens":"连接钱包以查看支付选项","receive.findingBestSource":"正在寻找最优来源...","receive.noOfferAvailable":"暂无可用报价","receive.browseAll":"浏览所有代币","receive.changePayment":"更换支付代币","receive.best":"最佳","receive.fee":"费用: {value}","receive.viewExplorer":"在浏览器中查看","selector.title.from":"选择支付代币","selector.title.to":"选择目标代币","selector.search":"按名称或地址搜索","selector.allChains":"所有链","selector.noResults":"未找到代币","tracking.step1.title":"已签名","tracking.step1.subtitle":"签名已提交","tracking.step1.signing":"钱包签名","tracking.step1.signingSubtitle":"请在钱包中确认...","tracking.step2.title":"在 {chain} 上存入","tracking.step2.waiting":"等待确认中...","tracking.step2.confirmed":"已上链确认","tracking.step3.title":"提供商正在执行订单","tracking.step3.subtitle":"通过 {provider}","tracking.step3.expired":"订单已过期","tracking.step3.expiredSubtitle":"无做市商接受此订单","tracking.step3.failed":"订单失败","tracking.step3.failedSubtitle":"无法完成","tracking.step4.title":"已在 {chain} 上完成","tracking.step4.subtitle":"代币已送达","tracking.step4.refundPending":"退款进行中","tracking.step4.refundSubtitle":"正在 {chain} 上退还代币","tracking.step4.failed":"订单失败","tracking.step4.failedSubtitle":"交付未成功","tracking.viewOnExplorer":"查看","tracking.retry":"重试","tracking.via":"通过 {provider}","failure.title":"订单失败","failure.refundedTitle":"订单已退款","failure.subtitle":"您的订单无法完成。","failure.refundedSubtitle":"您的资金已退回钱包。","failure.refundAmount":"已退款","failure.refundTx":"退款交易","success.title":"交易完成","success.tokensLanded":"代币已到账!","success.deliveredIn":"{seconds}秒内送达","success.delivered":"您的代币已送达","success.onChain":"在 {chain} 上","success.journeyDetails":"交易详情","success.from":"发送","success.to":"接收","success.sender":"发送方","success.recipient":"接收方","success.depositTx":"存入交易","success.fillTx":"完成交易","success.provider":"提供商","success.sent":"已发送","success.received":"已收到","success.viewExplorer":"在浏览器中查看","success.newSwap":"新交易","success.newPurchase":"新购买","error.invalidConfig":"配置无效","error.walletNotConnected":"钱包未连接","error.transactionFailed":"交易失败","error.quoteFailed":"获取报价失败","error.timeout":"请求超时","error.insufficientBalance":"余额不足","error.walletChainMismatch":"钱包地址与源链不匹配","swap.swapTokens":"切换代币","selector.close":"关闭","time.seconds":"~{value}秒","time.minutes":"~{value}分钟","quote.refresh":"报价刷新","amount.zero":"0"}},Symbol.toStringTag,{value:"Module"})),Nd=Object.freeze(Object.defineProperty({__proto__:null,default:{"swap.title":"TokenFlight","swap.youPay":"支付","swap.youReceive":"收到","swap.balance":"餘額: {balance}","swap.selectToken":"選擇代幣","swap.connectWallet":"連接錢包","swap.reviewSwap":"查看兌換","swap.confirmSwap":"確認兌換","swap.executing":"執行中...","swap.success":"兌換成功","swap.error.generic":"交易失敗 — 重試","swap.viewExplorer":"在瀏覽器中查看","swap.max":"最大","swap.rate":"匯率","swap.fee":"費用","swap.estTime":"預計時間","swap.poweredBy":"由","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"錢包帳戶","swap.recipient":"接收地址","swap.required":"必填","swap.recipientPlaceholder":"輸入目標地址","swap.enterRecipient":"輸入收款地址","swap.recipientTitle":"收款地址","swap.recipientConfirm":"確認","swap.recipientInvalid":"此鏈地址格式無效","swap.noRoutesAvailable":"暫無可用路由","receive.title":"TokenFlight","receive.youReceive":"您將收到","receive.payWith":"使用支付","receive.buy":"購買 {amount} {symbol}","receive.processing":"處理中...","receive.success":"購買完成","receive.noPaymentOptions":"沒有可用的代幣","receive.noPaymentHint":"瀏覽代幣以選擇支付方式","receive.connectToSeeTokens":"連接錢包以查看支付選項","receive.findingBestSource":"正在尋找最優來源...","receive.noOfferAvailable":"暫無可用報價","receive.browseAll":"瀏覽所有代幣","receive.changePayment":"更換支付代幣","receive.best":"最佳","receive.fee":"費用: {value}","receive.viewExplorer":"在瀏覽器中查看","selector.title.from":"選擇支付代幣","selector.title.to":"選擇目標代幣","selector.search":"按名稱或地址搜索","selector.allChains":"所有鏈","selector.noResults":"未找到代幣","tracking.step1.title":"已簽名","tracking.step1.subtitle":"簽名已提交","tracking.step1.signing":"錢包簽名","tracking.step1.signingSubtitle":"請在錢包中確認...","tracking.step2.title":"在 {chain} 上存入","tracking.step2.waiting":"等待確認中...","tracking.step2.confirmed":"已上鏈確認","tracking.step3.title":"提供商正在執行訂單","tracking.step3.subtitle":"透過 {provider}","tracking.step3.expired":"訂單已過期","tracking.step3.expiredSubtitle":"無做市商接受此訂單","tracking.step3.failed":"訂單失敗","tracking.step3.failedSubtitle":"無法完成","tracking.step4.title":"已在 {chain} 上完成","tracking.step4.subtitle":"代幣已送達","tracking.step4.refundPending":"退款進行中","tracking.step4.refundSubtitle":"正在 {chain} 上退還代幣","tracking.step4.failed":"訂單失敗","tracking.step4.failedSubtitle":"交付未成功","tracking.viewOnExplorer":"查看","tracking.retry":"重試","tracking.via":"透過 {provider}","failure.title":"訂單失敗","failure.refundedTitle":"訂單已退款","failure.subtitle":"您的訂單無法完成。","failure.refundedSubtitle":"您的資金已退回錢包。","failure.refundAmount":"已退款","failure.refundTx":"退款交易","success.title":"交易完成","success.tokensLanded":"代幣已到帳!","success.deliveredIn":"{seconds}秒內送達","success.delivered":"您的代幣已送達","success.onChain":"在 {chain} 上","success.journeyDetails":"交易詳情","success.from":"發送","success.to":"接收","success.sender":"發送方","success.recipient":"接收方","success.depositTx":"存入交易","success.fillTx":"完成交易","success.provider":"提供商","success.sent":"已發送","success.received":"已收到","success.viewExplorer":"在瀏覽器中查看","success.newSwap":"新交易","success.newPurchase":"新購買","error.invalidConfig":"配置無效","error.walletNotConnected":"錢包未連接","error.transactionFailed":"交易失敗","error.quoteFailed":"獲取報價失敗","error.timeout":"請求超時","error.insufficientBalance":"餘額不足","error.walletChainMismatch":"錢包地址與源鏈不匹配","swap.swapTokens":"切換代幣","selector.close":"關閉","time.seconds":"~{value}秒","time.minutes":"~{value}分鐘","quote.refresh":"報價刷新","amount.zero":"0"}},Symbol.toStringTag,{value:"Module"})),Fd=Object.freeze(Object.defineProperty({__proto__:null,default:{"swap.title":"TokenFlight","swap.youPay":"支払い","swap.youReceive":"受取り","swap.balance":"残高: {balance}","swap.selectToken":"トークンを選択","swap.connectWallet":"ウォレットを接続","swap.reviewSwap":"スワップを確認","swap.confirmSwap":"スワップを実行","swap.executing":"実行中...","swap.success":"スワップ成功","swap.error.generic":"取引失敗 — 再試行","swap.viewExplorer":"エクスプローラーで表示","swap.max":"最大","swap.rate":"レート","swap.fee":"手数料","swap.estTime":"推定時間","swap.poweredBy":"Powered by","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"ウォレットアカウント","swap.recipient":"受取アドレス","swap.required":"必須","swap.recipientPlaceholder":"宛先アドレスを入力","swap.enterRecipient":"受取アドレスを入力","swap.recipientTitle":"受取アドレス","swap.recipientConfirm":"確認","swap.recipientInvalid":"このチェーンのアドレス形式が無効です","swap.noRoutesAvailable":"利用可能なルートがありません","receive.title":"TokenFlight","receive.youReceive":"受取り","receive.payWith":"支払い方法","receive.buy":"{amount} {symbol}を購入","receive.processing":"処理中...","receive.success":"購入完了","receive.noPaymentOptions":"利用可能なトークンがありません","receive.noPaymentHint":"トークンを検索して支払い方法を選択してください","receive.connectToSeeTokens":"ウォレットを接続して支払いオプションを表示","receive.findingBestSource":"最適なソースを検索中...","receive.noOfferAvailable":"利用可能なオファーがありません","receive.browseAll":"すべてのトークンを見る","receive.changePayment":"支払いトークンを変更","receive.best":"最適","receive.fee":"手数料: {value}","receive.viewExplorer":"エクスプローラーで表示","selector.title.from":"支払いトークンを選択","selector.title.to":"受取りトークンを選択","selector.search":"名前またはアドレスで検索","selector.allChains":"全チェーン","selector.noResults":"トークンが見つかりません","tracking.step1.title":"署名完了","tracking.step1.subtitle":"署名を提出しました","tracking.step1.signing":"ウォレットで署名","tracking.step1.signingSubtitle":"ウォレットで確認してください...","tracking.step2.title":"{chain}への入金","tracking.step2.waiting":"確認待ち...","tracking.step2.confirmed":"オンチェーンで確認済み","tracking.step3.title":"プロバイダーが注文を処理中","tracking.step3.subtitle":"{provider}経由","tracking.step3.expired":"注文が期限切れ","tracking.step3.expiredSubtitle":"フィラーが注文を受け付けませんでした","tracking.step3.failed":"注文が失敗","tracking.step3.failedSubtitle":"完了できませんでした","tracking.step4.title":"{chain}で完了","tracking.step4.subtitle":"トークンが送達されました","tracking.step4.refundPending":"返金処理中","tracking.step4.refundSubtitle":"{chain}でトークンを返還中","tracking.step4.failed":"注文が失敗","tracking.step4.failedSubtitle":"送達に失敗しました","tracking.viewOnExplorer":"表示","tracking.retry":"リトライ","tracking.via":"{provider}経由","failure.title":"注文が失敗しました","failure.refundedTitle":"注文が返金されました","failure.subtitle":"注文を完了できませんでした。","failure.refundedSubtitle":"資金がウォレットに返金されました。","failure.refundAmount":"返金額","failure.refundTx":"返金トランザクション","success.title":"取引完了","success.tokensLanded":"トークンが到着しました!","success.deliveredIn":"{seconds}秒で送達","success.delivered":"トークンが送達されました","success.onChain":"{chain}上","success.journeyDetails":"取引詳細","success.from":"送金元","success.to":"送金先","success.sender":"送信者","success.recipient":"受取人","success.depositTx":"入金取引","success.fillTx":"完了取引","success.provider":"プロバイダー","success.sent":"送金","success.received":"受取","success.viewExplorer":"エクスプローラーで表示","success.newSwap":"新しいスワップ","success.newPurchase":"新しい購入","error.invalidConfig":"設定が無効です","error.walletNotConnected":"ウォレットが接続されていません","error.transactionFailed":"取引が失敗しました","error.quoteFailed":"見積もりの取得に失敗しました","error.timeout":"リクエストがタイムアウトしました","error.insufficientBalance":"残高不足","error.walletChainMismatch":"ウォレットがソースチェーンと一致しません","swap.swapTokens":"トークンを入れ替える","selector.close":"閉じる","time.seconds":"~{value}秒","time.minutes":"~{value}分","quote.refresh":"見積もり更新","amount.zero":"0"}},Symbol.toStringTag,{value:"Module"})),_d=Object.freeze(Object.defineProperty({__proto__:null,default:{"swap.title":"TokenFlight","swap.youPay":"지불","swap.youReceive":"수령","swap.balance":"잔액: {balance}","swap.selectToken":"토큰 선택","swap.connectWallet":"지갑 연결","swap.reviewSwap":"스왑 확인","swap.confirmSwap":"스왑 실행","swap.executing":"실행 중...","swap.success":"스왑 성공","swap.error.generic":"거래 실패 — 재시도","swap.viewExplorer":"익스플로러에서 보기","swap.max":"최대","swap.rate":"환율","swap.fee":"수수료","swap.estTime":"예상 시간","swap.poweredBy":"Powered by","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"지갑 계정","swap.recipient":"수신 주소","swap.required":"필수","swap.recipientPlaceholder":"대상 주소 입력","swap.enterRecipient":"수신 주소 입력","swap.recipientTitle":"수신 주소","swap.recipientConfirm":"확인","swap.recipientInvalid":"이 체인의 주소 형식이 올바르지 않습니다","swap.noRoutesAvailable":"이용 가능한 경로 없음","receive.title":"TokenFlight","receive.youReceive":"수령","receive.payWith":"결제 수단","receive.buy":"{amount} {symbol} 구매","receive.processing":"처리 중...","receive.success":"구매 완료","receive.noPaymentOptions":"사용 가능한 토큰이 없습니다","receive.noPaymentHint":"토큰을 검색하여 결제 수단을 선택하세요","receive.connectToSeeTokens":"지갑을 연결하여 결제 옵션을 확인하세요","receive.findingBestSource":"최적의 소스를 찾는 중...","receive.noOfferAvailable":"이용 가능한 오퍼 없음","receive.browseAll":"모든 토큰 보기","receive.changePayment":"결제 토큰 변경","receive.best":"최적","receive.fee":"수수료: {value}","receive.viewExplorer":"익스플로러에서 보기","selector.title.from":"결제 토큰 선택","selector.title.to":"수령 토큰 선택","selector.search":"이름 또는 주소로 검색","selector.allChains":"모든 체인","selector.noResults":"토큰을 찾을 수 없습니다","tracking.step1.title":"서명 완료","tracking.step1.subtitle":"서명이 제출되었습니다","tracking.step1.signing":"지갑에서 서명","tracking.step1.signingSubtitle":"지갑에서 확인해 주세요...","tracking.step2.title":"{chain}에 입금","tracking.step2.waiting":"확인 대기 중...","tracking.step2.confirmed":"온체인에서 확인됨","tracking.step3.title":"제공자가 주문 처리 중","tracking.step3.subtitle":"{provider} 경유","tracking.step3.expired":"주문 만료","tracking.step3.expiredSubtitle":"필러가 주문을 수락하지 않았습니다","tracking.step3.failed":"주문 실패","tracking.step3.failedSubtitle":"완료할 수 없습니다","tracking.step4.title":"{chain}에서 완료","tracking.step4.subtitle":"토큰이 전달되었습니다","tracking.step4.refundPending":"환불 진행 중","tracking.step4.refundSubtitle":"{chain}에서 토큰 반환 중","tracking.step4.failed":"주문 실패","tracking.step4.failedSubtitle":"전달 실패","tracking.viewOnExplorer":"보기","tracking.retry":"재시도","tracking.via":"{provider} 경유","failure.title":"주문 실패","failure.refundedTitle":"주문 환불 완료","failure.subtitle":"주문을 완료할 수 없습니다.","failure.refundedSubtitle":"자금이 지갑으로 반환되었습니다.","failure.refundAmount":"환불됨","failure.refundTx":"환불 트랜잭션","success.title":"거래 완료","success.tokensLanded":"토큰이 도착했습니다!","success.deliveredIn":"{seconds}초 만에 전달","success.delivered":"토큰이 전달되었습니다","success.onChain":"{chain}에서","success.journeyDetails":"거래 상세","success.from":"보낸 곳","success.to":"받는 곳","success.sender":"보낸 사람","success.recipient":"받는 사람","success.depositTx":"입금 트랜잭션","success.fillTx":"완료 트랜잭션","success.provider":"제공자","success.sent":"전송","success.received":"수령","success.viewExplorer":"익스플로러에서 보기","success.newSwap":"새 스왑","success.newPurchase":"새 구매","error.invalidConfig":"잘못된 설정","error.walletNotConnected":"지갑이 연결되지 않았습니다","error.transactionFailed":"거래 실패","error.quoteFailed":"견적 조회 실패","error.timeout":"요청 시간 초과","error.insufficientBalance":"잔액 부족","error.walletChainMismatch":"지갑 주소가 소스 체인과 일치하지 않습니다","swap.swapTokens":"토큰 교환","selector.close":"닫기","time.seconds":"~{value}초","time.minutes":"~{value}분","quote.refresh":"견적 갱신","amount.zero":"0"}},Symbol.toStringTag,{value:"Module"}));e.DEFAULT_API_ENDPOINT=ga,e.ErrorCode=Ve,e.MockWalletAdapter=class{constructor(){this.name="Mock Wallet",this.icon=void 0,this.supportedActionTypes=["eip1193_request","solana_signAndSendTransaction"],this.connected=!1,this.address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",this.listeners=new Map}async connect(e){this.connected=!0,this.emit("connect",{address:this.address})}async disconnect(){this.connected=!1,this.emit("disconnect")}isConnected(e){return this.connected}async getAddress(e){return this.connected?this.address:null}async executeWalletAction(e){return await new Promise(e=>setTimeout(e,1e3)),{success:!0,txHash:"0x"+"a".repeat(64)}}async signMessage(e){return"0x"+"b".repeat(130)}async openAccountModal(){}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(e,t){const r=this.listeners.get(e);if(r)for(const n of r)n({type:e,data:t})}},e.SOLANA_CHAIN_ID=qo,e.TERMINAL_ORDER_STATUSES=Ke,e.TokenFlightError=Ye,e.TokenFlightReceive=class{constructor(e){this.dispose=null,this.unwatchTheme=null,this.shadowRoot=null,this.container=cd(e.container),this.config=e.config,this.walletAdapter=e.walletAdapter,this.callbacks=e.callbacks}initialize(){this.dispose&&this.destroy();const e=document.createElement("div");this.container.appendChild(e);const t=e.attachShadow({mode:"open"});this.shadowRoot=t;const r=document.createElement("style"),n=this.config.theme??"light";this.applyThemeStyles(r,n),t.appendChild(r),this.setupAutoThemeWatch(r);const i=document.createElement("div");t.appendChild(i);const o=this.config,s=this.walletAdapter,a=this.callbacks;o.customColors&&ld(e,o.customColors),this.dispose=pr(()=>Kt(Xn,{client:ma,get children(){return Kt(Wc,{config:o,walletAdapter:s,callbacks:a})}}),i)}destroy(){this.unwatchTheme&&(this.unwatchTheme(),this.unwatchTheme=null),this.dispose&&(this.dispose(),this.dispose=null),this.shadowRoot=null,this.container.innerHTML=""}setTheme(e){this.config={...this.config,theme:e};const t=this.shadowRoot;if(t){const r=t.querySelector("style");r&&(this.applyThemeStyles(r,e),this.setupAutoThemeWatch(r))}}setCustomColors(e){const t=this.shadowRoot?.host;t&&ld(t,e)}applyThemeStyles(e,t){const r=("auto"===t?"undefined"!=typeof window&&!0===window.matchMedia?.("(prefers-color-scheme: dark)").matches:"dark"===t)?od:id;e.textContent=`:host { ${sd(r)} }\n${nd}`}setupAutoThemeWatch(e){this.unwatchTheme&&(this.unwatchTheme(),this.unwatchTheme=null),"auto"===this.config.theme&&(this.unwatchTheme=ad(t=>{e.textContent=`:host { ${sd(t)} }\n${nd}`}))}},e.TokenFlightSwap=class{constructor(e){this.dispose=null,this.unwatchTheme=null,this.shadowRoot=null,this.container=cd(e.container),this.config=e.config,this.walletAdapter=e.walletAdapter,this.callbacks=e.callbacks}initialize(){this.dispose&&this.destroy();const e=document.createElement("div");this.container.appendChild(e);const t=e.attachShadow({mode:"open"});this.shadowRoot=t;const r=document.createElement("style"),n=this.config.theme??"light";this.applyThemeStyles(r,n),t.appendChild(r),this.setupAutoThemeWatch(r);const i=document.createElement("div");t.appendChild(i);const o=this.config,s=this.walletAdapter,a=this.callbacks;o.customColors&&ld(e,o.customColors),this.dispose=pr(()=>Kt(Xn,{client:ma,get children(){return Kt(Bl,{config:o,walletAdapter:s,callbacks:a})}}),i)}destroy(){this.unwatchTheme&&(this.unwatchTheme(),this.unwatchTheme=null),this.dispose&&(this.dispose(),this.dispose=null),this.shadowRoot=null,this.container.innerHTML=""}setTheme(e){this.config={...this.config,theme:e};const t=this.shadowRoot;if(t){const r=t.querySelector("style");r&&(this.applyThemeStyles(r,e),this.setupAutoThemeWatch(r))}}setCustomColors(e){const t=this.shadowRoot?.host;t&&ld(t,e)}applyThemeStyles(e,t){const r=("auto"===t?"undefined"!=typeof window&&!0===window.matchMedia?.("(prefers-color-scheme: dark)").matches:"dark"===t)?od:id;e.textContent=`:host { ${sd(r)} }\n${rd}`}setupAutoThemeWatch(e){this.unwatchTheme&&(this.unwatchTheme(),this.unwatchTheme=null),"auto"===this.config.theme&&(this.unwatchTheme=ad(t=>{e.textContent=`:host { ${sd(t)} }\n${rd}`}))}},e.buildOffersForRanking=Ya,e.buildSwapOffersForRanking=Ga,e.clearTokenCache=function(){try{const e=[];for(let t=0;t<localStorage.length;t++){const r=localStorage.key(t);r?.startsWith(ba)&&e.push(r)}for(const t of e)localStorage.removeItem(t)}catch{}},e.computeExchangeRate=Qi,e.formatDisplayAmount=Ki,e.getBestOverallRouteId=function(e,t){return Ja(Ya(e,t))[0]??null},e.getBestOverallSwapRouteId=Za,e.getChainType=jo,e.isCrossChainSwap=function(e,t){return jo(e)!==jo(t)},e.isEvmChain=Lo,e.isSolanaChain=Mo,e.rankOffers=Ja,e.rankSwapOffers=Xa,e.registerElements=Rd,e.toBaseUnits=Hi,e.toDisplayAmount=Bi,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
7
|
+
*/var yi=pr("<span aria-label=TokenFlight role=img style=line-height:1>✈️"),wi=pr("<div>"),xi=pr("<img>"),ki=pr("<img alt>"),Ti=pr('<a href=https://tokenflight.ai target=_blank rel="noopener noreferrer"part=fee-info data-testid=footer><span>Powered by</span><span>✈️</span><span>Token<span>Flight');function Ii(e,t){if(e)return`${e.replace(/\/$/,"")}/v1/chain/${t}/icon`}function Si(e){return t=yi(),gt(r=>yr(t,"font-size",`${e.size??28}px`)),t;var t}const Ci={USDC:"$",ETH:"Ξ",USDT:"₮",WBTC:"₿",DAI:"◈",ARB:"A",SOL:"◎"};function Ei(e){const t=()=>e.size??36,[r,n]=ht(!1),i=()=>!!e.logoURI&&!r();return kr(s=wi(),(o=ur(()=>!!i()),()=>{return o()?(br(r=xi(),"error",()=>n(!0)),gt(n=>{var i=e.logoURI,o=e.symbol,s=t(),a=t(),c="tf-59aca7";return i!==n.e&&gr(r,"src",n.e=i),o!==n.t&&gr(r,"alt",n.t=o),s!==n.a&&gr(r,"width",n.a=s),a!==n.o&&gr(r,"height",n.o=a),c!==n.i&&vr(r,n.i=c),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r):Ci[e.symbol]??e.symbol[0]??"?";var r})),gt(r=>{var n="tf-c63ac0",o={width:`${t()}px`,height:`${t()}px`,...i()?{}:{background:`linear-gradient(135deg, ${e.color}, ${e.color}cc)`,"font-size":.42*t()+"px","box-shadow":`0 2px 8px ${e.color}33`}};return n!==r.e&&vr(s,r.e=n),r.t=mr(s,o,r.t),r},{e:void 0,t:void 0}),s;var o,s}function Ai(e){const t=()=>e.size??8,[r,n]=ht(!1),i=()=>!!e.iconUrl&&!r();return kr(s=wi(),(o=ur(()=>!!i()),()=>{return o()&&(br(r=ki(),"error",()=>n(!0)),gt(n=>{var i=e.iconUrl,o=t(),s=t(),a="tf-f89395";return i!==n.e&&gr(r,"src",n.e=i),o!==n.t&&gr(r,"width",n.t=o),s!==n.a&&gr(r,"height",n.a=s),a!==n.o&&vr(r,n.o=a),n},{e:void 0,t:void 0,a:void 0,o:void 0}),r);var r})),gt(r=>{var n="tf-dbfbb3",o={width:`${t()}px`,height:`${t()}px`,...i()?{}:{background:e.color?e.color:"conic-gradient(#627EEA 0deg 90deg, #0052FF 90deg 180deg, #28A0F0 180deg 270deg, #9945FF 270deg 360deg)"}};return n!==r.e&&vr(s,r.e=n),r.t=mr(s,o,r.t),r},{e:void 0,t:void 0}),s;var o,s}function Oi(){return e=Ti(),t=e.firstChild,r=t.nextSibling,n=r.nextSibling,i=n.firstChild.nextSibling,kr(e,Kt(pi,{size:12,get class(){return"tf-b35860"}}),null),gt(o=>{var s="tf-cdfe94",a="tf-7c0c36",c="tf-26d5ea",l="tf-8b1e15",d="tf-3852e5";return s!==o.e&&vr(e,o.e=s),a!==o.t&&vr(t,o.t=a),c!==o.a&&vr(r,o.a=c),l!==o.o&&vr(n,o.o=l),d!==o.i&&vr(i,o.i=d),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e;var e,t,r,n,i}const Ri={"swap.title":"TokenFlight","swap.youPay":"You pay","swap.youReceive":"You receive","swap.balance":"Balance: {balance}","swap.selectToken":"Select token","swap.connectWallet":"Connect Wallet","swap.reviewSwap":"Review Swap","swap.confirmSwap":"Confirm Swap","swap.executing":"Executing...","swap.success":"Swap Successful","swap.error.generic":"Transaction failed — Retry","swap.viewExplorer":"View on Explorer","swap.max":"MAX","swap.rate":"Rate","swap.fee":"Fee","swap.estTime":"Est. time","swap.poweredBy":"Powered by","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"Wallet account","swap.recipient":"Recipient","swap.required":"Required","swap.recipientPlaceholder":"Enter destination address","swap.enterRecipient":"Enter Recipient Address","swap.recipientTitle":"Recipient Address","swap.recipientConfirm":"Confirm","swap.recipientInvalid":"Invalid address for this chain","swap.noRoutesAvailable":"No routes available","receive.title":"TokenFlight","receive.youReceive":"You receive","receive.payWith":"Pay with","receive.buy":"Buy {amount} {symbol}","receive.processing":"Processing...","receive.success":"Purchase Complete","receive.noPaymentOptions":"No tokens available","receive.noPaymentHint":"Browse tokens to select a payment method","receive.connectToSeeTokens":"Connect your wallet to see payment options","receive.findingBestSource":"Finding best source...","receive.noOfferAvailable":"No offer available","receive.browseAll":"Browse all tokens","receive.changePayment":"Change payment token","receive.best":"BEST","receive.fee":"fee: {value}","receive.viewExplorer":"View on Explorer","selector.title.from":"Select payment token","selector.title.to":"Select destination token","selector.search":"Search by name or address","selector.allChains":"All Chains","selector.noResults":"No tokens found","tracking.step1.title":"Signed in wallet","tracking.step1.subtitle":"Signature submitted","tracking.step1.signing":"Sign in wallet","tracking.step1.signingSubtitle":"Confirm in your wallet...","tracking.step2.title":"Deposit on {chain}","tracking.step2.waiting":"Waiting for confirmation...","tracking.step2.confirmed":"Confirmed on-chain","tracking.step3.title":"Provider filling your order","tracking.step3.subtitle":"Via {provider}","tracking.step3.expired":"Order expired","tracking.step3.expiredSubtitle":"No filler accepted the order","tracking.step3.failed":"Order failed","tracking.step3.failedSubtitle":"Could not be completed","tracking.step4.title":"Filled on {chain}","tracking.step4.subtitle":"Tokens delivered","tracking.step4.refundPending":"Refund in progress","tracking.step4.refundSubtitle":"Returning tokens on {chain}","tracking.step4.failed":"Order failed","tracking.step4.failedSubtitle":"Delivery unsuccessful","tracking.viewOnExplorer":"View","tracking.retry":"Retry","tracking.via":"via {provider}","failure.title":"Order Failed","failure.refundedTitle":"Order Refunded","failure.subtitle":"Your order could not be completed.","failure.refundedSubtitle":"Your funds have been returned to your wallet.","failure.refundAmount":"Refunded","failure.refundTx":"Refund tx","success.title":"Transaction Complete","success.tokensLanded":"Tokens Landed!","success.deliveredIn":"Delivered in {seconds}s","success.delivered":"Your tokens have been delivered","success.onChain":"on {chain}","success.journeyDetails":"Journey details","success.from":"From","success.to":"To","success.sender":"Sender","success.recipient":"Recipient","success.depositTx":"Deposit tx","success.fillTx":"Fill tx","success.provider":"Provider","success.sent":"Sent","success.received":"Received","success.viewExplorer":"View on Explorer","success.newSwap":"New Swap","success.newPurchase":"New Purchase","error.invalidConfig":"Invalid configuration","error.walletNotConnected":"Wallet not connected","error.transactionFailed":"Transaction failed","error.quoteFailed":"Failed to get quote","error.timeout":"Request timed out","error.insufficientBalance":"Insufficient balance","error.walletChainMismatch":"Wallet doesn't match source chain","swap.swapTokens":"Swap tokens","selector.close":"Close","time.seconds":"~{value}s","time.minutes":"~{value}m","quote.refresh":"Quote refreshes in","amount.zero":"0"},[Pi,Ni]=ht("en-US"),[Di,_i]=ht(Ri),Fi={"zh-CN":()=>Promise.resolve().then(()=>il),"zh-TW":()=>Promise.resolve().then(()=>ol),"ja-JP":()=>Promise.resolve().then(()=>sl),"ko-KR":()=>Promise.resolve().then(()=>al)};function Ui(e,t){let r=Di()[e]??Ri[e]??e;if(t)for(const[n,i]of Object.entries(t))r=r.replace(new RegExp(`\\{${n}\\}`,"g"),String(i));return r}const qi="tf-2de115";var $i=pr("<div part=button-primary data-testid=btn-primary>"),Mi=pr("<button part=button-primary data-testid=btn-primary>"),ji=pr("<button part=button-secondary data-testid=btn-connect>"),Li=pr("<button part=button-primary data-testid=btn-primary disabled><span><span>"),zi=pr("<button part=button-primary data-testid=btn-recipient>"),Wi=pr("<button part=button-primary data-testid=btn-primary disabled style=opacity:0.6>");function Bi(e){return Kt(nr,{get children(){return[Kt(ir,{get when(){return"success"===e.phase},get children(){var t=$i();return kr(t,Kt(di,{size:18}),null),kr(t,()=>e.label??Ui("swap.success"),null),gt(()=>vr(t,"tf-65cf23")),t}}),Kt(ir,{get when(){return"error"===e.phase},get children(){var t=Mi();return br(t,"click",e.onRetry),kr(t,Kt(ui,{size:16}),null),kr(t,()=>e.errorLabel||Ui("swap.error.generic"),null),gt(()=>vr(t,"tf-2f0314")),t}}),Kt(ir,{get when(){return!e.isConnected},get children(){var t=ji();return br(t,"click",e.onConnect),kr(t,()=>Ui("swap.connectWallet")),gt(()=>vr(t,"tf-44b8f1")),t}}),Kt(ir,{get when(){return"submitting"===e.phase||"building"===e.phase||"awaiting-wallet"===e.phase||"tracking"===e.phase},get children(){var e=Li(),t=e.firstChild,r=t.firstChild;return kr(t,()=>Ui("swap.executing"),null),gt(n=>{var i=`${qi} tf-47dc2a`,o="tf-20b1ac",s="tf-e6dae0";return i!==n.e&&vr(e,n.e=i),o!==n.t&&vr(t,n.t=o),s!==n.a&&vr(r,n.a=s),n},{e:void 0,t:void 0,a:void 0}),e}}),Kt(ir,{get when(){return e.needsRecipient},get children(){var t=zi();return br(t,"click",e.onEnterRecipient),kr(t,()=>Ui("swap.enterRecipient")),gt(()=>vr(t,"tf-04fe16")),t}}),Kt(ir,{get when(){return e.insufficientBalance},get children(){var e=Wi();return kr(e,()=>Ui("error.insufficientBalance")),gt(()=>vr(e,qi)),e}}),Kt(ir,{get when(){return e.hasQuote},get children(){var t=Mi();return br(t,"click",e.onConfirm),kr(t,()=>e.label??Ui("swap.confirmSwap")),gt(()=>vr(t,qi)),t}}),Kt(ir,{get when(){return"idle"===e.phase||"quoting"===e.phase||"quoted"===e.phase},get children(){var e=Wi();return kr(e,()=>Ui("swap.reviewSwap")),gt(()=>vr(e,qi)),e}})]}})}var Hi=pr("<span><span></span><span aria-hidden=true></span><span>"),Qi=pr("<span>");function Ki(e){return e.includes(".")?e.replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"").replace(/\.$/,""):e}function Vi(e,t,r){if(!Number.isFinite(e))return null;if(void 0!==r)return e.toFixed(r);if(0===e)return"0";const n=Math.abs(e)<1?e.toPrecision(t):e.toLocaleString("en-US",{useGrouping:!0,maximumSignificantDigits:t});if(!/[eE]/.test(n))return n;const[i,o]=n.toLowerCase().split("e");if(!i||void 0===o)return n;const s=Number(o);if(!Number.isFinite(s))return n;const a=i.startsWith("-")?"-":"",c=a?i.slice(1):i,[l,d=""]=c.split("."),f=`${l??""}${d}`,u=(l?.length??0)+s;return u<=0?`${a}0.${"0".repeat(Math.abs(u))}${f}`:u>=f.length?`${a}${f}${"0".repeat(u-f.length)}`:`${a}${f.slice(0,u)}.${f.slice(u)}`}function Gi(e){const t=bt(()=>function(e,t,r){const n=function(e){if(null==e)return null;if("bigint"==typeof e)return e.toString();const t=String(e).trim();if(!t)return null;const r=Number(t);return Number.isFinite(r)?t:null}(e);if(!n)return null;const i=Vi(Number(n),t,r);if(!i)return null;const o=Ki(i),s=o.match(/^(-?\d+)\.(0+)(\d*)$/);if(!s)return o;const a=s[1],c=s[2],l=s[3]??"";return!a||!c||c.length<3?o:{prefix:`${a}.${c.charAt(0)}`,zeroCount:c.length,suffix:l}}(e.value,e.digits??8,e.fixedDecimals)),r=bt(()=>{const r=t();if(null===r||"string"==typeof r)return null;const n=Vi(Number(e.value??0),18);return n?Ki(n):null});return ur(()=>{const e=t();if(null===e)return null;if("string"==typeof e)return e;const n=(o=(i=Hi()).firstChild,a=(s=o.nextSibling).nextSibling,kr(o,()=>e.prefix),kr(s,()=>e.zeroCount),kr(a,()=>e.suffix),gt(e=>{var t="tf-ba406b",r="tf-9d81a4";return t!==e.e&&vr(i,e.e=t),r!==e.t&&vr(s,e.t=r),e},{e:void 0,t:void 0}),i);var i,o,s,a;const c=r();return c?(gr(l=Qi(),"title",c),kr(l,n),gt(()=>vr(l,"tf-7977ef")),l):n;var l})}const Yi=20011e6;function Xi(e){return e===Yi}function Ji(e){return e!==Yi}function Zi(e){return Xi(e)?"solana":"evm"}function eo(e,t){return t?.get(e)?.name??`Chain ${e}`}function to(e,t){return"evm"===t?/^0x[0-9a-fA-F]{40}$/.test(e):/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e)}function ro(e,t,r){if(!t)return null;const n=r?.get(e)?.blockExplorers?.default?.url;return n?`${n}/tx/${t}`:null}const no="tf-7d5519",io="tf-bfbd0b",oo="tf-7e8fdf",so="tf-37f3cf",ao="tf-9401fd",co="tf-832fae",lo="tf-b557fc",fo="tf-4b9be7";var uo=pr("<div><div><div><div><div></div></div><div><div></div><span></span></div></div></div><div></div><div><div><div><div></div></div><div><div></div><span>"),ho=pr("<img>"),po=pr("<div>"),go=pr("<div><button>"),vo=pr('<a target=_blank rel="noopener noreferrer"> '),bo=pr("<button>"),mo=pr("<div><div>"),yo=pr("<div part=progress><div>"),wo=pr("<div><div></div><div><div></div><div><span>"),xo=pr("<span style=font-size:14px>!"),ko=pr("<span>");function To(e){if(e.style.transform="",e.scrollWidth>e.clientWidth){const t=e.clientWidth/e.scrollWidth;e.style.transform=`scale(${t})`,e.style.transformOrigin="left"}}function Io(e){const t=()=>e.fromToken?eo(e.fromToken.chainId,e.chainMap):"",r=()=>e.toToken?eo(e.toToken.chainId,e.chainMap):"",n=bt(()=>{const n=e.order,i=n?.status??null,o="deposited"===i||"published"===i||"filled"===i||"refund_pending"===i||!0===n?.stepsCompleted?.includes("deposited")||!!n?.transactions?.deposit,s="refund_pending"===i||"refunded"===i,a="filled"===i,c="failed"===i,l="building"===e.phase||"awaiting-wallet"===e.phase,d={title:Ui(l?"tracking.step1.signing":"tracking.step1.title"),subtitle:Ui(l?"tracking.step1.signingSubtitle":"tracking.step1.subtitle"),status:l?"active":"completed",explorerUrl:null,isWarning:!1},f=n?.depositTxHash??"",u=n?.transactions?.deposit?.chainId??e.fromToken?.chainId,h=u&&f?ro(u,f,e.chainMap):null,p=l?"pending":o?"completed":"active",g=l?Ui("tracking.step2.waiting"):o?Ui("tracking.step2.confirmed"):f?`${Ui("tracking.step2.waiting")} · ${v=f,v.length<=14?v:`${v.slice(0,6)}...${v.slice(-4)}`}`:Ui("tracking.step2.waiting");var v;const b={title:Ui("tracking.step2.title",{chain:t()}),subtitle:g,status:p,explorerUrl:h,isWarning:!1};let m="pending",y=Ui("tracking.step3.title"),w=e.providerName?Ui("tracking.step3.subtitle",{provider:e.providerName}):Ui("tracking.step3.subtitle",{provider:"Provider"}),x=!1;s?(y=Ui("tracking.step3.expired"),w=Ui("tracking.step3.expiredSubtitle"),m="completed",x=!0):c?(y=Ui("tracking.step3.failed"),w=Ui("tracking.step3.failedSubtitle"),m="completed",x=!0):a?m="completed":"deposited"!==i&&"published"!==i||(m="active");const k={title:y,subtitle:w,status:m,explorerUrl:null,isWarning:x};let T="pending",I=Ui("tracking.step4.title",{chain:r()}),S=Ui("tracking.step4.subtitle"),C=!1,E=null;if(a){T="completed";const t=n?.transactions?.fill?.txHash,r=n?.transactions?.fill?.chainId??e.toToken?.chainId;t&&r&&(E=ro(r,t,e.chainMap))}else if("refund_pending"===i)I=Ui("tracking.step4.refundPending"),S=Ui("tracking.step4.refundSubtitle",{chain:t()}),T="active",C=!0;else if("refunded"===i){I=Ui("tracking.step4.refundPending"),S=Ui("tracking.step4.refundSubtitle",{chain:t()}),T="completed",C=!0;const r=n?.transactions?.refund?.txHash,i=n?.transactions?.refund?.chainId??e.fromToken?.chainId;r&&i&&(E=ro(i,r,e.chainMap))}else c&&(I=Ui("tracking.step4.failed"),S=Ui("tracking.step4.failedSubtitle"),T="completed",C=!0);const A=[d,b,k,{title:I,subtitle:S,status:T,explorerUrl:E,isWarning:C}];if(e.executionError){for(let r=A.length-1;r>=0;r--){const t=A[r];if(t&&"active"===t.status){A[r]={...t,subtitle:e.executionError,isWarning:!0};break}}const t=A[0];t&&!A.some(e=>e.isWarning&&"active"===e.status)&&(A[0]={...t,subtitle:e.executionError,status:"active",isWarning:!0})}return A}),i=()=>{const t=e.order?.transactions?.refund?.txHash,r=e.order?.transactions?.refund?.chainId??e.fromToken?.chainId;return t&&r?ro(r,t,e.chainMap):null};return o=yo(),s=o.firstChild,kr(o,Kt(rr,{get when(){return ur(()=>!!e.fromToken)()&&e.toToken},get children(){return[(n=uo(),i=n.firstChild,o=i.firstChild,s=o.firstChild,a=s.firstChild,c=s.nextSibling,l=c.firstChild,d=l.nextSibling,f=i.nextSibling,u=f.nextSibling,h=u.firstChild,p=h.firstChild,g=p.firstChild,v=p.nextSibling,b=v.firstChild,m=b.nextSibling,kr(s,Kt(Ei,{get symbol(){return e.fromToken.symbol??"?"},color:"#2775CA",size:32,get logoURI(){return e.fromToken.logoURI}}),a),kr(a,Kt(Ai,{color:null,size:14,get iconUrl(){return Ii(e.apiEndpoint,e.fromToken.chainId)}})),xr(t=>vt(()=>{e.inputAmount,e.fromToken,To(t)}),l),kr(l,Kt(rr,{get when(){return e.inputAmount},get children(){return[Kt(Gi,{get value(){return e.inputAmount},digits:6})," "]}}),null),kr(l,()=>e.fromToken.symbol??"",null),kr(d,t),kr(f,Kt(ci,{size:14})),kr(p,Kt(Ei,{get symbol(){return e.toToken.symbol??"?"},color:"#0052FF",size:32,get logoURI(){return e.toToken.logoURI}}),g),kr(g,Kt(Ai,{color:null,size:14,get iconUrl(){return Ii(e.apiEndpoint,e.toToken.chainId)}})),xr(t=>vt(()=>{e.outputAmount,e.toToken,To(t)}),b),kr(b,Kt(rr,{get when(){return e.outputAmount},get children(){return[Kt(Gi,{get value(){return e.outputAmount},digits:6})," "]}}),null),kr(b,()=>e.toToken.symbol??"",null),kr(m,r),gt(e=>{var t="tf-9322ae",r=`${no} tf-0b8d30`,y=io,w=oo,x=so,k=ao,T=co,I=lo,S="tf-5953e8",C=no,E=io,A=oo,O=so,R=ao,P=co,N=lo;return t!==e.e&&vr(n,e.e=t),r!==e.t&&vr(i,e.t=r),y!==e.a&&vr(o,e.a=y),w!==e.o&&vr(s,e.o=w),x!==e.i&&vr(a,e.i=x),k!==e.n&&vr(c,e.n=k),T!==e.s&&vr(l,e.s=T),I!==e.h&&vr(d,e.h=I),S!==e.r&&vr(f,e.r=S),C!==e.d&&vr(u,e.d=C),E!==e.l&&vr(h,e.l=E),A!==e.u&&vr(p,e.u=A),O!==e.c&&vr(g,e.c=O),R!==e.w&&vr(v,e.w=R),P!==e.m&&vr(b,e.m=P),N!==e.f&&vr(m,e.f=N),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0}),n),Kt(rr,{get when(){return e.providerName},get children(){var t=po();return kr(t,Kt(rr,{get when(){return e.providerIcon},get children(){var t=ho();return gt(r=>{var n=e.providerIcon,i=e.providerName,o="tf-062404";return n!==r.e&&gr(t,"src",r.e=n),i!==r.t&&gr(t,"alt",r.t=i),o!==r.a&&vr(t,r.a=o),r},{e:void 0,t:void 0,a:void 0}),t}}),null),kr(t,()=>Ui("tracking.via",{provider:e.providerName}),null),gt(()=>vr(t,"tf-a168c7")),t}})];var n,i,o,s,a,c,l,d,f,u,h,p,g,v,b,m}}),s),kr(s,Kt(tr,{get each(){return n()},children:(e,t)=>{return n=wo(),i=n.firstChild,o=i.nextSibling,s=o.firstChild,c=(a=s.nextSibling).firstChild,kr(i,(r=ur(()=>!("completed"!==e.status||e.isWarning)),()=>{return r()?Kt(di,{size:14}):ur(()=>!("active"!==e.status||!e.isWarning))()?xo():ur(()=>"active"===e.status)()?(i=po(),gt(()=>vr(i,"tf-9efe7c")),i):ur(()=>!(!e.isWarning||"completed"!==e.status))()?xo():(kr(n=ko(),()=>t()+1),n);var n,i})),kr(s,()=>e.title),kr(c,()=>e.subtitle),kr(a,Kt(rr,{get when(){return e.explorerUrl},get children(){var t=vo(),r=t.firstChild;return kr(t,()=>Ui("tracking.viewOnExplorer"),r),kr(t,Kt(pi,{size:10}),null),gt(r=>{var n=e.explorerUrl,i="tf-0aa291";return n!==r.e&&gr(t,"href",r.e=n),i!==r.t&&vr(t,r.t=i),r},{e:void 0,t:void 0}),t}}),null),gt(t=>{var r=e.isWarning?`${fo} tf-417d35`:"completed"===e.status?`${fo} tf-84527b`:"active"===e.status?`${fo} tf-16cfdc`:`${fo} tf-8de1c6`,c="tf-036db2 "+(!e.isWarning||"completed"!==e.status&&"active"!==e.status?"completed"===e.status?"tf-09b7bb":"active"===e.status?"tf-aef7e0":"tf-5c628c":"tf-a5abdf"),l="tf-185719",d="tf-aad7e9",f="tf-bcb46a";return r!==t.e&&vr(n,t.e=r),c!==t.t&&vr(i,t.t=c),l!==t.a&&vr(o,t.a=l),d!==t.o&&vr(s,t.o=d),f!==t.i&&vr(a,t.i=f),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n;var r,n,i,o,s,a,c}})),kr(o,Kt(rr,{get when(){return e.onRetry},get children(){var t=go(),r=t.firstChild;return br(r,"click",e.onRetry),kr(r,()=>Ui("tracking.retry")),gt(n=>{var i="tf-c918a2"+(e.executionError?"":" tf-ad7aab"),o="tf-1e22cb";return i!==n.e&&vr(t,n.e=i),o!==n.t&&vr(r,n.t=o),n},{e:void 0,t:void 0}),t}}),null),kr(o,Kt(rr,{get when(){return(()=>{const t=e.order?.status;return"failed"===t||"refunded"===t})()},get children(){var t,r=mo(),n=r.firstChild;return kr(n,(t=ur(()=>"refunded"===e.order?.status),()=>t()?Ui("failure.refundedSubtitle"):Ui("failure.subtitle"))),kr(r,Kt(rr,{get when(){return i()},get children(){var e=vo(),t=e.firstChild;return kr(e,()=>Ui("failure.refundTx"),t),kr(e,Kt(pi,{size:10}),null),gt(t=>{var r=i(),n="tf-11fa21";return r!==t.e&&gr(e,"href",t.e=r),n!==t.t&&vr(e,t.t=n),t},{e:void 0,t:void 0}),e}}),null),kr(r,Kt(rr,{get when(){return e.onNewSwap},get children(){var t,r=bo();return br(r,"click",e.onNewSwap),kr(r,(t=ur(()=>"receive"===e.mode),()=>t()?Ui("success.newPurchase"):Ui("success.newSwap"))),gt(()=>vr(r,"tf-4f7573")),r}}),null),gt(e=>{var t="tf-234e31",i="tf-adb588";return t!==e.e&&vr(r,e.e=t),i!==e.t&&vr(n,e.t=i),e},{e:void 0,t:void 0}),r}}),null),gt(e=>{var t="tf-5835df",r="tf-26af4c";return t!==e.e&&vr(o,e.e=t),r!==e.t&&vr(s,e.t=r),e},{e:void 0,t:void 0}),o;var o,s}function So(e,t){if(!e||t<0)return"0";let r;try{e.startsWith("0x"),r=BigInt(e).toString()}catch{return"0"}const n=r.startsWith("-"),i=n?r.slice(1):r;if(0===t)return n?`-${i}`:i;const o=i.padStart(t+1,"0"),s=o.slice(0,o.length-t),a=o.slice(o.length-t).replace(/0+$/,""),c=a?`${s}.${a}`:s;return n?`-${c}`:c}function Co(e,t){if(!e)return"0";if(!/^-?\d+(?:\.\d*)?$/.test(e))return"0";const r=e.startsWith("-"),n=(r?e.slice(1):e).split("."),i=((n[0]??"0")+(n[1]??"").slice(0,t).padEnd(t,"0")).replace(/^0+/,"")||"0";return r?`-${i}`:i}function Eo(e,t,r,n){if(!e||!r||"0"===e)return"0";if(t<0||n<0)return"0";let i,o;try{i=BigInt(e),o=BigInt(r)}catch{return"0"}if(0n===i)return"0";const s=10n**BigInt(8),a=(o*10n**BigInt(t)*s/(i*10n**BigInt(n))).toString().padStart(9,"0"),c=a.slice(0,a.length-8),l=a.slice(a.length-8).replace(/0+$/,"");return l?`${c}.${l}`:c}function Ao(e){const t=e.split("."),r=t[0]??"0",n=r.startsWith("-"),i=(n?r.slice(1):r).replace(/\B(?=(\d{3})+(?!\d))/g,","),o=n?`-${i}`:i;return void 0!==t[1]?`${o}.${t[1]}`:o}function Oo(e,t=6){if(!e||"0"===e)return"0";const r=e.split("."),n=r[0]??"0";if(!r[1])return e;const i=r[1];if("0"!==n&&"-0"!==n){const e=i.slice(0,t).replace(/0+$/,"");return e?`${n}.${e}`:n}const o=i.search(/[1-9]/);if(-1===o)return"0";const s=o+t,a=i.slice(0,s).replace(/0+$/,"");return a?`${n}.${a}`:"0"}const Ro="tf-6e8c3e",Po="tf-4b5396",No="tf-63cca1",Do="tf-18c122";var _o=pr("<div><div>"),Fo=pr("<div><span></span><span>"),Uo=pr('<div><span></span><a target=_blank rel="noopener noreferrer"> '),qo=pr("<div>"),$o=pr("<div><button><span> <span style=font-family:var(--tf-font-family-mono);font-weight:600;color:var(--tf-text)> </span> </span><span>"),Mo=pr('<div part=success data-testid=success-page><div><div><div><svg width=28 height=28 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round><polyline points="4,12 10,18 20,6"></polyline></svg></div></div></div><div data-testid=success-title></div><div></div><div><div><span></span><span></span></div></div><button data-testid=success-primary-btn>');function jo(e){const[t,r]=ht(!1),n=()=>{const t=Date.parse(e.order.createdAt),r=Date.parse(e.order.updatedAt);if(Number.isNaN(t)||Number.isNaN(r))return null;const n=Math.round((r-t)/1e3);return n>0?n:null},i=()=>{const t=e.order.transactions?.deposit?.txHash??e.order.depositTxHash,r=e.order.transactions?.deposit?.chainId??e.order.fromChainId;return t?ro(r,t,e.chainMap):null},o=()=>{const t=e.order.transactions?.fill?.txHash,r=e.order.transactions?.fill?.chainId??e.order.toChainId;return t?ro(r,t,e.chainMap):null},s=e=>e.length>14?`${e.slice(0,6)}...${e.slice(-4)}`:e;return c=Mo(),l=c.firstChild,d=l.firstChild,f=d.firstChild,u=l.nextSibling,h=u.nextSibling,p=h.nextSibling,g=p.firstChild,v=g.firstChild,b=v.nextSibling,m=p.nextSibling,kr(u,()=>Ui("success.tokensLanded")),kr(h,(a=ur(()=>null!==n()),()=>a()?Ui("success.deliveredIn",{seconds:String(n())}):Ui("success.delivered"))),kr(p,Kt(rr,{get when(){return e.toToken},get children(){var t=_o(),r=t.firstChild;return kr(t,Kt(Ei,{get symbol(){return e.toToken.symbol??"?"},color:"#0052FF",size:40,get logoURI(){return e.toToken.logoURI}}),r),kr(r,Kt(Ai,{color:null,size:14,get iconUrl(){return Ii(e.apiEndpoint,e.order.toChainId)}})),gt(e=>{var n="tf-7b3b5b",i="tf-651299";return n!==e.e&&vr(t,e.e=n),i!==e.t&&vr(r,e.t=i),e},{e:void 0,t:void 0}),t}}),g),kr(g,Kt(Gi,{get value(){return e.order.destAmount&&"number"==typeof e.toToken?.decimals?Oo(So(e.order.destAmount,e.toToken.decimals),6):e.order.destAmount??"0"},digits:8}),v),kr(v,()=>e.toToken?.symbol??""),kr(b,()=>Ui("success.onChain",{chain:eo(e.order.toChainId,e.chainMap)})),kr(c,Kt(rr,{get when(){return e.fromToken},get children(){var n=$o(),a=n.firstChild,c=a.firstChild,l=c.firstChild,d=l.nextSibling,f=d.firstChild;d.nextSibling;var u=c.nextSibling;return br(a,"click",()=>r(!t())),kr(c,()=>Ui("success.from"),l),kr(d,Kt(Gi,{get value(){return e.order.srcAmount&&"number"==typeof e.fromToken?.decimals?Oo(So(e.order.srcAmount,e.fromToken.decimals),6):e.order.srcAmount??"0"},digits:6}),f),kr(d,()=>e.fromToken.symbol??"",null),kr(c,()=>Ui("success.onChain",{chain:eo(e.order.fromChainId,e.chainMap)}),null),kr(u,Kt(si,{size:14})),kr(n,Kt(rr,{get when(){return t()},get children(){var t=qo();return kr(t,Kt(rr,{get when(){return e.order.author},get children(){var t=Fo(),r=t.firstChild,n=r.nextSibling;return kr(r,()=>Ui("success.sender")),kr(n,()=>s(e.order.author)),gt(e=>{var i=Ro,o=Po,s=No;return i!==e.e&&vr(t,e.e=i),o!==e.t&&vr(r,e.t=o),s!==e.a&&vr(n,e.a=s),e},{e:void 0,t:void 0,a:void 0}),t}}),null),kr(t,Kt(rr,{get when(){return e.order.recipient},get children(){var t=Fo(),r=t.firstChild,n=r.nextSibling;return kr(r,()=>Ui("success.recipient")),kr(n,()=>s(e.order.recipient)),gt(e=>{var i=Ro,o=Po,s=No;return i!==e.e&&vr(t,e.e=i),o!==e.t&&vr(r,e.t=o),s!==e.a&&vr(n,e.a=s),e},{e:void 0,t:void 0,a:void 0}),t}}),null),kr(t,Kt(rr,{get when(){return i()},get children(){var e=Uo(),t=e.firstChild,r=t.nextSibling,n=r.firstChild;return kr(t,()=>Ui("success.depositTx")),kr(r,()=>Ui("success.viewExplorer"),n),kr(r,Kt(pi,{size:10}),null),gt(n=>{var o=Ro,s=Po,a=i(),c=Do;return o!==n.e&&vr(e,n.e=o),s!==n.t&&vr(t,n.t=s),a!==n.a&&gr(r,"href",n.a=a),c!==n.o&&vr(r,n.o=c),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e}}),null),kr(t,Kt(rr,{get when(){return o()},get children(){var e=Uo(),t=e.firstChild,r=t.nextSibling,n=r.firstChild;return kr(t,()=>Ui("success.fillTx")),kr(r,()=>Ui("success.viewExplorer"),n),kr(r,Kt(pi,{size:10}),null),gt(n=>{var i=Ro,s=Po,a=o(),c=Do;return i!==n.e&&vr(e,n.e=i),s!==n.t&&vr(t,n.t=s),a!==n.a&&gr(r,"href",n.a=a),c!==n.o&&vr(r,n.o=c),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e}}),null),kr(t,Kt(rr,{get when(){return e.providerName},get children(){var t=Fo(),r=t.firstChild,n=r.nextSibling;return kr(r,()=>Ui("success.provider")),kr(n,()=>e.providerName),gt(e=>{var i=Ro,o=Po,s=No;return i!==e.e&&vr(t,e.e=i),o!==e.t&&vr(r,e.t=o),s!==e.a&&vr(n,e.a=s),e},{e:void 0,t:void 0,a:void 0}),t}}),null),gt(()=>vr(t,"tf-92a530")),t}}),null),gt(e=>{var r="tf-75f592",i="tf-73910d"+(t()?" tf-ae94a0":""),o="tf-1afb0a"+(t()?" tf-7737cf":"");return r!==e.e&&vr(n,e.e=r),i!==e.t&&vr(a,e.t=i),o!==e.a&&vr(u,e.a=o),e},{e:void 0,t:void 0,a:void 0}),n}}),m),br(m,"click",e.onNewSwap),kr(m,()=>"receive"===e.mode?Ui("success.newPurchase"):Ui("success.newSwap")),gt(e=>{var t="tf-e98a9a",r="tf-1f9019",n="tf-fd4d56",i="tf-d3c8df",o="tf-9e3a66",s="tf-db06d4",a="tf-c9a5e1",y="tf-f52291",w="tf-8cfc86",x="tf-5f768d",k="tf-d7e813";return t!==e.e&&vr(c,e.e=t),r!==e.t&&vr(l,e.t=r),n!==e.a&&vr(d,e.a=n),i!==e.o&&vr(f,e.o=i),o!==e.i&&vr(u,e.i=o),s!==e.n&&vr(h,e.n=s),a!==e.s&&vr(p,e.s=a),y!==e.h&&vr(g,e.h=y),w!==e.r&&vr(v,e.r=w),x!==e.d&&vr(b,e.d=x),k!==e.l&&vr(m,e.l=k),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),c;var a,c,l,d,f,u,h,p,g,v,b,m}const Lo={1:{symbol:"ETH",decimals:18},10:{symbol:"ETH",decimals:18},8453:{symbol:"ETH",decimals:18},42161:{symbol:"ETH",decimals:18},324:{symbol:"ETH",decimals:18},59144:{symbol:"ETH",decimals:18},11155111:{symbol:"ETH",decimals:18},11155420:{symbol:"ETH",decimals:18},1313161554:{symbol:"ETH",decimals:18},56:{symbol:"BNB",decimals:18},137:{symbol:"POL",decimals:18},43114:{symbol:"AVAX",decimals:18},20011e6:{symbol:"SOL",decimals:9}};function zo(e){const t=Number(e);return Number.isFinite(t)?0===t?"0":Oo(e,t>=1?4:t>=.01?6:8):e}var Wo=pr('<div><span>s</span><svg width=14 height=14 viewBox="0 0 16 16"><circle cx=8 cy=8 r=6 fill=none stroke=var(--tf-border) stroke-width=2></circle><circle cx=8 cy=8 r=6 fill=none stroke=var(--tf-accent) stroke-width=2 stroke-linecap=round transform="rotate(-90 8 8)"style="transition:stroke-dashoffset 1s linear">');function Bo(e){const t=2*Math.PI*6;return r=Wo(),i=(n=r.firstChild).firstChild,o=n.nextSibling,s=o.firstChild.nextSibling,kr(n,()=>e.secondsRemaining(),i),gt(i=>{var a="tf-216412",c="tf-fd32be",l="tf-52dc68",d=String(t),f=t*(1-e.secondsRemaining()/e.totalSeconds);return a!==i.e&&vr(r,i.e=a),c!==i.t&&vr(n,i.t=c),l!==i.a&&gr(o,"class",i.a=l),d!==i.o&&gr(s,"stroke-dasharray",i.o=d),f!==i.i&&gr(s,"stroke-dashoffset",i.i=f),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r;var r,n,i,o,s}const Ho="tf-1019c2",Qo="tf-4922f1",Ko="tf-57f45f",Vo="tf-d74ccc",Go="tf-92e7a8",Yo="tf-a9a96f",Xo="tf-0134eb",Jo="tf-1ac2ef",Zo="tf-68a980";var es=pr("<div part=price-preview aria-hidden=true><div><div></div><div></div></div><div><div></div><div></div></div><div><div></div><div></div></div><div><div></div><div>"),ts=pr("<div><span></span><span>1 <!> = <!> "),rs=pr("<div><span></span><span>"),ns=pr("<div><span>"),is=pr("<div part=price-preview>");function os(){return e=es(),t=e.firstChild,r=t.firstChild,n=r.nextSibling,i=t.nextSibling,o=i.firstChild,s=o.nextSibling,a=i.nextSibling,c=a.firstChild,l=c.nextSibling,d=a.nextSibling,f=d.firstChild,u=f.nextSibling,gt(h=>{var p=`${Ho} tf-a57ec8`,g=Vo,v=`${Jo} ${Go}`,b=`${Jo} ${Yo}`,m=Vo,y=`${Jo} ${Go}`,w=`${Jo} ${Yo} ${Xo}`,x=Vo,k=`${Jo} ${Go} tf-d20f50`,T=`${Jo} ${Yo} tf-91635c`,I=Vo,S=`${Jo} ${Go}`,C=`${Jo} ${Yo} ${Xo}`;return p!==h.e&&vr(e,h.e=p),g!==h.t&&vr(t,h.t=g),v!==h.a&&vr(r,h.a=v),b!==h.o&&vr(n,h.o=b),m!==h.i&&vr(i,h.i=m),y!==h.n&&vr(o,h.n=y),w!==h.s&&vr(s,h.s=w),x!==h.h&&vr(a,h.h=x),k!==h.r&&vr(c,h.r=k),T!==h.d&&vr(l,h.d=T),I!==h.l&&vr(d,h.l=I),S!==h.u&&vr(f,h.u=S),C!==h.c&&vr(u,h.c=C),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0}),e;var e,t,r,n,i,o,s,a,c,l,d,f,u}function ss(e){const t=bt(()=>function(e,t){const{symbol:r,decimals:n}=function(e){return Lo[e]??{symbol:"ETH",decimals:18}}(t),i=(e??"").trim();if(!i)return{amount:"0",symbol:r};try{return i.includes(".")?{amount:zo(i),symbol:r}:{amount:zo(So(i,n)),symbol:r}}catch{return{amount:i,symbol:r}}}(e.route.quote.estimatedGas,e.fromToken.chainId)),r=[(l=ts(),d=l.firstChild,f=d.nextSibling,u=f.firstChild.nextSibling,h=u.nextSibling.nextSibling,h.nextSibling,kr(d,()=>Ui("swap.rate")),kr(f,()=>e.fromToken.symbol??"?",u),kr(f,()=>{const t=e.fromToken.decimals??18,r=e.toToken.decimals??18;return Ao(Oo(Eo(e.route.quote.amountIn,t,e.route.quote.amountOut,r),4))},h),kr(f,()=>e.toToken.symbol??"?",null),gt(e=>{var t=Qo,r=Ko;return t!==e.e&&vr(l,e.e=t),r!==e.t&&vr(f,e.t=r),e},{e:void 0,t:void 0}),l),(s=rs(),a=s.firstChild,c=a.nextSibling,kr(a,()=>Ui("swap.fee")),kr(c,Kt(rr,{get when(){return e.route.quote.estimatedGas},fallback:"-",get children(){return["~",Kt(Gi,{get value(){return t().amount},digits:8})," ",ur(()=>t().symbol)]}})),gt(e=>{var t=Qo,r=Ko;return t!==e.e&&vr(s,e.e=t),r!==e.t&&vr(c,e.t=r),e},{e:void 0,t:void 0}),s),(n=rs(),i=n.firstChild,o=i.nextSibling,kr(i,()=>Ui("swap.estTime")),kr(o,()=>{return(t=e.route.quote.expectedDurationSeconds)>=60?Ui("time.minutes",{value:Math.round(t/60)}):Ui("time.seconds",{value:t});var t}),gt(e=>{var t=Qo,r=Ko;return t!==e.e&&vr(n,e.e=t),r!==e.t&&vr(o,e.t=r),e},{e:void 0,t:void 0}),n)];var n,i,o,s,a,c,l,d,f,u,h;return Kt(rr,{get when(){return!e.inline},get fallback(){return[r,Kt(rr,{get when(){return e.showCountdown?.()},get children(){var t=ns();return kr(t.firstChild,()=>Ui("quote.refresh")),kr(t,Kt(Bo,{get secondsRemaining(){return e.countdownSeconds},get totalSeconds(){return e.countdownTotal??30}}),null),gt(()=>vr(t,Qo)),t}})]},get children(){var t=is();return kr(t,r,null),kr(t,Kt(rr,{get when(){return e.showCountdown?.()},get children(){var t=ns();return kr(t.firstChild,()=>Ui("quote.refresh")),kr(t,Kt(Bo,{get secondsRemaining(){return e.countdownSeconds},get totalSeconds(){return e.countdownTotal??30}}),null),gt(()=>vr(t,Qo)),t}}),null),gt(()=>vr(t,Ho)),t}})}const as="tf-6c1e97",cs="tf-142024",ls="tf-3b42da",ds="tf-2f811b",fs="tf-c7ba0f",us="tf-66007c",hs="tf-12c6bb",ps="tf-140273",gs="tf-45030f",vs="tf-ce0622",bs="tf-0c1692",ms="tf-64aa3f",ys="tf-25e112",ws="tf-478cb9",xs="tf-125be5",ks="tf-9171a2",Ts="tf-43fbf4",Is="tf-61ca3c";var Ss=pr("<div>"),Cs=pr("<button data-testid=pay-selected><div><div data-testid=pay-token-icon-wrap><div data-testid=pay-token-chain-dot></div></div><div><div><span data-testid=pay-token-symbol></span></div><span data-testid=pay-token-chain-name></span></div></div><div><div data-testid=pay-selected-amount></div></div><span data-testid=pay-selected-caret>"),Es=pr("<div><button data-testid=browse-all> "),As=pr("<div><div><div><div><span data-testid=selector-title></span><button data-testid=selector-close></button></div></div><div data-testid=pay-selector-list>"),Os=pr("<div part=payment-list>"),Rs=pr('<div data-testid=pay-empty-icon><svg width=32 height=32 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round><circle cx=12 cy=12 r=10></circle><path d="M12 6v6l4 2">'),Ps=pr("<span data-testid=pay-empty-text>"),Ns=pr("<span>"),Ds=pr("<div data-testid=pay-empty>"),_s=pr('<div data-testid=pay-empty-icon><svg width=32 height=32 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round><rect x=1 y=5 width=22 height=16 rx=2></rect><path d="M16 14h.01"></path><path d="M1 10h22">'),Fs=pr("<span data-testid=best-badge>"),Us=pr("<button><div><div data-testid=pay-token-icon-wrap><div data-testid=pay-token-chain-dot></div></div><div><div><span data-testid=pay-selector-item-symbol></span></div><span data-testid=pay-selector-item-chain></span></div></div><div><div data-testid=pay-selector-item-amount>");function qs(e){const t=()=>e.tokens[e.selectedIndex]??e.tokens[0];return kr(r=Os(),Kt(rr,{get when(){return e.tokens.some(e=>!e.disabled)},get fallback(){return kr(t=Ds(),Kt(rr,{get when(){return e.isConnected},get fallback(){return[(t=_s(),gt(()=>vr(t,us)),t),(e=Ps(),kr(e,()=>Ui("receive.connectToSeeTokens")),gt(()=>vr(e,hs)),e)];var e,t},get children(){return[(r=Rs(),gt(()=>vr(r,us)),r),(t=Ps(),kr(t,()=>Ui("receive.noPaymentOptions")),gt(()=>vr(t,hs)),t),(e=Ns(),kr(e,()=>Ui("receive.noPaymentHint")),gt(()=>vr(e,"tf-7a8fe0")),e)];var e,t,r}})),gt(()=>vr(t,"tf-5fb6ad")),t;var t},get children(){var r,n=Cs(),i=n.firstChild,o=i.firstChild,s=o.firstChild,a=o.nextSibling,c=a.firstChild,l=c.firstChild,d=c.nextSibling,f=i.nextSibling,u=f.firstChild,h=f.nextSibling;return br(n,"click",e.onOpenSelector),kr(o,Kt(Ei,{get symbol(){return t().symbol},get color(){return t().color},size:32,get logoURI(){return t().logoURI}}),s),kr(s,Kt(Ai,{color:null,size:12,get iconUrl(){return ur(()=>void 0!==t().chainId)()?Ii(e.apiEndpoint,t().chainId):void 0}})),kr(l,()=>t().symbol),kr(c,(r=ur(()=>!!t().best),()=>{return r()&&(kr(e=Fs(),()=>Ui("receive.best")),gt(()=>vr(e,ds)),e);var e}),null),kr(d,()=>t().chain),kr(u,()=>t().amount),kr(f,Kt(rr,{get when(){return t().amountUsd},get children(){var e=Ss();return kr(e,()=>t().amountUsd),gt(()=>vr(e,"tf-c11354")),e}}),null),kr(h,Kt(si,{size:16})),gt(e=>{var t="tf-09818b",r=Ui("receive.changePayment"),p=fs,g=cs,v=ls,b="tf-dea0cb",m="tf-41931a",y="tf-b949b8",w="tf-6542b9",x="tf-3d2f5a",k="tf-9a379d",T="tf-864468";return t!==e.e&&vr(n,e.e=t),r!==e.t&&gr(n,"aria-label",e.t=r),p!==e.a&&vr(i,e.a=p),g!==e.o&&vr(o,e.o=g),v!==e.i&&vr(s,e.i=v),b!==e.n&&vr(a,e.n=b),m!==e.s&&vr(c,e.s=m),y!==e.h&&vr(l,e.h=y),w!==e.r&&vr(d,e.r=w),x!==e.d&&vr(f,e.d=x),k!==e.l&&vr(u,e.l=k),T!==e.u&&vr(h,e.u=T),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),n}}),null),kr(r,Kt(rr,{get when(){return e.selectorOpen},get children(){var t=As(),r=t.firstChild,n=r.firstChild,i=n.firstChild,o=i.firstChild,s=o.nextSibling,a=n.nextSibling;return kr(o,()=>Ui("receive.payWith")),br(s,"click",e.onCloseSelector),kr(s,Kt(ui,{size:16})),kr(a,Kt(tr,{get each(){return e.tokens},children:(t,r)=>{return i=Us(),o=i.firstChild,s=o.firstChild,a=s.firstChild,c=s.nextSibling,l=c.firstChild,d=l.firstChild,f=l.nextSibling,u=o.nextSibling,h=u.firstChild,br(i,"click",()=>{t.disabled||(e.onSelect(r()),e.onCloseSelector())}),kr(s,Kt(Ei,{get symbol(){return t.symbol},get color(){return t.color},size:36,get logoURI(){return t.logoURI}}),a),kr(a,Kt(Ai,{color:null,size:11,get iconUrl(){return ur(()=>void 0!==t.chainId)()?Ii(e.apiEndpoint,t.chainId):void 0}})),kr(d,()=>t.symbol),kr(l,(n=ur(()=>!!t.best),()=>{return n()&&(kr(e=Fs(),()=>Ui("receive.best")),gt(()=>vr(e,ds)),e);var e}),null),kr(f,()=>t.chain),kr(h,()=>t.balance),kr(u,Kt(rr,{get when(){return t.balanceUsd},get children(){var e=Ss();return kr(e,()=>t.balanceUsd),gt(()=>vr(e,"tf-7474a9")),e}}),null),gt(n=>{var p=`tf-176d77 ${r()===e.selectedIndex?"tf-2df5d9":""} ${t.disabled?"tf-dc503e":""}`,g=t.disabled,v="tf-ebbc44",b=cs,m=ls,y="tf-5f455f",w="tf-15ee78",x="tf-976d83",k="tf-ba2eec",T="tf-a37921",I="tf-cf71b6";return p!==n.e&&vr(i,n.e=p),g!==n.t&&(i.disabled=n.t=g),v!==n.a&&vr(o,n.a=v),b!==n.o&&vr(s,n.o=b),m!==n.i&&vr(a,n.i=m),y!==n.n&&vr(c,n.n=y),w!==n.s&&vr(l,n.s=w),x!==n.h&&vr(d,n.h=x),k!==n.r&&vr(f,n.r=k),T!==n.d&&vr(u,n.d=T),I!==n.l&&vr(h,n.l=I),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),i;var n,i,o,s,a,c,l,d,f,u,h}})),kr(r,Kt(rr,{get when(){return e.isConnected},get children(){var t=Es(),r=t.firstChild,n=r.firstChild;return br(r,"click",()=>{e.onCloseSelector(),e.onBrowseAll()}),kr(r,()=>Ui("receive.browseAll"),n),kr(r,Kt(ci,{size:14}),null),gt(e=>{var n="tf-772a9c",i="tf-22f94f";return n!==e.e&&vr(t,e.e=n),i!==e.t&&vr(r,e.t=i),e},{e:void 0,t:void 0}),t}}),null),gt(e=>{var c=Zo,l=ps,d=gs,f=vs,u=bs,h=ms,p="tf-8299cf";return c!==e.e&&vr(t,e.e=c),l!==e.t&&vr(r,e.t=l),d!==e.a&&vr(n,e.a=d),f!==e.o&&vr(i,e.o=f),u!==e.i&&vr(o,e.i=u),h!==e.n&&vr(s,e.n=h),p!==e.s&&vr(a,e.s=p),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),t}}),null),gt(()=>vr(r,"tf-d61a98")),r;var r}function $s(e){return new Map(e.map(e=>[e.id,e]))}class Ms extends Error{constructor(e,t,r){const n=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${n?`status code ${n}`:"an unknown error"}: ${t.method} ${t.url}`),je(this,"response"),je(this,"request"),je(this,"options"),this.name="HTTPError",this.response=e,this.request=t,this.options=r}}class js extends Error{constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),je(this,"name","NonError"),je(this,"value"),this.value=e}}class Ls extends Error{constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new js(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),je(this,"name","ForceRetryError"),je(this,"customDelay"),je(this,"code"),je(this,"customRequest"),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}const zs=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,n="function"==typeof globalThis.Request;if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&"unsupported BodyInit type"===i.message)return!1;throw i}return e&&!t})(),Ws="function"==typeof globalThis.AbortController,Bs="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Hs="function"==typeof globalThis.ReadableStream,Qs="function"==typeof globalThis.FormData,Ks=["get","post","put","patch","head","delete"],Vs={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Gs=2147483647,Ys=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Xs=Symbol("stop");class Js{constructor(e){je(this,"options"),this.options=e}}const Zs=e=>new Js(e),ea={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},ta={next:!0},ra={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},na=(e,t,r)=>{let n,i=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),n){i+=n.byteLength;let e=0===t?0:i/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,i),transferredBytes:i},n)}n=e},flush(){n&&(i+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},n))}}))},ia=e=>null!==e&&"object"==typeof e,oa=(...e)=>{for(const t of e)if((!ia(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return da({},...e)},sa=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(const[o,s]of i.entries())n&&"undefined"===s||void 0===s?r.delete(o):r.set(o,s);return r};function aa(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:da(e[r]??[],t[r]??[])}const ca=(e={},t={})=>({beforeRequest:aa(e,t,"beforeRequest"),beforeRetry:aa(e,t,"beforeRetry"),afterResponse:aa(e,t,"afterResponse"),beforeError:aa(e,t,"beforeError")}),la=(e,t)=>{const r=new URLSearchParams;for(const n of[e,t])if(void 0!==n)if(n instanceof URLSearchParams)for(const[e,t]of n.entries())r.append(e,t);else if(Array.isArray(n))for(const e of n){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(ia(n))for(const[e,t]of Object.entries(n))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(n);for(const[t,n]of e.entries())r.append(t,n)}return r},da=(...e)=>{let t,r={},n={},i={};const o=[];for(const s of e)if(Array.isArray(s))Array.isArray(r)||(r=[]),r=[...r,...s];else if(ia(s)){for(let[e,n]of Object.entries(s))if("signal"===e&&n instanceof globalThis.AbortSignal)o.push(n);else if("context"!==e)"searchParams"!==e?(ia(n)&&e in r&&(n=da(r[e],n)),r={...r,[e]:n}):t=null==n?void 0:void 0===t?n:la(t,n);else{if(null!=n&&(!ia(n)||Array.isArray(n)))throw new TypeError("The `context` option must be an object");r={...r,context:null==n?{}:{...r.context,...n}}}ia(s.hooks)&&(i=ca(i,s.hooks),r.hooks=i),ia(s.headers)&&(n=sa(n,s.headers),r.headers=n)}return void 0!==t&&(r.searchParams=t),o.length>0&&(1===o.length?r.signal=o[0]:r.signal=Bs?AbortSignal.any(o):o.at(-1)),r},fa=e=>Ks.includes(e)?e.toUpperCase():e,ua={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},ha=(e={})=>{if("number"==typeof e)return{...ua,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&(e.methods=e.methods.map(e=>e.toLowerCase())),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...ua,...t}};class pa extends Error{constructor(e){super(`Request timed out: ${e.method} ${e.url}`),je(this,"request"),this.name="TimeoutError",this.request=e}}const ga=class e{constructor(t,r={}){var n;if(We(this,Ee),je(this,"request"),We(this,we),We(this,xe,0),We(this,ke),We(this,Te),We(this,Ie),We(this,Se),We(this,Ce),Be(this,ke,t),Be(this,Te,{...r,headers:sa(ze(this,ke).headers,r.headers),hooks:ca({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:fa(r.method??ze(this,ke).method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:ha(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}}),"string"!=typeof ze(this,ke)&&!(ze(this,ke)instanceof URL||ze(this,ke)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(ze(this,Te).prefixUrl&&"string"==typeof ze(this,ke)){if(ze(this,ke).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");ze(this,Te).prefixUrl.endsWith("/")||(ze(this,Te).prefixUrl+="/"),Be(this,ke,ze(this,Te).prefixUrl+ze(this,ke))}Ws&&Bs&&(Be(this,Se,ze(this,Te).signal??ze(this,ke).signal),Be(this,we,new globalThis.AbortController),ze(this,Te).signal=ze(this,Se)?AbortSignal.any([ze(this,Se),ze(this,we).signal]):ze(this,we).signal),zs&&(ze(this,Te).duplex="half"),void 0!==ze(this,Te).json&&(ze(this,Te).body=ze(this,Te).stringifyJson?.(ze(this,Te).json)??JSON.stringify(ze(this,Te).json),ze(this,Te).headers.set("content-type",ze(this,Te).headers.get("content-type")??"application/json"));const i=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(ze(this,ke)instanceof globalThis.Request&&(Qs&&ze(this,Te).body instanceof globalThis.FormData||ze(this,Te).body instanceof URLSearchParams)&&!i&&ze(this,Te).headers.delete("content-type"),this.request=new globalThis.Request(ze(this,ke),ze(this,Te)),void 0!==(o=ze(this,Te).searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0:"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t="?"+("string"==typeof ze(this,Te).searchParams?ze(this,Te).searchParams.replace(/^\?/,""):new URLSearchParams(He(n=e,me,ye).call(n,ze(this,Te).searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,ze(this,Te))}var o;if(ze(this,Te).onUploadProgress){if("function"!=typeof ze(this,Te).onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!zs)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=He(this,Ee,qe).call(this,this.request,ze(this,Te).body??void 0)}}static create(t,r){var n;const i=new e(t,r),o=He(n=i,Ee,De).call(n,async()=>{var e,t,r,n,o,s,a,c,l,d,f,u;if("number"==typeof ze(i,Te).timeout&&ze(i,Te).timeout>Gs)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let h=await He(e=i,Ee,_e).call(e);for(const g of ze(i,Te).hooks.afterResponse){const e=He(t=i,Ee,Re).call(t,h.clone());let d;try{d=await g(i.request,He(r=i,Ee,Fe).call(r),e,{retryCount:ze(i,xe)})}catch(p){throw He(n=i,Ee,Ne).call(n,e),He(o=i,Ee,Ne).call(o,h),p}if(d instanceof Js)throw He(s=i,Ee,Ne).call(s,e),He(a=i,Ee,Ne).call(a,h),new Ls(d.options);const f=d instanceof globalThis.Response?d:h;e!==f&&He(c=i,Ee,Ne).call(c,e),h!==f&&He(l=i,Ee,Ne).call(l,h),h=f}if(He(d=i,Ee,Re).call(d,h),!h.ok&&("function"==typeof ze(i,Te).throwHttpErrors?ze(i,Te).throwHttpErrors(h.status):ze(i,Te).throwHttpErrors)){let e=new Ms(h,i.request,He(f=i,Ee,Fe).call(f));for(const t of ze(i,Te).hooks.beforeError)e=await t(e,{retryCount:ze(i,xe)});throw e}if(ze(i,Te).onDownloadProgress){if("function"!=typeof ze(i,Te).onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Hs)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=h.clone();return He(u=i,Ee,Ne).call(u,h),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(na(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(e,ze(i,Te).onDownloadProgress)}return h}).finally(()=>{var e,t;const r=ze(i,Ie);He(e=i,Ee,Pe).call(e,r?.body??void 0),He(t=i,Ee,Pe).call(t,i.request.body??void 0)});for(const[e,s]of Object.entries(Vs))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(o[e]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||s);const t=await o;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return o}};me=new WeakSet,ye=function(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))},we=new WeakMap,xe=new WeakMap,ke=new WeakMap,Te=new WeakMap,Ie=new WeakMap,Se=new WeakMap,Ce=new WeakMap,Ee=new WeakSet,Ae=function(){const e=ze(this,Te).retry.delay(ze(this,xe));let t=e;!0===ze(this,Te).retry.jitter?t=Math.random()*e:"function"==typeof ze(this,Te).retry.jitter&&(t=ze(this,Te).retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=ze(this,Te).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)},Oe=async function(e){if(Qe(this,xe)._++,ze(this,xe)>ze(this,Te).retry.limit)throw e;const t=e instanceof Error?e:new js(e);if(t instanceof Ls)return t.customDelay??He(this,Ee,Ae).call(this);if(!ze(this,Te).retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==ze(this,Te).retry.shouldRetry){const r=await ze(this,Te).retry.shouldRetry({error:t,retryCount:ze(this,xe)});if(!1===r)throw e;if(!0===r)return He(this,Ee,Ae).call(this)}if(function(e){return e instanceof pa||e?.name===pa.name}(e)&&!ze(this,Te).retry.retryOnTimeout)throw e;if(function(e){return e instanceof Ms||e?.name===Ms.name}(e)){if(!ze(this,Te).retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&ze(this,Te).retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=ze(this,Te).retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return He(this,Ee,Ae).call(this)},Re=function(e){return ze(this,Te).parseJson&&(e.json=async()=>ze(this,Te).parseJson(await e.text())),e},Pe=function(e){e&&e.cancel().catch(()=>{})},Ne=function(e){He(this,Ee,Pe).call(this,e.body??void 0)},De=async function(e){try{return await e()}catch(t){const r=Math.min(await He(this,Ee,Oe).call(this,t),Gs);if(ze(this,xe)<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,n)=>{function i(){clearTimeout(o),n(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));const o=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}(r,ze(this,Se)?{signal:ze(this,Se)}:{}),t instanceof Ls&&t.customRequest){const e=ze(this,Te).signal?new globalThis.Request(t.customRequest,{signal:ze(this,Te).signal}):new globalThis.Request(t.customRequest);He(this,Ee,Ue).call(this,e)}for(const e of ze(this,Te).hooks.beforeRetry){const r=await e({request:this.request,options:He(this,Ee,Fe).call(this),error:t,retryCount:ze(this,xe)});if(r instanceof globalThis.Request){He(this,Ee,Ue).call(this,r);break}if(r instanceof globalThis.Response)return r;if(r===Xs)return}return He(this,Ee,De).call(this,e)}},_e=async function(){ze(this,we)?.signal.aborted&&(Be(this,we,new globalThis.AbortController),ze(this,Te).signal=ze(this,Se)?AbortSignal.any([ze(this,Se),ze(this,we).signal]):ze(this,we).signal,this.request=new globalThis.Request(this.request,{signal:ze(this,Te).signal}));for(const t of ze(this,Te).hooks.beforeRequest){const e=await t(this.request,He(this,Ee,Fe).call(this),{retryCount:ze(this,xe)});if(e instanceof Response)return e;if(e instanceof globalThis.Request){He(this,Ee,Ue).call(this,e);break}}const e=((e,t)=>{const r={};for(const n in t)Object.hasOwn(t,n)&&(n in ra||n in ea||n in e&&!(n in ta)||(r[n]=t[n]));return r})(this.request,ze(this,Te));return Be(this,Ie,this.request),this.request=ze(this,Ie).clone(),!1===ze(this,Te).timeout?ze(this,Te).fetch(ze(this,Ie),e):async function(e,t,r,n){return new Promise((i,o)=>{const s=setTimeout(()=>{r&&r.abort(),o(new pa(e))},n.timeout);n.fetch(e,t).then(i).catch(o).then(()=>{clearTimeout(s)})})}(ze(this,Ie),e,ze(this,we),ze(this,Te))},Fe=function(){if(!ze(this,Ce)){const{hooks:e,...t}=ze(this,Te);Be(this,Ce,Object.freeze(t))}return ze(this,Ce)},Ue=function(e){Be(this,Ce,void 0),this.request=He(this,Ee,qe).call(this,e)},qe=function(e,t){return ze(this,Te).onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const n=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=Ys,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof n?(new TextEncoder).encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:na(e.body,n,t)})})(e,ze(this,Te).onUploadProgress,t??ze(this,Te).body??void 0):e},We(ga,me);let va=ga;
|
|
8
|
+
/*! MIT License © Sindre Sorhus */const ba=e=>{const t=(t,r)=>va.create(t,oa(e,r));for(const r of Ks)t[r]=(t,n)=>va.create(t,oa(e,n,{method:r}));return t.create=e=>ba(oa(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),ba(oa(e,t))),t.stop=Xs,t.retry=Zs,t},ma=ba(),ya="https://api.hyperstream.dev";class wa{constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,""),this.ky=ma.create({prefixUrl:this.baseUrl,timeout:15e3,retry:0,headers:{"X-TF-SDK-Version":"0.0.4"}})}async request(e){try{return await e}catch(t){if(t instanceof Ye)throw t;if(t instanceof pa)throw new Ye(Ve.API_TIMEOUT,"API request timed out",t);if(t instanceof Ms){let e="";try{e=await t.response.json()}catch{e=await t.response.text().catch(()=>"")}const r="object"==typeof e&&null!==e&&"message"in e?String(e.message):`API request failed: ${t.response.status} ${t.response.statusText}`;throw new Ye(Ve.API_REQUEST_FAILED,r,{status:t.response.status,body:e})}throw new Ye(Ve.API_REQUEST_FAILED,`API request failed: ${String(t)}`,t)}}getQuotes(e,t){return this.request(this.ky.post("v1/quotes",{json:e,signal:t}).json())}buildDeposit(e,t){return this.request(this.ky.post("v1/deposit/build",{json:e,signal:t}).json())}submitDeposit(e,t){return this.request(this.ky.put("v1/deposit/submit",{json:e,signal:t}).json())}getOrdersByAddress(e,t){const r={};return t?.orderIds?.length&&(r.orderIds=t.orderIds.join(",")),t?.limit&&(r.limit=t.limit.toString()),t?.cursor&&(r.cursor=t.cursor.toString()),this.request(this.ky.get(`v1/orders/${encodeURIComponent(e)}`,{searchParams:r}).json())}async getOrderById(e,t){return(await this.getOrdersByAddress(e,{orderIds:[t]})).data[0]??null}getTokens(e){const t={};return e?.q&&(t.q=e.q),e?.chainIds?.length&&(t.chainIds=e.chainIds.join(",")),e?.limit&&(t.limit=e.limit.toString()),e?.cursor&&(t.cursor=e.cursor.toString()),this.request(this.ky.get("v1/tokens",{searchParams:t}).json())}searchTokens(e,t){const r={q:e};return t?.chainIds?.length&&(r.chainIds=t.chainIds.join(",")),this.request(this.ky.get("v1/tokens/search",{searchParams:r}).json())}getTopTokens(e){const t={};return e?.chainIds?.length&&(t.chainIds=e.chainIds.join(",")),this.request(this.ky.get("v1/tokens/top",{searchParams:t}).json())}getTokenBalances(e,t){const r={};return t?.chainIds?.length&&(r.chainIds=t.chainIds.join(",")),this.request(this.ky.get(`v1/tokens/balances/${encodeURIComponent(e)}`,{searchParams:r}).json())}getChains(){return this.request(this.ky.get("v1/chains").json())}}const xa=new class extends Rn{constructor(e={}){super(e)}}({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}}),ka="tf:token:";function Ta(e,t,r){return["tokenInfo",r??"__default__",e,t.toLowerCase()]}function Ia(e,t){return`${ka}${e}:${t.toLowerCase()}`}function Sa(e,t){xa.setQueryData(Ta(e.chainId,e.address,t),e)}function Ca(e,t){(function(e){try{const t=Ia(e.chainId,e.address),r={token:e,timestamp:Date.now()};localStorage.setItem(t,JSON.stringify(r)),function(){const e=[];for(let r=0;r<localStorage.length;r++){const t=localStorage.key(r);if(t?.startsWith(ka))try{const r=localStorage.getItem(t);if(r){const n=JSON.parse(r);e.push({key:t,timestamp:n.timestamp})}}catch{t&&localStorage.removeItem(t)}}if(e.length<=200)return;e.sort((e,t)=>e.timestamp-t.timestamp);const t=e.length-200;for(let r=0;r<t;r++)localStorage.removeItem(e[r].key)}()}catch{}})(e),Sa(e,t)}async function Ea(e,t,r,n){const i=(n?.baseUrl??r)?.replace(/\/$/,""),o=function(e,t,r){return xa.getQueryData(Ta(e,t,r))??null}(e,t,i);if(o)return o;const s=function(e,t){try{const r=Ia(e,t),n=localStorage.getItem(r);if(!n)return null;const i=JSON.parse(n);return Date.now()-i.timestamp>864e5?(localStorage.removeItem(r),null):i.token}catch{return null}}(e,t);if(s)return Sa(s,i),s;if(n||r)try{const o=n??new wa({baseUrl:r}),s=(r=>{const n=t.toLowerCase();return r.find(t=>Number(t.chainId)===e&&t.address.toLowerCase()===n)})((await o.searchTokens(t,{chainIds:[e]})).data??[]);if(s){const r={chainId:(a=s).chainId??e,address:a.address??t,symbol:a.symbol,name:a.name,decimals:a.decimals,logoURI:a.logoURI,...Number.isFinite(Number(a.extensions?.price?.usd??""))?{priceUsd:Number(a.extensions?.price?.usd??"")}:{}};return Ca(r,i),r}throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,`Token not found for chain ${e}: ${t}`)}catch(c){if(c instanceof Ye)throw c}var a;return{chainId:e,address:t,decimals:void 0}}const Aa=[{thresholdMs:1e4,intervalMs:1e3},{thresholdMs:3e4,intervalMs:2e3},{thresholdMs:6e4,intervalMs:3e3},{thresholdMs:12e4,intervalMs:5e3}];function Oa(e,t){return Zn(()=>({queryKey:["chains",e()?.baseUrl??"__default__"],queryFn:async()=>{const t=e();if(!t)throw new Error("Missing client");return t.getChains()},enabled:t()&&!!e(),staleTime:6e5}))}function Ra(e,t,r,n){return Zn(()=>({queryKey:["tokenBalances",e()?.baseUrl??"__default__",t(),n?.()?.join(",")??"all"],queryFn:async()=>{const r=e(),i=t();if(!r||!i)throw new Error("Missing client or address");const o=to(i,"solana"),s=n?.()?.filter(o?Xi:Ji);return r.getTokenBalances(i,s?.length?{chainIds:s}:void 0)},enabled:r()&&!!e()&&!!t(),staleTime:3e4}))}var Pa=pr("<div><button data-testid=chain-filter-btn>All Chains"),Na=pr("<div role=dialog part=token-selector data-testid=selector><div><div><span data-testid=selector-title></span><button data-testid=selector-close></button></div><div><span></span><input data-testid=selector-search-input></div></div><div></div><div>"),Da=pr("<div aria-hidden=true>"),_a=pr("<div>"),Fa=pr("<button data-testid=chain-filter-btn>"),Ua=pr("<div><div><div></div><div><div></div><div></div></div></div><div><div></div><div>"),qa=pr("<div style=padding:20px;text-align:center;color:var(--tf-text-tertiary);font-size:var(--tf-font-md)>"),$a=pr("<div><div></div><div>"),Ma=pr("<button data-testid=token-list-item><div><div><div></div></div><div><span></span><span>");const ja=["108px","80px","92px","84px"],La=[0,1,2,3,4];function za(e,t){const r=Number(e.chainId),n=Number.isFinite(r)?r:0,i=n>0?t?.get(n):void 0,o="number"==typeof e.decimals&&e.decimals>=0?e.decimals:18,s=e.extensions?.balance,a=void 0!==s&&"0"!==s,c=void 0!==s?a?Ao(Oo(So(s,o),2)):"0":null,l=Number(e.extensions?.price?.usd??""),d=a?Number(So(s,o)):0,f=Number.isFinite(l)&&Number.isFinite(d)?d*l:0;return{symbol:e.symbol,name:e.name,chain:i?.name??(n>0?`Chain ${n}`:"Unknown Chain"),chainId:n,color:"#888",balance:c,usd:null!==c?(u=f,!Number.isFinite(u)||u<=0?"$0":u<.01?"<$0.01":`$${Ao(u.toFixed(2).replace(/\.?0+$/,""))}`):"",address:e.address,decimals:o,logoURI:e.logoURI,priceUsd:Number.isFinite(l)?l:void 0};var u}function Wa(e){const t=()=>"from"===e.selectingFor,[r,n]=ht(""),[i,o]=function(e,t=500){const[r,n]=ht(e);let i=null;return Tt(()=>{null!==i&&clearTimeout(i)}),[r,e=>{null!==i&&clearTimeout(i),i=setTimeout(()=>{n(()=>e),i=null},t)},e=>{null!==i&&(clearTimeout(i),i=null),n(()=>e)}]}("",300),[s,a]=ht("All Chains"),[c,l]=ht(!1),d=Oa(()=>e.client??null,()=>!!e.client),f=bt(()=>{const t=d.data,r=e.supportedChainIds;if(!t)return[];if(r?.length){const e=new Set(r);return t.filter(t=>e.has(t.id))}return t}),u=bt(()=>d.isPending&&!d.data),h=()=>e.client?.baseUrl,p=bt(()=>{if("All Chains"===s())return e.supportedChainIds?.length?e.supportedChainIds:void 0;const t=f().find(e=>e.name===s());return t?[t.id]:void 0}),g=bt(()=>p()??(e.supportedChainIds?.length?e.supportedChainIds:void 0)),v=(b=()=>e.client??null,m=()=>!!e.client&&!t(),y=()=>p(),Zn(()=>({queryKey:["topTokens",b()?.baseUrl??"__default__",y?.()?.join(",")??"all"],queryFn:async()=>{const e=b();if(!e)throw new Error("Missing client");const t=y?.();return e.getTopTokens(t?.length?{chainIds:t}:void 0)},enabled:m()&&!!b(),staleTime:3e5})));var b,m,y;const w=Ra(()=>e.client??null,()=>e.walletAddress??null,()=>!!e.client&&!!e.walletAddress,()=>p()),x=function(r,n,o,s){return Zn(()=>({queryKey:["searchTokens",r()?.baseUrl??"__default__",n(),s?.()?.join(",")??"all"],queryFn:async()=>{const e=r(),t=n();if(!e||!t)throw new Error("Missing client or query");const i=s?.();return e.searchTokens(t,i?.length?{chainIds:i}:void 0)},select:e=>e.data,enabled:!(!e.client||t()||!i().trim()||!r()||!n()),staleTime:3e4}))}(()=>e.client??null,()=>i().trim(),0,()=>g()),k=bt(()=>{const e=d.data;return e?$s(e):new Map}),T=bt(()=>{const e=w.data;if(!e)return new Map;const t=new Map;for(const r of e)t.set(`${r.chainId}:${r.address.toLowerCase()}`,r);return t}),I=(e,t)=>{if(void 0!==e.extensions?.balance)return e;const r=t.get(`${e.chainId}:${e.address.toLowerCase()}`);return r?.extensions?.balance?{...e,extensions:{...e.extensions,balance:r.extensions.balance}}:e},S=bt(()=>{const e=k(),t=T(),r=v.data;return r?r.map(r=>za(I(r,t),e)):[]}),C=bt(()=>{const e=k(),t=w.data;return t?t.map(t=>za(t,e)):[]}),E=bt(()=>{const e=k(),t=T(),r=x.data;return r?r.map(r=>za(I(r,t),e)):null}),A=bt(()=>{if(null!==E())return E();const r=t()?C():S();return r.length>0?r:e.tokens??[]}),O=bt(()=>A().filter(e=>{if("All Chains"!==s()&&e.chain!==s())return!1;if(!x.data&&r()){const t=r().toLowerCase();if(!e.symbol.toLowerCase().includes(t)&&!e.name.toLowerCase().includes(t))return!1}return!0})),R=bt(()=>t()?(w.isPending||w.isFetching)&&!w.data:(v.isPending||v.isFetching)&&!v.data),P=bt(()=>x.isFetching&&!x.data),N=bt(()=>P()||R());return D=Na(),_=D.firstChild,F=_.firstChild,U=F.firstChild,q=U.nextSibling,$=F.nextSibling,M=$.firstChild,j=M.nextSibling,L=_.nextSibling,z=L.nextSibling,br(D,"keydown",t=>{"Escape"===t.key&&e.onClose()}),kr(U,()=>Ui("from"===e.selectingFor?"selector.title.from":"selector.title.to")),br(q,"click",e.onClose),kr(q,Kt(ui,{size:18})),kr(M,Kt(vi,{size:14})),br(j,"blur",()=>l(!1)),br(j,"focus",()=>l(!0)),br(j,"input",e=>{const t=e.target.value;n(t),o(t)}),kr(_,Kt(rr,{get when(){return!u()},get fallback(){return kr(e=Da(),Kt(tr,{each:ja,children:e=>{return yr(t=_a(),"width",e),gt(()=>vr(t,`${Jo} tf-bb4fb1`)),t;var t}})),gt(()=>vr(e,ys)),e;var e},get children(){var e=Pa(),t=e.firstChild,r=t.firstChild;return br(t,"click",()=>a("All Chains")),kr(t,Kt(Ai,{size:14}),r),kr(e,Kt(tr,{get each(){return f()},children:e=>{return br(t=Fa(),"click",()=>a(e.name)),kr(t,Kt(Ai,{size:14,get iconUrl(){return Ii(h(),e.id)}}),null),kr(t,()=>e.name,null),gt(()=>vr(t,`${ws} ${s()===e.name?xs:""}`)),t;var t}}),null),gt(r=>{var n=ys,i=`${ws} ${"All Chains"===s()?xs:""}`;return n!==r.e&&vr(e,r.e=n),i!==r.t&&vr(t,r.t=i),r},{e:void 0,t:void 0}),e}}),null),kr(z,Kt(rr,{get when(){return!N()},get fallback(){return kr(e=Da(),Kt(tr,{each:La,children:()=>{return e=Ua(),t=e.firstChild,r=t.firstChild,n=r.nextSibling,i=n.firstChild,o=i.nextSibling,s=t.nextSibling,a=s.firstChild,c=a.nextSibling,gt(l=>{var d="tf-c6ef08",f="tf-3643cf",u=`${Jo} tf-9b3d59`,h="tf-a4cc17",p=`${Jo} ${ks} tf-71ea5d`,g=`${Jo} ${ks} tf-dfb33a`,v="tf-7f1baf",b=`${Jo} ${ks} ${Ts}`,m=`${Jo} ${ks} ${Is}`;return d!==l.e&&vr(e,l.e=d),f!==l.t&&vr(t,l.t=f),u!==l.a&&vr(r,l.a=u),h!==l.o&&vr(n,l.o=h),p!==l.i&&vr(i,l.i=p),g!==l.n&&vr(o,l.n=g),v!==l.s&&vr(s,l.s=v),b!==l.h&&vr(a,l.h=b),m!==l.r&&vr(c,l.r=m),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),e;var e,t,r,n,i,o,s,a,c}})),gt(()=>vr(e,"tf-7ac0fe")),e;var e},get children(){return Kt(tr,{get each(){return O()},get fallback(){return kr(e=qa(),()=>Ui("selector.noResults")),e;var e},children:t=>{return r=Ma(),n=r.firstChild,i=n.firstChild,o=i.firstChild,s=i.nextSibling,a=s.firstChild,c=a.nextSibling,br(r,"click",()=>(t=>{t.address&&Ca({chainId:t.chainId,address:t.address,symbol:t.symbol,name:t.name,decimals:t.decimals,logoURI:t.logoURI,priceUsd:t.priceUsd}),e.onSelect(t)})(t)),kr(i,Kt(Ei,{get symbol(){return t.symbol},get color(){return t.color},size:36,get logoURI(){return t.logoURI}}),o),kr(o,Kt(Ai,{get color(){return null},size:11,get iconUrl(){return ur(()=>t.chainId>0)()?Ii(h(),t.chainId):void 0}})),kr(a,()=>t.symbol),kr(c,()=>t.chain),kr(r,Kt(rr,{get when(){return null!==t.balance},get children(){var e=$a(),r=e.firstChild,n=r.nextSibling;return kr(r,()=>t.balance),kr(n,()=>t.usd),gt(i=>{var o="tf-87740a",s=`${Ts} ${null===t.balance||"0"===t.balance?"tf-2ee375":""}`,a=Is;return o!==i.e&&vr(e,i.e=o),s!==i.t&&vr(r,i.t=s),a!==i.a&&vr(n,i.a=a),i},{e:void 0,t:void 0,a:void 0}),e}}),null),gt(e=>{var t="tf-512365",l="tf-a0b0d9",d="tf-1e7a62",f="tf-67f18a",u="tf-cd76b9",h="tf-8f4efd",p="tf-51bf2b";return t!==e.e&&vr(r,e.e=t),l!==e.t&&vr(n,e.t=l),d!==e.a&&vr(i,e.a=d),f!==e.o&&vr(o,e.o=f),u!==e.i&&vr(s,e.i=u),h!==e.n&&vr(a,e.n=h),p!==e.s&&vr(c,e.s=p),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),r;var r,n,i,o,s,a,c}})}})),gt(t=>{var r=ps,n=Ui("from"===e.selectingFor?"selector.title.from":"selector.title.to"),i=gs,o=vs,s=bs,a=ms,l=Ui("selector.close"),d="tf-9819ca "+(c()?"tf-d9fcd6":""),f="tf-4ad0e7",u="tf-9ea859",h=Ui("selector.search"),p="tf-ad5703",g="tf-de9986";return r!==t.e&&vr(D,t.e=r),n!==t.t&&gr(D,"aria-label",t.t=n),i!==t.a&&vr(_,t.a=i),o!==t.o&&vr(F,t.o=o),s!==t.i&&vr(U,t.i=s),a!==t.n&&vr(q,t.n=a),l!==t.s&&gr(q,"aria-label",t.s=l),d!==t.h&&vr($,t.h=d),f!==t.r&&vr(M,t.r=f),u!==t.d&&vr(j,t.d=u),h!==t.l&&gr(j,"placeholder",t.l=h),p!==t.u&&vr(L,t.u=p),g!==t.c&&vr(z,t.c=g),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0}),gt(()=>j.value=r()),D;var D,_,F,U,q,$,M,j,L,z}var Ba=pr("<div><div><span></span><button aria-label=Close></button></div><div><textarea rows=3 autocomplete=off></textarea></div><div><button>"),Ha=pr("<span>");function Qa(e){const[t,r]=ht(e.initialValue),n=bt(()=>{const r=t().trim();return!!r&&to(r,e.chainType)}),i=bt(()=>{const r=t().trim();return r.length>0&&!to(r,e.chainType)}),o=()=>{const r=t().trim();r&&n()&&e.onConfirm(r)};return a=Ba(),c=a.firstChild,l=c.firstChild,d=l.nextSibling,f=c.nextSibling,u=f.firstChild,h=f.nextSibling,p=h.firstChild,kr(l,()=>Ui("swap.recipientTitle")),br(d,"click",()=>e.onClose()),kr(d,Kt(ui,{size:18})),br(u,"keydown",e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),o())}),br(u,"input",e=>r(e.target.value)),gr(u,"spellcheck",!1),kr(f,(s=ur(()=>!!i()),()=>{return s()&&(kr(e=Ha(),()=>Ui("swap.recipientInvalid")),gt(()=>vr(e,"tf-9d4bba")),e);var e}),null),br(p,"click",o),kr(p,()=>Ui("swap.recipientConfirm")),gt(e=>{var t="tf-636daf",r="tf-fddfab",o="tf-970eb9",s="tf-de123a",g="tf-0445e3",v="tf-9a65ec "+(i()?"tf-c5ea21":""),b=Ui("swap.recipientPlaceholder"),m="tf-cb9b60",y=`${qi} tf-2cba65`,w=!n();return t!==e.e&&vr(a,e.e=t),r!==e.t&&vr(c,e.t=r),o!==e.a&&vr(l,e.a=o),s!==e.o&&vr(d,e.o=s),g!==e.i&&vr(f,e.i=g),v!==e.n&&vr(u,e.n=v),b!==e.s&&gr(u,"placeholder",e.s=b),m!==e.h&&vr(h,e.h=m),y!==e.r&&vr(p,e.r=y),w!==e.d&&(p.disabled=e.d=w),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),gt(()=>u.value=t()),a;var s,a,c,l,d,f,u,h,p}const Ka={eip155:{1:1,137:137,42161:42161,8453:8453,10:10,56:56,43114:43114},solana:{"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":20011e6}};function Va(e){if("object"==typeof e&&null!==e){if("number"!=typeof e.chainId||"string"!=typeof e.address)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"Token target must have numeric chainId and string address",e);return{chainId:e.chainId,address:e.address}}if("string"!=typeof e)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"Token identifier must be a string or TokenTarget object",e);if(e.startsWith("{")){try{const t=JSON.parse(e);if("number"==typeof t.chainId&&"string"==typeof t.address)return{chainId:t.chainId,address:t.address}}catch{}throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"Invalid JSON token identifier",e)}const t=e.split(":");if(3!==t.length)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,`Invalid CAIP-10 format: expected "namespace:reference:address", got "${e}"`,e);const[r,n,i]=t;if(!r||!n||!i)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,"CAIP-10 parts cannot be empty",e);const o=Ka[r];let s;if(o&&void 0!==o[n])s=o[n];else{if("eip155"!==r)throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,`Unknown CAIP-10 namespace: "${r}"`,e);if(s=parseInt(n,10),isNaN(s))throw new Ye(Ve.INVALID_TOKEN_IDENTIFIER,`Invalid EIP-155 chain reference: "${n}"`,e)}return{chainId:s,address:i}}function Ga(e){return e?.includes("1-click")??!1}function Ya(e){try{return e.startsWith("0x"),BigInt(e)}catch{return null}}function Xa(e,t){const r=[];for(const n of e){const e=Ya(n.quote.amountIn);if(null===e)continue;const i="EXACT_OUTPUT"===t&&"native"===n.exactOutMethod;r.push({routeId:n.routeId,amountIn:e,etaSeconds:Number.isFinite(n.quote.expectedDurationSeconds)?n.quote.expectedDurationSeconds:Number.MAX_SAFE_INTEGER,isGuaranteedOutput:i,isOneClick:Ga(n.tags)})}return r}function Ja(e){if(0===e.length)return[];let t=e[0].amountIn;for(const s of e)s.amountIn<t&&(t=s.amountIn);const r=1001n*t/1000n,n=[...e.filter(e=>e.amountIn<=r)].sort((e,t)=>{if(e.isGuaranteedOutput!==t.isGuaranteedOutput)return e.isGuaranteedOutput?-1:1;if(e.isOneClick!==t.isOneClick)return e.isOneClick?-1:1;const r=e.etaSeconds-t.etaSeconds;return 0!==r?r:e.amountIn>t.amountIn?1:e.amountIn<t.amountIn?-1:0}),i=new Set(n.map(e=>e.routeId)),o=e.filter(e=>!i.has(e.routeId)).sort((e,t)=>e.amountIn>t.amountIn?1:e.amountIn<t.amountIn?-1:0);return[...n.map(e=>e.routeId),...o.map(e=>e.routeId)]}const Za={ETH:["ETH","WETH"],USDC:["USDC","USDC.e","USDbC"],USDT:["USDT","USDT.e"]},ec={STABLES_MAJOR:["USDT","USDC","USDE","DAI","USDS","USD1","BUIDL","USDF","USDTB","PYUSD"],STABLE_WRAPPED:["USDE","SUSDE","USDS","SUSDS","DAI","SDAI"],BTC:["BTC","WBTC","TBTC","CBBTC","BTC.B","CKBTC"],ETH_LST_LRT:["ETH","WETH","STETH","WSTETH","RETH","CBETH","FRXETH","SFRXETH","OSETH","ETHX","METH","EETH","WEETH","EZETH","PUFETH","RSETH","WBETH"]},tc=new Set(["BTC","ETH","WETH","WBTC","USDC","USDT","DAI","BNB","XRP","SOL","TRX","DOGE","ADA","BCH","HYPE","XMR","LEO","LINK","MATIC","AVAX"]),rc=new Set(["USDC","USDT","DAI","USDE","USDS","USD1","USDF","USDG","RLUSD","USDD","BUSD","TUSD","USDP","FRAX","LUSD","GUSD","PYUSD"]),nc=new Set([1]),ic=new Set(["0x0000000000000000000000000000000000000000","0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","11111111111111111111111111111111"]);function oc(e){return!!e&&ic.has(e.toLowerCase())}function sc(e){return rc.has(e.toUpperCase())}function ac(e,t){const r=e.chainId===t.chainId,n=function(e,t){const r=e.toUpperCase(),n=t.toUpperCase();if(r===n)return!0;for(const i of Object.values(Za)){const e=i.some(e=>e.toUpperCase()===r),t=i.some(e=>e.toUpperCase()===n);if(e&&t)return!0}return!1}(e.symbol,t.symbol),i=function(e,t){const r=e.toUpperCase(),n=t.toUpperCase();for(const i of Object.values(ec)){const e=i.some(e=>e.toUpperCase()===r),t=i.some(e=>e.toUpperCase()===n);if(e&&t)return!0}return!1}(e.symbol,t.symbol),o=sc(e.symbol),s=sc(t.symbol),a=(c=e.symbol,tc.has(c.toUpperCase()));var c;return r&&n?1:n?2:i||o&&s?r?3:4:o&&!s?5:a?6:r?7:8}function cc(e){return nc.has(e)?1:0}function lc(e,t,r){return!!oc(e)||(r.get(t)??0)>=.1}function dc(e){return oc(e)&&(e.startsWith("0x")||e.startsWith("0X"))?"0x0000000000000000000000000000000000000000":e.toLowerCase()}function fc(e,t){return e.chainId===t.chainId&&dc(e.address)===dc(t.address)}function uc(e,t){return e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}const hc="tf-4c9136",pc="tf-febe61";var gc=pr("<div data-testid=selector-overlay>"),vc=pr("<div>"),bc=pr("<div part=container><div part=accent-line data-testid=accent-line>"),mc=pr("<img width=22 height=22>"),yc=pr("<button part=wallet-info><div data-testid=wallet-dot></div><span data-testid=wallet-address>"),wc=pr("<div part=header><div><span data-testid=header-title>"),xc=pr("<button part=recipient-badge data-testid=recipient-badge><span>"),kc=pr("<div><div data-testid=receive-section-label style=display:flex;justify-content:space-between;align-items:center><span></span></div><div part=target-token><div data-testid=receive-target-icon></div><span data-testid=receive-amount></span><span data-testid=receive-symbol></span><span>"),Tc=pr('<div style="padding:0 20px"><div>'),Ic=pr("<div part=price-preview data-testid=quote>"),Sc=pr("<div part=cta-wrapper>"),Cc=pr("<span>Flight"),Ec=pr('<div style="padding:0 20px"><div><div><div></div><div><div></div><div></div></div></div><div><div></div><div>'),Ac=pr('<div part=no-offer><div><svg width=28 height=28 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round><circle cx=11 cy=11 r=8></circle><path d="m21 21-4.35-4.35"></path><path d="M8 11h6"></path></svg></div><span>');function Oc(e){return oc(e)&&(e.startsWith("0x")||e.startsWith("0X"))?"0x0000000000000000000000000000000000000000":e.toLowerCase()}function Rc(e,t){return e.chainId===t.chainId&&Oc(e.address)===Oc(t.address)}function Pc(e){const t=function(){const[e,t]=ht(null),[r,n]=ht(""),[i,o]=ht(null),[s,a]=ht(null),[c,l]=ht(null),[d,f]=ht(null),[u,h]=ht(null),[p,g]=ht(null),[v,b]=ht(null);return{targetToken:e,targetAmount:r,fromToken:i,recipient:s,walletAddress:c,execPhase:d,order:u,error:p,errorCode:v,setTargetToken:t,setTargetAmount:n,setFromToken:o,setRecipient:function(e){s()!==e&&a(e)},setWalletAddress:function(e){c()!==e&&l(e)},setExecPhase:f,setOrder:h,setError:g,setErrorCode:b,clearError:function(){yt(()=>{g(null),b(null)})},reset:function(){yt(()=>{o(null),h(null),f(null),g(null),b(null)})}}}(),[r,n]=ht(0),[i,o]=ht(!1),[s,a]=ht(!1),[c,l]=ht([]),[d,f]=ht(!1),[u,h]=ht(null),{isConnected:p,walletAddress:g,handleConnect:v}=function(e){const[t,r]=ht(!1),[n,i]=ht(null),o=()=>{const t=e.walletAdapter();return t&&t.supportedActionTypes.some(e=>e.startsWith("solana_"))?"solana":"evm"};let s;return vt(xt(e.walletAdapter,a=>{if(s?.(),s=void 0,!a)return;const c=a.isConnected();r(c),c&&a.getAddress().then(t=>{i(t),e.onAddressChange(t),e.callbacks()?.onWalletConnected?.({address:t??"",chainType:o()})});const l=async()=>{const s=await a.getAddress();t()&&n()===s||(yt(()=>{r(!0),i(s),e.onAddressChange(s)}),e.callbacks()?.onWalletConnected?.({address:s??"",chainType:o()}))},d=()=>{t()&&(yt(()=>{r(!1),i(null),e.onAddressChange(null)}),e.onDisconnect?.())};a.on("connect",l),a.on("disconnect",d),s=()=>{a.off("connect",l),a.off("disconnect",d)}})),Tt(()=>s?.()),{isConnected:t,walletAddress:n,detectChainType:o,handleConnect:async()=>{const t=e.walletAdapter();if(t)try{await t.connect()}catch{e.onConnectError?.("Failed to connect wallet",Ve.WALLET_CONNECTION_FAILED)}else e.callbacks()?.onConnectWallet?.()}}}({walletAdapter:()=>e.walletAdapter,callbacks:()=>e.callbacks,onAddressChange:e=>t.setWalletAddress(e),onDisconnect:()=>{l([]),h(null)},onConnectError:(e,r)=>{t.setError(e),t.setErrorCode(r)}}),b=bt(()=>{const t=e.config.apiEndpoint??ya;return new wa({baseUrl:t})}),m=()=>b().baseUrl,y=bt(()=>function(e,t,r,n){return e||(t?"error":r&&0===n?"quoting":n>0?"quoted":"idle")}(t.execPhase(),t.error(),d(),c().length)),w=bt(()=>{const e=y();return"building"===e||"awaiting-wallet"===e||"submitting"===e||"tracking"===e}),[x,k]=ht(!1),T=bt(()=>!!e.config.recipient),{needRecipient:I,recipientDisplay:S,handleRecipientChange:C}=function(e){const t=bt(()=>{const t=e.toToken();if(!t||!e.isConnected())return!1;const r=e.walletAddress();return!!r&&!to(r,Zi(t.chainId))}),r=bt(()=>e.recipient()||(e.isConnected()&&e.walletAddress()&&!t()?e.walletAddress():null));return vt(xt(t,r=>{if(r&&!e.recipient()&&e.walletAdapter()){const r=e.toToken();if(!r)return;const n=Zi(r.chainId);e.walletAdapter().getAddress(n).then(r=>{r&&to(r,n)&&!e.recipient()&&t()&&e.setRecipient(r)}).catch(()=>{})}})),{needRecipient:t,recipientDisplay:r,handleRecipientChange:t=>{e.setRecipient(t.trim()||null)}}}({fromToken:u,toToken:t.targetToken,recipient:t.recipient,isConnected:p,walletAddress:g,walletAdapter:()=>e.walletAdapter,setRecipient:t.setRecipient}),E=Ra(b,g,()=>p()&&!!g(),()=>e.walletAdapter?.supportedChainIds);kt(()=>{e.config.locale&&async function(e){if("en-US"===e||"en"===e)return Ni("en-US"),void _i(Ri);const t=Fi[e];if(t){const r=await t();Ni(e),_i(r.default)}else Ni("en-US"),_i(Ri)}(e.config.locale),e.config.recipient&&t.setRecipient(e.config.recipient)});const A=Oa(b,()=>!0),O=bt(()=>{const e=A.data;return e?$s(e):new Map});kt(async()=>{const r=b(),n=Number(e.config.amount);if(!Number.isFinite(n)||n<=0)return t.setError("Invalid amount: must be greater than zero"),void t.setErrorCode(Ve.INVALID_AMOUNT);try{const n=Va(e.config.target),o=await Ea(n.chainId,n.address,e.config.apiEndpoint,r);if("number"!=typeof o.decimals)return t.setError("Failed to resolve target token metadata"),void t.setErrorCode(Ve.INVALID_CONFIG);if(t.setTargetToken(o),t.setTargetAmount(e.config.amount),e.config.fromToken)try{const t=Va(e.config.fromToken),n=await Ea(t.chainId,t.address,e.config.apiEndpoint,r);"number"==typeof n.decimals&&h({address:n.address,chainId:n.chainId,symbol:n.symbol??n.address.slice(0,6),name:n.name??n.symbol??n.address,decimals:n.decimals,logoURI:n.logoURI,...void 0!==n.priceUsd?{extensions:{price:{usd:String(n.priceUsd)}}}:{}})}catch(i){e.callbacks?.onSwapError?.({code:Ve.INVALID_TOKEN_IDENTIFIER,message:`Failed to resolve fromToken: ${i instanceof Error?i.message:String(i)}`})}}catch(i){t.setError(i instanceof Error?i.message:"Failed to resolve target token"),t.setErrorCode(Ve.INVALID_CONFIG)}});const R=bt(()=>{const r=E.data,n=t.targetToken();if(!r||0===r.length||!n)return[];const i=e.walletAdapter?.supportedChainIds,o=i?.length?r.filter(e=>i.includes(e.chainId)):r;if(0===o.length)return[];const s=n.priceUsd??1,a=Number(e.config.amount)*s;return function(e,t,r,n,i){if(0===e.length)return[];const o=function(e){const t=new Map;for(const r of e){if(!oc(r.address))continue;const e=r.extensions?.balance??"0";if("0"===e)continue;const n=Number(So(e,r.decimals)),i=Number(r.extensions?.price?.usd??"0");if(i<=0)continue;const o=n*i,s=t.get(r.chainId)??0;t.set(r.chainId,s+o)}return t}(e),s={address:n,chainId:r},a=[];for(const c of e){if(fc(c,s))continue;const e=c.extensions?.balance;if(!e||"0"===e)continue;const n=Number(c.extensions?.price?.usd??"0");if(n<=0)continue;const l=Number(So(e,c.decimals))*n;if(l<1)continue;if(void 0!==i&&l<i)continue;if(!lc(c.address,c.chainId,o))continue;const d=ac({symbol:c.symbol,chainId:c.chainId},{symbol:t,chainId:r});a.push({token:c,tier:d,gasCostScore:cc(c.chainId)})}return a.sort((e,t)=>e.tier!==t.tier?e.tier-t.tier:e.gasCostScore-t.gasCostScore),a.map(e=>e.token)}(o,n.symbol??"",n.chainId,n.address,a>0?a:void 0)});vt(xt(R,e=>{const t=y();e.length>0&&("idle"===t||"error"===t)&&q(e)})),vt(xt(()=>t.recipient(),()=>{const e=R(),t=y();e.length>0&&("idle"===t||"quoted"===t||"error"===t)&&q(e)},{defer:!0}));const P=bt(()=>{const r=u();if(!r)return null;const n=t.targetToken(),i=g(),o=t.recipient();return n&&"number"==typeof n.decimals&&i?I()&&!o?null:{tradeType:"EXACT_OUTPUT",fromChainId:r.chainId,fromToken:r.address,toChainId:n.chainId,toToken:n.address,amount:Co(e.config.amount,n.decimals),fromAddress:i,...o&&{recipient:o}}:null}),N=bt(()=>!!P()&&"quoted"===y()),D=function(e,t,r){return Zn(()=>({queryKey:["quote",e()?.baseUrl??"__default__",t()],queryFn:async({signal:r})=>{const n=e(),i=t();if(!n||!i)throw new Error("Missing client or request");return n.getQuotes(i,r)},enabled:r()&&!!e()&&!!t(),staleTime:15e3,refetchOnWindowFocus:!1}))}(b,P,N);vt(xt(()=>D.data,t=>{if(t&&e.callbacks?.onQuoteReceived?.(t),!t||"quoted"!==y())return;const r=u();if(r&&t.routes.length>0){const e=Ja(Xa(t.routes,"EXACT_OUTPUT"))[0],n=t.routes.find(t=>t.routeId===e)??t.routes[0],i=c(),o=i.findIndex(e=>e.token.address.toLowerCase()===r.address.toLowerCase()&&e.token.chainId===r.chainId);if(o>=0){const e=[...i];e[o]={token:r,route:n,quoteId:t.quoteId},l(e)}}}));const{countdownSeconds:_}=function(e){const t=e.intervalSeconds??30,[r,n]=ht(t);return vt(xt(e.phase,r=>{if("quoted"!==r)return void n(t);n(t);const i=setInterval(()=>{n(r=>r<=1?(e.onExpired(),t):r-1)},1e3);Tt(()=>clearInterval(i))})),{countdownSeconds:r}}({phase:y,onExpired:()=>{D.refetch()}}),F=async(e,t,r,n,i,o,s)=>{try{const a={tradeType:"EXACT_OUTPUT",fromChainId:t.chainId,fromToken:t.address,toChainId:i.chainId,toToken:i.address,amount:r,fromAddress:n,...o&&{recipient:o}},c=await xa.fetchQuery({queryKey:["quote",e.baseUrl,a],queryFn:({signal:t})=>e.getQuotes(a,s??t),staleTime:15e3});if(c.routes.length>0){const e=Ja(Xa(c.routes,"EXACT_OUTPUT"))[0];return{token:t,route:c.routes.find(t=>t.routeId===e)??c.routes[0],quoteId:c.quoteId}}}catch(a){}return null};let U=null;const q=async r=>{const i=b(),o=g(),s=t.targetToken();if(!i||!o||!s||"number"!=typeof s.decimals||0===r.length)return;c().length>0&&l([]),t.error()&&t.clearError(),f(!0),U?.abort();const a=new AbortController;U=a;try{const c=Co(e.config.amount,s.decimals),d=u(),p=d?r.find(e=>Rc(e,d)):void 0,g=p?[p,...r.filter(e=>!Rc(e,p))]:r;for(const e of g){if(a.signal.aborted)return;const d=await F(i,e,c,o,s,t.recipient(),a.signal);if(a.signal.aborted)return;if(d){l([d]);const t=r.findIndex(t=>Rc(t,e));return n(t>=0?t:0),h(e),void f(!1)}}a.signal.aborted||l([])}catch{}finally{f(!1)}};Tt(()=>{U?.abort()});const $=bt(()=>{const e=R(),r=c(),n=t.targetToken(),i=O();if(0===e.length||!n)return[];const o=new Map;for(const t of r)o.set(`${t.token.chainId}:${t.token.address.toLowerCase()}`,t);const s=r.map(e=>({routeId:e.route.routeId,amountIn:BigInt(e.route.quote.amountIn||"0"),etaSeconds:e.route.quote.expectedDurationSeconds,isGuaranteedOutput:"native"===e.route.exactOutMethod,isOneClick:e.route.tags?.includes("1-click")??!1})),a=(s.length>0?Ja(s):[])[0];return e.map(e=>{const t=`${e.chainId}:${e.address.toLowerCase()}`,r=o.get(t),n=i.get(e.chainId),s=e.decimals,c=Number(e.extensions?.price?.usd??"0"),l=e.extensions?.balance?So(e.extensions.balance,s):"0",d=Ao(Oo(l,2));let f="";if(c>0&&e.extensions?.balance){const e=Number(l)*c;f=e<.01?"<$0.01":`$${Ao(e.toFixed(2).replace(/\.?0+$/,""))}`}let u="",h="",p=!0,g=!1;if(r){const t=So(r.route.quote.amountIn,s);if(u=Ao(Oo(t,2)),c>0){const e=Number(t)*c;h=e<.01?"<$0.01":`$${Ao(e.toFixed(2).replace(/\.?0+$/,""))}`}p=BigInt(e.extensions?.balance??"0")>=BigInt(r.route.quote.amountIn||"0"),g=r.route.routeId===a}return{symbol:e.symbol,chain:n?.name??`Chain ${e.chainId}`,color:"#888",amount:u,amountUsd:h,balance:d,balanceUsd:f,best:g,disabled:!p,logoURI:e.logoURI,chainId:e.chainId}})}),M=bt(()=>{const e=u();return e?c().find(t=>Rc(t.token,e))??null:null}),j=bt(()=>M()?.route??null),L=bt(()=>{const e=M();return e?{chainId:e.token.chainId,address:e.token.address,symbol:e.token.symbol,name:e.token.name,decimals:e.token.decimals,logoURI:e.token.logoURI}:null}),{trackingOrderId:z,trackingProviderName:W,trackingProviderIcon:B,trackingInputAmount:H,executionError:Q,handleConfirm:K,handleRetry:V,handleNewSwap:G}=function(e){const[t,r]=ht(null),[n,i]=ht(null),[o,s]=ht(null),[a,c]=ht(null),[l,d]=ht(null);return{trackingOrderId:t,trackingProviderName:n,trackingProviderIcon:o,trackingInputAmount:a,executionError:l,handleConfirm:async()=>{const t=e.selectedPayToken(),n=t?e.payTokenQuotes().find(e=>uc(e.token,t)):null,o=e.walletAddress();if(!(n&&e.client()&&e.walletAdapter()&&o))return;if(e.needRecipient()&&!e.recipient())return e.setError("Recipient address is required for cross-chain swaps"),void e.setErrorCode(Ve.INVALID_CONFIG);const a=n.route.quote.validBefore;if(a&&Date.now()/1e3>a){e.setLoadingQuotes(!0);try{const t=e.targetToken();if(!t||"number"!=typeof t.decimals)return;const r=Co(e.configAmount(),t.decimals),i=await e.fetchSingleQuote(e.client(),n.token,r,o,t,e.recipient());if(!i)return e.setError("Quote expired and could not be refreshed"),void e.setErrorCode(Ve.QUOTE_EXPIRED);{const t=[...e.payTokenQuotes()],r=t.findIndex(e=>uc(e.token,n.token));r>=0?t[r]=i:t.push(i),e.setPayTokenQuotes(t)}}catch{return e.setError("Quote expired and could not be refreshed"),void e.setErrorCode(Ve.QUOTE_EXPIRED)}finally{e.setLoadingQuotes(!1)}}const l=e.selectedPayToken(),f=l?e.payTokenQuotes().find(e=>uc(e.token,l)):null;if(!f)return;e.setFromToken({chainId:f.token.chainId,address:f.token.address,symbol:f.token.symbol,name:f.token.name,decimals:f.token.decimals,logoURI:f.token.logoURI}),i(f.route.routeId??null);const u=e.apiEndpoint()??ya;s(f.route.icon?`${u}${f.route.icon}`:null),c(So(f.route.quote.amountIn,f.token.decimals)),d(null),e.setExecPhase("building");try{const t=await e.client().buildDeposit({from:o,quoteId:f.quoteId,routeId:f.route.routeId});let n,i;if(e.setExecPhase("awaiting-wallet"),"CONTRACT_CALL"===t.kind&&t.approvals)for(const r of t.approvals)if("eip1193_request"===r.type){const t=await e.walletAdapter().executeWalletAction({type:"eip1193_request",chainId:f.token.chainId,method:r.request.method,params:r.request.params});if(!t.success)throw new Ye(Ve.WALLET_ACTION_FAILED,t.error??"Wallet action failed");r.deposit&&(n=t.txHash??n)}else if("solana_sendTransaction"===r.type){const t=await e.walletAdapter().executeWalletAction({type:"solana_signTransaction",transaction:r.transaction});if(!t.success)throw new Ye(Ve.WALLET_ACTION_FAILED,t.error??"Wallet action failed");r.deposit&&(i="string"==typeof t.data?t.data:void 0)}if(!n&&!i)throw new Ye(Ve.TRANSACTION_FAILED,"No deposit transaction received");e.setExecPhase("submitting");const s=await e.client().submitDeposit(i?{quoteId:f.quoteId,routeId:f.route.routeId,signedTransaction:i}:{quoteId:f.quoteId,routeId:f.route.routeId,txHash:n});e.setExecPhase("tracking"),r(s.orderId)}catch(h){const t=h instanceof Error?h.message:"string"==typeof h?h:"Transaction failed";d(t),h instanceof Ye?e.callbacks()?.onSwapError?.({code:h.code,message:h.message,details:h.details}):e.callbacks()?.onSwapError?.({code:Ve.TRANSACTION_FAILED,message:String(h)})}},handleRetry:()=>{yt(()=>{d(null),e.setExecPhase(null),e.storeClearError(),e.setPayTokenQuotes([])}),e.onRetry?.()},handleNewSwap:()=>{yt(()=>{e.storeReset(),r(null),i(null),s(null),c(null),d(null),e.setPayTokenQuotes([])}),xa.removeQueries({queryKey:["quote",e.client().baseUrl]}),xa.removeQueries({queryKey:["order",e.client().baseUrl]}),e.onReset?.()}}}({client:b,walletAdapter:()=>e.walletAdapter,callbacks:()=>e.callbacks,apiEndpoint:()=>e.config.apiEndpoint,recipient:t.recipient,needRecipient:I,walletAddress:g,targetToken:t.targetToken,selectedPayToken:u,payTokenQuotes:c,setPayTokenQuotes:l,setLoadingQuotes:f,fetchSingleQuote:F,configAmount:()=>e.config.amount,setExecPhase:t.setExecPhase,setFromToken:t.setFromToken,setError:t.setError,setErrorCode:t.setErrorCode,storeReset:t.reset,storeClearError:t.clearError,onRetry:()=>{h(null);const e=R();e.length>0&&q(e)},onReset:()=>{n(0),h(null);const e=R();e.length>0&&q(e)}});!function(e){const t=function(e,t,r,n){return Zn(()=>{const i=r(),o=t();return{queryKey:["order",e()?.baseUrl??"__default__",o,i],queryFn:async()=>{const t=e();if(!t||!i||!o)throw new Error("Missing client, address, or orderId");return t.getOrderById(o,i)},enabled:n()&&!!e()&&!!i&&!!o,staleTime:5e3,refetchInterval:e=>function(e){const{orderStatus:t,dataUpdatedAt:r,now:n=Date.now()}=e;if(t&&Ke.includes(t))return!1;if(0===r)return Aa[0].intervalMs;const i=n-r;for(const o of Aa)if(i<o.thresholdMs)return o.intervalMs;return 1e4}({orderStatus:e.state.data?.status,dataUpdatedAt:e.state.dataUpdatedAt??0})}})}(e.client,e.walletAddress,e.trackingOrderId,()=>"tracking"===e.phase()&&!!e.trackingOrderId());vt(xt(()=>t.data,t=>{if(!t||"tracking"!==e.execPhase())return;const r="filled"===t.status||t.stepsCompleted?.includes("filled"),n="failed"===t.status||"refunded"===t.status;yt(()=>{e.setOrder(t),r?(e.setExecPhase("success"),xa.invalidateQueries({queryKey:["tokenBalances",e.client().baseUrl]}),e.onOrderFilled(t)):n&&(xa.invalidateQueries({queryKey:["tokenBalances",e.client().baseUrl]}),e.onOrderFailed(t))})}))}({client:b,walletAddress:g,trackingOrderId:z,phase:y,execPhase:t.execPhase,setOrder:t.setOrder,setExecPhase:t.setExecPhase,onOrderFilled:r=>{const n=u();e.callbacks?.onSwapSuccess?.({orderId:r.id,fromToken:n?.symbol??"",toToken:t.targetToken()?.symbol??"",fromAmount:r.srcAmount,toAmount:r.destAmount,txHash:r.depositTxHash})},onOrderFailed:t=>{e.callbacks?.onSwapError?.({code:Ve.ORDER_FAILED,message:"Order "+t.status})}});const Y=r=>{n(r),o(!1);const i=R()[r];i&&(h(i),(async r=>{const n=b(),i=g(),o=t.targetToken();if(!n||!i||!o||"number"!=typeof o.decimals)return;const s=Co(e.config.amount,o.decimals),a=await F(n,r,s,i,o,t.recipient());if(a){const e=c(),t=[...e],n=e.findIndex(e=>e.token.address.toLowerCase()===r.address.toLowerCase()&&e.token.chainId===r.chainId);n>=0?t[n]=a:t.push(a),l(t)}})(i))},X=async r=>{a(!1),o(!1);const i=b(),s=g(),d=t.targetToken();if(i&&s&&d&&"number"==typeof d.decimals&&r.address&&"number"==typeof r.decimals){f(!0);try{const o=Co(e.config.amount,d.decimals),a={address:r.address,chainId:r.chainId,name:r.name,symbol:r.symbol,decimals:r.decimals,logoURI:r.logoURI,extensions:null!==r.balance&&"0"!==r.balance?{balance:Co(r.balance,r.decimals)}:void 0},f=await F(i,a,o,s,d,t.recipient());if(f){const e=c(),t=e.findIndex(e=>e.token.address.toLowerCase()===r.address.toLowerCase()&&e.token.chainId===r.chainId);let i;t>=0?(i=[...e],i[t]=f):i=[...e,f],l(i),h(a);const o=R().findIndex(e=>Rc(e,a));o>=0&&n(o)}}catch{}finally{f(!1)}}},J=async()=>{e.walletAdapter?.openAccountModal?await e.walletAdapter.openAccountModal():e.callbacks?.onAccountModal?.()},Z=e=>`${e.slice(0,6)}...${e.slice(-4)}`,ee=()=>t.targetToken()?.symbol??"USDC",te=()=>t.targetAmount()||e.config.amount,re=bt(()=>{const t=e.config.titleText?.trim();return t&&t.length>0?t:"TokenFlight"}),ne=bt(()=>{const t=e.config.titleText?.trim();return!!t&&t.length>0}),ie=bt(()=>{const t=e.config.titleImageUrl?.trim();return t&&t.length>0?t:null});return oe=bc(),se=oe.firstChild,kr(oe,Kt(rr,{get when(){return ur(()=>"success"===y())()&&t.order()},get fallback(){return Kt(rr,{get when(){return w()},get fallback(){return[(O=wc(),R=O.firstChild,P=R.firstChild,kr(R,Kt(rr,{get when(){return ie()},get fallback(){return Kt(Si,{size:22})},get children(){var e=mc();return gt(t=>{var r=ie(),n=re(),i="tf-532d07";return r!==t.e&&gr(e,"src",t.e=r),n!==t.t&&gr(e,"alt",t.t=n),i!==t.a&&vr(e,t.a=i),t},{e:void 0,t:void 0,a:void 0}),e}}),P),kr(P,Kt(rr,{get when(){return ne()},get fallback(){return["Token",(e=Cc(),gt(()=>vr(e,"tf-883305")),e)];var e},get children(){return re()}})),kr(O,Kt(rr,{get when(){return ur(()=>!!p())()&&g()},get children(){var e=yc(),t=e.firstChild,r=t.nextSibling;return br(e,"click",J),kr(r,()=>Z(g())),gt(n=>{var i="tf-6da3db",o=Ui("swap.account"),s="tf-d25568",a="tf-11bb1d";return i!==n.e&&vr(e,n.e=i),o!==n.t&&gr(e,"aria-label",n.t=o),s!==n.a&&vr(t,n.a=s),a!==n.o&&vr(r,n.o=a),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e}}),null),gt(t=>{var r="tf-9b71d6",n="tf-68123c "+(e.config.hideTitle?"tf-43dda9":""),i=e.config.hideTitle?"true":void 0,o="tf-b7936a";return r!==t.e&&vr(O,t.e=r),n!==t.t&&vr(R,t.t=n),i!==t.a&&gr(R,"aria-hidden",t.a=i),o!==t.o&&vr(P,t.o=o),t},{e:void 0,t:void 0,a:void 0,o:void 0}),O),(f=kc(),u=f.firstChild,h=u.firstChild,b=u.nextSibling,x=b.firstChild,C=x.nextSibling,E=C.nextSibling,A=E.nextSibling,kr(h,()=>Ui("receive.youReceive")),kr(u,Kt(rr,{get when(){return p()},get children(){var e,t=xc(),r=t.firstChild;return br(t,"click",()=>!w()&&!T()&&k(!0)),kr(r,(e=ur(()=>!!S()),()=>e()?Z(S()):Ui("swap.recipientPlaceholder"))),kr(t,Kt(rr,{get when(){return!T()},get children(){return Kt(mi,{size:10})}}),null),gt(e=>{var n=`tf-d9b7b4 ${S()?"":"tf-9398ea"}${T()?" tf-4567e1":""}`,i=T(),o="tf-2d9323";return n!==e.e&&vr(t,e.e=n),i!==e.t&&(t.disabled=e.t=i),o!==e.a&&vr(r,e.a=o),e},{e:void 0,t:void 0,a:void 0}),t}}),null),kr(x,Kt(Ei,{get symbol(){return ee()},color:"#0052FF",size:32,get logoURI(){return t.targetToken()?.logoURI}}),null),kr(x,Kt(rr,{get when(){return t.targetToken()?.chainId},get children(){var e=vc();return kr(e,Kt(Ai,{size:12,get iconUrl(){return Ii(m(),t.targetToken().chainId)}})),gt(()=>vr(e,"tf-7a6fbc")),e}}),null),kr(C,()=>Ao(te())),kr(E,ee),kr(A,()=>Ui("swap.fiatValue",{value:Ao(te())})),gt(e=>{var t=hc,r=pc,n="tf-a27aab",i="tf-f0b3f5",o="tf-e9e9a1",s="tf-f3baad",a="tf-0131e4";return t!==e.e&&vr(f,e.e=t),r!==e.t&&vr(u,e.t=r),n!==e.a&&vr(b,e.a=n),i!==e.o&&vr(x,e.o=i),o!==e.i&&vr(C,e.i=o),s!==e.n&&vr(E,e.n=s),a!==e.s&&vr(A,e.s=a),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),f),(s=Tc(),l=s.firstChild,kr(l,()=>Ui("receive.payWith")),gt(e=>{var t=hc,r=pc;return t!==e.e&&vr(s,e.e=t),r!==e.t&&vr(l,e.t=r),e},{e:void 0,t:void 0}),s),Kt(rr,{get when(){return!d()||c().length>0},get fallback(){return[(e=Ec(),t=e.firstChild,r=t.firstChild,n=r.firstChild,i=n.nextSibling,o=i.firstChild,s=o.nextSibling,a=r.nextSibling,c=a.firstChild,l=c.nextSibling,gt(e=>{var d="tf-c3e864",f=fs,u=`${Jo} tf-d7d776`,h="tf-44450a",p=`${Jo} ${as} tf-2174f1`,g=`${Jo} ${as} tf-2d3530`,v="tf-2733a9",b=`${Jo} ${as} tf-54150b`,m=`${Jo} ${as} tf-7aabe1`;return d!==e.e&&vr(t,e.e=d),f!==e.t&&vr(r,e.t=f),u!==e.a&&vr(n,e.a=u),h!==e.o&&vr(i,e.o=h),p!==e.i&&vr(o,e.i=p),g!==e.n&&vr(s,e.n=g),v!==e.s&&vr(a,e.s=v),b!==e.h&&vr(c,e.h=b),m!==e.r&&vr(l,e.r=m),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),e),Kt(os,{})];var e,t,r,n,i,o,s,a,c,l},get children(){return Kt(qs,{get tokens(){return $()},get selectedIndex(){return r()},onSelect:Y,onBrowseAll:()=>a(!0),get apiEndpoint(){return m()},get isConnected(){return p()},get selectorOpen(){return i()},onOpenSelector:()=>o(!0),onCloseSelector:()=>o(!1)})}}),Kt(rr,{get when(){return ur(()=>!(!j()||!L()))()&&t.targetToken()},get fallback(){return Kt(rr,{get when(){return ur(()=>!(d()||!($().length>0)))()&&!j()},get children(){var e=Ac(),t=e.firstChild,r=t.nextSibling;return kr(r,()=>Ui("receive.noOfferAvailable")),gt(n=>{var i="tf-04e1e2",o="tf-d01908",s="tf-1cc72b";return i!==n.e&&vr(e,n.e=i),o!==n.t&&vr(t,n.t=o),s!==n.a&&vr(r,n.a=s),n},{e:void 0,t:void 0,a:void 0}),e}})},get children(){var e=Ic();return kr(e,Kt(ss,{get route(){return j()},get fromToken(){return L()},get toToken(){return t.targetToken()},inline:!0,countdownSeconds:_,countdownTotal:30,showCountdown:()=>"quoted"===y()})),gt(()=>vr(e,Ho)),e}}),(n=Sc(),kr(n,Kt(Bi,{get phase(){return y()},get isConnected(){return p()},get hasQuote(){return!!j()},onConnect:v,onConfirm:K,onRetry:V,get needsRecipient(){return ur(()=>!!I())()&&!t.recipient()},onEnterRecipient:()=>k(!0),get label(){return ur(()=>!!w())()?void 0:Ui("receive.buy",{amount:te(),symbol:ee()})}})),gt(()=>vr(n,"tf-5bb68c")),n)];var n,s,l,f,u,h,b,x,C,E,A,O,R,P},get children(){return Kt(Io,{get order(){return t.order()},get fromToken(){return t.fromToken()},get toToken(){return t.targetToken()},get providerName(){return W()},get providerIcon(){return B()},get apiEndpoint(){return e.config.apiEndpoint??ya},get inputAmount(){return H()??""},get outputAmount(){return t.targetAmount()},onNewSwap:G,mode:"receive",get executionError(){return Q()},onRetry:V,get phase(){return y()},get chainMap(){return O()}})}})},get children(){return Kt(jo,{get order(){return t.order()},get fromToken(){return t.fromToken()},get toToken(){return t.targetToken()},onNewSwap:G,get apiEndpoint(){return e.config.apiEndpoint??ya},get providerName(){return W()},mode:"receive",get chainMap(){return O()}})}}),null),kr(oe,Kt(rr,{get when(){return!e.config.hidePoweredBy},get children(){return Kt(Oi,{})}}),null),kr(oe,Kt(rr,{get when(){return s()},get children(){var t=gc();return kr(t,Kt(Wa,{get client(){return b()},get walletAddress(){return g()},selectingFor:"from",onSelect:X,onClose:()=>a(!1),get supportedChainIds(){return e.walletAdapter?.supportedChainIds}})),gt(()=>vr(t,Zo)),t}}),null),kr(oe,Kt(rr,{get when(){return ur(()=>!!x())()&&t.targetToken()},get children(){var e=vc();return kr(e,Kt(Qa,{get initialValue(){return t.recipient()??""},get chainType(){return Zi(t.targetToken().chainId)},onConfirm:e=>{C(e),k(!1)},onClose:()=>k(!1)})),gt(()=>vr(e,Zo)),e}}),null),gt(t=>{var r=`tf-e7b9c7${e.config.noBackground?" tf-b4f391":""}${e.config.noBorder?" tf-118b57":""}`,n="tf-07225e";return r!==t.e&&vr(oe,t.e=r),n!==t.t&&vr(se,t.t=n),t},{e:void 0,t:void 0}),oe;var oe,se}const Nc=[".tf-2de115{width:100%;padding:14px 0;border-radius:14px;border:none;background:linear-gradient(135deg,var(--tf-primary),color-mix(in srgb,var(--tf-primary) 80%,#000));color:var(--tf-text-on-primary);font-weight:600;font-size:var(--tf-font-xl);cursor:pointer;box-shadow:0 4px 16px var(--tf-primary-glow);letter-spacing:-.01em;font-family:var(--tf-font-family);transition:transform .15s ease,opacity .15s ease,box-shadow .15s ease}.tf-2de115:hover{opacity:.95;transform:translateY(-1px);box-shadow:0 6px 20px var(--tf-primary-glow)}.tf-2de115:active{transform:translateY(0)}.tf-47dc2a{background:var(--tf-primary);cursor:wait;opacity:.85}.tf-44b8f1{width:100%;padding:14px 0;border-radius:14px;border:1px solid var(--tf-primary);background:var(--tf-primary-light);color:var(--tf-primary);font-weight:600;font-size:var(--tf-font-xl);cursor:pointer;font-family:var(--tf-font-family);transition:transform .15s ease,background .15s ease}.tf-44b8f1:hover{transform:translateY(-1px)}.tf-44b8f1:active{transform:translateY(0)}.tf-04fe16{width:100%;padding:14px 0;border-radius:14px;border:1.5px dashed var(--tf-primary);background:var(--tf-primary-light);color:var(--tf-primary);font-weight:600;font-size:var(--tf-font-xl);cursor:pointer;font-family:var(--tf-font-family);transition:transform .15s ease,background .15s ease;animation:tf-d53743 2s ease-in-out infinite}.tf-04fe16:hover{transform:translateY(-1px);background:var(--tf-primary-glow)}.tf-04fe16:active{transform:translateY(0)}.tf-65cf23{width:100%;padding:14px 0;border-radius:14px;text-align:center;background:var(--tf-success-bg);color:var(--tf-success);font-weight:600;font-size:var(--tf-font-xl);display:flex;align-items:center;justify-content:center;gap:8px;border:none}.tf-2f0314{width:100%;padding:14px 0;border-radius:14px;text-align:center;background:var(--tf-error-bg);color:var(--tf-error);font-weight:600;font-size:var(--tf-font-xl);display:flex;align-items:center;justify-content:center;gap:8px;border:none;cursor:pointer}.tf-20b1ac{display:flex;align-items:center;justify-content:center;gap:8px}.tf-e6dae0{display:inline-block;width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,255,255,.3);border-top-color:var(--tf-text-on-primary, #fff);animation:tf-8a3bc2 .8s linear infinite}.tf-90e712{width:14px;height:14px}",'@keyframes tf-d36961{to{transform:rotate(360deg)}}.tf-5835df{width:100%;min-width:0;padding:24px 20px 16px;animation:tf-e061c9 .3s ease both;overflow:hidden;box-sizing:border-box}.tf-9322ae{display:flex;align-items:center;justify-content:center;gap:12px;padding-bottom:20px;margin-bottom:4px;border-bottom:1px solid var(--tf-border-light)}.tf-7d5519{display:flex;align-items:center;justify-content:flex-start;min-width:0;flex:1}.tf-0b8d30{justify-content:flex-end}.tf-bfbd0b{display:flex;align-items:center;gap:8px;min-width:0}.tf-7e8fdf{position:relative;width:32px;height:32px;flex-shrink:0}.tf-37f3cf{position:absolute;bottom:-2px;right:-2px;width:16px;height:16px;border-radius:50%;background:var(--tf-bg);display:flex;align-items:center;justify-content:center;border:1.5px solid var(--tf-bg)}.tf-9401fd{display:flex;flex-direction:column;min-width:0;overflow:hidden}.tf-832fae{font-family:var(--tf-font-family-mono);font-weight:600;font-size:var(--tf-font-lg);color:var(--tf-text);white-space:nowrap;line-height:1.2}.tf-b557fc{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-weight:500;line-height:1.2}.tf-5953e8{color:var(--tf-text-tertiary);flex-shrink:0}.tf-a168c7{display:flex;align-items:center;justify-content:center;gap:6px;text-align:center;font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);padding-bottom:16px}.tf-062404{width:16px;height:16px;border-radius:4px;object-fit:contain}.tf-26af4c{display:flex;flex-direction:column}.tf-4b9be7{display:flex;gap:12px}.tf-036db2{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:var(--tf-font-base);font-weight:600;z-index:1}.tf-09b7bb{background:var(--tf-success-bg);color:var(--tf-success)}.tf-aef7e0{background:var(--tf-primary-light)}.tf-5c628c{background:var(--tf-input-bg);color:var(--tf-text-tertiary);border:1px solid var(--tf-border-light)}.tf-a5abdf{background:var(--tf-error-bg);color:var(--tf-error)}.tf-9efe7c{width:14px;height:14px;border-radius:50%;border:2px solid var(--tf-primary-light);border-top-color:var(--tf-primary);animation:tf-d36961 .8s linear infinite}.tf-5c7806{border-color:#ff475733;border-top-color:var(--tf-error)}.tf-185719{flex:1;min-width:0;padding-bottom:20px;position:relative}.tf-185719:before{content:"";position:absolute;left:-26px;top:28px;bottom:0;width:2px;background:var(--tf-border-light)}.tf-4b9be7:last-child .tf-185719:before{display:none}.tf-4b9be7:last-child .tf-185719{padding-bottom:4px}.tf-84527b .tf-185719:before{background:var(--tf-success)}.tf-417d35 .tf-185719:before{background:var(--tf-error)}.tf-aad7e9{font-size:var(--tf-font-md);font-weight:600;color:var(--tf-text);line-height:28px}.tf-8de1c6 .tf-aad7e9{color:var(--tf-text-tertiary)}.tf-417d35 .tf-aad7e9{color:var(--tf-error)}.tf-bcb46a{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);margin-top:2px;display:flex;align-items:center;gap:6px;flex-wrap:wrap;word-break:break-word;overflow-wrap:break-word}.tf-16cfdc .tf-bcb46a{color:var(--tf-primary)}.tf-0aa291{font-size:var(--tf-font-sm);color:var(--tf-primary);text-decoration:none;display:inline-flex;align-items:center;gap:3px;transition:opacity .15s}.tf-0aa291:hover{opacity:.7}.tf-234e31{margin-top:20px;padding:16px;border-radius:12px;background:var(--tf-error-alpha, rgba(239, 68, 68, .06));border:1px solid var(--tf-error-bg);text-align:center}.tf-adb588{font-size:var(--tf-font-md);color:var(--tf-text-secondary);line-height:1.5;margin-bottom:12px}.tf-11fa21{display:inline-flex;align-items:center;gap:4px;font-size:var(--tf-font-base);color:var(--tf-primary);text-decoration:none;margin-bottom:12px;transition:opacity .15s}.tf-11fa21:hover{opacity:.7}.tf-4f7573{width:100%;padding:12px;border-radius:12px;background:linear-gradient(135deg,var(--tf-success),color-mix(in srgb,var(--tf-success) 80%,#000));color:var(--tf-text-on-primary);font-size:var(--tf-font-lg);font-weight:600;cursor:pointer;border:none;transition:opacity .2s,transform .15s}.tf-4f7573:hover{opacity:.9;transform:translateY(-1px)}.tf-4f7573:active{transform:scale(.98)}.tf-c918a2{margin-top:16px;text-align:center}.tf-ad7aab{visibility:hidden;pointer-events:none}.tf-1e22cb{width:100%;padding:12px;border-radius:12px;background:var(--tf-bg-secondary);color:var(--tf-text);font-size:var(--tf-font-lg);font-weight:600;cursor:pointer;border:1px solid var(--tf-border);transition:opacity .2s,transform .15s}.tf-1e22cb:hover{opacity:.85;transform:translateY(-1px)}.tf-1e22cb:active{transform:scale(.98)}',"@keyframes tf-540423{to{transform:rotate(360deg)}}.tf-d61a98{padding:0 20px}.tf-4574e9{height:162px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--tf-border) transparent}.tf-4574e9::-webkit-scrollbar{width:4px}.tf-4574e9::-webkit-scrollbar-track{background:transparent}.tf-4574e9::-webkit-scrollbar-thumb{background:var(--tf-border);border-radius:2px}.tf-2f8db2{display:flex;align-items:center;justify-content:space-between;padding:9px 11px;border-radius:11px;margin-bottom:4px;cursor:pointer;border:1px solid var(--tf-border-light);background:transparent;width:100%;font-family:var(--tf-font-family);transition:background .15s ease,border-color .15s ease}.tf-aaf1d0{border-color:var(--tf-primary);outline:.5px solid var(--tf-primary);outline-offset:-1px;background:var(--tf-primary-light)}.tf-328e9e{opacity:.4;cursor:not-allowed}.tf-af2c71{cursor:default;pointer-events:none}.tf-d7d776{width:32px;height:32px;border-radius:50%}.tf-c3e864{display:flex;align-items:center;padding:11px 14px;border-radius:12px;border:1px solid var(--tf-border-light);background:var(--tf-input-bg);cursor:default;pointer-events:none}.tf-44450a{display:flex;flex-direction:column;gap:6px}.tf-6c1e97{height:10px}.tf-2174f1{width:52px}.tf-2d3530{width:40px}.tf-2733a9{display:flex;flex-direction:column;align-items:flex-end;gap:6px;margin-left:auto}.tf-54150b{width:60px}.tf-7aabe1{width:44px}.tf-c41b7c{display:flex;align-items:center;gap:9px}.tf-142024{position:relative}.tf-3b42da{position:absolute;bottom:-1px;right:-1px;width:11px;height:11px;border-radius:50%;background:var(--tf-surface);border:1px solid var(--tf-border);display:flex;align-items:center;justify-content:center}.tf-b7faa4{text-align:left}.tf-1ae7a3{display:flex;align-items:center;gap:5px}.tf-b949b8{font-size:var(--tf-font-base);font-weight:600;color:var(--tf-text)}.tf-2f811b{font-size:var(--tf-font-2xs);font-weight:700;padding:1px 4px;border-radius:3px;background:var(--tf-success-bg);color:var(--tf-success);letter-spacing:.03em}.tf-6542b9{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary)}.tf-e613ff{text-align:right}.tf-630df3{font-size:var(--tf-font-base);font-weight:600;font-family:var(--tf-font-family-mono);color:var(--tf-text)}.tf-0be2ff{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-dad192{font-size:var(--tf-font-base);font-weight:600;font-family:var(--tf-font-family-mono);color:var(--tf-text)}.tf-840c29{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-09818b{display:flex;align-items:center;padding:10px 14px;border-radius:12px;border:1px solid var(--tf-border-light);background:var(--tf-input-bg);cursor:pointer;width:100%;font-family:var(--tf-font-family);transition:background .15s ease,border-color .15s ease}.tf-09818b:hover{border-color:var(--tf-primary);background:var(--tf-primary-light)}.tf-c7ba0f{display:flex;align-items:center;gap:9px}.tf-dea0cb{text-align:left}.tf-41931a{display:flex;align-items:center;gap:5px}.tf-3d2f5a{margin-left:auto;text-align:right;margin-right:8px}.tf-9a379d{font-size:var(--tf-font-lg);font-weight:500;font-family:var(--tf-font-family-mono);color:var(--tf-text);letter-spacing:-.02em}.tf-c11354{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-864468{color:var(--tf-text-tertiary);display:flex;align-items:center;flex-shrink:0;transition:transform .2s ease}.tf-8299cf{flex:1;overflow-y:auto;padding:0 8px 8px;scrollbar-width:thin;scrollbar-color:var(--tf-border) transparent}.tf-176d77{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px;cursor:pointer;background:transparent;transition:background .1s;border:none;width:100%;font-family:var(--tf-font-family);color:var(--tf-text)}.tf-176d77:hover{background:var(--tf-surface-hover)}.tf-2df5d9{background:var(--tf-primary-light)}.tf-dc503e{opacity:.4;cursor:not-allowed}.tf-ebbc44{display:flex;align-items:center;gap:12px}.tf-5f455f{text-align:left}.tf-15ee78{display:flex;align-items:center;gap:6px}.tf-976d83{font-size:var(--tf-font-lg);font-weight:600;color:var(--tf-text)}.tf-ba2eec{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary)}.tf-a37921{text-align:right}.tf-cf71b6{font-size:var(--tf-font-md);font-weight:600;font-family:var(--tf-font-family-mono);color:var(--tf-text)}.tf-7474a9{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-772a9c{flex-shrink:0;padding:4px 8px 12px;border-top:1px solid var(--tf-border-light)}.tf-5fb6ad{display:flex;flex-direction:column;align-items:center;justify-content:center;height:197px;gap:8px;padding:16px 20px}.tf-86e8e0{flex-direction:row;gap:10px}.tf-66007c{color:var(--tf-text-tertiary);opacity:.5}.tf-73bbbc{width:24px;height:24px;display:flex;align-items:center;justify-content:center;opacity:.6;color:var(--tf-primary);animation:tf-540423 1s linear infinite}.tf-12c6bb{font-size:var(--tf-font-md);font-weight:600;color:var(--tf-text-secondary)}.tf-7a8fe0{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);text-align:center;line-height:1.4}.tf-22f94f{display:flex;align-items:center;justify-content:center;gap:4px;padding:4px 0 2px;font-size:var(--tf-font-sm);color:var(--tf-primary);cursor:pointer;font-weight:500;background:none;border:none;width:100%;font-family:var(--tf-font-family)}",".tf-216412{display:inline-flex;align-items:center;gap:4px}.tf-52dc68{flex-shrink:0}.tf-fd32be{font-size:var(--tf-font-sm);color:var(--tf-text-secondary);min-width:20px}",".tf-1019c2{margin:12px 20px 0;padding:14px;background:var(--tf-primary-light);border-radius:10px;font-size:var(--tf-font-base);color:var(--tf-text-secondary);animation:tf-42889f .25s ease both}.tf-4922f1{display:flex;justify-content:space-between;align-items:center;min-height:16px;margin-bottom:4px}.tf-4922f1:last-child{margin-bottom:0}.tf-57f45f{font-family:var(--tf-font-family-mono);font-size:var(--tf-font-sm)}.tf-a57ec8{display:block;height:118px;box-sizing:border-box}.tf-d74ccc{display:flex;justify-content:space-between;align-items:center;height:22px}.tf-92e7a8{width:68px;height:14px}.tf-d20f50{width:56px}.tf-a9a96f{width:150px;height:14px}.tf-0134eb{width:126px}.tf-91635c{width:80px}.tf-ca1291{cursor:pointer;border-bottom:1px solid var(--tf-border-light);margin-bottom:10px;transition:opacity .15s}.tf-ca1291:hover{opacity:.7}.tf-ca1291 .tf-57f45f{display:inline-flex;align-items:center;gap:4px}.tf-ca1291 .tf-57f45f svg{opacity:.35;flex-shrink:0;transition:opacity .15s}.tf-ca1291:hover .tf-57f45f svg{opacity:.7}.tf-a249b3 .tf-recipient-placeholder{color:var(--tf-error)}.tf-adeddd{border:1px dashed var(--tf-primary);border-radius:var(--tf-radius, 10px);padding:8px 12px;margin-bottom:10px;animation:tf-d990e5 2s ease-in-out infinite}.tf-adeddd .tf-recipient-placeholder{color:var(--tf-primary);font-style:normal}",".tf-9b71d6{padding:16px 20px 12px;display:flex;justify-content:space-between;align-items:center;gap:7px}.tf-4c9136{padding:0 20px 10px}.tf-febe61{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-weight:500;margin-bottom:6px;text-align:left}.tf-a27aab{display:flex;align-items:center;gap:10px;padding:8px 14px;background:var(--tf-input-bg);border-radius:12px;border:1px solid var(--tf-border-light)}.tf-f0b3f5{position:relative;flex-shrink:0}.tf-7a6fbc{position:absolute;bottom:-1px;right:-1px;width:12px;height:12px}.tf-e9e9a1{font-size:var(--tf-font-amount-sm);font-weight:700;letter-spacing:-.02em}.tf-f3baad{font-size:var(--tf-font-lg);font-weight:500;color:var(--tf-text-secondary)}.tf-0131e4{margin-left:auto;font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}",".tf-636daf{width:100%;height:100%;background:var(--tf-bg);display:flex;flex-direction:column;border-radius:20px;overflow:hidden}.tf-fddfab{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--tf-border-light)}.tf-970eb9{font-size:var(--tf-font-2xl);font-weight:600;color:var(--tf-text)}.tf-de123a{background:none;border:none;padding:4px;cursor:pointer;color:var(--tf-text-secondary);display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background .15s}.tf-de123a:hover{background:var(--tf-bg-elevated)}.tf-0445e3{flex:1;padding:20px;display:flex;flex-direction:column;gap:8px}.tf-9a65ec{width:100%;min-height:80px;background:var(--tf-input-bg);border:1px solid var(--tf-border-light);border-radius:12px;padding:12px 14px;font-size:var(--tf-font-lg);font-family:var(--tf-font-family-mono);color:var(--tf-text);outline:none;resize:none;transition:border-color .2s,box-shadow .2s;box-sizing:border-box}.tf-9a65ec::placeholder{color:var(--tf-text-tertiary)}.tf-9a65ec:focus{border-color:var(--tf-primary);box-shadow:0 0 0 3px var(--tf-primary-alpha)}.tf-c5ea21{border-color:var(--tf-error)}.tf-c5ea21:focus{border-color:var(--tf-error);box-shadow:0 0 0 3px var(--tf-error-alpha)}.tf-9d4bba{font-size:var(--tf-font-base);color:var(--tf-error);padding:0 2px}.tf-cb9b60{padding:16px 20px 20px}.tf-2cba65{width:100%}.tf-2cba65:disabled{opacity:.5;cursor:not-allowed}",".tf-ba406b{display:inline-flex;align-items:baseline}.tf-9d81a4{font-size:.7em;line-height:1;opacity:.85}.tf-7977ef{cursor:help}","@keyframes tf-07c947{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.tf-dc5721{padding:18px 20px 0;display:flex;justify-content:space-between;align-items:center}.tf-68123c{display:flex;align-items:center;gap:7px}.tf-43dda9{visibility:hidden}.tf-532d07{width:22px;height:22px;object-fit:contain;flex-shrink:0}.tf-b7936a{font-size:var(--tf-font-xl);font-weight:600;letter-spacing:-.01em}.tf-883305{color:var(--tf-primary)}.tf-6da3db{display:flex;gap:6px;align-items:center;cursor:pointer;background:none;border:none;padding:4px 8px;border-radius:8px;font-family:inherit;transition:background .15s ease}.tf-6da3db:hover{background:var(--tf-surface-hover)}.tf-6da3db:focus-visible{outline:2px solid var(--tf-primary);outline-offset:2px}.tf-d25568{width:8px;height:8px;border-radius:50%;background:var(--tf-primary);box-shadow:0 0 8px var(--tf-primary-glow)}.tf-16ce7d{background:var(--tf-success);box-shadow:0 0 8px var(--tf-success)}.tf-11bb1d{font-size:var(--tf-font-base);color:var(--tf-text-secondary);font-family:var(--tf-font-family-mono)}.tf-98d625{padding:14px 20px 0;animation:tf-07c947 .3s ease both}.tf-8b7743{padding:0 20px;animation:tf-07c947 .35s ease both}.tf-677ece{background:var(--tf-input-bg);border-radius:14px;padding:14px 16px;border:1px solid var(--tf-border-light);transition:border-color .2s,background .25s ease,box-shadow .2s ease}.tf-635915{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.tf-b8a04a{display:inline-flex;align-items:center;gap:8px}.tf-0d1ef8{font-size:var(--tf-font-base);color:var(--tf-text-tertiary);font-weight:500;text-align:left}.tf-d04a4e{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}.tf-d7140f{display:flex;justify-content:space-between;align-items:center}.tf-dcd620{display:flex;align-items:center;gap:8px;background:var(--tf-surface);border-radius:10px;padding:6px 12px 6px 8px;height:36px;box-sizing:border-box;border:1px solid var(--tf-border);cursor:pointer;flex-shrink:0;font-family:var(--tf-font-family);transition:background .15s ease,border-color .15s ease,transform .1s ease}.tf-dcd620:hover{background:var(--tf-surface-hover);transform:scale(1.02)}.tf-e25a5c{padding:0 12px}.tf-038cf1{font-size:var(--tf-font-lg);font-weight:600;color:var(--tf-text)}.tf-33c9cb{font-size:var(--tf-font-md);font-weight:600;color:var(--tf-primary)}.tf-b1e4a6{font-size:var(--tf-font-xs);color:var(--tf-text-tertiary)}.tf-d168ae{display:flex;justify-content:space-between;align-items:center;margin-top:6px;min-height:16px;font-size:var(--tf-font-base);line-height:100%}.tf-b2b098{margin-top:6px;min-height:16px;display:flex;align-items:center}.tf-92acfd{display:inline-block;min-height:16px;font-size:var(--tf-font-base);line-height:100%;color:var(--tf-text-tertiary)}.tf-bd2f5c{visibility:hidden}.tf-5f8805{font-size:var(--tf-font-sm);font-weight:600;color:var(--tf-primary);background:var(--tf-primary-light);border:none;padding:2px 8px;border-radius:6px;cursor:pointer;font-family:var(--tf-font-family)}.tf-5f8805:hover{opacity:.8}.tf-af41ab{display:flex;justify-content:center;margin:-6px 0;position:relative;z-index:2}.tf-18c3f4{width:36px;height:36px;padding:0;appearance:none;-webkit-appearance:none;border-radius:10px;background:var(--tf-surface);border:3px solid var(--tf-bg);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 8px #0000000f;font-size:var(--tf-font-lg);color:var(--tf-text-secondary);transition:transform .2s ease,background .15s ease,color .15s ease}.tf-18c3f4:hover{transform:scale(1.1);color:var(--tf-primary)}.tf-18c3f4:active{transform:scale(.95) rotate(180deg)}.tf-a04b23{position:relative;flex-shrink:0}.tf-57762e{position:absolute;bottom:-2px;right:-2px}",".tf-140273{width:100%;max-width:400px;border-radius:20px;overflow:hidden;background:var(--tf-bg);border:1px solid var(--tf-border);box-shadow:var(--tf-shadow-lg);font-family:var(--tf-font-family);color:var(--tf-text);height:100%;display:flex;flex-direction:column}.tf-45030f{padding:18px 20px 14px;flex-shrink:0}.tf-ce0622{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.tf-0c1692{font-size:var(--tf-font-xl);font-weight:600}.tf-64aa3f{width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--tf-text-tertiary);font-size:var(--tf-font-2xl);font-weight:300;background:var(--tf-input-bg);border:none;font-family:var(--tf-font-family)}.tf-9819ca{display:flex;align-items:center;gap:10px;background:var(--tf-input-bg);border-radius:12px;padding:10px 14px;border:1px solid var(--tf-border-light);transition:border-color .15s}.tf-9819ca.tf-d9fcd6{border-color:var(--tf-primary)}.tf-4ad0e7{color:var(--tf-text-tertiary);font-size:var(--tf-font-lg);flex-shrink:0}.tf-9ea859{flex:1;border:none;background:none;outline:none;font-size:var(--tf-font-lg);color:var(--tf-text);font-family:var(--tf-font-family)}.tf-9ea859::placeholder{color:var(--tf-text-tertiary)}.tf-25e112{display:flex;gap:4px;margin-top:12px;overflow-x:auto;padding-bottom:2px}.tf-478cb9{display:flex;align-items:center;gap:5px;padding:4px 10px;border-radius:8px;border:none;font-size:var(--tf-font-sm);font-weight:500;cursor:pointer;white-space:nowrap;font-family:var(--tf-font-family);background:var(--tf-input-bg);color:var(--tf-text-secondary)}.tf-478cb9.tf-125be5{background:var(--tf-primary-light);color:var(--tf-primary);outline:1px solid var(--tf-primary);outline-offset:-1px}.tf-bb4fb1{height:24px;border-radius:8px;flex-shrink:0}.tf-ad5703{height:1px;background:var(--tf-border);margin:0 20px;flex-shrink:0}.tf-de9986{flex:1;min-height:0;overflow-y:auto;padding:6px 8px}.tf-7ac0fe{display:flex;flex-direction:column}.tf-c6ef08{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px}.tf-3643cf{display:flex;align-items:center;gap:12px}.tf-9b3d59{width:36px;height:36px;border-radius:50%}.tf-a4cc17{display:flex;flex-direction:column;gap:6px}.tf-7f1baf{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.tf-9171a2{height:10px}.tf-9171a2.tf-71ea5d{width:88px}.tf-9171a2.tf-dfb33a{width:64px}.tf-9171a2.tf-43fbf4{width:56px}.tf-9171a2.tf-61ca3c{width:44px}.tf-512365{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px;cursor:pointer;background:transparent;transition:background .1s;border:none;width:100%;font-family:var(--tf-font-family)}.tf-512365:hover{background:var(--tf-surface-hover)}.tf-512365.tf-9f601f{background:var(--tf-primary-light)}.tf-a0b0d9{display:flex;align-items:center;gap:12px}.tf-1e7a62{position:relative}.tf-67f18a{position:absolute;bottom:-1px;right:-1px;width:13px;height:13px;border-radius:50%;background:var(--tf-surface);border:1px solid var(--tf-border);display:flex;align-items:center;justify-content:center}.tf-cd76b9{text-align:left;display:flex;flex-direction:column;align-items:flex-start}.tf-8f4efd{font-size:var(--tf-font-lg);font-weight:600;color:var(--tf-text)}.tf-51bf2b{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary)}.tf-87740a{text-align:right}.tf-43fbf4{color:var(--tf-text);font-size:var(--tf-font-md);font-weight:500;font-family:var(--tf-font-family-mono)}.tf-43fbf4.tf-2ee375{color:var(--tf-text-tertiary)}.tf-61ca3c{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary);font-family:var(--tf-font-family-mono)}",'@keyframes tf-36c468{0%{transform:scale(.3);opacity:0}to{transform:scale(1);opacity:1}}@keyframes tf-dc4326{0%{stroke-dashoffset:24}to{stroke-dashoffset:0}}@keyframes tf-13e6cd{0%{transform:scale(1);opacity:.5}to{transform:scale(1.6);opacity:0}}@keyframes tf-2b6de5{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes tf-5b8ef8{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}.tf-e98a9a{width:100%;min-width:0;padding:28px 20px 24px;display:flex;flex-direction:column;align-items:center;animation:tf-2b6de5 .35s ease both;box-sizing:border-box}.tf-1f9019{position:relative;width:64px;height:64px;border-radius:50%;background:linear-gradient(145deg,var(--tf-success),#00E6A0);padding:2px;display:flex;align-items:center;justify-content:center;margin-bottom:16px;animation:tf-36c468 .5s cubic-bezier(.34,1.56,.64,1) both;box-shadow:0 2px 8px #00c48c4d,0 8px 32px #00c48c33}.tf-1f9019:before{content:"";position:absolute;inset:-2px;border-radius:50%;border:2px solid var(--tf-success);animation:tf-13e6cd 3s ease-out infinite;pointer-events:none}.tf-fd4d56{width:100%;height:100%;border-radius:50%;background:var(--tf-bg);display:flex;align-items:center;justify-content:center}.tf-d3c8df{display:flex;color:var(--tf-success)}.tf-d3c8df svg{stroke-dasharray:24;stroke-dashoffset:24;animation:tf-dc4326 .4s ease .35s forwards}.tf-9e3a66{font-size:var(--tf-font-heading);font-weight:700;color:var(--tf-text);margin-bottom:4px;letter-spacing:-.01em}.tf-db06d4{font-size:var(--tf-font-md);color:var(--tf-text-secondary);margin-bottom:20px}.tf-c9a5e1{position:relative;width:100%;padding:20px;border-radius:16px;background:linear-gradient(135deg,#00c48c14,#00e6a00a);border:1px solid rgba(0,196,140,.15);display:flex;flex-direction:column;align-items:center;gap:6px;margin-bottom:16px;animation:tf-2b6de5 .4s ease .2s both;overflow:hidden}.tf-c9a5e1:after{content:"";position:absolute;bottom:-20px;left:50%;transform:translate(-50%);width:60%;height:40px;background:radial-gradient(ellipse at center,rgba(0,196,140,.12),transparent 70%);pointer-events:none}.tf-7b3b5b{position:relative;width:40px;height:40px;margin-bottom:4px}.tf-651299{position:absolute;bottom:-2px;right:-2px;width:16px;height:16px;border-radius:50%;background:var(--tf-bg);display:flex;align-items:center;justify-content:center;border:1.5px solid rgba(0,196,140,.15)}.tf-f52291{font-size:var(--tf-font-amount-lg);font-weight:700;color:var(--tf-text);font-family:var(--tf-font-family-mono);letter-spacing:-.02em;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;justify-content:center}.tf-8cfc86{font-size:var(--tf-font-lg);font-weight:500;color:var(--tf-text-secondary)}.tf-5f768d{font-size:var(--tf-font-sm);font-weight:500;font-family:var(--tf-font-family);color:var(--tf-text-tertiary);letter-spacing:0}.tf-75f592{width:100%;margin-bottom:16px}.tf-73910d{width:100%;display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--tf-input-bg);border:1px solid var(--tf-border-light);border-radius:10px;cursor:pointer;font-size:var(--tf-font-base);font-weight:500;color:var(--tf-text-secondary);font-family:var(--tf-font-family);transition:background .15s}.tf-73910d:hover{background:var(--tf-bg-secondary)}.tf-ae94a0{border-radius:10px 10px 0 0}.tf-1afb0a{transition:transform .2s ease;color:var(--tf-text-tertiary);display:flex;justify-content:center;align-items:center}.tf-7737cf{transform:rotate(180deg)}.tf-92a530{padding:8px 14px 12px;border:1px solid var(--tf-border-light);border-top:none;border-radius:0 0 10px 10px;background:var(--tf-input-bg);animation:tf-5b8ef8 .15s ease both}.tf-6e8c3e{display:flex;justify-content:space-between;align-items:center;font-size:var(--tf-font-sm);padding:5px 0}.tf-4b5396{color:var(--tf-text-tertiary);font-weight:500}.tf-63cca1{color:var(--tf-text-secondary);font-family:var(--tf-font-family-mono);font-size:var(--tf-font-sm);display:flex;align-items:center;gap:4px}.tf-18c122{color:var(--tf-primary);text-decoration:none;font-size:var(--tf-font-sm);font-family:var(--tf-font-family-mono);display:inline-flex;align-items:center;gap:3px;transition:opacity .15s}.tf-18c122:hover{opacity:.7}.tf-d7e813{width:100%;padding:14px 0;border-radius:14px;border:none;background:var(--tf-primary);color:var(--tf-text-on-primary);font-weight:600;font-size:var(--tf-font-xl);cursor:pointer;font-family:var(--tf-font-family);box-shadow:0 4px 16px color-mix(in srgb,var(--tf-primary) 25%,transparent);transition:transform .15s ease,opacity .15s ease}.tf-d7e813:hover{opacity:.95;transform:translateY(-1px)}.tf-d7e813:active{transform:translateY(0)}',".tf-c63ac0{border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--tf-text-on-primary);font-weight:700;font-family:var(--tf-font-family);flex-shrink:0;overflow:hidden}.tf-59aca7{width:100%;height:100%;object-fit:cover;border-radius:50%}.tf-dbfbb3{border-radius:50%;flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center}.tf-f89395{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}.tf-cdfe94{display:flex;align-items:center;justify-content:center;gap:6px;padding:12px 0 14px;border-top:1px solid var(--tf-border-light);margin:8px 20px 0;text-decoration:none}.tf-7c0c36{font-size:var(--tf-font-sm);color:var(--tf-text-tertiary)}.tf-26d5ea{font-size:var(--tf-font-base);line-height:1}.tf-8b1e15{font-size:var(--tf-font-sm);font-weight:600;letter-spacing:.02em;color:var(--tf-text-secondary)}.tf-3852e5,.tf-b35860{color:var(--tf-primary)}",'@keyframes tf-80a677{to{transform:rotate(360deg)}}@keyframes tf-d97ff2{0%,to{opacity:1}50%{opacity:.4}}@keyframes tf-c3558b{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes tf-89a83e{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(6px)}}@keyframes tf-ca9155{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes tf-d2dbc4{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@keyframes tf-54b7e7{0%,to{border-color:var(--tf-primary)}50%{border-color:var(--tf-primary-light)}}@keyframes tf-194f18{to{transform:rotate(360deg)}}@keyframes tf-cdef4a{0%{transform:scale(.3);opacity:0}50%{transform:scale(1.05)}70%{transform:scale(.95)}to{transform:scale(1);opacity:1}}@keyframes tf-fd8795{0%{transform:translateY(0) rotate(0)}to{transform:translateY(-4px) rotate(8deg)}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{display:block;color:var(--tf-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--tf-font-family: "DM Sans", sans-serif;--tf-font-family-mono: "JetBrains Mono", monospace;font-family:var(--tf-font-family);--tf-font-2xs: 10px;--tf-font-xs: 11px;--tf-font-sm: 12px;--tf-font-base: 13px;--tf-font-md: 14px;--tf-font-lg: 15px;--tf-font-xl: 16px;--tf-font-2xl: 17px;--tf-font-heading: 20px;--tf-font-amount: 28px;--tf-font-amount-lg: 24px;--tf-font-amount-sm: 22px}button:focus-visible,a:focus-visible{outline:2px solid var(--tf-primary);outline-offset:2px;border-radius:4px}',".tf-1ac2ef{border-radius:6px;background:var(--tf-skeleton);animation:tf-90e981 1.5s infinite}.tf-68a980{position:absolute;inset:0;border-radius:20px;display:flex;align-items:flex-start;z-index:10;overflow:hidden;animation:tf-552c66 .2s ease both}.tf-e7b9c7{width:100%;max-width:400px;min-width:360px;border-radius:20px;overflow:hidden;background:var(--tf-bg);border:1px solid var(--tf-border);box-shadow:var(--tf-shadow-lg);font-family:var(--tf-font-family);color:var(--tf-text);position:relative;transition:background .25s ease,border-color .25s ease,box-shadow .25s ease}.tf-b4f391{background:transparent}.tf-118b57{border:none;box-shadow:none}.tf-118b57 .tf-07225e{display:none}.tf-07225e{height:2px;background:linear-gradient(90deg,transparent,var(--tf-primary),transparent);opacity:.6}.tf-d01dff{padding:16px 20px 20px;animation:tf-ed0355 .3s ease .1s both}.tf-5bb68c{padding:12px 20px 0}.tf-04e1e2{margin:12px 20px 0;padding:14px;background:var(--tf-primary-light);border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;height:131px;box-sizing:border-box;animation:tf-b61e63 .25s ease both}.tf-d01908{color:var(--tf-text-tertiary);opacity:.4}.tf-1cc72b{font-size:var(--tf-font-base);color:var(--tf-text-secondary)}.tf-480f1a{padding:0 20px 16px;text-align:center}.tf-480f1a a{font-size:var(--tf-font-base);color:var(--tf-primary);text-decoration:none;font-family:var(--tf-font-family-mono)}.tf-bc7950{text-align:center;margin-top:8px;margin-bottom:10px}.tf-bc7950 a{font-size:var(--tf-font-sm);color:var(--tf-primary);text-decoration:none;font-family:var(--tf-font-family-mono)}.tf-d9b7b4{display:inline-flex;align-items:center;gap:4px;background:var(--tf-surface);border:1px solid var(--tf-border);border-radius:6px;padding:2px 8px;cursor:pointer;font-size:var(--tf-font-sm);font-family:var(--tf-font-family-mono);color:var(--tf-text-secondary);transition:background .15s,border-color .15s}.tf-d9b7b4:hover{background:var(--tf-surface-hover)}.tf-d9b7b4 svg{opacity:.4;transition:opacity .15s}.tf-d9b7b4:hover svg{opacity:.7}.tf-9398ea{border-style:dashed;border-color:var(--tf-primary)}.tf-9398ea .tf-2d9323{color:var(--tf-primary);font-style:italic;font-family:var(--tf-font-family)}.tf-4567e1{cursor:default;opacity:.8}.tf-4567e1:hover{background:var(--tf-surface)}.tf-58881e{color:var(--tf-text-tertiary);font-style:italic}"].join("\n"),Dc={"--tf-bg":"#ffffff","--tf-bg-secondary":"#f8f9fb","--tf-bg-elevated":"#ffffff","--tf-surface":"#ffffff","--tf-surface-hover":"#f3f4f8","--tf-text":"#0f1419","--tf-text-secondary":"#5e6673","--tf-text-tertiary":"#9ba3af","--tf-text-on-primary":"#ffffff","--tf-border":"#e8eaef","--tf-border-light":"#f0f1f5","--tf-primary":"#6C5CE7","--tf-primary-alpha":"rgba(108,92,231,0.12)","--tf-primary-light":"rgba(108,92,231,0.1)","--tf-primary-glow":"rgba(108,92,231,0.15)","--tf-success":"#00C48C","--tf-success-bg":"rgba(0,196,140,0.08)","--tf-error":"#FF4757","--tf-error-bg":"rgba(255,71,87,0.08)","--tf-error-alpha":"rgba(255,71,87,0.06)","--tf-warning":"#FFAA00","--tf-warning-bg":"rgba(255,170,0,0.08)","--tf-shadow":"0 2px 16px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.1)","--tf-shadow-lg":"0 8px 40px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.1)","--tf-input-bg":"#f5f6f8","--tf-glass":"rgba(255,255,255,0.7)","--tf-skeleton":"#e8eaef","--tf-radius-sm":"8px","--tf-radius":"12px","--tf-radius-lg":"16px","--tf-radius-xl":"20px","--tf-accent":"var(--tf-primary)","--tf-accent-light":"var(--tf-primary-light)","--tf-accent-glow":"var(--tf-primary-glow)"},_c={"--tf-bg":"#0d0f14","--tf-bg-secondary":"#141720","--tf-bg-elevated":"#1e2230","--tf-surface":"#181b25","--tf-surface-hover":"#1e2230","--tf-text":"#eef0f6","--tf-text-secondary":"#8b93a5","--tf-text-tertiary":"#555d6e","--tf-text-on-primary":"#ffffff","--tf-border":"#252a38","--tf-border-light":"#1e2230","--tf-primary":"#8B7CF6","--tf-primary-alpha":"rgba(139,124,246,0.15)","--tf-primary-light":"rgba(139,124,246,0.1)","--tf-primary-glow":"rgba(139,124,246,0.2)","--tf-success":"#34D399","--tf-success-bg":"rgba(52,211,153,0.1)","--tf-error":"#F87171","--tf-error-bg":"rgba(248,113,113,0.1)","--tf-error-alpha":"rgba(248,113,113,0.06)","--tf-warning":"#FBBF24","--tf-warning-bg":"rgba(251,191,36,0.1)","--tf-shadow":"0 2px 16px rgba(0,0,0,0.3), 0 0 1px rgba(0,0,0,0.5)","--tf-shadow-lg":"0 8px 40px rgba(0,0,0,0.4), 0 0 1px rgba(0,0,0,0.5)","--tf-input-bg":"#141720","--tf-glass":"rgba(13,15,20,0.7)","--tf-skeleton":"#252a38","--tf-radius-sm":"8px","--tf-radius":"12px","--tf-radius-lg":"16px","--tf-radius-xl":"20px","--tf-accent":"var(--tf-primary)","--tf-accent-light":"var(--tf-primary-light)","--tf-accent-glow":"var(--tf-primary-glow)"};function Fc(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join("\n ")}function Uc(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>e(t.matches?_c:Dc);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)}function qc(e,t){for(const[r,n]of Object.entries(t))void 0!==n&&e.style.setProperty(r,n)}function $c(e){if(e)try{return JSON.parse(e)}catch(t){return e}}function Mc(e,t,r,n){if(null==r||!1===r)return e.removeAttribute(t);let i=n?JSON.stringify(r):r;e.__updating[t]=!0,"true"===i&&(i=""),e.setAttribute(t,i),Promise.resolve().then(()=>delete e.__updating[t])}function jc(e){return null!=e&&("object"==typeof e||"function"==typeof e)}let Lc;function zc(e,t){const r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(e=>t[e].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};for(let e of r)this[e]=void 0}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=function(e,t){const r=function(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];var i;return t[r]=Object.assign({},n),jc(n.value)&&(i=n.value,"[object Function]"!==Object.prototype.toString.call(i))&&!Array.isArray(n.value)&&(t[r].value=Object.assign({},n.value)),Array.isArray(n.value)&&(t[r].value=n.value.slice(0)),t},{})}(t);return Object.keys(t).forEach(t=>{const n=r[t],i=e.getAttribute(n.attribute),o=e[t];null!=i&&(n.value=n.parse?$c(i):i),null!=o&&(n.value=Array.isArray(o)?o.slice(0):o),n.reflect&&Mc(e,n.attribute,n.value,!!n.parse),Object.defineProperty(e,t,{get:()=>n.value,set(e){const r=n.value;n.value=e,n.reflect&&Mc(this,n.attribute,n.value,!!n.parse);for(let n=0,i=this.__propertyChangedCallbacks.length;n<i;n++)this.__propertyChangedCallbacks[n](t,e,r)},enumerable:!0,configurable:!0})}),r}(this,t);const e=function(e){return Object.keys(e).reduce((t,r)=>(t[r]=e[r].value,t),{})}(this.props),r=this.Component,n=Lc;try{Lc=this,this.__initialized=!0,"function"==typeof(i=r)&&0===i.toString().indexOf("class")?new r(e,{element:this}):r(e,{element:this})}finally{Lc=n}var i}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let e=null;for(;e=this.__releaseCallbacks.pop();)e(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(e,r,n){if(this.__initialized&&!this.__updating[e]&&(e=this.lookupProp(e))in t){if(null==n&&!this[e])return;this[e]=t[e].parse?$c(n):n}}lookupProp(e){if(t)return r.find(r=>e===r||e===t[r].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(e){this.__releaseCallbacks.push(e)}addPropertyChangedCallback(e){this.__propertyChangedCallbacks.push(e)}}}var Wc=pr("<style>");function Bc(e){if(null!=e){if("boolean"==typeof e)return e;if("string"==typeof e){const t=e.trim().toLowerCase();if(""===t||"true"===t||"1"===t||"yes"===t)return!0;if("false"===t||"0"===t||"no"===t)return!1}}}const[Hc,Qc]=ht(),[Kc,Vc]=ht(),[Gc,Yc]=ht(),[Xc,Jc]=ht(),[Zc,el]=ht(),[tl,rl]=ht();function nl(e={}){"walletAdapter"in e&&Qc(()=>e.walletAdapter),"callbacks"in e&&Vc(()=>e.callbacks),"customColors"in e&&Yc(()=>e.customColors),"apiEndpoint"in e&&Jc(e.apiEndpoint),"theme"in e&&el(e.theme),"locale"in e&&rl(e.locale),"undefined"!=typeof customElements&&(customElements.get("tokenflight-receive")||function(e,t,r){2===arguments.length&&(r=t,t={}),function(e,t={},r={}){const{BaseElement:n=HTMLElement,extension:i,customElements:o=window.customElements}=r;return r=>{let s=o.get(e);return s?(s.prototype.Component=r,s):(s=zc(n,function(e){return e?Object.keys(e).reduce((t,r)=>{const n=e[r];return t[r]=jc(n)&&"value"in n?n:{value:n},t[r].attribute||(t[r].attribute=r.replace(/\.?([A-Z]+)/g,(e,t)=>"-"+t.toLowerCase()).replace("_","-").replace(/^-/,"")),t[r].parse="parse"in t[r]?t[r].parse:"string"!=typeof t[r].value,t},{}):{}}(t)),s.prototype.Component=r,s.prototype.registeredTag=e,o.define(e,s,i),s)}}(e,t)(function(e){return(t,r)=>{const{element:n}=r;return ut(i=>{const o=function(e){const t=Object.keys(e),r={};for(let n=0;n<t.length;n++){const[i,o]=ht(e[t[n]]);Object.defineProperty(r,t[n],{get:i,set(e){o(()=>e)}})}return r}(t);n.addPropertyChangedCallback((e,t)=>o[e]=t),n.addReleaseCallback(()=>{n.renderRoot.textContent="",i()});const s=e(o,r);return kr(n.renderRoot,s)},function(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&(!t.assignedSlot||!t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}(n))}}(r))}("tokenflight-receive",{"api-endpoint":"",target:"",amount:"","from-token":"",recipient:"","title-text":"","title-image":"",theme:"",locale:"","csp-nonce":"",icon:"","hide-title":!1,"hide-powered-by":!1,"no-background":!1,"no-border":!1},(e,{element:t})=>{const r={apiEndpoint:e["api-endpoint"]||Xc()||void 0,target:e.target||"",amount:e.amount||"",fromToken:e["from-token"]||void 0,recipient:e.recipient||void 0,titleText:e["title-text"]||void 0,titleImageUrl:e["title-image"]||void 0,theme:e.theme||Zc()||"light",locale:e.locale||tl()||"en-US",icon:e.icon||void 0,hideTitle:Bc(e["hide-title"]),hidePoweredBy:Bc(e["hide-powered-by"]),noBackground:Bc(e["no-background"]),noBorder:Bc(e["no-border"])},n=e["csp-nonce"]||void 0,[i,o]=ht("undefined"!=typeof window&&!0===window.matchMedia?.("(prefers-color-scheme: dark)").matches);Tt(Uc(e=>{o(e===_c)}));const s=t.__customColors,a=bt(()=>{const t=e.theme||Zc()||"light",r=("auto"===t?i():"dark"===t)?_c:Dc,n=Gc();return`:host { ${Fc(n||s?{...r,...n,...s}:r)} }\n${Nc}`}),c=t.__walletAdapter,l=t.__callbacks;return[(d=Wc(),gr(d,"nonce",n),kr(d,a),d),Kt(Yn,{client:xa,get children(){return Kt(Pc,{config:r,get walletAdapter(){return c??Hc()},get callbacks(){return l?{...Kc(),...l}:Kc()}})}})];var d}))}"undefined"!=typeof window&&nl();const il=Object.freeze(Object.defineProperty({__proto__:null,default:{"swap.title":"TokenFlight","swap.youPay":"支付","swap.youReceive":"收到","swap.balance":"余额: {balance}","swap.selectToken":"选择代币","swap.connectWallet":"连接钱包","swap.reviewSwap":"查看兑换","swap.confirmSwap":"确认兑换","swap.executing":"执行中...","swap.success":"兑换成功","swap.error.generic":"交易失败 — 重试","swap.viewExplorer":"在浏览器中查看","swap.max":"最大","swap.rate":"汇率","swap.fee":"费用","swap.estTime":"预计时间","swap.poweredBy":"由","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"钱包账户","swap.recipient":"接收地址","swap.required":"必填","swap.recipientPlaceholder":"输入目标地址","swap.enterRecipient":"输入收款地址","swap.recipientTitle":"收款地址","swap.recipientConfirm":"确认","swap.recipientInvalid":"此链地址格式无效","swap.noRoutesAvailable":"暂无可用路由","receive.title":"TokenFlight","receive.youReceive":"您将收到","receive.payWith":"使用支付","receive.buy":"购买 {amount} {symbol}","receive.processing":"处理中...","receive.success":"购买完成","receive.noPaymentOptions":"没有可用的代币","receive.noPaymentHint":"浏览代币以选择支付方式","receive.connectToSeeTokens":"连接钱包以查看支付选项","receive.findingBestSource":"正在寻找最优来源...","receive.noOfferAvailable":"暂无可用报价","receive.browseAll":"浏览所有代币","receive.changePayment":"更换支付代币","receive.best":"最佳","receive.fee":"费用: {value}","receive.viewExplorer":"在浏览器中查看","selector.title.from":"选择支付代币","selector.title.to":"选择目标代币","selector.search":"按名称或地址搜索","selector.allChains":"所有链","selector.noResults":"未找到代币","tracking.step1.title":"已签名","tracking.step1.subtitle":"签名已提交","tracking.step1.signing":"钱包签名","tracking.step1.signingSubtitle":"请在钱包中确认...","tracking.step2.title":"在 {chain} 上存入","tracking.step2.waiting":"等待确认中...","tracking.step2.confirmed":"已上链确认","tracking.step3.title":"提供商正在执行订单","tracking.step3.subtitle":"通过 {provider}","tracking.step3.expired":"订单已过期","tracking.step3.expiredSubtitle":"无做市商接受此订单","tracking.step3.failed":"订单失败","tracking.step3.failedSubtitle":"无法完成","tracking.step4.title":"已在 {chain} 上完成","tracking.step4.subtitle":"代币已送达","tracking.step4.refundPending":"退款进行中","tracking.step4.refundSubtitle":"正在 {chain} 上退还代币","tracking.step4.failed":"订单失败","tracking.step4.failedSubtitle":"交付未成功","tracking.viewOnExplorer":"查看","tracking.retry":"重试","tracking.via":"通过 {provider}","failure.title":"订单失败","failure.refundedTitle":"订单已退款","failure.subtitle":"您的订单无法完成。","failure.refundedSubtitle":"您的资金已退回钱包。","failure.refundAmount":"已退款","failure.refundTx":"退款交易","success.title":"交易完成","success.tokensLanded":"代币已到账!","success.deliveredIn":"{seconds}秒内送达","success.delivered":"您的代币已送达","success.onChain":"在 {chain} 上","success.journeyDetails":"交易详情","success.from":"发送","success.to":"接收","success.sender":"发送方","success.recipient":"接收方","success.depositTx":"存入交易","success.fillTx":"完成交易","success.provider":"提供商","success.sent":"已发送","success.received":"已收到","success.viewExplorer":"在浏览器中查看","success.newSwap":"新交易","success.newPurchase":"新购买","error.invalidConfig":"配置无效","error.walletNotConnected":"钱包未连接","error.transactionFailed":"交易失败","error.quoteFailed":"获取报价失败","error.timeout":"请求超时","error.insufficientBalance":"余额不足","error.walletChainMismatch":"钱包地址与源链不匹配","swap.swapTokens":"切换代币","selector.close":"关闭","time.seconds":"~{value}秒","time.minutes":"~{value}分钟","quote.refresh":"报价刷新","amount.zero":"0"}},Symbol.toStringTag,{value:"Module"})),ol=Object.freeze(Object.defineProperty({__proto__:null,default:{"swap.title":"TokenFlight","swap.youPay":"支付","swap.youReceive":"收到","swap.balance":"餘額: {balance}","swap.selectToken":"選擇代幣","swap.connectWallet":"連接錢包","swap.reviewSwap":"查看兌換","swap.confirmSwap":"確認兌換","swap.executing":"執行中...","swap.success":"兌換成功","swap.error.generic":"交易失敗 — 重試","swap.viewExplorer":"在瀏覽器中查看","swap.max":"最大","swap.rate":"匯率","swap.fee":"費用","swap.estTime":"預計時間","swap.poweredBy":"由","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"錢包帳戶","swap.recipient":"接收地址","swap.required":"必填","swap.recipientPlaceholder":"輸入目標地址","swap.enterRecipient":"輸入收款地址","swap.recipientTitle":"收款地址","swap.recipientConfirm":"確認","swap.recipientInvalid":"此鏈地址格式無效","swap.noRoutesAvailable":"暫無可用路由","receive.title":"TokenFlight","receive.youReceive":"您將收到","receive.payWith":"使用支付","receive.buy":"購買 {amount} {symbol}","receive.processing":"處理中...","receive.success":"購買完成","receive.noPaymentOptions":"沒有可用的代幣","receive.noPaymentHint":"瀏覽代幣以選擇支付方式","receive.connectToSeeTokens":"連接錢包以查看支付選項","receive.findingBestSource":"正在尋找最優來源...","receive.noOfferAvailable":"暫無可用報價","receive.browseAll":"瀏覽所有代幣","receive.changePayment":"更換支付代幣","receive.best":"最佳","receive.fee":"費用: {value}","receive.viewExplorer":"在瀏覽器中查看","selector.title.from":"選擇支付代幣","selector.title.to":"選擇目標代幣","selector.search":"按名稱或地址搜索","selector.allChains":"所有鏈","selector.noResults":"未找到代幣","tracking.step1.title":"已簽名","tracking.step1.subtitle":"簽名已提交","tracking.step1.signing":"錢包簽名","tracking.step1.signingSubtitle":"請在錢包中確認...","tracking.step2.title":"在 {chain} 上存入","tracking.step2.waiting":"等待確認中...","tracking.step2.confirmed":"已上鏈確認","tracking.step3.title":"提供商正在執行訂單","tracking.step3.subtitle":"透過 {provider}","tracking.step3.expired":"訂單已過期","tracking.step3.expiredSubtitle":"無做市商接受此訂單","tracking.step3.failed":"訂單失敗","tracking.step3.failedSubtitle":"無法完成","tracking.step4.title":"已在 {chain} 上完成","tracking.step4.subtitle":"代幣已送達","tracking.step4.refundPending":"退款進行中","tracking.step4.refundSubtitle":"正在 {chain} 上退還代幣","tracking.step4.failed":"訂單失敗","tracking.step4.failedSubtitle":"交付未成功","tracking.viewOnExplorer":"查看","tracking.retry":"重試","tracking.via":"透過 {provider}","failure.title":"訂單失敗","failure.refundedTitle":"訂單已退款","failure.subtitle":"您的訂單無法完成。","failure.refundedSubtitle":"您的資金已退回錢包。","failure.refundAmount":"已退款","failure.refundTx":"退款交易","success.title":"交易完成","success.tokensLanded":"代幣已到帳!","success.deliveredIn":"{seconds}秒內送達","success.delivered":"您的代幣已送達","success.onChain":"在 {chain} 上","success.journeyDetails":"交易詳情","success.from":"發送","success.to":"接收","success.sender":"發送方","success.recipient":"接收方","success.depositTx":"存入交易","success.fillTx":"完成交易","success.provider":"提供商","success.sent":"已發送","success.received":"已收到","success.viewExplorer":"在瀏覽器中查看","success.newSwap":"新交易","success.newPurchase":"新購買","error.invalidConfig":"配置無效","error.walletNotConnected":"錢包未連接","error.transactionFailed":"交易失敗","error.quoteFailed":"獲取報價失敗","error.timeout":"請求超時","error.insufficientBalance":"餘額不足","error.walletChainMismatch":"錢包地址與源鏈不匹配","swap.swapTokens":"切換代幣","selector.close":"關閉","time.seconds":"~{value}秒","time.minutes":"~{value}分鐘","quote.refresh":"報價刷新","amount.zero":"0"}},Symbol.toStringTag,{value:"Module"})),sl=Object.freeze(Object.defineProperty({__proto__:null,default:{"swap.title":"TokenFlight","swap.youPay":"支払い","swap.youReceive":"受取り","swap.balance":"残高: {balance}","swap.selectToken":"トークンを選択","swap.connectWallet":"ウォレットを接続","swap.reviewSwap":"スワップを確認","swap.confirmSwap":"スワップを実行","swap.executing":"実行中...","swap.success":"スワップ成功","swap.error.generic":"取引失敗 — 再試行","swap.viewExplorer":"エクスプローラーで表示","swap.max":"最大","swap.rate":"レート","swap.fee":"手数料","swap.estTime":"推定時間","swap.poweredBy":"Powered by","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"ウォレットアカウント","swap.recipient":"受取アドレス","swap.required":"必須","swap.recipientPlaceholder":"宛先アドレスを入力","swap.enterRecipient":"受取アドレスを入力","swap.recipientTitle":"受取アドレス","swap.recipientConfirm":"確認","swap.recipientInvalid":"このチェーンのアドレス形式が無効です","swap.noRoutesAvailable":"利用可能なルートがありません","receive.title":"TokenFlight","receive.youReceive":"受取り","receive.payWith":"支払い方法","receive.buy":"{amount} {symbol}を購入","receive.processing":"処理中...","receive.success":"購入完了","receive.noPaymentOptions":"利用可能なトークンがありません","receive.noPaymentHint":"トークンを検索して支払い方法を選択してください","receive.connectToSeeTokens":"ウォレットを接続して支払いオプションを表示","receive.findingBestSource":"最適なソースを検索中...","receive.noOfferAvailable":"利用可能なオファーがありません","receive.browseAll":"すべてのトークンを見る","receive.changePayment":"支払いトークンを変更","receive.best":"最適","receive.fee":"手数料: {value}","receive.viewExplorer":"エクスプローラーで表示","selector.title.from":"支払いトークンを選択","selector.title.to":"受取りトークンを選択","selector.search":"名前またはアドレスで検索","selector.allChains":"全チェーン","selector.noResults":"トークンが見つかりません","tracking.step1.title":"署名完了","tracking.step1.subtitle":"署名を提出しました","tracking.step1.signing":"ウォレットで署名","tracking.step1.signingSubtitle":"ウォレットで確認してください...","tracking.step2.title":"{chain}への入金","tracking.step2.waiting":"確認待ち...","tracking.step2.confirmed":"オンチェーンで確認済み","tracking.step3.title":"プロバイダーが注文を処理中","tracking.step3.subtitle":"{provider}経由","tracking.step3.expired":"注文が期限切れ","tracking.step3.expiredSubtitle":"フィラーが注文を受け付けませんでした","tracking.step3.failed":"注文が失敗","tracking.step3.failedSubtitle":"完了できませんでした","tracking.step4.title":"{chain}で完了","tracking.step4.subtitle":"トークンが送達されました","tracking.step4.refundPending":"返金処理中","tracking.step4.refundSubtitle":"{chain}でトークンを返還中","tracking.step4.failed":"注文が失敗","tracking.step4.failedSubtitle":"送達に失敗しました","tracking.viewOnExplorer":"表示","tracking.retry":"リトライ","tracking.via":"{provider}経由","failure.title":"注文が失敗しました","failure.refundedTitle":"注文が返金されました","failure.subtitle":"注文を完了できませんでした。","failure.refundedSubtitle":"資金がウォレットに返金されました。","failure.refundAmount":"返金額","failure.refundTx":"返金トランザクション","success.title":"取引完了","success.tokensLanded":"トークンが到着しました!","success.deliveredIn":"{seconds}秒で送達","success.delivered":"トークンが送達されました","success.onChain":"{chain}上","success.journeyDetails":"取引詳細","success.from":"送金元","success.to":"送金先","success.sender":"送信者","success.recipient":"受取人","success.depositTx":"入金取引","success.fillTx":"完了取引","success.provider":"プロバイダー","success.sent":"送金","success.received":"受取","success.viewExplorer":"エクスプローラーで表示","success.newSwap":"新しいスワップ","success.newPurchase":"新しい購入","error.invalidConfig":"設定が無効です","error.walletNotConnected":"ウォレットが接続されていません","error.transactionFailed":"取引が失敗しました","error.quoteFailed":"見積もりの取得に失敗しました","error.timeout":"リクエストがタイムアウトしました","error.insufficientBalance":"残高不足","error.walletChainMismatch":"ウォレットがソースチェーンと一致しません","swap.swapTokens":"トークンを入れ替える","selector.close":"閉じる","time.seconds":"~{value}秒","time.minutes":"~{value}分","quote.refresh":"見積もり更新","amount.zero":"0"}},Symbol.toStringTag,{value:"Module"})),al=Object.freeze(Object.defineProperty({__proto__:null,default:{"swap.title":"TokenFlight","swap.youPay":"지불","swap.youReceive":"수령","swap.balance":"잔액: {balance}","swap.selectToken":"토큰 선택","swap.connectWallet":"지갑 연결","swap.reviewSwap":"스왑 확인","swap.confirmSwap":"스왑 실행","swap.executing":"실행 중...","swap.success":"스왑 성공","swap.error.generic":"거래 실패 — 재시도","swap.viewExplorer":"익스플로러에서 보기","swap.max":"최대","swap.rate":"환율","swap.fee":"수수료","swap.estTime":"예상 시간","swap.poweredBy":"Powered by","swap.approx":"~{value}","swap.fiatValue":"≈ ${value}","swap.account":"지갑 계정","swap.recipient":"수신 주소","swap.required":"필수","swap.recipientPlaceholder":"대상 주소 입력","swap.enterRecipient":"수신 주소 입력","swap.recipientTitle":"수신 주소","swap.recipientConfirm":"확인","swap.recipientInvalid":"이 체인의 주소 형식이 올바르지 않습니다","swap.noRoutesAvailable":"이용 가능한 경로 없음","receive.title":"TokenFlight","receive.youReceive":"수령","receive.payWith":"결제 수단","receive.buy":"{amount} {symbol} 구매","receive.processing":"처리 중...","receive.success":"구매 완료","receive.noPaymentOptions":"사용 가능한 토큰이 없습니다","receive.noPaymentHint":"토큰을 검색하여 결제 수단을 선택하세요","receive.connectToSeeTokens":"지갑을 연결하여 결제 옵션을 확인하세요","receive.findingBestSource":"최적의 소스를 찾는 중...","receive.noOfferAvailable":"이용 가능한 오퍼 없음","receive.browseAll":"모든 토큰 보기","receive.changePayment":"결제 토큰 변경","receive.best":"최적","receive.fee":"수수료: {value}","receive.viewExplorer":"익스플로러에서 보기","selector.title.from":"결제 토큰 선택","selector.title.to":"수령 토큰 선택","selector.search":"이름 또는 주소로 검색","selector.allChains":"모든 체인","selector.noResults":"토큰을 찾을 수 없습니다","tracking.step1.title":"서명 완료","tracking.step1.subtitle":"서명이 제출되었습니다","tracking.step1.signing":"지갑에서 서명","tracking.step1.signingSubtitle":"지갑에서 확인해 주세요...","tracking.step2.title":"{chain}에 입금","tracking.step2.waiting":"확인 대기 중...","tracking.step2.confirmed":"온체인에서 확인됨","tracking.step3.title":"제공자가 주문 처리 중","tracking.step3.subtitle":"{provider} 경유","tracking.step3.expired":"주문 만료","tracking.step3.expiredSubtitle":"필러가 주문을 수락하지 않았습니다","tracking.step3.failed":"주문 실패","tracking.step3.failedSubtitle":"완료할 수 없습니다","tracking.step4.title":"{chain}에서 완료","tracking.step4.subtitle":"토큰이 전달되었습니다","tracking.step4.refundPending":"환불 진행 중","tracking.step4.refundSubtitle":"{chain}에서 토큰 반환 중","tracking.step4.failed":"주문 실패","tracking.step4.failedSubtitle":"전달 실패","tracking.viewOnExplorer":"보기","tracking.retry":"재시도","tracking.via":"{provider} 경유","failure.title":"주문 실패","failure.refundedTitle":"주문 환불 완료","failure.subtitle":"주문을 완료할 수 없습니다.","failure.refundedSubtitle":"자금이 지갑으로 반환되었습니다.","failure.refundAmount":"환불됨","failure.refundTx":"환불 트랜잭션","success.title":"거래 완료","success.tokensLanded":"토큰이 도착했습니다!","success.deliveredIn":"{seconds}초 만에 전달","success.delivered":"토큰이 전달되었습니다","success.onChain":"{chain}에서","success.journeyDetails":"거래 상세","success.from":"보낸 곳","success.to":"받는 곳","success.sender":"보낸 사람","success.recipient":"받는 사람","success.depositTx":"입금 트랜잭션","success.fillTx":"완료 트랜잭션","success.provider":"제공자","success.sent":"전송","success.received":"수령","success.viewExplorer":"익스플로러에서 보기","success.newSwap":"새 스왑","success.newPurchase":"새 구매","error.invalidConfig":"잘못된 설정","error.walletNotConnected":"지갑이 연결되지 않았습니다","error.transactionFailed":"거래 실패","error.quoteFailed":"견적 조회 실패","error.timeout":"요청 시간 초과","error.insufficientBalance":"잔액 부족","error.walletChainMismatch":"지갑 주소가 소스 체인과 일치하지 않습니다","swap.swapTokens":"토큰 교환","selector.close":"닫기","time.seconds":"~{value}초","time.minutes":"~{value}분","quote.refresh":"견적 갱신","amount.zero":"0"}},Symbol.toStringTag,{value:"Module"}));e.DEFAULT_API_ENDPOINT=ya,e.ErrorCode=Ve,e.MockWalletAdapter=class{constructor(){this.name="Mock Wallet",this.icon=void 0,this.supportedActionTypes=["eip1193_request","solana_signAndSendTransaction"],this.connected=!1,this.address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",this.listeners=new Map}async connect(e){this.connected=!0,this.emit("connect",{address:this.address})}async disconnect(){this.connected=!1,this.emit("disconnect")}isConnected(e){return this.connected}async getAddress(e){return this.connected?this.address:null}async executeWalletAction(e){return await new Promise(e=>setTimeout(e,1e3)),{success:!0,txHash:"0x"+"a".repeat(64)}}async signMessage(e){return"0x"+"b".repeat(130)}async openAccountModal(){}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(e,t){const r=this.listeners.get(e);if(r)for(const n of r)n({type:e,data:t})}},e.SOLANA_CHAIN_ID=Yi,e.TERMINAL_ORDER_STATUSES=Ke,e.TokenFlightError=Ye,e.TokenFlightReceive=class{constructor(e){this.dispose=null,this.unwatchTheme=null,this.shadowRoot=null,this.container=function(e){if("string"==typeof e){const t=document.querySelector(e);if(!t)throw new Ye(Ve.ELEMENT_NOT_FOUND,`Element not found: ${e}`);return t}return e}(e.container),this.config=e.config,this.walletAdapter=e.walletAdapter,this.callbacks=e.callbacks}initialize(){this.dispose&&this.destroy();const e=document.createElement("div");this.container.appendChild(e);const t=e.attachShadow({mode:"open"});this.shadowRoot=t;const r=document.createElement("style"),n=this.config.theme??"light";this.applyThemeStyles(r,n),t.appendChild(r),this.setupAutoThemeWatch(r);const i=document.createElement("div");t.appendChild(i);const o=this.config,s=this.walletAdapter,a=this.callbacks;o.customColors&&qc(e,o.customColors),this.dispose=function(e,t,r,n={}){let i;return ut(n=>{i=n,t===document?e():kr(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}(()=>Kt(Yn,{client:xa,get children(){return Kt(Pc,{config:o,walletAdapter:s,callbacks:a})}}),i)}destroy(){this.unwatchTheme&&(this.unwatchTheme(),this.unwatchTheme=null),this.dispose&&(this.dispose(),this.dispose=null),this.shadowRoot=null,this.container.innerHTML=""}setTheme(e){this.config={...this.config,theme:e};const t=this.shadowRoot;if(t){const r=t.querySelector("style");r&&(this.applyThemeStyles(r,e),this.setupAutoThemeWatch(r))}}setCustomColors(e){const t=this.shadowRoot?.host;t&&qc(t,e)}applyThemeStyles(e,t){const r=("auto"===t?"undefined"!=typeof window&&!0===window.matchMedia?.("(prefers-color-scheme: dark)").matches:"dark"===t)?_c:Dc;e.textContent=`:host { ${Fc(r)} }\n${Nc}`}setupAutoThemeWatch(e){this.unwatchTheme&&(this.unwatchTheme(),this.unwatchTheme=null),"auto"===this.config.theme&&(this.unwatchTheme=Uc(t=>{e.textContent=`:host { ${Fc(t)} }\n${Nc}`}))}},e.addThousandsSeparator=Ao,e.buildOffersForRanking=Xa,e.clearTokenCache=function(){try{const e=[];for(let t=0;t<localStorage.length;t++){const r=localStorage.key(t);r?.startsWith(ka)&&e.push(r)}for(const t of e)localStorage.removeItem(t)}catch{}},e.computeExchangeRate=Eo,e.formatDisplayAmount=Oo,e.getBestOverallRouteId=function(e,t){return Ja(Xa(e,t))[0]??null},e.getChainType=Zi,e.isCrossChainSwap=function(e,t){return Zi(e)!==Zi(t)},e.isEvmChain=Ji,e.isSolanaChain=Xi,e.rankOffers=Ja,e.registerElements=nl,e.toBaseUnits=Co,e.toDisplayAmount=So,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|