@shipengine/alchemy 4.0.0 → 4.1.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.
package/index.js CHANGED
@@ -4,10 +4,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
4
4
 
5
5
  const React = require('react');
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
- const react = require('@emotion/react');
8
7
  const giger = require('@packlink/giger');
9
8
  const gigerTheme = require('@packlink/giger-theme');
10
9
  const reactQuery = require('@tanstack/react-query');
10
+ const react = require('@emotion/react');
11
11
  const reactI18next = require('react-i18next');
12
12
  const i18n = require('i18next');
13
13
 
@@ -2462,13 +2462,6 @@ function jsx(type, props, key) {
2462
2462
 
2463
2463
  return jsxRuntime.jsx(Emotion, createEmotionProps(type, props), key);
2464
2464
  }
2465
- function jsxs(type, props, key) {
2466
- if (!hasOwnProperty.call(props, 'css')) {
2467
- return jsxRuntime.jsxs(type, props, key);
2468
- }
2469
-
2470
- return jsxRuntime.jsxs(Emotion, createEmotionProps(type, props), key);
2471
- }
2472
2465
 
2473
2466
  var dist = {};
2474
2467
 
@@ -2476,17 +2469,17 @@ Object.defineProperty(dist, "__esModule", { value: true });
2476
2469
  var _default = dist.default = (function () {
2477
2470
  });
2478
2471
 
2479
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
2480
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
2481
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
2472
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
2473
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
2474
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
2482
2475
  var __objRest$8 = (source, exclude) => {
2483
2476
  var target = {};
2484
2477
  for (var prop in source)
2485
- if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
2478
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
2486
2479
  target[prop] = source[prop];
2487
- if (source != null && __getOwnPropSymbols$c)
2488
- for (var prop of __getOwnPropSymbols$c(source)) {
2489
- if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
2480
+ if (source != null && __getOwnPropSymbols$d)
2481
+ for (var prop of __getOwnPropSymbols$d(source)) {
2482
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
2490
2483
  target[prop] = source[prop];
2491
2484
  }
2492
2485
  return target;
@@ -5254,7 +5247,7 @@ var ipaddr = {
5254
5247
  }).call(commonjsGlobal);
5255
5248
  } (ipaddr));
5256
5249
 
