@standhigher/besttrack-page-extension 0.5.11 → 0.5.13
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/index.d.ts +125 -105
- package/dist/index.js +950 -779
- package/dist/validation.js +6 -3
- package/package.json +8 -8
- package/dist/{chunk-KEW42Y26.js → chunk-KD7KFFFK.js} +28 -28
package/dist/index.js
CHANGED
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
isValidTrackingNumber,
|
|
12
12
|
resolveShopifyResources,
|
|
13
13
|
safeTrackingPageUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KD7KFFFK.js";
|
|
15
15
|
|
|
16
|
-
// src/
|
|
17
|
-
import { createContext, useCallback
|
|
18
|
-
import { parseProductReferences } from "@standhigher/puck-page-builder/runtime";
|
|
16
|
+
// src/tracking-runtime.tsx
|
|
17
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
19
18
|
|
|
20
19
|
// src/shopify-track-page/i18n/locales.ts
|
|
21
20
|
var SUPPORTED_LOCALES = [
|
|
@@ -592,6 +591,19 @@ var sanitizeMilestone = (milestone) => ({
|
|
|
592
591
|
estimated_delivery: sanitizeEstimatedDelivery(milestone?.estimated_delivery)
|
|
593
592
|
});
|
|
594
593
|
var sanitizeMilestones = (milestones) => Array.isArray(milestones) ? milestones.map(sanitizeMilestone) : [];
|
|
594
|
+
function mergeDisplayValues(previous, next) {
|
|
595
|
+
const normalizedNext = next.filter(Boolean);
|
|
596
|
+
if (normalizedNext.length === 0) {
|
|
597
|
+
return previous;
|
|
598
|
+
}
|
|
599
|
+
const merged = [...normalizedNext];
|
|
600
|
+
previous.forEach((value) => {
|
|
601
|
+
if (!normalizedNext.includes(value)) {
|
|
602
|
+
merged.push(value);
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
return merged.slice(0, 3);
|
|
606
|
+
}
|
|
595
607
|
function normalizeOrderValue(value) {
|
|
596
608
|
return value.trim();
|
|
597
609
|
}
|
|
@@ -824,12 +836,17 @@ function toEvents(details) {
|
|
|
824
836
|
}));
|
|
825
837
|
}
|
|
826
838
|
function toOrderItems(items) {
|
|
827
|
-
return (items ?? []).map((item, index) =>
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
839
|
+
return (items ?? []).map((item, index) => {
|
|
840
|
+
const productId = (item.product_id ?? "").replace("gid://shopify/Product/", "");
|
|
841
|
+
const href = resolveShopifyRecommendHref(void 0, productId);
|
|
842
|
+
return {
|
|
843
|
+
id: item.variant_id || item.product_id || `item-${index}`,
|
|
844
|
+
title: [item.title, item.variant_title].filter(Boolean).join(" - "),
|
|
845
|
+
quantity: item.quantity,
|
|
846
|
+
imageUrl: item.image_url || void 0,
|
|
847
|
+
...href ? { href } : {}
|
|
848
|
+
};
|
|
849
|
+
});
|
|
833
850
|
}
|
|
834
851
|
function cityRegion(milestone) {
|
|
835
852
|
const records = milestone?.rawEventList?.length ? milestone.rawEventList : milestone?.nodeList ?? [];
|
|
@@ -890,6 +907,7 @@ function mapShopifyTrackQueryResponse(response, request, locale = "EN") {
|
|
|
890
907
|
events: primary.events,
|
|
891
908
|
orderItems: primary.orderItems,
|
|
892
909
|
ad,
|
|
910
|
+
// 旧接口广告是本次响应共用配置,因此复制到各包裹,切换后仍能读取同一广告。
|
|
893
911
|
shipments: shipments.map((shipment) => ({ ...shipment, ad }))
|
|
894
912
|
};
|
|
895
913
|
}
|
|
@@ -973,11 +991,342 @@ function createShopifyRecommendationsQuery(post) {
|
|
|
973
991
|
};
|
|
974
992
|
}
|
|
975
993
|
|
|
994
|
+
// src/tracking-block-model.ts
|
|
995
|
+
import { parseProductReferences } from "@standhigher/puck-page-builder/runtime";
|
|
996
|
+
function defaultProgress(status) {
|
|
997
|
+
const steps = [
|
|
998
|
+
{ id: "ordered", label: "Ordered", icon: "check" },
|
|
999
|
+
{ id: "ready", label: "Order Ready", icon: "bag" },
|
|
1000
|
+
{ id: "transit", label: "In Transit", icon: "truck" },
|
|
1001
|
+
{ id: "out", label: "Out for Delivery", icon: "box" },
|
|
1002
|
+
{ id: "delivered", label: "Delivered", icon: "check" }
|
|
1003
|
+
];
|
|
1004
|
+
const normalized = status.toLowerCase();
|
|
1005
|
+
const current = normalized.includes("deliver") ? normalized.includes("out for") ? 3 : 4 : normalized.includes("transit") ? 2 : normalized.includes("ready") ? 1 : 0;
|
|
1006
|
+
return steps.map((step, index) => ({
|
|
1007
|
+
...step,
|
|
1008
|
+
state: index < current ? "complete" : index === current ? "current" : "upcoming"
|
|
1009
|
+
}));
|
|
1010
|
+
}
|
|
1011
|
+
function previewTrackingPageResult(trackingNumber = "BT-2048-DEMO") {
|
|
1012
|
+
return {
|
|
1013
|
+
trackingNumber,
|
|
1014
|
+
status: "In transit",
|
|
1015
|
+
carrier: "BestTrack demo carrier",
|
|
1016
|
+
latestEvent: "Shipment accepted at the regional hub",
|
|
1017
|
+
updatedAt: "Sep 17, 10:00 AM",
|
|
1018
|
+
destination: "Shanghai",
|
|
1019
|
+
estimatedDelivery: "Sep 22 - Sep 24",
|
|
1020
|
+
progress: defaultProgress("In transit"),
|
|
1021
|
+
events: [
|
|
1022
|
+
{ id: "hub", title: "Shipment accepted at the regional hub", at: "Sep 17, 10:00 AM", state: "current" },
|
|
1023
|
+
{ id: "info", title: "The order has been placed and confirmed.", at: "Sep 16, 3:31 PM", state: "complete" }
|
|
1024
|
+
],
|
|
1025
|
+
orderItems: [{ id: "demo-order-item", title: "Demo shipment item", quantity: 1, description: "Product details are available in your order." }],
|
|
1026
|
+
// 演示结果保留该字段供画布取样;正式 Web 推荐仍通过 recommendationItems 读取独立来源。
|
|
1027
|
+
recommendations: [
|
|
1028
|
+
{ id: "shipping-protection", title: "Shipping protection", description: "Extra assurance for your next delivery.", price: { amount: 900, currencyCode: "USD" } },
|
|
1029
|
+
{ id: "delivery-alerts", title: "Delivery alerts", description: "Receive an update at every milestone.", price: { amount: 400, currencyCode: "USD" } }
|
|
1030
|
+
]
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
function configuredRecommendations(products) {
|
|
1034
|
+
return parseProductReferences(products).map((product) => ({
|
|
1035
|
+
id: product.id,
|
|
1036
|
+
title: product.title || product.id,
|
|
1037
|
+
description: "",
|
|
1038
|
+
imageUrl: product.imageUrl,
|
|
1039
|
+
// 商品引用快照保存 handle;先生成店铺商品地址,渲染卡片时仍需经过 URL 安全检查。
|
|
1040
|
+
href: resolveShopifyRecommendHref(void 0, product.handle),
|
|
1041
|
+
...product.price ? { price: product.price } : {}
|
|
1042
|
+
}));
|
|
1043
|
+
}
|
|
1044
|
+
function trackingEvents(result) {
|
|
1045
|
+
if (result?.events?.length) return result.events;
|
|
1046
|
+
if (result?.latestEvent) return [{ id: "latest", title: result.latestEvent, at: result.updatedAt, state: "current" }];
|
|
1047
|
+
return [];
|
|
1048
|
+
}
|
|
1049
|
+
function formatRecommendationPrice(price) {
|
|
1050
|
+
if (!price || !Number.isInteger(price.amount)) return "";
|
|
1051
|
+
return `$ ${(price.amount / 100).toFixed(2)}`;
|
|
1052
|
+
}
|
|
1053
|
+
function trackingSteps(result) {
|
|
1054
|
+
return result.progress?.length ? result.progress : defaultProgress(result.status);
|
|
1055
|
+
}
|
|
1056
|
+
function recommendationItems(products, runtime) {
|
|
1057
|
+
const configured = configuredRecommendations(products);
|
|
1058
|
+
return configured.length ? configured : runtime.recommendations.phase === "success" ? runtime.recommendations.items : [];
|
|
1059
|
+
}
|
|
1060
|
+
function trackingSelection(result, recentQueries) {
|
|
1061
|
+
const identity = recentQueries.length > 0 ? { mode: recentQueries[0].mode, values: recentQueries.map((item) => item.value).slice(0, 3) } : { mode: "tracking", values: result.trackingNumber ? [result.trackingNumber] : [] };
|
|
1062
|
+
const shipmentValues = (result.shipments ?? []).map((shipment, index) => shipment.trackingNumber || shipment.label || `shipment #${index + 1}`);
|
|
1063
|
+
return { identity, shipmentValues };
|
|
1064
|
+
}
|
|
1065
|
+
function trackingBlockState({ phase, autoQueryDemo = false }) {
|
|
1066
|
+
return {
|
|
1067
|
+
showResult: phase === "success",
|
|
1068
|
+
showNotFound: phase === "empty",
|
|
1069
|
+
showUnavailable: phase === "error",
|
|
1070
|
+
showProgress: phase === "success" || phase === "empty" || phase === "error",
|
|
1071
|
+
showDelivery: phase === "success" || phase === "error",
|
|
1072
|
+
showEstimatedDelivery: !autoQueryDemo
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
// src/tracking-runtime.tsx
|
|
1077
|
+
import { jsx } from "react/jsx-runtime";
|
|
1078
|
+
function recentQueryFromRequest(request, result) {
|
|
1079
|
+
if (request.mode === "order") {
|
|
1080
|
+
const value2 = request.orderNumber.trim() || result.orderNumber?.trim() || "";
|
|
1081
|
+
if (!value2) return null;
|
|
1082
|
+
return { mode: "order", value: value2, email: request.email.trim() || void 0, result };
|
|
1083
|
+
}
|
|
1084
|
+
const value = request.trackingNumber.trim() || result.trackingNumber.trim();
|
|
1085
|
+
if (!value) return null;
|
|
1086
|
+
return { mode: "tracking", value, result };
|
|
1087
|
+
}
|
|
1088
|
+
function mergeRecentQueries(previous, next) {
|
|
1089
|
+
if (previous[0] && (previous[0].mode !== next.mode || next.mode === "order" && previous[0].email !== next.email)) return [next];
|
|
1090
|
+
const values = mergeDisplayValues(previous.map((item) => item.value), [next.value]);
|
|
1091
|
+
const byValue = new Map(previous.map((item) => [item.value, item]));
|
|
1092
|
+
byValue.set(next.value, next);
|
|
1093
|
+
return values.flatMap((value) => {
|
|
1094
|
+
const item = byValue.get(value);
|
|
1095
|
+
return item ? [item] : [];
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
function resultWithShipment(result, index) {
|
|
1099
|
+
const shipment = result.shipments?.[index];
|
|
1100
|
+
if (!shipment) return result;
|
|
1101
|
+
return {
|
|
1102
|
+
...result,
|
|
1103
|
+
trackingNumber: shipment.trackingNumber || result.trackingNumber,
|
|
1104
|
+
status: shipment.status || result.status,
|
|
1105
|
+
carrier: shipment.carrier,
|
|
1106
|
+
latestEvent: shipment.latestEvent,
|
|
1107
|
+
updatedAt: shipment.updatedAt,
|
|
1108
|
+
destination: shipment.destination,
|
|
1109
|
+
estimatedDelivery: shipment.estimatedDelivery,
|
|
1110
|
+
progress: shipment.progress ?? result.progress,
|
|
1111
|
+
events: shipment.events ?? result.events,
|
|
1112
|
+
orderItems: shipment.orderItems ?? result.orderItems,
|
|
1113
|
+
ad: shipment.ad ?? result.ad
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
var initialRuntime = {
|
|
1117
|
+
phase: "idle",
|
|
1118
|
+
recentQueries: [],
|
|
1119
|
+
selectedRecentIndex: 0,
|
|
1120
|
+
selectionRevision: 0,
|
|
1121
|
+
selectedShipmentIndex: 0,
|
|
1122
|
+
selectRecentQuery() {
|
|
1123
|
+
return void 0;
|
|
1124
|
+
},
|
|
1125
|
+
selectShipment() {
|
|
1126
|
+
return void 0;
|
|
1127
|
+
},
|
|
1128
|
+
recommendations: { phase: "idle", items: [] },
|
|
1129
|
+
autoQueryFromUrl: false,
|
|
1130
|
+
autoQueryDemo: false,
|
|
1131
|
+
reset() {
|
|
1132
|
+
return void 0;
|
|
1133
|
+
},
|
|
1134
|
+
async query() {
|
|
1135
|
+
return void 0;
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
var TrackingRuntimeContext = createContext(initialRuntime);
|
|
1139
|
+
async function queryMockTracking(request) {
|
|
1140
|
+
return previewTrackingPageResult(request.mode === "tracking" ? request.trackingNumber : request.orderNumber);
|
|
1141
|
+
}
|
|
1142
|
+
function TrackingRuntimeProvider({ children, query: injectedQuery, queryRecommendations, transport, autoQueryFromUrl, autoQueryDemo = false, watermark, adPreview, resourceResolution }) {
|
|
1143
|
+
const [state, setState] = useState({ phase: "idle" });
|
|
1144
|
+
const [recentQueries, setRecentQueries] = useState([]);
|
|
1145
|
+
const [selectedRecentIndex, setSelectedRecentIndex] = useState(0);
|
|
1146
|
+
const [selectionRevision, setSelectionRevision] = useState(0);
|
|
1147
|
+
const [selectedShipmentIndex, setSelectedShipmentIndex] = useState(0);
|
|
1148
|
+
const requestId = useRef(0);
|
|
1149
|
+
const resolvedQuery = useMemo(() => {
|
|
1150
|
+
if (injectedQuery) return injectedQuery;
|
|
1151
|
+
if (transport) return createShopifyTrackQuery(transport);
|
|
1152
|
+
return void 0;
|
|
1153
|
+
}, [injectedQuery, transport]);
|
|
1154
|
+
const resolvedRecommendations = useMemo(() => {
|
|
1155
|
+
if (queryRecommendations) return queryRecommendations;
|
|
1156
|
+
if (transport) return createShopifyRecommendationsQuery(transport.post);
|
|
1157
|
+
return void 0;
|
|
1158
|
+
}, [queryRecommendations, transport]);
|
|
1159
|
+
const live = Boolean(resolvedQuery);
|
|
1160
|
+
const [recommendationLoad, setRecommendationLoad] = useState(() => ({ source: resolvedRecommendations, state: { phase: resolvedRecommendations ? "loading" : "idle", items: [] } }));
|
|
1161
|
+
const recommendations = useMemo(() => recommendationLoad.source === resolvedRecommendations ? recommendationLoad.state : { phase: resolvedRecommendations ? "loading" : "idle", items: [] }, [recommendationLoad, resolvedRecommendations]);
|
|
1162
|
+
if (recommendationLoad.source !== resolvedRecommendations) {
|
|
1163
|
+
setRecommendationLoad({ source: resolvedRecommendations, state: recommendations });
|
|
1164
|
+
}
|
|
1165
|
+
useEffect(() => {
|
|
1166
|
+
if (!resolvedRecommendations) return;
|
|
1167
|
+
let active = true;
|
|
1168
|
+
void Promise.resolve().then(resolvedRecommendations).then((items) => {
|
|
1169
|
+
if (!active) return;
|
|
1170
|
+
setRecommendationLoad({ source: resolvedRecommendations, state: { phase: items.length ? "success" : "empty", items } });
|
|
1171
|
+
}).catch(() => {
|
|
1172
|
+
if (!active) return;
|
|
1173
|
+
setRecommendationLoad({ source: resolvedRecommendations, state: { phase: "error", items: [] } });
|
|
1174
|
+
});
|
|
1175
|
+
return () => {
|
|
1176
|
+
active = false;
|
|
1177
|
+
};
|
|
1178
|
+
}, [resolvedRecommendations]);
|
|
1179
|
+
const query = useCallback(async (request) => {
|
|
1180
|
+
const currentRequestId = ++requestId.current;
|
|
1181
|
+
setState({ phase: "loading" });
|
|
1182
|
+
try {
|
|
1183
|
+
const result = live ? await resolvedQuery(request) : await queryMockTracking(request);
|
|
1184
|
+
if (currentRequestId !== requestId.current) return;
|
|
1185
|
+
if (isEmptyTrackingPageResult(result)) {
|
|
1186
|
+
setState({ phase: "empty", result });
|
|
1187
|
+
return;
|
|
1188
|
+
}
|
|
1189
|
+
const recent = recentQueryFromRequest(request, result);
|
|
1190
|
+
if (recent) {
|
|
1191
|
+
setRecentQueries((previous) => mergeRecentQueries(previous, recent));
|
|
1192
|
+
setSelectedRecentIndex(0);
|
|
1193
|
+
setSelectedShipmentIndex(0);
|
|
1194
|
+
}
|
|
1195
|
+
setState({ phase: "success", result: resultWithShipment(result, 0) });
|
|
1196
|
+
} catch {
|
|
1197
|
+
if (currentRequestId !== requestId.current) return;
|
|
1198
|
+
setState({ phase: "error", error: "We couldn\u2019t retrieve this order right now. Please try again later." });
|
|
1199
|
+
}
|
|
1200
|
+
}, [live, resolvedQuery]);
|
|
1201
|
+
const selectRecentQuery = useCallback((index) => {
|
|
1202
|
+
const item = recentQueries[index];
|
|
1203
|
+
if (!item) return;
|
|
1204
|
+
requestId.current += 1;
|
|
1205
|
+
setSelectionRevision((revision) => revision + 1);
|
|
1206
|
+
setSelectedRecentIndex(index);
|
|
1207
|
+
setSelectedShipmentIndex(0);
|
|
1208
|
+
setState({ phase: "success", result: resultWithShipment(item.result, 0) });
|
|
1209
|
+
}, [recentQueries]);
|
|
1210
|
+
const selectShipment = useCallback((index) => {
|
|
1211
|
+
const full = recentQueries[selectedRecentIndex]?.result ?? state.result;
|
|
1212
|
+
if (!full?.shipments?.[index]) return;
|
|
1213
|
+
requestId.current += 1;
|
|
1214
|
+
setSelectedShipmentIndex(index);
|
|
1215
|
+
setState({ phase: "success", result: resultWithShipment(full, index) });
|
|
1216
|
+
}, [recentQueries, selectedRecentIndex, state.result]);
|
|
1217
|
+
const reset = useCallback(() => {
|
|
1218
|
+
requestId.current += 1;
|
|
1219
|
+
setState({ phase: "idle" });
|
|
1220
|
+
setRecentQueries([]);
|
|
1221
|
+
setSelectedRecentIndex(0);
|
|
1222
|
+
setSelectedShipmentIndex(0);
|
|
1223
|
+
}, []);
|
|
1224
|
+
const resolveAutoQuery = autoQueryFromUrl ?? Boolean(transport && !injectedQuery);
|
|
1225
|
+
const resolvedWatermark = useMemo(
|
|
1226
|
+
() => watermark ?? { visible: !shouldHidePoweredBy() },
|
|
1227
|
+
[watermark]
|
|
1228
|
+
);
|
|
1229
|
+
const value = useMemo(() => ({
|
|
1230
|
+
...state,
|
|
1231
|
+
adPreview,
|
|
1232
|
+
resourceResolution,
|
|
1233
|
+
reset,
|
|
1234
|
+
query,
|
|
1235
|
+
recentQueries,
|
|
1236
|
+
selectedRecentIndex,
|
|
1237
|
+
selectionRevision,
|
|
1238
|
+
selectedShipmentIndex,
|
|
1239
|
+
selectRecentQuery,
|
|
1240
|
+
selectShipment,
|
|
1241
|
+
recommendations,
|
|
1242
|
+
autoQueryFromUrl: resolveAutoQuery,
|
|
1243
|
+
autoQueryDemo,
|
|
1244
|
+
watermark: resolvedWatermark
|
|
1245
|
+
}), [adPreview, resourceResolution, reset, autoQueryDemo, query, recentQueries, recommendations, resolveAutoQuery, resolvedWatermark, selectRecentQuery, selectShipment, selectedRecentIndex, selectionRevision, selectedShipmentIndex, state]);
|
|
1246
|
+
return /* @__PURE__ */ jsx(TrackingRuntimeContext.Provider, { value, children });
|
|
1247
|
+
}
|
|
1248
|
+
function useTrackingRuntime() {
|
|
1249
|
+
return useContext(TrackingRuntimeContext);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
// src/tracking-query-form.ts
|
|
1253
|
+
import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
1254
|
+
function useTrackingQueryForm({ initialTrackingNumber, initialOrderNumber = "", initialMode = "tracking", onComplete, onQuery, phase }) {
|
|
1255
|
+
const runtime = useTrackingRuntime();
|
|
1256
|
+
const query = onQuery ?? runtime.query;
|
|
1257
|
+
const loading = (phase ?? runtime.phase) === "loading";
|
|
1258
|
+
const [locationState] = useState2(() => runtime.autoQueryFromUrl ? readTrackingQueryLocationState() : void 0);
|
|
1259
|
+
const [mode, updateMode] = useState2(locationState?.tab ?? initialMode);
|
|
1260
|
+
const [trackingNumber, setTrackingNumber] = useState2(locationState?.trackingNumber || initialTrackingNumber);
|
|
1261
|
+
const [orderNumber, setOrderNumber] = useState2(locationState?.orderNumber || initialOrderNumber);
|
|
1262
|
+
const [email, setEmail] = useState2(locationState?.email ?? "");
|
|
1263
|
+
const [localError, setLocalError] = useState2("");
|
|
1264
|
+
const [firstInvalidField, setFirstInvalidField] = useState2();
|
|
1265
|
+
const autoQueryStarted = useRef2(false);
|
|
1266
|
+
const previewDemoTrackingNumber = useRef2(trackingNumber);
|
|
1267
|
+
const selected = runtime.recentQueries[runtime.selectedRecentIndex];
|
|
1268
|
+
const [lastSelectionRevision, setLastSelectionRevision] = useState2(runtime.selectionRevision);
|
|
1269
|
+
if (lastSelectionRevision !== runtime.selectionRevision) {
|
|
1270
|
+
setLastSelectionRevision(runtime.selectionRevision);
|
|
1271
|
+
if (selected) {
|
|
1272
|
+
updateMode(selected.mode);
|
|
1273
|
+
setLocalError("");
|
|
1274
|
+
setFirstInvalidField(void 0);
|
|
1275
|
+
if (selected.mode === "tracking") setTrackingNumber(selected.value);
|
|
1276
|
+
else {
|
|
1277
|
+
setOrderNumber(selected.value);
|
|
1278
|
+
setEmail(selected.email ?? "");
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
useEffect2(() => {
|
|
1283
|
+
if (autoQueryStarted.current) return;
|
|
1284
|
+
if (locationState?.canAutoQuery) {
|
|
1285
|
+
autoQueryStarted.current = true;
|
|
1286
|
+
void query(locationState.tab === "tracking" ? { mode: "tracking", trackingNumber: locationState.trackingNumber } : { mode: "order", orderNumber: locationState.orderNumber, email: locationState.email }).finally(onComplete);
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1289
|
+
const demoTrackingNumber = previewDemoTrackingNumber.current.trim();
|
|
1290
|
+
if (!runtime.autoQueryDemo || !demoTrackingNumber) return;
|
|
1291
|
+
autoQueryStarted.current = true;
|
|
1292
|
+
void query({ mode: "tracking", trackingNumber: demoTrackingNumber });
|
|
1293
|
+
}, [locationState, onComplete, query, runtime.autoQueryDemo]);
|
|
1294
|
+
const setMode = (next) => {
|
|
1295
|
+
updateMode(next);
|
|
1296
|
+
setLocalError("");
|
|
1297
|
+
setFirstInvalidField(void 0);
|
|
1298
|
+
};
|
|
1299
|
+
const submit = (event) => {
|
|
1300
|
+
event.preventDefault();
|
|
1301
|
+
if (loading) return;
|
|
1302
|
+
setLocalError("");
|
|
1303
|
+
setFirstInvalidField(void 0);
|
|
1304
|
+
if (mode === "order") {
|
|
1305
|
+
if (!orderNumber.trim() || !email.trim()) {
|
|
1306
|
+
setLocalError("Please enter your order number and email address");
|
|
1307
|
+
setFirstInvalidField(!orderNumber.trim() ? "order" : "email");
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
syncTrackingQueryToUrl("order", orderNumber.trim(), email.trim());
|
|
1311
|
+
void query({ mode: "order", orderNumber: orderNumber.trim(), email: email.trim() }).finally(onComplete);
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
if (!trackingNumber.trim()) {
|
|
1315
|
+
setLocalError("Please enter your tracking number");
|
|
1316
|
+
setFirstInvalidField("tracking");
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
syncTrackingQueryToUrl("tracking", trackingNumber.trim());
|
|
1320
|
+
void query({ mode: "tracking", trackingNumber: trackingNumber.trim() }).finally(onComplete);
|
|
1321
|
+
};
|
|
1322
|
+
return { mode, setMode, trackingNumber, setTrackingNumber, orderNumber, setOrderNumber, email, setEmail, localError, firstInvalidField, loading, submit };
|
|
1323
|
+
}
|
|
1324
|
+
|
|
976
1325
|
// src/track-page-display.tsx
|
|
977
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
1326
|
+
import { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useState as useState3 } from "react";
|
|
978
1327
|
import Autoplay from "embla-carousel-autoplay";
|
|
979
1328
|
import useEmblaCarousel from "embla-carousel-react";
|
|
980
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
1329
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
981
1330
|
var pageFont = { fontFamily: "var(--pb-font-family, Inter, system-ui, sans-serif)" };
|
|
982
1331
|
var contentWidth = {
|
|
983
1332
|
width: "min(1248px, 100%)",
|
|
@@ -1001,55 +1350,52 @@ var trackingProgressStyles = `
|
|
|
1001
1350
|
.bt-progress__label { font-size: 11px; line-height: 14px; }
|
|
1002
1351
|
}
|
|
1003
1352
|
`;
|
|
1353
|
+
var packageNameStyles = `
|
|
1354
|
+
.bt-package-name { position: relative; width: 100%; max-width: 100%; min-width: 0; outline: none; }
|
|
1355
|
+
.bt-package-name__text { display: block; width: 100%; max-width: 100%; margin: 0; overflow: hidden; font-size: 14px; font-weight: 500; color: #1e293b; text-overflow: ellipsis; white-space: nowrap; }
|
|
1356
|
+
.bt-package-name__tooltip { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30; width: max-content; max-width: min(320px, calc(100vw - 48px)); padding: 8px 10px; border-radius: 6px; background: #0f172a; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.35; opacity: 0; overflow-wrap: anywhere; pointer-events: none; transform: translateY(2px); transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease; visibility: hidden; white-space: normal; }
|
|
1357
|
+
.bt-package-name:hover .bt-package-name__tooltip,
|
|
1358
|
+
.bt-package-name:focus-within .bt-package-name__tooltip { opacity: 1; transform: translateY(0); visibility: visible; }
|
|
1359
|
+
.bt-package-reorder { box-sizing: border-box; display: inline-flex; width: fit-content; height: 30px; flex-shrink: 0; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; color: #1e293b; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 16px; background: #fff; cursor: pointer; text-decoration: none; transition: border-color 0.15s; }
|
|
1360
|
+
.bt-package-reorder:hover { border-color: #94a3b8; }
|
|
1361
|
+
`;
|
|
1004
1362
|
function text(props, key, fallback = "") {
|
|
1005
1363
|
return typeof props[key] === "string" ? props[key] : fallback;
|
|
1006
1364
|
}
|
|
1007
1365
|
function safeHref(value) {
|
|
1008
1366
|
return safeTrackingPageUrl(value);
|
|
1009
1367
|
}
|
|
1368
|
+
function packageReorderHref(href) {
|
|
1369
|
+
return safeHref(href) ?? resolveShopifyRecommendHref(href) ?? "/products/";
|
|
1370
|
+
}
|
|
1010
1371
|
function safeImageUrl(value) {
|
|
1011
1372
|
return safeTrackingPageUrl(value);
|
|
1012
1373
|
}
|
|
1013
|
-
function defaultProgress(status) {
|
|
1014
|
-
const steps = [
|
|
1015
|
-
{ id: "ordered", label: "Ordered", icon: "check" },
|
|
1016
|
-
{ id: "ready", label: "Order Ready", icon: "bag" },
|
|
1017
|
-
{ id: "transit", label: "In Transit", icon: "truck" },
|
|
1018
|
-
{ id: "out", label: "Out for Delivery", icon: "box" },
|
|
1019
|
-
{ id: "delivered", label: "Delivered", icon: "check" }
|
|
1020
|
-
];
|
|
1021
|
-
const normalized = status.toLowerCase();
|
|
1022
|
-
const current = normalized.includes("deliver") ? normalized.includes("out for") ? 3 : 4 : normalized.includes("transit") ? 2 : normalized.includes("ready") ? 1 : 0;
|
|
1023
|
-
return steps.map((step, index) => ({
|
|
1024
|
-
...step,
|
|
1025
|
-
state: index < current ? "complete" : index === current ? "current" : "upcoming"
|
|
1026
|
-
}));
|
|
1027
|
-
}
|
|
1028
1374
|
function StepIcon({ name, done }) {
|
|
1029
1375
|
const fill = done ? "#ffffff" : "currentColor";
|
|
1030
1376
|
const common = { width: 24, height: 24, viewBox: "0 0 24 24", "aria-hidden": true, style: { width: 24, height: 24, display: "block" } };
|
|
1031
1377
|
if (name === "bag") {
|
|
1032
1378
|
return /* @__PURE__ */ jsxs("svg", { ...common, children: [
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ jsx2("path", { fill, d: "M9.9 12.9c0-.239.095-.468.264-.636A.9.9 0 0 1 10.8 12h2.4a.9.9 0 1 1 0 1.8h-2.4a.9.9 0 0 1-.9-.9Z" }),
|
|
1380
|
+
/* @__PURE__ */ jsx2("path", { fill, fillRule: "evenodd", d: "M6.3 4.2a2.1 2.1 0 0 0-2.1 2.1v2.4c0 .714.357 1.344.9 1.723V16.5a3.3 3.3 0 0 0 3.3 3.3h7.2a3.3 3.3 0 0 0 3.3-3.3v-6.077c.543-.379.9-1.009.9-1.723V6.3a2.1 2.1 0 0 0-2.1-2.1H6.3Zm10.8 6.6H6.9V16.5a1.5 1.5 0 0 0 1.5 1.5h7.2a1.5 1.5 0 0 0 1.5-1.5V10.8ZM6 6.3c0-.08.032-.156.088-.212A.3.3 0 0 1 6.3 6h11.4a.3.3 0 0 1 .3.3v2.4a.3.3 0 0 1-.3.3H6.3a.3.3 0 0 1-.3-.3V6.3Z" })
|
|
1035
1381
|
] });
|
|
1036
1382
|
}
|
|
1037
1383
|
if (name === "truck") {
|
|
1038
1384
|
return /* @__PURE__ */ jsxs("svg", { ...common, children: [
|
|
1039
|
-
/* @__PURE__ */
|
|
1040
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ jsx2("path", { fill, fillRule: "evenodd", d: "M4.8 6.3c0-.239.095-.468.264-.636A.9.9 0 0 1 5.7 5.4h8.389a3.3 3.3 0 0 1 3.174 2.394l.512 1.793a.6.6 0 0 0 .216.207l2.017.505A2.7 2.7 0 0 1 21.6 12.337V13.8a2.1 2.1 0 0 1-1.238 1.916 3.6 3.6 0 0 1-3.012 3.474 3.6 3.6 0 0 1-4.564-2.29H10.8a3.6 3.6 0 0 1-6.75-.903A3.6 3.6 0 0 1 5.05 15H4.5a.9.9 0 0 1 0-1.8h3a2.7 2.7 0 0 1 2.442 1.5h7.758A3.58 3.58 0 0 1 19.54 14.1a.45.45 0 0 0 .26-.198V12.336a.3.3 0 0 0-.228-.29l-2.018-.504a2.7 2.7 0 0 1-1.56-1.46l-.512-1.793A1.5 1.5 0 0 0 14.09 7.2H5.7a.9.9 0 0 1-.9-.9Zm3 11.1a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4Zm9.6 0a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4Z" }),
|
|
1386
|
+
/* @__PURE__ */ jsx2("path", { fill, d: "M3.9 9.6a.9.9 0 0 0 0 1.8h6a.9.9 0 0 0 0-1.8h-6Z" })
|
|
1041
1387
|
] });
|
|
1042
1388
|
}
|
|
1043
1389
|
if (name === "box") {
|
|
1044
1390
|
return /* @__PURE__ */ jsxs("svg", { ...common, children: [
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ jsx2("path", { fill, d: "M15.995 5.672a1.05 1.05 0 1 0-1.39-1.578l-3.43 4.164-1.126-1.691a1.05 1.05 0 1 0-1.726 1.2l1.576 2.364a1.35 1.35 0 0 0 2.175.096l3.943-4.555Z" }),
|
|
1392
|
+
/* @__PURE__ */ jsx2("path", { fill, fillRule: "evenodd", d: "M5.832 8.26a1.05 1.05 0 0 1 1.221 1.353L6.187 12H9.168a1.65 1.65 0 0 1 1.422 1.026l.191.569a.3.3 0 0 0 .284.205h1.87a.3.3 0 0 0 .284-.204l.191-.57A1.65 1.65 0 0 1 14.832 12H17.813l-.403-2.718a1.05 1.05 0 0 1 1.78-.837 1.05 1.05 0 0 1 .355 1.152L19.686 12.37c.076.51.114 1.023.114 1.538V15.9a3.9 3.9 0 0 1-3.9 3.9H8.1a3.9 3.9 0 0 1-3.9-3.9v-1.992c0-.516.038-1.029.113-1.54l.497-3.35a1.05 1.05 0 0 1 1.022-.828ZM6 13.908V13.8h2.952l.12.364a2.1 2.1 0 0 0 1.992 1.436h1.872a2.1 2.1 0 0 0 1.992-1.436l.12-.364H18v2.1a1.8 1.8 0 0 1-1.8 1.8H8.1A1.8 1.8 0 0 1 6 15.9v-1.992Z" })
|
|
1047
1393
|
] });
|
|
1048
1394
|
}
|
|
1049
|
-
return /* @__PURE__ */
|
|
1395
|
+
return /* @__PURE__ */ jsx2("svg", { ...common, children: /* @__PURE__ */ jsx2("path", { fill, fillRule: "evenodd", d: "M18.852 6.187a1.05 1.05 0 0 1 .154 1.264l-8.161 10.63a1.35 1.35 0 0 1-2.177.081L4.99 13.444a1.05 1.05 0 0 1 1.431-1.534l3.188 4.176 7.98-10.187a1.05 1.05 0 0 1 1.263-.712Z" }) });
|
|
1050
1396
|
}
|
|
1051
1397
|
function ProductImage({ src, alt, size = 60 }) {
|
|
1052
|
-
const [failed, setFailed] =
|
|
1398
|
+
const [failed, setFailed] = useState3(false);
|
|
1053
1399
|
const safeSrc = safeImageUrl(src);
|
|
1054
1400
|
const box = {
|
|
1055
1401
|
width: size,
|
|
@@ -1060,9 +1406,9 @@ function ProductImage({ src, alt, size = 60 }) {
|
|
|
1060
1406
|
background: "#f1f5f9"
|
|
1061
1407
|
};
|
|
1062
1408
|
if (!safeSrc || failed) {
|
|
1063
|
-
return /* @__PURE__ */
|
|
1409
|
+
return /* @__PURE__ */ jsx2("span", { "aria-label": alt + " image unavailable", style: { ...box, display: "grid", placeItems: "center", color: "#94a3b8", fontSize: 12 }, children: alt.slice(0, 1).toUpperCase() });
|
|
1064
1410
|
}
|
|
1065
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ jsx2("img", { src: safeSrc, alt, onError: () => setFailed(true), style: box });
|
|
1066
1412
|
}
|
|
1067
1413
|
var hexColor = /^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i;
|
|
1068
1414
|
var defaultProgressColor = "#0f172a";
|
|
@@ -1073,20 +1419,20 @@ function TrackingProgress({ steps, color }) {
|
|
|
1073
1419
|
const active = progressColor(color);
|
|
1074
1420
|
const cells = Math.max(steps.length, 1);
|
|
1075
1421
|
return /* @__PURE__ */ jsxs("div", { className: "bt-progress", role: "region", "aria-label": "Delivery progress", style: { marginTop: 32, width: "100%", maxWidth: 1200, marginLeft: "auto", marginRight: "auto", overflow: "visible" }, children: [
|
|
1076
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ jsx2("style", { children: trackingProgressStyles }),
|
|
1077
1423
|
/* @__PURE__ */ jsxs("div", { style: { position: "relative", display: "grid", gridTemplateColumns: `repeat(${cells}, minmax(0, 1fr))`, columnGap: 4, width: "100%", alignItems: "start" }, children: [
|
|
1078
|
-
cells > 1 ? /* @__PURE__ */
|
|
1424
|
+
cells > 1 ? /* @__PURE__ */ jsx2("div", { className: "bt-progress__line", "aria-hidden": "true", style: { position: "absolute", left: `calc(50% / ${cells})`, right: `calc(50% / ${cells})`, height: 6, display: "flex", zIndex: 0, pointerEvents: "none" }, children: steps.slice(0, -1).map((step, index) => {
|
|
1079
1425
|
const done = step.state === "complete" || step.state === "current";
|
|
1080
1426
|
const nextDone = steps[index + 1]?.state === "complete" || steps[index + 1]?.state === "current";
|
|
1081
|
-
return /* @__PURE__ */
|
|
1427
|
+
return /* @__PURE__ */ jsx2("span", { style: { flex: 1, height: 6, borderRadius: 999, background: done && nextDone ? active : `color-mix(in srgb, ${active} 25%, transparent)` } }, step.id + "-line");
|
|
1082
1428
|
}) }) : null,
|
|
1083
1429
|
steps.map((step, index) => {
|
|
1084
1430
|
const done = step.state === "complete" || step.state === "current";
|
|
1085
1431
|
return /* @__PURE__ */ jsxs("div", { style: { minWidth: 0, display: "flex", flexDirection: "column", alignItems: "center", position: "relative", zIndex: 1 }, children: [
|
|
1086
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ jsx2("span", { className: "bt-progress__icon", "aria-label": step.label + " " + step.state, style: { display: "flex", flexShrink: 0, alignItems: "center", justifyContent: "center", borderRadius: 9999, border: `1px solid ${active}`, background: done ? active : "#fff", color: active }, children: /* @__PURE__ */ jsx2(StepIcon, { name: step.icon ?? (index === 0 || index === steps.length - 1 ? "check" : index === 1 ? "bag" : index === 2 ? "truck" : "box"), done }) }),
|
|
1087
1433
|
/* @__PURE__ */ jsxs("div", { className: "bt-progress__copy", style: { width: "100%", maxWidth: "100%", boxSizing: "border-box", textAlign: "center", padding: "0 2px" }, children: [
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
step.date ? /* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ jsx2("p", { className: "bt-progress__label", style: { margin: 0, fontWeight: 500, color: "#334155", overflowWrap: "anywhere", wordBreak: "break-word" }, children: step.label }),
|
|
1435
|
+
step.date ? /* @__PURE__ */ jsx2("p", { style: { margin: "6px 0 0", fontSize: 12, lineHeight: "16px", color: "#94a3b8", overflowWrap: "anywhere" }, children: step.date }) : null
|
|
1090
1436
|
] })
|
|
1091
1437
|
] }, step.id);
|
|
1092
1438
|
})
|
|
@@ -1095,57 +1441,59 @@ function TrackingProgress({ steps, color }) {
|
|
|
1095
1441
|
}
|
|
1096
1442
|
function ShippingTimeline({ events }) {
|
|
1097
1443
|
if (!events.length) {
|
|
1098
|
-
return /* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ jsx2("p", { style: { margin: "16px 0 0", color: "#475569", fontSize: 14 }, children: "Shipping events will appear when the carrier publishes them." });
|
|
1099
1445
|
}
|
|
1100
|
-
return /* @__PURE__ */
|
|
1446
|
+
return /* @__PURE__ */ jsx2("div", { "aria-label": "Shipping events", style: { marginTop: 16, display: "flex", flexDirection: "column", gap: 20 }, children: events.map((event, index) => {
|
|
1101
1447
|
const latest = event.state === "current" || index === 0;
|
|
1102
1448
|
return /* @__PURE__ */ jsxs("div", { style: { position: "relative", paddingLeft: 28, paddingBottom: index < events.length - 1 ? 20 : 0 }, children: [
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
index < events.length - 1 ? /* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ jsx2("span", { "aria-hidden": "true", style: { position: "absolute", left: 0, top: 2, width: 16, height: 16, borderRadius: 9999, background: latest ? "#16a34a" : "#cbd5e1" } }),
|
|
1450
|
+
index < events.length - 1 ? /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", style: { position: "absolute", left: 7, top: 20, width: 1, height: "100%", background: "#e2e8f0" } }) : null,
|
|
1105
1451
|
/* @__PURE__ */ jsxs("p", { style: { margin: 0, fontSize: 14, fontWeight: 500, lineHeight: 1.5, color: latest ? "#c01400" : "#64748b" }, children: [
|
|
1106
1452
|
event.title,
|
|
1107
1453
|
event.detail ? ", " + event.detail : ""
|
|
1108
1454
|
] }),
|
|
1109
|
-
event.at ? /* @__PURE__ */
|
|
1455
|
+
event.at ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", fontSize: 12, lineHeight: 1.5, color: latest ? "rgba(192, 20, 0, 0.8)" : "#94a3b8" }, children: event.at }) : null
|
|
1110
1456
|
] }, event.id);
|
|
1111
1457
|
}) });
|
|
1112
1458
|
}
|
|
1113
1459
|
function PackageContents({ items }) {
|
|
1114
|
-
if (!items.length) return /* @__PURE__ */
|
|
1115
|
-
return /* @__PURE__ */
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
/* @__PURE__ */ jsxs("
|
|
1120
|
-
/* @__PURE__ */
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
"
|
|
1125
|
-
item.quantity
|
|
1460
|
+
if (!items.length) return /* @__PURE__ */ jsx2("p", { style: { margin: 0, color: "#64748b", fontSize: 14 }, children: "Package contents are not available for this shipment." });
|
|
1461
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
1462
|
+
/* @__PURE__ */ jsx2("style", { children: packageNameStyles }),
|
|
1463
|
+
items.map((item) => {
|
|
1464
|
+
const title = item.title;
|
|
1465
|
+
return /* @__PURE__ */ jsxs("article", { style: { display: "flex", alignItems: "center", gap: 12, padding: "8px 0", overflow: "visible" }, children: [
|
|
1466
|
+
/* @__PURE__ */ jsx2(ProductImage, { src: item.imageUrl, alt: title }),
|
|
1467
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0, overflow: "visible" }, children: [
|
|
1468
|
+
/* @__PURE__ */ jsxs("div", { className: "bt-package-name", tabIndex: 0, "aria-label": title, children: [
|
|
1469
|
+
/* @__PURE__ */ jsx2("p", { className: "bt-package-name__text", children: title }),
|
|
1470
|
+
/* @__PURE__ */ jsx2("span", { className: "bt-package-name__tooltip", role: "tooltip", children: title })
|
|
1126
1471
|
] }),
|
|
1127
|
-
|
|
1472
|
+
item.description ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#64748b" }, children: item.description }) : null,
|
|
1473
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 8, marginTop: 4 }, children: [
|
|
1474
|
+
/* @__PURE__ */ jsxs("p", { style: { margin: 0, fontSize: 13, color: "#64748b" }, children: [
|
|
1475
|
+
"x",
|
|
1476
|
+
item.quantity
|
|
1477
|
+
] }),
|
|
1478
|
+
/* @__PURE__ */ jsx2("a", { href: packageReorderHref(item.href), className: "bt-package-reorder", children: "Reorder" })
|
|
1479
|
+
] })
|
|
1128
1480
|
] })
|
|
1129
|
-
] })
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1133
|
-
function formatTrackPageRecommendPrice(price) {
|
|
1134
|
-
if (!price || !Number.isInteger(price.amount)) return "";
|
|
1135
|
-
return `$ ${(price.amount / 100).toFixed(2)}`;
|
|
1481
|
+
] }, item.id);
|
|
1482
|
+
})
|
|
1483
|
+
] });
|
|
1136
1484
|
}
|
|
1137
1485
|
function RecommendationCards({ items }) {
|
|
1138
|
-
const autoplay =
|
|
1486
|
+
const autoplay = useMemo2(() => Autoplay({ delay: 3e3, stopOnInteraction: false, stopOnMouseEnter: true }), []);
|
|
1139
1487
|
const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true, align: "start", slidesToScroll: 1 }, [autoplay]);
|
|
1140
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1141
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1142
|
-
const [hideButtons, setHideButtons] =
|
|
1143
|
-
const onSelect =
|
|
1488
|
+
const [canScrollPrev, setCanScrollPrev] = useState3(false);
|
|
1489
|
+
const [canScrollNext, setCanScrollNext] = useState3(false);
|
|
1490
|
+
const [hideButtons, setHideButtons] = useState3(false);
|
|
1491
|
+
const onSelect = useCallback2(() => {
|
|
1144
1492
|
if (!emblaApi) return;
|
|
1145
1493
|
setCanScrollPrev(emblaApi.canScrollPrev());
|
|
1146
1494
|
setCanScrollNext(emblaApi.canScrollNext());
|
|
1147
1495
|
}, [emblaApi]);
|
|
1148
|
-
|
|
1496
|
+
useEffect3(() => {
|
|
1149
1497
|
if (!emblaApi) return;
|
|
1150
1498
|
const frame = window.requestAnimationFrame(onSelect);
|
|
1151
1499
|
emblaApi.on("select", onSelect);
|
|
@@ -1156,7 +1504,7 @@ function RecommendationCards({ items }) {
|
|
|
1156
1504
|
emblaApi.off("reInit", onSelect);
|
|
1157
1505
|
};
|
|
1158
1506
|
}, [emblaApi, onSelect]);
|
|
1159
|
-
|
|
1507
|
+
useEffect3(() => {
|
|
1160
1508
|
if (typeof window.matchMedia !== "function") return;
|
|
1161
1509
|
const media = window.matchMedia("(max-width: 768px)");
|
|
1162
1510
|
const update = () => setHideButtons(media.matches);
|
|
@@ -1165,7 +1513,7 @@ function RecommendationCards({ items }) {
|
|
|
1165
1513
|
return () => media.removeEventListener("change", update);
|
|
1166
1514
|
}, []);
|
|
1167
1515
|
if (items.length === 0) return null;
|
|
1168
|
-
const arrow = (points) => /* @__PURE__ */
|
|
1516
|
+
const arrow = (points) => /* @__PURE__ */ jsx2("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("polyline", { points }) });
|
|
1169
1517
|
const buttonStyle = {
|
|
1170
1518
|
position: "absolute",
|
|
1171
1519
|
top: 115,
|
|
@@ -1184,21 +1532,21 @@ function RecommendationCards({ items }) {
|
|
|
1184
1532
|
padding: 0
|
|
1185
1533
|
};
|
|
1186
1534
|
return /* @__PURE__ */ jsxs("div", { "aria-label": "Recommended products carousel", style: { position: "relative", marginLeft: "min(48px, 4%)", marginRight: "min(48px, 4%)" }, children: [
|
|
1187
|
-
!hideButtons && canScrollPrev ? /* @__PURE__ */
|
|
1188
|
-
/* @__PURE__ */
|
|
1535
|
+
!hideButtons && canScrollPrev ? /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": "Previous", onClick: () => emblaApi?.scrollPrev(), style: { ...buttonStyle, left: -40 }, children: arrow("15 18 9 12 15 6") }) : null,
|
|
1536
|
+
/* @__PURE__ */ jsx2("div", { ref: emblaRef, style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx2("div", { style: { display: "flex" }, children: items.map((item) => {
|
|
1189
1537
|
const href = safeHref(item.href);
|
|
1190
|
-
const displayPrice =
|
|
1538
|
+
const displayPrice = formatRecommendationPrice(item.price);
|
|
1191
1539
|
const card = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1192
|
-
/* @__PURE__ */
|
|
1540
|
+
/* @__PURE__ */ jsx2("div", { style: { width: 262, height: 262, maxWidth: "100%", borderRadius: 8, border: "1px solid #E3E3E3", overflow: "hidden", background: "#f1f5f9" }, children: /* @__PURE__ */ jsx2(ProductImage, { src: item.imageUrl, alt: item.title, size: 262 }) }),
|
|
1193
1541
|
/* @__PURE__ */ jsxs("div", { style: { padding: "12px 8px", textAlign: "center", fontSize: 14 }, children: [
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
displayPrice ? /* @__PURE__ */
|
|
1196
|
-
item.description ? /* @__PURE__ */
|
|
1542
|
+
/* @__PURE__ */ jsx2("p", { style: { margin: 0, color: "#334155" }, children: item.title }),
|
|
1543
|
+
displayPrice ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", fontWeight: 600, color: "#0f172a" }, children: displayPrice }) : null,
|
|
1544
|
+
item.description ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", color: "#64748b", fontSize: 13 }, children: item.description }) : null
|
|
1197
1545
|
] })
|
|
1198
1546
|
] });
|
|
1199
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ jsx2("div", { style: { flex: "0 0 286px", minWidth: 0, paddingRight: 24, boxSizing: "border-box" }, children: href ? /* @__PURE__ */ jsx2("a", { href, style: { display: "block", width: 262, maxWidth: "100%", textDecoration: "none", color: "inherit" }, children: card }) : /* @__PURE__ */ jsx2("div", { style: { width: 262, maxWidth: "100%" }, children: card }) }, item.id);
|
|
1200
1548
|
}) }) }),
|
|
1201
|
-
!hideButtons && canScrollNext ? /* @__PURE__ */
|
|
1549
|
+
!hideButtons && canScrollNext ? /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": "Next", onClick: () => emblaApi?.scrollNext(), style: { ...buttonStyle, right: -40 }, children: arrow("9 18 15 12 9 6") }) : null
|
|
1202
1550
|
] });
|
|
1203
1551
|
}
|
|
1204
1552
|
var trackingPageAdSlotStyle = {
|
|
@@ -1221,41 +1569,92 @@ var trackingPageAdImageStyle = {
|
|
|
1221
1569
|
objectPosition: "center"
|
|
1222
1570
|
};
|
|
1223
1571
|
function TrackingPageAdSlot({ ad, disableLink = false }) {
|
|
1224
|
-
const [failedUrl, setFailedUrl] =
|
|
1572
|
+
const [failedUrl, setFailedUrl] = useState3();
|
|
1225
1573
|
const imageUrl = safeImageUrl(ad?.imageUrl);
|
|
1226
1574
|
if (!imageUrl || failedUrl === imageUrl) return null;
|
|
1227
|
-
const content = /* @__PURE__ */
|
|
1575
|
+
const content = /* @__PURE__ */ jsx2("img", { src: imageUrl, alt: ad?.alt ?? "Promotion", loading: "lazy", onError: () => setFailedUrl(imageUrl), style: trackingPageAdImageStyle });
|
|
1228
1576
|
const href = safeHref(ad?.href);
|
|
1229
|
-
if (!href || disableLink) return /* @__PURE__ */
|
|
1230
|
-
return /* @__PURE__ */
|
|
1577
|
+
if (!href || disableLink) return /* @__PURE__ */ jsx2("div", { "data-tracking-page-ad": true, style: trackingPageAdSlotStyle, children: content });
|
|
1578
|
+
return /* @__PURE__ */ jsx2("a", { "data-tracking-page-ad": true, href, target: "_blank", rel: "noopener noreferrer", style: trackingPageAdSlotStyle, children: content });
|
|
1231
1579
|
}
|
|
1232
1580
|
function EstimatedDeliveryCard({ dateText, steps = 5 }) {
|
|
1233
1581
|
const trackInset = `max(0px, calc(50% / ${Math.max(steps, 1)} - var(--bt-progress-icon, 44px) / 2))`;
|
|
1234
1582
|
return /* @__PURE__ */ jsxs("div", { "aria-label": "Est. Delivery", className: "bt-edd-card", style: { margin: `16px ${trackInset} 0`, width: "auto", boxSizing: "border-box", border: "1px solid transparent", borderRadius: 10, backgroundColor: "#eaf4ff", padding: "20px 22px 18px", textAlign: "left" }, children: [
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ jsx2("p", { style: { margin: 0, color: "#202124", fontSize: 13, fontWeight: 700, lineHeight: 1.3 }, children: "Est. Delivery" }),
|
|
1584
|
+
/* @__PURE__ */ jsx2("p", { style: { margin: "6px 0 0", color: "#202124", fontSize: 22, fontWeight: 700, lineHeight: 1.15, letterSpacing: 0, overflowWrap: "anywhere", wordBreak: "break-word" }, children: dateText }),
|
|
1585
|
+
/* @__PURE__ */ jsx2("p", { style: { margin: "6px 0 0", color: "#5f6368", fontSize: 13, fontWeight: 400, lineHeight: 1.35 }, children: "Estimated time may update as tracking progresses." })
|
|
1586
|
+
] });
|
|
1587
|
+
}
|
|
1588
|
+
var orderBadgeRowStyle = {
|
|
1589
|
+
display: "flex",
|
|
1590
|
+
flexWrap: "wrap",
|
|
1591
|
+
alignItems: "center",
|
|
1592
|
+
justifyContent: "center",
|
|
1593
|
+
gap: 12,
|
|
1594
|
+
margin: "0 auto"
|
|
1595
|
+
};
|
|
1596
|
+
var orderBadgeStyle = (active) => ({
|
|
1597
|
+
appearance: "none",
|
|
1598
|
+
height: 36,
|
|
1599
|
+
minWidth: 128,
|
|
1600
|
+
borderRadius: 8,
|
|
1601
|
+
border: `1px solid ${active ? "#c01400" : "#cbd5e1"}`,
|
|
1602
|
+
padding: "0 16px",
|
|
1603
|
+
font: "inherit",
|
|
1604
|
+
fontSize: 14,
|
|
1605
|
+
fontWeight: 600,
|
|
1606
|
+
color: active ? "#c01400" : "#64748b",
|
|
1607
|
+
background: "transparent",
|
|
1608
|
+
cursor: "pointer"
|
|
1609
|
+
});
|
|
1610
|
+
function TrackPageOrderBadges({
|
|
1611
|
+
values,
|
|
1612
|
+
selectedIndex,
|
|
1613
|
+
onSelect,
|
|
1614
|
+
style
|
|
1615
|
+
}) {
|
|
1616
|
+
if (values.length === 0) return null;
|
|
1617
|
+
return /* @__PURE__ */ jsx2("div", { style: { ...orderBadgeRowStyle, ...style }, children: values.map((value, index) => {
|
|
1618
|
+
const active = selectedIndex === index;
|
|
1619
|
+
return /* @__PURE__ */ jsx2(
|
|
1620
|
+
"button",
|
|
1621
|
+
{
|
|
1622
|
+
type: "button",
|
|
1623
|
+
"aria-pressed": active,
|
|
1624
|
+
onClick: () => onSelect(index),
|
|
1625
|
+
style: orderBadgeStyle(active),
|
|
1626
|
+
children: value
|
|
1627
|
+
},
|
|
1628
|
+
`${value}-${index}`
|
|
1629
|
+
);
|
|
1630
|
+
}) });
|
|
1631
|
+
}
|
|
1632
|
+
function TrackPageQueryNumber({ mode, value }) {
|
|
1633
|
+
return /* @__PURE__ */ jsxs("p", { style: { margin: 0, fontSize: 20, fontWeight: 400, lineHeight: 1.4, color: "#000", overflowWrap: "anywhere" }, children: [
|
|
1634
|
+
mode === "order" ? "Order" : "Tracking",
|
|
1635
|
+
": ",
|
|
1636
|
+
value
|
|
1238
1637
|
] });
|
|
1239
1638
|
}
|
|
1240
1639
|
function SectionShell({ title, children, bordered = true, resultAnchor = false }) {
|
|
1241
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ jsx2("section", { "aria-label": title, "data-tracking-result": resultAnchor ? "" : void 0, style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: bordered ? "1px solid #f1f5f9" : "0" }, children });
|
|
1242
1641
|
}
|
|
1243
1642
|
|
|
1244
1643
|
// src/shopify-track-page/assets/not-found.png.ts
|
|
1245
1644
|
var not_found_png_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcQAAAHECAYAAACnX1ofAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAWjpJREFUeAHtvXm0JFd95/mLfO/VvrxXVIEkSqoHEosQA8IgL6wlPGx22wJmEHOGthF9OGPTPm6QfQ7HhralOnRzZuZMj4E/2kvTM9IMZppljIQHs9nWAyyMG2SEDYhFy5NAQiUVqirVpqpXL2Pu9+b9Rf7iZmS+93KLiMzvp05WZEbciIyIfDd+97deEUIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCG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EEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQsh08P8D6wH8vd+UWaQAAAAASUVORK5CYII=";
|
|
1246
1645
|
|
|
1247
1646
|
// src/tracking-not-found.tsx
|
|
1248
|
-
import { jsx as
|
|
1647
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1249
1648
|
function TrackingNotFound({ resultAnchor = false } = {}) {
|
|
1250
1649
|
return /* @__PURE__ */ jsxs2("section", { "aria-label": "Order not found", role: "status", "data-tracking-result": resultAnchor ? "" : void 0, style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "80px 24px", gap: 16 }, children: [
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
/* @__PURE__ */
|
|
1650
|
+
/* @__PURE__ */ jsx3("img", { src: not_found_png_default, alt: "", width: 180, height: 180, style: { width: 180, height: 180, objectFit: "contain" } }),
|
|
1651
|
+
/* @__PURE__ */ jsx3("p", { style: { margin: 0, fontSize: 16, fontWeight: 500, color: "#475569" }, children: "Can not find order" })
|
|
1253
1652
|
] });
|
|
1254
1653
|
}
|
|
1255
1654
|
|
|
1256
1655
|
// src/tracking-loading.tsx
|
|
1257
1656
|
import { useId } from "react";
|
|
1258
|
-
import { Fragment as Fragment2, jsx as
|
|
1657
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1259
1658
|
var loadingStyles = `
|
|
1260
1659
|
@keyframes bt-tracking-pin-float {
|
|
1261
1660
|
0%, 100% { transform: translateY(-1px); }
|
|
@@ -1273,129 +1672,43 @@ var loadingStyles = `
|
|
|
1273
1672
|
function TrackingLoading() {
|
|
1274
1673
|
const id = useId();
|
|
1275
1674
|
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1276
|
-
/* @__PURE__ */
|
|
1277
|
-
/* @__PURE__ */ jsxs3("div", { role: "status", "aria-label": "\u67E5\u8BE2\u4E2D...", "aria-live": "polite", "aria-atomic": "true", style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 16, marginTop:
|
|
1278
|
-
/* @__PURE__ */
|
|
1675
|
+
/* @__PURE__ */ jsx4("style", { children: loadingStyles }),
|
|
1676
|
+
/* @__PURE__ */ jsxs3("div", { role: "status", "aria-label": "\u67E5\u8BE2\u4E2D...", "aria-live": "polite", "aria-atomic": "true", style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 16, marginTop: 45, paddingBottom: 8, textAlign: "center" }, children: [
|
|
1677
|
+
/* @__PURE__ */ jsx4("p", { style: { margin: 0, color: "var(--pb-color-muted, #64748b)", fontSize: 14, fontWeight: 400, lineHeight: "20px" }, children: "\u67E5\u8BE2\u4E2D..." }),
|
|
1279
1678
|
/* @__PURE__ */ jsxs3("svg", { width: "56", height: "64", viewBox: "0 0 56 64", fill: "none", "aria-hidden": "true", focusable: "false", style: { display: "block", flexShrink: 0, overflow: "visible" }, children: [
|
|
1280
1679
|
/* @__PURE__ */ jsxs3("defs", { children: [
|
|
1281
1680
|
/* @__PURE__ */ jsxs3("linearGradient", { id: `${id}-top`, x1: "10", y1: "28", x2: "44", y2: "40", gradientUnits: "userSpaceOnUse", children: [
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ jsx4("stop", { stopColor: "#FFF0DA" }),
|
|
1682
|
+
/* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#EABD8E" })
|
|
1284
1683
|
] }),
|
|
1285
1684
|
/* @__PURE__ */ jsxs3("linearGradient", { id: `${id}-left`, x1: "11", y1: "35", x2: "29", y2: "60", gradientUnits: "userSpaceOnUse", children: [
|
|
1286
|
-
/* @__PURE__ */
|
|
1287
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ jsx4("stop", { stopColor: "#FFE8CD" }),
|
|
1686
|
+
/* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#F3C79C" })
|
|
1288
1687
|
] }),
|
|
1289
1688
|
/* @__PURE__ */ jsxs3("linearGradient", { id: `${id}-right`, x1: "28", y1: "40", x2: "45", y2: "52", gradientUnits: "userSpaceOnUse", children: [
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ jsx4("stop", { stopColor: "#F8D2AA" }),
|
|
1690
|
+
/* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#DCA574" })
|
|
1292
1691
|
] }),
|
|
1293
1692
|
/* @__PURE__ */ jsxs3("linearGradient", { id: `${id}-pin`, x1: "21", y1: "8", x2: "35", y2: "25", gradientUnits: "userSpaceOnUse", children: [
|
|
1294
|
-
/* @__PURE__ */
|
|
1295
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ jsx4("stop", { stopColor: "#FFD18A" }),
|
|
1694
|
+
/* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#F6A34A" })
|
|
1296
1695
|
] })
|
|
1297
1696
|
] }),
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsx4("path", { d: "m11 35 17-10 17 10-17 10-17-10Z", fill: `url(#${id}-top)` }),
|
|
1698
|
+
/* @__PURE__ */ jsx4("path", { d: "M11 35v19l17 10V45L11 35Z", fill: `url(#${id}-left)` }),
|
|
1699
|
+
/* @__PURE__ */ jsx4("path", { d: "M28 45v19l17-10V35L28 45Z", fill: `url(#${id}-right)` }),
|
|
1700
|
+
/* @__PURE__ */ jsx4("path", { d: "m18 31 17 10v19l4-2V39L22 29l-4 2Z", fill: "#FFF3E0", fillOpacity: ".6" }),
|
|
1701
|
+
/* @__PURE__ */ jsx4("path", { d: "M11 35 28 45 45 35M28 45v19", stroke: "#FFF8EC", strokeOpacity: ".35", strokeWidth: ".7" }),
|
|
1702
|
+
/* @__PURE__ */ jsx4("g", { className: "bt-tracking-loading__pin", children: /* @__PURE__ */ jsx4("path", { d: "M28 8a7 7 0 0 0-7 7c0 5 7 12 7 12s7-7 7-12a7 7 0 0 0-7-7Zm0 4a3 3 0 1 1 0 6 3 3 0 0 1 0-6Z", fill: `url(#${id}-pin)`, fillRule: "evenodd" }) })
|
|
1304
1703
|
] })
|
|
1305
1704
|
] })
|
|
1306
1705
|
] });
|
|
1307
1706
|
}
|
|
1308
1707
|
|
|
1309
1708
|
// src/ready-to-go.tsx
|
|
1310
|
-
import { Fragment as Fragment3, jsx as
|
|
1311
|
-
var initialRuntime = {
|
|
1312
|
-
phase: "idle",
|
|
1313
|
-
recommendations: { phase: "idle", items: [] },
|
|
1314
|
-
autoQueryFromUrl: false,
|
|
1315
|
-
autoQueryDemo: false,
|
|
1316
|
-
async query() {
|
|
1317
|
-
return void 0;
|
|
1318
|
-
}
|
|
1319
|
-
};
|
|
1320
|
-
var ReadyToGoRuntimeContext = createContext(initialRuntime);
|
|
1321
|
-
function previewReadyToGoTracking(trackingNumber = "BT-2048-DEMO") {
|
|
1322
|
-
return {
|
|
1323
|
-
trackingNumber,
|
|
1324
|
-
status: "In transit",
|
|
1325
|
-
carrier: "BestTrack demo carrier",
|
|
1326
|
-
latestEvent: "Shipment accepted at the regional hub",
|
|
1327
|
-
updatedAt: "Sep 17, 10:00 AM",
|
|
1328
|
-
destination: "Shanghai",
|
|
1329
|
-
estimatedDelivery: "Sep 22 - Sep 24",
|
|
1330
|
-
progress: defaultProgress("In transit"),
|
|
1331
|
-
events: [
|
|
1332
|
-
{ id: "hub", title: "Shipment accepted at the regional hub", at: "Sep 17, 10:00 AM", state: "current" },
|
|
1333
|
-
{ id: "info", title: "The order has been placed and confirmed.", at: "Sep 16, 3:31 PM", state: "complete" }
|
|
1334
|
-
],
|
|
1335
|
-
orderItems: [{ id: "demo-order-item", title: "Demo shipment item", quantity: 1, description: "Product details are available in your order." }],
|
|
1336
|
-
recommendations: [
|
|
1337
|
-
{ id: "shipping-protection", title: "Shipping protection", description: "Extra assurance for your next delivery.", price: { amount: 900, currencyCode: "USD" } },
|
|
1338
|
-
{ id: "delivery-alerts", title: "Delivery alerts", description: "Receive an update at every milestone.", price: { amount: 400, currencyCode: "USD" } }
|
|
1339
|
-
]
|
|
1340
|
-
};
|
|
1341
|
-
}
|
|
1342
|
-
async function queryMockReadyToGoTracking(request) {
|
|
1343
|
-
return previewReadyToGoTracking(request.mode === "tracking" ? request.trackingNumber : request.orderNumber);
|
|
1344
|
-
}
|
|
1345
|
-
function ReadyToGoRuntimeProvider({ children, query: injectedQuery, queryRecommendations, transport, autoQueryFromUrl, autoQueryDemo = false, watermark, adPreview }) {
|
|
1346
|
-
const [state, setState] = useState2({ phase: "idle" });
|
|
1347
|
-
const [recommendations, setRecommendations] = useState2(() => queryRecommendations || transport ? { phase: "loading", items: [] } : { phase: "idle", items: [] });
|
|
1348
|
-
const requestId = useRef(0);
|
|
1349
|
-
const resolvedQuery = useMemo2(() => {
|
|
1350
|
-
if (injectedQuery) return injectedQuery;
|
|
1351
|
-
if (transport) return createShopifyTrackQuery(transport);
|
|
1352
|
-
return void 0;
|
|
1353
|
-
}, [injectedQuery, transport]);
|
|
1354
|
-
const resolvedRecommendations = useMemo2(() => {
|
|
1355
|
-
if (queryRecommendations) return queryRecommendations;
|
|
1356
|
-
if (transport) return createShopifyRecommendationsQuery(transport.post);
|
|
1357
|
-
return void 0;
|
|
1358
|
-
}, [queryRecommendations, transport]);
|
|
1359
|
-
const live = Boolean(resolvedQuery);
|
|
1360
|
-
useEffect2(() => {
|
|
1361
|
-
if (!resolvedRecommendations) return;
|
|
1362
|
-
let active = true;
|
|
1363
|
-
void resolvedRecommendations().then((items) => {
|
|
1364
|
-
if (!active) return;
|
|
1365
|
-
setRecommendations({ phase: items.length ? "success" : "empty", items });
|
|
1366
|
-
}).catch(() => {
|
|
1367
|
-
if (!active) return;
|
|
1368
|
-
setRecommendations({ phase: "error", items: [] });
|
|
1369
|
-
});
|
|
1370
|
-
return () => {
|
|
1371
|
-
active = false;
|
|
1372
|
-
};
|
|
1373
|
-
}, [resolvedRecommendations]);
|
|
1374
|
-
const query = useCallback2(async (request) => {
|
|
1375
|
-
const currentRequestId = ++requestId.current;
|
|
1376
|
-
setState({ phase: "loading" });
|
|
1377
|
-
try {
|
|
1378
|
-
const result = live ? await resolvedQuery(request) : await queryMockReadyToGoTracking(request);
|
|
1379
|
-
if (currentRequestId !== requestId.current) return;
|
|
1380
|
-
setState({ phase: isEmptyTrackingPageResult(result) ? "empty" : "success", result });
|
|
1381
|
-
} catch {
|
|
1382
|
-
if (currentRequestId !== requestId.current) return;
|
|
1383
|
-
setState({ phase: "error", error: "We couldn\u2019t retrieve this order right now. Please try again later." });
|
|
1384
|
-
}
|
|
1385
|
-
}, [live, resolvedQuery]);
|
|
1386
|
-
const resolveAutoQuery = autoQueryFromUrl ?? Boolean(transport && !injectedQuery);
|
|
1387
|
-
const resolvedWatermark = useMemo2(
|
|
1388
|
-
() => watermark ?? { visible: !shouldHidePoweredBy() },
|
|
1389
|
-
[watermark]
|
|
1390
|
-
);
|
|
1391
|
-
const value = useMemo2(() => ({ ...state, adPreview, query, recommendations, autoQueryFromUrl: resolveAutoQuery, autoQueryDemo, watermark: resolvedWatermark }), [adPreview, autoQueryDemo, query, recommendations, resolveAutoQuery, resolvedWatermark, state]);
|
|
1392
|
-
return /* @__PURE__ */ jsx4(ReadyToGoRuntimeContext.Provider, { value, children });
|
|
1393
|
-
}
|
|
1394
|
-
function useReadyToGoRuntime() {
|
|
1395
|
-
return useContext(ReadyToGoRuntimeContext);
|
|
1396
|
-
}
|
|
1709
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1397
1710
|
function RuntimeWatermark({ watermark }) {
|
|
1398
|
-
return watermark?.visible ? /* @__PURE__ */
|
|
1711
|
+
return watermark?.visible ? /* @__PURE__ */ jsx5("small", { style: { display: "block", marginTop: "auto", paddingTop: 28, textAlign: "center", fontSize: 12, lineHeight: "17px", fontStyle: "italic", color: "#b8b8b8" }, children: watermark.label || "Powered by BestTrack" }) : null;
|
|
1399
1712
|
}
|
|
1400
1713
|
var heroStyle = {
|
|
1401
1714
|
...pageFont,
|
|
@@ -1487,12 +1800,12 @@ function submitButtonStyle(props, loading = false) {
|
|
|
1487
1800
|
};
|
|
1488
1801
|
}
|
|
1489
1802
|
function ReadyToGoTextField({ value, onChange }) {
|
|
1490
|
-
return /* @__PURE__ */
|
|
1803
|
+
return /* @__PURE__ */ jsx5("input", { "aria-label": "Ready-to-go text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
|
|
1491
1804
|
}
|
|
1492
1805
|
function InlineText({ block, name, fallback }) {
|
|
1493
1806
|
const value = text(block, name, fallback);
|
|
1494
|
-
if (!block.selected) return /* @__PURE__ */
|
|
1495
|
-
return /* @__PURE__ */
|
|
1807
|
+
if (!block.selected) return /* @__PURE__ */ jsx5("span", { "data-ready-to-go-editor-field": name, children: value });
|
|
1808
|
+
return /* @__PURE__ */ jsx5(
|
|
1496
1809
|
"input",
|
|
1497
1810
|
{
|
|
1498
1811
|
"aria-label": "Canvas " + name,
|
|
@@ -1521,53 +1834,56 @@ function InlineText({ block, name, fallback }) {
|
|
|
1521
1834
|
}
|
|
1522
1835
|
);
|
|
1523
1836
|
}
|
|
1524
|
-
function
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1837
|
+
function ProgressResult({
|
|
1838
|
+
result,
|
|
1839
|
+
showEstimatedDelivery = true,
|
|
1840
|
+
color,
|
|
1841
|
+
recentQueries = [],
|
|
1842
|
+
selectedRecentIndex = 0,
|
|
1843
|
+
onSelectRecent,
|
|
1844
|
+
selectedShipmentIndex = 0,
|
|
1845
|
+
onSelectShipment
|
|
1846
|
+
}) {
|
|
1847
|
+
const steps = trackingSteps(result);
|
|
1848
|
+
const { identity, shipmentValues } = trackingSelection(result, recentQueries);
|
|
1531
1849
|
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
] }),
|
|
1536
|
-
/* @__PURE__ */ jsx4("h2", { style: { margin: "clamp(24px, 8%, 48px) 0 0", fontSize: 32, lineHeight: 1.25, fontWeight: 700, color: "#303030", overflowWrap: "anywhere" }, children: result.status }),
|
|
1850
|
+
identity.values.length > 1 && onSelectRecent ? /* @__PURE__ */ jsx5(TrackPageOrderBadges, { values: identity.values.slice(0, 3), selectedIndex: selectedRecentIndex, onSelect: onSelectRecent }) : identity.values[0] ? /* @__PURE__ */ jsx5(TrackPageQueryNumber, { mode: identity.mode, value: identity.values[0] }) : null,
|
|
1851
|
+
shipmentValues.length > 1 && onSelectShipment ? /* @__PURE__ */ jsx5(TrackPageOrderBadges, { values: shipmentValues, selectedIndex: selectedShipmentIndex, onSelect: onSelectShipment, style: { marginTop: 8 } }) : null,
|
|
1852
|
+
/* @__PURE__ */ jsx5("h2", { style: { margin: "clamp(24px, 8%, 48px) 0 0", fontSize: 32, lineHeight: 1.25, fontWeight: 700, color: "#303030", overflowWrap: "anywhere" }, children: result.status }),
|
|
1537
1853
|
/* @__PURE__ */ jsxs4("div", { className: "bt-progress-band", children: [
|
|
1538
|
-
showEstimatedDelivery && result.estimatedDelivery ? /* @__PURE__ */
|
|
1539
|
-
/* @__PURE__ */
|
|
1854
|
+
showEstimatedDelivery && result.estimatedDelivery ? /* @__PURE__ */ jsx5(EstimatedDeliveryCard, { dateText: result.estimatedDelivery, steps: steps.length }) : null,
|
|
1855
|
+
/* @__PURE__ */ jsx5(TrackingProgress, { steps, color })
|
|
1540
1856
|
] })
|
|
1541
1857
|
] });
|
|
1542
1858
|
}
|
|
1543
1859
|
function DeliveryResult({ heading, contentsHeading, carrierHeading, result, editing }) {
|
|
1544
1860
|
return /* @__PURE__ */ jsxs4("div", { style: { ...contentWidth, display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 280px), 500px))", gap: 40, justifyContent: "center", alignItems: "start" }, children: [
|
|
1545
1861
|
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
/* @__PURE__ */
|
|
1862
|
+
/* @__PURE__ */ jsx5("h3", { style: { margin: 0, fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
|
|
1863
|
+
/* @__PURE__ */ jsx5(ShippingTimeline, { events: trackingEvents(result) })
|
|
1548
1864
|
] }),
|
|
1549
1865
|
/* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", gap: 24 }, children: [
|
|
1550
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ jsx5(TrackingPageAdSlot, { ad: result.ad, disableLink: editing }),
|
|
1551
1867
|
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1552
|
-
/* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ jsx5("h3", { style: { margin: "0 0 12px", fontSize: 18, fontWeight: 700 }, children: contentsHeading }),
|
|
1869
|
+
/* @__PURE__ */ jsx5(PackageContents, { items: result.orderItems ?? [] })
|
|
1554
1870
|
] }),
|
|
1555
1871
|
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ jsx5("h3", { style: { margin: "0 0 12px", fontSize: 18, fontWeight: 700 }, children: carrierHeading }),
|
|
1873
|
+
/* @__PURE__ */ jsx5("p", { style: { margin: 0, fontSize: 14, fontWeight: 600, color: "#1e293b" }, children: result.carrier ?? "Not available" }),
|
|
1874
|
+
/* @__PURE__ */ jsx5("p", { style: { margin: "8px 0 0", fontSize: 14, color: "#64748b" }, children: result.destination ?? "Destination details are not available." })
|
|
1559
1875
|
] })
|
|
1560
1876
|
] })
|
|
1561
1877
|
] });
|
|
1562
1878
|
}
|
|
1563
1879
|
function ReadyToGoQueryEditor(block) {
|
|
1564
|
-
return /* @__PURE__ */
|
|
1880
|
+
return /* @__PURE__ */ jsx5("section", { "aria-label": "Ready-to-go query editor", style: editorHeroStyle, children: /* @__PURE__ */ jsxs4("div", { role: "region", "aria-label": "Ready-to-go tracking query", style: editorFormCardStyle, children: [
|
|
1565
1881
|
/* @__PURE__ */ jsxs4("div", { style: { display: "flex", width: "100%", borderBottom: "1px solid #cbd5e1" }, children: [
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ jsx5("div", { style: { ...tabStyle(true), display: "flex", alignItems: "center", justifyContent: "center", cursor: "default" }, children: /* @__PURE__ */ jsx5(InlineText, { block, name: "trackingTabLabel", fallback: "Tracking Number" }) }),
|
|
1883
|
+
/* @__PURE__ */ jsx5("div", { style: { ...tabStyle(false), display: "flex", alignItems: "center", justifyContent: "center", cursor: "default" }, children: /* @__PURE__ */ jsx5(InlineText, { block, name: "orderTabLabel", fallback: "Order Number" }) })
|
|
1568
1884
|
] }),
|
|
1569
1885
|
/* @__PURE__ */ jsxs4("div", { style: { marginTop: 24, display: "flex", flexDirection: "column", gap: 16, flex: 1 }, children: [
|
|
1570
|
-
/* @__PURE__ */
|
|
1886
|
+
/* @__PURE__ */ jsx5(
|
|
1571
1887
|
"input",
|
|
1572
1888
|
{
|
|
1573
1889
|
"aria-label": "Canvas default tracking number",
|
|
@@ -1582,153 +1898,113 @@ function ReadyToGoQueryEditor(block) {
|
|
|
1582
1898
|
}
|
|
1583
1899
|
}
|
|
1584
1900
|
),
|
|
1585
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ jsx5("div", { style: submitButtonStyle(block), children: /* @__PURE__ */ jsx5(InlineText, { block, name: "submitLabel", fallback: "Track Your Order" }) })
|
|
1586
1902
|
] }),
|
|
1587
|
-
/* @__PURE__ */
|
|
1903
|
+
/* @__PURE__ */ jsx5("p", { style: { marginTop: "auto", paddingTop: 28, textAlign: "center", fontSize: 12, lineHeight: "17px", fontStyle: "italic", color: "#b8b8b8" }, children: "Powered by BestTrack" })
|
|
1588
1904
|
] }) });
|
|
1589
1905
|
}
|
|
1590
1906
|
function ReadyToGoProgressEditor(block) {
|
|
1591
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ jsx5("section", { "aria-label": "Ready-to-go progress editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: "1px solid #f1f5f9" }, children: /* @__PURE__ */ jsx5("div", { style: { ...contentWidth, textAlign: "center", width: "min(1248px, 100%)" }, children: /* @__PURE__ */ jsx5(ProgressResult, { result: previewTrackingPageResult(), showEstimatedDelivery: false, color: text(block, "progressColor") }) }) });
|
|
1592
1908
|
}
|
|
1593
1909
|
function ReadyToGoDeliveryEditor(block) {
|
|
1594
|
-
const { adPreview } =
|
|
1595
|
-
return /* @__PURE__ */
|
|
1910
|
+
const { adPreview } = useTrackingRuntime();
|
|
1911
|
+
return /* @__PURE__ */ jsx5("section", { "aria-label": "Ready-to-go delivery editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: "1px solid #f1f5f9" }, children: /* @__PURE__ */ jsx5(
|
|
1596
1912
|
DeliveryResult,
|
|
1597
1913
|
{
|
|
1598
|
-
heading: /* @__PURE__ */
|
|
1599
|
-
contentsHeading: /* @__PURE__ */
|
|
1600
|
-
carrierHeading: /* @__PURE__ */
|
|
1914
|
+
heading: /* @__PURE__ */ jsx5(InlineText, { block, name: "heading", fallback: "Shipping Details" }),
|
|
1915
|
+
contentsHeading: /* @__PURE__ */ jsx5(InlineText, { block, name: "contentsHeading", fallback: "Package Contents" }),
|
|
1916
|
+
carrierHeading: /* @__PURE__ */ jsx5(InlineText, { block, name: "carrierHeading", fallback: "Carrier" }),
|
|
1601
1917
|
editing: true,
|
|
1602
|
-
result: { ...
|
|
1918
|
+
result: { ...previewTrackingPageResult(), ad: adPreview ?? void 0 }
|
|
1603
1919
|
}
|
|
1604
1920
|
) });
|
|
1605
1921
|
}
|
|
1606
|
-
function configuredRecommendations(products) {
|
|
1607
|
-
return parseProductReferences(products).map((product) => ({
|
|
1608
|
-
id: product.id,
|
|
1609
|
-
title: product.title || product.id,
|
|
1610
|
-
description: "",
|
|
1611
|
-
imageUrl: product.imageUrl,
|
|
1612
|
-
// Product snapshots only persist the Shopify handle. Resolve the generated
|
|
1613
|
-
// storefront path before RecommendationCards applies its URL safety check.
|
|
1614
|
-
href: resolveShopifyRecommendHref(void 0, product.handle),
|
|
1615
|
-
...product.price ? { price: product.price } : {}
|
|
1616
|
-
}));
|
|
1617
|
-
}
|
|
1618
1922
|
function ReadyToGoRecommendationsEditor(block) {
|
|
1619
1923
|
const selected = configuredRecommendations(block.products);
|
|
1620
|
-
const items = selected.length ? selected :
|
|
1621
|
-
return /* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1623
|
-
/* @__PURE__ */
|
|
1924
|
+
const items = selected.length ? selected : previewTrackingPageResult().recommendations ?? [];
|
|
1925
|
+
return /* @__PURE__ */ jsx5("section", { "aria-label": "Ready-to-go recommendations editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)" }, children: /* @__PURE__ */ jsxs4("div", { style: contentWidth, children: [
|
|
1926
|
+
/* @__PURE__ */ jsx5("h3", { style: { margin: 0, textAlign: "center", fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: /* @__PURE__ */ jsx5(InlineText, { block, name: "heading", fallback: "You may also like..." }) }),
|
|
1927
|
+
/* @__PURE__ */ jsx5("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsx5(RecommendationCards, { items }) })
|
|
1624
1928
|
] }) });
|
|
1625
1929
|
}
|
|
1626
1930
|
function ReadyToGoQueryBlock(props) {
|
|
1627
|
-
const runtime =
|
|
1628
|
-
const
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
const autoQueryStarted = useRef(false);
|
|
1635
|
-
const previewDemoTrackingNumber = useRef(trackingNumber);
|
|
1931
|
+
const runtime = useTrackingRuntime();
|
|
1932
|
+
const { mode, setMode, trackingNumber, setTrackingNumber, orderNumber, setOrderNumber, email, setEmail, localError, loading, submit } = useTrackingQueryForm({
|
|
1933
|
+
initialTrackingNumber: text(props, "defaultTrackingNumber", "BT-2048-DEMO"),
|
|
1934
|
+
initialOrderNumber: text(props, "defaultOrderNumber", ""),
|
|
1935
|
+
initialMode: text(props, "defaultQueryMode", "tracking") === "order" ? "order" : "tracking",
|
|
1936
|
+
onComplete: scrollToTrackingResult
|
|
1937
|
+
});
|
|
1636
1938
|
const submitLabel = text(props, "submitLabel", "Track Your Order");
|
|
1637
1939
|
const trackingTabLabel = text(props, "trackingTabLabel", "Tracking Number");
|
|
1638
1940
|
const orderTabLabel = text(props, "orderTabLabel", "Order Number");
|
|
1639
|
-
|
|
1640
|
-
if (autoQueryStarted.current) return;
|
|
1641
|
-
if (locationState?.canAutoQuery) {
|
|
1642
|
-
autoQueryStarted.current = true;
|
|
1643
|
-
void runtime.query(locationState.tab === "tracking" ? { mode: "tracking", trackingNumber: locationState.trackingNumber } : { mode: "order", orderNumber: locationState.orderNumber, email: locationState.email }).finally(() => scrollToTrackingResult());
|
|
1644
|
-
return;
|
|
1645
|
-
}
|
|
1646
|
-
const demoTrackingNumber = previewDemoTrackingNumber.current.trim();
|
|
1647
|
-
if (!runtime.autoQueryDemo || !demoTrackingNumber) return;
|
|
1648
|
-
autoQueryStarted.current = true;
|
|
1649
|
-
void runtime.query({ mode: "tracking", trackingNumber: demoTrackingNumber });
|
|
1650
|
-
}, [locationState, runtime]);
|
|
1651
|
-
const submit = (event) => {
|
|
1652
|
-
event.preventDefault();
|
|
1653
|
-
if (runtime.phase === "loading") return;
|
|
1654
|
-
setLocalError("");
|
|
1655
|
-
if (mode === "order") {
|
|
1656
|
-
if (!orderNumber.trim() || !email.trim()) {
|
|
1657
|
-
setLocalError("Please enter your order number and email address");
|
|
1658
|
-
return;
|
|
1659
|
-
}
|
|
1660
|
-
syncTrackingQueryToUrl("order", orderNumber.trim(), email.trim());
|
|
1661
|
-
void runtime.query({ mode: "order", orderNumber: orderNumber.trim(), email: email.trim() }).finally(() => scrollToTrackingResult());
|
|
1662
|
-
return;
|
|
1663
|
-
}
|
|
1664
|
-
if (!trackingNumber.trim()) {
|
|
1665
|
-
setLocalError("Please enter your tracking number");
|
|
1666
|
-
return;
|
|
1667
|
-
}
|
|
1668
|
-
syncTrackingQueryToUrl("tracking", trackingNumber.trim());
|
|
1669
|
-
void runtime.query({ mode: "tracking", trackingNumber: trackingNumber.trim() }).finally(() => scrollToTrackingResult());
|
|
1670
|
-
};
|
|
1671
|
-
const loading = runtime.phase === "loading";
|
|
1672
|
-
return /* @__PURE__ */ jsx4("section", { style: heroStyle, children: /* @__PURE__ */ jsxs4("div", { role: "region", "aria-label": "Ready-to-go tracking query", style: formCardStyle, children: [
|
|
1941
|
+
return /* @__PURE__ */ jsx5("section", { style: heroStyle, children: /* @__PURE__ */ jsxs4("div", { role: "region", "aria-label": "Ready-to-go tracking query", style: formCardStyle, children: [
|
|
1673
1942
|
/* @__PURE__ */ jsxs4("div", { role: "tablist", "aria-label": "Tracking method", style: { display: "flex", width: "100%", borderBottom: "1px solid #cbd5e1" }, children: [
|
|
1674
|
-
/* @__PURE__ */
|
|
1675
|
-
|
|
1676
|
-
setLocalError("");
|
|
1677
|
-
}, style: tabStyle(mode === "tracking"), children: trackingTabLabel }),
|
|
1678
|
-
/* @__PURE__ */ jsx4("button", { type: "button", role: "tab", "aria-selected": mode === "order", onClick: () => {
|
|
1679
|
-
setMode("order");
|
|
1680
|
-
setLocalError("");
|
|
1681
|
-
}, style: tabStyle(mode === "order"), children: orderTabLabel })
|
|
1943
|
+
/* @__PURE__ */ jsx5("button", { type: "button", role: "tab", "aria-selected": mode === "tracking", onClick: () => setMode("tracking"), style: tabStyle(mode === "tracking"), children: trackingTabLabel }),
|
|
1944
|
+
/* @__PURE__ */ jsx5("button", { type: "button", role: "tab", "aria-selected": mode === "order", onClick: () => setMode("order"), style: tabStyle(mode === "order"), children: orderTabLabel })
|
|
1682
1945
|
] }),
|
|
1683
1946
|
/* @__PURE__ */ jsxs4("form", { onSubmit: submit, style: { marginTop: 24, display: "flex", flexDirection: "column", gap: 16, flex: 1 }, children: [
|
|
1684
1947
|
mode === "order" ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
/* @__PURE__ */
|
|
1688
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ jsx5("label", { htmlFor: "ready-to-go-order-number", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Order number" }),
|
|
1949
|
+
/* @__PURE__ */ jsx5("input", { id: "ready-to-go-order-number", "aria-label": "Order number", value: orderNumber, onChange: (event) => setOrderNumber(event.target.value), placeholder: "Order Number", style: inputStyle }),
|
|
1950
|
+
/* @__PURE__ */ jsx5("label", { htmlFor: "ready-to-go-email", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Email" }),
|
|
1951
|
+
/* @__PURE__ */ jsx5("input", { id: "ready-to-go-email", "aria-label": "Email", value: email, onChange: (event) => setEmail(event.target.value), placeholder: "Email", style: inputStyle })
|
|
1689
1952
|
] }) : /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1690
|
-
/* @__PURE__ */
|
|
1691
|
-
/* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ jsx5("label", { htmlFor: "ready-to-go-tracking-number", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Tracking number" }),
|
|
1954
|
+
/* @__PURE__ */ jsx5("input", { id: "ready-to-go-tracking-number", "aria-label": "Tracking number", value: trackingNumber, onChange: (event) => setTrackingNumber(event.target.value), placeholder: "Tracking Number", style: inputStyle })
|
|
1692
1955
|
] }),
|
|
1693
|
-
localError ? /* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
runtime.phase === "error" ? /* @__PURE__ */
|
|
1956
|
+
localError ? /* @__PURE__ */ jsx5("p", { role: "alert", style: { margin: 0, textAlign: "center", fontSize: 12, color: "#f43f5e" }, children: localError }) : null,
|
|
1957
|
+
/* @__PURE__ */ jsx5("button", { type: "submit", disabled: loading, style: { ...submitButtonStyle(props, loading), border: 0, font: "inherit", fontSize: 15, fontWeight: 600, cursor: loading ? "wait" : "pointer", opacity: loading ? 0.7 : 1 }, children: submitLabel }),
|
|
1958
|
+
runtime.phase === "error" ? /* @__PURE__ */ jsx5("p", { role: "alert", style: { margin: 0, textAlign: "center", fontSize: 12, color: "#f43f5e" }, children: runtime.error }) : null
|
|
1696
1959
|
] }),
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
loading ? /* @__PURE__ */
|
|
1960
|
+
/* @__PURE__ */ jsx5(RuntimeWatermark, { watermark: runtime.watermark }),
|
|
1961
|
+
loading ? /* @__PURE__ */ jsx5(TrackingLoading, {}) : null
|
|
1699
1962
|
] }) });
|
|
1700
1963
|
}
|
|
1701
1964
|
function ReadyToGoProgressBlock(props) {
|
|
1702
|
-
const runtime =
|
|
1965
|
+
const runtime = useTrackingRuntime();
|
|
1966
|
+
const visibility = trackingBlockState(runtime);
|
|
1703
1967
|
const result = runtime.result;
|
|
1704
|
-
if (
|
|
1705
|
-
if (
|
|
1706
|
-
return /* @__PURE__ */
|
|
1707
|
-
|
|
1708
|
-
|
|
1968
|
+
if (!visibility.showProgress) return null;
|
|
1969
|
+
if (visibility.showNotFound) return /* @__PURE__ */ jsx5(TrackingNotFound, { resultAnchor: true });
|
|
1970
|
+
return /* @__PURE__ */ jsx5(SectionShell, { title: "Shipment progress", resultAnchor: true, children: /* @__PURE__ */ jsxs4("div", { style: { ...contentWidth, textAlign: "center", width: "min(1248px, 100%)" }, children: [
|
|
1971
|
+
visibility.showUnavailable ? /* @__PURE__ */ jsx5("p", { style: { margin: 0, color: "#b42318" }, children: "Shipment progress is temporarily unavailable." }) : null,
|
|
1972
|
+
visibility.showResult && result ? /* @__PURE__ */ jsx5(
|
|
1973
|
+
ProgressResult,
|
|
1974
|
+
{
|
|
1975
|
+
result,
|
|
1976
|
+
showEstimatedDelivery: visibility.showEstimatedDelivery,
|
|
1977
|
+
color: text(props, "progressColor"),
|
|
1978
|
+
recentQueries: runtime.recentQueries,
|
|
1979
|
+
selectedRecentIndex: runtime.selectedRecentIndex,
|
|
1980
|
+
onSelectRecent: runtime.selectRecentQuery,
|
|
1981
|
+
selectedShipmentIndex: runtime.selectedShipmentIndex,
|
|
1982
|
+
onSelectShipment: runtime.selectShipment
|
|
1983
|
+
}
|
|
1984
|
+
) : null
|
|
1709
1985
|
] }) });
|
|
1710
1986
|
}
|
|
1711
1987
|
function ReadyToGoDeliveryBlock(props) {
|
|
1712
|
-
const runtime =
|
|
1713
|
-
|
|
1988
|
+
const runtime = useTrackingRuntime();
|
|
1989
|
+
const visibility = trackingBlockState(runtime);
|
|
1990
|
+
if (!visibility.showDelivery) return null;
|
|
1714
1991
|
const heading = text(props, "heading", "Shipping Details");
|
|
1715
1992
|
const contentsHeading = text(props, "contentsHeading", "Package Contents");
|
|
1716
1993
|
const carrierHeading = text(props, "carrierHeading", "Carrier");
|
|
1717
1994
|
const result = runtime.result;
|
|
1718
|
-
return /* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
|
|
1995
|
+
return /* @__PURE__ */ jsx5(SectionShell, { title: heading, children: visibility.showResult && result ? /* @__PURE__ */ jsx5(DeliveryResult, { heading, contentsHeading, carrierHeading, result }) : /* @__PURE__ */ jsx5("div", { style: { ...contentWidth, display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 280px), 500px))", gap: 40, justifyContent: "center", alignItems: "start" }, children: /* @__PURE__ */ jsxs4("div", { children: [
|
|
1996
|
+
/* @__PURE__ */ jsx5("h3", { style: { margin: 0, fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
|
|
1997
|
+
visibility.showUnavailable ? /* @__PURE__ */ jsx5("p", { style: { margin: "16px 0 0", color: "#b42318" }, children: "Delivery details are temporarily unavailable." }) : null
|
|
1721
1998
|
] }) }) });
|
|
1722
1999
|
}
|
|
1723
2000
|
function ReadyToGoRecommendationsBlock(props) {
|
|
1724
|
-
const runtime =
|
|
2001
|
+
const runtime = useTrackingRuntime();
|
|
1725
2002
|
const heading = text(props, "heading", "You may also like...");
|
|
1726
|
-
const
|
|
1727
|
-
const items = configured.length ? configured : runtime.recommendations.phase === "success" ? runtime.recommendations.items : [];
|
|
2003
|
+
const items = recommendationItems(props.products, runtime);
|
|
1728
2004
|
if (!items.length) return null;
|
|
1729
|
-
return /* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
1731
|
-
/* @__PURE__ */
|
|
2005
|
+
return /* @__PURE__ */ jsx5(SectionShell, { title: heading, bordered: false, children: /* @__PURE__ */ jsxs4("div", { style: contentWidth, children: [
|
|
2006
|
+
/* @__PURE__ */ jsx5("h3", { style: { margin: 0, textAlign: "center", fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
|
|
2007
|
+
/* @__PURE__ */ jsx5("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsx5(RecommendationCards, { items }) })
|
|
1732
2008
|
] }) });
|
|
1733
2009
|
}
|
|
1734
2010
|
|
|
@@ -1828,12 +2104,12 @@ var readyToGoBlocks = withTemplatePolicy([
|
|
|
1828
2104
|
},
|
|
1829
2105
|
render: { web: ReadyToGoRecommendationsBlock, editor: ReadyToGoRecommendationsEditor }
|
|
1830
2106
|
}
|
|
1831
|
-
], ["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery"]);
|
|
2107
|
+
], ["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery", "besttrack.ready-to-go.recommendations"]);
|
|
1832
2108
|
var readyToGoTemplatePolicy = defineTemplatePolicy(
|
|
1833
2109
|
"besttrack.ready-to-go",
|
|
1834
2110
|
"Ready-to-go",
|
|
1835
2111
|
readyToGoBlocks.map((block) => block.type),
|
|
1836
|
-
["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery"]
|
|
2112
|
+
["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery", "besttrack.ready-to-go.recommendations"]
|
|
1837
2113
|
);
|
|
1838
2114
|
function createReadyToGoTemplate() {
|
|
1839
2115
|
return {
|
|
@@ -1883,11 +2159,11 @@ var bestTrackPageExtension = Object.freeze({
|
|
|
1883
2159
|
import { createPageDocument as createPageDocument2 } from "@standhigher/puck-page-builder/runtime";
|
|
1884
2160
|
|
|
1885
2161
|
// src/branded.tsx
|
|
1886
|
-
import {
|
|
2162
|
+
import { useState as useState5 } from "react";
|
|
1887
2163
|
|
|
1888
2164
|
// src/tracking-query-experience.tsx
|
|
1889
|
-
import { useEffect as
|
|
1890
|
-
import { Fragment as Fragment4, jsx as
|
|
2165
|
+
import { useEffect as useEffect4, useId as useId2, useRef as useRef3, useState as useState4 } from "react";
|
|
2166
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1891
2167
|
var srOnly = {
|
|
1892
2168
|
position: "absolute",
|
|
1893
2169
|
width: 1,
|
|
@@ -1931,11 +2207,6 @@ var defaultSubmitStyle = (loading) => ({
|
|
|
1931
2207
|
fontWeight: 700,
|
|
1932
2208
|
cursor: loading ? "wait" : "pointer"
|
|
1933
2209
|
});
|
|
1934
|
-
function fieldError(field) {
|
|
1935
|
-
if (field === "tracking") return "Enter a valid tracking number.";
|
|
1936
|
-
if (field === "order") return "Enter a valid order number.";
|
|
1937
|
-
return "Enter a valid email address.";
|
|
1938
|
-
}
|
|
1939
2210
|
function TrackingQueryCard({
|
|
1940
2211
|
phase,
|
|
1941
2212
|
onQuery,
|
|
@@ -1949,7 +2220,6 @@ function TrackingQueryCard({
|
|
|
1949
2220
|
trackingPlaceholder = "Enter your tracking number",
|
|
1950
2221
|
orderPlaceholder = "Enter your order number",
|
|
1951
2222
|
emailPlaceholder = "Enter your email",
|
|
1952
|
-
emptyMessage = "We couldn't find an order or shipment for that number.",
|
|
1953
2223
|
errorMessage = "We couldn't retrieve this order right now. Please try again later.",
|
|
1954
2224
|
trackingInputLabel = "Tracking number",
|
|
1955
2225
|
orderInputLabel = "Order number",
|
|
@@ -1976,20 +2246,16 @@ function TrackingQueryCard({
|
|
|
1976
2246
|
const orderTabId = useId2();
|
|
1977
2247
|
const tabPanelId = useId2();
|
|
1978
2248
|
const queryStatusId = useId2();
|
|
1979
|
-
const
|
|
1980
|
-
const
|
|
1981
|
-
const
|
|
1982
|
-
const
|
|
1983
|
-
const
|
|
1984
|
-
const
|
|
1985
|
-
const
|
|
1986
|
-
const
|
|
1987
|
-
const
|
|
1988
|
-
|
|
1989
|
-
const tabRefs = useRef2({ tracking: null, order: null });
|
|
1990
|
-
const loading = phase === "loading";
|
|
1991
|
-
const terminalPhase = phase === "success" || phase === "empty" || phase === "error";
|
|
1992
|
-
useEffect3(() => {
|
|
2249
|
+
const { mode, setMode, trackingNumber, setTrackingNumber, orderNumber, setOrderNumber, email, setEmail, localError, firstInvalidField, loading, submit } = useTrackingQueryForm({ initialTrackingNumber, initialOrderNumber, initialMode, onQuery, phase });
|
|
2250
|
+
const cardRef = useRef3(null);
|
|
2251
|
+
const resultRef = useRef3(null);
|
|
2252
|
+
const trackingInputRef = useRef3(null);
|
|
2253
|
+
const orderInputRef = useRef3(null);
|
|
2254
|
+
const emailInputRef = useRef3(null);
|
|
2255
|
+
const tabRefs = useRef3({ tracking: null, order: null });
|
|
2256
|
+
const visibility = trackingBlockState({ phase });
|
|
2257
|
+
const terminalPhase = visibility.showProgress;
|
|
2258
|
+
useEffect4(() => {
|
|
1993
2259
|
if (!terminalPhase) return;
|
|
1994
2260
|
const card = cardRef.current;
|
|
1995
2261
|
const resultNode = resultRef.current;
|
|
@@ -1998,13 +2264,12 @@ function TrackingQueryCard({
|
|
|
1998
2264
|
}
|
|
1999
2265
|
resultNode?.focus({ preventScroll: true });
|
|
2000
2266
|
}, [phase, terminalPhase]);
|
|
2001
|
-
|
|
2002
|
-
const input =
|
|
2267
|
+
useEffect4(() => {
|
|
2268
|
+
const input = firstInvalidField === "tracking" ? trackingInputRef.current : firstInvalidField === "order" ? orderInputRef.current : firstInvalidField === "email" ? emailInputRef.current : null;
|
|
2003
2269
|
input?.focus();
|
|
2004
|
-
};
|
|
2270
|
+
}, [firstInvalidField, localError]);
|
|
2005
2271
|
const setActiveMode = (nextMode, moveFocus = false) => {
|
|
2006
2272
|
setMode(nextMode);
|
|
2007
|
-
setErrors({});
|
|
2008
2273
|
if (moveFocus) tabRefs.current[nextMode]?.focus();
|
|
2009
2274
|
};
|
|
2010
2275
|
const onTabKeyDown = (event, currentMode) => {
|
|
@@ -2015,273 +2280,186 @@ function TrackingQueryCard({
|
|
|
2015
2280
|
event.preventDefault();
|
|
2016
2281
|
setActiveMode(nextMode, true);
|
|
2017
2282
|
};
|
|
2018
|
-
const
|
|
2019
|
-
setErrors((current) => {
|
|
2020
|
-
if (!current[field]) return current;
|
|
2021
|
-
const next = { ...current };
|
|
2022
|
-
delete next[field];
|
|
2023
|
-
return next;
|
|
2024
|
-
});
|
|
2025
|
-
};
|
|
2026
|
-
const submit = (event) => {
|
|
2027
|
-
event.preventDefault();
|
|
2028
|
-
if (loading) return;
|
|
2029
|
-
const nextErrors = {};
|
|
2030
|
-
const normalizedTrackingNumber = trackingNumber.trim();
|
|
2031
|
-
const normalizedOrderNumber = orderNumber.trim();
|
|
2032
|
-
const normalizedEmail = email.trim();
|
|
2033
|
-
if (mode === "tracking" && !isValidTrackingNumber(normalizedTrackingNumber)) nextErrors.tracking = fieldError("tracking");
|
|
2034
|
-
if (mode === "order" && !isValidOrderNumber(normalizedOrderNumber)) nextErrors.order = fieldError("order");
|
|
2035
|
-
if (mode === "order" && !isValidOrderEmail(normalizedEmail)) nextErrors.email = fieldError("email");
|
|
2036
|
-
const firstInvalidField = mode === "tracking" ? "tracking" : nextErrors.order ? "order" : nextErrors.email ? "email" : void 0;
|
|
2037
|
-
if (firstInvalidField && nextErrors[firstInvalidField]) {
|
|
2038
|
-
setErrors(nextErrors);
|
|
2039
|
-
focusField(firstInvalidField);
|
|
2040
|
-
return;
|
|
2041
|
-
}
|
|
2042
|
-
setErrors({});
|
|
2043
|
-
void onQuery(mode === "tracking" ? { mode, trackingNumber: normalizedTrackingNumber } : { mode, orderNumber: normalizedOrderNumber, email: normalizedEmail });
|
|
2044
|
-
};
|
|
2045
|
-
const errorFor = (field) => errors[field];
|
|
2283
|
+
const errorFor = (field) => firstInvalidField === field ? localError : void 0;
|
|
2046
2284
|
const inputWithError = (field) => ({ ...inputStyle2, borderColor: errorFor(field) ? "#b42318" : inputStyle2.borderColor ?? "#cbd5e1" });
|
|
2047
|
-
const message =
|
|
2285
|
+
const message = visibility.showUnavailable ? errorMessage : void 0;
|
|
2048
2286
|
const cardData = cardDataAttribute ? { [cardDataAttribute]: "true" } : {};
|
|
2049
2287
|
const resultData = resultDataAttribute ? { [resultDataAttribute]: "true" } : {};
|
|
2050
2288
|
const activeTabId = mode === "tracking" ? trackingTabId : orderTabId;
|
|
2051
|
-
const resultLabel =
|
|
2289
|
+
const resultLabel = visibility.showResult ? "Tracking result" : "Tracking query status";
|
|
2052
2290
|
return /* @__PURE__ */ jsxs5("div", { ref: cardRef, "data-tracking-query-card": true, ...cardData, "aria-busy": loading || void 0, style: { boxSizing: "border-box", minWidth: 0, maxWidth: "100%", overflowX: "hidden", overflowY: "auto", overscrollBehavior: "contain", scrollPaddingBlock: 16, ...cardStyle2 }, children: [
|
|
2053
|
-
/* @__PURE__ */
|
|
2291
|
+
/* @__PURE__ */ jsx6("h1", { style: { margin: "0 0 28px", textAlign: "center", ...headingStyle }, children: heading }),
|
|
2054
2292
|
/* @__PURE__ */ jsxs5("div", { role: "tablist", "aria-label": "Tracking method", style: { display: "grid", gridTemplateColumns: "1fr 1fr", borderBottom: "1px solid #cbd5e1", marginBottom: 18, ...tabListStyle }, children: [
|
|
2055
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ jsx6("button", { ref: (element) => {
|
|
2056
2294
|
tabRefs.current.tracking = element;
|
|
2057
2295
|
}, id: trackingTabId, type: "button", role: "tab", "aria-selected": mode === "tracking", "aria-controls": tabPanelId, tabIndex: mode === "tracking" ? 0 : -1, onClick: () => setActiveMode("tracking"), onKeyDown: (event) => onTabKeyDown(event, "tracking"), style: tabStyle2(mode === "tracking"), children: trackingTabLabel }),
|
|
2058
|
-
/* @__PURE__ */
|
|
2296
|
+
/* @__PURE__ */ jsx6("button", { ref: (element) => {
|
|
2059
2297
|
tabRefs.current.order = element;
|
|
2060
2298
|
}, id: orderTabId, type: "button", role: "tab", "aria-selected": mode === "order", "aria-controls": tabPanelId, tabIndex: mode === "order" ? 0 : -1, onClick: () => setActiveMode("order"), onKeyDown: (event) => onTabKeyDown(event, "order"), style: tabStyle2(mode === "order"), children: orderTabLabel })
|
|
2061
2299
|
] }),
|
|
2062
|
-
/* @__PURE__ */
|
|
2300
|
+
/* @__PURE__ */ jsx6("div", { id: tabPanelId, role: "tabpanel", "aria-labelledby": activeTabId, children: /* @__PURE__ */ jsxs5("form", { noValidate: true, onSubmit: submit, style: { display: "grid", gap: 12, minWidth: 0, ...formStyle }, children: [
|
|
2063
2301
|
mode === "tracking" ? /* @__PURE__ */ jsxs5("div", { children: [
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2302
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: trackingInputId, style: srOnly, children: trackingInputLabel }),
|
|
2303
|
+
/* @__PURE__ */ jsx6("input", { ref: trackingInputRef, id: trackingInputId, "aria-label": trackingInputLabel, "aria-invalid": Boolean(errorFor("tracking")), "aria-describedby": errorFor("tracking") ? trackingInputId + "-error" : void 0, value: trackingNumber, onChange: (event) => {
|
|
2066
2304
|
setTrackingNumber(event.target.value);
|
|
2067
|
-
clearError("tracking");
|
|
2068
2305
|
}, placeholder: trackingPlaceholder, style: inputWithError("tracking") }),
|
|
2069
|
-
errorFor("tracking") ? /* @__PURE__ */
|
|
2306
|
+
errorFor("tracking") ? /* @__PURE__ */ jsx6("p", { id: trackingInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("tracking") }) : null
|
|
2070
2307
|
] }) : /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
2071
2308
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2072
|
-
/* @__PURE__ */
|
|
2073
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: orderInputId, style: srOnly, children: orderInputLabel }),
|
|
2310
|
+
/* @__PURE__ */ jsx6("input", { ref: orderInputRef, id: orderInputId, "aria-label": orderInputLabel, "aria-invalid": Boolean(errorFor("order")), "aria-describedby": errorFor("order") ? orderInputId + "-error" : void 0, value: orderNumber, onChange: (event) => {
|
|
2074
2311
|
setOrderNumber(event.target.value);
|
|
2075
|
-
clearError("order");
|
|
2076
2312
|
}, placeholder: orderPlaceholder, style: inputWithError("order") }),
|
|
2077
|
-
errorFor("order") ? /* @__PURE__ */
|
|
2313
|
+
errorFor("order") ? /* @__PURE__ */ jsx6("p", { id: orderInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("order") }) : null
|
|
2078
2314
|
] }),
|
|
2079
2315
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2080
|
-
/* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: emailInputId, style: srOnly, children: emailInputLabel }),
|
|
2317
|
+
/* @__PURE__ */ jsx6("input", { ref: emailInputRef, id: emailInputId, type: "email", "aria-label": emailInputLabel, "aria-invalid": Boolean(errorFor("email")), "aria-describedby": errorFor("email") ? emailInputId + "-error" : void 0, value: email, onChange: (event) => {
|
|
2082
2318
|
setEmail(event.target.value);
|
|
2083
|
-
clearError("email");
|
|
2084
2319
|
}, placeholder: emailPlaceholder, style: inputWithError("email") }),
|
|
2085
|
-
errorFor("email") ? /* @__PURE__ */
|
|
2320
|
+
errorFor("email") ? /* @__PURE__ */ jsx6("p", { id: emailInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("email") }) : null
|
|
2086
2321
|
] })
|
|
2087
2322
|
] }),
|
|
2088
|
-
/* @__PURE__ */
|
|
2323
|
+
/* @__PURE__ */ jsx6("button", { type: "submit", disabled: loading, style: submitStyle(loading), children: submitLabel })
|
|
2089
2324
|
] }) }),
|
|
2090
|
-
message ? /* @__PURE__ */
|
|
2091
|
-
|
|
2092
|
-
terminalPhase ? /* @__PURE__ */
|
|
2325
|
+
message ? /* @__PURE__ */ jsx6("p", { id: queryStatusId, role: "alert", "aria-live": "assertive", style: { margin: "16px 0 0", color: "#b42318", ...messageStyle }, children: message }) : null,
|
|
2326
|
+
visibility.showResult ? /* @__PURE__ */ jsx6("p", { id: queryStatusId, role: "status", "aria-live": "polite", style: srOnly, children: "Tracking details loaded." }) : null,
|
|
2327
|
+
terminalPhase ? /* @__PURE__ */ jsx6("div", { ref: resultRef, role: "region", "aria-label": resultLabel, "aria-describedby": queryStatusId, "data-tracking-query-result": true, ...resultData, "data-testid": resultTestId, tabIndex: -1, style: { minWidth: 0, overflowWrap: "anywhere", marginTop: visibility.showResult ? 20 : 0, ...resultStyle }, children: visibility.showResult ? result : visibility.showNotFound ? /* @__PURE__ */ jsx6("div", { id: queryStatusId, children: /* @__PURE__ */ jsx6(TrackingNotFound, {}) }) : /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
2328
|
+
/* @__PURE__ */ jsx6("section", { "aria-label": "Shipment progress", children: /* @__PURE__ */ jsx6("p", { style: { color: "#b42318" }, children: "Shipment progress is temporarily unavailable." }) }),
|
|
2329
|
+
/* @__PURE__ */ jsx6("section", { "aria-label": "Shipping Details", children: /* @__PURE__ */ jsx6("p", { style: { color: "#b42318" }, children: "Delivery details are temporarily unavailable." }) })
|
|
2330
|
+
] }) }) : null,
|
|
2093
2331
|
watermark,
|
|
2094
|
-
loading ? /* @__PURE__ */
|
|
2332
|
+
loading ? /* @__PURE__ */ jsx6(TrackingLoading, {}) : null
|
|
2095
2333
|
] });
|
|
2096
2334
|
}
|
|
2097
|
-
function defaultProgress2(status) {
|
|
2098
|
-
const steps = [
|
|
2099
|
-
{ id: "ordered", label: "Ordered", icon: "check" },
|
|
2100
|
-
{ id: "ready", label: "Order Ready", icon: "bag" },
|
|
2101
|
-
{ id: "transit", label: "In Transit", icon: "truck" },
|
|
2102
|
-
{ id: "out", label: "Out for Delivery", icon: "box" },
|
|
2103
|
-
{ id: "delivered", label: "Delivered", icon: "check" }
|
|
2104
|
-
];
|
|
2105
|
-
const normalized = status.toLowerCase();
|
|
2106
|
-
const current = normalized.includes("deliver") ? normalized.includes("out for") ? 3 : 4 : normalized.includes("transit") ? 2 : normalized.includes("ready") ? 1 : 0;
|
|
2107
|
-
return steps.map((step, index) => ({ ...step, state: index < current ? "complete" : index === current ? "current" : "upcoming" }));
|
|
2108
|
-
}
|
|
2109
2335
|
function TrackingProgressDetails({ steps }) {
|
|
2110
|
-
return /* @__PURE__ */
|
|
2111
|
-
/* @__PURE__ */
|
|
2112
|
-
/* @__PURE__ */
|
|
2113
|
-
step.date ? /* @__PURE__ */
|
|
2336
|
+
return /* @__PURE__ */ jsx6("ol", { "aria-label": "Delivery progress", style: { display: "grid", gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))`, gap: 4, margin: "20px 0 0", padding: 0, listStyle: "none" }, children: steps.map((step, index) => /* @__PURE__ */ jsxs5("li", { style: { minWidth: 0, textAlign: "center", color: step.state === "upcoming" ? "#64748b" : "#0f172a" }, children: [
|
|
2337
|
+
/* @__PURE__ */ jsx6("span", { "aria-label": step.label + " " + step.state, style: { display: "grid", placeItems: "center", width: 28, height: 28, margin: "0 auto", border: "1px solid " + (step.state === "upcoming" ? "#94a3b8" : "#0f172a"), borderRadius: "50%", background: step.state === "current" ? "#0f172a" : "#fff", color: step.state === "current" ? "#fff" : "#0f172a", fontSize: 13, fontWeight: 700 }, children: step.state === "complete" || step.state === "current" ? "\u2713" : index + 1 }),
|
|
2338
|
+
/* @__PURE__ */ jsx6("span", { style: { display: "block", marginTop: 6, overflowWrap: "anywhere", fontSize: 11, lineHeight: 1.25 }, children: step.label }),
|
|
2339
|
+
step.date ? /* @__PURE__ */ jsx6("span", { style: { display: "block", marginTop: 3, color: "#94a3b8", fontSize: 10, lineHeight: 1.2 }, children: step.date }) : null
|
|
2114
2340
|
] }, step.id)) });
|
|
2115
2341
|
}
|
|
2116
2342
|
function TrackingEvents({ result }) {
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
/* @__PURE__ */
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
event.detail ? /* @__PURE__ */ jsx5("span", { style: { display: "block", marginTop: 2, color: "#64748b", fontSize: 13 }, children: event.detail }) : null,
|
|
2126
|
-
event.at ? /* @__PURE__ */ jsx5("time", { style: { display: "block", marginTop: 3, color: "#94a3b8", fontSize: 12 }, children: event.at }) : null
|
|
2127
|
-
] }, event.id)) }),
|
|
2128
|
-
events.length > 3 ? /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => setExpanded((current) => !current), style: { minWidth: 44, minHeight: 44, marginTop: 14, padding: "6px 12px", border: "1px solid #cbd5e1", borderRadius: 6, background: "#fff", color: "#0f172a", font: "inherit", fontSize: 13, cursor: "pointer" }, children: expanded ? "Show recent events" : "Show all events" }) : null
|
|
2129
|
-
] });
|
|
2343
|
+
const events = trackingEvents(result);
|
|
2344
|
+
if (!events.length) return /* @__PURE__ */ jsx6("p", { style: { margin: "12px 0 0", color: "#64748b", fontSize: 14 }, children: "Tracking events are not available yet. Please try again later." });
|
|
2345
|
+
return /* @__PURE__ */ jsx6("div", { "aria-label": "Shipping events", style: { marginTop: 16 }, children: /* @__PURE__ */ jsx6("ol", { style: { display: "grid", gap: 14, margin: 0, padding: 0, listStyle: "none" }, children: events.map((event, index) => /* @__PURE__ */ jsxs5("li", { style: { position: "relative", minWidth: 0, paddingLeft: 22, overflowWrap: "anywhere" }, children: [
|
|
2346
|
+
/* @__PURE__ */ jsx6("span", { "aria-hidden": "true", style: { position: "absolute", left: 0, top: 4, width: 10, height: 10, borderRadius: "50%", background: event.state === "current" || index === 0 ? "#111827" : "#cbd5e1" } }),
|
|
2347
|
+
/* @__PURE__ */ jsx6("strong", { style: { display: "block", fontSize: 14 }, children: event.title }),
|
|
2348
|
+
event.detail ? /* @__PURE__ */ jsx6("span", { style: { display: "block", marginTop: 2, color: "#64748b", fontSize: 13 }, children: event.detail }) : null,
|
|
2349
|
+
event.at ? /* @__PURE__ */ jsx6("time", { style: { display: "block", marginTop: 3, color: "#94a3b8", fontSize: 12 }, children: event.at }) : null
|
|
2350
|
+
] }, event.id)) }) });
|
|
2130
2351
|
}
|
|
2131
2352
|
function TrackingOrderItemImage({ src, title }) {
|
|
2132
|
-
const [failed, setFailed] =
|
|
2353
|
+
const [failed, setFailed] = useState4(false);
|
|
2133
2354
|
const imageUrl = safeTrackingPageUrl(src);
|
|
2134
|
-
if (!imageUrl || failed) return /* @__PURE__ */
|
|
2135
|
-
return /* @__PURE__ */
|
|
2355
|
+
if (!imageUrl || failed) return /* @__PURE__ */ jsx6("span", { "aria-label": title + " image unavailable", style: { display: "grid", width: 56, height: 56, placeItems: "center", borderRadius: 6, background: "#e2e8f0", color: "#64748b", fontSize: 13 }, children: title.slice(0, 1).toUpperCase() });
|
|
2356
|
+
return /* @__PURE__ */ jsx6("img", { src: imageUrl, alt: "", onError: () => setFailed(true), style: { width: 56, height: 56, borderRadius: 6, objectFit: "cover", background: "#f1f5f9" } });
|
|
2136
2357
|
}
|
|
2137
2358
|
function TrackingOrderItems({ items }) {
|
|
2138
|
-
if (!items.length) return null;
|
|
2139
2359
|
return /* @__PURE__ */ jsxs5("section", { "aria-label": "Order items", style: { marginTop: 24, borderTop: "1px solid #e2e8f0", paddingTop: 18 }, children: [
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
/* @__PURE__ */
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
/* @__PURE__ */ jsxs5("
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
|
|
2152
|
-
|
|
2360
|
+
/* @__PURE__ */ jsx6("h2", { style: { margin: 0, fontSize: 16 }, children: "Items in your order" }),
|
|
2361
|
+
/* @__PURE__ */ jsxs5("div", { style: { display: "grid", gap: 12, marginTop: 12 }, children: [
|
|
2362
|
+
!items.length ? /* @__PURE__ */ jsx6("p", { style: { margin: 0, color: "#64748b", fontSize: 14 }, children: "Package contents are not available for this shipment." }) : null,
|
|
2363
|
+
items.map((item) => {
|
|
2364
|
+
const price = item.price ? formatTrackingPageMoney(item.price) : void 0;
|
|
2365
|
+
const href = safeTrackingPageUrl(item.href);
|
|
2366
|
+
return /* @__PURE__ */ jsxs5("article", { style: { display: "grid", gridTemplateColumns: "56px minmax(0, 1fr)", gap: 12, alignItems: "center" }, children: [
|
|
2367
|
+
/* @__PURE__ */ jsx6(TrackingOrderItemImage, { src: item.imageUrl, title: item.title }),
|
|
2368
|
+
/* @__PURE__ */ jsxs5("div", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
2369
|
+
href ? /* @__PURE__ */ jsx6("a", { href, style: { color: "inherit", fontWeight: 700, overflowWrap: "anywhere" }, children: item.title }) : /* @__PURE__ */ jsx6("strong", { style: { overflowWrap: "anywhere" }, children: item.title }),
|
|
2370
|
+
item.description ? /* @__PURE__ */ jsx6("p", { style: { margin: "3px 0 0", color: "#64748b", fontSize: 13 }, children: item.description }) : null,
|
|
2371
|
+
/* @__PURE__ */ jsxs5("p", { style: { display: "flex", flexWrap: "wrap", gap: 8, margin: "4px 0 0", color: "#475569", fontSize: 13 }, children: [
|
|
2372
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
2373
|
+
"Qty ",
|
|
2374
|
+
item.quantity
|
|
2375
|
+
] }),
|
|
2376
|
+
price?.amount ? /* @__PURE__ */ jsxs5("span", { children: [
|
|
2377
|
+
price.amount,
|
|
2378
|
+
price.startsAt ? " and up" : ""
|
|
2379
|
+
] }) : null,
|
|
2380
|
+
price?.compareAt ? /* @__PURE__ */ jsx6("s", { style: { color: "#94a3b8" }, children: price.compareAt }) : null
|
|
2153
2381
|
] }),
|
|
2154
|
-
|
|
2155
|
-
price.amount,
|
|
2156
|
-
price.startsAt ? " and up" : ""
|
|
2157
|
-
] }) : null,
|
|
2158
|
-
price?.compareAt ? /* @__PURE__ */ jsx5("s", { style: { color: "#94a3b8" }, children: price.compareAt }) : null
|
|
2382
|
+
href ? /* @__PURE__ */ jsx6("a", { href, style: { display: "inline-flex", alignItems: "center", minHeight: 32, marginTop: 6, padding: "6px 12px", border: "1px solid #cbd5e1", borderRadius: 6, color: "inherit", fontSize: 13 }, children: "Reorder" }) : null
|
|
2159
2383
|
] })
|
|
2160
|
-
] })
|
|
2161
|
-
|
|
2162
|
-
|
|
2384
|
+
] }, item.id);
|
|
2385
|
+
})
|
|
2386
|
+
] })
|
|
2163
2387
|
] });
|
|
2164
2388
|
}
|
|
2165
|
-
function TrackingQueryResultDetails({ result, onTrackAnother, trackAnotherLabel = "Track another" }) {
|
|
2166
|
-
const [copied, setCopied] =
|
|
2167
|
-
const
|
|
2389
|
+
function TrackingQueryResultDetails({ result, onTrackAnother, trackAnotherLabel = "Track another", showShipments = true }) {
|
|
2390
|
+
const [copied, setCopied] = useState4(false);
|
|
2391
|
+
const runtime = useTrackingRuntime();
|
|
2392
|
+
const visibility = trackingBlockState(runtime);
|
|
2393
|
+
const progress = trackingSteps(result);
|
|
2394
|
+
const { identity, shipmentValues } = trackingSelection(result, runtime.recentQueries);
|
|
2168
2395
|
const copyTrackingNumber = () => {
|
|
2169
2396
|
if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
|
|
2170
2397
|
void navigator.clipboard.writeText(result.trackingNumber).then(() => setCopied(true)).catch(() => void 0);
|
|
2171
2398
|
}
|
|
2172
2399
|
};
|
|
2173
2400
|
return /* @__PURE__ */ jsxs5("section", { "aria-label": "Tracking result details", style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
2401
|
+
identity.values.length > 1 ? /* @__PURE__ */ jsx6(TrackPageOrderBadges, { values: identity.values, selectedIndex: runtime.selectedRecentIndex, onSelect: runtime.selectRecentQuery, style: { marginBottom: 16 } }) : identity.values[0] ? /* @__PURE__ */ jsx6("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsx6(TrackPageQueryNumber, { mode: identity.mode, value: identity.values[0] }) }) : null,
|
|
2402
|
+
showShipments && shipmentValues.length > 1 ? /* @__PURE__ */ jsx6(TrackPageOrderBadges, { values: shipmentValues, selectedIndex: runtime.selectedShipmentIndex, onSelect: runtime.selectShipment, style: { marginBottom: 16 } }) : null,
|
|
2174
2403
|
/* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "start", justifyContent: "space-between", gap: 12 }, children: [
|
|
2175
2404
|
/* @__PURE__ */ jsxs5("div", { style: { minWidth: 0, flex: "1 1 180px" }, children: [
|
|
2176
2405
|
/* @__PURE__ */ jsxs5("strong", { style: { fontSize: 17 }, children: [
|
|
2177
2406
|
"Your order is ",
|
|
2178
2407
|
result.status || "being updated"
|
|
2179
2408
|
] }),
|
|
2180
|
-
result.estimatedDelivery ? /* @__PURE__ */ jsxs5("p", { style: { margin: "5px 0 0", color: "#475569", fontSize: 14 }, children: [
|
|
2409
|
+
visibility.showEstimatedDelivery && result.estimatedDelivery ? /* @__PURE__ */ jsxs5("p", { style: { margin: "5px 0 0", color: "#475569", fontSize: 14 }, children: [
|
|
2181
2410
|
"Estimated delivery: ",
|
|
2182
2411
|
result.estimatedDelivery
|
|
2183
2412
|
] }) : null
|
|
2184
2413
|
] }),
|
|
2185
|
-
onTrackAnother ? /* @__PURE__ */
|
|
2414
|
+
onTrackAnother ? /* @__PURE__ */ jsx6("button", { type: "button", onClick: onTrackAnother, style: { minWidth: 44, minHeight: 44, flex: "0 0 auto", padding: "6px 10px", border: "1px solid #cbd5e1", borderRadius: 6, background: "#fff", color: "#0f172a", font: "inherit", fontSize: 12, cursor: "pointer" }, children: trackAnotherLabel }) : null
|
|
2186
2415
|
] }),
|
|
2187
|
-
/* @__PURE__ */
|
|
2416
|
+
/* @__PURE__ */ jsx6(TrackingProgressDetails, { steps: progress }),
|
|
2188
2417
|
/* @__PURE__ */ jsxs5("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 140px), 1fr))", gap: 10, marginTop: 22, padding: 12, borderRadius: 8, background: "#f8fafc", color: "#334155", fontSize: 13 }, children: [
|
|
2189
2418
|
/* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
2190
|
-
/* @__PURE__ */
|
|
2191
|
-
/* @__PURE__ */
|
|
2192
|
-
result.carrier
|
|
2419
|
+
/* @__PURE__ */ jsx6("strong", { children: "Carrier" }),
|
|
2420
|
+
/* @__PURE__ */ jsx6("br", {}),
|
|
2421
|
+
result.carrier ?? "Not available"
|
|
2193
2422
|
] }),
|
|
2194
2423
|
/* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
/* @__PURE__ */
|
|
2424
|
+
/* @__PURE__ */ jsx6("strong", { children: "Tracking number" }),
|
|
2425
|
+
/* @__PURE__ */ jsx6("br", {}),
|
|
2426
|
+
/* @__PURE__ */ jsx6("span", { children: result.trackingNumber }),
|
|
2198
2427
|
" ",
|
|
2199
|
-
/* @__PURE__ */
|
|
2428
|
+
/* @__PURE__ */ jsx6("button", { type: "button", onClick: copyTrackingNumber, style: { minWidth: 44, minHeight: 44, border: 0, background: "transparent", color: "#0f172a", font: "inherit", fontSize: 12, fontWeight: 700, cursor: "pointer" }, children: copied ? "Copied" : "Copy" })
|
|
2200
2429
|
] }),
|
|
2201
2430
|
/* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
2202
|
-
/* @__PURE__ */
|
|
2203
|
-
/* @__PURE__ */
|
|
2204
|
-
result.destination
|
|
2431
|
+
/* @__PURE__ */ jsx6("strong", { children: "Destination" }),
|
|
2432
|
+
/* @__PURE__ */ jsx6("br", {}),
|
|
2433
|
+
result.destination ?? "Destination details are not available."
|
|
2205
2434
|
] }),
|
|
2206
2435
|
/* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
2207
|
-
/* @__PURE__ */
|
|
2208
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ jsx6("strong", { children: "Transit time" }),
|
|
2437
|
+
/* @__PURE__ */ jsx6("br", {}),
|
|
2209
2438
|
result.transitDuration || "\u2014"
|
|
2210
2439
|
] }),
|
|
2211
2440
|
result.orderNumber ? /* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2441
|
+
/* @__PURE__ */ jsx6("strong", { children: "Order number" }),
|
|
2442
|
+
/* @__PURE__ */ jsx6("br", {}),
|
|
2214
2443
|
result.orderNumber
|
|
2215
2444
|
] }) : null
|
|
2216
2445
|
] }),
|
|
2217
2446
|
/* @__PURE__ */ jsxs5("section", { "aria-label": "Tracking timeline", style: { marginTop: 24, borderTop: "1px solid #e2e8f0", paddingTop: 18 }, children: [
|
|
2218
|
-
/* @__PURE__ */
|
|
2219
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ jsx6("h2", { style: { margin: 0, fontSize: 16 }, children: "Tracking timeline" }),
|
|
2448
|
+
/* @__PURE__ */ jsx6(TrackingEvents, { result })
|
|
2220
2449
|
] }),
|
|
2221
|
-
/* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ jsx6(TrackingPageAdSlot, { ad: result.ad }),
|
|
2451
|
+
/* @__PURE__ */ jsx6(TrackingOrderItems, { items: result.orderItems ?? [] })
|
|
2222
2452
|
] });
|
|
2223
2453
|
}
|
|
2224
2454
|
|
|
2225
2455
|
// src/branded.tsx
|
|
2226
|
-
import { jsx as
|
|
2227
|
-
var
|
|
2228
|
-
|
|
2229
|
-
selectedShipmentId: null,
|
|
2230
|
-
async query() {
|
|
2231
|
-
return void 0;
|
|
2232
|
-
},
|
|
2233
|
-
reset() {
|
|
2234
|
-
return void 0;
|
|
2235
|
-
},
|
|
2236
|
-
selectShipment() {
|
|
2237
|
-
return void 0;
|
|
2238
|
-
}
|
|
2239
|
-
};
|
|
2240
|
-
var BrandedRuntimeContext = createContext2(initialRuntime2);
|
|
2456
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2457
|
+
var BrandedRuntimeProvider = TrackingRuntimeProvider;
|
|
2458
|
+
var useBrandedRuntime = useTrackingRuntime;
|
|
2241
2459
|
var contentWidth2 = { width: "min(1200px, 100%)", margin: "0 auto", padding: "0 clamp(16px, 4vw, 48px)", boxSizing: "border-box" };
|
|
2242
2460
|
var cardStyle = { background: "#fff", color: "#0a0a0a", border: "1px solid #e7e7e7", borderRadius: 10, fontFamily: "var(--pb-font-family)" };
|
|
2243
|
-
function BrandedRuntimeProvider({ children, query: injectedQuery, watermark }) {
|
|
2244
|
-
const [state, setState] = useState4({ phase: "idle" });
|
|
2245
|
-
const [selectedShipmentId, setSelectedShipmentId] = useState4(null);
|
|
2246
|
-
const requestId = useRef3(0);
|
|
2247
|
-
const query = useCallback3(async (request) => {
|
|
2248
|
-
const currentRequestId = ++requestId.current;
|
|
2249
|
-
setState({ phase: "loading" });
|
|
2250
|
-
try {
|
|
2251
|
-
if (!injectedQuery) throw new Error("tracking-query-not-configured");
|
|
2252
|
-
const result = await injectedQuery(request);
|
|
2253
|
-
if (currentRequestId !== requestId.current) return;
|
|
2254
|
-
setSelectedShipmentId(result.shipments?.[0]?.id ?? null);
|
|
2255
|
-
setState({ phase: isEmptyTrackingPageResult(result) ? "empty" : "success", result });
|
|
2256
|
-
} catch {
|
|
2257
|
-
if (currentRequestId !== requestId.current) return;
|
|
2258
|
-
setState({ phase: "error", error: "tracking-query-failed" });
|
|
2259
|
-
}
|
|
2260
|
-
}, [injectedQuery]);
|
|
2261
|
-
const reset = useCallback3(() => {
|
|
2262
|
-
requestId.current += 1;
|
|
2263
|
-
setSelectedShipmentId(null);
|
|
2264
|
-
setState({ phase: "idle" });
|
|
2265
|
-
}, []);
|
|
2266
|
-
const displayedResult = useMemo3(() => {
|
|
2267
|
-
if (!state.result) return void 0;
|
|
2268
|
-
const shipment = state.result.shipments?.find((item) => item.id === selectedShipmentId);
|
|
2269
|
-
return shipment ? { ...state.result, ...shipment } : state.result;
|
|
2270
|
-
}, [selectedShipmentId, state.result]);
|
|
2271
|
-
const selectShipment = useCallback3((id) => {
|
|
2272
|
-
if (state.result?.shipments?.some((shipment) => shipment.id === id)) setSelectedShipmentId(id);
|
|
2273
|
-
}, [state.result]);
|
|
2274
|
-
const value = useMemo3(
|
|
2275
|
-
() => ({ ...state, displayedResult, selectedShipmentId, query, reset, selectShipment, watermark }),
|
|
2276
|
-
[displayedResult, query, reset, selectedShipmentId, selectShipment, state, watermark]
|
|
2277
|
-
);
|
|
2278
|
-
return /* @__PURE__ */ jsx6(BrandedRuntimeContext.Provider, { value, children });
|
|
2279
|
-
}
|
|
2280
|
-
function useBrandedRuntime() {
|
|
2281
|
-
return useContext2(BrandedRuntimeContext);
|
|
2282
|
-
}
|
|
2283
2461
|
function RuntimeWatermark2({ watermark }) {
|
|
2284
|
-
return watermark?.visible ? /* @__PURE__ */
|
|
2462
|
+
return watermark?.visible ? /* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 10, color: "#8a8a8a", fontSize: 8, textAlign: "right" }, children: watermark.label || "Powered by BestTrack" }) : null;
|
|
2285
2463
|
}
|
|
2286
2464
|
function text3(props, key, fallback) {
|
|
2287
2465
|
return typeof props[key] === "string" ? props[key] : fallback;
|
|
@@ -2292,31 +2470,31 @@ function shipmentLabels(value) {
|
|
|
2292
2470
|
return typeof value === "string" ? value.split("|").map((label, index) => ({ id: "configured-" + index, label: label.trim() })).filter((item) => item.label) : [];
|
|
2293
2471
|
}
|
|
2294
2472
|
function ProductImage2({ src, alt }) {
|
|
2295
|
-
const [failed, setFailed] =
|
|
2473
|
+
const [failed, setFailed] = useState5(false);
|
|
2296
2474
|
const safeSrc = safeImageUrl2(src);
|
|
2297
2475
|
if (!safeSrc || failed) {
|
|
2298
|
-
return /* @__PURE__ */
|
|
2476
|
+
return /* @__PURE__ */ jsx7("span", { "aria-label": alt + " image unavailable", style: { display: "grid", placeItems: "center", width: 72, height: 72, flex: "0 0 auto", borderRadius: 6, background: "#f2f2f2", color: "#6b6b6b", fontSize: 14 }, children: alt.slice(0, 1).toUpperCase() });
|
|
2299
2477
|
}
|
|
2300
|
-
return /* @__PURE__ */
|
|
2478
|
+
return /* @__PURE__ */ jsx7("img", { src: safeSrc, alt, onError: () => setFailed(true), style: { width: 72, height: 72, flex: "0 0 auto", borderRadius: 6, objectFit: "cover", background: "#f2f2f2" } });
|
|
2301
2479
|
}
|
|
2302
|
-
function ShipmentSwitcher(
|
|
2480
|
+
function ShipmentSwitcher() {
|
|
2303
2481
|
const runtime = useBrandedRuntime();
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
return /* @__PURE__ */
|
|
2308
|
-
const selected =
|
|
2309
|
-
return /* @__PURE__ */
|
|
2482
|
+
const shipments = trackingBlockState(runtime).showResult ? runtime.result?.shipments ?? [] : [];
|
|
2483
|
+
if (shipments.length < 2 || !runtime.result) return null;
|
|
2484
|
+
const { shipmentValues } = trackingSelection(runtime.result, runtime.recentQueries);
|
|
2485
|
+
return /* @__PURE__ */ jsx7("div", { "aria-label": "Shipment switcher", style: { ...contentWidth2, minWidth: 0, minHeight: 56, display: "flex", alignItems: "center", gap: 8, overflowX: "auto", whiteSpace: "nowrap" }, children: shipments.map((shipment, index) => {
|
|
2486
|
+
const selected = runtime.selectedShipmentIndex === index;
|
|
2487
|
+
return /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => runtime.selectShipment(index), "aria-pressed": selected, style: { minWidth: 92, minHeight: 44, padding: "0 12px", border: selected ? "1px solid #1a1a1a" : "1px solid #e7e7e7", borderRadius: 4, background: "#fff", color: "#0a0a0a", fontSize: 11, fontWeight: selected ? 700 : 400, cursor: "pointer" }, children: shipmentValues[index] }, shipment.id);
|
|
2310
2488
|
}) });
|
|
2311
2489
|
}
|
|
2312
2490
|
function QueryHero(props) {
|
|
2313
2491
|
const runtime = useBrandedRuntime();
|
|
2314
|
-
const [heroImageFailed, setHeroImageFailed] =
|
|
2315
|
-
const result = runtime.
|
|
2492
|
+
const [heroImageFailed, setHeroImageFailed] = useState5(false);
|
|
2493
|
+
const result = runtime.result;
|
|
2316
2494
|
return /* @__PURE__ */ jsxs6("div", { style: { position: "relative", minWidth: 0, minHeight: "clamp(520px, 44vw, 560px)", display: "grid", overflow: "hidden", background: "linear-gradient(135deg, #dedbd4, #b9b3aa)" }, children: [
|
|
2317
|
-
!heroImageFailed && safeImageUrl2(props.heroImageUrl) ? /* @__PURE__ */
|
|
2318
|
-
/* @__PURE__ */
|
|
2319
|
-
/* @__PURE__ */
|
|
2495
|
+
!heroImageFailed && safeImageUrl2(props.heroImageUrl) ? /* @__PURE__ */ jsx7("img", { src: safeImageUrl2(props.heroImageUrl), alt: "", onError: () => setHeroImageFailed(true), style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" } }) : null,
|
|
2496
|
+
/* @__PURE__ */ jsx7("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgba(255,255,255,0.12)" } }),
|
|
2497
|
+
/* @__PURE__ */ jsx7("div", { style: { ...contentWidth2, position: "relative", zIndex: 1, display: "grid", alignItems: "center", width: "100%", minWidth: 0, paddingTop: "clamp(24px, 5vw, 48px)", paddingBottom: "clamp(24px, 5vw, 48px)" }, children: /* @__PURE__ */ jsx7(
|
|
2320
2498
|
TrackingQueryCard,
|
|
2321
2499
|
{
|
|
2322
2500
|
phase: runtime.phase,
|
|
@@ -2340,34 +2518,38 @@ function QueryHero(props) {
|
|
|
2340
2518
|
formStyle: { gap: 12 },
|
|
2341
2519
|
inputStyle: { width: "100%", height: 48, padding: "0 16px", boxSizing: "border-box", border: "1px solid #e2e2e2", borderRadius: 10, font: "inherit" },
|
|
2342
2520
|
submitStyle: (loading) => ({ width: "100%", minHeight: 48, marginTop: 12, border: 0, borderRadius: 10, background: loading ? "#6b6b6b" : "#000", color: "#fff", font: "inherit", cursor: loading ? "wait" : "pointer" }),
|
|
2343
|
-
result: result ? /* @__PURE__ */
|
|
2521
|
+
result: result ? /* @__PURE__ */ jsx7(TrackingQueryResultDetails, { showShipments: false, result, onTrackAnother: runtime.reset, trackAnotherLabel: text3(props, "trackAnotherLabel", "Track another order") }) : null,
|
|
2344
2522
|
resultStyle: { padding: 16, border: "1px solid #e7e7e7", borderRadius: 8, background: "#fffdf0" },
|
|
2345
|
-
watermark: /* @__PURE__ */
|
|
2523
|
+
watermark: /* @__PURE__ */ jsx7(RuntimeWatermark2, { watermark: runtime.watermark })
|
|
2346
2524
|
}
|
|
2347
2525
|
) })
|
|
2348
2526
|
] });
|
|
2349
2527
|
}
|
|
2350
2528
|
function PackageContents2({ items }) {
|
|
2351
|
-
if (!items?.length) return /* @__PURE__ */
|
|
2352
|
-
return /* @__PURE__ */
|
|
2353
|
-
|
|
2354
|
-
/* @__PURE__ */ jsxs6("
|
|
2355
|
-
/* @__PURE__ */
|
|
2356
|
-
/* @__PURE__ */
|
|
2357
|
-
|
|
2358
|
-
"
|
|
2359
|
-
|
|
2529
|
+
if (!items?.length) return /* @__PURE__ */ jsx7("p", { style: { margin: 0, color: "#6b6b6b" }, children: "Package contents are not available for this shipment." });
|
|
2530
|
+
return /* @__PURE__ */ jsx7("div", { style: { display: "grid", gap: 16 }, children: items.map((item) => {
|
|
2531
|
+
const href = safeHref2(item.href);
|
|
2532
|
+
return /* @__PURE__ */ jsxs6("article", { style: { display: "flex", alignItems: "flex-start", gap: 14, minWidth: 0 }, children: [
|
|
2533
|
+
/* @__PURE__ */ jsx7(ProductImage2, { src: item.imageUrl, alt: item.title }),
|
|
2534
|
+
/* @__PURE__ */ jsxs6("div", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
2535
|
+
/* @__PURE__ */ jsx7("strong", { children: item.title }),
|
|
2536
|
+
item.description ? /* @__PURE__ */ jsx7("p", { style: { margin: "5px 0", color: "#6b6b6b", fontSize: 14 }, children: item.description }) : null,
|
|
2537
|
+
/* @__PURE__ */ jsxs6("small", { style: { color: "#6b6b6b" }, children: [
|
|
2538
|
+
"Qty ",
|
|
2539
|
+
item.quantity
|
|
2540
|
+
] }),
|
|
2541
|
+
href ? /* @__PURE__ */ jsx7("a", { href, style: { display: "inline-flex", alignItems: "center", minHeight: 32, marginLeft: 8, padding: "6px 12px", border: "1px solid #e7e7e7", borderRadius: 6, color: "inherit", fontSize: 13 }, children: "Reorder" }) : null
|
|
2360
2542
|
] })
|
|
2361
|
-
] })
|
|
2362
|
-
|
|
2543
|
+
] }, item.id);
|
|
2544
|
+
}) });
|
|
2363
2545
|
}
|
|
2364
2546
|
function BrandedTextField({ value, onChange }) {
|
|
2365
|
-
return /* @__PURE__ */
|
|
2547
|
+
return /* @__PURE__ */ jsx7("input", { "aria-label": "Branded text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
|
|
2366
2548
|
}
|
|
2367
2549
|
function InlineText2({ block, name, fallback }) {
|
|
2368
2550
|
const value = text3(block, name, fallback);
|
|
2369
|
-
if (!block.selected) return /* @__PURE__ */
|
|
2370
|
-
return /* @__PURE__ */
|
|
2551
|
+
if (!block.selected) return /* @__PURE__ */ jsx7("span", { "data-branded-editor-field": name, children: value });
|
|
2552
|
+
return /* @__PURE__ */ jsx7(
|
|
2371
2553
|
"input",
|
|
2372
2554
|
{
|
|
2373
2555
|
"aria-label": "Canvas " + name,
|
|
@@ -2397,22 +2579,22 @@ function InlineText2({ block, name, fallback }) {
|
|
|
2397
2579
|
);
|
|
2398
2580
|
}
|
|
2399
2581
|
function EditorSurface({ block, children }) {
|
|
2400
|
-
return /* @__PURE__ */
|
|
2582
|
+
return /* @__PURE__ */ jsx7("section", { "aria-label": "Branded editor preview", style: { ...cardStyle, outline: block.selected ? "2px solid #2563eb" : "1px dashed #cbd5e1", outlineOffset: -2, padding: 24 }, children });
|
|
2401
2583
|
}
|
|
2402
2584
|
function BrandedAnnouncementEditor(block) {
|
|
2403
|
-
return /* @__PURE__ */
|
|
2585
|
+
return /* @__PURE__ */ jsx7("section", { "aria-label": "Branded announcement editor", style: { minHeight: 36, display: "grid", placeItems: "center", padding: "0 16px", background: "#252525", color: "#fff", fontFamily: "var(--pb-font-family)", fontSize: 12, textAlign: "center" }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "message", fallback: "Check out our summer sale" }) });
|
|
2404
2586
|
}
|
|
2405
2587
|
function BrandedTrackingExperienceEditor(block) {
|
|
2406
2588
|
const labels = shipmentLabels(block.shipmentLabels);
|
|
2407
2589
|
return /* @__PURE__ */ jsxs6("section", { "aria-label": "Branded tracking experience editor", style: { background: "#fffdf0", fontFamily: "var(--pb-font-family)" }, children: [
|
|
2408
|
-
/* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
2410
|
-
/* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ jsx7("div", { style: { ...contentWidth2, minHeight: 56, display: "flex", alignItems: "center", gap: 8, overflowX: "auto" }, children: labels.map((shipment, index) => /* @__PURE__ */ jsx7("span", { style: { minWidth: 92, padding: "9px 12px", border: index === 0 ? "1px solid #1a1a1a" : "1px solid #e7e7e7", borderRadius: 4, background: "#fff", fontSize: 11, fontWeight: index === 0 ? 700 : 400 }, children: shipment.label }, shipment.id)) }),
|
|
2591
|
+
/* @__PURE__ */ jsx7("div", { style: { minHeight: 360, display: "grid", placeItems: "center", padding: 16, background: "linear-gradient(135deg, #dedbd4, #b9b3aa)" }, children: /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
|
|
2592
|
+
/* @__PURE__ */ jsx7("h1", { style: { margin: "0 0 28px", textAlign: "center", fontSize: 32 }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "Track your order" }) }),
|
|
2411
2593
|
/* @__PURE__ */ jsxs6("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", borderBottom: "1px solid #e7e7e7", marginBottom: 20, textAlign: "center" }, children: [
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2594
|
+
/* @__PURE__ */ jsx7("span", { style: { padding: 10 }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "orderTabLabel", fallback: "Order Number" }) }),
|
|
2595
|
+
/* @__PURE__ */ jsx7("strong", { style: { padding: 10, borderBottom: "2px solid #0a0a0a" }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "trackingTabLabel", fallback: "Tracking Number" }) })
|
|
2414
2596
|
] }),
|
|
2415
|
-
/* @__PURE__ */
|
|
2597
|
+
/* @__PURE__ */ jsx7("input", { "aria-label": "Canvas default tracking number", readOnly: !block.selected, value: text3(block, "defaultTrackingNumber", "DEMO-YQTRACK9999"), onMouseDown: (event) => block.selected && event.stopPropagation(), onClick: (event) => block.selected && event.stopPropagation(), onChange: (event) => block.onPropsChange({ defaultTrackingNumber: event.currentTarget.value }), style: {
|
|
2416
2598
|
width: "100%",
|
|
2417
2599
|
height: 44,
|
|
2418
2600
|
boxSizing: "border-box",
|
|
@@ -2423,42 +2605,42 @@ function BrandedTrackingExperienceEditor(block) {
|
|
|
2423
2605
|
background: "#fff",
|
|
2424
2606
|
font: "inherit"
|
|
2425
2607
|
} }),
|
|
2426
|
-
/* @__PURE__ */
|
|
2427
|
-
/* @__PURE__ */
|
|
2608
|
+
/* @__PURE__ */ jsx7("div", { style: { display: "grid", placeItems: "center", minHeight: 46, marginTop: 16, borderRadius: 10, background: "#000", color: "#fff", fontWeight: 700 }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "submitLabel", fallback: "Track" }) }),
|
|
2609
|
+
/* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 10, color: "#8a8a8a", fontSize: 9, textAlign: "right" }, children: "Powered by BestTrack" })
|
|
2428
2610
|
] }) })
|
|
2429
2611
|
] });
|
|
2430
2612
|
}
|
|
2431
2613
|
function BrandedQueryEditor(block) {
|
|
2432
|
-
return /* @__PURE__ */
|
|
2614
|
+
return /* @__PURE__ */ jsx7(BrandedTrackingExperienceEditor, { ...block });
|
|
2433
2615
|
}
|
|
2434
2616
|
function BrandedOrderItemsEditor(block) {
|
|
2435
2617
|
return /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
|
|
2436
|
-
/* @__PURE__ */
|
|
2437
|
-
/* @__PURE__ */
|
|
2618
|
+
/* @__PURE__ */ jsx7("h2", { style: { margin: 0 }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "What's Inside" }) }),
|
|
2619
|
+
/* @__PURE__ */ jsx7("p", { style: { color: "#6b6b6b" }, children: "Package contents appear after a consumer tracking query." })
|
|
2438
2620
|
] });
|
|
2439
2621
|
}
|
|
2440
2622
|
function BrandedRecommendationsEditor(block) {
|
|
2441
2623
|
return /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2624
|
+
/* @__PURE__ */ jsx7("h2", { style: { margin: 0, textAlign: "center" }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "You might also like" }) }),
|
|
2625
|
+
/* @__PURE__ */ jsx7("p", { style: { color: "#6b6b6b", textAlign: "center" }, children: "Recommended products load independently of tracking queries." })
|
|
2444
2626
|
] });
|
|
2445
2627
|
}
|
|
2446
2628
|
function BrandedQuickLinksEditor(block) {
|
|
2447
2629
|
return /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
|
|
2448
|
-
/* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ jsx7("h2", { children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "Need help?" }) }),
|
|
2449
2631
|
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", gap: 20 }, children: [
|
|
2450
|
-
/* @__PURE__ */
|
|
2451
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ jsx7(InlineText2, { block, name: "primaryLabel", fallback: "Shipping help" }),
|
|
2633
|
+
/* @__PURE__ */ jsx7(InlineText2, { block, name: "secondaryLabel", fallback: "Contact us" })
|
|
2452
2634
|
] })
|
|
2453
2635
|
] });
|
|
2454
2636
|
}
|
|
2455
2637
|
function BrandedBlogEditor(block) {
|
|
2456
2638
|
return /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
|
|
2457
|
-
/* @__PURE__ */
|
|
2639
|
+
/* @__PURE__ */ jsx7("h2", { children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "From our journal" }) }),
|
|
2458
2640
|
/* @__PURE__ */ jsxs6("article", { children: [
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ jsx7("strong", { children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "articleTitle", fallback: "Delivery tips for every season" }) }),
|
|
2642
|
+
/* @__PURE__ */ jsx7("p", { children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "excerpt", fallback: "Simple ways to make every delivery feel considered." }) }),
|
|
2643
|
+
/* @__PURE__ */ jsx7(InlineText2, { block, name: "linkLabel", fallback: "Read the story" })
|
|
2462
2644
|
] })
|
|
2463
2645
|
] });
|
|
2464
2646
|
}
|
|
@@ -2466,53 +2648,55 @@ function BrandedAnnouncementBlock(props) {
|
|
|
2466
2648
|
const message = text3(props, "message", "");
|
|
2467
2649
|
const href = safeHref2(props.href);
|
|
2468
2650
|
if (!message) return null;
|
|
2469
|
-
return /* @__PURE__ */
|
|
2651
|
+
return /* @__PURE__ */ jsx7("section", { "aria-label": "Branded announcement", style: { minHeight: 36, display: "grid", placeItems: "center", padding: "0 16px", background: "#252525", color: "#fff", fontFamily: "var(--pb-font-family)", fontSize: 12, textAlign: "center" }, children: href ? /* @__PURE__ */ jsx7("a", { href, style: { color: "inherit", textDecoration: "none" }, children: message }) : message });
|
|
2470
2652
|
}
|
|
2471
2653
|
function BrandedTrackingExperienceBlock(props) {
|
|
2472
2654
|
return /* @__PURE__ */ jsxs6("section", { "aria-label": "Branded tracking experience", style: { background: "#fffdf0", fontFamily: "var(--pb-font-family)" }, children: [
|
|
2473
|
-
/* @__PURE__ */
|
|
2474
|
-
/* @__PURE__ */
|
|
2655
|
+
/* @__PURE__ */ jsx7(ShipmentSwitcher, {}),
|
|
2656
|
+
/* @__PURE__ */ jsx7(QueryHero, { ...props })
|
|
2475
2657
|
] });
|
|
2476
2658
|
}
|
|
2477
2659
|
function BrandedQueryBlock(props) {
|
|
2478
2660
|
return /* @__PURE__ */ jsxs6("section", { "aria-label": "Branded tracking query", style: { background: "#fffdf0", fontFamily: "var(--pb-font-family)" }, children: [
|
|
2479
|
-
/* @__PURE__ */
|
|
2480
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ jsx7(ShipmentSwitcher, {}),
|
|
2662
|
+
/* @__PURE__ */ jsx7(QueryHero, { ...props })
|
|
2481
2663
|
] });
|
|
2482
2664
|
}
|
|
2483
2665
|
function BrandedOrderItemsBlock(props) {
|
|
2484
2666
|
const runtime = useBrandedRuntime();
|
|
2485
|
-
const
|
|
2667
|
+
const visibility = trackingBlockState(runtime);
|
|
2668
|
+
if (!visibility.showDelivery) return null;
|
|
2669
|
+
const items = runtime.result?.orderItems ?? [];
|
|
2486
2670
|
const title = text3(props, "heading", "What's Inside");
|
|
2487
|
-
return /* @__PURE__ */
|
|
2671
|
+
return /* @__PURE__ */ jsx7("section", { "aria-label": title, style: { background: "#fffdf0", color: "#0a0a0a", fontFamily: "var(--pb-font-family)", padding: "clamp(28px, 4vw, 48px) 0" }, children: /* @__PURE__ */ jsxs6("div", { style: contentWidth2, children: [
|
|
2488
2672
|
/* @__PURE__ */ jsxs6("h2", { style: { margin: "0 0 20px", fontSize: 20 }, children: [
|
|
2489
2673
|
title,
|
|
2490
|
-
|
|
2674
|
+
visibility.showResult ? " (" + items.length + ")" : ""
|
|
2491
2675
|
] }),
|
|
2492
|
-
|
|
2676
|
+
visibility.showResult ? /* @__PURE__ */ jsx7(PackageContents2, { items }) : /* @__PURE__ */ jsx7("p", { style: { margin: 0, color: "#b42318" }, children: "Order items are temporarily unavailable." })
|
|
2493
2677
|
] }) });
|
|
2494
2678
|
}
|
|
2495
2679
|
function RecommendationCard({ item }) {
|
|
2496
2680
|
const href = safeHref2(item.href);
|
|
2497
|
-
const price =
|
|
2681
|
+
const price = formatRecommendationPrice(item.price);
|
|
2498
2682
|
return /* @__PURE__ */ jsxs6("article", { style: { overflow: "hidden", borderRadius: 6, background: "#fff", boxShadow: "0 1px 2px rgb(0 0 0 / 8%)" }, children: [
|
|
2499
|
-
/* @__PURE__ */
|
|
2683
|
+
/* @__PURE__ */ jsx7(ProductImage2, { src: item.imageUrl, alt: item.title }),
|
|
2500
2684
|
/* @__PURE__ */ jsxs6("div", { style: { padding: 14 }, children: [
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
price
|
|
2503
|
-
/* @__PURE__ */
|
|
2504
|
-
!href ? /* @__PURE__ */
|
|
2685
|
+
/* @__PURE__ */ jsx7("strong", { children: item.title }),
|
|
2686
|
+
price ? /* @__PURE__ */ jsx7("p", { style: { margin: "6px 0", fontWeight: 700 }, children: price }) : null,
|
|
2687
|
+
/* @__PURE__ */ jsx7("p", { style: { margin: "6px 0", color: "#6b6b6b", fontSize: 13 }, children: item.description }),
|
|
2688
|
+
!href ? /* @__PURE__ */ jsx7("span", { style: { color: "#6b6b6b", fontSize: 13, fontWeight: 700 }, children: "View product" }) : /* @__PURE__ */ jsx7("a", { href, style: { color: "#0a0a0a", fontSize: 13, fontWeight: 700 }, children: "View product" })
|
|
2505
2689
|
] })
|
|
2506
2690
|
] });
|
|
2507
2691
|
}
|
|
2508
2692
|
function BrandedRecommendationsBlock(props) {
|
|
2509
2693
|
const runtime = useBrandedRuntime();
|
|
2510
|
-
const recommendations =
|
|
2694
|
+
const recommendations = recommendationItems(props.products, runtime);
|
|
2511
2695
|
const title = text3(props, "heading", "You might also like");
|
|
2512
|
-
if (
|
|
2513
|
-
return /* @__PURE__ */
|
|
2514
|
-
/* @__PURE__ */
|
|
2515
|
-
|
|
2696
|
+
if (!recommendations.length) return null;
|
|
2697
|
+
return /* @__PURE__ */ jsx7("section", { "aria-label": title, style: { background: "#fffdf0", color: "#0a0a0a", fontFamily: "var(--pb-font-family)", padding: "clamp(28px, 4vw, 48px) 0" }, children: /* @__PURE__ */ jsxs6("div", { style: contentWidth2, children: [
|
|
2698
|
+
/* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 24px", textAlign: "center", fontSize: 20 }, children: title }),
|
|
2699
|
+
/* @__PURE__ */ jsx7("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: 16 }, children: recommendations.map((item) => /* @__PURE__ */ jsx7(RecommendationCard, { item }, item.id)) })
|
|
2516
2700
|
] }) });
|
|
2517
2701
|
}
|
|
2518
2702
|
function BrandedQuickLinksBlock(props) {
|
|
@@ -2520,10 +2704,10 @@ function BrandedQuickLinksBlock(props) {
|
|
|
2520
2704
|
const primaryHref = safeHref2(props.primaryHref);
|
|
2521
2705
|
const secondaryHref = safeHref2(props.secondaryHref);
|
|
2522
2706
|
return /* @__PURE__ */ jsxs6("section", { "aria-label": title, style: { ...cardStyle, margin: "24px auto", maxWidth: 1200, padding: 24 }, children: [
|
|
2523
|
-
/* @__PURE__ */
|
|
2707
|
+
/* @__PURE__ */ jsx7("h2", { children: title }),
|
|
2524
2708
|
/* @__PURE__ */ jsxs6("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))", gap: 16 }, children: [
|
|
2525
|
-
primaryHref ? /* @__PURE__ */
|
|
2526
|
-
secondaryHref ? /* @__PURE__ */
|
|
2709
|
+
primaryHref ? /* @__PURE__ */ jsx7("a", { href: primaryHref, style: { color: "#0a0a0a" }, children: text3(props, "primaryLabel", "Shipping help") }) : /* @__PURE__ */ jsx7("span", { children: text3(props, "primaryLabel", "Shipping help") }),
|
|
2710
|
+
secondaryHref ? /* @__PURE__ */ jsx7("a", { href: secondaryHref, style: { color: "#0a0a0a" }, children: text3(props, "secondaryLabel", "Contact us") }) : /* @__PURE__ */ jsx7("span", { children: text3(props, "secondaryLabel", "Contact us") })
|
|
2527
2711
|
] })
|
|
2528
2712
|
] });
|
|
2529
2713
|
}
|
|
@@ -2531,11 +2715,11 @@ function BrandedBlogBlock(props) {
|
|
|
2531
2715
|
const title = text3(props, "heading", "From our journal");
|
|
2532
2716
|
const href = safeHref2(props.articleHref);
|
|
2533
2717
|
return /* @__PURE__ */ jsxs6("section", { "aria-label": title, style: { ...cardStyle, margin: "24px auto", maxWidth: 1200, padding: 24 }, children: [
|
|
2534
|
-
/* @__PURE__ */
|
|
2718
|
+
/* @__PURE__ */ jsx7("h2", { children: title }),
|
|
2535
2719
|
/* @__PURE__ */ jsxs6("article", { children: [
|
|
2536
|
-
/* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
href ? /* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsx7("strong", { children: text3(props, "articleTitle", "Delivery tips for every season") }),
|
|
2721
|
+
/* @__PURE__ */ jsx7("p", { children: text3(props, "excerpt", "Simple ways to make every delivery feel considered.") }),
|
|
2722
|
+
href ? /* @__PURE__ */ jsx7("a", { href, style: { color: "#0a0a0a" }, children: text3(props, "linkLabel", "Read the story") }) : /* @__PURE__ */ jsx7("span", { children: text3(props, "linkLabel", "Read the story") })
|
|
2539
2723
|
] })
|
|
2540
2724
|
] });
|
|
2541
2725
|
}
|
|
@@ -2551,16 +2735,18 @@ var brandedBlocks = withTemplatePolicy2([
|
|
|
2551
2735
|
{ type: "besttrack.branded.tracking-experience", version: 1, label: "Tracking experience", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "Track your order", submitLabel: "Track", trackAnotherLabel: "Track another order", defaultTrackingNumber: "DEMO-YQTRACK9999", defaultOrderNumber: "", defaultQueryMode: "tracking", trackingTabLabel: "Tracking Number", orderTabLabel: "Order Number", shipmentLabels: "Shipment #1|Shipment #2|Shipment #3", heroImageUrl: "https://images.unsplash.com/photo-1596462502278-27bfdc403348?auto=format&fit=crop&w=1600&q=85" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "compact", label: "Compact", theme: { spacing: "12px" } }], fields: { heading: text4("Heading"), submitLabel: text4("Button label"), trackAnotherLabel: text4("Track another label"), defaultTrackingNumber: text4("Default tracking number"), defaultOrderNumber: text4("Default order number"), defaultQueryMode: text4("Default query mode"), trackingTabLabel: text4("Tracking tab label"), orderTabLabel: text4("Order tab label"), shipmentLabels: text4("Shipment labels (separate with |)"), heroImageUrl: httpsUrl("Hero image URL") }, render: { web: BrandedTrackingExperienceBlock, editor: BrandedTrackingExperienceEditor } },
|
|
2552
2736
|
{ type: "besttrack.branded.query", version: 1, label: "Order query", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "Track your order", submitLabel: "Track", defaultTrackingNumber: "DEMO-YQTRACK9999", defaultOrderNumber: "", defaultQueryMode: "tracking", trackingTabLabel: "Tracking Number", orderTabLabel: "Order Number", shipmentLabels: "Shipment #1|Shipment #2|Shipment #3", heroImageUrl: "https://images.unsplash.com/photo-1596462502278-27bfdc403348?auto=format&fit=crop&w=1600&q=85" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "compact", label: "Compact", theme: { spacing: "12px" } }], fields: { heading: text4("Heading"), submitLabel: text4("Button label"), defaultTrackingNumber: text4("Default tracking number"), defaultOrderNumber: text4("Default order number"), defaultQueryMode: text4("Default query mode"), trackingTabLabel: text4("Tracking tab label"), orderTabLabel: text4("Order tab label"), shipmentLabels: text4("Shipment labels (separate with |)"), heroImageUrl: httpsUrl("Hero image URL") }, render: { web: BrandedQueryBlock, editor: BrandedQueryEditor } },
|
|
2553
2737
|
{ type: "besttrack.branded.order-items", version: 1, label: "Order items", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "What's Inside" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "minimal", label: "Minimal" }], fields: { heading: text4("Heading") }, render: { web: BrandedOrderItemsBlock, editor: BrandedOrderItemsEditor } },
|
|
2554
|
-
|
|
2738
|
+
// products 接入与 Ready-to-go 相同的商家选品优先规则;hideWhenEmpty 仅保留旧文档兼容,
|
|
2739
|
+
// 不再提供编辑开关,因为三套模板都在没有可用推荐时隐藏内容。
|
|
2740
|
+
{ type: "besttrack.branded.recommendations", version: 1, label: "Recommended products", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "You might also like", hideWhenEmpty: "false", products: [] }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "editorial", label: "Editorial", theme: { "color.surface": "#fffdf0" } }], fields: { heading: text4("Heading"), products: { field: "besttrack.branded.products", label: "\u63A8\u8350\u5546\u54C1 (Shopify)", control: "products", group: "Content" } }, render: { web: BrandedRecommendationsBlock, editor: BrandedRecommendationsEditor } },
|
|
2555
2741
|
{ type: "besttrack.branded.quick-links", version: 1, label: "Quick links", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "Need help?", primaryLabel: "Shipping help", primaryHref: "https://example.com/pages/shipping", secondaryLabel: "Contact us", secondaryHref: "https://example.com/pages/contact" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }], fields: { heading: text4("Heading"), primaryLabel: text4("Primary link label"), primaryHref: httpsUrl("Primary link URL"), secondaryLabel: text4("Secondary link label"), secondaryHref: httpsUrl("Secondary link URL") }, render: { web: BrandedQuickLinksBlock, editor: BrandedQuickLinksEditor } },
|
|
2556
2742
|
{ type: "besttrack.branded.blog", version: 1, label: "Blog", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "From our journal", articleTitle: "Delivery tips for every season", excerpt: "Simple ways to make every delivery feel considered.", articleHref: "https://example.com/blogs/news", linkLabel: "Read the story" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }], fields: { heading: text4("Heading"), articleTitle: text4("Article title"), excerpt: text4("Excerpt", { control: "textarea" }), articleHref: httpsUrl("Article URL"), linkLabel: text4("Link label") }, render: { web: BrandedBlogBlock, editor: BrandedBlogEditor } }
|
|
2557
|
-
], ["besttrack.branded.announcement", "besttrack.branded.tracking-experience"]);
|
|
2743
|
+
], ["besttrack.branded.announcement", "besttrack.branded.tracking-experience", "besttrack.branded.recommendations"]);
|
|
2558
2744
|
var brandedDefaultBlockTypes = brandedBlocks.filter((block) => !["besttrack.branded.query", "besttrack.branded.order-items"].includes(block.type)).map((block) => block.type);
|
|
2559
2745
|
var brandedTemplatePolicy = defineTemplatePolicy(
|
|
2560
2746
|
"besttrack.branded",
|
|
2561
2747
|
"Branded",
|
|
2562
2748
|
brandedDefaultBlockTypes,
|
|
2563
|
-
["besttrack.branded.announcement", "besttrack.branded.tracking-experience"]
|
|
2749
|
+
["besttrack.branded.announcement", "besttrack.branded.tracking-experience", "besttrack.branded.recommendations"]
|
|
2564
2750
|
);
|
|
2565
2751
|
function createBrandedTemplate() {
|
|
2566
2752
|
const templateBlocks = brandedBlocks.filter((block) => brandedDefaultBlockTypes.includes(block.type));
|
|
@@ -2572,40 +2758,16 @@ var bestTrackBrandedExtension = Object.freeze({ name: "besttrack.branded", versi
|
|
|
2572
2758
|
import { createPageDocument as createPageDocument3 } from "@standhigher/puck-page-builder/runtime";
|
|
2573
2759
|
|
|
2574
2760
|
// src/sales.tsx
|
|
2575
|
-
import {
|
|
2576
|
-
import { Fragment as Fragment5, jsx as
|
|
2577
|
-
var
|
|
2578
|
-
|
|
2579
|
-
} };
|
|
2580
|
-
var SalesRuntimeContext = createContext3(initialRuntime3);
|
|
2761
|
+
import { useState as useState6 } from "react";
|
|
2762
|
+
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2763
|
+
var SalesRuntimeProvider = TrackingRuntimeProvider;
|
|
2764
|
+
var useSalesRuntime = useTrackingRuntime;
|
|
2581
2765
|
var contentWidth3 = { boxSizing: "border-box", width: "min(1120px, calc(100% - 32px))", margin: "0 auto" };
|
|
2582
2766
|
var sectionStyle = { ...contentWidth3, marginTop: "clamp(32px, 6vw, 72px)", color: "var(--pb-color-text)", fontFamily: "var(--pb-font-family)" };
|
|
2583
2767
|
var panelStyle = { boxSizing: "border-box", border: "1px solid var(--pb-color-border)", borderRadius: "var(--pb-radius)", padding: "clamp(20px, 3vw, 32px)", background: "var(--pb-color-surface)", color: "var(--pb-color-text)", overflowWrap: "anywhere" };
|
|
2584
2768
|
var gridStyle = { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 220px), 1fr))", gap: "clamp(16px, 2vw, 24px)" };
|
|
2585
|
-
function SalesRuntimeProvider({ children, query: injectedQuery, watermark, resourceResolution }) {
|
|
2586
|
-
const [state, setState] = useState5({ phase: "idle" });
|
|
2587
|
-
const requestId = useRef4(0);
|
|
2588
|
-
const query = useCallback4(async (request) => {
|
|
2589
|
-
const currentRequestId = ++requestId.current;
|
|
2590
|
-
setState({ phase: "loading" });
|
|
2591
|
-
try {
|
|
2592
|
-
if (!injectedQuery) throw new Error("tracking-query-not-configured");
|
|
2593
|
-
const result = await injectedQuery(request);
|
|
2594
|
-
if (currentRequestId !== requestId.current) return;
|
|
2595
|
-
setState({ phase: isEmptyTrackingPageResult(result) ? "empty" : "success", result });
|
|
2596
|
-
} catch {
|
|
2597
|
-
if (currentRequestId !== requestId.current) return;
|
|
2598
|
-
setState({ phase: "error" });
|
|
2599
|
-
}
|
|
2600
|
-
}, [injectedQuery]);
|
|
2601
|
-
const value = useMemo4(() => ({ ...state, query, watermark, resourceResolution }), [query, resourceResolution, state, watermark]);
|
|
2602
|
-
return /* @__PURE__ */ jsx7(SalesRuntimeContext.Provider, { value, children });
|
|
2603
|
-
}
|
|
2604
|
-
function useSalesRuntime() {
|
|
2605
|
-
return useContext3(SalesRuntimeContext);
|
|
2606
|
-
}
|
|
2607
2769
|
function RuntimeWatermark3({ watermark }) {
|
|
2608
|
-
return watermark?.visible ? /* @__PURE__ */
|
|
2770
|
+
return watermark?.visible ? /* @__PURE__ */ jsx8("small", { style: { display: "block", marginTop: 14, color: "var(--pb-color-muted)", fontSize: 11, textAlign: "right" }, children: watermark.label || "Powered by BestTrack" }) : null;
|
|
2609
2771
|
}
|
|
2610
2772
|
function text5(props, key, fallback) {
|
|
2611
2773
|
const value = props[key];
|
|
@@ -2614,28 +2776,28 @@ function text5(props, key, fallback) {
|
|
|
2614
2776
|
var safeHref3 = safeTrackingPageUrl;
|
|
2615
2777
|
var safeImageUrl3 = safeTrackingPageUrl;
|
|
2616
2778
|
function Status({ children, alert = false }) {
|
|
2617
|
-
return /* @__PURE__ */
|
|
2779
|
+
return /* @__PURE__ */ jsx8("p", { role: alert ? "alert" : "status", "aria-live": alert ? "assertive" : "polite", style: { margin: "16px 0 0", color: alert ? "#a61b1b" : "var(--pb-color-muted)" }, children });
|
|
2618
2780
|
}
|
|
2619
2781
|
function Section({ title, children, busy = false }) {
|
|
2620
|
-
return /* @__PURE__ */
|
|
2621
|
-
/* @__PURE__ */
|
|
2782
|
+
return /* @__PURE__ */ jsx8("section", { "aria-label": title, "aria-busy": busy || void 0, style: sectionStyle, children: /* @__PURE__ */ jsxs7("div", { style: panelStyle, children: [
|
|
2783
|
+
/* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px", fontSize: "clamp(24px, 3vw, 34px)", lineHeight: 1.15 }, children: title }),
|
|
2622
2784
|
children
|
|
2623
2785
|
] }) });
|
|
2624
2786
|
}
|
|
2625
2787
|
function ProductImage3({ src, alt }) {
|
|
2626
|
-
const [failed, setFailed] =
|
|
2788
|
+
const [failed, setFailed] = useState6(false);
|
|
2627
2789
|
const safeSrc = safeImageUrl3(src);
|
|
2628
|
-
if (!safeSrc || failed) return /* @__PURE__ */
|
|
2629
|
-
return /* @__PURE__ */
|
|
2790
|
+
if (!safeSrc || failed) return /* @__PURE__ */ jsx8("span", { "aria-label": `${alt} image unavailable`, role: "img", style: { display: "grid", placeItems: "center", width: 76, height: 76, flex: "0 0 auto", border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)", color: "var(--pb-color-muted)", fontWeight: 700 }, children: alt.slice(0, 1).toUpperCase() });
|
|
2791
|
+
return /* @__PURE__ */ jsx8("img", { src: safeSrc, alt, onError: () => setFailed(true), style: { width: 76, height: 76, flex: "0 0 auto", borderRadius: "calc(var(--pb-radius) / 1.5)", objectFit: "cover", background: "var(--pb-color-background)" } });
|
|
2630
2792
|
}
|
|
2631
2793
|
function HeroAsset({ src }) {
|
|
2632
|
-
const [failed, setFailed] =
|
|
2794
|
+
const [failed, setFailed] = useState6(false);
|
|
2633
2795
|
const safeSrc = safeImageUrl3(src);
|
|
2634
2796
|
if (!safeSrc || failed) return null;
|
|
2635
|
-
return /* @__PURE__ */
|
|
2797
|
+
return /* @__PURE__ */ jsx8("img", { "data-sales-hero-image": true, src: safeSrc, alt: "", "aria-hidden": "true", onError: () => setFailed(true), style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.62 } });
|
|
2636
2798
|
}
|
|
2637
2799
|
function SalesTextField({ value, onChange }) {
|
|
2638
|
-
return /* @__PURE__ */
|
|
2800
|
+
return /* @__PURE__ */ jsx8("input", { "aria-label": "Sales text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
|
|
2639
2801
|
}
|
|
2640
2802
|
var editorSurfaceStyle = { boxSizing: "border-box", border: "1px solid #dfddd7", borderRadius: 10, padding: 24, background: "#ffffff", color: "#0a0a0a", fontFamily: "Arial, Helvetica, sans-serif" };
|
|
2641
2803
|
var editorCardStyle = { boxSizing: "border-box", padding: 18, border: "1px solid #dfddd7", borderRadius: 7, background: "#f7f5f0" };
|
|
@@ -2644,8 +2806,8 @@ function editorText(block, name, fallback) {
|
|
|
2644
2806
|
}
|
|
2645
2807
|
function SalesInlineText({ block, name, fallback, style }) {
|
|
2646
2808
|
const value = editorText(block, name, fallback);
|
|
2647
|
-
if (!block.selected) return /* @__PURE__ */
|
|
2648
|
-
return /* @__PURE__ */
|
|
2809
|
+
if (!block.selected) return /* @__PURE__ */ jsx8("span", { "data-sales-editor-field": name, style, children: value });
|
|
2810
|
+
return /* @__PURE__ */ jsx8("input", { "aria-label": `Canvas ${name}`, "data-sales-editor-field": name, value, onMouseDown: (event) => event.stopPropagation(), onClick: (event) => event.stopPropagation(), onChange: (event) => block.onPropsChange({ [name]: event.currentTarget.value }), style: {
|
|
2649
2811
|
boxSizing: "border-box",
|
|
2650
2812
|
width: "100%",
|
|
2651
2813
|
/* border: "1px dashed currentColor", */
|
|
@@ -2662,55 +2824,55 @@ function SalesInlineText({ block, name, fallback, style }) {
|
|
|
2662
2824
|
} });
|
|
2663
2825
|
}
|
|
2664
2826
|
function SalesEditorSurface({ block, children }) {
|
|
2665
|
-
return /* @__PURE__ */
|
|
2827
|
+
return /* @__PURE__ */ jsx8("section", { "aria-label": "Sales editor preview", style: { ...editorSurfaceStyle, outline: block.selected ? "2px solid #2563eb" : void 0, outlineOffset: -2 }, children });
|
|
2666
2828
|
}
|
|
2667
2829
|
function SalesAnnouncementEditor(block) {
|
|
2668
|
-
return /* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ jsx8("section", { "aria-label": "Sales announcement editor", style: { display: "grid", minHeight: 38, placeItems: "center", boxSizing: "border-box", padding: "10px 16px", borderBottom: "1px solid #dfddd7", background: "#f7f5f0", color: "#0a0a0a", fontFamily: "Arial, Helvetica, sans-serif", fontSize: 13, fontWeight: 700, textAlign: "center" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "message", fallback: "Free delivery on orders over $50" }) });
|
|
2669
2831
|
}
|
|
2670
2832
|
function SalesQueryEditor(block) {
|
|
2671
2833
|
const imageUrl = safeImageUrl3(block.heroImageUrl);
|
|
2672
2834
|
const trackingNumber = editorText(block, "defaultTrackingNumber", "BT-2048-DEMO");
|
|
2673
2835
|
return /* @__PURE__ */ jsxs7("section", { "aria-label": "Sales Hero query editor", style: { position: "relative", display: "grid", minHeight: "clamp(460px, 52vw, 620px)", placeItems: "center", boxSizing: "border-box", overflow: "hidden", padding: "clamp(28px, 6vw, 72px) 16px", background: "#0a0a0a", fontFamily: "Arial, Helvetica, sans-serif" }, children: [
|
|
2674
|
-
imageUrl ? /* @__PURE__ */
|
|
2675
|
-
/* @__PURE__ */
|
|
2836
|
+
imageUrl ? /* @__PURE__ */ jsx8("img", { src: imageUrl, alt: "", "aria-hidden": "true", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.62 } }) : null,
|
|
2837
|
+
/* @__PURE__ */ jsx8("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgb(0 0 0 / 42%)" } }),
|
|
2676
2838
|
/* @__PURE__ */ jsxs7("div", { style: { position: "relative", zIndex: 1, boxSizing: "border-box", width: "min(560px, 100%)", padding: "clamp(28px, 5vw, 48px)", borderRadius: 10, background: "#ffffff", color: "#0a0a0a", boxShadow: "0 20px 56px rgb(0 0 0 / 28%)" }, children: [
|
|
2677
|
-
/* @__PURE__ */
|
|
2678
|
-
/* @__PURE__ */
|
|
2679
|
-
/* @__PURE__ */
|
|
2680
|
-
/* @__PURE__ */
|
|
2839
|
+
/* @__PURE__ */ jsx8("h1", { style: { margin: "0 0 28px", fontSize: "clamp(32px, 5vw, 48px)", fontWeight: 800, letterSpacing: "-0.035em", lineHeight: 1.02, textAlign: "center" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Track your order" }) }),
|
|
2840
|
+
/* @__PURE__ */ jsx8("input", { "aria-label": "Canvas default tracking number", readOnly: !block.selected, value: trackingNumber, onMouseDown: (event) => block.selected && event.stopPropagation(), onClick: (event) => block.selected && event.stopPropagation(), onChange: (event) => block.onPropsChange({ defaultTrackingNumber: event.currentTarget.value }), style: { boxSizing: "border-box", width: "100%", minHeight: 58, padding: "12px 16px", border: "1px solid #dfddd7", borderRadius: 8, background: "#ffffff", color: "#0a0a0a", font: "inherit", fontSize: 17 } }),
|
|
2841
|
+
/* @__PURE__ */ jsx8("div", { style: { display: "grid", minHeight: 58, placeItems: "center", marginTop: 14, padding: "12px 18px", borderRadius: 8, background: "#0a0a0a", color: "#ffffff", fontSize: 16, fontWeight: 700 }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "submitLabel", fallback: "Track order" }) }),
|
|
2842
|
+
/* @__PURE__ */ jsx8("small", { style: { display: "block", marginTop: 14, color: "#6b6b6b", fontSize: 11, textAlign: "right" }, children: "Powered by BestTrack" })
|
|
2681
2843
|
] })
|
|
2682
2844
|
] });
|
|
2683
2845
|
}
|
|
2684
2846
|
function SalesOrderItemsEditor(block) {
|
|
2685
2847
|
return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
|
|
2686
|
-
/* @__PURE__ */
|
|
2848
|
+
/* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Items in your order" }) }),
|
|
2687
2849
|
/* @__PURE__ */ jsxs7("article", { style: { ...editorCardStyle, display: "flex", alignItems: "center", gap: 14 }, children: [
|
|
2688
|
-
/* @__PURE__ */
|
|
2850
|
+
/* @__PURE__ */ jsx8("span", { "aria-hidden": "true", style: { width: 68, height: 68, borderRadius: 7, background: "#dfddd7" } }),
|
|
2689
2851
|
/* @__PURE__ */ jsxs7("span", { children: [
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsx8("strong", { children: "Order item" }),
|
|
2853
|
+
/* @__PURE__ */ jsx8("br", {}),
|
|
2854
|
+
/* @__PURE__ */ jsx8("small", { style: { color: "#6b6b6b" }, children: "Items appear after a successful tracking query." })
|
|
2693
2855
|
] })
|
|
2694
2856
|
] })
|
|
2695
2857
|
] });
|
|
2696
2858
|
}
|
|
2697
2859
|
function SalesOtherTrackingEditor(block) {
|
|
2698
2860
|
return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
|
|
2699
|
-
/* @__PURE__ */
|
|
2700
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Other shipments" }) }),
|
|
2862
|
+
/* @__PURE__ */ jsx8("p", { style: { margin: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "emptyMessage", fallback: "No other shipments are linked to this order." }) })
|
|
2701
2863
|
] });
|
|
2702
2864
|
}
|
|
2703
2865
|
function SalesServiceCardsEditor(block) {
|
|
2704
2866
|
return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
|
|
2705
|
-
/* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Shop with confidence" }) }),
|
|
2706
2868
|
/* @__PURE__ */ jsxs7("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 180px), 1fr))", gap: 14 }, children: [
|
|
2707
2869
|
/* @__PURE__ */ jsxs7("article", { style: editorCardStyle, children: [
|
|
2708
|
-
/* @__PURE__ */
|
|
2709
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ jsx8("strong", { children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "firstTitle", fallback: "Easy returns" }) }),
|
|
2871
|
+
/* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "firstDescription", fallback: "Simple support when plans change." }) })
|
|
2710
2872
|
] }),
|
|
2711
2873
|
/* @__PURE__ */ jsxs7("article", { style: editorCardStyle, children: [
|
|
2712
|
-
/* @__PURE__ */
|
|
2713
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ jsx8("strong", { children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "secondTitle", fallback: "Secure delivery" }) }),
|
|
2875
|
+
/* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "secondDescription", fallback: "Follow every milestone in one place." }) })
|
|
2714
2876
|
] })
|
|
2715
2877
|
] })
|
|
2716
2878
|
] });
|
|
@@ -2718,39 +2880,39 @@ function SalesServiceCardsEditor(block) {
|
|
|
2718
2880
|
function SalesProductCategoriesEditor(block) {
|
|
2719
2881
|
const collection = isShopifyResourceReference(block.collection, "collection") ? block.collection : void 0;
|
|
2720
2882
|
return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
|
|
2721
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Shop by category" }) }),
|
|
2722
2884
|
/* @__PURE__ */ jsxs7("div", { style: { ...editorCardStyle, display: "flex", justifyContent: "space-between", fontWeight: 700 }, children: [
|
|
2723
|
-
/* @__PURE__ */
|
|
2724
|
-
/* @__PURE__ */
|
|
2885
|
+
/* @__PURE__ */ jsx8("span", { children: collection?.title ?? "Choose a collection in the inspector" }),
|
|
2886
|
+
/* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: "\u2192" })
|
|
2725
2887
|
] })
|
|
2726
2888
|
] });
|
|
2727
2889
|
}
|
|
2728
2890
|
function SalesFeaturedProductEditor(block) {
|
|
2729
2891
|
const product = isShopifyResourceReference(block.product, "product") ? block.product : void 0;
|
|
2730
2892
|
return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
|
|
2731
|
-
/* @__PURE__ */
|
|
2893
|
+
/* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Featured product" }) }),
|
|
2732
2894
|
/* @__PURE__ */ jsxs7("div", { style: { ...editorCardStyle, display: "flex", justifyContent: "space-between", fontWeight: 700 }, children: [
|
|
2733
|
-
/* @__PURE__ */
|
|
2734
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ jsx8("span", { children: product?.title ?? "Choose a product in the inspector" }),
|
|
2896
|
+
/* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: "\u2192" })
|
|
2735
2897
|
] }),
|
|
2736
|
-
/* @__PURE__ */
|
|
2898
|
+
/* @__PURE__ */ jsx8("small", { style: { display: "block", marginTop: 10, color: "#6b6b6b" }, children: "Availability is supplied by the authorized runtime." })
|
|
2737
2899
|
] });
|
|
2738
2900
|
}
|
|
2739
2901
|
function SalesRecommendationsEditor(block) {
|
|
2740
2902
|
return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
|
|
2741
|
-
/* @__PURE__ */
|
|
2742
|
-
/* @__PURE__ */
|
|
2903
|
+
/* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Complete your order" }) }),
|
|
2904
|
+
/* @__PURE__ */ jsx8("div", { style: { ...editorCardStyle, color: "#6b6b6b" }, children: "Recommended products load independently of tracking queries." })
|
|
2743
2905
|
] });
|
|
2744
2906
|
}
|
|
2745
2907
|
function SalesAnnouncementBlock(props) {
|
|
2746
|
-
return /* @__PURE__ */
|
|
2908
|
+
return /* @__PURE__ */ jsx8("section", { "aria-label": "Sales announcement", "data-sales-announcement": true, style: { display: "grid", minHeight: 38, placeItems: "center", boxSizing: "border-box", padding: "10px 16px", borderBottom: "1px solid var(--pb-color-border)", background: "var(--pb-color-background)", color: "var(--pb-color-text)", fontFamily: "var(--pb-font-family)", fontSize: 13, textAlign: "center" }, children: /* @__PURE__ */ jsx8("strong", { children: text5(props, "message", "Free delivery on orders over $50") }) });
|
|
2747
2909
|
}
|
|
2748
2910
|
function SalesQueryBlock(props) {
|
|
2749
2911
|
const runtime = useSalesRuntime();
|
|
2750
2912
|
return /* @__PURE__ */ jsxs7("section", { "aria-label": "Sales tracking query", "aria-busy": runtime.phase === "loading" || void 0, "data-sales-hero": true, style: { position: "relative", display: "grid", minHeight: "clamp(460px, 52vw, 620px)", boxSizing: "border-box", overflow: "hidden", padding: "clamp(28px, 6vw, 72px) 16px", background: "var(--pb-color-text)", color: "var(--pb-color-surface)", fontFamily: "var(--pb-font-family)" }, children: [
|
|
2751
|
-
/* @__PURE__ */
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
/* @__PURE__ */
|
|
2913
|
+
/* @__PURE__ */ jsx8(HeroAsset, { src: props.heroImageUrl }),
|
|
2914
|
+
/* @__PURE__ */ jsx8("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgb(0 0 0 / 42%)" } }),
|
|
2915
|
+
/* @__PURE__ */ jsx8("div", { style: { ...contentWidth3, position: "relative", zIndex: 1, display: "grid", alignItems: "center", width: "100%", minWidth: 0 }, children: /* @__PURE__ */ jsx8(
|
|
2754
2916
|
TrackingQueryCard,
|
|
2755
2917
|
{
|
|
2756
2918
|
phase: runtime.phase,
|
|
@@ -2759,6 +2921,7 @@ function SalesQueryBlock(props) {
|
|
|
2759
2921
|
submitLabel: text5(props, "submitLabel", "Track order"),
|
|
2760
2922
|
initialTrackingNumber: text5(props, "defaultTrackingNumber", "BT-2048-DEMO"),
|
|
2761
2923
|
initialOrderNumber: text5(props, "defaultOrderNumber", ""),
|
|
2924
|
+
initialMode: text5(props, "defaultQueryMode", "tracking") === "order" ? "order" : "tracking",
|
|
2762
2925
|
emptyMessage: "We couldn\u2019t find an order for that number.",
|
|
2763
2926
|
errorMessage: "We couldn\u2019t retrieve this order right now. Please try again later.",
|
|
2764
2927
|
trackingInputLabel: "Sales tracking number",
|
|
@@ -2773,9 +2936,9 @@ function SalesQueryBlock(props) {
|
|
|
2773
2936
|
formStyle: { gap: 14 },
|
|
2774
2937
|
inputStyle: { boxSizing: "border-box", width: "100%", minHeight: 58, padding: "12px 16px", border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.25)", background: "var(--pb-color-surface)", color: "var(--pb-color-text)", font: "inherit", fontSize: 17 },
|
|
2775
2938
|
submitStyle: (loading) => ({ width: "100%", minHeight: 58, padding: "12px 18px", border: 0, borderRadius: "calc(var(--pb-radius) / 1.25)", background: loading ? "#64748b" : "var(--pb-color-text)", color: "var(--pb-color-surface)", font: "inherit", fontSize: 16, fontWeight: 700, cursor: loading ? "wait" : "pointer" }),
|
|
2776
|
-
result: runtime.result ? /* @__PURE__ */
|
|
2939
|
+
result: runtime.result ? /* @__PURE__ */ jsx8(TrackingQueryResultDetails, { result: runtime.result }) : null,
|
|
2777
2940
|
resultStyle: { padding: 16, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.25)", background: "var(--pb-color-background)" },
|
|
2778
|
-
watermark: /* @__PURE__ */
|
|
2941
|
+
watermark: /* @__PURE__ */ jsx8(RuntimeWatermark3, { watermark: runtime.watermark })
|
|
2779
2942
|
}
|
|
2780
2943
|
) })
|
|
2781
2944
|
] });
|
|
@@ -2783,127 +2946,132 @@ function SalesQueryBlock(props) {
|
|
|
2783
2946
|
function SalesOrderItemsBlock(props) {
|
|
2784
2947
|
const runtime = useSalesRuntime();
|
|
2785
2948
|
const title = text5(props, "heading", "Items in your order");
|
|
2949
|
+
const visibility = trackingBlockState(runtime);
|
|
2950
|
+
if (!visibility.showDelivery) return null;
|
|
2786
2951
|
const items = runtime.result?.orderItems ?? [];
|
|
2787
|
-
return /* @__PURE__ */
|
|
2952
|
+
return /* @__PURE__ */ jsx8(Section, { title, children: visibility.showUnavailable ? /* @__PURE__ */ jsx8(Status, { alert: true, children: "Order items are temporarily unavailable." }) : items.length ? /* @__PURE__ */ jsx8("ul", { style: { display: "grid", gap: 12, margin: 0, padding: 0, listStyle: "none" }, children: items.map((item) => {
|
|
2788
2953
|
const href = safeHref3(item.href);
|
|
2789
2954
|
const itemTitle = text5(item, "title", "Order item");
|
|
2790
|
-
const itemContent = href ? /* @__PURE__ */
|
|
2955
|
+
const itemContent = href ? /* @__PURE__ */ jsx8("a", { href, style: { color: "inherit" }, children: itemTitle }) : itemTitle;
|
|
2791
2956
|
return /* @__PURE__ */ jsxs7("li", { style: { display: "flex", alignItems: "center", gap: 16, minWidth: 0, padding: 14, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
|
|
2792
|
-
/* @__PURE__ */
|
|
2957
|
+
/* @__PURE__ */ jsx8(ProductImage3, { src: item.imageUrl, alt: itemTitle }),
|
|
2793
2958
|
/* @__PURE__ */ jsxs7("span", { style: { minWidth: 0 }, children: [
|
|
2794
|
-
/* @__PURE__ */
|
|
2795
|
-
/* @__PURE__ */
|
|
2959
|
+
/* @__PURE__ */ jsx8("strong", { children: itemContent }),
|
|
2960
|
+
/* @__PURE__ */ jsx8("br", {}),
|
|
2796
2961
|
/* @__PURE__ */ jsxs7("small", { style: { color: "var(--pb-color-muted)" }, children: [
|
|
2797
2962
|
"Qty ",
|
|
2798
|
-
|
|
2963
|
+
item.quantity
|
|
2799
2964
|
] }),
|
|
2800
2965
|
item.description ? /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
2801
|
-
/* @__PURE__ */
|
|
2802
|
-
/* @__PURE__ */
|
|
2803
|
-
] }) : null
|
|
2966
|
+
/* @__PURE__ */ jsx8("br", {}),
|
|
2967
|
+
/* @__PURE__ */ jsx8("small", { style: { color: "var(--pb-color-muted)" }, children: item.description })
|
|
2968
|
+
] }) : null,
|
|
2969
|
+
href ? /* @__PURE__ */ jsx8("a", { href, style: { display: "inline-flex", alignItems: "center", minHeight: 32, marginLeft: 8, padding: "6px 12px", border: "1px solid var(--pb-color-border)", borderRadius: 6, color: "inherit", fontSize: 13 }, children: "Reorder" }) : null
|
|
2804
2970
|
] })
|
|
2805
2971
|
] }, item.id);
|
|
2806
|
-
}) }) : /* @__PURE__ */
|
|
2972
|
+
}) }) : /* @__PURE__ */ jsx8(Status, { children: "Package contents are not available for this shipment." }) });
|
|
2807
2973
|
}
|
|
2808
2974
|
function SalesOtherTrackingBlock(props) {
|
|
2809
2975
|
const runtime = useSalesRuntime();
|
|
2810
2976
|
const title = text5(props, "heading", "Other shipments");
|
|
2811
|
-
const shipments =
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2977
|
+
const shipments = runtime.result?.shipments ?? [];
|
|
2978
|
+
if (!trackingBlockState(runtime).showResult || shipments.length < 2 || !runtime.result) return null;
|
|
2979
|
+
const { shipmentValues } = trackingSelection(runtime.result, runtime.recentQueries);
|
|
2980
|
+
return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8("ul", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 220px), 1fr))", gap: 12, margin: 0, padding: 0, listStyle: "none" }, children: shipments.map((shipment, index) => /* @__PURE__ */ jsxs7("li", { style: { padding: 16, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
|
|
2981
|
+
/* @__PURE__ */ jsx8("button", { type: "button", "aria-pressed": runtime.selectedShipmentIndex === index, onClick: () => runtime.selectShipment(index), style: { minHeight: 44, border: 0, background: "transparent", color: "inherit", font: "inherit", fontWeight: 700, cursor: "pointer" }, children: shipmentValues[index] }),
|
|
2982
|
+
shipment.status ? /* @__PURE__ */ jsx8("p", { style: { margin: "8px 0 0", color: "var(--pb-color-muted)" }, children: shipment.status }) : null
|
|
2983
|
+
] }, shipment.id)) }) });
|
|
2817
2984
|
}
|
|
2818
2985
|
function SalesServiceCardsBlock(props) {
|
|
2819
2986
|
const title = text5(props, "heading", "Shop with confidence");
|
|
2820
|
-
return /* @__PURE__ */
|
|
2987
|
+
return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsxs7("div", { style: gridStyle, children: [
|
|
2821
2988
|
/* @__PURE__ */ jsxs7("article", { style: { padding: 20, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
|
|
2822
|
-
/* @__PURE__ */
|
|
2823
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ jsx8("strong", { children: text5(props, "firstTitle", "Easy returns") }),
|
|
2990
|
+
/* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: text5(props, "firstDescription", "Simple support when plans change.") })
|
|
2824
2991
|
] }),
|
|
2825
2992
|
/* @__PURE__ */ jsxs7("article", { style: { padding: 20, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
|
|
2826
|
-
/* @__PURE__ */
|
|
2827
|
-
/* @__PURE__ */
|
|
2993
|
+
/* @__PURE__ */ jsx8("strong", { children: text5(props, "secondTitle", "Secure delivery") }),
|
|
2994
|
+
/* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: text5(props, "secondDescription", "Follow every milestone in one place.") })
|
|
2828
2995
|
] })
|
|
2829
2996
|
] }) });
|
|
2830
2997
|
}
|
|
2831
2998
|
function SalesProductCategoriesBlock(props) {
|
|
2832
2999
|
const title = text5(props, "heading", "Shop by category");
|
|
2833
3000
|
const runtime = useSalesRuntime();
|
|
2834
|
-
if (props.collection !== void 0 && props.collection !== null && !isShopifyResourceReference(props.collection, "collection")) return /* @__PURE__ */
|
|
3001
|
+
if (props.collection !== void 0 && props.collection !== null && !isShopifyResourceReference(props.collection, "collection")) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { alert: true, children: "Collection reference is invalid." }) });
|
|
2835
3002
|
const collection = isShopifyResourceReference(props.collection, "collection") ? props.collection : void 0;
|
|
2836
|
-
if (!collection) return /* @__PURE__ */
|
|
3003
|
+
if (!collection) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { children: "No collection selected. Choose a collection through an authorized resource integration." }) });
|
|
2837
3004
|
const resolved = getResolvedShopifyResource(collection, runtime.resourceResolution);
|
|
2838
3005
|
const error = getShopifyResourceResolutionError(collection, runtime.resourceResolution);
|
|
2839
|
-
if (error) return /* @__PURE__ */
|
|
2840
|
-
if (!resolved) return /* @__PURE__ */
|
|
3006
|
+
if (error) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { alert: true, children: error.code === "missing" ? "This collection is no longer available." : "Collection details are temporarily unavailable." }) });
|
|
3007
|
+
if (!resolved) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { children: "Collection details are resolved by the authorized runtime." }) });
|
|
2841
3008
|
const content = /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
2842
|
-
/* @__PURE__ */
|
|
2843
|
-
/* @__PURE__ */
|
|
3009
|
+
/* @__PURE__ */ jsx8("span", { children: resolved.title }),
|
|
3010
|
+
/* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: "\u2192" })
|
|
2844
3011
|
] });
|
|
2845
3012
|
const style = { display: "flex", minHeight: 72, alignItems: "center", justifyContent: "space-between", gap: 16, padding: 18, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)", color: "inherit", fontWeight: 700, textDecoration: "none" };
|
|
2846
|
-
return /* @__PURE__ */
|
|
3013
|
+
return /* @__PURE__ */ jsx8(Section, { title, children: resolved.href ? /* @__PURE__ */ jsx8("a", { href: resolved.href, style, children: content }) : /* @__PURE__ */ jsx8("div", { style, children: content }) });
|
|
2847
3014
|
}
|
|
2848
3015
|
function SalesFeaturedProductBlock(props) {
|
|
2849
3016
|
const runtime = useSalesRuntime();
|
|
2850
3017
|
const title = text5(props, "heading", "Featured product");
|
|
2851
|
-
if (props.product !== void 0 && props.product !== null && !isShopifyResourceReference(props.product, "product")) return /* @__PURE__ */
|
|
3018
|
+
if (props.product !== void 0 && props.product !== null && !isShopifyResourceReference(props.product, "product")) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { alert: true, children: "Product reference is invalid." }) });
|
|
2852
3019
|
const product = isShopifyResourceReference(props.product, "product") ? props.product : void 0;
|
|
2853
|
-
if (!product) return /* @__PURE__ */
|
|
3020
|
+
if (!product) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { children: "No product selected. Choose a product through an authorized resource integration." }) });
|
|
2854
3021
|
const resolved = getResolvedShopifyResource(product, runtime.resourceResolution);
|
|
2855
3022
|
const error = getShopifyResourceResolutionError(product, runtime.resourceResolution);
|
|
2856
|
-
if (error) return /* @__PURE__ */
|
|
2857
|
-
if (!resolved) return /* @__PURE__ */
|
|
3023
|
+
if (error) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { alert: true, children: error.code === "missing" ? "This product is no longer available." : "Product details are temporarily unavailable." }) });
|
|
3024
|
+
if (!resolved) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { children: "Product details and availability are resolved by the authorized runtime." }) });
|
|
2858
3025
|
const available = resolved.availability === "available";
|
|
2859
3026
|
const body = /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
2860
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ jsx8(ProductImage3, { src: resolved.imageUrl, alt: resolved.title }),
|
|
2861
3028
|
/* @__PURE__ */ jsxs7("span", { style: { minWidth: 0, flex: 1 }, children: [
|
|
2862
|
-
/* @__PURE__ */
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
/* @__PURE__ */
|
|
3029
|
+
/* @__PURE__ */ jsx8("strong", { children: resolved.title }),
|
|
3030
|
+
/* @__PURE__ */ jsx8("br", {}),
|
|
3031
|
+
/* @__PURE__ */ jsx8("small", { style: { color: "var(--pb-color-muted)" }, children: available ? "Available" : resolved.availability === "sold-out" ? "Sold out" : "Unavailable" })
|
|
2865
3032
|
] })
|
|
2866
3033
|
] });
|
|
2867
3034
|
const style = { display: "flex", alignItems: "center", gap: 16, padding: 14, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)", color: "inherit", textDecoration: "none" };
|
|
2868
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ jsx8(Section, { title, children: available && resolved.href ? /* @__PURE__ */ jsx8("a", { href: resolved.href, style, children: body }) : /* @__PURE__ */ jsx8("div", { style, children: body }) });
|
|
2869
3036
|
}
|
|
2870
3037
|
function SalesRecommendationsBlock(props) {
|
|
2871
3038
|
const runtime = useSalesRuntime();
|
|
2872
3039
|
const title = text5(props, "heading", "Complete your order");
|
|
2873
|
-
const recommendations =
|
|
2874
|
-
|
|
3040
|
+
const recommendations = recommendationItems(props.products, runtime);
|
|
3041
|
+
if (!recommendations.length) return null;
|
|
3042
|
+
return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8("div", { style: gridStyle, children: recommendations.map((item) => {
|
|
2875
3043
|
const href = safeHref3(item.href);
|
|
2876
3044
|
const itemTitle = text5(item, "title", "Recommended product");
|
|
2877
|
-
const price =
|
|
3045
|
+
const price = formatRecommendationPrice(item.price);
|
|
2878
3046
|
return /* @__PURE__ */ jsxs7("article", { style: { display: "grid", gap: 14, minWidth: 0, padding: 18, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
|
|
2879
|
-
/* @__PURE__ */
|
|
3047
|
+
/* @__PURE__ */ jsx8(ProductImage3, { src: item.imageUrl, alt: itemTitle }),
|
|
2880
3048
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
2881
|
-
/* @__PURE__ */
|
|
2882
|
-
price
|
|
2883
|
-
item.description ? /* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ jsx8("strong", { children: href ? /* @__PURE__ */ jsx8("a", { href, style: { color: "inherit" }, children: itemTitle }) : itemTitle }),
|
|
3050
|
+
price ? /* @__PURE__ */ jsx8("small", { style: { display: "block", marginTop: 5, color: "var(--pb-color-muted)" }, children: price }) : null,
|
|
3051
|
+
item.description ? /* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: item.description }) : null
|
|
2884
3052
|
] })
|
|
2885
3053
|
] }, item.id);
|
|
2886
|
-
}) })
|
|
3054
|
+
}) }) });
|
|
2887
3055
|
}
|
|
2888
3056
|
|
|
2889
3057
|
// src/shopify-resources.tsx
|
|
2890
|
-
import { createContext as
|
|
2891
|
-
import { jsx as
|
|
2892
|
-
var ShopifyResourceBrowserContext =
|
|
3058
|
+
import { createContext as createContext2, useCallback as useCallback3, useContext as useContext2, useState as useState7 } from "react";
|
|
3059
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3060
|
+
var ShopifyResourceBrowserContext = createContext2(void 0);
|
|
2893
3061
|
function ShopifyResourcePickerProvider({ browser, children }) {
|
|
2894
|
-
return /* @__PURE__ */
|
|
3062
|
+
return /* @__PURE__ */ jsx9(ShopifyResourceBrowserContext.Provider, { value: browser, children });
|
|
2895
3063
|
}
|
|
2896
3064
|
var pickerSurface = { marginTop: 8, padding: 12, border: "1px solid #c9cccf", borderRadius: 8, background: "#fff", color: "#202223" };
|
|
2897
3065
|
var pickerButton = { minHeight: 32, padding: "6px 10px", border: "1px solid #8c9196", borderRadius: 6, background: "#fff", color: "#202223", font: "inherit", cursor: "pointer" };
|
|
2898
3066
|
function ResourceField({ value, onChange, kind }) {
|
|
2899
|
-
const browser =
|
|
3067
|
+
const browser = useContext2(ShopifyResourceBrowserContext);
|
|
2900
3068
|
const selected = isShopifyResourceReference(value, kind) ? value : void 0;
|
|
2901
|
-
const [open, setOpen] =
|
|
2902
|
-
const [query, setQuery] =
|
|
2903
|
-
const [items, setItems] =
|
|
2904
|
-
const [cursor, setCursor] =
|
|
2905
|
-
const [state, setState] =
|
|
2906
|
-
const search =
|
|
3069
|
+
const [open, setOpen] = useState7(false);
|
|
3070
|
+
const [query, setQuery] = useState7("");
|
|
3071
|
+
const [items, setItems] = useState7([]);
|
|
3072
|
+
const [cursor, setCursor] = useState7();
|
|
3073
|
+
const [state, setState] = useState7("idle");
|
|
3074
|
+
const search = useCallback3(async (nextQuery, nextCursor, append = false) => {
|
|
2907
3075
|
if (!browser) return;
|
|
2908
3076
|
setState("loading");
|
|
2909
3077
|
try {
|
|
@@ -2919,15 +3087,15 @@ function ResourceField({ value, onChange, kind }) {
|
|
|
2919
3087
|
const name = kind === "product" ? "product" : "collection";
|
|
2920
3088
|
return /* @__PURE__ */ jsxs8("div", { "data-shopify-resource-field": kind, children: [
|
|
2921
3089
|
selected ? /* @__PURE__ */ jsxs8("p", { style: { margin: "0 0 8px" }, children: [
|
|
2922
|
-
/* @__PURE__ */
|
|
2923
|
-
/* @__PURE__ */
|
|
2924
|
-
/* @__PURE__ */
|
|
3090
|
+
/* @__PURE__ */ jsx9("strong", { children: selected.title }),
|
|
3091
|
+
/* @__PURE__ */ jsx9("br", {}),
|
|
3092
|
+
/* @__PURE__ */ jsx9("small", { children: selected.id })
|
|
2925
3093
|
] }) : /* @__PURE__ */ jsxs8("p", { style: { margin: "0 0 8px" }, children: [
|
|
2926
3094
|
"No ",
|
|
2927
3095
|
name,
|
|
2928
3096
|
" selected."
|
|
2929
3097
|
] }),
|
|
2930
|
-
/* @__PURE__ */
|
|
3098
|
+
/* @__PURE__ */ jsx9("button", { type: "button", style: pickerButton, onClick: () => {
|
|
2931
3099
|
if (open) {
|
|
2932
3100
|
setOpen(false);
|
|
2933
3101
|
return;
|
|
@@ -2945,32 +3113,32 @@ function ResourceField({ value, onChange, kind }) {
|
|
|
2945
3113
|
"Search ",
|
|
2946
3114
|
name,
|
|
2947
3115
|
"s",
|
|
2948
|
-
/* @__PURE__ */
|
|
3116
|
+
/* @__PURE__ */ jsx9("input", { "aria-label": `Search ${name}s`, value: query, onChange: (event) => setQuery(event.currentTarget.value), style: { boxSizing: "border-box", display: "block", width: "100%", minHeight: 32, marginTop: 4, padding: "6px 8px" } })
|
|
2949
3117
|
] }),
|
|
2950
|
-
/* @__PURE__ */
|
|
3118
|
+
/* @__PURE__ */ jsx9("button", { type: "submit", disabled: state === "loading", style: { ...pickerButton, marginTop: 8 }, children: state === "loading" ? "Searching\u2026" : "Search" })
|
|
2951
3119
|
] }),
|
|
2952
|
-
state === "error" ? /* @__PURE__ */
|
|
3120
|
+
state === "error" ? /* @__PURE__ */ jsx9("p", { role: "alert", children: "The authorized resource service is unavailable. Try again later." }) : null,
|
|
2953
3121
|
state === "idle" && !items.length ? /* @__PURE__ */ jsxs8("p", { role: "status", children: [
|
|
2954
3122
|
"No ",
|
|
2955
3123
|
name,
|
|
2956
3124
|
"s found."
|
|
2957
3125
|
] }) : null,
|
|
2958
|
-
items.length ? /* @__PURE__ */
|
|
3126
|
+
items.length ? /* @__PURE__ */ jsx9("ul", { style: { display: "grid", gap: 6, margin: "12px 0", padding: 0, listStyle: "none" }, children: items.map((item) => /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsxs8("button", { type: "button", style: { ...pickerButton, width: "100%", textAlign: "left" }, onClick: () => {
|
|
2959
3127
|
onChange(item);
|
|
2960
3128
|
setOpen(false);
|
|
2961
3129
|
}, children: [
|
|
2962
|
-
/* @__PURE__ */
|
|
2963
|
-
item.handle ? /* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ jsx9("strong", { children: item.title }),
|
|
3131
|
+
item.handle ? /* @__PURE__ */ jsx9("small", { style: { display: "block" }, children: item.handle }) : null
|
|
2964
3132
|
] }) }, item.id)) }) : null,
|
|
2965
|
-
cursor ? /* @__PURE__ */
|
|
3133
|
+
cursor ? /* @__PURE__ */ jsx9("button", { type: "button", disabled: state === "loading", style: pickerButton, onClick: () => void search(query, cursor, true), children: "Load more" }) : null
|
|
2966
3134
|
] }) : null
|
|
2967
3135
|
] });
|
|
2968
3136
|
}
|
|
2969
3137
|
function ShopifyProductResourceField(props) {
|
|
2970
|
-
return /* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsx9(ResourceField, { ...props, kind: "product" });
|
|
2971
3139
|
}
|
|
2972
3140
|
function ShopifyCollectionResourceField(props) {
|
|
2973
|
-
return /* @__PURE__ */
|
|
3141
|
+
return /* @__PURE__ */ jsx9(ResourceField, { ...props, kind: "collection" });
|
|
2974
3142
|
}
|
|
2975
3143
|
|
|
2976
3144
|
// src/sales-definition.ts
|
|
@@ -3020,13 +3188,14 @@ var salesBlocks = withTemplatePolicy3([
|
|
|
3020
3188
|
{ type: "besttrack.sales.service-cards", version: 1, label: "Service cards", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Shop with confidence", firstTitle: "Easy returns", firstDescription: "Simple support when plans change.", secondTitle: "Secure delivery", secondDescription: "Follow every milestone in one place." }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }], fields: { heading: shortText("Heading"), firstTitle: shortText("First card title"), firstDescription: longText("First card description"), secondTitle: shortText("Second card title"), secondDescription: longText("Second card description") }, validate: textProps([["heading", 120], ["firstTitle", 120], ["firstDescription", 280], ["secondTitle", 120], ["secondDescription", 280]]), render: { web: SalesServiceCardsBlock, editor: SalesServiceCardsEditor } },
|
|
3021
3189
|
{ type: "besttrack.sales.product-categories", version: 3, label: "Product categories", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Shop by category", collection: { id: "gid://shopify/Collection/1", kind: "collection", title: "Featured collection", handle: "featured" } }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }, { id: "grid", label: "Grid", theme: { "color.surface": "#f8fafc" } }], fields: { heading: shortText("Heading"), collection: { field: "besttrack.shopify.collection", label: "Collection", group: "Resource", description: "Browse through an authorized host integration. Only a stable ID and minimal display copy are saved." } }, validate: validateCategories, render: { web: SalesProductCategoriesBlock, editor: SalesProductCategoriesEditor } },
|
|
3022
3190
|
{ type: "besttrack.sales.featured-product", version: 1, label: "Featured product", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Featured product", product: { id: "gid://shopify/Product/1", kind: "product", title: "Featured product", handle: "featured-product" } }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }], fields: { heading: shortText("Heading"), product: { field: "besttrack.shopify.product", label: "Product", group: "Resource", description: "Browse through an authorized host integration. Current availability is resolved only at runtime." } }, validate: validateFeaturedProduct, render: { web: SalesFeaturedProductBlock, editor: SalesFeaturedProductEditor } },
|
|
3023
|
-
|
|
3024
|
-
|
|
3191
|
+
// 与另外两套模板一样保存商家选品配置;空数组表示交给独立推荐来源,不能改读查单推荐。
|
|
3192
|
+
{ type: "besttrack.sales.recommendations", version: 1, label: "Recommended products", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Complete your order", products: [] }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }, { id: "grid", label: "Product grid", theme: { "color.surface": "#f8fafc" } }], fields: { heading: shortText("Heading"), products: { field: "besttrack.sales.products", label: "\u63A8\u8350\u5546\u54C1 (Shopify)", control: "products", group: "Content" } }, validate: textProps([["heading", 120]]), render: { web: SalesRecommendationsBlock, editor: SalesRecommendationsEditor } }
|
|
3193
|
+
], ["besttrack.sales.announcement", "besttrack.sales.query", "besttrack.sales.order-items", "besttrack.sales.other-tracking", "besttrack.sales.recommendations"]);
|
|
3025
3194
|
var salesTemplatePolicy = defineTemplatePolicy(
|
|
3026
3195
|
"besttrack.sales",
|
|
3027
3196
|
"Sales",
|
|
3028
3197
|
salesBlocks.map((block) => block.type),
|
|
3029
|
-
["besttrack.sales.announcement", "besttrack.sales.query"]
|
|
3198
|
+
["besttrack.sales.announcement", "besttrack.sales.query", "besttrack.sales.order-items", "besttrack.sales.other-tracking", "besttrack.sales.recommendations"]
|
|
3030
3199
|
);
|
|
3031
3200
|
function createSalesTemplate() {
|
|
3032
3201
|
return { id: "besttrack.sales", version: 3, name: "Sales", target: "web", source: "built-in", requiredBlocks: salesBlocks.map((block) => block.type), theme: { "color.primary": "#000000", "color.background": "#f7f5f0", "color.surface": "#ffffff", "color.text": "#0a0a0a", "color.muted": "#6b6b6b", "color.border": "#dfddd7", "font.family": "Arial, Helvetica, sans-serif", radius: "10px", spacing: "24px" }, create: () => createPageDocument3({ pageId: "besttrack-sales", target: "web", templateId: "besttrack.sales", templateVersion: 3, settings: { locale: "en", seoTitle: "Shop and track your order" }, blocks: salesBlocks.map((block, index) => ({ id: "sales-" + (index + 1), type: block.type, version: block.version, props: block.defaultProps, variant: block.defaultVariant, style: {} })) }) };
|
|
@@ -3034,13 +3203,14 @@ function createSalesTemplate() {
|
|
|
3034
3203
|
var bestTrackSalesExtension = Object.freeze({ name: "besttrack.sales", version: "0.8.0", fields: [{ type: "besttrack.sales.text", component: SalesTextField }, { type: "besttrack.shopify.collection", component: ShopifyCollectionResourceField }, { type: "besttrack.shopify.product", component: ShopifyProductResourceField }], blocks: salesBlocks, templates: [createSalesTemplate()] });
|
|
3035
3204
|
export {
|
|
3036
3205
|
BrandedRuntimeProvider,
|
|
3037
|
-
ReadyToGoRuntimeProvider,
|
|
3206
|
+
TrackingRuntimeProvider as ReadyToGoRuntimeProvider,
|
|
3038
3207
|
SHOPIFY_RECOMMEND_PATH,
|
|
3039
3208
|
SHOPIFY_TRACK_QUERY_PATH,
|
|
3040
3209
|
SalesRuntimeProvider,
|
|
3041
3210
|
ShopifyCollectionResourceField,
|
|
3042
3211
|
ShopifyProductResourceField,
|
|
3043
3212
|
ShopifyResourcePickerProvider,
|
|
3213
|
+
TrackingRuntimeProvider,
|
|
3044
3214
|
bestTrackBrandedExtension,
|
|
3045
3215
|
bestTrackPageExtension,
|
|
3046
3216
|
bestTrackSalesExtension,
|
|
@@ -3074,6 +3244,7 @@ export {
|
|
|
3074
3244
|
salesTemplatePolicy,
|
|
3075
3245
|
shouldHidePoweredBy,
|
|
3076
3246
|
syncTrackingQueryToUrl,
|
|
3247
|
+
useTrackingRuntime,
|
|
3077
3248
|
withShopifyAppProxyPrefix,
|
|
3078
3249
|
withShopifyTrackCacheBust
|
|
3079
3250
|
};
|