@cimplify/sdk 0.102.0 → 0.103.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/dist/advanced.d.mts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +23 -22
- package/dist/advanced.mjs +4 -3
- package/dist/{chunk-DCMXUKDQ.mjs → chunk-C2JSNJUC.mjs} +404 -95
- package/dist/chunk-CNN7Z2IP.js +125 -0
- package/dist/{chunk-DKLHCZ5M.mjs → chunk-GERXZQSX.mjs} +487 -11
- package/dist/chunk-GOHSXBKW.mjs +105 -0
- package/dist/{chunk-4KNFBPV2.mjs → chunk-H7ACMHM3.mjs} +32 -14
- package/dist/{chunk-Z3K2D3TE.mjs → chunk-J6PNHDHL.mjs} +453 -483
- package/dist/{chunk-NIOUSKQQ.js → chunk-JG5CQNCB.js} +5 -0
- package/dist/{chunk-YER7DIOM.js → chunk-JSWJ4XDE.js} +471 -519
- package/dist/{chunk-DLW3RWRK.mjs → chunk-M4URVKHE.mjs} +46 -12
- package/dist/{chunk-WMEC5JWN.js → chunk-NNG6IFFX.js} +50 -13
- package/dist/{chunk-LOWSMGRT.js → chunk-QOWPGS7Z.js} +34 -16
- package/dist/{chunk-YDA46OZ6.js → chunk-R6OLQ33I.js} +560 -80
- package/dist/{chunk-EAZGA7LD.js → chunk-VIL6IQCG.js} +406 -97
- package/dist/{chunk-O3YUHLZL.mjs → chunk-VNPEYLB2.mjs} +5 -0
- package/dist/{client-B40KFazg.d.ts → client-BfpNjJ_a.d.mts} +90 -299
- package/dist/{client-BizGfqB7.d.mts → client-DHBwvh7U.d.ts} +90 -299
- package/dist/{client-BdErclfU.d.mts → client-DpqRobY9.d.mts} +2 -2
- package/dist/{client-nsiMwuC1.d.ts → client-Dqg2mc-7.d.ts} +2 -2
- package/dist/{index-DpmnI__D.d.mts → index-C8uDqLwJ.d.ts} +14 -4
- package/dist/{index-nEyXWIyR.d.ts → index-e2y6AK70.d.mts} +14 -4
- package/dist/index.d.mts +81 -8
- package/dist/index.d.ts +81 -8
- package/dist/index.js +202 -169
- package/dist/index.mjs +6 -5
- package/dist/link-cuNVYc2s.d.mts +297 -0
- package/dist/link-cuNVYc2s.d.ts +297 -0
- package/dist/mock/cli.mjs +410 -94
- package/dist/mock/library.js +410 -94
- package/dist/mock/library.mjs +410 -94
- package/dist/mock/msw.js +410 -94
- package/dist/mock/msw.mjs +410 -94
- package/dist/{product-Byf0unSy.d.mts → payment-H5LoIvXU.d.mts} +189 -7
- package/dist/{product-Byf0unSy.d.ts → payment-H5LoIvXU.d.ts} +189 -7
- package/dist/{price-CS4E5zLS.d.mts → price-BvePgDXe.d.mts} +1 -1
- package/dist/{price-BstChV9a.d.ts → price-C2RqscMY.d.ts} +1 -1
- package/dist/react.d.mts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +141 -140
- package/dist/react.mjs +5 -4
- package/dist/{server-DqbZh8Bk.d.mts → server-C7FyLdrz.d.mts} +11 -9
- package/dist/{server-Cj40R2ZD.d.ts → server-DoXIpSd7.d.ts} +11 -9
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +11 -10
- package/dist/server.mjs +5 -4
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +4 -3
- package/dist/testing/msw.mjs +3 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +26 -25
- package/dist/testing/suite.mjs +7 -6
- package/dist/testing.d.mts +154 -55
- package/dist/testing.d.ts +154 -55
- package/dist/testing.js +83 -82
- package/dist/testing.mjs +8 -7
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +37 -29
- package/dist/utils.mjs +2 -2
- package/package.json +7 -1
- package/dist/payment-l0rkieEQ.d.mts +0 -113
- package/dist/payment-vzNnIi1n.d.ts +0 -113
package/dist/react.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
|
|
5
5
|
var chunk2P4KXFB6_js = require('./chunk-2P4KXFB6.js');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
6
|
+
var chunkR6OLQ33I_js = require('./chunk-R6OLQ33I.js');
|
|
7
|
+
var chunkJSWJ4XDE_js = require('./chunk-JSWJ4XDE.js');
|
|
8
|
+
require('./chunk-CNN7Z2IP.js');
|
|
9
|
+
var chunkNNG6IFFX_js = require('./chunk-NNG6IFFX.js');
|
|
10
|
+
var chunkJG5CQNCB_js = require('./chunk-JG5CQNCB.js');
|
|
10
11
|
require('./chunk-OWW5GUSB.js');
|
|
11
12
|
var React14 = require('react');
|
|
12
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -634,14 +635,14 @@ function attachInternalItemMetadata(item, metadata = {}) {
|
|
|
634
635
|
}
|
|
635
636
|
function calculateLineSubtotal(item) {
|
|
636
637
|
if (item._quotedUnitPrice !== void 0) {
|
|
637
|
-
return roundMoney(
|
|
638
|
+
return roundMoney(chunkNNG6IFFX_js.parsePrice(item._quotedUnitPrice) * item.quantity);
|
|
638
639
|
}
|
|
639
|
-
let unitPrice =
|
|
640
|
+
let unitPrice = chunkNNG6IFFX_js.parsePrice(item.product.default_price);
|
|
640
641
|
if (item.variant?.price_adjustment) {
|
|
641
|
-
unitPrice +=
|
|
642
|
+
unitPrice += chunkNNG6IFFX_js.parsePrice(item.variant.price_adjustment);
|
|
642
643
|
}
|
|
643
644
|
for (const option of item.addOnOptions || []) {
|
|
644
|
-
if (option.default_price) unitPrice +=
|
|
645
|
+
if (option.default_price) unitPrice += chunkNNG6IFFX_js.parsePrice(option.default_price);
|
|
645
646
|
}
|
|
646
647
|
return roundMoney(unitPrice * item.quantity);
|
|
647
648
|
}
|
|
@@ -862,7 +863,7 @@ async function syncFromServer(entry) {
|
|
|
862
863
|
return next;
|
|
863
864
|
}
|
|
864
865
|
function emitMutationError(entry, operation, opId, idempotencyKey, error) {
|
|
865
|
-
entry.client.events.emit(
|
|
866
|
+
entry.client.events.emit(chunkR6OLQ33I_js.MUTATION_ERROR, {
|
|
866
867
|
service: "cart",
|
|
867
868
|
operation,
|
|
868
869
|
opId,
|
|
@@ -902,10 +903,10 @@ function getOrCreateStore(params) {
|
|
|
902
903
|
syncTail: Promise.resolve(),
|
|
903
904
|
failedOpRemovers: /* @__PURE__ */ new Set()
|
|
904
905
|
};
|
|
905
|
-
client.events.on(
|
|
906
|
+
client.events.on(chunkR6OLQ33I_js.SESSION_CLAIMED, () => {
|
|
906
907
|
if (entry.initialized) void syncFromServer(entry);
|
|
907
908
|
});
|
|
908
|
-
client.events.on(
|
|
909
|
+
client.events.on(chunkR6OLQ33I_js.SESSION_CLEARED, () => {
|
|
909
910
|
if (entry.initialized) void syncFromServer(entry);
|
|
910
911
|
});
|
|
911
912
|
cartStores.set(storeKey, entry);
|
|
@@ -1213,7 +1214,7 @@ var DEFAULT_COUNTRY = "US";
|
|
|
1213
1214
|
function createDefaultClient() {
|
|
1214
1215
|
const processRef = globalThis.process;
|
|
1215
1216
|
const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
|
|
1216
|
-
return
|
|
1217
|
+
return chunkR6OLQ33I_js.createCimplifyClient({ publicKey: envPublicKey });
|
|
1217
1218
|
}
|
|
1218
1219
|
function getStoredLocationId() {
|
|
1219
1220
|
if (typeof window === "undefined" || !window.localStorage) {
|
|
@@ -1317,7 +1318,7 @@ function CimplifyProvider({
|
|
|
1317
1318
|
const setDisplayCurrency = React14.useCallback(
|
|
1318
1319
|
(currency) => {
|
|
1319
1320
|
const normalized = currency?.trim().toUpperCase() || null;
|
|
1320
|
-
if (normalized && !
|
|
1321
|
+
if (normalized && !chunkJG5CQNCB_js.isSupportedCurrency(normalized)) {
|
|
1321
1322
|
return;
|
|
1322
1323
|
}
|
|
1323
1324
|
setDisplayCurrencyOverride(normalized);
|
|
@@ -3261,19 +3262,19 @@ function toAccountLineItem(item, currency) {
|
|
|
3261
3262
|
quantity: s.quantity,
|
|
3262
3263
|
name: s.product_name,
|
|
3263
3264
|
variantName: s.variant_name,
|
|
3264
|
-
priceLabel:
|
|
3265
|
+
priceLabel: chunkNNG6IFFX_js.parsePrice(s.unit_price) > 0 ? chunkNNG6IFFX_js.formatMoney(s.unit_price, currency) : void 0
|
|
3265
3266
|
}));
|
|
3266
3267
|
const customisations = item.composite_selections?.selections.map((s) => ({
|
|
3267
3268
|
quantity: s.quantity,
|
|
3268
3269
|
name: s.component_name,
|
|
3269
|
-
priceLabel:
|
|
3270
|
+
priceLabel: chunkNNG6IFFX_js.parsePrice(s.unit_price) > 0 ? `+${chunkNNG6IFFX_js.formatMoney(s.unit_price, currency)}` : void 0
|
|
3270
3271
|
}));
|
|
3271
3272
|
const data = {
|
|
3272
3273
|
id: item.id,
|
|
3273
3274
|
name: item.product_name ?? "Item",
|
|
3274
3275
|
imageUrl: item.image_url,
|
|
3275
3276
|
subtitle: lineSubtitle(item),
|
|
3276
|
-
priceLabel:
|
|
3277
|
+
priceLabel: chunkNNG6IFFX_js.formatMoney(item.total_price, currency),
|
|
3277
3278
|
lineType: item.line_type,
|
|
3278
3279
|
includes,
|
|
3279
3280
|
customisations,
|
|
@@ -3323,20 +3324,20 @@ var PAYMENT_TONE = {
|
|
|
3323
3324
|
function toAccountOrderView(order, opts = {}) {
|
|
3324
3325
|
const currency = order.payment.currency;
|
|
3325
3326
|
const rows = [
|
|
3326
|
-
{ label: "Subtotal", value:
|
|
3327
|
+
{ label: "Subtotal", value: chunkNNG6IFFX_js.formatMoney(order.pricing.subtotal, currency) }
|
|
3327
3328
|
];
|
|
3328
|
-
if (
|
|
3329
|
+
if (chunkNNG6IFFX_js.parsePrice(order.pricing.total_discount) > 0) {
|
|
3329
3330
|
rows.push({
|
|
3330
3331
|
label: "Discount",
|
|
3331
|
-
value: `\u2212${
|
|
3332
|
+
value: `\u2212${chunkNNG6IFFX_js.formatMoney(order.pricing.total_discount, currency)}`,
|
|
3332
3333
|
tone: "positive"
|
|
3333
3334
|
});
|
|
3334
3335
|
}
|
|
3335
|
-
if (order.pricing.tax &&
|
|
3336
|
-
rows.push({ label: "Tax", value:
|
|
3336
|
+
if (order.pricing.tax && chunkNNG6IFFX_js.parsePrice(order.pricing.tax) > 0) {
|
|
3337
|
+
rows.push({ label: "Tax", value: chunkNNG6IFFX_js.formatMoney(order.pricing.tax, currency) });
|
|
3337
3338
|
}
|
|
3338
|
-
if (order.pricing.service_charge &&
|
|
3339
|
-
rows.push({ label: "Service", value:
|
|
3339
|
+
if (order.pricing.service_charge && chunkNNG6IFFX_js.parsePrice(order.pricing.service_charge) > 0) {
|
|
3340
|
+
rows.push({ label: "Service", value: chunkNNG6IFFX_js.formatMoney(order.pricing.service_charge, currency) });
|
|
3340
3341
|
}
|
|
3341
3342
|
const placed = fmtDateTime(order.timestamps.created_at);
|
|
3342
3343
|
const placedLabel = opts.placedLabel ?? [placed && `Placed ${placed}`, `${order.items.length} item${order.items.length === 1 ? "" : "s"}`].filter(Boolean).join(" \xB7 ");
|
|
@@ -3350,7 +3351,7 @@ function toAccountOrderView(order, opts = {}) {
|
|
|
3350
3351
|
stateLabel: cap(order.payment.computed_status ?? order.payment.state),
|
|
3351
3352
|
stateTone: PAYMENT_TONE[order.payment.state] ?? "muted",
|
|
3352
3353
|
rows,
|
|
3353
|
-
total: { label: "Total", value:
|
|
3354
|
+
total: { label: "Total", value: chunkNNG6IFFX_js.formatMoney(order.pricing.total_price, currency) }
|
|
3354
3355
|
},
|
|
3355
3356
|
shipTo: order.customer.delivery_address ? { lines: order.customer.delivery_address } : void 0,
|
|
3356
3357
|
onBack: opts.onBack
|
|
@@ -3525,7 +3526,7 @@ function CimplifySignInButton({
|
|
|
3525
3526
|
const onClick = async () => {
|
|
3526
3527
|
if (busy || disabled || !signInOpts.clientId) return;
|
|
3527
3528
|
setBusy(true);
|
|
3528
|
-
await
|
|
3529
|
+
await chunkJSWJ4XDE_js.startSignIn({
|
|
3529
3530
|
...signInOpts,
|
|
3530
3531
|
onSuccess: () => {
|
|
3531
3532
|
setBusy(false);
|
|
@@ -4380,7 +4381,7 @@ function Price({
|
|
|
4380
4381
|
const resolvedAmount = fxActive ? context.convertPrice(amount) : typeof amount === "string" ? parseFloat(amount) || 0 : amount;
|
|
4381
4382
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
4382
4383
|
prefix,
|
|
4383
|
-
|
|
4384
|
+
chunkNNG6IFFX_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
4384
4385
|
] });
|
|
4385
4386
|
}
|
|
4386
4387
|
function createCachedQuery(config) {
|
|
@@ -4993,9 +4994,9 @@ function useClientSessionEpoch(client) {
|
|
|
4993
4994
|
const subscribe = React14.useCallback(
|
|
4994
4995
|
(notify) => {
|
|
4995
4996
|
const unsubscribe = [
|
|
4996
|
-
client.events.on(
|
|
4997
|
-
client.events.on(
|
|
4998
|
-
client.events.on(
|
|
4997
|
+
client.events.on(chunkR6OLQ33I_js.AUTH_TOKEN_CHANGED, notify),
|
|
4998
|
+
client.events.on(chunkR6OLQ33I_js.SESSION_CLAIMED, notify),
|
|
4999
|
+
client.events.on(chunkR6OLQ33I_js.SESSION_CLEARED, notify)
|
|
4999
5000
|
];
|
|
5000
5001
|
return () => {
|
|
5001
5002
|
for (const stopListening of unsubscribe) {
|
|
@@ -5482,13 +5483,13 @@ function useProductPrice(input) {
|
|
|
5482
5483
|
if (bundleTotalPrice != null) {
|
|
5483
5484
|
unitPrice = bundleTotalPrice;
|
|
5484
5485
|
} else if (compositePrice) {
|
|
5485
|
-
unitPrice =
|
|
5486
|
+
unitPrice = chunkNNG6IFFX_js.parsePrice(compositePrice.final_price);
|
|
5486
5487
|
} else {
|
|
5487
|
-
unitPrice =
|
|
5488
|
+
unitPrice = chunkNNG6IFFX_js.getVariantUnitPrice(product, variant);
|
|
5488
5489
|
if (addOnOptions) {
|
|
5489
5490
|
for (const option of addOnOptions) {
|
|
5490
5491
|
if (option.default_price) {
|
|
5491
|
-
unitPrice +=
|
|
5492
|
+
unitPrice += chunkNNG6IFFX_js.parsePrice(option.default_price);
|
|
5492
5493
|
}
|
|
5493
5494
|
}
|
|
5494
5495
|
}
|
|
@@ -6325,7 +6326,7 @@ function useChat(options = {}) {
|
|
|
6325
6326
|
const watchSessionClaims = React14.useCallback(() => {
|
|
6326
6327
|
const c = clientRef.current;
|
|
6327
6328
|
if (!c || claimUnsubRef.current) return;
|
|
6328
|
-
const unsubClaimed = c.events.on(
|
|
6329
|
+
const unsubClaimed = c.events.on(chunkR6OLQ33I_js.SESSION_CLAIMED, (event) => {
|
|
6329
6330
|
setClaimedAs(event.customerName || c.support.claimedCustomerName || null);
|
|
6330
6331
|
if (!openedRef.current) {
|
|
6331
6332
|
void openIfExisting();
|
|
@@ -6334,7 +6335,7 @@ function useChat(options = {}) {
|
|
|
6334
6335
|
connectWebSocket();
|
|
6335
6336
|
void resyncConversation();
|
|
6336
6337
|
});
|
|
6337
|
-
const unsubCleared = c.events.on(
|
|
6338
|
+
const unsubCleared = c.events.on(chunkR6OLQ33I_js.SESSION_CLEARED, resetConversation);
|
|
6338
6339
|
claimUnsubRef.current = () => {
|
|
6339
6340
|
unsubClaimed();
|
|
6340
6341
|
unsubCleared();
|
|
@@ -6386,7 +6387,7 @@ function useChat(options = {}) {
|
|
|
6386
6387
|
if (!openedRef.current) return false;
|
|
6387
6388
|
}
|
|
6388
6389
|
const replyTo = opts?.replyTo;
|
|
6389
|
-
const clientId =
|
|
6390
|
+
const clientId = chunkJSWJ4XDE_js.generateIdempotencyKey();
|
|
6390
6391
|
const localId = optimisticId(clientId);
|
|
6391
6392
|
const optimistic = {
|
|
6392
6393
|
id: localId,
|
|
@@ -6575,15 +6576,15 @@ function AuthElement({
|
|
|
6575
6576
|
}, [onReady, onAuthenticated, onError]);
|
|
6576
6577
|
React14.useEffect(() => {
|
|
6577
6578
|
if (!elements || !containerRef.current) return;
|
|
6578
|
-
const element = elements.create(
|
|
6579
|
+
const element = elements.create(chunkJSWJ4XDE_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
6579
6580
|
elementRef.current = element;
|
|
6580
|
-
element.on(
|
|
6581
|
+
element.on(chunkJSWJ4XDE_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6581
6582
|
element.on(
|
|
6582
|
-
|
|
6583
|
+
chunkJSWJ4XDE_js.EVENT_TYPES.AUTHENTICATED,
|
|
6583
6584
|
(data) => onAuthenticatedRef.current?.(data)
|
|
6584
6585
|
);
|
|
6585
6586
|
element.on(
|
|
6586
|
-
|
|
6587
|
+
chunkJSWJ4XDE_js.EVENT_TYPES.ERROR,
|
|
6587
6588
|
(data) => onErrorRef.current?.(data)
|
|
6588
6589
|
);
|
|
6589
6590
|
element.mount(containerRef.current);
|
|
@@ -6612,15 +6613,15 @@ function AddressElement({
|
|
|
6612
6613
|
}, [onReady, onChange, onError]);
|
|
6613
6614
|
React14.useEffect(() => {
|
|
6614
6615
|
if (!elements || !containerRef.current) return;
|
|
6615
|
-
const element = elements.create(
|
|
6616
|
+
const element = elements.create(chunkJSWJ4XDE_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
6616
6617
|
elementRef.current = element;
|
|
6617
|
-
element.on(
|
|
6618
|
+
element.on(chunkJSWJ4XDE_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6618
6619
|
element.on(
|
|
6619
|
-
|
|
6620
|
+
chunkJSWJ4XDE_js.EVENT_TYPES.CHANGE,
|
|
6620
6621
|
(data) => onChangeRef.current?.(data)
|
|
6621
6622
|
);
|
|
6622
6623
|
element.on(
|
|
6623
|
-
|
|
6624
|
+
chunkJSWJ4XDE_js.EVENT_TYPES.ERROR,
|
|
6624
6625
|
(data) => onErrorRef.current?.(data)
|
|
6625
6626
|
);
|
|
6626
6627
|
element.mount(containerRef.current);
|
|
@@ -6650,15 +6651,15 @@ function PaymentElement({
|
|
|
6650
6651
|
}, [onReady, onChange, onError]);
|
|
6651
6652
|
React14.useEffect(() => {
|
|
6652
6653
|
if (!elements || !containerRef.current) return;
|
|
6653
|
-
const element = elements.create(
|
|
6654
|
+
const element = elements.create(chunkJSWJ4XDE_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
6654
6655
|
elementRef.current = element;
|
|
6655
|
-
element.on(
|
|
6656
|
+
element.on(chunkJSWJ4XDE_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6656
6657
|
element.on(
|
|
6657
|
-
|
|
6658
|
+
chunkJSWJ4XDE_js.EVENT_TYPES.CHANGE,
|
|
6658
6659
|
(data) => onChangeRef.current?.(data)
|
|
6659
6660
|
);
|
|
6660
6661
|
element.on(
|
|
6661
|
-
|
|
6662
|
+
chunkJSWJ4XDE_js.EVENT_TYPES.ERROR,
|
|
6662
6663
|
(data) => onErrorRef.current?.(data)
|
|
6663
6664
|
);
|
|
6664
6665
|
element.mount(containerRef.current);
|
|
@@ -6815,7 +6816,7 @@ function VariantSelector({
|
|
|
6815
6816
|
if (!variants || variants.length <= 1) {
|
|
6816
6817
|
return null;
|
|
6817
6818
|
}
|
|
6818
|
-
basePrice != null ?
|
|
6819
|
+
basePrice != null ? chunkNNG6IFFX_js.parsePrice(basePrice) : 0;
|
|
6819
6820
|
if (variantAxes && variantAxes.length > 0) {
|
|
6820
6821
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
6821
6822
|
const labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -6921,7 +6922,7 @@ function VariantSelector({
|
|
|
6921
6922
|
className: cn("divide-y divide-border", classNames?.list),
|
|
6922
6923
|
children: variants.map((variant) => {
|
|
6923
6924
|
const isSelected = selectedVariantId === variant.id;
|
|
6924
|
-
const adjustment =
|
|
6925
|
+
const adjustment = chunkNNG6IFFX_js.parsePrice(variant.price_adjustment);
|
|
6925
6926
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6926
6927
|
radio.Radio.Root,
|
|
6927
6928
|
{
|
|
@@ -7189,16 +7190,16 @@ function BundleSelector({
|
|
|
7189
7190
|
}, [components, selections, onReady]);
|
|
7190
7191
|
const totalPrice = React14.useMemo(() => {
|
|
7191
7192
|
if (pricingType === "fixed" && bundlePrice) {
|
|
7192
|
-
return
|
|
7193
|
+
return chunkNNG6IFFX_js.parsePrice(bundlePrice);
|
|
7193
7194
|
}
|
|
7194
7195
|
const componentsTotal = components.reduce((sum, comp) => {
|
|
7195
7196
|
return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
|
|
7196
7197
|
}, 0);
|
|
7197
7198
|
if (pricingType === "percentage_discount" && discountValue) {
|
|
7198
|
-
return componentsTotal * (1 -
|
|
7199
|
+
return componentsTotal * (1 - chunkNNG6IFFX_js.parsePrice(discountValue) / 100);
|
|
7199
7200
|
}
|
|
7200
7201
|
if (pricingType === "fixed_discount" && discountValue) {
|
|
7201
|
-
return componentsTotal -
|
|
7202
|
+
return componentsTotal - chunkNNG6IFFX_js.parsePrice(discountValue);
|
|
7202
7203
|
}
|
|
7203
7204
|
return componentsTotal;
|
|
7204
7205
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
@@ -7260,15 +7261,15 @@ function BundleSelector({
|
|
|
7260
7261
|
}
|
|
7261
7262
|
function getComponentPrice(component, selectedVariantId) {
|
|
7262
7263
|
if (!selectedVariantId || component.available_variants.length === 0) {
|
|
7263
|
-
return
|
|
7264
|
+
return chunkNNG6IFFX_js.parsePrice(component.effective_price);
|
|
7264
7265
|
}
|
|
7265
7266
|
if (selectedVariantId === component.variant_id) {
|
|
7266
|
-
return
|
|
7267
|
+
return chunkNNG6IFFX_js.parsePrice(component.effective_price);
|
|
7267
7268
|
}
|
|
7268
7269
|
const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
|
|
7269
7270
|
const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
7270
|
-
if (!selectedAdj) return
|
|
7271
|
-
return
|
|
7271
|
+
if (!selectedAdj) return chunkNNG6IFFX_js.parsePrice(component.effective_price);
|
|
7272
|
+
return chunkNNG6IFFX_js.parsePrice(component.effective_price) - chunkNNG6IFFX_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkNNG6IFFX_js.parsePrice(selectedAdj.price_adjustment);
|
|
7272
7273
|
}
|
|
7273
7274
|
function formatDuration(minutes, unit) {
|
|
7274
7275
|
if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
|
|
@@ -7382,7 +7383,7 @@ function BundleComponentCard({
|
|
|
7382
7383
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
7383
7384
|
children: component.available_variants.map((variant) => {
|
|
7384
7385
|
const isSelected = selectedVariantId === variant.id;
|
|
7385
|
-
const adjustment =
|
|
7386
|
+
const adjustment = chunkNNG6IFFX_js.parsePrice(variant.price_adjustment);
|
|
7386
7387
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7387
7388
|
radio.Radio.Root,
|
|
7388
7389
|
{
|
|
@@ -7829,7 +7830,7 @@ function CompositeSelector({
|
|
|
7829
7830
|
"data-cimplify-composite-summary": true,
|
|
7830
7831
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
7831
7832
|
children: [
|
|
7832
|
-
|
|
7833
|
+
chunkNNG6IFFX_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7833
7834
|
"div",
|
|
7834
7835
|
{
|
|
7835
7836
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7840,7 +7841,7 @@ function CompositeSelector({
|
|
|
7840
7841
|
]
|
|
7841
7842
|
}
|
|
7842
7843
|
),
|
|
7843
|
-
|
|
7844
|
+
chunkNNG6IFFX_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7844
7845
|
"div",
|
|
7845
7846
|
{
|
|
7846
7847
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7984,7 +7985,7 @@ function BookingSummary({
|
|
|
7984
7985
|
className,
|
|
7985
7986
|
classNames
|
|
7986
7987
|
}) {
|
|
7987
|
-
const depositValue = depositAmount != null ?
|
|
7988
|
+
const depositValue = depositAmount != null ? chunkNNG6IFFX_js.parsePrice(depositAmount) : 0;
|
|
7988
7989
|
const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
|
|
7989
7990
|
const hasDeposit = depositDue > 0;
|
|
7990
7991
|
const balance = Math.max(0, total - depositDue);
|
|
@@ -8712,7 +8713,7 @@ function InputField({
|
|
|
8712
8713
|
currency,
|
|
8713
8714
|
classNames
|
|
8714
8715
|
}) {
|
|
8715
|
-
const hasPriceAdjustment = field.price_adjustment != null &&
|
|
8716
|
+
const hasPriceAdjustment = field.price_adjustment != null && chunkNNG6IFFX_js.parsePrice(field.price_adjustment) > 0;
|
|
8716
8717
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
|
|
8717
8718
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
|
|
8718
8719
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
|
|
@@ -9844,15 +9845,15 @@ function ProductCustomizerContent({
|
|
|
9844
9845
|
}, [selectedAddOnOptionIds]);
|
|
9845
9846
|
const localTotalPrice = React14.useMemo(() => {
|
|
9846
9847
|
if (isComposite && compositePrice) {
|
|
9847
|
-
return
|
|
9848
|
+
return chunkNNG6IFFX_js.parsePrice(compositePrice.final_price) * quantity;
|
|
9848
9849
|
}
|
|
9849
9850
|
if (isBundle && bundleTotalPrice != null) {
|
|
9850
9851
|
return bundleTotalPrice * quantity;
|
|
9851
9852
|
}
|
|
9852
|
-
let price =
|
|
9853
|
+
let price = chunkNNG6IFFX_js.getVariantUnitPrice(product, selectedVariant);
|
|
9853
9854
|
for (const option of selectedAddOnOptions) {
|
|
9854
9855
|
if (option.default_price) {
|
|
9855
|
-
price +=
|
|
9856
|
+
price += chunkNNG6IFFX_js.parsePrice(option.default_price);
|
|
9856
9857
|
}
|
|
9857
9858
|
}
|
|
9858
9859
|
return price * quantity;
|
|
@@ -9918,12 +9919,12 @@ function ProductCustomizerContent({
|
|
|
9918
9919
|
} = useQuote(quoteInput, {
|
|
9919
9920
|
enabled: quoteEnabled
|
|
9920
9921
|
});
|
|
9921
|
-
const currency = quote?.currency ??
|
|
9922
|
+
const currency = quote?.currency ?? chunkNNG6IFFX_js.getProductCurrency(product);
|
|
9922
9923
|
const quoteId = quote?.quote_id;
|
|
9923
9924
|
const quotedUnitPrice = (quote?.quoted_total_price_info ?? quote?.final_price_info)?.final_price;
|
|
9924
9925
|
const quotedTotalPrice = React14.useMemo(() => {
|
|
9925
9926
|
if (quotedUnitPrice === void 0 || quotedUnitPrice === null) return void 0;
|
|
9926
|
-
return
|
|
9927
|
+
return chunkNNG6IFFX_js.parsePrice(quotedUnitPrice) * quantity;
|
|
9927
9928
|
}, [quotedUnitPrice, quantity]);
|
|
9928
9929
|
const quoteIsReady = quoteEnabled && quote !== null && !isQuoteLoading && !quoteError && !isQuoteExpired2;
|
|
9929
9930
|
const validationMessage = !quoteEnabled ? REQUIRED_OPTIONS_MESSAGE : quoteError ? QUOTE_UNAVAILABLE_MESSAGE : !quoteIsReady ? QUOTE_LOADING_MESSAGE : null;
|
|
@@ -10147,7 +10148,7 @@ function ProductCustomizerContent({
|
|
|
10147
10148
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency })
|
|
10148
10149
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
10149
10150
|
"Deposit required: ",
|
|
10150
|
-
|
|
10151
|
+
chunkNNG6IFFX_js.parsePrice(product.deposit_amount),
|
|
10151
10152
|
"%"
|
|
10152
10153
|
] })
|
|
10153
10154
|
}
|
|
@@ -10255,10 +10256,10 @@ function ProductCustomizerContent({
|
|
|
10255
10256
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10256
10257
|
Price,
|
|
10257
10258
|
{
|
|
10258
|
-
amount:
|
|
10259
|
+
amount: chunkNNG6IFFX_js.getUnitPriceAtQuantity(
|
|
10259
10260
|
product.quantity_pricing,
|
|
10260
10261
|
quantity,
|
|
10261
|
-
|
|
10262
|
+
chunkNNG6IFFX_js.parsePrice(product.default_price)
|
|
10262
10263
|
),
|
|
10263
10264
|
currency,
|
|
10264
10265
|
className: "font-medium text-foreground"
|
|
@@ -10724,11 +10725,11 @@ function CartLineItemRow({
|
|
|
10724
10725
|
addOnOptions: item.addOnOptions
|
|
10725
10726
|
});
|
|
10726
10727
|
const pinnedUnitPrice = item._quotedUnitPrice;
|
|
10727
|
-
const unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice :
|
|
10728
|
+
const unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice : chunkNNG6IFFX_js.parsePrice(pinnedUnitPrice);
|
|
10728
10729
|
const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
|
|
10729
10730
|
const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
|
|
10730
10731
|
const isOptimistic2 = item.isOptimistic === true;
|
|
10731
|
-
const lineTotal =
|
|
10732
|
+
const lineTotal = chunkNNG6IFFX_js.parsePrice(unitPrice) * item.quantity;
|
|
10732
10733
|
const imageUrl = item.product.image_url;
|
|
10733
10734
|
const variantLabel2 = item.variant ? chunk2P4KXFB6_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
10734
10735
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -11017,7 +11018,7 @@ function CartSummary({
|
|
|
11017
11018
|
removeItem,
|
|
11018
11019
|
updateQuantity
|
|
11019
11020
|
} = useCart();
|
|
11020
|
-
const displayCurrency = serverCart?.currency ??
|
|
11021
|
+
const displayCurrency = serverCart?.currency ?? chunkJG5CQNCB_js.currencyCode(currency);
|
|
11021
11022
|
const deliveryFee = serverCart?.delivery_fee;
|
|
11022
11023
|
const serviceCharge = serverCart?.service_charge;
|
|
11023
11024
|
const totalDiscounts = serverCart?.total_discounts;
|
|
@@ -11080,7 +11081,7 @@ function CartSummary({
|
|
|
11080
11081
|
]
|
|
11081
11082
|
}
|
|
11082
11083
|
),
|
|
11083
|
-
totalDiscounts != null &&
|
|
11084
|
+
totalDiscounts != null && chunkNNG6IFFX_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11084
11085
|
"div",
|
|
11085
11086
|
{
|
|
11086
11087
|
"data-cimplify-cart-discount": true,
|
|
@@ -11106,7 +11107,7 @@ function CartSummary({
|
|
|
11106
11107
|
className: cn("flex items-baseline justify-between", classNames?.deliveryFee),
|
|
11107
11108
|
children: [
|
|
11108
11109
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
|
|
11109
|
-
|
|
11110
|
+
chunkNNG6IFFX_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11110
11111
|
Price,
|
|
11111
11112
|
{
|
|
11112
11113
|
amount: deliveryFee,
|
|
@@ -11117,7 +11118,7 @@ function CartSummary({
|
|
|
11117
11118
|
]
|
|
11118
11119
|
}
|
|
11119
11120
|
),
|
|
11120
|
-
serviceCharge != null &&
|
|
11121
|
+
serviceCharge != null && chunkNNG6IFFX_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11121
11122
|
"div",
|
|
11122
11123
|
{
|
|
11123
11124
|
"data-cimplify-cart-service-charge": true,
|
|
@@ -11251,18 +11252,18 @@ function SaleBadge({
|
|
|
11251
11252
|
className,
|
|
11252
11253
|
classNames
|
|
11253
11254
|
}) {
|
|
11254
|
-
const onSale =
|
|
11255
|
+
const onSale = chunkNNG6IFFX_js.isOnSale(product);
|
|
11255
11256
|
const hasDeal = dealInfo !== void 0;
|
|
11256
11257
|
if (!hasDeal && !onSale && !label) {
|
|
11257
11258
|
return null;
|
|
11258
11259
|
}
|
|
11259
11260
|
let percentage = null;
|
|
11260
11261
|
if (product.sale) {
|
|
11261
|
-
percentage =
|
|
11262
|
+
percentage = chunkNNG6IFFX_js.parsePrice(product.sale.percent_off);
|
|
11262
11263
|
} else if (hasDeal && dealInfo.benefit_type === "percentage") {
|
|
11263
|
-
percentage =
|
|
11264
|
+
percentage = chunkNNG6IFFX_js.parsePrice(dealInfo.value);
|
|
11264
11265
|
} else if (onSale) {
|
|
11265
|
-
percentage =
|
|
11266
|
+
percentage = chunkNNG6IFFX_js.getDiscountPercentage(product);
|
|
11266
11267
|
}
|
|
11267
11268
|
const badgeText = label ?? product.sale?.badge_text ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
|
|
11268
11269
|
if (!badgeText) {
|
|
@@ -11281,7 +11282,7 @@ function SaleBadge({
|
|
|
11281
11282
|
"%"
|
|
11282
11283
|
] }),
|
|
11283
11284
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
11284
|
-
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
11285
|
+
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkNNG6IFFX_js.getBasePrice(product), currency: chunkNNG6IFFX_js.getProductCurrency(product) }) })
|
|
11285
11286
|
]
|
|
11286
11287
|
}
|
|
11287
11288
|
);
|
|
@@ -11299,7 +11300,7 @@ function SalePrice({
|
|
|
11299
11300
|
if (!sale) {
|
|
11300
11301
|
return /* @__PURE__ */ jsxRuntime.jsx(Price, { amount, currency, className });
|
|
11301
11302
|
}
|
|
11302
|
-
const off = Math.round(
|
|
11303
|
+
const off = Math.round(chunkNNG6IFFX_js.parsePrice(sale.percent_off));
|
|
11303
11304
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11304
11305
|
"span",
|
|
11305
11306
|
{
|
|
@@ -11675,7 +11676,7 @@ function ProductSheet({
|
|
|
11675
11676
|
Price,
|
|
11676
11677
|
{
|
|
11677
11678
|
amount: fullProduct.default_price,
|
|
11678
|
-
currency:
|
|
11679
|
+
currency: chunkNNG6IFFX_js.getProductCurrency(fullProduct),
|
|
11679
11680
|
className: classNames?.price
|
|
11680
11681
|
}
|
|
11681
11682
|
)
|
|
@@ -11861,10 +11862,10 @@ function SoldOutOverlay() {
|
|
|
11861
11862
|
function SaleBadge2({ product }) {
|
|
11862
11863
|
let label = null;
|
|
11863
11864
|
if (product.sale) {
|
|
11864
|
-
const off = Math.round(
|
|
11865
|
+
const off = Math.round(chunkNNG6IFFX_js.parsePrice(product.sale.percent_off));
|
|
11865
11866
|
label = product.sale.badge_text ?? (off > 0 ? `-${off}%` : null);
|
|
11866
|
-
} else if (
|
|
11867
|
-
const pct =
|
|
11867
|
+
} else if (chunkNNG6IFFX_js.isOnSale(product)) {
|
|
11868
|
+
const pct = chunkNNG6IFFX_js.getDiscountPercentage(product);
|
|
11868
11869
|
label = pct && pct > 0 ? `-${pct}%` : null;
|
|
11869
11870
|
}
|
|
11870
11871
|
if (!label) return null;
|
|
@@ -11905,7 +11906,7 @@ function FoodProductCard({
|
|
|
11905
11906
|
className
|
|
11906
11907
|
}) {
|
|
11907
11908
|
const image = product.image_url || product.images?.[0] || "";
|
|
11908
|
-
const currency =
|
|
11909
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
11909
11910
|
const tags = product.tags || [];
|
|
11910
11911
|
const isSignature = product.metadata?.is_signature === true;
|
|
11911
11912
|
const isNew = product.metadata?.is_new === true;
|
|
@@ -11961,9 +11962,9 @@ function RetailProductCard({
|
|
|
11961
11962
|
className
|
|
11962
11963
|
}) {
|
|
11963
11964
|
const image = product.image_url || product.images?.[0] || "";
|
|
11964
|
-
const currency =
|
|
11965
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
11965
11966
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
11966
|
-
const onSale =
|
|
11967
|
+
const onSale = chunkNNG6IFFX_js.isOnSale(product);
|
|
11967
11968
|
const swatches = getColorSwatches(product);
|
|
11968
11969
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
11969
11970
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
@@ -11984,7 +11985,7 @@ function RetailProductCard({
|
|
|
11984
11985
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-xs text-muted-foreground line-through" })
|
|
11985
11986
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11986
11987
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
11987
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
11988
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkNNG6IFFX_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
|
|
11988
11989
|
] }) }),
|
|
11989
11990
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11990
11991
|
"span",
|
|
@@ -11999,10 +12000,10 @@ function RetailProductCard({
|
|
|
11999
12000
|
] });
|
|
12000
12001
|
}
|
|
12001
12002
|
function PriceRange({ product, currency, className }) {
|
|
12002
|
-
const resolvedCurrency = currency ??
|
|
12003
|
-
const range =
|
|
12003
|
+
const resolvedCurrency = currency ?? chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12004
|
+
const range = chunkNNG6IFFX_js.getPriceRange(product);
|
|
12004
12005
|
if (!range) return null;
|
|
12005
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children:
|
|
12006
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunkNNG6IFFX_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
|
|
12006
12007
|
}
|
|
12007
12008
|
function WholesaleProductCard({
|
|
12008
12009
|
product,
|
|
@@ -12012,7 +12013,7 @@ function WholesaleProductCard({
|
|
|
12012
12013
|
className
|
|
12013
12014
|
}) {
|
|
12014
12015
|
const image = product.image_url || product.images?.[0] || "";
|
|
12015
|
-
const currency =
|
|
12016
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12016
12017
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12017
12018
|
const status = product.inventory_status;
|
|
12018
12019
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -12060,7 +12061,7 @@ function DigitalProductCard({
|
|
|
12060
12061
|
className
|
|
12061
12062
|
}) {
|
|
12062
12063
|
const image = product.image_url || product.images?.[0] || "";
|
|
12063
|
-
const currency =
|
|
12064
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12064
12065
|
const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;
|
|
12065
12066
|
const isTicket = product.digital_type === "ticket";
|
|
12066
12067
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -12091,11 +12092,11 @@ function BundleProductCard({
|
|
|
12091
12092
|
className
|
|
12092
12093
|
}) {
|
|
12093
12094
|
const image = product.image_url || product.images?.[0] || "";
|
|
12094
|
-
const currency =
|
|
12095
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12095
12096
|
const components = product.components || [];
|
|
12096
12097
|
const componentCount = components.length;
|
|
12097
|
-
const onSale =
|
|
12098
|
-
const discount =
|
|
12098
|
+
const onSale = chunkNNG6IFFX_js.isOnSale(product);
|
|
12099
|
+
const discount = chunkNNG6IFFX_js.getDiscountPercentage(product);
|
|
12099
12100
|
const hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
12100
12101
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
12101
12102
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
@@ -12122,7 +12123,7 @@ function BundleProductCard({
|
|
|
12122
12123
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
12123
12124
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
12124
12125
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12125
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
12126
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkNNG6IFFX_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
|
|
12126
12127
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
12127
12128
|
"Save ",
|
|
12128
12129
|
discount,
|
|
@@ -12142,7 +12143,7 @@ function CompositeProductCard({
|
|
|
12142
12143
|
className
|
|
12143
12144
|
}) {
|
|
12144
12145
|
const image = product.image_url || product.images?.[0] || "";
|
|
12145
|
-
const currency =
|
|
12146
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12146
12147
|
const groups = product.groups || [];
|
|
12147
12148
|
const groupCount = groups.length;
|
|
12148
12149
|
groups.reduce((sum, g) => sum + g.components.length, 0);
|
|
@@ -12194,7 +12195,7 @@ function StandardServiceCard({
|
|
|
12194
12195
|
className
|
|
12195
12196
|
}) {
|
|
12196
12197
|
const image = product.image_url || product.images?.[0] || "";
|
|
12197
|
-
const currency =
|
|
12198
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12198
12199
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12199
12200
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
12200
12201
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
@@ -12249,7 +12250,7 @@ function CompactServiceCard({
|
|
|
12249
12250
|
className
|
|
12250
12251
|
}) {
|
|
12251
12252
|
const image = product.image_url || product.images?.[0] || "";
|
|
12252
|
-
const currency =
|
|
12253
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12253
12254
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12254
12255
|
const hasBillingPlans = product.billing_plans && product.billing_plans.length > 0;
|
|
12255
12256
|
const href = `/products/${product.slug}`;
|
|
@@ -12298,7 +12299,7 @@ function ScheduleServiceCard({
|
|
|
12298
12299
|
className
|
|
12299
12300
|
}) {
|
|
12300
12301
|
const image = product.image_url || product.images?.[0] || "";
|
|
12301
|
-
const currency =
|
|
12302
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12302
12303
|
const href = `/products/${product.slug}`;
|
|
12303
12304
|
const durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null;
|
|
12304
12305
|
const displaySlots = (slots || []).slice(0, 3);
|
|
@@ -12370,7 +12371,7 @@ function RentalServiceCard({
|
|
|
12370
12371
|
className
|
|
12371
12372
|
}) {
|
|
12372
12373
|
const image = product.image_url || product.images?.[0] || "";
|
|
12373
|
-
const currency =
|
|
12374
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12374
12375
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12375
12376
|
const unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day";
|
|
12376
12377
|
const priceUnit = product.price_basis === "per_person" ? "guest" : product.price_basis === "flat" ? "" : unit;
|
|
@@ -12440,7 +12441,7 @@ function AccommodationCard({
|
|
|
12440
12441
|
className
|
|
12441
12442
|
}) {
|
|
12442
12443
|
const image = product.image_url || product.images?.[0] || "";
|
|
12443
|
-
const currency =
|
|
12444
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12444
12445
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12445
12446
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
12446
12447
|
const tags = product.tags || [];
|
|
@@ -12506,7 +12507,7 @@ function LeaseServiceCard({
|
|
|
12506
12507
|
className
|
|
12507
12508
|
}) {
|
|
12508
12509
|
const image = product.image_url || product.images?.[0] || "";
|
|
12509
|
-
const currency =
|
|
12510
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12510
12511
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12511
12512
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12512
12513
|
const unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo";
|
|
@@ -12580,7 +12581,7 @@ function SubscriptionCard({
|
|
|
12580
12581
|
className
|
|
12581
12582
|
}) {
|
|
12582
12583
|
const image = product.image_url || product.images?.[0] || "";
|
|
12583
|
-
const currency =
|
|
12584
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
12584
12585
|
const plans = product.billing_plans || [];
|
|
12585
12586
|
const primaryPlan = plans[0];
|
|
12586
12587
|
const frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo";
|
|
@@ -12811,7 +12812,7 @@ function ProductCard({
|
|
|
12811
12812
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
|
|
12812
12813
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
|
|
12813
12814
|
descriptionPreview && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-description": true, className: cn("text-sm text-muted-foreground line-clamp-2", classNames?.description), children: descriptionPreview }),
|
|
12814
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency:
|
|
12815
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunkNNG6IFFX_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
|
|
12815
12816
|
] })
|
|
12816
12817
|
] });
|
|
12817
12818
|
})();
|
|
@@ -13140,7 +13141,7 @@ function SearchInput({
|
|
|
13140
13141
|
}
|
|
13141
13142
|
),
|
|
13142
13143
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
|
|
13143
|
-
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children:
|
|
13144
|
+
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunkNNG6IFFX_js.formatPrice(product.default_price) })
|
|
13144
13145
|
] })
|
|
13145
13146
|
},
|
|
13146
13147
|
product.id
|
|
@@ -13635,19 +13636,19 @@ function OrderSummary({
|
|
|
13635
13636
|
order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
|
|
13636
13637
|
] }),
|
|
13637
13638
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
13638
|
-
order.total_discount != null &&
|
|
13639
|
+
order.total_discount != null && chunkNNG6IFFX_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
|
|
13639
13640
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
13640
13641
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
13641
13642
|
] }),
|
|
13642
|
-
order.delivery_fee != null &&
|
|
13643
|
+
order.delivery_fee != null && chunkNNG6IFFX_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
|
|
13643
13644
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
13644
13645
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
13645
13646
|
] }),
|
|
13646
|
-
order.service_charge != null &&
|
|
13647
|
+
order.service_charge != null && chunkNNG6IFFX_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
|
|
13647
13648
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
13648
13649
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
13649
13650
|
] }),
|
|
13650
|
-
order.tax != null &&
|
|
13651
|
+
order.tax != null && chunkNNG6IFFX_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
13651
13652
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
13652
13653
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
13653
13654
|
] }),
|
|
@@ -14178,7 +14179,7 @@ function BookingPage({
|
|
|
14178
14179
|
const hasStaffStep = staff && staff.length > 0;
|
|
14179
14180
|
const depositType = product?.deposit_type;
|
|
14180
14181
|
const depositAmount = product?.deposit_amount;
|
|
14181
|
-
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 &&
|
|
14182
|
+
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunkNNG6IFFX_js.parsePrice(depositAmount) !== 0;
|
|
14182
14183
|
const cancellationMinutes = product?.cancellation_window_minutes;
|
|
14183
14184
|
const noShowFee = product?.no_show_fee;
|
|
14184
14185
|
const handleSlotSelect = React14.useCallback(
|
|
@@ -14311,14 +14312,14 @@ function BookingPage({
|
|
|
14311
14312
|
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
|
|
14312
14313
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
14313
14314
|
"Deposit: ",
|
|
14314
|
-
depositType === "percentage" ? `${
|
|
14315
|
+
depositType === "percentage" ? `${chunkNNG6IFFX_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
|
|
14315
14316
|
] }),
|
|
14316
14317
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
14317
14318
|
"Free cancellation up to ",
|
|
14318
14319
|
cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
|
|
14319
14320
|
" before"
|
|
14320
14321
|
] }),
|
|
14321
|
-
noShowFee !== void 0 &&
|
|
14322
|
+
noShowFee !== void 0 && chunkNNG6IFFX_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
|
|
14322
14323
|
"No-show fee: ",
|
|
14323
14324
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
|
|
14324
14325
|
] })
|
|
@@ -14421,7 +14422,7 @@ function BookingPage({
|
|
|
14421
14422
|
] }),
|
|
14422
14423
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
14423
14424
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
14424
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${
|
|
14425
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunkNNG6IFFX_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
|
|
14425
14426
|
] })
|
|
14426
14427
|
] }),
|
|
14427
14428
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15095,9 +15096,9 @@ function DefaultProductLayout({
|
|
|
15095
15096
|
}) {
|
|
15096
15097
|
const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
|
|
15097
15098
|
const images = chunk2P4KXFB6_js.resolveGallery(product, selectedVariantId);
|
|
15098
|
-
const currency =
|
|
15099
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
15099
15100
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
15100
|
-
const onSale =
|
|
15101
|
+
const onSale = chunkNNG6IFFX_js.isOnSale(product);
|
|
15101
15102
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
15102
15103
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
15103
15104
|
renderBreadcrumb?.(product),
|
|
@@ -15120,13 +15121,13 @@ function DefaultProductLayout({
|
|
|
15120
15121
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-3", children: hasRange ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, currency, className: "text-2xl font-extrabold" }) : product.sale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15121
15122
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.price, currency, className: "text-2xl font-extrabold" }),
|
|
15122
15123
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-lg text-muted-foreground line-through" }),
|
|
15123
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: product.sale.badge_text ?? `${Math.round(
|
|
15124
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: product.sale.badge_text ?? `${Math.round(chunkNNG6IFFX_js.parsePrice(product.sale.percent_off))}% OFF` })
|
|
15124
15125
|
] }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15125
15126
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
|
|
15126
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
15127
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkNNG6IFFX_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
|
|
15127
15128
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
15128
15129
|
"Save ",
|
|
15129
|
-
|
|
15130
|
+
chunkNNG6IFFX_js.getDiscountPercentage(product),
|
|
15130
15131
|
"%"
|
|
15131
15132
|
] })
|
|
15132
15133
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
@@ -15188,7 +15189,7 @@ function FoodProductLayout({
|
|
|
15188
15189
|
className
|
|
15189
15190
|
}) {
|
|
15190
15191
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15191
|
-
const currency =
|
|
15192
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
15192
15193
|
const tags = product.tags || [];
|
|
15193
15194
|
const ingredients = getMetadataStringList(product.metadata, "ingredients");
|
|
15194
15195
|
const pairings = getMetadataStringList(product.metadata, "pairings");
|
|
@@ -15263,7 +15264,7 @@ function WholesaleProductLayout({
|
|
|
15263
15264
|
className
|
|
15264
15265
|
}) {
|
|
15265
15266
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15266
|
-
const currency =
|
|
15267
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
15267
15268
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
15268
15269
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
|
|
15269
15270
|
renderBreadcrumb?.(product),
|
|
@@ -15347,9 +15348,9 @@ function ServiceProductLayout({
|
|
|
15347
15348
|
className
|
|
15348
15349
|
}) {
|
|
15349
15350
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15350
|
-
const currency =
|
|
15351
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
15351
15352
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
15352
|
-
const depositAmount = hasDeposit ?
|
|
15353
|
+
const depositAmount = hasDeposit ? chunkNNG6IFFX_js.parsePrice(product.deposit_amount) : 0;
|
|
15353
15354
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
15354
15355
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
15355
15356
|
renderBreadcrumb?.(product),
|
|
@@ -15417,7 +15418,7 @@ function ServiceProductLayout({
|
|
|
15417
15418
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
|
|
15418
15419
|
" deposit charged at booking"
|
|
15419
15420
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15420
|
-
|
|
15421
|
+
chunkNNG6IFFX_js.parsePrice(product.deposit_amount),
|
|
15421
15422
|
"% deposit charged at booking"
|
|
15422
15423
|
] }) })
|
|
15423
15424
|
] })
|
|
@@ -15449,7 +15450,7 @@ function DigitalProductLayout({
|
|
|
15449
15450
|
className
|
|
15450
15451
|
}) {
|
|
15451
15452
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15452
|
-
const currency =
|
|
15453
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
15453
15454
|
const typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product";
|
|
15454
15455
|
const isTicket = product.digital_type === "ticket";
|
|
15455
15456
|
const isAccessPass = product.digital_type === "access_grant";
|
|
@@ -15576,15 +15577,15 @@ function BundleProductLayout({
|
|
|
15576
15577
|
className
|
|
15577
15578
|
}) {
|
|
15578
15579
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15579
|
-
const currency =
|
|
15580
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
15580
15581
|
const components = product.components || [];
|
|
15581
|
-
const onSale =
|
|
15582
|
-
const discount =
|
|
15582
|
+
const onSale = chunkNNG6IFFX_js.isOnSale(product);
|
|
15583
|
+
const discount = chunkNNG6IFFX_js.getDiscountPercentage(product);
|
|
15583
15584
|
const baseTotal = components.reduce(
|
|
15584
|
-
(sum, c) => sum +
|
|
15585
|
+
(sum, c) => sum + chunkNNG6IFFX_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
15585
15586
|
0
|
|
15586
15587
|
);
|
|
15587
|
-
const bundlePrice =
|
|
15588
|
+
const bundlePrice = chunkNNG6IFFX_js.parsePrice(product.default_price);
|
|
15588
15589
|
const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
15589
15590
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
15590
15591
|
renderBreadcrumb?.(product),
|
|
@@ -15660,7 +15661,7 @@ function CompositeProductLayout({
|
|
|
15660
15661
|
className
|
|
15661
15662
|
}) {
|
|
15662
15663
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15663
|
-
const currency =
|
|
15664
|
+
const currency = chunkNNG6IFFX_js.getProductCurrency(product);
|
|
15664
15665
|
const groups = product.groups || [];
|
|
15665
15666
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
|
|
15666
15667
|
renderBreadcrumb?.(product),
|
|
@@ -16083,7 +16084,7 @@ function CartDrawer({
|
|
|
16083
16084
|
}) {
|
|
16084
16085
|
const { isOpen, close } = useCartDrawer();
|
|
16085
16086
|
const cart = useCart();
|
|
16086
|
-
const subtotalNum =
|
|
16087
|
+
const subtotalNum = chunkNNG6IFFX_js.parsePrice(cart.subtotal);
|
|
16087
16088
|
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
16088
16089
|
React14.useEffect(() => {
|
|
16089
16090
|
if (!isOpen) return;
|
|
@@ -16477,9 +16478,9 @@ function CatalogueCollectionLayout({
|
|
|
16477
16478
|
result = result.filter((p) => p.tags?.includes(activeCategory));
|
|
16478
16479
|
}
|
|
16479
16480
|
if (sortBy === "price-asc") {
|
|
16480
|
-
result = [...result].sort((a, b) =>
|
|
16481
|
+
result = [...result].sort((a, b) => chunkNNG6IFFX_js.parsePrice(a.default_price) - chunkNNG6IFFX_js.parsePrice(b.default_price));
|
|
16481
16482
|
} else if (sortBy === "price-desc") {
|
|
16482
|
-
result = [...result].sort((a, b) =>
|
|
16483
|
+
result = [...result].sort((a, b) => chunkNNG6IFFX_js.parsePrice(b.default_price) - chunkNNG6IFFX_js.parsePrice(a.default_price));
|
|
16483
16484
|
} else if (sortBy === "name") {
|
|
16484
16485
|
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
16485
16486
|
}
|
|
@@ -20008,7 +20009,7 @@ function toneChip(value) {
|
|
|
20008
20009
|
}
|
|
20009
20010
|
}
|
|
20010
20011
|
function money(amount, currency) {
|
|
20011
|
-
return
|
|
20012
|
+
return chunkNNG6IFFX_js.formatPrice(chunkNNG6IFFX_js.parsePrice(num(amount) ?? 0), text(currency));
|
|
20012
20013
|
}
|
|
20013
20014
|
var CHAT_GENUI_COMPONENTS = {
|
|
20014
20015
|
Stack: ({ node, ctx }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20256,7 +20257,7 @@ function ReplyCardView({
|
|
|
20256
20257
|
card.image_url && /* @__PURE__ */ jsxRuntime.jsx("img", { src: card.image_url, alt: "", className: "size-12 shrink-0 rounded-xl object-cover" }),
|
|
20257
20258
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
20258
20259
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: card.name }),
|
|
20259
|
-
card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children:
|
|
20260
|
+
card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children: chunkNNG6IFFX_js.formatPrice(chunkNNG6IFFX_js.parsePrice(card.price), currency ?? void 0) }),
|
|
20260
20261
|
fire2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-primary", children: "View" })
|
|
20261
20262
|
] })
|
|
20262
20263
|
]
|
|
@@ -20353,12 +20354,12 @@ function ChatWidget({
|
|
|
20353
20354
|
setAttachError(null);
|
|
20354
20355
|
if (!isAllowedAttachment(file)) {
|
|
20355
20356
|
setAttachError(
|
|
20356
|
-
new
|
|
20357
|
+
new chunkJG5CQNCB_js.CimplifyError("invalid_attachment", "Only photos and documents can be attached.")
|
|
20357
20358
|
);
|
|
20358
20359
|
return;
|
|
20359
20360
|
}
|
|
20360
20361
|
if (file.size > MAX_ATTACHMENT_BYTES) {
|
|
20361
|
-
setAttachError(new
|
|
20362
|
+
setAttachError(new chunkJG5CQNCB_js.CimplifyError("attachment_too_large", "Files must be under 25MB."));
|
|
20362
20363
|
return;
|
|
20363
20364
|
}
|
|
20364
20365
|
const uploaded = await client.uploads.upload(file);
|