@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/components/alchemy-provider/alchemy-provider.d.ts +6 -3
- package/components/alchemy-provider/hooks/index.d.ts +0 -1
- package/components/element/utils/get-emotion-cache.d.ts +2 -0
- package/components/element/utils/index.d.ts +1 -1
- package/index.js +283 -275
- package/index.mjs +286 -277
- package/package.json +2 -2
- package/components/alchemy-provider/hooks/use-load-fonts.d.ts +0 -7
- package/components/element/utils/memoized-create-cache.d.ts +0 -1
package/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { createContext, forwardRef, useContext, createElement as createElement$1, Fragment, useState,
|
|
3
|
-
import { jsx as jsx$1
|
|
4
|
-
import {
|
|
5
|
-
import { createIconCache, getEmotionResetStyles, GigerConfigProvider, GigerTestProvider, DefaultPortalRefProvider } from '@packlink/giger';
|
|
2
|
+
import { createContext, forwardRef, useContext, createElement as createElement$1, Fragment, useState, useCallback, useMemo, useRef } from 'react';
|
|
3
|
+
import { jsx as jsx$1 } from 'react/jsx-runtime';
|
|
4
|
+
import { GigerProvider, GigerTestProvider, DefaultPortalRefProvider } from '@packlink/giger';
|
|
6
5
|
import { Theme } from '@packlink/giger-theme';
|
|
7
6
|
import { QueryClient, QueryClientProvider, useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
7
|
+
import { CacheProvider } from '@emotion/react';
|
|
8
8
|
import { I18nextProvider } from 'react-i18next';
|
|
9
9
|
import i18n from 'i18next';
|
|
10
10
|
|
|
@@ -2440,13 +2440,6 @@ function jsx(type, props, key) {
|
|
|
2440
2440
|
|
|
2441
2441
|
return jsx$1(Emotion, createEmotionProps(type, props), key);
|
|
2442
2442
|
}
|
|
2443
|
-
function jsxs(type, props, key) {
|
|
2444
|
-
if (!hasOwnProperty.call(props, 'css')) {
|
|
2445
|
-
return jsxs$1(type, props, key);
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2448
|
-
return jsxs$1(Emotion, createEmotionProps(type, props), key);
|
|
2449
|
-
}
|
|
2450
2443
|
|
|
2451
2444
|
var dist = {};
|
|
2452
2445
|
|
|
@@ -2454,17 +2447,17 @@ Object.defineProperty(dist, "__esModule", { value: true });
|
|
|
2454
2447
|
var _default = dist.default = (function () {
|
|
2455
2448
|
});
|
|
2456
2449
|
|
|
2457
|
-
var __getOwnPropSymbols$
|
|
2458
|
-
var __hasOwnProp$
|
|
2459
|
-
var __propIsEnum$
|
|
2450
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
2451
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
2452
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
2460
2453
|
var __objRest$8 = (source, exclude) => {
|
|
2461
2454
|
var target = {};
|
|
2462
2455
|
for (var prop in source)
|
|
2463
|
-
if (__hasOwnProp$
|
|
2456
|
+
if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2464
2457
|
target[prop] = source[prop];
|
|
2465
|
-
if (source != null && __getOwnPropSymbols$
|
|
2466
|
-
for (var prop of __getOwnPropSymbols$
|
|
2467
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2458
|
+
if (source != null && __getOwnPropSymbols$d)
|
|
2459
|
+
for (var prop of __getOwnPropSymbols$d(source)) {
|
|
2460
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
|
|
2468
2461
|
target[prop] = source[prop];
|
|
2469
2462
|
}
|
|
2470
2463
|
return target;
|
|
@@ -5232,7 +5225,7 @@ var ipaddr = {
|
|
|
5232
5225
|
}).call(commonjsGlobal);
|
|
5233
5226
|
} (ipaddr));
|
|
5234
5227
|
|
|
5235
|
-
var __async$
|
|
5228
|
+
var __async$v = (__this, __arguments, generator) => {
|
|
5236
5229
|
return new Promise((resolve, reject) => {
|
|
5237
5230
|
var fulfilled = (value) => {
|
|
5238
5231
|
try {
|
|
@@ -5252,7 +5245,7 @@ var __async$w = (__this, __arguments, generator) => {
|
|
|
5252
5245
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
5253
5246
|
});
|
|
5254
5247
|
};
|
|
5255
|
-
const getEndUserIpAddress = () => __async$
|
|
5248
|
+
const getEndUserIpAddress = () => __async$v(void 0, null, function* () {
|
|
5256
5249
|
try {
|
|
5257
5250
|
const response = yield axios.get("https://api.ipify.org/?format=json");
|
|
5258
5251
|
if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
|
|
@@ -5264,21 +5257,21 @@ const getEndUserIpAddress = () => __async$w(void 0, null, function* () {
|
|
|
5264
5257
|
}
|
|
5265
5258
|
});
|
|
5266
5259
|
|
|
5267
|
-
var __defProp$
|
|
5260
|
+
var __defProp$6 = Object.defineProperty;
|
|
5268
5261
|
var __defProps$3 = Object.defineProperties;
|
|
5269
5262
|
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
5270
|
-
var __getOwnPropSymbols$
|
|
5271
|
-
var __hasOwnProp$
|
|
5272
|
-
var __propIsEnum$
|
|
5273
|
-
var __defNormalProp$
|
|
5274
|
-
var __spreadValues$
|
|
5263
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
5264
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
5265
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
5266
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5267
|
+
var __spreadValues$6 = (a, b) => {
|
|
5275
5268
|
for (var prop in b || (b = {}))
|
|
5276
|
-
if (__hasOwnProp$
|
|
5277
|
-
__defNormalProp$
|
|
5278
|
-
if (__getOwnPropSymbols$
|
|
5279
|
-
for (var prop of __getOwnPropSymbols$
|
|
5280
|
-
if (__propIsEnum$
|
|
5281
|
-
__defNormalProp$
|
|
5269
|
+
if (__hasOwnProp$c.call(b, prop))
|
|
5270
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
5271
|
+
if (__getOwnPropSymbols$c)
|
|
5272
|
+
for (var prop of __getOwnPropSymbols$c(b)) {
|
|
5273
|
+
if (__propIsEnum$c.call(b, prop))
|
|
5274
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
5282
5275
|
}
|
|
5283
5276
|
return a;
|
|
5284
5277
|
};
|
|
@@ -5286,16 +5279,16 @@ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
|
5286
5279
|
var __objRest$7 = (source, exclude) => {
|
|
5287
5280
|
var target = {};
|
|
5288
5281
|
for (var prop in source)
|
|
5289
|
-
if (__hasOwnProp$
|
|
5282
|
+
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
5290
5283
|
target[prop] = source[prop];
|
|
5291
|
-
if (source != null && __getOwnPropSymbols$
|
|
5292
|
-
for (var prop of __getOwnPropSymbols$
|
|
5293
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
5284
|
+
if (source != null && __getOwnPropSymbols$c)
|
|
5285
|
+
for (var prop of __getOwnPropSymbols$c(source)) {
|
|
5286
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
|
|
5294
5287
|
target[prop] = source[prop];
|
|
5295
5288
|
}
|
|
5296
5289
|
return target;
|
|
5297
5290
|
};
|
|
5298
|
-
var __async$
|
|
5291
|
+
var __async$u = (__this, __arguments, generator) => {
|
|
5299
5292
|
return new Promise((resolve, reject) => {
|
|
5300
5293
|
var fulfilled = (value) => {
|
|
5301
5294
|
try {
|
|
@@ -5333,12 +5326,12 @@ class CarriersAPI {
|
|
|
5333
5326
|
/**
|
|
5334
5327
|
* The `connect` method connects a carrier account to a user's ShipEngine account.
|
|
5335
5328
|
*/
|
|
5336
|
-
this.connect = (_a) => __async$
|
|
5329
|
+
this.connect = (_a) => __async$u(this, null, function* () {
|
|
5337
5330
|
var _b = _a, { carrierCode } = _b, connection = __objRest$7(_b, ["carrierCode"]);
|
|
5338
5331
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5339
5332
|
if (!endUserIpAddress)
|
|
5340
5333
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5341
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$
|
|
5334
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$3(__spreadValues$6({}, connection), {
|
|
5342
5335
|
endUserIpAddress
|
|
5343
5336
|
}));
|
|
5344
5337
|
});
|
|
@@ -7620,23 +7613,23 @@ class CustomPackagesAPI {
|
|
|
7620
7613
|
}
|
|
7621
7614
|
}
|
|
7622
7615
|
|
|
7623
|
-
var __defProp$
|
|
7624
|
-
var __getOwnPropSymbols$
|
|
7625
|
-
var __hasOwnProp$
|
|
7626
|
-
var __propIsEnum$
|
|
7627
|
-
var __defNormalProp$
|
|
7628
|
-
var __spreadValues$
|
|
7616
|
+
var __defProp$5 = Object.defineProperty;
|
|
7617
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
7618
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
7619
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
7620
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7621
|
+
var __spreadValues$5 = (a, b) => {
|
|
7629
7622
|
for (var prop in b || (b = {}))
|
|
7630
|
-
if (__hasOwnProp$
|
|
7631
|
-
__defNormalProp$
|
|
7632
|
-
if (__getOwnPropSymbols$
|
|
7633
|
-
for (var prop of __getOwnPropSymbols$
|
|
7634
|
-
if (__propIsEnum$
|
|
7635
|
-
__defNormalProp$
|
|
7623
|
+
if (__hasOwnProp$b.call(b, prop))
|
|
7624
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
7625
|
+
if (__getOwnPropSymbols$b)
|
|
7626
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
7627
|
+
if (__propIsEnum$b.call(b, prop))
|
|
7628
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
7636
7629
|
}
|
|
7637
7630
|
return a;
|
|
7638
7631
|
};
|
|
7639
|
-
var __async$
|
|
7632
|
+
var __async$t = (__this, __arguments, generator) => {
|
|
7640
7633
|
return new Promise((resolve, reject) => {
|
|
7641
7634
|
var fulfilled = (value) => {
|
|
7642
7635
|
try {
|
|
@@ -7675,11 +7668,11 @@ class FundingSourcesAPI {
|
|
|
7675
7668
|
* The `create` method creates a new funding source for a given user. This requires
|
|
7676
7669
|
* payment information to be collected from the user.
|
|
7677
7670
|
*/
|
|
7678
|
-
this.create = (createFundingSource) => __async$
|
|
7671
|
+
this.create = (createFundingSource) => __async$t(this, null, function* () {
|
|
7679
7672
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7680
7673
|
if (!endUserIpAddress)
|
|
7681
7674
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7682
|
-
return yield this.client.post("/v1/funding_sources", __spreadValues$
|
|
7675
|
+
return yield this.client.post("/v1/funding_sources", __spreadValues$5({
|
|
7683
7676
|
endUserIpAddress
|
|
7684
7677
|
}, createFundingSource));
|
|
7685
7678
|
});
|
|
@@ -7688,7 +7681,7 @@ class FundingSourcesAPI {
|
|
|
7688
7681
|
* user to update the billing address or payment information associated with the
|
|
7689
7682
|
* funding source.
|
|
7690
7683
|
*/
|
|
7691
|
-
this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$
|
|
7684
|
+
this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$t(this, null, function* () {
|
|
7692
7685
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7693
7686
|
if (!endUserIpAddress)
|
|
7694
7687
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
@@ -7705,18 +7698,18 @@ class FundingSourcesAPI {
|
|
|
7705
7698
|
* The `registerCarrier` method registers a carrier account and associates
|
|
7706
7699
|
* it with a given funding source.
|
|
7707
7700
|
*/
|
|
7708
|
-
this.registerCarrier = (carrier) => __async$
|
|
7701
|
+
this.registerCarrier = (carrier) => __async$t(this, null, function* () {
|
|
7709
7702
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7710
7703
|
if (!endUserIpAddress)
|
|
7711
7704
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7712
|
-
return yield this.client.post("/v1/registration/funding_source", __spreadValues$
|
|
7705
|
+
return yield this.client.post("/v1/registration/funding_source", __spreadValues$5({
|
|
7713
7706
|
endUserIpAddress
|
|
7714
7707
|
}, carrier));
|
|
7715
7708
|
});
|
|
7716
7709
|
/**
|
|
7717
7710
|
* The `addFunds` method allows you to add funds to a funding source.
|
|
7718
7711
|
*/
|
|
7719
|
-
this.addFunds = (amount, fundingSourceId) => __async$
|
|
7712
|
+
this.addFunds = (amount, fundingSourceId) => __async$t(this, null, function* () {
|
|
7720
7713
|
return yield this.client.put(
|
|
7721
7714
|
`/v1/funding_sources/${fundingSourceId}/add_funds`,
|
|
7722
7715
|
amount
|
|
@@ -7950,7 +7943,7 @@ class SalesOrdersAPI {
|
|
|
7950
7943
|
}
|
|
7951
7944
|
}
|
|
7952
7945
|
|
|
7953
|
-
var __async$
|
|
7946
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
7954
7947
|
return new Promise((resolve, reject) => {
|
|
7955
7948
|
var fulfilled = (value) => {
|
|
7956
7949
|
try {
|
|
@@ -7993,7 +7986,7 @@ class ShipmentsAPI {
|
|
|
7993
7986
|
* The `create` method allows for creating shipments based on a list of shipment
|
|
7994
7987
|
* items passed into this method.
|
|
7995
7988
|
*/
|
|
7996
|
-
this.create = (...shipments) => __async$
|
|
7989
|
+
this.create = (...shipments) => __async$s(this, null, function* () {
|
|
7997
7990
|
return this.client.post("/v1/shipments", {
|
|
7998
7991
|
shipments
|
|
7999
7992
|
});
|
|
@@ -8037,26 +8030,26 @@ class WarehousesAPI {
|
|
|
8037
8030
|
}
|
|
8038
8031
|
}
|
|
8039
8032
|
|
|
8040
|
-
var __defProp$
|
|
8033
|
+
var __defProp$4 = Object.defineProperty;
|
|
8041
8034
|
var __defProps$2 = Object.defineProperties;
|
|
8042
8035
|
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
8043
|
-
var __getOwnPropSymbols$
|
|
8044
|
-
var __hasOwnProp$
|
|
8045
|
-
var __propIsEnum$
|
|
8046
|
-
var __defNormalProp$
|
|
8047
|
-
var __spreadValues$
|
|
8036
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
8037
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
8038
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
8039
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8040
|
+
var __spreadValues$4 = (a, b) => {
|
|
8048
8041
|
for (var prop in b || (b = {}))
|
|
8049
|
-
if (__hasOwnProp$
|
|
8050
|
-
__defNormalProp$
|
|
8051
|
-
if (__getOwnPropSymbols$
|
|
8052
|
-
for (var prop of __getOwnPropSymbols$
|
|
8053
|
-
if (__propIsEnum$
|
|
8054
|
-
__defNormalProp$
|
|
8042
|
+
if (__hasOwnProp$a.call(b, prop))
|
|
8043
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
8044
|
+
if (__getOwnPropSymbols$a)
|
|
8045
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
8046
|
+
if (__propIsEnum$a.call(b, prop))
|
|
8047
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
8055
8048
|
}
|
|
8056
8049
|
return a;
|
|
8057
8050
|
};
|
|
8058
8051
|
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
8059
|
-
var __async$
|
|
8052
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
8060
8053
|
return new Promise((resolve, reject) => {
|
|
8061
8054
|
var fulfilled = (value) => {
|
|
8062
8055
|
try {
|
|
@@ -8078,7 +8071,7 @@ var __async$s = (__this, __arguments, generator) => {
|
|
|
8078
8071
|
};
|
|
8079
8072
|
const logger$1 = E({
|
|
8080
8073
|
name: "shipengine-api",
|
|
8081
|
-
serializers: __spreadProps$2(__spreadValues$
|
|
8074
|
+
serializers: __spreadProps$2(__spreadValues$4({}, k), {
|
|
8082
8075
|
req: (req) => ({
|
|
8083
8076
|
headers: req.headers,
|
|
8084
8077
|
method: req.method,
|
|
@@ -8103,7 +8096,7 @@ class ShipEngineAPI {
|
|
|
8103
8096
|
constructor(token, { baseURL, headers, getToken }) {
|
|
8104
8097
|
const client = axios.create({
|
|
8105
8098
|
baseURL,
|
|
8106
|
-
headers: __spreadProps$2(__spreadValues$
|
|
8099
|
+
headers: __spreadProps$2(__spreadValues$4({}, headers), {
|
|
8107
8100
|
Authorization: `Bearer ${token}`,
|
|
8108
8101
|
"Content-Type": "application/json"
|
|
8109
8102
|
}),
|
|
@@ -8150,7 +8143,7 @@ class ShipEngineAPI {
|
|
|
8150
8143
|
);
|
|
8151
8144
|
return res;
|
|
8152
8145
|
},
|
|
8153
|
-
(err) => __async$
|
|
8146
|
+
(err) => __async$r(this, null, function* () {
|
|
8154
8147
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
8155
8148
|
logger$1.error(
|
|
8156
8149
|
{ err, req: err.config, res: err.response },
|
|
@@ -8377,21 +8370,21 @@ const delay = (ms) => new Promise((resolve) => {
|
|
|
8377
8370
|
|
|
8378
8371
|
const onError = (errors) => errors.forEach(console.log);
|
|
8379
8372
|
|
|
8380
|
-
var __defProp$
|
|
8373
|
+
var __defProp$3 = Object.defineProperty;
|
|
8381
8374
|
var __defProps$1 = Object.defineProperties;
|
|
8382
8375
|
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
8383
|
-
var __getOwnPropSymbols$
|
|
8384
|
-
var __hasOwnProp$
|
|
8385
|
-
var __propIsEnum$
|
|
8386
|
-
var __defNormalProp$
|
|
8387
|
-
var __spreadValues$
|
|
8376
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
8377
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
8378
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
8379
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8380
|
+
var __spreadValues$3 = (a, b) => {
|
|
8388
8381
|
for (var prop in b || (b = {}))
|
|
8389
|
-
if (__hasOwnProp$
|
|
8390
|
-
__defNormalProp$
|
|
8391
|
-
if (__getOwnPropSymbols$
|
|
8392
|
-
for (var prop of __getOwnPropSymbols$
|
|
8393
|
-
if (__propIsEnum$
|
|
8394
|
-
__defNormalProp$
|
|
8382
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
8383
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
8384
|
+
if (__getOwnPropSymbols$9)
|
|
8385
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
8386
|
+
if (__propIsEnum$9.call(b, prop))
|
|
8387
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
8395
8388
|
}
|
|
8396
8389
|
return a;
|
|
8397
8390
|
};
|
|
@@ -8404,7 +8397,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
8404
8397
|
}
|
|
8405
8398
|
const logger = E({
|
|
8406
8399
|
name: "shipengine",
|
|
8407
|
-
serializers: __spreadProps$1(__spreadValues$
|
|
8400
|
+
serializers: __spreadProps$1(__spreadValues$3({}, k), {
|
|
8408
8401
|
req: (req) => ({
|
|
8409
8402
|
headers: req.headers,
|
|
8410
8403
|
method: req.method,
|
|
@@ -8439,7 +8432,7 @@ const useGetAccountSettings = () => {
|
|
|
8439
8432
|
});
|
|
8440
8433
|
};
|
|
8441
8434
|
|
|
8442
|
-
var __async$
|
|
8435
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
8443
8436
|
return new Promise((resolve, reject) => {
|
|
8444
8437
|
var fulfilled = (value) => {
|
|
8445
8438
|
try {
|
|
@@ -8462,7 +8455,7 @@ var __async$r = (__this, __arguments, generator) => {
|
|
|
8462
8455
|
const useUpdateAccountSettings = () => {
|
|
8463
8456
|
const { client } = useShipEngine();
|
|
8464
8457
|
return useMutation({
|
|
8465
|
-
mutationFn: (settings) => __async$
|
|
8458
|
+
mutationFn: (settings) => __async$q(void 0, null, function* () {
|
|
8466
8459
|
const result = yield client.accountSettings.update(settings);
|
|
8467
8460
|
return result.data;
|
|
8468
8461
|
}),
|
|
@@ -8471,7 +8464,7 @@ const useUpdateAccountSettings = () => {
|
|
|
8471
8464
|
});
|
|
8472
8465
|
};
|
|
8473
8466
|
|
|
8474
|
-
var __async$
|
|
8467
|
+
var __async$p = (__this, __arguments, generator) => {
|
|
8475
8468
|
return new Promise((resolve, reject) => {
|
|
8476
8469
|
var fulfilled = (value) => {
|
|
8477
8470
|
try {
|
|
@@ -8494,7 +8487,7 @@ var __async$q = (__this, __arguments, generator) => {
|
|
|
8494
8487
|
const useParseAddress = () => {
|
|
8495
8488
|
const { client } = useShipEngine();
|
|
8496
8489
|
return useMutation({
|
|
8497
|
-
mutationFn: (_0) => __async$
|
|
8490
|
+
mutationFn: (_0) => __async$p(void 0, [_0], function* ({ address, text }) {
|
|
8498
8491
|
const result = yield client.addresses.parse(text, address);
|
|
8499
8492
|
return result.data;
|
|
8500
8493
|
}),
|
|
@@ -8503,7 +8496,7 @@ const useParseAddress = () => {
|
|
|
8503
8496
|
});
|
|
8504
8497
|
};
|
|
8505
8498
|
|
|
8506
|
-
var __async$
|
|
8499
|
+
var __async$o = (__this, __arguments, generator) => {
|
|
8507
8500
|
return new Promise((resolve, reject) => {
|
|
8508
8501
|
var fulfilled = (value) => {
|
|
8509
8502
|
try {
|
|
@@ -8526,7 +8519,7 @@ var __async$p = (__this, __arguments, generator) => {
|
|
|
8526
8519
|
const useValidateAddresses = () => {
|
|
8527
8520
|
const { client } = useShipEngine();
|
|
8528
8521
|
return useMutation({
|
|
8529
|
-
mutationFn: (addresses) => __async$
|
|
8522
|
+
mutationFn: (addresses) => __async$o(void 0, null, function* () {
|
|
8530
8523
|
const result = yield client.addresses.validate(addresses);
|
|
8531
8524
|
return result.data;
|
|
8532
8525
|
}),
|
|
@@ -8535,7 +8528,7 @@ const useValidateAddresses = () => {
|
|
|
8535
8528
|
});
|
|
8536
8529
|
};
|
|
8537
8530
|
|
|
8538
|
-
var __async$
|
|
8531
|
+
var __async$n = (__this, __arguments, generator) => {
|
|
8539
8532
|
return new Promise((resolve, reject) => {
|
|
8540
8533
|
var fulfilled = (value) => {
|
|
8541
8534
|
try {
|
|
@@ -8558,7 +8551,7 @@ var __async$o = (__this, __arguments, generator) => {
|
|
|
8558
8551
|
const useAddFunds = (carrierId) => {
|
|
8559
8552
|
const { client } = useShipEngine();
|
|
8560
8553
|
return useMutation({
|
|
8561
|
-
mutationFn: (funds) => __async$
|
|
8554
|
+
mutationFn: (funds) => __async$n(void 0, null, function* () {
|
|
8562
8555
|
const result = yield client.carriers.addFunds(carrierId, funds);
|
|
8563
8556
|
return result.data;
|
|
8564
8557
|
}),
|
|
@@ -8567,7 +8560,7 @@ const useAddFunds = (carrierId) => {
|
|
|
8567
8560
|
});
|
|
8568
8561
|
};
|
|
8569
8562
|
|
|
8570
|
-
var __async$
|
|
8563
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
8571
8564
|
return new Promise((resolve, reject) => {
|
|
8572
8565
|
var fulfilled = (value) => {
|
|
8573
8566
|
try {
|
|
@@ -8590,7 +8583,7 @@ var __async$n = (__this, __arguments, generator) => {
|
|
|
8590
8583
|
const useConnectCarrier = () => {
|
|
8591
8584
|
const { client } = useShipEngine();
|
|
8592
8585
|
return useMutation({
|
|
8593
|
-
mutationFn: (params) => __async$
|
|
8586
|
+
mutationFn: (params) => __async$m(void 0, null, function* () {
|
|
8594
8587
|
const result = yield client.carriers.connect(params);
|
|
8595
8588
|
return result.data;
|
|
8596
8589
|
}),
|
|
@@ -8727,7 +8720,7 @@ const useListCarriers = () => {
|
|
|
8727
8720
|
});
|
|
8728
8721
|
};
|
|
8729
8722
|
|
|
8730
|
-
var __async$
|
|
8723
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
8731
8724
|
return new Promise((resolve, reject) => {
|
|
8732
8725
|
var fulfilled = (value) => {
|
|
8733
8726
|
try {
|
|
@@ -8751,7 +8744,7 @@ const useUpdateAutoFunding = (carrierId) => {
|
|
|
8751
8744
|
const { client } = useShipEngine();
|
|
8752
8745
|
const queryClient = useQueryClient();
|
|
8753
8746
|
return useMutation({
|
|
8754
|
-
mutationFn: (options) => __async$
|
|
8747
|
+
mutationFn: (options) => __async$l(void 0, null, function* () {
|
|
8755
8748
|
const result = yield client.carriers.updateAutoFunding(carrierId, options);
|
|
8756
8749
|
return result.data;
|
|
8757
8750
|
}),
|
|
@@ -8790,7 +8783,7 @@ const useListCustomPackageTypes = () => {
|
|
|
8790
8783
|
});
|
|
8791
8784
|
};
|
|
8792
8785
|
|
|
8793
|
-
var __async$
|
|
8786
|
+
var __async$k = (__this, __arguments, generator) => {
|
|
8794
8787
|
return new Promise((resolve, reject) => {
|
|
8795
8788
|
var fulfilled = (value) => {
|
|
8796
8789
|
try {
|
|
@@ -8813,7 +8806,7 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
8813
8806
|
const useCreateFundingSource = () => {
|
|
8814
8807
|
const { client } = useShipEngine();
|
|
8815
8808
|
return useMutation({
|
|
8816
|
-
mutationFn: (fundingSource) => __async$
|
|
8809
|
+
mutationFn: (fundingSource) => __async$k(void 0, null, function* () {
|
|
8817
8810
|
const result = yield client.fundingSources.create(fundingSource);
|
|
8818
8811
|
return result.data;
|
|
8819
8812
|
}),
|
|
@@ -8822,7 +8815,7 @@ const useCreateFundingSource = () => {
|
|
|
8822
8815
|
});
|
|
8823
8816
|
};
|
|
8824
8817
|
|
|
8825
|
-
var __async$
|
|
8818
|
+
var __async$j = (__this, __arguments, generator) => {
|
|
8826
8819
|
return new Promise((resolve, reject) => {
|
|
8827
8820
|
var fulfilled = (value) => {
|
|
8828
8821
|
try {
|
|
@@ -8845,7 +8838,7 @@ var __async$k = (__this, __arguments, generator) => {
|
|
|
8845
8838
|
const useFundingSourcesAddFunds = (fundingSourceId) => {
|
|
8846
8839
|
const { client } = useShipEngine();
|
|
8847
8840
|
return useMutation({
|
|
8848
|
-
mutationFn: (funds) => __async$
|
|
8841
|
+
mutationFn: (funds) => __async$j(void 0, null, function* () {
|
|
8849
8842
|
const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
|
|
8850
8843
|
return result.data;
|
|
8851
8844
|
}),
|
|
@@ -8874,7 +8867,7 @@ const useListFundingSources = () => {
|
|
|
8874
8867
|
});
|
|
8875
8868
|
};
|
|
8876
8869
|
|
|
8877
|
-
var __async$
|
|
8870
|
+
var __async$i = (__this, __arguments, generator) => {
|
|
8878
8871
|
return new Promise((resolve, reject) => {
|
|
8879
8872
|
var fulfilled = (value) => {
|
|
8880
8873
|
try {
|
|
@@ -8897,7 +8890,7 @@ var __async$j = (__this, __arguments, generator) => {
|
|
|
8897
8890
|
const useRegisterCarrier = () => {
|
|
8898
8891
|
const { client } = useShipEngine();
|
|
8899
8892
|
return useMutation({
|
|
8900
|
-
mutationFn: (carrier) => __async$
|
|
8893
|
+
mutationFn: (carrier) => __async$i(void 0, null, function* () {
|
|
8901
8894
|
const result = yield client.fundingSources.registerCarrier(carrier);
|
|
8902
8895
|
return result.data;
|
|
8903
8896
|
}),
|
|
@@ -8906,7 +8899,7 @@ const useRegisterCarrier = () => {
|
|
|
8906
8899
|
});
|
|
8907
8900
|
};
|
|
8908
8901
|
|
|
8909
|
-
var __async$
|
|
8902
|
+
var __async$h = (__this, __arguments, generator) => {
|
|
8910
8903
|
return new Promise((resolve, reject) => {
|
|
8911
8904
|
var fulfilled = (value) => {
|
|
8912
8905
|
try {
|
|
@@ -8929,7 +8922,7 @@ var __async$i = (__this, __arguments, generator) => {
|
|
|
8929
8922
|
const useUpdateFundingSource = () => {
|
|
8930
8923
|
const { client } = useShipEngine();
|
|
8931
8924
|
return useMutation({
|
|
8932
|
-
mutationFn: (_0) => __async$
|
|
8925
|
+
mutationFn: (_0) => __async$h(void 0, [_0], function* ({
|
|
8933
8926
|
billingInfo,
|
|
8934
8927
|
creditCardInfo,
|
|
8935
8928
|
fundingSourceId
|
|
@@ -8961,22 +8954,22 @@ const useGetInsuranceAccount = (insuranceProvider) => {
|
|
|
8961
8954
|
});
|
|
8962
8955
|
};
|
|
8963
8956
|
|
|
8964
|
-
var __getOwnPropSymbols$
|
|
8965
|
-
var __hasOwnProp$
|
|
8966
|
-
var __propIsEnum$
|
|
8957
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
8958
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
8959
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
8967
8960
|
var __objRest$6 = (source, exclude) => {
|
|
8968
8961
|
var target = {};
|
|
8969
8962
|
for (var prop in source)
|
|
8970
|
-
if (__hasOwnProp$
|
|
8963
|
+
if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8971
8964
|
target[prop] = source[prop];
|
|
8972
|
-
if (source != null && __getOwnPropSymbols$
|
|
8973
|
-
for (var prop of __getOwnPropSymbols$
|
|
8974
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
8965
|
+
if (source != null && __getOwnPropSymbols$8)
|
|
8966
|
+
for (var prop of __getOwnPropSymbols$8(source)) {
|
|
8967
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
|
|
8975
8968
|
target[prop] = source[prop];
|
|
8976
8969
|
}
|
|
8977
8970
|
return target;
|
|
8978
8971
|
};
|
|
8979
|
-
var __async$
|
|
8972
|
+
var __async$g = (__this, __arguments, generator) => {
|
|
8980
8973
|
return new Promise((resolve, reject) => {
|
|
8981
8974
|
var fulfilled = (value) => {
|
|
8982
8975
|
try {
|
|
@@ -8999,7 +8992,7 @@ var __async$h = (__this, __arguments, generator) => {
|
|
|
8999
8992
|
const useCreateLabel = () => {
|
|
9000
8993
|
const { client } = useShipEngine();
|
|
9001
8994
|
return useMutation({
|
|
9002
|
-
mutationFn: (_a) => __async$
|
|
8995
|
+
mutationFn: (_a) => __async$g(void 0, null, function* () {
|
|
9003
8996
|
var _b = _a, { rateId } = _b, options = __objRest$6(_b, ["rateId"]);
|
|
9004
8997
|
const result = yield client.labels.createByRateId(rateId, options);
|
|
9005
8998
|
return result.data;
|
|
@@ -9035,7 +9028,7 @@ const useListLabels = (params) => {
|
|
|
9035
9028
|
});
|
|
9036
9029
|
};
|
|
9037
9030
|
|
|
9038
|
-
var __async$
|
|
9031
|
+
var __async$f = (__this, __arguments, generator) => {
|
|
9039
9032
|
return new Promise((resolve, reject) => {
|
|
9040
9033
|
var fulfilled = (value) => {
|
|
9041
9034
|
try {
|
|
@@ -9058,7 +9051,7 @@ var __async$g = (__this, __arguments, generator) => {
|
|
|
9058
9051
|
const useVoidLabel = () => {
|
|
9059
9052
|
const { client } = useShipEngine();
|
|
9060
9053
|
return useMutation({
|
|
9061
|
-
mutationFn: (labelId) => __async$
|
|
9054
|
+
mutationFn: (labelId) => __async$f(void 0, null, function* () {
|
|
9062
9055
|
const result = yield client.labels.void(labelId);
|
|
9063
9056
|
return result.data;
|
|
9064
9057
|
}),
|
|
@@ -9077,7 +9070,7 @@ const useListOrderSources = () => {
|
|
|
9077
9070
|
});
|
|
9078
9071
|
};
|
|
9079
9072
|
|
|
9080
|
-
var __async$
|
|
9073
|
+
var __async$e = (__this, __arguments, generator) => {
|
|
9081
9074
|
return new Promise((resolve, reject) => {
|
|
9082
9075
|
var fulfilled = (value) => {
|
|
9083
9076
|
try {
|
|
@@ -9100,7 +9093,7 @@ var __async$f = (__this, __arguments, generator) => {
|
|
|
9100
9093
|
const useRefreshOrderSourceAsync = () => {
|
|
9101
9094
|
const { client } = useShipEngine();
|
|
9102
9095
|
return useMutation({
|
|
9103
|
-
mutationFn: (orderSourceId) => __async$
|
|
9096
|
+
mutationFn: (orderSourceId) => __async$e(void 0, null, function* () {
|
|
9104
9097
|
const result = yield client.orderSources.refresh(orderSourceId);
|
|
9105
9098
|
return result.data;
|
|
9106
9099
|
}),
|
|
@@ -9111,9 +9104,9 @@ const useRefreshOrderSource = () => {
|
|
|
9111
9104
|
const { client } = useShipEngine();
|
|
9112
9105
|
const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
|
|
9113
9106
|
return useMutation({
|
|
9114
|
-
mutationFn: (orderSourceId) => __async$
|
|
9107
|
+
mutationFn: (orderSourceId) => __async$e(void 0, null, function* () {
|
|
9115
9108
|
yield refreshOrderSourceAsync(orderSourceId);
|
|
9116
|
-
const waitResult = yield retryUntil(() => __async$
|
|
9109
|
+
const waitResult = yield retryUntil(() => __async$e(void 0, null, function* () {
|
|
9117
9110
|
const { data: checkResult } = yield client.orderSources.get(orderSourceId);
|
|
9118
9111
|
if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
|
|
9119
9112
|
throw new CodedError("Order source is still refreshing");
|
|
@@ -9127,7 +9120,7 @@ const useRefreshOrderSource = () => {
|
|
|
9127
9120
|
});
|
|
9128
9121
|
};
|
|
9129
9122
|
|
|
9130
|
-
var __async$
|
|
9123
|
+
var __async$d = (__this, __arguments, generator) => {
|
|
9131
9124
|
return new Promise((resolve, reject) => {
|
|
9132
9125
|
var fulfilled = (value) => {
|
|
9133
9126
|
try {
|
|
@@ -9150,7 +9143,7 @@ var __async$e = (__this, __arguments, generator) => {
|
|
|
9150
9143
|
const useCreateRateCard = () => {
|
|
9151
9144
|
const { client } = useShipEngine();
|
|
9152
9145
|
return useMutation({
|
|
9153
|
-
mutationFn: (rateCard) => __async$
|
|
9146
|
+
mutationFn: (rateCard) => __async$d(void 0, null, function* () {
|
|
9154
9147
|
const result = yield client.rateCards.create(rateCard);
|
|
9155
9148
|
return result.data;
|
|
9156
9149
|
}),
|
|
@@ -9197,7 +9190,7 @@ const useListRateCards = (carrierIds) => {
|
|
|
9197
9190
|
});
|
|
9198
9191
|
};
|
|
9199
9192
|
|
|
9200
|
-
var __async$
|
|
9193
|
+
var __async$c = (__this, __arguments, generator) => {
|
|
9201
9194
|
return new Promise((resolve, reject) => {
|
|
9202
9195
|
var fulfilled = (value) => {
|
|
9203
9196
|
try {
|
|
@@ -9220,7 +9213,7 @@ var __async$d = (__this, __arguments, generator) => {
|
|
|
9220
9213
|
const usePublishRateCard = () => {
|
|
9221
9214
|
const { client } = useShipEngine();
|
|
9222
9215
|
return useMutation({
|
|
9223
|
-
mutationFn: (rateCardId) => __async$
|
|
9216
|
+
mutationFn: (rateCardId) => __async$c(void 0, null, function* () {
|
|
9224
9217
|
return yield client.rateCards.publish(rateCardId);
|
|
9225
9218
|
}),
|
|
9226
9219
|
mutationKey: ["usePublishRateCard"],
|
|
@@ -9228,7 +9221,7 @@ const usePublishRateCard = () => {
|
|
|
9228
9221
|
});
|
|
9229
9222
|
};
|
|
9230
9223
|
|
|
9231
|
-
var __async$
|
|
9224
|
+
var __async$b = (__this, __arguments, generator) => {
|
|
9232
9225
|
return new Promise((resolve, reject) => {
|
|
9233
9226
|
var fulfilled = (value) => {
|
|
9234
9227
|
try {
|
|
@@ -9251,7 +9244,7 @@ var __async$c = (__this, __arguments, generator) => {
|
|
|
9251
9244
|
const useUpdateRateCard = () => {
|
|
9252
9245
|
const { client } = useShipEngine();
|
|
9253
9246
|
return useMutation({
|
|
9254
|
-
mutationFn: (rateCard) => __async$
|
|
9247
|
+
mutationFn: (rateCard) => __async$b(void 0, null, function* () {
|
|
9255
9248
|
const result = yield client.rateCards.update(rateCard);
|
|
9256
9249
|
return result.data;
|
|
9257
9250
|
}),
|
|
@@ -9260,7 +9253,7 @@ const useUpdateRateCard = () => {
|
|
|
9260
9253
|
});
|
|
9261
9254
|
};
|
|
9262
9255
|
|
|
9263
|
-
var __async$
|
|
9256
|
+
var __async$a = (__this, __arguments, generator) => {
|
|
9264
9257
|
return new Promise((resolve, reject) => {
|
|
9265
9258
|
var fulfilled = (value) => {
|
|
9266
9259
|
try {
|
|
@@ -9283,7 +9276,7 @@ var __async$b = (__this, __arguments, generator) => {
|
|
|
9283
9276
|
const useUploadRateCard = () => {
|
|
9284
9277
|
const { client } = useShipEngine();
|
|
9285
9278
|
return useMutation({
|
|
9286
|
-
mutationFn: (_0) => __async$
|
|
9279
|
+
mutationFn: (_0) => __async$a(void 0, [_0], function* ({ rateCardId, file }) {
|
|
9287
9280
|
const result = yield client.rateCards.upload(rateCardId, file);
|
|
9288
9281
|
return result.data;
|
|
9289
9282
|
}),
|
|
@@ -9292,7 +9285,7 @@ const useUploadRateCard = () => {
|
|
|
9292
9285
|
});
|
|
9293
9286
|
};
|
|
9294
9287
|
|
|
9295
|
-
var __async$
|
|
9288
|
+
var __async$9 = (__this, __arguments, generator) => {
|
|
9296
9289
|
return new Promise((resolve, reject) => {
|
|
9297
9290
|
var fulfilled = (value) => {
|
|
9298
9291
|
try {
|
|
@@ -9315,7 +9308,7 @@ var __async$a = (__this, __arguments, generator) => {
|
|
|
9315
9308
|
const useDeleteRateCard = () => {
|
|
9316
9309
|
const { client } = useShipEngine();
|
|
9317
9310
|
return useMutation({
|
|
9318
|
-
mutationFn: (rateCardId) => __async$
|
|
9311
|
+
mutationFn: (rateCardId) => __async$9(void 0, null, function* () {
|
|
9319
9312
|
const result = yield client.rateCards.delete(rateCardId);
|
|
9320
9313
|
return result.data;
|
|
9321
9314
|
}),
|
|
@@ -9324,7 +9317,7 @@ const useDeleteRateCard = () => {
|
|
|
9324
9317
|
});
|
|
9325
9318
|
};
|
|
9326
9319
|
|
|
9327
|
-
var __async$
|
|
9320
|
+
var __async$8 = (__this, __arguments, generator) => {
|
|
9328
9321
|
return new Promise((resolve, reject) => {
|
|
9329
9322
|
var fulfilled = (value) => {
|
|
9330
9323
|
try {
|
|
@@ -9347,7 +9340,7 @@ var __async$9 = (__this, __arguments, generator) => {
|
|
|
9347
9340
|
const useCalculateRates = () => {
|
|
9348
9341
|
const { client } = useShipEngine();
|
|
9349
9342
|
return useMutation({
|
|
9350
|
-
mutationFn: (_0) => __async$
|
|
9343
|
+
mutationFn: (_0) => __async$8(void 0, [_0], function* ({ rateOptions, shipmentId }) {
|
|
9351
9344
|
const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
|
|
9352
9345
|
return result.data;
|
|
9353
9346
|
}),
|
|
@@ -9382,22 +9375,22 @@ const useListSalesOrders = (params = {}) => {
|
|
|
9382
9375
|
});
|
|
9383
9376
|
};
|
|
9384
9377
|
|
|
9385
|
-
var __getOwnPropSymbols$
|
|
9386
|
-
var __hasOwnProp$
|
|
9387
|
-
var __propIsEnum$
|
|
9378
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
9379
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
9380
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
9388
9381
|
var __objRest$5 = (source, exclude) => {
|
|
9389
9382
|
var target = {};
|
|
9390
9383
|
for (var prop in source)
|
|
9391
|
-
if (__hasOwnProp$
|
|
9384
|
+
if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9392
9385
|
target[prop] = source[prop];
|
|
9393
|
-
if (source != null && __getOwnPropSymbols$
|
|
9394
|
-
for (var prop of __getOwnPropSymbols$
|
|
9395
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9386
|
+
if (source != null && __getOwnPropSymbols$7)
|
|
9387
|
+
for (var prop of __getOwnPropSymbols$7(source)) {
|
|
9388
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
|
|
9396
9389
|
target[prop] = source[prop];
|
|
9397
9390
|
}
|
|
9398
9391
|
return target;
|
|
9399
9392
|
};
|
|
9400
|
-
var __async$
|
|
9393
|
+
var __async$7 = (__this, __arguments, generator) => {
|
|
9401
9394
|
return new Promise((resolve, reject) => {
|
|
9402
9395
|
var fulfilled = (value) => {
|
|
9403
9396
|
try {
|
|
@@ -9420,7 +9413,7 @@ var __async$8 = (__this, __arguments, generator) => {
|
|
|
9420
9413
|
const useNotifySalesOrderShipped = () => {
|
|
9421
9414
|
const { client } = useShipEngine();
|
|
9422
9415
|
return useMutation({
|
|
9423
|
-
mutationFn: (_a) => __async$
|
|
9416
|
+
mutationFn: (_a) => __async$7(void 0, null, function* () {
|
|
9424
9417
|
var _b = _a, { salesOrderId } = _b, tracking = __objRest$5(_b, ["salesOrderId"]);
|
|
9425
9418
|
const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
|
|
9426
9419
|
return result.data;
|
|
@@ -9430,22 +9423,22 @@ const useNotifySalesOrderShipped = () => {
|
|
|
9430
9423
|
});
|
|
9431
9424
|
};
|
|
9432
9425
|
|
|
9433
|
-
var __getOwnPropSymbols$
|
|
9434
|
-
var __hasOwnProp$
|
|
9435
|
-
var __propIsEnum$
|
|
9426
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
9427
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
9428
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
9436
9429
|
var __objRest$4 = (source, exclude) => {
|
|
9437
9430
|
var target = {};
|
|
9438
9431
|
for (var prop in source)
|
|
9439
|
-
if (__hasOwnProp$
|
|
9432
|
+
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9440
9433
|
target[prop] = source[prop];
|
|
9441
|
-
if (source != null && __getOwnPropSymbols$
|
|
9442
|
-
for (var prop of __getOwnPropSymbols$
|
|
9443
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9434
|
+
if (source != null && __getOwnPropSymbols$6)
|
|
9435
|
+
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
9436
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
9444
9437
|
target[prop] = source[prop];
|
|
9445
9438
|
}
|
|
9446
9439
|
return target;
|
|
9447
9440
|
};
|
|
9448
|
-
var __async$
|
|
9441
|
+
var __async$6 = (__this, __arguments, generator) => {
|
|
9449
9442
|
return new Promise((resolve, reject) => {
|
|
9450
9443
|
var fulfilled = (value) => {
|
|
9451
9444
|
try {
|
|
@@ -9468,7 +9461,7 @@ var __async$7 = (__this, __arguments, generator) => {
|
|
|
9468
9461
|
const useCreateSalesOrderShipment = () => {
|
|
9469
9462
|
const { client } = useShipEngine();
|
|
9470
9463
|
return useMutation({
|
|
9471
|
-
mutationFn: (_a) => __async$
|
|
9464
|
+
mutationFn: (_a) => __async$6(void 0, null, function* () {
|
|
9472
9465
|
var _b = _a, { salesOrderId } = _b, shipment = __objRest$4(_b, ["salesOrderId"]);
|
|
9473
9466
|
const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
|
|
9474
9467
|
return result.data;
|
|
@@ -9504,22 +9497,22 @@ const useListSalesOrderShipments = (params) => {
|
|
|
9504
9497
|
});
|
|
9505
9498
|
};
|
|
9506
9499
|
|
|
9507
|
-
var __getOwnPropSymbols$
|
|
9508
|
-
var __hasOwnProp$
|
|
9509
|
-
var __propIsEnum$
|
|
9500
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
9501
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
9502
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
9510
9503
|
var __objRest$3 = (source, exclude) => {
|
|
9511
9504
|
var target = {};
|
|
9512
9505
|
for (var prop in source)
|
|
9513
|
-
if (__hasOwnProp$
|
|
9506
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9514
9507
|
target[prop] = source[prop];
|
|
9515
|
-
if (source != null && __getOwnPropSymbols$
|
|
9516
|
-
for (var prop of __getOwnPropSymbols$
|
|
9517
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9508
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
9509
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
9510
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
9518
9511
|
target[prop] = source[prop];
|
|
9519
9512
|
}
|
|
9520
9513
|
return target;
|
|
9521
9514
|
};
|
|
9522
|
-
var __async$
|
|
9515
|
+
var __async$5 = (__this, __arguments, generator) => {
|
|
9523
9516
|
return new Promise((resolve, reject) => {
|
|
9524
9517
|
var fulfilled = (value) => {
|
|
9525
9518
|
try {
|
|
@@ -9542,7 +9535,7 @@ var __async$6 = (__this, __arguments, generator) => {
|
|
|
9542
9535
|
const useUpdateSalesOrderShipment = () => {
|
|
9543
9536
|
const { client } = useShipEngine();
|
|
9544
9537
|
return useMutation({
|
|
9545
|
-
mutationFn: (_a) => __async$
|
|
9538
|
+
mutationFn: (_a) => __async$5(void 0, null, function* () {
|
|
9546
9539
|
var _b = _a, { shipmentId } = _b, shipment = __objRest$3(_b, ["shipmentId"]);
|
|
9547
9540
|
const result = yield client.salesOrderShipments.update(shipmentId, shipment);
|
|
9548
9541
|
return result.data;
|
|
@@ -9552,26 +9545,26 @@ const useUpdateSalesOrderShipment = () => {
|
|
|
9552
9545
|
});
|
|
9553
9546
|
};
|
|
9554
9547
|
|
|
9555
|
-
var __defProp$
|
|
9548
|
+
var __defProp$2 = Object.defineProperty;
|
|
9556
9549
|
var __defProps = Object.defineProperties;
|
|
9557
9550
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9558
|
-
var __getOwnPropSymbols$
|
|
9559
|
-
var __hasOwnProp$
|
|
9560
|
-
var __propIsEnum$
|
|
9561
|
-
var __defNormalProp$
|
|
9562
|
-
var __spreadValues$
|
|
9551
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
9552
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
9553
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
9554
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9555
|
+
var __spreadValues$2 = (a, b) => {
|
|
9563
9556
|
for (var prop in b || (b = {}))
|
|
9564
|
-
if (__hasOwnProp$
|
|
9565
|
-
__defNormalProp$
|
|
9566
|
-
if (__getOwnPropSymbols$
|
|
9567
|
-
for (var prop of __getOwnPropSymbols$
|
|
9568
|
-
if (__propIsEnum$
|
|
9569
|
-
__defNormalProp$
|
|
9557
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
9558
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
9559
|
+
if (__getOwnPropSymbols$4)
|
|
9560
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
9561
|
+
if (__propIsEnum$4.call(b, prop))
|
|
9562
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
9570
9563
|
}
|
|
9571
9564
|
return a;
|
|
9572
9565
|
};
|
|
9573
9566
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
9574
|
-
var __async$
|
|
9567
|
+
var __async$4 = (__this, __arguments, generator) => {
|
|
9575
9568
|
return new Promise((resolve, reject) => {
|
|
9576
9569
|
var fulfilled = (value) => {
|
|
9577
9570
|
try {
|
|
@@ -9594,7 +9587,7 @@ var __async$5 = (__this, __arguments, generator) => {
|
|
|
9594
9587
|
const useCreateShipment = () => {
|
|
9595
9588
|
const { client } = useShipEngine();
|
|
9596
9589
|
return useMutation({
|
|
9597
|
-
mutationFn: (shipment) => __async$
|
|
9590
|
+
mutationFn: (shipment) => __async$4(void 0, null, function* () {
|
|
9598
9591
|
var _a;
|
|
9599
9592
|
if (shipment.warehouseId === void 0) {
|
|
9600
9593
|
throw new CodedError("errorMessages.noWarehouses", {
|
|
@@ -9612,7 +9605,7 @@ const useCreateShipment = () => {
|
|
|
9612
9605
|
postalCode: "",
|
|
9613
9606
|
stateProvince: ""
|
|
9614
9607
|
};
|
|
9615
|
-
return (yield client.shipments.create(__spreadProps(__spreadValues$
|
|
9608
|
+
return (yield client.shipments.create(__spreadProps(__spreadValues$2({}, shipment), {
|
|
9616
9609
|
shipTo
|
|
9617
9610
|
}))).data;
|
|
9618
9611
|
}),
|
|
@@ -9653,17 +9646,17 @@ const useGetShipment = (shipmentId) => {
|
|
|
9653
9646
|
});
|
|
9654
9647
|
};
|
|
9655
9648
|
|
|
9656
|
-
var __getOwnPropSymbols$
|
|
9657
|
-
var __hasOwnProp$
|
|
9658
|
-
var __propIsEnum$
|
|
9649
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
9650
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
9651
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
9659
9652
|
var __objRest$2 = (source, exclude) => {
|
|
9660
9653
|
var target = {};
|
|
9661
9654
|
for (var prop in source)
|
|
9662
|
-
if (__hasOwnProp$
|
|
9655
|
+
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9663
9656
|
target[prop] = source[prop];
|
|
9664
|
-
if (source != null && __getOwnPropSymbols$
|
|
9665
|
-
for (var prop of __getOwnPropSymbols$
|
|
9666
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9657
|
+
if (source != null && __getOwnPropSymbols$3)
|
|
9658
|
+
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
9659
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
9667
9660
|
target[prop] = source[prop];
|
|
9668
9661
|
}
|
|
9669
9662
|
return target;
|
|
@@ -9680,7 +9673,7 @@ const useListShipments = (_params) => {
|
|
|
9680
9673
|
});
|
|
9681
9674
|
};
|
|
9682
9675
|
|
|
9683
|
-
var __async$
|
|
9676
|
+
var __async$3 = (__this, __arguments, generator) => {
|
|
9684
9677
|
return new Promise((resolve, reject) => {
|
|
9685
9678
|
var fulfilled = (value) => {
|
|
9686
9679
|
try {
|
|
@@ -9703,7 +9696,7 @@ var __async$4 = (__this, __arguments, generator) => {
|
|
|
9703
9696
|
const useCreateWarehouse = () => {
|
|
9704
9697
|
const { client } = useShipEngine();
|
|
9705
9698
|
return useMutation({
|
|
9706
|
-
mutationFn: (data) => __async$
|
|
9699
|
+
mutationFn: (data) => __async$3(void 0, null, function* () {
|
|
9707
9700
|
const result = yield client.warehouses.create(data);
|
|
9708
9701
|
return result.data;
|
|
9709
9702
|
}),
|
|
@@ -9712,7 +9705,7 @@ const useCreateWarehouse = () => {
|
|
|
9712
9705
|
});
|
|
9713
9706
|
};
|
|
9714
9707
|
|
|
9715
|
-
var __async$
|
|
9708
|
+
var __async$2 = (__this, __arguments, generator) => {
|
|
9716
9709
|
return new Promise((resolve, reject) => {
|
|
9717
9710
|
var fulfilled = (value) => {
|
|
9718
9711
|
try {
|
|
@@ -9735,7 +9728,7 @@ var __async$3 = (__this, __arguments, generator) => {
|
|
|
9735
9728
|
const useDeleteWarehouse = () => {
|
|
9736
9729
|
const { client } = useShipEngine();
|
|
9737
9730
|
return useMutation({
|
|
9738
|
-
mutationFn: (_0) => __async$
|
|
9731
|
+
mutationFn: (_0) => __async$2(void 0, [_0], function* ({ warehouseId }) {
|
|
9739
9732
|
const result = yield client.warehouses.delete(warehouseId);
|
|
9740
9733
|
return result.data;
|
|
9741
9734
|
}),
|
|
@@ -9756,22 +9749,22 @@ const useListWarehouses = (options) => {
|
|
|
9756
9749
|
});
|
|
9757
9750
|
};
|
|
9758
9751
|
|
|
9759
|
-
var __getOwnPropSymbols$
|
|
9760
|
-
var __hasOwnProp$
|
|
9761
|
-
var __propIsEnum$
|
|
9752
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
9753
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
9754
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
9762
9755
|
var __objRest$1 = (source, exclude) => {
|
|
9763
9756
|
var target = {};
|
|
9764
9757
|
for (var prop in source)
|
|
9765
|
-
if (__hasOwnProp$
|
|
9758
|
+
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
9766
9759
|
target[prop] = source[prop];
|
|
9767
|
-
if (source != null && __getOwnPropSymbols$
|
|
9768
|
-
for (var prop of __getOwnPropSymbols$
|
|
9769
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9760
|
+
if (source != null && __getOwnPropSymbols$2)
|
|
9761
|
+
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
9762
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
9770
9763
|
target[prop] = source[prop];
|
|
9771
9764
|
}
|
|
9772
9765
|
return target;
|
|
9773
9766
|
};
|
|
9774
|
-
var __async$
|
|
9767
|
+
var __async$1 = (__this, __arguments, generator) => {
|
|
9775
9768
|
return new Promise((resolve, reject) => {
|
|
9776
9769
|
var fulfilled = (value) => {
|
|
9777
9770
|
try {
|
|
@@ -9794,7 +9787,7 @@ var __async$2 = (__this, __arguments, generator) => {
|
|
|
9794
9787
|
const useUpdateWarehouse = () => {
|
|
9795
9788
|
const { client } = useShipEngine();
|
|
9796
9789
|
return useMutation({
|
|
9797
|
-
mutationFn: (_a) => __async$
|
|
9790
|
+
mutationFn: (_a) => __async$1(void 0, null, function* () {
|
|
9798
9791
|
var _b = _a, { warehouseId } = _b, warehouse = __objRest$1(_b, ["warehouseId"]);
|
|
9799
9792
|
const result = yield client.warehouses.update(warehouseId, warehouse);
|
|
9800
9793
|
return result.data;
|
|
@@ -10164,56 +10157,6 @@ const themeData = {
|
|
|
10164
10157
|
fallback: fallbackThemeData
|
|
10165
10158
|
};
|
|
10166
10159
|
|
|
10167
|
-
var __async$1 = (__this, __arguments, generator) => {
|
|
10168
|
-
return new Promise((resolve, reject) => {
|
|
10169
|
-
var fulfilled = (value) => {
|
|
10170
|
-
try {
|
|
10171
|
-
step(generator.next(value));
|
|
10172
|
-
} catch (e) {
|
|
10173
|
-
reject(e);
|
|
10174
|
-
}
|
|
10175
|
-
};
|
|
10176
|
-
var rejected = (value) => {
|
|
10177
|
-
try {
|
|
10178
|
-
step(generator.throw(value));
|
|
10179
|
-
} catch (e) {
|
|
10180
|
-
reject(e);
|
|
10181
|
-
}
|
|
10182
|
-
};
|
|
10183
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
10184
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
10185
|
-
});
|
|
10186
|
-
};
|
|
10187
|
-
const useLoadFonts = ({ cdnURL = "/", scope, theme }) => {
|
|
10188
|
-
const [fontFamily, setFontFamily] = useState();
|
|
10189
|
-
useEffect(() => {
|
|
10190
|
-
(() => __async$1(void 0, null, function* () {
|
|
10191
|
-
var _a;
|
|
10192
|
-
try {
|
|
10193
|
-
const fontFaces = (_a = theme == null ? void 0 : theme.fontFaces) != null ? _a : [];
|
|
10194
|
-
yield Promise.all(
|
|
10195
|
-
fontFaces.map((_0) => __async$1(void 0, [_0], function* ({ family, source, descriptors }) {
|
|
10196
|
-
const fontSources = source.map((url) => `url(${url.replace("$cdnUrl", cdnURL)})`).join(", ");
|
|
10197
|
-
try {
|
|
10198
|
-
const font = new FontFace(family, fontSources, descriptors);
|
|
10199
|
-
const loadedFont = yield font.load();
|
|
10200
|
-
document.fonts.add(loadedFont);
|
|
10201
|
-
} catch (err) {
|
|
10202
|
-
console.error(err);
|
|
10203
|
-
}
|
|
10204
|
-
}))
|
|
10205
|
-
);
|
|
10206
|
-
setFontFamily(theme == null ? void 0 : theme.defaultFontFamily);
|
|
10207
|
-
} catch (error) {
|
|
10208
|
-
logger.error({ error }, `Error loading fonts`);
|
|
10209
|
-
}
|
|
10210
|
-
}))();
|
|
10211
|
-
}, [cdnURL, theme]);
|
|
10212
|
-
return css({
|
|
10213
|
-
[`.${scope}`]: { fontFamily }
|
|
10214
|
-
});
|
|
10215
|
-
};
|
|
10216
|
-
|
|
10217
10160
|
const fallbackBrandName = "fallback";
|
|
10218
10161
|
const constants = {
|
|
10219
10162
|
fallbackBrandName
|
|
@@ -10256,28 +10199,49 @@ const useLoadIcons = ({ cdnURL = "/" }) => {
|
|
|
10256
10199
|
);
|
|
10257
10200
|
};
|
|
10258
10201
|
|
|
10202
|
+
const DEFAULT_LOCALE = "en-US";
|
|
10259
10203
|
const AlchemyContext = createContext(void 0);
|
|
10204
|
+
const getDefaultLocale = () => {
|
|
10205
|
+
var _a;
|
|
10206
|
+
if (typeof window === "undefined") {
|
|
10207
|
+
return DEFAULT_LOCALE;
|
|
10208
|
+
}
|
|
10209
|
+
return (_a = navigator == null ? void 0 : navigator.language) != null ? _a : DEFAULT_LOCALE;
|
|
10210
|
+
};
|
|
10260
10211
|
const AlchemyProvider = ({
|
|
10261
10212
|
baseURL = "https://api.shipengine.com",
|
|
10262
10213
|
cdnURL = "/",
|
|
10214
|
+
container,
|
|
10263
10215
|
children,
|
|
10264
10216
|
getToken,
|
|
10265
|
-
locale
|
|
10217
|
+
locale: localeProp,
|
|
10266
10218
|
onError = _default,
|
|
10267
10219
|
scope = "lmnt",
|
|
10268
10220
|
themeConfig
|
|
10269
10221
|
}) => {
|
|
10270
|
-
const
|
|
10271
|
-
const fontStyles = useLoadFonts({ cdnURL, scope, theme });
|
|
10222
|
+
const locale = localeProp || getDefaultLocale();
|
|
10272
10223
|
const resolveIcon = useLoadIcons({ cdnURL });
|
|
10273
|
-
const
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10224
|
+
const theme = new Theme(themeConfig != null ? themeConfig : themeData.fallback);
|
|
10225
|
+
const contextValue = {
|
|
10226
|
+
baseURL,
|
|
10227
|
+
cdnURL,
|
|
10228
|
+
container,
|
|
10229
|
+
getToken,
|
|
10230
|
+
locale,
|
|
10231
|
+
onError,
|
|
10232
|
+
scope,
|
|
10233
|
+
theme
|
|
10234
|
+
};
|
|
10235
|
+
return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
10236
|
+
GigerProvider,
|
|
10237
|
+
{
|
|
10238
|
+
reference: scope || void 0,
|
|
10239
|
+
cdnUrl: cdnURL,
|
|
10240
|
+
resolveIcon,
|
|
10241
|
+
theme,
|
|
10242
|
+
children: /* @__PURE__ */ jsx(ShipEngine, { baseURL, getToken, children })
|
|
10243
|
+
}
|
|
10244
|
+
) });
|
|
10281
10245
|
};
|
|
10282
10246
|
const useAlchemy = () => {
|
|
10283
10247
|
const context = useContext(AlchemyContext);
|
|
@@ -10813,22 +10777,66 @@ const useI18n = ({ resources }) => {
|
|
|
10813
10777
|
}, [resources]);
|
|
10814
10778
|
};
|
|
10815
10779
|
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10780
|
+
var __defProp$1 = Object.defineProperty;
|
|
10781
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
10782
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
10783
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
10784
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10785
|
+
var __spreadValues$1 = (a, b) => {
|
|
10786
|
+
for (var prop in b || (b = {}))
|
|
10787
|
+
if (__hasOwnProp$1.call(b, prop))
|
|
10788
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
10789
|
+
if (__getOwnPropSymbols$1)
|
|
10790
|
+
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
10791
|
+
if (__propIsEnum$1.call(b, prop))
|
|
10792
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
10825
10793
|
}
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10794
|
+
return a;
|
|
10795
|
+
};
|
|
10796
|
+
const getScopeSelectors = (className) => (...[element]) => {
|
|
10797
|
+
if ((element == null ? void 0 : element.type) === "rule" && (element == null ? void 0 : element.value.startsWith(".css"))) {
|
|
10798
|
+
element.props = [element.props].flat().map((value) => {
|
|
10799
|
+
if (value.includes(className))
|
|
10800
|
+
return value;
|
|
10801
|
+
return `${className} ${value}`;
|
|
10802
|
+
});
|
|
10803
|
+
}
|
|
10804
|
+
};
|
|
10805
|
+
class EmotionScopeCacheForContainer {
|
|
10806
|
+
constructor(container) {
|
|
10807
|
+
this.container = container;
|
|
10808
|
+
this.cacheByScope = /* @__PURE__ */ new Map();
|
|
10809
|
+
this.initializeCacheForScope = (scope) => {
|
|
10810
|
+
const emotionCache = createCache(__spreadValues$1({
|
|
10811
|
+
key: "css",
|
|
10812
|
+
stylisPlugins: [getScopeSelectors(`.${scope}`), prefixer$1]
|
|
10813
|
+
}, this.container && { container: this.container, prepend: true }));
|
|
10814
|
+
this.cacheByScope.set(scope, emotionCache);
|
|
10815
|
+
return emotionCache;
|
|
10816
|
+
};
|
|
10817
|
+
this.getEmotionCache = (scope) => {
|
|
10818
|
+
var _a;
|
|
10819
|
+
return (_a = this.cacheByScope.get(scope)) != null ? _a : this.initializeCacheForScope(scope);
|
|
10820
|
+
};
|
|
10821
|
+
}
|
|
10822
|
+
}
|
|
10823
|
+
class EmotionScopeContainerCache {
|
|
10824
|
+
constructor() {
|
|
10825
|
+
// allow undefined element for normal no container scope group
|
|
10826
|
+
this.scopeGroupByContainer = /* @__PURE__ */ new Map();
|
|
10827
|
+
this.getEmotionCache = (scope, container) => {
|
|
10828
|
+
var _a;
|
|
10829
|
+
const scopeGroup = (_a = this.scopeGroupByContainer.get(container)) != null ? _a : this.initializeScopeCacheForContainer(container);
|
|
10830
|
+
return scopeGroup.getEmotionCache(scope);
|
|
10831
|
+
};
|
|
10832
|
+
}
|
|
10833
|
+
initializeScopeCacheForContainer(container) {
|
|
10834
|
+
const scopeGroup = new EmotionScopeCacheForContainer(container);
|
|
10835
|
+
this.scopeGroupByContainer.set(container, scopeGroup);
|
|
10836
|
+
return scopeGroup;
|
|
10837
|
+
}
|
|
10838
|
+
}
|
|
10839
|
+
const { getEmotionCache } = new EmotionScopeContainerCache();
|
|
10832
10840
|
|
|
10833
10841
|
const Element = ({
|
|
10834
10842
|
children,
|
|
@@ -10836,10 +10844,11 @@ const Element = ({
|
|
|
10836
10844
|
fallback: FallbackComponent,
|
|
10837
10845
|
resources
|
|
10838
10846
|
}) => {
|
|
10839
|
-
const { scope, onError } = useAlchemy();
|
|
10847
|
+
const { scope, onError, container } = useAlchemy();
|
|
10840
10848
|
const i18n = useI18n({ resources });
|
|
10841
10849
|
const elementContainerRef = useRef(null);
|
|
10842
|
-
|
|
10850
|
+
const renderProviders = () => /* @__PURE__ */ jsx(I18nextProvider, { i18n, children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: FallbackComponent, onError, children }) });
|
|
10851
|
+
return /* @__PURE__ */ jsx("div", { className: cx(scope, className), "data-testid": scope, ref: elementContainerRef, children: /* @__PURE__ */ jsx(DefaultPortalRefProvider, { portalRef: elementContainerRef, children: scope ? /* @__PURE__ */ jsx(CacheProvider, { value: getEmotionCache(scope, container), children: renderProviders() }) : renderProviders() }) });
|
|
10843
10852
|
};
|
|
10844
10853
|
|
|
10845
10854
|
var __defProp = Object.defineProperty;
|
|
@@ -10903,4 +10912,4 @@ const alchemy = {
|
|
|
10903
10912
|
createElement
|
|
10904
10913
|
};
|
|
10905
10914
|
|
|
10906
|
-
export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEndUserIpAddress, isCodedError, isCodedErrors, logger,
|
|
10915
|
+
export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, logger, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateWarehouse, useDeleteRateCard, useDeleteWarehouse, useDownloadRateCard, useFundingSourcesAddFunds, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetWalletHistory, useGetZonesByCarrier, useI18n, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListWarehouses, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
|