@imtbl/checkout-widgets 2.4.1 → 2.4.2-alpha.0

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 (25) hide show
  1. package/dist/browser/{AddTokensWidget-C7WvIzVB.js → AddTokensWidget-DyaSNxb9.js} +13 -13
  2. package/dist/browser/{BridgeWidget-B1Wu23zB.js → BridgeWidget-CC3HoG-f.js} +18 -18
  3. package/dist/browser/{CommerceWidget-DumWCWme.js → CommerceWidget-CTQ4KlsY.js} +171 -171
  4. package/dist/browser/{FeesBreakdown-BYJrY7h0.js → FeesBreakdown-CXCCZO8Y.js} +1 -1
  5. package/dist/browser/{OnRampWidget-DJ6lRZIv.js → OnRampWidget-D3mMWz-D.js} +5 -5
  6. package/dist/browser/{SaleWidget-CroZTFC-.js → SaleWidget-C3_vgKdS.js} +42 -42
  7. package/dist/browser/{SpendingCapHero-CwKV5CXn.js → SpendingCapHero-9hMtorO0.js} +1 -1
  8. package/dist/browser/{SwapWidget-C6I2fCpc.js → SwapWidget-B583872v.js} +15 -15
  9. package/dist/browser/{TokenImage-Bw5JLoGQ.js → TokenImage-DIQAWWQ8.js} +1 -1
  10. package/dist/browser/{TopUpView-DESM41IF.js → TopUpView-ZH8ArNep.js} +4 -4
  11. package/dist/browser/{WalletApproveHero-DZlFc1Nj.js → WalletApproveHero-OJwL-DBm.js} +3 -3
  12. package/dist/browser/{WalletWidget-hRjuhzEr.js → WalletWidget-BBu55NDF.js} +8 -8
  13. package/dist/browser/{auto-track-D__zrCK7.js → auto-track-CLMvF6S6.js} +1 -1
  14. package/dist/browser/{index-YeyP_iah.js → index-C0jRMAZA.js} +1 -1
  15. package/dist/browser/{index-CEfrmZzQ.js → index-C4XLneTe.js} +1 -1
  16. package/dist/browser/{index-DoMmAj9u.js → index-CN86wAag.js} +1 -1
  17. package/dist/browser/{index-BXlX70_L.js → index-D-N55IPR.js} +1 -1
  18. package/dist/browser/{index-CuJhn9sR.js → index-DFqiWhIF.js} +194 -194
  19. package/dist/browser/{index-BFyrNz4O.js → index-DLzYYXML.js} +2 -2
  20. package/dist/browser/{index-9wAv7OEf.js → index-VQiYAYMX.js} +1 -1
  21. package/dist/browser/{index-DQXCcnS_.js → index-lsDJnzuG.js} +1 -1
  22. package/dist/browser/index.js +1 -1
  23. package/dist/browser/{index.umd-D1wm4N7h.js → index.umd-v4vSwYO3.js} +1 -1
  24. package/dist/browser/{useInterval-BxDw5ss0.js → useInterval-Dp0AIWS5.js} +1 -1
  25. package/package.json +7 -7
