@imtbl/checkout-widgets 2.0.0-alpha.2 → 2.0.0-alpha.3

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.
Files changed (55) hide show
  1. package/dist/browser/AddTokensWidget-TM4L24PP.js +15 -0
  2. package/dist/browser/BridgeWidget-2JZZV7LZ.js +17 -1
  3. package/dist/browser/CommerceWidget-NRMKQO2X.js +41 -0
  4. package/dist/browser/ConnectWidget-ZM6T4NZJ.js +11 -1
  5. package/dist/browser/OnRampWidget-CXSJR4D2.js +10 -1
  6. package/dist/browser/SaleWidget-NS5UQNBN.js +29 -1
  7. package/dist/browser/SwapWidget-3DWYEOCD.js +18 -1
  8. package/dist/browser/WalletWidget-XWB6VELR.js +10 -1
  9. package/dist/browser/chunk-3AHRPZYV.js +15 -2
  10. package/dist/browser/chunk-5AVK5XOU.js +17 -2
  11. package/dist/browser/chunk-5U7AR7XV.js +5 -1
  12. package/dist/browser/chunk-65KT4KZW.js +6 -1
  13. package/dist/browser/chunk-AWLYHJ5L.js +6 -2
  14. package/dist/browser/chunk-BVF4MRFQ.js +9 -2
  15. package/dist/browser/chunk-DVUYKTGV.js +27 -2
  16. package/dist/browser/chunk-ECAH5RC3.js +7 -1
  17. package/dist/browser/chunk-EEDQFEKZ.js +20 -2
  18. package/dist/browser/chunk-EZWBOX2K.js +6 -1
  19. package/dist/browser/chunk-I3HZNWUF.js +6 -1
  20. package/dist/browser/chunk-JF3XWEEL.js +10 -2
  21. package/dist/browser/chunk-JV43EWXA.js +6 -1
  22. package/dist/browser/chunk-K3KIUMY7.js +7 -1
  23. package/dist/browser/chunk-KOBELCOG.js +7 -1
  24. package/dist/browser/{chunk-QPBIRWVO.js → chunk-LY53FASO.js} +31 -2
  25. package/dist/browser/chunk-MADECDXT.js +10 -2
  26. package/dist/browser/chunk-ME7FB46X.js +6 -1
  27. package/dist/browser/chunk-NNMZJ5NV.js +7 -2
  28. package/dist/browser/chunk-OPMBNAY3.js +6 -1
  29. package/dist/browser/chunk-P7Y5EGBN.js +12 -1
  30. package/dist/browser/chunk-QJTHBCR2.js +12 -1
  31. package/dist/browser/chunk-QPOHDTWR.js +13 -2
  32. package/dist/browser/chunk-R5TRMOBS.js +6 -1
  33. package/dist/browser/chunk-R7NCCCUY.js +6 -1
  34. package/dist/browser/chunk-RTSPX46P.js +7 -1
  35. package/dist/browser/chunk-UNEH2WXY.js +10 -1
  36. package/dist/browser/chunk-UNLLKACC.js +6 -1
  37. package/dist/browser/chunk-WCTMM2S2.js +24 -2
  38. package/dist/browser/chunk-WWUSGIQB.js +18 -2
  39. package/dist/browser/chunk-XE2T4YRZ.js +27 -2
  40. package/dist/browser/chunk-Y7N65KJX.js +8 -1
  41. package/dist/browser/chunk-YOCWSYBR.js +12 -1
  42. package/dist/browser/chunk-Z52PVTUZ.js +13 -2
  43. package/dist/browser/index.cdn.js +1 -1
  44. package/dist/browser/index.js +33 -3
  45. package/dist/node/{AddTokensWidget-EDEZT3WU.cjs → AddTokensWidget-4FGS24JD.cjs} +1 -1
  46. package/dist/node/{AddTokensWidget-3VRQJPK4.js → AddTokensWidget-WY3G5Z35.js} +1 -1
  47. package/dist/node/{CommerceWidget-SS5YH6AS.cjs → CommerceWidget-KTK7XCY5.cjs} +1 -1
  48. package/dist/node/{CommerceWidget-Q5YRUGMH.js → CommerceWidget-N7CELEEE.js} +1 -1
  49. package/dist/node/{chunk-JVDN4WI2.cjs → chunk-AOVPOH6S.cjs} +1 -1
  50. package/dist/node/{chunk-FI3JDTB2.js → chunk-HEO2MY2D.js} +1 -1
  51. package/dist/node/index.cjs +1 -1
  52. package/dist/node/index.js +1 -1
  53. package/package.json +8 -8
  54. package/dist/browser/AddTokensWidget-KL5Q2LI3.js +0 -1
  55. package/dist/browser/CommerceWidget-SWRL7ZWK.js +0 -1
