@simpleapps-com/augur-utils 2026.11.3 → 2026.11.5
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/EXPORTS.md +15 -4
- package/README.md +31 -2
- package/dist/address-id.d.ts +41 -0
- package/dist/address-id.d.ts.map +1 -0
- package/dist/analytics.d.ts +8 -3
- package/dist/analytics.d.ts.map +1 -1
- package/dist/build-checkout-payload.d.ts +9 -3
- package/dist/build-checkout-payload.d.ts.map +1 -1
- package/dist/cart-line-rules.d.ts +43 -0
- package/dist/cart-line-rules.d.ts.map +1 -0
- package/dist/date-helpers.d.ts.map +1 -1
- package/dist/image-rules.d.ts +72 -10
- package/dist/image-rules.d.ts.map +1 -1
- package/dist/image.d.ts +22 -7
- package/dist/image.d.ts.map +1 -1
- package/dist/index.cjs +228 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +222 -48
- package/dist/index.js.map +1 -1
- package/dist/rules.d.ts +14 -0
- package/dist/rules.d.ts.map +1 -1
- package/dist/transform-ship-to-address.d.ts.map +1 -1
- package/llms.txt +16 -3
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -92,6 +92,14 @@ function availabilityOf(isInStock, isDiscontinued) {
|
|
|
92
92
|
if (isDiscontinued) return "OutOfStock";
|
|
93
93
|
return "BackOrder";
|
|
94
94
|
}
|
|
95
|
+
function presentIndexFrom(present, i) {
|
|
96
|
+
if (i === present.length) return -1;
|
|
97
|
+
if (present[i] === true) return i;
|
|
98
|
+
return presentIndexFrom(present, i + 1);
|
|
99
|
+
}
|
|
100
|
+
function leadDateText(from, hasTo, to) {
|
|
101
|
+
return hasTo ? from + " - " + to : from;
|
|
102
|
+
}
|
|
95
103
|
function takerOf(taker) {
|
|
96
104
|
return _nullishCoalesce(taker, () => ( "ESTORE"));
|
|
97
105
|
}
|
|
@@ -191,11 +199,12 @@ function getPaymentStatus(invoice) {
|
|
|
191
199
|
function str(value) {
|
|
192
200
|
return String(value).trim();
|
|
193
201
|
}
|
|
202
|
+
function presence(raw, keys) {
|
|
203
|
+
return keys.map((k) => raw[k] != null);
|
|
204
|
+
}
|
|
194
205
|
function firstPresent(raw, keys) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
return "";
|
|
206
|
+
const index = presentIndexFrom(presence(raw, keys), 0);
|
|
207
|
+
return index < 0 ? "" : raw[keys[index]];
|
|
199
208
|
}
|
|
200
209
|
function pick(raw, keys) {
|
|
201
210
|
return str(firstPresent(raw, keys));
|
|
@@ -225,7 +234,7 @@ var MAIL_FIELDS = {
|
|
|
225
234
|
country: ["mailCountry", "mail_country", "country"]
|
|
226
235
|
};
|
|
227
236
|
function transformShipToAddress(raw) {
|
|
228
|
-
const isPhys =
|
|
237
|
+
const isPhys = presentIndexFrom(presence(raw, PHYS_MARKERS), 0) >= 0;
|
|
229
238
|
const f = isPhys ? PHYS_FIELDS : MAIL_FIELDS;
|
|
230
239
|
const address = {
|
|
231
240
|
shipToId: firstPresent(raw, ["shipToId", "ship_to_id", "id"]),
|
|
@@ -242,6 +251,114 @@ function transformShipToAddress(raw) {
|
|
|
242
251
|
return address;
|
|
243
252
|
}
|
|
244
253
|
|
|
254
|
+
// ../foundation/src/chars.ts
|
|
255
|
+
function isDigit(c) {
|
|
256
|
+
return c >= 48 && c <= 57;
|
|
257
|
+
}
|
|
258
|
+
function lowerCode(c) {
|
|
259
|
+
return c >= 65 && c <= 90 ? c + 32 : c;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// ../utils/src/strings.ts
|
|
263
|
+
function codeAt(s, i) {
|
|
264
|
+
return i >= 0 && i < s.length ? s.charCodeAt(i) : -1;
|
|
265
|
+
}
|
|
266
|
+
function indexOfCode(s, code, from) {
|
|
267
|
+
const c = codeAt(s, from);
|
|
268
|
+
if (c === code) return from;
|
|
269
|
+
if (c === -1) return -1;
|
|
270
|
+
return indexOfCode(s, code, from + 1);
|
|
271
|
+
}
|
|
272
|
+
function startsWithAt(s, x, pos) {
|
|
273
|
+
const at = Math.min(pos, s.length);
|
|
274
|
+
return s.slice(at, Math.min(at + x.length, s.length)) === x;
|
|
275
|
+
}
|
|
276
|
+
function lowerAscii(s) {
|
|
277
|
+
if (s.length === 0) return "";
|
|
278
|
+
const c = s.charCodeAt(0);
|
|
279
|
+
const head = c >= 65 && c <= 90 ? "abcdefghijklmnopqrstuvwxyz".slice(c - 65, c - 64) : s.slice(0, 1);
|
|
280
|
+
return head + lowerAscii(s.slice(1));
|
|
281
|
+
}
|
|
282
|
+
function caselessFrom(s, x, pos, k) {
|
|
283
|
+
if (k === x.length) return true;
|
|
284
|
+
return lowerCode(codeAt(s, pos + k)) === x.charCodeAt(k) && caselessFrom(s, x, pos, k + 1);
|
|
285
|
+
}
|
|
286
|
+
function startsWithCaseless(s, x, pos) {
|
|
287
|
+
return pos <= s.length && caselessFrom(s, x, pos, 0);
|
|
288
|
+
}
|
|
289
|
+
function digitsValue(s) {
|
|
290
|
+
if (s.length === 0) return 0;
|
|
291
|
+
return digitsValue(s.slice(0, s.length - 1)) * 10 + (s.charCodeAt(s.length - 1) - 48);
|
|
292
|
+
}
|
|
293
|
+
function isBlank(s) {
|
|
294
|
+
return s.trim() === "";
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// src/cart-line-rules.ts
|
|
298
|
+
function lineHasQuantity(quantity) {
|
|
299
|
+
return quantity !== null;
|
|
300
|
+
}
|
|
301
|
+
function priceQueryRuns(hasCustomer, hasItemId, quantity) {
|
|
302
|
+
return hasCustomer && hasItemId && lineHasQuantity(quantity);
|
|
303
|
+
}
|
|
304
|
+
function priceQueryUnit(unitOfMeasure) {
|
|
305
|
+
return unitOfMeasure !== null && !isBlank(unitOfMeasure) ? unitOfMeasure : null;
|
|
306
|
+
}
|
|
307
|
+
function pricingSettledFrom(succeeded, runs, i) {
|
|
308
|
+
if (i === succeeded.length) return true;
|
|
309
|
+
if (runs[i] === true && succeeded[i] !== true) return false;
|
|
310
|
+
return pricingSettledFrom(succeeded, runs, i + 1);
|
|
311
|
+
}
|
|
312
|
+
function pricingLoadingFrom(loading, runs, i) {
|
|
313
|
+
if (i === loading.length) return false;
|
|
314
|
+
if (runs[i] === true && loading[i] === true) return true;
|
|
315
|
+
return pricingLoadingFrom(loading, runs, i + 1);
|
|
316
|
+
}
|
|
317
|
+
function linePriceAt(unitPrices, i) {
|
|
318
|
+
return i < unitPrices.length ? unitPrices[i] : 0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// ../foundation/src/pos-digits.ts
|
|
322
|
+
function posDigitsFrom(s, i, nonZero) {
|
|
323
|
+
if (i === s.length) return nonZero;
|
|
324
|
+
const c = s.charCodeAt(i);
|
|
325
|
+
if (!isDigit(c)) return false;
|
|
326
|
+
return posDigitsFrom(s, i + 1, nonZero || c !== 48);
|
|
327
|
+
}
|
|
328
|
+
function isPosDigits(s) {
|
|
329
|
+
return posDigitsFrom(s, 0, false);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// ../foundation/src/pos-int.ts
|
|
333
|
+
function posIntOf(n) {
|
|
334
|
+
return Math.floor(n) === n && n >= 1 && n <= 9007199254740991 ? n : null;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// src/address-id.ts
|
|
338
|
+
function addressIdOfText(s) {
|
|
339
|
+
const t = s.trim();
|
|
340
|
+
if (!isPosDigits(t)) return null;
|
|
341
|
+
const v2 = digitsValue(t);
|
|
342
|
+
return v2 >= 1 && v2 <= 9007199254740991 ? v2 : null;
|
|
343
|
+
}
|
|
344
|
+
function firstAddressIdFrom(ids, i) {
|
|
345
|
+
if (i === ids.length) return null;
|
|
346
|
+
const id = ids[i];
|
|
347
|
+
if (id !== null) return id;
|
|
348
|
+
return firstAddressIdFrom(ids, i + 1);
|
|
349
|
+
}
|
|
350
|
+
function addressIdOf(value) {
|
|
351
|
+
if (typeof value === "number") return posIntOf(value);
|
|
352
|
+
if (typeof value === "string") return addressIdOfText(value);
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
function isUsableAddressId(value) {
|
|
356
|
+
return addressIdOf(value) !== null;
|
|
357
|
+
}
|
|
358
|
+
function resolveAddressId(...candidates) {
|
|
359
|
+
return firstAddressIdFrom(candidates.map(addressIdOf), 0);
|
|
360
|
+
}
|
|
361
|
+
|
|
245
362
|
// src/build-checkout-payload.ts
|
|
246
363
|
function buildCheckoutPayload(input) {
|
|
247
364
|
const oe_hdr = {
|
|
@@ -376,21 +493,6 @@ var SCHEMA_URLS = {
|
|
|
376
493
|
BackOrder: "https://schema.org/BackOrder"
|
|
377
494
|
};
|
|
378
495
|
|
|
379
|
-
// ../utils/src/strings.ts
|
|
380
|
-
function codeAt(s, i) {
|
|
381
|
-
return i >= 0 && i < s.length ? s.charCodeAt(i) : -1;
|
|
382
|
-
}
|
|
383
|
-
function indexOfCode(s, code, from) {
|
|
384
|
-
const c = codeAt(s, from);
|
|
385
|
-
if (c === code) return from;
|
|
386
|
-
if (c === -1) return -1;
|
|
387
|
-
return indexOfCode(s, code, from + 1);
|
|
388
|
-
}
|
|
389
|
-
function startsWithAt(s, x, pos) {
|
|
390
|
-
const at = Math.min(pos, s.length);
|
|
391
|
-
return s.slice(at, Math.min(at + x.length, s.length)) === x;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
496
|
// ../utils/src/lists.ts
|
|
395
497
|
function joinFrom(xs, sep, i) {
|
|
396
498
|
if (i >= xs.length) return "";
|
|
@@ -760,7 +862,8 @@ function serializedTransforms(fields, present, texts) {
|
|
|
760
862
|
return joinFrom(transformPartsFrom(fields, present, texts, 0), ",", 0);
|
|
761
863
|
}
|
|
762
864
|
function isExternal(path) {
|
|
763
|
-
|
|
865
|
+
if (startsWithCaseless(path, "https://", 0)) return true;
|
|
866
|
+
return startsWithAt(path, "//", 0);
|
|
764
867
|
}
|
|
765
868
|
function stripFirstPrefixFrom(path, prefixes, i) {
|
|
766
869
|
if (i >= prefixes.length) return path;
|
|
@@ -772,27 +875,85 @@ function stripLeadingSlashes(s) {
|
|
|
772
875
|
if (codeAt(s, 0) !== 47) return s;
|
|
773
876
|
return stripLeadingSlashes(s.slice(1));
|
|
774
877
|
}
|
|
775
|
-
function
|
|
776
|
-
if (isExternal(raw)) return raw;
|
|
878
|
+
function localPath(raw, prefixes, defaultPath) {
|
|
777
879
|
const cleaned = stripLeadingSlashes(stripFirstPrefixFrom(raw, prefixes, 0));
|
|
778
880
|
if (defaultPath !== "" && indexOfCode(cleaned, 47, 0) < 0) return defaultPath + "/" + cleaned;
|
|
779
881
|
return cleaned;
|
|
780
882
|
}
|
|
883
|
+
function isInsecure(s) {
|
|
884
|
+
return startsWithCaseless(s, "http://", 0);
|
|
885
|
+
}
|
|
886
|
+
function schemeEnd(raw) {
|
|
887
|
+
if (startsWithCaseless(raw, "https://", 0)) return 8;
|
|
888
|
+
return startsWithAt(raw, "//", 0) ? 2 : 0;
|
|
889
|
+
}
|
|
890
|
+
function slashAt(o) {
|
|
891
|
+
const k = indexOfCode(o, 47, 0);
|
|
892
|
+
return k < 0 ? o.length : k;
|
|
893
|
+
}
|
|
894
|
+
function ownOriginAt(raw, o, at) {
|
|
895
|
+
const cut = slashAt(o);
|
|
896
|
+
if (cut === 0) return false;
|
|
897
|
+
if (!startsWithCaseless(raw, lowerAscii(o.slice(0, cut)), at)) return false;
|
|
898
|
+
if (!startsWithAt(raw, o.slice(cut), at + cut)) return false;
|
|
899
|
+
return codeAt(raw, at + o.length) === 47;
|
|
900
|
+
}
|
|
901
|
+
function ownOriginRestFrom(raw, origins, i) {
|
|
902
|
+
const at = schemeEnd(raw);
|
|
903
|
+
if (at === 0 || i >= origins.length) return null;
|
|
904
|
+
const o = origins[i];
|
|
905
|
+
if (ownOriginAt(raw, o, at)) {
|
|
906
|
+
const path = stripLeadingSlashes(raw.slice(at + o.length));
|
|
907
|
+
return path === "" ? null : path;
|
|
908
|
+
}
|
|
909
|
+
return ownOriginRestFrom(raw, origins, i + 1);
|
|
910
|
+
}
|
|
911
|
+
function defaultOwnOrigins(clientDomain) {
|
|
912
|
+
return ["images." + clientDomain, "www." + clientDomain + "/images", clientDomain + "/images"];
|
|
913
|
+
}
|
|
914
|
+
function normalizedPath(raw, prefixes, origins, defaultPath) {
|
|
915
|
+
if (isInsecure(raw)) return "";
|
|
916
|
+
const own = ownOriginRestFrom(raw, origins, 0);
|
|
917
|
+
if (own !== null) return own;
|
|
918
|
+
if (isExternal(raw)) return raw;
|
|
919
|
+
const local = localPath(raw, prefixes, defaultPath);
|
|
920
|
+
return isInsecure(local) ? "" : local;
|
|
921
|
+
}
|
|
781
922
|
function cdnUrlOf(clientDomain, serialized, normalized) {
|
|
782
923
|
const segment = serialized !== "" ? "/" + serialized : "";
|
|
783
924
|
return "https://agr.media/" + clientDomain + "/images" + segment + "/" + normalized;
|
|
784
925
|
}
|
|
785
|
-
function
|
|
786
|
-
if (
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
return "
|
|
790
|
-
}
|
|
791
|
-
function
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
926
|
+
function srcSetPartsFrom(urls, widths, i) {
|
|
927
|
+
if (i >= urls.length) return [];
|
|
928
|
+
const url = urls[i];
|
|
929
|
+
const rest = srcSetPartsFrom(urls, widths, i + 1);
|
|
930
|
+
return url === "" ? rest : [url + " " + widths[i] + "w", ...rest];
|
|
931
|
+
}
|
|
932
|
+
function srcSetOf(urls, widths) {
|
|
933
|
+
return joinFrom(srcSetPartsFrom(urls, widths, 0), ", ", 0);
|
|
934
|
+
}
|
|
935
|
+
function defaultImageUrlOf(clientDomain, fallback, prefixes, origins, defaultPath) {
|
|
936
|
+
if (fallback === "" || isInsecure(fallback)) return "";
|
|
937
|
+
const own = ownOriginRestFrom(fallback, origins, 0);
|
|
938
|
+
if (own !== null) return "https://agr.media/" + clientDomain + "/images/" + own;
|
|
939
|
+
if (isExternal(fallback)) return fallback;
|
|
940
|
+
const local = localPath(fallback, prefixes, defaultPath);
|
|
941
|
+
if (isInsecure(local)) return "";
|
|
942
|
+
if (isExternal(local)) return local;
|
|
943
|
+
return "https://agr.media/" + clientDomain + "/images/" + local;
|
|
944
|
+
}
|
|
945
|
+
function imageUrlOf(clientDomain, path, serialized, fallback, prefixes, origins, defaultPath) {
|
|
946
|
+
if (path === "" || isInsecure(path)) {
|
|
947
|
+
return defaultImageUrlOf(clientDomain, fallback, prefixes, origins, defaultPath);
|
|
948
|
+
}
|
|
949
|
+
const own = ownOriginRestFrom(path, origins, 0);
|
|
950
|
+
if (own !== null) return cdnUrlOf(clientDomain, serialized, own);
|
|
951
|
+
if (isExternal(path)) return path;
|
|
952
|
+
const local = localPath(path, prefixes, defaultPath);
|
|
953
|
+
if (isInsecure(local))
|
|
954
|
+
return defaultImageUrlOf(clientDomain, fallback, prefixes, origins, defaultPath);
|
|
955
|
+
if (isExternal(local)) return local;
|
|
956
|
+
return cdnUrlOf(clientDomain, serialized, local);
|
|
796
957
|
}
|
|
797
958
|
|
|
798
959
|
// src/image.ts
|
|
@@ -804,7 +965,8 @@ function createImageConfig(clientDomain, opts) {
|
|
|
804
965
|
defaultImage: _optionalChain([opts, 'optionalAccess', _29 => _29.defaultImage]),
|
|
805
966
|
defaultTransforms: _optionalChain([opts, 'optionalAccess', _30 => _30.defaultTransforms]),
|
|
806
967
|
stripPrefixes: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _31 => _31.stripPrefixes]), () => ( DEFAULT_STRIP_PREFIXES)),
|
|
807
|
-
defaultPath: _optionalChain([opts, 'optionalAccess', _32 => _32.defaultPath])
|
|
968
|
+
defaultPath: _optionalChain([opts, 'optionalAccess', _32 => _32.defaultPath]),
|
|
969
|
+
ownOrigins: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _33 => _33.ownOrigins]), () => ( defaultOwnOrigins(clientDomain)))
|
|
808
970
|
});
|
|
809
971
|
}
|
|
810
972
|
function serializeTransforms(transforms) {
|
|
@@ -816,11 +978,14 @@ function serializeTransforms(transforms) {
|
|
|
816
978
|
);
|
|
817
979
|
}
|
|
818
980
|
function normalizePath(config, raw) {
|
|
819
|
-
return normalizedPath(raw, prefixesOf(config), _nullishCoalesce(config.defaultPath, () => ( "")));
|
|
981
|
+
return normalizedPath(raw, prefixesOf(config), originsOf(config), _nullishCoalesce(config.defaultPath, () => ( "")));
|
|
820
982
|
}
|
|
821
983
|
function prefixesOf(config) {
|
|
822
984
|
return _nullishCoalesce(config.stripPrefixes, () => ( DEFAULT_STRIP_PREFIXES));
|
|
823
985
|
}
|
|
986
|
+
function originsOf(config) {
|
|
987
|
+
return _nullishCoalesce(config.ownOrigins, () => ( defaultOwnOrigins(config.clientDomain)));
|
|
988
|
+
}
|
|
824
989
|
function getImageUrl(config, imagePath, transforms, options) {
|
|
825
990
|
const merged = {
|
|
826
991
|
...config.defaultTransforms,
|
|
@@ -828,10 +993,11 @@ function getImageUrl(config, imagePath, transforms, options) {
|
|
|
828
993
|
};
|
|
829
994
|
return imageUrlOf(
|
|
830
995
|
config.clientDomain,
|
|
831
|
-
_nullishCoalesce(_optionalChain([imagePath, 'optionalAccess',
|
|
996
|
+
_nullishCoalesce(_optionalChain([imagePath, 'optionalAccess', _34 => _34.trim, 'call', _35 => _35()]), () => ( "")),
|
|
832
997
|
serializeTransforms(merged),
|
|
833
998
|
fallbackOf(config, options),
|
|
834
999
|
prefixesOf(config),
|
|
1000
|
+
originsOf(config),
|
|
835
1001
|
_nullishCoalesce(config.defaultPath, () => ( ""))
|
|
836
1002
|
);
|
|
837
1003
|
}
|
|
@@ -840,17 +1006,18 @@ function getDefaultImageUrl(config, options) {
|
|
|
840
1006
|
config.clientDomain,
|
|
841
1007
|
fallbackOf(config, options),
|
|
842
1008
|
prefixesOf(config),
|
|
1009
|
+
originsOf(config),
|
|
843
1010
|
_nullishCoalesce(config.defaultPath, () => ( ""))
|
|
844
1011
|
);
|
|
845
1012
|
}
|
|
846
1013
|
function fallbackOf(config, options) {
|
|
847
|
-
return _nullishCoalesce(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1014
|
+
return _nullishCoalesce(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _36 => _36.defaultImage]), () => ( config.defaultImage)), () => ( ""));
|
|
848
1015
|
}
|
|
849
1016
|
function getImageSrcSet(config, imagePath, widths, transforms) {
|
|
850
|
-
return
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
1017
|
+
return srcSetOf(
|
|
1018
|
+
widths.map((width) => getImageUrl(config, imagePath, { ...transforms, width })),
|
|
1019
|
+
widths.map(String)
|
|
1020
|
+
);
|
|
854
1021
|
}
|
|
855
1022
|
function buildImageLoader(config, transforms) {
|
|
856
1023
|
return ({ src, width, quality }) => {
|
|
@@ -1015,12 +1182,8 @@ function getBusinessDay(businessDaysFromNow) {
|
|
|
1015
1182
|
function getShippingLeadDate(days3) {
|
|
1016
1183
|
const config = shippingLeadOf(days3);
|
|
1017
1184
|
if (!config) return "";
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
const toDate = getBusinessDay(config.to);
|
|
1021
|
-
return `${fromDate} - ${toDate}`;
|
|
1022
|
-
}
|
|
1023
|
-
return fromDate;
|
|
1185
|
+
const hasTo = config.to !== 0;
|
|
1186
|
+
return leadDateText(getBusinessDay(config.from), hasTo, hasTo ? getBusinessDay(config.to) : "");
|
|
1024
1187
|
}
|
|
1025
1188
|
|
|
1026
1189
|
// src/transforms.ts
|
|
@@ -1048,7 +1211,7 @@ function serializeSearchParams(filters, options) {
|
|
|
1048
1211
|
from: filters.offset,
|
|
1049
1212
|
sortBy: searchSortBy(filters.sortBy),
|
|
1050
1213
|
classId5List: categoryUid ? String(categoryUid) : void 0,
|
|
1051
|
-
filters: _optionalChain([filters, 'access',
|
|
1214
|
+
filters: _optionalChain([filters, 'access', _37 => _37.filters, 'optionalAccess', _38 => _38.length]) ? JSON.stringify(filters.filters) : void 0,
|
|
1052
1215
|
sourceFieldsList: sourceFields
|
|
1053
1216
|
};
|
|
1054
1217
|
}
|
|
@@ -1114,20 +1277,20 @@ function trackViewItem({
|
|
|
1114
1277
|
function buildTrackingData({
|
|
1115
1278
|
cartLines,
|
|
1116
1279
|
itemDetails,
|
|
1117
|
-
|
|
1280
|
+
getLineUnitPrice,
|
|
1118
1281
|
currency = "USD"
|
|
1119
1282
|
}) {
|
|
1120
1283
|
let total = 0;
|
|
1121
1284
|
const items = cartLines.map((line, index) => {
|
|
1122
1285
|
const details = itemDetails[line.itemId];
|
|
1123
|
-
const price =
|
|
1286
|
+
const price = getLineUnitPrice(index);
|
|
1124
1287
|
total = cleanMoney(total + cleanMoney(price * line.quantity));
|
|
1125
1288
|
return {
|
|
1126
1289
|
item_id: line.itemId,
|
|
1127
|
-
item_name: _nullishCoalesce(_optionalChain([details, 'optionalAccess',
|
|
1290
|
+
item_name: _nullishCoalesce(_optionalChain([details, 'optionalAccess', _39 => _39.itemDesc]), () => ( "")),
|
|
1128
1291
|
currency,
|
|
1129
1292
|
index,
|
|
1130
|
-
item_category: _nullishCoalesce(_optionalChain([details, 'optionalAccess',
|
|
1293
|
+
item_category: _nullishCoalesce(_optionalChain([details, 'optionalAccess', _40 => _40.classId5]), () => ( "")),
|
|
1131
1294
|
price,
|
|
1132
1295
|
quantity: line.quantity
|
|
1133
1296
|
};
|
|
@@ -1217,5 +1380,16 @@ function pushTrackingData(data) {
|
|
|
1217
1380
|
|
|
1218
1381
|
|
|
1219
1382
|
|
|
1220
|
-
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
exports.BLUR_DATA_URL = BLUR_DATA_URL; exports.BillingAddressInvoiceSchema = BillingAddressInvoiceSchema; exports.BillingAddressSchema = BillingAddressSchema; exports.CACHE_CONFIG = CACHE_CONFIG; exports.CONTIGUOUS_STATES = CONTIGUOUS_STATES; exports.ShippingAddressSchema = ShippingAddressSchema; exports.US_STATES = US_STATES; exports.US_STATES_FULL = US_STATES_FULL; exports.US_TERRITORIES = US_TERRITORIES; exports.VALIDATION_PATTERNS = VALIDATION_PATTERNS; exports.addMillis = addMillis2; exports.addressIdOf = addressIdOf; exports.addressIdOfText = addressIdOfText; exports.breadcrumbLd = breadcrumbLd2; exports.buildCheckoutPayload = buildCheckoutPayload; exports.buildImageLoader = buildImageLoader; exports.buildTrackingData = buildTrackingData; exports.categorySortBy = categorySortBy; exports.cleanMoney = cleanMoney; exports.cn = _chunk5UMFBGVAcjs.cn; exports.createImageConfig = createImageConfig; exports.days = days2; exports.derivePrice = derivePrice; exports.faqLd = faqLd2; exports.firstAddressIdFrom = firstAddressIdFrom; exports.floorSeconds = floorSeconds2; exports.formatPrice = formatPrice; exports.generateBreadcrumbJsonLd = generateBreadcrumbJsonLd; exports.generateProductJsonLd = generateProductJsonLd; exports.getBusinessDay = getBusinessDay; exports.getDefaultImageUrl = getDefaultImageUrl; exports.getImageSrcSet = getImageSrcSet; exports.getImageUrl = getImageUrl; exports.getPaymentStatus = getPaymentStatus; exports.getSchemaAvailability = getSchemaAvailability; exports.getShippingLeadDate = getShippingLeadDate; exports.hasPriceBreaks = hasPriceBreaks; exports.hours = hours2; exports.idRef = idRef2; exports.isAddressDifferent = isAddressDifferent; exports.isServerRuntime = isServerRuntime; exports.isUsableAddressId = isUsableAddressId; exports.lineHasQuantity = lineHasQuantity; exports.linePriceAt = linePriceAt; exports.millis = millis2; exports.millisOf = millisOf2; exports.minusMillis = minusMillis2; exports.minutes = minutes2; exports.nodeHead = nodeHead2; exports.normalizePath = normalizePath; exports.paginateOffset = paginateOffset; exports.priceQueryRuns = priceQueryRuns; exports.priceQueryUnit = priceQueryUnit; exports.pricingLoadingFrom = pricingLoadingFrom; exports.pricingSettledFrom = pricingSettledFrom; exports.pushTrackingData = pushTrackingData; exports.resolveAddressId = resolveAddressId; exports.resolveGcTime = resolveGcTime; exports.resolveStock = resolveStock; exports.roundHalfAway = roundHalfAway; exports.sanitizeHtmlImages = sanitizeHtmlImages; exports.seconds = seconds2; exports.secondsOf = secondsOf2; exports.serializeCategoryFilters = serializeCategoryFilters; exports.serializeSearchParams = serializeSearchParams; exports.serializeTransforms = serializeTransforms; exports.tierBrowserGcTime = tierBrowserGcTime; exports.tierStaleTime = tierStaleTime; exports.toMillis = toMillis2; exports.trackAddToCart = trackAddToCart; exports.trackViewItem = trackViewItem; exports.transformShipToAddress = transformShipToAddress; exports.unwrap = unwrap; exports.unwrapOr = unwrapOr; exports.wholeSeconds = wholeSeconds2;
|
|
1221
1395
|
//# sourceMappingURL=index.cjs.map
|