@shipengine/elements 0.25.0 → 0.26.1

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 (53) hide show
  1. package/index.cjs +1147 -663
  2. package/index.js +1154 -677
  3. package/package.json +12 -4
  4. package/src/components/field/field.styles.d.ts +2 -12
  5. package/src/components/index.d.ts +1 -0
  6. package/src/components/label-layout/label-layout-settings.d.ts +3 -1
  7. package/src/components/powered-by-shipengine/index.d.ts +1 -0
  8. package/src/components/powered-by-shipengine/powered-by-shipengine.d.ts +1 -0
  9. package/src/components/powered-by-shipengine/powered-by-shipengine.styles.d.ts +11 -0
  10. package/src/components/save-status/index.d.ts +2 -0
  11. package/src/components/save-status/save-status-styles.d.ts +43 -0
  12. package/src/components/save-status/save-status.d.ts +6 -0
  13. package/src/components/templates/index.d.ts +0 -1
  14. package/src/components/templates/rate-form/rate-form.d.ts +1 -0
  15. package/src/constants/shipengine/address.d.ts +2 -0
  16. package/src/elements/list-carriers/list-carriers.d.ts +28 -14
  17. package/src/elements/manage-warehouses/manage-warehouses.d.ts +28 -14
  18. package/src/elements/onboarding/onboarding.d.ts +28 -14
  19. package/src/elements/purchase-label/hooks/use-load-or-create-shipment.d.ts +6 -0
  20. package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +5 -2
  21. package/src/elements/purchase-label/purchase-label.d.ts +40 -20
  22. package/src/elements/view-shipment/view-shipment.d.ts +28 -14
  23. package/src/{components/templates/void-label/void-label.d.ts → elements/void-label/components/actions/actions.d.ts} +3 -3
  24. package/src/elements/void-label/components/actions/index.d.ts +1 -0
  25. package/src/elements/void-label/components/index.d.ts +2 -0
  26. package/src/elements/void-label/components/message/index.d.ts +1 -0
  27. package/src/elements/void-label/components/message/message.d.ts +6 -0
  28. package/src/elements/void-label/void-label.d.ts +28 -14
  29. package/src/hooks/options/index.d.ts +1 -0
  30. package/src/hooks/options/use-package-options.d.ts +1 -1
  31. package/src/hooks/options/use-service-code-options.d.ts +1 -1
  32. package/src/hooks/options/use-shipment-metadata.d.ts +8 -0
  33. package/src/hooks/options/use-shipping-presets-options.d.ts +2 -1
  34. package/src/hooks/use-get-or-create-shipment.d.ts +2 -0
  35. package/src/locales/en/index.d.ts +28 -14
  36. package/src/mocks/server.d.ts +1 -0
  37. package/src/testing/extensions/index.d.ts +2 -0
  38. package/src/testing/extensions/matchers/extend-matchers.d.ts +8 -0
  39. package/src/testing/extensions/matchers/index.d.ts +1 -0
  40. package/src/testing/extensions/matchers/matchers.d.ts +1 -0
  41. package/src/testing/extensions/matchers/to-have-loading-spinner.d.ts +2 -0
  42. package/src/testing/extensions/queries/by-icon-name.d.ts +4 -0
  43. package/src/testing/extensions/queries/index.d.ts +57 -0
  44. package/src/testing/extensions/queries/queries.d.ts +1 -0
  45. package/src/testing/index.d.ts +1 -1
  46. package/src/testing/test-utils.d.ts +292 -0
  47. package/src/utilities/error.d.ts +13 -0
  48. package/src/utilities/i18nDateUtils.d.ts +16 -0
  49. package/src/utilities/shipengine/address.d.ts +4 -0
  50. package/src/utilities/shipengine/carrier.d.ts +1 -0
  51. package/src/components/templates/void-label/index.d.ts +0 -1
  52. package/src/public-sdk.d.ts +0 -38
  53. package/src/testing/render.d.ts +0 -6
package/index.cjs CHANGED
@@ -15,8 +15,10 @@ var react = require('@emotion/react');
15
15
  var humps = require('humps');
16
16
  var ReactDatePicker = require('react-datepicker');
17
17
  var gigerTheme = require('@packlink/giger-theme');
18
+ var dateFns = require('date-fns');
19
+ var Locales = require('date-fns/locale');
18
20
  var css = require('@emotion/css');
19
- var _$2 = require('lodash');
21
+ var _$3 = require('lodash');
20
22
  var reactDom = require('react-dom');
21
23
  var min$3 = require('libphonenumber-js/min');
22
24
  var copy = require('copy-to-clipboard');
@@ -24,6 +26,7 @@ var jsBase64 = require('js-base64');
24
26
  var cardValidator = require('card-validator');
25
27
  var reactQuery = require('react-query');
26
28
  var brands = require('@packlink/brands');
29
+ var reactApi = require('@shipengine/react-api');
27
30
 
28
31
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
29
32
 
@@ -49,7 +52,8 @@ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
49
52
  var alchemy__default = /*#__PURE__*/_interopDefaultLegacy(alchemy);
50
53
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
51
54
  var ReactDatePicker__default = /*#__PURE__*/_interopDefaultLegacy(ReactDatePicker);
52
- var ___default = /*#__PURE__*/_interopDefaultLegacy(_$2);
55
+ var Locales__namespace = /*#__PURE__*/_interopNamespace(Locales);
56
+ var ___default = /*#__PURE__*/_interopDefaultLegacy(_$3);
53
57
  var copy__default = /*#__PURE__*/_interopDefaultLegacy(copy);
54
58
  var cardValidator__default = /*#__PURE__*/_interopDefaultLegacy(cardValidator);
55
59
 