@@ -1,19 +1,19 @@
1
- import { r as ro, A as Ao, o as oo, m as mo, n as no, f as fo, g as go, a as ao, E as Eo, i as io, R as Ro, l as lo, u as uo, s as so, C as Co, p as po, b as reactExports, V as ViewActions, c as parseUnits, d as Contract, e as ae, h as formatZeroAmount, j as calculateCryptoToFiat, k as useTranslation, q as dist, t as getRemoteRive, v as tt, w as jsx, x as jsxs, B as Box, H as Heading, L as Link, y as Button, S as Stack, z as SimpleLayout, D as Body, F as useAnalytics, G as EventTargetContext, I as CryptoFiatContext, J as tokenValueFormat, K as getDefaultTokenImage, U as UserJourney, M as HeaderNavigation, N as sendCloseWidgetEvent, O as orchestrationEvents$1, P as amountInputValidation, T as To, Q as useTheme, W as CloudImage, X as getRemoteImage, Y as CryptoFiatProvider, Z as ConnectLoaderContext, _ as isAddress, $ as isError, a0 as LoadingView, a1 as CryptoFiatActions, a2 as useViewState, a3 as useEventTargetState, a4 as commerceFlows, a5 as SharedViews, a6 as ErrorView, a7 as ConnectWidget, a8 as ProvidersContextProvider, a9 as PurchaseWidget, aa as ConnectLoader, ab as ViewContextProvider } from './index-CuJhn9sR.js';
2
- import { S as SelectInput, a as SwapWidget } from './SwapWidget-C6I2fCpc.js';
3
- import { B as BridgeWidget } from './BridgeWidget-B1Wu23zB.js';
4
- import OnRampWidget from './OnRampWidget-DJ6lRZIv.js';
5
- import WalletWidget from './WalletWidget-hRjuhzEr.js';
6
- import SaleWidget from './SaleWidget-CroZTFC-.js';
7
- import AddTokensWidget from './AddTokensWidget-C7WvIzVB.js';
8
- import { g as getAllowedBalances, T as TextInputForm } from './WalletApproveHero-DZlFc1Nj.js';
9
- import './useInterval-BxDw5ss0.js';
10
- import './TopUpView-DESM41IF.js';
11
- import './FeesBreakdown-BYJrY7h0.js';
12
- import './SpendingCapHero-CwKV5CXn.js';
13
- import './TokenImage-Bw5JLoGQ.js';
1
+ import { o as oo, w as wo, n as no, g as go, a as ao, E as Eo, f as fo, i as io, R as Ro, s as so, C as Co, p as po, m as mo, c as co, T as To, u as uo, r as reactExports, V as ViewActions, b as parseUnits, d as Contract, e as ae, h as formatZeroAmount, j as calculateCryptoToFiat, k as useTranslation, l as dist, q as getRemoteRive, t as tt, v as jsx, x as jsxs, B as Box, H as Heading, L as Link, y as Button, S as Stack, z as SimpleLayout, A as Body, D as useAnalytics, F as EventTargetContext, G as CryptoFiatContext, I as tokenValueFormat, J as getDefaultTokenImage, U as UserJourney, K as HeaderNavigation, M as sendCloseWidgetEvent, N as orchestrationEvents$1, O as amountInputValidation, P as Io, Q as useTheme, W as CloudImage, X as getRemoteImage, Y as CryptoFiatProvider, Z as ConnectLoaderContext, _ as isAddress, $ as isError, a0 as LoadingView, a1 as CryptoFiatActions, a2 as useViewState, a3 as useEventTargetState, a4 as commerceFlows, a5 as SharedViews, a6 as ErrorView, a7 as ConnectWidget, a8 as ProvidersContextProvider, a9 as PurchaseWidget, aa as ConnectLoader, ab as ViewContextProvider } from './index-DFqiWhIF.js';
2
+ import { S as SelectInput, a as SwapWidget } from './SwapWidget-B583872v.js';
3
+ import { B as BridgeWidget } from './BridgeWidget-CC3HoG-f.js';
4
+ import OnRampWidget from './OnRampWidget-D3mMWz-D.js';
5
+ import WalletWidget from './WalletWidget-BBu55NDF.js';
6
+ import SaleWidget from './SaleWidget-C3_vgKdS.js';
7
+ import AddTokensWidget from './AddTokensWidget-DyaSNxb9.js';
8
+ import { g as getAllowedBalances, T as TextInputForm } from './WalletApproveHero-OJwL-DBm.js';
9
+ import './useInterval-Dp0AIWS5.js';
10
+ import './TopUpView-ZH8ArNep.js';
11
+ import './FeesBreakdown-CXCCZO8Y.js';
12
+ import './SpendingCapHero-9hMtorO0.js';
13
+ import './TokenImage-DIQAWWQ8.js';
14
14
 
