@faststore/core 2.0.75-alpha.0 → 2.0.76-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +6 -0
  3. package/package.json +2 -2
  4. package/src/components/cart/CartSidebar/CartSidebar.tsx +5 -1
  5. package/.next/BUILD_ID +0 -1
  6. package/.next/build-manifest.json +0 -103
  7. package/.next/cache/.tsbuildinfo +0 -1
  8. package/.next/cache/config.json +0 -7
  9. package/.next/cache/eslint/.cache_1gneedd +0 -1
  10. package/.next/cache/next-server.js.nft.json +0 -1
  11. package/.next/cache/webpack/client-production/0.pack +0 -0
  12. package/.next/cache/webpack/client-production/index.pack +0 -0
  13. package/.next/cache/webpack/server-production/0.pack +0 -0
  14. package/.next/cache/webpack/server-production/index.pack +0 -0
  15. package/.next/export-marker.json +0 -1
  16. package/.next/images-manifest.json +0 -1
  17. package/.next/next-server.js.nft.json +0 -1
  18. package/.next/package.json +0 -1
  19. package/.next/prerender-manifest.json +0 -1
  20. package/.next/react-loadable-manifest.json +0 -49
  21. package/.next/required-server-files.json +0 -1
  22. package/.next/routes-manifest.json +0 -1
  23. package/.next/server/chunks/104.js +0 -196
  24. package/.next/server/chunks/143.js +0 -106
  25. package/.next/server/chunks/154.js +0 -201
  26. package/.next/server/chunks/183.js +0 -72
  27. package/.next/server/chunks/247.js +0 -61
  28. package/.next/server/chunks/264.js +0 -67
  29. package/.next/server/chunks/280.js +0 -417
  30. package/.next/server/chunks/287.js +0 -79
  31. package/.next/server/chunks/307.js +0 -109
  32. package/.next/server/chunks/312.js +0 -714
  33. package/.next/server/chunks/317.js +0 -126
  34. package/.next/server/chunks/350.js +0 -120
  35. package/.next/server/chunks/371.js +0 -1467
  36. package/.next/server/chunks/377.js +0 -82
  37. package/.next/server/chunks/394.js +0 -3801
  38. package/.next/server/chunks/439.js +0 -175
  39. package/.next/server/chunks/444.js +0 -464
  40. package/.next/server/chunks/465.js +0 -91
  41. package/.next/server/chunks/576.js +0 -72
  42. package/.next/server/chunks/650.js +0 -216
  43. package/.next/server/chunks/664.js +0 -124
  44. package/.next/server/chunks/676.js +0 -32
  45. package/.next/server/chunks/732.js +0 -51
  46. package/.next/server/chunks/746.js +0 -237
  47. package/.next/server/chunks/849.js +0 -665
  48. package/.next/server/chunks/854.js +0 -72
  49. package/.next/server/chunks/859.js +0 -959
  50. package/.next/server/chunks/872.js +0 -378
  51. package/.next/server/chunks/881.js +0 -320
  52. package/.next/server/chunks/898.js +0 -240
  53. package/.next/server/chunks/914.js +0 -96
  54. package/.next/server/chunks/953.js +0 -673
  55. package/.next/server/chunks/98.js +0 -266
  56. package/.next/server/chunks/992.js +0 -562
  57. package/.next/server/chunks/font-manifest.json +0 -1
  58. package/.next/server/font-manifest.json +0 -1
  59. package/.next/server/middleware-build-manifest.js +0 -1
  60. package/.next/server/middleware-manifest.json +0 -6
  61. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  62. package/.next/server/pages/404.js.nft.json +0 -1
  63. package/.next/server/pages/500.js.nft.json +0 -1
  64. package/.next/server/pages/[...slug].js +0 -609
  65. package/.next/server/pages/[...slug].js.nft.json +0 -1
  66. package/.next/server/pages/[slug]/p.js +0 -2560
  67. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  68. package/.next/server/pages/_app.js +0 -2058
  69. package/.next/server/pages/_app.js.nft.json +0 -1
  70. package/.next/server/pages/_document.js +0 -304
  71. package/.next/server/pages/_document.js.nft.json +0 -1
  72. package/.next/server/pages/_error.js +0 -164
  73. package/.next/server/pages/_error.js.nft.json +0 -1
  74. package/.next/server/pages/account.js.nft.json +0 -1
  75. package/.next/server/pages/api/graphql.js +0 -259
  76. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  77. package/.next/server/pages/api/preview.js +0 -118
  78. package/.next/server/pages/api/preview.js.nft.json +0 -1
  79. package/.next/server/pages/checkout.js.nft.json +0 -1
  80. package/.next/server/pages/en-US/404.html +0 -81
  81. package/.next/server/pages/en-US/500.html +0 -81
  82. package/.next/server/pages/en-US/account.html +0 -81
  83. package/.next/server/pages/en-US/checkout.html +0 -81
  84. package/.next/server/pages/en-US/login.html +0 -81
  85. package/.next/server/pages/en-US/s.html +0 -81
  86. package/.next/server/pages/en-US.html +0 -81
  87. package/.next/server/pages/en-US.json +0 -1
  88. package/.next/server/pages/index.js +0 -407
  89. package/.next/server/pages/index.js.nft.json +0 -1
  90. package/.next/server/pages/login.js.nft.json +0 -1
  91. package/.next/server/pages/s.js.nft.json +0 -1
  92. package/.next/server/pages-manifest.json +0 -16
  93. package/.next/server/webpack-api-runtime.js +0 -229
  94. package/.next/server/webpack-runtime.js +0 -229
  95. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  96. package/.next/static/chunks/153-a20e3f2da180607e.js +0 -1
  97. package/.next/static/chunks/260-994385416f68673d.js +0 -1
  98. package/.next/static/chunks/307.10facde65af3066a.js +0 -1
  99. package/.next/static/chunks/337-4b719ca7a86d8d8c.js +0 -1
  100. package/.next/static/chunks/351-a4e28d64f48c5269.js +0 -1
  101. package/.next/static/chunks/588.591fb3bf1a136c66.js +0 -1
  102. package/.next/static/chunks/650.807852d1c36bfe44.js +0 -1
  103. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  104. package/.next/static/chunks/686.36adeba271636edd.js +0 -1
  105. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  106. package/.next/static/chunks/817-728f854c2948afc0.js +0 -1
  107. package/.next/static/chunks/909.ea3532bde0943808.js +0 -1
  108. package/.next/static/chunks/953.77a48c854f628dcf.js +0 -1
  109. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  110. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  111. package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
  112. package/.next/static/chunks/pages/404-ba608a2a9f0c420a.js +0 -1
  113. package/.next/static/chunks/pages/500-910883c20541d9ce.js +0 -1
  114. package/.next/static/chunks/pages/[...slug]-9443b18a60d89746.js +0 -1
  115. package/.next/static/chunks/pages/[slug]/p-cb8ef12f6449cf26.js +0 -1
  116. package/.next/static/chunks/pages/_app-9cc7312632f19e94.js +0 -1
  117. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  118. package/.next/static/chunks/pages/account-f19102933e6fd84c.js +0 -1
  119. package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +0 -1
  120. package/.next/static/chunks/pages/index-6717326cc207d674.js +0 -1
  121. package/.next/static/chunks/pages/login-0b9ea80d9fa0f91b.js +0 -1
  122. package/.next/static/chunks/pages/s-86fe1e3303388123.js +0 -1
  123. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  124. package/.next/static/chunks/webpack-fc7c18f8a868734c.js +0 -1
  125. package/.next/static/css/14ebc84fc6d6c80c.css +0 -1
  126. package/.next/static/css/430b8cafbf7c23c1.css +0 -1
  127. package/.next/static/css/43d61b402f41569b.css +0 -1
  128. package/.next/static/css/4d7e7f156483493d.css +0 -1
  129. package/.next/static/css/6507cb48401e73a4.css +0 -1
  130. package/.next/static/css/9dd1d1084d254c66.css +0 -1
  131. package/.next/static/css/b2f16bd4b93e0aca.css +0 -1
  132. package/.next/static/css/bd743407c8049677.css +0 -1
  133. package/.next/static/css/e63697a078fd522e.css +0 -1
  134. package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
  135. package/.next/static/xmQIY_XtSwwYX1xvtcDOJ/_buildManifest.js +0 -1
  136. package/.next/static/xmQIY_XtSwwYX1xvtcDOJ/_ssgManifest.js +0 -1
  137. package/.next/trace +0 -64
  138. package/public/~partytown/debug/partytown-atomics.js +0 -556
  139. package/public/~partytown/debug/partytown-media.js +0 -374
  140. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  141. package/public/~partytown/debug/partytown-sw.js +0 -59
  142. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  143. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  144. package/public/~partytown/debug/partytown.js +0 -72
  145. package/public/~partytown/partytown-atomics.js +0 -2
  146. package/public/~partytown/partytown-media.js +0 -2
  147. package/public/~partytown/partytown-sw.js +0 -2
  148. package/public/~partytown/partytown.js +0 -2
