@anker-in/shopify-react 0.1.1-beta.2 → 0.1.1-beta.20
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/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/index.d.ts +2 -2
- package/dist/hooks/index.d.mts +1879 -9
- package/dist/hooks/index.d.ts +1879 -9
- package/dist/hooks/index.js +358 -140
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +354 -138
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +380 -166
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +371 -141
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +9 -9
- package/dist/provider/index.d.ts +9 -9
- package/dist/provider/index.js +215 -73
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +214 -72
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-CICUnw0v.d.mts → types-C1So3siD.d.mts} +6 -18
- package/dist/{types-CICUnw0v.d.ts → types-C1So3siD.d.ts} +6 -18
- package/dist/{types-BLMoxbOk.d.mts → types-Dt0DUG00.d.mts} +1 -9
- package/dist/{types-BLMoxbOk.d.ts → types-Dt0DUG00.d.ts} +1 -9
- package/package.json +3 -3
- package/dist/index-BZ6WbAdZ.d.ts +0 -1889
- package/dist/index-Bea95u2X.d.mts +0 -1889
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, useMemo, useRef, useState, useEffect, useCallback, useContext } from 'react';
|
|
2
2
|
import useSWRMutation from 'swr/mutation';
|
|
3
|
-
import { getProductsByHandles, createCart, updateCartCodes, addCartLines, updateCartLines, removeCartLines, updateCartAttributes, getProduct, getAllProducts, getCollection, getAllCollections, getCollections, getBlog, getAllBlogs, getArticle, getArticles, getArticlesInBlog,
|
|
3
|
+
import { atobID, btoaID, getProductsByHandles, createCart, updateCartCodes, addCartLines, updateCartLines, removeCartLines, updateCartAttributes, getLocalStorage, getProduct, getAllProducts, getCollection, getAllCollections, getCollections, getBlog, getAllBlogs, getArticle, getArticles, getArticlesInBlog, setLocalStorage, updateCartDeliveryOptions } from '@anker-in/shopify-sdk';
|
|
4
4
|
import Cookies5 from 'js-cookie';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import Decimal2 from 'decimal.js';
|
|
@@ -62,6 +62,81 @@ var CODE_AMOUNT_KEY = "_sku_code_money";
|
|
|
62
62
|
var SCRIPT_CODE_AMOUNT_KEY = "_code_money";
|
|
63
63
|
var MAIN_PRODUCT_CODE = ["WS24", "WSTD", "WS7D", "WSCP", "WSPE", "WSPD"];
|
|
64
64
|
|
|
65
|
+
// src/hooks/cart/utils/normalize-add-to-cart-lines.ts
|
|
66
|
+
function normalizeAddToCartLines(lines) {
|
|
67
|
+
return lines.filter((line) => line.variant?.id).map((line, index) => {
|
|
68
|
+
const variant = line.variant;
|
|
69
|
+
const product = variant.product;
|
|
70
|
+
const quantity = line.quantity || 1;
|
|
71
|
+
const price = variant.finalPrice?.amount ? Number(variant.finalPrice.amount) : variant.compareAtPrice?.amount ? Number(variant.compareAtPrice.amount) : variant.price?.amount ? Number(variant.price.amount) : 0;
|
|
72
|
+
const subtotalAmount = price * quantity;
|
|
73
|
+
const totalAmount = subtotalAmount;
|
|
74
|
+
return {
|
|
75
|
+
id: `temp-line-${index}-${variant.id}`,
|
|
76
|
+
// Temporary ID for pre-cart lines
|
|
77
|
+
name: product?.title || variant.title || "",
|
|
78
|
+
quantity,
|
|
79
|
+
variantId: variant.id,
|
|
80
|
+
productId: product?.id || variant.id.split("/").slice(0, -2).join("/"),
|
|
81
|
+
totalAmount,
|
|
82
|
+
subtotalAmount,
|
|
83
|
+
discountAllocations: [],
|
|
84
|
+
customAttributes: line.attributes || [],
|
|
85
|
+
variant: {
|
|
86
|
+
id: variant.id,
|
|
87
|
+
price,
|
|
88
|
+
listPrice: variant.compareAtPrice?.amount ? Number(variant.compareAtPrice.amount) : 0,
|
|
89
|
+
sku: variant.sku || "",
|
|
90
|
+
name: variant.title || "",
|
|
91
|
+
image: variant.image ? {
|
|
92
|
+
url: variant.image.url,
|
|
93
|
+
altText: variant.image.altText || void 0
|
|
94
|
+
} : void 0,
|
|
95
|
+
requiresShipping: false,
|
|
96
|
+
// Default value, not available in NormalizedProductVariant
|
|
97
|
+
availableForSale: variant.availableForSale ?? true,
|
|
98
|
+
quantityAvailable: variant.quantityAvailable ?? 0,
|
|
99
|
+
currentlyNotInStock: false,
|
|
100
|
+
// Default value, will be updated when added to cart
|
|
101
|
+
weight: variant.weight,
|
|
102
|
+
metafields: variant.metafields
|
|
103
|
+
},
|
|
104
|
+
product,
|
|
105
|
+
path: product?.handle ? `/products/${product.handle}` : "",
|
|
106
|
+
discounts: [],
|
|
107
|
+
options: variant.selectedOptions?.map((opt) => ({
|
|
108
|
+
name: opt.name,
|
|
109
|
+
value: opt.value
|
|
110
|
+
}))
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function createMockCartFromLines(lines, existingCart) {
|
|
115
|
+
const normalizedLines = normalizeAddToCartLines(lines);
|
|
116
|
+
const subtotalPrice = normalizedLines.reduce((sum, line) => sum + line.subtotalAmount, 0);
|
|
117
|
+
const totalPrice = normalizedLines.reduce((sum, line) => sum + line.totalAmount, 0);
|
|
118
|
+
return {
|
|
119
|
+
id: existingCart?.id || "temp-cart-id",
|
|
120
|
+
customerId: existingCart?.customerId,
|
|
121
|
+
email: existingCart?.email,
|
|
122
|
+
createdAt: existingCart?.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
123
|
+
currency: existingCart?.currency || { code: "USD" },
|
|
124
|
+
taxesIncluded: existingCart?.taxesIncluded,
|
|
125
|
+
lineItems: normalizedLines,
|
|
126
|
+
totalLineItemsDiscount: 0,
|
|
127
|
+
orderDiscounts: 0,
|
|
128
|
+
lineItemsSubtotalPrice: subtotalPrice,
|
|
129
|
+
subtotalPrice,
|
|
130
|
+
totalPrice,
|
|
131
|
+
totalTaxAmount: 0,
|
|
132
|
+
discountCodes: existingCart?.discountCodes || [],
|
|
133
|
+
discountAllocations: [],
|
|
134
|
+
url: existingCart?.url || "",
|
|
135
|
+
ready: true,
|
|
136
|
+
customAttributes: existingCart?.customAttributes
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
65
140
|
// src/hooks/cart/utils/index.ts
|
|
66
141
|
var getQuery = () => {
|
|
67
142
|
const url = typeof window !== "undefined" ? window.location.search : "";
|
|
@@ -79,16 +154,6 @@ var getQuery = () => {
|
|
|
79
154
|
}
|
|
80
155
|
return theRequest;
|
|
81
156
|
};
|
|
82
|
-
function atobID(id) {
|
|
83
|
-
if (id && typeof id === "string" && id.includes("/")) {
|
|
84
|
-
return id.split("/").pop()?.split("?")?.shift();
|
|
85
|
-
} else {
|
|
86
|
-
return id;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function btoaID(id, type = "ProductVariant") {
|
|
90
|
-
return `gid://shopify/${type}/${id}`;
|
|
91
|
-
}
|
|
92
157
|
var getMatchedMainProductSubTotal = (cartData, variant_list, main_product) => {
|
|
93
158
|
const isAllStoreVariant = main_product?.all_store_variant ?? false;
|
|
94
159
|
const matchedList = cartData?.lineItems?.filter((line) => {
|
|
@@ -286,12 +351,18 @@ var formatFunctionAutoFreeGift = ({
|
|
|
286
351
|
};
|
|
287
352
|
return result;
|
|
288
353
|
};
|
|
289
|
-
var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
354
|
+
var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer, lines) => {
|
|
290
355
|
const tags = useMemo(() => customer?.tags || [], [customer?.tags]);
|
|
291
356
|
const isCustomerLoading = useMemo(() => !customer ? true : false, [customer]);
|
|
292
357
|
const dealsType = "";
|
|
293
358
|
const { client, locale } = useShopify();
|
|
294
359
|
const giftProductsCache = useRef(null);
|
|
360
|
+
const effectiveCart = useMemo(() => {
|
|
361
|
+
if (lines && lines.length > 0) {
|
|
362
|
+
return createMockCartFromLines(lines, cart);
|
|
363
|
+
}
|
|
364
|
+
return cart;
|
|
365
|
+
}, [lines, cart]);
|
|
295
366
|
const { activeCampaign, subtotal } = useMemo(() => {
|
|
296
367
|
for (const campaign of autoFreeGiftConfig) {
|
|
297
368
|
const { rule_conditions = [], rule_result } = campaign;
|
|
@@ -299,7 +370,7 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
|
299
370
|
const isPreCheckPassed = preCheck(rule_conditions, tags, []);
|
|
300
371
|
if (isPreCheckPassed && spend_get_reward) {
|
|
301
372
|
const matchedSubtotal = getMatchedMainProductSubTotal(
|
|
302
|
-
|
|
373
|
+
effectiveCart,
|
|
303
374
|
spend_get_reward.main_product?.variant_list?.map((v) => v.variant_id) || [],
|
|
304
375
|
{
|
|
305
376
|
spend_money_type: spend_get_reward.main_product?.spend_money_type || 1,
|
|
@@ -313,13 +384,13 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
|
313
384
|
}
|
|
314
385
|
}
|
|
315
386
|
return { activeCampaign: null, subtotal: 0 };
|
|
316
|
-
}, [autoFreeGiftConfig,
|
|
387
|
+
}, [autoFreeGiftConfig, effectiveCart, tags, dealsType]);
|
|
317
388
|
const { qualifyingGift, nextTierGoal } = useMemo(() => {
|
|
318
389
|
if (!activeCampaign || !activeCampaign.rule_result?.spend_get_reward?.gift_product) {
|
|
319
390
|
return { qualifyingGift: null, nextTierGoal: null };
|
|
320
391
|
}
|
|
321
392
|
const giftTiers = activeCampaign.rule_result.spend_get_reward.gift_product;
|
|
322
|
-
const qualifyingTier = [...giftTiers].
|
|
393
|
+
const qualifyingTier = [...giftTiers].sort((a, b) => Number(b.spend_sum_money) - Number(a.spend_sum_money)).find((tier) => subtotal >= Number(tier.spend_sum_money));
|
|
323
394
|
const nextGoal = giftTiers.find((tier) => subtotal < Number(tier.spend_sum_money));
|
|
324
395
|
if (!qualifyingTier) {
|
|
325
396
|
return { qualifyingGift: null, nextTierGoal: nextGoal || null };
|
|
@@ -366,18 +437,24 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
|
366
437
|
}
|
|
367
438
|
return true;
|
|
368
439
|
}, [giftHandles]);
|
|
369
|
-
const { data: giftProductsResult } = useSWR(
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
440
|
+
const { data: giftProductsResult } = useSWR(
|
|
441
|
+
shouldFetch ? giftHandles : null,
|
|
442
|
+
async () => {
|
|
443
|
+
const res = await getProductsByHandles(client, {
|
|
444
|
+
handles: giftHandles,
|
|
445
|
+
locale
|
|
446
|
+
});
|
|
447
|
+
const result = Array.isArray(res) ? res : [];
|
|
448
|
+
giftProductsCache.current = {
|
|
449
|
+
data: result,
|
|
450
|
+
giftHandles: [...giftHandles]
|
|
451
|
+
};
|
|
452
|
+
return result;
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
revalidateOnFocus: false
|
|
456
|
+
}
|
|
457
|
+
);
|
|
381
458
|
const finalGiftProductsResult = useMemo(() => {
|
|
382
459
|
if (giftProductsCache.current && !shouldFetch) {
|
|
383
460
|
return giftProductsCache.current.data || void 0;
|
|
@@ -396,12 +473,19 @@ var useScriptAutoFreeGift = ({
|
|
|
396
473
|
campaign,
|
|
397
474
|
_giveaway,
|
|
398
475
|
cart,
|
|
399
|
-
locale: providedLocale
|
|
476
|
+
locale: providedLocale,
|
|
477
|
+
lines
|
|
400
478
|
}) => {
|
|
401
479
|
const { client, locale: contextLocale } = useShopify();
|
|
402
480
|
const locale = providedLocale || contextLocale;
|
|
403
481
|
const [points_subscribe, set_points_subscribe] = useState(false);
|
|
404
482
|
const giftProductsCache = useRef(null);
|
|
483
|
+
const effectiveCart = useMemo(() => {
|
|
484
|
+
if (lines && lines.length > 0) {
|
|
485
|
+
return createMockCartFromLines(lines, cart);
|
|
486
|
+
}
|
|
487
|
+
return cart;
|
|
488
|
+
}, [lines, cart]);
|
|
405
489
|
useEffect(() => {
|
|
406
490
|
if (locale === "au") {
|
|
407
491
|
const isPointsSubscribe = Cookies5.get("points_subscribe");
|
|
@@ -423,14 +507,16 @@ var useScriptAutoFreeGift = ({
|
|
|
423
507
|
upgrade_multiple2 = 1.2;
|
|
424
508
|
upgrade_value2 = 40;
|
|
425
509
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
510
|
+
effectiveCart?.lineItems?.forEach(
|
|
511
|
+
({ customAttributes }) => {
|
|
512
|
+
customAttributes?.forEach(({ key, value }) => {
|
|
513
|
+
if (key === "_amount_upgrade_multiple") upgrade_multiple2 = Number(value) || 1;
|
|
514
|
+
if (key === "_amount_upgrade_value") upgrade_value2 = Number(value) || 0;
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
);
|
|
432
518
|
return [upgrade_multiple2, upgrade_value2];
|
|
433
|
-
}, [
|
|
519
|
+
}, [effectiveCart?.lineItems, points_subscribe]);
|
|
434
520
|
const breakpoints = useMemo(() => {
|
|
435
521
|
if (!isActivityAvailable) return [];
|
|
436
522
|
return (campaign?.breakpoints || []).map((item) => ({
|
|
@@ -458,7 +544,7 @@ var useScriptAutoFreeGift = ({
|
|
|
458
544
|
}, [giftHandles]);
|
|
459
545
|
const involvedLines = useMemo(() => {
|
|
460
546
|
if (!isActivityAvailable) return [];
|
|
461
|
-
return (
|
|
547
|
+
return (effectiveCart?.lineItems || []).filter((line) => {
|
|
462
548
|
const isNotGift = line?.totalAmount && Number(line.totalAmount) > 0 && line.customAttributes?.every(
|
|
463
549
|
(item) => item.key !== _giveaway
|
|
464
550
|
);
|
|
@@ -467,7 +553,7 @@ var useScriptAutoFreeGift = ({
|
|
|
467
553
|
);
|
|
468
554
|
return isNotGift && hasCampaignTag;
|
|
469
555
|
});
|
|
470
|
-
}, [
|
|
556
|
+
}, [effectiveCart?.lineItems, isActivityAvailable, _giveaway]);
|
|
471
557
|
const involvedSubTotal = useMemo(() => {
|
|
472
558
|
if (!isActivityAvailable) return new Decimal2(0);
|
|
473
559
|
return involvedLines.reduce((prev, item) => {
|
|
@@ -493,18 +579,24 @@ var useScriptAutoFreeGift = ({
|
|
|
493
579
|
const nextLevel = levelIndex > 0 ? sortedLevels[levelIndex - 1] ?? null : null;
|
|
494
580
|
return [currentLevel, nextLevel];
|
|
495
581
|
}, [breakpoints, involvedSubTotal, involvedLines.length]);
|
|
496
|
-
const { data: giftProductsResult } = useSWR(
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
582
|
+
const { data: giftProductsResult } = useSWR(
|
|
583
|
+
shouldFetch ? giftHandles : null,
|
|
584
|
+
async () => {
|
|
585
|
+
const res = await getProductsByHandles(client, {
|
|
586
|
+
handles: giftHandles,
|
|
587
|
+
locale
|
|
588
|
+
});
|
|
589
|
+
const result = Array.isArray(res) ? res : [];
|
|
590
|
+
giftProductsCache.current = {
|
|
591
|
+
data: result,
|
|
592
|
+
giftHandles: [...giftHandles]
|
|
593
|
+
};
|
|
594
|
+
return result;
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
revalidateOnFocus: false
|
|
598
|
+
}
|
|
599
|
+
);
|
|
508
600
|
const finalGiftProductsResult = useMemo(() => {
|
|
509
601
|
if (giftProductsCache.current && !shouldFetch) {
|
|
510
602
|
return giftProductsCache.current.data || void 0;
|
|
@@ -742,7 +834,7 @@ function useApplyCartCodes(options) {
|
|
|
742
834
|
if (!discountCodes?.length) {
|
|
743
835
|
throw new Error("Invalid input used for this operation: Miss discountCode");
|
|
744
836
|
}
|
|
745
|
-
const cartId = providedCartId
|
|
837
|
+
const cartId = providedCartId || cart?.id;
|
|
746
838
|
if (!cartId) {
|
|
747
839
|
return void 0;
|
|
748
840
|
}
|
|
@@ -770,7 +862,7 @@ function useRemoveCartCodes(options) {
|
|
|
770
862
|
const removeCodes = useCallback(
|
|
771
863
|
async (_key, { arg }) => {
|
|
772
864
|
const { cartId: providedCartId, discountCodes } = arg;
|
|
773
|
-
const cartId = providedCartId
|
|
865
|
+
const cartId = providedCartId || cart?.id;
|
|
774
866
|
const codes = cart?.discountCodes?.filter((code) => !!code.applicable) || [];
|
|
775
867
|
const leftCodes = codes.filter((code) => discountCodes?.length ? !discountCodes.includes(code.code) : code.code).map((code) => code.code);
|
|
776
868
|
const updatedCart = await updateCartCodes(client, {
|
|
@@ -792,7 +884,7 @@ function useRemoveCartCodes(options) {
|
|
|
792
884
|
// src/hooks/cart/use-add-to-cart.ts
|
|
793
885
|
function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
794
886
|
const { client, config, locale, cartCookieAdapter, userAdapter } = useShopify();
|
|
795
|
-
const { cart } = useCartContext();
|
|
887
|
+
const { cart, addCustomAttributes } = useCartContext();
|
|
796
888
|
const { trigger: applyCartCodes } = useApplyCartCodes();
|
|
797
889
|
const { trigger: removeInvalidCodes } = useRemoveCartCodes();
|
|
798
890
|
const { trigger: addCartLines2 } = useAddCartLines();
|
|
@@ -806,7 +898,8 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
806
898
|
buyerIdentity,
|
|
807
899
|
needCreateCart = false,
|
|
808
900
|
onCodesInvalid,
|
|
809
|
-
replaceExistingCodes
|
|
901
|
+
replaceExistingCodes,
|
|
902
|
+
customAttributes
|
|
810
903
|
} = arg;
|
|
811
904
|
if (!lineItems || lineItems.length === 0) {
|
|
812
905
|
return;
|
|
@@ -829,6 +922,7 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
829
922
|
if (!resultCart) {
|
|
830
923
|
return void 0;
|
|
831
924
|
}
|
|
925
|
+
console.log("npm addCartLines resultCart", resultCart);
|
|
832
926
|
if (resultCart.discountCodes && resultCart.discountCodes.length > 0) {
|
|
833
927
|
const unapplicableCodes = resultCart.discountCodes.filter((item) => !item.applicable).map((item) => item.code);
|
|
834
928
|
if (unapplicableCodes.length > 0) {
|
|
@@ -850,6 +944,9 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
850
944
|
discountCodes
|
|
851
945
|
});
|
|
852
946
|
}
|
|
947
|
+
if (customAttributes && customAttributes.length > 0) {
|
|
948
|
+
addCustomAttributes(customAttributes);
|
|
949
|
+
}
|
|
853
950
|
if (withTrack) {
|
|
854
951
|
trackAddToCartGA({
|
|
855
952
|
lineItems,
|
|
@@ -1002,6 +1099,60 @@ function useBuyNow({ withTrack = true } = {}, swrOptions) {
|
|
|
1002
1099
|
);
|
|
1003
1100
|
return useSWRMutation("buy-now", buyNow, swrOptions);
|
|
1004
1101
|
}
|
|
1102
|
+
function useCalcGiftsFromLines({
|
|
1103
|
+
lines,
|
|
1104
|
+
customer,
|
|
1105
|
+
scriptGiveawayKey = CUSTOMER_SCRIPT_GIFT_KEY
|
|
1106
|
+
}) {
|
|
1107
|
+
const { locale } = useShopify();
|
|
1108
|
+
const { cart, autoFreeGiftConfig, gradientGiftsConfig } = useCartContext();
|
|
1109
|
+
const functionGift = useCalcAutoFreeGift(cart, autoFreeGiftConfig || [], customer, lines);
|
|
1110
|
+
const scriptGift = useScriptAutoFreeGift({
|
|
1111
|
+
campaign: gradientGiftsConfig || null,
|
|
1112
|
+
_giveaway: scriptGiveawayKey,
|
|
1113
|
+
cart,
|
|
1114
|
+
locale,
|
|
1115
|
+
lines
|
|
1116
|
+
});
|
|
1117
|
+
const allGiftLines = useMemo(() => {
|
|
1118
|
+
const functionGiftLines = functionGift.qualifyingGift?.itemsToAdd || [];
|
|
1119
|
+
const scriptGiftLines = scriptGift.freeGiftLevel ? scriptGift.freeGiftLevel.giveawayProducts.map((product) => {
|
|
1120
|
+
const giftProduct = scriptGift.giftProductsResult?.find(
|
|
1121
|
+
(p) => p.handle === product.handle
|
|
1122
|
+
);
|
|
1123
|
+
const variant = giftProduct?.variants?.[0];
|
|
1124
|
+
return {
|
|
1125
|
+
variant: {
|
|
1126
|
+
id: variant?.id || "",
|
|
1127
|
+
handle: product.handle,
|
|
1128
|
+
sku: product.sku
|
|
1129
|
+
},
|
|
1130
|
+
quantity: 1,
|
|
1131
|
+
attributes: [
|
|
1132
|
+
{
|
|
1133
|
+
key: scriptGiveawayKey,
|
|
1134
|
+
value: "true"
|
|
1135
|
+
}
|
|
1136
|
+
]
|
|
1137
|
+
};
|
|
1138
|
+
}).filter((item) => item.variant.id) : [];
|
|
1139
|
+
return [...functionGiftLines, ...scriptGiftLines];
|
|
1140
|
+
}, [
|
|
1141
|
+
functionGift.qualifyingGift,
|
|
1142
|
+
scriptGift.freeGiftLevel,
|
|
1143
|
+
scriptGift.giftProductsResult,
|
|
1144
|
+
scriptGiveawayKey
|
|
1145
|
+
]);
|
|
1146
|
+
const hasGifts = useMemo(() => {
|
|
1147
|
+
return allGiftLines.length > 0;
|
|
1148
|
+
}, [allGiftLines]);
|
|
1149
|
+
return {
|
|
1150
|
+
functionGift,
|
|
1151
|
+
scriptGift,
|
|
1152
|
+
allGiftLines,
|
|
1153
|
+
hasGifts
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1005
1156
|
|
|
1006
1157
|
// src/hooks/cart/types/order-discount.ts
|
|
1007
1158
|
var OrderDiscountType = /* @__PURE__ */ ((OrderDiscountType2) => {
|
|
@@ -1122,12 +1273,10 @@ function useHasPlusMemberInCart({
|
|
|
1122
1273
|
};
|
|
1123
1274
|
}, [cart?.lineItems, plus_monthly_product, plus_annual_product]);
|
|
1124
1275
|
}
|
|
1125
|
-
|
|
1126
|
-
// src/hooks/cart/feature/use-cart-attributes.ts
|
|
1127
1276
|
var getReferralAttributes = () => {
|
|
1128
|
-
const inviteCode = Cookies5.get("invite_code");
|
|
1129
|
-
const playModeId = Cookies5.get("playModeId");
|
|
1130
|
-
const popup = Cookies5.get("_popup");
|
|
1277
|
+
const inviteCode = getLocalStorage("invite_code") || Cookies5.get("invite_code");
|
|
1278
|
+
const playModeId = getLocalStorage("playModeId") || Cookies5.get("playModeId");
|
|
1279
|
+
const popup = getLocalStorage("_popup") || Cookies5.get("_popup");
|
|
1131
1280
|
if (inviteCode && playModeId) {
|
|
1132
1281
|
return popup ? [
|
|
1133
1282
|
{ key: "_invite_code", value: inviteCode ? inviteCode : "" },
|
|
@@ -1151,8 +1300,6 @@ var useCartAttributes = ({
|
|
|
1151
1300
|
memberSetting,
|
|
1152
1301
|
cart
|
|
1153
1302
|
});
|
|
1154
|
-
console.log("memberSetting", memberSetting);
|
|
1155
|
-
console.log("hasPlusMember", hasPlusMember);
|
|
1156
1303
|
useEffect(() => {
|
|
1157
1304
|
setCurrentUrl(window.location.href);
|
|
1158
1305
|
}, []);
|
|
@@ -1178,7 +1325,7 @@ var useCartAttributes = ({
|
|
|
1178
1325
|
return "new_user_login";
|
|
1179
1326
|
}, [customer]);
|
|
1180
1327
|
const memberAttributes = useMemo(() => {
|
|
1181
|
-
|
|
1328
|
+
const attributes = [
|
|
1182
1329
|
{
|
|
1183
1330
|
key: "_token",
|
|
1184
1331
|
value: profile?.token
|
|
@@ -1199,17 +1346,28 @@ var useCartAttributes = ({
|
|
|
1199
1346
|
value: profile?.token ? "true" : "false"
|
|
1200
1347
|
}
|
|
1201
1348
|
];
|
|
1349
|
+
if (profile?.token) {
|
|
1350
|
+
attributes.push({
|
|
1351
|
+
key: "_login_user",
|
|
1352
|
+
value: "1"
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
return attributes;
|
|
1202
1356
|
}, [profile?.memberType, profile?.token, userType, hasPlusMember]);
|
|
1203
1357
|
const functionAttributes = useMemo(() => {
|
|
1204
|
-
|
|
1205
|
-
|
|
1358
|
+
const hasFunctionEnvAttribute = cart?.lineItems.some(
|
|
1359
|
+
(item) => item.customAttributes?.some((attr) => attr.key === CUSTOMER_ATTRIBUTE_KEY)
|
|
1360
|
+
);
|
|
1361
|
+
const discountCodes = cart?.discountCodes.map((item) => item.code).filter((code) => code) || [];
|
|
1362
|
+
return hasFunctionEnvAttribute ? [
|
|
1363
|
+
{
|
|
1206
1364
|
key: "_discounts_function_env",
|
|
1207
1365
|
value: JSON.stringify({
|
|
1208
|
-
discount_code:
|
|
1366
|
+
discount_code: discountCodes,
|
|
1209
1367
|
user_tags: customer?.tags || []
|
|
1210
1368
|
})
|
|
1211
1369
|
}
|
|
1212
|
-
];
|
|
1370
|
+
] : [];
|
|
1213
1371
|
}, [cart]);
|
|
1214
1372
|
const presellAttributes = useMemo(() => {
|
|
1215
1373
|
return [
|
|
@@ -1241,18 +1399,50 @@ var useCartAttributes = ({
|
|
|
1241
1399
|
}
|
|
1242
1400
|
];
|
|
1243
1401
|
}, [currentUrl]);
|
|
1402
|
+
const commonAttributes = useMemo(
|
|
1403
|
+
() => [
|
|
1404
|
+
...memberAttributes,
|
|
1405
|
+
...functionAttributes,
|
|
1406
|
+
...presellAttributes,
|
|
1407
|
+
...weightAttributes,
|
|
1408
|
+
...trackingAttributes,
|
|
1409
|
+
...getReferralAttributes()
|
|
1410
|
+
].filter((item) => item?.value),
|
|
1411
|
+
[memberAttributes, functionAttributes, presellAttributes, weightAttributes, trackingAttributes]
|
|
1412
|
+
);
|
|
1413
|
+
const extraAttributesInCart = useMemo(() => {
|
|
1414
|
+
const commonAttributeKeys = [
|
|
1415
|
+
// member attributes
|
|
1416
|
+
"_token",
|
|
1417
|
+
"_member_type",
|
|
1418
|
+
"_user_type",
|
|
1419
|
+
"_is_login",
|
|
1420
|
+
"_login_user",
|
|
1421
|
+
// function attributes
|
|
1422
|
+
"_discounts_function_env",
|
|
1423
|
+
// presell attributes
|
|
1424
|
+
"_presale",
|
|
1425
|
+
// weight attributes
|
|
1426
|
+
"_weight",
|
|
1427
|
+
"_app_source_name",
|
|
1428
|
+
// tracking attributes
|
|
1429
|
+
"utm_params",
|
|
1430
|
+
// referral attributes
|
|
1431
|
+
"_invite_code",
|
|
1432
|
+
"_play_mode_id",
|
|
1433
|
+
"_popup"
|
|
1434
|
+
];
|
|
1435
|
+
return cart?.customAttributes?.filter(
|
|
1436
|
+
(item) => !commonAttributeKeys.includes(item.key)
|
|
1437
|
+
) || [];
|
|
1438
|
+
}, [cart]);
|
|
1244
1439
|
return useMemo(
|
|
1245
1440
|
() => ({
|
|
1246
|
-
attributes: [
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
...presellAttributes,
|
|
1250
|
-
...weightAttributes,
|
|
1251
|
-
...trackingAttributes,
|
|
1252
|
-
...getReferralAttributes()
|
|
1253
|
-
].filter((item) => item?.value)
|
|
1441
|
+
attributes: [...commonAttributes, ...extraAttributesInCart].filter(
|
|
1442
|
+
(item) => item?.value
|
|
1443
|
+
)
|
|
1254
1444
|
}),
|
|
1255
|
-
[
|
|
1445
|
+
[commonAttributes, extraAttributesInCart]
|
|
1256
1446
|
);
|
|
1257
1447
|
};
|
|
1258
1448
|
var DEFAULT_MIN = 1;
|
|
@@ -1469,8 +1659,9 @@ function useProductsByHandles(options = {}) {
|
|
|
1469
1659
|
metafieldIdentifiers
|
|
1470
1660
|
});
|
|
1471
1661
|
},
|
|
1472
|
-
|
|
1473
|
-
revalidateOnFocus: false
|
|
1662
|
+
{
|
|
1663
|
+
revalidateOnFocus: false,
|
|
1664
|
+
...swrOptions
|
|
1474
1665
|
}
|
|
1475
1666
|
);
|
|
1476
1667
|
}
|
|
@@ -2386,6 +2577,73 @@ var usePlusMemberDeliveryCodes = ({
|
|
|
2386
2577
|
[deliveryData]
|
|
2387
2578
|
);
|
|
2388
2579
|
};
|
|
2580
|
+
function useUpdateCartDeliveryOptions(mutate, metafieldIdentifiers, options) {
|
|
2581
|
+
const { client, locale, cartCookieAdapter } = useShopify();
|
|
2582
|
+
const updateDeliveryOptions = useCallback(
|
|
2583
|
+
async (_key, { arg }) => {
|
|
2584
|
+
const updatedCart = await updateCartDeliveryOptions(client, {
|
|
2585
|
+
...arg,
|
|
2586
|
+
metafieldIdentifiers,
|
|
2587
|
+
cookieAdapter: cartCookieAdapter
|
|
2588
|
+
});
|
|
2589
|
+
console.log("useUpdateCartDeliveryOptions updatedCart", updatedCart);
|
|
2590
|
+
if (updatedCart) {
|
|
2591
|
+
mutate(updatedCart);
|
|
2592
|
+
}
|
|
2593
|
+
return updatedCart;
|
|
2594
|
+
},
|
|
2595
|
+
[client, locale, cartCookieAdapter, mutate]
|
|
2596
|
+
);
|
|
2597
|
+
return useSWRMutation("update-cart-delivery-options", updateDeliveryOptions, options);
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
// src/hooks/member/plus/use-update-plus-member-delivery-options.ts
|
|
2601
|
+
var useUpdatePlusMemberDeliveryOptions = ({
|
|
2602
|
+
options
|
|
2603
|
+
} = {}) => {
|
|
2604
|
+
const { cart: cartContextData, mutateCart, metafieldIdentifiers } = useCartContext();
|
|
2605
|
+
const { trigger: updateCartDeliveryOptions2 } = useUpdateCartDeliveryOptions(
|
|
2606
|
+
mutateCart,
|
|
2607
|
+
metafieldIdentifiers
|
|
2608
|
+
);
|
|
2609
|
+
const handler = useCallback(
|
|
2610
|
+
async (_, { arg }) => {
|
|
2611
|
+
const currentCart = arg?.cart || cartContextData;
|
|
2612
|
+
const { deliveryData } = arg;
|
|
2613
|
+
const firstDeliveryGroup = currentCart?.deliveryGroups?.[0];
|
|
2614
|
+
const deliveryGroupId = firstDeliveryGroup?.id;
|
|
2615
|
+
const selectedOptionCode = deliveryData?.deliveryCustomData?.selected_delivery_option?.code;
|
|
2616
|
+
if (!deliveryGroupId || !selectedOptionCode || selectedOptionCode === firstDeliveryGroup?.selectedDeliveryOption?.code) {
|
|
2617
|
+
return null;
|
|
2618
|
+
}
|
|
2619
|
+
const deliveryGroup = currentCart?.deliveryGroups?.find(
|
|
2620
|
+
(group) => group?.id === deliveryGroupId
|
|
2621
|
+
);
|
|
2622
|
+
const matchedOption = deliveryGroup?.deliveryOptions?.find(
|
|
2623
|
+
(option) => option?.code === selectedOptionCode
|
|
2624
|
+
);
|
|
2625
|
+
if (!matchedOption?.handle) {
|
|
2626
|
+
return null;
|
|
2627
|
+
}
|
|
2628
|
+
const deliveryOptions = [
|
|
2629
|
+
{
|
|
2630
|
+
deliveryGroupId,
|
|
2631
|
+
deliveryOptionHandle: matchedOption.handle
|
|
2632
|
+
}
|
|
2633
|
+
];
|
|
2634
|
+
const updatedCart = await updateCartDeliveryOptions2({
|
|
2635
|
+
selectedDeliveryOptions: deliveryOptions,
|
|
2636
|
+
cartId: currentCart?.id
|
|
2637
|
+
});
|
|
2638
|
+
if (updatedCart && mutateCart) {
|
|
2639
|
+
mutateCart(updatedCart);
|
|
2640
|
+
}
|
|
2641
|
+
return updatedCart;
|
|
2642
|
+
},
|
|
2643
|
+
[cartContextData, updateCartDeliveryOptions2, mutateCart]
|
|
2644
|
+
);
|
|
2645
|
+
return useSWRMutation("update-cart-delivery-options", handler, options);
|
|
2646
|
+
};
|
|
2389
2647
|
var usePlusMemberItemCustomAttributes = ({
|
|
2390
2648
|
deliveryData
|
|
2391
2649
|
}) => {
|
|
@@ -2405,48 +2663,18 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2405
2663
|
deliveryData,
|
|
2406
2664
|
product,
|
|
2407
2665
|
variant,
|
|
2408
|
-
customer,
|
|
2409
2666
|
isShowShippingBenefits
|
|
2410
2667
|
}) => {
|
|
2411
2668
|
const { deliveryCustomData } = deliveryData || {};
|
|
2412
2669
|
const { profile } = usePlusMemberContext();
|
|
2413
|
-
const userType = useMemo(() => {
|
|
2414
|
-
const customerInfo = customer;
|
|
2415
|
-
if (!customerInfo) {
|
|
2416
|
-
return "new_user_unlogin";
|
|
2417
|
-
}
|
|
2418
|
-
if (customer) {
|
|
2419
|
-
const { orders = {} } = customer;
|
|
2420
|
-
const edgesLength = orders?.edges?.length;
|
|
2421
|
-
if (edgesLength === 1) {
|
|
2422
|
-
return "old_user_orders_once";
|
|
2423
|
-
} else if (edgesLength && edgesLength > 1) {
|
|
2424
|
-
return "old_user_orders_twice";
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
2427
|
-
return "new_user_login";
|
|
2428
|
-
}, [customer]);
|
|
2429
2670
|
return useMemo(() => {
|
|
2430
2671
|
const checkoutCustomAttributes = [
|
|
2431
|
-
|
|
2432
|
-
key: "_token",
|
|
2433
|
-
value: profile?.token || ""
|
|
2434
|
-
},
|
|
2672
|
+
// _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
|
|
2435
2673
|
{
|
|
2436
2674
|
key: "_last_url",
|
|
2437
2675
|
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
2438
|
-
},
|
|
2439
|
-
{
|
|
2440
|
-
key: "_user_type",
|
|
2441
|
-
value: userType
|
|
2442
2676
|
}
|
|
2443
2677
|
];
|
|
2444
|
-
if (profile) {
|
|
2445
|
-
checkoutCustomAttributes.push({
|
|
2446
|
-
key: "_login_user",
|
|
2447
|
-
value: "1"
|
|
2448
|
-
});
|
|
2449
|
-
}
|
|
2450
2678
|
if (deliveryCustomData) {
|
|
2451
2679
|
checkoutCustomAttributes.push({
|
|
2452
2680
|
key: "_checkout_delivery_custom",
|
|
@@ -2456,12 +2684,6 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2456
2684
|
})
|
|
2457
2685
|
});
|
|
2458
2686
|
}
|
|
2459
|
-
if (variant?.metafields?.presell) {
|
|
2460
|
-
checkoutCustomAttributes.push({
|
|
2461
|
-
key: "_presale",
|
|
2462
|
-
value: "true"
|
|
2463
|
-
});
|
|
2464
|
-
}
|
|
2465
2687
|
if (isShowShippingBenefits && !isShowShippingBenefits({ variant, product, setting: {} })) {
|
|
2466
2688
|
checkoutCustomAttributes.push({
|
|
2467
2689
|
key: "_hide_shipping",
|
|
@@ -2469,18 +2691,17 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2469
2691
|
});
|
|
2470
2692
|
}
|
|
2471
2693
|
return checkoutCustomAttributes;
|
|
2472
|
-
}, [deliveryCustomData, product, profile,
|
|
2694
|
+
}, [deliveryCustomData, product, profile, variant, isShowShippingBenefits]);
|
|
2473
2695
|
};
|
|
2474
2696
|
function useAutoRemovePlusMemberInCart({
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2697
|
+
cart,
|
|
2698
|
+
profile,
|
|
2699
|
+
memberSetting
|
|
2478
2700
|
}) {
|
|
2479
|
-
const { plus_monthly_product, plus_annual_product } =
|
|
2480
|
-
const { cart } = useCartContext();
|
|
2701
|
+
const { plus_monthly_product, plus_annual_product } = memberSetting || {};
|
|
2481
2702
|
const { trigger: removeCartLines2 } = useRemoveCartLines();
|
|
2482
2703
|
useEffect(() => {
|
|
2483
|
-
if (!cart) return;
|
|
2704
|
+
if (!cart || !plus_monthly_product || !plus_annual_product) return;
|
|
2484
2705
|
const removePlusProduct = async (productType) => {
|
|
2485
2706
|
if (!productType) return;
|
|
2486
2707
|
const product = cart.lineItems?.find(
|
|
@@ -2492,33 +2713,25 @@ function useAutoRemovePlusMemberInCart({
|
|
|
2492
2713
|
});
|
|
2493
2714
|
}
|
|
2494
2715
|
};
|
|
2495
|
-
if (isMonthlyPlus) {
|
|
2716
|
+
if (profile?.isMonthlyPlus) {
|
|
2496
2717
|
removePlusProduct(plus_monthly_product);
|
|
2497
2718
|
}
|
|
2498
|
-
if (isAnnualPlus) {
|
|
2719
|
+
if (profile?.isAnnualPlus) {
|
|
2499
2720
|
removePlusProduct(plus_annual_product);
|
|
2500
2721
|
}
|
|
2501
|
-
}, [
|
|
2502
|
-
cart,
|
|
2503
|
-
plus_annual_product,
|
|
2504
|
-
plus_monthly_product,
|
|
2505
|
-
isAnnualPlus,
|
|
2506
|
-
isMonthlyPlus,
|
|
2507
|
-
removeCartLines2
|
|
2508
|
-
]);
|
|
2722
|
+
}, [cart, plus_annual_product, plus_monthly_product, profile, removeCartLines2]);
|
|
2509
2723
|
}
|
|
2510
2724
|
function useAddPlusMemberProductsToCart({
|
|
2511
2725
|
cart,
|
|
2512
|
-
|
|
2513
|
-
selectedPlusMemberMode,
|
|
2514
|
-
selectedPlusMemberProduct
|
|
2726
|
+
profile
|
|
2515
2727
|
}) {
|
|
2728
|
+
const { selectedPlusMemberMode, selectedPlusMemberProduct, plusMemberMetafields } = usePlusMemberContext();
|
|
2516
2729
|
const { hasMonthlyPlus, hasAnnualPlus } = useHasPlusMemberInCart({
|
|
2517
|
-
|
|
2518
|
-
|
|
2730
|
+
memberSetting: plusMemberMetafields,
|
|
2731
|
+
cart
|
|
2519
2732
|
});
|
|
2520
2733
|
const plusMemberProduct = useMemo(() => {
|
|
2521
|
-
if (selectedPlusMemberMode === "free" /* FREE */) {
|
|
2734
|
+
if (!selectedPlusMemberProduct || selectedPlusMemberMode === "free" /* FREE */) {
|
|
2522
2735
|
return void 0;
|
|
2523
2736
|
}
|
|
2524
2737
|
if (selectedPlusMemberMode === "monthly" /* MONTHLY */ && hasMonthlyPlus) {
|
|
@@ -2527,7 +2740,10 @@ function useAddPlusMemberProductsToCart({
|
|
|
2527
2740
|
if (selectedPlusMemberMode === "annual" /* ANNUAL */ && hasAnnualPlus) {
|
|
2528
2741
|
return void 0;
|
|
2529
2742
|
}
|
|
2530
|
-
if (
|
|
2743
|
+
if (profile?.isMonthlyPlus && selectedPlusMemberMode === "monthly" /* MONTHLY */) {
|
|
2744
|
+
return void 0;
|
|
2745
|
+
}
|
|
2746
|
+
if (profile?.isAnnualPlus && selectedPlusMemberMode === "annual" /* ANNUAL */) {
|
|
2531
2747
|
return void 0;
|
|
2532
2748
|
}
|
|
2533
2749
|
return selectedPlusMemberProduct;
|
|
@@ -2801,6 +3017,6 @@ function clearGeoLocationCache(cacheKey = "geoLocation") {
|
|
|
2801
3017
|
}
|
|
2802
3018
|
}
|
|
2803
3019
|
|
|
2804
|
-
export { BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, DeliveryPlusType, MAIN_PRODUCT_CODE, OrderBasePriceType, OrderDiscountType, PLUS_MEMBER_TYPE, PlusMemberContext, PlusMemberMode, PlusMemberProvider, PriceBasePriceType, PriceDiscountType, RuleType, SCRIPT_CODE_AMOUNT_KEY, ShippingMethodMode, SpendMoneyType,
|
|
3020
|
+
export { BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, DeliveryPlusType, MAIN_PRODUCT_CODE, OrderBasePriceType, OrderDiscountType, PLUS_MEMBER_TYPE, PlusMemberContext, PlusMemberMode, PlusMemberProvider, PriceBasePriceType, PriceDiscountType, RuleType, SCRIPT_CODE_AMOUNT_KEY, ShippingMethodMode, SpendMoneyType, checkAttributesUpdateNeeded, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, normalizeAddToCartLines, preCheck, safeParse, useAddCartLines, useAddPlusMemberProductsToCart, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useIntersection, usePlusAnnualProductVariant, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberDeliveryCodes, usePlusMemberItemCustomAttributes, usePlusMonthlyProductVariant, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useScriptAutoFreeGift, useSearch, useSelectedOptions, useShippingMethodAvailableCheck, useShippingMethods, useSite, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdatePlusMemberDeliveryOptions, useUpdateVariantQuery, useVariant, useVariantMedia };
|
|
2805
3021
|
//# sourceMappingURL=index.mjs.map
|
|
2806
3022
|
//# sourceMappingURL=index.mjs.map
|