5257
- var __async$w = (__this, __arguments, generator) => {
5250
+ var __async$v = (__this, __arguments, generator) => {
5258
5251
  return new Promise((resolve, reject) => {
5259
5252
  var fulfilled = (value) => {
5260
5253
  try {
@@ -5274,7 +5267,7 @@ var __async$w = (__this, __arguments, generator) => {
5274
5267
  step((generator = generator.apply(__this, __arguments)).next());
5275
5268
  });
5276
5269
  };
5277
- const getEndUserIpAddress = () => __async$w(void 0, null, function* () {
5270
+ const getEndUserIpAddress = () => __async$v(void 0, null, function* () {
5278
5271
  try {
5279
5272
  const response = yield axios.get("https://api.ipify.org/?format=json");
5280
5273
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -5286,21 +5279,21 @@ const getEndUserIpAddress = () => __async$w(void 0, null, function* () {
5286
5279
  }
5287
5280
  });
5288
5281
 
5289
- var __defProp$5 = Object.defineProperty;
5282
+ var __defProp$6 = Object.defineProperty;
5290
5283
  var __defProps$3 = Object.defineProperties;
5291
5284
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
5292
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
5293
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
5294
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
5295
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5296
- var __spreadValues$5 = (a, b) => {
5285
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
5286
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
5287
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
5288
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5289
+ var __spreadValues$6 = (a, b) => {
5297
5290
  for (var prop in b || (b = {}))
5298
- if (__hasOwnProp$b.call(b, prop))
5299
- __defNormalProp$5(a, prop, b[prop]);
5300
- if (__getOwnPropSymbols$b)
5301
- for (var prop of __getOwnPropSymbols$b(b)) {
5302
- if (__propIsEnum$b.call(b, prop))
5303
- __defNormalProp$5(a, prop, b[prop]);
5291
+ if (__hasOwnProp$c.call(b, prop))
5292
+ __defNormalProp$6(a, prop, b[prop]);
5293
+ if (__getOwnPropSymbols$c)
5294
+ for (var prop of __getOwnPropSymbols$c(b)) {
5295
+ if (__propIsEnum$c.call(b, prop))
5296
+ __defNormalProp$6(a, prop, b[prop]);
5304
5297
  }
5305
5298
  return a;
5306
5299
  };
@@ -5308,16 +5301,16 @@ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
5308
5301
  var __objRest$7 = (source, exclude) => {
5309
5302
  var target = {};
5310
5303
  for (var prop in source)
5311
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
5304
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
5312
5305
  target[prop] = source[prop];
5313
- if (source != null && __getOwnPropSymbols$b)
5314
- for (var prop of __getOwnPropSymbols$b(source)) {
5315
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
5306
+ if (source != null && __getOwnPropSymbols$c)
5307
+ for (var prop of __getOwnPropSymbols$c(source)) {
5308
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
5316
5309
  target[prop] = source[prop];
5317
5310
  }
5318
5311
  return target;
5319
5312
  };
5320
- var __async$v = (__this, __arguments, generator) => {
5313
+ var __async$u = (__this, __arguments, generator) => {
5321
5314
  return new Promise((resolve, reject) => {
5322
5315
  var fulfilled = (value) => {
5323
5316
  try {
@@ -5355,12 +5348,12 @@ class CarriersAPI {
5355
5348
  /**
5356
5349
  * The `connect` method connects a carrier account to a user's ShipEngine account.
5357
5350
  */
5358
- this.connect = (_a) => __async$v(this, null, function* () {
5351
+ this.connect = (_a) => __async$u(this, null, function* () {
5359
5352
  var _b = _a, { carrierCode } = _b, connection = __objRest$7(_b, ["carrierCode"]);
5360
5353
  const endUserIpAddress = yield getEndUserIpAddress();
5361
5354
  if (!endUserIpAddress)
5362
5355
  return Promise.reject([new CodedError("Unable to get IP address")]);
5363
- return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$5({}, connection), {
5356
+ return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$6({}, connection), {
5364
5357
  endUserIpAddress
5365
5358
  }));
5366
5359
  });
@@ -7642,23 +7635,23 @@ class CustomPackagesAPI {
7642
7635
  }
7643
7636
  }
7644
7637
 
7645
- var __defProp$4 = Object.defineProperty;
7646
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
7647
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
7648
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
7649
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7650
- var __spreadValues$4 = (a, b) => {
7638
+ var __defProp$5 = Object.defineProperty;
7639
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
7640
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
7641
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
7642
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7643
+ var __spreadValues$5 = (a, b) => {
7651
7644
  for (var prop in b || (b = {}))
7652
- if (__hasOwnProp$a.call(b, prop))
7653
- __defNormalProp$4(a, prop, b[prop]);
7654
- if (__getOwnPropSymbols$a)
7655
- for (var prop of __getOwnPropSymbols$a(b)) {
7656
- if (__propIsEnum$a.call(b, prop))
7657
- __defNormalProp$4(a, prop, b[prop]);
7645
+ if (__hasOwnProp$b.call(b, prop))
7646
+ __defNormalProp$5(a, prop, b[prop]);
7647
+ if (__getOwnPropSymbols$b)
7648
+ for (var prop of __getOwnPropSymbols$b(b)) {
7649
+ if (__propIsEnum$b.call(b, prop))
7650
+ __defNormalProp$5(a, prop, b[prop]);
7658
7651
  }
7659
7652
  return a;
7660
7653
  };
7661
- var __async$u = (__this, __arguments, generator) => {
7654
+ var __async$t = (__this, __arguments, generator) => {
7662
7655
  return new Promise((resolve, reject) => {
7663
7656
  var fulfilled = (value) => {
7664
7657
  try {
@@ -7697,11 +7690,11 @@ class FundingSourcesAPI {
7697
7690
  * The `create` method creates a new funding source for a given user. This requires
7698
7691
  * payment information to be collected from the user.
7699
7692
  */
7700
- this.create = (createFundingSource) => __async$u(this, null, function* () {
7693
+ this.create = (createFundingSource) => __async$t(this, null, function* () {
7701
7694
  const endUserIpAddress = yield getEndUserIpAddress();
7702
7695
  if (!endUserIpAddress)
7703
7696
  return Promise.reject([new CodedError("Unable to get IP address")]);
7704
- return yield this.client.post("/v1/funding_sources", __spreadValues$4({
7697
+ return yield this.client.post("/v1/funding_sources", __spreadValues$5({
7705
7698
  endUserIpAddress
7706
7699
  }, createFundingSource));
7707
7700
  });
@@ -7710,7 +7703,7 @@ class FundingSourcesAPI {
7710
7703
  * user to update the billing address or payment information associated with the
7711
7704
  * funding source.
7712
7705
  */
7713
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$u(this, null, function* () {
7706
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$t(this, null, function* () {
7714
7707
  const endUserIpAddress = yield getEndUserIpAddress();
7715
7708
  if (!endUserIpAddress)
7716
7709
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -7727,18 +7720,18 @@ class FundingSourcesAPI {
7727
7720
  * The `registerCarrier` method registers a carrier account and associates
7728
7721
  * it with a given funding source.
7729
7722
  */
7730
- this.registerCarrier = (carrier) => __async$u(this, null, function* () {
7723
+ this.registerCarrier = (carrier) => __async$t(this, null, function* () {
7731
7724
  const endUserIpAddress = yield getEndUserIpAddress();
7732
7725
  if (!endUserIpAddress)
7733
7726
  return Promise.reject([new CodedError("Unable to get IP address")]);
7734
- return yield this.client.post("/v1/registration/funding_source", __spreadValues$4({
7727
+ return yield this.client.post("/v1/registration/funding_source", __spreadValues$5({
7735
7728
  endUserIpAddress
7736
7729
  }, carrier));
7737
7730
  });
7738
7731
  /**
7739
7732
  * The `addFunds` method allows you to add funds to a funding source.
7740
7733
  */
7741
- this.addFunds = (amount, fundingSourceId) => __async$u(this, null, function* () {
7734
+ this.addFunds = (amount, fundingSourceId) => __async$t(this, null, function* () {
7742
7735
  return yield this.client.put(
7743
7736
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
7744
7737
  amount
@@ -7972,7 +7965,7 @@ class SalesOrdersAPI {
7972
7965
  }
7973
7966
  }
7974
7967
 
7975
- var __async$t = (__this, __arguments, generator) => {
7968
+ var __async$s = (__this, __arguments, generator) => {
7976
7969
  return new Promise((resolve, reject) => {
7977
7970
  var fulfilled = (value) => {
7978
7971
  try {
@@ -8015,7 +8008,7 @@ class ShipmentsAPI {
8015
8008
  * The `create` method allows for creating shipments based on a list of shipment
8016
8009
  * items passed into this method.
8017
8010
  */
8018
- this.create = (...shipments) => __async$t(this, null, function* () {
8011
+ this.create = (...shipments) => __async$s(this, null, function* () {
8019
8012
  return this.client.post("/v1/shipments", {
8020
8013
  shipments
8021
8014
  });
@@ -8059,26 +8052,26 @@ class WarehousesAPI {
8059
8052
  }
8060
8053
  }
8061
8054
 
8062
- var __defProp$3 = Object.defineProperty;
8055
+ var __defProp$4 = Object.defineProperty;
8063
8056
  var __defProps$2 = Object.defineProperties;
8064
8057
  var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
8065
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
8066
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
8067
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
8068
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8069
- var __spreadValues$3 = (a, b) => {
8058
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
8059
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
8060
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
8061
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8062
+ var __spreadValues$4 = (a, b) => {
8070
8063
  for (var prop in b || (b = {}))
8071
- if (__hasOwnProp$9.call(b, prop))
8072
- __defNormalProp$3(a, prop, b[prop]);
8073
- if (__getOwnPropSymbols$9)
8074
- for (var prop of __getOwnPropSymbols$9(b)) {
8075
- if (__propIsEnum$9.call(b, prop))
8076
- __defNormalProp$3(a, prop, b[prop]);
8064
+ if (__hasOwnProp$a.call(b, prop))
8065
+ __defNormalProp$4(a, prop, b[prop]);
8066
+ if (__getOwnPropSymbols$a)
8067
+ for (var prop of __getOwnPropSymbols$a(b)) {
8068
+ if (__propIsEnum$a.call(b, prop))
8069
+ __defNormalProp$4(a, prop, b[prop]);
8077
8070
  }
8078
8071
  return a;
8079
8072
  };
8080
8073
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
8081
- var __async$s = (__this, __arguments, generator) => {
8074
+ var __async$r = (__this, __arguments, generator) => {
8082
8075
  return new Promise((resolve, reject) => {
8083
8076
  var fulfilled = (value) => {
8084
8077
  try {
@@ -8100,7 +8093,7 @@ var __async$s = (__this, __arguments, generator) => {
8100
8093
  };
8101
8094
  const logger$1 = E({
8102
8095
  name: "shipengine-api",
8103
- serializers: __spreadProps$2(__spreadValues$3({}, k), {
8096
+ serializers: __spreadProps$2(__spreadValues$4({}, k), {
8104
8097
  req: (req) => ({
8105
8098
  headers: req.headers,
8106
8099
  method: req.method,
@@ -8125,7 +8118,7 @@ class ShipEngineAPI {
8125
8118
  constructor(token, { baseURL, headers, getToken }) {
8126
8119
  const client = axios.create({
8127
8120
  baseURL,
8128
- headers: __spreadProps$2(__spreadValues$3({}, headers), {
8121
+ headers: __spreadProps$2(__spreadValues$4({}, headers), {
8129
8122
  Authorization: `Bearer ${token}`,
8130
8123
  "Content-Type": "application/json"
8131
8124
  }),
@@ -8172,7 +8165,7 @@ class ShipEngineAPI {
8172
8165
  );
8173
8166
  return res;
8174
8167
  },
8175
- (err) => __async$s(this, null, function* () {
8168
+ (err) => __async$r(this, null, function* () {
8176
8169
  var _a, _b, _c, _d, _e, _f, _g;
8177
8170
  logger$1.error(
8178
8171
  { err, req: err.config, res: err.response },
@@ -8399,21 +8392,21 @@ const delay = (ms) => new Promise((resolve) => {
8399
8392
 
8400
8393
  const onError = (errors) => errors.forEach(console.log);
8401
8394
 
8402
- var __defProp$2 = Object.defineProperty;
8395
+ var __defProp$3 = Object.defineProperty;
8403
8396
  var __defProps$1 = Object.defineProperties;
8404
8397
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
8405
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8406
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8407
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8408
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8409
- var __spreadValues$2 = (a, b) => {
8398
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
8399
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
8400
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
8401
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8402
+ var __spreadValues$3 = (a, b) => {
8410
8403
  for (var prop in b || (b = {}))
8411
- if (__hasOwnProp$8.call(b, prop))
8412
- __defNormalProp$2(a, prop, b[prop]);
8413
- if (__getOwnPropSymbols$8)
8414
- for (var prop of __getOwnPropSymbols$8(b)) {
8415
- if (__propIsEnum$8.call(b, prop))
8416
- __defNormalProp$2(a, prop, b[prop]);
8404
+ if (__hasOwnProp$9.call(b, prop))
8405
+ __defNormalProp$3(a, prop, b[prop]);
8406
+ if (__getOwnPropSymbols$9)
8407
+ for (var prop of __getOwnPropSymbols$9(b)) {
8408
+ if (__propIsEnum$9.call(b, prop))
8409
+ __defNormalProp$3(a, prop, b[prop]);
8417
8410
  }
8418
8411
  return a;
8419
8412
  };
@@ -8426,7 +8419,7 @@ if (process.env.NODE_ENV === "production") {
8426
8419
  }
8427
8420
  const logger = E({
8428
8421
  name: "shipengine",
8429
- serializers: __spreadProps$1(__spreadValues$2({}, k), {
8422
+ serializers: __spreadProps$1(__spreadValues$3({}, k), {
8430
8423
  req: (req) => ({
8431
8424
  headers: req.headers,
8432
8425
  method: req.method,
@@ -8461,7 +8454,7 @@ const useGetAccountSettings = () => {
8461
8454
  });
8462
8455
  };
8463
8456
 
8464
- var __async$r = (__this, __arguments, generator) => {
8457
+ var __async$q = (__this, __arguments, generator) => {
8465
8458
  return new Promise((resolve, reject) => {
8466
8459
  var fulfilled = (value) => {
8467
8460
  try {
@@ -8484,7 +8477,7 @@ var __async$r = (__this, __arguments, generator) => {
8484
8477
  const useUpdateAccountSettings = () => {
8485
8478
  const { client } = useShipEngine();
8486
8479
  return reactQuery.useMutation({
8487
- mutationFn: (settings) => __async$r(void 0, null, function* () {
8480
+ mutationFn: (settings) => __async$q(void 0, null, function* () {
8488
8481
  const result = yield client.accountSettings.update(settings);
8489
8482
  return result.data;
8490
8483
  }),
@@ -8493,7 +8486,7 @@ const useUpdateAccountSettings = () => {
8493
8486
  });
8494
8487
  };
8495
8488
 
8496
- var __async$q = (__this, __arguments, generator) => {
8489
+ var __async$p = (__this, __arguments, generator) => {
8497
8490
  return new Promise((resolve, reject) => {
8498
8491
  var fulfilled = (value) => {
8499
8492
  try {
@@ -8516,7 +8509,7 @@ var __async$q = (__this, __arguments, generator) => {
8516
8509
  const useParseAddress = () => {
8517
8510
  const { client } = useShipEngine();
8518
8511
  return reactQuery.useMutation({
8519
- mutationFn: (_0) => __async$q(void 0, [_0], function* ({ address, text }) {
8512
+ mutationFn: (_0) => __async$p(void 0, [_0], function* ({ address, text }) {
8520
8513
  const result = yield client.addresses.parse(text, address);
8521
8514
  return result.data;
8522
8515
  }),
@@ -8525,7 +8518,7 @@ const useParseAddress = () => {
8525
8518
  });
8526
8519
  };
8527
8520
 
8528
- var __async$p = (__this, __arguments, generator) => {
8521
+ var __async$o = (__this, __arguments, generator) => {
8529
8522
  return new Promise((resolve, reject) => {
8530
8523
  var fulfilled = (value) => {
8531
8524
  try {
@@ -8548,7 +8541,7 @@ var __async$p = (__this, __arguments, generator) => {
8548
8541
  const useValidateAddresses = () => {
8549
8542
  const { client } = useShipEngine();
8550
8543
  return reactQuery.useMutation({
8551
- mutationFn: (addresses) => __async$p(void 0, null, function* () {
8544
+ mutationFn: (addresses) => __async$o(void 0, null, function* () {
8552
8545
  const result = yield client.addresses.validate(addresses);
8553
8546
  return result.data;
8554
8547
  }),
@@ -8557,7 +8550,7 @@ const useValidateAddresses = () => {
8557
8550
  });
8558
8551
  };
8559
8552
 
8560
- var __async$o = (__this, __arguments, generator) => {
8553
+ var __async$n = (__this, __arguments, generator) => {
8561
8554
  return new Promise((resolve, reject) => {
8562
8555
  var fulfilled = (value) => {
8563
8556
  try {
@@ -8580,7 +8573,7 @@ var __async$o = (__this, __arguments, generator) => {
8580
8573
  const useAddFunds = (carrierId) => {
8581
8574
  const { client } = useShipEngine();
8582
8575
  return reactQuery.useMutation({
8583
- mutationFn: (funds) => __async$o(void 0, null, function* () {
8576
+ mutationFn: (funds) => __async$n(void 0, null, function* () {
8584
8577
  const result = yield client.carriers.addFunds(carrierId, funds);
8585
8578
  return result.data;
8586
8579
  }),
@@ -8589,7 +8582,7 @@ const useAddFunds = (carrierId) => {
8589
8582
  });
8590
8583
  };
8591
8584
 
8592
- var __async$n = (__this, __arguments, generator) => {
8585
+ var __async$m = (__this, __arguments, generator) => {
8593
8586
  return new Promise((resolve, reject) => {
8594
8587
  var fulfilled = (value) => {
8595
8588
  try {
@@ -8612,7 +8605,7 @@ var __async$n = (__this, __arguments, generator) => {
8612
8605
  const useConnectCarrier = () => {
8613
8606
  const { client } = useShipEngine();
8614
8607
  return reactQuery.useMutation({
8615
- mutationFn: (params) => __async$n(void 0, null, function* () {
8608
+ mutationFn: (params) => __async$m(void 0, null, function* () {
8616
8609
  const result = yield client.carriers.connect(params);
8617
8610
  return result.data;
8618
8611
  }),
@@ -8749,7 +8742,7 @@ const useListCarriers = () => {
8749
8742
  });
8750
8743
  };
8751
8744
 
8752
- var __async$m = (__this, __arguments, generator) => {
8745
+ var __async$l = (__this, __arguments, generator) => {
8753
8746
  return new Promise((resolve, reject) => {
8754
8747
  var fulfilled = (value) => {
8755
8748
  try {
@@ -8773,7 +8766,7 @@ const useUpdateAutoFunding = (carrierId) => {
8773
8766
  const { client } = useShipEngine();
8774
8767
  const queryClient = reactQuery.useQueryClient();
8775
8768
  return reactQuery.useMutation({
8776
- mutationFn: (options) => __async$m(void 0, null, function* () {
8769
+ mutationFn: (options) => __async$l(void 0, null, function* () {
8777
8770
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
8778
8771
  return result.data;
8779
8772
  }),
@@ -8812,7 +8805,7 @@ const useListCustomPackageTypes = () => {
8812
8805
  });
8813
8806
  };
8814
8807
 
8815
- var __async$l = (__this, __arguments, generator) => {
8808
+ var __async$k = (__this, __arguments, generator) => {
8816
8809
  return new Promise((resolve, reject) => {
8817
8810
  var fulfilled = (value) => {
8818
8811
  try {
@@ -8835,7 +8828,7 @@ var __async$l = (__this, __arguments, generator) => {
8835
8828
  const useCreateFundingSource = () => {
8836
8829
  const { client } = useShipEngine();
8837
8830
  return reactQuery.useMutation({
8838
- mutationFn: (fundingSource) => __async$l(void 0, null, function* () {
8831
+ mutationFn: (fundingSource) => __async$k(void 0, null, function* () {
8839
8832
  const result = yield client.fundingSources.create(fundingSource);
8840
8833
  return result.data;
8841
8834
  }),
@@ -8844,7 +8837,7 @@ const useCreateFundingSource = () => {
8844
8837
  });
8845
8838
  };
8846
8839
 
8847
- var __async$k = (__this, __arguments, generator) => {
8840
+ var __async$j = (__this, __arguments, generator) => {
8848
8841
  return new Promise((resolve, reject) => {
8849
8842
  var fulfilled = (value) => {
8850
8843
  try {
@@ -8867,7 +8860,7 @@ var __async$k = (__this, __arguments, generator) => {
8867
8860
  const useFundingSourcesAddFunds = (fundingSourceId) => {
8868
8861
  const { client } = useShipEngine();
8869
8862
  return reactQuery.useMutation({
8870
- mutationFn: (funds) => __async$k(void 0, null, function* () {
8863
+ mutationFn: (funds) => __async$j(void 0, null, function* () {
8871
8864
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
8872
8865
  return result.data;
8873
8866
  }),
@@ -8896,7 +8889,7 @@ const useListFundingSources = () => {
8896
8889
  });
8897
8890
  };
8898
8891
 
8899
- var __async$j = (__this, __arguments, generator) => {
8892
+ var __async$i = (__this, __arguments, generator) => {
8900
8893
  return new Promise((resolve, reject) => {
8901
8894
  var fulfilled = (value) => {
8902
8895
  try {
@@ -8919,7 +8912,7 @@ var __async$j = (__this, __arguments, generator) => {
8919
8912
  const useRegisterCarrier = () => {
8920
8913
  const { client } = useShipEngine();
8921
8914
  return reactQuery.useMutation({
8922
- mutationFn: (carrier) => __async$j(void 0, null, function* () {
8915
+ mutationFn: (carrier) => __async$i(void 0, null, function* () {
8923
8916
  const result = yield client.fundingSources.registerCarrier(carrier);
8924
8917
  return result.data;
8925
8918
  }),
@@ -8928,7 +8921,7 @@ const useRegisterCarrier = () => {
8928
8921
  });
8929
8922
  };
8930
8923
 
8931
- var __async$i = (__this, __arguments, generator) => {
8924
+ var __async$h = (__this, __arguments, generator) => {
8932
8925
  return new Promise((resolve, reject) => {
8933
8926
  var fulfilled = (value) => {
8934
8927
  try {
@@ -8951,7 +8944,7 @@ var __async$i = (__this, __arguments, generator) => {
8951
8944
  const useUpdateFundingSource = () => {
8952
8945
  const { client } = useShipEngine();
8953
8946
  return reactQuery.useMutation({
8954
- mutationFn: (_0) => __async$i(void 0, [_0], function* ({
8947
+ mutationFn: (_0) => __async$h(void 0, [_0], function* ({
8955
8948
  billingInfo,
8956
8949
  creditCardInfo,
8957
8950
  fundingSourceId
@@ -8983,22 +8976,22 @@ const useGetInsuranceAccount = (insuranceProvider) => {
8983
8976
  });
8984
8977
  };
8985
8978
 
8986
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8987
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8988
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8979
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8980
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8981
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8989
8982
  var __objRest$6 = (source, exclude) => {
8990
8983
  var target = {};
8991
8984
  for (var prop in source)
8992
- if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
8985
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
8993
8986
  target[prop] = source[prop];
8994
- if (source != null && __getOwnPropSymbols$7)
8995
- for (var prop of __getOwnPropSymbols$7(source)) {
8996
- if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
8987
+ if (source != null && __getOwnPropSymbols$8)
8988
+ for (var prop of __getOwnPropSymbols$8(source)) {
8989
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
8997
8990
  target[prop] = source[prop];
8998
8991
  }
8999
8992
  return target;
9000
8993
  };
9001
- var __async$h = (__this, __arguments, generator) => {
8994
+ var __async$g = (__this, __arguments, generator) => {
9002
8995
  return new Promise((resolve, reject) => {
9003
8996
  var fulfilled = (value) => {
9004
8997
  try {
@@ -9021,7 +9014,7 @@ var __async$h = (__this, __arguments, generator) => {
9021
9014
  const useCreateLabel = () => {
9022
9015
  const { client } = useShipEngine();
9023
9016
  return reactQuery.useMutation({
9024
- mutationFn: (_a) => __async$h(void 0, null, function* () {
9017
+ mutationFn: (_a) => __async$g(void 0, null, function* () {
9025
9018
  var _b = _a, { rateId } = _b, options = __objRest$6(_b, ["rateId"]);
9026
9019
  const result = yield client.labels.createByRateId(rateId, options);
9027
9020
  return result.data;
@@ -9057,7 +9050,7 @@ const useListLabels = (params) => {
9057
9050
  });
9058
9051
  };
9059
9052
 
9060
- var __async$g = (__this, __arguments, generator) => {
9053
+ var __async$f = (__this, __arguments, generator) => {
9061
9054
  return new Promise((resolve, reject) => {
9062
9055
  var fulfilled = (value) => {
9063
9056
  try {
@@ -9080,7 +9073,7 @@ var __async$g = (__this, __arguments, generator) => {
9080
9073
  const useVoidLabel = () => {
9081
9074
  const { client } = useShipEngine();
9082
9075
  return reactQuery.useMutation({
9083
- mutationFn: (labelId) => __async$g(void 0, null, function* () {
9076
+ mutationFn: (labelId) => __async$f(void 0, null, function* () {
9084
9077
  const result = yield client.labels.void(labelId);
9085
9078
  return result.data;
9086
9079
  }),
@@ -9099,7 +9092,7 @@ const useListOrderSources = () => {
9099
9092
  });
9100
9093
  };
9101
9094
 
9102
- var __async$f = (__this, __arguments, generator) => {
9095
+ var __async$e = (__this, __arguments, generator) => {
9103
9096
  return new Promise((resolve, reject) => {
9104
9097
  var fulfilled = (value) => {
9105
9098
  try {
@@ -9122,7 +9115,7 @@ var __async$f = (__this, __arguments, generator) => {
9122
9115
  const useRefreshOrderSourceAsync = () => {
9123
9116
  const { client } = useShipEngine();
9124
9117
  return reactQuery.useMutation({
9125
- mutationFn: (orderSourceId) => __async$f(void 0, null, function* () {
9118
+ mutationFn: (orderSourceId) => __async$e(void 0, null, function* () {
9126
9119
  const result = yield client.orderSources.refresh(orderSourceId);
9127
9120
  return result.data;
9128
9121
  }),
@@ -9133,9 +9126,9 @@ const useRefreshOrderSource = () => {
9133
9126
  const { client } = useShipEngine();
9134
9127
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
9135
9128
  return reactQuery.useMutation({
9136
- mutationFn: (orderSourceId) => __async$f(void 0, null, function* () {
9129
+ mutationFn: (orderSourceId) => __async$e(void 0, null, function* () {
9137
9130
  yield refreshOrderSourceAsync(orderSourceId);
9138
- const waitResult = yield retryUntil(() => __async$f(void 0, null, function* () {
9131
+ const waitResult = yield retryUntil(() => __async$e(void 0, null, function* () {
9139
9132
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
9140
9133
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
9141
9134
  throw new CodedError("Order source is still refreshing");
@@ -9149,7 +9142,7 @@ const useRefreshOrderSource = () => {
9149
9142
  });
9150
9143
  };
9151
9144
 
9152
- var __async$e = (__this, __arguments, generator) => {
9145
+ var __async$d = (__this, __arguments, generator) => {
9153
9146
  return new Promise((resolve, reject) => {
9154
9147
  var fulfilled = (value) => {
9155
9148
  try {
@@ -9172,7 +9165,7 @@ var __async$e = (__this, __arguments, generator) => {
9172
9165
  const useCreateRateCard = () => {
9173
9166
  const { client } = useShipEngine();
9174
9167
  return reactQuery.useMutation({
9175
- mutationFn: (rateCard) => __async$e(void 0, null, function* () {
9168
+ mutationFn: (rateCard) => __async$d(void 0, null, function* () {
9176
9169
  const result = yield client.rateCards.create(rateCard);
9177
9170
  return result.data;
9178
9171
  }),
@@ -9219,7 +9212,7 @@ const useListRateCards = (carrierIds) => {
9219
9212
  });
9220
9213
  };
9221
9214
 
9222
- var __async$d = (__this, __arguments, generator) => {
9215
+ var __async$c = (__this, __arguments, generator) => {
9223
9216
  return new Promise((resolve, reject) => {
9224
9217
  var fulfilled = (value) => {
9225
9218
  try {
@@ -9242,7 +9235,7 @@ var __async$d = (__this, __arguments, generator) => {
9242
9235
  const usePublishRateCard = () => {
9243
9236
  const { client } = useShipEngine();
9244
9237
  return reactQuery.useMutation({
9245
- mutationFn: (rateCardId) => __async$d(void 0, null, function* () {
9238
+ mutationFn: (rateCardId) => __async$c(void 0, null, function* () {
9246
9239
  return yield client.rateCards.publish(rateCardId);
9247
9240
  }),
9248
9241
  mutationKey: ["usePublishRateCard"],
@@ -9250,7 +9243,7 @@ const usePublishRateCard = () => {
9250
9243
  });
9251
9244
  };
9252
9245
 
9253
- var __async$c = (__this, __arguments, generator) => {
9246
+ var __async$b = (__this, __arguments, generator) => {
9254
9247
  return new Promise((resolve, reject) => {
9255
9248
  var fulfilled = (value) => {
9256
9249
  try {
@@ -9273,7 +9266,7 @@ var __async$c = (__this, __arguments, generator) => {
9273
9266
  const useUpdateRateCard = () => {
9274
9267
  const { client } = useShipEngine();
9275
9268
  return reactQuery.useMutation({
9276
- mutationFn: (rateCard) => __async$c(void 0, null, function* () {
9269
+ mutationFn: (rateCard) => __async$b(void 0, null, function* () {
9277
9270
  const result = yield client.rateCards.update(rateCard);
9278
9271
  return result.data;
9279
9272
  }),
@@ -9282,7 +9275,7 @@ const useUpdateRateCard = () => {
9282
9275
  });
9283
9276
  };
9284
9277
 
9285
- var __async$b = (__this, __arguments, generator) => {
9278
+ var __async$a = (__this, __arguments, generator) => {
9286
9279
  return new Promise((resolve, reject) => {
9287
9280
  var fulfilled = (value) => {
9288
9281
  try {
@@ -9305,7 +9298,7 @@ var __async$b = (__this, __arguments, generator) => {
9305
9298
  const useUploadRateCard = () => {
9306
9299
  const { client } = useShipEngine();
9307
9300
  return reactQuery.useMutation({
9308
- mutationFn: (_0) => __async$b(void 0, [_0], function* ({ rateCardId, file }) {
9301
+ mutationFn: (_0) => __async$a(void 0, [_0], function* ({ rateCardId, file }) {
9309
9302
  const result = yield client.rateCards.upload(rateCardId, file);
9310
9303
  return result.data;
9311
9304
  }),
@@ -9314,7 +9307,7 @@ const useUploadRateCard = () => {
9314
9307
  });
9315
9308
  };
9316
9309
 
9317
- var __async$a = (__this, __arguments, generator) => {
9310
+ var __async$9 = (__this, __arguments, generator) => {
9318
9311
  return new Promise((resolve, reject) => {
9319
9312
  var fulfilled = (value) => {
9320
9313
  try {
@@ -9337,7 +9330,7 @@ var __async$a = (__this, __arguments, generator) => {
9337
9330
  const useDeleteRateCard = () => {
9338
9331
  const { client } = useShipEngine();
9339
9332
  return reactQuery.useMutation({
9340
- mutationFn: (rateCardId) => __async$a(void 0, null, function* () {
9333
+ mutationFn: (rateCardId) => __async$9(void 0, null, function* () {
9341
9334
  const result = yield client.rateCards.delete(rateCardId);
9342
9335
  return result.data;
9343
9336
  }),
@@ -9346,7 +9339,7 @@ const useDeleteRateCard = () => {
9346
9339
  });
9347
9340
  };
9348
9341
 
9349
- var __async$9 = (__this, __arguments, generator) => {
9342
+ var __async$8 = (__this, __arguments, generator) => {
9350
9343
  return new Promise((resolve, reject) => {
9351
9344
  var fulfilled = (value) => {
9352
9345
  try {
@@ -9369,7 +9362,7 @@ var __async$9 = (__this, __arguments, generator) => {
9369
9362
  const useCalculateRates = () => {
9370
9363
  const { client } = useShipEngine();
9371
9364
  return reactQuery.useMutation({
9372
- mutationFn: (_0) => __async$9(void 0, [_0], function* ({ rateOptions, shipmentId }) {
9365
+ mutationFn: (_0) => __async$8(void 0, [_0], function* ({ rateOptions, shipmentId }) {
9373
9366
  const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
9374
9367
  return result.data;
9375
9368
  }),
@@ -9404,22 +9397,22 @@ const useListSalesOrders = (params = {}) => {
9404
9397
  });
9405
9398
  };
9406
9399
 
9407
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
9408
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
9409
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
9400
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
9401
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
9402
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
9410
9403
  var __objRest$5 = (source, exclude) => {
9411
9404
  var target = {};
9412
9405
  for (var prop in source)
9413
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
9406
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
9414
9407
  target[prop] = source[prop];
9415
- if (source != null && __getOwnPropSymbols$6)
9416
- for (var prop of __getOwnPropSymbols$6(source)) {
9417
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
9408
+ if (source != null && __getOwnPropSymbols$7)
9409
+ for (var prop of __getOwnPropSymbols$7(source)) {
9410
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
9418
9411
  target[prop] = source[prop];
9419
9412
  }
9420
9413
  return target;
9421
9414
  };
9422
- var __async$8 = (__this, __arguments, generator) => {
9415
+ var __async$7 = (__this, __arguments, generator) => {
9423
9416
  return new Promise((resolve, reject) => {
9424
9417
  var fulfilled = (value) => {
9425
9418
  try {
@@ -9442,7 +9435,7 @@ var __async$8 = (__this, __arguments, generator) => {
9442
9435
  const useNotifySalesOrderShipped = () => {
9443
9436
  const { client } = useShipEngine();
9444
9437
  return reactQuery.useMutation({
9445
- mutationFn: (_a) => __async$8(void 0, null, function* () {
9438
+ mutationFn: (_a) => __async$7(void 0, null, function* () {
9446
9439
  var _b = _a, { salesOrderId } = _b, tracking = __objRest$5(_b, ["salesOrderId"]);
9447
9440
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
9448
9441
  return result.data;
@@ -9452,22 +9445,22 @@ const useNotifySalesOrderShipped = () => {
9452
9445
  });
9453
9446
  };
9454
9447
 
9455
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
9456
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
9457
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
9448
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
9449
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
9450
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
9458
9451
  var __objRest$4 = (source, exclude) => {
9459
9452
  var target = {};
9460
9453
  for (var prop in source)
9461
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
9454
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
9462
9455
  target[prop] = source[prop];
9463
- if (source != null && __getOwnPropSymbols$5)
9464
- for (var prop of __getOwnPropSymbols$5(source)) {
9465
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
9456
+ if (source != null && __getOwnPropSymbols$6)
9457
+ for (var prop of __getOwnPropSymbols$6(source)) {
9458
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
9466
9459
  target[prop] = source[prop];
9467
9460
  }
9468
9461
  return target;
9469
9462
  };
9470
- var __async$7 = (__this, __arguments, generator) => {
9463
+ var __async$6 = (__this, __arguments, generator) => {
9471
9464
  return new Promise((resolve, reject) => {
9472
9465
  var fulfilled = (value) => {
9473
9466
  try {
@@ -9490,7 +9483,7 @@ var __async$7 = (__this, __arguments, generator) => {
9490
9483
  const useCreateSalesOrderShipment = () => {
9491
9484
  const { client } = useShipEngine();
9492
9485
  return reactQuery.useMutation({
9493
- mutationFn: (_a) => __async$7(void 0, null, function* () {
9486
+ mutationFn: (_a) => __async$6(void 0, null, function* () {
9494
9487
  var _b = _a, { salesOrderId } = _b, shipment = __objRest$4(_b, ["salesOrderId"]);
9495
9488
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
9496
9489
  return result.data;
@@ -9526,22 +9519,22 @@ const useListSalesOrderShipments = (params) => {
9526
9519
  });
9527
9520
  };
9528
9521
 
9529
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
9530
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
9531
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
9522
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
9523
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
9524
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
9532
9525
  var __objRest$3 = (source, exclude) => {
9533
9526
  var target = {};
9534
9527
  for (var prop in source)
9535
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
9528
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
9536
9529
  target[prop] = source[prop];
9537
- if (source != null && __getOwnPropSymbols$4)
9538
- for (var prop of __getOwnPropSymbols$4(source)) {
9539
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
9530
+ if (source != null && __getOwnPropSymbols$5)
9531
+ for (var prop of __getOwnPropSymbols$5(source)) {
9532
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
9540
9533
  target[prop] = source[prop];
9541
9534
  }
9542
9535
  return target;
9543
9536
  };
9544
- var __async$6 = (__this, __arguments, generator) => {
9537
+ var __async$5 = (__this, __arguments, generator) => {
9545
9538
  return new Promise((resolve, reject) => {
9546
9539
  var fulfilled = (value) => {
9547
9540
  try {
@@ -9564,7 +9557,7 @@ var __async$6 = (__this, __arguments, generator) => {
9564
9557
  const useUpdateSalesOrderShipment = () => {
9565
9558
  const { client } = useShipEngine();
9566
9559
  return reactQuery.useMutation({
9567
- mutationFn: (_a) => __async$6(void 0, null, function* () {
9560
+ mutationFn: (_a) => __async$5(void 0, null, function* () {
9568
9561
  var _b = _a, { shipmentId } = _b, shipment = __objRest$3(_b, ["shipmentId"]);
9569
9562
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
9570
9563
  return result.data;
@@ -9574,26 +9567,26 @@ const useUpdateSalesOrderShipment = () => {
9574
9567
  });
9575
9568
  };
9576
9569
 
9577
- var __defProp$1 = Object.defineProperty;
9570
+ var __defProp$2 = Object.defineProperty;
9578
9571
  var __defProps = Object.defineProperties;
9579
9572
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9580
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
9581
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
9582
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
9583
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9584
- var __spreadValues$1 = (a, b) => {
9573
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
9574
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
9575
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
9576
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9577
+ var __spreadValues$2 = (a, b) => {
9585
9578
  for (var prop in b || (b = {}))
9586
- if (__hasOwnProp$3.call(b, prop))
9587
- __defNormalProp$1(a, prop, b[prop]);
9588
- if (__getOwnPropSymbols$3)
9589
- for (var prop of __getOwnPropSymbols$3(b)) {
9590
- if (__propIsEnum$3.call(b, prop))
9591
- __defNormalProp$1(a, prop, b[prop]);
9579
+ if (__hasOwnProp$4.call(b, prop))
9580
+ __defNormalProp$2(a, prop, b[prop]);
9581
+ if (__getOwnPropSymbols$4)
9582
+ for (var prop of __getOwnPropSymbols$4(b)) {
9583
+ if (__propIsEnum$4.call(b, prop))
9584
+ __defNormalProp$2(a, prop, b[prop]);
9592
9585
  }
9593
9586
  return a;
9594
9587
  };
9595
9588
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9596
- var __async$5 = (__this, __arguments, generator) => {
9589
+ var __async$4 = (__this, __arguments, generator) => {
9597
9590
  return new Promise((resolve, reject) => {
9598
9591
  var fulfilled = (value) => {
9599
9592
  try {
@@ -9616,7 +9609,7 @@ var __async$5 = (__this, __arguments, generator) => {
9616
9609
  const useCreateShipment = () => {
9617
9610
  const { client } = useShipEngine();
9618
9611
  return reactQuery.useMutation({
9619
- mutationFn: (shipment) => __async$5(void 0, null, function* () {
9612
+ mutationFn: (shipment) => __async$4(void 0, null, function* () {
9620
9613
  var _a;
9621
9614
  if (shipment.warehouseId === void 0) {
9622
9615
  throw new CodedError("errorMessages.noWarehouses", {
@@ -9634,7 +9627,7 @@ const useCreateShipment = () => {
9634
9627
  postalCode: "",
9635
9628
  stateProvince: ""
9636
9629
  };
9637
- return (yield client.shipments.create(__spreadProps(__spreadValues$1({}, shipment), {
9630
+ return (yield client.shipments.create(__spreadProps(__spreadValues$2({}, shipment), {
9638
9631
  shipTo
9639
9632
  }))).data;
9640
9633
  }),
@@ -9675,17 +9668,17 @@ const useGetShipment = (shipmentId) => {
9675
9668
  });
9676
9669
  };
9677
9670
 
9678
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
9679
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
9680
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
9671
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
9672
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
9673
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
9681
9674
  var __objRest$2 = (source, exclude) => {
9682
9675
  var target = {};
9683
9676
  for (var prop in source)
9684
- if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
9677
+ if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
9685
9678
  target[prop] = source[prop];
9686
- if (source != null && __getOwnPropSymbols$2)
9687
- for (var prop of __getOwnPropSymbols$2(source)) {
9688
- if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
9679
+ if (source != null && __getOwnPropSymbols$3)
9680
+ for (var prop of __getOwnPropSymbols$3(source)) {
9681
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
9689
9682
  target[prop] = source[prop];
9690
9683
  }
9691
9684
  return target;
@@ -9702,7 +9695,7 @@ const useListShipments = (_params) => {
9702
9695
  });
9703
9696
  };
9704
9697
 
9705
- var __async$4 = (__this, __arguments, generator) => {
9698
+ var __async$3 = (__this, __arguments, generator) => {
9706
9699
  return new Promise((resolve, reject) => {
9707
9700
  var fulfilled = (value) => {
9708
9701
  try {
@@ -9725,7 +9718,7 @@ var __async$4 = (__this, __arguments, generator) => {
9725
9718
  const useCreateWarehouse = () => {
9726
9719
  const { client } = useShipEngine();
9727
9720
  return reactQuery.useMutation({
9728
- mutationFn: (data) => __async$4(void 0, null, function* () {
9721
+ mutationFn: (data) => __async$3(void 0, null, function* () {
9729
9722
  const result = yield client.warehouses.create(data);
9730
9723
  return result.data;
9731
9724
  }),
@@ -9734,7 +9727,7 @@ const useCreateWarehouse = () => {
9734
9727
  });
9735
9728
  };
9736
9729
 
9737
- var __async$3 = (__this, __arguments, generator) => {
9730
+ var __async$2 = (__this, __arguments, generator) => {
9738
9731
  return new Promise((resolve, reject) => {
9739
9732
  var fulfilled = (value) => {
9740
9733
  try {
@@ -9757,7 +9750,7 @@ var __async$3 = (__this, __arguments, generator) => {
9757
9750
  const useDeleteWarehouse = () => {
9758
9751
  const { client } = useShipEngine();
9759
9752
  return reactQuery.useMutation({
9760
- mutationFn: (_0) => __async$3(void 0, [_0], function* ({ warehouseId }) {
9753
+ mutationFn: (_0) => __async$2(void 0, [_0], function* ({ warehouseId }) {
9761
9754
  const result = yield client.warehouses.delete(warehouseId);
9762
9755
  return result.data;
9763
9756
  }),
@@ -9778,22 +9771,22 @@ const useListWarehouses = (options) => {
9778
9771
  });
9779
9772
  };
9780
9773
 
9781
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
9782
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
9783
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
9774
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
9775
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
9776
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
9784
9777
  var __objRest$1 = (source, exclude) => {
9785
9778
  var target = {};
9786
9779
  for (var prop in source)
9787
- if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
9780
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
9788
9781
  target[prop] = source[prop];
9789
- if (source != null && __getOwnPropSymbols$1)
9790
- for (var prop of __getOwnPropSymbols$1(source)) {
9791
- if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
9782
+ if (source != null && __getOwnPropSymbols$2)
9783
+ for (var prop of __getOwnPropSymbols$2(source)) {
9784
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
9792
9785
  target[prop] = source[prop];
9793
9786
  }
9794
9787
  return target;
9795
9788
  };
9796
- var __async$2 = (__this, __arguments, generator) => {
9789
+ var __async$1 = (__this, __arguments, generator) => {
9797
9790
  return new Promise((resolve, reject) => {
9798
9791
  var fulfilled = (value) => {
9799
9792
  try {
@@ -9816,7 +9809,7 @@ var __async$2 = (__this, __arguments, generator) => {
9816
9809
  const useUpdateWarehouse = () => {
9817
9810
  const { client } = useShipEngine();
9818
9811
  return reactQuery.useMutation({
9819
- mutationFn: (_a) => __async$2(void 0, null, function* () {
9812
+ mutationFn: (_a) => __async$1(void 0, null, function* () {
9820
9813
  var _b = _a, { warehouseId } = _b, warehouse = __objRest$1(_b, ["warehouseId"]);
9821
9814
  const result = yield client.warehouses.update(warehouseId, warehouse);
9822
9815
  return result.data;
@@ -10186,56 +10179,6 @@ const themeData = {
10186
10179
  fallback: fallbackThemeData
10187
10180
  };
10188
10181
 
10189
- var __async$1 = (__this, __arguments, generator) => {
10190
- return new Promise((resolve, reject) => {
10191
- var fulfilled = (value) => {
10192
- try {
10193
- step(generator.next(value));
10194
- } catch (e) {
10195
- reject(e);
10196
- }
10197
- };
10198
- var rejected = (value) => {
10199
- try {
10200
- step(generator.throw(value));
10201
- } catch (e) {
10202
- reject(e);
10203
- }
10204
- };
10205
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
10206
- step((generator = generator.apply(__this, __arguments)).next());
10207
- });
10208
- };
10209
- const useLoadFonts = ({ cdnURL = "/", scope, theme }) => {
10210
- const [fontFamily, setFontFamily] = React.useState();
10211
- React.useEffect(() => {
10212
- (() => __async$1(void 0, null, function* () {
10213
- var _a;
10214
- try {
10215
- const fontFaces = (_a = theme == null ? void 0 : theme.fontFaces) != null ? _a : [];
10216
- yield Promise.all(
10217
- fontFaces.map((_0) => __async$1(void 0, [_0], function* ({ family, source, descriptors }) {
10218
- const fontSources = source.map((url) => `url(${url.replace("$cdnUrl", cdnURL)})`).join(", ");
10219
- try {
10220
- const font = new FontFace(family, fontSources, descriptors);
10221
- const loadedFont = yield font.load();
10222
- document.fonts.add(loadedFont);
10223
- } catch (err) {
10224
- console.error(err);
10225
- }
10226
- }))
10227
- );
10228
- setFontFamily(theme == null ? void 0 : theme.defaultFontFamily);
10229
- } catch (error) {
10230
- logger.error({ error }, `Error loading fonts`);
10231
- }
10232
- }))();
10233
- }, [cdnURL, theme]);
10234
- return react.css({
10235
- [`.${scope}`]: { fontFamily }
10236
- });
10237
- };
10238
-
10239
10182
  const fallbackBrandName = "fallback";
10240
10183
  const constants = {
10241
10184
  fallbackBrandName
@@ -10278,28 +10221,49 @@ const useLoadIcons = ({ cdnURL = "/" }) => {
10278
10221
  );
10279
10222
  };
10280
10223
 
10224
+ const DEFAULT_LOCALE = "en-US";
10281
10225
  const AlchemyContext = React.createContext(void 0);
10226
+ const getDefaultLocale = () => {
10227
+ var _a;
10228
+ if (typeof window === "undefined") {
10229
+ return DEFAULT_LOCALE;
10230
+ }
10231
+ return (_a = navigator == null ? void 0 : navigator.language) != null ? _a : DEFAULT_LOCALE;
10232
+ };
10282
10233
  const AlchemyProvider = ({
10283
10234
  baseURL = "https://api.shipengine.com",
10284
10235
  cdnURL = "/",
10236
+ container,
10285
10237
  children,
10286
10238
  getToken,
10287
- locale = ((_a) => (_a = navigator == null ? void 0 : navigator.language) != null ? _a : "en-US")(),
10239
+ locale: localeProp,
10288
10240
  onError = _default,
10289
10241
  scope = "lmnt",
10290
10242
  themeConfig
10291
10243
  }) => {
10292
- const theme = new gigerTheme.Theme(themeConfig != null ? themeConfig : themeData.fallback);
10293
- const fontStyles = useLoadFonts({ cdnURL, scope, theme });
10244
+ const locale = localeProp || getDefaultLocale();
10294
10245
  const resolveIcon = useLoadIcons({ cdnURL });
10295
- const iconCache = React.useMemo(giger.createIconCache, []);
10296
- if (!theme)
10297
- return null;
10298
- const contextValue = { baseURL, cdnURL, getToken, locale, onError, scope, theme };
10299
- return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(react.ThemeProvider, { theme, children: [
10300
- /* @__PURE__ */ jsx(react.Global, { styles: [giger.getEmotionResetStyles(scope), fontStyles] }),
10301
- /* @__PURE__ */ jsx(giger.GigerConfigProvider, { iconCache, resolveIcon, children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children }) })
10302
- ] }) });
10246
+ const theme = new gigerTheme.Theme(themeConfig != null ? themeConfig : themeData.fallback);
10247
+ const contextValue = {
10248
+ baseURL,
10249
+ cdnURL,
10250
+ container,
10251
+ getToken,
10252
+ locale,
10253
+ onError,
10254
+ scope,
10255
+ theme
10256
+ };
10257
+ return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
10258
+ giger.GigerProvider,
10259
+ {
10260
+ reference: scope || void 0,
10261
+ cdnUrl: cdnURL,
10262
+ resolveIcon,
10263
+ theme,
10264
+ children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children })
10265
+ }
10266
+ ) });
10303
10267
  };
10304
10268
  const useAlchemy = () => {
10305
10269
  const context = React.useContext(AlchemyContext);
@@ -10835,22 +10799,66 @@ const useI18n = ({ resources }) => {
10835
10799
  }, [resources]);
10836
10800
  };
10837
10801
 
10838
- const memoizedCreateCache = memoize((scope) => {
10839
- const className = `.${scope}`;
10840
- const scopeSelectors = (element) => {
10841
- if ((element == null ? void 0 : element.type) === "rule" && (element == null ? void 0 : element.value.startsWith(".css"))) {
10842
- element.props = [element.props].flat().map((value) => {
10843
- if (value.includes(className))
10844
- return value;
10845
- return `${className} ${value}`;
10846
- });
10802
+ var __defProp$1 = Object.defineProperty;
10803
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
10804
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
10805
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
10806
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10807
+ var __spreadValues$1 = (a, b) => {
10808
+ for (var prop in b || (b = {}))
10809
+ if (__hasOwnProp$1.call(b, prop))
10810
+ __defNormalProp$1(a, prop, b[prop]);
10811
+ if (__getOwnPropSymbols$1)
10812
+ for (var prop of __getOwnPropSymbols$1(b)) {
10813
+ if (__propIsEnum$1.call(b, prop))
10814
+ __defNormalProp$1(a, prop, b[prop]);
10847
10815
  }
10848
- };
10849
- return createCache({
10850
- key: "css",
10851
- stylisPlugins: [scopeSelectors, prefixer$1]
10852
- });
10853
- });
10816
+ return a;
10817
+ };
10818
+ const getScopeSelectors = (className) => (...[element]) => {
10819
+ if ((element == null ? void 0 : element.type) === "rule" && (element == null ? void 0 : element.value.startsWith(".css"))) {
10820
+ element.props = [element.props].flat().map((value) => {
10821
+ if (value.includes(className))
10822
+ return value;
10823
+ return `${className} ${value}`;
10824
+ });
10825
+ }
10826
+ };
10827
+ class EmotionScopeCacheForContainer {
10828
+ constructor(container) {
10829
+ this.container = container;
10830
+ this.cacheByScope = /* @__PURE__ */ new Map();
10831
+ this.initializeCacheForScope = (scope) => {
10832
+ const emotionCache = createCache(__spreadValues$1({
10833
+ key: "css",
10834
+ stylisPlugins: [getScopeSelectors(`.${scope}`), prefixer$1]
10835
+ }, this.container && { container: this.container, prepend: true }));
10836
+ this.cacheByScope.set(scope, emotionCache);
10837
+ return emotionCache;
10838
+ };
10839
+ this.getEmotionCache = (scope) => {
10840
+ var _a;
10841
+ return (_a = this.cacheByScope.get(scope)) != null ? _a : this.initializeCacheForScope(scope);
10842
+ };
10843
+ }
10844
+ }
10845
+ class EmotionScopeContainerCache {
10846
+ constructor() {
10847
+ // allow undefined element for normal no container scope group
10848
+ this.scopeGroupByContainer = /* @__PURE__ */ new Map();
10849
+ this.getEmotionCache = (scope, container) => {
10850
+ var _a;
10851
+ const scopeGroup = (_a = this.scopeGroupByContainer.get(container)) != null ? _a : this.initializeScopeCacheForContainer(container);
10852
+ return scopeGroup.getEmotionCache(scope);
10853
+ };
10854
+ }
10855
+ initializeScopeCacheForContainer(container) {
10856
+ const scopeGroup = new EmotionScopeCacheForContainer(container);
10857
+ this.scopeGroupByContainer.set(container, scopeGroup);
10858
+ return scopeGroup;
10859
+ }
10860
+ }
10861
+ const { getEmotionCache } = new EmotionScopeContainerCache();
10854
10862
 
10855
10863
  const Element = ({
10856
10864
  children,
@@ -10858,10 +10866,11 @@ const Element = ({
10858
10866
  fallback: FallbackComponent,
10859
10867
  resources
10860
10868
  }) => {
10861
- const { scope, onError } = useAlchemy();
10869
+ const { scope, onError, container } = useAlchemy();
10862
10870
  const i18n = useI18n({ resources });
10863
10871
  const elementContainerRef = React.useRef(null);
10864
- return /* @__PURE__ */ jsx("div", { className: cx(scope, className), "data-testid": scope, ref: elementContainerRef, children: /* @__PURE__ */ jsx(giger.DefaultPortalRefProvider, { portalRef: elementContainerRef, children: /* @__PURE__ */ jsx(react.CacheProvider, { value: memoizedCreateCache(scope), children: /* @__PURE__ */ jsx(reactI18next.I18nextProvider, { i18n, children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: FallbackComponent, onError, children }) }) }) }) });
10872
+ const renderProviders = () => /* @__PURE__ */ jsx(reactI18next.I18nextProvider, { i18n, children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: FallbackComponent, onError, children }) });
10873
+ return /* @__PURE__ */ jsx("div", { className: cx(scope, className), "data-testid": scope, ref: elementContainerRef, children: /* @__PURE__ */ jsx(giger.DefaultPortalRefProvider, { portalRef: elementContainerRef, children: scope ? /* @__PURE__ */ jsx(react.CacheProvider, { value: getEmotionCache(scope, container), children: renderProviders() }) : renderProviders() }) });
10865
10874
  };
10866
10875
 
10867
10876
  var __defProp = Object.defineProperty;
@@ -10959,11 +10968,11 @@ exports.WarehousesAPI = WarehousesAPI;
10959
10968
  exports.alchemy = alchemy;
10960
10969
  exports.default = alchemy;
10961
10970
  exports.delay = delay;
10971
+ exports.getEmotionCache = getEmotionCache;
10962
10972
  exports.getEndUserIpAddress = getEndUserIpAddress;
10963
10973
  exports.isCodedError = isCodedError;
10964
10974
  exports.isCodedErrors = isCodedErrors;
10965
10975
  exports.logger = logger;
10966
- exports.memoizedCreateCache = memoizedCreateCache;
10967
10976
  exports.onError = onError;
10968
10977
  exports.retryUntil = retryUntil;
10969
10978
  exports.useAddFunds = useAddFunds;
@@ -11008,7 +11017,6 @@ exports.useListSalesOrderShipments = useListSalesOrderShipments;
11008
11017
  exports.useListSalesOrders = useListSalesOrders;
11009
11018
  exports.useListShipments = useListShipments;
11010
11019
  exports.useListWarehouses = useListWarehouses;
11011
- exports.useLoadFonts = useLoadFonts;
11012
11020
  exports.useLoadIcons = useLoadIcons;
11013
11021
  exports.useNotifySalesOrderShipped = useNotifySalesOrderShipped;
11014
11022
  exports.useParseAddress = useParseAddress;