@@ -1,196 +0,0 @@
1
- exports.id = 104;
2
- exports.ids = [104];
3
- exports.modules = {
4
-
5
- /***/ 8569:
6
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
7
-
8
- "use strict";
9
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
10
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
12
- /* harmony export */ });
13
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
14
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
15
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
16
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
17
- /* harmony import */ var src_sdk_analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5184);
18
- /* harmony import */ var src_components_skeletons_ProductShelfSkeleton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9201);
19
- /* harmony import */ var src_sdk_product_useProductsQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4867);
20
- /* harmony import */ var _product_ProductCard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6475);
21
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8879);
22
- /* harmony import */ var _product_shelf_module_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3656);
23
- /* harmony import */ var _product_shelf_module_scss__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_product_shelf_module_scss__WEBPACK_IMPORTED_MODULE_8__);
24
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(997);
25
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
26
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_sdk_product_useProductsQuery__WEBPACK_IMPORTED_MODULE_4__]);
27
- src_sdk_product_useProductsQuery__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
28
- const _excluded = ["title", "withDivisor"];
29
-
30
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
31
-
32
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
- function ProductShelf(_ref) {
46
- let {
47
- title,
48
- withDivisor = false
49
- } = _ref,
50
- variables = _objectWithoutProperties(_ref, _excluded);
51
-
52
- const viewedOnce = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
53
- const {
54
- ref,
55
- inView
56
- } = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
57
- const products = (0,src_sdk_product_useProductsQuery__WEBPACK_IMPORTED_MODULE_4__/* .useProductsQuery */ .kN)(variables);
58
- const productEdges = products?.edges ?? [];
59
- const aspectRatio = 1;
60
- const {
61
- sendViewItemListEvent
62
- } = (0,src_sdk_analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_2__/* .useViewItemListEvent */ .m)({
63
- products: productEdges,
64
- title,
65
- page: 0,
66
- pageSize: 0
67
- });
68
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
69
- if (inView && !viewedOnce.current && productEdges.length) {
70
- sendViewItemListEvent();
71
- viewedOnce.current = true;
72
- }
73
- }, [inView, productEdges.length, sendViewItemListEvent]);
74
-
75
- if (products?.edges.length === 0) {
76
- return null;
77
- }
78
-
79
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_Section__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
80
- className: `layout__section ${withDivisor ? 'section__divisor' : ''}`,
81
- ref: ref,
82
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx("h2", {
83
- className: "text__title-section layout__content",
84
- children: title
85
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx("div", {
86
- className: (_product_shelf_module_scss__WEBPACK_IMPORTED_MODULE_8___default().fsProductShelf),
87
- "data-fs-product-shelf": true,
88
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx(src_components_skeletons_ProductShelfSkeleton__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
89
- aspectRatio: aspectRatio,
90
- loading: products === undefined,
91
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx("ul", {
92
- "data-fs-product-shelf-items": true,
93
- className: "layout__content",
94
- children: productEdges.map((product, idx) => /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx("li", {
95
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx(_product_ProductCard__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
96
- product: product.node,
97
- index: idx + 1,
98
- aspectRatio: aspectRatio
99
- })
100
- }, `${product.node.id}`))
101
- })
102
- })
103
- })]
104
- });
105
- }
106
-
107
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductShelf);
108
- __webpack_async_result__();
109
- } catch(e) { __webpack_async_result__(e); } });
110
-
111
- /***/ }),
112
-
113
- /***/ 7104:
114
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
115
-
116
- "use strict";
117
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
118
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
119
- /* harmony export */ "Z": () => (/* reexport safe */ _ProductShelf__WEBPACK_IMPORTED_MODULE_0__.Z)
120
- /* harmony export */ });
121
- /* harmony import */ var _ProductShelf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8569);
122
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_ProductShelf__WEBPACK_IMPORTED_MODULE_0__]);
123
- _ProductShelf__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
124
-
125
- __webpack_async_result__();
126
- } catch(e) { __webpack_async_result__(e); } });
127
-
128
- /***/ }),
129
-
130
- /***/ 9201:
131
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
132
-
133
- "use strict";
134
-
135
- // EXPORTS
136
- __webpack_require__.d(__webpack_exports__, {
137
- "Z": () => (/* reexport */ ProductShelfSkeleton_ProductShelfSkeleton)
138
- });
139
-
140
- // EXTERNAL MODULE: ./src/constants.ts
141
- var constants = __webpack_require__(8459);
142
- // EXTERNAL MODULE: ./src/components/sections/ProductShelf/product-shelf.module.scss
143
- var product_shelf_module = __webpack_require__(3656);
144
- var product_shelf_module_default = /*#__PURE__*/__webpack_require__.n(product_shelf_module);
145
- // EXTERNAL MODULE: ./src/components/skeletons/ProductCardSkeleton/index.ts + 1 modules
146
- var ProductCardSkeleton = __webpack_require__(3288);
147
- // EXTERNAL MODULE: external "react/jsx-runtime"
148
- var jsx_runtime_ = __webpack_require__(997);
149
- ;// CONCATENATED MODULE: ./src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx
150
-
151
-
152
-
153
-
154
-
155
-
156
- function ProductShelfSkeleton({
157
- children,
158
- aspectRatio,
159
- loading = true
160
- }) {
161
- return loading ? /*#__PURE__*/jsx_runtime_.jsx("ul", {
162
- "data-fs-product-shelf-items": true,
163
- className: `layout__content ${(product_shelf_module_default()).fsProductShelf}`,
164
- children: Array.from({
165
- length: constants/* ITEMS_PER_SECTION */.K
166
- }, (_, index) => /*#__PURE__*/jsx_runtime_.jsx("li", {
167
- children: /*#__PURE__*/jsx_runtime_.jsx(ProductCardSkeleton/* default */.Z, {
168
- aspectRatio: aspectRatio,
169
- sectioned: true
170
- })
171
- }, String(index)))
172
- }) : /*#__PURE__*/jsx_runtime_.jsx(jsx_runtime_.Fragment, {
173
- children: children
174
- });
175
- }
176
-
177
- /* harmony default export */ const ProductShelfSkeleton_ProductShelfSkeleton = (ProductShelfSkeleton);
178
- ;// CONCATENATED MODULE: ./src/components/skeletons/ProductShelfSkeleton/index.ts
179
-
180
-
181
- /***/ }),
182
-
183
- /***/ 3656:
184
- /***/ ((module) => {
185
-
186
- // Exports
187
- module.exports = {
188
- "fs-product-shelf": "product-shelf_fs-product-shelf__65g4z",
189
- "fsProductShelf": "product-shelf_fs-product-shelf__65g4z"
190
- };
191
-
192
-
193
- /***/ })
194
-
195
- };
196
- ;
@@ -1,106 +0,0 @@
1
- "use strict";
2
- exports.id = 143;
3
- exports.ids = [143];
4
- exports.modules = {
5
-
6
- /***/ 9143:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- __webpack_require__.r(__webpack_exports__);
10
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
12
- /* harmony export */ });
13
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7183);
14
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_faststore_config__WEBPACK_IMPORTED_MODULE_0__);
15
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
-
17
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
-
19
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20
-
21
- /**
22
- * More info at: https://www.notion.so/vtexhandbook/Event-API-Documentation-48eee26730cf4d7f80f8fd7262231f84
23
- */
24
-
25
- const THIRTY_MINUTES_S = 30 * 60;
26
- const ONE_YEAR_S = 365 * 24 * 3600;
27
-
28
- const randomUUID = () => typeof crypto.randomUUID === 'function' ? crypto.randomUUID() : (Math.random() * 1e6).toFixed(0);
29
-
30
- const createStorage = (key, expiresSecond) => {
31
- const timelapsed = past => (Date.now() - past) / 1e3;
32
-
33
- return () => {
34
- const item = JSON.parse(localStorage.getItem(key) ?? 'null');
35
- const isExpired = !item || timelapsed(item.createdAt) > expiresSecond;
36
- const payload = isExpired ? randomUUID() : item.payload;
37
-
38
- if (isExpired) {
39
- const data = {
40
- payload,
41
- createdAt: Date.now()
42
- };
43
- localStorage.setItem(key, JSON.stringify(data));
44
- }
45
-
46
- return payload;
47
- };
48
- };
49
-
50
- const user = {
51
- anonymous: createStorage('vtex.search.anonymous', ONE_YEAR_S),
52
- session: createStorage('vtex.search.session', THIRTY_MINUTES_S)
53
- };
54
-
55
- const sendEvent = options => fetch(`https://sp.vtex.com/event-api/v1/${(_faststore_config__WEBPACK_IMPORTED_MODULE_0___default().api.storeId)}/event`, {
56
- method: 'POST',
57
- body: JSON.stringify(_objectSpread(_objectSpread({}, options), {}, {
58
- userAgent: navigator.userAgent,
59
- anonymous: user.anonymous(),
60
- session: user.session()
61
- })),
62
- headers: {
63
- 'content-type': 'application/json'
64
- }
65
- });
66
-
67
- const isFullTextSearch = url => typeof url.searchParams.get('q') === 'string' && /^\/s(\/)?$/g.test(url.pathname);
68
-
69
- const handleEvent = event => {
70
- if (event.name !== 'search_select_item') {
71
- return;
72
- }
73
-
74
- const url = new URL(event.params.url);
75
-
76
- if (!isFullTextSearch(url)) {
77
- return;
78
- }
79
-
80
- for (const item of event.params.items ?? []) {
81
- const productId = item.item_id ?? item.item_variant;
82
- const position = item.index;
83
-
84
- if (productId && position) {
85
- sendEvent({
86
- type: 'search.click',
87
- productId,
88
- position,
89
- url: url.href,
90
- text: url.searchParams.get('q') ?? '<empty>'
91
- });
92
- }
93
- }
94
- };
95
-
96
- setInterval(() => sendEvent({
97
- type: 'session.ping'
98
- }), 60 * 1e3
99
- /* One minute */
100
- );
101
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (handleEvent);
102
-
103
- /***/ })
104
-
105
- };
106
- ;
@@ -1,201 +0,0 @@
1
- "use strict";
2
- exports.id = 154;
3
- exports.ids = [154];
4
- exports.modules = {
5
-
6
- /***/ 2154:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "E": () => (/* reexport */ Image_Image)
13
- });
14
-
15
- // EXTERNAL MODULE: external "react"
16
- var external_react_ = __webpack_require__(6689);
17
- // EXTERNAL MODULE: external "next/head"
18
- var head_ = __webpack_require__(968);
19
- var head_default = /*#__PURE__*/__webpack_require__.n(head_);
20
- ;// CONCATENATED MODULE: ./src/components/ui/Image/thumborUrlBuilder.ts
21
- const THUMBOR_SERVER = 'https://assets.vtex.app';
22
-
23
- const cropSection = ({
24
- left,
25
- top,
26
- right,
27
- bottom
28
- }) => `${left}x${top}:${right}x${bottom}`;
29
-
30
- function filtersURIComponent(filters) {
31
- const elements = ['filters'];
32
- Object.keys(filters).forEach(name => {
33
- const parameters = filters[name];
34
- let stringParameters; // If we have several parameters, they were passed as an array
35
- // and now they need to be comma separated, otherwise there is just one to convert to a string
36
-
37
- if (Array.isArray(parameters)) {
38
- stringParameters = parameters.join(',');
39
- } // If true, we don't even need to do anything, we just have an empty string and insert ()
40
- // Ex: {grayscale: true} => grayscale()
41
- else if (parameters === true) {
42
- stringParameters = '';
43
- } else {
44
- stringParameters = String(parameters);
45
- }
46
-
47
- elements.push(`${name}(${stringParameters})`);
48
- });
49
- return elements.join(':');
50
- }
51
-
52
- const urlBuilder = (baseUrl, options) => {
53
- const preSizeComponents = [THUMBOR_SERVER, 'unsafe'];
54
- const postSizeComponents = []; // Add the trim parameter after unsafe if appliable
55
-
56
- options.trim && preSizeComponents.push('trim'); // Add the crop parameter if any
57
-
58
- options.manualCrop && preSizeComponents.push(cropSection(options.manualCrop)); // Add the fit-in parameter after crop if appliable
59
-
60
- options.fitIn && preSizeComponents.push('fit-in'); // Adds the horizontal alignement after the size
61
-
62
- postSizeComponents.push(options.horizontalAlign ?? 'center'); // Adds the vertical alignement after the size
63
-
64
- postSizeComponents.push(options.verticalAlign ?? 'middle'); // Adds the smart parameter if appliable
65
-
66
- options.smart && postSizeComponents.push('smart'); // Compile the filters and add them right before the URI
67
-
68
- const {
69
- filters
70
- } = options;
71
- filters && postSizeComponents.push(filtersURIComponent(filters)); // Finally, adds the real image uri
72
-
73
- postSizeComponents.push(encodeURIComponent(baseUrl));
74
- return (width, height) => {
75
- // Adds the final size parameter
76
- let finalSize = '';
77
-
78
- if (options.flipHorizontal) {
79
- finalSize += '-';
80
- }
81
-
82
- finalSize += `${width}x`;
83
-
84
- if (options.flipVertical) {
85
- finalSize += '-';
86
- }
87
-
88
- finalSize += `${height}`;
89
- return [...preSizeComponents, finalSize, ...postSizeComponents].join('/');
90
- };
91
- };
92
- ;// CONCATENATED MODULE: ./src/components/ui/Image/useImage.ts
93
- const _excluded = ["src", "width", "height", "options"];
94
-
95
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
96
-
97
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
98
-
99
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
100
-
101
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
102
-
103
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
104
-
105
-
106
-
107
- const FACTORS = [1, 2, 3];
108
- const LARGE_FACTOR = FACTORS[FACTORS.length - 1];
109
- const useImage = _ref => {
110
- let {
111
- src: baseUrl,
112
- width,
113
- height,
114
- options = {}
115
- } = _ref,
116
- rest = _objectWithoutProperties(_ref, _excluded);
117
-
118
- const {
119
- srcSet,
120
- src
121
- } = (0,external_react_.useMemo)(() => {
122
- const builder = urlBuilder(baseUrl, options);
123
- const srcs = FACTORS.map(factor => {
124
- const rescaledWidth = width * factor;
125
- return `${builder(rescaledWidth, height * factor)} ${rescaledWidth}w`;
126
- });
127
- return {
128
- src: builder(width * LARGE_FACTOR, height * LARGE_FACTOR),
129
- srcSet: srcs.join(', ')
130
- };
131
- }, [height, options, baseUrl, width]);
132
- return _objectSpread({
133
- src,
134
- srcSet,
135
- width: `${width}px`,
136
- height: `${height}px`
137
- }, rest);
138
- };
139
- // EXTERNAL MODULE: external "react/jsx-runtime"
140
- var jsx_runtime_ = __webpack_require__(997);
141
- ;// CONCATENATED MODULE: ./src/components/ui/Image/Image.tsx
142
- const Image_excluded = ["preload", "fetchPriority"];
143
-
144
- function Image_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
145
-
146
- function Image_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Image_ownKeys(Object(source), !0).forEach(function (key) { Image_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Image_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
147
-
148
- function Image_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
149
-
150
- function Image_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Image_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
151
-
152
- function Image_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
- // TODO: Replace this component by next/image
161
- const Image = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
162
- let {
163
- preload = false,
164
- fetchPriority
165
- } = _ref,
166
- otherProps = Image_objectWithoutProperties(_ref, Image_excluded);
167
-
168
- const imgProps = useImage(otherProps);
169
- const {
170
- src,
171
- sizes = '100vw',
172
- srcSet
173
- } = imgProps;
174
- return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
175
- children: [preload && /*#__PURE__*/jsx_runtime_.jsx((head_default()), {
176
- children: /*#__PURE__*/jsx_runtime_.jsx("link", {
177
- as: "image",
178
- rel: "preload",
179
- href: src,
180
- imageSrcSet: srcSet,
181
- imageSizes: sizes,
182
- fetchpriority: fetchPriority
183
- })
184
- }), /*#__PURE__*/jsx_runtime_.jsx("img", Image_objectSpread(Image_objectSpread({
185
- ref: ref,
186
- "data-fs-image": true
187
- }, imgProps), {}, {
188
- alt: imgProps.alt,
189
- fetchpriority: fetchPriority
190
- }))]
191
- });
192
- });
193
- Image.displayName = 'Image';
194
- /* harmony default export */ const Image_Image = (/*#__PURE__*/(0,external_react_.memo)(Image));
195
- ;// CONCATENATED MODULE: ./src/components/ui/Image/index.ts
196
-
197
-
198
- /***/ })
199
-
200
- };
201
- ;
@@ -1,72 +0,0 @@
1
- exports.id = 183;
2
- exports.ids = [183];
3
- exports.modules = {
4
-
5
- /***/ 7183:
6
- /***/ ((module) => {
7
-
8
- module.exports = {
9
- seo: {
10
- title: 'NextJSStore',
11
- description: 'Fast Demo Store',
12
- titleTemplate: '%s | FastStore',
13
- author: 'Store Framework'
14
- },
15
- // Theming
16
- theme: 'custom-theme',
17
- // Ecommerce Platform
18
- platform: 'vtex',
19
- // Platform specific configs for API
20
- api: {
21
- storeId: 'storeframework',
22
- workspace: 'master',
23
- environment: 'vtexcommercestable',
24
- hideUnavailableItems: true
25
- },
26
- // Default session
27
- session: {
28
- currency: {
29
- code: 'USD',
30
- symbol: '$'
31
- },
32
- locale: 'en-US',
33
- channel: '{"salesChannel":"1","regionId":""}',
34
- country: 'USA',
35
- postalCode: null,
36
- person: null
37
- },
38
- // Production URLs
39
- storeUrl: 'https://vtexfaststore.com',
40
- secureSubdomain: 'https://secure.vtexfaststore.com',
41
- checkoutUrl: 'https://secure.vtexfaststore.com/checkout',
42
- loginUrl: 'https://secure.vtexfaststore.com/api/io/login',
43
- accountUrl: 'https://secure.vtexfaststore.com/api/io/account',
44
- // Lighthouse CI
45
- lighthouse: {
46
- server: process.env.BASE_SITE_URL || 'http://localhost:3000',
47
- pages: {
48
- home: '/',
49
- pdp: '/apple-magic-mouse/p',
50
- collection: '/office'
51
- }
52
- },
53
- // E2E CI
54
- cypress: {
55
- pages: {
56
- home: '/',
57
- pdp: '/apple-magic-mouse/p',
58
- collection: '/office',
59
- collection_filtered: '/office/?category-1=office&marca=acer&facets=category-1%2Cmarca',
60
- search: '/s?q=orange'
61
- }
62
- },
63
- analytics: {
64
- // https://developers.google.com/tag-platform/tag-manager/web#standard_web_page_installation,
65
- gtmContainerId: 'GTM-PGHZ95N'
66
- }
67
- };
68
-
69
- /***/ })
70
-
71
- };
72
- ;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- exports.id = 247;
3
- exports.ids = [247];
4
- exports.modules = {
5
-
6
- /***/ 7549:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
11
- /* harmony export */ });
12
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
13
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
14
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2691);
15
-
16
-
17
- const Price = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function Price({ value, as: Component = 'span', variant = 'selling', testId = 'fs-price', formatter = (price) => price, SRText, ...otherProps }, ref) {
18
- const formattedPrice = formatter(value, variant);
19
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Component, { ref: ref, "data-fs-price": true, "data-fs-price-variant": variant, "data-testid": testId, ...otherProps },
20
- SRText && react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { text: SRText }),
21
- formattedPrice));
22
- });
23
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Price);
24
- //# sourceMappingURL=Price.js.map
25
-
26
- /***/ }),
27
-
28
- /***/ 5346:
29
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
30
-
31
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32
- /* harmony export */ "P": () => (/* binding */ useFormattedPrice),
33
- /* harmony export */ "o": () => (/* binding */ usePriceFormatter)
34
- /* harmony export */ });
35
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
36
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
37
- /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5971);
38
-
39
-
40
- const usePriceFormatter = ({
41
- decimals
42
- } = {}) => {
43
- const {
44
- currency,
45
- locale
46
- } = (0,_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
47
- return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(price => Intl.NumberFormat(locale, {
48
- style: 'currency',
49
- currency: currency.code,
50
- minimumFractionDigits: decimals ? 2 : 0
51
- }).format(price), [currency.code, locale, decimals]);
52
- };
53
- const useFormattedPrice = price => {
54
- const formatter = usePriceFormatter();
55
- return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => formatter(price), [formatter, price]);
56
- };
57
-
58
- /***/ })
59
-
60
- };
61
- ;