@@ -99,10 +103,10 @@ var functionBindNative = !fails$o(function () {
99
103
 
100
104
  var NATIVE_BIND$3 = functionBindNative;
101
105
 
102
- var call$j = Function.prototype.call;
106
+ var call$k = Function.prototype.call;
103
107
 
104
- var functionCall = NATIVE_BIND$3 ? call$j.bind(call$j) : function () {
105
- return call$j.apply(call$j, arguments);
108
+ var functionCall = NATIVE_BIND$3 ? call$k.bind(call$k) : function () {
109
+ return call$k.apply(call$k, arguments);
106
110
  };
107
111
 
108
112
  var objectPropertyIsEnumerable = {};
@@ -133,30 +137,30 @@ var createPropertyDescriptor$4 = function (bitmap, value) {
133
137
  var NATIVE_BIND$2 = functionBindNative;
134
138
 
135
139
  var FunctionPrototype$2 = Function.prototype;
136
- var call$i = FunctionPrototype$2.call;
137
- var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$i, call$i);
140
+ var call$j = FunctionPrototype$2.call;
141
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$j, call$j);
138
142
 
139
143
  var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
140
144
  return function () {
141
- return call$i.apply(fn, arguments);
145
+ return call$j.apply(fn, arguments);
142
146
  };
143
147
  };
144
148
 
145
- var uncurryThis$q = functionUncurryThis;
149
+ var uncurryThis$r = functionUncurryThis;
146
150
 
147
- var toString$d = uncurryThis$q({}.toString);
148
- var stringSlice$6 = uncurryThis$q(''.slice);
151
+ var toString$e = uncurryThis$r({}.toString);
152
+ var stringSlice$7 = uncurryThis$r(''.slice);
149
153
 
150
154
  var classofRaw$2 = function (it) {
151
- return stringSlice$6(toString$d(it), 8, -1);
155
+ return stringSlice$7(toString$e(it), 8, -1);
152
156
  };
153
157
 
154
- var uncurryThis$p = functionUncurryThis;
158
+ var uncurryThis$q = functionUncurryThis;
155
159
  var fails$n = fails$q;
156
160
  var classof$8 = classofRaw$2;
157
161
 
158
162
  var $Object$4 = Object;
159
- var split = uncurryThis$p(''.split);
163
+ var split = uncurryThis$q(''.split);
160
164
 
161
165
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
162
166
  var indexedObject = fails$n(function () {
@@ -169,27 +173,27 @@ var indexedObject = fails$n(function () {
169
173
 
170
174
  // we can't use just `it == null` since of `document.all` special case
171
175
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
172
- var isNullOrUndefined$6 = function (it) {
176
+ var isNullOrUndefined$7 = function (it) {
173
177
  return it === null || it === undefined;
174
178
  };
175
179
 
176
- var isNullOrUndefined$5 = isNullOrUndefined$6;
180
+ var isNullOrUndefined$6 = isNullOrUndefined$7;
177
181
 
178
- var $TypeError$h = TypeError;
182
+ var $TypeError$i = TypeError;
179
183
 
180
184
  // `RequireObjectCoercible` abstract operation
181
185
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
182
- var requireObjectCoercible$8 = function (it) {
183
- if (isNullOrUndefined$5(it)) throw $TypeError$h("Can't call method on " + it);
186
+ var requireObjectCoercible$9 = function (it) {
187
+ if (isNullOrUndefined$6(it)) throw $TypeError$i("Can't call method on " + it);
184
188
  return it;
185
189
  };
186
190
 
187
191
  // toObject with fallback for non-array-like ES3 strings
188
192
  var IndexedObject$2 = indexedObject;
189
- var requireObjectCoercible$7 = requireObjectCoercible$8;
193
+ var requireObjectCoercible$8 = requireObjectCoercible$9;
190
194
 
191
195
  var toIndexedObject$5 = function (it) {
192
- return IndexedObject$2(requireObjectCoercible$7(it));
196
+ return IndexedObject$2(requireObjectCoercible$8(it));
193
197
  };
194
198
 
195
199
  var documentAll$2 = typeof document == 'object' && document.all;
@@ -208,37 +212,37 @@ var documentAll$1 = $documentAll$1.all;
208
212
 
209
213
  // `IsCallable` abstract operation
210
214
  // https://tc39.es/ecma262/#sec-iscallable
211
- var isCallable$n = $documentAll$1.IS_HTMLDDA ? function (argument) {
215
+ var isCallable$o = $documentAll$1.IS_HTMLDDA ? function (argument) {
212
216
  return typeof argument == 'function' || argument === documentAll$1;
213
217
  } : function (argument) {
214
218
  return typeof argument == 'function';
215
219
  };
216
220
 
217
- var isCallable$m = isCallable$n;
221
+ var isCallable$n = isCallable$o;
218
222
  var $documentAll = documentAll_1;
219
223
 
220
224
  var documentAll = $documentAll.all;
221
225
 
222
226
  var isObject$a = $documentAll.IS_HTMLDDA ? function (it) {
223
- return typeof it == 'object' ? it !== null : isCallable$m(it) || it === documentAll;
227
+ return typeof it == 'object' ? it !== null : isCallable$n(it) || it === documentAll;
224
228
  } : function (it) {
225
- return typeof it == 'object' ? it !== null : isCallable$m(it);
229
+ return typeof it == 'object' ? it !== null : isCallable$n(it);
226
230
  };
227
231
 
228
232
  var global$o = global$p;
229
- var isCallable$l = isCallable$n;
233
+ var isCallable$m = isCallable$o;
230
234
 
231
235
  var aFunction = function (argument) {
232
- return isCallable$l(argument) ? argument : undefined;
236
+ return isCallable$m(argument) ? argument : undefined;
233
237
  };
234
238
 
235
239
  var getBuiltIn$8 = function (namespace, method) {
236
240
  return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
237
241
  };
238
242
 
239
- var uncurryThis$o = functionUncurryThis;
243
+ var uncurryThis$p = functionUncurryThis;
240
244
 
241
- var objectIsPrototypeOf = uncurryThis$o({}.isPrototypeOf);
245
+ var objectIsPrototypeOf = uncurryThis$p({}.isPrototypeOf);
242
246
 
243
247
  var getBuiltIn$7 = getBuiltIn$8;
244
248
 
@@ -296,7 +300,7 @@ var useSymbolAsUid = NATIVE_SYMBOL$2
296
300
  && typeof Symbol.iterator == 'symbol';
297
301
 
298
302
  var getBuiltIn$6 = getBuiltIn$8;
299
- var isCallable$k = isCallable$n;
303
+ var isCallable$l = isCallable$o;
300
304
  var isPrototypeOf$4 = objectIsPrototypeOf;
301
305
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
302
306
 
@@ -306,7 +310,7 @@ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
306
310
  return typeof it == 'symbol';
307
311
  } : function (it) {
308
312
  var $Symbol = getBuiltIn$6('Symbol');
309
- return isCallable$k($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
313
+ return isCallable$l($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
310
314
  };
311
315
 
312
316
  var $String$4 = String;
@@ -319,41 +323,41 @@ var tryToString$5 = function (argument) {
319
323
  }
320
324
  };
321
325
 
322
- var isCallable$j = isCallable$n;
326
+ var isCallable$k = isCallable$o;
323
327
  var tryToString$4 = tryToString$5;
324
328
 
325
- var $TypeError$g = TypeError;
329
+ var $TypeError$h = TypeError;
326
330
 
327
331
  // `Assert: IsCallable(argument) is true`
328
332
  var aCallable$a = function (argument) {
329
- if (isCallable$j(argument)) return argument;
330
- throw $TypeError$g(tryToString$4(argument) + ' is not a function');
333
+ if (isCallable$k(argument)) return argument;
334
+ throw $TypeError$h(tryToString$4(argument) + ' is not a function');
331
335
  };
332
336
 
333
337
  var aCallable$9 = aCallable$a;
334
- var isNullOrUndefined$4 = isNullOrUndefined$6;
338
+ var isNullOrUndefined$5 = isNullOrUndefined$7;
335
339
 
336
340
  // `GetMethod` abstract operation
337
341
  // https://tc39.es/ecma262/#sec-getmethod
338
- var getMethod$5 = function (V, P) {
342
+ var getMethod$6 = function (V, P) {
339
343
  var func = V[P];
340
- return isNullOrUndefined$4(func) ? undefined : aCallable$9(func);
344
+ return isNullOrUndefined$5(func) ? undefined : aCallable$9(func);
341
345
  };
342
346
 
343
- var call$h = functionCall;
344
- var isCallable$i = isCallable$n;
347
+ var call$i = functionCall;
348
+ var isCallable$j = isCallable$o;
345
349
  var isObject$9 = isObject$a;
346
350
 
347
- var $TypeError$f = TypeError;
351
+ var $TypeError$g = TypeError;
348
352
 
349
353
  // `OrdinaryToPrimitive` abstract operation
350
354
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
351
355
  var ordinaryToPrimitive$1 = function (input, pref) {
352
356
  var fn, val;
353
- if (pref === 'string' && isCallable$i(fn = input.toString) && !isObject$9(val = call$h(fn, input))) return val;
354
- if (isCallable$i(fn = input.valueOf) && !isObject$9(val = call$h(fn, input))) return val;
355
- if (pref !== 'string' && isCallable$i(fn = input.toString) && !isObject$9(val = call$h(fn, input))) return val;
356
- throw $TypeError$f("Can't convert object to primitive value");
357
+ if (pref === 'string' && isCallable$j(fn = input.toString) && !isObject$9(val = call$i(fn, input))) return val;
358
+ if (isCallable$j(fn = input.valueOf) && !isObject$9(val = call$i(fn, input))) return val;
359
+ if (pref !== 'string' && isCallable$j(fn = input.toString) && !isObject$9(val = call$i(fn, input))) return val;
360
+ throw $TypeError$g("Can't convert object to primitive value");
357
361
  };
358
362
 
359
363
  var shared$4 = {exports: {}};
@@ -391,20 +395,20 @@ var store$2 = sharedStore;
391
395
  source: 'https://github.com/zloirock/core-js'
392
396
  });
393
397
 
394
- var requireObjectCoercible$6 = requireObjectCoercible$8;
398
+ var requireObjectCoercible$7 = requireObjectCoercible$9;
395
399
 
396
400
  var $Object$2 = Object;
397
401
 
398
402
  // `ToObject` abstract operation
399
403
  // https://tc39.es/ecma262/#sec-toobject
400
404
  var toObject$7 = function (argument) {
401
- return $Object$2(requireObjectCoercible$6(argument));
405
+ return $Object$2(requireObjectCoercible$7(argument));
402
406
  };
403
407
 
404
- var uncurryThis$n = functionUncurryThis;
408
+ var uncurryThis$o = functionUncurryThis;
405
409
  var toObject$6 = toObject$7;
406
410
 
407
- var hasOwnProperty = uncurryThis$n({}.hasOwnProperty);
411
+ var hasOwnProperty = uncurryThis$o({}.hasOwnProperty);
408
412
 
409
413
  // `HasOwnProperty` abstract operation
410
414
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -413,14 +417,14 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
413
417
  return hasOwnProperty(toObject$6(it), key);
414
418
  };
415
419
 
416
- var uncurryThis$m = functionUncurryThis;
420
+ var uncurryThis$n = functionUncurryThis;
417
421
 
418
422
  var id = 0;
419
423
  var postfix = Math.random();
420
- var toString$c = uncurryThis$m(1.0.toString);
424
+ var toString$d = uncurryThis$n(1.0.toString);
421
425
 
422
426
  var uid$2 = function (key) {
423
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$c(++id + postfix, 36);
427
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$d(++id + postfix, 36);
424
428
  };
425
429
 
426
430
  var global$k = global$p;
@@ -435,7 +439,7 @@ var Symbol$3 = global$k.Symbol;
435
439
  var symbolFor = Symbol$3 && Symbol$3['for'];
436
440
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
437
441
 
438
- var wellKnownSymbol$j = function (name) {
442
+ var wellKnownSymbol$k = function (name) {
439
443
  if (!hasOwn$b(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
440
444
  var description = 'Symbol.' + name;
441
445
  if (NATIVE_SYMBOL$1 && hasOwn$b(Symbol$3, name)) {
@@ -448,27 +452,27 @@ var wellKnownSymbol$j = function (name) {
448
452
  } return WellKnownSymbolsStore[name];
449
453
  };
450
454
 
451
- var call$g = functionCall;
455
+ var call$h = functionCall;
452
456
  var isObject$8 = isObject$a;
453
457
  var isSymbol$1 = isSymbol$2;
454
- var getMethod$4 = getMethod$5;
458
+ var getMethod$5 = getMethod$6;
455
459
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
456
- var wellKnownSymbol$i = wellKnownSymbol$j;
460
+ var wellKnownSymbol$j = wellKnownSymbol$k;
457
461
 
458
- var $TypeError$e = TypeError;
459
- var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
462
+ var $TypeError$f = TypeError;
463
+ var TO_PRIMITIVE = wellKnownSymbol$j('toPrimitive');
460
464
 
461
465
  // `ToPrimitive` abstract operation
462
466
  // https://tc39.es/ecma262/#sec-toprimitive
463
467
  var toPrimitive$1 = function (input, pref) {
464
468
  if (!isObject$8(input) || isSymbol$1(input)) return input;
465
- var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
469
+ var exoticToPrim = getMethod$5(input, TO_PRIMITIVE);
466
470
  var result;
467
471
  if (exoticToPrim) {
468
472
  if (pref === undefined) pref = 'default';
469
- result = call$g(exoticToPrim, input, pref);
473
+ result = call$h(exoticToPrim, input, pref);
470
474
  if (!isObject$8(result) || isSymbol$1(result)) return result;
471
- throw $TypeError$e("Can't convert object to primitive value");
475
+ throw $TypeError$f("Can't convert object to primitive value");
472
476
  }
473
477
  if (pref === undefined) pref = 'number';
474
478
  return ordinaryToPrimitive(input, pref);
@@ -508,7 +512,7 @@ var ie8DomDefine = !DESCRIPTORS$b && !fails$l(function () {
508
512
  });
509
513
 
510
514
  var DESCRIPTORS$a = descriptors;
511
- var call$f = functionCall;
515
+ var call$g = functionCall;
512
516
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
513
517
  var createPropertyDescriptor$3 = createPropertyDescriptor$4;
514
518
  var toIndexedObject$4 = toIndexedObject$5;
@@ -527,7 +531,7 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$a ? $getOwnPropertyDescriptor$1 :
527
531
  if (IE8_DOM_DEFINE$1) try {
528
532
  return $getOwnPropertyDescriptor$1(O, P);
529
533
  } catch (error) { /* empty */ }
530
- if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$f(propertyIsEnumerableModule$1.f, O, P), O[P]);
534
+ if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$g(propertyIsEnumerableModule$1.f, O, P), O[P]);
531
535
  };
532
536
 
533
537
  var objectDefineProperty = {};
@@ -548,12 +552,12 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$k(function () {
548
552
  var isObject$6 = isObject$a;
549
553
 
550
554
  var $String$3 = String;
551
- var $TypeError$d = TypeError;
555
+ var $TypeError$e = TypeError;
552
556
 
553
557
  // `Assert: Type(argument) is Object`
554
558
  var anObject$f = function (argument) {
555
559
  if (isObject$6(argument)) return argument;
556
- throw $TypeError$d($String$3(argument) + ' is not an object');
560
+ throw $TypeError$e($String$3(argument) + ' is not an object');
557
561
  };
558
562
 
559
563
  var DESCRIPTORS$8 = descriptors;
@@ -562,7 +566,7 @@ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
562
566
  var anObject$e = anObject$f;
563
567
  var toPropertyKey$1 = toPropertyKey$3;
564
568
 
565
- var $TypeError$c = TypeError;
569
+ var $TypeError$d = TypeError;
566
570
  // eslint-disable-next-line es/no-object-defineproperty -- safe
567
571
  var $defineProperty = Object.defineProperty;
568
572
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -595,7 +599,7 @@ objectDefineProperty.f = DESCRIPTORS$8 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
595
599
  if (IE8_DOM_DEFINE) try {
596
600
  return $defineProperty(O, P, Attributes);
597
601
  } catch (error) { /* empty */ }
598
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$c('Accessors not supported');
602
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$d('Accessors not supported');
599
603
  if ('value' in Attributes) O[P] = Attributes.value;
600
604
  return O;
601
605
  };
@@ -631,14 +635,14 @@ var functionName = {
631
635
  CONFIGURABLE: CONFIGURABLE
632
636
  };
633
637
 
634
- var uncurryThis$l = functionUncurryThis;
635
- var isCallable$h = isCallable$n;
638
+ var uncurryThis$m = functionUncurryThis;
639
+ var isCallable$i = isCallable$o;
636
640
  var store$1 = sharedStore;
637
641
 
638
- var functionToString = uncurryThis$l(Function.toString);
642
+ var functionToString = uncurryThis$m(Function.toString);
639
643
 
640
644
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
641
- if (!isCallable$h(store$1.inspectSource)) {
645
+ if (!isCallable$i(store$1.inspectSource)) {
642
646
  store$1.inspectSource = function (it) {
643
647
  return functionToString(it);
644
648
  };
@@ -647,11 +651,11 @@ if (!isCallable$h(store$1.inspectSource)) {
647
651
  var inspectSource$3 = store$1.inspectSource;
648
652
 
649
653
  var global$i = global$p;
650
- var isCallable$g = isCallable$n;
654
+ var isCallable$h = isCallable$o;
651
655
 
652
656
  var WeakMap$1 = global$i.WeakMap;
653
657
 
654
- var weakMapBasicDetection = isCallable$g(WeakMap$1) && /native code/.test(String(WeakMap$1));
658
+ var weakMapBasicDetection = isCallable$h(WeakMap$1) && /native code/.test(String(WeakMap$1));
655
659
 
656
660
  var shared$2 = shared$4.exports;
657
661
  var uid = uid$2;
@@ -736,7 +740,7 @@ var internalState = {
736
740
  };
737
741
 
738
742
  var fails$j = fails$q;
739
- var isCallable$f = isCallable$n;
743
+ var isCallable$g = isCallable$o;
740
744
  var hasOwn$7 = hasOwnProperty_1;
741
745
  var DESCRIPTORS$5 = descriptors;
742
746
  var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
@@ -782,10 +786,10 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
782
786
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
783
787
  // eslint-disable-next-line no-extend-native -- required
784
788
  Function.prototype.toString = makeBuiltIn$1(function toString() {
785
- return isCallable$f(this) && getInternalState$2(this).source || inspectSource$2(this);
789
+ return isCallable$g(this) && getInternalState$2(this).source || inspectSource$2(this);
786
790
  }, 'toString');
787
791
 
788
- var isCallable$e = isCallable$n;
792
+ var isCallable$f = isCallable$o;
789
793
  var definePropertyModule$4 = objectDefineProperty;
790
794
  var makeBuiltIn = makeBuiltIn$2.exports;
791
795
  var defineGlobalProperty$1 = defineGlobalProperty$3;
@@ -794,7 +798,7 @@ var defineBuiltIn$7 = function (O, key, value, options) {
794
798
  if (!options) options = {};
795
799
  var simple = options.enumerable;
796
800
  var name = options.name !== undefined ? options.name : key;
797
- if (isCallable$e(value)) makeBuiltIn(value, name, options);
801
+ if (isCallable$f(value)) makeBuiltIn(value, name, options);
798
802
  if (options.global) {
799
803
  if (simple) O[key] = value;
800
804
  else defineGlobalProperty$1(key, value);
@@ -838,7 +842,7 @@ var toIntegerOrInfinity$6 = function (argument) {
838
842
 
839
843
  var toIntegerOrInfinity$5 = toIntegerOrInfinity$6;
840
844
 
841
- var max$2 = Math.max;
845
+ var max$3 = Math.max;
842
846
  var min$2 = Math.min;
843
847
 
844
848
  // Helper for a popular repeating case of the spec:
@@ -846,7 +850,7 @@ var min$2 = Math.min;
846
850
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
847
851
  var toAbsoluteIndex$2 = function (index, length) {
848
852
  var integer = toIntegerOrInfinity$5(index);
849
- return integer < 0 ? max$2(integer + length, 0) : min$2(integer, length);
853
+ return integer < 0 ? max$3(integer + length, 0) : min$2(integer, length);
850
854
  };
851
855
 
852
856
  var toIntegerOrInfinity$4 = toIntegerOrInfinity$6;
@@ -900,13 +904,13 @@ var arrayIncludes = {
900
904
  indexOf: createMethod$3(false)
901
905
  };
902
906
 
903
- var uncurryThis$k = functionUncurryThis;
907
+ var uncurryThis$l = functionUncurryThis;
904
908
  var hasOwn$6 = hasOwnProperty_1;
905
909
  var toIndexedObject$2 = toIndexedObject$5;
906
- var indexOf$1 = arrayIncludes.indexOf;
910
+ var indexOf$2 = arrayIncludes.indexOf;
907
911
  var hiddenKeys$2 = hiddenKeys$4;
908
912
 
909
- var push$2 = uncurryThis$k([].push);
913
+ var push$2 = uncurryThis$l([].push);
910
914
 
911
915
  var objectKeysInternal = function (object, names) {
912
916
  var O = toIndexedObject$2(object);
@@ -916,7 +920,7 @@ var objectKeysInternal = function (object, names) {
916
920
  for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$2(result, key);
917
921
  // Don't enum bug & hidden keys
918
922
  while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
919
- ~indexOf$1(result, key) || push$2(result, key);
923
+ ~indexOf$2(result, key) || push$2(result, key);
920
924
  }
921
925
  return result;
922
926
  };
@@ -950,12 +954,12 @@ var objectGetOwnPropertySymbols = {};
950
954
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
951
955
 
952
956
  var getBuiltIn$5 = getBuiltIn$8;
953
- var uncurryThis$j = functionUncurryThis;
957
+ var uncurryThis$k = functionUncurryThis;
954
958
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
955
959
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
956
960
  var anObject$d = anObject$f;
957
961
 
958
- var concat$2 = uncurryThis$j([].concat);
962
+ var concat$2 = uncurryThis$k([].concat);
959
963
 
960
964
  // all object keys, includes non-enumerable and symbols
961
965
  var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -982,7 +986,7 @@ var copyConstructorProperties$2 = function (target, source, exceptions) {
982
986
  };
983
987
 
984
988
  var fails$i = fails$q;
985
- var isCallable$d = isCallable$n;
989
+ var isCallable$e = isCallable$o;
986
990
 
987
991
  var replacement = /#|\.prototype\./;
988
992
 
@@ -990,7 +994,7 @@ var isForced$2 = function (feature, detection) {
990
994
  var value = data[normalize(feature)];
991
995
  return value == POLYFILL ? true
992
996
  : value == NATIVE ? false
993
- : isCallable$d(detection) ? fails$i(detection)
997
+ : isCallable$e(detection) ? fails$i(detection)
994
998
  : !!detection;
995
999
  };
996
1000
 
@@ -1070,8 +1074,8 @@ var objectKeys$2 = Object.keys || function keys(O) {
1070
1074
  };
1071
1075
 
1072
1076
  var DESCRIPTORS$4 = descriptors;
1073
- var uncurryThis$i = functionUncurryThis;
1074
- var call$e = functionCall;
1077
+ var uncurryThis$j = functionUncurryThis;
1078
+ var call$f = functionCall;
1075
1079
  var fails$h = fails$q;
1076
1080
  var objectKeys$1 = objectKeys$2;
1077
1081
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
@@ -1083,7 +1087,7 @@ var IndexedObject$1 = indexedObject;
1083
1087
  var $assign = Object.assign;
1084
1088
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1085
1089
  var defineProperty$4 = Object.defineProperty;
1086
- var concat$1 = uncurryThis$i([].concat);
1090
+ var concat$1 = uncurryThis$j([].concat);
1087
1091
 
1088
1092
  // `Object.assign` method
1089
1093
  // https://tc39.es/ecma262/#sec-object.assign
@@ -1121,18 +1125,18 @@ var objectAssign = !$assign || fails$h(function () {
1121
1125
  var key;
1122
1126
  while (length > j) {
1123
1127
  key = keys[j++];
1124
- if (!DESCRIPTORS$4 || call$e(propertyIsEnumerable, S, key)) T[key] = S[key];
1128
+ if (!DESCRIPTORS$4 || call$f(propertyIsEnumerable, S, key)) T[key] = S[key];
1125
1129
  }
1126
1130
  } return T;
1127
1131
  } : $assign;
1128
1132
 
1129
- var $$j = _export;
1133
+ var $$k = _export;
1130
1134
  var assign = objectAssign;
1131
1135
 
1132
1136
  // `Object.assign` method
1133
1137
  // https://tc39.es/ecma262/#sec-object.assign
1134
1138
  // eslint-disable-next-line es/no-object-assign -- required for testing
1135
- $$j({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1139
+ $$k({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1136
1140
  assign: assign
1137
1141
  });
1138
1142
 
@@ -1178,7 +1182,7 @@ var toObject$4 = toObject$7;
1178
1182
  var IndexedObject = indexedObject;
1179
1183
  var lengthOfArrayLike$5 = lengthOfArrayLike$7;
1180
1184
 
1181
- var $TypeError$b = TypeError;
1185
+ var $TypeError$c = TypeError;
1182
1186
 
1183
1187
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
1184
1188
  var createMethod$2 = function (IS_RIGHT) {
@@ -1197,7 +1201,7 @@ var createMethod$2 = function (IS_RIGHT) {
1197
1201
  }
1198
1202
  index += i;
1199
1203
  if (IS_RIGHT ? index < 0 : length <= index) {
1200
- throw $TypeError$b('Reduce of empty array with no initial value');
1204
+ throw $TypeError$c('Reduce of empty array with no initial value');
1201
1205
  }
1202
1206
  }
1203
1207
  for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
@@ -1231,7 +1235,7 @@ var global$f = global$p;
1231
1235
 
1232
1236
  var engineIsNode = classof$7(global$f.process) == 'process';
1233
1237
 
1234
- var $$i = _export;
1238
+ var $$j = _export;
1235
1239
  var $reduce = arrayReduce.left;
1236
1240
  var arrayMethodIsStrict$1 = arrayMethodIsStrict$2;
1237
1241
  var CHROME_VERSION = engineV8Version;
@@ -1244,7 +1248,7 @@ var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1244
1248
 
1245
1249
  // `Array.prototype.reduce` method
1246
1250
  // https://tc39.es/ecma262/#sec-array.prototype.reduce
1247
- $$i({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
1251
+ $$j({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
1248
1252
  reduce: function reduce(callbackfn /* , initialValue */) {
1249
1253
  var length = arguments.length;
1250
1254
  return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
@@ -1371,11 +1375,11 @@ var objectCreate = Object.create || function create(O, Properties) {
1371
1375
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1372
1376
  };
1373
1377
 
1374
- var wellKnownSymbol$h = wellKnownSymbol$j;
1378
+ var wellKnownSymbol$i = wellKnownSymbol$k;
1375
1379
  var create$2 = objectCreate;
1376
1380
  var defineProperty$3 = objectDefineProperty.f;
1377
1381
 
1378
- var UNSCOPABLES = wellKnownSymbol$h('unscopables');
1382
+ var UNSCOPABLES = wellKnownSymbol$i('unscopables');
1379
1383
  var ArrayPrototype$1 = Array.prototype;
1380
1384
 
1381
1385
  // Array.prototype[@@unscopables]
@@ -1404,7 +1408,7 @@ var correctPrototypeGetter = !fails$f(function () {
1404
1408
  });
1405
1409
 
1406
1410
  var hasOwn$4 = hasOwnProperty_1;
1407
- var isCallable$c = isCallable$n;
1411
+ var isCallable$d = isCallable$o;
1408
1412
  var toObject$3 = toObject$7;
1409
1413
  var sharedKey = sharedKey$3;
1410
1414
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
@@ -1420,19 +1424,19 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
1420
1424
  var object = toObject$3(O);
1421
1425
  if (hasOwn$4(object, IE_PROTO)) return object[IE_PROTO];
1422
1426
  var constructor = object.constructor;
1423
- if (isCallable$c(constructor) && object instanceof constructor) {
1427
+ if (isCallable$d(constructor) && object instanceof constructor) {
1424
1428
  return constructor.prototype;
1425
1429
  } return object instanceof $Object$1 ? ObjectPrototype : null;
1426
1430
  };
1427
1431
 
1428
1432
  var fails$e = fails$q;
1429
- var isCallable$b = isCallable$n;
1433
+ var isCallable$c = isCallable$o;
1430
1434
  var isObject$4 = isObject$a;
1431
1435
  var getPrototypeOf$1 = objectGetPrototypeOf;
1432
1436
  var defineBuiltIn$5 = defineBuiltIn$7;
1433
- var wellKnownSymbol$g = wellKnownSymbol$j;
1437
+ var wellKnownSymbol$h = wellKnownSymbol$k;
1434
1438
 
1435
- var ITERATOR$7 = wellKnownSymbol$g('iterator');
1439
+ var ITERATOR$7 = wellKnownSymbol$h('iterator');
1436
1440
  var BUGGY_SAFARI_ITERATORS$1 = false;
1437
1441
 
1438
1442
  // `%IteratorPrototype%` object
@@ -1460,7 +1464,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1460
1464
 
1461
1465
  // `%IteratorPrototype%[@@iterator]()` method
1462
1466
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1463
- if (!isCallable$b(IteratorPrototype$2[ITERATOR$7])) {
1467
+ if (!isCallable$c(IteratorPrototype$2[ITERATOR$7])) {
1464
1468
  defineBuiltIn$5(IteratorPrototype$2, ITERATOR$7, function () {
1465
1469
  return this;
1466
1470
  });
@@ -1473,9 +1477,9 @@ var iteratorsCore = {
1473
1477
 
1474
1478
  var defineProperty$2 = objectDefineProperty.f;
1475
1479
  var hasOwn$3 = hasOwnProperty_1;
1476
- var wellKnownSymbol$f = wellKnownSymbol$j;
1480
+ var wellKnownSymbol$g = wellKnownSymbol$k;
1477
1481
 
1478
- var TO_STRING_TAG$3 = wellKnownSymbol$f('toStringTag');
1482
+ var TO_STRING_TAG$3 = wellKnownSymbol$g('toStringTag');
1479
1483
 
1480
1484
  var setToStringTag$3 = function (target, TAG, STATIC) {
1481
1485
  if (target && !STATIC) target = target.prototype;
@@ -1500,19 +1504,19 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
1500
1504
  return IteratorConstructor;
1501
1505
  };
1502
1506
 
1503
- var isCallable$a = isCallable$n;
1507
+ var isCallable$b = isCallable$o;
1504
1508
 
1505
1509
  var $String$2 = String;
1506
- var $TypeError$a = TypeError;
1510
+ var $TypeError$b = TypeError;
1507
1511
 
1508
1512
  var aPossiblePrototype$1 = function (argument) {
1509
- if (typeof argument == 'object' || isCallable$a(argument)) return argument;
1510
- throw $TypeError$a("Can't set " + $String$2(argument) + ' as a prototype');
1513
+ if (typeof argument == 'object' || isCallable$b(argument)) return argument;
1514
+ throw $TypeError$b("Can't set " + $String$2(argument) + ' as a prototype');
1511
1515
  };
1512
1516
 
1513
1517
  /* eslint-disable no-proto -- safe */
1514
1518
 
1515
- var uncurryThis$h = functionUncurryThis;
1519
+ var uncurryThis$i = functionUncurryThis;
1516
1520
  var anObject$a = anObject$f;
1517
1521
  var aPossiblePrototype = aPossiblePrototype$1;
1518
1522
 
@@ -1526,7 +1530,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1526
1530
  var setter;
1527
1531
  try {
1528
1532
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1529
- setter = uncurryThis$h(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1533
+ setter = uncurryThis$i(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1530
1534
  setter(test, []);
1531
1535
  CORRECT_SETTER = test instanceof Array;
1532
1536
  } catch (error) { /* empty */ }
@@ -1539,17 +1543,17 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1539
1543
  };
1540
1544
  }() : undefined);
1541
1545
 
1542
- var $$h = _export;
1543
- var call$d = functionCall;
1546
+ var $$i = _export;
1547
+ var call$e = functionCall;
1544
1548
  var FunctionName = functionName;
1545
- var isCallable$9 = isCallable$n;
1549
+ var isCallable$a = isCallable$o;
1546
1550
  var createIteratorConstructor = iteratorCreateConstructor;
1547
1551
  var getPrototypeOf = objectGetPrototypeOf;
1548
1552
  var setPrototypeOf$1 = objectSetPrototypeOf;
1549
1553
  var setToStringTag$1 = setToStringTag$3;
1550
1554
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1551
1555
  var defineBuiltIn$4 = defineBuiltIn$7;
1552
- var wellKnownSymbol$e = wellKnownSymbol$j;
1556
+ var wellKnownSymbol$f = wellKnownSymbol$k;
1553
1557
  var Iterators$3 = iterators;
1554
1558
  var IteratorsCore = iteratorsCore;
1555
1559
 
@@ -1557,7 +1561,7 @@ var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
1557
1561
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1558
1562
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1559
1563
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1560
- var ITERATOR$6 = wellKnownSymbol$e('iterator');
1564
+ var ITERATOR$6 = wellKnownSymbol$f('iterator');
1561
1565
  var KEYS = 'keys';
1562
1566
  var VALUES = 'values';
1563
1567
  var ENTRIES = 'entries';
@@ -1594,7 +1598,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1594
1598
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1595
1599
  if (setPrototypeOf$1) {
1596
1600
  setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1597
- } else if (!isCallable$9(CurrentIteratorPrototype[ITERATOR$6])) {
1601
+ } else if (!isCallable$a(CurrentIteratorPrototype[ITERATOR$6])) {
1598
1602
  defineBuiltIn$4(CurrentIteratorPrototype, ITERATOR$6, returnThis);
1599
1603
  }
1600
1604
  }
@@ -1609,7 +1613,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1609
1613
  createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1610
1614
  } else {
1611
1615
  INCORRECT_VALUES_NAME = true;
1612
- defaultIterator = function values() { return call$d(nativeIterator, this); };
1616
+ defaultIterator = function values() { return call$e(nativeIterator, this); };
1613
1617
  }
1614
1618
  }
1615
1619
 
@@ -1624,7 +1628,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1624
1628
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1625
1629
  defineBuiltIn$4(IterablePrototype, KEY, methods[KEY]);
1626
1630
  }
1627
- } else $$h({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1631
+ } else $$i({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1628
1632
  }
1629
1633
 
1630
1634
  // define iterator
@@ -1752,10 +1756,10 @@ var DOMIterables = domIterables;
1752
1756
  var DOMTokenListPrototype = domTokenListPrototype;
1753
1757
  var ArrayIteratorMethods = es_array_iterator;
1754
1758
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1755
- var wellKnownSymbol$d = wellKnownSymbol$j;
1759
+ var wellKnownSymbol$e = wellKnownSymbol$k;
1756
1760
 
1757
- var ITERATOR$5 = wellKnownSymbol$d('iterator');
1758
- var TO_STRING_TAG$2 = wellKnownSymbol$d('toStringTag');
1761
+ var ITERATOR$5 = wellKnownSymbol$e('iterator');
1762
+ var TO_STRING_TAG$2 = wellKnownSymbol$e('toStringTag');
1759
1763
  var ArrayValues = ArrayIteratorMethods.values;
1760
1764
 
1761
1765
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
@@ -1874,6 +1878,18 @@ const createCodedErrors = err => {
1874
1878
  message: err.message
1875
1879
  }];
1876
1880
  };
1881
+ /**
1882
+ * Joins a list of error-like object's messages and throws them as a single error.
1883
+ */
1884
+ function throwJoinedMessages(errors) {
1885
+ throw new Error(errors.map(e => e.message).join(", "));
1886
+ }
1887
+ /**
1888
+ * If any CodedErrors exist, throw them all as a single error, otherwise assert errors is null.
1889
+ */
1890
+ function throwAny(errors) {
1891
+ if (errors) throwJoinedMessages(errors);
1892
+ }
1877
1893
 
1878
1894
  /**
1879
1895
  * @description
@@ -1911,9 +1927,9 @@ const formLogger = {
1911
1927
  })
1912
1928
  };
1913
1929
 
1914
- var wellKnownSymbol$c = wellKnownSymbol$j;
1930
+ var wellKnownSymbol$d = wellKnownSymbol$k;
1915
1931
 
1916
- var TO_STRING_TAG$1 = wellKnownSymbol$c('toStringTag');
1932
+ var TO_STRING_TAG$1 = wellKnownSymbol$d('toStringTag');
1917
1933
  var test$1 = {};
1918
1934
 
1919
1935
  test$1[TO_STRING_TAG$1] = 'z';
@@ -1921,11 +1937,11 @@ test$1[TO_STRING_TAG$1] = 'z';
1921
1937
  var toStringTagSupport = String(test$1) === '[object z]';
1922
1938
 
1923
1939
  var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1924
- var isCallable$8 = isCallable$n;
1940
+ var isCallable$9 = isCallable$o;
1925
1941
  var classofRaw$1 = classofRaw$2;
1926
- var wellKnownSymbol$b = wellKnownSymbol$j;
1942
+ var wellKnownSymbol$c = wellKnownSymbol$k;
1927
1943
 
1928
- var TO_STRING_TAG = wellKnownSymbol$b('toStringTag');
1944
+ var TO_STRING_TAG = wellKnownSymbol$c('toStringTag');
1929
1945
  var $Object = Object;
1930
1946
 
1931
1947
  // ES3 wrong here
@@ -1947,14 +1963,14 @@ var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1947
1963
  // builtinTag case
1948
1964
  : CORRECT_ARGUMENTS ? classofRaw$1(O)
1949
1965
  // ES3 arguments fallback
1950
- : (result = classofRaw$1(O)) == 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
1966
+ : (result = classofRaw$1(O)) == 'Object' && isCallable$9(O.callee) ? 'Arguments' : result;
1951
1967
  };
1952
1968
 
1953
1969
  var classof$5 = classof$6;
1954
1970
 
1955
1971
  var $String$1 = String;
1956
1972
 
1957
- var toString$b = function (argument) {
1973
+ var toString$c = function (argument) {
1958
1974
  if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1959
1975
  return $String$1(argument);
1960
1976
  };
@@ -1963,12 +1979,12 @@ var toString$b = function (argument) {
1963
1979
  var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1964
1980
  '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1965
1981
 
1966
- var uncurryThis$g = functionUncurryThis;
1967
- var requireObjectCoercible$5 = requireObjectCoercible$8;
1968
- var toString$a = toString$b;
1982
+ var uncurryThis$h = functionUncurryThis;
1983
+ var requireObjectCoercible$6 = requireObjectCoercible$9;
1984
+ var toString$b = toString$c;
1969
1985
  var whitespaces$3 = whitespaces$4;
1970
1986
 
1971
- var replace$3 = uncurryThis$g(''.replace);
1987
+ var replace$3 = uncurryThis$h(''.replace);
1972
1988
  var whitespace = '[' + whitespaces$3 + ']';
1973
1989
  var ltrim = RegExp('^' + whitespace + whitespace + '*');
1974
1990
  var rtrim = RegExp(whitespace + whitespace + '*$');
@@ -1976,7 +1992,7 @@ var rtrim = RegExp(whitespace + whitespace + '*$');
1976
1992
  // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1977
1993
  var createMethod$1 = function (TYPE) {
1978
1994
  return function ($this) {
1979
- var string = toString$a(requireObjectCoercible$5($this));
1995
+ var string = toString$b(requireObjectCoercible$6($this));
1980
1996
  if (TYPE & 1) string = replace$3(string, ltrim, '');
1981
1997
  if (TYPE & 2) string = replace$3(string, rtrim, '');
1982
1998
  return string;
@@ -2011,13 +2027,13 @@ var stringTrimForced = function (METHOD_NAME) {
2011
2027
  });
2012
2028
  };
2013
2029
 
2014
- var $$g = _export;
2030
+ var $$h = _export;
2015
2031
  var $trim = stringTrim.trim;
2016
2032
  var forcedStringTrimMethod = stringTrimForced;
2017
2033
 
2018
2034
  // `String.prototype.trim` method
2019
2035
  // https://tc39.es/ecma262/#sec-string.prototype.trim
2020
- $$g({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
2036
+ $$h({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
2021
2037
  trim: function trim() {
2022
2038
  return $trim(this);
2023
2039
  }
@@ -2097,9 +2113,9 @@ var regexpUnsupportedNcg = fails$a(function () {
2097
2113
 
2098
2114
  /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
2099
2115
  /* eslint-disable regexp/no-useless-quantifier -- testing */
2100
- var call$c = functionCall;
2101
- var uncurryThis$f = functionUncurryThis;
2102
- var toString$9 = toString$b;
2116
+ var call$d = functionCall;
2117
+ var uncurryThis$g = functionUncurryThis;
2118
+ var toString$a = toString$c;
2103
2119
  var regexpFlags = regexpFlags$1;
2104
2120
  var stickyHelpers = regexpStickyHelpers;
2105
2121
  var shared = shared$4.exports;
@@ -2111,16 +2127,16 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
2111
2127
  var nativeReplace = shared('native-string-replace', String.prototype.replace);
2112
2128
  var nativeExec = RegExp.prototype.exec;
2113
2129
  var patchedExec = nativeExec;
2114
- var charAt$4 = uncurryThis$f(''.charAt);
2115
- var indexOf = uncurryThis$f(''.indexOf);
2116
- var replace$2 = uncurryThis$f(''.replace);
2117
- var stringSlice$5 = uncurryThis$f(''.slice);
2130
+ var charAt$4 = uncurryThis$g(''.charAt);
2131
+ var indexOf$1 = uncurryThis$g(''.indexOf);
2132
+ var replace$2 = uncurryThis$g(''.replace);
2133
+ var stringSlice$6 = uncurryThis$g(''.slice);
2118
2134
 
2119
2135
  var UPDATES_LAST_INDEX_WRONG = (function () {
2120
2136
  var re1 = /a/;
2121
2137
  var re2 = /b*/g;
2122
- call$c(nativeExec, re1, 'a');
2123
- call$c(nativeExec, re2, 'a');
2138
+ call$d(nativeExec, re1, 'a');
2139
+ call$d(nativeExec, re2, 'a');
2124
2140
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2125
2141
  })();
2126
2142
 
@@ -2135,31 +2151,31 @@ if (PATCH) {
2135
2151
  patchedExec = function exec(string) {
2136
2152
  var re = this;
2137
2153
  var state = getInternalState(re);
2138
- var str = toString$9(string);
2154
+ var str = toString$a(string);
2139
2155
  var raw = state.raw;
2140
2156
  var result, reCopy, lastIndex, match, i, object, group;
2141
2157
 
2142
2158
  if (raw) {
2143
2159
  raw.lastIndex = re.lastIndex;
2144
- result = call$c(patchedExec, raw, str);
2160
+ result = call$d(patchedExec, raw, str);
2145
2161
  re.lastIndex = raw.lastIndex;
2146
2162
  return result;
2147
2163
  }
2148
2164
 
2149
2165
  var groups = state.groups;
2150
2166
  var sticky = UNSUPPORTED_Y && re.sticky;
2151
- var flags = call$c(regexpFlags, re);
2167
+ var flags = call$d(regexpFlags, re);
2152
2168
  var source = re.source;
2153
2169
  var charsAdded = 0;
2154
2170
  var strCopy = str;
2155
2171
 
2156
2172
  if (sticky) {
2157
2173
  flags = replace$2(flags, 'y', '');
2158
- if (indexOf(flags, 'g') === -1) {
2174
+ if (indexOf$1(flags, 'g') === -1) {
2159
2175
  flags += 'g';
2160
2176
  }
2161
2177
 
2162
- strCopy = stringSlice$5(str, re.lastIndex);
2178
+ strCopy = stringSlice$6(str, re.lastIndex);
2163
2179
  // Support anchored sticky behavior.
2164
2180
  if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
2165
2181
  source = '(?: ' + source + ')';
@@ -2176,12 +2192,12 @@ if (PATCH) {
2176
2192
  }
2177
2193
  if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2178
2194
 
2179
- match = call$c(nativeExec, sticky ? reCopy : re, strCopy);
2195
+ match = call$d(nativeExec, sticky ? reCopy : re, strCopy);
2180
2196
 
2181
2197
  if (sticky) {
2182
2198
  if (match) {
2183
- match.input = stringSlice$5(match.input, charsAdded);
2184
- match[0] = stringSlice$5(match[0], charsAdded);
2199
+ match.input = stringSlice$6(match.input, charsAdded);
2200
+ match[0] = stringSlice$6(match[0], charsAdded);
2185
2201
  match.index = re.lastIndex;
2186
2202
  re.lastIndex += match[0].length;
2187
2203
  } else re.lastIndex = 0;
@@ -2191,7 +2207,7 @@ if (PATCH) {
2191
2207
  if (NPCG_INCLUDED && match && match.length > 1) {
2192
2208
  // Fix browsers whose `exec` methods don't consistently return `undefined`
2193
2209
  // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
2194
- call$c(nativeReplace, match[0], reCopy, function () {
2210
+ call$d(nativeReplace, match[0], reCopy, function () {
2195
2211
  for (i = 1; i < arguments.length - 2; i++) {
2196
2212
  if (arguments[i] === undefined) match[i] = undefined;
2197
2213
  }
@@ -2212,12 +2228,12 @@ if (PATCH) {
2212
2228
 
2213
2229
  var regexpExec$2 = patchedExec;
2214
2230
 
2215
- var $$f = _export;
2231
+ var $$g = _export;
2216
2232
  var exec$2 = regexpExec$2;
2217
2233
 
2218
2234
  // `RegExp.prototype.exec` method
2219
2235
  // https://tc39.es/ecma262/#sec-regexp.prototype.exec
2220
- $$f({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2236
+ $$g({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2221
2237
  exec: exec$2
2222
2238
  });
2223
2239
 
@@ -2225,37 +2241,37 @@ var NATIVE_BIND$1 = functionBindNative;
2225
2241
 
2226
2242
  var FunctionPrototype = Function.prototype;
2227
2243
  var apply$2 = FunctionPrototype.apply;
2228
- var call$b = FunctionPrototype.call;
2244
+ var call$c = FunctionPrototype.call;
2229
2245
 
2230
2246
  // eslint-disable-next-line es/no-reflect -- safe
2231
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$b.bind(apply$2) : function () {
2232
- return call$b.apply(apply$2, arguments);
2247
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$c.bind(apply$2) : function () {
2248
+ return call$c.apply(apply$2, arguments);
2233
2249
  });
2234
2250
 
2235
2251
  var classofRaw = classofRaw$2;
2236
- var uncurryThis$e = functionUncurryThis;
2252
+ var uncurryThis$f = functionUncurryThis;
2237
2253
 
2238
2254
  var functionUncurryThisClause = function (fn) {
2239
2255
  // Nashorn bug:
2240
2256
  // https://github.com/zloirock/core-js/issues/1128
2241
2257
  // https://github.com/zloirock/core-js/issues/1130
2242
- if (classofRaw(fn) === 'Function') return uncurryThis$e(fn);
2258
+ if (classofRaw(fn) === 'Function') return uncurryThis$f(fn);
2243
2259
  };
2244
2260
 
2245
2261
  // TODO: Remove from `core-js@4` since it's moved to entry points
2246
2262
 
2247
- var uncurryThis$d = functionUncurryThisClause;
2263
+ var uncurryThis$e = functionUncurryThisClause;
2248
2264
  var defineBuiltIn$3 = defineBuiltIn$7;
2249
2265
  var regexpExec$1 = regexpExec$2;
2250
2266
  var fails$9 = fails$q;
2251
- var wellKnownSymbol$a = wellKnownSymbol$j;
2267
+ var wellKnownSymbol$b = wellKnownSymbol$k;
2252
2268
  var createNonEnumerableProperty = createNonEnumerableProperty$5;
2253
2269
 
2254
- var SPECIES$4 = wellKnownSymbol$a('species');
2270
+ var SPECIES$4 = wellKnownSymbol$b('species');
2255
2271
  var RegExpPrototype$2 = RegExp.prototype;
2256
2272
 
2257
2273
  var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2258
- var SYMBOL = wellKnownSymbol$a(KEY);
2274
+ var SYMBOL = wellKnownSymbol$b(KEY);
2259
2275
 
2260
2276
  var DELEGATES_TO_SYMBOL = !fails$9(function () {
2261
2277
  // String methods call symbol-named RegEp methods
@@ -2293,9 +2309,9 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2293
2309
  !DELEGATES_TO_EXEC ||
2294
2310
  FORCED
2295
2311
  ) {
2296
- var uncurriedNativeRegExpMethod = uncurryThis$d(/./[SYMBOL]);
2312
+ var uncurriedNativeRegExpMethod = uncurryThis$e(/./[SYMBOL]);
2297
2313
  var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2298
- var uncurriedNativeMethod = uncurryThis$d(nativeMethod);
2314
+ var uncurriedNativeMethod = uncurryThis$e(nativeMethod);
2299
2315
  var $exec = regexp.exec;
2300
2316
  if ($exec === regexpExec$1 || $exec === RegExpPrototype$2.exec) {
2301
2317
  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
@@ -2316,18 +2332,18 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2316
2332
  if (SHAM) createNonEnumerableProperty(RegExpPrototype$2[SYMBOL], 'sham', true);
2317
2333
  };
2318
2334
 
2319
- var uncurryThis$c = functionUncurryThis;
2335
+ var uncurryThis$d = functionUncurryThis;
2320
2336
  var toIntegerOrInfinity$3 = toIntegerOrInfinity$6;
2321
- var toString$8 = toString$b;
2322
- var requireObjectCoercible$4 = requireObjectCoercible$8;
2337
+ var toString$9 = toString$c;
2338
+ var requireObjectCoercible$5 = requireObjectCoercible$9;
2323
2339
 
2324
- var charAt$3 = uncurryThis$c(''.charAt);
2325
- var charCodeAt = uncurryThis$c(''.charCodeAt);
2326
- var stringSlice$4 = uncurryThis$c(''.slice);
2340
+ var charAt$3 = uncurryThis$d(''.charAt);
2341
+ var charCodeAt = uncurryThis$d(''.charCodeAt);
2342
+ var stringSlice$5 = uncurryThis$d(''.slice);
2327
2343
 
2328
2344
  var createMethod = function (CONVERT_TO_STRING) {
2329
2345
  return function ($this, pos) {
2330
- var S = toString$8(requireObjectCoercible$4($this));
2346
+ var S = toString$9(requireObjectCoercible$5($this));
2331
2347
  var position = toIntegerOrInfinity$3(pos);
2332
2348
  var size = S.length;
2333
2349
  var first, second;
@@ -2339,7 +2355,7 @@ var createMethod = function (CONVERT_TO_STRING) {
2339
2355
  ? charAt$3(S, position)
2340
2356
  : first
2341
2357
  : CONVERT_TO_STRING
2342
- ? stringSlice$4(S, position, position + 2)
2358
+ ? stringSlice$5(S, position, position + 2)
2343
2359
  : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2344
2360
  };
2345
2361
  };
@@ -2361,19 +2377,19 @@ var advanceStringIndex$2 = function (S, index, unicode) {
2361
2377
  return index + (unicode ? charAt$2(S, index).length : 1);
2362
2378
  };
2363
2379
 
2364
- var uncurryThis$b = functionUncurryThis;
2380
+ var uncurryThis$c = functionUncurryThis;
2365
2381
  var toObject$2 = toObject$7;
2366
2382
 
2367
2383
  var floor$2 = Math.floor;
2368
- var charAt$1 = uncurryThis$b(''.charAt);
2369
- var replace$1 = uncurryThis$b(''.replace);
2370
- var stringSlice$3 = uncurryThis$b(''.slice);
2384
+ var charAt$1 = uncurryThis$c(''.charAt);
2385
+ var replace$1 = uncurryThis$c(''.replace);
2386
+ var stringSlice$4 = uncurryThis$c(''.slice);
2371
2387
  var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2372
2388
  var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2373
2389
 
2374
2390
  // `GetSubstitution` abstract operation
2375
2391
  // https://tc39.es/ecma262/#sec-getsubstitution
2376
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
2392
+ var getSubstitution$2 = function (matched, str, position, captures, namedCaptures, replacement) {
2377
2393
  var tailPos = position + matched.length;
2378
2394
  var m = captures.length;
2379
2395
  var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
@@ -2386,10 +2402,10 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
2386
2402
  switch (charAt$1(ch, 0)) {
2387
2403
  case '$': return '$';
2388
2404
  case '&': return matched;
2389
- case '`': return stringSlice$3(str, 0, position);
2390
- case "'": return stringSlice$3(str, tailPos);
2405
+ case '`': return stringSlice$4(str, 0, position);
2406
+ case "'": return stringSlice$4(str, tailPos);
2391
2407
  case '<':
2392
- capture = namedCaptures[stringSlice$3(ch, 1, -1)];
2408
+ capture = namedCaptures[stringSlice$4(ch, 1, -1)];
2393
2409
  break;
2394
2410
  default: // \d\d?
2395
2411
  var n = +ch;
@@ -2406,52 +2422,52 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
2406
2422
  });
2407
2423
  };
2408
2424
 
2409
- var call$a = functionCall;
2425
+ var call$b = functionCall;
2410
2426
  var anObject$8 = anObject$f;
2411
- var isCallable$7 = isCallable$n;
2427
+ var isCallable$8 = isCallable$o;
2412
2428
  var classof$4 = classofRaw$2;
2413
2429
  var regexpExec = regexpExec$2;
2414
2430
 
2415
- var $TypeError$9 = TypeError;
2431
+ var $TypeError$a = TypeError;
2416
2432
 
2417
2433
  // `RegExpExec` abstract operation
2418
2434
  // https://tc39.es/ecma262/#sec-regexpexec
2419
2435
  var regexpExecAbstract = function (R, S) {
2420
2436
  var exec = R.exec;
2421
- if (isCallable$7(exec)) {
2422
- var result = call$a(exec, R, S);
2437
+ if (isCallable$8(exec)) {
2438
+ var result = call$b(exec, R, S);
2423
2439
  if (result !== null) anObject$8(result);
2424
2440
  return result;
2425
2441
  }
2426
- if (classof$4(R) === 'RegExp') return call$a(regexpExec, R, S);
2427
- throw $TypeError$9('RegExp#exec called on incompatible receiver');
2442
+ if (classof$4(R) === 'RegExp') return call$b(regexpExec, R, S);
2443
+ throw $TypeError$a('RegExp#exec called on incompatible receiver');
2428
2444
  };
2429
2445
 
2430
2446
  var apply$1 = functionApply;
2431
- var call$9 = functionCall;
2432
- var uncurryThis$a = functionUncurryThis;
2447
+ var call$a = functionCall;
2448
+ var uncurryThis$b = functionUncurryThis;
2433
2449
  var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
2434
2450
  var fails$8 = fails$q;
2435
2451
  var anObject$7 = anObject$f;
2436
- var isCallable$6 = isCallable$n;
2437
- var isNullOrUndefined$3 = isNullOrUndefined$6;
2452
+ var isCallable$7 = isCallable$o;
2453
+ var isNullOrUndefined$4 = isNullOrUndefined$7;
2438
2454
  var toIntegerOrInfinity$2 = toIntegerOrInfinity$6;
2439
2455
  var toLength$1 = toLength$3;
2440
- var toString$7 = toString$b;
2441
- var requireObjectCoercible$3 = requireObjectCoercible$8;
2456
+ var toString$8 = toString$c;
2457
+ var requireObjectCoercible$4 = requireObjectCoercible$9;
2442
2458
  var advanceStringIndex$1 = advanceStringIndex$2;
2443
- var getMethod$3 = getMethod$5;
2444
- var getSubstitution = getSubstitution$1;
2459
+ var getMethod$4 = getMethod$6;
2460
+ var getSubstitution$1 = getSubstitution$2;
2445
2461
  var regExpExec$1 = regexpExecAbstract;
2446
- var wellKnownSymbol$9 = wellKnownSymbol$j;
2462
+ var wellKnownSymbol$a = wellKnownSymbol$k;
2447
2463
 
2448
- var REPLACE = wellKnownSymbol$9('replace');
2449
- var max$1 = Math.max;
2464
+ var REPLACE$1 = wellKnownSymbol$a('replace');
2465
+ var max$2 = Math.max;
2450
2466
  var min = Math.min;
2451
- var concat = uncurryThis$a([].concat);
2452
- var push$1 = uncurryThis$a([].push);
2453
- var stringIndexOf$1 = uncurryThis$a(''.indexOf);
2454
- var stringSlice$2 = uncurryThis$a(''.slice);
2467
+ var concat = uncurryThis$b([].concat);
2468
+ var push$1 = uncurryThis$b([].push);
2469
+ var stringIndexOf$2 = uncurryThis$b(''.indexOf);
2470
+ var stringSlice$3 = uncurryThis$b(''.slice);
2455
2471
 
2456
2472
  var maybeToString = function (it) {
2457
2473
  return it === undefined ? it : String(it);
@@ -2466,8 +2482,8 @@ var REPLACE_KEEPS_$0 = (function () {
2466
2482
 
2467
2483
  // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2468
2484
  var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2469
- if (/./[REPLACE]) {
2470
- return /./[REPLACE]('a', '$0') === '';
2485
+ if (/./[REPLACE$1]) {
2486
+ return /./[REPLACE$1]('a', '$0') === '';
2471
2487
  }
2472
2488
  return false;
2473
2489
  })();
@@ -2491,29 +2507,29 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2491
2507
  // `String.prototype.replace` method
2492
2508
  // https://tc39.es/ecma262/#sec-string.prototype.replace
2493
2509
  function replace(searchValue, replaceValue) {
2494
- var O = requireObjectCoercible$3(this);
2495
- var replacer = isNullOrUndefined$3(searchValue) ? undefined : getMethod$3(searchValue, REPLACE);
2510
+ var O = requireObjectCoercible$4(this);
2511
+ var replacer = isNullOrUndefined$4(searchValue) ? undefined : getMethod$4(searchValue, REPLACE$1);
2496
2512
  return replacer
2497
- ? call$9(replacer, searchValue, O, replaceValue)
2498
- : call$9(nativeReplace, toString$7(O), searchValue, replaceValue);
2513
+ ? call$a(replacer, searchValue, O, replaceValue)
2514
+ : call$a(nativeReplace, toString$8(O), searchValue, replaceValue);
2499
2515
  },
2500
2516
  // `RegExp.prototype[@@replace]` method
2501
2517
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2502
2518
  function (string, replaceValue) {
2503
2519
  var rx = anObject$7(this);
2504
- var S = toString$7(string);
2520
+ var S = toString$8(string);
2505
2521
 
2506
2522
  if (
2507
2523
  typeof replaceValue == 'string' &&
2508
- stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2509
- stringIndexOf$1(replaceValue, '$<') === -1
2524
+ stringIndexOf$2(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2525
+ stringIndexOf$2(replaceValue, '$<') === -1
2510
2526
  ) {
2511
2527
  var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2512
2528
  if (res.done) return res.value;
2513
2529
  }
2514
2530
 
2515
- var functionalReplace = isCallable$6(replaceValue);
2516
- if (!functionalReplace) replaceValue = toString$7(replaceValue);
2531
+ var functionalReplace = isCallable$7(replaceValue);
2532
+ if (!functionalReplace) replaceValue = toString$8(replaceValue);
2517
2533
 
2518
2534
  var global = rx.global;
2519
2535
  if (global) {
@@ -2528,7 +2544,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2528
2544
  push$1(results, result);
2529
2545
  if (!global) break;
2530
2546
 
2531
- var matchStr = toString$7(result[0]);
2547
+ var matchStr = toString$8(result[0]);
2532
2548
  if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
2533
2549
  }
2534
2550
 
@@ -2537,8 +2553,8 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2537
2553
  for (var i = 0; i < results.length; i++) {
2538
2554
  result = results[i];
2539
2555
 
2540
- var matched = toString$7(result[0]);
2541
- var position = max$1(min(toIntegerOrInfinity$2(result.index), S.length), 0);
2556
+ var matched = toString$8(result[0]);
2557
+ var position = max$2(min(toIntegerOrInfinity$2(result.index), S.length), 0);
2542
2558
  var captures = [];
2543
2559
  // NOTE: This is equivalent to
2544
2560
  // captures = result.slice(1).map(maybeToString)
@@ -2550,16 +2566,16 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2550
2566
  if (functionalReplace) {
2551
2567
  var replacerArgs = concat([matched], captures, position, S);
2552
2568
  if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
2553
- var replacement = toString$7(apply$1(replaceValue, undefined, replacerArgs));
2569
+ var replacement = toString$8(apply$1(replaceValue, undefined, replacerArgs));
2554
2570
  } else {
2555
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2571
+ replacement = getSubstitution$1(matched, S, position, captures, namedCaptures, replaceValue);
2556
2572
  }
2557
2573
  if (position >= nextSourcePosition) {
2558
- accumulatedResult += stringSlice$2(S, nextSourcePosition, position) + replacement;
2574
+ accumulatedResult += stringSlice$3(S, nextSourcePosition, position) + replacement;
2559
2575
  nextSourcePosition = position + matched.length;
2560
2576
  }
2561
2577
  }
2562
- return accumulatedResult + stringSlice$2(S, nextSourcePosition);
2578
+ return accumulatedResult + stringSlice$3(S, nextSourcePosition);
2563
2579
  }
2564
2580
  ];
2565
2581
  }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
@@ -2619,16 +2635,18 @@ const hasEuCustomsRules = true,
2619
2635
  // United States territories that ship domestic but require customs
2620
2636
  // https://blog.stamps.com/2015/09/23/how-to-ship-packages-to-u-s-territories/
2621
2637
  isUnitedStatesTerritory$1 = true,
2638
+ isUnsupportedByUps$1 = true,
2622
2639
  supportsByoa = true;
2623
2640
  class Country {
2624
2641
  constructor(name, code, rules = {}) {
2625
- var _a, _b, _c, _d;
2642
+ var _a, _b, _c, _d, _e;
2626
2643
  this.name = name;
2627
2644
  this.code = code;
2628
2645
  this.hasEuCustomsRules = (_a = rules.hasEuCustomsRules) !== null && _a !== void 0 ? _a : false;
2629
2646
  this.hasProvinces = (_b = rules.hasProvinces) !== null && _b !== void 0 ? _b : false;
2630
2647
  this.isUnitedStatesTerritory = (_c = rules.isUnitedStatesTerritory) !== null && _c !== void 0 ? _c : false;
2631
2648
  this.supportsByoa = (_d = rules.supportsByoa) !== null && _d !== void 0 ? _d : false;
2649
+ this.isUnsupportedByUps = (_e = rules.isUnsupportedByUps) !== null && _e !== void 0 ? _e : false;
2632
2650
  }
2633
2651
  }
2634
2652
  const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands", "AX"), new Country("Albania", "AL"), new Country("Algeria", "DZ"), new Country("American Samoa", "AS", {
@@ -2649,7 +2667,9 @@ const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands"
2649
2667
  supportsByoa
2650
2668
  }), new Country("Burkina Faso", "BF"), new Country("Burundi", "BI"), new Country("Canada", "CA", {
2651
2669
  hasProvinces
2652
- }), new Country("Cambodia", "KH"), new Country("Cameroon", "CM"), new Country("Cape Verde Islands", "CV"), new Country("Cayman Islands", "KY"), new Country("Central African Republic", "CF"), new Country("Chad", "TD"), new Country("Chile", "CL"), new Country("China", "CN"), new Country("Christmas Island", "CX"), new Country("Cocos(Keeling) Islands", "CC"), new Country("Colombia", "CO"), new Country("Comoros", "KM"), new Country("Congo", "CG"), new Country("Congo, The Democratic Republic of", "CD"), new Country("Cook Islands", "CK"), new Country("Costa Rica", "CR"), new Country("Croatia", "HR", {
2670
+ }), new Country("Cambodia", "KH", {
2671
+ isUnsupportedByUps: isUnsupportedByUps$1
2672
+ }), new Country("Cameroon", "CM"), new Country("Cape Verde Islands", "CV"), new Country("Cayman Islands", "KY"), new Country("Central African Republic", "CF"), new Country("Chad", "TD"), new Country("Chile", "CL"), new Country("China", "CN"), new Country("Christmas Island", "CX"), new Country("Cocos(Keeling) Islands", "CC"), new Country("Colombia", "CO"), new Country("Comoros", "KM"), new Country("Congo", "CG"), new Country("Congo, The Democratic Republic of", "CD"), new Country("Cook Islands", "CK"), new Country("Costa Rica", "CR"), new Country("Croatia", "HR", {
2653
2673
  hasEuCustomsRules,
2654
2674
  supportsByoa
2655
2675
  }), new Country("Cuba", "CU"), new Country("Curacao", "CW"), new Country("Cyprus", "CY", {
@@ -2710,7 +2730,9 @@ const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands"
2710
2730
  }), new Country("Moldova", "MD"), new Country("Monaco", "MC"), new Country("Mongolia", "MN"), new Country("Montenegro", "ME"), new Country("Montserrat", "MS"), new Country("Morocco", "MA"), new Country("Mozambique", "MZ"), new Country("Myanmar", "MM"), new Country("Namibia", "NA"), new Country("Nauru", "NR"), new Country("Nepal", "NP"), new Country("Netherlands", "NL", {
2711
2731
  hasEuCustomsRules,
2712
2732
  supportsByoa
2713
- }), new Country("Netherlands Antilles", "AN"), new Country("New Caledonia", "NC"), new Country("New Zealand", "NZ", {
2733
+ }), new Country("Netherlands Antilles", "AN"), new Country("New Caledonia", "NC", {
2734
+ isUnsupportedByUps: isUnsupportedByUps$1
2735
+ }), new Country("New Zealand", "NZ", {
2714
2736
  supportsByoa
2715
2737
  }), new Country("Nicaragua", "NI"), new Country("Niger", "NE"), new Country("Nigeria", "NG"), new Country("Niue", "NU"), new Country("Norfolk Island", "NF"), new Country("North Korea", "KP"), new Country("Northern Mariana Islands", "MP", {
2716
2738
  isUnitedStatesTerritory: isUnitedStatesTerritory$1
@@ -2827,6 +2849,13 @@ const isUnitedStatesTerritory = address => {
2827
2849
  var _a, _b;
2828
2850
  return !!(((_a = countries.find(c => c.code === address.countryCode)) === null || _a === void 0 ? void 0 : _a.isUnitedStatesTerritory) || ((_b = usStates.find(s => s.code === address.stateProvince)) === null || _b === void 0 ? void 0 : _b.isUnitedStatesTerritory));
2829
2851
  };
2852
+ /**
2853
+ * @category Utilities
2854
+ */
2855
+ const isUnsupportedByUps = address => {
2856
+ var _a;
2857
+ return !!((_a = countries.find(c => c.code === address.countryCode)) === null || _a === void 0 ? void 0 : _a.isUnsupportedByUps);
2858
+ };
2830
2859
  const PO_BOX_REGEX =
2831
2860
  // eslint-disable-next-line no-useless-escape
2832
2861
  /^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i;
@@ -2839,7 +2868,7 @@ const isPoBox = addressLine => PO_BOX_REGEX.test(addressLine);
2839
2868
  */
2840
2869
  const isPoBoxAddress = address => !!(isPoBox(address.addressLine1) || address.addressLine2 && isPoBox(address.addressLine2));
2841
2870
 
2842
- var $$e = _export;
2871
+ var $$f = _export;
2843
2872
  var $includes = arrayIncludes.includes;
2844
2873
  var fails$7 = fails$q;
2845
2874
  var addToUnscopables$1 = addToUnscopables$3;
@@ -2851,7 +2880,7 @@ var BROKEN_ON_SPARSE = fails$7(function () {
2851
2880
 
2852
2881
  // `Array.prototype.includes` method
2853
2882
  // https://tc39.es/ecma262/#sec-array.prototype.includes
2854
- $$e({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2883
+ $$f({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2855
2884
  includes: function includes(el /* , fromIndex = 0 */) {
2856
2885
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2857
2886
  }
@@ -2862,6 +2891,7 @@ addToUnscopables$1('includes');
2862
2891
 
2863
2892
  const USPS_CARRIER_CODES = ["usps", "stamps_com"];
2864
2893
  const isUspsCarrier = carrierCode => USPS_CARRIER_CODES.includes(carrierCode);
2894
+ const isUpsCarrier = carrierCode => carrierCode === "ups";
2865
2895
 
2866
2896
  function convertDimensions(dimensions, {
2867
2897
  allowAllZeroes
@@ -2926,10 +2956,10 @@ const getSalesOrderItemsFromSalesOrderOrShipment = ({
2926
2956
 
2927
2957
  var tryToString$3 = tryToString$5;
2928
2958
 
2929
- var $TypeError$8 = TypeError;
2959
+ var $TypeError$9 = TypeError;
2930
2960
 
2931
2961
  var deletePropertyOrThrow$1 = function (O, P) {
2932
- if (!delete O[P]) throw $TypeError$8('Cannot delete property ' + tryToString$3(P) + ' of ' + tryToString$3(O));
2962
+ if (!delete O[P]) throw $TypeError$9('Cannot delete property ' + tryToString$3(P) + ' of ' + tryToString$3(O));
2933
2963
  };
2934
2964
 
2935
2965
  var toPropertyKey = toPropertyKey$3;
@@ -2947,13 +2977,13 @@ var lengthOfArrayLike$4 = lengthOfArrayLike$7;
2947
2977
  var createProperty$1 = createProperty$2;
2948
2978
 
2949
2979
  var $Array$1 = Array;
2950
- var max = Math.max;
2980
+ var max$1 = Math.max;
2951
2981
 
2952
2982
  var arraySliceSimple = function (O, start, end) {
2953
2983
  var length = lengthOfArrayLike$4(O);
2954
2984
  var k = toAbsoluteIndex(start, length);
2955
2985
  var fin = toAbsoluteIndex(end === undefined ? length : end, length);
2956
- var result = $Array$1(max(fin - k, 0));
2986
+ var result = $Array$1(max$1(fin - k, 0));
2957
2987
  for (var n = 0; k < fin; k++, n++) createProperty$1(result, n, O[k]);
2958
2988
  result.length = n;
2959
2989
  return result;
@@ -3020,13 +3050,13 @@ var webkit = userAgent$3.match(/AppleWebKit\/(\d+)\./);
3020
3050
 
3021
3051
  var engineWebkitVersion = !!webkit && +webkit[1];
3022
3052
 
3023
- var $$d = _export;
3024
- var uncurryThis$9 = functionUncurryThis;
3053
+ var $$e = _export;
3054
+ var uncurryThis$a = functionUncurryThis;
3025
3055
  var aCallable$7 = aCallable$a;
3026
3056
  var toObject$1 = toObject$7;
3027
3057
  var lengthOfArrayLike$3 = lengthOfArrayLike$7;
3028
3058
  var deletePropertyOrThrow = deletePropertyOrThrow$1;
3029
- var toString$6 = toString$b;
3059
+ var toString$7 = toString$c;
3030
3060
  var fails$6 = fails$q;
3031
3061
  var internalSort = arraySort;
3032
3062
  var arrayMethodIsStrict = arrayMethodIsStrict$2;
@@ -3036,8 +3066,8 @@ var V8 = engineV8Version;
3036
3066
  var WEBKIT = engineWebkitVersion;
3037
3067
 
3038
3068
  var test = [];
3039
- var nativeSort = uncurryThis$9(test.sort);
3040
- var push = uncurryThis$9(test.push);
3069
+ var nativeSort = uncurryThis$a(test.sort);
3070
+ var push = uncurryThis$a(test.push);
3041
3071
 
3042
3072
  // IE8-
3043
3073
  var FAILS_ON_UNDEFINED = fails$6(function () {
@@ -3092,13 +3122,13 @@ var getSortCompare = function (comparefn) {
3092
3122
  if (y === undefined) return -1;
3093
3123
  if (x === undefined) return 1;
3094
3124
  if (comparefn !== undefined) return +comparefn(x, y) || 0;
3095
- return toString$6(x) > toString$6(y) ? 1 : -1;
3125
+ return toString$7(x) > toString$7(y) ? 1 : -1;
3096
3126
  };
3097
3127
  };
3098
3128
 
3099
3129
  // `Array.prototype.sort` method
3100
3130
  // https://tc39.es/ecma262/#sec-array.prototype.sort
3101
- $$d({ target: 'Array', proto: true, forced: FORCED$3 }, {
3131
+ $$e({ target: 'Array', proto: true, forced: FORCED$3 }, {
3102
3132
  sort: function sort(comparefn) {
3103
3133
  if (comparefn !== undefined) aCallable$7(comparefn);
3104
3134
 
@@ -3176,9 +3206,9 @@ function formatFractionalWeight(weight) {
3176
3206
 
3177
3207
  var isObject$3 = isObject$a;
3178
3208
  var classof$3 = classofRaw$2;
3179
- var wellKnownSymbol$8 = wellKnownSymbol$j;
3209
+ var wellKnownSymbol$9 = wellKnownSymbol$k;
3180
3210
 
3181
- var MATCH$1 = wellKnownSymbol$8('match');
3211
+ var MATCH$1 = wellKnownSymbol$9('match');
3182
3212
 
3183
3213
  // `IsRegExp` abstract operation
3184
3214
  // https://tc39.es/ecma262/#sec-isregexp
@@ -3187,19 +3217,19 @@ var isRegexp = function (it) {
3187
3217
  return isObject$3(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$3(it) == 'RegExp');
3188
3218
  };
3189
3219
 
3190
- var isRegExp = isRegexp;
3220
+ var isRegExp$1 = isRegexp;
3191
3221
 
3192
- var $TypeError$7 = TypeError;
3222
+ var $TypeError$8 = TypeError;
3193
3223
 
3194
3224
  var notARegexp = function (it) {
3195
- if (isRegExp(it)) {
3196
- throw $TypeError$7("The method doesn't accept regular expressions");
3225
+ if (isRegExp$1(it)) {
3226
+ throw $TypeError$8("The method doesn't accept regular expressions");
3197
3227
  } return it;
3198
3228
  };
3199
3229
 
3200
- var wellKnownSymbol$7 = wellKnownSymbol$j;
3230
+ var wellKnownSymbol$8 = wellKnownSymbol$k;
3201
3231
 
3202
- var MATCH = wellKnownSymbol$7('match');
3232
+ var MATCH = wellKnownSymbol$8('match');
3203
3233
 
3204
3234
  var correctIsRegexpLogic = function (METHOD_NAME) {
3205
3235
  var regexp = /./;
@@ -3213,22 +3243,22 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
3213
3243
  } return false;
3214
3244
  };
3215
3245
 
3216
- var $$c = _export;
3217
- var uncurryThis$8 = functionUncurryThis;
3246
+ var $$d = _export;
3247
+ var uncurryThis$9 = functionUncurryThis;
3218
3248
  var notARegExp = notARegexp;
3219
- var requireObjectCoercible$2 = requireObjectCoercible$8;
3220
- var toString$5 = toString$b;
3249
+ var requireObjectCoercible$3 = requireObjectCoercible$9;
3250
+ var toString$6 = toString$c;
3221
3251
  var correctIsRegExpLogic = correctIsRegexpLogic;
3222
3252
 
3223
- var stringIndexOf = uncurryThis$8(''.indexOf);
3253
+ var stringIndexOf$1 = uncurryThis$9(''.indexOf);
3224
3254
 
3225
3255
  // `String.prototype.includes` method
3226
3256
  // https://tc39.es/ecma262/#sec-string.prototype.includes
3227
- $$c({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
3257
+ $$d({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
3228
3258
  includes: function includes(searchString /* , position = 0 */) {
3229
- return !!~stringIndexOf(
3230
- toString$5(requireObjectCoercible$2(this)),
3231
- toString$5(notARegExp(searchString)),
3259
+ return !!~stringIndexOf$1(
3260
+ toString$6(requireObjectCoercible$3(this)),
3261
+ toString$6(notARegExp(searchString)),
3232
3262
  arguments.length > 1 ? arguments[1] : undefined
3233
3263
  );
3234
3264
  }
@@ -3547,6 +3577,16 @@ const CheckboxInput = _a => {
3547
3577
  };
3548
3578
 
3549
3579
  const getOverrideStyles = theme => ({
3580
+ "&& .react-datepicker__aria-live": {
3581
+ // Hide aria alerts that are for screen readers in a way screen readers can still read them
3582
+ clip: "rect(0 0 0 0)",
3583
+ clipPath: "inset(50%)",
3584
+ height: "1px",
3585
+ overflow: "hidden",
3586
+ position: "absolute",
3587
+ whiteSpace: "nowrap",
3588
+ width: "1px"
3589
+ },
3550
3590
  "&& input, && span[role='button']": {
3551
3591
  cursor: "auto",
3552
3592
  fontWeight: theme.typography.fontWeight.normal
@@ -3594,6 +3634,131 @@ const CreditCardInput = fieldProps => jsxRuntime.jsx(CreditCardInputController,
3594
3634
  }
3595
3635
  }));
3596
3636
 
3637
+ var call$9 = functionCall;
3638
+ var hasOwn$2 = hasOwnProperty_1;
3639
+ var isPrototypeOf$3 = objectIsPrototypeOf;
3640
+ var regExpFlags = regexpFlags$1;
3641
+
3642
+ var RegExpPrototype$1 = RegExp.prototype;
3643
+
3644
+ var regexpGetFlags = function (R) {
3645
+ var flags = R.flags;
3646
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
3647
+ ? call$9(regExpFlags, R) : flags;
3648
+ };
3649
+
3650
+ var $$c = _export;
3651
+ var call$8 = functionCall;
3652
+ var uncurryThis$8 = functionUncurryThis;
3653
+ var requireObjectCoercible$2 = requireObjectCoercible$9;
3654
+ var isCallable$6 = isCallable$o;
3655
+ var isNullOrUndefined$3 = isNullOrUndefined$7;
3656
+ var isRegExp = isRegexp;
3657
+ var toString$5 = toString$c;
3658
+ var getMethod$3 = getMethod$6;
3659
+ var getRegExpFlags$1 = regexpGetFlags;
3660
+ var getSubstitution = getSubstitution$2;
3661
+ var wellKnownSymbol$7 = wellKnownSymbol$k;
3662
+
3663
+ var REPLACE = wellKnownSymbol$7('replace');
3664
+ var $TypeError$7 = TypeError;
3665
+ var indexOf = uncurryThis$8(''.indexOf);
3666
+ uncurryThis$8(''.replace);
3667
+ var stringSlice$2 = uncurryThis$8(''.slice);
3668
+ var max = Math.max;
3669
+
3670
+ var stringIndexOf = function (string, searchValue, fromIndex) {
3671
+ if (fromIndex > string.length) return -1;
3672
+ if (searchValue === '') return fromIndex;
3673
+ return indexOf(string, searchValue, fromIndex);
3674
+ };
3675
+
3676
+ // `String.prototype.replaceAll` method
3677
+ // https://tc39.es/ecma262/#sec-string.prototype.replaceall
3678
+ $$c({ target: 'String', proto: true }, {
3679
+ replaceAll: function replaceAll(searchValue, replaceValue) {
3680
+ var O = requireObjectCoercible$2(this);
3681
+ var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
3682
+ var position = 0;
3683
+ var endOfLastMatch = 0;
3684
+ var result = '';
3685
+ if (!isNullOrUndefined$3(searchValue)) {
3686
+ IS_REG_EXP = isRegExp(searchValue);
3687
+ if (IS_REG_EXP) {
3688
+ flags = toString$5(requireObjectCoercible$2(getRegExpFlags$1(searchValue)));
3689
+ if (!~indexOf(flags, 'g')) throw $TypeError$7('`.replaceAll` does not allow non-global regexes');
3690
+ }
3691
+ replacer = getMethod$3(searchValue, REPLACE);
3692
+ if (replacer) {
3693
+ return call$8(replacer, searchValue, O, replaceValue);
3694
+ }
3695
+ }
3696
+ string = toString$5(O);
3697
+ searchString = toString$5(searchValue);
3698
+ functionalReplace = isCallable$6(replaceValue);
3699
+ if (!functionalReplace) replaceValue = toString$5(replaceValue);
3700
+ searchLength = searchString.length;
3701
+ advanceBy = max(1, searchLength);
3702
+ position = stringIndexOf(string, searchString, 0);
3703
+ while (position !== -1) {
3704
+ replacement = functionalReplace
3705
+ ? toString$5(replaceValue(searchString, position, string))
3706
+ : getSubstitution(searchString, string, position, [], undefined, replaceValue);
3707
+ result += stringSlice$2(string, endOfLastMatch, position) + replacement;
3708
+ endOfLastMatch = position + searchLength;
3709
+ position = stringIndexOf(string, searchString, position + advanceBy);
3710
+ }
3711
+ if (endOfLastMatch < string.length) {
3712
+ result += stringSlice$2(string, endOfLastMatch);
3713
+ }
3714
+ return result;
3715
+ }
3716
+ });
3717
+
3718
+ var _a;
3719
+ let _LOCALE = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.language) !== null && _a !== void 0 ? _a : "en-US";
3720
+ const loadableLocale = _LOCALE.replaceAll("-", "");
3721
+ const loadableBackupLocale = _LOCALE.split("-")[0];
3722
+ let intlLocale = undefined;
3723
+ if (loadableLocale in Locales__namespace || loadableBackupLocale) {
3724
+ const targetLocale = loadableLocale in Locales__namespace ? loadableLocale : loadableBackupLocale;
3725
+ const l = Locales__namespace[targetLocale];
3726
+ ReactDatePicker.registerLocale(_LOCALE, l);
3727
+ intlLocale = l;
3728
+ ReactDatePicker.setDefaultLocale(_LOCALE);
3729
+ } else {
3730
+ // Really should never happen but this SHOULD revert to un-localized
3731
+ console.log(`User's navigator.language locale ${_LOCALE} could not be loaded because it was not found in date-fns.
3732
+ Backup attempt to load ${loadableBackupLocale} failed as well.
3733
+ Reverting to en-US.`);
3734
+ _LOCALE = "en-US";
3735
+ }
3736
+ const usaLocale = Locales__namespace["enUS"];
3737
+ const LOCALE = _LOCALE;
3738
+ /**
3739
+ * Parse a string in the CURRENT locale into a Date object.
3740
+ * current locale is determined by navigator.language for now
3741
+ * @param dateString
3742
+ */
3743
+ const parseLocaleDate = dateString => dateString ? dateFns.parse(dateString, "P", new Date(), intlLocale ? {
3744
+ locale: intlLocale
3745
+ } : undefined) : null;
3746
+ const parseUSADate = dateString => dateString ? dateFns.parse(dateString, "P", new Date(), {
3747
+ locale: usaLocale
3748
+ }) : null;
3749
+ /**
3750
+ *
3751
+ * Format a date into a string in the CURRENT locale.
3752
+ * current locale is determined by navigator.language for now
3753
+ * @param date
3754
+ */
3755
+ const formatLocaleDate = date => date ? dateFns.format(date, "P", {
3756
+ locale: intlLocale
3757
+ }) : null;
3758
+ const formatUSADate = date => date ? dateFns.format(date, "P", {
3759
+ locale: usaLocale
3760
+ }) : null;
3761
+
3597
3762
  function _EMOTION_STRINGIFIED_CSS_ERROR__$4() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
3598
3763
  const getPopperStyles = theme => /*#__PURE__*/css.css("padding-top:10px;z-index:10;.react-datepicker{background-color:", theme.palette.white, ";border-radius:0.25rem;box-shadow:", theme.getElevation("above").boxShadow, ";display:inline-block;font-size:1rem;position:relative;&__month-container{float:left;}&__header{border-top-left-radius:", theme.borderRadius.M, ";border-top-right-radius:", theme.borderRadius.M, ";padding:", theme.spacing(2), "px 0 ", theme.spacing(1), "px 0;position:relative;text-align:center;}&__current-month{color:", theme.palette.black, ";font-size:1rem;font-weight:600;line-height:1.25rem;margin-bottom:", theme.spacing(2), "px;}&__navigation{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:32px;justify-content:center;overflow:hidden;position:absolute;text-align:center;text-indent:-999em;top:0.688rem;width:32px;z-index:1;&--previous{left:1rem;}&--next{right:1rem;}&:hover *::before{border-color:", theme.palette.gray.light, ";}&-icon{position:relative;top:-0.125rem;width:0;&::before{border-color:", theme.palette.gray.main, ";border-style:solid;border-width:2.5px 2.5px 0 0;content:\"\";display:block;height:6px;position:absolute;top:6px;width:6px;}&--previous{right:0rem;&::before{right:-0.438rem;transform:rotate(225deg);}}&--next{left:0rem;&::before{left:-0.438rem;transform:rotate(45deg);}}}} &__month{padding:0 1rem 1rem 1rem;text-align:center;}&__week{white-space:nowrap;} &__day{color:", theme.palette.black, ";cursor:pointer;display:inline-block;font-size:1rem;line-height:2rem;margin:0.25rem;text-align:center;width:2rem;&:hover[aria-selected=\"false\"]:not(&--disabled){background-color:", theme.palette.gray.ultraLight, ";border-radius:0.25rem;}&-name{color:", theme.palette.gray.main, ";display:inline-block;font-size:0.75rem;font-weight:600;line-height:1rem;margin:0 0.25rem;text-align:center;width:2rem;}&-names{white-space:nowrap;}&--disabled{color:", theme.palette.gray.main, ";cursor:default;&:hover{background-color:transparent;}}&--today[aria-selected=\"false\"]{position:relative;&::before{border-bottom:0.125rem solid ", theme.palette.primary.main, ";content:\"\";display:block;inset:0;position:absolute;}}&--highlighted{background-color:#3dcc4a;border-radius:0.25rem;color:#fff;&:hover{background-color:", theme.palette.secondary.main, ";}&-custom-1{color:magenta;}&-custom-2{color:green;}}&--selected,&--in-selecting-range,&--in-range{background-color:", theme.palette.primary.main, ";border-radius:0.25rem;color:#fff;&[aria-selected=\"true\"]{cursor:default;}&[aria-selected=\"false\"]:hover{background-color:", theme.palette.primary.dark, ";}}&--in-selecting-range:not(&--in-range){background-color:rgba(33, 107, 165, 0.5);}&--keyboard-selected{border-radius:0.25rem;outline:0.125rem solid ", theme.palette.primary.main, ";} &--selected:not(&--keyboard-selected):focus-visible{outline:0.125rem solid ", theme.palette.primary.main, ";}} &__input-container{display:inline-block;position:relative;width:100%;}}" + (process.env.NODE_ENV === "production" ? "" : ";label:getPopperStyles;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRhdGUtcGlja2VyLnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDOEMiLCJmaWxlIjoiZGF0ZS1waWNrZXIuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL2Nzc1wiO1xyXG5leHBvcnQgY29uc3QgZ2V0UG9wcGVyU3R5bGVzID0gKHRoZW1lKSA9PiBjc3MgYFxuICBwYWRkaW5nLXRvcDogMTBweDtcbiAgei1pbmRleDogMTA7XG4gIC5yZWFjdC1kYXRlcGlja2VyIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiAke3RoZW1lLnBhbGV0dGUud2hpdGV9O1xuICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgYm94LXNoYWRvdzogJHt0aGVtZS5nZXRFbGV2YXRpb24oXCJhYm92ZVwiKS5ib3hTaGFkb3d9O1xuICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICBmb250LXNpemU6IDFyZW07XG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICZfX21vbnRoLWNvbnRhaW5lciB7XG4gICAgICBmbG9hdDogbGVmdDtcbiAgICB9XG4gICAgJl9faGVhZGVyIHtcbiAgICAgIGJvcmRlci10b3AtbGVmdC1yYWRpdXM6ICR7dGhlbWUuYm9yZGVyUmFkaXVzLk19O1xuICAgICAgYm9yZGVyLXRvcC1yaWdodC1yYWRpdXM6ICR7dGhlbWUuYm9yZGVyUmFkaXVzLk19O1xuICAgICAgcGFkZGluZzogJHt0aGVtZS5zcGFjaW5nKDIpfXB4IDAgJHt0aGVtZS5zcGFjaW5nKDEpfXB4IDA7XG4gICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgfVxuICAgICZfX2N1cnJlbnQtbW9udGgge1xuICAgICAgY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5ibGFja307XG4gICAgICBmb250LXNpemU6IDFyZW07XG4gICAgICBmb250LXdlaWdodDogNjAwO1xuICAgICAgbGluZS1oZWlnaHQ6IDEuMjVyZW07XG4gICAgICBtYXJnaW4tYm90dG9tOiAke3RoZW1lLnNwYWNpbmcoMil9cHg7XG4gICAgfVxuICAgICZfX25hdmlnYXRpb24ge1xuICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgIGJhY2tncm91bmQ6IG5vbmU7XG4gICAgICBib3JkZXI6IG5vbmU7XG4gICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgaGVpZ2h0OiAzMnB4O1xuICAgICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgdGV4dC1pbmRlbnQ6IC05OTllbTtcbiAgICAgIHRvcDogMC42ODhyZW07XG4gICAgICB3aWR0aDogMzJweDtcbiAgICAgIHotaW5kZXg6IDE7XG4gICAgICAmLS1wcmV2aW91cyB7XG4gICAgICAgIGxlZnQ6IDFyZW07XG4gICAgICB9XG4gICAgICAmLS1uZXh0IHtcbiAgICAgICAgcmlnaHQ6IDFyZW07XG4gICAgICB9XG4gICAgICAmOmhvdmVyICo6OmJlZm9yZSB7XG4gICAgICAgIGJvcmRlci1jb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkubGlnaHR9O1xuICAgICAgfVxuICAgICAgJi1pY29uIHtcbiAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICAgICB0b3A6IC0wLjEyNXJlbTtcbiAgICAgICAgd2lkdGg6IDA7XG4gICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgYm9yZGVyLWNvbG9yOiAke3RoZW1lLnBhbGV0dGUuZ3JheS5tYWlufTtcbiAgICAgICAgICBib3JkZXItc3R5bGU6IHNvbGlkO1xuICAgICAgICAgIGJvcmRlci13aWR0aDogMi41cHggMi41cHggMCAwO1xuICAgICAgICAgIGNvbnRlbnQ6IFwiXCI7XG4gICAgICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgICAgICAgaGVpZ2h0OiA2cHg7XG4gICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgICAgIHRvcDogNnB4O1xuICAgICAgICAgIHdpZHRoOiA2cHg7XG4gICAgICAgIH1cbiAgICAgICAgJi0tcHJldmlvdXMge1xuICAgICAgICAgIHJpZ2h0OiAwcmVtO1xuICAgICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgICByaWdodDogLTAuNDM4cmVtO1xuICAgICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoMjI1ZGVnKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgJi0tbmV4dCB7XG4gICAgICAgICAgbGVmdDogMHJlbTtcbiAgICAgICAgICAmOjpiZWZvcmUge1xuICAgICAgICAgICAgbGVmdDogLTAuNDM4cmVtO1xuICAgICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoNDVkZWcpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICAkeyAvKiAjZW5kcmVnaW9uICovXCJcIn1cbiAgICAmX19tb250aCB7XG4gICAgICBwYWRkaW5nOiAwIDFyZW0gMXJlbSAxcmVtO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgIH1cbiAgICAmX193ZWVrIHtcbiAgICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgfVxuICAgICR7IC8qICNyZWdpb24gWyByZ2JhKDEyMCw1MCwxNTAsMC4xKSBdIERheXMgKi9cIlwifVxuICAgICZfX2RheSB7XG4gICAgICBjb2xvcjogJHt0aGVtZS5wYWxldHRlLmJsYWNrfTtcbiAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgIGZvbnQtc2l6ZTogMXJlbTtcbiAgICAgIGxpbmUtaGVpZ2h0OiAycmVtO1xuICAgICAgbWFyZ2luOiAwLjI1cmVtO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgd2lkdGg6IDJyZW07XG4gICAgICAmOmhvdmVyW2FyaWEtc2VsZWN0ZWQ9XCJmYWxzZVwiXTpub3QoJi0tZGlzYWJsZWQpIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkudWx0cmFMaWdodH07XG4gICAgICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgICB9XG4gICAgICAmLW5hbWUge1xuICAgICAgICBjb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkubWFpbn07XG4gICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgICAgZm9udC1zaXplOiAwLjc1cmVtO1xuICAgICAgICBmb250LXdlaWdodDogNjAwO1xuICAgICAgICBsaW5lLWhlaWdodDogMXJlbTtcbiAgICAgICAgbWFyZ2luOiAwIDAuMjVyZW07XG4gICAgICAgIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgICAgICAgd2lkdGg6IDJyZW07XG4gICAgICB9XG4gICAgICAmLW5hbWVzIHtcbiAgICAgICAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgICAgIH1cbiAgICAgICYtLWRpc2FibGVkIHtcbiAgICAgICAgY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5ncmF5Lm1haW59O1xuICAgICAgICBjdXJzb3I6IGRlZmF1bHQ7XG4gICAgICAgICY6aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS10b2RheVthcmlhLXNlbGVjdGVkPVwiZmFsc2VcIl0ge1xuICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgYm9yZGVyLWJvdHRvbTogMC4xMjVyZW0gc29saWQgJHt0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbn07XG4gICAgICAgICAgY29udGVudDogXCJcIjtcbiAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgICBpbnNldDogMDtcbiAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgICYtLWhpZ2hsaWdodGVkIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogIzNkY2M0YTtcbiAgICAgICAgYm9yZGVyLXJhZGl1czogMC4yNXJlbTtcbiAgICAgICAgY29sb3I6ICNmZmY7XG4gICAgICAgICY6aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5zZWNvbmRhcnkubWFpbn07XG4gICAgICAgIH1cbiAgICAgICAgJi1jdXN0b20tMSB7XG4gICAgICAgICAgY29sb3I6IG1hZ2VudGE7XG4gICAgICAgIH1cbiAgICAgICAgJi1jdXN0b20tMiB7XG4gICAgICAgICAgY29sb3I6IGdyZWVuO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS1zZWxlY3RlZCxcbiAgICAgICYtLWluLXNlbGVjdGluZy1yYW5nZSxcbiAgICAgICYtLWluLXJhbmdlIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbn07XG4gICAgICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgICAgIGNvbG9yOiAjZmZmO1xuICAgICAgICAmW2FyaWEtc2VsZWN0ZWQ9XCJ0cnVlXCJdIHtcbiAgICAgICAgICBjdXJzb3I6IGRlZmF1bHQ7XG4gICAgICAgIH1cbiAgICAgICAgJlthcmlhLXNlbGVjdGVkPVwiZmFsc2VcIl06aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5wcmltYXJ5LmRhcmt9O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS1pbi1zZWxlY3RpbmctcmFuZ2U6bm90KCYtLWluLXJhbmdlKSB7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMzMsIDEwNywgMTY1LCAwLjUpO1xuICAgICAgfVxuICAgICAgJi0ta2V5Ym9hcmQtc2VsZWN0ZWQge1xuICAgICAgICBib3JkZXItcmFkaXVzOiAwLjI1cmVtO1xuICAgICAgICBvdXRsaW5lOiAwLjEyNXJlbSBzb2xpZCAke3RoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWlufTtcbiAgICAgIH1cbiAgICAgICR7XHJcbi8qIFJEUCBkb2Vzbid0IGF0dGFjaCB0aGUgLS1rZXlib2FyZC1zZWxlY3RlZCBjbGFzcyBpZiB5b3UgYXJyb3ctbmF2aWdhdGUgdG8gdGhlIGN1cnJlbnRseVxyXG4gICAgIHNlbGVjdGVkIGRhdGUsIHdoaWNoIHdvdWxkIHJlc3VsdCBpbiBhIGRlZmF1bHQgYnJvd3NlciBmb2N1cy1yaW5nICovIFwiXCJ9XG4gICAgICAmLS1zZWxlY3RlZDpub3QoJi0ta2V5Ym9hcmQtc2VsZWN0ZWQpOmZvY3VzLXZpc2libGUge1xuICAgICAgICBvdXRsaW5lOiAwLjEyNXJlbSBzb2xpZCAke3RoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWlufTtcbiAgICAgIH1cbiAgICB9XG4gICAgJHsgLyogI2VuZHJlZ2lvbiAqL1wiXCJ9XG4gICAgJl9faW5wdXQtY29udGFpbmVyIHtcbiAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICAgIHdpZHRoOiAxMDAlO1xuICAgIH1cbiAgfVxuYDtcclxuZXhwb3J0IGNvbnN0IGdldFdyYXBwZXJTdHlsZXMgPSAodGhlbWUpID0+IGNzcyBgXG4gIGJvcmRlcjogMDtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBwYWRkaW5nOiAwO1xuICB3aWR0aDogMTAwJTtcbiAgei1pbmRleDogMjAwO1xuYDtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9ZGF0ZS1waWNrZXIuc3R5bGVzLmpzLm1hcCJdfQ== */");
3599
3764
  const getWrapperStyles = theme => /*#__PURE__*/css.css(process.env.NODE_ENV === "production" ? {
@@ -3612,28 +3777,43 @@ const DatePicker = fieldProps => {
3612
3777
  const datePickerRef = React.useRef(null);
3613
3778
  return jsxRuntime.jsx(DatePickerController, Object.assign({}, fieldProps, {
3614
3779
  children: _a => {
3615
- var {
3616
- ref
3617
- } = _a,
3618
- datePickerProps = __rest(_a, ["ref"]);
3780
+ var _datePickerProps = __rest(_a, ["ref"]);
3781
+ // Lens the form's usa date string into a locale date string
3782
+ // for the now localized date picker
3783
+ const onChange = date => {
3784
+ var _a;
3785
+ (_a = _datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(_datePickerProps, formatUSADate(parseLocaleDate(date)));
3786
+ };
3787
+ const value = formatLocaleDate(parseUSADate(_datePickerProps.value));
3788
+ const datePickerProps = Object.assign(Object.assign({}, _datePickerProps), {
3789
+ onChange,
3790
+ value
3791
+ });
3619
3792
  return jsxRuntime.jsx("div", Object.assign({
3620
- css: getOverrideStyles
3793
+ css: getOverrideStyles(theme)
3621
3794
  }, {
3622
- children: jsxRuntime.jsx(ReactDatePicker__default["default"], Object.assign({}, datePickerProps, {
3623
- customInput: /*#__PURE__*/React.createElement(function InputWrapper(_a) {
3795
+ children: jsxRuntime.jsx(ReactDatePicker__default["default"], Object.assign({
3796
+ locale: LOCALE
3797
+ }, datePickerProps, {
3798
+ customInput: /*#__PURE__*/React.createElement( /*#__PURE__*/React.forwardRef(function InputWrapper(_a, forwardedRef) {
3624
3799
  var _b;
3625
3800
  var {
3626
3801
  value
3627
3802
  } = _a,
3628
- props = __rest(_a, ["value"]);
3629
- const innerRef = React.useRef(null);
3630
- const refInterceptor = React.useCallback(node => {
3631
- ref(node);
3632
- innerRef.current = node;
3633
- }, []);
3634
- const isFocused = (_b = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
3635
- return jsxRuntime.jsx(giger.Input, Object.assign({}, props, {
3636
- ref: refInterceptor,
3803
+ inputProps = __rest(_a, ["value"]);
3804
+ if (typeof forwardedRef !== "function") throw new Error("DatePicker requires a callback-ref and should always be passing one (this should never happen)");
3805
+ // The forwarded ref that RDP supplies is a callback ref; we need a *mutable* ref in order to check if the DOM element is focused
3806
+ const mutableRef = React.useRef(null);
3807
+ // We wrap RDP's forwarded ref in order to setup our own mutable ref
3808
+ const callbackRef = React.useCallback(node => {
3809
+ // Invoke RDP's forwarded ref
3810
+ forwardedRef(node);
3811
+ // Setup our mutable ref
3812
+ if (node) mutableRef.current = node;
3813
+ }, [forwardedRef]);
3814
+ const isFocused = (_b = mutableRef.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
3815
+ return jsxRuntime.jsx(giger.Input, Object.assign({}, inputProps, {
3816
+ ref: callbackRef,
3637
3817
  rightContent: jsxRuntime.jsx(giger.Icon
3638
3818
  // Internally, RDP applies this class to the Input, but the Icon is absolute / in its own context
3639
3819
  , {
@@ -3648,9 +3828,9 @@ const DatePicker = fieldProps => {
3648
3828
  return (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(!datePickerRef.current.isCalendarOpen());
3649
3829
  }
3650
3830
  }),
3651
- value: isFocused || value !== new Date().toLocaleDateString("en-US") ? value : datePickerProps.placeholderText
3831
+ value: isFocused || value !== formatLocaleDate(new Date()) ? value : datePickerProps.placeholderText
3652
3832
  }));
3653
- }),
3833
+ })),
3654
3834
  "data-testid": fieldProps.name ? humps.camelize(fieldProps.name) : "date",
3655
3835
  onCalendarOpen: () => {
3656
3836
  var _a;
@@ -3659,13 +3839,13 @@ const DatePicker = fieldProps => {
3659
3839
  onChange: (date, event) => {
3660
3840
  var _a;
3661
3841
  event === null || event === void 0 ? void 0 : event.preventDefault();
3662
- (_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? date.toLocaleDateString("en-US") : null);
3842
+ (_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? formatLocaleDate(date) : null);
3663
3843
  },
3664
3844
  popperClassName: getPopperStyles(theme),
3665
3845
  popperPlacement: "bottom-end",
3666
3846
  preventOpenOnFocus: true,
3667
3847
  ref: datePickerRef,
3668
- selected: datePickerProps.value ? new Date(datePickerProps.value) : null,
3848
+ selected: parseLocaleDate(datePickerProps.value),
3669
3849
  showPopperArrow: false,
3670
3850
  wrapperClassName: getWrapperStyles()
3671
3851
  }))
@@ -3775,7 +3955,7 @@ var flattenIntoArray_1 = flattenIntoArray$1;
3775
3955
 
3776
3956
  var uncurryThis$6 = functionUncurryThis;
3777
3957
  var fails$5 = fails$q;
3778
- var isCallable$5 = isCallable$n;
3958
+ var isCallable$5 = isCallable$o;
3779
3959
  var classof$1 = classof$6;
3780
3960
  var getBuiltIn$3 = getBuiltIn$8;
3781
3961
  var inspectSource$1 = inspectSource$3;
@@ -3829,7 +4009,7 @@ var isConstructor$2 = !construct || fails$5(function () {
3829
4009
  var isArray = isArray$2;
3830
4010
  var isConstructor$1 = isConstructor$2;
3831
4011
  var isObject$2 = isObject$a;
3832
- var wellKnownSymbol$6 = wellKnownSymbol$j;
4012
+ var wellKnownSymbol$6 = wellKnownSymbol$k;
3833
4013
 
3834
4014
  var SPECIES$3 = wellKnownSymbol$6('species');
3835
4015
  var $Array = Array;
@@ -4010,8 +4190,8 @@ var uncurryThis$5 = functionUncurryThis;
4010
4190
  var thisNumberValue$1 = uncurryThis$5(1.0.valueOf);
4011
4191
 
4012
4192
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$6;
4013
- var toString$4 = toString$b;
4014
- var requireObjectCoercible$1 = requireObjectCoercible$8;
4193
+ var toString$4 = toString$c;
4194
+ var requireObjectCoercible$1 = requireObjectCoercible$9;
4015
4195
 
4016
4196
  var $RangeError$1 = RangeError;
4017
4197
 
@@ -4160,7 +4340,7 @@ $$a({ target: 'Number', proto: true, forced: FORCED$2 }, {
4160
4340
  var global$a = global$p;
4161
4341
  var fails$3 = fails$q;
4162
4342
  var uncurryThis$3 = functionUncurryThis;
4163
- var toString$3 = toString$b;
4343
+ var toString$3 = toString$c;
4164
4344
  var trim$1 = stringTrim.trim;
4165
4345
  var whitespaces$1 = whitespaces$4;
4166
4346
 
@@ -4320,7 +4500,7 @@ const MoneyInput = _a => {
4320
4500
  var global$9 = global$p;
4321
4501
  var fails$2 = fails$q;
4322
4502
  var uncurryThis$2 = functionUncurryThis;
4323
- var toString$2 = toString$b;
4503
+ var toString$2 = toString$c;
4324
4504
  var trim = stringTrim.trim;
4325
4505
  var whitespaces = whitespaces$4;
4326
4506
 
@@ -4393,23 +4573,10 @@ const NumberInput = _a => {
4393
4573
  }));
4394
4574
  };
4395
4575
 
4396
- var call$8 = functionCall;
4397
- var hasOwn$2 = hasOwnProperty_1;
4398
- var isPrototypeOf$3 = objectIsPrototypeOf;
4399
- var regExpFlags = regexpFlags$1;
4400
-
4401
- var RegExpPrototype$1 = RegExp.prototype;
4402
-
4403
- var regexpGetFlags = function (R) {
4404
- var flags = R.flags;
4405
- return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
4406
- ? call$8(regExpFlags, R) : flags;
4407
- };
4408
-
4409
4576
  var PROPER_FUNCTION_NAME = functionName.PROPER;
4410
4577
  var defineBuiltIn$2 = defineBuiltIn$7;
4411
4578
  var anObject$6 = anObject$f;
4412
- var $toString = toString$b;
4579
+ var $toString = toString$c;
4413
4580
  var fails$1 = fails$q;
4414
4581
  var getRegExpFlags = regexpGetFlags;
4415
4582
 
@@ -5208,17 +5375,43 @@ const useInsuranceProviderOptions = (insuranceAccount, features) => {
5208
5375
  }), [t, insuranceAccount, features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance, features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance]);
5209
5376
  };
5210
5377
 
5211
- let _$1 = t => t,
5212
- _t$1,
5213
- _t2$1;
5378
+ const useShipmentMetadata = shipment => {
5379
+ const isInternational = React.useMemo(() => {
5380
+ return shipment ? getIsInternationalShipment(shipment) : false;
5381
+ }, [shipment]);
5382
+ const isPoBox = React.useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5383
+ const isUnsupportedUpsCountry = React.useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isUnsupportedByUps(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5384
+ const isCustomsRequired = React.useMemo(() => {
5385
+ return shipment ? getIsCustomsRequiredForShipment(shipment) : false;
5386
+ }, [shipment]);
5387
+ const isContentDescriptionRequired = React.useMemo(() => {
5388
+ var _a;
5389
+ return shipment && ((_a = shipment.shipFrom) === null || _a === void 0 ? void 0 : _a.countryCode) === "MX" || (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo.countryCode) === "MX";
5390
+ }, [shipment]);
5391
+ return {
5392
+ isContentDescriptionRequired,
5393
+ isCustomsRequired,
5394
+ isInternational,
5395
+ isPoBox,
5396
+ isUnsupportedUpsCountry
5397
+ };
5398
+ };
5399
+
5400
+ let _$2 = t => t,
5401
+ _t$2,
5402
+ _t2$2;
5214
5403
  const findGenericPackageFromCarriers = carriers => {
5215
5404
  const carrier = carriers.find(c => c.packages.some(p => p.packageCode === "package"));
5216
5405
  return carrier === null || carrier === void 0 ? void 0 : carrier.packages.find(p => p.packageCode === "package");
5217
5406
  };
5218
- const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5407
+ const usePackageOptions = (carriers, customPackageTypes, shipment) => {
5219
5408
  const {
5220
5409
  t
5221
5410
  } = reactI18next.useTranslation("common");
5411
+ const {
5412
+ isPoBox,
5413
+ isUnsupportedUpsCountry
5414
+ } = useShipmentMetadata(shipment);
5222
5415
  return React.useMemo(() => {
5223
5416
  if (!carriers) return undefined;
5224
5417
  // Dictionary to lookup the uniqueness of each carrierCode
@@ -5227,7 +5420,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5227
5420
  }));
5228
5421
  const genericPackage = findGenericPackageFromCarriers(carriers);
5229
5422
  const packageOptions = [...(genericPackage ? [{
5230
- label: t(_t$1 || (_t$1 = _$1`packageCategories.browseRates`)),
5423
+ label: t(_t$2 || (_t$2 = _$2`packageCategories.browseRates`)),
5231
5424
  options: [{
5232
5425
  label: t("packageCodes.package"),
5233
5426
  value: {
@@ -5235,7 +5428,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5235
5428
  }
5236
5429
  }]
5237
5430
  }] : []), ...((customPackageTypes === null || customPackageTypes === void 0 ? void 0 : customPackageTypes.length) ? [{
5238
- label: t(_t2$1 || (_t2$1 = _$1`packageCategories.myCustomPackages`)),
5431
+ label: t(_t2$2 || (_t2$2 = _$2`packageCategories.myCustomPackages`)),
5239
5432
  options: customPackageTypes.sort((a, b) => a.name.localeCompare(b.name)).map(({
5240
5433
  dimensions,
5241
5434
  name,
@@ -5252,7 +5445,8 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5252
5445
  return carriers.reduce((options, carrier) => {
5253
5446
  if (carrier.packages.length === 0) return options;
5254
5447
  // Filter out non-USPS packages for PO Box shipments
5255
- if (!isUspsCarrier(carrier.carrierCode) && poBox) return options;
5448
+ // Filter out UPS packages for unsupported countries
5449
+ if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
5256
5450
  return [...options, {
5257
5451
  // Check the uniqueness of the carrierCode, if unique default to friendlyName and if non-unique use nickname.
5258
5452
  label: isUniqueByCarrierCode[carrier.carrierCode] ? carrier.friendlyName : carrier.nickname,
@@ -5268,24 +5462,27 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5268
5462
  value: carrier.carrierId
5269
5463
  }];
5270
5464
  }, packageOptions);
5271
- }, [carriers, customPackageTypes, poBox, t]);
5465
+ }, [carriers, customPackageTypes, isPoBox, isUnsupportedUpsCountry, t]);
5272
5466
  };
5273
5467
 
5274
5468
  const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) => {
5275
- const isInternationalShipment = React.useMemo(() => {
5276
- return shipment ? getIsInternationalShipment(shipment) : false;
5277
- }, [shipment]);
5278
- const isPoBoxShipment = React.useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5279
5469
  const carriersById = React.useMemo(() => createDictionary(carriers, c => ({
5280
5470
  [c.carrierId]: c
5281
5471
  })), [carriers]);
5472
+ const {
5473
+ isInternational,
5474
+ isPoBox,
5475
+ isUnsupportedUpsCountry
5476
+ } = useShipmentMetadata(shipment);
5282
5477
  return React.useMemo(() => {
5283
5478
  return (rates !== null && rates !== void 0 ? rates : []).filter(r => {
5284
5479
  const carrier = carriersById[r.carrierId];
5285
5480
  const service = carrier === null || carrier === void 0 ? void 0 : carrier.services.find(s => s.serviceCode === r.serviceCode);
5286
- return (service === null || service === void 0 ? void 0 : service.domestic) === !isInternationalShipment && (!enableGlobalPostFiltering || !r.serviceCode.includes("globalpost_")) && (
5481
+ return (service === null || service === void 0 ? void 0 : service.domestic) === !isInternational && (!enableGlobalPostFiltering || !r.serviceCode.includes("globalpost_")) && (
5287
5482
  // Filter out non-USPS carriers for PO Box shipments
5288
- service && isUspsCarrier(service.carrierCode) || !isPoBoxShipment);
5483
+ service && isUspsCarrier(service.carrierCode) || !isPoBox) && (
5484
+ // Filter out UPS for unsupported countries
5485
+ service && !isUpsCarrier(service.carrierCode) || !isUnsupportedUpsCountry);
5289
5486
  }).sort((a, b) => getTotalRateAmount(a) - getTotalRateAmount(b)).map(r => {
5290
5487
  var _a, _b;
5291
5488
  const balance = (_a = carriersById[r.carrierId]) === null || _a === void 0 ? void 0 : _a.balance;
@@ -5297,18 +5494,25 @@ const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) =>
5297
5494
  requiresFundedAmount
5298
5495
  });
5299
5496
  });
5300
- }, [carriersById, enableGlobalPostFiltering, isInternationalShipment, isPoBoxShipment, rates]);
5497
+ }, [carriersById, enableGlobalPostFiltering, isInternational, isPoBox, isUnsupportedUpsCountry, rates]);
5301
5498
  };
5302
5499
 
5303
- const useServiceCodeOptions = (carriers, domestic, poBox) => {
5500
+ const useServiceCodeOptions = (carriers, shipment) => {
5501
+ const {
5502
+ isInternational,
5503
+ isPoBox,
5504
+ isUnsupportedUpsCountry
5505
+ } = useShipmentMetadata(shipment);
5304
5506
  return React.useMemo(() => {
5305
5507
  // Dictionary to lookup the uniqueness of each carrierCode
5306
5508
  const isUniqueByCarrierCode = createDictionary(carriers, (c, partialResults) => ({
5307
5509
  [c.carrierCode]: partialResults[c.carrierCode] === undefined
5308
5510
  }));
5309
5511
  return (carriers !== null && carriers !== void 0 ? carriers : []).reduce((options, carrier) => {
5310
- if (!isUspsCarrier(carrier.carrierCode) && poBox) return options;
5311
- const services = carrier.services.filter(s => s.domestic === domestic &&
5512
+ // Filter out non-USPS service for PO Box shipments
5513
+ // Filter out UPS service for unsupported countries
5514
+ if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
5515
+ const services = carrier.services.filter(s => s.domestic === !isInternational &&
5312
5516
  // TODO: Pending LMNT-418, GlobalPost filtering should be wrapped in FF
5313
5517
  !s.serviceCode.includes("globalpost_"));
5314
5518
  if (services.length === 0) return options;
@@ -5326,7 +5530,7 @@ const useServiceCodeOptions = (carriers, domestic, poBox) => {
5326
5530
  value: carrier.carrierId
5327
5531
  }];
5328
5532
  }, []);
5329
- }, [carriers, domestic, poBox]);
5533
+ }, [carriers, isInternational, isPoBox, isUnsupportedUpsCountry]);
5330
5534
  };
5331
5535
 
5332
5536
  const getContainerStyles = theme => /*#__PURE__*/react.css({
@@ -5385,13 +5589,16 @@ const createCategoryFromShippingPresets = (categoryName, presets) => presets ? [
5385
5589
  const useShippingPresetsOptions = ({
5386
5590
  platform,
5387
5591
  user
5388
- } = {}, isInternationalShipment) => {
5592
+ } = {}, shipment) => {
5389
5593
  const {
5390
5594
  t
5391
5595
  } = reactI18next.useTranslation();
5392
- return React.useMemo(() => [...createCategoryFromShippingPresets(t("shippingPresets.user"), isInternationalShipment ? user === null || user === void 0 ? void 0 : user.international : user === null || user === void 0 ? void 0 : user.domestic),
5596
+ const {
5597
+ isInternational
5598
+ } = useShipmentMetadata(shipment);
5599
+ return React.useMemo(() => [...createCategoryFromShippingPresets(t("shippingPresets.user"), isInternational ? user === null || user === void 0 ? void 0 : user.international : user === null || user === void 0 ? void 0 : user.domestic),
5393
5600
  // TODO - platform name should probably be a platform-specific environmental variable ?
5394
- ...createCategoryFromShippingPresets(t("shippingPresets.platform"), isInternationalShipment ? platform === null || platform === void 0 ? void 0 : platform.international : platform === null || platform === void 0 ? void 0 : platform.domestic)], [isInternationalShipment, platform, t, user]);
5601
+ ...createCategoryFromShippingPresets(t("shippingPresets.platform"), isInternational ? platform === null || platform === void 0 ? void 0 : platform.international : platform === null || platform === void 0 ? void 0 : platform.domestic)], [isInternational, platform, t, user]);
5395
5602
  };
5396
5603
 
5397
5604
  const useStateCodeOptions = domestic => React.useMemo(() => usStates.flatMap(v => !domestic || !v.isMilitary && !v.isUnitedStatesTerritory ? {
@@ -5668,7 +5875,7 @@ const useRunOnceOnTrue = conditionalEffect => {
5668
5875
  */
5669
5876
  const useToggle = (initialValue = false) => React.useReducer((prev, next) => next !== undefined && typeof next !== "object" ? next : !prev, initialValue);
5670
5877
 
5671
- var wellKnownSymbol$5 = wellKnownSymbol$j;
5878
+ var wellKnownSymbol$5 = wellKnownSymbol$k;
5672
5879
  var Iterators$1 = iterators;
5673
5880
 
5674
5881
  var ITERATOR$2 = wellKnownSymbol$5('iterator');
@@ -5680,10 +5887,10 @@ var isArrayIteratorMethod$1 = function (it) {
5680
5887
  };
5681
5888
 
5682
5889
  var classof = classof$6;
5683
- var getMethod$2 = getMethod$5;
5684
- var isNullOrUndefined$2 = isNullOrUndefined$6;
5890
+ var getMethod$2 = getMethod$6;
5891
+ var isNullOrUndefined$2 = isNullOrUndefined$7;
5685
5892
  var Iterators = iterators;
5686
- var wellKnownSymbol$4 = wellKnownSymbol$j;
5893
+ var wellKnownSymbol$4 = wellKnownSymbol$k;
5687
5894
 
5688
5895
  var ITERATOR$1 = wellKnownSymbol$4('iterator');
5689
5896
 
@@ -5709,7 +5916,7 @@ var getIterator$1 = function (argument, usingIterator) {
5709
5916
 
5710
5917
  var call$6 = functionCall;
5711
5918
  var anObject$4 = anObject$f;
5712
- var getMethod$1 = getMethod$5;
5919
+ var getMethod$1 = getMethod$6;
5713
5920
 
5714
5921
  var iteratorClose$1 = function (iterator, kind, value) {
5715
5922
  var innerResult, innerError;
@@ -5957,7 +6164,7 @@ const AddressParser = ({
5957
6164
  }));
5958
6165
  };
5959
6166
 
5960
- const styles$m = createStyles({
6167
+ const styles$o = createStyles({
5961
6168
  grow: {
5962
6169
  flexGrow: 1
5963
6170
  },
@@ -6057,13 +6264,13 @@ const AddressFields = ({
6057
6264
  },
6058
6265
  options: countryCodeOptions
6059
6266
  }), jsxRuntime.jsxs("div", Object.assign({
6060
- css: styles$m.stateZipWrapper
6267
+ css: styles$o.stateZipWrapper
6061
6268
  }, {
6062
6269
  children: [jsxRuntime.jsx("div", Object.assign({
6063
- css: styles$m.stateWrapper
6270
+ css: styles$o.stateWrapper
6064
6271
  }, {
6065
6272
  children: jsxRuntime.jsx("div", Object.assign({
6066
- css: styles$m.grow
6273
+ css: styles$o.grow
6067
6274
  }, {
6068
6275
  children: watchCountryCode === "US" ?
6069
6276
  // Domestic States
@@ -6088,10 +6295,10 @@ const AddressFields = ({
6088
6295
  })
6089
6296
  }))
6090
6297
  })), jsxRuntime.jsx("div", Object.assign({
6091
- css: styles$m.zipWrapper
6298
+ css: styles$o.zipWrapper
6092
6299
  }, {
6093
6300
  children: jsxRuntime.jsx("div", Object.assign({
6094
- css: styles$m.grow
6301
+ css: styles$o.grow
6095
6302
  }, {
6096
6303
  children: jsxRuntime.jsx(TextInput, {
6097
6304
  control: form.control,
@@ -6131,11 +6338,11 @@ const extendZod = () => {
6131
6338
  var call$4 = functionCall;
6132
6339
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
6133
6340
  var anObject$2 = anObject$f;
6134
- var isNullOrUndefined$1 = isNullOrUndefined$6;
6341
+ var isNullOrUndefined$1 = isNullOrUndefined$7;
6135
6342
  var toLength = toLength$3;
6136
- var toString$1 = toString$b;
6137
- var requireObjectCoercible = requireObjectCoercible$8;
6138
- var getMethod = getMethod$5;
6343
+ var toString$1 = toString$c;
6344
+ var requireObjectCoercible = requireObjectCoercible$9;
6345
+ var getMethod = getMethod$6;
6139
6346
  var advanceStringIndex = advanceStringIndex$2;
6140
6347
  var regExpExec = regexpExecAbstract;
6141
6348
 
@@ -6263,7 +6470,7 @@ const AddressForm = ({
6263
6470
  children: [jsxRuntime.jsxs("div", Object.assign({
6264
6471
  css: theme => ({
6265
6472
  display: "flex",
6266
- justifyContent: isAddressParserOpen ? "normal" : "flex-end",
6473
+ flexDirection: isAddressParserOpen ? "column" : "row",
6267
6474
  paddingBottom: theme.spacing(4),
6268
6475
  width: "100%"
6269
6476
  })
@@ -6329,7 +6536,7 @@ const AddressForm = ({
6329
6536
  }));
6330
6537
  };
6331
6538
 
6332
- const styles$l = createStyles({
6539
+ const styles$n = createStyles({
6333
6540
  agreement: {
6334
6541
  alignItems: "center",
6335
6542
  display: "flex",
@@ -6399,10 +6606,10 @@ const DisplayCarrierTerms = c => {
6399
6606
  const listCarrierLinks = () => {
6400
6607
  return c.carrierTerms.links.map((term, index) => {
6401
6608
  return jsxRuntime.jsx("li", Object.assign({
6402
- css: styles$l.listItems
6609
+ css: styles$n.listItems
6403
6610
  }, {
6404
6611
  children: jsxRuntime.jsx(giger.Link, Object.assign({
6405
- css: styles$l.link,
6612
+ css: styles$n.link,
6406
6613
  href: term.url,
6407
6614
  isExternal: true,
6408
6615
  target: "_blank"
@@ -6418,18 +6625,18 @@ const DisplayCarrierTerms = c => {
6418
6625
  };
6419
6626
  const listCarrierTerms = () => {
6420
6627
  return jsxRuntime.jsxs("div", Object.assign({
6421
- css: styles$l.terms
6628
+ css: styles$n.terms
6422
6629
  }, {
6423
6630
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
6424
6631
  variant: "subtitle1"
6425
6632
  }, {
6426
6633
  children: c.carrierTerms.title
6427
6634
  })), jsxRuntime.jsx("div", Object.assign({
6428
- css: styles$l.terms
6635
+ css: styles$n.terms
6429
6636
  }, {
6430
6637
  children: listCarrierContent()
6431
6638
  })), jsxRuntime.jsx("ul", Object.assign({
6432
- css: styles$l.links
6639
+ css: styles$n.links
6433
6640
  }, {
6434
6641
  children: listCarrierLinks()
6435
6642
  }))]
@@ -6659,7 +6866,7 @@ const AddressDisplay = ({
6659
6866
  }));
6660
6867
  };
6661
6868
 
6662
- const styles$k = createStyles({
6869
+ const styles$m = createStyles({
6663
6870
  container: theme => ({
6664
6871
  display: "flex",
6665
6872
  gap: theme.spacing()
@@ -6697,13 +6904,13 @@ const Disclosure = ({
6697
6904
  }, [open]);
6698
6905
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
6699
6906
  children: [jsxRuntime.jsxs("div", Object.assign({
6700
- css: styles$k.container
6907
+ css: styles$m.container
6701
6908
  }, {
6702
6909
  children: [jsxRuntime.jsx("div", {
6703
6910
  children: label
6704
6911
  }), _showToggle && jsxRuntime.jsx("button", Object.assign({
6705
6912
  "aria-expanded": isOpen,
6706
- css: styles$k.toggle,
6913
+ css: styles$m.toggle,
6707
6914
  onClick: () => {
6708
6915
  setIsOpen(!isOpen);
6709
6916
  onToggle(!isOpen);
@@ -6711,12 +6918,12 @@ const Disclosure = ({
6711
6918
  type: "button"
6712
6919
  }, {
6713
6920
  children: jsxRuntime.jsx(giger.Icon, {
6714
- css: styles$k.icon,
6921
+ css: styles$m.icon,
6715
6922
  name: isOpen ? gigerTheme.IconNames.CHEVRON_TOP : gigerTheme.IconNames.CHEVRON_BOTTOM
6716
6923
  })
6717
6924
  }))]
6718
6925
  })), isOpen && jsxRuntime.jsx("div", Object.assign({
6719
- css: styles$k.content
6926
+ css: styles$m.content
6720
6927
  }, {
6721
6928
  children: typeof children === "function" ? children(() => setIsOpen(!isOpen)) : children
6722
6929
  }))]
@@ -6756,14 +6963,10 @@ const AddressPreferenceDisplay = ({
6756
6963
  }), [addressPreference, onChangePreference]);
6757
6964
  const disclosureContentTitle = React.useMemo(() => addressPreference.status === "verified" ? t(`address.preference.${addressPreference.alternativeSource}`) : t("address.preference.addressNotValidated"), [addressPreference, t]);
6758
6965
  const isVerified = React.useMemo(() => {
6759
- if (isDomesticAddress(addressPreference.selection) || addressPreference.selectionSource === "matchedAddress") {
6760
- return addressPreference.status === "verified";
6761
- }
6762
- // If the address is international and is modified, We might get "verified" even though we are displaying original "not verified" address
6763
- if (addressPreference.isModified) {
6764
- return false;
6966
+ if (addressPreference.status === "verified" && addressPreference.selectionSource === "matchedAddress") {
6967
+ return true;
6765
6968
  }
6766
- return addressPreference.status === "verified";
6969
+ return false;
6767
6970
  }, [addressPreference]);
6768
6971
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
6769
6972
  children: [jsxRuntime.jsx(AddressDisplay, {
@@ -6866,7 +7069,7 @@ const getCarrierRecoverySchema = requiresAddress => zod.z.object({
6866
7069
  address: requiresAddress ? baseSchema : baseSchema.optional()
6867
7070
  });
6868
7071
 
6869
- const styles$j = createStyles({
7072
+ const styles$l = createStyles({
6870
7073
  grid: theme => ({
6871
7074
  margin: theme.spacing(4)
6872
7075
  }),
@@ -6909,7 +7112,7 @@ const CarrierRecoveryForm = ({
6909
7112
  onSubmit: formLogger.capture(handleSubmit)
6910
7113
  }, {
6911
7114
  children: jsxRuntime.jsxs(giger.Grid, Object.assign({
6912
- css: styles$j.grid,
7115
+ css: styles$l.grid,
6913
7116
  noPadding: true
6914
7117
  }, {
6915
7118
  children: [requiresAddress && jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -6917,14 +7120,14 @@ const CarrierRecoveryForm = ({
6917
7120
  colSpan: 12
6918
7121
  }, {
6919
7122
  children: jsxRuntime.jsx(giger.Typography, Object.assign({
6920
- css: styles$j.heading,
7123
+ css: styles$l.heading,
6921
7124
  variant: "heading4"
6922
7125
  }, {
6923
7126
  children: t("register-wallet:sections.carriers.title")
6924
7127
  }))
6925
7128
  })), jsxRuntime.jsx(giger.GridChild, Object.assign({
6926
7129
  colSpan: 12,
6927
- css: styles$j.subtitle
7130
+ css: styles$l.subtitle
6928
7131
  }, {
6929
7132
  children: jsxRuntime.jsx(giger.Typography, Object.assign({
6930
7133
  variant: "subtitle1"
@@ -7010,7 +7213,7 @@ const CarrierTermsForm = ({
7010
7213
  onSubmit(payload.agreement);
7011
7214
  }));
7012
7215
  return jsxRuntime.jsxs("div", Object.assign({
7013
- css: styles$l.termsForm,
7216
+ css: styles$n.termsForm,
7014
7217
  "data-testid": "carrier-terms-form"
7015
7218
  }, {
7016
7219
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
@@ -7026,7 +7229,7 @@ const CarrierTermsForm = ({
7026
7229
  })), jsxRuntime.jsx(Spacer, {
7027
7230
  multiplier: 1
7028
7231
  }), jsxRuntime.jsx("div", Object.assign({
7029
- css: styles$l.carrierLogos
7232
+ css: styles$n.carrierLogos
7030
7233
  }, {
7031
7234
  children: metadatas.map(({
7032
7235
  name,
@@ -7042,7 +7245,7 @@ const CarrierTermsForm = ({
7042
7245
  onSubmit: formLogger.capture(handleSubmit)
7043
7246
  }, {
7044
7247
  children: jsxRuntime.jsxs("div", Object.assign({
7045
- css: styles$l.agreement
7248
+ css: styles$n.agreement
7046
7249
  }, {
7047
7250
  children: [jsxRuntime.jsx("div", {
7048
7251
  children: jsxRuntime.jsx(CheckboxInput, {
@@ -7069,12 +7272,12 @@ const CarrierTermsForm = ({
7069
7272
  name: "agreement"
7070
7273
  })
7071
7274
  }), showTerms && jsxRuntime.jsxs("div", Object.assign({
7072
- css: styles$l.well
7275
+ css: styles$n.well
7073
7276
  }, {
7074
7277
  children: [terms.map(t => jsxRuntime.jsx(DisplayCarrierTerms, {
7075
7278
  carrierTerms: t
7076
7279
  }, t.title)), jsxRuntime.jsx("div", Object.assign({
7077
- css: styles$l.close
7280
+ css: styles$n.close
7078
7281
  }, {
7079
7282
  children: jsxRuntime.jsx(giger.Button, Object.assign({
7080
7283
  onClick: () => setShowTerms(false),
@@ -7106,9 +7309,9 @@ var DESCRIPTORS$1 = descriptors;
7106
7309
  var global$8 = global$p;
7107
7310
  var uncurryThis$1 = functionUncurryThis;
7108
7311
  var hasOwn$1 = hasOwnProperty_1;
7109
- var isCallable$4 = isCallable$n;
7312
+ var isCallable$4 = isCallable$o;
7110
7313
  var isPrototypeOf$1 = objectIsPrototypeOf;
7111
- var toString = toString$b;
7314
+ var toString = toString$c;
7112
7315
  var defineProperty = objectDefineProperty.f;
7113
7316
  var copyConstructorProperties = copyConstructorProperties$2;
7114
7317
 
@@ -7395,7 +7598,7 @@ const CopyButton = ({
7395
7598
  }));
7396
7599
  };
7397
7600
 
7398
- const styles$i = createStyles({
7601
+ const styles$k = createStyles({
7399
7602
  trackingNumber: theme => ({
7400
7603
  alignItems: "center",
7401
7604
  display: "flex"
@@ -7441,10 +7644,10 @@ const Label = ({
7441
7644
  shippingAmount: label.shipmentCost
7442
7645
  }, {
7443
7646
  children: label.trackingNumber && jsxRuntime.jsxs("div", Object.assign({
7444
- css: styles$i.trackingNumber
7647
+ css: styles$k.trackingNumber
7445
7648
  }, {
7446
7649
  children: [jsxRuntime.jsx("div", Object.assign({
7447
- css: styles$i.truncatedTrackingNumber
7650
+ css: styles$k.truncatedTrackingNumber
7448
7651
  }, {
7449
7652
  children: label.trackingNumber.toString()
7450
7653
  })), jsxRuntime.jsx(CopyButton, {
@@ -7556,7 +7759,7 @@ const LandingPageForm = ({
7556
7759
  }));
7557
7760
  };
7558
7761
 
7559
- const styles$h = createStyles({
7762
+ const styles$j = createStyles({
7560
7763
  container: theme => ({
7561
7764
  padding: theme.spacing(2)
7562
7765
  }),
@@ -7578,11 +7781,11 @@ const LandingPage = ({
7578
7781
  t
7579
7782
  } = reactI18next.useTranslation();
7580
7783
  return jsxRuntime.jsxs("div", Object.assign({
7581
- css: styles$h.container,
7784
+ css: styles$j.container,
7582
7785
  "data-testid": "landing-page"
7583
7786
  }, {
7584
7787
  children: [jsxRuntime.jsxs("div", Object.assign({
7585
- css: styles$h.header
7788
+ css: styles$j.header
7586
7789
  }, {
7587
7790
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
7588
7791
  variant: "heading4"
@@ -7600,7 +7803,7 @@ const LandingPage = ({
7600
7803
  })), jsxRuntime.jsx(LandingPageForm, {
7601
7804
  onSubmit: onSubmit
7602
7805
  }), jsxRuntime.jsxs("div", Object.assign({
7603
- css: styles$h.header
7806
+ css: styles$j.header
7604
7807
  }, {
7605
7808
  children: [jsxRuntime.jsx(Spacer, {
7606
7809
  multiplier: 6
@@ -7611,14 +7814,14 @@ const LandingPage = ({
7611
7814
  })), jsxRuntime.jsx(Spacer, {
7612
7815
  multiplier: 2
7613
7816
  }), jsxRuntime.jsx(giger.Typography, Object.assign({
7614
- css: styles$h.description,
7817
+ css: styles$j.description,
7615
7818
  variant: "body1"
7616
7819
  }, {
7617
7820
  children: t("onboarding:landing.messageLine1")
7618
7821
  })), jsxRuntime.jsx(Spacer, {
7619
7822
  multiplier: 2
7620
7823
  }), jsxRuntime.jsx(giger.Typography, Object.assign({
7621
- css: styles$h.description,
7824
+ css: styles$j.description,
7622
7825
  variant: "body1"
7623
7826
  }, {
7624
7827
  children: t("onboarding:landing.messageLine2")
@@ -7629,7 +7832,7 @@ const LandingPage = ({
7629
7832
  }));
7630
7833
  };
7631
7834
 
7632
- const styles$g = createStyles({
7835
+ const styles$i = createStyles({
7633
7836
  icon: theme => ({
7634
7837
  color: theme.palette.primary.main,
7635
7838
  marginRight: theme.spacing(2)
@@ -7674,10 +7877,10 @@ const Section = _a => {
7674
7877
  rest = __rest(_a, ["bold", "title", "children", "rightContent"]);
7675
7878
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
7676
7879
  children: [title && jsxRuntime.jsx("summary", Object.assign({
7677
- css: styles$g.summary
7880
+ css: styles$i.summary
7678
7881
  }, {
7679
7882
  children: jsxRuntime.jsxs("div", Object.assign({
7680
- css: styles$g.summaryWrapper
7883
+ css: styles$i.summaryWrapper
7681
7884
  }, {
7682
7885
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
7683
7886
  bold: bold,
@@ -7685,20 +7888,20 @@ const Section = _a => {
7685
7888
  }, {
7686
7889
  children: title
7687
7890
  })), rightContent && jsxRuntime.jsx("div", Object.assign({
7688
- css: styles$g.rightContentWrapper
7891
+ css: styles$i.rightContentWrapper
7689
7892
  }, {
7690
7893
  children: rightContent
7691
7894
  }))]
7692
7895
  }))
7693
7896
  })), jsxRuntime.jsx("section", Object.assign({
7694
- css: styles$g.section
7897
+ css: styles$i.section
7695
7898
  }, rest, {
7696
7899
  children: children
7697
7900
  }))]
7698
7901
  });
7699
7902
  };
7700
7903
 
7701
- const styles$f = createStyles({
7904
+ const styles$h = createStyles({
7702
7905
  container: {
7703
7906
  display: "flex",
7704
7907
  flexDirection: "column"
@@ -7758,14 +7961,14 @@ const ListCarriersRow = ({
7758
7961
  setIsSubmitting(false);
7759
7962
  });
7760
7963
  return jsxRuntime.jsxs("div", Object.assign({
7761
- css: styles$f.container,
7964
+ css: styles$h.container,
7762
7965
  "data-testid": "carrier-row"
7763
7966
  }, {
7764
7967
  children: [jsxRuntime.jsxs("div", Object.assign({
7765
- css: styles$f.rowContainer
7968
+ css: styles$h.rowContainer
7766
7969
  }, {
7767
7970
  children: [jsxRuntime.jsxs("div", Object.assign({
7768
- css: styles$f.logoContainer
7971
+ css: styles$h.logoContainer
7769
7972
  }, {
7770
7973
  children: [jsxRuntime.jsx("div", {
7771
7974
  children: jsxRuntime.jsx("img", {
@@ -7783,7 +7986,7 @@ const ListCarriersRow = ({
7783
7986
  css: _ref
7784
7987
  }, {
7785
7988
  children: jsxRuntime.jsx(LinkAction, {
7786
- css: styles$f.getConnectButton(isConnected),
7989
+ css: styles$h.getConnectButton(isConnected),
7787
7990
  isDisabled: isConnected || showDropDown,
7788
7991
  isLoading: isSubmitting,
7789
7992
  onClick: () => __awaiter(void 0, void 0, void 0, function* () {
@@ -7801,7 +8004,7 @@ const ListCarriersRow = ({
7801
8004
  }));
7802
8005
  };
7803
8006
 
7804
- const styles$e = createStyles({
8007
+ const styles$g = createStyles({
7805
8008
  carriersList: theme => ({
7806
8009
  "& > li:not(:last-of-type)": {
7807
8010
  borderBottom: `1px solid ${theme.palette.gray.light}`
@@ -7854,7 +8057,7 @@ const ListCarriers = ({
7854
8057
  }))
7855
8058
  })), jsxRuntime.jsx(Spacer, {})]
7856
8059
  }), jsxRuntime.jsx("ul", Object.assign({
7857
- css: styles$e.carriersList,
8060
+ css: styles$g.carriersList,
7858
8061
  "data-testid": "carriers-list"
7859
8062
  }, {
7860
8063
  children: isLoading ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -7876,11 +8079,11 @@ const ListCarriers = ({
7876
8079
  };
7877
8080
  const LoadingSkeletonRow = () => {
7878
8081
  return jsxRuntime.jsxs("div", Object.assign({
7879
- css: styles$e.skeletonRow,
8082
+ css: styles$g.skeletonRow,
7880
8083
  "data-testid": "skeleton-carrier-row"
7881
8084
  }, {
7882
8085
  children: [jsxRuntime.jsxs("div", Object.assign({
7883
- css: styles$e.skeletonLogoContainer
8086
+ css: styles$g.skeletonLogoContainer
7884
8087
  }, {
7885
8088
  children: [jsxRuntime.jsx(giger.Skeleton, {
7886
8089
  animation: giger.SkeletonAnimation.WAVE,
@@ -8187,7 +8390,7 @@ const useAddressPreference = () => {
8187
8390
  return context;
8188
8391
  };
8189
8392
 
8190
- const styles$d = createStyles({
8393
+ const styles$f = createStyles({
8191
8394
  body: theme => ({
8192
8395
  borderTop: `1px solid ${theme.palette.gray.light}`,
8193
8396
  color: theme.palette.black,
@@ -8238,14 +8441,14 @@ const SettingsCard = ({
8238
8441
  verticallyAligned
8239
8442
  }) => {
8240
8443
  return jsxRuntime.jsxs("div", Object.assign({
8241
- css: verticallyAligned ? styles$d.verticalContainer : styles$d.container,
8444
+ css: verticallyAligned ? styles$f.verticalContainer : styles$f.container,
8242
8445
  "data-testid": "settingsCard"
8243
8446
  }, {
8244
8447
  children: [jsxRuntime.jsxs("div", Object.assign({
8245
- css: styles$d.header
8448
+ css: styles$f.header
8246
8449
  }, {
8247
8450
  children: [jsxRuntime.jsxs("div", Object.assign({
8248
- css: styles$d.title
8451
+ css: styles$f.title
8249
8452
  }, {
8250
8453
  children: [typeof title === "string" ? jsxRuntime.jsx(giger.Typography, Object.assign({
8251
8454
  variant: "subtitle2"
@@ -8280,7 +8483,7 @@ const SettingsCard = ({
8280
8483
  }))
8281
8484
  }))]
8282
8485
  })), children && jsxRuntime.jsx("div", Object.assign({
8283
- css: styles$d.body
8486
+ css: styles$f.body
8284
8487
  }, {
8285
8488
  children: jsxRuntime.jsxs("div", {
8286
8489
  children: [children, accessoryAction && jsxRuntime.jsx(ButtonGroup, Object.assign({
@@ -8416,7 +8619,7 @@ const WarehouseForm = ({
8416
8619
  returnAddress: Object.assign(Object.assign({}, warehouse.returnAddress), {
8417
8620
  countryCode: warehouse.returnAddress.countryCode
8418
8621
  }),
8419
- returnToAddressIsDifferent: !_$2.isEqual(warehouse.originAddress, warehouse.returnAddress)
8622
+ returnToAddressIsDifferent: !_$3.isEqual(warehouse.originAddress, warehouse.returnAddress)
8420
8623
  }) : {
8421
8624
  isDefault: _isOnboarding ? true : false,
8422
8625
  originAddress: {
@@ -8536,7 +8739,7 @@ const WarehouseForm = ({
8536
8739
  }));
8537
8740
  };
8538
8741
 
8539
- const styles$c = createStyles({
8742
+ const styles$e = createStyles({
8540
8743
  cardSpacing: theme => ({
8541
8744
  display: "flex",
8542
8745
  flexDirection: "column",
@@ -8566,9 +8769,9 @@ const ManageWarehouses = ({
8566
8769
  const [showAddNewWarehouseForm, toggleShowAddNewWarehouseForm] = useToggle(false);
8567
8770
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
8568
8771
  children: [showAddNewWarehouseForm ? jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
8569
- css: styles$c.well,
8772
+ css: styles$e.well,
8570
8773
  formHeader: jsxRuntime.jsxs("div", Object.assign({
8571
- css: styles$c.header
8774
+ css: styles$e.header
8572
8775
  }, {
8573
8776
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
8574
8777
  variant: "subtitle1"
@@ -8613,14 +8816,14 @@ const ManageWarehouses = ({
8613
8816
  })]
8614
8817
  }))
8615
8818
  })), jsxRuntime.jsx("div", Object.assign({
8616
- css: styles$c.cardSpacing
8819
+ css: styles$e.cardSpacing
8617
8820
  }, {
8618
8821
  children: warehouses.map(warehouse => {
8619
8822
  if (editWarehouseId && editWarehouseId === warehouse.warehouseId) {
8620
8823
  return jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
8621
- css: styles$c.well,
8824
+ css: styles$e.well,
8622
8825
  formHeader: jsxRuntime.jsxs("div", Object.assign({
8623
- css: styles$c.header
8826
+ css: styles$e.header
8624
8827
  }, {
8625
8828
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
8626
8829
  variant: "subtitle1"
@@ -8678,7 +8881,7 @@ const ManageWarehouses = ({
8678
8881
 
8679
8882
  var getBuiltIn$2 = getBuiltIn$8;
8680
8883
  var definePropertyModule = objectDefineProperty;
8681
- var wellKnownSymbol$3 = wellKnownSymbol$j;
8884
+ var wellKnownSymbol$3 = wellKnownSymbol$k;
8682
8885
  var DESCRIPTORS = descriptors;
8683
8886
 
8684
8887
  var SPECIES$2 = wellKnownSymbol$3('species');
@@ -8717,8 +8920,8 @@ var aConstructor$1 = function (argument) {
8717
8920
 
8718
8921
  var anObject$1 = anObject$f;
8719
8922
  var aConstructor = aConstructor$1;
8720
- var isNullOrUndefined = isNullOrUndefined$6;
8721
- var wellKnownSymbol$2 = wellKnownSymbol$j;
8923
+ var isNullOrUndefined = isNullOrUndefined$7;
8924
+ var wellKnownSymbol$2 = wellKnownSymbol$k;
8722
8925
 
8723
8926
  var SPECIES$1 = wellKnownSymbol$2('species');
8724
8927
 
@@ -8748,7 +8951,7 @@ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
8748
8951
  var global$7 = global$p;
8749
8952
  var apply = functionApply;
8750
8953
  var bind$2 = functionBindContext;
8751
- var isCallable$3 = isCallable$n;
8954
+ var isCallable$3 = isCallable$o;
8752
8955
  var hasOwn = hasOwnProperty_1;
8753
8956
  var fails = fails$q;
8754
8957
  var html = html$2;
@@ -9015,10 +9218,10 @@ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
9015
9218
 
9016
9219
  var global$2 = global$p;
9017
9220
  var NativePromiseConstructor$3 = promiseNativeConstructor;
9018
- var isCallable$2 = isCallable$n;
9221
+ var isCallable$2 = isCallable$o;
9019
9222
  var isForced = isForced_1;
9020
9223
  var inspectSource = inspectSource$3;
9021
- var wellKnownSymbol$1 = wellKnownSymbol$j;
9224
+ var wellKnownSymbol$1 = wellKnownSymbol$k;
9022
9225
  var IS_BROWSER = engineIsBrowser;
9023
9226
  var IS_DENO = engineIsDeno;
9024
9227
  var V8_VERSION = engineV8Version;
@@ -9090,7 +9293,7 @@ var setPrototypeOf = objectSetPrototypeOf;
9090
9293
  var setToStringTag = setToStringTag$3;
9091
9294
  var setSpecies = setSpecies$1;
9092
9295
  var aCallable$2 = aCallable$a;
9093
- var isCallable$1 = isCallable$n;
9296
+ var isCallable$1 = isCallable$o;
9094
9297
  var isObject$1 = isObject$a;
9095
9298
  var anInstance = anInstance$1;
9096
9299
  var speciesConstructor = speciesConstructor$1;
@@ -9368,7 +9571,7 @@ $$5({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTR
9368
9571
  setToStringTag(PromiseConstructor, PROMISE, false);
9369
9572
  setSpecies(PROMISE);
9370
9573
 
9371
- var wellKnownSymbol = wellKnownSymbol$j;
9574
+ var wellKnownSymbol = wellKnownSymbol$k;
9372
9575
 
9373
9576
  var ITERATOR = wellKnownSymbol('iterator');
9374
9577
  var SAFE_CLOSING = false;
@@ -9458,7 +9661,7 @@ var $$3 = _export;
9458
9661
  var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
9459
9662
  var NativePromiseConstructor = promiseNativeConstructor;
9460
9663
  var getBuiltIn$1 = getBuiltIn$8;
9461
- var isCallable = isCallable$n;
9664
+ var isCallable = isCallable$o;
9462
9665
  var defineBuiltIn = defineBuiltIn$7;
9463
9666
 
9464
9667
  var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
@@ -9798,7 +10001,7 @@ const EditWalletAddressForm = ({
9798
10001
  }));
9799
10002
  };
9800
10003
 
9801
- const styles$b = createStyles({
10004
+ const styles$d = createStyles({
9802
10005
  grid: theme => ({
9803
10006
  margin: theme.spacing(4)
9804
10007
  })
@@ -9860,7 +10063,7 @@ const WalletForm = ({
9860
10063
  onSubmit: formLogger.capture(handleSubmit)
9861
10064
  }, {
9862
10065
  children: jsxRuntime.jsxs(giger.Grid, Object.assign({
9863
- css: styles$b.grid,
10066
+ css: styles$d.grid,
9864
10067
  noPadding: true
9865
10068
  }, {
9866
10069
  children: [jsxRuntime.jsx(giger.GridChild, Object.assign({
@@ -9942,7 +10145,7 @@ const WalletForm = ({
9942
10145
  }));
9943
10146
  };
9944
10147
 
9945
- const styles$a = createStyles({
10148
+ const styles$c = createStyles({
9946
10149
  container: theme => ({
9947
10150
  padding: theme.spacing(2)
9948
10151
  }),
@@ -10118,10 +10321,10 @@ const Onboarding = ({
10118
10321
  const defaultWarehouse = (_a = warehouses.find(w => w.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
10119
10322
  return jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
10120
10323
  formHeader: jsxRuntime.jsxs("div", Object.assign({
10121
- css: styles$a.walletFormHeader
10324
+ css: styles$c.walletFormHeader
10122
10325
  }, {
10123
10326
  children: [jsxRuntime.jsxs("div", Object.assign({
10124
- css: styles$a.walletFormTitle
10327
+ css: styles$c.walletFormTitle
10125
10328
  }, {
10126
10329
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
10127
10330
  variant: "heading4"
@@ -10198,38 +10401,38 @@ const Onboarding = ({
10198
10401
  });
10199
10402
  };
10200
10403
  return jsxRuntime.jsxs("div", Object.assign({
10201
- css: styles$a.container
10404
+ css: styles$c.container
10202
10405
  }, {
10203
10406
  children: [jsxRuntime.jsxs(giger.Stepper, Object.assign({
10204
10407
  currentStep: currentStep
10205
10408
  }, {
10206
10409
  children: [jsxRuntime.jsx(giger.Step, {
10207
- css: styles$a.step,
10410
+ css: styles$c.step,
10208
10411
  label: t("onboarding:steps.login")
10209
10412
  }), jsxRuntime.jsx(giger.Step, {
10210
- css: styles$a.step,
10413
+ css: styles$c.step,
10211
10414
  label: t("onboarding:steps.carriers")
10212
10415
  }), jsxRuntime.jsx(giger.Step, {
10213
- css: styles$a.step,
10416
+ css: styles$c.step,
10214
10417
  label: t("onboarding:steps.addresses")
10215
10418
  }), jsxRuntime.jsx(giger.Step, {
10216
- css: styles$a.step,
10419
+ css: styles$c.step,
10217
10420
  label: t("onboarding:steps.payment")
10218
10421
  })]
10219
- })), renderStep()]
10422
+ })), renderStep(), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
10220
10423
  }));
10221
10424
  };
10222
10425
 
10223
- let _ = t => t,
10224
- _t,
10225
- _t2;
10426
+ let _$1 = t => t,
10427
+ _t$1,
10428
+ _t2$1;
10226
10429
  const Cube = _a => {
10227
10430
  var {
10228
10431
  animate = false
10229
10432
  } = _a,
10230
10433
  props = __rest(_a, ["animate"]);
10231
10434
  const theme = react.useTheme();
10232
- const bounce = react.keyframes(_t || (_t = _`
10435
+ const bounce = react.keyframes(_t$1 || (_t$1 = _$1`
10233
10436
  0%, 100% {
10234
10437
  transform: translateY(-25%);
10235
10438
  animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
@@ -10239,7 +10442,7 @@ const Cube = _a => {
10239
10442
  animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
10240
10443
  }
10241
10444
  `));
10242
- const spin = react.keyframes(_t2 || (_t2 = _`
10445
+ const spin = react.keyframes(_t2$1 || (_t2$1 = _$1`
10243
10446
  from {
10244
10447
  transform: rotate(0deg);
10245
10448
  }
@@ -10342,12 +10545,12 @@ const Loader = props => {
10342
10545
  }
10343
10546
  }, {
10344
10547
  children: jsxRuntime.jsx(giger.Spinner, Object.assign({}, props, {
10345
- size: giger.SpinnerSize.SIZE_LARGE
10548
+ size: props.size || giger.SpinnerSize.SIZE_LARGE
10346
10549
  }))
10347
10550
  }));
10348
10551
  };
10349
10552
 
10350
- const styles$9 = createStyles({
10553
+ const styles$b = createStyles({
10351
10554
  chipList: theme => ({
10352
10555
  gap: theme.spacing(1)
10353
10556
  }),
@@ -10458,7 +10661,7 @@ const AddFundsForm = ({
10458
10661
  })), jsxRuntime.jsx(Spacer, {
10459
10662
  multiplier: 2
10460
10663
  }), jsxRuntime.jsx(giger.ChipList, Object.assign({
10461
- css: styles$9.chipList,
10664
+ css: styles$b.chipList,
10462
10665
  onChange: idx => {
10463
10666
  const chip = chips[idx];
10464
10667
  setSelectedChip(chip);
@@ -10473,7 +10676,7 @@ const AddFundsForm = ({
10473
10676
  }
10474
10677
  }, {
10475
10678
  children: chips.map(chip => jsxRuntime.jsx(giger.Chip, Object.assign({
10476
- css: styles$9.getChip({
10679
+ css: styles$b.getChip({
10477
10680
  isDisabled: chip.value < _minimumAmount,
10478
10681
  isSelected: chip.value === selectedChip.value
10479
10682
  }),
@@ -10490,7 +10693,7 @@ const AddFundsForm = ({
10490
10693
  multiplier: 1
10491
10694
  }), jsxRuntime.jsx(MoneyInput, {
10492
10695
  control: form.control,
10493
- css: styles$9.fundsInput,
10696
+ css: styles$b.fundsInput,
10494
10697
  defaultValue: {
10495
10698
  amount: undefined,
10496
10699
  currency: alchemy.SE.Currency.USD
@@ -10543,7 +10746,7 @@ const AddFundsForm = ({
10543
10746
  });
10544
10747
  };
10545
10748
 
10546
- const styles$8 = isLabelRight => createStyles({
10749
+ const styles$a = isLabelRight => createStyles({
10547
10750
  inlineContainer: theme => ({
10548
10751
  alignItems: "center",
10549
10752
  display: "flex",
@@ -10558,14 +10761,14 @@ const InlineLabel = ({
10558
10761
  isLabelRight,
10559
10762
  labelProps: _labelProps = {}
10560
10763
  }) => jsxRuntime.jsxs("div", Object.assign({
10561
- css: styles$8(isLabelRight).inlineContainer
10764
+ css: styles$a(isLabelRight).inlineContainer
10562
10765
  }, {
10563
10766
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({}, _labelProps, {
10564
10767
  children: label
10565
10768
  })), children]
10566
10769
  }));
10567
10770
 
10568
- const styles$7 = createStyles({
10771
+ const styles$9 = createStyles({
10569
10772
  getBalanceText: balance => theme => ({
10570
10773
  color: balance === undefined ? theme.palette.alert.main : balance >= 0 ? theme.palette.secondary.dark : theme.palette.error.main
10571
10774
  })
@@ -10588,7 +10791,7 @@ const CarrierBalance = ({
10588
10791
  }, {
10589
10792
  children: isLoadingCarrier || isRefetchingCarrier ? jsxRuntime.jsx(giger.Spinner, {}) : jsxRuntime.jsx(giger.Typography, Object.assign({
10590
10793
  bold: true,
10591
- css: styles$7.getBalanceText(balance)
10794
+ css: styles$9.getBalanceText(balance)
10592
10795
  }, {
10593
10796
  children: balance === undefined ? t("manage-funding:errors.balanceUnknown") : formatMoney({
10594
10797
  amount: balance,
@@ -10610,7 +10813,7 @@ const Spread = ({
10610
10813
  children: children
10611
10814
  }));
10612
10815
 
10613
- const styles$6 = createStyles({
10816
+ const styles$8 = createStyles({
10614
10817
  balanceText: theme => ({
10615
10818
  color: theme.palette.secondary.dark
10616
10819
  }),
@@ -10664,41 +10867,61 @@ const FundAndPurchase = ({
10664
10867
  control
10665
10868
  });
10666
10869
  const [isSavingRate, setIsSavingRate] = React.useState(false);
10870
+ const [isSavingError, setIsSavingError] = React.useState(false);
10667
10871
  const handleSaveRate = () => __awaiter(void 0, void 0, void 0, function* () {
10668
10872
  setIsSavingRate(true);
10669
- yield onSave();
10670
- setIsSavingRate(false);
10873
+ setIsSavingError(false);
10874
+ try {
10875
+ yield onSave();
10876
+ } catch (e) {
10877
+ setIsSavingError(true);
10878
+ } finally {
10879
+ setIsSavingRate(false);
10880
+ }
10671
10881
  });
10672
10882
  // Automatically open the Add Funds form if the carrier's balance is insufficient.
10673
10883
  React.useEffect(() => {
10674
10884
  if (isFundingEnabled && isFundingRequired && (carrier === null || carrier === void 0 ? void 0 : carrier.balance) !== undefined && carrier.balance < purchaseAmount) setIsAddFundsFormOpen(true);
10675
10885
  }, [carrier === null || carrier === void 0 ? void 0 : carrier.balance, isFundingEnabled, isFundingRequired, purchaseAmount]);
10676
- const renderActionButtons = (addFundsForm = {}) => jsxRuntime.jsxs(ButtonGroup, Object.assign({
10677
- justify: "end"
10678
- }, {
10679
- children: [jsxRuntime.jsx(giger.Button, Object.assign({
10680
- bold: false,
10681
- css: styles$6.saveRateButton,
10682
- disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
10683
- isLoading: isSavingRate,
10684
- onClick: handleSaveRate,
10685
- variant: giger.ButtonVariant.OUTLINED
10686
- }, {
10687
- children: t("purchase-label:actions.saveRate")
10688
- })), jsxRuntime.jsx(giger.Button, Object.assign({
10689
- "data-testid": "submit-fund-and-purchase",
10690
- disabled: disabled || !carrierId || !isRateFormValid || isFundingEnabled && isFundingRequired && isAddFundsFormOpen && addFundsForm.isSubmitted && !addFundsForm.isValid,
10691
- isLoading: addFundsForm.isSubmitting || isRateFormSubmitting,
10692
- onClick: isAddFundsFormOpen ? addFundsForm.submit : onPurchase
10886
+ const renderActionButtons = (addFundsForm = {}) => jsxRuntime.jsxs(jsxRuntime.Fragment, {
10887
+ children: [isSavingError && jsxRuntime.jsxs(jsxRuntime.Fragment, {
10888
+ children: [jsxRuntime.jsx(giger.InlineNotification, Object.assign({
10889
+ type: giger.NotificationType.ERROR,
10890
+ title: t("purchase-label:errorMessages.saveRateFailedTitle")
10891
+ }, {
10892
+ children: jsxRuntime.jsx(giger.Typography, {
10893
+ children: t("purchase-label:errorMessages.saveRateFailedMessage")
10894
+ })
10895
+ })), jsxRuntime.jsx(Spacer, {
10896
+ multiplier: 2
10897
+ })]
10898
+ }), jsxRuntime.jsxs(ButtonGroup, Object.assign({
10899
+ justify: "end"
10693
10900
  }, {
10694
- children: isAddFundsFormOpen ? t("manage-funding:actions.addFundsAndPurchase") : t("purchase-label:actions.purchaseNow")
10901
+ children: [jsxRuntime.jsx(giger.Button, Object.assign({
10902
+ bold: false,
10903
+ css: styles$8.saveRateButton,
10904
+ disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
10905
+ isLoading: isSavingRate,
10906
+ onClick: handleSaveRate,
10907
+ variant: giger.ButtonVariant.OUTLINED
10908
+ }, {
10909
+ children: t("purchase-label:actions.saveRate")
10910
+ })), jsxRuntime.jsx(giger.Button, Object.assign({
10911
+ "data-testid": "submit-fund-and-purchase",
10912
+ disabled: disabled || !carrierId || !isRateFormValid || isFundingEnabled && isFundingRequired && isAddFundsFormOpen && addFundsForm.isSubmitted && !addFundsForm.isValid,
10913
+ isLoading: addFundsForm.isSubmitting || isRateFormSubmitting,
10914
+ onClick: isAddFundsFormOpen ? addFundsForm.submit : onPurchase
10915
+ }, {
10916
+ children: isAddFundsFormOpen ? t("manage-funding:actions.addFundsAndPurchase") : t("purchase-label:actions.purchaseNow")
10917
+ }))]
10695
10918
  }))]
10696
- }));
10919
+ });
10697
10920
  // Render: not a walleted carrier;
10698
10921
  // don't show balance or funding form
10699
10922
  if (!isFundingRequired) return jsxRuntime.jsx("div", Object.assign({
10700
10923
  className: className,
10701
- css: styles$6.container
10924
+ css: styles$8.container
10702
10925
  }, {
10703
10926
  children: renderActionButtons()
10704
10927
  }));
@@ -10711,7 +10934,7 @@ const FundAndPurchase = ({
10711
10934
  // show balance, but not the funding form.
10712
10935
  if (!isFundingEnabled) return jsxRuntime.jsxs("div", Object.assign({
10713
10936
  className: className,
10714
- css: styles$6.container
10937
+ css: styles$8.container
10715
10938
  }, {
10716
10939
  children: [jsxRuntime.jsx(CarrierBalance, {
10717
10940
  carrierId: carrierId
@@ -10723,7 +10946,7 @@ const FundAndPurchase = ({
10723
10946
  // show balance and funding form
10724
10947
  return jsxRuntime.jsxs("div", Object.assign({
10725
10948
  className: className,
10726
- css: styles$6.container
10949
+ css: styles$8.container
10727
10950
  }, {
10728
10951
  children: [jsxRuntime.jsxs(Spread, {
10729
10952
  children: [jsxRuntime.jsx(CarrierBalance, {
@@ -10754,13 +10977,13 @@ const FundAndPurchase = ({
10754
10977
  var _a, _b;
10755
10978
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
10756
10979
  children: [jsxRuntime.jsxs("section", Object.assign({
10757
- css: styles$6.getFormExtension(addFundsForm.isCustomAmount)
10980
+ css: styles$8.getFormExtension(addFundsForm.isCustomAmount)
10758
10981
  }, {
10759
10982
  children: [jsxRuntime.jsx(InlineLabel, Object.assign({
10760
10983
  label: t("manage-funding:fundAndPurchase.newBalance")
10761
10984
  }, {
10762
10985
  children: jsxRuntime.jsx(giger.Typography, Object.assign({
10763
- css: styles$6.balanceText
10986
+ css: styles$8.balanceText
10764
10987
  }, {
10765
10988
  children: formatMoney({
10766
10989
  amount: balance + ((_a = addFundsForm.selectedAmount) !== null && _a !== void 0 ? _a : 0),
@@ -10771,7 +10994,7 @@ const FundAndPurchase = ({
10771
10994
  label: t("manage-funding:fundAndPurchase.finalBalance")
10772
10995
  }, {
10773
10996
  children: jsxRuntime.jsx(giger.Typography, Object.assign({
10774
- css: styles$6.balanceText
10997
+ css: styles$8.balanceText
10775
10998
  }, {
10776
10999
  children: formatMoney({
10777
11000
  amount: balance + ((_b = addFundsForm.selectedAmount) !== null && _b !== void 0 ? _b : 0) - purchaseAmount,
@@ -10844,9 +11067,137 @@ const LabelLayoutPurchase = ({
10844
11067
  });
10845
11068
  };
10846
11069
 
10847
- const styles$5 = createStyles({
10848
- button: theme => ({
10849
- backgroundColor: "transparent",
11070
+ let _ = t => t,
11071
+ _t,
11072
+ _t2,
11073
+ _t3;
11074
+ const stroke = react.keyframes(_t || (_t = _`
11075
+ 100% {
11076
+ stroke-dashoffset: 0;
11077
+ }
11078
+ `));
11079
+ const fadeInOut = react.keyframes(_t2 || (_t2 = _`
11080
+ 0%, 100% {
11081
+ opacity: 0;
11082
+ }
11083
+ 20% {
11084
+ opacity: 1;
11085
+ }
11086
+ 85% {
11087
+ opacity: 1;
11088
+ }
11089
+ `));
11090
+ const fill = react.keyframes(_t3 || (_t3 = _`
11091
+ 100% {
11092
+ box-shadow: inset 0px 0px 0px 30px #3F8200;
11093
+ `));
11094
+ const colors = {
11095
+ green: "#3F8200",
11096
+ grey: "#706F6F",
11097
+ red: "#EE3B3F"
11098
+ };
11099
+ const styles$7 = createStyles({
11100
+ checkmark: () => ({
11101
+ animation: `${fill} forwards`,
11102
+ borderRadius: "50%",
11103
+ height: "20px,",
11104
+ stroke: "#fff",
11105
+ width: "20px"
11106
+ }),
11107
+ checkmarkCheck: () => ({
11108
+ animation: `${stroke} 1s forwards`,
11109
+ strokeDasharray: "48",
11110
+ strokeDashoffset: "48"
11111
+ }),
11112
+ container: theme => ({
11113
+ alignItems: "center",
11114
+ animation: `${fadeInOut} 2.5s ease-in-out forwards`,
11115
+ display: "flex",
11116
+ justifyContent: "flex-start",
11117
+ padding: `0 ${theme.spacing(2)}px 0 0`
11118
+ }),
11119
+ saved: theme => ({
11120
+ color: colors.green,
11121
+ marginLeft: `${theme.spacing(1)}px`
11122
+ }),
11123
+ saving: theme => ({
11124
+ marginLeft: `${theme.spacing(1)}px`
11125
+ }),
11126
+ savingContainer: () => ({
11127
+ alignItems: "center",
11128
+ color: colors.grey,
11129
+ display: "flex",
11130
+ justifyContent: "flex-start"
11131
+ }),
11132
+ savingFailed: theme => ({
11133
+ color: "#EE3B3F",
11134
+ marginLeft: `${theme.spacing(1)}px`
11135
+ })
11136
+ });
11137
+
11138
+ const SaveStatus = ({
11139
+ errors,
11140
+ isSaving
11141
+ }) => {
11142
+ const {
11143
+ t
11144
+ } = reactI18next.useTranslation(["manage-defaults"]);
11145
+ if (isSaving) {
11146
+ return jsxRuntime.jsxs("div", Object.assign({
11147
+ css: styles$7.savingContainer
11148
+ }, {
11149
+ children: [jsxRuntime.jsx(Loader, {
11150
+ color: colors.grey,
11151
+ css: {
11152
+ color: colors.grey
11153
+ },
11154
+ size: giger.SpinnerSize.SIZE_SMALL
11155
+ }), jsxRuntime.jsx(giger.Typography, Object.assign({
11156
+ css: styles$7.saving
11157
+ }, {
11158
+ children: t("manage-defaults:status.saving")
11159
+ }))]
11160
+ }));
11161
+ }
11162
+ return !isSaving && !errors ? jsxRuntime.jsxs("div", Object.assign({
11163
+ css: styles$7.container
11164
+ }, {
11165
+ children: [jsxRuntime.jsx("svg", Object.assign({
11166
+ css: styles$7.checkmark,
11167
+ viewBox: "0 0 52 52"
11168
+ }, {
11169
+ children: jsxRuntime.jsx("path", {
11170
+ css: styles$7.checkmarkCheck,
11171
+ d: "M14.1 27.2l7.1 7.2 16.7-16.8",
11172
+ fill: "none",
11173
+ strokeWidth: "5px"
11174
+ })
11175
+ })), jsxRuntime.jsx(giger.Typography, Object.assign({
11176
+ css: styles$7.saved
11177
+ }, {
11178
+ children: t("manage-defaults:status.saved")
11179
+ }))]
11180
+ })) : jsxRuntime.jsxs("div", Object.assign({
11181
+ css: [styles$7.container, {
11182
+ padding: "0"
11183
+ }]
11184
+ }, {
11185
+ children: [jsxRuntime.jsx(giger.Icon, {
11186
+ css: {
11187
+ color: colors.red
11188
+ },
11189
+ name: gigerTheme.IconNames.CANCEL_FILLED
11190
+ }), jsxRuntime.jsx(giger.Typography, Object.assign({
11191
+ css: styles$7.savingFailed
11192
+ }, {
11193
+ children: t("manage-defaults:status.savingFailed")
11194
+ }))]
11195
+ }));
11196
+ };
11197
+
11198
+ const styles$6 = createStyles({
11199
+ button: theme => ({
11200
+ backgroundColor: "transparent",
10850
11201
  padding: 0
10851
11202
  }),
10852
11203
  buttonContainer: theme => ({
@@ -10870,10 +11221,10 @@ const styles$5 = createStyles({
10870
11221
  cursor: "pointer",
10871
11222
  display: "flex",
10872
11223
  flexDirection: "column",
10873
- height: theme.spacing(32),
11224
+ height: theme.spacing(31),
10874
11225
  marginRight: theme.spacing(3.5),
10875
11226
  position: "relative",
10876
- width: theme.spacing(24)
11227
+ width: theme.spacing(22)
10877
11228
  }),
10878
11229
  letterInner: theme => ({
10879
11230
  backgroundColor: "white",
@@ -10898,10 +11249,10 @@ const styles$5 = createStyles({
10898
11249
  cursor: "pointer",
10899
11250
  display: "flex",
10900
11251
  flexDirection: "column",
10901
- height: theme.spacing(32),
11252
+ height: theme.spacing(31),
10902
11253
  marginRight: theme.spacing(3.5),
10903
11254
  position: "relative",
10904
- width: theme.spacing(24)
11255
+ width: theme.spacing(22)
10905
11256
  }),
10906
11257
  selectedThermal: theme => ({
10907
11258
  alignItems: "center",
@@ -10912,9 +11263,9 @@ const styles$5 = createStyles({
10912
11263
  cursor: "pointer",
10913
11264
  display: "flex",
10914
11265
  flexDirection: "column",
10915
- height: theme.spacing(32),
11266
+ height: theme.spacing(31),
10916
11267
  position: "relative",
10917
- width: theme.spacing(24)
11268
+ width: theme.spacing(22)
10918
11269
  }),
10919
11270
  thermal: theme => ({
10920
11271
  ":hover": {
@@ -10926,9 +11277,9 @@ const styles$5 = createStyles({
10926
11277
  cursor: "pointer",
10927
11278
  display: "flex",
10928
11279
  flexDirection: "column",
10929
- height: theme.spacing(32),
11280
+ height: theme.spacing(31),
10930
11281
  position: "relative",
10931
- width: theme.spacing(24)
11282
+ width: theme.spacing(22)
10932
11283
  }),
10933
11284
  thermalIcon: theme => ({
10934
11285
  backgroundColor: "#95C2E0",
@@ -10952,6 +11303,8 @@ const styles$5 = createStyles({
10952
11303
  });
10953
11304
 
10954
11305
  const LabelLayoutSettings = ({
11306
+ errors,
11307
+ isSaving,
10955
11308
  onChange
10956
11309
  }) => {
10957
11310
  var _a;
@@ -10964,13 +11317,17 @@ const LabelLayoutSettings = ({
10964
11317
  const labelLayout = (_a = accountSettings === null || accountSettings === void 0 ? void 0 : accountSettings.defaultLabelLayout) === null || _a === void 0 ? void 0 : _a.toLowerCase();
10965
11318
  return jsxRuntime.jsx(Section, Object.assign({
10966
11319
  bold: true,
11320
+ rightContent: jsxRuntime.jsx(SaveStatus, {
11321
+ errors: errors,
11322
+ isSaving: isSaving
11323
+ }),
10967
11324
  title: t("manage-defaults:label.title")
10968
11325
  }, {
10969
11326
  children: jsxRuntime.jsxs("div", Object.assign({
10970
- css: styles$5.buttonContainer
11327
+ css: styles$6.buttonContainer
10971
11328
  }, {
10972
11329
  children: [jsxRuntime.jsx("button", Object.assign({
10973
- css: styles$5.button,
11330
+ css: styles$6.button,
10974
11331
  id: "letter",
10975
11332
  onClick: () => {
10976
11333
  onChange("Letter");
@@ -10978,16 +11335,16 @@ const LabelLayoutSettings = ({
10978
11335
  value: "letter"
10979
11336
  }, {
10980
11337
  children: jsxRuntime.jsxs("div", Object.assign({
10981
- css: labelLayout === "letter" ? styles$5.selectedLetter : styles$5.letter
11338
+ css: labelLayout === "letter" ? styles$6.selectedLetter : styles$6.letter
10982
11339
  }, {
10983
11340
  children: [labelLayout === "letter" && jsxRuntime.jsx(giger.Icon, {
10984
- css: styles$5.icon,
11341
+ css: styles$6.icon,
10985
11342
  name: brands.IconNames.CHECK_FILLED
10986
11343
  }), jsxRuntime.jsx("div", Object.assign({
10987
- css: styles$5.letterInner
11344
+ css: styles$6.letterInner
10988
11345
  }, {
10989
11346
  children: jsxRuntime.jsx("div", {
10990
- css: styles$5.letterLabel
11347
+ css: styles$6.letterLabel
10991
11348
  })
10992
11349
  })), jsxRuntime.jsx(giger.Typography, {
10993
11350
  children: t("manage-defaults:label.letter.title")
@@ -11002,7 +11359,7 @@ const LabelLayoutSettings = ({
11002
11359
  }))]
11003
11360
  }))
11004
11361
  })), jsxRuntime.jsx("button", Object.assign({
11005
- css: styles$5.button,
11362
+ css: styles$6.button,
11006
11363
  id: "4x6",
11007
11364
  onClick: e => {
11008
11365
  onChange(e.currentTarget.value);
@@ -11010,16 +11367,16 @@ const LabelLayoutSettings = ({
11010
11367
  value: "4x6"
11011
11368
  }, {
11012
11369
  children: jsxRuntime.jsxs("div", Object.assign({
11013
- css: labelLayout === "4x6" ? styles$5.selectedThermal : styles$5.thermal
11370
+ css: labelLayout === "4x6" ? styles$6.selectedThermal : styles$6.thermal
11014
11371
  }, {
11015
11372
  children: [labelLayout === "4x6" && jsxRuntime.jsx(giger.Icon, {
11016
- css: styles$5.icon,
11373
+ css: styles$6.icon,
11017
11374
  name: brands.IconNames.CHECK_FILLED
11018
11375
  }), jsxRuntime.jsx("div", Object.assign({
11019
- css: styles$5.thermalInner
11376
+ css: styles$6.thermalInner
11020
11377
  }, {
11021
11378
  children: jsxRuntime.jsx("div", {
11022
- css: styles$5.thermalLabel
11379
+ css: styles$6.thermalLabel
11023
11380
  })
11024
11381
  })), jsxRuntime.jsx(giger.Typography, {
11025
11382
  children: t("manage-defaults:label.thermal.title")
@@ -11042,6 +11399,8 @@ const LabelLayout = ({
11042
11399
  display
11043
11400
  }) => {
11044
11401
  const {
11402
+ error: updateAccountSettingsErrors,
11403
+ isLoading: updatingAccountSettings,
11045
11404
  mutateAsync: updateAccountSettings
11046
11405
  } = alchemy.useUpdateAccountSettings();
11047
11406
  const {
@@ -11059,6 +11418,8 @@ const LabelLayout = ({
11059
11418
  });
11060
11419
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
11061
11420
  children: [display === "settings" && jsxRuntime.jsx(LabelLayoutSettings, {
11421
+ errors: updateAccountSettingsErrors,
11422
+ isSaving: updatingAccountSettings,
11062
11423
  onChange: handleSubmitUpdateAccountSettings
11063
11424
  }), display === "purchase" && jsxRuntime.jsx(LabelLayoutPurchase, {
11064
11425
  onChange: handleSubmitUpdateAccountSettings
@@ -11066,7 +11427,7 @@ const LabelLayout = ({
11066
11427
  });
11067
11428
  };
11068
11429
 
11069
- const styles$4 = createStyles({
11430
+ const styles$5 = createStyles({
11070
11431
  fundAndPurchase: theme => ({
11071
11432
  borderTop: `1px solid ${theme.palette.gray.ultraLight}`
11072
11433
  }),
@@ -11090,6 +11451,50 @@ const rateSchema = zod.z.object({
11090
11451
  })
11091
11452
  }).transform(schema => schema.rate.rateId);
11092
11453
 
11454
+ var _path, _path2;
11455
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11456
+ var SvgShipengineLogo = function SvgShipengineLogo(props) {
11457
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
11458
+ width: 244,
11459
+ height: 31,
11460
+ fill: "none",
11461
+ xmlns: "http://www.w3.org/2000/svg"
11462
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
11463
+ d: "M25.038 15.5c0-.954-.357-1.789-1.073-2.504-.715-.715-1.55-1.073-2.503-1.073-.954 0-1.789.358-2.504 1.073-.716.715-1.073 1.55-1.073 2.504s.357 1.788 1.073 2.504c.715.715 1.55 1.073 2.504 1.073.953 0 1.788-.358 2.503-1.073.716-.716 1.073-1.55 1.073-2.504zm7.154-1.55v3.1c0 .12 0 .238-.119.358l-.238.238-2.623.358c-.12.477-.358.954-.597 1.192.358.477.835 1.073 1.55 1.908.12.12.12.238.12.358 0 .119 0 .238-.12.357-.238.358-.715.835-1.311 1.55-.596.716-1.073.954-1.312.954-.119 0-.238 0-.357-.12l-2.027-1.55c-.358.24-.835.359-1.312.478-.12 1.311-.238 2.146-.358 2.623 0 .357-.238.477-.476.477h-3.1c-.12 0-.239 0-.358-.12-.12-.119-.12-.238-.12-.357l-.357-2.623c-.477-.12-.835-.358-1.312-.477l-2.027 1.55c-.119.12-.238.12-.357.12-.12 0-.239 0-.358-.12-1.192-1.073-1.908-1.789-2.265-2.385-.12-.119-.12-.238-.12-.357 0-.12 0-.239.12-.358.119-.239.357-.477.715-.954s.596-.715.715-.954c-.238-.477-.477-.954-.596-1.43l-2.504-.358c-.119 0-.238-.12-.238-.12s-.12-.119-.12-.238v-3.1c0-.12 0-.239.12-.358l.238-.238 2.623-.358c.12-.477.358-.835.597-1.311-.358-.477-.835-1.193-1.55-1.908-.12-.12-.12-.239-.12-.358s0-.238.12-.357c.238-.358.715-.835 1.43-1.55.716-.716 1.073-.954 1.312-.954.12 0 .238 0 .358.119l1.907 1.55c.358-.239.835-.358 1.312-.477.12-1.312.238-2.146.358-2.623.119-.239.238-.358.477-.358h3.1c.119 0 .238 0 .357.12.12.119.12.238.12.357l.357 2.623c.477.12.835.358 1.312.477l2.027-1.55c.119-.12.238-.12.357-.12.12 0 .239 0 .358.12 1.192 1.073 2.027 1.908 2.265 2.385.12.119.12.119.12.357 0 .12 0 .239-.12.358-.119.239-.357.477-.715.954s-.596.715-.715.954c.238.477.477.954.596 1.311l2.504.358c.119 0 .238.12.238.12s.12.238.12.357z",
11464
+ fill: "#45AAF2"
11465
+ })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
11466
+ d: "M0 16.335v-1.789a1.7 1.7 0 0 0 1.43-.715c.358-.477.478-1.073.478-1.789V4.77c0-1.43.477-2.623 1.311-3.457C4.173.358 5.127 0 6.32 0h2.146v2.027H6.32c-.596 0-1.192.238-1.669.835-.477.596-.715 1.192-.715 2.026V12.4c0 1.67-.597 2.623-1.67 3.1 1.073.477 1.67 1.55 1.67 3.1v7.63c0 .835.238 1.55.715 2.028.477.596 1.073.834 1.67.834h2.145V31H6.32c-1.192 0-2.265-.477-3.1-1.311-.954-.835-1.311-2.027-1.311-3.458v-7.393c0-.715-.12-1.311-.477-1.788A1.7 1.7 0 0 0 0 16.335zm34.577 12.638h2.146c.596 0 1.192-.238 1.67-.834.476-.597.715-1.193.715-2.027V18.6c0-1.67.596-2.742 1.669-3.1-1.073-.477-1.67-1.55-1.67-3.1V4.888c0-.834-.238-1.55-.715-2.026-.477-.597-1.073-.835-1.669-.835h-2.146V0h2.146c1.192 0 2.265.477 3.1 1.312.835.834 1.312 2.026 1.312 3.457v7.273c0 .716.119 1.312.477 1.789.357.477.834.715 1.311.715v1.789c-.477 0-.835.238-1.192.715-.358.477-.477 1.073-.477 1.788v7.393c0 1.43-.477 2.504-1.312 3.457-.954.835-2.027 1.312-3.219 1.312h-2.146v-2.027zm17.884-7.75 1.193-1.55c.596.716 1.311 1.192 2.146 1.67.835.476 1.788.596 2.861.596.716 0 1.312-.12 1.789-.239.477-.12.954-.358 1.192-.715.358-.12.596-.477.716-.716.119-.357.238-.596.238-.954 0-.477-.12-.834-.358-1.192a2.784 2.784 0 0 0-.834-.835c-.358-.238-.835-.357-1.312-.596-.477-.238-.954-.357-1.55-.477-.596-.119-1.073-.238-1.55-.476a8.281 8.281 0 0 1-1.55-.597c-.477-.238-.954-.477-1.311-.834-.358-.358-.716-.716-.835-1.193-.238-.476-.358-1.073-.358-1.669 0-1.311.477-2.384 1.55-3.22 1.073-.834 2.385-1.191 3.935-1.191 2.385 0 4.292.715 5.723 2.265l-1.192 1.43c-1.193-1.31-2.743-1.907-4.65-1.907-.954 0-1.789.239-2.385.715-.596.477-.954 1.073-.954 1.789 0 .358.12.715.358 1.073s.477.477.835.715c.357.239.834.358 1.311.477.477.12.954.239 1.55.477.596.239 1.073.477 1.55.596a8.28 8.28 0 0 1 1.55.597c.477.238.954.476 1.312.834.357.358.715.715.834 1.192.12.477.358 1.073.358 1.67 0 .477-.12.954-.239 1.43-.119.477-.357.835-.596 1.312l-1.073 1.073a3.562 3.562 0 0 1-1.669.715c-.835.239-1.55.358-2.385.358-2.623 0-4.65-.834-6.2-2.623zm18.958 2.385V7.512h2.027v6.796h9.42V7.392h2.026v16.096h-2.027v-7.392h-9.419v7.392h-2.027v.12zm20.985 0V7.512h2.027v16.096h-2.027zm9.657 0V7.512h6.439c1.55 0 2.742.476 3.696 1.43.954.954 1.312 2.146 1.312 3.458a5.193 5.193 0 0 1-1.312 3.458c-.954.834-2.146 1.311-3.696 1.311h-4.531v6.439h-1.908zm2.027-8.227h4.173c.954 0 1.67-.239 2.385-.835.715-.596.954-1.311.954-2.265 0-.954-.358-1.67-.954-2.266-.596-.596-1.431-.834-2.385-.834h-4.173v6.2zm15.5 8.227V7.512h11.804v3.577h-7.631v2.503h7.512v3.577h-7.512v2.742h7.631v3.577h-11.804v.12zm18.123 0V7.512h4.174l6.557 8.823V7.512h4.173v16.096h-4.054l-6.796-9.3v9.3h-4.054zm20.866-8.108c0-1.192.238-2.385.715-3.458.477-1.073 1.073-1.907 1.908-2.623.835-.715 1.669-1.311 2.742-1.669 1.073-.358 2.146-.596 3.458-.596.835 0 1.669.12 2.385.358.715.238 1.43.476 1.907.834.596.358 1.073.835 1.431 1.192l1.073 1.431-3.458 1.789a4.103 4.103 0 0 0-1.43-1.431c-.597-.358-1.312-.596-2.027-.596-1.312 0-2.385.477-3.22 1.311-.834.835-1.311 2.027-1.311 3.339 0 1.311.477 2.384 1.311 3.338.835.835 1.908 1.312 3.22 1.312.596 0 1.073-.12 1.669-.239.596-.238.954-.477 1.311-.715v-1.192h-3.576v-3.577h7.75v6.438c-1.908 2.146-4.293 3.1-7.154 3.1-1.193 0-2.385-.238-3.458-.596a7.074 7.074 0 0 1-2.742-1.67c-.835-.715-1.431-1.55-1.908-2.622-.358-1.073-.596-2.266-.596-3.458zm22.058 8.108V7.512h4.173v16.096h-4.173zm10.85 0V7.512h4.292l6.558 8.823V7.512h4.173v16.096h-4.054l-6.796-9.3v9.3h-4.173zm21.7 0V7.512h11.803v3.577h-7.63v2.503h7.511v3.577h-7.511v2.742h7.63v3.577h-11.803v.12zm18.123-13.712c0-.715.238-1.43.834-1.908.596-.476 1.193-.834 1.908-.834.477 0 .954.12 1.431.358.477.238.715.596.954.953.238.358.357.835.357 1.431 0 .715-.238 1.43-.834 1.908-.597.477-1.193.835-1.908.835-.715 0-1.431-.239-1.908-.835-.477-.596-.834-1.193-.834-1.908zm.477 0c0 .596.238 1.192.715 1.67.477.476 1.073.715 1.669.715.596 0 1.192-.239 1.669-.716a2.353 2.353 0 0 0 .716-1.669c0-.715-.239-1.192-.716-1.67a2.356 2.356 0 0 0-1.669-.714c-.715 0-1.192.238-1.669.715-.477.358-.715.954-.715 1.67zm1.311 1.55v-3.1h1.312c.238 0 .477.12.715.239s.238.357.238.715-.119.596-.238.715c-.119.12-.358.239-.477.239l.835 1.311h-.596l-.835-1.311h-.596v1.311h-.358v-.119zm.358-1.55h.834c.12 0 .239 0 .358-.12.239-.238.239-.357.239-.476 0-.12 0-.358-.12-.477-.119-.12-.238-.12-.357-.12h-.835v1.193h-.119z",
11467
+ fill: "#162948"
11468
+ })));
11469
+ };
11470
+
11471
+ const styles$4 = createStyles({
11472
+ poweredByShipEngine: {
11473
+ display: "flex",
11474
+ alignItems: "center",
11475
+ justifyContent: "center",
11476
+ textAlign: "center",
11477
+ margin: "1rem 0",
11478
+ gap: "1rem",
11479
+ color: "#818F9C"
11480
+ }
11481
+ });
11482
+
11483
+ const PoweredByShipEngine = () => {
11484
+ const {
11485
+ t
11486
+ } = reactI18next.useTranslation();
11487
+ return jsxRuntime.jsxs("div", Object.assign({
11488
+ css: styles$4.poweredByShipEngine
11489
+ }, {
11490
+ children: [jsxRuntime.jsx(giger.Typography, Object.assign({
11491
+ variant: "subtitle1"
11492
+ }, {
11493
+ children: t("powered-by")
11494
+ })), jsxRuntime.jsx(SvgShipengineLogo, {})]
11495
+ }));
11496
+ };
11497
+
11093
11498
  const RateForm = ({
11094
11499
  carriers,
11095
11500
  disabled,
@@ -11110,6 +11515,7 @@ const RateForm = ({
11110
11515
  }) => {
11111
11516
  features = Object.assign({
11112
11517
  enableGlobalPostFiltering: false,
11518
+ labelLayout: false,
11113
11519
  nicknameRate: true,
11114
11520
  saveRate: true
11115
11521
  }, features !== null && features !== void 0 ? features : {});
@@ -11174,6 +11580,14 @@ const RateForm = ({
11174
11580
  index < 5 && rateOptions.length <= 6 || !option.requiresAcknowledgement && index < 6 && rateOptions.length > 6 || option.rateId === selectedRateId), [rateOptions, selectedRateId]);
11175
11581
  // When rateOptions update, handle scrolling and single-rate auto-selection and form reset
11176
11582
  React.useEffect(() => {
11583
+ if (!(rateOptions === null || rateOptions === void 0 ? void 0 : rateOptions.length)) {
11584
+ form.setValue("rate", {
11585
+ isAcknowledged: false,
11586
+ rateId: ""
11587
+ }, {
11588
+ shouldDirty: true
11589
+ });
11590
+ }
11177
11591
  if (rateOptions.length === 1) {
11178
11592
  form.setValue("rate", {
11179
11593
  isAcknowledged: !rateOptions[0].requiresAcknowledgement,
@@ -11207,6 +11621,7 @@ const RateForm = ({
11207
11621
  children: [!isLoading && !!rateOptions.length ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
11208
11622
  children: [jsxRuntime.jsx(RateSelect, {
11209
11623
  control: form.control,
11624
+ displayErrors: false,
11210
11625
  label: "Rate",
11211
11626
  name: "rate",
11212
11627
  nicknameFeature:
@@ -11215,7 +11630,7 @@ const RateForm = ({
11215
11630
  onClick: onSelectRate,
11216
11631
  options: showHiddenRates ? rateOptions : filteredRateOptions
11217
11632
  }), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsxRuntime.jsx(giger.Link, Object.assign({
11218
- css: styles$4.showMoreOrLessRatesButton,
11633
+ css: styles$5.showMoreOrLessRatesButton,
11219
11634
  onClick: () => {
11220
11635
  var _a;
11221
11636
  setShowHiddenRates(!showHiddenRates);
@@ -11236,7 +11651,7 @@ const RateForm = ({
11236
11651
  }))
11237
11652
  }))]
11238
11653
  }) : !isLoading && !!allDisplayableErrors.length ? null : jsxRuntime.jsxs("article", Object.assign({
11239
- css: styles$4.ratesInterstitial,
11654
+ css: styles$5.ratesInterstitial,
11240
11655
  role: "presentation"
11241
11656
  }, {
11242
11657
  children: [jsxRuntime.jsx(Cube, {
@@ -11250,7 +11665,7 @@ const RateForm = ({
11250
11665
  children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
11251
11666
  })
11252
11667
  }))]
11253
- })), !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsxRuntime.jsx(Section, Object.assign({
11668
+ })), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsxRuntime.jsx(Section, Object.assign({
11254
11669
  title: t("manage-defaults:label.title")
11255
11670
  }, {
11256
11671
  children: jsxRuntime.jsx(LabelLayout, {
@@ -11259,14 +11674,14 @@ const RateForm = ({
11259
11674
  })), jsxRuntime.jsx(FundAndPurchase, {
11260
11675
  carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
11261
11676
  control: form.control,
11262
- css: styles$4.fundAndPurchase,
11677
+ css: styles$5.fundAndPurchase,
11263
11678
  disabled: disabled,
11264
11679
  isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
11265
11680
  isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
11266
11681
  onPurchase: handleSubmit,
11267
11682
  onSave: handleSaveRate,
11268
11683
  purchaseAmount: getTotalRateAmount(selectedRate)
11269
- })]
11684
+ }), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
11270
11685
  }));
11271
11686
  };
11272
11687
 
@@ -11831,13 +12246,10 @@ const ShipmentForm = ({
11831
12246
  } = reactI18next.useTranslation(["purchase-label"]);
11832
12247
  const [requireMeasurements, setRequireMeasurements] = React.useState(true);
11833
12248
  const [insuranceEnabled, setInsuranceEnabled] = React.useState(false);
11834
- const isCustomsRequired = React.useMemo(() => {
11835
- return shipment ? getIsCustomsRequiredForShipment(shipment) : false;
11836
- }, [shipment]);
11837
- const isContentDescriptionRequired = React.useMemo(() => {
11838
- var _a;
11839
- return shipment && ((_a = shipment.shipFrom) === null || _a === void 0 ? void 0 : _a.countryCode) === "MX" || (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo.countryCode) === "MX";
11840
- }, [shipment]);
12249
+ const {
12250
+ isContentDescriptionRequired,
12251
+ isCustomsRequired
12252
+ } = useShipmentMetadata(shipment);
11841
12253
  const shipmentSchema = React.useMemo(() => getShipmentSchema({
11842
12254
  isContentDescriptionRequired,
11843
12255
  isCustomsRequired,
@@ -11848,7 +12260,7 @@ const ShipmentForm = ({
11848
12260
  const form = reactHookForm.useForm({
11849
12261
  defaultValues: {
11850
12262
  __mode: features.browseRates ? "browse_rates" : "select_service",
11851
- shipDate: minimumShipDate.toLocaleDateString("en-US")
12263
+ shipDate: formatUSADate(minimumShipDate || new Date())
11852
12264
  },
11853
12265
  resolver: validationResolver(shipmentSchema)
11854
12266
  });
@@ -11873,10 +12285,6 @@ const ShipmentForm = ({
11873
12285
  return (carriers !== null && carriers !== void 0 ? carriers : []).filter(c => carrierIds.includes(c.carrierId));
11874
12286
  }, [carrierIds, carriers, selectedMode]);
11875
12287
  const nonAddressValidationErrors = errors === null || errors === void 0 ? void 0 : errors.filter(e => e.errorCode !== "invalid_address");
11876
- const isInternationalShipment = React.useMemo(() => {
11877
- return shipment ? getIsInternationalShipment(shipment) : false;
11878
- }, [shipment]);
11879
- const isPoBoxShipment = React.useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
11880
12288
  const confirmationOptions = useConfirmationOptions();
11881
12289
  const customsContentsOptions = useCustomsContentsOptions();
11882
12290
  const customsNonDeliveryOptions = useCustomsNonDeliveryOptions();
@@ -11884,9 +12292,9 @@ const ShipmentForm = ({
11884
12292
  includeShipsuranceInsurance: features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance,
11885
12293
  includeThirdPartyInsurance: features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance
11886
12294
  });
11887
- const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes, isPoBoxShipment);
11888
- const serviceCodeOptions = useServiceCodeOptions(carriers, !isInternationalShipment, isPoBoxShipment);
11889
- const shippingPresetOptions = useShippingPresetsOptions(shippingPresets, isInternationalShipment);
12295
+ const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes, shipment);
12296
+ const serviceCodeOptions = useServiceCodeOptions(carriers, shipment);
12297
+ const shippingPresetOptions = useShippingPresetsOptions(shippingPresets, shipment);
11890
12298
  const warehouseOptions = useWarehouseOptions(warehouses);
11891
12299
  const [showItems, setShowItems] = React.useState(false);
11892
12300
  const [showApplyPreset, setShowApplyPreset] = React.useState(false);
@@ -11984,7 +12392,7 @@ const ShipmentForm = ({
11984
12392
  carrierId: updatedShipment.carrierId,
11985
12393
  serviceCode: updatedShipment.serviceCode
11986
12394
  } : undefined,
11987
- shipDate: mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate).toLocaleDateString("en-US"),
12395
+ shipDate: formatUSADate(mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate)),
11988
12396
  shipmentId: updatedShipment.shipmentId,
11989
12397
  warehouseId: updatedShipment.warehouseId
11990
12398
  }));
@@ -12146,6 +12554,7 @@ const ShipmentForm = ({
12146
12554
  });
12147
12555
  if (errors) throw new Error(errors.map(e => e.message).join(", "));
12148
12556
  if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
12557
+ const isEmptyShipTo = Object.entries(shipment.shipTo).every(([key, value]) => key === "countryCode" || [null, "", "unknown"].includes(value));
12149
12558
  return jsxRuntime.jsxs("form", Object.assign({
12150
12559
  id: "shipment-form",
12151
12560
  onSubmit: formLogger.capture(handleSubmit)
@@ -12169,7 +12578,12 @@ const ShipmentForm = ({
12169
12578
  }), jsxRuntime.jsx(FieldLabel, Object.assign({
12170
12579
  label: !isEditShipFormToOpen ? "purchase-label:fields.shipTo" : ""
12171
12580
  }, {
12172
- children: !isEditShipFormToOpen && (addressPreference ? jsxRuntime.jsx(AddressPreferenceDisplay, {
12581
+ children: !isEditShipFormToOpen && (isEmptyShipTo ? jsxRuntime.jsx(giger.Button, Object.assign({
12582
+ onClick: toggleIsEditShipFormToOpen,
12583
+ variant: giger.ButtonVariant.OUTLINED
12584
+ }, {
12585
+ children: t("purchase-label:fields:addShipToAddress")
12586
+ })) : addressPreference ? jsxRuntime.jsx(AddressPreferenceDisplay, {
12173
12587
  addressPreference: addressPreference,
12174
12588
  onChangePreference: handleChangePreference,
12175
12589
  onEditAddress: () => {
@@ -12774,7 +13188,7 @@ const Shipment = ({
12774
13188
  })), "representative."]
12775
13189
  }))
12776
13190
  }))
12777
- }))]
13191
+ })), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
12778
13192
  });
12779
13193
  };
12780
13194
 
@@ -12802,115 +13216,6 @@ const SuspendShipment = ({
12802
13216
  }));
12803
13217
  };
12804
13218
 
12805
- const VoidLabel = ({
12806
- onComplete,
12807
- onSubmit,
12808
- onViewShipment,
12809
- shipment,
12810
- voidRequest
12811
- }) => {
12812
- const {
12813
- t
12814
- } = reactI18next.useTranslation(["common", "void-label"]);
12815
- const [isSubmitting, setIsSubmitting] = React.useState(false);
12816
- const handleSubmit = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
12817
- setIsSubmitting(true);
12818
- yield onSubmit();
12819
- setIsSubmitting(false);
12820
- }), [onSubmit]);
12821
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
12822
- children: [jsxRuntime.jsx(Section, {
12823
- children: voidRequest ? jsxRuntime.jsxs("section", Object.assign({
12824
- css: {
12825
- textAlign: "center",
12826
- width: "100%"
12827
- }
12828
- }, {
12829
- children: [jsxRuntime.jsx(giger.Icon, {
12830
- css: theme => ({
12831
- color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
12832
- }),
12833
- name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? gigerTheme.IconNames.CHECK_FILLED : gigerTheme.IconNames.ALERT,
12834
- size: giger.IconSize.SIZE_LARGE
12835
- }), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
12836
- children: [jsxRuntime.jsx(giger.Typography, Object.assign({
12837
- component: "h2"
12838
- }, {
12839
- children: t("void-label:resultTitles.approved")
12840
- })), jsxRuntime.jsx(giger.Typography, Object.assign({
12841
- variant: "body1"
12842
- }, {
12843
- children: t("void-label:resultMessages.approved")
12844
- }))]
12845
- }) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
12846
- children: [jsxRuntime.jsx(giger.Typography, Object.assign({
12847
- component: "h2"
12848
- }, {
12849
- children: t("void-label:resultTitles.rejected")
12850
- })), jsxRuntime.jsx(giger.Typography, Object.assign({
12851
- variant: "body1"
12852
- }, {
12853
- children: jsxRuntime.jsx("p", {
12854
- dangerouslySetInnerHTML: {
12855
- __html: t("void-label:resultMessages.rejected")
12856
- }
12857
- })
12858
- }))]
12859
- })]
12860
- })) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
12861
- children: [jsxRuntime.jsx(giger.Typography, Object.assign({
12862
- variant: "body1"
12863
- }, {
12864
- children: t("void-label:refund_process")
12865
- })), jsxRuntime.jsx(giger.Typography, Object.assign({
12866
- component: "p",
12867
- variant: "body1"
12868
- }, {
12869
- children: t("void-label:refund_rules")
12870
- }))]
12871
- })
12872
- }), jsxRuntime.jsx(giger.BottomSheet, Object.assign({
12873
- alwaysVisible: true,
12874
- css: theme => ({
12875
- borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
12876
- boxShadow: "none",
12877
- position: "static"
12878
- })
12879
- }, {
12880
- children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
12881
- // Label has been voided
12882
- jsxRuntime.jsxs(ButtonGroup, {
12883
- children: [jsxRuntime.jsx(giger.Button, Object.assign({
12884
- bold: false,
12885
- onClick: () => shipment && onComplete(voidRequest, shipment),
12886
- type: "button",
12887
- variant: giger.ButtonVariant.OUTLINED
12888
- }, {
12889
- children: t("void-label:actions.complete")
12890
- })), jsxRuntime.jsx(giger.Button, Object.assign({
12891
- bold: false,
12892
- isFullWidth: true,
12893
- onClick: () => shipment && onViewShipment(shipment),
12894
- type: "button"
12895
- }, {
12896
- children: t("void-label:actions.viewShipment")
12897
- }))]
12898
- }) :
12899
- // Label has not yet been voided
12900
- jsxRuntime.jsx(giger.Button, Object.assign({
12901
- bold: false,
12902
- disabled: isSubmitting,
12903
- isFullWidth: true,
12904
- isLoading: isSubmitting,
12905
- onClick: handleSubmit,
12906
- type: "submit"
12907
- }, {
12908
- children: t("void-label:actions.confirmVoid")
12909
- }))
12910
- }))]
12911
- });
12912
- };
12913
-
12914
13219
  var index = /*#__PURE__*/Object.freeze({
12915
13220
  __proto__: null,
12916
13221
  AddCarrierForm: AddCarrierForm,
@@ -12943,9 +13248,8 @@ var index = /*#__PURE__*/Object.freeze({
12943
13248
  Shipment: Shipment,
12944
13249
  SuspendShipment: SuspendShipment,
12945
13250
  WarehouseForm: WarehouseForm,
12946
- VoidLabel: VoidLabel,
12947
13251
  WalletForm: WalletForm,
12948
- styles: styles$b,
13252
+ styles: styles$d,
12949
13253
  billingAddressSchema: billingAddressSchema,
12950
13254
  walletSchema: walletSchema,
12951
13255
  BillingFields: BillingFields,
@@ -13230,6 +13534,7 @@ const DateRangeCombo = ({
13230
13534
  dateFormat: "MM/dd/yyyy",
13231
13535
  isClearable: true,
13232
13536
  label: t("wallet-history:actions.chooseDate"),
13537
+ locale: LOCALE,
13233
13538
  maxDate: new Date(),
13234
13539
  onClickConfirm: dates => {
13235
13540
  if (Array.isArray(dates) && dates.length === 2 && dates[1] !== null) handleConfirmCustomRange(dates);
@@ -13496,6 +13801,7 @@ var common = {
13496
13801
  autoFundingSettings: "Unable to load auto funding settings",
13497
13802
  carrier: "Unable to load carrier",
13498
13803
  carriers: "Unable to load carriers",
13804
+ label: "Unable to load label",
13499
13805
  salesOrder: "Unable to load order",
13500
13806
  shipment: "Unable to load shipment",
13501
13807
  warehouses: "Unable to load warehouses"
@@ -13526,6 +13832,7 @@ var common = {
13526
13832
  carriers: "Loading carriers...",
13527
13833
  data: "Loading...",
13528
13834
  importingSalesOrder: "Importing order...",
13835
+ label: "Loading label...",
13529
13836
  onboarding: "Loading onboarding...",
13530
13837
  salesOrder: "Loading order...",
13531
13838
  shipment: "Loading shipment...",
@@ -13552,6 +13859,7 @@ var common = {
13552
13859
  packageCodes: {
13553
13860
  "package": "Custom"
13554
13861
  },
13862
+ "powered-by": "Powered by",
13555
13863
  schema: {
13556
13864
  optionalLabel: "{{fieldLabel}} (optional)"
13557
13865
  },
@@ -13622,21 +13930,8 @@ var listCarriers$1 = {
13622
13930
 
13623
13931
  var manageDefaults = {
13624
13932
  "manage-defaults": {
13625
- units: {
13626
- title: "Units of Measure",
13627
- dimensions: {
13628
- title: "Dimensions",
13629
- standard: "Inches",
13630
- metric: "Centimeters"
13631
- },
13632
- weight: {
13633
- title: "Weight",
13634
- standard: "Pounds & Ounces",
13635
- g: "Grams",
13636
- kg: "Kilograms"
13637
- }
13638
- },
13639
13933
  label: {
13934
+ title: "Label Printing",
13640
13935
  letter: {
13641
13936
  title: "Letter (8.5 x 11 inch)",
13642
13937
  description: "For desktop printers"
@@ -13648,8 +13943,26 @@ var manageDefaults = {
13648
13943
  thermal: {
13649
13944
  title: "Thermal (4 x 6 inch)",
13650
13945
  description: "For label printers"
13946
+ }
13947
+ },
13948
+ status: {
13949
+ saving: "Saving...",
13950
+ saved: "Saved",
13951
+ savingFailed: "Saving Failed"
13952
+ },
13953
+ units: {
13954
+ title: "Units of Measure",
13955
+ dimensions: {
13956
+ title: "Dimensions",
13957
+ standard: "Inches",
13958
+ metric: "Centimeters"
13651
13959
  },
13652
- title: "Shipping Label Layout"
13960
+ weight: {
13961
+ title: "Weight",
13962
+ standard: "Pounds & Ounces",
13963
+ g: "Grams",
13964
+ kg: "Kilograms"
13965
+ }
13653
13966
  }
13654
13967
  }
13655
13968
  };
@@ -13782,7 +14095,9 @@ var purchaseLabel$1 = {
13782
14095
  invalidAddress: "The address cannot be validated. Please confirm the address details with your customer and <link>edit the address in ShipStation</link>.",
13783
14096
  noRates: "We were unable to find any rates matching your shipment information",
13784
14097
  salesOrderNotLoaded: "Sales order has not been loaded",
13785
- unsupportedAddress: "At this time, we do not support shipping to international addresses that require customs declarations, including international, military, and US Territory addresses. You can create a label for this order in ShipStation."
14098
+ unsupportedAddress: "At this time, we do not support shipping to international addresses that require customs declarations, including international, military, and US Territory addresses. You can create a label for this order in ShipStation.",
14099
+ saveRateFailedMessage: "Saving DHL Express Worldwide rates is temporarily unavailable. Please try again later.",
14100
+ saveRateFailedTitle: "Unable To Save Rate"
13786
14101
  },
13787
14102
  errorTypes: {
13788
14103
  results: "No results returned"
@@ -13810,6 +14125,7 @@ var purchaseLabel$1 = {
13810
14125
  shipDate: "Ship Date",
13811
14126
  service: "Service",
13812
14127
  shipTo: "Ship To",
14128
+ addShipToAddress: "Add Ship To Address",
13813
14129
  warehouse: "Ship From",
13814
14130
  weight: {
13815
14131
  whole: "Pounds",
@@ -13945,6 +14261,9 @@ var voidLabel$1 = {
13945
14261
  confirmVoid: "Confirm Void",
13946
14262
  viewShipment: "View Shipment"
13947
14263
  },
14264
+ errorMessages: {
14265
+ labelIdRequired: "A label id is required"
14266
+ },
13948
14267
  resultMessages: {
13949
14268
  approved: "Your refund request has been submitted to the carrier.",
13950
14269
  rejected: "Your label may have already been scanned by the carrier or the label type is ineligible for voiding.<br /><br />Contact your carrier for assistance with shipments currently in transit."
@@ -15111,15 +15430,61 @@ const PurchaseLabelBySalesOrder = _a => {
15111
15430
  }));
15112
15431
  };
15113
15432
 
15114
- const useLoadShipment = ({
15115
- shipmentId
15116
- }) => {
15433
+ let shipmentsCreated = 0;
15434
+ const useGetOrCreateShipment = shipmentId => {
15435
+ const {
15436
+ client
15437
+ } = alchemy.useShipEngine();
15438
+ const shipmentCreation = React.useMemo(() => {
15439
+ return ++shipmentsCreated;
15440
+ },
15441
+ // eslint-disable-next-line react-hooks/exhaustive-deps
15442
+ []);
15443
+ return reactQuery.useQuery({
15444
+ onError: reactApi.onError,
15445
+ retry: shipmentId !== undefined,
15446
+ queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
15447
+ var _a;
15448
+ if (shipmentId) {
15449
+ return (yield client.salesOrderShipments.get(shipmentId)).data;
15450
+ } else {
15451
+ const warehouses = (yield client.warehouses.list()).data.warehouses;
15452
+ const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
15453
+ if (defaultOrFirstWarehouse === undefined) {
15454
+ throw [alchemy.CodedError.fromObject({
15455
+ message: "errorMessages.noWarehouses",
15456
+ errorType: "unknown",
15457
+ errorCode: "unknown",
15458
+ errorSource: "client"
15459
+ })];
15460
+ }
15461
+ const shipTo = {
15462
+ addressLine1: "",
15463
+ cityLocality: "",
15464
+ countryCode: "",
15465
+ name: "",
15466
+ phone: "",
15467
+ postalCode: "",
15468
+ stateProvince: ""
15469
+ };
15470
+ const newShipment = yield client.shipments.create({
15471
+ shipTo: shipTo,
15472
+ warehouseId: defaultOrFirstWarehouse.warehouseId
15473
+ });
15474
+ return newShipment.data.shipments[0];
15475
+ }
15476
+ }),
15477
+ queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
15478
+ });
15479
+ };
15480
+
15481
+ const useLoadOrCreateShipment = shipmentId => {
15117
15482
  const {
15118
15483
  data: shipment,
15119
15484
  error: loadShipmentErrors,
15120
15485
  refetch: refetchShipment,
15121
15486
  isLoading
15122
- } = alchemy.useGetShipment(shipmentId);
15487
+ } = useGetOrCreateShipment(shipmentId);
15123
15488
  const errors = [...(loadShipmentErrors !== null && loadShipmentErrors !== void 0 ? loadShipmentErrors : [])];
15124
15489
  return {
15125
15490
  errors: errors.length > 0 ? errors : undefined,
@@ -15131,15 +15496,12 @@ const useLoadShipment = ({
15131
15496
 
15132
15497
  const PurchaseLabelByShipment = _a => {
15133
15498
  var {
15134
- shipmentId,
15135
15499
  onLoad,
15136
15500
  onShipmentUpdated,
15137
15501
  features
15138
15502
  } = _a,
15139
- props = __rest(_a, ["shipmentId", "onLoad", "onShipmentUpdated", "features"]);
15140
- const _b = useLoadShipment({
15141
- shipmentId
15142
- }),
15503
+ props = __rest(_a, ["onLoad", "onShipmentUpdated", "features"]);
15504
+ const _b = useLoadOrCreateShipment("shipmentId" in props ? props.shipmentId : undefined),
15143
15505
  {
15144
15506
  shipment
15145
15507
  } = _b,
@@ -15171,16 +15533,11 @@ const PurchaseLabelByShipment = _a => {
15171
15533
  };
15172
15534
 
15173
15535
  const Component$2 = _a => {
15174
- var {
15175
- shipmentId
15176
- } = _a,
15177
- props = __rest(_a, ["shipmentId"]);
15178
- if (shipmentId) {
15179
- return jsxRuntime.jsx(PurchaseLabelByShipment, Object.assign({
15180
- shipmentId: shipmentId
15181
- }, props));
15182
- } else {
15536
+ var props = __rest(_a, []);
15537
+ if ("salesOrderId" in props) {
15183
15538
  return jsxRuntime.jsx(PurchaseLabelBySalesOrder, Object.assign({}, props));
15539
+ } else {
15540
+ return jsxRuntime.jsx(PurchaseLabelByShipment, Object.assign({}, props));
15184
15541
  }
15185
15542
  };
15186
15543
  const Element$2 = alchemy__default["default"].createElement(Component$2, ErrorFallback, {
@@ -15254,6 +15611,111 @@ var viewShipment = /*#__PURE__*/Object.freeze({
15254
15611
  Element: Element$1
15255
15612
  });
15256
15613
 
15614
+ const Actions = ({
15615
+ onComplete,
15616
+ onSubmit,
15617
+ onViewShipment,
15618
+ shipment,
15619
+ voidRequest
15620
+ }) => {
15621
+ const {
15622
+ t
15623
+ } = reactI18next.useTranslation(["common", "void-label"]);
15624
+ const [isSubmitting, setIsSubmitting] = React.useState(false);
15625
+ const handleSubmit = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
15626
+ setIsSubmitting(true);
15627
+ yield onSubmit();
15628
+ setIsSubmitting(false);
15629
+ }), [onSubmit]);
15630
+ return jsxRuntime.jsx(giger.BottomSheet, Object.assign({
15631
+ alwaysVisible: true,
15632
+ css: theme => ({
15633
+ borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
15634
+ boxShadow: "none",
15635
+ position: "static"
15636
+ })
15637
+ }, {
15638
+ children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
15639
+ // The void request has been approved
15640
+ jsxRuntime.jsxs(ButtonGroup, {
15641
+ children: [jsxRuntime.jsx(giger.Button, Object.assign({
15642
+ bold: false,
15643
+ onClick: () => onComplete(voidRequest, shipment),
15644
+ variant: giger.ButtonVariant.OUTLINED
15645
+ }, {
15646
+ children: t("void-label:actions.complete")
15647
+ })), jsxRuntime.jsx(giger.Button, Object.assign({
15648
+ bold: false,
15649
+ isFullWidth: true,
15650
+ onClick: () => onViewShipment(shipment)
15651
+ }, {
15652
+ children: t("void-label:actions.viewShipment")
15653
+ }))]
15654
+ }) :
15655
+ // The void request has yet to be made or was rejected
15656
+ jsxRuntime.jsx(giger.Button, Object.assign({
15657
+ bold: false,
15658
+ isFullWidth: true,
15659
+ isLoading: isSubmitting,
15660
+ onClick: handleSubmit
15661
+ }, {
15662
+ children: t("void-label:actions.confirmVoid")
15663
+ }))
15664
+ }));
15665
+ };
15666
+
15667
+ const Message = ({
15668
+ voidRequest
15669
+ }) => {
15670
+ const {
15671
+ t
15672
+ } = reactI18next.useTranslation(["common", "void-label"]);
15673
+ return jsxRuntime.jsx(Section, {
15674
+ children: voidRequest ? jsxRuntime.jsxs("section", Object.assign({
15675
+ css: {
15676
+ textAlign: "center",
15677
+ width: "100%"
15678
+ }
15679
+ }, {
15680
+ children: [jsxRuntime.jsx(giger.Icon, {
15681
+ css: theme => ({
15682
+ color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
15683
+ }),
15684
+ name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? gigerTheme.IconNames.CHECK_FILLED : gigerTheme.IconNames.ALERT,
15685
+ size: giger.IconSize.SIZE_LARGE
15686
+ }), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
15687
+ children: [jsxRuntime.jsx(giger.Typography, Object.assign({
15688
+ component: "h2"
15689
+ }, {
15690
+ children: t("void-label:resultTitles.approved")
15691
+ })), jsxRuntime.jsx(giger.Typography, {
15692
+ children: t("void-label:resultMessages.approved")
15693
+ })]
15694
+ }) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
15695
+ children: [jsxRuntime.jsx(giger.Typography, Object.assign({
15696
+ component: "h2"
15697
+ }, {
15698
+ children: t("void-label:resultTitles.rejected")
15699
+ })), jsxRuntime.jsx(giger.Typography, {
15700
+ children: jsxRuntime.jsx("p", {
15701
+ dangerouslySetInnerHTML: {
15702
+ __html: t("void-label:resultMessages.rejected")
15703
+ }
15704
+ })
15705
+ })]
15706
+ })]
15707
+ })) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
15708
+ children: [jsxRuntime.jsx(giger.Typography, {
15709
+ children: t("void-label:refund_process")
15710
+ }), jsxRuntime.jsx(giger.Typography, Object.assign({
15711
+ component: "p"
15712
+ }, {
15713
+ children: t("void-label:refund_rules")
15714
+ }))]
15715
+ })
15716
+ });
15717
+ };
15718
+
15257
15719
  const Component = ({
15258
15720
  labelId,
15259
15721
  onComplete,
@@ -15261,24 +15723,40 @@ const Component = ({
15261
15723
  onViewShipment
15262
15724
  }) => {
15263
15725
  var _a;
15726
+ // TODO [LMNT-910] - labelId should be a required prop
15727
+ if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
15728
+ const {
15729
+ t
15730
+ } = reactI18next.useTranslation();
15264
15731
  const label = alchemy.useGetLabel(labelId);
15265
15732
  const shipment = alchemy.useGetSalesOrderShipment((_a = label.data) === null || _a === void 0 ? void 0 : _a.shipmentId);
15266
15733
  const voidLabel = alchemy.useVoidLabel();
15734
+ if (label.isLoading) return jsxRuntime.jsx(Loader, {
15735
+ message: t("loading.label")
15736
+ });
15737
+ if (shipment.isLoading) return jsxRuntime.jsx(Loader, {
15738
+ message: t("loading.shipment")
15739
+ });
15740
+ throwAny(label.error);
15741
+ throwAny(shipment.error);
15742
+ if (!label.data) throw new Error("errorMessages.unableToLoad.label");
15743
+ if (!shipment.data) throw new Error("errorMessages.unableToLoad.shipment");
15267
15744
  const handleVoidLabelSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
15268
- if (!labelId) throw new Error("labelId is required");
15269
15745
  const result = yield voidLabel.mutateAsync(labelId);
15270
- // We should always have label.data and shipment.data if the request was approved,
15271
- // but we aren't using Suspense so we still need to check.
15272
- if ((result === null || result === void 0 ? void 0 : result.approved) && label.data && shipment.data) {
15746
+ if (result.approved) {
15273
15747
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(label.data, shipment.data);
15274
15748
  }
15275
15749
  });
15276
- return jsxRuntime.jsx(VoidLabel, {
15277
- onComplete: onComplete,
15278
- onSubmit: handleVoidLabelSubmit,
15279
- onViewShipment: onViewShipment,
15280
- shipment: shipment.data,
15281
- voidRequest: voidLabel.data
15750
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
15751
+ children: [jsxRuntime.jsx(Message, {
15752
+ voidRequest: voidLabel.data
15753
+ }), jsxRuntime.jsx(Actions, {
15754
+ onComplete: onComplete,
15755
+ onSubmit: handleVoidLabelSubmit,
15756
+ onViewShipment: onViewShipment,
15757
+ shipment: shipment.data,
15758
+ voidRequest: voidLabel.data
15759
+ }), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
15282
15760
  });
15283
15761
  };
15284
15762
  const Element = alchemy__default["default"].createElement(Component, ErrorFallback, {
@@ -15321,6 +15799,7 @@ exports.ManageWarehouses = manageWarehouses;
15321
15799
  exports.Onboarding = onboarding;
15322
15800
  exports.PageLayoutProvider = PageLayoutProvider;
15323
15801
  exports.Portal = Portal;
15802
+ exports.PoweredByShipEngine = PoweredByShipEngine;
15324
15803
  exports.PurchaseLabel = purchaseLabel;
15325
15804
  exports.RootPortalProvider = RootPortalProvider;
15326
15805
  exports.Section = Section;
@@ -15374,6 +15853,8 @@ exports.isPoBox = isPoBox;
15374
15853
  exports.isPoBoxAddress = isPoBoxAddress;
15375
15854
  exports.isString = isString;
15376
15855
  exports.isUnitedStatesTerritory = isUnitedStatesTerritory;
15856
+ exports.isUnsupportedByUps = isUnsupportedByUps;
15857
+ exports.isUpsCarrier = isUpsCarrier;
15377
15858
  exports.isUspsCarrier = isUspsCarrier;
15378
15859
  exports.moneySchema = moneySchema;
15379
15860
  exports.mostRecent = mostRecent;
@@ -15384,6 +15865,8 @@ exports.phoneSchema = phoneSchema;
15384
15865
  exports.phoneSchemaUnvalidated = phoneSchemaUnvalidated;
15385
15866
  exports.postalCodeRegex = postalCodeRegex$3;
15386
15867
  exports.sortByCreationDate = sortByCreationDate;
15868
+ exports.throwAny = throwAny;
15869
+ exports.throwJoinedMessages = throwJoinedMessages;
15387
15870
  exports.usCities = usCities;
15388
15871
  exports.usStateCodes = usStateCodes;
15389
15872
  exports.usStates = usStates;
@@ -15403,6 +15886,7 @@ exports.useRateOptions = useRateOptions;
15403
15886
  exports.useRootPortal = useRootPortal;
15404
15887
  exports.useRunOnceOnTrue = useRunOnceOnTrue;
15405
15888
  exports.useServiceCodeOptions = useServiceCodeOptions;
15889
+ exports.useShipmentMetadata = useShipmentMetadata;
15406
15890
  exports.useShippingPresetsOptions = useShippingPresetsOptions;
15407
15891
  exports.useStateCodeOptions = useStateCodeOptions;
15408
15892
  exports.useToggle = useToggle;