@shipengine/elements 0.17.3 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/components/fund-and-purchase/fund-and-purchase.d.ts +3 -1
  2. package/components/history/history-actions/history-actions.d.ts +1 -0
  3. package/components/history/history-actions/history-actions.styles.d.ts +1 -0
  4. package/components/history/history-actions/index.d.ts +1 -0
  5. package/components/history/history-body/history-body.d.ts +6 -0
  6. package/components/history/history-body/index.d.ts +1 -0
  7. package/components/history/history-list/history-list.d.ts +12 -0
  8. package/components/history/history-list/index.d.ts +1 -0
  9. package/components/history/history-row/history-row.d.ts +6 -0
  10. package/components/history/history-row/index.d.ts +1 -0
  11. package/components/history/history.d.ts +11 -0
  12. package/components/history/index.d.ts +1 -0
  13. package/components/templates/index.d.ts +3 -0
  14. package/components/templates/manage-warehouses/manage-warehouse.styles.d.ts +1 -0
  15. package/components/templates/manage-warehouses/manage-warehouses.d.ts +10 -5
  16. package/components/templates/onboarding/onboarding.d.ts +8 -1
  17. package/components/templates/shipment-form/shipment-schema.d.ts +2 -2
  18. package/components/templates/wallet-history/index.d.ts +1 -0
  19. package/components/templates/wallet-history/wallet-history.d.ts +6 -0
  20. package/components/templates/warehouse-form/warehouse-form-schema.d.ts +52 -146
  21. package/components/templates/warehouse-form/warehouse-form.d.ts +2 -1
  22. package/components/templates/warehouse-preference-select/index.d.ts +1 -0
  23. package/components/templates/warehouse-preference-select/warehouse-preference-select.d.ts +24 -0
  24. package/components/templates/warehouse-preference-wizard/index.d.ts +1 -0
  25. package/components/templates/warehouse-preference-wizard/warehouse-preference-wizard.d.ts +23 -0
  26. package/elements/components/index.d.ts +1 -0
  27. package/elements/components/manage-warehouses/manage-warehouses.d.ts +5 -2
  28. package/elements/components/wallet-history/index.d.ts +1 -0
  29. package/elements/components/wallet-history/wallet-history.d.ts +1 -0
  30. package/elements/index.d.ts +1 -0
  31. package/elements/manage-warehouses.d.ts +1 -1
  32. package/elements/wallet-history.d.ts +1 -0
  33. package/factories/shipengine/index.d.ts +1 -0
  34. package/factories/shipengine/wallet-history.d.ts +14 -0
  35. package/factories/shipengine/warehouse.d.ts +2 -0
  36. package/hooks/index.d.ts +1 -0
  37. package/hooks/use-warehouse-validation.d.ts +14 -0
  38. package/index.cjs +1044 -1250
  39. package/index.d.ts +0 -2
  40. package/index.js +1042 -1215
  41. package/locales/en/index.d.ts +15 -0
  42. package/package.json +3 -3
  43. package/components/templates/warehouse-form/warehouse-form.styles.d.ts +0 -1
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
2
2
  import { useController, get as get$1, set as set$2, useWatch, useFormState, useForm } from 'react-hook-form';
3
3
  import { useTranslation, Trans, initReactI18next, I18nextProvider } from 'react-i18next';
4
- import { Typography, FormField, FieldMessageType, Input, Checkbox, Icon, Divider, Link, Select as Select$1, Next, Option, Button, Switch as Switch$1, Textarea, ButtonVariant, InlineNotification, NotificationType, ButtonColor, Grid, GridChild, Tag, TagColor, Skeleton, SkeletonAnimation, SkeletonVariant, SkeletonBackgroundColor, IconSize, Stepper, Step, Spinner, SpinnerSize, ChipList, Chip, ButtonSize, Table, TableBody, TableBaseRow, TableBodyCell, TableHeader, TableHeaderCell, useToggle as useToggle$1, Popover, DropdownOptionList, BottomSheet, GigerConfigProvider, EmotionReset, FontsLoader } from '@packlink/giger';
4
+ import { Typography, FormField, FieldMessageType, Input, Checkbox, Icon, Divider, Link, Select as Select$1, Next, Option, Button, Switch as Switch$1, Textarea, ButtonVariant, InlineNotification, NotificationType, ButtonColor, Grid, GridChild, Tag, TagColor, Skeleton, SkeletonAnimation, SkeletonVariant, SkeletonBackgroundColor, IconSize, Stepper, Step, Spinner, SpinnerSize, ChipList, Chip, ButtonSize, Table, TableBody, TableBaseRow, TableBodyCell, TableHeader, TableHeaderCell, useToggle as useToggle$1, Popover, DropdownOptionList, Pagination, BottomSheet, GigerConfigProvider, EmotionReset, FontsLoader } from '@packlink/giger';
5
5
  import axios from 'axios';
6
- import { logger, ShipEngineProvider, useAddFunds, useGetCarrierById, useUpdateAutoFunding, useGetAutoFundingConfiguration, useListCarriers, useConnectCarrier, useListWarehouses, useUpdateWarehouse, useCreateWarehouse, useDeleteWarehouse, useValidateAddresses, useUpdateSalesOrderShipment, useParseAddress, useListCustomPackageTypes, useCalculateRates, useCreateLabel, useListSalesOrderShipments, useCreateSalesOrderShipment, useGetAccountSettings, useListSalesOrders, useGetSalesOrder, useListOrderSources, useRefreshOrderSource, useGetShipment, useGetSalesOrderShipment, useListLabels, useGetLabel, useVoidLabel } from '@shipengine/react';
6
+ import { logger, ShipEngineProvider, useValidateAddresses, useAddFunds, useGetCarrierById, useUpdateAutoFunding, useGetAutoFundingConfiguration, useListCarriers, useConnectCarrier, useListWarehouses, useUpdateWarehouse, useCreateWarehouse, useDeleteWarehouse, useUpdateSalesOrderShipment, useParseAddress, useListCustomPackageTypes, useCalculateRates, useCreateLabel, useListSalesOrderShipments, useCreateSalesOrderShipment, useGetAccountSettings, useListSalesOrders, useGetSalesOrder, useListOrderSources, useRefreshOrderSource, useGetShipment, useGetSalesOrderShipment, useListLabels, useGetWalletTransactionHistory, useGetLabel, useVoidLabel } from '@shipengine/react';
7
7
  import { zodResolver } from '@hookform/resolvers/zod';
8
8
  import { z } from 'zod';
9
9
  import * as React from 'react';
@@ -18,13 +18,10 @@ import { createPortal } from 'react-dom';
18
18
  import { isValidPhoneNumber } from 'libphonenumber-js/min';
19
19
  import cardValidator from 'card-validator';
20
20
  import { encode } from 'js-base64';
21
- import { useIsMutating } from 'react-query';
21
+ import { useQueryClient } from 'react-query';
22
22
  import { stringify, COMMENT, rulesheet, middleware, RULESET, combine, match as match$1, serialize, copy, replace as replace$4, WEBKIT as WEBKIT$1, MOZ, MS, KEYFRAMES, DECLARATION, compile, dealloc, alloc, hash, charat, strlen, indexof, next, token, from, peek, delimit, slice, position, prefixer as prefixer$1 } from 'stylis';
23
23
  import i18n from 'i18next';
24
24
  import languageDetector from 'i18next-browser-languagedetector';
25
- import { faker } from '@faker-js/faker';
26
- import { Factory } from 'fishery';
27
- import { render } from '@testing-library/react';
28
25
 
29
26
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
30
27
 
@@ -1099,13 +1096,13 @@ var objectAssign = !$assign || fails$i(function () {
1099
1096
  } return T;
1100
1097
  } : $assign;
1101
1098
 
1102
- var $$l = _export;
1099
+ var $$m = _export;
1103
1100
  var assign = objectAssign;
1104
1101
 
1105
1102
  // `Object.assign` method
1106
1103
  // https://tc39.es/ecma262/#sec-object.assign
1107
1104
  // eslint-disable-next-line es/no-object-assign -- required for testing
