@faststore/core 2.0.89-alpha.0 → 2.0.91-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 (154) hide show
  1. package/.turbo/turbo-build.log +6 -6
  2. package/CHANGELOG.md +16 -0
  3. package/cypress/integration/plp.test.js +2 -3
  4. package/package.json +4 -4
  5. package/src/components/search/Filter/Filter.tsx +7 -27
  6. package/src/components/search/Filter/FilterDesktop.tsx +109 -0
  7. package/src/components/search/Filter/FilterSlider.tsx +97 -73
  8. package/src/styles/themes/midnight.scss +4 -0
  9. package/.next/BUILD_ID +0 -1
  10. package/.next/build-manifest.json +0 -101
  11. package/.next/cache/.tsbuildinfo +0 -1
  12. package/.next/cache/config.json +0 -7
  13. package/.next/cache/eslint/.cache_1gneedd +0 -1
  14. package/.next/cache/next-server.js.nft.json +0 -1
  15. package/.next/cache/webpack/client-production/0.pack +0 -0
  16. package/.next/cache/webpack/client-production/index.pack +0 -0
  17. package/.next/cache/webpack/server-production/0.pack +0 -0
  18. package/.next/cache/webpack/server-production/index.pack +0 -0
  19. package/.next/export-marker.json +0 -1
  20. package/.next/images-manifest.json +0 -1
  21. package/.next/next-server.js.nft.json +0 -1
  22. package/.next/package.json +0 -1
  23. package/.next/prerender-manifest.json +0 -1
  24. package/.next/react-loadable-manifest.json +0 -44
  25. package/.next/required-server-files.json +0 -1
  26. package/.next/routes-manifest.json +0 -1
  27. package/.next/server/chunks/104.js +0 -196
  28. package/.next/server/chunks/143.js +0 -106
  29. package/.next/server/chunks/154.js +0 -206
  30. package/.next/server/chunks/183.js +0 -72
  31. package/.next/server/chunks/247.js +0 -61
  32. package/.next/server/chunks/264.js +0 -67
  33. package/.next/server/chunks/280.js +0 -417
  34. package/.next/server/chunks/287.js +0 -79
  35. package/.next/server/chunks/312.js +0 -684
  36. package/.next/server/chunks/317.js +0 -125
  37. package/.next/server/chunks/350.js +0 -120
  38. package/.next/server/chunks/371.js +0 -1467
  39. package/.next/server/chunks/377.js +0 -82
  40. package/.next/server/chunks/394.js +0 -3801
  41. package/.next/server/chunks/439.js +0 -175
  42. package/.next/server/chunks/444.js +0 -464
  43. package/.next/server/chunks/465.js +0 -91
  44. package/.next/server/chunks/576.js +0 -72
  45. package/.next/server/chunks/608.js +0 -515
  46. package/.next/server/chunks/650.js +0 -216
  47. package/.next/server/chunks/664.js +0 -124
  48. package/.next/server/chunks/676.js +0 -32
  49. package/.next/server/chunks/746.js +0 -237
  50. package/.next/server/chunks/777.js +0 -708
  51. package/.next/server/chunks/854.js +0 -72
  52. package/.next/server/chunks/859.js +0 -959
  53. package/.next/server/chunks/872.js +0 -378
  54. package/.next/server/chunks/881.js +0 -320
  55. package/.next/server/chunks/898.js +0 -240
  56. package/.next/server/chunks/914.js +0 -96
  57. package/.next/server/chunks/953.js +0 -674
  58. package/.next/server/chunks/98.js +0 -266
  59. package/.next/server/chunks/992.js +0 -570
  60. package/.next/server/chunks/font-manifest.json +0 -1
  61. package/.next/server/font-manifest.json +0 -1
  62. package/.next/server/middleware-build-manifest.js +0 -1
  63. package/.next/server/middleware-manifest.json +0 -6
  64. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  65. package/.next/server/pages/404.js.nft.json +0 -1
  66. package/.next/server/pages/500.js.nft.json +0 -1
  67. package/.next/server/pages/[...slug].js +0 -633
  68. package/.next/server/pages/[...slug].js.nft.json +0 -1
  69. package/.next/server/pages/[slug]/p.js +0 -2436
  70. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  71. package/.next/server/pages/_app.js +0 -2479
  72. package/.next/server/pages/_app.js.nft.json +0 -1
  73. package/.next/server/pages/_document.js +0 -304
  74. package/.next/server/pages/_document.js.nft.json +0 -1
  75. package/.next/server/pages/_error.js +0 -164
  76. package/.next/server/pages/_error.js.nft.json +0 -1
  77. package/.next/server/pages/account.js.nft.json +0 -1
  78. package/.next/server/pages/api/graphql.js +0 -259
  79. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  80. package/.next/server/pages/api/preview.js +0 -118
  81. package/.next/server/pages/api/preview.js.nft.json +0 -1
  82. package/.next/server/pages/checkout.js.nft.json +0 -1
  83. package/.next/server/pages/en-US/404.html +0 -81
  84. package/.next/server/pages/en-US/500.html +0 -81
  85. package/.next/server/pages/en-US/account.html +0 -81
  86. package/.next/server/pages/en-US/checkout.html +0 -81
  87. package/.next/server/pages/en-US/login.html +0 -81
  88. package/.next/server/pages/en-US/s.html +0 -81
  89. package/.next/server/pages/en-US.html +0 -81
  90. package/.next/server/pages/en-US.json +0 -1
  91. package/.next/server/pages/index.js +0 -428
  92. package/.next/server/pages/index.js.nft.json +0 -1
  93. package/.next/server/pages/login.js.nft.json +0 -1
  94. package/.next/server/pages/s.js.nft.json +0 -1
  95. package/.next/server/pages-manifest.json +0 -16
  96. package/.next/server/webpack-api-runtime.js +0 -229
  97. package/.next/server/webpack-runtime.js +0 -229
  98. package/.next/static/1KPdWgQQSDSsDjbALweg_/_buildManifest.js +0 -1
  99. package/.next/static/1KPdWgQQSDSsDjbALweg_/_ssgManifest.js +0 -1
  100. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  101. package/.next/static/chunks/291.78e3aea4a7f45595.js +0 -1
  102. package/.next/static/chunks/351-a4e28d64f48c5269.js +0 -1
  103. package/.next/static/chunks/608.59e69b83f35d9c44.js +0 -1
  104. package/.next/static/chunks/626-99e3ce6603bc98f0.js +0 -1
  105. package/.next/static/chunks/650.807852d1c36bfe44.js +0 -1
  106. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  107. package/.next/static/chunks/686.41582b9e75eaba89.js +0 -1
  108. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  109. package/.next/static/chunks/781-7df372b5b56e3f96.js +0 -1
  110. package/.next/static/chunks/843.fab5a00e170b4f11.js +0 -1
  111. package/.next/static/chunks/855-05313b1877eceff8.js +0 -1
  112. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  113. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  114. package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
  115. package/.next/static/chunks/pages/404-ba608a2a9f0c420a.js +0 -1
  116. package/.next/static/chunks/pages/500-910883c20541d9ce.js +0 -1
  117. package/.next/static/chunks/pages/[...slug]-a947020e62f4ac94.js +0 -1
  118. package/.next/static/chunks/pages/[slug]/p-de7852e7e513012d.js +0 -1
  119. package/.next/static/chunks/pages/_app-0bf8e95d55047056.js +0 -1
  120. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  121. package/.next/static/chunks/pages/account-f19102933e6fd84c.js +0 -1
  122. package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +0 -1
  123. package/.next/static/chunks/pages/index-eabe9d42a172b52b.js +0 -1
  124. package/.next/static/chunks/pages/login-0b9ea80d9fa0f91b.js +0 -1
  125. package/.next/static/chunks/pages/s-56181f57d448f67c.js +0 -1
  126. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  127. package/.next/static/chunks/webpack-2d6880a14598b3ec.js +0 -1
  128. package/.next/static/css/046add45db5e9cdf.css +0 -1
  129. package/.next/static/css/430b8cafbf7c23c1.css +0 -1
  130. package/.next/static/css/43d61b402f41569b.css +0 -1
  131. package/.next/static/css/59446068ab594e58.css +0 -1
  132. package/.next/static/css/6507cb48401e73a4.css +0 -1
  133. package/.next/static/css/9dd1d1084d254c66.css +0 -1
  134. package/.next/static/css/b2f16bd4b93e0aca.css +0 -1
  135. package/.next/static/css/bd743407c8049677.css +0 -1
  136. package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
  137. package/.next/trace +0 -63
  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
  149. package/src/components/search/Filter/Facets.stories.mdx +0 -282
  150. package/src/components/search/Filter/Facets.tsx +0 -147
  151. package/src/components/search/Filter/Filter.stories.mdx +0 -208
  152. package/src/components/search/Filter/FilterSlider.stories.mdx +0 -216
  153. package/src/components/search/Filter/facets.module.scss +0 -117
  154. package/src/components/search/Filter/filter-slider.module.scss +0 -53
