@azzas/azzas-tracker-web 2.0.0-preview.6 → 2.0.0-preview.8

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/mod.js CHANGED
@@ -1329,9 +1329,6 @@ var legacyGetters = {
1329
1329
  // src/params/adapters/meta/index.ts
1330
1330
  var metaAdapters = {
1331
1331
  user_info: getUserInfo,
1332
- // brand: (context: MetaBrandContext) => {
1333
- // return context.meta.brand || null;
1334
- // },
1335
1332
  content_type: (context) => {
1336
1333
  return context.meta.content_type || null;
1337
1334
  },
@@ -1393,24 +1390,7 @@ var metaAdapters = {
1393
1390
  }
1394
1391
  };
1395
1392
 
1396
- // src/params/adapters/deco/utils.ts
1397
- var getItemCategory3 = (item) => {
1398
- var _a;
1399
- const value = item == null ? void 0 : item.category;
1400
- if (!value) return "Cole\xE7\xE3o";
1401
- const text = Array.isArray(value) ? value.join(" ") : String(value);
1402
- const match = (_a = text.match(/outlet|bazar|sale/i)) == null ? void 0 : _a[0].toLowerCase();
1403
- return match != null ? match : "Cole\xE7\xE3o";
1404
- };
1405
- var getItemCategory22 = (item) => {
1406
- var _a, _b, _c, _d;
1407
- const AVOID_CATEGORIES = /^(outlet|bazar|sale)$/i;
1408
- const categories = (_b = (_a = item.category) == null ? void 0 : _a.split(">")) != null ? _b : [];
1409
- const last = (_c = categories[categories.length - 1]) != null ? _c : "";
1410
- const validHierarchy = last.split("/").filter((c) => c && !AVOID_CATEGORIES.test(c));
1411
- const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
1412
- return capitalize(deepest);
1413
- };
1393
+ // src/core/farm.ts
1414
1394
  var BRAND_CODES2 = {
1415
1395
  farm: "farmrio",
1416
1396
  "farm etc": "farmetc",
@@ -1443,6 +1423,25 @@ function normalizeBrand2(input) {
1443
1423
  return uniqueSortedCodes.length > 0 ? uniqueSortedCodes.join("_") : null;
1444
1424
  }
1445
1425
 
1426
+ // src/params/adapters/deco/utils.ts
1427
+ var getItemCategory3 = (item) => {
1428
+ var _a;
1429
+ const value = item == null ? void 0 : item.category;
1430
+ if (!value) return "Cole\xE7\xE3o";
1431
+ const text = Array.isArray(value) ? value.join(" ") : String(value);
1432
+ const match = (_a = text.match(/outlet|bazar|sale/i)) == null ? void 0 : _a[0].toLowerCase();
1433
+ return match != null ? match : "Cole\xE7\xE3o";
1434
+ };
1435
+ var getItemCategory22 = (item) => {
1436
+ var _a, _b, _c, _d;
1437
+ const AVOID_CATEGORIES = /^(outlet|bazar|sale)$/i;
1438
+ const categories = (_b = (_a = item.category) == null ? void 0 : _a.split(">")) != null ? _b : [];
1439
+ const last = (_c = categories[categories.length - 1]) != null ? _c : "";
1440
+ const validHierarchy = last.split("/").filter((c) => c && !AVOID_CATEGORIES.test(c));
1441
+ const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
1442
+ return capitalize(deepest);
1443
+ };
1444
+
1446
1445
  // src/params/adapters/deco/index.ts
1447
1446
  var IN_STOCK_SCHEMA = "https://schema.org/InStock";
1448
1447
  var LIST_PRICE_SCHEMA = "https://schema.org/ListPrice";
@@ -1486,6 +1485,7 @@ var decoAdapter = {
1486
1485
  },
1487
1486
  brand: (context, config2) => {
1488
1487
  if (config2 == null ? void 0 : config2.brand) return config2.brand;
1488
+ if (context == null ? void 0 : context.brand) return context.brand;
1489
1489
  if (context == null ? void 0 : context.products) {
1490
1490
  return normalizeBrand2(context.products.map((p) => {
1491
1491
  var _a;
@@ -1612,6 +1612,7 @@ var HeadlessPdpZone = {
1612
1612
  },
1613
1613
  brand: (context, config2) => {
1614
1614
  if (config2 == null ? void 0 : config2.brand) return config2.brand;
1615
+ if (context == null ? void 0 : context.brand) return context.brand;
1615
1616
  if (context == null ? void 0 : context.products) {
1616
1617
  return context.products.map((p) => p.brand).join().trim();
1617
1618
  }
@@ -1670,6 +1671,7 @@ var HeadlessPdcZone = {
1670
1671
  },
1671
1672
  brand: (context, config2) => {
1672
1673
  if (config2 == null ? void 0 : config2.brand) return config2.brand;
1674
+ if (context == null ? void 0 : context.brand) return context.brand;
1673
1675
  if (context == null ? void 0 : context.products) {
1674
1676
  return context.products.map((p) => p.brand.name).join().trim();
1675
1677
  }
@@ -1766,9 +1768,14 @@ var pickupAdapter = {
1766
1768
  }
1767
1769
  return null;
1768
1770
  },
1771
+ brand: (context, config2) => {
1772
+ if (config2 == null ? void 0 : config2.brand) return config2.brand;
1773
+ if (context == null ? void 0 : context.brand) return context.brand;
1774
+ return null;
1775
+ },
1769
1776
  zipcode: (context) => {
1770
1777
  var _a;
1771
- return (_a = context.zipcode) != null ? _a : null;
1778
+ return (_a = context.meta.zipcode) != null ? _a : null;
1772
1779
  }
1773
1780
  };
1774
1781
 
@@ -1837,6 +1844,7 @@ var orderFormAdapter = {
1837
1844
  brand: (context, config2) => {
1838
1845
  var _a;
1839
1846
  if (config2 == null ? void 0 : config2.brand) return config2.brand;
1847
+ if (context == null ? void 0 : context.brand) return context.brand;
1840
1848
  if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
1841
1849
  const brands = getOrderFormItems(context.orderForm).map((item) => item.additionalInfo.brandName);
1842
1850
  return normalizeBrand2(brands);
@@ -1885,7 +1893,7 @@ var orderFormAdapter = {
1885
1893
  },
1886
1894
  zipcode: (context) => {
1887
1895
  var _a;
1888
- return (_a = context.zipcode) != null ? _a : null;
1896
+ return (_a = context.meta.zipcode) != null ? _a : null;
1889
1897
  },
1890
1898
  flag_pickup: (context) => {
1891
1899
  var _a;