@disconetwork/shopify 0.0.3 → 0.0.4
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/README.md +2 -12
- package/dist/{DiscoRecommendations-i3RGOqOq.js → DiscoRecommendations-BeqZ2x4q.js} +379 -138
- package/dist/DiscoRecommendations-BeqZ2x4q.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/internal.js +1 -1
- package/package.json +2 -2
- package/dist/DiscoRecommendations-i3RGOqOq.js.map +0 -1
|
@@ -1,15 +1,224 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
2
2
|
import { createContext } from "preact";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { cloneElement, createContext as createContext$1, createElement, isValidElement, useCallback as useCallback$1, useContext as useContext$1, useEffect as useEffect$1, useMemo as useMemo$1, useState as useState$1 } from "preact/compat";
|
|
4
|
+
import { withImpressionDedupe } from "@disconetwork/core";
|
|
5
|
+
import { jsx } from "preact/jsx-runtime";
|
|
6
|
+
import { INTERNAL_BASE_URL, InternalDiscoClient, parseScreens } from "@disconetwork/core/internal";
|
|
7
|
+
import { Fragment, jsx as jsx$1, jsxs } from "preact/jsx-runtime";
|
|
6
8
|
import { useApi, useBillingAddress, useCartLines, useCheckoutToken, useCustomer, useDiscountCodes, useEmail, usePhone, usePurchasingCompany, useShippingAddress, useShop, useSubscription, useTotalAmount } from "@shopify/ui-extensions/checkout/preact";
|
|
7
9
|
import { useApi as useApi$1, useBillingAddress as useBillingAddress$1, useCartLines as useCartLines$1, useCustomer as useCustomer$1, useDiscountCodes as useDiscountCodes$1, useEmail as useEmail$1, useOrder, usePhone as usePhone$1, usePurchasingCompany as usePurchasingCompany$1, useShippingAddress as useShippingAddress$1, useShop as useShop$1, useSubscription as useSubscription$1, useTotalAmount as useTotalAmount$1 } from "@shopify/ui-extensions/customer-account/preact";
|
|
8
|
-
|
|
10
|
+
//#region ../react-shared/dist/createHeadlessBindings-CPuF5wZQ.js
|
|
11
|
+
/**
|
|
12
|
+
* Build a self-contained set of headless React bindings for one client type.
|
|
13
|
+
*
|
|
14
|
+
* Returns the client context (for a backing-specific `DiscoProvider` to provide
|
|
15
|
+
* into), the `useDiscoClient` accessor, the `Disco.Root` controller, and the
|
|
16
|
+
* `useDiscoRecommendations` / `useDiscoTracker` / `useFetchRecommendations`
|
|
17
|
+
* hooks — all concretely typed to `TRequest` / `TResponse`. Call this once per
|
|
18
|
+
* backing at module load; the returned components/hooks are stable references.
|
|
19
|
+
*/
|
|
20
|
+
function createHeadlessBindings() {
|
|
21
|
+
/**
|
|
22
|
+
* Holds the client built by the backing's `<DiscoProvider>`. Read it with
|
|
23
|
+
* `useDiscoClient` to fetch recommendations or create trackers.
|
|
24
|
+
*/
|
|
25
|
+
const DiscoClientContext = createContext$1(null);
|
|
26
|
+
/**
|
|
27
|
+
* Read the client configured by the surrounding `<DiscoProvider>`.
|
|
28
|
+
*
|
|
29
|
+
* Returns the single, stable, provider-configured instance — use this rather
|
|
30
|
+
* than constructing a client in a component (which would create a new one each
|
|
31
|
+
* render and risk drifting from the provider's auth/env). Throws if used
|
|
32
|
+
* outside a provider.
|
|
33
|
+
*/
|
|
34
|
+
function useDiscoClient() {
|
|
35
|
+
const client = useContext$1(DiscoClientContext);
|
|
36
|
+
if (!client) throw new Error("useDiscoClient must be used inside a <DiscoProvider>.");
|
|
37
|
+
return client;
|
|
38
|
+
}
|
|
39
|
+
const LOADING = {
|
|
40
|
+
status: "loading",
|
|
41
|
+
data: void 0,
|
|
42
|
+
error: void 0
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Fetch-on-mount state machine for a recommendations surface.
|
|
46
|
+
*
|
|
47
|
+
* Owns the request lifecycle — fetch on mount, refetch when the request
|
|
48
|
+
* changes or `refetch` is called, abort in-flight requests on unmount/change —
|
|
49
|
+
* and derives the session-bound tracker from each response. Renders nothing and
|
|
50
|
+
* knows nothing about the `Disco.*` contexts; `<Disco.Root>` adapts its result.
|
|
51
|
+
*
|
|
52
|
+
* Exported from each backing's `/headless` entry as the shared fetch
|
|
53
|
+
* primitive: `<Disco.Root>` builds on it. Reach for it directly only when
|
|
54
|
+
* building a custom surface that needs the fetch lifecycle without the
|
|
55
|
+
* `Disco.*` contexts.
|
|
56
|
+
*/
|
|
57
|
+
function useFetchRecommendations(request) {
|
|
58
|
+
const client = useDiscoClient();
|
|
59
|
+
const [state, setState] = useState$1(LOADING);
|
|
60
|
+
const [tracker, setTracker] = useState$1(null);
|
|
61
|
+
const requestKey = useMemo$1(() => JSON.stringify(request), [request]);
|
|
62
|
+
const [reloadCount, setReloadCount] = useState$1(0);
|
|
63
|
+
const refetch = useCallback$1(() => setReloadCount((n) => n + 1), []);
|
|
64
|
+
useEffect$1(() => {
|
|
65
|
+
const controller = new AbortController();
|
|
66
|
+
setState(LOADING);
|
|
67
|
+
setTracker(null);
|
|
68
|
+
client.getRecommendationsWithTracker(request, { signal: controller.signal }).then(({ data, tracker }) => {
|
|
69
|
+
if (controller.signal.aborted) return;
|
|
70
|
+
setState({
|
|
71
|
+
status: "success",
|
|
72
|
+
data,
|
|
73
|
+
error: void 0
|
|
74
|
+
});
|
|
75
|
+
setTracker(withImpressionDedupe(tracker));
|
|
76
|
+
}).catch((error) => {
|
|
77
|
+
if (controller.signal.aborted) return;
|
|
78
|
+
setState({
|
|
79
|
+
status: "error",
|
|
80
|
+
data: void 0,
|
|
81
|
+
error
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return () => controller.abort();
|
|
85
|
+
}, [
|
|
86
|
+
client,
|
|
87
|
+
requestKey,
|
|
88
|
+
reloadCount
|
|
89
|
+
]);
|
|
90
|
+
return {
|
|
91
|
+
state,
|
|
92
|
+
tracker,
|
|
93
|
+
refetch
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const DiscoContext = createContext$1(null);
|
|
97
|
+
/**
|
|
98
|
+
* Read the recommendations fetch state, the session-bound tracker, and
|
|
99
|
+
* `refetch` from the surrounding `<Disco.Root>`. The tracker is non-null only
|
|
100
|
+
* once `status === "success"`; for consumers that only need the tracker and
|
|
101
|
+
* render inside a success branch, {@link useDiscoTracker} returns a non-null
|
|
102
|
+
* tracker and throws if used before success. Throws if used outside a
|
|
103
|
+
* `<Disco.Root>`.
|
|
104
|
+
*/
|
|
105
|
+
function useDiscoRecommendations() {
|
|
106
|
+
const ctx = useContext$1(DiscoContext);
|
|
107
|
+
if (!ctx) throw new Error("useDiscoRecommendations must be used inside a <Disco.Root>.");
|
|
108
|
+
return ctx;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Read the session-bound {@link EventTracker} for the surrounding
|
|
112
|
+
* `<Disco.Root>`.
|
|
113
|
+
*
|
|
114
|
+
* The tracker exists only once recommendations have loaded (its session comes
|
|
115
|
+
* from the response). Render tracking UI inside the `success` branch and this
|
|
116
|
+
* hook returns a ready tracker; it throws if used before `success`, surfacing
|
|
117
|
+
* misuse loudly rather than silently dropping events. Throws if used outside a
|
|
118
|
+
* `<Disco.Root>`.
|
|
119
|
+
*/
|
|
120
|
+
function useDiscoTracker() {
|
|
121
|
+
const ctx = useContext$1(DiscoContext);
|
|
122
|
+
if (!ctx) throw new Error("useDiscoTracker must be used inside a <Disco.Root>.");
|
|
123
|
+
if (!ctx.tracker) throw new Error("useDiscoTracker is only available after recommendations have loaded — render tracking UI inside the <Disco.Root> success branch.");
|
|
124
|
+
return ctx.tracker;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Headless controller for a Disco recommendations surface — the root of the
|
|
128
|
+
* `Disco.*` compound. Fetches via `useFetchRecommendations` and provides the
|
|
129
|
+
* fetch state (read with `useDiscoRecommendations`) and the session-bound
|
|
130
|
+
* tracker (read with `useDiscoTracker`) to its subtree. Renders no UI of its
|
|
131
|
+
* own; aborts in-flight requests on unmount or request change.
|
|
132
|
+
*/
|
|
133
|
+
function DiscoRoot({ request, children }) {
|
|
134
|
+
const { state, tracker, refetch } = useFetchRecommendations(request);
|
|
135
|
+
const value = useMemo$1(() => ({
|
|
136
|
+
...state,
|
|
137
|
+
tracker,
|
|
138
|
+
refetch
|
|
139
|
+
}), [
|
|
140
|
+
state,
|
|
141
|
+
tracker,
|
|
142
|
+
refetch
|
|
143
|
+
]);
|
|
144
|
+
return /* @__PURE__ */ jsx(DiscoContext.Provider, {
|
|
145
|
+
value,
|
|
146
|
+
children
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
DiscoClientContext,
|
|
151
|
+
useDiscoClient,
|
|
152
|
+
useDiscoRecommendations,
|
|
153
|
+
useDiscoTracker,
|
|
154
|
+
useFetchRecommendations,
|
|
155
|
+
DiscoRoot
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region ../react-shared/dist/bindings-D-XXI0bV.js
|
|
160
|
+
const bindings = createHeadlessBindings();
|
|
161
|
+
const DiscoClientContext = bindings.DiscoClientContext;
|
|
162
|
+
const useDiscoClient = bindings.useDiscoClient;
|
|
163
|
+
bindings.DiscoRoot;
|
|
164
|
+
const useFetchRecommendations = bindings.useFetchRecommendations;
|
|
165
|
+
bindings.useDiscoRecommendations;
|
|
166
|
+
bindings.useDiscoTracker;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region ../react-shared/dist/headless-C9iZrlrk.js
|
|
169
|
+
const RendererContext = createContext$1(null);
|
|
170
|
+
function useRendererContext() {
|
|
171
|
+
const ctx = useContext$1(RendererContext);
|
|
172
|
+
if (!ctx) throw new Error("useRendererContext must be used within a ScreensRenderer");
|
|
173
|
+
return ctx;
|
|
174
|
+
}
|
|
175
|
+
function generateNodes({ nodes, path, renderers }) {
|
|
176
|
+
return nodes.map((node, idx) => {
|
|
177
|
+
const generator = renderers[node.type];
|
|
178
|
+
if (!generator) throw new Error(`No renderer found for node type: "${node.type}"`);
|
|
179
|
+
const nodePath = `${path}.${node.type}.${idx}`;
|
|
180
|
+
const reactNode = generator({
|
|
181
|
+
node,
|
|
182
|
+
nodesToJSX: (args) => generateNodes({
|
|
183
|
+
nodes: args.nodes,
|
|
184
|
+
path: nodePath,
|
|
185
|
+
renderers
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
if (isValidElement(reactNode)) return cloneElement(reactNode, { key: nodePath });
|
|
189
|
+
return reactNode;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function ScreensRenderer({ jsonContent, renderers, fallback = null }) {
|
|
193
|
+
const screens = useMemo$1(() => parseScreens(jsonContent), [jsonContent]);
|
|
194
|
+
if (!screens) return fallback;
|
|
195
|
+
return createElement(ScreensNavigator, {
|
|
196
|
+
screens,
|
|
197
|
+
renderers
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function ScreensNavigator({ screens, renderers }) {
|
|
201
|
+
const [currentScreenId, setCurrentScreenId] = useState$1(() => screens[0]?.id ?? "default");
|
|
202
|
+
useEffect$1(() => {
|
|
203
|
+
setCurrentScreenId(screens[0]?.id ?? "default");
|
|
204
|
+
}, [screens]);
|
|
205
|
+
const activeScreen = screens.find((screen) => screen.id === currentScreenId) ?? screens[0];
|
|
206
|
+
if (!activeScreen) return null;
|
|
207
|
+
return createElement(RendererContext.Provider, { value: {
|
|
208
|
+
screens,
|
|
209
|
+
currentScreenId: activeScreen.id,
|
|
210
|
+
setCurrentScreenId
|
|
211
|
+
} }, generateNodes({
|
|
212
|
+
nodes: activeScreen.children,
|
|
213
|
+
path: activeScreen.id,
|
|
214
|
+
renderers
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
9
218
|
//#region src/managers/RecommendationsTrackingManager/index.tsx
|
|
10
219
|
const RecommendationsTrackingManagerContext = createContext(null);
|
|
11
220
|
function RecommendationsTrackingManager({ children, tracker }) {
|
|
12
|
-
return /* @__PURE__ */ jsx(RecommendationsTrackingManagerContext.Provider, {
|
|
221
|
+
return /* @__PURE__ */ jsx$1(RecommendationsTrackingManagerContext.Provider, {
|
|
13
222
|
value: tracker,
|
|
14
223
|
children
|
|
15
224
|
});
|
|
@@ -65,7 +274,7 @@ const getRecommendationsRequest = ({ payload }) => {
|
|
|
65
274
|
//#endregion
|
|
66
275
|
//#region src/components/CardContainer.tsx
|
|
67
276
|
const CardContainer = ({ children, ...rest }) => {
|
|
68
|
-
return /* @__PURE__ */ jsx("s-box", {
|
|
277
|
+
return /* @__PURE__ */ jsx$1("s-box", {
|
|
69
278
|
border: "base",
|
|
70
279
|
borderWidth: "base",
|
|
71
280
|
borderRadius: "large",
|
|
@@ -84,16 +293,16 @@ const DummyDiscoFeedRow = () => {
|
|
|
84
293
|
direction: "inline",
|
|
85
294
|
gap: "small-200",
|
|
86
295
|
alignItems: "center",
|
|
87
|
-
children: [/* @__PURE__ */ jsx("s-box", {
|
|
296
|
+
children: [/* @__PURE__ */ jsx$1("s-box", {
|
|
88
297
|
blockSize: "18px",
|
|
89
298
|
inlineSize: "18px",
|
|
90
299
|
background: "subdued",
|
|
91
300
|
borderRadius: "base"
|
|
92
|
-
}), /* @__PURE__ */ jsx("s-skeleton-paragraph", { content: "Brand" })]
|
|
93
|
-
}), /* @__PURE__ */ jsx("s-scroll-box", { children: /* @__PURE__ */ jsx("s-grid", {
|
|
301
|
+
}), /* @__PURE__ */ jsx$1("s-skeleton-paragraph", { content: "Brand" })]
|
|
302
|
+
}), /* @__PURE__ */ jsx$1("s-scroll-box", { children: /* @__PURE__ */ jsx$1("s-grid", {
|
|
94
303
|
gridTemplateColumns: `repeat(10, ${productSize}px)`,
|
|
95
304
|
gap: "small-200",
|
|
96
|
-
children: Array.from({ length: 10 }, (_, index) => /* @__PURE__ */ jsx("s-box", {
|
|
305
|
+
children: Array.from({ length: 10 }, (_, index) => /* @__PURE__ */ jsx$1("s-box", {
|
|
97
306
|
blockSize: `${productSize}px`,
|
|
98
307
|
inlineSize: `${productSize}px`,
|
|
99
308
|
background: "subdued",
|
|
@@ -105,26 +314,58 @@ const DummyDiscoFeedRow = () => {
|
|
|
105
314
|
const DummyDiscoFeedContent = ({ isPadded = false, brandCount = 3, showHeading = false }) => /* @__PURE__ */ jsxs("s-stack", {
|
|
106
315
|
padding: isPadded ? DISCO_FEED_CARD_PADDING : void 0,
|
|
107
316
|
gap: "large-500",
|
|
108
|
-
children: [showHeading && /* @__PURE__ */ jsx("s-skeleton-paragraph", { content: "Recommendations" }), Array.from({ length: brandCount }, (_, index) => /* @__PURE__ */ jsx(DummyDiscoFeedRow, {}, index))]
|
|
317
|
+
children: [showHeading && /* @__PURE__ */ jsx$1("s-skeleton-paragraph", { content: "Recommendations" }), Array.from({ length: brandCount }, (_, index) => /* @__PURE__ */ jsx$1(DummyDiscoFeedRow, {}, index))]
|
|
109
318
|
});
|
|
110
|
-
const DummyDiscoFeed = () => /* @__PURE__ */ jsx(CardContainer, {
|
|
319
|
+
const DummyDiscoFeed = () => /* @__PURE__ */ jsx$1(CardContainer, {
|
|
111
320
|
background: "base",
|
|
112
|
-
children: /* @__PURE__ */ jsx(DummyDiscoFeedContent, {
|
|
321
|
+
children: /* @__PURE__ */ jsx$1(DummyDiscoFeedContent, {
|
|
113
322
|
brandCount: 4,
|
|
114
323
|
showHeading: true,
|
|
115
324
|
isPadded: true
|
|
116
325
|
})
|
|
117
326
|
});
|
|
118
327
|
//#endregion
|
|
119
|
-
//#region src/
|
|
120
|
-
const
|
|
328
|
+
//#region src/sdkIdentity.ts
|
|
329
|
+
const SDK_IDENTITY = {
|
|
121
330
|
name: "@disconetwork/shopify",
|
|
122
|
-
version: "0.0.
|
|
123
|
-
}
|
|
331
|
+
version: "0.0.4"
|
|
332
|
+
};
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region ../react-shared/dist/sdk-internals.js
|
|
335
|
+
/** @internal Bind SDK identity to a provider using the legacy backend proxy. */
|
|
336
|
+
function createProxySdkProvider(sdk) {
|
|
337
|
+
return function ProxySdkProvider({ children, ...auth }) {
|
|
338
|
+
const apiKey = "apiKey" in auth ? auth.apiKey : void 0;
|
|
339
|
+
const surface = "surface" in auth ? auth.surface : void 0;
|
|
340
|
+
const shopGid = "shopGid" in auth ? auth.shopGid : void 0;
|
|
341
|
+
const env = "env" in auth ? auth.env : void 0;
|
|
342
|
+
const client = useMemo$1(() => apiKey !== void 0 ? new InternalDiscoClient({
|
|
343
|
+
apiKey,
|
|
344
|
+
surface,
|
|
345
|
+
sdk
|
|
346
|
+
}) : new InternalDiscoClient({
|
|
347
|
+
shopGid,
|
|
348
|
+
env,
|
|
349
|
+
sdk
|
|
350
|
+
}), [
|
|
351
|
+
apiKey,
|
|
352
|
+
surface,
|
|
353
|
+
shopGid,
|
|
354
|
+
env
|
|
355
|
+
]);
|
|
356
|
+
return /* @__PURE__ */ jsx(DiscoClientContext.Provider, {
|
|
357
|
+
value: client,
|
|
358
|
+
children
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/managers/DataManager.tsx
|
|
364
|
+
const ShopifySdkProvider = createProxySdkProvider(SDK_IDENTITY);
|
|
124
365
|
const MIN_LOADING_VIEW_HEIGHT = 800;
|
|
125
366
|
const DataManager = ({ auth, children }) => {
|
|
126
367
|
const payload = usePayload();
|
|
127
|
-
return /* @__PURE__ */ jsx(ShopifySdkProvider, {
|
|
368
|
+
return /* @__PURE__ */ jsx$1(ShopifySdkProvider, {
|
|
128
369
|
..."apiKey" in auth ? {
|
|
129
370
|
apiKey: auth.apiKey,
|
|
130
371
|
surface: "shopify"
|
|
@@ -132,7 +373,7 @@ const DataManager = ({ auth, children }) => {
|
|
|
132
373
|
shopGid: payload.shopGid,
|
|
133
374
|
env: auth.env
|
|
134
375
|
},
|
|
135
|
-
children: /* @__PURE__ */ jsx(RecommendationsContent, {
|
|
376
|
+
children: /* @__PURE__ */ jsx$1(RecommendationsContent, {
|
|
136
377
|
request: getRecommendationsRequest({ payload }),
|
|
137
378
|
children
|
|
138
379
|
})
|
|
@@ -141,13 +382,13 @@ const DataManager = ({ auth, children }) => {
|
|
|
141
382
|
const RecommendationsContent = ({ children, request }) => {
|
|
142
383
|
const { state: recommendations, tracker } = useFetchRecommendations(request);
|
|
143
384
|
if (recommendations.status === "error") return null;
|
|
144
|
-
if (recommendations.status === "loading" || !tracker) return /* @__PURE__ */ jsx("s-box", {
|
|
385
|
+
if (recommendations.status === "loading" || !tracker) return /* @__PURE__ */ jsx$1("s-box", {
|
|
145
386
|
minBlockSize: `${MIN_LOADING_VIEW_HEIGHT}px`,
|
|
146
|
-
children: /* @__PURE__ */ jsx(DummyDiscoFeed, {}, "dummy-feed")
|
|
387
|
+
children: /* @__PURE__ */ jsx$1(DummyDiscoFeed, {}, "dummy-feed")
|
|
147
388
|
});
|
|
148
|
-
return /* @__PURE__ */ jsx(RecommendationsDataContext.Provider, {
|
|
389
|
+
return /* @__PURE__ */ jsx$1(RecommendationsDataContext.Provider, {
|
|
149
390
|
value: recommendations.data,
|
|
150
|
-
children: /* @__PURE__ */ jsx(RecommendationsTrackingManager, {
|
|
391
|
+
children: /* @__PURE__ */ jsx$1(RecommendationsTrackingManager, {
|
|
151
392
|
tracker,
|
|
152
393
|
children
|
|
153
394
|
})
|
|
@@ -161,7 +402,7 @@ const GenericPayloadProvider = ({ target, children, payload, additionalPayload,
|
|
|
161
402
|
throw new Error("[Disco]: Disabling for B2B purchase");
|
|
162
403
|
}, [isB2BPurchase]);
|
|
163
404
|
if (isB2BPurchase) return null;
|
|
164
|
-
return /* @__PURE__ */ jsx(PayloadContext.Provider, {
|
|
405
|
+
return /* @__PURE__ */ jsx$1(PayloadContext.Provider, {
|
|
165
406
|
value: {
|
|
166
407
|
...payload,
|
|
167
408
|
...additionalPayload || {},
|
|
@@ -212,7 +453,7 @@ const ThankYouPayloadManager = ({ children }) => {
|
|
|
212
453
|
const api = useApi();
|
|
213
454
|
const orderId = useSubscription(api.orderConfirmation).order.id.split("/").pop();
|
|
214
455
|
if (!orderId) console.warn("[Disco]: Order ID not found in thank you page");
|
|
215
|
-
return /* @__PURE__ */ jsx(GenericPayloadProvider, {
|
|
456
|
+
return /* @__PURE__ */ jsx$1(GenericPayloadProvider, {
|
|
216
457
|
target,
|
|
217
458
|
payload: createGenericPayload({
|
|
218
459
|
buyerPhone,
|
|
@@ -249,7 +490,7 @@ const OrderStatusPayloadManager = ({ children }) => {
|
|
|
249
490
|
const shop = useShop$1();
|
|
250
491
|
const order = useOrder();
|
|
251
492
|
const api = useApi$1();
|
|
252
|
-
return /* @__PURE__ */ jsx(GenericPayloadProvider, {
|
|
493
|
+
return /* @__PURE__ */ jsx$1(GenericPayloadProvider, {
|
|
253
494
|
target,
|
|
254
495
|
payload: createGenericPayload({
|
|
255
496
|
buyerPhone,
|
|
@@ -286,8 +527,8 @@ const getExtensionTarget = () => globalThis.shopify?.extension?.target;
|
|
|
286
527
|
const PayloadManager = ({ children }) => {
|
|
287
528
|
const extensionTarget = getExtensionTarget();
|
|
288
529
|
const target = extensionTarget && EXTENSION_TARGETS[extensionTarget];
|
|
289
|
-
if (target === PAYLOAD_MANAGER_TARGET.THANK_YOU) return /* @__PURE__ */ jsx(ThankYouPayloadManager, { children });
|
|
290
|
-
if (target === PAYLOAD_MANAGER_TARGET.ORDER_STATUS) return /* @__PURE__ */ jsx(OrderStatusPayloadManager, { children });
|
|
530
|
+
if (target === PAYLOAD_MANAGER_TARGET.THANK_YOU) return /* @__PURE__ */ jsx$1(ThankYouPayloadManager, { children });
|
|
531
|
+
if (target === PAYLOAD_MANAGER_TARGET.ORDER_STATUS) return /* @__PURE__ */ jsx$1(OrderStatusPayloadManager, { children });
|
|
291
532
|
throw new Error(`[Disco]: Unsupported extension target ${extensionTarget ?? "(none)"}`);
|
|
292
533
|
};
|
|
293
534
|
//#endregion
|
|
@@ -303,7 +544,7 @@ const UserManager = ({ children }) => {
|
|
|
303
544
|
extrapolatedFirstName
|
|
304
545
|
});
|
|
305
546
|
const hasIdentity = useMemo(() => !!user?.email, [user]);
|
|
306
|
-
return /* @__PURE__ */ jsx(UserContext.Provider, {
|
|
547
|
+
return /* @__PURE__ */ jsx$1(UserContext.Provider, {
|
|
307
548
|
value: {
|
|
308
549
|
user,
|
|
309
550
|
setUser,
|
|
@@ -384,7 +625,7 @@ const HeroOfferProvider = ({ children, recommendationGroup, loop }) => {
|
|
|
384
625
|
claimedOffers,
|
|
385
626
|
recommendations
|
|
386
627
|
};
|
|
387
|
-
return /* @__PURE__ */ jsx(HeroContext.Provider, {
|
|
628
|
+
return /* @__PURE__ */ jsx$1(HeroContext.Provider, {
|
|
388
629
|
value,
|
|
389
630
|
children
|
|
390
631
|
});
|
|
@@ -399,7 +640,7 @@ const useHeroOffer = () => {
|
|
|
399
640
|
const ScrollableSlotContext = createContext(null);
|
|
400
641
|
const ScrollableSlotProvider = ({ children, scrollableRecommendationGroup }) => {
|
|
401
642
|
const value = { hasScrollableSlot: !!scrollableRecommendationGroup };
|
|
402
|
-
return /* @__PURE__ */ jsx(ScrollableSlotContext.Provider, {
|
|
643
|
+
return /* @__PURE__ */ jsx$1(ScrollableSlotContext.Provider, {
|
|
403
644
|
value,
|
|
404
645
|
children
|
|
405
646
|
});
|
|
@@ -536,7 +777,7 @@ const useDiscoEnv = () => useDiscoClient().env;
|
|
|
536
777
|
//#region src/components/Essential/generation/LinkGenerator.tsx
|
|
537
778
|
function InternalLink({ targetScreenId, children }) {
|
|
538
779
|
const ctx = useRendererContext();
|
|
539
|
-
return /* @__PURE__ */ jsx("s-link", {
|
|
780
|
+
return /* @__PURE__ */ jsx$1("s-link", {
|
|
540
781
|
tone: "neutral",
|
|
541
782
|
onClick: () => ctx.setCurrentScreenId(targetScreenId),
|
|
542
783
|
children
|
|
@@ -544,13 +785,13 @@ function InternalLink({ targetScreenId, children }) {
|
|
|
544
785
|
}
|
|
545
786
|
const LinkGenerator = { link: ({ node, nodesToJSX }) => {
|
|
546
787
|
const children = nodesToJSX({ nodes: node.children });
|
|
547
|
-
if ("targetScreenId" in node.attributes) return /* @__PURE__ */ jsx(InternalLink, {
|
|
788
|
+
if ("targetScreenId" in node.attributes) return /* @__PURE__ */ jsx$1(InternalLink, {
|
|
548
789
|
targetScreenId: node.attributes.targetScreenId,
|
|
549
790
|
children
|
|
550
791
|
});
|
|
551
792
|
const href = node.attributes.to;
|
|
552
793
|
const external = node.attributes.external;
|
|
553
|
-
return /* @__PURE__ */ jsx("s-link", {
|
|
794
|
+
return /* @__PURE__ */ jsx$1("s-link", {
|
|
554
795
|
tone: "neutral",
|
|
555
796
|
href,
|
|
556
797
|
target: external ? "_blank" : "auto",
|
|
@@ -560,9 +801,9 @@ const LinkGenerator = { link: ({ node, nodesToJSX }) => {
|
|
|
560
801
|
//#endregion
|
|
561
802
|
//#region src/components/Essential/generation/ParagraphGenerator.tsx
|
|
562
803
|
const ParagraphGenerator = { paragraph: ({ node, nodesToJSX }) => {
|
|
563
|
-
return /* @__PURE__ */ jsx("s-paragraph", {
|
|
804
|
+
return /* @__PURE__ */ jsx$1("s-paragraph", {
|
|
564
805
|
color: "subdued",
|
|
565
|
-
children: /* @__PURE__ */ jsx("s-text", {
|
|
806
|
+
children: /* @__PURE__ */ jsx$1("s-text", {
|
|
566
807
|
type: "strong",
|
|
567
808
|
children: nodesToJSX({ nodes: node.children })
|
|
568
809
|
})
|
|
@@ -573,7 +814,7 @@ const ParagraphGenerator = { paragraph: ({ node, nodesToJSX }) => {
|
|
|
573
814
|
const DEFAULT_MAX_BLOCK_SIZE = 300;
|
|
574
815
|
const ScrollViewGenerator = { scrollview: ({ node, nodesToJSX }) => {
|
|
575
816
|
const children = nodesToJSX({ nodes: node.children });
|
|
576
|
-
return /* @__PURE__ */ jsx("s-scroll-box", {
|
|
817
|
+
return /* @__PURE__ */ jsx$1("s-scroll-box", {
|
|
577
818
|
maxBlockSize: `${node.attributes?.maxBlockSize ?? DEFAULT_MAX_BLOCK_SIZE}px`,
|
|
578
819
|
children
|
|
579
820
|
});
|
|
@@ -591,12 +832,12 @@ const renderers = {
|
|
|
591
832
|
const EssentialOfferContent = ({ heading: offerHeading, subheading: offerSubheading, jsonContent: incentiveJson }) => {
|
|
592
833
|
return /* @__PURE__ */ jsxs("s-stack", {
|
|
593
834
|
gap: "small-200",
|
|
594
|
-
children: [/* @__PURE__ */ jsx("s-heading", { children: offerHeading }), /* @__PURE__ */ jsx(ScreensRenderer, {
|
|
835
|
+
children: [/* @__PURE__ */ jsx$1("s-heading", { children: offerHeading }), /* @__PURE__ */ jsx$1(ScreensRenderer, {
|
|
595
836
|
jsonContent: incentiveJson,
|
|
596
837
|
renderers,
|
|
597
|
-
fallback: /* @__PURE__ */ jsx("s-paragraph", {
|
|
838
|
+
fallback: /* @__PURE__ */ jsx$1("s-paragraph", {
|
|
598
839
|
color: "subdued",
|
|
599
|
-
children: /* @__PURE__ */ jsx("s-text", {
|
|
840
|
+
children: /* @__PURE__ */ jsx$1("s-text", {
|
|
600
841
|
type: "strong",
|
|
601
842
|
children: offerSubheading || ""
|
|
602
843
|
})
|
|
@@ -609,43 +850,43 @@ const EssentialOfferContent = ({ heading: offerHeading, subheading: offerSubhead
|
|
|
609
850
|
const EssentialLayoutType = ({ onLastOffer, compact }) => {
|
|
610
851
|
const { isFirstOffer, activeRecommendation: recommendation } = useHeroOffer();
|
|
611
852
|
const renderBrandLogo = recommendation.offer.metadata.layoutType === "FEATURED_IMAGE";
|
|
612
|
-
return /* @__PURE__ */ jsx("s-query-container", { children: /* @__PURE__ */ jsx("s-box", {
|
|
853
|
+
return /* @__PURE__ */ jsx$1("s-query-container", { children: /* @__PURE__ */ jsx$1("s-box", {
|
|
613
854
|
padding: compact ? "none" : "base",
|
|
614
855
|
children: /* @__PURE__ */ jsxs("s-stack", {
|
|
615
856
|
gap: "small-400",
|
|
616
857
|
children: [
|
|
617
|
-
renderBrandLogo && /* @__PURE__ */ jsx("s-box", {
|
|
858
|
+
renderBrandLogo && /* @__PURE__ */ jsx$1("s-box", {
|
|
618
859
|
display: "@container (inline-size > 450px) none, auto",
|
|
619
|
-
children: /* @__PURE__ */ jsx("s-stack", {
|
|
860
|
+
children: /* @__PURE__ */ jsx$1("s-stack", {
|
|
620
861
|
alignItems: "center",
|
|
621
|
-
children: /* @__PURE__ */ jsx(AdvertiserLogo, { recommendation })
|
|
862
|
+
children: /* @__PURE__ */ jsx$1(AdvertiserLogo, { recommendation })
|
|
622
863
|
})
|
|
623
864
|
}),
|
|
624
|
-
isFirstOffer && !compact && /* @__PURE__ */ jsx(FirstOfferHeading, {}),
|
|
865
|
+
isFirstOffer && !compact && /* @__PURE__ */ jsx$1(FirstOfferHeading, {}),
|
|
625
866
|
/* @__PURE__ */ jsxs("s-grid", {
|
|
626
867
|
gridTemplateColumns: renderBrandLogo ? "@container (inline-size > 450px) 1fr auto, 1fr" : "1fr",
|
|
627
868
|
gap: "base",
|
|
628
869
|
alignItems: "center",
|
|
629
870
|
children: [/* @__PURE__ */ jsxs("s-stack", {
|
|
630
871
|
gap: "base",
|
|
631
|
-
children: [/* @__PURE__ */ jsx(EssentialOfferContent, {
|
|
872
|
+
children: [/* @__PURE__ */ jsx$1(EssentialOfferContent, {
|
|
632
873
|
heading: recommendation.offer.heading || "",
|
|
633
874
|
subheading: recommendation.offer.subheading || "",
|
|
634
875
|
jsonContent: recommendation.offer.jsonContent
|
|
635
876
|
}), /* @__PURE__ */ jsxs("s-stack", {
|
|
636
877
|
direction: "@container (inline-size > 450px) inline, block",
|
|
637
878
|
gap: "base",
|
|
638
|
-
children: [/* @__PURE__ */ jsx("s-box", {
|
|
879
|
+
children: [/* @__PURE__ */ jsx$1("s-box", {
|
|
639
880
|
inlineSize: "@container (inline-size > 450px) auto, 100%",
|
|
640
|
-
children: /* @__PURE__ */ jsx(PrimaryButton, {})
|
|
641
|
-
}), /* @__PURE__ */ jsx("s-box", {
|
|
881
|
+
children: /* @__PURE__ */ jsx$1(PrimaryButton, {})
|
|
882
|
+
}), /* @__PURE__ */ jsx$1("s-box", {
|
|
642
883
|
inlineSize: "@container (inline-size > 450px) auto, 100%",
|
|
643
|
-
children: /* @__PURE__ */ jsx(SecondaryButton, { onLastOffer })
|
|
884
|
+
children: /* @__PURE__ */ jsx$1(SecondaryButton, { onLastOffer })
|
|
644
885
|
})]
|
|
645
886
|
})]
|
|
646
|
-
}), renderBrandLogo && /* @__PURE__ */ jsx("s-box", {
|
|
887
|
+
}), renderBrandLogo && /* @__PURE__ */ jsx$1("s-box", {
|
|
647
888
|
display: "@container (inline-size > 450px) auto, none",
|
|
648
|
-
children: /* @__PURE__ */ jsx(AdvertiserLogo, { recommendation })
|
|
889
|
+
children: /* @__PURE__ */ jsx$1(AdvertiserLogo, { recommendation })
|
|
649
890
|
})]
|
|
650
891
|
})
|
|
651
892
|
]
|
|
@@ -660,10 +901,10 @@ function AdvertiserLogo({ recommendation }) {
|
|
|
660
901
|
env,
|
|
661
902
|
size: imageSize
|
|
662
903
|
});
|
|
663
|
-
return /* @__PURE__ */ jsx("s-box", {
|
|
904
|
+
return /* @__PURE__ */ jsx$1("s-box", {
|
|
664
905
|
blockSize: `${imageSize}px`,
|
|
665
906
|
inlineSize: `${imageSize}px`,
|
|
666
|
-
children: /* @__PURE__ */ jsx("s-image", {
|
|
907
|
+
children: /* @__PURE__ */ jsx$1("s-image", {
|
|
667
908
|
aspectRatio: "1",
|
|
668
909
|
src: image.src,
|
|
669
910
|
srcSet: image.srcSet,
|
|
@@ -687,7 +928,7 @@ function PrimaryButton() {
|
|
|
687
928
|
});
|
|
688
929
|
handleOfferClaim();
|
|
689
930
|
};
|
|
690
|
-
return /* @__PURE__ */ jsx("s-button", {
|
|
931
|
+
return /* @__PURE__ */ jsx$1("s-button", {
|
|
691
932
|
href: recommendation.offer.targetUrl,
|
|
692
933
|
target: "_blank",
|
|
693
934
|
inlineSize: "fill",
|
|
@@ -717,7 +958,7 @@ function SecondaryButton({ onLastOffer }) {
|
|
|
717
958
|
nextOffer();
|
|
718
959
|
};
|
|
719
960
|
const buttonText = isOfferClaimed ? isLastOffer ? hasScrollableSlot ? "See more" : "Close" : "Next offer" : recommendation.offer.ctaDetails.declineCopy || "No thanks";
|
|
720
|
-
return /* @__PURE__ */ jsx("s-button", {
|
|
961
|
+
return /* @__PURE__ */ jsx$1("s-button", {
|
|
721
962
|
inlineSize: "fill",
|
|
722
963
|
variant: isOfferClaimed ? "primary" : "secondary",
|
|
723
964
|
onClick: handleClick,
|
|
@@ -725,7 +966,7 @@ function SecondaryButton({ onLastOffer }) {
|
|
|
725
966
|
});
|
|
726
967
|
}
|
|
727
968
|
function FirstOfferHeading() {
|
|
728
|
-
return /* @__PURE__ */ jsx("s-text", {
|
|
969
|
+
return /* @__PURE__ */ jsx$1("s-text", {
|
|
729
970
|
tone: "info",
|
|
730
971
|
children: useFirstOfferHeading()
|
|
731
972
|
});
|
|
@@ -734,13 +975,13 @@ function FirstOfferHeading() {
|
|
|
734
975
|
//#region src/components/RecommendationsWidget/DotIndicators.tsx
|
|
735
976
|
const DotIndicators = ({ totalCount, activeIndex }) => {
|
|
736
977
|
if (totalCount <= 1) return null;
|
|
737
|
-
return /* @__PURE__ */ jsx("s-stack", {
|
|
978
|
+
return /* @__PURE__ */ jsx$1("s-stack", {
|
|
738
979
|
padding: "small-200 none",
|
|
739
980
|
alignItems: "center",
|
|
740
|
-
children: /* @__PURE__ */ jsx("s-stack", {
|
|
981
|
+
children: /* @__PURE__ */ jsx$1("s-stack", {
|
|
741
982
|
direction: "inline",
|
|
742
983
|
gap: "small-200",
|
|
743
|
-
children: Array.from({ length: totalCount }, (_, i) => /* @__PURE__ */ jsx("s-badge", {
|
|
984
|
+
children: Array.from({ length: totalCount }, (_, i) => /* @__PURE__ */ jsx$1("s-badge", {
|
|
744
985
|
size: "small",
|
|
745
986
|
color: i === activeIndex ? "base" : "subdued",
|
|
746
987
|
children: `${i + 1}`
|
|
@@ -755,9 +996,9 @@ const PRIVACY_POLICY_URL = "https://www.disconetwork.com/privacy-policy";
|
|
|
755
996
|
//#endregion
|
|
756
997
|
//#region src/components/PrivacyLink.tsx
|
|
757
998
|
const PrivacyLink = ({ onPress }) => {
|
|
758
|
-
return /* @__PURE__ */ jsx("s-text", {
|
|
999
|
+
return /* @__PURE__ */ jsx$1("s-text", {
|
|
759
1000
|
color: "subdued",
|
|
760
|
-
children: /* @__PURE__ */ jsx("s-link", {
|
|
1001
|
+
children: /* @__PURE__ */ jsx$1("s-link", {
|
|
761
1002
|
href: PRIVACY_POLICY_URL,
|
|
762
1003
|
target: "_blank",
|
|
763
1004
|
tone: "neutral",
|
|
@@ -776,10 +1017,10 @@ function Footer() {
|
|
|
776
1017
|
target: "INLINE_FOOTER_PRIVACY"
|
|
777
1018
|
});
|
|
778
1019
|
};
|
|
779
|
-
return /* @__PURE__ */ jsx("s-stack", {
|
|
1020
|
+
return /* @__PURE__ */ jsx$1("s-stack", {
|
|
780
1021
|
padding: "small-200 base",
|
|
781
1022
|
alignItems: "end",
|
|
782
|
-
children: /* @__PURE__ */ jsx(PrivacyLink, { onPress: handlePrivacyClick })
|
|
1023
|
+
children: /* @__PURE__ */ jsx$1(PrivacyLink, { onPress: handlePrivacyClick })
|
|
783
1024
|
});
|
|
784
1025
|
}
|
|
785
1026
|
//#endregion
|
|
@@ -789,10 +1030,10 @@ const CoverRecommendationsWidget = ({ heroRecommendationGroup }) => {
|
|
|
789
1030
|
useEffect(() => {
|
|
790
1031
|
track({ type: "WIDGET_LOAD" });
|
|
791
1032
|
}, [track]);
|
|
792
|
-
return /* @__PURE__ */ jsx(HeroOfferProvider, {
|
|
1033
|
+
return /* @__PURE__ */ jsx$1(HeroOfferProvider, {
|
|
793
1034
|
recommendationGroup: heroRecommendationGroup,
|
|
794
1035
|
loop: true,
|
|
795
|
-
children: /* @__PURE__ */ jsx(CoverRecommendationsWidgetContent, {})
|
|
1036
|
+
children: /* @__PURE__ */ jsx$1(CoverRecommendationsWidgetContent, {})
|
|
796
1037
|
});
|
|
797
1038
|
};
|
|
798
1039
|
const CoverRecommendationsWidgetContent = () => {
|
|
@@ -821,19 +1062,19 @@ const CoverRecommendationsWidgetContent = () => {
|
|
|
821
1062
|
advertiser.id
|
|
822
1063
|
]);
|
|
823
1064
|
const subtitle = `You've unlocked ${TOTAL_NUM_OFFERS} exclusive offer${TOTAL_NUM_OFFERS !== 1 ? "s" : ""} with your purchase — don't let them go to waste!`;
|
|
824
|
-
return /* @__PURE__ */ jsx(CardContainer, {
|
|
1065
|
+
return /* @__PURE__ */ jsx$1(CardContainer, {
|
|
825
1066
|
background: "transparent",
|
|
826
|
-
children: /* @__PURE__ */ jsx("s-box", {
|
|
1067
|
+
children: /* @__PURE__ */ jsx$1("s-box", {
|
|
827
1068
|
padding: "base",
|
|
828
1069
|
children: /* @__PURE__ */ jsxs("s-stack", {
|
|
829
1070
|
gap: "base",
|
|
830
1071
|
children: [
|
|
831
|
-
/* @__PURE__ */ jsx("s-heading", { children: "Your purchase comes with rewards!" }),
|
|
832
|
-
/* @__PURE__ */ jsx("s-text", {
|
|
1072
|
+
/* @__PURE__ */ jsx$1("s-heading", { children: "Your purchase comes with rewards!" }),
|
|
1073
|
+
/* @__PURE__ */ jsx$1("s-text", {
|
|
833
1074
|
color: "subdued",
|
|
834
1075
|
children: subtitle
|
|
835
1076
|
}),
|
|
836
|
-
/* @__PURE__ */ jsx("s-button", {
|
|
1077
|
+
/* @__PURE__ */ jsx$1("s-button", {
|
|
837
1078
|
variant: "primary",
|
|
838
1079
|
command: "--show",
|
|
839
1080
|
commandFor: "cover-modal",
|
|
@@ -860,16 +1101,16 @@ const CoverRecommendationsWidgetContent = () => {
|
|
|
860
1101
|
});
|
|
861
1102
|
},
|
|
862
1103
|
children: [
|
|
863
|
-
/* @__PURE__ */ jsx(ScrollableSlotProvider, { children: /* @__PURE__ */ jsx(EssentialLayoutType, {
|
|
1104
|
+
/* @__PURE__ */ jsx$1(ScrollableSlotProvider, { children: /* @__PURE__ */ jsx$1(EssentialLayoutType, {
|
|
864
1105
|
onLastOffer: nextOffer,
|
|
865
1106
|
compact: true
|
|
866
1107
|
}) }),
|
|
867
|
-
/* @__PURE__ */ jsx(DotIndicators, {
|
|
1108
|
+
/* @__PURE__ */ jsx$1(DotIndicators, {
|
|
868
1109
|
totalCount: TOTAL_NUM_OFFERS,
|
|
869
1110
|
activeIndex: activeOfferIndex
|
|
870
1111
|
}),
|
|
871
|
-
/* @__PURE__ */ jsx("s-divider", {}),
|
|
872
|
-
/* @__PURE__ */ jsx(Footer, {})
|
|
1112
|
+
/* @__PURE__ */ jsx$1("s-divider", {}),
|
|
1113
|
+
/* @__PURE__ */ jsx$1(Footer, {})
|
|
873
1114
|
]
|
|
874
1115
|
})
|
|
875
1116
|
]
|
|
@@ -880,19 +1121,19 @@ const CoverRecommendationsWidgetContent = () => {
|
|
|
880
1121
|
//#endregion
|
|
881
1122
|
//#region src/components/DiscoFeed/DiscoFeedProduct.tsx
|
|
882
1123
|
function ProductTile({ targetUrl, trackClick, image, productName }) {
|
|
883
|
-
return /* @__PURE__ */ jsx("s-box", {
|
|
1124
|
+
return /* @__PURE__ */ jsx$1("s-box", {
|
|
884
1125
|
inlineSize: "100%",
|
|
885
1126
|
children: /* @__PURE__ */ jsxs("s-stack", {
|
|
886
1127
|
alignItems: "stretch",
|
|
887
1128
|
gap: "none",
|
|
888
|
-
children: [/* @__PURE__ */ jsx("s-link", {
|
|
1129
|
+
children: [/* @__PURE__ */ jsx$1("s-link", {
|
|
889
1130
|
target: "_blank",
|
|
890
1131
|
tone: "neutral",
|
|
891
1132
|
href: targetUrl,
|
|
892
1133
|
onClick: trackClick,
|
|
893
|
-
children: /* @__PURE__ */ jsx("s-box", {
|
|
1134
|
+
children: /* @__PURE__ */ jsx$1("s-box", {
|
|
894
1135
|
inlineSize: "100%",
|
|
895
|
-
children: /* @__PURE__ */ jsx("s-image", {
|
|
1136
|
+
children: /* @__PURE__ */ jsx$1("s-image", {
|
|
896
1137
|
aspectRatio: "1",
|
|
897
1138
|
src: image.src,
|
|
898
1139
|
srcSet: image.srcSet,
|
|
@@ -902,15 +1143,15 @@ function ProductTile({ targetUrl, trackClick, image, productName }) {
|
|
|
902
1143
|
borderRadius: "small"
|
|
903
1144
|
})
|
|
904
1145
|
})
|
|
905
|
-
}), /* @__PURE__ */ jsx("s-stack", {
|
|
1146
|
+
}), /* @__PURE__ */ jsx$1("s-stack", {
|
|
906
1147
|
maxBlockSize: "50px",
|
|
907
1148
|
maxInlineSize: "100%",
|
|
908
1149
|
padding: "small-400 none none none",
|
|
909
1150
|
overflow: "hidden",
|
|
910
|
-
children: /* @__PURE__ */ jsx("s-text", {
|
|
1151
|
+
children: /* @__PURE__ */ jsx$1("s-text", {
|
|
911
1152
|
type: "strong",
|
|
912
1153
|
color: "subdued",
|
|
913
|
-
children: /* @__PURE__ */ jsx("s-link", {
|
|
1154
|
+
children: /* @__PURE__ */ jsx$1("s-link", {
|
|
914
1155
|
target: "_blank",
|
|
915
1156
|
tone: "neutral",
|
|
916
1157
|
href: targetUrl,
|
|
@@ -927,7 +1168,7 @@ function ProductTile({ targetUrl, trackClick, image, productName }) {
|
|
|
927
1168
|
const PAGE_SIZE = 4;
|
|
928
1169
|
const PRODUCT_IMAGE_SOURCE_SIZE = 256;
|
|
929
1170
|
const RecommendationsOfferRow = ({ recommendations, padding }) => {
|
|
930
|
-
return /* @__PURE__ */ jsx(RecommendationsPager, {
|
|
1171
|
+
return /* @__PURE__ */ jsx$1(RecommendationsPager, {
|
|
931
1172
|
recommendations: recommendations.filter((recommendation) => recommendation.offer.assets.length > 0),
|
|
932
1173
|
padding
|
|
933
1174
|
});
|
|
@@ -941,16 +1182,16 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
941
1182
|
if (page !== currentPage) setPage(currentPage);
|
|
942
1183
|
}, [page, currentPage]);
|
|
943
1184
|
if (pageRecommendations.length === 0) return null;
|
|
944
|
-
return /* @__PURE__ */ jsx("s-box", {
|
|
1185
|
+
return /* @__PURE__ */ jsx$1("s-box", {
|
|
945
1186
|
padding,
|
|
946
1187
|
children: /* @__PURE__ */ jsxs("s-stack", {
|
|
947
1188
|
gap: "base",
|
|
948
|
-
children: [/* @__PURE__ */ jsx("s-grid", {
|
|
1189
|
+
children: [/* @__PURE__ */ jsx$1("s-grid", {
|
|
949
1190
|
gridTemplateColumns: "repeat(4, minmax(0, 1fr))",
|
|
950
1191
|
gap: "small-200",
|
|
951
|
-
children: pageRecommendations.map((recommendation) => /* @__PURE__ */ jsx("s-box", {
|
|
1192
|
+
children: pageRecommendations.map((recommendation) => /* @__PURE__ */ jsx$1("s-box", {
|
|
952
1193
|
inlineSize: "100%",
|
|
953
|
-
children: /* @__PURE__ */ jsx(RecommendationsOfferRowTile, { recommendation })
|
|
1194
|
+
children: /* @__PURE__ */ jsx$1(RecommendationsOfferRowTile, { recommendation })
|
|
954
1195
|
}, recommendation.id))
|
|
955
1196
|
}), pageCount > 1 && /* @__PURE__ */ jsxs("s-stack", {
|
|
956
1197
|
direction: "inline",
|
|
@@ -958,7 +1199,7 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
958
1199
|
alignItems: "center",
|
|
959
1200
|
gap: "small-200",
|
|
960
1201
|
children: [
|
|
961
|
-
/* @__PURE__ */ jsx("s-clickable", {
|
|
1202
|
+
/* @__PURE__ */ jsx$1("s-clickable", {
|
|
962
1203
|
accessibilityLabel: "Previous recommendations page",
|
|
963
1204
|
disabled: currentPage === 0,
|
|
964
1205
|
inlineSize: "32px",
|
|
@@ -966,11 +1207,11 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
966
1207
|
border: "base",
|
|
967
1208
|
borderRadius: "base",
|
|
968
1209
|
onClick: () => setPage(currentPage - 1),
|
|
969
|
-
children: /* @__PURE__ */ jsx("s-stack", {
|
|
1210
|
+
children: /* @__PURE__ */ jsx$1("s-stack", {
|
|
970
1211
|
blockSize: "100%",
|
|
971
1212
|
alignItems: "center",
|
|
972
1213
|
justifyContent: "center",
|
|
973
|
-
children: /* @__PURE__ */ jsx("s-icon", {
|
|
1214
|
+
children: /* @__PURE__ */ jsx$1("s-icon", {
|
|
974
1215
|
type: "chevron-left",
|
|
975
1216
|
size: "small",
|
|
976
1217
|
tone: currentPage === 0 ? "neutral" : "auto"
|
|
@@ -987,7 +1228,7 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
987
1228
|
pageCount
|
|
988
1229
|
]
|
|
989
1230
|
}),
|
|
990
|
-
/* @__PURE__ */ jsx("s-clickable", {
|
|
1231
|
+
/* @__PURE__ */ jsx$1("s-clickable", {
|
|
991
1232
|
accessibilityLabel: "Next recommendations page",
|
|
992
1233
|
disabled: currentPage === pageCount - 1,
|
|
993
1234
|
inlineSize: "32px",
|
|
@@ -995,11 +1236,11 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
995
1236
|
border: "base",
|
|
996
1237
|
borderRadius: "base",
|
|
997
1238
|
onClick: () => setPage(currentPage + 1),
|
|
998
|
-
children: /* @__PURE__ */ jsx("s-stack", {
|
|
1239
|
+
children: /* @__PURE__ */ jsx$1("s-stack", {
|
|
999
1240
|
blockSize: "100%",
|
|
1000
1241
|
alignItems: "center",
|
|
1001
1242
|
justifyContent: "center",
|
|
1002
|
-
children: /* @__PURE__ */ jsx("s-icon", {
|
|
1243
|
+
children: /* @__PURE__ */ jsx$1("s-icon", {
|
|
1003
1244
|
type: "chevron-right",
|
|
1004
1245
|
size: "small",
|
|
1005
1246
|
tone: currentPage === pageCount - 1 ? "neutral" : "auto"
|
|
@@ -1048,7 +1289,7 @@ function RecommendationsOfferRowTile({ recommendation }) {
|
|
|
1048
1289
|
const productName = `${recommendation.offer.heading} ${recommendation.offer.subheading}`;
|
|
1049
1290
|
const offerImageAsset = recommendation.offer.assets[0];
|
|
1050
1291
|
if (!offerImageAsset) return null;
|
|
1051
|
-
return /* @__PURE__ */ jsx(ProductTile, {
|
|
1292
|
+
return /* @__PURE__ */ jsx$1(ProductTile, {
|
|
1052
1293
|
targetUrl,
|
|
1053
1294
|
trackClick,
|
|
1054
1295
|
image: getImageSources(offerImageAsset.imageUrl, {
|
|
@@ -1071,32 +1312,32 @@ const EssentialRecommendationsWidget = ({ heroRecommendationGroup, scrollableRec
|
|
|
1071
1312
|
const hideOfferSlot = () => setShowOfferSlot(false);
|
|
1072
1313
|
const heading = applyCustomizationOrFallback("widget_bottom_slot_heading", "Trending brands we think you'll love");
|
|
1073
1314
|
if (!showOfferSlot && !scrollableRecommendationGroup) return null;
|
|
1074
|
-
return /* @__PURE__ */ jsx(ScrollableSlotProvider, {
|
|
1315
|
+
return /* @__PURE__ */ jsx$1(ScrollableSlotProvider, {
|
|
1075
1316
|
scrollableRecommendationGroup,
|
|
1076
1317
|
children: /* @__PURE__ */ jsxs(CardContainer, {
|
|
1077
1318
|
background: "base",
|
|
1078
1319
|
children: [
|
|
1079
|
-
showOfferSlot && heroRecommendationGroup ? /* @__PURE__ */ jsx("s-box", {
|
|
1320
|
+
showOfferSlot && heroRecommendationGroup ? /* @__PURE__ */ jsx$1("s-box", {
|
|
1080
1321
|
border: "base",
|
|
1081
1322
|
borderWidth: "none none base none",
|
|
1082
|
-
children: /* @__PURE__ */ jsx(HeroOfferProvider, {
|
|
1323
|
+
children: /* @__PURE__ */ jsx$1(HeroOfferProvider, {
|
|
1083
1324
|
recommendationGroup: heroRecommendationGroup,
|
|
1084
|
-
children: /* @__PURE__ */ jsx(TrackedEssentialLayout, { onLastOffer: hideOfferSlot })
|
|
1325
|
+
children: /* @__PURE__ */ jsx$1(TrackedEssentialLayout, { onLastOffer: hideOfferSlot })
|
|
1085
1326
|
})
|
|
1086
|
-
}) : /* @__PURE__ */ jsx("s-box", {
|
|
1327
|
+
}) : /* @__PURE__ */ jsx$1("s-box", {
|
|
1087
1328
|
padding: "base base none base",
|
|
1088
|
-
children: /* @__PURE__ */ jsx("s-heading", { children: heading })
|
|
1329
|
+
children: /* @__PURE__ */ jsx$1("s-heading", { children: heading })
|
|
1089
1330
|
}),
|
|
1090
|
-
scrollableRecommendationGroup && /* @__PURE__ */ jsx("s-box", {
|
|
1331
|
+
scrollableRecommendationGroup && /* @__PURE__ */ jsx$1("s-box", {
|
|
1091
1332
|
padding: "base none",
|
|
1092
1333
|
border: "base",
|
|
1093
1334
|
borderWidth: "none none base none",
|
|
1094
|
-
children: /* @__PURE__ */ jsx(RecommendationsOfferRow, {
|
|
1335
|
+
children: /* @__PURE__ */ jsx$1(RecommendationsOfferRow, {
|
|
1095
1336
|
recommendations: scrollableRecommendationGroup.recommendations,
|
|
1096
1337
|
padding: "none base"
|
|
1097
1338
|
})
|
|
1098
1339
|
}),
|
|
1099
|
-
/* @__PURE__ */ jsx(Footer, {})
|
|
1340
|
+
/* @__PURE__ */ jsx$1(Footer, {})
|
|
1100
1341
|
]
|
|
1101
1342
|
})
|
|
1102
1343
|
});
|
|
@@ -1121,7 +1362,7 @@ const TrackedEssentialLayout = ({ onLastOffer }) => {
|
|
|
1121
1362
|
offer.id,
|
|
1122
1363
|
advertiser.id
|
|
1123
1364
|
]);
|
|
1124
|
-
return /* @__PURE__ */ jsx(EssentialLayoutType, { onLastOffer });
|
|
1365
|
+
return /* @__PURE__ */ jsx$1(EssentialLayoutType, { onLastOffer });
|
|
1125
1366
|
};
|
|
1126
1367
|
//#endregion
|
|
1127
1368
|
//#region src/components/RecommendationsWidget/LeadGen/LeadGenHeader.tsx
|
|
@@ -1134,7 +1375,7 @@ const LeadGenHeader = () => {
|
|
|
1134
1375
|
return /* @__PURE__ */ jsxs("s-stack", {
|
|
1135
1376
|
gap: "none",
|
|
1136
1377
|
padding: "large-200",
|
|
1137
|
-
children: [/* @__PURE__ */ jsx("s-heading", { children: heading }), /* @__PURE__ */ jsx("s-text", {
|
|
1378
|
+
children: [/* @__PURE__ */ jsx$1("s-heading", { children: heading }), /* @__PURE__ */ jsx$1("s-text", {
|
|
1138
1379
|
color: "subdued",
|
|
1139
1380
|
children: subheading
|
|
1140
1381
|
})]
|
|
@@ -1148,7 +1389,7 @@ const LeadGenAssetTile = ({ asset }) => {
|
|
|
1148
1389
|
env,
|
|
1149
1390
|
size: 400
|
|
1150
1391
|
});
|
|
1151
|
-
return /* @__PURE__ */ jsx("s-image", {
|
|
1392
|
+
return /* @__PURE__ */ jsx$1("s-image", {
|
|
1152
1393
|
aspectRatio: "1",
|
|
1153
1394
|
src: image.src,
|
|
1154
1395
|
srcSet: image.srcSet,
|
|
@@ -1163,10 +1404,10 @@ const LeadGenBrandProducts = () => {
|
|
|
1163
1404
|
const { activeRecommendation } = useHeroOffer();
|
|
1164
1405
|
const assets = activeRecommendation.offer.assets.slice(0, 4);
|
|
1165
1406
|
if (assets.length === 0) return null;
|
|
1166
|
-
return /* @__PURE__ */ jsx("s-query-container", { children: /* @__PURE__ */ jsx("s-grid", {
|
|
1407
|
+
return /* @__PURE__ */ jsx$1("s-query-container", { children: /* @__PURE__ */ jsx$1("s-grid", {
|
|
1167
1408
|
gridTemplateColumns: "@container (inline-size > 450px) repeat(4, 1fr), repeat(3, 1fr)",
|
|
1168
1409
|
gap: "small-200",
|
|
1169
|
-
children: assets.map((asset) => /* @__PURE__ */ jsx(LeadGenAssetTile, { asset }, asset.id))
|
|
1410
|
+
children: assets.map((asset) => /* @__PURE__ */ jsx$1(LeadGenAssetTile, { asset }, asset.id))
|
|
1170
1411
|
}) });
|
|
1171
1412
|
};
|
|
1172
1413
|
const LeadGenBrand = () => {
|
|
@@ -1187,14 +1428,14 @@ const LeadGenBrand = () => {
|
|
|
1187
1428
|
alignItems: "start",
|
|
1188
1429
|
children: [/* @__PURE__ */ jsxs("s-stack", {
|
|
1189
1430
|
gap: "none",
|
|
1190
|
-
children: [/* @__PURE__ */ jsx("s-text", {
|
|
1431
|
+
children: [/* @__PURE__ */ jsx$1("s-text", {
|
|
1191
1432
|
type: "strong",
|
|
1192
1433
|
children: advertiser.name
|
|
1193
|
-
}), /* @__PURE__ */ jsx("s-paragraph", { children: advertiser.description })]
|
|
1194
|
-
}), /* @__PURE__ */ jsx("s-box", {
|
|
1434
|
+
}), /* @__PURE__ */ jsx$1("s-paragraph", { children: advertiser.description })]
|
|
1435
|
+
}), /* @__PURE__ */ jsx$1("s-box", {
|
|
1195
1436
|
inlineSize: `${logoSize}px`,
|
|
1196
1437
|
blockSize: `${logoSize}px`,
|
|
1197
|
-
children: /* @__PURE__ */ jsx("s-image", {
|
|
1438
|
+
children: /* @__PURE__ */ jsx$1("s-image", {
|
|
1198
1439
|
aspectRatio: "1",
|
|
1199
1440
|
src: logo.src,
|
|
1200
1441
|
srcSet: logo.srcSet,
|
|
@@ -1204,7 +1445,7 @@ const LeadGenBrand = () => {
|
|
|
1204
1445
|
borderRadius: "max"
|
|
1205
1446
|
})
|
|
1206
1447
|
})]
|
|
1207
|
-
}), /* @__PURE__ */ jsx(LeadGenBrandProducts, {})]
|
|
1448
|
+
}), /* @__PURE__ */ jsx$1(LeadGenBrandProducts, {})]
|
|
1208
1449
|
});
|
|
1209
1450
|
};
|
|
1210
1451
|
//#endregion
|
|
@@ -1357,7 +1598,7 @@ function LeadGenActionButton() {
|
|
|
1357
1598
|
if (payload.buyerEmail) sendOfferEmail();
|
|
1358
1599
|
handleOfferClaim();
|
|
1359
1600
|
};
|
|
1360
|
-
return /* @__PURE__ */ jsx("s-button", {
|
|
1601
|
+
return /* @__PURE__ */ jsx$1("s-button", {
|
|
1361
1602
|
href: activeRecommendation.offer.targetUrl,
|
|
1362
1603
|
target: "_blank",
|
|
1363
1604
|
inlineSize: "fill",
|
|
@@ -1383,13 +1624,13 @@ const LeadGenOfferRow = ({ recommendations }) => {
|
|
|
1383
1624
|
return /* @__PURE__ */ jsxs("s-stack", {
|
|
1384
1625
|
gap: "small-200",
|
|
1385
1626
|
padding: "base none",
|
|
1386
|
-
children: [/* @__PURE__ */ jsx("s-box", {
|
|
1627
|
+
children: [/* @__PURE__ */ jsx$1("s-box", {
|
|
1387
1628
|
padding: "none large-200",
|
|
1388
|
-
children: /* @__PURE__ */ jsx("s-text", {
|
|
1629
|
+
children: /* @__PURE__ */ jsx$1("s-text", {
|
|
1389
1630
|
type: "strong",
|
|
1390
1631
|
children: applyCustomizationOrFallback("widget_bottom_slot_heading", "Trending brands we think you'll love")
|
|
1391
1632
|
})
|
|
1392
|
-
}), /* @__PURE__ */ jsx(RecommendationsOfferRow, {
|
|
1633
|
+
}), /* @__PURE__ */ jsx$1(RecommendationsOfferRow, {
|
|
1393
1634
|
recommendations,
|
|
1394
1635
|
padding: "small-400 large-200"
|
|
1395
1636
|
})]
|
|
@@ -1410,22 +1651,22 @@ const LeadGen = ({ heroRecommendationGroup, scrollableRecommendationGroup }) =>
|
|
|
1410
1651
|
heroRecommendationGroup && /* @__PURE__ */ jsxs(HeroOfferProvider, {
|
|
1411
1652
|
recommendationGroup: heroRecommendationGroup,
|
|
1412
1653
|
children: [
|
|
1413
|
-
/* @__PURE__ */ jsx(LeadGenHeader, {}),
|
|
1414
|
-
/* @__PURE__ */ jsx("s-divider", {}),
|
|
1415
|
-
/* @__PURE__ */ jsx("s-box", {
|
|
1654
|
+
/* @__PURE__ */ jsx$1(LeadGenHeader, {}),
|
|
1655
|
+
/* @__PURE__ */ jsx$1("s-divider", {}),
|
|
1656
|
+
/* @__PURE__ */ jsx$1("s-box", {
|
|
1416
1657
|
minBlockSize: "230px",
|
|
1417
|
-
children: /* @__PURE__ */ jsx(LeadGenBrand, {})
|
|
1658
|
+
children: /* @__PURE__ */ jsx$1(LeadGenBrand, {})
|
|
1418
1659
|
}),
|
|
1419
1660
|
/* @__PURE__ */ jsxs("s-stack", {
|
|
1420
1661
|
padding: "none large-200 large-200 large-200",
|
|
1421
1662
|
gap: "base",
|
|
1422
|
-
children: [/* @__PURE__ */ jsx(LeadGenActionOffer, {}), /* @__PURE__ */ jsx(LeadGenActionNav, {})]
|
|
1663
|
+
children: [/* @__PURE__ */ jsx$1(LeadGenActionOffer, {}), /* @__PURE__ */ jsx$1(LeadGenActionNav, {})]
|
|
1423
1664
|
}),
|
|
1424
|
-
/* @__PURE__ */ jsx("s-divider", {})
|
|
1665
|
+
/* @__PURE__ */ jsx$1("s-divider", {})
|
|
1425
1666
|
]
|
|
1426
1667
|
}),
|
|
1427
|
-
scrollableRecommendationGroup && /* @__PURE__ */ jsx(LeadGenOfferRow, { recommendations: scrollableRecommendationGroup.recommendations }),
|
|
1428
|
-
/* @__PURE__ */ jsx(Footer, {})
|
|
1668
|
+
scrollableRecommendationGroup && /* @__PURE__ */ jsx$1(LeadGenOfferRow, { recommendations: scrollableRecommendationGroup.recommendations }),
|
|
1669
|
+
/* @__PURE__ */ jsx$1(Footer, {})
|
|
1429
1670
|
]
|
|
1430
1671
|
});
|
|
1431
1672
|
};
|
|
@@ -1433,7 +1674,7 @@ function LeadGenActionOffer() {
|
|
|
1433
1674
|
const { activeRecommendation, isOfferClaimed } = useHeroOffer();
|
|
1434
1675
|
const { heading, subheading, metadata } = activeRecommendation.offer;
|
|
1435
1676
|
const primaryHeading = isOfferClaimed ? `You've got ${heading}` : heading;
|
|
1436
|
-
const secondaryHeading = isOfferClaimed && metadata.type === "PROMO_CODE" ? /* @__PURE__ */ jsxs(Fragment, { children: ["Use code: ", /* @__PURE__ */ jsx("s-text", {
|
|
1677
|
+
const secondaryHeading = isOfferClaimed && metadata.type === "PROMO_CODE" ? /* @__PURE__ */ jsxs(Fragment, { children: ["Use code: ", /* @__PURE__ */ jsx$1("s-text", {
|
|
1437
1678
|
type: "strong",
|
|
1438
1679
|
children: metadata.code
|
|
1439
1680
|
})] }) : subheading || "On your next purchase";
|
|
@@ -1445,8 +1686,8 @@ function LeadGenActionOffer() {
|
|
|
1445
1686
|
gap: "base",
|
|
1446
1687
|
children: [/* @__PURE__ */ jsxs("s-stack", {
|
|
1447
1688
|
gap: "none",
|
|
1448
|
-
children: [/* @__PURE__ */ jsx("s-heading", { children: primaryHeading }), /* @__PURE__ */ jsx("s-text", { children: secondaryHeading })]
|
|
1449
|
-
}), /* @__PURE__ */ jsx(LeadGenActionButton, {})]
|
|
1689
|
+
children: [/* @__PURE__ */ jsx$1("s-heading", { children: primaryHeading }), /* @__PURE__ */ jsx$1("s-text", { children: secondaryHeading })]
|
|
1690
|
+
}), /* @__PURE__ */ jsx$1(LeadGenActionButton, {})]
|
|
1450
1691
|
});
|
|
1451
1692
|
}
|
|
1452
1693
|
function LeadGenActionNav() {
|
|
@@ -1482,13 +1723,13 @@ function LeadGenActionNav() {
|
|
|
1482
1723
|
gridTemplateColumns: hasSingleButton ? "1fr" : "1fr 11px 1fr",
|
|
1483
1724
|
gap: "base",
|
|
1484
1725
|
children: [
|
|
1485
|
-
showPrevious && /* @__PURE__ */ jsx("s-button", {
|
|
1726
|
+
showPrevious && /* @__PURE__ */ jsx$1("s-button", {
|
|
1486
1727
|
variant: !isOfferClaimed || showNext ? "secondary" : "primary",
|
|
1487
1728
|
onClick: handlePrevious,
|
|
1488
1729
|
children: applyCustomizationOrFallback("widget_nav_backward_cta_text", "Previous offer")
|
|
1489
1730
|
}),
|
|
1490
|
-
!hasSingleButton && /* @__PURE__ */ jsx("s-box", {}),
|
|
1491
|
-
showNext && /* @__PURE__ */ jsx("s-button", {
|
|
1731
|
+
!hasSingleButton && /* @__PURE__ */ jsx$1("s-box", {}),
|
|
1732
|
+
showNext && /* @__PURE__ */ jsx$1("s-button", {
|
|
1492
1733
|
variant: isOfferClaimed ? "primary" : "secondary",
|
|
1493
1734
|
onClick: handleNext,
|
|
1494
1735
|
children: applyCustomizationOrFallback("widget_nav_forward_cta_text", showPrevious ? "Next offer" : "No thanks")
|
|
@@ -1505,15 +1746,15 @@ const Widget = () => {
|
|
|
1505
1746
|
const scrollableRecommendationGroup = recommendationsData.recommendationGroups.find((group) => group.slotContext === "SCROLLABLE");
|
|
1506
1747
|
if (!heroRecommendationGroup && !scrollableRecommendationGroup) return null;
|
|
1507
1748
|
const layoutId = recommendationsData.layoutId;
|
|
1508
|
-
if (ESSENTIAL_LAYOUT_IDS.includes(layoutId)) return /* @__PURE__ */ jsx(EssentialRecommendationsWidget, {
|
|
1749
|
+
if (ESSENTIAL_LAYOUT_IDS.includes(layoutId)) return /* @__PURE__ */ jsx$1(EssentialRecommendationsWidget, {
|
|
1509
1750
|
heroRecommendationGroup,
|
|
1510
1751
|
scrollableRecommendationGroup
|
|
1511
1752
|
});
|
|
1512
1753
|
if (layoutId === "SHOPIFY_NATIVE_COVER") {
|
|
1513
1754
|
if (!heroRecommendationGroup) return null;
|
|
1514
|
-
return /* @__PURE__ */ jsx(CoverRecommendationsWidget, { heroRecommendationGroup });
|
|
1755
|
+
return /* @__PURE__ */ jsx$1(CoverRecommendationsWidget, { heroRecommendationGroup });
|
|
1515
1756
|
}
|
|
1516
|
-
return /* @__PURE__ */ jsx(LeadGen, {
|
|
1757
|
+
return /* @__PURE__ */ jsx$1(LeadGen, {
|
|
1517
1758
|
heroRecommendationGroup,
|
|
1518
1759
|
scrollableRecommendationGroup
|
|
1519
1760
|
});
|
|
@@ -1528,19 +1769,19 @@ const Widget = () => {
|
|
|
1528
1769
|
* details are read from that target's API.
|
|
1529
1770
|
*/
|
|
1530
1771
|
function DiscoRecommendations({ apiKey }) {
|
|
1531
|
-
return /* @__PURE__ */ jsx(Recommendations, { auth: { apiKey } });
|
|
1772
|
+
return /* @__PURE__ */ jsx$1(Recommendations, { auth: { apiKey } });
|
|
1532
1773
|
}
|
|
1533
1774
|
/**
|
|
1534
1775
|
* The widget tree shared by the public (`apiKey`) and internal (`shop_gid`)
|
|
1535
1776
|
* entry points.
|
|
1536
1777
|
*/
|
|
1537
1778
|
function Recommendations({ auth }) {
|
|
1538
|
-
return /* @__PURE__ */ jsx(PayloadManager, { children: /* @__PURE__ */ jsx(DataManager, {
|
|
1779
|
+
return /* @__PURE__ */ jsx$1(PayloadManager, { children: /* @__PURE__ */ jsx$1(DataManager, {
|
|
1539
1780
|
auth,
|
|
1540
|
-
children: /* @__PURE__ */ jsx(UserManager, { children: /* @__PURE__ */ jsx(Widget, {}) })
|
|
1781
|
+
children: /* @__PURE__ */ jsx$1(UserManager, { children: /* @__PURE__ */ jsx$1(Widget, {}) })
|
|
1541
1782
|
}) });
|
|
1542
1783
|
}
|
|
1543
1784
|
//#endregion
|
|
1544
1785
|
export { Recommendations as n, DiscoRecommendations as t };
|
|
1545
1786
|
|
|
1546
|
-
//# sourceMappingURL=DiscoRecommendations-
|
|
1787
|
+
//# sourceMappingURL=DiscoRecommendations-BeqZ2x4q.js.map
|