@@ -1,91 +0,0 @@
1
- "use strict";
2
- exports.id = 465;
3
- exports.ids = [465];
4
- exports.modules = {
5
-
6
- /***/ 8460:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "_": () => (/* binding */ sendAnalyticsEvent)
11
- /* harmony export */ });
12
- /* harmony import */ var _wrap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6716);
13
-
14
- const sendAnalyticsEvent = (event) => {
15
- try {
16
- window.postMessage((0,_wrap__WEBPACK_IMPORTED_MODULE_0__/* .wrap */ .re)(event), window.origin);
17
- }
18
- catch (e) {
19
- // IE and Edge have a bug on postMessage inside promises.
20
- // Ignoring for now, will try to find a workaround that
21
- // makes postMessage work on those browsers.
22
- // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14719328/
23
- console.error(e);
24
- }
25
- };
26
- //# sourceMappingURL=sendAnalyticsEvent.js.map
27
-
28
- /***/ }),
29
-
30
- /***/ 6751:
31
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
32
-
33
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34
- /* harmony export */ "W": () => (/* binding */ useAnalyticsEvent)
35
- /* harmony export */ });
36
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
37
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
38
- /* harmony import */ var _wrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6716);
39
-
40
-
41
- const useAnalyticsEvent = (handler) => {
42
- const callback = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((message) => {
43
- try {
44
- if (message.data.name !== _wrap__WEBPACK_IMPORTED_MODULE_1__/* .ANALYTICS_EVENT_TYPE */ .vi) {
45
- return;
46
- }
47
- handler((0,_wrap__WEBPACK_IMPORTED_MODULE_1__/* .unwrap */ .Wg)(message.data));
48
- }
49
- catch (err) {
50
- console.error('Something went wrong while running Analytics handler');
51
- }
52
- }, [handler]);
53
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
54
- window.addEventListener('message', callback);
55
- return () => window.removeEventListener('message', callback);
56
- }, [callback]);
57
- };
58
- //# sourceMappingURL=useAnalyticsEvent.js.map
59
-
60
- /***/ }),
61
-
62
- /***/ 6716:
63
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64
-
65
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
66
- /* harmony export */ "Wg": () => (/* binding */ unwrap),
67
- /* harmony export */ "re": () => (/* binding */ wrap),
68
- /* harmony export */ "vi": () => (/* binding */ ANALYTICS_EVENT_TYPE)
69
- /* harmony export */ });
70
- /* unused harmony export STORE_EVENT_PREFIX */
71
- const STORE_EVENT_PREFIX = 'store:';
72
- const ANALYTICS_EVENT_TYPE = 'AnalyticsEvent';
73
- const wrap = (event) => ({
74
- name: ANALYTICS_EVENT_TYPE,
75
- params: {
76
- ...event,
77
- name: `${STORE_EVENT_PREFIX}${event.name}`,
78
- },
79
- });
80
- const unwrap = (event) => {
81
- return {
82
- ...event.params,
83
- name: event.params.name.slice(STORE_EVENT_PREFIX.length, event.params.name.length),
84
- };
85
- };
86
- //# sourceMappingURL=wrap.js.map
87
-
88
- /***/ })
89
-
90
- };
91
- ;
@@ -1,72 +0,0 @@
1
- exports.id = 576;
2
- exports.ids = [576];
3
- exports.modules = {
4
-
5
- /***/ 5576:
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,515 +0,0 @@
1
- exports.id = 608;
2
- exports.ids = [608];
3
- exports.modules = {
4
-
5
- /***/ 1432:
6
- /***/ ((module, exports, __webpack_require__) => {
7
-
8
- "client";
9
- "use strict";
10
-
11
- Object.defineProperty(exports, "__esModule", ({
12
- value: true
13
- }));
14
- exports["default"] = Image;
15
-
16
- var _extends = (__webpack_require__(6495)/* ["default"] */ .Z);
17
-
18
- var _interop_require_default = (__webpack_require__(2648)/* ["default"] */ .Z);
19
-
20
- var _interop_require_wildcard = (__webpack_require__(1598)/* ["default"] */ .Z);
21
-
22
- var _object_without_properties_loose = (__webpack_require__(7273)/* ["default"] */ .Z);
23
-
24
- var _react = _interop_require_wildcard(__webpack_require__(6689));
25
-
26
- var _head = _interop_require_default(__webpack_require__(5429));
27
-
28
- var _imageBlurSvg = __webpack_require__(4486);
29
-
30
- var _imageConfig = __webpack_require__(5843);
31
-
32
- var _imageConfigContext = __webpack_require__(744);
33
-
34
- var _utils = __webpack_require__(9232);
35
-
36
- function Image(_param) {
37
- var {
38
- src,
39
- sizes,
40
- unoptimized = false,
41
- priority = false,
42
- loading,
43
- className,
44
- quality,
45
- width,
46
- height,
47
- fill,
48
- style,
49
- onLoadingComplete,
50
- placeholder = 'empty',
51
- blurDataURL
52
- } = _param,
53
- all = _object_without_properties_loose(_param, ["src", "sizes", "unoptimized", "priority", "loading", "className", "quality", "width", "height", "fill", "style", "onLoadingComplete", "placeholder", "blurDataURL"]);
54
-
55
- const configContext = (0, _react).useContext(_imageConfigContext.ImageConfigContext);
56
- const config = (0, _react).useMemo(() => {
57
- const c = configEnv || configContext || _imageConfig.imageConfigDefault;
58
- const allSizes = [...c.deviceSizes, ...c.imageSizes].sort((a, b) => a - b);
59
- const deviceSizes = c.deviceSizes.sort((a, b) => a - b);
60
- return _extends({}, c, {
61
- allSizes,
62
- deviceSizes
63
- });
64
- }, [configContext]);
65
- let rest = all;
66
- let loader = defaultLoader;
67
-
68
- if ('loader' in rest) {
69
- if (rest.loader) {
70
- const customImageLoader = rest.loader;
71
-
72
- var _tmp;
73
-
74
- _tmp = obj => {
75
- const {
76
- config: _
77
- } = obj,
78
- opts = _object_without_properties_loose(obj, ["config"]); // The config object is internal only so we must
79
- // not pass it to the user-defined loader()
80
-
81
-
82
- return customImageLoader(opts);
83
- }, loader = _tmp, _tmp;
84
- } // Remove property so it's not spread on <img>
85
-
86
-
87
- delete rest.loader;
88
- }
89
-
90
- let staticSrc = '';
91
- let widthInt = getInt(width);
92
- let heightInt = getInt(height);
93
- let blurWidth;
94
- let blurHeight;
95
-
96
- if (isStaticImport(src)) {
97
- const staticImageData = isStaticRequire(src) ? src.default : src;
98
-
99
- if (!staticImageData.src) {
100
- throw new Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(staticImageData)}`);
101
- }
102
-
103
- if (!staticImageData.height || !staticImageData.width) {
104
- throw new Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(staticImageData)}`);
105
- }
106
-
107
- blurWidth = staticImageData.blurWidth;
108
- blurHeight = staticImageData.blurHeight;
109
- blurDataURL = blurDataURL || staticImageData.blurDataURL;
110
- staticSrc = staticImageData.src;
111
-
112
- if (!fill) {
113
- if (!widthInt && !heightInt) {
114
- widthInt = staticImageData.width;
115
- heightInt = staticImageData.height;
116
- } else if (widthInt && !heightInt) {
117
- const ratio = widthInt / staticImageData.width;
118
- heightInt = Math.round(staticImageData.height * ratio);
119
- } else if (!widthInt && heightInt) {
120
- const ratio = heightInt / staticImageData.height;
121
- widthInt = Math.round(staticImageData.width * ratio);
122
- }
123
- }
124
- }
125
-
126
- src = typeof src === 'string' ? src : staticSrc;
127
- let isLazy = !priority && (loading === 'lazy' || typeof loading === 'undefined');
128
-
129
- if (src.startsWith('data:') || src.startsWith('blob:')) {
130
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
131
- unoptimized = true;
132
- isLazy = false;
133
- }
134
-
135
- if (config.unoptimized) {
136
- unoptimized = true;
137
- }
138
-
139
- const [blurComplete, setBlurComplete] = (0, _react).useState(false);
140
- const [showAltText, setShowAltText] = (0, _react).useState(false);
141
- const qualityInt = getInt(quality);
142
-
143
- if (false) {}
144
-
145
- const imgStyle = Object.assign(fill ? {
146
- position: 'absolute',
147
- height: '100%',
148
- width: '100%',
149
- left: 0,
150
- top: 0,
151
- right: 0,
152
- bottom: 0
153
- } : {}, showAltText ? {} : {
154
- color: 'transparent'
155
- }, style);
156
- const blurStyle = placeholder === 'blur' && blurDataURL && !blurComplete ? {
157
- backgroundSize: imgStyle.objectFit || 'cover',
158
- backgroundPosition: imgStyle.objectPosition || '50% 50%',
159
- backgroundRepeat: 'no-repeat',
160
- backgroundImage: `url("data:image/svg+xml;charset=utf-8,${(0, _imageBlurSvg).getImageBlurSvg({
161
- widthInt,
162
- heightInt,
163
- blurWidth,
164
- blurHeight,
165
- blurDataURL
166
- })}")`
167
- } : {};
168
-
169
- if (false) {}
170
-
171
- const imgAttributes = generateImgAttrs({
172
- config,
173
- src,
174
- unoptimized,
175
- width: widthInt,
176
- quality: qualityInt,
177
- sizes,
178
- loader
179
- });
180
- let srcString = src;
181
-
182
- if (false) {}
183
-
184
- let imageSrcSetPropName = 'imagesrcset';
185
- let imageSizesPropName = 'imagesizes';
186
-
187
- if (true) {
188
- imageSrcSetPropName = 'imageSrcSet';
189
- imageSizesPropName = 'imageSizes';
190
- }
191
-
192
- const linkProps = {
193
- // Note: imagesrcset and imagesizes are not in the link element type with react 17.
194
- [imageSrcSetPropName]: imgAttributes.srcSet,
195
- [imageSizesPropName]: imgAttributes.sizes,
196
- crossOrigin: rest.crossOrigin
197
- };
198
- const onLoadingCompleteRef = (0, _react).useRef(onLoadingComplete);
199
- (0, _react).useEffect(() => {
200
- onLoadingCompleteRef.current = onLoadingComplete;
201
- }, [onLoadingComplete]);
202
-
203
- const imgElementArgs = _extends({
204
- isLazy,
205
- imgAttributes,
206
- heightInt,
207
- widthInt,
208
- qualityInt,
209
- className,
210
- imgStyle,
211
- blurStyle,
212
- loading,
213
- config,
214
- fill,
215
- unoptimized,
216
- placeholder,
217
- loader,
218
- srcString,
219
- onLoadingCompleteRef,
220
- setBlurComplete,
221
- setShowAltText
222
- }, rest);
223
-
224
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ImageElement, Object.assign({}, imgElementArgs)), priority ? // Note how we omit the `href` attribute, as it would only be relevant
225
- // for browsers that do not support `imagesrcset`, and in those cases
226
- // it would likely cause the incorrect image to be preloaded.
227
- //
228
- // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset
229
-
230
- /*#__PURE__*/
231
- _react.default.createElement(_head.default, null, /*#__PURE__*/_react.default.createElement("link", Object.assign({
232
- key: '__nimg-' + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes,
233
- rel: "preload",
234
- as: "image",
235
- href: imgAttributes.srcSet ? undefined : imgAttributes.src
236
- }, linkProps))) : null);
237
- }
238
-
239
- 'client';
240
- const configEnv = {"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","dangerouslyAllowSVG":false,"unoptimized":false};
241
- const allImgs = new Map();
242
- let perfObserver;
243
-
244
- if (true) {
245
- global.__NEXT_IMAGE_IMPORTED = true;
246
- }
247
-
248
- const VALID_LOADING_VALUES = (/* unused pure expression or super */ null && (['lazy', 'eager', undefined]));
249
-
250
- function isStaticRequire(src) {
251
- return src.default !== undefined;
252
- }
253
-
254
- function isStaticImageData(src) {
255
- return src.src !== undefined;
256
- }
257
-
258
- function isStaticImport(src) {
259
- return typeof src === 'object' && (isStaticRequire(src) || isStaticImageData(src));
260
- }
261
-
262
- function getWidths({
263
- deviceSizes,
264
- allSizes
265
- }, width, sizes) {
266
- if (sizes) {
267
- // Find all the "vw" percent sizes used in the sizes prop
268
- const viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
269
- const percentSizes = [];
270
-
271
- for (let match; match = viewportWidthRe.exec(sizes); match) {
272
- percentSizes.push(parseInt(match[2]));
273
- }
274
-
275
- if (percentSizes.length) {
276
- const smallestRatio = Math.min(...percentSizes) * 0.01;
277
- return {
278
- widths: allSizes.filter(s => s >= deviceSizes[0] * smallestRatio),
279
- kind: 'w'
280
- };
281
- }
282
-
283
- return {
284
- widths: allSizes,
285
- kind: 'w'
286
- };
287
- }
288
-
289
- if (typeof width !== 'number') {
290
- return {
291
- widths: deviceSizes,
292
- kind: 'w'
293
- };
294
- }
295
-
296
- const widths = [...new Set( // > This means that most OLED screens that say they are 3x resolution,
297
- // > are actually 3x in the green color, but only 1.5x in the red and
298
- // > blue colors. Showing a 3x resolution image in the app vs a 2x
299
- // > resolution image will be visually the same, though the 3x image
300
- // > takes significantly more data. Even true 3x resolution screens are
301
- // > wasteful as the human eye cannot see that level of detail without
302
- // > something like a magnifying glass.
303
- // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
304
- [width, width * 2
305
- /*, width * 3*/
306
- ].map(w => allSizes.find(p => p >= w) || allSizes[allSizes.length - 1]))];
307
- return {
308
- widths,
309
- kind: 'x'
310
- };
311
- }
312
-
313
- function generateImgAttrs({
314
- config,
315
- src,
316
- unoptimized,
317
- width,
318
- quality,
319
- sizes,
320
- loader
321
- }) {
322
- if (unoptimized) {
323
- return {
324
- src,
325
- srcSet: undefined,
326
- sizes: undefined
327
- };
328
- }
329
-
330
- const {
331
- widths,
332
- kind
333
- } = getWidths(config, width, sizes);
334
- const last = widths.length - 1;
335
- return {
336
- sizes: !sizes && kind === 'w' ? '100vw' : sizes,
337
- srcSet: widths.map((w, i) => `${loader({
338
- config,
339
- src,
340
- quality,
341
- width: w
342
- })} ${kind === 'w' ? w : i + 1}${kind}`).join(', '),
343
- // It's intended to keep `src` the last attribute because React updates
344
- // attributes in order. If we keep `src` the first one, Safari will
345
- // immediately start to fetch `src`, before `sizes` and `srcSet` are even
346
- // updated by React. That causes multiple unnecessary requests if `srcSet`
347
- // and `sizes` are defined.
348
- // This bug cannot be reproduced in Chrome or Firefox.
349
- src: loader({
350
- config,
351
- src,
352
- quality,
353
- width: widths[last]
354
- })
355
- };
356
- }
357
-
358
- function getInt(x) {
359
- if (typeof x === 'number' || typeof x === 'undefined') {
360
- return x;
361
- }
362
-
363
- if (typeof x === 'string' && /^[0-9]+$/.test(x)) {
364
- return parseInt(x, 10);
365
- }
366
-
367
- return NaN;
368
- } // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
369
- // handler instead of the img's onLoad attribute.
370
-
371
-
372
- function handleLoading(img, src, placeholder, onLoadingCompleteRef, setBlurComplete) {
373
- if (!img || img['data-loaded-src'] === src) {
374
- return;
375
- }
376
-
377
- img['data-loaded-src'] = src;
378
- const p = 'decode' in img ? img.decode() : Promise.resolve();
379
- p.catch(() => {}).then(() => {
380
- if (!img.parentNode) {
381
- // Exit early in case of race condition:
382
- // - onload() is called
383
- // - decode() is called but incomplete
384
- // - unmount is called
385
- // - decode() completes
386
- return;
387
- }
388
-
389
- if (placeholder === 'blur') {
390
- setBlurComplete(true);
391
- }
392
-
393
- if (onLoadingCompleteRef == null ? void 0 : onLoadingCompleteRef.current) {
394
- onLoadingCompleteRef.current(img);
395
- }
396
-
397
- if (false) {}
398
- });
399
- }
400
-
401
- const ImageElement = _param => {
402
- var {
403
- imgAttributes,
404
- heightInt,
405
- widthInt,
406
- qualityInt,
407
- className,
408
- imgStyle,
409
- blurStyle,
410
- isLazy,
411
- fill,
412
- placeholder,
413
- loading,
414
- srcString,
415
- config,
416
- unoptimized,
417
- loader,
418
- onLoadingCompleteRef,
419
- setBlurComplete,
420
- setShowAltText,
421
- onLoad,
422
- onError
423
- } = _param,
424
- rest = _object_without_properties_loose(_param, ["imgAttributes", "heightInt", "widthInt", "qualityInt", "className", "imgStyle", "blurStyle", "isLazy", "fill", "placeholder", "loading", "srcString", "config", "unoptimized", "loader", "onLoadingCompleteRef", "setBlurComplete", "setShowAltText", "onLoad", "onError"]);
425
-
426
- loading = isLazy ? 'lazy' : loading;
427
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("img", Object.assign({}, rest, imgAttributes, {
428
- width: widthInt,
429
- height: heightInt,
430
- decoding: "async",
431
- "data-nimg": `future${fill ? '-fill' : ''}`,
432
- className: className,
433
- // @ts-ignore - TODO: upgrade to `@types/react@17`
434
- loading: loading,
435
- style: _extends({}, imgStyle, blurStyle),
436
- ref: (0, _react).useCallback(img => {
437
- if (!img) {
438
- return;
439
- }
440
-
441
- if (onError) {
442
- // If the image has an error before react hydrates, then the error is lost.
443
- // The workaround is to wait until the image is mounted which is after hydration,
444
- // then we set the src again to trigger the error handler (if there was an error).
445
- // eslint-disable-next-line no-self-assign
446
- img.src = img.src;
447
- }
448
-
449
- if (false) {}
450
-
451
- if (img.complete) {
452
- handleLoading(img, srcString, placeholder, onLoadingCompleteRef, setBlurComplete);
453
- }
454
- }, [srcString, placeholder, onLoadingCompleteRef, setBlurComplete, onError]),
455
- onLoad: event => {
456
- const img = event.currentTarget;
457
- handleLoading(img, srcString, placeholder, onLoadingCompleteRef, setBlurComplete);
458
-
459
- if (onLoad) {
460
- onLoad(event);
461
- }
462
- },
463
- onError: event => {
464
- // if the real image fails to load, this will ensure "alt" is visible
465
- setShowAltText(true);
466
-
467
- if (placeholder === 'blur') {
468
- // If the real image fails to load, this will still remove the placeholder.
469
- setBlurComplete(true);
470
- }
471
-
472
- if (onError) {
473
- onError(event);
474
- }
475
- }
476
- })));
477
- };
478
-
479
- function defaultLoader({
480
- config,
481
- src,
482
- width,
483
- quality
484
- }) {
485
- if (false) {}
486
-
487
- if (src.endsWith('.svg') && !config.dangerouslyAllowSVG) {
488
- // Special case to make svg serve as-is to avoid proxying
489
- // through the built-in Image Optimization API.
490
- return src;
491
- }
492
-
493
- return `${config.path}?url=${encodeURIComponent(src)}&w=${width}&q=${quality || 75}`;
494
- }
495
-
496
- if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
497
- Object.defineProperty(exports.default, '__esModule', {
498
- value: true
499
- });
500
- Object.assign(exports.default, exports);
501
- module.exports = exports.default;
502
- }
503
-
504
- /***/ }),
505
-
506
- /***/ 1608:
507
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
508
-
509
- module.exports = __webpack_require__(1432)
510
-
511
-
512
- /***/ })
513
-
514
- };
515
- ;