@@ -0,0 +1,15 @@
1
+ export { a as default } from './chunk-LY53FASO.js';
2
+ import './chunk-UNEH2WXY.js';
3
+ import './chunk-OPMBNAY3.js';
4
+ import './chunk-R7NCCCUY.js';
5
+ import './chunk-BVF4MRFQ.js';
6
+ import './chunk-P7Y5EGBN.js';
7
+ import './chunk-Y7N65KJX.js';
8
+ import './chunk-5U7AR7XV.js';
9
+ import './chunk-UNLLKACC.js';
10
+ import './chunk-NNMZJ5NV.js';
11
+ import './chunk-MADECDXT.js';
12
+ import './chunk-ECAH5RC3.js';
13
+ import './chunk-JF3XWEEL.js';
14
+ import './chunk-I3HZNWUF.js';
15
+ import './chunk-QPOHDTWR.js';
@@ -1 +1,17 @@
1
- export{a as default}from'./chunk-DVUYKTGV.js';import'./chunk-P7Y5EGBN.js';import'./chunk-3AHRPZYV.js';import'./chunk-Y7N65KJX.js';import'./chunk-5U7AR7XV.js';import'./chunk-EZWBOX2K.js';import'./chunk-UNLLKACC.js';import'./chunk-Z52PVTUZ.js';import'./chunk-K3KIUMY7.js';import'./chunk-NNMZJ5NV.js';import'./chunk-MADECDXT.js';import'./chunk-RTSPX46P.js';import'./chunk-ECAH5RC3.js';import'./chunk-JF3XWEEL.js';import'./chunk-KOBELCOG.js';import'./chunk-I3HZNWUF.js';import'./chunk-QPOHDTWR.js';
1
+ export { a as default } from './chunk-DVUYKTGV.js';
2
+ import './chunk-P7Y5EGBN.js';
3
+ import './chunk-3AHRPZYV.js';
4
+ import './chunk-Y7N65KJX.js';
5
+ import './chunk-5U7AR7XV.js';
6
+ import './chunk-EZWBOX2K.js';
7
+ import './chunk-UNLLKACC.js';
8
+ import './chunk-Z52PVTUZ.js';
9
+ import './chunk-K3KIUMY7.js';
10
+ import './chunk-NNMZJ5NV.js';
11
+ import './chunk-MADECDXT.js';
12
+ import './chunk-RTSPX46P.js';
13
+ import './chunk-ECAH5RC3.js';
14
+ import './chunk-JF3XWEEL.js';
15
+ import './chunk-KOBELCOG.js';
16
+ import './chunk-I3HZNWUF.js';
17
+ import './chunk-QPOHDTWR.js';
@@ -0,0 +1,41 @@
1
+ import { a, b } from './chunk-QJTHBCR2.js';
2
+ import { a as a$3 } from './chunk-LY53FASO.js';
3
+ import { e } from './chunk-UNEH2WXY.js';
4
+ import { a as a$4 } from './chunk-WWUSGIQB.js';
5
+ import './chunk-ME7FB46X.js';
6
+ import { a as a$5 } from './chunk-XE2T4YRZ.js';
7
+ import './chunk-YOCWSYBR.js';
8
+ import './chunk-OPMBNAY3.js';
9
+ import './chunk-R7NCCCUY.js';
10
+ import { a as a$2 } from './chunk-DVUYKTGV.js';
11
+ import { a as a$1 } from './chunk-EEDQFEKZ.js';
12
+ import './chunk-BVF4MRFQ.js';
13
+ import './chunk-P7Y5EGBN.js';
14
+ import { a as a$6 } from './chunk-WCTMM2S2.js';
15
+ import './chunk-R5TRMOBS.js';
16
+ import './chunk-3AHRPZYV.js';
17
+ import './chunk-Y7N65KJX.js';
18
+ import './chunk-5U7AR7XV.js';
19
+ import './chunk-EZWBOX2K.js';
20
+ import './chunk-UNLLKACC.js';
21
+ import { b as b$1 } from './chunk-5AVK5XOU.js';
22
+ import './chunk-65KT4KZW.js';
23
+ import './chunk-AWLYHJ5L.js';
24
+ import './chunk-Z52PVTUZ.js';
25
+ import './chunk-K3KIUMY7.js';
26
+ import './chunk-NNMZJ5NV.js';
27
+ import './chunk-MADECDXT.js';
28
+ import './chunk-RTSPX46P.js';
29
+ import './chunk-ECAH5RC3.js';
30
+ import { v } from './chunk-JF3XWEEL.js';
31
+ import './chunk-KOBELCOG.js';
32
+ import './chunk-I3HZNWUF.js';
33
+ import './chunk-JV43EWXA.js';
34
+ import { d, c, ga, ca, O, ha, P, S, C, B } from './chunk-QPOHDTWR.js';
35
+ import { createContext, useReducer, useMemo, useCallback, useEffect, Suspense } from 'react';
36
+ import { CommerceFlowType, OrchestrationEventType, IMTBLWidgetEvents, CommerceEventType, ProviderEventType, ChainId, ConnectEventType, CommerceFailureEventType, CommerceSuccessEventType, WalletEventType, CommerceUserActionEventType, SwapEventType, AddTokensEventType, BridgeEventType, OnRampEventType, SaleEventType } from '@imtbl/checkout-sdk';
37
+ import { useTranslation } from 'react-i18next';
38
+
39
+ d();c();d();c();var R=(e,t)=>{let o=new CustomEvent(IMTBLWidgetEvents.IMTBL_COMMERCE_WIDGET_EVENT,{detail:t});console.log("checkout app event ",e,o),e!==void 0&&e.dispatchEvent(o);};d();c();var Ue=[CommerceFlowType.SALE,CommerceFlowType.SWAP,CommerceFlowType.WALLET,CommerceFlowType.ONRAMP],Be=[CommerceFlowType.ADD_TOKENS];function Se(e){return Ue.includes(e)}function Te(e){return Be.includes(e)}d();c();d();c();function Me(e){let{type:t,data:o}=e.detail;switch(t){case ConnectEventType.SUCCESS:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.CONNECT_SUCCESS,data:o}};case ConnectEventType.FAILURE:return {type:CommerceEventType.FAILURE,data:{type:CommerceFailureEventType.CONNECT_FAILED,data:o}};case ConnectEventType.CLOSE_WIDGET:return {type:CommerceEventType.CLOSE,data:{}};default:throw new Error(`Unknown connect event type "${e.detail.type}"`)}}function ke(e){let{type:t,data:o}=e.detail;switch(t){case WalletEventType.NETWORK_SWITCH:return {type:CommerceEventType.USER_ACTION,data:{type:CommerceUserActionEventType.NETWORK_SWITCH,data:o}};case WalletEventType.DISCONNECT_WALLET:return {type:CommerceEventType.DISCONNECTED,data:{}};case WalletEventType.CLOSE_WIDGET:return {type:CommerceEventType.CLOSE,data:{}};default:throw new Error(`Unknown wallet event type "${e.detail.type}"`)}}function xe(e){let{type:t,data:o}=e.detail;switch(t){case SwapEventType.SUCCESS:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.SWAP_SUCCESS,data:o}};case SwapEventType.FAILURE:return {type:CommerceEventType.FAILURE,data:{type:CommerceFailureEventType.SWAP_FAILED,data:o}};case SwapEventType.REJECTED:return {type:CommerceEventType.FAILURE,data:{type:CommerceFailureEventType.SWAP_REJECTED,data:o}};case SwapEventType.CLOSE_WIDGET:return {type:CommerceEventType.CLOSE,data:{}};default:throw new Error(`Unknown swap event type "${e.detail.type}"`)}}function Fe(e){let{type:t}=e.detail;switch(t){case AddTokensEventType.SUCCESS:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.ADD_TOKENS_SUCCESS,data:e.detail.data}};case AddTokensEventType.CONNECT_SUCCESS:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.ADD_TOKENS_CONNECT_SUCCESS,data:e.detail.data}};case AddTokensEventType.FAILURE:return {type:CommerceEventType.FAILURE,data:{type:CommerceFailureEventType.ADD_TOKENS_FAILED,data:e.detail.data}};case AddTokensEventType.CLOSE_WIDGET:return {type:CommerceEventType.CLOSE,data:{}};default:throw new Error(`Unknown add tokens event type "${e.detail.type}"`)}}function Ge(e){let{type:t,data:o}=e.detail;switch(t){case BridgeEventType.TRANSACTION_SENT:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.BRIDGE_SUCCESS,data:o}};case BridgeEventType.CLAIM_WITHDRAWAL_SUCCESS:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.BRIDGE_CLAIM_WITHDRAWAL_SUCCESS,data:o}};case BridgeEventType.CLAIM_WITHDRAWAL_FAILURE:return {type:CommerceEventType.FAILURE,data:{type:CommerceFailureEventType.BRIDGE_CLAIM_WITHDRAWAL_FAILED,data:o}};case BridgeEventType.FAILURE:return {type:CommerceEventType.FAILURE,data:{type:CommerceFailureEventType.BRIDGE_FAILED,data:o}};case BridgeEventType.CLOSE_WIDGET:return {type:CommerceEventType.CLOSE,data:{}};default:throw new Error(`Unknown bridge event type "${e.detail.type}"`)}}function Ke(e){let{type:t,data:o}=e.detail;switch(t){case OnRampEventType.SUCCESS:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.ONRAMP_SUCCESS,data:o}};case OnRampEventType.FAILURE:return {type:CommerceEventType.FAILURE,data:{type:CommerceFailureEventType.ONRAMP_FAILED,data:o}};case OnRampEventType.CLOSE_WIDGET:return {type:CommerceEventType.CLOSE,data:{}};default:throw new Error(`Unknown onRamp event type "${e.detail.type}"`)}}function Qe(e){let{type:t,data:o}=e.detail;switch(t){case SaleEventType.SUCCESS:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.SALE_SUCCESS,data:o}};case SaleEventType.FAILURE:return {type:CommerceEventType.FAILURE,data:{type:CommerceFailureEventType.SALE_FAILED,data:o}};case SaleEventType.CLOSE_WIDGET:return {type:CommerceEventType.CLOSE,data:{}};case SaleEventType.TRANSACTION_SUCCESS:return {type:CommerceEventType.SUCCESS,data:{type:CommerceSuccessEventType.SALE_TRANSACTION_SUCCESS,data:o}};case SaleEventType.PAYMENT_METHOD:return {type:CommerceEventType.USER_ACTION,data:{type:CommerceUserActionEventType.PAYMENT_METHOD_SELECTED,data:o}};case SaleEventType.PAYMENT_TOKEN:return {type:CommerceEventType.USER_ACTION,data:{type:CommerceUserActionEventType.PAYMENT_TOKEN_SELECTED,data:o}};default:throw new Error(`Unknown sale event type "${e.detail.type}"`)}}function ue(e){if(e.detail.type===ProviderEventType.PROVIDER_UPDATED)return {type:CommerceEventType.PROVIDER_UPDATED,data:e.detail.data};switch(e.type){case IMTBLWidgetEvents.IMTBL_CONNECT_WIDGET_EVENT:return Me(e);case IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT:return ke(e);case IMTBLWidgetEvents.IMTBL_SWAP_WIDGET_EVENT:return xe(e);case IMTBLWidgetEvents.IMTBL_ADD_TOKENS_WIDGET_EVENT:return Fe(e);case IMTBLWidgetEvents.IMTBL_BRIDGE_WIDGET_EVENT:return Ge(e);case IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT:return Ke(e);case IMTBLWidgetEvents.IMTBL_SALE_WIDGET_EVENT:return Qe(e);default:throw new Error(`Unknown widget event type "${e.type}"`)}}d();c();function ye(e){switch(e){case OrchestrationEventType.REQUEST_SWAP:return CommerceFlowType.SWAP;case OrchestrationEventType.REQUEST_CONNECT:return CommerceFlowType.CONNECT;case OrchestrationEventType.REQUEST_WALLET:return CommerceFlowType.WALLET;case OrchestrationEventType.REQUEST_BRIDGE:return CommerceFlowType.BRIDGE;case OrchestrationEventType.REQUEST_ONRAMP:return CommerceFlowType.ONRAMP;case OrchestrationEventType.REQUEST_ADD_TOKENS:return CommerceFlowType.ADD_TOKENS;default:return null}}d();c();var He=[OrchestrationEventType.REQUEST_CONNECT,OrchestrationEventType.REQUEST_WALLET,OrchestrationEventType.REQUEST_SWAP,OrchestrationEventType.REQUEST_BRIDGE,OrchestrationEventType.REQUEST_ONRAMP,OrchestrationEventType.REQUEST_ADD_TOKENS,OrchestrationEventType.REQUEST_GO_BACK];function _e(e){return He.includes(e.detail.type)}var fe=[IMTBLWidgetEvents.IMTBL_CONNECT_WIDGET_EVENT,IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT,IMTBLWidgetEvents.IMTBL_SWAP_WIDGET_EVENT,IMTBLWidgetEvents.IMTBL_BRIDGE_WIDGET_EVENT,IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,IMTBLWidgetEvents.IMTBL_SALE_WIDGET_EVENT,IMTBLWidgetEvents.IMTBL_ADD_TOKENS_WIDGET_EVENT];function ve(e,t,o){let[{history:c},s]=t,m=p=>{let{type:r,data:_}=p.detail;if(r===OrchestrationEventType.REQUEST_GO_BACK){s({payload:{type:"UPDATE_VIEW",view:c?.[0]}});return}if(r===OrchestrationEventType.REQUEST_ONRAMP){let l=_;l.provider&&o(l.provider);}let A=ye(r);A&&s({payload:{type:"UPDATE_VIEW",view:{type:A,data:{params:_,config:{},showBackButton:!0}}}});},C=useMemo(()=>e?p=>{let r=p;if(_e(r)){m(r);return}let _=ue(r);R(e,_);}:null,[e]);useEffect(()=>C?(fe.map(p=>window.addEventListener(p,C)),()=>{fe.map(p=>window.removeEventListener(p,C));}):()=>{},[C]);}d();c();var Y=e=>e.config.isProduction?ChainId.IMTBL_ZKEVM_MAINNET:ChainId.IMTBL_ZKEVM_TESTNET;function Ae(e,t,o){let{type:c}=e;switch(c){case CommerceFlowType.WALLET:return {checkout:t,browserProvider:o,targetChainId:Y(t),allowedChains:[B(t.config),C(t.config)]};case CommerceFlowType.ONRAMP:case CommerceFlowType.ADD_TOKENS:return {checkout:t,browserProvider:o,targetChainId:Y(t),allowedChains:[B(t.config),C(t.config)]};case CommerceFlowType.SALE:case CommerceFlowType.SWAP:return {checkout:t,browserProvider:o,targetChainId:Y(t),allowedChains:[C(t.config)]};default:return {}}}d();c();var q={checkout:void 0,provider:void 0,passport:void 0};var J=createContext({commerceState:q,commerceDispatch:()=>{}});J.displayName="CommerceContext";var Ie=(e,t)=>{switch(t.payload.type){case"SET_CHECKOUT":return {...e,checkout:t.payload.checkout};case"SET_PROVIDER":return {...e,provider:t.payload.provider};case"SET_PASSPORT":return {...e,passport:t.payload.passport};default:return e}};function je(e$1){let{flowParams:t,flowConfig:o,widgetsConfig:c,checkout:s,browserProvider:m}=e$1,{t:C}=useTranslation(),p=ga(),[{view:r,history:_},A]=p,[{eventTarget:l}]=ca(),[x,I]=useReducer(Ie,q),We=useMemo(()=>({commerceState:x,commerceDispatch:I}),[x,I]),{provider:X}=x,Re=useMemo(()=>Ae(r,s,X||m),[r,s,X,m]),Le=t.flow===CommerceFlowType.ADD_TOKENS?()=>{}:void 0,De=useCallback(()=>{let W=["LOADING_VIEW","ERROR_VIEW","SUCCESS_VIEW","TOP_UP_VIEW","SERVICE_UNAVAILABLE_ERROR_VIEW"],B=_.slice(0,-1).filter(({type:Ne})=>!W.includes(Ne)),j=B[B.length-1];j&&A({payload:{type:"UPDATE_VIEW",view:j}});},[_]),Oe=useMemo(()=>W=>{I({payload:{type:"SET_PROVIDER",provider:W}});},[I]);ve(l,p,Oe),useEffect(()=>{m&&I({payload:{type:"SET_PROVIDER",provider:m}});},[I,m]),useEffect(()=>{if(!t.flow)return;let{flow:W,...B}=t;A({payload:{type:"UPDATE_VIEW",view:{type:W,data:{params:B,config:{...o?.[W]||{}}}}}});},[t]),useEffect(()=>{a.includes(t.flow)||A({payload:{type:"UPDATE_VIEW",view:{type:"ERROR_VIEW",error:{name:"InvalidViewType",message:`Invalid view type "${t.flow}"`}}}});},[t.flow]);let ge=useMemo(()=>Se(r.type),[r.type]),Pe=useMemo(()=>Te(r.type),[r.type]),g=!!r.data?.showBackButton;return O(ha,{children:P(J.Provider,{value:We,children:[r.type==="LOADING_VIEW"&&O(S,{loadingText:C("views.LOADING_VIEW.text")}),r.type==="ERROR_VIEW"&&O(v,{onCloseClick:()=>{R(l,{type:CommerceEventType.CLOSE,data:{}});},onActionClick:()=>{},actionText:C("views.ERROR_VIEW.actionText")}),r.type===CommerceFlowType.CONNECT&&O(a$1,{config:c,checkout:s,sendCloseEventOverride:()=>{R(l,{type:CommerceEventType.CLOSE,data:{}});},...r.data.params||{}}),r.type===CommerceFlowType.BRIDGE&&O(a$2,{config:c,checkout:s,browserProvider:m,showBackButton:g,...r.data.params||{}}),Pe&&r.type===CommerceFlowType.ADD_TOKENS&&O(e,{initialState:{checkout:s,toProvider:r.data.params.toProvider},children:O(a$3,{config:c,...r.data.params||{},...r.data.config||{},showBackButton:g})}),ge&&O(b,{widgetConfig:c,params:Re,successEvent:Le,closeEvent:()=>{R(l,{type:CommerceEventType.CLOSE,data:{}});},showBackButton:g,goBackEvent:De,children:P(Suspense,{fallback:O(S,{loadingText:C("views.LOADING_VIEW.text")}),children:[r.type===CommerceFlowType.WALLET&&O(a$4,{config:c,walletConfig:{showNetworkMenu:!0,showDisconnectButton:!0,...r.data.config},...r.data.params||{}}),r.type===CommerceFlowType.SALE&&O(a$5,{config:c,...r.data.params||{},hideExcludedPaymentTypes:!1,waitFulfillmentSettlements:!0,...r.data.config}),r.type===CommerceFlowType.SWAP&&O(a$6,{config:c,...r.data.params||{},...r.data.config||{},showBackButton:g}),r.type===CommerceFlowType.ONRAMP&&O(b$1,{config:c,...r.data.params||{},...r.data.config||{},showBackButton:g})]})})]})})}
40
+
41
+ export { je as default };
@@ -1 +1,11 @@
1
- export{a as default}from'./chunk-EEDQFEKZ.js';import'./chunk-BVF4MRFQ.js';import'./chunk-P7Y5EGBN.js';import'./chunk-EZWBOX2K.js';import'./chunk-UNLLKACC.js';import'./chunk-K3KIUMY7.js';import'./chunk-NNMZJ5NV.js';import'./chunk-MADECDXT.js';import'./chunk-JF3XWEEL.js';import'./chunk-JV43EWXA.js';import'./chunk-QPOHDTWR.js';
1
+ export { a as default } from './chunk-EEDQFEKZ.js';
2
+ import './chunk-BVF4MRFQ.js';
3
+ import './chunk-P7Y5EGBN.js';
4
+ import './chunk-EZWBOX2K.js';
5
+ import './chunk-UNLLKACC.js';
6
+ import './chunk-K3KIUMY7.js';
7
+ import './chunk-NNMZJ5NV.js';
8
+ import './chunk-MADECDXT.js';
9
+ import './chunk-JF3XWEEL.js';
10
+ import './chunk-JV43EWXA.js';
11
+ import './chunk-QPOHDTWR.js';
@@ -1 +1,10 @@
1
- export{b as default}from'./chunk-5AVK5XOU.js';import'./chunk-65KT4KZW.js';import'./chunk-AWLYHJ5L.js';import'./chunk-Z52PVTUZ.js';import'./chunk-K3KIUMY7.js';import'./chunk-NNMZJ5NV.js';import'./chunk-KOBELCOG.js';import'./chunk-I3HZNWUF.js';import'./chunk-JV43EWXA.js';import'./chunk-QPOHDTWR.js';
1
+ export { b as default } from './chunk-5AVK5XOU.js';
2
+ import './chunk-65KT4KZW.js';
3
+ import './chunk-AWLYHJ5L.js';
4
+ import './chunk-Z52PVTUZ.js';
5
+ import './chunk-K3KIUMY7.js';
6
+ import './chunk-NNMZJ5NV.js';
7
+ import './chunk-KOBELCOG.js';
8
+ import './chunk-I3HZNWUF.js';
9
+ import './chunk-JV43EWXA.js';
10
+ import './chunk-QPOHDTWR.js';
@@ -1 +1,29 @@
1
- export{a as default}from'./chunk-XE2T4YRZ.js';import'./chunk-YOCWSYBR.js';import'./chunk-OPMBNAY3.js';import'./chunk-R7NCCCUY.js';import'./chunk-DVUYKTGV.js';import'./chunk-EEDQFEKZ.js';import'./chunk-BVF4MRFQ.js';import'./chunk-P7Y5EGBN.js';import'./chunk-WCTMM2S2.js';import'./chunk-R5TRMOBS.js';import'./chunk-3AHRPZYV.js';import'./chunk-Y7N65KJX.js';import'./chunk-5U7AR7XV.js';import'./chunk-EZWBOX2K.js';import'./chunk-UNLLKACC.js';import'./chunk-5AVK5XOU.js';import'./chunk-65KT4KZW.js';import'./chunk-AWLYHJ5L.js';import'./chunk-Z52PVTUZ.js';import'./chunk-K3KIUMY7.js';import'./chunk-NNMZJ5NV.js';import'./chunk-MADECDXT.js';import'./chunk-RTSPX46P.js';import'./chunk-ECAH5RC3.js';import'./chunk-JF3XWEEL.js';import'./chunk-KOBELCOG.js';import'./chunk-I3HZNWUF.js';import'./chunk-JV43EWXA.js';import'./chunk-QPOHDTWR.js';
1
+ export { a as default } from './chunk-XE2T4YRZ.js';
2
+ import './chunk-YOCWSYBR.js';
3
+ import './chunk-OPMBNAY3.js';
4
+ import './chunk-R7NCCCUY.js';
5
+ import './chunk-DVUYKTGV.js';
6
+ import './chunk-EEDQFEKZ.js';
7
+ import './chunk-BVF4MRFQ.js';
8
+ import './chunk-P7Y5EGBN.js';
9
+ import './chunk-WCTMM2S2.js';
10
+ import './chunk-R5TRMOBS.js';
11
+ import './chunk-3AHRPZYV.js';
12
+ import './chunk-Y7N65KJX.js';
13
+ import './chunk-5U7AR7XV.js';
14
+ import './chunk-EZWBOX2K.js';
15
+ import './chunk-UNLLKACC.js';
16
+ import './chunk-5AVK5XOU.js';
17
+ import './chunk-65KT4KZW.js';
18
+ import './chunk-AWLYHJ5L.js';
19
+ import './chunk-Z52PVTUZ.js';
20
+ import './chunk-K3KIUMY7.js';
21
+ import './chunk-NNMZJ5NV.js';
22
+ import './chunk-MADECDXT.js';
23
+ import './chunk-RTSPX46P.js';
24
+ import './chunk-ECAH5RC3.js';
25
+ import './chunk-JF3XWEEL.js';
26
+ import './chunk-KOBELCOG.js';
27
+ import './chunk-I3HZNWUF.js';
28
+ import './chunk-JV43EWXA.js';
29
+ import './chunk-QPOHDTWR.js';
@@ -1 +1,18 @@
1
- export{a as default}from'./chunk-WCTMM2S2.js';import'./chunk-R5TRMOBS.js';import'./chunk-3AHRPZYV.js';import'./chunk-Y7N65KJX.js';import'./chunk-5U7AR7XV.js';import'./chunk-EZWBOX2K.js';import'./chunk-UNLLKACC.js';import'./chunk-AWLYHJ5L.js';import'./chunk-Z52PVTUZ.js';import'./chunk-K3KIUMY7.js';import'./chunk-NNMZJ5NV.js';import'./chunk-RTSPX46P.js';import'./chunk-ECAH5RC3.js';import'./chunk-JF3XWEEL.js';import'./chunk-KOBELCOG.js';import'./chunk-I3HZNWUF.js';import'./chunk-JV43EWXA.js';import'./chunk-QPOHDTWR.js';
1
+ export { a as default } from './chunk-WCTMM2S2.js';
2
+ import './chunk-R5TRMOBS.js';
3
+ import './chunk-3AHRPZYV.js';
4
+ import './chunk-Y7N65KJX.js';
5
+ import './chunk-5U7AR7XV.js';
6
+ import './chunk-EZWBOX2K.js';
7
+ import './chunk-UNLLKACC.js';
8
+ import './chunk-AWLYHJ5L.js';
9
+ import './chunk-Z52PVTUZ.js';
10
+ import './chunk-K3KIUMY7.js';
11
+ import './chunk-NNMZJ5NV.js';
12
+ import './chunk-RTSPX46P.js';
13
+ import './chunk-ECAH5RC3.js';
14
+ import './chunk-JF3XWEEL.js';
15
+ import './chunk-KOBELCOG.js';
16
+ import './chunk-I3HZNWUF.js';
17
+ import './chunk-JV43EWXA.js';
18
+ import './chunk-QPOHDTWR.js';
@@ -1 +1,10 @@
1
- export{a as default}from'./chunk-WWUSGIQB.js';import'./chunk-ME7FB46X.js';import'./chunk-MADECDXT.js';import'./chunk-RTSPX46P.js';import'./chunk-ECAH5RC3.js';import'./chunk-JF3XWEEL.js';import'./chunk-KOBELCOG.js';import'./chunk-I3HZNWUF.js';import'./chunk-JV43EWXA.js';import'./chunk-QPOHDTWR.js';
1
+ export { a as default } from './chunk-WWUSGIQB.js';
2
+ import './chunk-ME7FB46X.js';
3
+ import './chunk-MADECDXT.js';
4
+ import './chunk-RTSPX46P.js';
5
+ import './chunk-ECAH5RC3.js';
6
+ import './chunk-JF3XWEEL.js';
7
+ import './chunk-KOBELCOG.js';
8
+ import './chunk-I3HZNWUF.js';
9
+ import './chunk-JV43EWXA.js';
10
+ import './chunk-QPOHDTWR.js';
@@ -1,2 +1,15 @@
1
- import {a as a$3}from'./chunk-Y7N65KJX.js';import {a as a$2}from'./chunk-EZWBOX2K.js';import {a as a$1}from'./chunk-UNLLKACC.js';import {a,b}from'./chunk-ECAH5RC3.js';import {p,i,j as j$1,e as e$1,f}from'./chunk-JF3XWEEL.js';import {d,c,e,o,O,ra,pa,qa,P,B,V,U,ta,N}from'./chunk-QPOHDTWR.js';import {Box,TextInput,Select,Drawer,DuoCon,Heading,Body,Button,CloudImage,ButtCon,Accordion,ShimmerBox,PriceDisplay,MenuItem}from'@biom3/react';import {useState,useMemo,useCallback,useEffect}from'react';import {Environment}from'@imtbl/config';import {WidgetTheme}from'@imtbl/checkout-sdk';import {useTranslation}from'react-i18next';d();c();var Xe=async({checkout:r,provider:o$1,allowTokenListType:d,chainId:i$1,allowZero:n=!1,retryPolicy:m=o})=>{let c=i$1||Number((await r.getNetworkInfo({provider:o$1})).chainId),L=await(await o$1.getSigner()).getAddress(),p$1=await a(()=>r.getAllBalances({provider:o$1,walletAddress:L,chainId:c}),{...m});if(p$1===void 0)return;let u=await r.getTokenAllowList({chainId:c,type:d}),g=new Map;u.tokens.forEach(t=>g.set(t.address?.toLowerCase()||e,!0));let h=p$1.balances.filter(t=>t.balance<=0&&!n?!1:g.get(t.token.address?.toLowerCase()||e)).map(t=>({...t,token:{...t.token,icon:t.token.icon??p(r.config.environment,i(t.token.address)?t.token.symbol:t.token.address??"")}}))??[];return u.tokens=u.tokens.map(t=>({...t,icon:t.icon??p(r.config.environment,i(t.address)?t.symbol:t.address??"")})),{allowList:u,allowedBalances:h}};d();c();function t2(){return O(Box,{testId:"wallet-approve-hero",sx:{...ra,background:"base.color.translucent.emphasis.100"},children:O(Box,{sx:{...pa,...qa},children:P("svg",{width:"430",height:"305",viewBox:"0 0 430 305",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[O("path",{d:"M227.517 171.325L182.178 85.6034C181.033 83.4446 179.583 82.3652 178.156 82.3652C175.711 82.3652 174.322 84.1157 172.863 86.6218L137.285 164.056L183.689 253.776L227.522 171.32L227.517 171.325Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M226.841 137.597C228.497 133.997 228.338 128.188 226.484 124.682L197.866 70.5767C196.012 67.0757 193.14 67.1508 191.484 70.7503L164.936 128.427L168.399 134.936L165.396 141.464L168.85 147.992L171.853 141.464L175.307 147.992L172.304 154.52L168.85 147.992L165.846 154.52L169.3 161.048L166.287 167.562L187.922 208.465C189.776 211.966 192.648 211.891 194.304 208.292L226.845 137.597H226.841Z",fill:"#F191FA"}),O("path",{d:"M168.85 147.992L165.396 141.464L168.399 134.936L164.936 128.427L191.484 70.7503C193.14 67.1508 196.012 67.0757 197.866 70.5767L226.484 124.682C228.338 128.188 228.497 133.997 226.841 137.597H226.845L194.304 208.292C192.648 211.891 189.776 211.966 187.922 208.465L166.287 167.562L169.3 161.048L165.846 154.52L168.85 147.992ZM168.85 147.992L171.853 141.464L175.307 147.992L172.304 154.52L168.85 147.992Z",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M159.384 154.519L155.93 147.991L158.939 141.463L162.388 147.991L159.384 154.519Z",fill:"#F191FA"}),O("path",{d:"M203.136 132.773C202.484 134.19 201.353 134.223 200.621 132.843L196.101 124.297C195.369 122.917 195.308 120.627 195.961 119.21L200.621 109.082C201.273 107.665 202.404 107.632 203.136 109.012L207.656 117.558C208.388 118.938 208.449 121.228 207.796 122.645L203.136 132.773Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M206.22 114.837L204.68 118.183C204.174 119.286 203.291 119.309 202.724 118.234L199.345 111.852",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M197.542 127.015L199.058 123.716C199.565 122.613 200.447 122.589 201.015 123.664L204.394 130.046",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M293.369 250.453L252.263 172.733C249.936 168.331 243.957 164.731 238.982 164.731H173.769C171.516 164.731 169.306 164.14 167.358 163.014L162.876 160.423C160.929 159.297 158.718 158.706 156.466 158.706H147.896L141.237 164.534L189.659 256C190.612 257.493 192.452 258.417 194.939 258.417L287.456 258.445L291.473 260.904L293.904 255.733H293.895C294.556 254.315 294.449 252.471 293.379 250.448L293.369 250.453Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M232.923 169.903L235.354 164.731",stroke:"black",strokeWidth:"0.469297",strokeMiterlimit:"10"}),O("path",{d:"M249.832 177.908C247.505 173.506 241.526 169.907 236.551 169.907L142.025 169.878C139.355 169.878 137.436 168.813 136.549 167.128L186.313 261.185C187.266 262.677 189.105 263.602 191.592 263.602L286.118 263.63C291.098 263.63 293.266 260.03 290.938 255.633L249.832 177.913V177.908Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M255.328 198.77L245.041 179.313C243.581 176.548 240.235 174.042 237.161 174.042L143.555 173.93",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M188.64 259.548L282.448 259.558C285.569 259.558 286.418 257.577 285.198 255.264L276.103 238.064",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M150.238 159.776C150.965 161.151 149.539 163.338 147.051 164.652C144.564 165.966 141.96 165.919 141.227 164.539C140.495 163.159 141.927 160.977 144.414 159.663C145.62 159.025 146.854 158.71 147.891 158.71C148.99 158.71 149.863 159.067 150.238 159.776Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M147.826 161.052C148.164 161.69 147.502 162.704 146.348 163.314C145.193 163.924 143.983 163.9 143.645 163.262C143.307 162.624 143.969 161.61 145.123 161C145.681 160.705 146.254 160.559 146.737 160.559C147.249 160.559 147.652 160.723 147.826 161.057V161.052Z",fill:"black"}),O("path",{d:"M171.652 85.828L136.755 161.652C135.788 163.75 135.784 165.669 136.549 167.124C136.549 167.124 137.717 169.874 142.025 169.874C146.333 169.874 151.754 169.907 151.754 169.907L153.115 167.5L143.419 167.467C139.669 167.467 137.637 165.186 139.205 161.779L174.163 85.8233C175.223 83.5238 176.678 82.3646 178.156 82.3646C178.156 82.3646 173.431 81.961 171.652 85.8233V85.828Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M273.579 230.377L277.263 229.767L287.024 238.458L278.347 222.051L270.373 223.609L273.579 230.377Z",fill:"black"}),O("path",{d:"M274.968 235.918C272.495 231.239 272.777 228.33 278.296 226.565C281.262 225.617 283.951 224.073 286.255 221.98L291.328 217.371C295.725 213.378 297.049 205.813 294.275 200.561C291.497 195.31 285.626 194.282 281.233 198.276L275.071 203.874C272.983 205.775 270.327 206.939 267.516 207.206C261.79 207.746 259.392 206.456 256.769 201.495L255.399 206.127L271.073 235.923H274.973L274.968 235.918Z",fill:"#EBE9E9"}),O("path",{d:"M274.968 235.918C272.495 231.239 272.776 228.33 278.295 226.565C281.261 225.617 283.95 224.073 286.255 221.98L291.328 217.371C295.725 213.378 297.048 205.813 294.275 200.561C291.497 195.31 285.626 194.282 281.233 198.276L275.071 203.874C272.983 205.775 270.327 206.939 267.516 207.206C261.79 207.746 259.392 206.456 256.769 201.495",stroke:"black",strokeWidth:"0.469297",strokeMiterlimit:"10"}),O("path",{d:"M289.926 200.125C287.265 199.276 284.074 201.829 282.793 205.832C281.512 209.835 282.629 213.768 285.29 214.617L286.533 215.016L291.17 200.524L289.926 200.125Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M293.683 209.321C294.963 205.319 293.846 201.386 291.187 200.535C288.528 199.685 285.335 202.239 284.055 206.241C282.775 210.242 283.892 214.176 286.551 215.026C289.21 215.877 292.403 213.322 293.683 209.321Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M213.26 224.182C211.237 224.182 208.816 222.722 207.868 220.934L189.021 185.301C188.077 183.513 188.955 182.053 190.978 182.053L231.3 182.039C233.322 182.039 235.744 183.499 236.692 185.287L255.539 220.92C256.482 222.708 255.604 224.168 253.582 224.168L213.26 224.182Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M214.334 222.319C212.312 222.319 209.89 220.859 208.942 219.071L190.095 183.438C189.884 183.034 189.767 182.649 189.729 182.292C188.64 182.776 188.302 183.944 189.02 185.301L207.867 220.934C208.811 222.722 211.237 224.182 213.26 224.182L253.582 224.168C255.144 224.168 256.022 223.29 255.9 222.065C255.557 222.22 255.14 222.305 254.652 222.305L214.33 222.319H214.334Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M231.586 203.083L233.646 206.978H228.756H223.871H218.981H215.513C214.733 206.978 214.363 207.489 214.691 208.109L215.555 209.737C215.883 210.361 216.794 210.873 217.577 210.873H221.046H225.936L227.395 213.632C227.724 214.256 228.634 214.763 229.418 214.763H231.464C232.243 214.763 232.614 214.252 232.285 213.628L230.826 210.868H235.716H239.184C239.963 210.868 240.334 210.352 240.005 209.732L238.546 206.973L237.086 204.214C236.758 203.589 235.847 203.083 235.063 203.083H231.595H231.586Z",fill:"#F191FA"}),O("path",{d:"M214.855 199.191L216.315 201.951C216.648 202.575 217.554 203.086 218.342 203.086H221.81H226.696H231.586L230.126 200.322C229.793 199.698 228.887 199.187 228.099 199.187H224.631H219.746H214.855V199.191Z",fill:"#F191FA"}),O("path",{d:"M214.986 187.501C214.207 187.501 213.837 188.013 214.165 188.632L215.625 191.392H210.735H207.266C206.487 191.392 206.117 191.903 206.445 192.527L207.905 195.287L209.364 198.046C209.693 198.671 210.603 199.177 211.387 199.177H214.855L212.795 195.282H217.685H222.57H227.46H230.928C231.707 195.282 232.078 194.771 231.75 194.147L230.891 192.523C230.558 191.899 229.652 191.387 228.868 191.387H225.4H220.51L219.051 188.628C218.722 188.003 217.812 187.497 217.028 187.497H214.982L214.986 187.501Z",fill:"#F191FA"}),O("path",{d:"M214.098 243.795L212.428 240.641C211.78 239.412 210.109 238.412 208.725 238.412H202.849L200.428 233.832C199.78 232.602 198.114 231.603 196.725 231.603H191.751C191 231.603 190.483 231.898 190.263 232.363L189.066 234.906L191.464 235.826L192.835 238.417H186.959C186.208 238.417 185.692 238.712 185.471 239.177L184.275 241.721L186.612 242.528L187.288 243.804C187.935 245.034 189.606 246.033 190.99 246.033H196.866L199.287 250.614C199.935 251.843 201.601 252.843 202.99 252.843H205.032L208.256 254.631L209.452 252.087C209.635 251.693 209.607 251.177 209.307 250.614L206.885 246.033H210.194L213.057 247.817L214.253 245.273C214.441 244.879 214.408 244.363 214.108 243.8L214.098 243.795Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M212.902 246.339L211.231 243.185C210.584 241.956 208.913 240.956 207.529 240.956H201.653L199.231 236.376C198.584 235.151 196.918 234.146 195.529 234.146H190.554C189.165 234.146 188.564 235.151 189.212 236.38L191.634 240.961H185.758C184.369 240.961 183.763 241.97 184.416 243.195L186.086 246.348C186.734 247.578 188.405 248.577 189.789 248.577H195.665L198.086 253.158C198.734 254.387 200.4 255.387 201.789 255.387H206.764C208.153 255.387 208.753 254.383 208.106 253.153L205.684 248.573H211.56C212.949 248.573 213.554 247.564 212.902 246.339Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M208.107 253.158L205.685 248.573",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M191.634 240.96H185.758",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M212.902 246.339L211.231 243.185C210.584 241.956 208.913 240.956 207.528 240.956H201.653L199.231 236.376C198.584 235.151 196.918 234.146 195.528 234.146H190.554",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M356.061 232.632L355.632 231L354 231.429L354.429 233.061L356.061 232.632Z",fill:"white"}),O("path",{d:"M57.6531 168.341L57.1006 166.24L54.9996 166.793L55.5521 168.894L57.6531 168.341Z",fill:"white"}),O("path",{d:"M103.489 244.345L101.345 244L101 246.145L103.144 246.49L103.489 244.345Z",fill:"white"}),O("path",{d:"M341.286 111.905L341.905 110.619L340.619 110L340 111.286L341.286 111.905Z",fill:"white"}),O("path",{d:"M323.144 179.08L322.592 176.979L320.491 177.531L321.043 179.632L323.144 179.08Z",fill:"white"}),O("path",{d:"M328.919 177.658L329.538 176.372L328.252 175.753L327.633 177.039L328.919 177.658Z",fill:"white"}),O("path",{d:"M88.1441 141.383L87.2188 140.296L86.1321 141.221L87.0574 142.308L88.1441 141.383Z",fill:"white"}),O("path",{d:"M258.286 89.9052L258.905 88.6191L257.619 88L257 89.2861L258.286 89.9052Z",fill:"white"})]})})})}d();c();function l2({testId:r,value:o,placeholder:d,errorMessage:i,validator:n,onTextInputChange:m,onTextInputBlur:c,onTextInputFocus:L,onTextInputEnter:p,textAlign:u,type:g,subtext:h,maxButtonClick:t,disabled:k,inputMode:x}){let v=(y,I)=>{let T=y.target.value;if(g==="number"&&T==="."&&(T="0."),!n(T)){m(I??"");return}m(T);},B=y=>{if(!c)return;let I=y.target.value;n(I)&&c(I);},f=y=>{if(!L)return;let I=y.target.value;n(I)&&L(I);},b=y=>{p&&y.key==="Enter"&&p();};return O(a$1,{testId:`${r}-text-control`,textAlign:u??"left",subtext:i?void 0:h,isErrored:!!i,errorMessage:i,sx:{width:"100%"},children:O(TextInput,{testId:`${r}-text`,onChange:y=>v(y,o),sizeVariant:"large",value:o,inputMode:x,validationStatus:i?"error":"success",placeholder:d,onBlur:B,onFocus:f,onKeyDown:b,disabled:k,hideClearValueButton:!0,sx:{minWidth:"100%"},children:t&&O(TextInput.Button,{testId:`${r}-max-button`,onClick:t,disabled:k,children:"max"})})})}d();c();d();c();d();c();function re({onClick:r,icon:o,name:d,symbol:i,balance:n,defaultTokenImage:m,testId:c,id:L}){let{t:p}=useTranslation();return P(MenuItem,{testId:`${c}-coin-selector__option-${L}`,emphasized:!0,size:"small",onClick:r,children:[O(MenuItem.FramedImage,{circularFrame:!0,use:O(b,{src:o,name:d,defaultImage:m})}),O(MenuItem.Label,{children:d}),O(MenuItem.Caption,{children:i}),n&&O(MenuItem.PriceDisplay,{fiatAmount:`${p("drawers.coinSelector.option.fiatPricePrefix")}${n.formattedFiatAmount}`,price:n.formattedAmount})]})}d();c();var ie={display:"flex",flexDirection:"column",gap:"2px",paddingX:"base.spacing.x4",paddingBottom:"base.spacing.x4"},ae={display:"flex",flexDirection:"column",rowGap:"base.spacing.x2"};function le({heading:r,options:o,defaultTokenImage:d,optionsLoading:i,children:n,onCloseDrawer:m,visible:c}){let{t:L}=useTranslation();return P(Drawer,{headerBarTitle:r,size:"full",onCloseDrawer:m,visible:c,children:[O(Drawer.Target,{children:n}),O(Drawer.Content,{children:P(Box,{sx:ie,children:[i&&o.length===0&&P(Box,{sx:ae,children:[O(MenuItem,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--1"}),O(MenuItem,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--2"}),O(MenuItem,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--3"})]}),!i&&o.length===0&&O(Body,{sx:{padding:"base.spacing.x4"},children:L("drawers.coinSelector.noCoins")}),!i&&o.map(({onClick:p,icon:u,name:g,symbol:h,balance:t,id:k,testId:x})=>O(re,{id:k,testId:x,onClick:p,icon:u,name:g,symbol:h,balance:t,defaultTokenImage:d},`${h}-${g}`))]})})]})}function z2({testId:r,options:o,optionsLoading:d,subtext:i,onSelectChange:n,textAlign:m,errorMessage:c,disabled:L,selectedOption:p,coinSelectorHeading:u,defaultTokenImage:g,environment:h=Environment.PRODUCTION,theme:t=WidgetTheme.DARK}){let[k,x]=useState(!1),v=useMemo(()=>o.map(b=>({...b,testId:r,onClick:()=>{n(b.id),x(!1);}})),[o,n,x]),B=()=>{if(p&&o.length!==0&&o.find(b=>b.id===p))return p},f=o?.find(b=>b.id===p)??p;return P(Box,{children:[O(le,{heading:u,options:v,defaultTokenImage:g,optionsLoading:d??!1,visible:k,onCloseDrawer:()=>x(!1)}),O(a$1,{testId:`${r}-select-control`,textAlign:m??"left",subtext:c?void 0:i,isErrored:!!c,errorMessage:c,children:O(Select,{testId:`${r}-select`,size:"large",defaultLabel:"Select token",targetClickOveride:()=>x(!0),selectedOption:B(),sx:{minw:"170px"},children:f&&P(Select.Option,{optionKey:f.id,testId:f.testId,disabled:L,children:[!f.icon&&O(Select.Option.Icon,{icon:"Coins",variant:"bold"}),f.icon&&O(Select.Option.FramedImage,{use:O(b,{environment:h,theme:t,src:f.icon,name:f.name}),circularFrame:!0,sx:{background:"base.color.translucent.standard.100"}}),O(Select.Option.Label,{children:f.symbol})]},f.id)})})]})}d();c();d();c();var de={display:"flex",flexDirection:"column",alignItems:"center",paddingY:"50px",paddingX:"base.spacing.x4",height:"100%"},j={color:"base.color.text.body.secondary",fontFamily:"base.font.family.heading.secondary",textAlign:"center",marginTop:"15px"},ce={display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:"8px",height:"100%",width:"100%"},z={width:"100%",height:"64px"};function Y2({onCloseDrawer:r,visible:o,showHeaderBar:d,onRetry:i}){let{t:n}=useTranslation();return O(Drawer,{headerBarTitle:void 0,size:"full",onCloseDrawer:r,visible:o,showHeaderBar:d,children:O(Drawer.Content,{children:P(Box,{sx:de,children:[O(DuoCon,{icon:"Information",colorVariant:"guidance",iconVariant:"bold"}),P(Heading,{size:"small",sx:j,testId:"transaction-rejected-heading",children:[n("drawers.transactionFailed.content.heading1"),O("br",{}),n("drawers.transactionFailed.content.heading2")]}),P(Body,{sx:j,children:[n("drawers.transactionFailed.content.body1"),O("br",{}),n("drawers.transactionFailed.content.body2")]}),P(Box,{sx:ce,children:[O(Button,{sx:z,variant:"tertiary",onClick:i,children:n("drawers.transactionFailed.buttons.retry")}),O(Button,{sx:z,variant:"tertiary",onClick:r,testId:"transaction-rejected-cancel-button",children:n("drawers.transactionFailed.buttons.cancel")})]})]})})})}d();c();function m1({visible:r,targetChainId:o,provider:d,checkout:i,onCloseDrawer:n,onNetworkSwitch:m}){let{t:c}=useTranslation(),L=j$1(i.config.environment??Environment.PRODUCTION,"/switchnetworkethereum.svg"),p=j$1(i.config.environment??Environment.PRODUCTION,"/switchnetworkzkevm.svg"),u=a$2(o),g=o===B(i.config),h=useCallback(async()=>{if(!i)return;let f=await i.switchNetwork({provider:d,chainId:o});m&&m(f.provider);},[i,d,m,o]),t=V(d),k=useMemo(()=>t?d.provider?.session?.peer?.metadata?.name:"",[d,t]),x=useMemo(()=>k?.toLowerCase().includes("metamask"),[k]),v=useMemo(()=>U(d)?"MetaMask wallet":t&&k?k:"wallet",[d,t,k]),B$1=t&&x;return useEffect(()=>{let f=new Image;f.src=L;let b=new Image;b.src=p;},[]),O(Drawer,{size:"threeQuarter",visible:r,onCloseDrawer:n,showHeaderBar:!1,children:P(Drawer.Content,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center"},children:[O(CloudImage,{use:O("img",{src:g?L:p,alt:c("drawers.networkSwitch.heading",{wallet:v})})}),O(ButtCon,{icon:"Close",variant:"tertiary",sx:{pos:"absolute",top:"base.spacing.x5",left:"base.spacing.x5",backdropFilter:"blur(30px)"},onClick:n}),P(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"base.spacing.x4",paddingX:"base.spacing.x6"},children:[O(Heading,{size:"small",weight:"bold",sx:{textAlign:"center",paddingX:"base.spacing.x6"},children:c("drawers.networkSwitch.heading",{wallet:v})}),B$1&&O(Body,{size:"medium",weight:"regular",sx:{color:"base.color.text.body.secondary",textAlign:"center",paddingX:"base.spacing.x6"},children:c("drawers.networkSwitch.manualSwitch.body",{chain:u})}),!B$1&&O(Body,{size:"medium",weight:"regular",sx:{color:"base.color.text.body.secondary",textAlign:"center",paddingX:"base.spacing.x6"},children:c("drawers.networkSwitch.controlledSwitch.body",{chain:u})})]}),P(Box,{sx:{display:"flex",flexDirection:"column",paddingX:"base.spacing.x4",width:"100%"},children:[!B$1&&O(Button,{size:"large",variant:"primary",sx:{width:"100%",marginBottom:"base.spacing.x2"},onClick:h,children:c("drawers.networkSwitch.switchButton",{chain:u})}),O(ta,{})]})]})})}d();c();d();c();var ke={backgroundColor:"base.color.translucent.emphasis.100"},Ce={marginBottom:"base.spacing.x4",color:"base.color.text.body.secondary"};function S1({gasFeeValue:r,gasFeeToken:o,gasFeeFiatValue:d,fees:i,onFeesClick:n,loading:m,sx:c}){let[L,p]=useState(!1),{t:u}=useTranslation();if(!r&&!m)return null;let g=e$1(f(r)),h=o?.symbol;return P(N,{children:[P(Accordion,{targetClickOveride:()=>{p(!0),n?.();},sx:{...ke,paddingBottom:"base.spacing.x2",...c},children:[O(Accordion.TargetLeftSlot,{children:O(Body,{size:"medium",sx:Ce,children:u("drawers.feesBreakdown.heading")})}),P(Accordion.TargetRightSlot,{children:[m&&O(Box,{sx:{width:"218px",position:"relative"},children:O(Box,{sx:{display:"block",position:"absolute",top:"-15px",width:"100%",height:"68px",WebkitMaskPosition:"right center",WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain",WebkitMaskImage:`url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" width="196" height="96"><path d="M182.85 55.2Q181.65 54 180 54h-56q-1.7 0-2.85 1.2Q120 56.35 120 58v4q0 1.7 1.15 2.85Q122.3 66 124 66h56q1.65 0 2.85-1.15Q184 63.7 184 62v-4q0-1.65-1.15-2.8m0-22Q181.65 32 180 32H68q-1.7 0-2.85 1.2Q64 34.35 64 36v8q0 1.7 1.15 2.85Q66.3 48 68 48h112q1.65 0 2.85-1.15Q184 45.7 184 44v-8q0-1.65-1.15-2.8Z" id="a"/></svg>')`},rc:O("span",{}),children:O(ShimmerBox,{rc:O("span",{})})})}),!m&&O(PriceDisplay,{testId:"fees-gas-fee__priceDisplay",fiatAmount:`\u2248 ${u("drawers.feesBreakdown.fees.fiatPricePrefix")}${d}`,price:`~ ${h} ${e$1(f(g))}`})]})]}),O(a$3,{tokenSymbol:h??"",fees:i,visible:L,loading:m,onCloseDrawer:()=>p(!1)})]})}
2
- export{l2 as a,z2 as b,Y2 as c,Xe as d,m1 as e,S1 as f,t2 as g};
1
+ import { a as a$3 } from './chunk-Y7N65KJX.js';
2
+ import { a as a$2 } from './chunk-EZWBOX2K.js';
3
+ import { a as a$1 } from './chunk-UNLLKACC.js';
4
+ import { a, b } from './chunk-ECAH5RC3.js';
5
+ import { p, i, j as j$1, e as e$1, f } from './chunk-JF3XWEEL.js';
6
+ import { d, c, e, o, O, ra, pa, qa, P, B, V, U, ta, N } from './chunk-QPOHDTWR.js';
7
+ import { Box, TextInput, Select, Drawer, DuoCon, Heading, Body, Button, CloudImage, ButtCon, Accordion, ShimmerBox, PriceDisplay, MenuItem } from '@biom3/react';
8
+ import { useState, useMemo, useCallback, useEffect } from 'react';
9
+ import { Environment } from '@imtbl/config';
10
+ import { WidgetTheme } from '@imtbl/checkout-sdk';
11
+ import { useTranslation } from 'react-i18next';
12
+
13
+ d();c();var Xe=async({checkout:r,provider:o$1,allowTokenListType:d,chainId:i$1,allowZero:n=!1,retryPolicy:m=o})=>{let c=i$1||Number((await r.getNetworkInfo({provider:o$1})).chainId),L=await(await o$1.getSigner()).getAddress(),p$1=await a(()=>r.getAllBalances({provider:o$1,walletAddress:L,chainId:c}),{...m});if(p$1===void 0)return;let u=await r.getTokenAllowList({chainId:c,type:d}),g=new Map;u.tokens.forEach(t=>g.set(t.address?.toLowerCase()||e,!0));let h=p$1.balances.filter(t=>t.balance<=0&&!n?!1:g.get(t.token.address?.toLowerCase()||e)).map(t=>({...t,token:{...t.token,icon:t.token.icon??p(r.config.environment,i(t.token.address)?t.token.symbol:t.token.address??"")}}))??[];return u.tokens=u.tokens.map(t=>({...t,icon:t.icon??p(r.config.environment,i(t.address)?t.symbol:t.address??"")})),{allowList:u,allowedBalances:h}};d();c();function t2(){return O(Box,{testId:"wallet-approve-hero",sx:{...ra,background:"base.color.translucent.emphasis.100"},children:O(Box,{sx:{...pa,...qa},children:P("svg",{width:"430",height:"305",viewBox:"0 0 430 305",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[O("path",{d:"M227.517 171.325L182.178 85.6034C181.033 83.4446 179.583 82.3652 178.156 82.3652C175.711 82.3652 174.322 84.1157 172.863 86.6218L137.285 164.056L183.689 253.776L227.522 171.32L227.517 171.325Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M226.841 137.597C228.497 133.997 228.338 128.188 226.484 124.682L197.866 70.5767C196.012 67.0757 193.14 67.1508 191.484 70.7503L164.936 128.427L168.399 134.936L165.396 141.464L168.85 147.992L171.853 141.464L175.307 147.992L172.304 154.52L168.85 147.992L165.846 154.52L169.3 161.048L166.287 167.562L187.922 208.465C189.776 211.966 192.648 211.891 194.304 208.292L226.845 137.597H226.841Z",fill:"#F191FA"}),O("path",{d:"M168.85 147.992L165.396 141.464L168.399 134.936L164.936 128.427L191.484 70.7503C193.14 67.1508 196.012 67.0757 197.866 70.5767L226.484 124.682C228.338 128.188 228.497 133.997 226.841 137.597H226.845L194.304 208.292C192.648 211.891 189.776 211.966 187.922 208.465L166.287 167.562L169.3 161.048L165.846 154.52L168.85 147.992ZM168.85 147.992L171.853 141.464L175.307 147.992L172.304 154.52L168.85 147.992Z",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M159.384 154.519L155.93 147.991L158.939 141.463L162.388 147.991L159.384 154.519Z",fill:"#F191FA"}),O("path",{d:"M203.136 132.773C202.484 134.19 201.353 134.223 200.621 132.843L196.101 124.297C195.369 122.917 195.308 120.627 195.961 119.21L200.621 109.082C201.273 107.665 202.404 107.632 203.136 109.012L207.656 117.558C208.388 118.938 208.449 121.228 207.796 122.645L203.136 132.773Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M206.22 114.837L204.68 118.183C204.174 119.286 203.291 119.309 202.724 118.234L199.345 111.852",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M197.542 127.015L199.058 123.716C199.565 122.613 200.447 122.589 201.015 123.664L204.394 130.046",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M293.369 250.453L252.263 172.733C249.936 168.331 243.957 164.731 238.982 164.731H173.769C171.516 164.731 169.306 164.14 167.358 163.014L162.876 160.423C160.929 159.297 158.718 158.706 156.466 158.706H147.896L141.237 164.534L189.659 256C190.612 257.493 192.452 258.417 194.939 258.417L287.456 258.445L291.473 260.904L293.904 255.733H293.895C294.556 254.315 294.449 252.471 293.379 250.448L293.369 250.453Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M232.923 169.903L235.354 164.731",stroke:"black",strokeWidth:"0.469297",strokeMiterlimit:"10"}),O("path",{d:"M249.832 177.908C247.505 173.506 241.526 169.907 236.551 169.907L142.025 169.878C139.355 169.878 137.436 168.813 136.549 167.128L186.313 261.185C187.266 262.677 189.105 263.602 191.592 263.602L286.118 263.63C291.098 263.63 293.266 260.03 290.938 255.633L249.832 177.913V177.908Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M255.328 198.77L245.041 179.313C243.581 176.548 240.235 174.042 237.161 174.042L143.555 173.93",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M188.64 259.548L282.448 259.558C285.569 259.558 286.418 257.577 285.198 255.264L276.103 238.064",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M150.238 159.776C150.965 161.151 149.539 163.338 147.051 164.652C144.564 165.966 141.96 165.919 141.227 164.539C140.495 163.159 141.927 160.977 144.414 159.663C145.62 159.025 146.854 158.71 147.891 158.71C148.99 158.71 149.863 159.067 150.238 159.776Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M147.826 161.052C148.164 161.69 147.502 162.704 146.348 163.314C145.193 163.924 143.983 163.9 143.645 163.262C143.307 162.624 143.969 161.61 145.123 161C145.681 160.705 146.254 160.559 146.737 160.559C147.249 160.559 147.652 160.723 147.826 161.057V161.052Z",fill:"black"}),O("path",{d:"M171.652 85.828L136.755 161.652C135.788 163.75 135.784 165.669 136.549 167.124C136.549 167.124 137.717 169.874 142.025 169.874C146.333 169.874 151.754 169.907 151.754 169.907L153.115 167.5L143.419 167.467C139.669 167.467 137.637 165.186 139.205 161.779L174.163 85.8233C175.223 83.5238 176.678 82.3646 178.156 82.3646C178.156 82.3646 173.431 81.961 171.652 85.8233V85.828Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M273.579 230.377L277.263 229.767L287.024 238.458L278.347 222.051L270.373 223.609L273.579 230.377Z",fill:"black"}),O("path",{d:"M274.968 235.918C272.495 231.239 272.777 228.33 278.296 226.565C281.262 225.617 283.951 224.073 286.255 221.98L291.328 217.371C295.725 213.378 297.049 205.813 294.275 200.561C291.497 195.31 285.626 194.282 281.233 198.276L275.071 203.874C272.983 205.775 270.327 206.939 267.516 207.206C261.79 207.746 259.392 206.456 256.769 201.495L255.399 206.127L271.073 235.923H274.973L274.968 235.918Z",fill:"#EBE9E9"}),O("path",{d:"M274.968 235.918C272.495 231.239 272.776 228.33 278.295 226.565C281.261 225.617 283.95 224.073 286.255 221.98L291.328 217.371C295.725 213.378 297.048 205.813 294.275 200.561C291.497 195.31 285.626 194.282 281.233 198.276L275.071 203.874C272.983 205.775 270.327 206.939 267.516 207.206C261.79 207.746 259.392 206.456 256.769 201.495",stroke:"black",strokeWidth:"0.469297",strokeMiterlimit:"10"}),O("path",{d:"M289.926 200.125C287.265 199.276 284.074 201.829 282.793 205.832C281.512 209.835 282.629 213.768 285.29 214.617L286.533 215.016L291.17 200.524L289.926 200.125Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M293.683 209.321C294.963 205.319 293.846 201.386 291.187 200.535C288.528 199.685 285.335 202.239 284.055 206.241C282.775 210.242 283.892 214.176 286.551 215.026C289.21 215.877 292.403 213.322 293.683 209.321Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M213.26 224.182C211.237 224.182 208.816 222.722 207.868 220.934L189.021 185.301C188.077 183.513 188.955 182.053 190.978 182.053L231.3 182.039C233.322 182.039 235.744 183.499 236.692 185.287L255.539 220.92C256.482 222.708 255.604 224.168 253.582 224.168L213.26 224.182Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M214.334 222.319C212.312 222.319 209.89 220.859 208.942 219.071L190.095 183.438C189.884 183.034 189.767 182.649 189.729 182.292C188.64 182.776 188.302 183.944 189.02 185.301L207.867 220.934C208.811 222.722 211.237 224.182 213.26 224.182L253.582 224.168C255.144 224.168 256.022 223.29 255.9 222.065C255.557 222.22 255.14 222.305 254.652 222.305L214.33 222.319H214.334Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M231.586 203.083L233.646 206.978H228.756H223.871H218.981H215.513C214.733 206.978 214.363 207.489 214.691 208.109L215.555 209.737C215.883 210.361 216.794 210.873 217.577 210.873H221.046H225.936L227.395 213.632C227.724 214.256 228.634 214.763 229.418 214.763H231.464C232.243 214.763 232.614 214.252 232.285 213.628L230.826 210.868H235.716H239.184C239.963 210.868 240.334 210.352 240.005 209.732L238.546 206.973L237.086 204.214C236.758 203.589 235.847 203.083 235.063 203.083H231.595H231.586Z",fill:"#F191FA"}),O("path",{d:"M214.855 199.191L216.315 201.951C216.648 202.575 217.554 203.086 218.342 203.086H221.81H226.696H231.586L230.126 200.322C229.793 199.698 228.887 199.187 228.099 199.187H224.631H219.746H214.855V199.191Z",fill:"#F191FA"}),O("path",{d:"M214.986 187.501C214.207 187.501 213.837 188.013 214.165 188.632L215.625 191.392H210.735H207.266C206.487 191.392 206.117 191.903 206.445 192.527L207.905 195.287L209.364 198.046C209.693 198.671 210.603 199.177 211.387 199.177H214.855L212.795 195.282H217.685H222.57H227.46H230.928C231.707 195.282 232.078 194.771 231.75 194.147L230.891 192.523C230.558 191.899 229.652 191.387 228.868 191.387H225.4H220.51L219.051 188.628C218.722 188.003 217.812 187.497 217.028 187.497H214.982L214.986 187.501Z",fill:"#F191FA"}),O("path",{d:"M214.098 243.795L212.428 240.641C211.78 239.412 210.109 238.412 208.725 238.412H202.849L200.428 233.832C199.78 232.602 198.114 231.603 196.725 231.603H191.751C191 231.603 190.483 231.898 190.263 232.363L189.066 234.906L191.464 235.826L192.835 238.417H186.959C186.208 238.417 185.692 238.712 185.471 239.177L184.275 241.721L186.612 242.528L187.288 243.804C187.935 245.034 189.606 246.033 190.99 246.033H196.866L199.287 250.614C199.935 251.843 201.601 252.843 202.99 252.843H205.032L208.256 254.631L209.452 252.087C209.635 251.693 209.607 251.177 209.307 250.614L206.885 246.033H210.194L213.057 247.817L214.253 245.273C214.441 244.879 214.408 244.363 214.108 243.8L214.098 243.795Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M212.902 246.339L211.231 243.185C210.584 241.956 208.913 240.956 207.529 240.956H201.653L199.231 236.376C198.584 235.151 196.918 234.146 195.529 234.146H190.554C189.165 234.146 188.564 235.151 189.212 236.38L191.634 240.961H185.758C184.369 240.961 183.763 241.97 184.416 243.195L186.086 246.348C186.734 247.578 188.405 248.577 189.789 248.577H195.665L198.086 253.158C198.734 254.387 200.4 255.387 201.789 255.387H206.764C208.153 255.387 208.753 254.383 208.106 253.153L205.684 248.573H211.56C212.949 248.573 213.554 247.564 212.902 246.339Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M208.107 253.158L205.685 248.573",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M191.634 240.96H185.758",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M212.902 246.339L211.231 243.185C210.584 241.956 208.913 240.956 207.528 240.956H201.653L199.231 236.376C198.584 235.151 196.918 234.146 195.528 234.146H190.554",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),O("path",{d:"M356.061 232.632L355.632 231L354 231.429L354.429 233.061L356.061 232.632Z",fill:"white"}),O("path",{d:"M57.6531 168.341L57.1006 166.24L54.9996 166.793L55.5521 168.894L57.6531 168.341Z",fill:"white"}),O("path",{d:"M103.489 244.345L101.345 244L101 246.145L103.144 246.49L103.489 244.345Z",fill:"white"}),O("path",{d:"M341.286 111.905L341.905 110.619L340.619 110L340 111.286L341.286 111.905Z",fill:"white"}),O("path",{d:"M323.144 179.08L322.592 176.979L320.491 177.531L321.043 179.632L323.144 179.08Z",fill:"white"}),O("path",{d:"M328.919 177.658L329.538 176.372L328.252 175.753L327.633 177.039L328.919 177.658Z",fill:"white"}),O("path",{d:"M88.1441 141.383L87.2188 140.296L86.1321 141.221L87.0574 142.308L88.1441 141.383Z",fill:"white"}),O("path",{d:"M258.286 89.9052L258.905 88.6191L257.619 88L257 89.2861L258.286 89.9052Z",fill:"white"})]})})})}d();c();function l2({testId:r,value:o,placeholder:d,errorMessage:i,validator:n,onTextInputChange:m,onTextInputBlur:c,onTextInputFocus:L,onTextInputEnter:p,textAlign:u,type:g,subtext:h,maxButtonClick:t,disabled:k,inputMode:x}){let v=(y,I)=>{let T=y.target.value;if(g==="number"&&T==="."&&(T="0."),!n(T)){m(I??"");return}m(T);},B=y=>{if(!c)return;let I=y.target.value;n(I)&&c(I);},f=y=>{if(!L)return;let I=y.target.value;n(I)&&L(I);},b=y=>{p&&y.key==="Enter"&&p();};return O(a$1,{testId:`${r}-text-control`,textAlign:u??"left",subtext:i?void 0:h,isErrored:!!i,errorMessage:i,sx:{width:"100%"},children:O(TextInput,{testId:`${r}-text`,onChange:y=>v(y,o),sizeVariant:"large",value:o,inputMode:x,validationStatus:i?"error":"success",placeholder:d,onBlur:B,onFocus:f,onKeyDown:b,disabled:k,hideClearValueButton:!0,sx:{minWidth:"100%"},children:t&&O(TextInput.Button,{testId:`${r}-max-button`,onClick:t,disabled:k,children:"max"})})})}d();c();d();c();d();c();function re({onClick:r,icon:o,name:d,symbol:i,balance:n,defaultTokenImage:m,testId:c,id:L}){let{t:p}=useTranslation();return P(MenuItem,{testId:`${c}-coin-selector__option-${L}`,emphasized:!0,size:"small",onClick:r,children:[O(MenuItem.FramedImage,{circularFrame:!0,use:O(b,{src:o,name:d,defaultImage:m})}),O(MenuItem.Label,{children:d}),O(MenuItem.Caption,{children:i}),n&&O(MenuItem.PriceDisplay,{fiatAmount:`${p("drawers.coinSelector.option.fiatPricePrefix")}${n.formattedFiatAmount}`,price:n.formattedAmount})]})}d();c();var ie={display:"flex",flexDirection:"column",gap:"2px",paddingX:"base.spacing.x4",paddingBottom:"base.spacing.x4"},ae={display:"flex",flexDirection:"column",rowGap:"base.spacing.x2"};function le({heading:r,options:o,defaultTokenImage:d,optionsLoading:i,children:n,onCloseDrawer:m,visible:c}){let{t:L}=useTranslation();return P(Drawer,{headerBarTitle:r,size:"full",onCloseDrawer:m,visible:c,children:[O(Drawer.Target,{children:n}),O(Drawer.Content,{children:P(Box,{sx:ie,children:[i&&o.length===0&&P(Box,{sx:ae,children:[O(MenuItem,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--1"}),O(MenuItem,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--2"}),O(MenuItem,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--3"})]}),!i&&o.length===0&&O(Body,{sx:{padding:"base.spacing.x4"},children:L("drawers.coinSelector.noCoins")}),!i&&o.map(({onClick:p,icon:u,name:g,symbol:h,balance:t,id:k,testId:x})=>O(re,{id:k,testId:x,onClick:p,icon:u,name:g,symbol:h,balance:t,defaultTokenImage:d},`${h}-${g}`))]})})]})}function z2({testId:r,options:o,optionsLoading:d,subtext:i,onSelectChange:n,textAlign:m,errorMessage:c,disabled:L,selectedOption:p,coinSelectorHeading:u,defaultTokenImage:g,environment:h=Environment.PRODUCTION,theme:t=WidgetTheme.DARK}){let[k,x]=useState(!1),v=useMemo(()=>o.map(b=>({...b,testId:r,onClick:()=>{n(b.id),x(!1);}})),[o,n,x]),B=()=>{if(p&&o.length!==0&&o.find(b=>b.id===p))return p},f=o?.find(b=>b.id===p)??p;return P(Box,{children:[O(le,{heading:u,options:v,defaultTokenImage:g,optionsLoading:d??!1,visible:k,onCloseDrawer:()=>x(!1)}),O(a$1,{testId:`${r}-select-control`,textAlign:m??"left",subtext:c?void 0:i,isErrored:!!c,errorMessage:c,children:O(Select,{testId:`${r}-select`,size:"large",defaultLabel:"Select token",targetClickOveride:()=>x(!0),selectedOption:B(),sx:{minw:"170px"},children:f&&P(Select.Option,{optionKey:f.id,testId:f.testId,disabled:L,children:[!f.icon&&O(Select.Option.Icon,{icon:"Coins",variant:"bold"}),f.icon&&O(Select.Option.FramedImage,{use:O(b,{environment:h,theme:t,src:f.icon,name:f.name}),circularFrame:!0,sx:{background:"base.color.translucent.standard.100"}}),O(Select.Option.Label,{children:f.symbol})]},f.id)})})]})}d();c();d();c();var de={display:"flex",flexDirection:"column",alignItems:"center",paddingY:"50px",paddingX:"base.spacing.x4",height:"100%"},j={color:"base.color.text.body.secondary",fontFamily:"base.font.family.heading.secondary",textAlign:"center",marginTop:"15px"},ce={display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:"8px",height:"100%",width:"100%"},z={width:"100%",height:"64px"};function Y2({onCloseDrawer:r,visible:o,showHeaderBar:d,onRetry:i}){let{t:n}=useTranslation();return O(Drawer,{headerBarTitle:void 0,size:"full",onCloseDrawer:r,visible:o,showHeaderBar:d,children:O(Drawer.Content,{children:P(Box,{sx:de,children:[O(DuoCon,{icon:"Information",colorVariant:"guidance",iconVariant:"bold"}),P(Heading,{size:"small",sx:j,testId:"transaction-rejected-heading",children:[n("drawers.transactionFailed.content.heading1"),O("br",{}),n("drawers.transactionFailed.content.heading2")]}),P(Body,{sx:j,children:[n("drawers.transactionFailed.content.body1"),O("br",{}),n("drawers.transactionFailed.content.body2")]}),P(Box,{sx:ce,children:[O(Button,{sx:z,variant:"tertiary",onClick:i,children:n("drawers.transactionFailed.buttons.retry")}),O(Button,{sx:z,variant:"tertiary",onClick:r,testId:"transaction-rejected-cancel-button",children:n("drawers.transactionFailed.buttons.cancel")})]})]})})})}d();c();function m1({visible:r,targetChainId:o,provider:d,checkout:i,onCloseDrawer:n,onNetworkSwitch:m}){let{t:c}=useTranslation(),L=j$1(i.config.environment??Environment.PRODUCTION,"/switchnetworkethereum.svg"),p=j$1(i.config.environment??Environment.PRODUCTION,"/switchnetworkzkevm.svg"),u=a$2(o),g=o===B(i.config),h=useCallback(async()=>{if(!i)return;let f=await i.switchNetwork({provider:d,chainId:o});m&&m(f.provider);},[i,d,m,o]),t=V(d),k=useMemo(()=>t?d.provider?.session?.peer?.metadata?.name:"",[d,t]),x=useMemo(()=>k?.toLowerCase().includes("metamask"),[k]),v=useMemo(()=>U(d)?"MetaMask wallet":t&&k?k:"wallet",[d,t,k]),B$1=t&&x;return useEffect(()=>{let f=new Image;f.src=L;let b=new Image;b.src=p;},[]),O(Drawer,{size:"threeQuarter",visible:r,onCloseDrawer:n,showHeaderBar:!1,children:P(Drawer.Content,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center"},children:[O(CloudImage,{use:O("img",{src:g?L:p,alt:c("drawers.networkSwitch.heading",{wallet:v})})}),O(ButtCon,{icon:"Close",variant:"tertiary",sx:{pos:"absolute",top:"base.spacing.x5",left:"base.spacing.x5",backdropFilter:"blur(30px)"},onClick:n}),P(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"base.spacing.x4",paddingX:"base.spacing.x6"},children:[O(Heading,{size:"small",weight:"bold",sx:{textAlign:"center",paddingX:"base.spacing.x6"},children:c("drawers.networkSwitch.heading",{wallet:v})}),B$1&&O(Body,{size:"medium",weight:"regular",sx:{color:"base.color.text.body.secondary",textAlign:"center",paddingX:"base.spacing.x6"},children:c("drawers.networkSwitch.manualSwitch.body",{chain:u})}),!B$1&&O(Body,{size:"medium",weight:"regular",sx:{color:"base.color.text.body.secondary",textAlign:"center",paddingX:"base.spacing.x6"},children:c("drawers.networkSwitch.controlledSwitch.body",{chain:u})})]}),P(Box,{sx:{display:"flex",flexDirection:"column",paddingX:"base.spacing.x4",width:"100%"},children:[!B$1&&O(Button,{size:"large",variant:"primary",sx:{width:"100%",marginBottom:"base.spacing.x2"},onClick:h,children:c("drawers.networkSwitch.switchButton",{chain:u})}),O(ta,{})]})]})})}d();c();d();c();var ke={backgroundColor:"base.color.translucent.emphasis.100"},Ce={marginBottom:"base.spacing.x4",color:"base.color.text.body.secondary"};function S1({gasFeeValue:r,gasFeeToken:o,gasFeeFiatValue:d,fees:i,onFeesClick:n,loading:m,sx:c}){let[L,p]=useState(!1),{t:u}=useTranslation();if(!r&&!m)return null;let g=e$1(f(r)),h=o?.symbol;return P(N,{children:[P(Accordion,{targetClickOveride:()=>{p(!0),n?.();},sx:{...ke,paddingBottom:"base.spacing.x2",...c},children:[O(Accordion.TargetLeftSlot,{children:O(Body,{size:"medium",sx:Ce,children:u("drawers.feesBreakdown.heading")})}),P(Accordion.TargetRightSlot,{children:[m&&O(Box,{sx:{width:"218px",position:"relative"},children:O(Box,{sx:{display:"block",position:"absolute",top:"-15px",width:"100%",height:"68px",WebkitMaskPosition:"right center",WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain",WebkitMaskImage:`url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" width="196" height="96"><path d="M182.85 55.2Q181.65 54 180 54h-56q-1.7 0-2.85 1.2Q120 56.35 120 58v4q0 1.7 1.15 2.85Q122.3 66 124 66h56q1.65 0 2.85-1.15Q184 63.7 184 62v-4q0-1.65-1.15-2.8m0-22Q181.65 32 180 32H68q-1.7 0-2.85 1.2Q64 34.35 64 36v8q0 1.7 1.15 2.85Q66.3 48 68 48h112q1.65 0 2.85-1.15Q184 45.7 184 44v-8q0-1.65-1.15-2.8Z" id="a"/></svg>')`},rc:O("span",{}),children:O(ShimmerBox,{rc:O("span",{})})})}),!m&&O(PriceDisplay,{testId:"fees-gas-fee__priceDisplay",fiatAmount:`\u2248 ${u("drawers.feesBreakdown.fees.fiatPricePrefix")}${d}`,price:`~ ${h} ${e$1(f(g))}`})]})]}),O(a$3,{tokenSymbol:h??"",fees:i,visible:L,loading:m,onCloseDrawer:()=>p(!1)})]})}
14
+
15
+ export { l2 as a, z2 as b, Y2 as c, Xe as d, m1 as e, S1 as f, t2 as g };
@@ -1,4 +1,19 @@
1
- import {b as b$2,a as a$1,c as c$1}from'./chunk-65KT4KZW.js';import {a as a$4}from'./chunk-AWLYHJ5L.js';import {b as b$3}from'./chunk-Z52PVTUZ.js';import {a}from'./chunk-K3KIUMY7.js';import {a as a$2}from'./chunk-NNMZJ5NV.js';import {a as a$3}from'./chunk-I3HZNWUF.js';import {b as b$1}from'./chunk-JV43EWXA.js';import {d,c,K as K$1,fa,da,aa,e,P,ea,O,S,T,R,oa,ta,sa}from'./chunk-QPOHDTWR.js';import {useState,useRef,useCallback,useEffect,useReducer,useMemo,useContext}from'react';import {IMTBLWidgetEvents,fetchRiskAssessment,isAddressSanctioned,ExchangeType}from'@imtbl/checkout-sdk';import {useTranslation}from'react-i18next';import {Box}from'@biom3/react';d();c();d();c();d();c();d();c();var vt=/^xn--/,pt=/[^\0-\x7E]/,gt=/[\x2E\u3002\uFF0E\uFF61]/g,At={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=Math.floor,pe=String.fromCharCode;function B(t){throw new RangeError(At[t])}function Ve(t,o){let n=t.split("@"),u="";n.length>1&&(u=n[0]+"@",t=n[1]);let d=function(h,e){let r=[],a=h.length;for(;a--;)r[a]=e(h[a]);return r}((t=t.replace(gt,".")).split("."),o).join(".");return u+d}function je(t){let o=[],n=0,u=t.length;for(;n<u;){let d=t.charCodeAt(n++);if(d>=55296&&d<=56319&&n<u){let h=t.charCodeAt(n++);(64512&h)==56320?o.push(((1023&d)<<10)+(1023&h)+65536):(o.push(d),n--);}else o.push(d);}return o}var Ge=function(t,o){return t+22+75*(t<26)-((o!=0)<<5)},Be=function(t,o,n){let u=0;for(t=n?x(t/700):t>>1,t+=x(t/o);t>455;u+=36)t=x(t/35);return x(u+36*t/(t+38))},$e=function(t){let o=[],n=t.length,u=0,d=128,h=72,e=t.lastIndexOf("-");e<0&&(e=0);for(let a=0;a<e;++a)t.charCodeAt(a)>=128&&B("not-basic"),o.push(t.charCodeAt(a));for(let a=e>0?e+1:0;a<n;){let i=u;for(let s=1,l=36;;l+=36){a>=n&&B("invalid-input");let f=(r=t.charCodeAt(a++))-48<10?r-22:r-65<26?r-65:r-97<26?r-97:36;(f>=36||f>x((2147483647-u)/s))&&B("overflow"),u+=f*s;let p=l<=h?1:l>=h+26?26:l-h;if(f<p)break;let v=36-p;s>x(2147483647/v)&&B("overflow"),s*=v;}let c=o.length+1;h=Be(u-i,c,i==0),x(u/c)>2147483647-d&&B("overflow"),d+=x(u/c),u%=c,o.splice(u++,0,d);}var r;return String.fromCodePoint(...o)},He=function(t){let o=[],n=(t=je(t)).length,u=128,d=0,h=72;for(let a of t)a<128&&o.push(pe(a));let e=o.length,r=e;for(e&&o.push("-");r<n;){let a=2147483647;for(let c of t)c>=u&&c<a&&(a=c);let i=r+1;a-u>x((2147483647-d)/i)&&B("overflow"),d+=(a-u)*i,u=a;for(let c of t)if(c<u&&++d>2147483647&&B("overflow"),c==u){let s=d;for(let l=36;;l+=36){let f=l<=h?1:l>=h+26?26:l-h;if(s<f)break;let p=s-f,v=36-f;o.push(pe(Ge(f+p%v,0))),s=x(p/v);}o.push(pe(Ge(s,0))),h=Be(d,i,r==e),d=0,++r;}++d,++u;}return o.join("")},j={version:"2.1.0",ucs2:{decode:je,encode:t=>String.fromCodePoint(...t)},decode:$e,encode:He,toASCII:function(t){return Ve(t,function(o){return pt.test(o)?"xn--"+He(o):o})},toUnicode:function(t){return Ve(t,function(o){return vt.test(o)?$e(o.slice(4).toLowerCase()):o})}};d();c();function Rt(t,o){return Object.prototype.hasOwnProperty.call(t,o)}var Et=function(t,o,n,u){o=o||"&",n=n||"=";var d={};if(typeof t!="string"||t.length===0)return d;var h=/\+/g;t=t.split(o);var e=1e3;u&&typeof u.maxKeys=="number"&&(e=u.maxKeys);var r=t.length;e>0&&r>e&&(r=e);for(var a=0;a<r;++a){var i,c,s,l,f=t[a].replace(h,"%20"),p=f.indexOf(n);p>=0?(i=f.substr(0,p),c=f.substr(p+1)):(i=f,c=""),s=decodeURIComponent(i),l=decodeURIComponent(c),Rt(d,s)?Array.isArray(d[s])?d[s].push(l):d[s]=[d[s],l]:d[s]=l;}return d},ee=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return ""}},Tt=function(t,o,n,u){return o=o||"&",n=n||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(d){var h=encodeURIComponent(ee(d))+n;return Array.isArray(t[d])?t[d].map(function(e){return h+encodeURIComponent(ee(e))}).join(o):h+encodeURIComponent(ee(t[d]))}).join(o):u?encodeURIComponent(ee(u))+n+encodeURIComponent(ee(t)):""},N={};N.decode=N.parse=Et,N.encode=N.stringify=Tt;N.decode;N.encode;N.parse;N.stringify;d();c();var Je,V,G,Q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis,b=Je={};function ge(){throw new Error("setTimeout has not been defined")}function Ae(){throw new Error("clearTimeout has not been defined")}function ze(t){if(V===setTimeout)return setTimeout(t,0);if((V===ge||!V)&&setTimeout)return V=setTimeout,setTimeout(t,0);try{return V(t,0)}catch{try{return V.call(null,t,0)}catch{return V.call(this||Q,t,0)}}}(function(){try{V=typeof setTimeout=="function"?setTimeout:ge;}catch{V=ge;}try{G=typeof clearTimeout=="function"?clearTimeout:Ae;}catch{G=Ae;}})();var q,$=[],z=!1,ce=-1;function St(){z&&q&&(z=!1,q.length?$=q.concat($):ce=-1,$.length&&Qe());}function Qe(){if(!z){var t=ze(St);z=!0;for(var o=$.length;o;){for(q=$,$=[];++ce<o;)q&&q[ce].run();ce=-1,o=$.length;}q=null,z=!1,function(n){if(G===clearTimeout)return clearTimeout(n);if((G===Ae||!G)&&clearTimeout)return G=clearTimeout,clearTimeout(n);try{G(n);}catch{try{return G.call(null,n)}catch{return G.call(this||Q,n)}}}(t);}}function qe(t,o){(this||Q).fun=t,(this||Q).array=o;}function K(){}b.nextTick=function(t){var o=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)o[n-1]=arguments[n];$.push(new qe(t,o)),$.length!==1||z||ze(Qe);},qe.prototype.run=function(){(this||Q).fun.apply(null,(this||Q).array);},b.title="browser",b.browser=!0,b.env={},b.argv=[],b.version="",b.versions={},b.on=K,b.addListener=K,b.once=K,b.off=K,b.removeListener=K,b.removeAllListeners=K,b.emit=K,b.prependListener=K,b.prependOnceListener=K,b.listeners=function(t){return []},b.binding=function(t){throw new Error("process.binding is not supported")},b.cwd=function(){return "/"},b.chdir=function(t){throw new Error("process.chdir is not supported")},b.umask=function(){return 0};var C=Je;C.addListener;C.argv;C.binding;C.browser;C.chdir;C.cwd;C.emit;C.env;C.listeners;C.nextTick;C.off;C.on;C.once;C.prependListener;C.prependOnceListener;C.removeAllListeners;C.removeListener;C.title;C.umask;C.version;C.versions;d();c();d();c();var Re={},Ye=!1,Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;function yt(){if(Ye)return Re;Ye=!0;var t=Re={},o,n;function u(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=u;}catch{o=u;}try{typeof clearTimeout=="function"?n=clearTimeout:n=d;}catch{n=d;}})();function h(v){if(o===setTimeout)return setTimeout(v,0);if((o===u||!o)&&setTimeout)return o=setTimeout,setTimeout(v,0);try{return o(v,0)}catch{try{return o.call(null,v,0)}catch{return o.call(this||Y,v,0)}}}function e(v){if(n===clearTimeout)return clearTimeout(v);if((n===d||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(v);try{return n(v)}catch{try{return n.call(null,v)}catch{return n.call(this||Y,v)}}}var r=[],a=!1,i,c=-1;function s(){!a||!i||(a=!1,i.length?r=i.concat(r):c=-1,r.length&&l());}function l(){if(!a){var v=h(s);a=!0;for(var m=r.length;m;){for(i=r,r=[];++c<m;)i&&i[c].run();c=-1,m=r.length;}i=null,a=!1,e(v);}}t.nextTick=function(v){var m=new Array(arguments.length-1);if(arguments.length>1)for(var A=1;A<arguments.length;A++)m[A-1]=arguments[A];r.push(new f(v,m)),r.length===1&&!a&&h(l);};function f(v,m){(this||Y).fun=v,(this||Y).array=m;}f.prototype.run=function(){(this||Y).fun.apply(null,(this||Y).array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function p(){}return t.on=p,t.addListener=p,t.once=p,t.off=p,t.removeListener=p,t.removeAllListeners=p,t.emit=p,t.prependListener=p,t.prependOnceListener=p,t.listeners=function(v){return []},t.binding=function(v){throw new Error("process.binding is not supported")},t.cwd=function(){return "/"},t.chdir=function(v){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},Re}var y=yt();y.platform="browser";y.addListener;y.argv;y.binding;y.browser;y.chdir;y.cwd;y.emit;y.env;y.listeners;y.nextTick;y.off;y.on;y.once;y.prependListener;y.prependOnceListener;y.removeAllListeners;y.removeListener;y.title;y.umask;y.version;y.versions;var Ee={},Ze=!1;function wt(){if(Ze)return Ee;Ze=!0;var t=y;function o(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function n(h,e){for(var r="",a=0,i=-1,c=0,s,l=0;l<=h.length;++l){if(l<h.length)s=h.charCodeAt(l);else {if(s===47)break;s=47;}if(s===47){if(!(i===l-1||c===1))if(i!==l-1&&c===2){if(r.length<2||a!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",a=0):(r=r.slice(0,f),a=r.length-1-r.lastIndexOf("/")),i=l,c=0;continue}}else if(r.length===2||r.length===1){r="",a=0,i=l,c=0;continue}}e&&(r.length>0?r+="/..":r="..",a=2);}else r.length>0?r+="/"+h.slice(i+1,l):r=h.slice(i+1,l),a=l-i-1;i=l,c=0;}else s===46&&c!==-1?++c:c=-1;}return r}function u(h,e){var r=e.dir||e.root,a=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+a:r+h+a:a}var d={resolve:function(){for(var e="",r=!1,a,i=arguments.length-1;i>=-1&&!r;i--){var c;i>=0?c=arguments[i]:(a===void 0&&(a=t.cwd()),c=a),o(c),c.length!==0&&(e=c+"/"+e,r=c.charCodeAt(0)===47);}return e=n(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(o(e),e.length===0)return ".";var r=e.charCodeAt(0)===47,a=e.charCodeAt(e.length-1)===47;return e=n(e,!r),e.length===0&&!r&&(e="."),e.length>0&&a&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return o(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return ".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];o(a),a.length>0&&(e===void 0?e=a:e+="/"+a);}return e===void 0?".":d.normalize(e)},relative:function(e,r){if(o(e),o(r),e===r||(e=d.resolve(e),r=d.resolve(r),e===r))return "";for(var a=1;a<e.length&&e.charCodeAt(a)===47;++a);for(var i=e.length,c=i-a,s=1;s<r.length&&r.charCodeAt(s)===47;++s);for(var l=r.length,f=l-s,p=c<f?c:f,v=-1,m=0;m<=p;++m){if(m===p){if(f>p){if(r.charCodeAt(s+m)===47)return r.slice(s+m+1);if(m===0)return r.slice(s+m)}else c>p&&(e.charCodeAt(a+m)===47?v=m:m===0&&(v=0));break}var A=e.charCodeAt(a+m),w=r.charCodeAt(s+m);if(A!==w)break;A===47&&(v=m);}var g="";for(m=a+v+1;m<=i;++m)(m===i||e.charCodeAt(m)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(s+v):(s+=v,r.charCodeAt(s)===47&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(o(e),e.length===0)return ".";for(var r=e.charCodeAt(0),a=r===47,i=-1,c=!0,s=e.length-1;s>=1;--s)if(r=e.charCodeAt(s),r===47){if(!c){i=s;break}}else c=!1;return i===-1?a?"/":".":a&&i===1?"//":e.slice(0,i)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');o(e);var a=0,i=-1,c=!0,s;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return "";var l=r.length-1,f=-1;for(s=e.length-1;s>=0;--s){var p=e.charCodeAt(s);if(p===47){if(!c){a=s+1;break}}else f===-1&&(c=!1,f=s+1),l>=0&&(p===r.charCodeAt(l)?--l===-1&&(i=s):(l=-1,i=f));}return a===i?i=f:i===-1&&(i=e.length),e.slice(a,i)}else {for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!c){a=s+1;break}}else i===-1&&(c=!1,i=s+1);return i===-1?"":e.slice(a,i)}},extname:function(e){o(e);for(var r=-1,a=0,i=-1,c=!0,s=0,l=e.length-1;l>=0;--l){var f=e.charCodeAt(l);if(f===47){if(!c){a=l+1;break}continue}i===-1&&(c=!1,i=l+1),f===46?r===-1?r=l:s!==1&&(s=1):r!==-1&&(s=-1);}return r===-1||i===-1||s===0||s===1&&r===i-1&&r===a+1?"":e.slice(r,i)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return u("/",e)},parse:function(e){o(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var a=e.charCodeAt(0),i=a===47,c;i?(r.root="/",c=1):c=0;for(var s=-1,l=0,f=-1,p=!0,v=e.length-1,m=0;v>=c;--v){if(a=e.charCodeAt(v),a===47){if(!p){l=v+1;break}continue}f===-1&&(p=!1,f=v+1),a===46?s===-1?s=v:m!==1&&(m=1):s!==-1&&(m=-1);}return s===-1||f===-1||m===0||m===1&&s===f-1&&s===l+1?f!==-1&&(l===0&&i?r.base=r.name=e.slice(1,f):r.base=r.name=e.slice(l,f)):(l===0&&i?(r.name=e.slice(1,s),r.base=e.slice(1,f)):(r.name=e.slice(l,s),r.base=e.slice(l,f)),r.ext=e.slice(s,f)),l>0?r.dir=e.slice(0,l-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return d.posix=d,Ee=d,Ee}var Te=wt();var E={},Ct=j,W={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};function k(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null;}E.parse=te,E.resolve=function(t,o){return te(t,!1,!0).resolve(o)},E.resolveObject=function(t,o){return t?te(t,!1,!0).resolveObject(o):o},E.format=function(t){return W.isString(t)&&(t=te(t)),t instanceof k?t.format():k.prototype.format.call(t)},E.Url=k;var Ot=/^([a-z0-9.+-]+:)/i,bt=/:[0-9]*$/,_t=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Lt=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
1
+ import { b as b$2, a as a$1, c as c$1 } from './chunk-65KT4KZW.js';
2
+ import { a as a$4 } from './chunk-AWLYHJ5L.js';
3
+ import { b as b$3 } from './chunk-Z52PVTUZ.js';
4
+ import { a } from './chunk-K3KIUMY7.js';
5
+ import { a as a$2 } from './chunk-NNMZJ5NV.js';
6
+ import { a as a$3 } from './chunk-I3HZNWUF.js';
7
+ import { b as b$1 } from './chunk-JV43EWXA.js';
8
+ import { d, c, K as K$1, fa, da, aa, e, P, ea, O, S, T, R, oa, ta, sa } from './chunk-QPOHDTWR.js';
9
+ import { useState, useRef, useCallback, useEffect, useReducer, useMemo, useContext } from 'react';
10
+ import { IMTBLWidgetEvents, fetchRiskAssessment, isAddressSanctioned, ExchangeType } from '@imtbl/checkout-sdk';
11
+ import { useTranslation } from 'react-i18next';
12
+ import { Box } from '@biom3/react';
13
+
14
+ d();c();d();c();d();c();d();c();var vt=/^xn--/,pt=/[^\0-\x7E]/,gt=/[\x2E\u3002\uFF0E\uFF61]/g,At={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=Math.floor,pe=String.fromCharCode;function B(t){throw new RangeError(At[t])}function Ve(t,o){let n=t.split("@"),u="";n.length>1&&(u=n[0]+"@",t=n[1]);let d=function(h,e){let r=[],a=h.length;for(;a--;)r[a]=e(h[a]);return r}((t=t.replace(gt,".")).split("."),o).join(".");return u+d}function je(t){let o=[],n=0,u=t.length;for(;n<u;){let d=t.charCodeAt(n++);if(d>=55296&&d<=56319&&n<u){let h=t.charCodeAt(n++);(64512&h)==56320?o.push(((1023&d)<<10)+(1023&h)+65536):(o.push(d),n--);}else o.push(d);}return o}var Ge=function(t,o){return t+22+75*(t<26)-((o!=0)<<5)},Be=function(t,o,n){let u=0;for(t=n?x(t/700):t>>1,t+=x(t/o);t>455;u+=36)t=x(t/35);return x(u+36*t/(t+38))},$e=function(t){let o=[],n=t.length,u=0,d=128,h=72,e=t.lastIndexOf("-");e<0&&(e=0);for(let a=0;a<e;++a)t.charCodeAt(a)>=128&&B("not-basic"),o.push(t.charCodeAt(a));for(let a=e>0?e+1:0;a<n;){let i=u;for(let s=1,l=36;;l+=36){a>=n&&B("invalid-input");let f=(r=t.charCodeAt(a++))-48<10?r-22:r-65<26?r-65:r-97<26?r-97:36;(f>=36||f>x((2147483647-u)/s))&&B("overflow"),u+=f*s;let p=l<=h?1:l>=h+26?26:l-h;if(f<p)break;let v=36-p;s>x(2147483647/v)&&B("overflow"),s*=v;}let c=o.length+1;h=Be(u-i,c,i==0),x(u/c)>2147483647-d&&B("overflow"),d+=x(u/c),u%=c,o.splice(u++,0,d);}var r;return String.fromCodePoint(...o)},He=function(t){let o=[],n=(t=je(t)).length,u=128,d=0,h=72;for(let a of t)a<128&&o.push(pe(a));let e=o.length,r=e;for(e&&o.push("-");r<n;){let a=2147483647;for(let c of t)c>=u&&c<a&&(a=c);let i=r+1;a-u>x((2147483647-d)/i)&&B("overflow"),d+=(a-u)*i,u=a;for(let c of t)if(c<u&&++d>2147483647&&B("overflow"),c==u){let s=d;for(let l=36;;l+=36){let f=l<=h?1:l>=h+26?26:l-h;if(s<f)break;let p=s-f,v=36-f;o.push(pe(Ge(f+p%v,0))),s=x(p/v);}o.push(pe(Ge(s,0))),h=Be(d,i,r==e),d=0,++r;}++d,++u;}return o.join("")},j={version:"2.1.0",ucs2:{decode:je,encode:t=>String.fromCodePoint(...t)},decode:$e,encode:He,toASCII:function(t){return Ve(t,function(o){return pt.test(o)?"xn--"+He(o):o})},toUnicode:function(t){return Ve(t,function(o){return vt.test(o)?$e(o.slice(4).toLowerCase()):o})}};d();c();function Rt(t,o){return Object.prototype.hasOwnProperty.call(t,o)}var Et=function(t,o,n,u){o=o||"&",n=n||"=";var d={};if(typeof t!="string"||t.length===0)return d;var h=/\+/g;t=t.split(o);var e=1e3;u&&typeof u.maxKeys=="number"&&(e=u.maxKeys);var r=t.length;e>0&&r>e&&(r=e);for(var a=0;a<r;++a){var i,c,s,l,f=t[a].replace(h,"%20"),p=f.indexOf(n);p>=0?(i=f.substr(0,p),c=f.substr(p+1)):(i=f,c=""),s=decodeURIComponent(i),l=decodeURIComponent(c),Rt(d,s)?Array.isArray(d[s])?d[s].push(l):d[s]=[d[s],l]:d[s]=l;}return d},ee=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return ""}},Tt=function(t,o,n,u){return o=o||"&",n=n||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(d){var h=encodeURIComponent(ee(d))+n;return Array.isArray(t[d])?t[d].map(function(e){return h+encodeURIComponent(ee(e))}).join(o):h+encodeURIComponent(ee(t[d]))}).join(o):u?encodeURIComponent(ee(u))+n+encodeURIComponent(ee(t)):""},N={};N.decode=N.parse=Et,N.encode=N.stringify=Tt;N.decode;N.encode;N.parse;N.stringify;d();c();var Je,V,G,Q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis,b=Je={};function ge(){throw new Error("setTimeout has not been defined")}function Ae(){throw new Error("clearTimeout has not been defined")}function ze(t){if(V===setTimeout)return setTimeout(t,0);if((V===ge||!V)&&setTimeout)return V=setTimeout,setTimeout(t,0);try{return V(t,0)}catch{try{return V.call(null,t,0)}catch{return V.call(this||Q,t,0)}}}(function(){try{V=typeof setTimeout=="function"?setTimeout:ge;}catch{V=ge;}try{G=typeof clearTimeout=="function"?clearTimeout:Ae;}catch{G=Ae;}})();var q,$=[],z=!1,ce=-1;function St(){z&&q&&(z=!1,q.length?$=q.concat($):ce=-1,$.length&&Qe());}function Qe(){if(!z){var t=ze(St);z=!0;for(var o=$.length;o;){for(q=$,$=[];++ce<o;)q&&q[ce].run();ce=-1,o=$.length;}q=null,z=!1,function(n){if(G===clearTimeout)return clearTimeout(n);if((G===Ae||!G)&&clearTimeout)return G=clearTimeout,clearTimeout(n);try{G(n);}catch{try{return G.call(null,n)}catch{return G.call(this||Q,n)}}}(t);}}function qe(t,o){(this||Q).fun=t,(this||Q).array=o;}function K(){}b.nextTick=function(t){var o=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)o[n-1]=arguments[n];$.push(new qe(t,o)),$.length!==1||z||ze(Qe);},qe.prototype.run=function(){(this||Q).fun.apply(null,(this||Q).array);},b.title="browser",b.browser=!0,b.env={},b.argv=[],b.version="",b.versions={},b.on=K,b.addListener=K,b.once=K,b.off=K,b.removeListener=K,b.removeAllListeners=K,b.emit=K,b.prependListener=K,b.prependOnceListener=K,b.listeners=function(t){return []},b.binding=function(t){throw new Error("process.binding is not supported")},b.cwd=function(){return "/"},b.chdir=function(t){throw new Error("process.chdir is not supported")},b.umask=function(){return 0};var C=Je;C.addListener;C.argv;C.binding;C.browser;C.chdir;C.cwd;C.emit;C.env;C.listeners;C.nextTick;C.off;C.on;C.once;C.prependListener;C.prependOnceListener;C.removeAllListeners;C.removeListener;C.title;C.umask;C.version;C.versions;d();c();d();c();var Re={},Ye=!1,Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;function yt(){if(Ye)return Re;Ye=!0;var t=Re={},o,n;function u(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=u;}catch{o=u;}try{typeof clearTimeout=="function"?n=clearTimeout:n=d;}catch{n=d;}})();function h(v){if(o===setTimeout)return setTimeout(v,0);if((o===u||!o)&&setTimeout)return o=setTimeout,setTimeout(v,0);try{return o(v,0)}catch{try{return o.call(null,v,0)}catch{return o.call(this||Y,v,0)}}}function e(v){if(n===clearTimeout)return clearTimeout(v);if((n===d||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(v);try{return n(v)}catch{try{return n.call(null,v)}catch{return n.call(this||Y,v)}}}var r=[],a=!1,i,c=-1;function s(){!a||!i||(a=!1,i.length?r=i.concat(r):c=-1,r.length&&l());}function l(){if(!a){var v=h(s);a=!0;for(var m=r.length;m;){for(i=r,r=[];++c<m;)i&&i[c].run();c=-1,m=r.length;}i=null,a=!1,e(v);}}t.nextTick=function(v){var m=new Array(arguments.length-1);if(arguments.length>1)for(var A=1;A<arguments.length;A++)m[A-1]=arguments[A];r.push(new f(v,m)),r.length===1&&!a&&h(l);};function f(v,m){(this||Y).fun=v,(this||Y).array=m;}f.prototype.run=function(){(this||Y).fun.apply(null,(this||Y).array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function p(){}return t.on=p,t.addListener=p,t.once=p,t.off=p,t.removeListener=p,t.removeAllListeners=p,t.emit=p,t.prependListener=p,t.prependOnceListener=p,t.listeners=function(v){return []},t.binding=function(v){throw new Error("process.binding is not supported")},t.cwd=function(){return "/"},t.chdir=function(v){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},Re}var y=yt();y.platform="browser";y.addListener;y.argv;y.binding;y.browser;y.chdir;y.cwd;y.emit;y.env;y.listeners;y.nextTick;y.off;y.on;y.once;y.prependListener;y.prependOnceListener;y.removeAllListeners;y.removeListener;y.title;y.umask;y.version;y.versions;var Ee={},Ze=!1;function wt(){if(Ze)return Ee;Ze=!0;var t=y;function o(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function n(h,e){for(var r="",a=0,i=-1,c=0,s,l=0;l<=h.length;++l){if(l<h.length)s=h.charCodeAt(l);else {if(s===47)break;s=47;}if(s===47){if(!(i===l-1||c===1))if(i!==l-1&&c===2){if(r.length<2||a!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",a=0):(r=r.slice(0,f),a=r.length-1-r.lastIndexOf("/")),i=l,c=0;continue}}else if(r.length===2||r.length===1){r="",a=0,i=l,c=0;continue}}e&&(r.length>0?r+="/..":r="..",a=2);}else r.length>0?r+="/"+h.slice(i+1,l):r=h.slice(i+1,l),a=l-i-1;i=l,c=0;}else s===46&&c!==-1?++c:c=-1;}return r}function u(h,e){var r=e.dir||e.root,a=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+a:r+h+a:a}var d={resolve:function(){for(var e="",r=!1,a,i=arguments.length-1;i>=-1&&!r;i--){var c;i>=0?c=arguments[i]:(a===void 0&&(a=t.cwd()),c=a),o(c),c.length!==0&&(e=c+"/"+e,r=c.charCodeAt(0)===47);}return e=n(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(o(e),e.length===0)return ".";var r=e.charCodeAt(0)===47,a=e.charCodeAt(e.length-1)===47;return e=n(e,!r),e.length===0&&!r&&(e="."),e.length>0&&a&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return o(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return ".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];o(a),a.length>0&&(e===void 0?e=a:e+="/"+a);}return e===void 0?".":d.normalize(e)},relative:function(e,r){if(o(e),o(r),e===r||(e=d.resolve(e),r=d.resolve(r),e===r))return "";for(var a=1;a<e.length&&e.charCodeAt(a)===47;++a);for(var i=e.length,c=i-a,s=1;s<r.length&&r.charCodeAt(s)===47;++s);for(var l=r.length,f=l-s,p=c<f?c:f,v=-1,m=0;m<=p;++m){if(m===p){if(f>p){if(r.charCodeAt(s+m)===47)return r.slice(s+m+1);if(m===0)return r.slice(s+m)}else c>p&&(e.charCodeAt(a+m)===47?v=m:m===0&&(v=0));break}var A=e.charCodeAt(a+m),w=r.charCodeAt(s+m);if(A!==w)break;A===47&&(v=m);}var g="";for(m=a+v+1;m<=i;++m)(m===i||e.charCodeAt(m)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(s+v):(s+=v,r.charCodeAt(s)===47&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(o(e),e.length===0)return ".";for(var r=e.charCodeAt(0),a=r===47,i=-1,c=!0,s=e.length-1;s>=1;--s)if(r=e.charCodeAt(s),r===47){if(!c){i=s;break}}else c=!1;return i===-1?a?"/":".":a&&i===1?"//":e.slice(0,i)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');o(e);var a=0,i=-1,c=!0,s;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return "";var l=r.length-1,f=-1;for(s=e.length-1;s>=0;--s){var p=e.charCodeAt(s);if(p===47){if(!c){a=s+1;break}}else f===-1&&(c=!1,f=s+1),l>=0&&(p===r.charCodeAt(l)?--l===-1&&(i=s):(l=-1,i=f));}return a===i?i=f:i===-1&&(i=e.length),e.slice(a,i)}else {for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!c){a=s+1;break}}else i===-1&&(c=!1,i=s+1);return i===-1?"":e.slice(a,i)}},extname:function(e){o(e);for(var r=-1,a=0,i=-1,c=!0,s=0,l=e.length-1;l>=0;--l){var f=e.charCodeAt(l);if(f===47){if(!c){a=l+1;break}continue}i===-1&&(c=!1,i=l+1),f===46?r===-1?r=l:s!==1&&(s=1):r!==-1&&(s=-1);}return r===-1||i===-1||s===0||s===1&&r===i-1&&r===a+1?"":e.slice(r,i)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return u("/",e)},parse:function(e){o(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var a=e.charCodeAt(0),i=a===47,c;i?(r.root="/",c=1):c=0;for(var s=-1,l=0,f=-1,p=!0,v=e.length-1,m=0;v>=c;--v){if(a=e.charCodeAt(v),a===47){if(!p){l=v+1;break}continue}f===-1&&(p=!1,f=v+1),a===46?s===-1?s=v:m!==1&&(m=1):s!==-1&&(m=-1);}return s===-1||f===-1||m===0||m===1&&s===f-1&&s===l+1?f!==-1&&(l===0&&i?r.base=r.name=e.slice(1,f):r.base=r.name=e.slice(l,f)):(l===0&&i?(r.name=e.slice(1,s),r.base=e.slice(1,f)):(r.name=e.slice(l,s),r.base=e.slice(l,f)),r.ext=e.slice(s,f)),l>0?r.dir=e.slice(0,l-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return d.posix=d,Ee=d,Ee}var Te=wt();var E={},Ct=j,W={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};function k(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null;}E.parse=te,E.resolve=function(t,o){return te(t,!1,!0).resolve(o)},E.resolveObject=function(t,o){return t?te(t,!1,!0).resolveObject(o):o},E.format=function(t){return W.isString(t)&&(t=te(t)),t instanceof k?t.format():k.prototype.format.call(t)},E.Url=k;var Ot=/^([a-z0-9.+-]+:)/i,bt=/:[0-9]*$/,_t=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Lt=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
2
15
  `," "]),Ce=["'"].concat(Lt),Xe=["%","/","?",";","#"].concat(Ce),et=["/","?","#"],tt=/^[+a-z0-9A-Z_-]{0,63}$/,It=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Dt={javascript:!0,"javascript:":!0},Se={javascript:!0,"javascript:":!0},Z={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ye=N;function te(t,o,n){if(t&&W.isObject(t)&&t instanceof k)return t;var u=new k;return u.parse(t,o,n),u}k.prototype.parse=function(t,o,n){if(!W.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var u=t.indexOf("?"),d=u!==-1&&u<t.indexOf("#")?"?":"#",h=t.split(d);h[0]=h[0].replace(/\\/g,"/");var e=t=h.join(d);if(e=e.trim(),!n&&t.split("#").length===1){var r=_t.exec(e);if(r)return this.path=e,this.href=e,this.pathname=r[1],r[2]?(this.search=r[2],this.query=o?ye.parse(this.search.substr(1)):this.search.substr(1)):o&&(this.search="",this.query={}),this}var a=Ot.exec(e);if(a){var i=(a=a[0]).toLowerCase();this.protocol=i,e=e.substr(a.length);}if(n||a||e.match(/^\/\/[^@\/]+@[^@\/]+/)){var c=e.substr(0,2)==="//";!c||a&&Se[a]||(e=e.substr(2),this.slashes=!0);}if(!Se[a]&&(c||a&&!Z[a])){for(var s,l,f=-1,p=0;p<et.length;p++)(v=e.indexOf(et[p]))!==-1&&(f===-1||v<f)&&(f=v);for((l=f===-1?e.lastIndexOf("@"):e.lastIndexOf("@",f))!==-1&&(s=e.slice(0,l),e=e.slice(l+1),this.auth=decodeURIComponent(s)),f=-1,p=0;p<Xe.length;p++){var v;(v=e.indexOf(Xe[p]))!==-1&&(f===-1||v<f)&&(f=v);}f===-1&&(f=e.length),this.host=e.slice(0,f),e=e.slice(f),this.parseHost(),this.hostname=this.hostname||"";var m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m)for(var A=this.hostname.split(/\./),w=(p=0,A.length);p<w;p++){var g=A[p];if(g&&!g.match(tt)){for(var D="",R=0,F=g.length;R<F;R++)g.charCodeAt(R)>127?D+="x":D+=g[R];if(!D.match(tt)){var L=A.slice(0,p),_=A.slice(p+1),I=g.match(It);I&&(L.push(I[1]),_.unshift(I[2])),_.length&&(e="/"+_.join(".")+e),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=Ct.toASCII(this.hostname));var H=this.port?":"+this.port:"",ht=this.hostname||"";this.host=ht+H,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),e[0]!=="/"&&(e="/"+e));}if(!Dt[i])for(p=0,w=Ce.length;p<w;p++){var X=Ce[p];if(e.indexOf(X)!==-1){var ue=encodeURIComponent(X);ue===X&&(ue=escape(X)),e=e.split(X).join(ue);}}var fe=e.indexOf("#");fe!==-1&&(this.hash=e.substr(fe),e=e.slice(0,fe));var re=e.indexOf("?");if(re!==-1?(this.search=e.substr(re),this.query=e.substr(re+1),o&&(this.query=ye.parse(this.query)),e=e.slice(0,re)):o&&(this.search="",this.query={}),e&&(this.pathname=e),Z[i]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){H=this.pathname||"";var mt=this.search||"";this.path=H+mt;}return this.href=this.format(),this},k.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var o=this.protocol||"",n=this.pathname||"",u=this.hash||"",d=!1,h="";this.host?d=t+this.host:this.hostname&&(d=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(d+=":"+this.port)),this.query&&W.isObject(this.query)&&Object.keys(this.query).length&&(h=ye.stringify(this.query));var e=this.search||h&&"?"+h||"";return o&&o.substr(-1)!==":"&&(o+=":"),this.slashes||(!o||Z[o])&&d!==!1?(d="//"+(d||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):d||(d=""),u&&u.charAt(0)!=="#"&&(u="#"+u),e&&e.charAt(0)!=="?"&&(e="?"+e),o+d+(n=n.replace(/[?#]/g,function(r){return encodeURIComponent(r)}))+(e=e.replace("#","%23"))+u},k.prototype.resolve=function(t){return this.resolveObject(te(t,!1,!0)).format()},k.prototype.resolveObject=function(t){if(W.isString(t)){var o=new k;o.parse(t,!1,!0),t=o;}for(var n=new k,u=Object.keys(this),d=0;d<u.length;d++){var h=u[d];n[h]=this[h];}if(n.hash=t.hash,t.href==="")return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var e=Object.keys(t),r=0;r<e.length;r++){var a=e[r];a!=="protocol"&&(n[a]=t[a]);}return Z[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!Z[t.protocol]){for(var i=Object.keys(t),c=0;c<i.length;c++){var s=i[c];n[s]=t[s];}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||Se[t.protocol])n.pathname=t.pathname;else {for(var l=(t.pathname||"").split("/");l.length&&!(t.host=l.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),l[0]!==""&&l.unshift(""),l.length<2&&l.unshift(""),n.pathname=l.join("/");}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var f=n.pathname||"",p=n.search||"";n.path=f+p;}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var v=n.pathname&&n.pathname.charAt(0)==="/",m=t.host||t.pathname&&t.pathname.charAt(0)==="/",A=m||v||n.host&&t.pathname,w=A,g=n.pathname&&n.pathname.split("/")||[],D=(l=t.pathname&&t.pathname.split("/")||[],n.protocol&&!Z[n.protocol]);if(D&&(n.hostname="",n.port=null,n.host&&(g[0]===""?g[0]=n.host:g.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(l[0]===""?l[0]=t.host:l.unshift(t.host)),t.host=null),A=A&&(l[0]===""||g[0]==="")),m)n.host=t.host||t.host===""?t.host:n.host,n.hostname=t.hostname||t.hostname===""?t.hostname:n.hostname,n.search=t.search,n.query=t.query,g=l;else if(l.length)g||(g=[]),g.pop(),g=g.concat(l),n.search=t.search,n.query=t.query;else if(!W.isNullOrUndefined(t.search))return D&&(n.hostname=n.host=g.shift(),(I=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=I.shift(),n.host=n.hostname=I.shift())),n.search=t.search,n.query=t.query,W.isNull(n.pathname)&&W.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!g.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var R=g.slice(-1)[0],F=(n.host||t.host||g.length>1)&&(R==="."||R==="..")||R==="",L=0,_=g.length;_>=0;_--)(R=g[_])==="."?g.splice(_,1):R===".."?(g.splice(_,1),L++):L&&(g.splice(_,1),L--);if(!A&&!w)for(;L--;L)g.unshift("..");!A||g[0]===""||g[0]&&g[0].charAt(0)==="/"||g.unshift(""),F&&g.join("/").substr(-1)!=="/"&&g.push("");var I,H=g[0]===""||g[0]&&g[0].charAt(0)==="/";return D&&(n.hostname=n.host=H?"":g.length?g.shift():"",(I=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=I.shift(),n.host=n.hostname=I.shift())),(A=A||n.host&&g.length)&&!H&&g.unshift(""),g.length?n.pathname=g.join("/"):(n.pathname=null,n.path=null),W.isNull(n.pathname)&&W.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},k.prototype.parseHost=function(){var t=this.host,o=bt.exec(t);o&&((o=o[0])!==":"&&(this.port=o.substr(1)),t=t.substr(0,t.length-o.length)),t&&(this.hostname=t);};E.Url;E.format;E.resolve;E.resolveObject;var we={},rt=!1;function Pt(){if(rt)return we;rt=!0;var t=C;function o(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function n(h,e){for(var r="",a=0,i=-1,c=0,s,l=0;l<=h.length;++l){if(l<h.length)s=h.charCodeAt(l);else {if(s===47)break;s=47;}if(s===47){if(!(i===l-1||c===1))if(i!==l-1&&c===2){if(r.length<2||a!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",a=0):(r=r.slice(0,f),a=r.length-1-r.lastIndexOf("/")),i=l,c=0;continue}}else if(r.length===2||r.length===1){r="",a=0,i=l,c=0;continue}}e&&(r.length>0?r+="/..":r="..",a=2);}else r.length>0?r+="/"+h.slice(i+1,l):r=h.slice(i+1,l),a=l-i-1;i=l,c=0;}else s===46&&c!==-1?++c:c=-1;}return r}function u(h,e){var r=e.dir||e.root,a=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+a:r+h+a:a}var d={resolve:function(){for(var e="",r=!1,a,i=arguments.length-1;i>=-1&&!r;i--){var c;i>=0?c=arguments[i]:(a===void 0&&(a=t.cwd()),c=a),o(c),c.length!==0&&(e=c+"/"+e,r=c.charCodeAt(0)===47);}return e=n(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(o(e),e.length===0)return ".";var r=e.charCodeAt(0)===47,a=e.charCodeAt(e.length-1)===47;return e=n(e,!r),e.length===0&&!r&&(e="."),e.length>0&&a&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return o(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return ".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];o(a),a.length>0&&(e===void 0?e=a:e+="/"+a);}return e===void 0?".":d.normalize(e)},relative:function(e,r){if(o(e),o(r),e===r||(e=d.resolve(e),r=d.resolve(r),e===r))return "";for(var a=1;a<e.length&&e.charCodeAt(a)===47;++a);for(var i=e.length,c=i-a,s=1;s<r.length&&r.charCodeAt(s)===47;++s);for(var l=r.length,f=l-s,p=c<f?c:f,v=-1,m=0;m<=p;++m){if(m===p){if(f>p){if(r.charCodeAt(s+m)===47)return r.slice(s+m+1);if(m===0)return r.slice(s+m)}else c>p&&(e.charCodeAt(a+m)===47?v=m:m===0&&(v=0));break}var A=e.charCodeAt(a+m),w=r.charCodeAt(s+m);if(A!==w)break;A===47&&(v=m);}var g="";for(m=a+v+1;m<=i;++m)(m===i||e.charCodeAt(m)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(s+v):(s+=v,r.charCodeAt(s)===47&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(o(e),e.length===0)return ".";for(var r=e.charCodeAt(0),a=r===47,i=-1,c=!0,s=e.length-1;s>=1;--s)if(r=e.charCodeAt(s),r===47){if(!c){i=s;break}}else c=!1;return i===-1?a?"/":".":a&&i===1?"//":e.slice(0,i)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');o(e);var a=0,i=-1,c=!0,s;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return "";var l=r.length-1,f=-1;for(s=e.length-1;s>=0;--s){var p=e.charCodeAt(s);if(p===47){if(!c){a=s+1;break}}else f===-1&&(c=!1,f=s+1),l>=0&&(p===r.charCodeAt(l)?--l===-1&&(i=s):(l=-1,i=f));}return a===i?i=f:i===-1&&(i=e.length),e.slice(a,i)}else {for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!c){a=s+1;break}}else i===-1&&(c=!1,i=s+1);return i===-1?"":e.slice(a,i)}},extname:function(e){o(e);for(var r=-1,a=0,i=-1,c=!0,s=0,l=e.length-1;l>=0;--l){var f=e.charCodeAt(l);if(f===47){if(!c){a=l+1;break}continue}i===-1&&(c=!1,i=l+1),f===46?r===-1?r=l:s!==1&&(s=1):r!==-1&&(s=-1);}return r===-1||i===-1||s===0||s===1&&r===i-1&&r===a+1?"":e.slice(r,i)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return u("/",e)},parse:function(e){o(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var a=e.charCodeAt(0),i=a===47,c;i?(r.root="/",c=1):c=0;for(var s=-1,l=0,f=-1,p=!0,v=e.length-1,m=0;v>=c;--v){if(a=e.charCodeAt(v),a===47){if(!p){l=v+1;break}continue}f===-1&&(p=!1,f=v+1),a===46?s===-1?s=v:m!==1&&(m=1):s!==-1&&(m=-1);}return s===-1||f===-1||m===0||m===1&&s===f-1&&s===l+1?f!==-1&&(l===0&&i?r.base=r.name=e.slice(1,f):r.base=r.name=e.slice(l,f)):(l===0&&i?(r.name=e.slice(1,s),r.base=e.slice(1,f)):(r.name=e.slice(l,s),r.base=e.slice(l,f)),r.ext=e.slice(s,f)),l>0?r.dir=e.slice(0,l-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return d.posix=d,we=d,we}var nt=Pt(),kt=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;E.URL=typeof URL<"u"?URL:null;E.pathToFileURL=qt;E.fileURLToPath=Ht;E.Url;E.format;E.resolve;E.resolveObject;E.URL;var xt=92,Ut=47,Nt=97,Wt=122,Oe=kt==="win32",Ft=/\//g,Mt=/%/g,Kt=/\\/g,Vt=/\n/g,Gt=/\r/g,$t=/\t/g;function Ht(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Oe?jt(t):Bt(t)}function jt(t){let o=t.hostname,n=t.pathname;for(let u=0;u<n.length;u++)if(n[u]==="%"){let d=n.codePointAt(u+2)||32;if(n[u+1]==="2"&&d===102||n[u+1]==="5"&&d===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(Ft,"\\"),n=decodeURIComponent(n),o!=="")return `\\\\${o}${n}`;{let u=n.codePointAt(1)|32,d=n[2];if(u<Nt||u>Wt||d!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function Bt(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let o=t.pathname;for(let n=0;n<o.length;n++)if(o[n]==="%"){let u=o.codePointAt(n+2)||32;if(o[n+1]==="2"&&u===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(o)}function qt(t){let o=nt.resolve(t),n=t.charCodeAt(t.length-1);(n===Ut||Oe&&n===xt)&&o[o.length-1]!==nt.sep&&(o+="/");let u=new URL("file://");return o.includes("%")&&(o=o.replace(Mt,"%25")),!Oe&&o.includes("\\")&&(o=o.replace(Kt,"%5C")),o.includes(`
3
16
  `)&&(o=o.replace(Vt,"%0A")),o.includes("\r")&&(o=o.replace(Gt,"%0D")),o.includes(" ")&&(o=o.replace($t,"%09")),u.pathname=o,u}var Jt=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;E.URL=typeof URL<"u"?URL:null;E.pathToFileURL=lr;E.fileURLToPath=sr;E.Url;E.format;E.resolve;E.resolveObject;var ot=E.parse;E.URL;var zt=92,Qt=47,Yt=97,Zt=122,be=Jt==="win32",Xt=/\//g,er=/%/g,tr=/\\/g,rr=/\n/g,nr=/\r/g,or=/\t/g;function sr(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return be?ar(t):ir(t)}function ar(t){let o=t.hostname,n=t.pathname;for(let u=0;u<n.length;u++)if(n[u]==="%"){let d=n.codePointAt(u+2)||32;if(n[u+1]==="2"&&d===102||n[u+1]==="5"&&d===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(Xt,"\\"),n=decodeURIComponent(n),o!=="")return `\\\\${o}${n}`;{let u=n.codePointAt(1)|32,d=n[2];if(u<Yt||u>Zt||d!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function ir(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let o=t.pathname;for(let n=0;n<o.length;n++)if(o[n]==="%"){let u=o.codePointAt(n+2)||32;if(o[n+1]==="2"&&u===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(o)}function lr(t){let o=Te.resolve(t),n=t.charCodeAt(t.length-1);(n===Qt||be&&n===zt)&&o[o.length-1]!==Te.sep&&(o+="/");let u=new URL("file://");return o.includes("%")&&(o=o.replace(er,"%25")),!be&&o.includes("\\")&&(o=o.replace(tr,"%5C")),o.includes(`
4
- `)&&(o=o.replace(rr,"%0A")),o.includes("\r")&&(o=o.replace(nr,"%0D")),o.includes(" ")&&(o=o.replace(or,"%09")),u.pathname=o,u}d();c();var st=t=>({position:"relative",maxWidth:"420px",height:"565px",borderRadius:"base.borderRadius.x6",overflow:"hidden",marginLeft:"base.spacing.x2",marginRight:"base.spacing.x2",marginBottom:"base.spacing.x2",display:t?"block":"none"}),at=t=>({display:t?"block":"none"});d();c();d();c();d();c();var Le=["global.transak.com","global-stg.transak.com"],hr=1e4,mr={TRANSAK_WIDGET_OPEN:{screen:"InputScreen",control:"TransakWidgetOpen",controlType:"IframeEvent"},TRANSAK_ORDER_CREATED:{screen:"InputScreen",control:"OrderCreated",controlType:"IframeEvent"},["TRANSAK_ORDER_SUCCESSFULPROCESSING"]:{screen:"OrderInProgress",control:"PaymentProcessing",controlType:"IframeEvent"},["TRANSAK_ORDER_SUCCESSFULCOMPLETED"]:{screen:"Success",control:"PaymentCompleted",controlType:"IframeEvent"},TRANSAK_ORDER_FAILED:{screen:"Failure",control:"PaymentFailed",controlType:"IframeEvent"}},In=t=>{let{track:o}=K$1(),{userJourney:n,ref:u,walletAddress:d,isPassportWallet:h,failedToLoadTimeoutInMs:e,onFailedToLoad:r}=t,[a,i]=useState(!1),c=e||hr,s=useRef(void 0),l=A=>{i(!0),clearTimeout(s.current),s.current=void 0,t.onInit?.(A);},f=()=>{r!==void 0&&s.current===void 0&&!a&&(s.current=setTimeout(()=>{a||r();},c));},p=useCallback(A=>{let w=A.event_id,g=["TRANSAK_ORDER_SUCCESSFUL"].includes(w)?`${w}${A.data.status}`:w,D=mr?.[g]||{};Object.keys(D).length>=0&&o({...D,userJourney:n,extras:{walletAddress:d,isPassportWallet:h}});},[]),v=useCallback(A=>{switch(A.event_id){case"TRANSAK_WIDGET_INITIALISED":l(A.data);break;case"TRANSAK_WIDGET_OPEN":t.onOpen?.(A.data);break;case"TRANSAK_ORDER_CREATED":t.onOrderCreated?.(A.data);break;case"TRANSAK_ORDER_SUCCESSFUL":A.data.status==="PROCESSING"&&t.onOrderProcessing?.(A.data),A.data.status==="COMPLETED"&&t.onOrderCompleted?.(A.data);break;case"TRANSAK_ORDER_FAILED":t.onOrderFailed?.(A.data);break;}},[]),m=useCallback(A=>{let w=ot(A.origin)?.host?.toLowerCase();A.source===u?.current?.contentWindow&&w&&Le.includes(w)&&(p(A.data),v(A.data),console.log("@@@ Transak event",A));},[u]);return useEffect(()=>(window.addEventListener("message",m),()=>{clearTimeout(s.current),window.removeEventListener("message",m);}),[]),{initialised:a,onLoad:f}};var lt="transak-iframe",_r=6e3;function ct({passport:t,showIframe:o,tokenAmount:n,tokenAddress:u,showBackButton:d}){let{connectLoaderState:h}=useContext(b$1),{checkout:e,provider:r}=h,{eventTargetState:{eventTarget:a}}=useContext(aa),{t:i}=useTranslation(),{viewState:c,viewDispatch:s}=useContext(ea),[l,f]=useState(""),p=useRef(),v=!!t&&T(r),m=useMemo(()=>c.history.length>2&&c.history[c.history.length-2].type==="TOP_UP_VIEW",[c.history]),A=d||m,{track:w}=K$1(),g=async(R,F)=>{let L={userId:F.toLowerCase(),isPassportWallet:v};switch(R.event_id){case"TRANSAK_WIDGET_OPEN":w({userJourney:"OnRamp",screen:"InputScreen",control:"TransakWidgetOpen",controlType:"IframeEvent",extras:{...L}});break;case"TRANSAK_ORDER_CREATED":w({userJourney:"OnRamp",screen:"InputScreen",control:"OrderCreated",controlType:"IframeEvent",extras:{...L}});break;case"TRANSAK_ORDER_SUCCESSFUL":R.data.status==="PROCESSING"&&w({userJourney:"OnRamp",screen:"OrderInProgress",control:"PaymentProcessing",controlType:"IframeEvent",extras:{...L,transactionHash:R.data.transactionHash}}),R.data.status==="COMPLETED"&&w({userJourney:"OnRamp",screen:"Success",control:"PaymentCompleted",controlType:"IframeEvent",extras:{...L,transactionHash:R.data.transactionHash}});break;case"TRANSAK_ORDER_FAILED":w({userJourney:"OnRamp",screen:"Failure",control:"PaymentFailed",controlType:"IframeEvent",extras:{...L}});break;}},D=R=>{if(p.current&&clearTimeout(p.current),R.event_id==="TRANSAK_WIDGET_OPEN"){s({payload:{type:"UPDATE_VIEW",view:{type:"ONRAMP",data:{amount:c.view.data?.amount??n,tokenAddress:c.view.data?.tokenAddress??u}}}});return}if(R.event_id==="TRANSAK_ORDER_SUCCESSFUL"&&R.data.status==="PROCESSING"){s({payload:{type:"UPDATE_VIEW",view:{type:"IN_PROGRESS_LOADING"}}}),p.current=window.setTimeout(()=>{s({payload:{type:"UPDATE_VIEW",view:{type:"IN_PROGRESS"}}});},_r);return}if(R.event_id==="TRANSAK_ORDER_SUCCESSFUL"&&R.data.status==="COMPLETED"){s({payload:{type:"UPDATE_VIEW",view:{type:"SUCCESS",data:{transactionHash:R.data.transactionHash}}}});return}R.event_id==="TRANSAK_ORDER_FAILED"&&s({payload:{type:"UPDATE_VIEW",view:{type:"FAIL",data:{amount:n,tokenAddress:u},reason:`Transaction failed: ${R.data.statusReason}`}}});};return useEffect(()=>{if(!e||!r)return;let R="";(async()=>{let _=await(await r.getSigner()).getAddress(),I=await fetchRiskAssessment([_],e.config);if(isAddressSanctioned(I)){s({payload:{type:"UPDATE_VIEW",view:{type:"SERVICE_UNAVAILABLE_ERROR_VIEW",error:new Error("Sanctioned address")}}});return}let H={exchangeType:ExchangeType.ONRAMP,browserProvider:r,tokenAddress:u,tokenAmount:n,passport:t};f(await e.createFiatRampUrl(H)),R=await(await r.getSigner()).getAddress();})();let F=document.getElementById(lt);if(!F)return;let L=_=>{if(!F)return;let I=E.parse(_.origin)?.host?.toLowerCase();_.source===F.contentWindow&&I&&Le.includes(I)&&(g(_.data,R),D(_.data));};window.addEventListener("message",L);},[e,r,n,u,t]),O(Box,{sx:at(o),children:O(R,{header:O(oa,{title:i("views.ONRAMP.header.title"),onCloseButtonClick:()=>a$1(a),showBack:A,onBackButtonClick:()=>{a$3.sendRequestGoBackEvent(a,IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,{});}}),footerBackgroundColor:"base.color.translucent.emphasis.200",children:O(Box,{sx:st(o),children:O("iframe",{title:"Transak",id:lt,src:l,allow:"camera;microphone;fullscreen;payment",style:{height:"100%",width:"100%",border:"none",position:"absolute"}})})})})}d();c();function ut(){let{eventTargetState:{eventTarget:t}}=useContext(aa),{t:o}=useTranslation();return O(R,{testId:"order-in-progress-view",header:O(oa,{transparent:!0,onCloseButtonClick:()=>a$1(t)}),footer:O(ta,{}),heroContent:O(a$4,{}),floatHeader:!0,children:P(sa,{heading:o("views.ONRAMP.IN_PROGRESS.content.heading"),children:[o("views.ONRAMP.IN_PROGRESS.content.body1"),O("br",{}),O("br",{}),o("views.ONRAMP.IN_PROGRESS.content.body2")]})})}function Nr({amount:t,tokenAddress:o,config:n,showBackButton:u}){let{isOnRampEnabled:d,isSwapEnabled:h,isBridgeEnabled:e$1}=n,[r,a$3]=useReducer(fa,{...da,history:[]}),i=useMemo(()=>({viewState:r,viewDispatch:a$3}),[r,fa]),{connectLoaderState:c}=useContext(b$1),{checkout:s,provider:l}=c,[f,p]=useState(o),{eventTargetState:{eventTarget:v}}=useContext(aa),{t:m}=useTranslation(),A=useMemo(()=>r.view.type==="ONRAMP",[r.view.type]);return useEffect(()=>{!s||!l||(async()=>{if(!(await s.getNetworkInfo({provider:l})).isSupported)return;let g=f?.toLocaleLowerCase()===e?e:o;p(g);})();},[s,l,a$3]),P(ea.Provider,{value:i,children:[r.view.type==="LOADING_VIEW"&&O(S,{loadingText:m("views.ONRAMP.initialLoadingText")}),r.view.type==="IN_PROGRESS_LOADING"&&O(S,{loadingText:m("views.ONRAMP.IN_PROGRESS_LOADING.loading.text")}),r.view.type==="IN_PROGRESS"&&O(ut,{}),r.view.type==="SUCCESS"&&O(a,{statusText:m("views.ONRAMP.SUCCESS.text"),actionText:m("views.ONRAMP.SUCCESS.actionText"),onRenderEvent:()=>b$2(v,r.view.data.transactionHash),onActionClick:()=>a$1(v),statusType:"success",testId:"success-view"}),r.view.type==="FAIL"&&O(a,{statusText:m("views.ONRAMP.FAIL.text"),actionText:m("views.ONRAMP.FAIL.actionText"),onRenderEvent:()=>c$1(v,r.view.reason??"Transaction failed"),onActionClick:()=>{a$3({payload:{type:"UPDATE_VIEW",view:{type:"ONRAMP",data:r.view.data}}});},statusType:"failure",onCloseClick:()=>a$1(v),testId:"fail-view"}),r.view.type!=="SUCCESS"&&r.view.type!=="FAIL"&&O(ct,{passport:s?.passport,showIframe:A,tokenAmount:t??r.view.data?.amount,tokenAddress:f??r.view.data?.tokenAddress,showBackButton:u}),r.view.type==="TOP_UP_VIEW"&&O(b$3,{analytics:{userJourney:"OnRamp"},widgetEvent:IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,checkout:s,provider:l,showOnrampOption:d,showSwapOption:h,showBridgeOption:e$1,onCloseButtonClick:()=>a$1(v)}),r.view.type==="SERVICE_UNAVAILABLE_ERROR_VIEW"&&O(a$2,{onCloseClick:()=>a$1(v)})]})}export{In as a,Nr as b};
17
+ `)&&(o=o.replace(rr,"%0A")),o.includes("\r")&&(o=o.replace(nr,"%0D")),o.includes(" ")&&(o=o.replace(or,"%09")),u.pathname=o,u}d();c();var st=t=>({position:"relative",maxWidth:"420px",height:"565px",borderRadius:"base.borderRadius.x6",overflow:"hidden",marginLeft:"base.spacing.x2",marginRight:"base.spacing.x2",marginBottom:"base.spacing.x2",display:t?"block":"none"}),at=t=>({display:t?"block":"none"});d();c();d();c();d();c();var Le=["global.transak.com","global-stg.transak.com"],hr=1e4,mr={TRANSAK_WIDGET_OPEN:{screen:"InputScreen",control:"TransakWidgetOpen",controlType:"IframeEvent"},TRANSAK_ORDER_CREATED:{screen:"InputScreen",control:"OrderCreated",controlType:"IframeEvent"},["TRANSAK_ORDER_SUCCESSFULPROCESSING"]:{screen:"OrderInProgress",control:"PaymentProcessing",controlType:"IframeEvent"},["TRANSAK_ORDER_SUCCESSFULCOMPLETED"]:{screen:"Success",control:"PaymentCompleted",controlType:"IframeEvent"},TRANSAK_ORDER_FAILED:{screen:"Failure",control:"PaymentFailed",controlType:"IframeEvent"}},In=t=>{let{track:o}=K$1(),{userJourney:n,ref:u,walletAddress:d,isPassportWallet:h,failedToLoadTimeoutInMs:e,onFailedToLoad:r}=t,[a,i]=useState(!1),c=e||hr,s=useRef(void 0),l=A=>{i(!0),clearTimeout(s.current),s.current=void 0,t.onInit?.(A);},f=()=>{r!==void 0&&s.current===void 0&&!a&&(s.current=setTimeout(()=>{a||r();},c));},p=useCallback(A=>{let w=A.event_id,g=["TRANSAK_ORDER_SUCCESSFUL"].includes(w)?`${w}${A.data.status}`:w,D=mr?.[g]||{};Object.keys(D).length>=0&&o({...D,userJourney:n,extras:{walletAddress:d,isPassportWallet:h}});},[]),v=useCallback(A=>{switch(A.event_id){case"TRANSAK_WIDGET_INITIALISED":l(A.data);break;case"TRANSAK_WIDGET_OPEN":t.onOpen?.(A.data);break;case"TRANSAK_ORDER_CREATED":t.onOrderCreated?.(A.data);break;case"TRANSAK_ORDER_SUCCESSFUL":A.data.status==="PROCESSING"&&t.onOrderProcessing?.(A.data),A.data.status==="COMPLETED"&&t.onOrderCompleted?.(A.data);break;case"TRANSAK_ORDER_FAILED":t.onOrderFailed?.(A.data);break;}},[]),m=useCallback(A=>{let w=ot(A.origin)?.host?.toLowerCase();A.source===u?.current?.contentWindow&&w&&Le.includes(w)&&(p(A.data),v(A.data),console.log("@@@ Transak event",A));},[u]);return useEffect(()=>(window.addEventListener("message",m),()=>{clearTimeout(s.current),window.removeEventListener("message",m);}),[]),{initialised:a,onLoad:f}};var lt="transak-iframe",_r=6e3;function ct({passport:t,showIframe:o,tokenAmount:n,tokenAddress:u,showBackButton:d}){let{connectLoaderState:h}=useContext(b$1),{checkout:e,provider:r}=h,{eventTargetState:{eventTarget:a}}=useContext(aa),{t:i}=useTranslation(),{viewState:c,viewDispatch:s}=useContext(ea),[l,f]=useState(""),p=useRef(),v=!!t&&T(r),m=useMemo(()=>c.history.length>2&&c.history[c.history.length-2].type==="TOP_UP_VIEW",[c.history]),A=d||m,{track:w}=K$1(),g=async(R,F)=>{let L={userId:F.toLowerCase(),isPassportWallet:v};switch(R.event_id){case"TRANSAK_WIDGET_OPEN":w({userJourney:"OnRamp",screen:"InputScreen",control:"TransakWidgetOpen",controlType:"IframeEvent",extras:{...L}});break;case"TRANSAK_ORDER_CREATED":w({userJourney:"OnRamp",screen:"InputScreen",control:"OrderCreated",controlType:"IframeEvent",extras:{...L}});break;case"TRANSAK_ORDER_SUCCESSFUL":R.data.status==="PROCESSING"&&w({userJourney:"OnRamp",screen:"OrderInProgress",control:"PaymentProcessing",controlType:"IframeEvent",extras:{...L,transactionHash:R.data.transactionHash}}),R.data.status==="COMPLETED"&&w({userJourney:"OnRamp",screen:"Success",control:"PaymentCompleted",controlType:"IframeEvent",extras:{...L,transactionHash:R.data.transactionHash}});break;case"TRANSAK_ORDER_FAILED":w({userJourney:"OnRamp",screen:"Failure",control:"PaymentFailed",controlType:"IframeEvent",extras:{...L}});break;}},D=R=>{if(p.current&&clearTimeout(p.current),R.event_id==="TRANSAK_WIDGET_OPEN"){s({payload:{type:"UPDATE_VIEW",view:{type:"ONRAMP",data:{amount:c.view.data?.amount??n,tokenAddress:c.view.data?.tokenAddress??u}}}});return}if(R.event_id==="TRANSAK_ORDER_SUCCESSFUL"&&R.data.status==="PROCESSING"){s({payload:{type:"UPDATE_VIEW",view:{type:"IN_PROGRESS_LOADING"}}}),p.current=window.setTimeout(()=>{s({payload:{type:"UPDATE_VIEW",view:{type:"IN_PROGRESS"}}});},_r);return}if(R.event_id==="TRANSAK_ORDER_SUCCESSFUL"&&R.data.status==="COMPLETED"){s({payload:{type:"UPDATE_VIEW",view:{type:"SUCCESS",data:{transactionHash:R.data.transactionHash}}}});return}R.event_id==="TRANSAK_ORDER_FAILED"&&s({payload:{type:"UPDATE_VIEW",view:{type:"FAIL",data:{amount:n,tokenAddress:u},reason:`Transaction failed: ${R.data.statusReason}`}}});};return useEffect(()=>{if(!e||!r)return;let R="";(async()=>{let _=await(await r.getSigner()).getAddress(),I=await fetchRiskAssessment([_],e.config);if(isAddressSanctioned(I)){s({payload:{type:"UPDATE_VIEW",view:{type:"SERVICE_UNAVAILABLE_ERROR_VIEW",error:new Error("Sanctioned address")}}});return}let H={exchangeType:ExchangeType.ONRAMP,browserProvider:r,tokenAddress:u,tokenAmount:n,passport:t};f(await e.createFiatRampUrl(H)),R=await(await r.getSigner()).getAddress();})();let F=document.getElementById(lt);if(!F)return;let L=_=>{if(!F)return;let I=E.parse(_.origin)?.host?.toLowerCase();_.source===F.contentWindow&&I&&Le.includes(I)&&(g(_.data,R),D(_.data));};window.addEventListener("message",L);},[e,r,n,u,t]),O(Box,{sx:at(o),children:O(R,{header:O(oa,{title:i("views.ONRAMP.header.title"),onCloseButtonClick:()=>a$1(a),showBack:A,onBackButtonClick:()=>{a$3.sendRequestGoBackEvent(a,IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,{});}}),footerBackgroundColor:"base.color.translucent.emphasis.200",children:O(Box,{sx:st(o),children:O("iframe",{title:"Transak",id:lt,src:l,allow:"camera;microphone;fullscreen;payment",style:{height:"100%",width:"100%",border:"none",position:"absolute"}})})})})}d();c();function ut(){let{eventTargetState:{eventTarget:t}}=useContext(aa),{t:o}=useTranslation();return O(R,{testId:"order-in-progress-view",header:O(oa,{transparent:!0,onCloseButtonClick:()=>a$1(t)}),footer:O(ta,{}),heroContent:O(a$4,{}),floatHeader:!0,children:P(sa,{heading:o("views.ONRAMP.IN_PROGRESS.content.heading"),children:[o("views.ONRAMP.IN_PROGRESS.content.body1"),O("br",{}),O("br",{}),o("views.ONRAMP.IN_PROGRESS.content.body2")]})})}function Nr({amount:t,tokenAddress:o,config:n,showBackButton:u}){let{isOnRampEnabled:d,isSwapEnabled:h,isBridgeEnabled:e$1}=n,[r,a$3]=useReducer(fa,{...da,history:[]}),i=useMemo(()=>({viewState:r,viewDispatch:a$3}),[r,fa]),{connectLoaderState:c}=useContext(b$1),{checkout:s,provider:l}=c,[f,p]=useState(o),{eventTargetState:{eventTarget:v}}=useContext(aa),{t:m}=useTranslation(),A=useMemo(()=>r.view.type==="ONRAMP",[r.view.type]);return useEffect(()=>{!s||!l||(async()=>{if(!(await s.getNetworkInfo({provider:l})).isSupported)return;let g=f?.toLocaleLowerCase()===e?e:o;p(g);})();},[s,l,a$3]),P(ea.Provider,{value:i,children:[r.view.type==="LOADING_VIEW"&&O(S,{loadingText:m("views.ONRAMP.initialLoadingText")}),r.view.type==="IN_PROGRESS_LOADING"&&O(S,{loadingText:m("views.ONRAMP.IN_PROGRESS_LOADING.loading.text")}),r.view.type==="IN_PROGRESS"&&O(ut,{}),r.view.type==="SUCCESS"&&O(a,{statusText:m("views.ONRAMP.SUCCESS.text"),actionText:m("views.ONRAMP.SUCCESS.actionText"),onRenderEvent:()=>b$2(v,r.view.data.transactionHash),onActionClick:()=>a$1(v),statusType:"success",testId:"success-view"}),r.view.type==="FAIL"&&O(a,{statusText:m("views.ONRAMP.FAIL.text"),actionText:m("views.ONRAMP.FAIL.actionText"),onRenderEvent:()=>c$1(v,r.view.reason??"Transaction failed"),onActionClick:()=>{a$3({payload:{type:"UPDATE_VIEW",view:{type:"ONRAMP",data:r.view.data}}});},statusType:"failure",onCloseClick:()=>a$1(v),testId:"fail-view"}),r.view.type!=="SUCCESS"&&r.view.type!=="FAIL"&&O(ct,{passport:s?.passport,showIframe:A,tokenAmount:t??r.view.data?.amount,tokenAddress:f??r.view.data?.tokenAddress,showBackButton:u}),r.view.type==="TOP_UP_VIEW"&&O(b$3,{analytics:{userJourney:"OnRamp"},widgetEvent:IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,checkout:s,provider:l,showOnrampOption:d,showSwapOption:h,showBridgeOption:e$1,onCloseButtonClick:()=>a$1(v)}),r.view.type==="SERVICE_UNAVAILABLE_ERROR_VIEW"&&O(a$2,{onCloseClick:()=>a$1(v)})]})}
18
+
19
+ export { In as a, Nr as b };
@@ -1 +1,5 @@
1
- import {d,c,i}from'./chunk-QPOHDTWR.js';d();c();function p(o){return new RegExp(`^([0-9]+([.][0-9]{0,${i}})?)?$`).test(o)}export{p as a};
1
+ import { d, c, i } from './chunk-QPOHDTWR.js';
2
+
3
+ d();c();function p(o){return new RegExp(`^([0-9]+([.][0-9]{0,${i}})?)?$`).test(o)}
4
+
5
+ export { p as a };
@@ -1 +1,6 @@
1
- import {d,c as c$1}from'./chunk-QPOHDTWR.js';import {IMTBLWidgetEvents,OnRampEventType}from'@imtbl/checkout-sdk';d();c$1();function c(e){let t=new CustomEvent(IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,{detail:{type:OnRampEventType.CLOSE_WIDGET,data:{}}});console.log("close widget event:",t),e!==void 0&&e.dispatchEvent(t);}var W=(e,t)=>{let n=new CustomEvent(IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,{detail:{type:OnRampEventType.SUCCESS,data:{transactionHash:t}}});console.log("on-ramp success event:",n),e!==void 0&&e.dispatchEvent(n);},g=(e,t)=>{let n=new CustomEvent(IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,{detail:{type:OnRampEventType.FAILURE,data:{reason:t,timestamp:new Date().getTime()}}});console.log("on-ramp failed event:",n),e!==void 0&&e.dispatchEvent(n);};export{c as a,W as b,g as c};
1
+ import { d, c as c$1 } from './chunk-QPOHDTWR.js';
2
+ import { IMTBLWidgetEvents, OnRampEventType } from '@imtbl/checkout-sdk';
3
+
4
+ d();c$1();function c(e){let t=new CustomEvent(IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,{detail:{type:OnRampEventType.CLOSE_WIDGET,data:{}}});console.log("close widget event:",t),e!==void 0&&e.dispatchEvent(t);}var W=(e,t)=>{let n=new CustomEvent(IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,{detail:{type:OnRampEventType.SUCCESS,data:{transactionHash:t}}});console.log("on-ramp success event:",n),e!==void 0&&e.dispatchEvent(n);},g=(e,t)=>{let n=new CustomEvent(IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT,{detail:{type:OnRampEventType.FAILURE,data:{reason:t,timestamp:new Date().getTime()}}});console.log("on-ramp failed event:",n),e!==void 0&&e.dispatchEvent(n);};
5
+
6
+ export { c as a, W as b, g as c };