15
15
  const sendCheckoutEvent = (eventTarget, detail) => {
16
- const event = new CustomEvent(ro.IMTBL_COMMERCE_WIDGET_EVENT, { detail });
16
+ const event = new CustomEvent(oo.IMTBL_COMMERCE_WIDGET_EVENT, { detail });
17
17
  // eslint-disable-next-line no-console
18
18
  console.log('checkout app event ', eventTarget, event);
19
19
  if (eventTarget !== undefined)
@@ -24,18 +24,18 @@ const sendCheckoutEvent = (eventTarget, detail) => {
24
24
  * List of views that require a connect loader wrapper
25
25
  */
26
26
  const connectLoaderFlows = [
27
- Ao.SALE,
28
- Ao.SWAP,
29
- Ao.WALLET,
30
- Ao.ONRAMP,
31
- Ao.TRANSFER,
27
+ wo.SALE,
28
+ wo.SWAP,
29
+ wo.WALLET,
30
+ wo.ONRAMP,
31
+ wo.TRANSFER,
32
32
  ];
33
33
  /**
34
34
  * List of views that require a providers context wrapper
35
35
  */
36
36
  const providersContextFlows = [
37
- Ao.ADD_TOKENS,
38
- Ao.PURCHASE,
37
+ wo.ADD_TOKENS,
38
+ wo.PURCHASE,
39
39
  ];
40
40
  /**
41
41
  * Check if the given view requires a connected wallet
@@ -56,25 +56,25 @@ function isProvidersContextFlow(view) {
56
56
  function mapConnectWidgetEvent(event) {
57
57
  const { type, data } = event.detail;
58
58
  switch (type) {
59
- case no.SUCCESS:
59
+ case ao.SUCCESS:
60
60
  return {
61
- type: mo.SUCCESS,
61
+ type: go.SUCCESS,
62
62
  data: {
63
- type: go.CONNECT_SUCCESS,
63
+ type: fo.CONNECT_SUCCESS,
64
64
  data,
65
65
  },
66
66
  };
67
- case no.FAILURE:
67
+ case ao.FAILURE:
68
68
  return {
69
- type: mo.FAILURE,
69
+ type: go.FAILURE,
70
70
  data: {
71
- type: fo.CONNECT_FAILED,
71
+ type: Eo.CONNECT_FAILED,
72
72
  data,
73
73
  },
74
74
  };
75
- case no.CLOSE_WIDGET:
75
+ case ao.CLOSE_WIDGET:
76
76
  return {
77
- type: mo.CLOSE,
77
+ type: go.CLOSE,
78
78
  data: {},
79
79
  };
80
80
  default:
@@ -87,22 +87,22 @@ function mapConnectWidgetEvent(event) {
87
87
  function mapWalletWidgetEvent(event) {
88
88
  const { type, data } = event.detail;
89
89
  switch (type) {
90
- case ao.NETWORK_SWITCH:
90
+ case io.NETWORK_SWITCH:
91
91
  return {
92
- type: mo.USER_ACTION,
92
+ type: go.USER_ACTION,
93
93
  data: {
94
- type: Eo.NETWORK_SWITCH,
94
+ type: Ro.NETWORK_SWITCH,
95
95
  data,
96
96
  },
97
97
  };
98
- case ao.DISCONNECT_WALLET:
98
+ case io.DISCONNECT_WALLET:
99
99
  return {
100
- type: mo.DISCONNECTED,
100
+ type: go.DISCONNECTED,
101
101
  data: {},
102
102
  };
103
- case ao.CLOSE_WIDGET:
103
+ case io.CLOSE_WIDGET:
104
104
  return {
105
- type: mo.CLOSE,
105
+ type: go.CLOSE,
106
106
  data: {},
107
107
  };
108
108
  default:
@@ -115,33 +115,33 @@ function mapWalletWidgetEvent(event) {
115
115
  function mapSwapWidgetEvent(event) {
116
116
  const { type, data } = event.detail;
117
117
  switch (type) {
118
- case io.SUCCESS:
118
+ case so.SUCCESS:
119
119
  return {
120
- type: mo.SUCCESS,
120
+ type: go.SUCCESS,
121
121
  data: {
122
- type: go.SWAP_SUCCESS,
122
+ type: fo.SWAP_SUCCESS,
123
123
  data,
124
124
  },
125
125
  };
126
- case io.FAILURE:
126
+ case so.FAILURE:
127
127
  return {
128
- type: mo.FAILURE,
128
+ type: go.FAILURE,
129
129
  data: {
130
- type: fo.SWAP_FAILED,
130
+ type: Eo.SWAP_FAILED,
131
131
  data,
132
132
  },
133
133
  };
134
- case io.REJECTED:
134
+ case so.REJECTED:
135
135
  return {
136
- type: mo.FAILURE,
136
+ type: go.FAILURE,
137
137
  data: {
138
- type: fo.SWAP_REJECTED,
138
+ type: Eo.SWAP_REJECTED,
139
139
  data,
140
140
  },
141
141
  };
142
- case io.CLOSE_WIDGET:
142
+ case so.CLOSE_WIDGET:
143
143
  return {
144
- type: mo.CLOSE,
144
+ type: go.CLOSE,
145
145
  data: {},
146
146
  };
147
147
  default:
@@ -154,33 +154,33 @@ function mapSwapWidgetEvent(event) {
154
154
  function mapAddTokensWidgetEvent(event) {
155
155
  const { type } = event.detail;
156
156
  switch (type) {
157
- case Ro.SUCCESS:
157
+ case Co.SUCCESS:
158
158
  return {
159
- type: mo.SUCCESS,
159
+ type: go.SUCCESS,
160
160
  data: {
161
- type: go.ADD_TOKENS_SUCCESS,
161
+ type: fo.ADD_TOKENS_SUCCESS,
162
162
  data: event.detail.data,
163
163
  },
164
164
  };
165
- case Ro.CONNECT_SUCCESS:
165
+ case Co.CONNECT_SUCCESS:
166
166
  return {
167
- type: mo.SUCCESS,
167
+ type: go.SUCCESS,
168
168
  data: {
169
- type: go.ADD_TOKENS_CONNECT_SUCCESS,
169
+ type: fo.ADD_TOKENS_CONNECT_SUCCESS,
170
170
  data: event.detail.data,
171
171
  },
172
172
  };
173
- case Ro.FAILURE:
173
+ case Co.FAILURE:
174
174
  return {
175
- type: mo.FAILURE,
175
+ type: go.FAILURE,
176
176
  data: {
177
- type: fo.ADD_TOKENS_FAILED,
177
+ type: Eo.ADD_TOKENS_FAILED,
178
178
  data: event.detail.data,
179
179
  },
180
180
  };
181
- case Ro.CLOSE_WIDGET:
181
+ case Co.CLOSE_WIDGET:
182
182
  return {
183
- type: mo.CLOSE,
183
+ type: go.CLOSE,
184
184
  data: {},
185
185
  };
186
186
  default:
@@ -193,41 +193,41 @@ function mapAddTokensWidgetEvent(event) {
193
193
  function mapBridgeWidgetEvent(event) {
194
194
  const { type, data } = event.detail;
195
195
  switch (type) {
196
- case lo.TRANSACTION_SENT:
196
+ case po.TRANSACTION_SENT:
197
197
  return {
198
- type: mo.SUCCESS,
198
+ type: go.SUCCESS,
199
199
  data: {
200
- type: go.BRIDGE_SUCCESS,
200
+ type: fo.BRIDGE_SUCCESS,
201
201
  data,
202
202
  },
203
203
  };
204
- case lo.CLAIM_WITHDRAWAL_SUCCESS:
204
+ case po.CLAIM_WITHDRAWAL_SUCCESS:
205
205
  return {
206
- type: mo.SUCCESS,
206
+ type: go.SUCCESS,
207
207
  data: {
208
- type: go.BRIDGE_CLAIM_WITHDRAWAL_SUCCESS,
208
+ type: fo.BRIDGE_CLAIM_WITHDRAWAL_SUCCESS,
209
209
  data,
210
210
  },
211
211
  };
212
- case lo.CLAIM_WITHDRAWAL_FAILURE:
212
+ case po.CLAIM_WITHDRAWAL_FAILURE:
213
213
  return {
214
- type: mo.FAILURE,
214
+ type: go.FAILURE,
215
215
  data: {
216
- type: fo.BRIDGE_CLAIM_WITHDRAWAL_FAILED,
216
+ type: Eo.BRIDGE_CLAIM_WITHDRAWAL_FAILED,
217
217
  data,
218
218
  },
219
219
  };
220
- case lo.FAILURE:
220
+ case po.FAILURE:
221
221
  return {
222
- type: mo.FAILURE,
222
+ type: go.FAILURE,
223
223
  data: {
224
- type: fo.BRIDGE_FAILED,
224
+ type: Eo.BRIDGE_FAILED,
225
225
  data,
226
226
  },
227
227
  };
228
- case lo.CLOSE_WIDGET:
228
+ case po.CLOSE_WIDGET:
229
229
  return {
230
- type: mo.CLOSE,
230
+ type: go.CLOSE,
231
231
  data: {},
232
232
  };
233
233
  default:
@@ -240,25 +240,25 @@ function mapBridgeWidgetEvent(event) {
240
240
  function mapOnrampWidgetEvent(event) {
241
241
  const { type, data } = event.detail;
242
242
  switch (type) {
243
- case uo.SUCCESS:
243
+ case mo.SUCCESS:
244
244
  return {
245
- type: mo.SUCCESS,
245
+ type: go.SUCCESS,
246
246
  data: {
247
- type: go.ONRAMP_SUCCESS,
247
+ type: fo.ONRAMP_SUCCESS,
248
248
  data,
249
249
  },
250
250
  };
251
- case uo.FAILURE:
251
+ case mo.FAILURE:
252
252
  return {
253
- type: mo.FAILURE,
253
+ type: go.FAILURE,
254
254
  data: {
255
- type: fo.ONRAMP_FAILED,
255
+ type: Eo.ONRAMP_FAILED,
256
256
  data,
257
257
  },
258
258
  };
259
- case uo.CLOSE_WIDGET:
259
+ case mo.CLOSE_WIDGET:
260
260
  return {
261
- type: mo.CLOSE,
261
+ type: go.CLOSE,
262
262
  data: {},
263
263
  };
264
264
  default:
@@ -268,48 +268,48 @@ function mapOnrampWidgetEvent(event) {
268
268
  function mapSaleWidgetEvent(event) {
269
269
  const { type, data } = event.detail;
270
270
  switch (type) {
271
- case so.SUCCESS:
271
+ case co.SUCCESS:
272
272
  return {
273
- type: mo.SUCCESS,
273
+ type: go.SUCCESS,
274
274
  data: {
275
- type: go.SALE_SUCCESS,
275
+ type: fo.SALE_SUCCESS,
276
276
  data,
277
277
  },
278
278
  };
279
- case so.FAILURE:
279
+ case co.FAILURE:
280
280
  return {
281
- type: mo.FAILURE,
281
+ type: go.FAILURE,
282
282
  data: {
283
- type: fo.SALE_FAILED,
283
+ type: Eo.SALE_FAILED,
284
284
  data,
285
285
  },
286
286
  };
287
- case so.CLOSE_WIDGET:
287
+ case co.CLOSE_WIDGET:
288
288
  return {
289
- type: mo.CLOSE,
289
+ type: go.CLOSE,
290
290
  data: {},
291
291
  };
292
- case so.TRANSACTION_SUCCESS:
292
+ case co.TRANSACTION_SUCCESS:
293
293
  return {
294
- type: mo.SUCCESS,
294
+ type: go.SUCCESS,
295
295
  data: {
296
- type: go.SALE_TRANSACTION_SUCCESS,
296
+ type: fo.SALE_TRANSACTION_SUCCESS,
297
297
  data,
298
298
  },
299
299
  };
300
- case so.PAYMENT_METHOD:
300
+ case co.PAYMENT_METHOD:
301
301
  return {
302
- type: mo.USER_ACTION,
302
+ type: go.USER_ACTION,
303
303
  data: {
304
- type: Eo.PAYMENT_METHOD_SELECTED,
304
+ type: Ro.PAYMENT_METHOD_SELECTED,
305
305
  data,
306
306
  },
307
307
  };
308
- case so.PAYMENT_TOKEN:
308
+ case co.PAYMENT_TOKEN:
309
309
  return {
310
- type: mo.USER_ACTION,
310
+ type: go.USER_ACTION,
311
311
  data: {
312
- type: Eo.PAYMENT_TOKEN_SELECTED,
312
+ type: Ro.PAYMENT_TOKEN_SELECTED,
313
313
  data,
314
314
  },
315
315
  };
@@ -320,25 +320,25 @@ function mapSaleWidgetEvent(event) {
320
320
  function mapPurchaseWidgetEvent(event) {
321
321
  const { type, data } = event.detail;
322
322
  switch (type) {
323
- case Co.SUCCESS:
323
+ case To.SUCCESS:
324
324
  return {
325
- type: mo.SUCCESS,
325
+ type: go.SUCCESS,
326
326
  data: {
327
- type: go.SALE_SUCCESS,
327
+ type: fo.SALE_SUCCESS,
328
328
  data,
329
329
  },
330
330
  };
331
- case Co.FAILURE:
331
+ case To.FAILURE:
332
332
  return {
333
- type: mo.FAILURE,
333
+ type: go.FAILURE,
334
334
  data: {
335
- type: fo.SALE_FAILED,
335
+ type: Eo.SALE_FAILED,
336
336
  data,
337
337
  },
338
338
  };
339
- case Co.CLOSE_WIDGET:
339
+ case To.CLOSE_WIDGET:
340
340
  return {
341
- type: mo.CLOSE,
341
+ type: go.CLOSE,
342
342
  data: {},
343
343
  };
344
344
  default:
@@ -349,28 +349,28 @@ function mapPurchaseWidgetEvent(event) {
349
349
  * Map widget events to commerce widget event detail
350
350
  */
351
351
  function getCommerceWidgetEvent(event) {
352
- if (event.detail.type === oo.PROVIDER_UPDATED) {
352
+ if (event.detail.type === no.PROVIDER_UPDATED) {
353
353
  return {
354
- type: mo.PROVIDER_UPDATED,
354
+ type: go.PROVIDER_UPDATED,
355
355
  data: event.detail.data,
356
356
  };
357
357
  }
358
358
  switch (event.type) {
359
- case ro.IMTBL_CONNECT_WIDGET_EVENT:
359
+ case oo.IMTBL_CONNECT_WIDGET_EVENT:
360
360
  return mapConnectWidgetEvent(event);
361
- case ro.IMTBL_WALLET_WIDGET_EVENT:
361
+ case oo.IMTBL_WALLET_WIDGET_EVENT:
362
362
  return mapWalletWidgetEvent(event);
363
- case ro.IMTBL_SWAP_WIDGET_EVENT:
363
+ case oo.IMTBL_SWAP_WIDGET_EVENT:
364
364
  return mapSwapWidgetEvent(event);
365
- case ro.IMTBL_ADD_TOKENS_WIDGET_EVENT:
365
+ case oo.IMTBL_ADD_TOKENS_WIDGET_EVENT:
366
366
  return mapAddTokensWidgetEvent(event);
367
- case ro.IMTBL_BRIDGE_WIDGET_EVENT:
367
+ case oo.IMTBL_BRIDGE_WIDGET_EVENT:
368
368
  return mapBridgeWidgetEvent(event);
369
- case ro.IMTBL_ONRAMP_WIDGET_EVENT:
369
+ case oo.IMTBL_ONRAMP_WIDGET_EVENT:
370
370
  return mapOnrampWidgetEvent(event);
371
- case ro.IMTBL_SALE_WIDGET_EVENT:
371
+ case oo.IMTBL_SALE_WIDGET_EVENT:
372
372
  return mapSaleWidgetEvent(event);
373
- case ro.IMTBL_PURCHASE_WIDGET_EVENT:
373
+ case oo.IMTBL_PURCHASE_WIDGET_EVENT:
374
374
  return mapPurchaseWidgetEvent(event);
375
375
  default:
376
376
  throw new Error(`Unknown widget event type "${event.type}"`);
@@ -382,20 +382,20 @@ function getCommerceWidgetEvent(event) {
382
382
  */
383
383
  function getViewFromOrchestrationEventType(type) {
384
384
  switch (type) {
385
- case po.REQUEST_SWAP:
386
- return Ao.SWAP;
387
- case po.REQUEST_CONNECT:
388
- return Ao.CONNECT;
389
- case po.REQUEST_WALLET:
390
- return Ao.WALLET;
391
- case po.REQUEST_BRIDGE:
392
- return Ao.BRIDGE;
393
- case po.REQUEST_ONRAMP:
394
- return Ao.ONRAMP;
395
- case po.REQUEST_ADD_TOKENS:
396
- return Ao.ADD_TOKENS;
397
- case po.REQUEST_PURCHASE:
398
- return Ao.PURCHASE;
385
+ case uo.REQUEST_SWAP:
386
+ return wo.SWAP;
387
+ case uo.REQUEST_CONNECT:
388
+ return wo.CONNECT;
389
+ case uo.REQUEST_WALLET:
390
+ return wo.WALLET;
391
+ case uo.REQUEST_BRIDGE:
392
+ return wo.BRIDGE;
393
+ case uo.REQUEST_ONRAMP:
394
+ return wo.ONRAMP;
395
+ case uo.REQUEST_ADD_TOKENS:
396
+ return wo.ADD_TOKENS;
397
+ case uo.REQUEST_PURCHASE:
398
+ return wo.PURCHASE;
399
399
  default:
400
400
  return null;
401
401
  }
@@ -403,14 +403,14 @@ function getViewFromOrchestrationEventType(type) {
403
403
 
404
404
  /** Orchestration Events List */
405
405
  const orchestrationEvents = [
406
- po.REQUEST_CONNECT,
407
- po.REQUEST_WALLET,
408
- po.REQUEST_SWAP,
409
- po.REQUEST_BRIDGE,
410
- po.REQUEST_ONRAMP,
411
- po.REQUEST_ADD_TOKENS,
412
- po.REQUEST_PURCHASE,
413
- po.REQUEST_GO_BACK,
406
+ uo.REQUEST_CONNECT,
407
+ uo.REQUEST_WALLET,
408
+ uo.REQUEST_SWAP,
409
+ uo.REQUEST_BRIDGE,
410
+ uo.REQUEST_ONRAMP,
411
+ uo.REQUEST_ADD_TOKENS,
412
+ uo.REQUEST_PURCHASE,
413
+ uo.REQUEST_GO_BACK,
414
414
  ];
415
415
  /**
416
416
  * Check if event is orchestration event
@@ -421,14 +421,14 @@ function isOrchestrationEvent(event) {
421
421
 
422
422
  /** Widget Events List */
423
423
  const widgetEvents = [
424
- ro.IMTBL_CONNECT_WIDGET_EVENT,
425
- ro.IMTBL_WALLET_WIDGET_EVENT,
426
- ro.IMTBL_SWAP_WIDGET_EVENT,
427
- ro.IMTBL_BRIDGE_WIDGET_EVENT,
428
- ro.IMTBL_ONRAMP_WIDGET_EVENT,
429
- ro.IMTBL_SALE_WIDGET_EVENT,
430
- ro.IMTBL_ADD_TOKENS_WIDGET_EVENT,
431
- ro.IMTBL_PURCHASE_WIDGET_EVENT,
424
+ oo.IMTBL_CONNECT_WIDGET_EVENT,
425
+ oo.IMTBL_WALLET_WIDGET_EVENT,
426
+ oo.IMTBL_SWAP_WIDGET_EVENT,
427
+ oo.IMTBL_BRIDGE_WIDGET_EVENT,
428
+ oo.IMTBL_ONRAMP_WIDGET_EVENT,
429
+ oo.IMTBL_SALE_WIDGET_EVENT,
430
+ oo.IMTBL_ADD_TOKENS_WIDGET_EVENT,
431
+ oo.IMTBL_PURCHASE_WIDGET_EVENT,
432
432
  ];
433
433
  /**
434
434
  * Subscribe and Handle widget events
@@ -440,7 +440,7 @@ function useWidgetEvents(eventTarget, viewState, handleProviderUpdated) {
440
440
  */
441
441
  const handleOrchestrationEvent = (event) => {
442
442
  const { type, data } = event.detail;
443
- if (type === po.REQUEST_GO_BACK) {
443
+ if (type === uo.REQUEST_GO_BACK) {
444
444
  viewDispatch({
445
445
  payload: {
446
446
  type: ViewActions.UPDATE_VIEW,
@@ -449,7 +449,7 @@ function useWidgetEvents(eventTarget, viewState, handleProviderUpdated) {
449
449
  });
450
450
  return;
451
451
  }
452
- if (type === po.REQUEST_ONRAMP) {
452
+ if (type === uo.REQUEST_ONRAMP) {
453
453
  const onRampEvent = data;
454
454
  if (onRampEvent.provider) {
455
455
  handleProviderUpdated(onRampEvent.provider);
@@ -483,7 +483,7 @@ function useWidgetEvents(eventTarget, viewState, handleProviderUpdated) {
483
483
  // ignore walletconnect provider updated event on CONNECT
484
484
  // as that is not really consumed and the provider is available to the consumer on success event
485
485
  // GFI-596
486
- const isConnectProviderUpdatedEvent = customEvent.detail.type === no.WALLETCONNECT_PROVIDER_UPDATED;
486
+ const isConnectProviderUpdatedEvent = customEvent.detail.type === ao.WALLETCONNECT_PROVIDER_UPDATED;
487
487
  if (isConnectProviderUpdatedEvent) {
488
488
  return;
489
489
  }
@@ -507,7 +507,7 @@ function useWidgetEvents(eventTarget, viewState, handleProviderUpdated) {
507
507
  function getConnectLoaderParams(view, checkout, browserProvider) {
508
508
  const { type } = view;
509
509
  switch (type) {
510
- case Ao.WALLET:
510
+ case wo.WALLET:
511
511
  return {
512
512
  checkout,
513
513
  browserProvider,
@@ -517,8 +517,8 @@ function getConnectLoaderParams(view, checkout, browserProvider) {
517
517
  checkout.config.l2ChainId,
518
518
  ],
519
519
  };
520
- case Ao.ONRAMP:
521
- case Ao.ADD_TOKENS:
520
+ case wo.ONRAMP:
521
+ case wo.ADD_TOKENS:
522
522
  return {
523
523
  checkout,
524
524
  browserProvider,
@@ -528,9 +528,9 @@ function getConnectLoaderParams(view, checkout, browserProvider) {
528
528
  checkout.config.l2ChainId,
529
529
  ],
530
530
  };
531
- case Ao.SALE:
532
- case Ao.SWAP:
533
- case Ao.TRANSFER:
531
+ case wo.SALE:
532
+ case wo.SWAP:
533
+ case wo.TRANSFER:
534
534
  return {
535
535
  checkout,
536
536
  browserProvider,
@@ -740,7 +740,7 @@ function TransferForm({ config, viewState, setViewState, onSend, showBackButton,
740
740
  }, [token]);
741
741
  const isButtonDisabled = reactExports.useMemo(() => !viewState.amount || !viewState.toAddress || !token, [viewState.amount, viewState.toAddress, token]);
742
742
  return (jsx(SimpleLayout, { header: (jsx(HeaderNavigation, { title: t('views.TRANSFER.header.title'), onCloseButtonClick: () => sendCloseWidgetEvent(eventTarget), showBack: showBackButton, onBackButtonClick: () => {
743
- orchestrationEvents$1.sendRequestGoBackEvent(eventTarget, ro.IMTBL_TRANSFER_WIDGET_EVENT, {});
743
+ orchestrationEvents$1.sendRequestGoBackEvent(eventTarget, oo.IMTBL_TRANSFER_WIDGET_EVENT, {});
744
744
  } })), children: jsxs(Stack, { justifyContent: "space-between", sx: {
745
745
  height: '100%',
746
746
  mt: 'base.spacing.x6',
@@ -750,9 +750,9 @@ function TransferForm({ config, viewState, setViewState, onSend, showBackButton,
750
750
  }
751
751
 
752
752
  const sendSuccessEvent = (eventTarget, transactionHash) => {
753
- const successEvent = new CustomEvent(ro.IMTBL_TRANSFER_WIDGET_EVENT, {
753
+ const successEvent = new CustomEvent(oo.IMTBL_TRANSFER_WIDGET_EVENT, {
754
754
  detail: {
755
- type: To.SUCCESS,
755
+ type: Io.SUCCESS,
756
756
  data: {
757
757
  transactionHash,
758
758
  },
@@ -764,9 +764,9 @@ const sendSuccessEvent = (eventTarget, transactionHash) => {
764
764
  eventTarget.dispatchEvent(successEvent);
765
765
  };
766
766
  const sendFailedEvent = (eventTarget, reason) => {
767
- const failedEvent = new CustomEvent(ro.IMTBL_TRANSFER_WIDGET_EVENT, {
767
+ const failedEvent = new CustomEvent(oo.IMTBL_TRANSFER_WIDGET_EVENT, {
768
768
  detail: {
769
- type: To.FAILURE,
769
+ type: Io.FAILURE,
770
770
  data: {
771
771
  reason,
772
772
  timestamp: new Date().getTime(),
@@ -779,9 +779,9 @@ const sendFailedEvent = (eventTarget, reason) => {
779
779
  eventTarget.dispatchEvent(failedEvent);
780
780
  };
781
781
  const sendRejectedEvent = (eventTarget, reason) => {
782
- const rejectedEvent = new CustomEvent(ro.IMTBL_TRANSFER_WIDGET_EVENT, {
782
+ const rejectedEvent = new CustomEvent(oo.IMTBL_TRANSFER_WIDGET_EVENT, {
783
783
  detail: {
784
- type: To.REJECTED,
784
+ type: Io.REJECTED,
785
785
  data: {
786
786
  reason,
787
787
  timestamp: new Date().getTime(),
@@ -958,8 +958,8 @@ function CommerceWidget(props) {
958
958
  const commerceReducerValues = reactExports.useMemo(() => ({ commerceState, commerceDispatch }), [commerceState, commerceDispatch]);
959
959
  const { provider } = commerceState;
960
960
  const connectLoaderParams = reactExports.useMemo(() => getConnectLoaderParams(view, checkout, provider || browserProvider), [view, checkout, provider, browserProvider]);
961
- const connectLoaderSuccessEvent = (flowParams.flow === Ao.ADD_TOKENS
962
- || flowParams.flow === Ao.PURCHASE) ? () => { } : undefined;
961
+ const connectLoaderSuccessEvent = (flowParams.flow === wo.ADD_TOKENS
962
+ || flowParams.flow === wo.PURCHASE) ? () => { } : undefined;
963
963
  const goToPreviousView = reactExports.useCallback(() => {
964
964
  const sharedViews = [
965
965
  SharedViews.LOADING_VIEW,
@@ -1057,28 +1057,28 @@ function CommerceWidget(props) {
1057
1057
  const showBackButton = !!view.data?.showBackButton;
1058
1058
  return (jsx(ViewContextProvider, { children: jsxs(CommerceContext.Provider, { value: commerceReducerValues, children: [view.type === SharedViews.LOADING_VIEW && (jsx(LoadingView, { loadingText: t('views.LOADING_VIEW.text') })), view.type === SharedViews.ERROR_VIEW && (jsx(ErrorView, { onCloseClick: () => {
1059
1059
  sendCheckoutEvent(eventTarget, {
1060
- type: mo.CLOSE,
1060
+ type: go.CLOSE,
1061
1061
  data: {},
1062
1062
  });
1063
1063
  }, onActionClick: () => {
1064
1064
  // TODO: trigger a retry
1065
- }, actionText: t('views.ERROR_VIEW.actionText') })), view.type === Ao.CONNECT && (jsx(ConnectWidget, { config: widgetsConfig, checkout: checkout, sendCloseEventOverride: () => {
1065
+ }, actionText: t('views.ERROR_VIEW.actionText') })), view.type === wo.CONNECT && (jsx(ConnectWidget, { config: widgetsConfig, checkout: checkout, sendCloseEventOverride: () => {
1066
1066
  sendCheckoutEvent(eventTarget, {
1067
- type: mo.CLOSE,
1067
+ type: go.CLOSE,
1068
1068
  data: {},
1069
1069
  });
1070
- }, ...(view.data.params || {}) })), view.type === Ao.BRIDGE && (jsx(BridgeWidget, { config: widgetsConfig, checkout: checkout, browserProvider: browserProvider, showBackButton: showBackButton, ...(view.data.params || {}) })), shouldWrapWithProvidersContext && view.type === Ao.ADD_TOKENS && (jsx(ProvidersContextProvider, { initialState: { checkout, toProvider: view.data.params.toProvider }, children: jsx(AddTokensWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }) })), shouldWrapWithProvidersContext && view.type === Ao.PURCHASE && (jsx(ProvidersContextProvider, { initialState: { checkout }, children: jsx(PurchaseWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }) })), shouldWrapWithConnectLoader && (jsx(ConnectLoader, { widgetConfig: widgetsConfig, params: connectLoaderParams, successEvent: connectLoaderSuccessEvent, closeEvent: () => {
1070
+ }, ...(view.data.params || {}) })), view.type === wo.BRIDGE && (jsx(BridgeWidget, { config: widgetsConfig, checkout: checkout, browserProvider: browserProvider, showBackButton: showBackButton, ...(view.data.params || {}) })), shouldWrapWithProvidersContext && view.type === wo.ADD_TOKENS && (jsx(ProvidersContextProvider, { initialState: { checkout, toProvider: view.data.params.toProvider }, children: jsx(AddTokensWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }) })), shouldWrapWithProvidersContext && view.type === wo.PURCHASE && (jsx(ProvidersContextProvider, { initialState: { checkout }, children: jsx(PurchaseWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }) })), shouldWrapWithConnectLoader && (jsx(ConnectLoader, { widgetConfig: widgetsConfig, params: connectLoaderParams, successEvent: connectLoaderSuccessEvent, closeEvent: () => {
1071
1071
  sendCheckoutEvent(eventTarget, {
1072
- type: mo.CLOSE,
1072
+ type: go.CLOSE,
1073
1073
  data: {},
1074
1074
  });
1075
- }, showBackButton: showBackButton, goBackEvent: goToPreviousView, children: jsxs(reactExports.Suspense, { fallback: jsx(LoadingView, { loadingText: t('views.LOADING_VIEW.text') }), children: [view.type === Ao.WALLET && (jsx(WalletWidget, { config: widgetsConfig, walletConfig: {
1075
+ }, showBackButton: showBackButton, goBackEvent: goToPreviousView, children: jsxs(reactExports.Suspense, { fallback: jsx(LoadingView, { loadingText: t('views.LOADING_VIEW.text') }), children: [view.type === wo.WALLET && (jsx(WalletWidget, { config: widgetsConfig, walletConfig: {
1076
1076
  showNetworkMenu: true,
1077
1077
  showDisconnectButton: true,
1078
1078
  ...view.data.config,
1079
- }, ...(view.data.params || {}) })), view.type === Ao.SALE && (jsx(SaleWidget, { config: widgetsConfig, ...(view.data.params || {}), hideExcludedPaymentTypes: false,
1079
+ }, ...(view.data.params || {}) })), view.type === wo.SALE && (jsx(SaleWidget, { config: widgetsConfig, ...(view.data.params || {}), hideExcludedPaymentTypes: false,
1080
1080
  waitFulfillmentSettlements: true,
1081
- ...view.data.config })), view.type === Ao.SWAP && (jsx(SwapWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton })), view.type === Ao.ONRAMP && (jsx(OnRampWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton })), view.type === Ao.TRANSFER && (jsx(TransferWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }))] }) }))] }) }));
1081
+ ...view.data.config })), view.type === wo.SWAP && (jsx(SwapWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton })), view.type === wo.ONRAMP && (jsx(OnRampWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton })), view.type === wo.TRANSFER && (jsx(TransferWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }))] }) }))] }) }));
1082
1082
  }
1083
1083
 
1084
1084
  export { CommerceWidget as default };