1108
- $$l({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1105
+ $$m({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1109
1106
  assign: assign
1110
1107
  });
1111
1108
 
@@ -1204,7 +1201,7 @@ var global$f = global$p;
1204
1201
 
1205
1202
  var engineIsNode = classof$7(global$f.process) == 'process';
1206
1203
 
1207
- var $$k = _export;
1204
+ var $$l = _export;
1208
1205
  var $reduce = arrayReduce.left;
1209
1206
  var arrayMethodIsStrict$1 = arrayMethodIsStrict$2;
1210
1207
  var CHROME_VERSION = engineV8Version;
@@ -1217,7 +1214,7 @@ var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1217
1214
 
1218
1215
  // `Array.prototype.reduce` method
1219
1216
  // https://tc39.es/ecma262/#sec-array.prototype.reduce
1220
- $$k({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
1217
+ $$l({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
1221
1218
  reduce: function reduce(callbackfn /* , initialValue */) {
1222
1219
  var length = arguments.length;
1223
1220
  return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
@@ -1512,7 +1509,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1512
1509
  };
1513
1510
  }() : undefined);
1514
1511
 
1515
- var $$j = _export;
1512
+ var $$k = _export;
1516
1513
  var call$d = functionCall;
1517
1514
  var FunctionName = functionName;
1518
1515
  var isCallable$a = isCallable$o;
@@ -1597,7 +1594,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1597
1594
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1598
1595
  defineBuiltIn$5(IterablePrototype, KEY, methods[KEY]);
1599
1596
  }
1600
- } else $$j({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1597
+ } else $$k({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1601
1598
  }
1602
1599
 
1603
1600
  // define iterator
@@ -1965,13 +1962,13 @@ var stringTrimForced = function (METHOD_NAME) {
1965
1962
  });
1966
1963
  };
1967
1964
 
1968
- var $$i = _export;
1965
+ var $$j = _export;
1969
1966
  var $trim = stringTrim.trim;
1970
1967
  var forcedStringTrimMethod = stringTrimForced;
1971
1968
 
1972
1969
  // `String.prototype.trim` method
1973
1970
  // https://tc39.es/ecma262/#sec-string.prototype.trim
1974
- $$i({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1971
+ $$j({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1975
1972
  trim: function trim() {
1976
1973
  return $trim(this);
1977
1974
  }
@@ -2166,12 +2163,12 @@ if (PATCH) {
2166
2163
 
2167
2164
  var regexpExec$2 = patchedExec;
2168
2165
 
2169
- var $$h = _export;
2166
+ var $$i = _export;
2170
2167
  var exec$2 = regexpExec$2;
2171
2168
 
2172
2169
  // `RegExp.prototype.exec` method
2173
2170
  // https://tc39.es/ecma262/#sec-regexp.prototype.exec
2174
- $$h({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2171
+ $$i({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2175
2172
  exec: exec$2
2176
2173
  });
2177
2174
 
@@ -2785,7 +2782,7 @@ const isPoBox = addressLine => PO_BOX_REGEX.test(addressLine);
2785
2782
  */
2786
2783
  const isPoBoxAddress = address => !!(isPoBox(address.addressLine1) || address.addressLine2 && isPoBox(address.addressLine2));
2787
2784
 
2788
- var $$g = _export;
2785
+ var $$h = _export;
2789
2786
  var $includes = arrayIncludes.includes;
2790
2787
  var fails$8 = fails$r;
2791
2788
  var addToUnscopables$2 = addToUnscopables$4;
@@ -2797,7 +2794,7 @@ var BROKEN_ON_SPARSE = fails$8(function () {
2797
2794
 
2798
2795
  // `Array.prototype.includes` method
2799
2796
  // https://tc39.es/ecma262/#sec-array.prototype.includes
2800
- $$g({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2797
+ $$h({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2801
2798
  includes: function includes(el /* , fromIndex = 0 */) {
2802
2799
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2803
2800
  }
@@ -2882,7 +2879,7 @@ var toPropertyKey = toPropertyKey$3;
2882
2879
  var definePropertyModule$1 = objectDefineProperty;
2883
2880
  var createPropertyDescriptor = createPropertyDescriptor$4;
2884
2881
 
2885
- var createProperty$1 = function (object, key, value) {
2882
+ var createProperty$2 = function (object, key, value) {
2886
2883
  var propertyKey = toPropertyKey(key);
2887
2884
  if (propertyKey in object) definePropertyModule$1.f(object, propertyKey, createPropertyDescriptor(0, value));
2888
2885
  else object[propertyKey] = value;
@@ -2890,7 +2887,7 @@ var createProperty$1 = function (object, key, value) {
2890
2887
 
2891
2888
  var toAbsoluteIndex = toAbsoluteIndex$2;
2892
2889
  var lengthOfArrayLike$5 = lengthOfArrayLike$8;
2893
- var createProperty = createProperty$1;
2890
+ var createProperty$1 = createProperty$2;
2894
2891
 
2895
2892
  var $Array$1 = Array;
2896
2893
  var max = Math.max;
@@ -2900,7 +2897,7 @@ var arraySliceSimple = function (O, start, end) {
2900
2897
  var k = toAbsoluteIndex(start, length);
2901
2898
  var fin = toAbsoluteIndex(end === undefined ? length : end, length);
2902
2899
  var result = $Array$1(max(fin - k, 0));
2903
- for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
2900
+ for (var n = 0; k < fin; k++, n++) createProperty$1(result, n, O[k]);
2904
2901
  result.length = n;
2905
2902
  return result;
2906
2903
  };
@@ -2966,7 +2963,7 @@ var webkit = userAgent$3.match(/AppleWebKit\/(\d+)\./);
2966
2963
 
2967
2964
  var engineWebkitVersion = !!webkit && +webkit[1];
2968
2965
 
2969
- var $$f = _export;
2966
+ var $$g = _export;
2970
2967
  var uncurryThis$a = functionUncurryThis;
2971
2968
  var aCallable$7 = aCallable$a;
2972
2969
  var toObject$2 = toObject$8;
@@ -3044,7 +3041,7 @@ var getSortCompare = function (comparefn) {
3044
3041
 
3045
3042
  // `Array.prototype.sort` method
3046
3043
  // https://tc39.es/ecma262/#sec-array.prototype.sort
3047
- $$f({ target: 'Array', proto: true, forced: FORCED$3 }, {
3044
+ $$g({ target: 'Array', proto: true, forced: FORCED$3 }, {
3048
3045
  sort: function sort(comparefn) {
3049
3046
  if (comparefn !== undefined) aCallable$7(comparefn);
3050
3047
 
@@ -3159,7 +3156,7 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
3159
3156
  } return false;
3160
3157
  };
3161
3158
 
3162
- var $$e = _export;
3159
+ var $$f = _export;
3163
3160
  var uncurryThis$9 = functionUncurryThis;
3164
3161
  var notARegExp$1 = notARegexp;
3165
3162
  var requireObjectCoercible$3 = requireObjectCoercible$9;
@@ -3170,7 +3167,7 @@ var stringIndexOf = uncurryThis$9(''.indexOf);
3170
3167
 
3171
3168
  // `String.prototype.includes` method
3172
3169
  // https://tc39.es/ecma262/#sec-string.prototype.includes
3173
- $$e({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, {
3170
+ $$f({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, {
3174
3171
  includes: function includes(searchString /* , position = 0 */) {
3175
3172
  return !!~stringIndexOf(
3176
3173
  toString$6(requireObjectCoercible$3(this)),
@@ -3777,7 +3774,7 @@ var arraySpeciesCreate$2 = function (originalArray, length) {
3777
3774
  return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
3778
3775
  };
3779
3776
 
3780
- var $$d = _export;
3777
+ var $$e = _export;
3781
3778
  var flattenIntoArray$1 = flattenIntoArray_1;
3782
3779
  var aCallable$5 = aCallable$a;
3783
3780
  var toObject$1 = toObject$8;
@@ -3786,7 +3783,7 @@ var arraySpeciesCreate$1 = arraySpeciesCreate$2;
3786
3783
 
3787
3784
  // `Array.prototype.flatMap` method
3788
3785
  // https://tc39.es/ecma262/#sec-array.prototype.flatmap
3789
- $$d({ target: 'Array', proto: true }, {
3786
+ $$e({ target: 'Array', proto: true }, {
3790
3787
  flatMap: function flatMap(callbackfn /* , thisArg */) {
3791
3788
  var O = toObject$1(this);
3792
3789
  var sourceLen = lengthOfArrayLike$2(O);
@@ -3946,7 +3943,7 @@ var stringRepeat = function repeat(count) {
3946
3943
  return result;
3947
3944
  };
3948
3945
 
3949
- var $$c = _export;
3946
+ var $$d = _export;
3950
3947
  var uncurryThis$5 = functionUncurryThis;
3951
3948
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$7;
3952
3949
  var thisNumberValue = thisNumberValue$1;
@@ -4020,7 +4017,7 @@ var FORCED$2 = fails$5(function () {
4020
4017
 
4021
4018
  // `Number.prototype.toFixed` method
4022
4019
  // https://tc39.es/ecma262/#sec-number.prototype.tofixed
4023
- $$c({ target: 'Number', proto: true, forced: FORCED$2 }, {
4020
+ $$d({ target: 'Number', proto: true, forced: FORCED$2 }, {
4024
4021
  toFixed: function toFixed(fractionDigits) {
4025
4022
  var number = thisNumberValue(this);
4026
4023
  var fractDigits = toIntegerOrInfinity$1(fractionDigits);
@@ -4100,12 +4097,12 @@ var numberParseFloat = FORCED$1 ? function parseFloat(string) {
4100
4097
  return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
4101
4098
  } : $parseFloat$1;
4102
4099
 
4103
- var $$b = _export;
4100
+ var $$c = _export;
4104
4101
  var $parseFloat = numberParseFloat;
4105
4102
 
4106
4103
  // `parseFloat` method
4107
4104
  // https://tc39.es/ecma262/#sec-parsefloat-string
4108
- $$b({ global: true, forced: parseFloat != $parseFloat }, {
4105
+ $$c({ global: true, forced: parseFloat != $parseFloat }, {
4109
4106
  parseFloat: $parseFloat
4110
4107
  });
4111
4108
 
@@ -4260,12 +4257,12 @@ var numberParseInt = FORCED ? function parseInt(string, radix) {
4260
4257
  return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
4261
4258
  } : $parseInt$1;
4262
4259
 
4263
- var $$a = _export;
4260
+ var $$b = _export;
4264
4261
  var $parseInt = numberParseInt;
4265
4262
 
4266
4263
  // `parseInt` method
4267
4264
  // https://tc39.es/ecma262/#sec-parseint-string-radix
4268
- $$a({ global: true, forced: parseInt != $parseInt }, {
4265
+ $$b({ global: true, forced: parseInt != $parseInt }, {
4269
4266
  parseInt: $parseInt
4270
4267
  });
4271
4268
 
@@ -22777,6 +22774,240 @@ const useRunOnceOnTrue = conditionalEffect => {
22777
22774
  */
22778
22775
  const useToggle = (initialValue = false) => useReducer((prev, next) => next !== undefined && typeof next !== "object" ? next : !prev, initialValue);
22779
22776
 
22777
+ var wellKnownSymbol$5 = wellKnownSymbol$j;
22778
+ var Iterators$1 = iterators;
22779
+
22780
+ var ITERATOR$2 = wellKnownSymbol$5('iterator');
22781
+ var ArrayPrototype = Array.prototype;
22782
+
22783
+ // check on default Array iterator
22784
+ var isArrayIteratorMethod$1 = function (it) {
22785
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
22786
+ };
22787
+
22788
+ var classof = classof$6;
22789
+ var getMethod$2 = getMethod$5;
22790
+ var isNullOrUndefined$2 = isNullOrUndefined$6;
22791
+ var Iterators = iterators;
22792
+ var wellKnownSymbol$4 = wellKnownSymbol$j;
22793
+
22794
+ var ITERATOR$1 = wellKnownSymbol$4('iterator');
22795
+
22796
+ var getIteratorMethod$2 = function (it) {
22797
+ if (!isNullOrUndefined$2(it)) return getMethod$2(it, ITERATOR$1)
22798
+ || getMethod$2(it, '@@iterator')
22799
+ || Iterators[classof(it)];
22800
+ };
22801
+
22802
+ var call$7 = functionCall;
22803
+ var aCallable$4 = aCallable$a;
22804
+ var anObject$5 = anObject$f;
22805
+ var tryToString$2 = tryToString$5;
22806
+ var getIteratorMethod$1 = getIteratorMethod$2;
22807
+
22808
+ var $TypeError$5 = TypeError;
22809
+
22810
+ var getIterator$1 = function (argument, usingIterator) {
22811
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
22812
+ if (aCallable$4(iteratorMethod)) return anObject$5(call$7(iteratorMethod, argument));
22813
+ throw $TypeError$5(tryToString$2(argument) + ' is not iterable');
22814
+ };
22815
+
22816
+ var call$6 = functionCall;
22817
+ var anObject$4 = anObject$f;
22818
+ var getMethod$1 = getMethod$5;
22819
+
22820
+ var iteratorClose$1 = function (iterator, kind, value) {
22821
+ var innerResult, innerError;
22822
+ anObject$4(iterator);
22823
+ try {
22824
+ innerResult = getMethod$1(iterator, 'return');
22825
+ if (!innerResult) {
22826
+ if (kind === 'throw') throw value;
22827
+ return value;
22828
+ }
22829
+ innerResult = call$6(innerResult, iterator);
22830
+ } catch (error) {
22831
+ innerError = true;
22832
+ innerResult = error;
22833
+ }
22834
+ if (kind === 'throw') throw value;
22835
+ if (innerError) throw innerResult;
22836
+ anObject$4(innerResult);
22837
+ return value;
22838
+ };
22839
+
22840
+ var bind$3 = functionBindContext;
22841
+ var call$5 = functionCall;
22842
+ var anObject$3 = anObject$f;
22843
+ var tryToString$1 = tryToString$5;
22844
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
22845
+ var lengthOfArrayLike$1 = lengthOfArrayLike$8;
22846
+ var isPrototypeOf$2 = objectIsPrototypeOf;
22847
+ var getIterator = getIterator$1;
22848
+ var getIteratorMethod = getIteratorMethod$2;
22849
+ var iteratorClose = iteratorClose$1;
22850
+
22851
+ var $TypeError$4 = TypeError;
22852
+
22853
+ var Result = function (stopped, result) {
22854
+ this.stopped = stopped;
22855
+ this.result = result;
22856
+ };
22857
+
22858
+ var ResultPrototype = Result.prototype;
22859
+
22860
+ var iterate$3 = function (iterable, unboundFunction, options) {
22861
+ var that = options && options.that;
22862
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
22863
+ var IS_RECORD = !!(options && options.IS_RECORD);
22864
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
22865
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
22866
+ var fn = bind$3(unboundFunction, that);
22867
+ var iterator, iterFn, index, length, result, next, step;
22868
+
22869
+ var stop = function (condition) {
22870
+ if (iterator) iteratorClose(iterator, 'normal', condition);
22871
+ return new Result(true, condition);
22872
+ };
22873
+
22874
+ var callFn = function (value) {
22875
+ if (AS_ENTRIES) {
22876
+ anObject$3(value);
22877
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
22878
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
22879
+ };
22880
+
22881
+ if (IS_RECORD) {
22882
+ iterator = iterable.iterator;
22883
+ } else if (IS_ITERATOR) {
22884
+ iterator = iterable;
22885
+ } else {
22886
+ iterFn = getIteratorMethod(iterable);
22887
+ if (!iterFn) throw $TypeError$4(tryToString$1(iterable) + ' is not iterable');
22888
+ // optimisation for array iterators
22889
+ if (isArrayIteratorMethod(iterFn)) {
22890
+ for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
22891
+ result = callFn(iterable[index]);
22892
+ if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
22893
+ } return new Result(false);
22894
+ }
22895
+ iterator = getIterator(iterable, iterFn);
22896
+ }
22897
+
22898
+ next = IS_RECORD ? iterable.next : iterator.next;
22899
+ while (!(step = call$5(next, iterator)).done) {
22900
+ try {
22901
+ result = callFn(step.value);
22902
+ } catch (error) {
22903
+ iteratorClose(iterator, 'throw', error);
22904
+ }
22905
+ if (typeof result == 'object' && result && isPrototypeOf$2(ResultPrototype, result)) return result;
22906
+ } return new Result(false);
22907
+ };
22908
+
22909
+ var $$a = _export;
22910
+ var iterate$2 = iterate$3;
22911
+ var createProperty = createProperty$2;
22912
+
22913
+ // `Object.fromEntries` method
22914
+ // https://github.com/tc39/proposal-object-from-entries
22915
+ $$a({ target: 'Object', stat: true }, {
22916
+ fromEntries: function fromEntries(iterable) {
22917
+ var obj = {};
22918
+ iterate$2(iterable, function (k, v) {
22919
+ createProperty(obj, k, v);
22920
+ }, { AS_ENTRIES: true });
22921
+ return obj;
22922
+ }
22923
+ });
22924
+
22925
+ const useWarehouseValidation = () => {
22926
+ const [warehousePreference, setWarehousePreference] = useState();
22927
+ const {
22928
+ error: validateAddressErrors,
22929
+ mutateAsync: validateAddresses
22930
+ } = useValidateAddresses();
22931
+ const caseInsensitiveCompare = useCallback((matched, original) => {
22932
+ if (matched === undefined || original === undefined) return false;
22933
+ const originalAddress = Object.fromEntries(Object.entries(original).map(([key, value]) => [key, typeof value == "string" ? value.toLowerCase() : value]));
22934
+ const matchedAddress = Object.fromEntries(Object.entries(matched).map(([key, value]) => [key, typeof value == "string" ? value.toLowerCase() : value]));
22935
+ // SE api returns addressLine2 as an empty string if it is not provided
22936
+ if (matchedAddress.addressLine2 === "") {
22937
+ matchedAddress.addressLine2 = null;
22938
+ }
22939
+ if (_$2.isEqual(_$2.omit(matchedAddress, ["postalCode", "addressResidentialIndicator"]), _$2.omit(originalAddress, ["postalCode", "addressResidentialIndicator"]))) return true;else return false;
22940
+ }, []);
22941
+ const postalCodeCompare = useCallback((matched, original) => {
22942
+ if (matched === undefined || original === undefined) return false;
22943
+ if (matched === original) return true;
22944
+ return matched.includes(original);
22945
+ }, []);
22946
+ const buildWarehousePreference = useCallback(addressValidation => {
22947
+ /**
22948
+ * Address validation matching criteria
22949
+ * 1. Case-insensitive string comparison
22950
+ * 2. Zip Code only added 4 extra digits to the original Zip Code
22951
+ */
22952
+ var _a;
22953
+ if (addressValidation.status === "error") {
22954
+ return {
22955
+ validation: addressValidation,
22956
+ validationType: "ERROR"
22957
+ };
22958
+ }
22959
+ // Valid if the matched address and input address were EXACTLY the same
22960
+ if (addressValidation.matchedAddress && addressValidation.matchedAddress.name === addressValidation.originalAddress.name && addressValidation.matchedAddress.companyName === addressValidation.originalAddress.companyName && addressValidation.matchedAddress.addressLine1 === addressValidation.originalAddress.addressLine1 && addressValidation.matchedAddress.addressLine2 === addressValidation.originalAddress.addressLine2 && addressValidation.matchedAddress.cityLocality === addressValidation.originalAddress.cityLocality && addressValidation.matchedAddress.stateProvince === addressValidation.originalAddress.stateProvince && addressValidation.matchedAddress.postalCode === addressValidation.originalAddress.postalCode && addressValidation.matchedAddress.countryCode === addressValidation.originalAddress.countryCode) {
22961
+ return {
22962
+ address: addressValidation.originalAddress,
22963
+ validationType: "EXACT"
22964
+ };
22965
+ }
22966
+ // Valid if the matched address passes matching criteria but are not exactly the same address
22967
+ if (addressValidation.matchedAddress && caseInsensitiveCompare(addressValidation.matchedAddress, addressValidation.originalAddress) && postalCodeCompare((_a = addressValidation.matchedAddress) === null || _a === void 0 ? void 0 : _a.postalCode, addressValidation.originalAddress.postalCode)) {
22968
+ return {
22969
+ address: addressValidation.matchedAddress,
22970
+ validationType: "SOFT"
22971
+ };
22972
+ }
22973
+ // If there is a matched address and does not pass the matching criteria
22974
+ if (addressValidation.matchedAddress) {
22975
+ return {
22976
+ validation: addressValidation,
22977
+ validationType: "SUGGESTED"
22978
+ };
22979
+ }
22980
+ // error or address was not valiqated
22981
+ return {
22982
+ validation: addressValidation,
22983
+ validationType: "ERROR"
22984
+ };
22985
+ }, [caseInsensitiveCompare, postalCodeCompare]);
22986
+ const validate = useCallback(warehouse => __awaiter(void 0, void 0, void 0, function* () {
22987
+ const warehouseAddresses = [warehouse.originAddress, ...(warehouse.returnAddress ? [warehouse.returnAddress] : [])];
22988
+ const result = yield validateAddresses(warehouseAddresses);
22989
+ const [originAddress, returnAddress] = result;
22990
+ setWarehousePreference({
22991
+ isDefault: warehouse.isDefault,
22992
+ name: warehouse.name,
22993
+ originAddress: buildWarehousePreference(originAddress),
22994
+ returnAddress: returnAddress && buildWarehousePreference(returnAddress)
22995
+ });
22996
+ return {
22997
+ isDefault: warehouse.isDefault,
22998
+ name: warehouse.name,
22999
+ originAddress: buildWarehousePreference(originAddress),
23000
+ returnAddress: returnAddress && buildWarehousePreference(returnAddress)
23001
+ };
23002
+ }), [buildWarehousePreference, validateAddresses]);
23003
+ return {
23004
+ errors: validateAddressErrors,
23005
+ setWarehousePreference,
23006
+ validate,
23007
+ warehousePreference
23008
+ };
23009
+ };
23010
+
22780
23011
  const addressParserSchema = z.object({
22781
23012
  fullAddress: z.string().min(1)
22782
23013
  });
@@ -22837,7 +23068,7 @@ const AddressParser = ({
22837
23068
  }));
22838
23069
  };
22839
23070
 
22840
- const styles$a = createStyles({
23071
+ const styles$b = createStyles({
22841
23072
  grow: {
22842
23073
  flexGrow: 1
22843
23074
  },
@@ -22936,13 +23167,13 @@ const AddressFields = ({
22936
23167
  },
22937
23168
  options: countryCodeOptions
22938
23169
  }), jsxs("div", Object.assign({
22939
- css: styles$a.stateZipWrapper
23170
+ css: styles$b.stateZipWrapper
22940
23171
  }, {
22941
23172
  children: [jsx("div", Object.assign({
22942
- css: styles$a.stateWrapper
23173
+ css: styles$b.stateWrapper
22943
23174
  }, {
22944
23175
  children: jsx("div", Object.assign({
22945
- css: styles$a.grow
23176
+ css: styles$b.grow
22946
23177
  }, {
22947
23178
  children: watchCountryCode === "US" ?
22948
23179
  // Domestic States
@@ -22966,10 +23197,10 @@ const AddressFields = ({
22966
23197
  })
22967
23198
  }))
22968
23199
  })), jsx("div", Object.assign({
22969
- css: styles$a.zipWrapper
23200
+ css: styles$b.zipWrapper
22970
23201
  }, {
22971
23202
  children: jsx("div", Object.assign({
22972
- css: styles$a.grow
23203
+ css: styles$b.grow
22973
23204
  }, {
22974
23205
  children: jsx(TextInput, {
22975
23206
  control: form.control,
@@ -23006,14 +23237,14 @@ const extendZod = () => {
23006
23237
  z.ZodObject.prototype.nullishDefault = nullishDefault;
23007
23238
  };
23008
23239
 
23009
- var call$7 = functionCall;
23240
+ var call$4 = functionCall;
23010
23241
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
23011
- var anObject$5 = anObject$f;
23012
- var isNullOrUndefined$2 = isNullOrUndefined$6;
23242
+ var anObject$2 = anObject$f;
23243
+ var isNullOrUndefined$1 = isNullOrUndefined$6;
23013
23244
  var toLength$1 = toLength$4;
23014
23245
  var toString$2 = toString$c;
23015
23246
  var requireObjectCoercible$1 = requireObjectCoercible$9;
23016
- var getMethod$2 = getMethod$5;
23247
+ var getMethod = getMethod$5;
23017
23248
  var advanceStringIndex = advanceStringIndex$2;
23018
23249
  var regExpExec = regexpExecAbstract;
23019
23250
 
@@ -23024,13 +23255,13 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa
23024
23255
  // https://tc39.es/ecma262/#sec-string.prototype.match
23025
23256
  function match(regexp) {
23026
23257
  var O = requireObjectCoercible$1(this);
23027
- var matcher = isNullOrUndefined$2(regexp) ? undefined : getMethod$2(regexp, MATCH);
23028
- return matcher ? call$7(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$2(O));
23258
+ var matcher = isNullOrUndefined$1(regexp) ? undefined : getMethod(regexp, MATCH);
23259
+ return matcher ? call$4(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$2(O));
23029
23260
  },
23030
23261
  // `RegExp.prototype[@@match]` method
23031
23262
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
23032
23263
  function (string) {
23033
- var rx = anObject$5(this);
23264
+ var rx = anObject$2(this);
23034
23265
  var S = toString$2(string);
23035
23266
  var res = maybeCallNative(nativeMatch, rx, S);
23036
23267
 
@@ -23197,7 +23428,7 @@ const AddressForm = ({
23197
23428
  }));
23198
23429
  };
23199
23430
 
23200
- const styles$9 = createStyles({
23431
+ const styles$a = createStyles({
23201
23432
  agreement: {
23202
23433
  alignItems: "center",
23203
23434
  display: "flex",
@@ -23267,10 +23498,10 @@ const DisplayCarrierTerms = c => {
23267
23498
  const listCarrierLinks = () => {
23268
23499
  return c.carrierTerms.links.map((term, index) => {
23269
23500
  return jsx("li", Object.assign({
23270
- css: styles$9.listItems
23501
+ css: styles$a.listItems
23271
23502
  }, {
23272
23503
  children: jsx(Link, Object.assign({
23273
- css: styles$9.link,
23504
+ css: styles$a.link,
23274
23505
  href: term.url,
23275
23506
  isExternal: true,
23276
23507
  target: "_blank"
@@ -23286,18 +23517,18 @@ const DisplayCarrierTerms = c => {
23286
23517
  };
23287
23518
  const listCarrierTerms = () => {
23288
23519
  return jsxs("div", Object.assign({
23289
- css: styles$9.terms
23520
+ css: styles$a.terms
23290
23521
  }, {
23291
23522
  children: [jsx(Typography, Object.assign({
23292
23523
  variant: "subtitle1"
23293
23524
  }, {
23294
23525
  children: c.carrierTerms.title
23295
23526
  })), jsx("div", Object.assign({
23296
- css: styles$9.terms
23527
+ css: styles$a.terms
23297
23528
  }, {
23298
23529
  children: listCarrierContent()
23299
23530
  })), jsx("ul", Object.assign({
23300
- css: styles$9.links
23531
+ css: styles$a.links
23301
23532
  }, {
23302
23533
  children: listCarrierLinks()
23303
23534
  }))]
@@ -23527,7 +23758,7 @@ const AddressDisplay = ({
23527
23758
  }));
23528
23759
  };
23529
23760
 
23530
- const styles$8 = createStyles({
23761
+ const styles$9 = createStyles({
23531
23762
  container: theme => ({
23532
23763
  display: "flex",
23533
23764
  gap: theme.spacing()
@@ -23565,13 +23796,13 @@ const Disclosure = ({
23565
23796
  }, [open]);
23566
23797
  return jsxs(Fragment, {
23567
23798
  children: [jsxs("div", Object.assign({
23568
- css: styles$8.container
23799
+ css: styles$9.container
23569
23800
  }, {
23570
23801
  children: [jsx("div", {
23571
23802
  children: label
23572
23803
  }), _showToggle && jsx("button", Object.assign({
23573
23804
  "aria-expanded": isOpen,
23574
- css: styles$8.toggle,
23805
+ css: styles$9.toggle,
23575
23806
  onClick: () => {
23576
23807
  setIsOpen(!isOpen);
23577
23808
  onToggle(!isOpen);
@@ -23579,12 +23810,12 @@ const Disclosure = ({
23579
23810
  type: "button"
23580
23811
  }, {
23581
23812
  children: jsx(Icon, {
23582
- css: styles$8.icon,
23813
+ css: styles$9.icon,
23583
23814
  name: isOpen ? IconNames.CHEVRON_TOP : IconNames.CHEVRON_BOTTOM
23584
23815
  })
23585
23816
  }))]
23586
23817
  })), isOpen && jsx("div", Object.assign({
23587
- css: styles$8.content
23818
+ css: styles$9.content
23588
23819
  }, {
23589
23820
  children: typeof children === "function" ? children(() => setIsOpen(!isOpen)) : children
23590
23821
  }))]
@@ -23724,7 +23955,7 @@ const getCarrierRecoverySchema = requiresAddress => z.object({
23724
23955
  address: requiresAddress ? baseSchema : baseSchema.optional()
23725
23956
  });
23726
23957
 
23727
- const styles$7 = createStyles({
23958
+ const styles$8 = createStyles({
23728
23959
  grid: theme => ({
23729
23960
  margin: theme.spacing(4)
23730
23961
  }),
@@ -23767,7 +23998,7 @@ const CarrierRecoveryForm = ({
23767
23998
  onSubmit: formLogger.capture(handleSubmit)
23768
23999
  }, {
23769
24000
  children: jsxs(Grid, Object.assign({
23770
- css: styles$7.grid,
24001
+ css: styles$8.grid,
23771
24002
  noPadding: true
23772
24003
  }, {
23773
24004
  children: [requiresAddress && jsxs(Fragment, {
@@ -23775,14 +24006,14 @@ const CarrierRecoveryForm = ({
23775
24006
  colSpan: 12
23776
24007
  }, {
23777
24008
  children: jsx(Typography, Object.assign({
23778
- css: styles$7.heading,
24009
+ css: styles$8.heading,
23779
24010
  variant: "heading4"
23780
24011
  }, {
23781
24012
  children: t("register-wallet:sections.carriers.title")
23782
24013
  }))
23783
24014
  })), jsx(GridChild, Object.assign({
23784
24015
  colSpan: 12,
23785
- css: styles$7.subtitle
24016
+ css: styles$8.subtitle
23786
24017
  }, {
23787
24018
  children: jsx(Typography, Object.assign({
23788
24019
  variant: "subtitle1"
@@ -23868,7 +24099,7 @@ const CarrierTermsForm = ({
23868
24099
  onSubmit(payload.agreement);
23869
24100
  }));
23870
24101
  return jsxs("div", Object.assign({
23871
- css: styles$9.termsForm,
24102
+ css: styles$a.termsForm,
23872
24103
  "data-testid": "carrier-terms-form"
23873
24104
  }, {
23874
24105
  children: [jsx(Typography, Object.assign({
@@ -23884,7 +24115,7 @@ const CarrierTermsForm = ({
23884
24115
  })), jsx(Spacer, {
23885
24116
  multiplier: 1
23886
24117
  }), jsx("div", Object.assign({
23887
- css: styles$9.carrierLogos
24118
+ css: styles$a.carrierLogos
23888
24119
  }, {
23889
24120
  children: metadatas.map(({
23890
24121
  name,
@@ -23900,7 +24131,7 @@ const CarrierTermsForm = ({
23900
24131
  onSubmit: formLogger.capture(handleSubmit)
23901
24132
  }, {
23902
24133
  children: jsxs("div", Object.assign({
23903
- css: styles$9.agreement
24134
+ css: styles$a.agreement
23904
24135
  }, {
23905
24136
  children: [jsx("div", {
23906
24137
  children: jsx(CheckboxInput, {
@@ -23927,12 +24158,12 @@ const CarrierTermsForm = ({
23927
24158
  name: "agreement"
23928
24159
  })
23929
24160
  }), showTerms && jsxs("div", Object.assign({
23930
- css: styles$9.well
24161
+ css: styles$a.well
23931
24162
  }, {
23932
24163
  children: [terms.map((t, idx) => jsx(DisplayCarrierTerms, {
23933
24164
  carrierTerms: t
23934
24165
  }, idx)), jsx("div", Object.assign({
23935
- css: styles$9.close
24166
+ css: styles$a.close
23936
24167
  }, {
23937
24168
  children: jsx(Button, Object.assign({
23938
24169
  onClick: () => setShowTerms(false),
@@ -23965,7 +24196,7 @@ var global$8 = global$p;
23965
24196
  var uncurryThis$2 = functionUncurryThis;
23966
24197
  var hasOwn$1 = hasOwnProperty_1;
23967
24198
  var isCallable$5 = isCallable$o;
23968
- var isPrototypeOf$2 = objectIsPrototypeOf;
24199
+ var isPrototypeOf$1 = objectIsPrototypeOf;
23969
24200
  var toString$1 = toString$c;
23970
24201
  var defineProperty = objectDefineProperty.f;
23971
24202
  var copyConstructorProperties = copyConstructorProperties$2;
@@ -23981,7 +24212,7 @@ if (DESCRIPTORS$1 && isCallable$5(NativeSymbol) && (!('description' in SymbolPro
23981
24212
  // wrap Symbol constructor for correct work with undefined description
23982
24213
  var SymbolWrapper = function Symbol() {
23983
24214
  var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$1(arguments[0]);
23984
- var result = isPrototypeOf$2(SymbolPrototype, this)
24215
+ var result = isPrototypeOf$1(SymbolPrototype, this)
23985
24216
  ? new NativeSymbol(description)
23986
24217
  // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
23987
24218
  : description === undefined ? NativeSymbol() : NativeSymbol(description);
@@ -24320,7 +24551,7 @@ const LandingPageForm = ({
24320
24551
  }));
24321
24552
  };
24322
24553
 
24323
- const styles$6 = createStyles({
24554
+ const styles$7 = createStyles({
24324
24555
  container: theme => ({
24325
24556
  padding: theme.spacing(2)
24326
24557
  }),
@@ -24342,11 +24573,11 @@ const LandingPage = ({
24342
24573
  t
24343
24574
  } = useTranslation();
24344
24575
  return jsxs("div", Object.assign({
24345
- css: styles$6.container,
24576
+ css: styles$7.container,
24346
24577
  "data-testid": "landing-page"
24347
24578
  }, {
24348
24579
  children: [jsxs("div", Object.assign({
24349
- css: styles$6.header
24580
+ css: styles$7.header
24350
24581
  }, {
24351
24582
  children: [jsx(Typography, Object.assign({
24352
24583
  variant: "heading4"
@@ -24364,7 +24595,7 @@ const LandingPage = ({
24364
24595
  })), jsx(LandingPageForm, {
24365
24596
  onSubmit: onSubmit
24366
24597
  }), jsxs("div", Object.assign({
24367
- css: styles$6.header
24598
+ css: styles$7.header
24368
24599
  }, {
24369
24600
  children: [jsx(Spacer, {
24370
24601
  multiplier: 6
@@ -24375,7 +24606,7 @@ const LandingPage = ({
24375
24606
  })), jsx(Spacer, {
24376
24607
  multiplier: 2
24377
24608
  }), jsx(Typography, Object.assign({
24378
- css: styles$6.description,
24609
+ css: styles$7.description,
24379
24610
  variant: "body1"
24380
24611
  }, {
24381
24612
  children: t("onboarding:landing.description")
@@ -24461,6 +24692,7 @@ const getStyles$4 = (isConnected = false) => createStyles({
24461
24692
  padding: `0 ${theme.spacing(.5)}px`
24462
24693
  }, isConnected && {
24463
24694
  backgroundColor: theme.palette.success.main,
24695
+ borderRadius: theme.borderRadius.XS,
24464
24696
  color: theme.palette.white
24465
24697
  }],
24466
24698
  container: {
@@ -24487,7 +24719,7 @@ var _ref$1 = process.env.NODE_ENV === "production" ? {
24487
24719
  } : {
24488
24720
  name: "111ty02-css",
24489
24721
  styles: "align-items:center;display:flex;label:css;",
24490
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpc3QtY2FycmllcnMtcm93LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtQmllIiwiZmlsZSI6Imxpc3QtY2FycmllcnMtcm93LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IF9fYXdhaXRlciB9IGZyb20gXCJ0c2xpYlwiO1xyXG5pbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJAZW1vdGlvbi9yZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcclxuaW1wb3J0IHsgdXNlU3RhdGUgfSBmcm9tIFwicmVhY3RcIjtcclxuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tIFwicmVhY3QtaTE4bmV4dFwiO1xyXG5pbXBvcnQgeyBCdXR0b24sIEJ1dHRvbkNvbG9yLCBCdXR0b25WYXJpYW50LCBUeXBvZ3JhcGh5IH0gZnJvbSBcIkBwYWNrbGluay9naWdlclwiO1xyXG5pbXBvcnQgeyBUZW1wbGF0ZXMgfSBmcm9tIFwiLi4vLi4vLi4vY29tcG9uZW50c1wiO1xyXG5pbXBvcnQgeyBnZXRTdHlsZXMgfSBmcm9tIFwiLi9saXN0LWNhcnJpZXJzLXJvdy5zdHlsZXNcIjtcclxuZXhwb3J0IGNvbnN0IExpc3RDYXJyaWVyc1JvdyA9ICh7IGNvbm5lY3RlZENhcnJpZXI6IHsgY2FycmllciwgaXNDb25uZWN0ZWQgfSwgcmVnaXN0ZXJDYXJyaWVyLCByZWdpc3RlckNhcnJpZXJFcnJvcnMsIH0pID0+IHtcclxuICAgIGNvbnN0IHsgc2hvcnRuYW1lOiBuYW1lLCBsb2dvLCByZXF1aXJlZEZpZWxkcyB9ID0gY2FycmllcjtcclxuICAgIGNvbnN0IHsgdCB9ID0gdXNlVHJhbnNsYXRpb24oW1wibGlzdC1jYXJyaWVyc1wiXSk7XHJcbiAgICBjb25zdCBbc2hvd0Ryb3BEb3duLCBzZXRTaG93RHJvcERvd25dID0gdXNlU3RhdGUoZmFsc2UpO1xyXG4gICAgY29uc3QgW2lzU3VibWl0dGluZywgc2V0SXNTdWJtaXR0aW5nXSA9IHVzZVN0YXRlKGZhbHNlKTtcclxuICAgIGNvbnN0IGhhbmRsZVJlZ2lzdGVyID0gKHZhbHVlcykgPT4gX19hd2FpdGVyKHZvaWQgMCwgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgc2V0SXNTdWJtaXR0aW5nKHRydWUpO1xyXG4gICAgICAgIHlpZWxkIHJlZ2lzdGVyQ2Fycmllcih2YWx1ZXMpO1xyXG4gICAgICAgIHNob3dEcm9wRG93biAmJiBzZXRTaG93RHJvcERvd24oZmFsc2UpO1xyXG4gICAgICAgIHNldElzU3VibWl0dGluZyhmYWxzZSk7XHJcbiAgICB9KTtcclxuICAgIHJldHVybiAoX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogZ2V0U3R5bGVzKCkuY29udGFpbmVyLCBcImRhdGEtdGVzdGlkXCI6IFwiY2Fycmllci1yb3dcIiB9LCB7IGNoaWxkcmVuOiBbX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogZ2V0U3R5bGVzKCkucm93Q29udGFpbmVyIH0sIHsgY2hpbGRyZW46IFtfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY3NzOiBnZXRTdHlsZXMoKS5sb2dvQ29udGFpbmVyIH0sIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIHsgY2hpbGRyZW46IF9qc3goXCJpbWdcIiwgeyBhbHQ6IGAke25hbWV9LWxvZ29gLCBoZWlnaHQ6IDQwLCBzcmM6IGxvZ28sIHdpZHRoOiA0MCB9KSB9KSwgX2pzeChUeXBvZ3JhcGh5LCBPYmplY3QuYXNzaWduKHsgdmFyaWFudDogXCJzdWJ0aXRsZTFcIiB9LCB7IGNoaWxkcmVuOiBuYW1lIH0pKV0gfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjc3M6IGNzcyh7IGFsaWduSXRlbXM6IFwiY2VudGVyXCIsIGRpc3BsYXk6IFwiZmxleFwiIH0pIH0sIHsgY2hpbGRyZW46IF9qc3goQnV0dG9uLCBPYmplY3QuYXNzaWduKHsgY29sb3I6IEJ1dHRvbkNvbG9yLlNFQ09OREFSWSwgY3NzOiBnZXRTdHlsZXMoaXNDb25uZWN0ZWQpLmNvbm5lY3RCdXR0b24sIGRpc2FibGVkOiBpc0Nvbm5lY3RlZCB8fCBzaG93RHJvcERvd24sIGlzTG9hZGluZzogaXNTdWJtaXR0aW5nLCBvbkNsaWNrOiAoKSA9PiBfX2F3YWl0ZXIodm9pZCAwLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVxdWlyZWRGaWVsZHMgPT09IG51bGwgfHwgcmVxdWlyZWRGaWVsZHMgPT09IHZvaWQgMCA/IHZvaWQgMCA6IHJlcXVpcmVkRmllbGRzLmluY2x1ZGVzKFwiYWRkcmVzc1wiKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U2hvd0Ryb3BEb3duKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWllbGQgaGFuZGxlUmVnaXN0ZXIoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLCB2YXJpYW50OiBCdXR0b25WYXJpYW50LlRFWFQgfSwgeyBjaGlsZHJlbjogaXNDb25uZWN0ZWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHQoXCJsaXN0LWNhcnJpZXJzOmFjdGlvbnMuc3RhdHVzLmNvbm5lY3RlZFwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdChcImxpc3QtY2FycmllcnM6YWN0aW9ucy5zdGF0dXMubm90Q29ubmVjdGVkXCIpIH0pKSB9KSldIH0pKSwgc2hvd0Ryb3BEb3duICYmIChfanN4KFRlbXBsYXRlcy5BZGRDYXJyaWVyRm9ybSwgeyBjYXJyaWVyVGVybXM6IGNhcnJpZXIudGVybXMgJiYgY2Fycmllci50ZXJtcywgb25DYW5jZWw6ICgpID0+IHNldFNob3dEcm9wRG93bihmYWxzZSksIG9uU3VibWl0OiAodmFsdWVzKSA9PiBoYW5kbGVSZWdpc3Rlcih2YWx1ZXMpLCByZWdpc3RlckNhcnJpZXJFcnJvcnM6IHJlZ2lzdGVyQ2FycmllckVycm9ycyB9KSldIH0pKSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWxpc3QtY2FycmllcnMtcm93LmpzLm1hcCJdfQ== */",
24722
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpc3QtY2FycmllcnMtcm93LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtQmllIiwiZmlsZSI6Imxpc3QtY2FycmllcnMtcm93LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IF9fYXdhaXRlciB9IGZyb20gXCJ0c2xpYlwiO1xyXG5pbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJAZW1vdGlvbi9yZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcclxuaW1wb3J0IHsgdXNlU3RhdGUgfSBmcm9tIFwicmVhY3RcIjtcclxuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tIFwicmVhY3QtaTE4bmV4dFwiO1xyXG5pbXBvcnQgeyBUeXBvZ3JhcGh5IH0gZnJvbSBcIkBwYWNrbGluay9naWdlclwiO1xyXG5pbXBvcnQgeyBMaW5rQWN0aW9uLCBUZW1wbGF0ZXMgfSBmcm9tIFwiLi4vLi4vLi4vY29tcG9uZW50c1wiO1xyXG5pbXBvcnQgeyBnZXRTdHlsZXMgfSBmcm9tIFwiLi9saXN0LWNhcnJpZXJzLXJvdy5zdHlsZXNcIjtcclxuZXhwb3J0IGNvbnN0IExpc3RDYXJyaWVyc1JvdyA9ICh7IGNvbm5lY3RlZENhcnJpZXI6IHsgY2FycmllciwgaXNDb25uZWN0ZWQgfSwgcmVnaXN0ZXJDYXJyaWVyLCByZWdpc3RlckNhcnJpZXJFcnJvcnMsIH0pID0+IHtcclxuICAgIGNvbnN0IHsgc2hvcnRuYW1lOiBuYW1lLCBsb2dvLCByZXF1aXJlZEZpZWxkcyB9ID0gY2FycmllcjtcclxuICAgIGNvbnN0IHsgdCB9ID0gdXNlVHJhbnNsYXRpb24oW1wibGlzdC1jYXJyaWVyc1wiXSk7XHJcbiAgICBjb25zdCBbc2hvd0Ryb3BEb3duLCBzZXRTaG93RHJvcERvd25dID0gdXNlU3RhdGUoZmFsc2UpO1xyXG4gICAgY29uc3QgW2lzU3VibWl0dGluZywgc2V0SXNTdWJtaXR0aW5nXSA9IHVzZVN0YXRlKGZhbHNlKTtcclxuICAgIGNvbnN0IGhhbmRsZVJlZ2lzdGVyID0gKHZhbHVlcykgPT4gX19hd2FpdGVyKHZvaWQgMCwgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgc2V0SXNTdWJtaXR0aW5nKHRydWUpO1xyXG4gICAgICAgIHlpZWxkIHJlZ2lzdGVyQ2Fycmllcih2YWx1ZXMpO1xyXG4gICAgICAgIHNob3dEcm9wRG93biAmJiBzZXRTaG93RHJvcERvd24oZmFsc2UpO1xyXG4gICAgICAgIHNldElzU3VibWl0dGluZyhmYWxzZSk7XHJcbiAgICB9KTtcclxuICAgIHJldHVybiAoX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogZ2V0U3R5bGVzKCkuY29udGFpbmVyLCBcImRhdGEtdGVzdGlkXCI6IFwiY2Fycmllci1yb3dcIiB9LCB7IGNoaWxkcmVuOiBbX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogZ2V0U3R5bGVzKCkucm93Q29udGFpbmVyIH0sIHsgY2hpbGRyZW46IFtfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY3NzOiBnZXRTdHlsZXMoKS5sb2dvQ29udGFpbmVyIH0sIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIHsgY2hpbGRyZW46IF9qc3goXCJpbWdcIiwgeyBhbHQ6IGAke25hbWV9LWxvZ29gLCBoZWlnaHQ6IDQwLCBzcmM6IGxvZ28sIHdpZHRoOiA0MCB9KSB9KSwgX2pzeChUeXBvZ3JhcGh5LCBPYmplY3QuYXNzaWduKHsgdmFyaWFudDogXCJzdWJ0aXRsZTFcIiB9LCB7IGNoaWxkcmVuOiBuYW1lIH0pKV0gfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjc3M6IGNzcyh7IGFsaWduSXRlbXM6IFwiY2VudGVyXCIsIGRpc3BsYXk6IFwiZmxleFwiIH0pIH0sIHsgY2hpbGRyZW46IF9qc3goTGlua0FjdGlvbiwgeyBjc3M6IGdldFN0eWxlcyhpc0Nvbm5lY3RlZCkuY29ubmVjdEJ1dHRvbiwgaXNEaXNhYmxlZDogaXNDb25uZWN0ZWQgfHwgc2hvd0Ryb3BEb3duLCBpc0xvYWRpbmc6IGlzU3VibWl0dGluZywgb25DbGljazogKCkgPT4gX19hd2FpdGVyKHZvaWQgMCwgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcXVpcmVkRmllbGRzID09PSBudWxsIHx8IHJlcXVpcmVkRmllbGRzID09PSB2b2lkIDAgPyB2b2lkIDAgOiByZXF1aXJlZEZpZWxkcy5pbmNsdWRlcyhcImFkZHJlc3NcIikpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFNob3dEcm9wRG93bih0cnVlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlpZWxkIGhhbmRsZVJlZ2lzdGVyKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSwgdGl0bGU6IGlzQ29ubmVjdGVkXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0KFwibGlzdC1jYXJyaWVyczphY3Rpb25zLnN0YXR1cy5jb25uZWN0ZWRcIilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHQoXCJsaXN0LWNhcnJpZXJzOmFjdGlvbnMuc3RhdHVzLm5vdENvbm5lY3RlZFwiKSB9KSB9KSldIH0pKSwgc2hvd0Ryb3BEb3duICYmIChfanN4KFRlbXBsYXRlcy5BZGRDYXJyaWVyRm9ybSwgeyBjYXJyaWVyVGVybXM6IGNhcnJpZXIudGVybXMgJiYgY2Fycmllci50ZXJtcywgb25DYW5jZWw6ICgpID0+IHNldFNob3dEcm9wRG93bihmYWxzZSksIG9uU3VibWl0OiAodmFsdWVzKSA9PiBoYW5kbGVSZWdpc3Rlcih2YWx1ZXMpLCByZWdpc3RlckNhcnJpZXJFcnJvcnM6IHJlZ2lzdGVyQ2FycmllckVycm9ycyB9KSldIH0pKSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWxpc3QtY2FycmllcnMtcm93LmpzLm1hcCJdfQ== */",
24491
24723
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
24492
24724
  };
24493
24725
  const ListCarriersRow = ({
@@ -24539,18 +24771,15 @@ const ListCarriersRow = ({
24539
24771
  })), jsx("div", Object.assign({
24540
24772
  css: _ref$1
24541
24773
  }, {
24542
- children: jsx(Button, Object.assign({
24543
- color: ButtonColor.SECONDARY,
24774
+ children: jsx(LinkAction, {
24544
24775
  css: getStyles$4(isConnected).connectButton,
24545
- disabled: isConnected || showDropDown,
24776
+ isDisabled: isConnected || showDropDown,
24546
24777
  isLoading: isSubmitting,
24547
24778
  onClick: () => __awaiter(void 0, void 0, void 0, function* () {
24548
24779
  if (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes("address")) setShowDropDown(true);else yield handleRegister();
24549
24780
  }),
24550
- variant: ButtonVariant.TEXT
24551
- }, {
24552
- children: isConnected ? t("list-carriers:actions.status.connected") : t("list-carriers:actions.status.notConnected")
24553
- }))
24781
+ title: isConnected ? t("list-carriers:actions.status.connected") : t("list-carriers:actions.status.notConnected")
24782
+ })
24554
24783
  }))]
24555
24784
  })), showDropDown && jsx(AddCarrierForm, {
24556
24785
  carrierTerms: carrier.terms && carrier.terms,
@@ -24561,7 +24790,7 @@ const ListCarriersRow = ({
24561
24790
  }));
24562
24791
  };
24563
24792
 
24564
- const styles$5 = createStyles({
24793
+ const styles$6 = createStyles({
24565
24794
  listContainer: theme => ({
24566
24795
  "& > li:not(:last-of-type)": {
24567
24796
  borderBottom: `1px solid ${theme.palette.gray.light}`
@@ -24608,7 +24837,7 @@ const ListCarriers$1 = ({
24608
24837
  children: t("list-carriers:headers.accountCarriers")
24609
24838
  }))
24610
24839
  }), jsx("ul", Object.assign({
24611
- css: styles$5.listContainer
24840
+ css: styles$6.listContainer
24612
24841
  }, {
24613
24842
  children: isLoading ? jsxs(Fragment, {
24614
24843
  children: [jsx(LoadingSkeletonRow, {}), jsx(LoadingSkeletonRow, {}), jsx(LoadingSkeletonRow, {})]
@@ -24629,10 +24858,10 @@ const ListCarriers$1 = ({
24629
24858
  };
24630
24859
  const LoadingSkeletonRow = () => {
24631
24860
  return jsxs("div", Object.assign({
24632
- css: styles$5.skeletonRow
24861
+ css: styles$6.skeletonRow
24633
24862
  }, {
24634
24863
  children: [jsxs("div", Object.assign({
24635
- css: styles$5.skeletonLogoContainer
24864
+ css: styles$6.skeletonLogoContainer
24636
24865
  }, {
24637
24866
  children: [jsx(Skeleton, {
24638
24867
  animation: SkeletonAnimation.WAVE,
@@ -24656,7 +24885,7 @@ const LoadingSkeletonRow = () => {
24656
24885
  }));
24657
24886
  };
24658
24887
 
24659
- const styles$4 = createStyles({
24888
+ const styles$5 = createStyles({
24660
24889
  body: theme => ({
24661
24890
  borderTop: `1px solid ${theme.palette.gray.light}`,
24662
24891
  color: theme.palette.black,
@@ -24707,14 +24936,14 @@ const SettingsCard = ({
24707
24936
  verticallyAligned
24708
24937
  }) => {
24709
24938
  return jsxs("div", Object.assign({
24710
- css: verticallyAligned ? styles$4.verticalContainer : styles$4.container,
24939
+ css: verticallyAligned ? styles$5.verticalContainer : styles$5.container,
24711
24940
  "data-testid": "settingsCard"
24712
24941
  }, {
24713
24942
  children: [jsxs("div", Object.assign({
24714
- css: styles$4.header
24943
+ css: styles$5.header
24715
24944
  }, {
24716
24945
  children: [jsxs("div", Object.assign({
24717
- css: styles$4.title
24946
+ css: styles$5.title
24718
24947
  }, {
24719
24948
  children: [typeof title === "string" ? jsx(Typography, Object.assign({
24720
24949
  variant: "subtitle2"
@@ -24749,7 +24978,7 @@ const SettingsCard = ({
24749
24978
  }))
24750
24979
  }))]
24751
24980
  })), children && jsx("div", Object.assign({
24752
- css: styles$4.body
24981
+ css: styles$5.body
24753
24982
  }, {
24754
24983
  children: jsxs("div", {
24755
24984
  children: [children, accessoryAction && jsx(ButtonGroup, Object.assign({
@@ -24781,6 +25010,7 @@ const WarehouseDisplay = ({
24781
25010
  returnAddress
24782
25011
  } = warehouse;
24783
25012
  return jsxs(Grid, Object.assign({
25013
+ "data-testid": "warehouseDisplay",
24784
25014
  noPadding: true
24785
25015
  }, {
24786
25016
  children: [jsx(GridChild, Object.assign({
@@ -24825,7 +25055,9 @@ const WarehouseDisplay = ({
24825
25055
 
24826
25056
  const postalCodeRegex$1 = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
24827
25057
  const warehouseAddressSchema = addressSchema.extend({
24828
- addressResidentialIndicator: z.preprocess(v => v === "yes" ? true : false, z.boolean().default(false).transform(value => value ? "yes" : "no"))
25058
+ addressResidentialIndicator: z.preprocess(v => v === "yes" ? true : false, z.boolean().default(false).transform(value => value ? "yes" : "no")),
25059
+ companyName: z.string().trim().min(1),
25060
+ phone: z.string().trim().min(1)
24829
25061
  }).refine(schema => !schema.phone || isValidPhoneNumber(schema.phone, schema.countryCode), {
24830
25062
  message: "schemaErrors.notAValidPhoneNumber",
24831
25063
  path: ["phone"]
@@ -24857,28 +25089,7 @@ const warehouseSchema = z.discriminatedUnion("returnToAddressIsDifferent", [z.ob
24857
25089
  name: z.string().trim().min(1),
24858
25090
  originAddress: warehouseAddressSchema,
24859
25091
  returnToAddressIsDifferent: z.literal(false)
24860
- })]).transform(schema => {
24861
- if (schema.returnToAddressIsDifferent) {
24862
- return schema;
24863
- }
24864
- return Object.assign(Object.assign({}, schema), {
24865
- returnAddress: schema.originAddress
24866
- });
24867
- });
24868
-
24869
- const styles$3 = createStyles({
24870
- header: {
24871
- textAlign: "center"
24872
- },
24873
- onboardingWell: theme => ({
24874
- backgroundColor: theme.palette.white,
24875
- padding: theme.spacing(2)
24876
- }),
24877
- well: theme => ({
24878
- backgroundColor: theme.palette.gray.ultraLight,
24879
- padding: theme.spacing(2)
24880
- })
24881
- });
25092
+ })]);
24882
25093
 
24883
25094
  const WarehouseForm = ({
24884
25095
  isOnboarding: _isOnboarding = false,
@@ -24902,9 +25113,9 @@ const WarehouseForm = ({
24902
25113
  }),
24903
25114
  returnToAddressIsDifferent: !lodash.exports.isEqual(warehouse.originAddress, warehouse.returnAddress)
24904
25115
  }) : {
24905
- isDefault: false,
25116
+ isDefault: _isOnboarding ? true : false,
24906
25117
  originAddress: {
24907
- countryCode: "US"
25118
+ addressResidentialIndicator: false
24908
25119
  },
24909
25120
  returnToAddressIsDifferent: false
24910
25121
  },
@@ -24913,140 +25124,368 @@ const WarehouseForm = ({
24913
25124
  const handleSubmit = form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
24914
25125
  const _a = values,
24915
25126
  payload = __rest(_a, ["returnToAddressIsDifferent"]);
24916
- if (_isOnboarding) {
24917
- payload.isDefault = true;
24918
- yield onSubmit(payload);
24919
- } else {
24920
- yield onSubmit(payload);
24921
- }
25127
+ yield onSubmit(payload);
24922
25128
  }));
24923
- return jsxs("div", Object.assign({
24924
- css: _isOnboarding ? styles$3.onboardingWell : styles$3.well,
24925
- "data-testid": "warehouse-form"
25129
+ return jsxs("form", Object.assign({
25130
+ id: "warehouse-form",
25131
+ onSubmit: formLogger.capture(handleSubmit)
24926
25132
  }, {
24927
- children: [_isOnboarding && jsxs(Fragment, {
24928
- children: [jsxs("div", Object.assign({
24929
- css: styles$3.header
25133
+ children: [jsx(TextInput, {
25134
+ control: form.control,
25135
+ form: "warehouse-form",
25136
+ label: t("manage-warehouses:locationName"),
25137
+ name: "name",
25138
+ nativeLabel: true
25139
+ }), jsx(AddressFields, {
25140
+ form: form,
25141
+ formatFieldName: fieldName => `originAddress.${fieldName}`,
25142
+ optionalFields: ["addressLine2"]
25143
+ }), jsx(CheckboxInput, {
25144
+ checkboxLabel: t("manage-warehouses:residentialAddress"),
25145
+ control: form.control,
25146
+ form: "warehouse-form",
25147
+ label: "originAddress.addressResidentialIndicator",
25148
+ name: "originAddress.addressResidentialIndicator"
25149
+ }), !_isOnboarding && jsx(CheckboxInput, {
25150
+ checkboxLabel: t("manage-warehouses:isDefault"),
25151
+ control: form.control,
25152
+ form: "warehouse-form",
25153
+ label: "isDefault",
25154
+ name: "isDefault"
25155
+ }), jsx(CheckboxInput, {
25156
+ checkboxLabel: t("manage-warehouses:returnToAddressIsDifferent"),
25157
+ control: form.control,
25158
+ "data-testid": "returnToAddressIsDifferent",
25159
+ form: "warehouse-form",
25160
+ label: "returnToAddressIsDifferent",
25161
+ name: "returnToAddressIsDifferent",
25162
+ onClick: e => {
25163
+ if (e.currentTarget.checked) {
25164
+ form.reset(formValues => Object.assign(Object.assign({}, formValues), {
25165
+ returnAddress: Object.assign(Object.assign({}, {}), {
25166
+ addressResidentialIndicator: false,
25167
+ companyName: "",
25168
+ countryCode: "US"
25169
+ }),
25170
+ returnToAddressIsDifferent: true
25171
+ }), {
25172
+ keepErrors: true
25173
+ });
25174
+ }
25175
+ }
25176
+ }), form.watch("returnToAddressIsDifferent") && jsxs(Fragment, {
25177
+ children: [jsx(AddressFields, {
25178
+ form: form,
25179
+ formatFieldName: fieldName => `returnAddress.${fieldName}`,
25180
+ optionalFields: ["addressLine2"]
25181
+ }), jsx(CheckboxInput, {
25182
+ checkboxLabel: t("manage-warehouses:residentialAddress"),
25183
+ control: form.control,
25184
+ form: "warehouse-form",
25185
+ label: "returnAddress.addressResidentialIndicator",
25186
+ name: "returnAddress.addressResidentialIndicator"
25187
+ })]
25188
+ }), jsxs(ButtonGroup, Object.assign({
25189
+ justify: "center"
25190
+ }, {
25191
+ children: [onDelete && jsx(Button, Object.assign({
25192
+ bold: false,
25193
+ onClick: onDelete,
25194
+ type: "button",
25195
+ variant: ButtonVariant.TEXT
24930
25196
  }, {
24931
- children: [jsx(Typography, Object.assign({
24932
- variant: "heading4"
24933
- }, {
24934
- children: t("onboarding:warehouse.title")
24935
- })), jsx(Spacer, {
24936
- multiplier: 2
24937
- }), jsx(Typography, Object.assign({
24938
- variant: "subtitle1"
24939
- }, {
24940
- children: t("onboarding:warehouse.subtitle")
24941
- })), jsx(Spacer, {
24942
- multiplier: 1
24943
- })]
24944
- })), jsxs("div", {
24945
- children: [jsx(InlineNotification, Object.assign({
24946
- title: t("onboarding:inlineTitle"),
24947
- type: NotificationType.INFO
24948
- }, {
24949
- children: t("onboarding:warehouse.inlineMessage")
24950
- })), jsx(Spacer, {
24951
- multiplier: 2
24952
- })]
24953
- })]
24954
- }), jsxs("form", Object.assign({
24955
- id: "warehouse-form",
24956
- onSubmit: formLogger.capture(handleSubmit)
24957
- }, {
24958
- children: [jsx(TextInput, {
24959
- control: form.control,
24960
- form: "warehouse-form",
24961
- label: t("manage-warehouses:locationName"),
24962
- name: "name",
24963
- nativeLabel: true
24964
- }), jsx(AddressFields, {
24965
- form: form,
24966
- formatFieldName: fieldName => `originAddress.${fieldName}`,
24967
- optionalFields: ["addressLine2"]
24968
- }), jsx(CheckboxInput, {
24969
- checkboxLabel: t("manage-warehouses:residentialAddress"),
24970
- control: form.control,
24971
- form: "warehouse-form",
24972
- label: "originAddress.addressResidentialIndicator",
24973
- name: "originAddress.addressResidentialIndicator"
24974
- }), !_isOnboarding && jsx(CheckboxInput, {
24975
- checkboxLabel: t("manage-warehouses:isDefault"),
24976
- control: form.control,
24977
- form: "warehouse-form",
24978
- label: "isDefault",
24979
- name: "isDefault"
24980
- }), jsx(CheckboxInput, {
24981
- checkboxLabel: t("manage-warehouses:returnToAddressIsDifferent"),
24982
- control: form.control,
24983
- form: "warehouse-form",
24984
- label: "returnToAddressIsDifferent",
24985
- name: "returnToAddressIsDifferent",
24986
- onClick: e => {
24987
- if (e.currentTarget.checked) {
24988
- form.reset(formValues => Object.assign(Object.assign({}, formValues), {
24989
- returnAddress: Object.assign(Object.assign({}, {}), {
24990
- addressResidentialIndicator: false,
24991
- countryCode: "US"
24992
- }),
24993
- returnToAddressIsDifferent: true
24994
- }), {
24995
- keepErrors: true
24996
- });
24997
- }
24998
- }
24999
- }), form.watch("returnToAddressIsDifferent") && jsxs(Fragment, {
25000
- children: [jsx(AddressFields, {
25001
- form: form,
25002
- formatFieldName: fieldName => `returnAddress.${fieldName}`
25003
- }), jsx(CheckboxInput, {
25004
- checkboxLabel: t("manage-warehouses:residentialAddress"),
25005
- control: form.control,
25006
- form: "warehouse-form",
25007
- label: "returnAddress.addressResidentialIndicator",
25008
- name: "returnAddress.addressResidentialIndicator"
25009
- })]
25010
- }), jsxs(ButtonGroup, Object.assign({
25011
- justify: "center"
25197
+ children: t("actions.remove")
25198
+ })), jsxs(ButtonGroup, Object.assign({
25199
+ justify: _isOnboarding ? "center" : "end"
25012
25200
  }, {
25013
- children: [onDelete && jsx(Button, Object.assign({
25201
+ children: [onCancel && jsx(Button, Object.assign({
25014
25202
  bold: false,
25015
- onClick: onDelete,
25203
+ onClick: onCancel,
25016
25204
  type: "button",
25017
25205
  variant: ButtonVariant.TEXT
25018
25206
  }, {
25019
- children: t("actions.remove")
25020
- })), jsxs(ButtonGroup, Object.assign({
25021
- justify: _isOnboarding ? "center" : "end"
25207
+ children: t("actions.cancel")
25208
+ })), jsx(SubmitButton, Object.assign({
25209
+ control: form.control,
25210
+ "data-testid": "warehouseFormSubmitButton",
25211
+ form: "warehouse-form",
25212
+ requireDirty: true,
25213
+ variant: _isOnboarding ? ButtonVariant.FILLED : ButtonVariant.OUTLINED
25022
25214
  }, {
25023
- children: [onCancel && jsx(Button, Object.assign({
25024
- bold: false,
25025
- onClick: onCancel,
25026
- type: "button",
25027
- variant: ButtonVariant.TEXT
25215
+ children: submitButtonTitle
25216
+ }))]
25217
+ }))]
25218
+ }))]
25219
+ }));
25220
+ };
25221
+
25222
+ const WarehousePreferenceSelect = ({
25223
+ onCancel,
25224
+ onSubmit,
25225
+ originAddress,
25226
+ returnAddress
25227
+ }) => {
25228
+ const {
25229
+ t
25230
+ } = useTranslation(["manage-warehouses", "common"]);
25231
+ const determineAddressPreference = address => {
25232
+ if (!address) return undefined;
25233
+ switch (address.validationType) {
25234
+ case "EXACT":
25235
+ case "SOFT":
25236
+ return address.address;
25237
+ case "SUGGESTED":
25238
+ return address.validation.matchedAddress;
25239
+ case "ERROR":
25240
+ return address.validation.originalAddress;
25241
+ default:
25242
+ return undefined;
25243
+ }
25244
+ };
25245
+ const [originAddressPreference, setOriginAddressPreference] = useState(determineAddressPreference(originAddress));
25246
+ const [returnAddressPreference, setReturnAddressPreference] = useState(determineAddressPreference(returnAddress));
25247
+ const addressPreferenceDisplay = (preference, name, onPreferenceSelect) => {
25248
+ var _a, _b;
25249
+ switch (preference.validationType) {
25250
+ case "EXACT":
25251
+ case "SOFT":
25252
+ return jsx(AddressDisplay, {
25253
+ address: preference.address
25254
+ });
25255
+ case "SUGGESTED":
25256
+ return jsxs(Next.RadioGroup, Object.assign({
25257
+ name: name,
25258
+ onChange: e => {
25259
+ if (preference.validation.matchedAddress && e.target.value === "suggested") {
25260
+ onPreferenceSelect(preference.validation.matchedAddress);
25261
+ } else {
25262
+ onPreferenceSelect(preference.validation.originalAddress);
25263
+ }
25264
+ }
25265
+ }, {
25266
+ children: [jsx(Spacer, {
25267
+ multiplier: 1
25268
+ }), jsx(Next.Radio, Object.assign({
25269
+ value: "suggested"
25028
25270
  }, {
25029
- children: t("actions.cancel")
25030
- })), jsx(SubmitButton, Object.assign({
25031
- control: form.control,
25032
- form: "warehouse-form",
25033
- requireDirty: true,
25034
- variant: _isOnboarding ? ButtonVariant.FILLED : ButtonVariant.OUTLINED
25271
+ children: t("common:address.preference.matchedAddress")
25272
+ })), preference.validation.matchedAddress && jsx(GridChild, Object.assign({
25273
+ colSpan: 6,
25274
+ colStart: 4,
25275
+ css: theme => ({
25276
+ paddingLeft: theme.spacing(3)
25277
+ })
25035
25278
  }, {
25036
- children: submitButtonTitle
25279
+ children: jsx(AddressDisplay, {
25280
+ address: preference.validation.matchedAddress
25281
+ })
25282
+ })), jsx(Spacer, {
25283
+ multiplier: 1
25284
+ }), jsx(Next.Radio, Object.assign({
25285
+ value: "original"
25286
+ }, {
25287
+ children: t("common:address.preference.originalAddress")
25288
+ })), jsx(Spacer, {
25289
+ multiplier: 1
25290
+ }), jsx(GridChild, Object.assign({
25291
+ colSpan: 6,
25292
+ colStart: 4,
25293
+ css: theme => ({
25294
+ paddingLeft: theme.spacing(3)
25295
+ })
25296
+ }, {
25297
+ children: jsx(AddressDisplay, {
25298
+ address: (_a = preference.validation) === null || _a === void 0 ? void 0 : _a.originalAddress
25299
+ })
25037
25300
  }))]
25038
- }))]
25301
+ }));
25302
+ case "ERROR":
25303
+ return jsxs(Fragment, {
25304
+ children: [jsx(Spacer, {
25305
+ multiplier: 1
25306
+ }), jsx(GridChild, Object.assign({
25307
+ colSpan: 8,
25308
+ css: theme => ({
25309
+ paddingLeft: theme.spacing(1)
25310
+ })
25311
+ }, {
25312
+ children: jsx(InlineNotification, Object.assign({
25313
+ type: NotificationType.ALERT
25314
+ }, {
25315
+ children: t("address.preference.unableToValidate")
25316
+ }))
25317
+ })), jsx(Spacer, {
25318
+ multiplier: 1
25319
+ }), jsx(GridChild, Object.assign({
25320
+ css: theme => ({
25321
+ paddingLeft: theme.spacing(1)
25322
+ })
25323
+ }, {
25324
+ children: jsx(AddressDisplay, {
25325
+ address: (_b = preference.validation) === null || _b === void 0 ? void 0 : _b.originalAddress
25326
+ })
25327
+ }))]
25328
+ });
25329
+ default:
25330
+ // This code path should never be reached.
25331
+ return jsx("div", {
25332
+ children: "not found"
25333
+ });
25334
+ }
25335
+ };
25336
+ return jsxs(Fragment, {
25337
+ children: [jsxs(Grid, Object.assign({
25338
+ "data-testid": "warehousePreferenceSelect",
25339
+ noPadding: true
25340
+ }, {
25341
+ children: [jsx(GridChild, Object.assign({
25342
+ colSpan: 12
25343
+ }, {
25344
+ children: jsx(Typography, Object.assign({
25345
+ variant: "subtitle2"
25346
+ }, {
25347
+ children: t("common:address.preference.title")
25348
+ }))
25349
+ })), jsxs(GridChild, Object.assign({
25350
+ colSpan: 8
25351
+ }, {
25352
+ children: [jsx(Typography, Object.assign({
25353
+ css: {
25354
+ textTransform: "capitalize"
25355
+ },
25356
+ variant: "subtitle2"
25357
+ }, {
25358
+ children: t("manage-warehouses:shipFrom")
25359
+ })), originAddress && addressPreferenceDisplay(originAddress, "originAddressPreference", preference => {
25360
+ setOriginAddressPreference(preference);
25361
+ })]
25362
+ })), returnAddress && jsxs(GridChild, Object.assign({
25363
+ colSpan: 8
25364
+ }, {
25365
+ children: [jsx(Typography, Object.assign({
25366
+ css: {
25367
+ textTransform: "capitalize"
25368
+ },
25369
+ variant: "subtitle2"
25370
+ }, {
25371
+ children: t("manage-warehouses:returnTo")
25372
+ })), addressPreferenceDisplay(returnAddress, "returnAddressPreference", preference => {
25373
+ setReturnAddressPreference(preference);
25374
+ })]
25375
+ }))]
25376
+ })), jsxs(ButtonGroup, Object.assign({
25377
+ justify: "end"
25378
+ }, {
25379
+ children: [onCancel && jsx(Button, Object.assign({
25380
+ bold: false,
25381
+ onClick: onCancel,
25382
+ type: "button",
25383
+ variant: ButtonVariant.TEXT
25384
+ }, {
25385
+ children: t("actions.cancel")
25386
+ })), jsx(Button, Object.assign({
25387
+ onClick: () => onSubmit({
25388
+ originAddress: originAddressPreference,
25389
+ returnAddress: returnAddressPreference
25390
+ }),
25391
+ variant: ButtonVariant.OUTLINED
25392
+ }, {
25393
+ children: t("common:address.preference.confirm")
25039
25394
  }))]
25040
25395
  }))]
25396
+ });
25397
+ };
25398
+
25399
+ const WarehousePreferenceWizard = ({
25400
+ className,
25401
+ formHeader,
25402
+ isOnboarding: _isOnboarding = false,
25403
+ onSubmit,
25404
+ onValidate,
25405
+ onWarehouseDelete,
25406
+ onWarehouseFormCancel,
25407
+ submitButtonTitle,
25408
+ warehouse,
25409
+ warehousePreference
25410
+ }) => {
25411
+ const [currentStep, setCurrentStep] = useState(0);
25412
+ const checkForExactOrSoft = warehousePreference => __awaiter(void 0, void 0, void 0, function* () {
25413
+ const {
25414
+ originAddress,
25415
+ returnAddress
25416
+ } = warehousePreference;
25417
+ if ((originAddress.validationType === "EXACT" || originAddress.validationType === "SOFT") && returnAddress && (returnAddress.validationType === "EXACT" || returnAddress.validationType === "SOFT")) {
25418
+ yield onSubmit({
25419
+ isDefault: !!warehousePreference.isDefault,
25420
+ name: warehousePreference.name,
25421
+ originAddress: originAddress.address,
25422
+ returnAddress: returnAddress.address
25423
+ });
25424
+ return;
25425
+ }
25426
+ if ((originAddress.validationType === "EXACT" || originAddress.validationType === "SOFT") && !returnAddress) {
25427
+ yield onSubmit({
25428
+ isDefault: !!warehousePreference.isDefault,
25429
+ name: warehousePreference.name,
25430
+ originAddress: originAddress.address
25431
+ });
25432
+ return;
25433
+ } else return;
25434
+ });
25435
+ return jsxs("div", Object.assign({
25436
+ className: className
25437
+ }, {
25438
+ children: [formHeader && formHeader, currentStep === 0 ? jsx(WarehouseForm, {
25439
+ isOnboarding: _isOnboarding,
25440
+ onCancel: onWarehouseFormCancel ? () => onWarehouseFormCancel() : undefined,
25441
+ onDelete: onWarehouseDelete ? () => onWarehouseDelete() : undefined,
25442
+ onSubmit: payload => __awaiter(void 0, void 0, void 0, function* () {
25443
+ const result = yield onValidate(payload);
25444
+ yield checkForExactOrSoft(result);
25445
+ setCurrentStep(1);
25446
+ }),
25447
+ submitButtonTitle: submitButtonTitle,
25448
+ warehouse: warehouse
25449
+ }) : warehousePreference && jsx(WarehousePreferenceSelect, {
25450
+ onCancel: () => setCurrentStep(0),
25451
+ onSubmit: payload => {
25452
+ onSubmit({
25453
+ isDefault: !!warehousePreference.isDefault,
25454
+ name: warehousePreference.name,
25455
+ originAddress: payload.originAddress,
25456
+ returnAddress: payload.returnAddress
25457
+ });
25458
+ },
25459
+ originAddress: warehousePreference.originAddress,
25460
+ returnAddress: warehousePreference.returnAddress
25461
+ })]
25041
25462
  }));
25042
25463
  };
25043
25464
 
25465
+ const styles$4 = createStyles({
25466
+ cardSpacing: theme => ({
25467
+ display: "flex",
25468
+ flexDirection: "column",
25469
+ gap: theme.spacing(2)
25470
+ }),
25471
+ header: {
25472
+ textAlign: "left"
25473
+ },
25474
+ well: theme => ({
25475
+ backgroundColor: theme.palette.gray.ultraLight,
25476
+ padding: theme.spacing(2)
25477
+ })
25478
+ });
25479
+
25044
25480
  const ManageWarehouses$1 = ({
25045
25481
  errors,
25046
25482
  onAdd,
25047
25483
  onDelete,
25048
25484
  onEdit,
25049
25485
  onSetDefault,
25486
+ onValidate,
25487
+ setWarehousePreference,
25488
+ warehousePreference,
25050
25489
  warehouses
25051
25490
  }) => {
25052
25491
  const {
@@ -25055,13 +25494,28 @@ const ManageWarehouses$1 = ({
25055
25494
  const [editWarehouseId, setEditWarehouseId] = useState();
25056
25495
  const [showAddNewWarehouseForm, toggleShowAddNewWarehouseForm] = useToggle(false);
25057
25496
  return jsxs(Fragment, {
25058
- children: [showAddNewWarehouseForm ? jsx(WarehouseForm, {
25059
- onCancel: () => toggleShowAddNewWarehouseForm(false),
25497
+ children: [showAddNewWarehouseForm ? jsx(WarehousePreferenceWizard, {
25498
+ css: styles$4.well,
25499
+ formHeader: jsxs("div", Object.assign({
25500
+ css: styles$4.header
25501
+ }, {
25502
+ children: [jsx(Typography, Object.assign({
25503
+ variant: "subtitle1"
25504
+ }, {
25505
+ children: t("manage-warehouses:addNew")
25506
+ })), jsx(Spacer, {
25507
+ multiplier: 1
25508
+ })]
25509
+ })),
25060
25510
  onSubmit: payload => {
25061
25511
  onAdd(payload);
25062
25512
  toggleShowAddNewWarehouseForm(false);
25513
+ setWarehousePreference(undefined);
25063
25514
  },
25064
- submitButtonTitle: t("actions.add")
25515
+ onValidate: onValidate,
25516
+ onWarehouseFormCancel: () => toggleShowAddNewWarehouseForm(false),
25517
+ submitButtonTitle: t("actions.save"),
25518
+ warehousePreference: warehousePreference
25065
25519
  }) : jsx(ButtonGroup, Object.assign({
25066
25520
  justify: "end"
25067
25521
  }, {
@@ -25080,26 +25534,37 @@ const ManageWarehouses$1 = ({
25080
25534
  })]
25081
25535
  }))
25082
25536
  })), jsx("div", Object.assign({
25083
- css: theme => ({
25084
- display: "flex",
25085
- flexDirection: "column",
25086
- gap: theme.spacing(2)
25087
- })
25537
+ css: styles$4.cardSpacing
25088
25538
  }, {
25089
25539
  children: warehouses.sort((a, b) => {
25090
25540
  if (b.isDefault) return 1;
25091
25541
  return sortByCreationDate(a, b, "desc");
25092
25542
  }).map(warehouse => {
25093
25543
  if (editWarehouseId && editWarehouseId === warehouse.warehouseId) {
25094
- return jsx(WarehouseForm, {
25095
- onCancel: () => setEditWarehouseId(undefined),
25096
- onDelete: warehouse.isDefault ? undefined : () => onDelete(warehouse.warehouseId),
25544
+ return jsx(WarehousePreferenceWizard, {
25545
+ css: styles$4.well,
25546
+ formHeader: jsxs("div", Object.assign({
25547
+ css: styles$4.header
25548
+ }, {
25549
+ children: [jsx(Typography, Object.assign({
25550
+ variant: "subtitle1"
25551
+ }, {
25552
+ children: t("manage-warehouses:editWarehouse")
25553
+ })), jsx(Spacer, {
25554
+ multiplier: 1
25555
+ })]
25556
+ })),
25097
25557
  onSubmit: payload => {
25098
25558
  onEdit(payload, warehouse.warehouseId);
25099
25559
  setEditWarehouseId(undefined);
25560
+ setWarehousePreference(undefined);
25100
25561
  },
25562
+ onValidate: onValidate,
25563
+ onWarehouseDelete: warehouse.isDefault ? undefined : () => onDelete(warehouse.warehouseId),
25564
+ onWarehouseFormCancel: () => setEditWarehouseId(undefined),
25101
25565
  submitButtonTitle: t("actions.save"),
25102
- warehouse: warehouse
25566
+ warehouse: warehouse,
25567
+ warehousePreference: warehousePreference
25103
25568
  }, warehouse.warehouseId);
25104
25569
  } else {
25105
25570
  return jsx(SettingsCard, Object.assign({
@@ -25129,10 +25594,10 @@ const ManageWarehouses$1 = ({
25129
25594
 
25130
25595
  var getBuiltIn$3 = getBuiltIn$9;
25131
25596
  var definePropertyModule = objectDefineProperty;
25132
- var wellKnownSymbol$5 = wellKnownSymbol$j;
25597
+ var wellKnownSymbol$3 = wellKnownSymbol$j;
25133
25598
  var DESCRIPTORS = descriptors;
25134
25599
 
25135
- var SPECIES$2 = wellKnownSymbol$5('species');
25600
+ var SPECIES$2 = wellKnownSymbol$3('species');
25136
25601
 
25137
25602
  var setSpecies$1 = function (CONSTRUCTOR_NAME) {
25138
25603
  var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
@@ -25146,49 +25611,49 @@ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
25146
25611
  }
25147
25612
  };
25148
25613
 
25149
- var isPrototypeOf$1 = objectIsPrototypeOf;
25614
+ var isPrototypeOf = objectIsPrototypeOf;
25150
25615
 
25151
- var $TypeError$5 = TypeError;
25616
+ var $TypeError$3 = TypeError;
25152
25617
 
25153
25618
  var anInstance$1 = function (it, Prototype) {
25154
- if (isPrototypeOf$1(Prototype, it)) return it;
25155
- throw $TypeError$5('Incorrect invocation');
25619
+ if (isPrototypeOf(Prototype, it)) return it;
25620
+ throw $TypeError$3('Incorrect invocation');
25156
25621
  };
25157
25622
 
25158
25623
  var isConstructor = isConstructor$2;
25159
- var tryToString$2 = tryToString$5;
25624
+ var tryToString = tryToString$5;
25160
25625
 
25161
- var $TypeError$4 = TypeError;
25626
+ var $TypeError$2 = TypeError;
25162
25627
 
25163
25628
  // `Assert: IsConstructor(argument) is true`
25164
25629
  var aConstructor$1 = function (argument) {
25165
25630
  if (isConstructor(argument)) return argument;
25166
- throw $TypeError$4(tryToString$2(argument) + ' is not a constructor');
25631
+ throw $TypeError$2(tryToString(argument) + ' is not a constructor');
25167
25632
  };
25168
25633
 
25169
- var anObject$4 = anObject$f;
25634
+ var anObject$1 = anObject$f;
25170
25635
  var aConstructor = aConstructor$1;
25171
- var isNullOrUndefined$1 = isNullOrUndefined$6;
25172
- var wellKnownSymbol$4 = wellKnownSymbol$j;
25636
+ var isNullOrUndefined = isNullOrUndefined$6;
25637
+ var wellKnownSymbol$2 = wellKnownSymbol$j;
25173
25638
 
25174
- var SPECIES$1 = wellKnownSymbol$4('species');
25639
+ var SPECIES$1 = wellKnownSymbol$2('species');
25175
25640
 
25176
25641
  // `SpeciesConstructor` abstract operation
25177
25642
  // https://tc39.es/ecma262/#sec-speciesconstructor
25178
25643
  var speciesConstructor$2 = function (O, defaultConstructor) {
25179
- var C = anObject$4(O).constructor;
25644
+ var C = anObject$1(O).constructor;
25180
25645
  var S;
25181
- return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
25646
+ return C === undefined || isNullOrUndefined(S = anObject$1(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
25182
25647
  };
25183
25648
 
25184
25649
  var uncurryThis$1 = functionUncurryThis;
25185
25650
 
25186
25651
  var arraySlice$1 = uncurryThis$1([].slice);
25187
25652
 
25188
- var $TypeError$3 = TypeError;
25653
+ var $TypeError$1 = TypeError;
25189
25654
 
25190
25655
  var validateArgumentsLength$1 = function (passed, required) {
25191
- if (passed < required) throw $TypeError$3('Not enough arguments');
25656
+ if (passed < required) throw $TypeError$1('Not enough arguments');
25192
25657
  return passed;
25193
25658
  };
25194
25659
 
@@ -25198,7 +25663,7 @@ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
25198
25663
 
25199
25664
  var global$7 = global$p;
25200
25665
  var apply = functionApply;
25201
- var bind$3 = functionBindContext;
25666
+ var bind$2 = functionBindContext;
25202
25667
  var isCallable$4 = isCallable$o;
25203
25668
  var hasOwn = hasOwnProperty_1;
25204
25669
  var fails$1 = fails$r;
@@ -25280,7 +25745,7 @@ if (!set || !clear) {
25280
25745
  channel = new MessageChannel();
25281
25746
  port = channel.port2;
25282
25747
  channel.port1.onmessage = listener;
25283
- defer = bind$3(port.postMessage, port);
25748
+ defer = bind$2(port.postMessage, port);
25284
25749
  // Browsers with postMessage, skip WebWorkers
25285
25750
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
25286
25751
  } else if (
@@ -25323,7 +25788,7 @@ var userAgent = engineUserAgent;
25323
25788
  var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
25324
25789
 
25325
25790
  var global$5 = global$p;
25326
- var bind$2 = functionBindContext;
25791
+ var bind$1 = functionBindContext;
25327
25792
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
25328
25793
  var macrotask = task$1.set;
25329
25794
  var IS_IOS = engineIsIos;
@@ -25375,7 +25840,7 @@ if (!queueMicrotask) {
25375
25840
  promise = Promise$1.resolve(undefined);
25376
25841
  // workaround of WebKit ~ iOS Safari 10.1 bug
25377
25842
  promise.constructor = Promise$1;
25378
- then = bind$2(promise.then, promise);
25843
+ then = bind$1(promise.then, promise);
25379
25844
  notify$1 = function () {
25380
25845
  then(flush);
25381
25846
  };
@@ -25392,7 +25857,7 @@ if (!queueMicrotask) {
25392
25857
  // - setTimeout
25393
25858
  } else {
25394
25859
  // strange IE + webpack dev server bug - use .bind(global)
25395
- macrotask = bind$2(macrotask, global$5);
25860
+ macrotask = bind$1(macrotask, global$5);
25396
25861
  notify$1 = function () {
25397
25862
  macrotask(flush);
25398
25863
  };
@@ -25469,13 +25934,13 @@ var NativePromiseConstructor$4 = promiseNativeConstructor;
25469
25934
  var isCallable$3 = isCallable$o;
25470
25935
  var isForced = isForced_1;
25471
25936
  var inspectSource = inspectSource$3;
25472
- var wellKnownSymbol$3 = wellKnownSymbol$j;
25937
+ var wellKnownSymbol$1 = wellKnownSymbol$j;
25473
25938
  var IS_BROWSER = engineIsBrowser;
25474
25939
  var IS_DENO = engineIsDeno;
25475
25940
  var V8_VERSION = engineV8Version;
25476
25941
 
25477
25942
  NativePromiseConstructor$4 && NativePromiseConstructor$4.prototype;
25478
- var SPECIES = wellKnownSymbol$3('species');
25943
+ var SPECIES = wellKnownSymbol$1('species');
25479
25944
  var SUBCLASSING = false;
25480
25945
  var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$3(global$2.PromiseRejectionEvent);
25481
25946
 
@@ -25511,19 +25976,19 @@ var promiseConstructorDetection = {
25511
25976
 
25512
25977
  var newPromiseCapability$2 = {};
25513
25978
 
25514
- var aCallable$4 = aCallable$a;
25979
+ var aCallable$3 = aCallable$a;
25515
25980
 
25516
- var $TypeError$2 = TypeError;
25981
+ var $TypeError = TypeError;
25517
25982
 
25518
25983
  var PromiseCapability = function (C) {
25519
25984
  var resolve, reject;
25520
25985
  this.promise = new C(function ($$resolve, $$reject) {
25521
- if (resolve !== undefined || reject !== undefined) throw $TypeError$2('Bad Promise constructor');
25986
+ if (resolve !== undefined || reject !== undefined) throw $TypeError('Bad Promise constructor');
25522
25987
  resolve = $$resolve;
25523
25988
  reject = $$reject;
25524
25989
  });
25525
- this.resolve = aCallable$4(resolve);
25526
- this.reject = aCallable$4(reject);
25990
+ this.resolve = aCallable$3(resolve);
25991
+ this.reject = aCallable$3(reject);
25527
25992
  };
25528
25993
 
25529
25994
  // `NewPromiseCapability` abstract operation
@@ -25535,12 +26000,12 @@ newPromiseCapability$2.f = function (C) {
25535
26000
  var $$8 = _export;
25536
26001
  var IS_NODE = engineIsNode;
25537
26002
  var global$1 = global$p;
25538
- var call$6 = functionCall;
26003
+ var call$3 = functionCall;
25539
26004
  var defineBuiltIn$2 = defineBuiltIn$8;
25540
26005
  var setPrototypeOf = objectSetPrototypeOf;
25541
26006
  var setToStringTag = setToStringTag$3;
25542
26007
  var setSpecies = setSpecies$1;
25543
- var aCallable$3 = aCallable$a;
26008
+ var aCallable$2 = aCallable$a;
25544
26009
  var isCallable$2 = isCallable$o;
25545
26010
  var isObject$1 = isObject$a;
25546
26011
  var anInstance = anInstance$1;
@@ -25613,7 +26078,7 @@ var callReaction = function (reaction, state) {
25613
26078
  if (result === reaction.promise) {
25614
26079
  reject(TypeError$1('Promise-chain cycle'));
25615
26080
  } else if (then = isThenable(result)) {
25616
- call$6(then, result, resolve, reject);
26081
+ call$3(then, result, resolve, reject);
25617
26082
  } else resolve(result);
25618
26083
  } else reject(value);
25619
26084
  } catch (error) {
@@ -25650,7 +26115,7 @@ var dispatchEvent = function (name, promise, reason) {
25650
26115
  };
25651
26116
 
25652
26117
  var onUnhandled = function (state) {
25653
- call$6(task, global$1, function () {
26118
+ call$3(task, global$1, function () {
25654
26119
  var promise = state.facade;
25655
26120
  var value = state.value;
25656
26121
  var IS_UNHANDLED = isUnhandled(state);
@@ -25673,7 +26138,7 @@ var isUnhandled = function (state) {
25673
26138
  };
25674
26139
 
25675
26140
  var onHandleUnhandled = function (state) {
25676
- call$6(task, global$1, function () {
26141
+ call$3(task, global$1, function () {
25677
26142
  var promise = state.facade;
25678
26143
  if (IS_NODE) {
25679
26144
  process$1.emit('rejectionHandled', promise);
@@ -25681,7 +26146,7 @@ var onHandleUnhandled = function (state) {
25681
26146
  });
25682
26147
  };
25683
26148
 
25684
- var bind$1 = function (fn, state, unwrap) {
26149
+ var bind = function (fn, state, unwrap) {
25685
26150
  return function (value) {
25686
26151
  fn(state, value, unwrap);
25687
26152
  };
@@ -25707,9 +26172,9 @@ var internalResolve = function (state, value, unwrap) {
25707
26172
  microtask(function () {
25708
26173
  var wrapper = { done: false };
25709
26174
  try {
25710
- call$6(then, value,
25711
- bind$1(internalResolve, wrapper, state),
25712
- bind$1(internalReject, wrapper, state)
26175
+ call$3(then, value,
26176
+ bind(internalResolve, wrapper, state),
26177
+ bind(internalReject, wrapper, state)
25713
26178
  );
25714
26179
  } catch (error) {
25715
26180
  internalReject(wrapper, error, state);
@@ -25730,11 +26195,11 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
25730
26195
  // 25.4.3.1 Promise(executor)
25731
26196
  PromiseConstructor = function Promise(executor) {
25732
26197
  anInstance(this, PromisePrototype);
25733
- aCallable$3(executor);
25734
- call$6(Internal, this);
26198
+ aCallable$2(executor);
26199
+ call$3(Internal, this);
25735
26200
  var state = getInternalPromiseState(this);
25736
26201
  try {
25737
- executor(bind$1(internalResolve, state), bind$1(internalReject, state));
26202
+ executor(bind(internalResolve, state), bind(internalReject, state));
25738
26203
  } catch (error) {
25739
26204
  internalReject(state, error);
25740
26205
  }
@@ -25776,8 +26241,8 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
25776
26241
  var promise = new Internal();
25777
26242
  var state = getInternalPromiseState(promise);
25778
26243
  this.promise = promise;
25779
- this.resolve = bind$1(internalResolve, state);
25780
- this.reject = bind$1(internalReject, state);
26244
+ this.resolve = bind(internalResolve, state);
26245
+ this.reject = bind(internalReject, state);
25781
26246
  };
25782
26247
 
25783
26248
  newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
@@ -25794,7 +26259,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
25794
26259
  defineBuiltIn$2(NativePromisePrototype$2, 'then', function then(onFulfilled, onRejected) {
25795
26260
  var that = this;
25796
26261
  return new PromiseConstructor(function (resolve, reject) {
25797
- call$6(nativeThen, that, resolve, reject);
26262
+ call$3(nativeThen, that, resolve, reject);
25798
26263
  }).then(onFulfilled, onRejected);
25799
26264
  // https://github.com/zloirock/core-js/issues/640
25800
26265
  }, { unsafe: true });
@@ -25819,138 +26284,6 @@ $$8({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTR
25819
26284
  setToStringTag(PromiseConstructor, PROMISE, false);
25820
26285
  setSpecies(PROMISE);
25821
26286
 
25822
- var wellKnownSymbol$2 = wellKnownSymbol$j;
25823
- var Iterators$1 = iterators;
25824
-
25825
- var ITERATOR$2 = wellKnownSymbol$2('iterator');
25826
- var ArrayPrototype = Array.prototype;
25827
-
25828
- // check on default Array iterator
25829
- var isArrayIteratorMethod$1 = function (it) {
25830
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
25831
- };
25832
-
25833
- var classof = classof$6;
25834
- var getMethod$1 = getMethod$5;
25835
- var isNullOrUndefined = isNullOrUndefined$6;
25836
- var Iterators = iterators;
25837
- var wellKnownSymbol$1 = wellKnownSymbol$j;
25838
-
25839
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
25840
-
25841
- var getIteratorMethod$2 = function (it) {
25842
- if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$1)
25843
- || getMethod$1(it, '@@iterator')
25844
- || Iterators[classof(it)];
25845
- };
25846
-
25847
- var call$5 = functionCall;
25848
- var aCallable$2 = aCallable$a;
25849
- var anObject$3 = anObject$f;
25850
- var tryToString$1 = tryToString$5;
25851
- var getIteratorMethod$1 = getIteratorMethod$2;
25852
-
25853
- var $TypeError$1 = TypeError;
25854
-
25855
- var getIterator$1 = function (argument, usingIterator) {
25856
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
25857
- if (aCallable$2(iteratorMethod)) return anObject$3(call$5(iteratorMethod, argument));
25858
- throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
25859
- };
25860
-
25861
- var call$4 = functionCall;
25862
- var anObject$2 = anObject$f;
25863
- var getMethod = getMethod$5;
25864
-
25865
- var iteratorClose$1 = function (iterator, kind, value) {
25866
- var innerResult, innerError;
25867
- anObject$2(iterator);
25868
- try {
25869
- innerResult = getMethod(iterator, 'return');
25870
- if (!innerResult) {
25871
- if (kind === 'throw') throw value;
25872
- return value;
25873
- }
25874
- innerResult = call$4(innerResult, iterator);
25875
- } catch (error) {
25876
- innerError = true;
25877
- innerResult = error;
25878
- }
25879
- if (kind === 'throw') throw value;
25880
- if (innerError) throw innerResult;
25881
- anObject$2(innerResult);
25882
- return value;
25883
- };
25884
-
25885
- var bind = functionBindContext;
25886
- var call$3 = functionCall;
25887
- var anObject$1 = anObject$f;
25888
- var tryToString = tryToString$5;
25889
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
25890
- var lengthOfArrayLike$1 = lengthOfArrayLike$8;
25891
- var isPrototypeOf = objectIsPrototypeOf;
25892
- var getIterator = getIterator$1;
25893
- var getIteratorMethod = getIteratorMethod$2;
25894
- var iteratorClose = iteratorClose$1;
25895
-
25896
- var $TypeError = TypeError;
25897
-
25898
- var Result = function (stopped, result) {
25899
- this.stopped = stopped;
25900
- this.result = result;
25901
- };
25902
-
25903
- var ResultPrototype = Result.prototype;
25904
-
25905
- var iterate$2 = function (iterable, unboundFunction, options) {
25906
- var that = options && options.that;
25907
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
25908
- var IS_RECORD = !!(options && options.IS_RECORD);
25909
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
25910
- var INTERRUPTED = !!(options && options.INTERRUPTED);
25911
- var fn = bind(unboundFunction, that);
25912
- var iterator, iterFn, index, length, result, next, step;
25913
-
25914
- var stop = function (condition) {
25915
- if (iterator) iteratorClose(iterator, 'normal', condition);
25916
- return new Result(true, condition);
25917
- };
25918
-
25919
- var callFn = function (value) {
25920
- if (AS_ENTRIES) {
25921
- anObject$1(value);
25922
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
25923
- } return INTERRUPTED ? fn(value, stop) : fn(value);
25924
- };
25925
-
25926
- if (IS_RECORD) {
25927
- iterator = iterable.iterator;
25928
- } else if (IS_ITERATOR) {
25929
- iterator = iterable;
25930
- } else {
25931
- iterFn = getIteratorMethod(iterable);
25932
- if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
25933
- // optimisation for array iterators
25934
- if (isArrayIteratorMethod(iterFn)) {
25935
- for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
25936
- result = callFn(iterable[index]);
25937
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
25938
- } return new Result(false);
25939
- }
25940
- iterator = getIterator(iterable, iterFn);
25941
- }
25942
-
25943
- next = IS_RECORD ? iterable.next : iterator.next;
25944
- while (!(step = call$3(next, iterator)).done) {
25945
- try {
25946
- result = callFn(step.value);
25947
- } catch (error) {
25948
- iteratorClose(iterator, 'throw', error);
25949
- }
25950
- if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
25951
- } return new Result(false);
25952
- };
25953
-
25954
26287
  var wellKnownSymbol = wellKnownSymbol$j;
25955
26288
 
25956
26289
  var ITERATOR = wellKnownSymbol('iterator');
@@ -26003,7 +26336,7 @@ var call$2 = functionCall;
26003
26336
  var aCallable$1 = aCallable$a;
26004
26337
  var newPromiseCapabilityModule$2 = newPromiseCapability$2;
26005
26338
  var perform$1 = perform$3;
26006
- var iterate$1 = iterate$2;
26339
+ var iterate$1 = iterate$3;
26007
26340
  var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
26008
26341
 
26009
26342
  // `Promise.all` method
@@ -26067,7 +26400,7 @@ var call$1 = functionCall;
26067
26400
  var aCallable = aCallable$a;
26068
26401
  var newPromiseCapabilityModule$1 = newPromiseCapability$2;
26069
26402
  var perform = perform$3;
26070
- var iterate = iterate$2;
26403
+ var iterate = iterate$3;
26071
26404
  var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
26072
26405
 
26073
26406
  // `Promise.race` method
@@ -26378,7 +26711,7 @@ const EditWalletAddressForm = ({
26378
26711
  }));
26379
26712
  };
26380
26713
 
26381
- const styles$2 = createStyles({
26714
+ const styles$3 = createStyles({
26382
26715
  grid: theme => ({
26383
26716
  margin: theme.spacing(4)
26384
26717
  }),
@@ -26430,21 +26763,21 @@ const WalletForm = ({
26430
26763
  onSubmit: formLogger.capture(handleSubmit)
26431
26764
  }, {
26432
26765
  children: jsxs(Grid, Object.assign({
26433
- css: styles$2.grid,
26766
+ css: styles$3.grid,
26434
26767
  noPadding: true
26435
26768
  }, {
26436
26769
  children: [jsx(GridChild, Object.assign({
26437
26770
  colSpan: 12
26438
26771
  }, {
26439
26772
  children: jsx(Typography, Object.assign({
26440
- css: styles$2.heading,
26773
+ css: styles$3.heading,
26441
26774
  variant: "heading4"
26442
26775
  }, {
26443
26776
  children: t("register-wallet:sections.billing.title")
26444
26777
  }))
26445
26778
  })), jsx(GridChild, Object.assign({
26446
26779
  colSpan: 12,
26447
- css: styles$2.subtitle
26780
+ css: styles$3.subtitle
26448
26781
  }, {
26449
26782
  children: jsx(Typography, Object.assign({
26450
26783
  variant: "subtitle1"
@@ -26477,7 +26810,7 @@ const WalletForm = ({
26477
26810
  colSpan: 12
26478
26811
  }, {
26479
26812
  children: jsx(Typography, Object.assign({
26480
- css: styles$2.subtitle,
26813
+ css: styles$3.subtitle,
26481
26814
  variant: "subtitle1"
26482
26815
  }, {
26483
26816
  children: t("register-wallet:sections.billing.addressSubTitle")
@@ -26533,7 +26866,7 @@ const WalletForm = ({
26533
26866
  }));
26534
26867
  };
26535
26868
 
26536
- const styles$1 = createStyles({
26869
+ const styles$2 = createStyles({
26537
26870
  step: {
26538
26871
  "& > span:last-child": {
26539
26872
  position: "static"
@@ -26551,6 +26884,9 @@ const Onboarding$1 = ({
26551
26884
  createWarehouse,
26552
26885
  onCarrierCreated,
26553
26886
  onWarehouseCreated,
26887
+ onValidateWarehouse,
26888
+ warehousePreference,
26889
+ setWarehousePreference,
26554
26890
  onCompleteOnboarding,
26555
26891
  registerDhlCarrier,
26556
26892
  registerDhlCarrierErrors,
@@ -26558,7 +26894,8 @@ const Onboarding$1 = ({
26558
26894
  registerStampsCarrierErrors,
26559
26895
  registerUpsCarrier,
26560
26896
  registerUpsCarrierErrors,
26561
- warehouses
26897
+ warehouses,
26898
+ validationErrors
26562
26899
  }) => {
26563
26900
  const {
26564
26901
  t
@@ -26611,6 +26948,7 @@ const Onboarding$1 = ({
26611
26948
  const handleCreateWarehouse = payload => __awaiter(void 0, void 0, void 0, function* () {
26612
26949
  const result = yield createWarehouse(payload);
26613
26950
  if (result) yield onWarehouseCreated();
26951
+ setHasValidAddress(true);
26614
26952
  });
26615
26953
  const handleWalletRegistration = ({
26616
26954
  address,
@@ -26656,14 +26994,34 @@ const Onboarding$1 = ({
26656
26994
  }
26657
26995
  if (agreedToTerms && !warehouses.length && !hasValidAddress) {
26658
26996
  // Step 3: Add Ship From (Warehouse) Address
26659
- return jsx(WarehouseForm, {
26997
+ return jsx(WarehousePreferenceWizard, {
26998
+ formHeader: jsxs("div", Object.assign({
26999
+ css: {
27000
+ textAlign: "center"
27001
+ }
27002
+ }, {
27003
+ children: [jsx(Typography, Object.assign({
27004
+ variant: "heading4"
27005
+ }, {
27006
+ children: t("onboarding:warehouse.title")
27007
+ })), jsx(Spacer, {
27008
+ multiplier: 2
27009
+ }), jsx(Typography, Object.assign({
27010
+ variant: "subtitle1"
27011
+ }, {
27012
+ children: t("onboarding:warehouse.subtitle")
27013
+ })), jsx(Spacer, {
27014
+ multiplier: 1
27015
+ })]
27016
+ })),
26660
27017
  isOnboarding: true,
26661
27018
  onSubmit: payload => {
26662
27019
  handleCreateWarehouse(payload);
26663
- setHasValidAddress(true);
26664
- // Step 3.1: TODO: LMNT-815 Validate Address
27020
+ setWarehousePreference(undefined);
26665
27021
  },
26666
- submitButtonTitle: t("actions.continue")
27022
+ onValidate: onValidateWarehouse,
27023
+ submitButtonTitle: t("actions.continue"),
27024
+ warehousePreference: warehousePreference
26667
27025
  });
26668
27026
  }
26669
27027
  // Step 4: Register Stamps Wallet, UPS, DHL
@@ -26703,22 +27061,22 @@ const Onboarding$1 = ({
26703
27061
  return jsx(Loader, {});
26704
27062
  };
26705
27063
  return jsxs("div", Object.assign({
26706
- css: styles$1.wrapper
27064
+ css: styles$2.wrapper
26707
27065
  }, {
26708
27066
  children: [jsxs(Stepper, Object.assign({
26709
27067
  currentStep: currentStep
26710
27068
  }, {
26711
27069
  children: [jsx(Step, {
26712
- css: styles$1.step,
27070
+ css: styles$2.step,
26713
27071
  label: t("onboarding:steps.login")
26714
27072
  }), jsx(Step, {
26715
- css: styles$1.step,
27073
+ css: styles$2.step,
26716
27074
  label: t("onboarding:steps.carriers")
26717
27075
  }), jsx(Step, {
26718
- css: styles$1.step,
27076
+ css: styles$2.step,
26719
27077
  label: t("onboarding:steps.addresses")
26720
27078
  }), jsx(Step, {
26721
- css: styles$1.step,
27079
+ css: styles$2.step,
26722
27080
  label: t("onboarding:steps.payment")
26723
27081
  })]
26724
27082
  })), renderStep()]
@@ -26926,16 +27284,20 @@ const AddFundsForm = ({
26926
27284
  });
26927
27285
  const {
26928
27286
  isSubmitted,
27287
+ isSubmitting,
26929
27288
  isValid
26930
27289
  } = form.formState;
26931
27290
  const watchAmount = form.watch("funds").amount;
26932
27291
  const formId = "add-funds-form";
26933
- const handleSubmit = formLogger.capture(form.handleSubmit(values => {
27292
+ const handleSubmit = formLogger.capture(form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
26934
27293
  const payload = values;
26935
- addFunds.mutate(payload, {
26936
- onSuccess: () => onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess()
26937
- });
26938
- }));
27294
+ try {
27295
+ yield addFunds.mutateAsync(payload);
27296
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
27297
+ } catch (_a) {
27298
+ // Noop; errors available on RQ object
27299
+ }
27300
+ })));
26939
27301
  if (carrier.isLoading) return jsx(Loader, {
26940
27302
  message: t("loading.carrier")
26941
27303
  });
@@ -27010,6 +27372,7 @@ const AddFundsForm = ({
27010
27372
  justify: "end"
27011
27373
  }, {
27012
27374
  children: [onCancel && jsx(Button, Object.assign({
27375
+ disabled: isSubmitting,
27013
27376
  onClick: onCancel,
27014
27377
  variant: ButtonVariant.TEXT
27015
27378
  }, {
@@ -27017,7 +27380,6 @@ const AddFundsForm = ({
27017
27380
  })), jsx(SubmitButton, Object.assign({
27018
27381
  control: form.control,
27019
27382
  form: formId,
27020
- isLoading: addFunds.isLoading,
27021
27383
  variant: ButtonVariant.OUTLINED
27022
27384
  }, {
27023
27385
  children: t("manage-funding:actions.addNow")
@@ -27036,7 +27398,7 @@ const AddFundsForm = ({
27036
27398
  }), children === null || children === void 0 ? void 0 : children({
27037
27399
  isCustomAmount: selectedChip.value === "custom",
27038
27400
  isSubmitted,
27039
- isSubmitting: addFunds.isLoading,
27401
+ isSubmitting,
27040
27402
  isValid,
27041
27403
  selectedAmount: watchAmount,
27042
27404
  submit: handleSubmit
@@ -27108,6 +27470,9 @@ const LinkAction = _a => {
27108
27470
  return jsx(Link, Object.assign({}, props, {
27109
27471
  bold: true,
27110
27472
  css: theme => [{
27473
+ "&&&": {
27474
+ textDecoration: "none"
27475
+ },
27111
27476
  alignItems: "center",
27112
27477
  display: "flex",
27113
27478
  gap: theme.spacing(1)
@@ -27174,6 +27539,7 @@ const getStyles$1 = isCustomAmount => createStyles({
27174
27539
  const FundAndPurchase = ({
27175
27540
  carrierId,
27176
27541
  className,
27542
+ control,
27177
27543
  disabled,
27178
27544
  isFundingEnabled,
27179
27545
  isFundingRequired,
@@ -27189,11 +27555,11 @@ const FundAndPurchase = ({
27189
27555
  data: carrier,
27190
27556
  isLoading: isLoadingCarrier
27191
27557
  } = useGetCarrierById(carrierId);
27192
- const isAddingFunds = !!useIsMutating({
27193
- mutationKey: ["useAddFunds"]
27194
- });
27195
- const isCreatingLabel = !!useIsMutating({
27196
- mutationKey: ["useCreateLabel"]
27558
+ const {
27559
+ isSubmitting: isRateFormSubmitting,
27560
+ isValid: isRateFormValid
27561
+ } = useFormState({
27562
+ control
27197
27563
  });
27198
27564
  const [isSavingRate, setIsSavingRate] = useState(false);
27199
27565
  const handleSaveRate = () => __awaiter(void 0, void 0, void 0, function* () {
@@ -27211,7 +27577,7 @@ const FundAndPurchase = ({
27211
27577
  children: [jsx(Button, Object.assign({
27212
27578
  bold: false,
27213
27579
  css: getStyles$1().saveRateButton,
27214
- disabled: disabled || !carrierId || isAddingFunds || isCreatingLabel,
27580
+ disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
27215
27581
  isLoading: isSavingRate,
27216
27582
  onClick: handleSaveRate,
27217
27583
  variant: ButtonVariant.OUTLINED
@@ -27219,8 +27585,8 @@ const FundAndPurchase = ({
27219
27585
  children: t("purchase-label:actions.saveRate")
27220
27586
  })), jsx(Button, Object.assign({
27221
27587
  "data-testid": "submit-fund-and-purchase",
27222
- disabled: disabled || !carrierId || isFundingEnabled && isFundingRequired && isAddFundsFormOpen && addFundsForm.isSubmitted && !addFundsForm.isValid,
27223
- isLoading: addFundsForm.isSubmitting || isAddingFunds || isCreatingLabel,
27588
+ disabled: disabled || !carrierId || !isRateFormValid || isFundingEnabled && isFundingRequired && isAddFundsFormOpen && addFundsForm.isSubmitted && !addFundsForm.isValid,
27589
+ isLoading: addFundsForm.isSubmitting || isRateFormSubmitting,
27224
27590
  onClick: isAddFundsFormOpen ? addFundsForm.submit : onPurchase
27225
27591
  }, {
27226
27592
  children: isAddFundsFormOpen ? t("manage-funding:actions.addFundsAndPurchase") : t("purchase-label:actions.purchaseNow")
@@ -27239,10 +27605,6 @@ const FundAndPurchase = ({
27239
27605
  });
27240
27606
  if (!carrier || !carrierId) throw new Error("errorMessages.unableToLoad.carrier");
27241
27607
  const balance = carrier.balance;
27242
- const handleAddFundsSuccess = () => {
27243
- setIsAddFundsFormOpen(false);
27244
- onPurchase();
27245
- };
27246
27608
  // Render: walleted carrier, but funding feature is not enabled;
27247
27609
  // show balance, but not the funding form.
27248
27610
  if (!isFundingEnabled) return jsxs("div", Object.assign({
@@ -27266,7 +27628,7 @@ const FundAndPurchase = ({
27266
27628
  carrierId: carrierId
27267
27629
  }), jsx(LinkAction, {
27268
27630
  icon: "add",
27269
- isDisabled: isAddFundsFormOpen || isAddingFunds || isCreatingLabel,
27631
+ isDisabled: isAddFundsFormOpen || isRateFormSubmitting,
27270
27632
  onClick: () => setIsAddFundsFormOpen(true),
27271
27633
  title: t("manage-funding:actions.addFunds")
27272
27634
  })]
@@ -27284,7 +27646,7 @@ const FundAndPurchase = ({
27284
27646
  }), isAddFundsFormOpen ? jsx(AddFundsForm, Object.assign({
27285
27647
  carrierId: carrierId,
27286
27648
  minimumAmount: purchaseAmount - balance,
27287
- onSuccess: handleAddFundsSuccess
27649
+ onSuccess: onPurchase
27288
27650
  }, {
27289
27651
  children: addFundsForm => {
27290
27652
  var _a, _b;
@@ -27318,6 +27680,7 @@ const FundAndPurchase = ({
27318
27680
  justify: "end"
27319
27681
  }, {
27320
27682
  children: jsx(Button, Object.assign({
27683
+ disabled: addFundsForm.isSubmitting || isRateFormSubmitting,
27321
27684
  onClick: () => setIsAddFundsFormOpen(false),
27322
27685
  variant: ButtonVariant.TEXT
27323
27686
  }, {
@@ -27329,11 +27692,11 @@ const FundAndPurchase = ({
27329
27692
  }), renderActionButtons(addFundsForm)]
27330
27693
  });
27331
27694
  }
27332
- })) : renderActionButtons()]
27695
+ }), purchaseAmount) : renderActionButtons()]
27333
27696
  }));
27334
27697
  };
27335
27698
 
27336
- const styles = createStyles({
27699
+ const styles$1 = createStyles({
27337
27700
  fundAndPurchase: theme => ({
27338
27701
  borderTop: `1px solid ${theme.palette.gray.ultraLight}`
27339
27702
  }),
@@ -27379,6 +27742,7 @@ const RateForm = ({
27379
27742
  const {
27380
27743
  t
27381
27744
  } = useTranslation();
27745
+ const queryClient = useQueryClient();
27382
27746
  const rateFormScrollToRef = useRef(null);
27383
27747
  const [showHiddenRates, setShowHiddenRates] = useState(false);
27384
27748
  const form = useForm({
@@ -27396,7 +27760,18 @@ const RateForm = ({
27396
27760
  } = form.watch("rate");
27397
27761
  const handleSubmit = formLogger.capture(form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
27398
27762
  const rateId = values;
27399
- yield onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(rateId);
27763
+ try {
27764
+ yield onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(rateId);
27765
+ } finally {
27766
+ // Invalidate carrier queries after the rate form is submitted, regardless of success.
27767
+ // This allows the carrier balance to refresh if the purchase failed but funding succeeded.
27768
+ queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
27769
+ exact: true
27770
+ });
27771
+ queryClient.invalidateQueries(["useListCarriers"], {
27772
+ exact: true
27773
+ });
27774
+ }
27400
27775
  })));
27401
27776
  const rateOptions = useRateOptions(rates, carriers, shipment, features.enableGlobalPostFiltering
27402
27777
  // TODO: LMNT-677: fix RecommendedRate logic
@@ -27472,7 +27847,7 @@ const RateForm = ({
27472
27847
  onClick: onSelectRate,
27473
27848
  options: showHiddenRates ? rateOptions : filteredRateOptions
27474
27849
  }), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsx(Link, Object.assign({
27475
- css: styles.showMoreOrLessRatesButton,
27850
+ css: styles$1.showMoreOrLessRatesButton,
27476
27851
  onClick: () => {
27477
27852
  var _a;
27478
27853
  setShowHiddenRates(!showHiddenRates);
@@ -27493,7 +27868,7 @@ const RateForm = ({
27493
27868
  }))
27494
27869
  }))]
27495
27870
  }) : !isLoading && errors && !!errors.length ? null : jsxs("article", Object.assign({
27496
- css: styles.ratesInterstitial,
27871
+ css: styles$1.ratesInterstitial,
27497
27872
  role: "presentation"
27498
27873
  }, {
27499
27874
  children: [jsx(Cube, {
@@ -27513,7 +27888,8 @@ const RateForm = ({
27513
27888
  })]
27514
27889
  })), jsx(FundAndPurchase, {
27515
27890
  carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
27516
- css: styles.fundAndPurchase,
27891
+ control: form.control,
27892
+ css: styles$1.fundAndPurchase,
27517
27893
  disabled: disabled,
27518
27894
  isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
27519
27895
  isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
@@ -27948,7 +28324,7 @@ const getShipmentSchema = ({
27948
28324
  }).nullish(),
27949
28325
  shipDate: z.string(),
27950
28326
  shipmentId: z.string().nullishDefault(undefined),
27951
- warehouseId: z.string().refine(warehouseId => {
28327
+ warehouseId: z.string().refine(warehouseId => !!warehouseId, "purchase-label:schemaErrors.shipFromAddressRequired").refine(warehouseId => {
27952
28328
  var _a;
27953
28329
  return allowInternationalShipFrom || ((_a = warehouses === null || warehouses === void 0 ? void 0 : warehouses.find(w => w.warehouseId === warehouseId)) === null || _a === void 0 ? void 0 : _a.originAddress.countryCode) === "US";
27954
28330
  }, "purchase-label:schemaErrors.shipFromUnitedStatesOnly")
@@ -28221,9 +28597,10 @@ const ShipmentForm = ({
28221
28597
  // When shipment is first loaded, hydrate the entire form
28222
28598
  useRunOnceOnTrue(shipment && (() => hydrateShipment(shipment)));
28223
28599
  useEffect(() => {
28224
- var _a, _b;
28600
+ var _a, _b, _c, _d;
28225
28601
  if (!shipment && (warehouses === null || warehouses === void 0 ? void 0 : warehouses.length)) {
28226
- const defaultWarehouse = (_b = (_a = warehouses.find(w => w.warehouseId === warehouseId)) === null || _a === void 0 ? void 0 : _a.warehouseId) !== null && _b !== void 0 ? _b : warehouses[0].warehouseId;
28602
+ const defaultWarehouse = (_d = (_b = (_a = warehouses.find(w => w.warehouseId === warehouseId)) === null || _a === void 0 ? void 0 : _a.warehouseId) !== null && _b !== void 0 ? _b : (_c = warehouses.find(w => w.isDefault)) === null || _c === void 0 ? void 0 : _c.warehouseId) !== null && _d !== void 0 ? _d : warehouses[0].warehouseId;
28603
+ // There will always be a default warehouse, but TS doesn't know that
28227
28604
  form.setValue("warehouseId", defaultWarehouse);
28228
28605
  }
28229
28606
  }, [form, shipment, warehouseId, warehouses]);
@@ -28950,22 +29327,126 @@ const SuspendShipment = ({
28950
29327
  isLoading,
28951
29328
  shipment
28952
29329
  }) => {
28953
- const {
28954
- t
28955
- } = useTranslation(["common", "purchase-label"]);
28956
- if (isLoading) return jsx(Loader, {
28957
- message: t("loading.shipment")
29330
+ const {
29331
+ t
29332
+ } = useTranslation(["common", "purchase-label"]);
29333
+ if (isLoading) return jsx(Loader, {
29334
+ message: t("loading.shipment")
29335
+ });
29336
+ if (errors) throw new Error(errors.map(e => e.message).join(", "));
29337
+ if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
29338
+ return jsx("div", Object.assign({
29339
+ css: {
29340
+ height: "100%",
29341
+ width: "100%"
29342
+ }
29343
+ }, {
29344
+ children: children
29345
+ }));
29346
+ };
29347
+
29348
+ const styles = createStyles({
29349
+ dateRangeInput: theme => ({
29350
+ width: theme.spacing(30)
29351
+ })
29352
+ });
29353
+
29354
+ const HistoryActions = () => {
29355
+ const {
29356
+ t
29357
+ } = useTranslation();
29358
+ const selectOptions = useMemo(() => [{
29359
+ label: t("wallet-history:historyOptions.custom"),
29360
+ value: t("wallet-history:historyOptions.custom")
29361
+ }, {
29362
+ label: t("wallet-history:historyOptions.last30days"),
29363
+ value: t("wallet-history:historyOptions.last30days")
29364
+ }, {
29365
+ label: t("wallet-history:historyOptions.thisMonth"),
29366
+ value: t("wallet-history:historyOptions.thisMonth")
29367
+ }, {
29368
+ label: t("wallet-history:historyOptions.lastMonth"),
29369
+ value: t("wallet-history:historyOptions.lastMonth")
29370
+ }], [t]);
29371
+ const [selectValue, setSelectValue] = useState();
29372
+ return jsxs(Spread, {
29373
+ children: [jsx(Select$1, Object.assign({
29374
+ css: styles.dateRangeInput,
29375
+ label: "Date range",
29376
+ leftContent: jsx(Icon, {
29377
+ name: IconNames.FILTER
29378
+ }),
29379
+ name: "date-range-select",
29380
+ onChange: newValue => setSelectValue(newValue),
29381
+ onClear: c => console.log("SELECT ON CLEAR CALLBACK:", c)
29382
+ }, {
29383
+ children: selectOptions.map(item => jsx(Option, Object.assign({
29384
+ value: item.value
29385
+ }, {
29386
+ children: item.label
29387
+ }), item.value))
29388
+ })), jsx(LinkAction, {
29389
+ onClick: x => console.log("Downloaded a CSV!", x),
29390
+ title: t("wallet-history:actions.downloadCsv")
29391
+ })]
29392
+ });
29393
+ };
29394
+
29395
+ const HistoryRow = ({
29396
+ key,
29397
+ rowItem
29398
+ }) => jsx("div", {
29399
+ children: "History Row Component"
29400
+ });
29401
+
29402
+ /**
29403
+ * This component is the list of events that represent the history of a
29404
+ * specific entity. The events are displayed in reverse chronological order.
29405
+ *
29406
+ * @param historyData The history data to display.
29407
+ */
29408
+ const HistoryList = ({
29409
+ historyData
29410
+ }) => {
29411
+ console.table(historyData);
29412
+ return jsx(Fragment, {
29413
+ children: [1, 2, 3].map((item, idx) => {
29414
+ return jsx(HistoryRow, {
29415
+ rowItem: item
29416
+ }, idx);
29417
+ })
29418
+ });
29419
+ };
29420
+
29421
+ const HistoryBody = ({
29422
+ historyData
29423
+ }) => {
29424
+ const [page, setPage] = useState(1);
29425
+ return jsxs(Fragment, {
29426
+ children: [jsx(HistoryActions, {}), jsx(HistoryList, {
29427
+ historyData: historyData
29428
+ }), jsxs(Fragment, {
29429
+ children: [jsxs("p", {
29430
+ children: ["Page ", jsx("strong", {
29431
+ children: page
29432
+ }), " selected."]
29433
+ }), jsx(Pagination, {
29434
+ boundaryPagesToShow: 7,
29435
+ currentPage: page,
29436
+ onPageChange: selectedPage => setPage(selectedPage),
29437
+ siblingCount: 2,
29438
+ totalPages: 20
29439
+ })]
29440
+ })]
29441
+ });
29442
+ };
29443
+
29444
+ const WalletHistory$1 = ({
29445
+ historyData
29446
+ }) => {
29447
+ return jsx(HistoryBody, {
29448
+ historyData: historyData
28958
29449
  });
28959
- if (errors) throw new Error(errors.map(e => e.message).join(", "));
28960
- if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
28961
- return jsx("div", Object.assign({
28962
- css: {
28963
- height: "100%",
28964
- width: "100%"
28965
- }
28966
- }, {
28967
- children: children
28968
- }));
28969
29450
  };
28970
29451
 
28971
29452
  const VoidLabel$1 = ({
@@ -29109,13 +29590,16 @@ var index$1 = /*#__PURE__*/Object.freeze({
29109
29590
  schedulePickupForCarrier: schedulePickupForCarrier,
29110
29591
  Shipment: Shipment$1,
29111
29592
  SuspendShipment: SuspendShipment,
29593
+ WalletHistory: WalletHistory$1,
29112
29594
  WarehouseForm: WarehouseForm,
29113
29595
  VoidLabel: VoidLabel$1,
29114
29596
  WalletForm: WalletForm,
29115
- styles: styles$2,
29597
+ styles: styles$3,
29116
29598
  billingAddressSchema: billingAddressSchema,
29117
29599
  walletSchema: walletSchema,
29118
- BillingFields: BillingFields
29600
+ BillingFields: BillingFields,
29601
+ WarehousePreferenceWizard: WarehousePreferenceWizard,
29602
+ WarehousePreferenceSelect: WarehousePreferenceSelect
29119
29603
  });
29120
29604
 
29121
29605
  const getStyles = showForm => createStyles({
@@ -29390,6 +29874,7 @@ const ManageFunding = ({
29390
29874
  const {
29391
29875
  t
29392
29876
  } = useTranslation();
29877
+ const queryClient = useQueryClient();
29393
29878
  const {
29394
29879
  isLoading: isLoadingCarrier
29395
29880
  } = useGetCarrierById(carrierId);
@@ -29412,7 +29897,15 @@ const ManageFunding = ({
29412
29897
  multiplier: 2
29413
29898
  }), jsx(AddFundsForm, {
29414
29899
  carrierId: carrierId,
29415
- onCancel: () => setIsAddFundsFormOpen(false)
29900
+ onCancel: () => setIsAddFundsFormOpen(false),
29901
+ onSuccess: () => {
29902
+ queryClient.invalidateQueries(["useGetCarrierById", carrierId], {
29903
+ exact: true
29904
+ });
29905
+ queryClient.invalidateQueries(["useListCarriers"], {
29906
+ exact: true
29907
+ });
29908
+ }
29416
29909
  })]
29417
29910
  }), jsx(Spacer, {
29418
29911
  multiplier: 2
@@ -30381,8 +30874,10 @@ var common = {
30381
30874
  },
30382
30875
  paste: "Paste Address",
30383
30876
  preference: {
30877
+ confirm: "Confirm",
30384
30878
  addressNotValidated: "Address not validated",
30385
30879
  modified: "modified",
30880
+ title: "To ensure accurate rate estimation, consider the changes suggested below.",
30386
30881
  originalAddress: "Original Address",
30387
30882
  matchedAddress: "Suggested Address",
30388
30883
  unableToValidate: "We were not able to validate this address. It might result in delays in your delivery.",
@@ -30643,6 +31138,7 @@ var manageFunding = {
30643
31138
  var manageWarehouses = {
30644
31139
  "manage-warehouses": {
30645
31140
  addNew: "Add New Address",
31141
+ editWarehouse: "Edit Address",
30646
31142
  contactName: "Contact Name",
30647
31143
  "default": "Default",
30648
31144
  isDefault: "Set as default Ship From address",
@@ -30757,6 +31253,7 @@ var purchaseLabel = {
30757
31253
  },
30758
31254
  schemaErrors: {
30759
31255
  shipFromUnitedStatesOnly: "Only US addresses are supported in this view",
31256
+ shipFromAddressRequired: "Ship From address is required",
30760
31257
  needToAcknowledge: "Need to accept Rate Compliance Agreement"
30761
31258
  },
30762
31259
  rates: {
@@ -30883,7 +31380,21 @@ var voidLabel = {
30883
31380
  }
30884
31381
  };
30885
31382
 
30886
- var index = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, common$1), listCarriers), manageFunding), manageWarehouses), onboarding$1), purchaseLabel), registerCarrier), registerWallet), viewShipment), voidLabel);
31383
+ var walletHistory = {
31384
+ "wallet-history": {
31385
+ actions: {
31386
+ downloadCsv: "Download a CSV"
31387
+ },
31388
+ historyOptions: {
31389
+ custom: "Custom",
31390
+ last30days: "Last 30 days",
31391
+ thisMonth: "This month",
31392
+ lastMonth: "Last month"
31393
+ }
31394
+ }
31395
+ };
31396
+
31397
+ var index = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, common$1), listCarriers), manageFunding), manageWarehouses), onboarding$1), purchaseLabel), registerCarrier), registerWallet), viewShipment), voidLabel), walletHistory);
30887
31398
 
30888
31399
  var resources = /*#__PURE__*/Object.freeze({
30889
31400
  __proto__: null,
@@ -31153,9 +31664,11 @@ const ListCarriers = () => {
31153
31664
  });
31154
31665
  };
31155
31666
 
31156
- const Element$5 = registerElement("list-carriers", ListCarriers);
31667
+ const Element$6 = registerElement("list-carriers", ListCarriers);
31157
31668
 
31158
- const ManageWarehouses = () => {
31669
+ const ManageWarehouses = ({
31670
+ onWarehouseAddressValidation
31671
+ }) => {
31159
31672
  const {
31160
31673
  t
31161
31674
  } = useTranslation();
@@ -31177,6 +31690,12 @@ const ManageWarehouses = () => {
31177
31690
  error: deleteWarehouseErrors,
31178
31691
  mutateAsync: deleteWarehouse
31179
31692
  } = useDeleteWarehouse();
31693
+ const {
31694
+ errors: validateWarehouseErrors,
31695
+ validate: validateWarehouse,
31696
+ warehousePreference,
31697
+ setWarehousePreference
31698
+ } = useWarehouseValidation();
31180
31699
  const handleDeleteWarehouse = warehouseId => __awaiter(void 0, void 0, void 0, function* () {
31181
31700
  yield deleteWarehouse({
31182
31701
  warehouseId
@@ -31210,18 +31729,21 @@ const ManageWarehouses = () => {
31210
31729
  if (listWarehouseErrors) throw new Error(listWarehouseErrors.map(e => e.message).join(", "));
31211
31730
  throw new Error("errorMessages.unableToLoad.warehouses");
31212
31731
  }
31213
- const errors = [...(updateWarehouseErrors !== null && updateWarehouseErrors !== void 0 ? updateWarehouseErrors : []), ...(createWarehouseErrors !== null && createWarehouseErrors !== void 0 ? createWarehouseErrors : []), ...(deleteWarehouseErrors !== null && deleteWarehouseErrors !== void 0 ? deleteWarehouseErrors : [])];
31732
+ const errors = [...(updateWarehouseErrors !== null && updateWarehouseErrors !== void 0 ? updateWarehouseErrors : []), ...(createWarehouseErrors !== null && createWarehouseErrors !== void 0 ? createWarehouseErrors : []), ...(deleteWarehouseErrors !== null && deleteWarehouseErrors !== void 0 ? deleteWarehouseErrors : []), ...(validateWarehouseErrors !== null && validateWarehouseErrors !== void 0 ? validateWarehouseErrors : [])];
31214
31733
  return jsx(ManageWarehouses$1, {
31215
31734
  errors: errors,
31216
31735
  onAdd: handleSubmitAddNewWarehouse,
31217
31736
  onDelete: handleDeleteWarehouse,
31218
31737
  onEdit: handleSubmitEditWarehouse,
31219
31738
  onSetDefault: handleSetDefault,
31739
+ onValidate: validateWarehouse,
31740
+ setWarehousePreference: setWarehousePreference,
31741
+ warehousePreference: warehousePreference,
31220
31742
  warehouses: warehouses
31221
31743
  });
31222
31744
  };
31223
31745
 
31224
- const Element$4 = registerElement("manage-warehouses", ManageWarehouses);
31746
+ const Element$5 = registerElement("manage-warehouses", ManageWarehouses);
31225
31747
 
31226
31748
  const useAddress = ({
31227
31749
  compatibleCountryCodes,
@@ -31532,18 +32054,16 @@ const useRequestRates = ({
31532
32054
  if (result) yield onRatesCalculated === null || onRatesCalculated === void 0 ? void 0 : onRatesCalculated(result.rateResponse.rates, shipment);
31533
32055
  }), [calculateRates, carriers, customPackageTypes, onRatesCalculated]);
31534
32056
  let ratesResponse = ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.rateResponse;
31535
- if (ratesResponse) {
31536
- ratesResponse = Object.assign(Object.assign({}, ratesResponse), {
31537
- rates: ratesResponse.rates.map(rate => {
31538
- var _a, _b;
31539
- return Object.assign(Object.assign({}, rate), {
31540
- warningMessages: [
31541
- // add additional rateMessages based on combinations of serviceCode and packageType
31542
- ...((_a = rateMessages[`${rate.serviceCode}:${rate.packageType}`]) !== null && _a !== void 0 ? _a : []), ...((_b = rateMessages[rate.serviceCode]) !== null && _b !== void 0 ? _b : []), ...rate.warningMessages]
31543
- });
31544
- })
31545
- });
31546
- }
32057
+ ratesResponse = useMemo(() => ratesResponse && Object.assign(Object.assign({}, ratesResponse), {
32058
+ rates: ratesResponse.rates.map(rate => {
32059
+ var _a, _b;
32060
+ return Object.assign(Object.assign({}, rate), {
32061
+ warningMessages: [
32062
+ // add additional rateMessages based on combinations of serviceCode and packageType
32063
+ ...((_a = rateMessages[`${rate.serviceCode}:${rate.packageType}`]) !== null && _a !== void 0 ? _a : []), ...((_b = rateMessages[rate.serviceCode]) !== null && _b !== void 0 ? _b : []), ...rate.warningMessages]
32064
+ });
32065
+ })
32066
+ }), [ratesResponse]);
31547
32067
  return {
31548
32068
  ratesCalculating,
31549
32069
  ratesErrors,
@@ -31856,6 +32376,12 @@ const Onboarding = ({
31856
32376
  const onWarehouseCreated = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
31857
32377
  yield refetchWarehouses();
31858
32378
  }), [refetchWarehouses]);
32379
+ const {
32380
+ errors: validateWarehouseErrors,
32381
+ validate: validateWarehouse,
32382
+ warehousePreference,
32383
+ setWarehousePreference
32384
+ } = useWarehouseValidation();
31859
32385
  const onCarrierCreated = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
31860
32386
  yield refetchCarriers();
31861
32387
  }), [refetchCarriers]);
@@ -31866,6 +32392,7 @@ const Onboarding = ({
31866
32392
  createWarehouse: createWarehouse,
31867
32393
  onCarrierCreated: onCarrierCreated,
31868
32394
  onCompleteOnboarding: onCompleteOnboarding,
32395
+ onValidateWarehouse: validateWarehouse,
31869
32396
  onWarehouseCreated: onWarehouseCreated,
31870
32397
  registerDhlCarrier: registerDhlCarrier,
31871
32398
  registerDhlCarrierErrors: registerDhlCarrierErrors,
@@ -31873,6 +32400,9 @@ const Onboarding = ({
31873
32400
  registerStampsCarrierErrors: registerStampsCarrierErrors,
31874
32401
  registerUpsCarrier: registerUpsCarrier,
31875
32402
  registerUpsCarrierErrors: registerUpsCarrierErrors,
32403
+ setWarehousePreference: setWarehousePreference,
32404
+ validationErrors: validateWarehouseErrors,
32405
+ warehousePreference: warehousePreference,
31876
32406
  warehouses: warehouses
31877
32407
  });
31878
32408
  };
@@ -31998,7 +32528,7 @@ const useImportSalesOrder = ({
31998
32528
  error: getSalesOrderErrors,
31999
32529
  refetch: refetchSalesOrder,
32000
32530
  isFetching: isFetchingSalesOrder
32001
- } = useGetSalesOrder(salesOrderId !== null && salesOrderId !== void 0 ? salesOrderId : salesOrders === null || salesOrders === void 0 ? void 0 : salesOrders[0].salesOrderId);
32531
+ } = useGetSalesOrder(salesOrderId !== null && salesOrderId !== void 0 ? salesOrderId : salesOrders && salesOrders[0] ? salesOrders[0].salesOrderId : undefined);
32002
32532
  const {
32003
32533
  data: orderSources,
32004
32534
  error: listOrderSourcesErrors
@@ -32006,6 +32536,7 @@ const useImportSalesOrder = ({
32006
32536
  const {
32007
32537
  data: refreshedOrderSource,
32008
32538
  error: refreshOrderSourceErrors,
32539
+ isLoading: isRefreshingOrderSource,
32009
32540
  mutateAsync: refreshOrderSource
32010
32541
  } = useRefreshOrderSource();
32011
32542
  useEffect(() => {
@@ -32025,7 +32556,7 @@ const useImportSalesOrder = ({
32025
32556
  const errors = [...(listOrderSourcesErrors !== null && listOrderSourcesErrors !== void 0 ? listOrderSourcesErrors : []), ...(listSalesOrdersErrors !== null && listSalesOrdersErrors !== void 0 ? listSalesOrdersErrors : []), ...(getSalesOrderErrors !== null && getSalesOrderErrors !== void 0 ? getSalesOrderErrors : []), ...(refreshOrderSourceErrors !== null && refreshOrderSourceErrors !== void 0 ? refreshOrderSourceErrors : [])];
32026
32557
  return {
32027
32558
  errors: errors.length > 0 ? errors : undefined,
32028
- isLoading: !salesOrder && !hasRefreshedOrderSource && errors.length === 0,
32559
+ isLoading: isFetchingSalesOrder || isFetchingSalesOrders || isRefreshingOrderSource || !hasRefreshedOrderSource && !salesOrder && (salesOrders === null || salesOrders === void 0 ? void 0 : salesOrders.length) === 0 && errors.length === 0,
32029
32560
  salesOrder
32030
32561
  };
32031
32562
  };
@@ -32183,6 +32714,13 @@ const Shipment = ({
32183
32714
  });
32184
32715
  };
32185
32716
 
32717
+ const WalletHistory = () => {
32718
+ const walletHistory = useGetWalletTransactionHistory(); // Mock data for now. Real implementation coming in a subsequent PR [LMNT-842] https://auctane.atlassian.net/browse/LMNT-842
32719
+ return jsx(WalletHistory$1, {
32720
+ historyData: walletHistory
32721
+ });
32722
+ };
32723
+
32186
32724
  const VoidLabel = ({
32187
32725
  labelId,
32188
32726
  onComplete,
@@ -32211,725 +32749,14 @@ const VoidLabel = ({
32211
32749
  });
32212
32750
  };
32213
32751
 
32214
- const Element$3 = registerElement("purchase-label", PurchaseLabel);
32752
+ const Element$4 = registerElement("purchase-label", PurchaseLabel);
32753
+
32754
+ const Element$3 = registerElement("onboarding", Onboarding);
32215
32755
 
32216
- const Element$2 = registerElement("onboarding", Onboarding);
32756
+ const Element$2 = registerElement("wallet-history", WalletHistory);
32217
32757
 
32218
32758
  const Element$1 = registerElement("view-shipment", Shipment);
32219
32759
 
32220
32760
  const Element = registerElement("void-label", VoidLabel);
32221
32761
 
32222
- /**
32223
- * @category Factories
32224
- */
32225
- const addressFactory = Factory.define(({
32226
- params,
32227
- transientParams
32228
- }) => {
32229
- var _a, _b, _c, _d;
32230
- const addressLine2 = (_a = params.addressLine2) !== null && _a !== void 0 ? _a : faker.helpers.maybe(faker.address.secondaryAddress, {
32231
- probability: 0.25
32232
- });
32233
- const addressLine3 = (_b = params.addressLine3) !== null && _b !== void 0 ? _b : addressLine2 && faker.helpers.maybe(faker.address.secondaryAddress);
32234
- let countryCode = (_c = params.countryCode) !== null && _c !== void 0 ? _c : "US";
32235
- // Random country code could still be US
32236
- while (transientParams.isInternational && countryCode === "US") {
32237
- countryCode = faker.address.countryCode();
32238
- }
32239
- const stateProvince = (_d = params.stateProvince) !== null && _d !== void 0 ? _d : faker.address.stateAbbr();
32240
- return {
32241
- addressLine1: faker.address.streetAddress(),
32242
- addressLine2,
32243
- addressLine3,
32244
- addressResidentialIndicator: faker.helpers.maybe(() => faker.helpers.arrayElement(["yes", "no"])),
32245
- cityLocality: faker.address.city(),
32246
- companyName: faker.helpers.maybe(faker.company.name),
32247
- countryCode,
32248
- name: faker.name.fullName(),
32249
- phone: faker.phone.number(),
32250
- postalCode: faker.address.zipCodeByState(stateProvince),
32251
- stateProvince
32252
- };
32253
- });
32254
- /**
32255
- * @category Factories
32256
- */
32257
- const addressValidationFactory = Factory.define(({
32258
- associations,
32259
- params
32260
- }) => {
32261
- var _a, _b;
32262
- const status = params.status || faker.helpers.arrayElement(["unverified", "verified", "warning", "error"]);
32263
- return {
32264
- matchedAddress: (_a = associations.matchedAddress) !== null && _a !== void 0 ? _a : faker.helpers.maybe(() => addressFactory.build(), {
32265
- probability: ["verified", "error"].includes(status) ? 0 : 0.8
32266
- }),
32267
- messages: [],
32268
- originalAddress: (_b = associations.originalAddress) !== null && _b !== void 0 ? _b : addressFactory.build(),
32269
- status
32270
- };
32271
- });
32272
- /**
32273
- * Mock the addressValidation object used to hyrdate address valiation feature
32274
- * on the shipment form.
32275
- * @category Factory
32276
- */
32277
- const addressPreferenceFactory = Factory.define(({
32278
- associations,
32279
- params
32280
- }) => {
32281
- const addressValidation = addressValidationFactory.build({
32282
- status: params.status
32283
- }, {
32284
- associations: {
32285
- matchedAddress: addressFactory.build()
32286
- }
32287
- });
32288
- if (!addressValidation.matchedAddress) throw new Error("addressPreferenceFactory did not generate a matchedAddress");
32289
- return Object.assign(Object.assign({}, addressValidation), {
32290
- alternative: addressValidation.originalAddress,
32291
- alternativeSource: "originalAddress",
32292
- isModified: true,
32293
- selection: addressValidation.matchedAddress,
32294
- selectionSource: "matchedAddress",
32295
- toggle: () => addressFactory.build()
32296
- });
32297
- });
32298
-
32299
- const randomShipengineId = (length = 5) => `se-${faker.random.numeric(length)}`;
32300
- const randomShipengineSlug = wordCount => faker.lorem.slug(wordCount).replace("-", "_");
32301
- const tristateValue = (ifTrue, ifFalse, ifUndefined, value) => {
32302
- if (value === undefined) {
32303
- return ifUndefined;
32304
- }
32305
- if (value) {
32306
- return ifTrue;
32307
- }
32308
- return ifFalse;
32309
- };
32310
-
32311
- /**
32312
- * @category Factories
32313
- */
32314
- const packageFactory = Factory.define(({
32315
- transientParams
32316
- }) => ({
32317
- description: faker.lorem.sentence(),
32318
- dimensions: (transientParams === null || transientParams === void 0 ? void 0 : transientParams.noDimensions) ? undefined : {
32319
- height: faker.datatype.number({
32320
- max: 50,
32321
- min: 1,
32322
- precision: 0.1
32323
- }),
32324
- length: faker.datatype.number({
32325
- max: 50,
32326
- min: 1,
32327
- precision: 0.1
32328
- }),
32329
- unit: faker.helpers.arrayElement(["inch", "centimeter"]),
32330
- width: faker.datatype.number({
32331
- max: 50,
32332
- min: 1,
32333
- precision: 0.1
32334
- })
32335
- },
32336
- name: faker.random.words(),
32337
- packageCode: randomShipengineSlug(2),
32338
- packageId: randomShipengineSlug(3)
32339
- }));
32340
-
32341
- /**
32342
- * @category Factories
32343
- */
32344
- const serviceFactory = Factory.define(({
32345
- params,
32346
- transientParams
32347
- }) => {
32348
- var _a, _b, _c, _d;
32349
- const international = params.international || faker.datatype.boolean();
32350
- return {
32351
- carrierCode: (_b = (_a = transientParams.carrier) === null || _a === void 0 ? void 0 : _a.carrierCode) !== null && _b !== void 0 ? _b : randomShipengineSlug(),
32352
- carrierId: (_d = (_c = transientParams.carrier) === null || _c === void 0 ? void 0 : _c.carrierId) !== null && _d !== void 0 ? _d : randomShipengineId(),
32353
- domestic: faker.datatype.boolean() || !international,
32354
- international,
32355
- isMultiPackageSupported: faker.datatype.boolean(),
32356
- name: faker.random.words(),
32357
- serviceCode: randomShipengineSlug()
32358
- };
32359
- });
32360
-
32361
- /**
32362
- * @category Factories
32363
- */
32364
- const carrierOptionFactory = Factory.define(() => ({
32365
- defaultValue: faker.random.word().toLowerCase(),
32366
- description: faker.random.words(),
32367
- name: faker.random.word()
32368
- }));
32369
- /**
32370
- * @category Factories
32371
- */
32372
- const carrierFactory = Factory.define(({
32373
- associations,
32374
- params,
32375
- sequence
32376
- }) => {
32377
- const carrierCode = params.carrierCode || randomShipengineSlug();
32378
- const carrierId = params.carrierId || `se-${10000 + sequence}`;
32379
- return {
32380
- accountNumber: faker.random.numeric(9),
32381
- balance: faker.datatype.number({
32382
- max: 0,
32383
- min: 0,
32384
- precision: 0.01
32385
- }),
32386
- carrierCode,
32387
- carrierId,
32388
- friendlyName: faker.company.name(),
32389
- hasMultiPackageSupportingServices: faker.datatype.boolean(),
32390
- nickname: faker.random.words(3),
32391
- options: associations.options || [],
32392
- packages: associations.packages || packageFactory.buildList(faker.datatype.number({
32393
- max: 10,
32394
- min: 1
32395
- }), {}, {
32396
- transient: {
32397
- noDimensions: true
32398
- }
32399
- }),
32400
- primary: false,
32401
- requiresFundedAmount: false,
32402
- services: associations.services || serviceFactory.buildList(faker.datatype.number({
32403
- max: 10,
32404
- min: 1
32405
- }), {
32406
- carrierCode,
32407
- carrierId
32408
- }),
32409
- supportsLabelMessages: faker.datatype.boolean()
32410
- };
32411
- });
32412
-
32413
- /**
32414
- * @category Factories
32415
- */
32416
- const moneyFactory = Factory.define(({
32417
- transientParams
32418
- }) => ({
32419
- amount: faker.datatype.number({
32420
- max: 1000,
32421
- min: 5,
32422
- precision: 0.01
32423
- }),
32424
- currency: (transientParams === null || transientParams === void 0 ? void 0 : transientParams.isInternational) ? faker.helpers.arrayElement(Object.values(SE.Currency)) : SE.Currency.USD
32425
- }));
32426
-
32427
- const randomOrderSourceCode = () => faker.helpers.arrayElement(["3dcart", "abantecart", "acumatica", "acumatica_v2", "alibaba", "amazon", "amazon_au", "amazon_ca", "amazon_de", "amazon_es", "amazon_fr", "amazon_it", "amazon_jp", "amazon_mx", "amazon_uk", "americommerce", "auctane-orders", "back-market", "bandcamp", "big_cartel", "bigcommerce", "bigcommerce_v3", "bigcommerce_v2", "bizelo", "bluepark", "bonanza", "brightpearl", "cdiscount", "celery", "channeladvisor", "channelsale", "choxi", "cin7", "commerceinterface", "corecommerce", "coupang", "cratejoy", "cs-cart", "custom_store", "dear_systems", "dummy-marketplace", "ebay", "ebay_au", "ebay_ca", "ebay_uk", "ebay_fr", "ebay_v2", "ecwid", "ecwid_v1", "edesk", "ekm", "etsy", "facebook", "fnac", "foxycart", "freestyle", "fullscreen_direct", "geekseller", "goodsie", "google", "google_checkout", "gorgias", "groopdealz", "groupon_goods", "handshake", "hatch", "highwire", "homeroots", "houzz", "idealo_de", "inksoft", "jane", "jet", "kaufland", "labelapi", "lemonstand", "lengow", "liftoff", "linnworks", "listingmirror", "magento", "zoey", "magento_go", "memberly", "mercado_libre", "mijoshop", "best_buy_ca", "catch", "darty", "fanatics", "kohls", "kroger", "urbn", "miva_merchant", "morecommerce", "mozu", "neto", "newegg", "newegg_business", "newegg_ca", "notonthehighstreet", "oauth_dummy", "odbc", "onbuy", "opencart", "order_time", "ordersource_api", "oscommerce", "overstock", "oxatis", "paypal", "paypal_v2", "payvment", "penny", "prestashop", "rakuten", "best_buy", "rakuten-fr", "rate_browser", "redditgifts", "reverb", "revolutionparts", "salesforce_commerce_cloud", "salesforce_core", "sap_anywhere", "scout_topshelf", "sears", "securestore", "sellbrite", "selleractive", "shipengine_api", "shipengine_merchant", "shipstation", "shop_premium_outlets", "shopify", "shoppingfeed", "shopware_de", "simplepart", "skuvault", "soldsie", "sophio", "spark_shipping", "spree", "spreesy", "square", "squarespace", "stitch_labs", "storenvy", "stripe", "suredone", "tanga", "tophatter", "trade_me", "tradegecko", "ultracart", "unbranded_ecommerce_store", "unleashed", "vault", "visualsoft", "volo", "volusion", "vtex", "walmart", "walmart_ca", "wayfair", "webflow", "weebly", "wish", "wix", "woocommerce", "woocommerce_v2", "woot", "x-cart", "yahoo", "sec_yumbles", "zen_cart", "zonos"]);
32428
- /**
32429
- * @category Factories
32430
- */
32431
- const orderSourceRefreshInfoFactory = Factory.define(() => {
32432
- const lastRefreshAttempt = faker.date.recent();
32433
- return {
32434
- lastRefreshAttempt: lastRefreshAttempt.toISOString(),
32435
- refreshDate: faker.date.recent(1, lastRefreshAttempt).toISOString(),
32436
- status: faker.helpers.arrayElement(["idle", "preparing_update", "updating", "error", "unknown"])
32437
- };
32438
- });
32439
- /**
32440
- * @category Factories
32441
- */
32442
- const orderSourceFactory = Factory.define(({
32443
- associations,
32444
- params
32445
- }) => {
32446
- var _a;
32447
- return {
32448
- active: faker.datatype.boolean(),
32449
- orderSourceCode: randomOrderSourceCode(),
32450
- orderSourceFriendlyName: faker.company.name(),
32451
- orderSourceId: faker.datatype.uuid(),
32452
- orderSourceNickname: faker.random.words(),
32453
- refreshInfo: (_a = associations.refreshInfo) !== null && _a !== void 0 ? _a : orderSourceRefreshInfoFactory.build(params.refreshInfo)
32454
- };
32455
- });
32456
-
32457
- /**
32458
- * @category Factories
32459
- */
32460
- const downloadFactory = Factory.define(() => ({
32461
- href: faker.internet.url(),
32462
- pdf: faker.internet.url(),
32463
- png: faker.internet.url(),
32464
- zpl: faker.internet.url()
32465
- }));
32466
- /**
32467
- * @category Factories
32468
- */
32469
- const linkedResourceFactory = Factory.define(() => ({
32470
- href: faker.internet.url(),
32471
- type: faker.word.noun()
32472
- }));
32473
-
32474
- const randomWeightUnit = () => faker.helpers.arrayElement(["pound", "ounce", "gram", "kilogram"]);
32475
- /**
32476
- * @category Factories
32477
- */
32478
- const fractionalWeightFactory = Factory.define(() => ({
32479
- fractional: faker.datatype.number({
32480
- max: 16,
32481
- min: 0
32482
- }),
32483
- whole: faker.datatype.number({
32484
- max: 20,
32485
- min: 0
32486
- })
32487
- }));
32488
- /**
32489
- * @category Factories
32490
- */
32491
- const weightFactory = Factory.define(() => ({
32492
- value: faker.datatype.number({
32493
- max: 20,
32494
- min: 1,
32495
- precision: 0.1
32496
- })
32497
- }));
32498
- /**
32499
- * @category Factories
32500
- */
32501
- const weightWithUnitFactory = Factory.define(({
32502
- params
32503
- }) => {
32504
- const weight = weightFactory.build(params);
32505
- return Object.assign(Object.assign({}, weight), {
32506
- unit: randomWeightUnit()
32507
- });
32508
- });
32509
-
32510
- const randomDeliveryConfirmation = () => faker.helpers.arrayElement(Object.values(SE.ConfirmationType));
32511
- const randomInsuranceProvider = (allowNone = true) => {
32512
- const availableProviders = Object.values(SE.InsuranceProviderType).filter(p => allowNone ? p : p !== "none");
32513
- return faker.helpers.arrayElement(availableProviders);
32514
- };
32515
- /**
32516
- * @category Factories
32517
- */
32518
- const customsItemFactory = Factory.define(({
32519
- associations,
32520
- params,
32521
- transientParams
32522
- }) => ({
32523
- countryOfOrigin: faker.address.countryCode(),
32524
- description: faker.commerce.productName(),
32525
- harmonizedTariffCode: faker.datatype.string(),
32526
- quantity: faker.datatype.number({
32527
- max: 10,
32528
- min: 1
32529
- }),
32530
- sku: faker.random.numeric(10),
32531
- skuDescription: faker.helpers.maybe(faker.lorem.sentence),
32532
- unitOfMeasure: faker.helpers.maybe(faker.word.noun),
32533
- value: associations.value || faker.datatype.number({
32534
- max: 10,
32535
- min: 1
32536
- })
32537
- }));
32538
- /**
32539
- * @category Factories
32540
- */
32541
- const shipmentItemFactory = Factory.define(({
32542
- params
32543
- }) => ({
32544
- asin: faker.helpers.maybe(() => faker.random.alphaNumeric(10)),
32545
- externalOrderId: faker.random.alphaNumeric(10),
32546
- externalOrderItemId: faker.random.alphaNumeric(10),
32547
- name: faker.commerce.productName(),
32548
- orderSourceCode: randomOrderSourceCode(),
32549
- quantity: faker.datatype.number({
32550
- max: 10,
32551
- min: 1
32552
- }),
32553
- salesOrderItemId: params.salesOrderId && faker.random.alphaNumeric(6),
32554
- sku: faker.random.numeric(10)
32555
- }));
32556
- /**
32557
- * @category Factories
32558
- */
32559
- const shipmentPackageFactory = Factory.define(({
32560
- associations,
32561
- params,
32562
- transientParams
32563
- }) => {
32564
- var _a, _b, _c, _d, _e;
32565
- const _f = packageFactory.build(params),
32566
- pkg = __rest(_f, ["name"]);
32567
- const isInsured = tristateValue(true, false, faker.datatype.boolean(), (_b = (_a = params.insuredValue) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : transientParams.isInsured);
32568
- return Object.assign(Object.assign({}, pkg), {
32569
- insuredValue: (_c = associations.insuredValue) !== null && _c !== void 0 ? _c : isInsured ? moneyFactory.build(params.insuredValue) : undefined,
32570
- labelDownload: (_d = associations.labelDownload) !== null && _d !== void 0 ? _d : transientParams.isShipped ? downloadFactory.build(params.labelDownload) : undefined,
32571
- labelMessages: associations.labelMessages,
32572
- trackingNumber: transientParams.isShipped ? faker.random.alphaNumeric(12, {
32573
- casing: "upper"
32574
- }) : undefined,
32575
- weight: (_e = associations.weight) !== null && _e !== void 0 ? _e : weightWithUnitFactory.build(params.weight)
32576
- });
32577
- });
32578
- /**
32579
- * @category Factories
32580
- */
32581
- const shipmentFactory = Factory.define(({
32582
- associations,
32583
- params,
32584
- sequence,
32585
- transientParams
32586
- }) => {
32587
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
32588
- const shipTo = (_a = associations.shipTo) !== null && _a !== void 0 ? _a : addressFactory.build(params.shipTo, {
32589
- transient: {
32590
- isInternational: transientParams.isInternational
32591
- }
32592
- });
32593
- let insuranceProvider = SE.InsuranceProviderType.NONE;
32594
- if (transientParams.insuredValue || transientParams.isInsured) {
32595
- insuranceProvider = (_b = params.insuranceProvider) !== null && _b !== void 0 ? _b : randomInsuranceProvider(false);
32596
- } else if (transientParams.insuredValue === undefined && transientParams.isInsured === undefined) {
32597
- insuranceProvider = randomInsuranceProvider(true);
32598
- }
32599
- const shipDateObj = faker.date.soon(7);
32600
- shipDateObj.setHours(0, 0, 0, 0);
32601
- const totalWeight = (_c = associations.totalWeight) !== null && _c !== void 0 ? _c : weightWithUnitFactory.build(params.totalWeight);
32602
- return {
32603
- addressValidation: (_d = associations.addressValidation) !== null && _d !== void 0 ? _d : addressValidationFactory.build(params.addressValidation, {
32604
- associations: {
32605
- originalAddress: shipTo
32606
- }
32607
- }),
32608
- carrierId: (_f = (_e = transientParams === null || transientParams === void 0 ? void 0 : transientParams.service) === null || _e === void 0 ? void 0 : _e.carrierId) !== null && _f !== void 0 ? _f : randomShipengineId(),
32609
- confirmation: randomDeliveryConfirmation(),
32610
- createdAt: faker.date.past().toISOString(),
32611
- customs: (_g = associations.customs) !== null && _g !== void 0 ? _g : transientParams.isInternational ? {
32612
- contents: faker.helpers.arrayElement(["documents", "gift", "merchandise", "returned_goods", "sample"]),
32613
- customsItems: customsItemFactory.buildList(faker.datatype.number({
32614
- max: 10,
32615
- min: 1
32616
- })),
32617
- nonDelivery: faker.helpers.arrayElement(["return_to_sender", "treat_as_abandoned"])
32618
- } : undefined,
32619
- externalOrderId: faker.random.alphaNumeric(10),
32620
- externalShipmentId: faker.random.alphaNumeric(10),
32621
- insuranceProvider,
32622
- items: shipmentItemFactory.buildList(faker.datatype.number({
32623
- max: 10,
32624
- min: 1
32625
- }), transientParams.salesOrder ? {
32626
- externalOrderId: transientParams.salesOrder.externalOrderId,
32627
- orderSourceCode: transientParams.salesOrder.orderSource.orderSourceCode,
32628
- salesOrderId: (_h = transientParams.salesOrder) === null || _h === void 0 ? void 0 : _h.salesOrderId
32629
- } : {}),
32630
- modifiedAt: faker.date.recent().toISOString(),
32631
- orderSourceCode: (_k = (_j = transientParams.salesOrder) === null || _j === void 0 ? void 0 : _j.orderSource.orderSourceCode) !== null && _k !== void 0 ? _k : randomOrderSourceCode(),
32632
- packages: (_l = associations.packages) !== null && _l !== void 0 ? _l : shipmentPackageFactory.buildList(1, (_m = params.packages) === null || _m === void 0 ? void 0 : _m[0], {
32633
- associations: {
32634
- weight: totalWeight
32635
- },
32636
- transient: {
32637
- isInsured: insuranceProvider !== "none",
32638
- isShipped: transientParams.isShipped
32639
- }
32640
- }),
32641
- returnTo: (_q = (_o = associations.returnTo) !== null && _o !== void 0 ? _o : (_p = transientParams.warehouse) === null || _p === void 0 ? void 0 : _p.returnAddress) !== null && _q !== void 0 ? _q : addressFactory.build(),
32642
- serviceCode: (_s = (_r = transientParams.service) === null || _r === void 0 ? void 0 : _r.serviceCode) !== null && _s !== void 0 ? _s : randomShipengineSlug(),
32643
- shipDate: shipDateObj.toISOString(),
32644
- shipFrom: (_v = (_t = associations.shipFrom) !== null && _t !== void 0 ? _t : (_u = transientParams.warehouse) === null || _u === void 0 ? void 0 : _u.originAddress) !== null && _v !== void 0 ? _v : addressFactory.build(),
32645
- shipmentId: `se-${30000 + sequence}`,
32646
- shipmentStatus: transientParams.isShipped ? "label_purchased" : "pending",
32647
- shipTo,
32648
- tags: (_w = associations.tags) !== null && _w !== void 0 ? _w : [],
32649
- totalWeight,
32650
- warehouseId: (_x = transientParams.warehouse) === null || _x === void 0 ? void 0 : _x.warehouseId
32651
- };
32652
- });
32653
- /**
32654
- * @category Factories
32655
- */
32656
- const salesOrderShipmentFactory = Factory.define(({
32657
- associations,
32658
- params,
32659
- transientParams
32660
- }) => {
32661
- var _a, _b, _c;
32662
- const shipment = shipmentFactory.build(params, {
32663
- associations,
32664
- transient: transientParams
32665
- });
32666
- return Object.assign(Object.assign({}, shipment), {
32667
- salesOrderIds: (_a = associations.salesOrderIds) !== null && _a !== void 0 ? _a : [(_c = (_b = transientParams.salesOrder) === null || _b === void 0 ? void 0 : _b.salesOrderId) !== null && _c !== void 0 ? _c : faker.datatype.uuid()]
32668
- });
32669
- });
32670
-
32671
- /**
32672
- * @category Factories
32673
- */
32674
- const labelFactory = Factory.define(({
32675
- params,
32676
- sequence,
32677
- transientParams
32678
- }) => {
32679
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
32680
- const shipTo = Object.assign(Object.assign({}, addressFactory.build((_a = transientParams.shipment) === null || _a === void 0 ? void 0 : _a.shipTo)), {
32681
- companyName: (_c = (_b = transientParams.shipment) === null || _b === void 0 ? void 0 : _b.shipTo.companyName) !== null && _c !== void 0 ? _c : faker.lorem.word(),
32682
- relayPointId: faker.random.numeric(10)
32683
- });
32684
- const shipFrom = Object.assign(Object.assign({}, addressFactory.build(((_d = transientParams.shipment) === null || _d === void 0 ? void 0 : _d.shipFrom) || undefined)), {
32685
- companyName: (_f = (_e = transientParams.shipment) === null || _e === void 0 ? void 0 : _e.shipTo.companyName) !== null && _f !== void 0 ? _f : faker.lorem.word(),
32686
- relayPointId: faker.random.numeric(10)
32687
- });
32688
- const shipDateObj = faker.date.soon(7);
32689
- shipDateObj.setHours(0, 0, 0, 0);
32690
- return {
32691
- batchId: faker.random.numeric(10),
32692
- carrierCode: (_h = (_g = transientParams.carrier) === null || _g === void 0 ? void 0 : _g.carrierCode) !== null && _h !== void 0 ? _h : randomShipengineSlug(),
32693
- carrierId: (_k = (_j = transientParams.shipment) === null || _j === void 0 ? void 0 : _j.carrierId) !== null && _k !== void 0 ? _k : `se-${10000 + sequence}`,
32694
- chargeEvent: "on_creation",
32695
- createdAt: faker.date.past().toISOString(),
32696
- displayScheme: "label",
32697
- formDownload: {
32698
- href: faker.internet.url(),
32699
- type: ""
32700
- },
32701
- insuranceClaim: {
32702
- href: faker.internet.url(),
32703
- type: ""
32704
- },
32705
- insuranceCost: moneyFactory.build(),
32706
- isInternational: shipTo.countryCode !== "US",
32707
- isReturnLabel: false,
32708
- labelDownload: {
32709
- href: faker.image.imageUrl(),
32710
- pdf: faker.image.imageUrl(),
32711
- png: faker.image.imageUrl(),
32712
- zpl: faker.image.imageUrl()
32713
- },
32714
- labelFormat: "pdf",
32715
- labelId: `se-${40000 + sequence}`,
32716
- labelImageId: faker.random.numeric(10),
32717
- labelLayout: "4x6",
32718
- modifiedAt: faker.date.recent().toISOString(),
32719
- packageCode: (_m = (_l = transientParams.shipment) === null || _l === void 0 ? void 0 : _l.packages[0].packageCode) !== null && _m !== void 0 ? _m : randomShipengineSlug(2),
32720
- packages: (_p = (_o = transientParams.shipment) === null || _o === void 0 ? void 0 : _o.packages) !== null && _p !== void 0 ? _p : shipmentPackageFactory.buildList(1),
32721
- relayPoints: {
32722
- shipFrom,
32723
- shipTo
32724
- },
32725
- rmaNumber: faker.random.alpha(10),
32726
- serviceCode: (_r = (_q = transientParams.shipment) === null || _q === void 0 ? void 0 : _q.serviceCode) !== null && _r !== void 0 ? _r : randomShipengineSlug(),
32727
- shipDate: (_t = (_s = transientParams.shipment) === null || _s === void 0 ? void 0 : _s.shipDate) !== null && _t !== void 0 ? _t : shipDateObj.toISOString(),
32728
- shipmentCost: moneyFactory.build(),
32729
- shipmentId: (_v = (_u = transientParams.shipment) === null || _u === void 0 ? void 0 : _u.shipmentId) !== null && _v !== void 0 ? _v : `se-${30000 + sequence}`,
32730
- status: (_w = params.status) !== null && _w !== void 0 ? _w : "processing",
32731
- trackable: !!((_x = transientParams.shipment) === null || _x === void 0 ? void 0 : _x.packages[0].trackingNumber),
32732
- trackingNumber: (_z = (_y = transientParams.shipment) === null || _y === void 0 ? void 0 : _y.packages[0].trackingNumber) !== null && _z !== void 0 ? _z : faker.random.alpha(10),
32733
- trackingStatus: "in_transit",
32734
- voided: ((_0 = transientParams.shipment) === null || _0 === void 0 ? void 0 : _0.shipmentStatus) === "cancelled",
32735
- voidedAt: (_2 = (_1 = transientParams.shipment) === null || _1 === void 0 ? void 0 : _1.modifiedAt) !== null && _2 !== void 0 ? _2 : faker.date.past().toISOString()
32736
- };
32737
- });
32738
-
32739
- const randomPaymentStatus = () => faker.helpers.arrayElement(["unknown", "paid", "unpaid", "partially_paid"]);
32740
- const randomFulfillmentStatus = () => faker.helpers.arrayElement(["unknown", "fulfilled", "unfulfilled", "partially_fulfilled", "on_hold"]);
32741
- /**
32742
- * @category Factories
32743
- */
32744
- const salesOrderItemFactory = Factory.define(({
32745
- associations,
32746
- params,
32747
- transientParams
32748
- }) => {
32749
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
32750
- const quantity = faker.datatype.number({
32751
- max: 5,
32752
- min: 1
32753
- });
32754
- let {
32755
- priceSummary
32756
- } = associations;
32757
- if (!priceSummary) {
32758
- const unitPrice = moneyFactory.build((_a = params.priceSummary) === null || _a === void 0 ? void 0 : _a.unitPrice, {
32759
- transient: transientParams
32760
- });
32761
- const estimatedShipping = ((_b = params.priceSummary) === null || _b === void 0 ? void 0 : _b.estimatedShipping) ? moneyFactory.build(Object.assign({
32762
- currency: unitPrice.currency
32763
- }, (_c = params.priceSummary) === null || _c === void 0 ? void 0 : _c.estimatedShipping)) : undefined;
32764
- const estimatedTax = moneyFactory.build({
32765
- amount: (_f = (_e = (_d = params.priceSummary) === null || _d === void 0 ? void 0 : _d.estimatedTax) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : unitPrice.amount * quantity * 0.1,
32766
- currency: (_j = (_h = (_g = params.priceSummary) === null || _g === void 0 ? void 0 : _g.estimatedTax) === null || _h === void 0 ? void 0 : _h.currency) !== null && _j !== void 0 ? _j : unitPrice.currency
32767
- });
32768
- const total = moneyFactory.build({
32769
- amount: (_m = (_l = (_k = params.priceSummary) === null || _k === void 0 ? void 0 : _k.total) === null || _l === void 0 ? void 0 : _l.amount) !== null && _m !== void 0 ? _m : unitPrice.amount * quantity + ((_o = estimatedShipping === null || estimatedShipping === void 0 ? void 0 : estimatedShipping.amount) !== null && _o !== void 0 ? _o : 0) + estimatedTax.amount,
32770
- currency: (_r = (_q = (_p = params.priceSummary) === null || _p === void 0 ? void 0 : _p.total) === null || _q === void 0 ? void 0 : _q.currency) !== null && _r !== void 0 ? _r : unitPrice.currency
32771
- });
32772
- priceSummary = {
32773
- estimatedShipping,
32774
- estimatedTax,
32775
- total,
32776
- unitPrice
32777
- };
32778
- }
32779
- return {
32780
- isGift: faker.datatype.boolean(),
32781
- lineItemDetails: (_s = associations.lineItemDetails) !== null && _s !== void 0 ? _s : {
32782
- asin: (_u = (_t = params.lineItemDetails) === null || _t === void 0 ? void 0 : _t.asin) !== null && _u !== void 0 ? _u : faker.random.alphaNumeric(10),
32783
- name: (_w = (_v = params.lineItemDetails) === null || _v === void 0 ? void 0 : _v.name) !== null && _w !== void 0 ? _w : faker.commerce.productName(),
32784
- sku: (_y = (_x = params.lineItemDetails) === null || _x === void 0 ? void 0 : _x.sku) !== null && _y !== void 0 ? _y : faker.random.numeric(10),
32785
- weight: weightWithUnitFactory.build((_z = params.lineItemDetails) === null || _z === void 0 ? void 0 : _z.weight)
32786
- },
32787
- priceSummary,
32788
- quantity,
32789
- requestedShippingOptions: (_0 = associations.requestedShippingOptions) !== null && _0 !== void 0 ? _0 : {
32790
- shipDate: (_1 = faker.helpers.maybe(() => faker.date.soon(7).toISOString())) !== null && _1 !== void 0 ? _1 : null,
32791
- shippingService: faker.word.adjective()
32792
- },
32793
- salesOrderItemId: faker.datatype.uuid(),
32794
- shipTo: (_2 = associations.shipTo) !== null && _2 !== void 0 ? _2 : addressFactory.build(params.shipTo)
32795
- };
32796
- });
32797
- /**
32798
- * @category Factories
32799
- */
32800
- const salesOrderFactory = Factory.define(({
32801
- associations,
32802
- params,
32803
- sequence,
32804
- transientParams
32805
- }) => {
32806
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
32807
- const createdAt = (_a = params.createdAt) !== null && _a !== void 0 ? _a : faker.date.recent(30).toISOString();
32808
- let {
32809
- paymentDetails
32810
- } = associations;
32811
- if (!paymentDetails) {
32812
- const subtotal = moneyFactory.build((_b = params.paymentDetails) === null || _b === void 0 ? void 0 : _b.subtotal, {
32813
- transient: transientParams
32814
- });
32815
- const estimatedShipping = moneyFactory.build(Object.assign({
32816
- currency: subtotal.currency
32817
- }, (_c = params.paymentDetails) === null || _c === void 0 ? void 0 : _c.estimatedShipping));
32818
- const estimatedTax = moneyFactory.build({
32819
- amount: (_f = (_e = (_d = params.paymentDetails) === null || _d === void 0 ? void 0 : _d.estimatedTax) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : subtotal.amount * 0.1,
32820
- currency: (_j = (_h = (_g = params.paymentDetails) === null || _g === void 0 ? void 0 : _g.estimatedTax) === null || _h === void 0 ? void 0 : _h.currency) !== null && _j !== void 0 ? _j : subtotal.currency
32821
- });
32822
- const grandTotal = moneyFactory.build({
32823
- amount: (_m = (_l = (_k = params.paymentDetails) === null || _k === void 0 ? void 0 : _k.grandTotal) === null || _l === void 0 ? void 0 : _l.amount) !== null && _m !== void 0 ? _m : subtotal.amount + estimatedShipping.amount + estimatedTax.amount,
32824
- currency: (_q = (_p = (_o = params.paymentDetails) === null || _o === void 0 ? void 0 : _o.grandTotal) === null || _p === void 0 ? void 0 : _p.currency) !== null && _q !== void 0 ? _q : subtotal.currency
32825
- });
32826
- paymentDetails = {
32827
- estimatedShipping,
32828
- estimatedTax,
32829
- grandTotal,
32830
- subtotal
32831
- };
32832
- }
32833
- const shipTo = (_r = associations.shipTo) !== null && _r !== void 0 ? _r : addressFactory.build(params.shipTo || {});
32834
- return {
32835
- billTo: (_s = associations.billTo) !== null && _s !== void 0 ? _s : {
32836
- address: addressFactory.build((_t = params.billTo) === null || _t === void 0 ? void 0 : _t.address),
32837
- email: faker.internet.email()
32838
- },
32839
- createdAt,
32840
- customer: (_u = associations.customer) !== null && _u !== void 0 ? _u : {
32841
- email: faker.internet.email(),
32842
- name: faker.name.fullName(),
32843
- phone: faker.phone.number()
32844
- },
32845
- externalOrderId: faker.random.numeric(9),
32846
- externalOrderNumber: faker.random.numeric(9),
32847
- modifiedAt: createdAt,
32848
- // TODO: What is this? Is it supposed to be in the future?
32849
- orderDate: createdAt,
32850
- orderSource: (_v = associations.orderSource) !== null && _v !== void 0 ? _v : orderSourceFactory.build(params.orderSource),
32851
- paymentDetails,
32852
- salesOrderId: `se-${20000 + sequence}`,
32853
- salesOrderItems: salesOrderItemFactory.buildList(2, {}, {
32854
- associations: {
32855
- shipTo
32856
- },
32857
- transient: transientParams
32858
- }),
32859
- salesOrderStatus: (_w = associations.salesOrderStatus) !== null && _w !== void 0 ? _w : {
32860
- fulfillmentStatus: randomFulfillmentStatus(),
32861
- isCancelled: false,
32862
- paymentStatus: randomPaymentStatus()
32863
- },
32864
- shipTo
32865
- };
32866
- });
32867
-
32868
- /**
32869
- * @category Factories
32870
- */
32871
- const warehouseFactory = Factory.define(({
32872
- associations,
32873
- params
32874
- }) => {
32875
- var _a, _b, _c;
32876
- return {
32877
- createdAt: faker.date.past().toISOString(),
32878
- isDefault: (_a = params.isDefault) !== null && _a !== void 0 ? _a : false,
32879
- name: faker.company.name(),
32880
- originAddress: (_b = associations.originAddress) !== null && _b !== void 0 ? _b : addressFactory.build(params.originAddress),
32881
- returnAddress: (_c = associations.returnAddress) !== null && _c !== void 0 ? _c : addressFactory.build(params.returnAddress),
32882
- warehouseId: randomShipengineId()
32883
- };
32884
- });
32885
-
32886
- const renderWithProviders = component => {
32887
- const theme = createTheme(BrandName.FALLBACK);
32888
- return render(component, {
32889
- wrapper: ({
32890
- children
32891
- }) => jsx(RootPortalProvider, {
32892
- children: jsx(GigerConfigProvider, Object.assign({
32893
- resolveIcon: name => `<svg>${name}</svg>`
32894
- }, {
32895
- children: jsx(ThemeProvider, Object.assign({
32896
- theme: deserialize(theme)
32897
- }, {
32898
- children: children
32899
- }))
32900
- }))
32901
- })
32902
- });
32903
- };
32904
- /**
32905
- * Wraps the test with all of the usual Shipengine / Giger / i18 / etc providers that a full, registered "Element" would have.
32906
- * This allows components to simulate usage in an Element via `decorators: [withAllProviders]`
32907
- **/
32908
- const renderWithAllProviders = component => {
32909
- const theme = createTheme(BrandName.FALLBACK);
32910
- return render(component, {
32911
- wrapper: ({
32912
- children
32913
- }) => jsx(ShipEngineProvider, Object.assign({
32914
- baseURL: "/api",
32915
- getToken: () => {
32916
- var _a;
32917
- return (_a = process.env.STORYBOOK_TOKEN) !== null && _a !== void 0 ? _a : "none";
32918
- }
32919
- }, {
32920
- children: jsx(RootPortalProvider, {
32921
- children: jsx(GigerConfigProvider, Object.assign({
32922
- resolveIcon: name => `<svg>${name}</svg>`
32923
- }, {
32924
- children: jsx(ThemeProvider, Object.assign({
32925
- theme: deserialize(theme)
32926
- }, {
32927
- children: children
32928
- }))
32929
- }))
32930
- })
32931
- }))
32932
- });
32933
- };
32934
-
32935
- export { Accordion, AddFundsForm, AutoFundingForm, ButtonGroup, CarrierBalance, Country, Cube, ElementsContext, ElementsProvider, ErrorBoundary, ErrorFallback, fields as Field, FieldLabel, FormPortal, FundAndPurchase, GigerProvider, InlineLabel, ItemsBreakdown, LinkAction, Element$5 as ListCarriers, Loader, ManageFunding, Element$4 as ManageWarehouses, Element$2 as Onboarding, PageLayoutProvider, Portal, Element$3 as PurchaseLabel, RootPortalProvider, Spacer, Spread, StoryNotes, index$1 as Templates, UsState, UsaCity, Element$1 as ViewShipment, Element as VoidLabel, addressFactory, addressPreferenceFactory, addressValidationFactory, autoFundingSchema, calculateTotal, capitalizeFirstLetter, carrierFactory, carrierOptionFactory, convertDimensions, convertWeight, countries, countryCodes, createCodedErrors, createDictionary, createStyles, currencySymbol, customsItemFactory, daysAfter, downloadFactory, errorMap, euCountryCodes, extendZod, formLogger, formatCreditCardNumber, formatDate, formatExpiration, formatFractionalWeight, formatMoney, fractionalWeightFactory, getAddFundsSchema, getCustomsFromSalesOrder, getExpirationYears, getIsCustomsRequiredForSalesOrder, getIsCustomsRequiredForShipment, getIsInternationalShipment, getPendingShipment, getRateRequiresAcknowledgement, getRequestedServices, getSalesOrderItemsFromSalesOrderOrShipment, getTotalRateAmount, isDomesticAddress, isFlatRatePackageCode, isMilitaryAddress, isNowOrInTheFuture, isPoBox, isPoBoxAddress, isString, isUnitedStatesTerritory, isUspsCarrier, labelFactory, linkedResourceFactory, moneyFactory, moneySchema, mostRecent, nextDayCutoff, omitTime, orderSourceFactory, orderSourceRefreshInfoFactory, packageFactory, phoneSchema, phoneSchemaUnvalidated, postalCodeRegex$3 as postalCodeRegex, randomDeliveryConfirmation, randomFulfillmentStatus, randomInsuranceProvider, randomOrderSourceCode, randomPaymentStatus, randomShipengineId, randomShipengineSlug, randomWeightUnit, registerElement, renderWithAllProviders, renderWithProviders, salesOrderFactory, salesOrderItemFactory, salesOrderShipmentFactory, serviceFactory, shipmentFactory, shipmentItemFactory, shipmentPackageFactory, sortByCreationDate, tristateValue, usCities, usStateCodes, usStates, useCarrierMetadata, useConfirmationOptions, useCountryCodeOptions, useCustomsContentsOptions, useCustomsNonDeliveryOptions, useElements, useExpirationMonthOptions, useInsuranceProviderOptions, useNestedForm, usePackageOptions, usePageLayout, useRateOptions, useRootPortal, useRunOnceOnTrue, useServiceCodeOptions, useShippingPresetsOptions, useStateCodeOptions, useToggle, useWarehouseOptions, validationResolver, warehouseFactory, weightFactory, weightWithUnitFactory };
32762
+ export { Accordion, AddFundsForm, AutoFundingForm, ButtonGroup, CarrierBalance, Country, Cube, ElementsContext, ElementsProvider, ErrorBoundary, ErrorFallback, fields as Field, FieldLabel, FormPortal, FundAndPurchase, GigerProvider, InlineLabel, ItemsBreakdown, LinkAction, Element$6 as ListCarriers, Loader, ManageFunding, Element$5 as ManageWarehouses, Element$3 as Onboarding, PageLayoutProvider, Portal, Element$4 as PurchaseLabel, RootPortalProvider, Spacer, Spread, StoryNotes, index$1 as Templates, UsState, UsaCity, Element$1 as ViewShipment, Element as VoidLabel, Element$2 as WalletHistory, autoFundingSchema, calculateTotal, capitalizeFirstLetter, convertDimensions, convertWeight, countries, countryCodes, createCodedErrors, createDictionary, createStyles, currencySymbol, daysAfter, errorMap, euCountryCodes, extendZod, formLogger, formatCreditCardNumber, formatDate, formatExpiration, formatFractionalWeight, formatMoney, getAddFundsSchema, getCustomsFromSalesOrder, getExpirationYears, getIsCustomsRequiredForSalesOrder, getIsCustomsRequiredForShipment, getIsInternationalShipment, getPendingShipment, getRateRequiresAcknowledgement, getRequestedServices, getSalesOrderItemsFromSalesOrderOrShipment, getTotalRateAmount, isDomesticAddress, isFlatRatePackageCode, isMilitaryAddress, isNowOrInTheFuture, isPoBox, isPoBoxAddress, isString, isUnitedStatesTerritory, isUspsCarrier, moneySchema, mostRecent, nextDayCutoff, omitTime, phoneSchema, phoneSchemaUnvalidated, postalCodeRegex$3 as postalCodeRegex, registerElement, sortByCreationDate, usCities, usStateCodes, usStates, useCarrierMetadata, useConfirmationOptions, useCountryCodeOptions, useCustomsContentsOptions, useCustomsNonDeliveryOptions, useElements, useExpirationMonthOptions, useInsuranceProviderOptions, useNestedForm, usePackageOptions, usePageLayout, useRateOptions, useRootPortal, useRunOnceOnTrue, useServiceCodeOptions, useShippingPresetsOptions, useStateCodeOptions, useToggle, useWarehouseOptions, useWarehouseValidation, validationResolver };