@faststore/core 2.2.42 → 2.2.44
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/117.js +1 -1
- package/.next/server/chunks/312.js +4 -4
- package/.next/server/chunks/350.js +2650 -16
- package/.next/server/chunks/390.js +1 -1
- package/.next/server/chunks/404.js +434 -0
- package/.next/server/chunks/57.js +434 -0
- package/.next/server/chunks/732.js +3 -3
- package/.next/server/chunks/74.js +5 -5
- package/.next/server/chunks/988.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/[...slug].js +13 -21
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +15 -23
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +2631 -96
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages-manifest.json +2 -2
- package/.next/trace +80 -78
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +11 -16
- package/package.json +20 -16
- package/.next/server/chunks/52.js +0 -4007
- package/.next/server/chunks/817.js +0 -4007
- /package/.next/static/{A0luZO19pCRpHHJjixWd9 → MJDhrWnxP4OY6Sz-u3PEu}/_buildManifest.js +0 -0
- /package/.next/static/{A0luZO19pCRpHHJjixWd9 → MJDhrWnxP4OY6Sz-u3PEu}/_ssgManifest.js +0 -0
|
@@ -5,195 +5,2723 @@ exports.id = 702;
|
|
|
5
5
|
exports.ids = [702];
|
|
6
6
|
exports.modules = {
|
|
7
7
|
|
|
8
|
-
/***/
|
|
8
|
+
/***/ 6330:
|
|
9
9
|
/***/ ((module) => {
|
|
10
10
|
|
|
11
|
-
module.exports = require("
|
|
11
|
+
module.exports = require("deepmerge");
|
|
12
12
|
|
|
13
13
|
/***/ }),
|
|
14
14
|
|
|
15
|
-
/***/
|
|
15
|
+
/***/ 7343:
|
|
16
16
|
/***/ ((module) => {
|
|
17
17
|
|
|
18
|
-
module.exports = require("
|
|
18
|
+
module.exports = require("graphql");
|
|
19
19
|
|
|
20
20
|
/***/ }),
|
|
21
21
|
|
|
22
|
-
/***/
|
|
22
|
+
/***/ 1423:
|
|
23
23
|
/***/ ((module) => {
|
|
24
24
|
|
|
25
|
-
module.exports = require("
|
|
25
|
+
module.exports = require("path");
|
|
26
26
|
|
|
27
27
|
/***/ }),
|
|
28
28
|
|
|
29
|
-
/***/
|
|
29
|
+
/***/ 9664:
|
|
30
30
|
/***/ ((module) => {
|
|
31
31
|
|
|
32
|
-
module.exports =
|
|
32
|
+
module.exports = import("@envelop/core");;
|
|
33
33
|
|
|
34
34
|
/***/ }),
|
|
35
35
|
|
|
36
|
-
/***/
|
|
36
|
+
/***/ 7886:
|
|
37
37
|
/***/ ((module) => {
|
|
38
38
|
|
|
39
|
-
module.exports =
|
|
39
|
+
module.exports = import("@envelop/graphql-jit");;
|
|
40
40
|
|
|
41
41
|
/***/ }),
|
|
42
42
|
|
|
43
|
-
/***/
|
|
43
|
+
/***/ 4656:
|
|
44
44
|
/***/ ((module) => {
|
|
45
45
|
|
|
46
|
-
module.exports =
|
|
46
|
+
module.exports = import("@envelop/parser-cache");;
|
|
47
47
|
|
|
48
48
|
/***/ }),
|
|
49
49
|
|
|
50
|
-
/***/
|
|
50
|
+
/***/ 6093:
|
|
51
51
|
/***/ ((module) => {
|
|
52
52
|
|
|
53
|
-
module.exports =
|
|
53
|
+
module.exports = import("@envelop/validation-cache");;
|
|
54
54
|
|
|
55
55
|
/***/ }),
|
|
56
56
|
|
|
57
|
-
/***/
|
|
57
|
+
/***/ 5774:
|
|
58
58
|
/***/ ((module) => {
|
|
59
59
|
|
|
60
|
-
module.exports =
|
|
60
|
+
module.exports = import("@graphql-tools/load-files");;
|
|
61
61
|
|
|
62
62
|
/***/ }),
|
|
63
63
|
|
|
64
|
-
/***/
|
|
64
|
+
/***/ 6550:
|
|
65
65
|
/***/ ((module) => {
|
|
66
66
|
|
|
67
|
-
module.exports =
|
|
67
|
+
module.exports = import("@graphql-tools/schema");;
|
|
68
68
|
|
|
69
69
|
/***/ }),
|
|
70
70
|
|
|
71
|
-
/***/
|
|
71
|
+
/***/ 8722:
|
|
72
72
|
/***/ ((module) => {
|
|
73
73
|
|
|
74
|
-
module.exports =
|
|
74
|
+
module.exports = import("@graphql-tools/utils");;
|
|
75
75
|
|
|
76
76
|
/***/ }),
|
|
77
77
|
|
|
78
|
-
/***/
|
|
79
|
-
/***/ ((module) => {
|
|
78
|
+
/***/ 2466:
|
|
79
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
80
80
|
|
|
81
|
-
module
|
|
81
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
82
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
83
|
+
/* harmony export */ "P": () => (/* binding */ stringify),
|
|
84
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
85
|
+
/* harmony export */ });
|
|
86
|
+
/* harmony import */ var _graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8722);
|
|
87
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__]);
|
|
88
|
+
_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
89
|
+
|
|
90
|
+
const NAME = "cacheControl";
|
|
91
|
+
const stringify = ({ scope = "private", sMaxAge = 0, staleWhileRevalidate = 0 }) => `${scope}, s-maxage=${sMaxAge}, stale-while-revalidate=${staleWhileRevalidate}`;
|
|
92
|
+
const min = (a, b) => {
|
|
93
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
94
|
+
return a > b ? b : a;
|
|
95
|
+
}
|
|
96
|
+
if (typeof a === "number") {
|
|
97
|
+
return a;
|
|
98
|
+
}
|
|
99
|
+
return b;
|
|
100
|
+
};
|
|
101
|
+
const minScope = (a, b) => {
|
|
102
|
+
if (typeof a === "string" && typeof b === "string") {
|
|
103
|
+
return a === "public" && b === "public" ? "public" : "private";
|
|
104
|
+
}
|
|
105
|
+
return a || b;
|
|
106
|
+
};
|
|
107
|
+
const directive = {
|
|
108
|
+
typeDefs: `directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION`,
|
|
109
|
+
transformer: (schema) => (0,_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__.mapSchema)(schema, {
|
|
110
|
+
[_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__.MapperKind.OBJECT_FIELD]: (fieldConfig) => {
|
|
111
|
+
const cacheControl = (0,_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__.getDirective)(schema, fieldConfig, NAME)?.[0];
|
|
112
|
+
if (cacheControl) {
|
|
113
|
+
const { sMaxAge, staleWhileRevalidate, scope } = cacheControl;
|
|
114
|
+
const resolver = fieldConfig.resolve;
|
|
115
|
+
fieldConfig.resolve = (obj, args, ctx, info) => {
|
|
116
|
+
ctx.cacheControl = {
|
|
117
|
+
sMaxAge: min(ctx.cacheControl?.sMaxAge, sMaxAge),
|
|
118
|
+
staleWhileRevalidate: min(ctx.cacheControl?.staleWhileRevalidate, staleWhileRevalidate),
|
|
119
|
+
scope: minScope(ctx.cacheControl?.scope, scope),
|
|
120
|
+
};
|
|
121
|
+
return resolver?.(obj, args, ctx, info);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return fieldConfig;
|
|
125
|
+
},
|
|
126
|
+
}),
|
|
127
|
+
};
|
|
128
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (directive);
|
|
129
|
+
//# sourceMappingURL=cacheControl.js.map
|
|
130
|
+
__webpack_async_result__();
|
|
131
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
82
132
|
|
|
83
133
|
/***/ }),
|
|
84
134
|
|
|
85
|
-
/***/
|
|
86
|
-
/***/ ((module) => {
|
|
135
|
+
/***/ 7449:
|
|
136
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
87
137
|
|
|
88
|
-
module
|
|
138
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
139
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
140
|
+
/* harmony export */ "E9": () => (/* binding */ getContextFactory),
|
|
141
|
+
/* harmony export */ "T9": () => (/* reexport safe */ _platforms_errors__WEBPACK_IMPORTED_MODULE_3__.T9),
|
|
142
|
+
/* harmony export */ "Ve": () => (/* reexport safe */ _directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__.P),
|
|
143
|
+
/* harmony export */ "yd": () => (/* binding */ getResolvers)
|
|
144
|
+
/* harmony export */ });
|
|
145
|
+
/* unused harmony exports getTypeDefs, getSchema */
|
|
146
|
+
/* harmony import */ var _platforms_vtex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9567);
|
|
147
|
+
/* harmony import */ var _typeDefs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1419);
|
|
148
|
+
/* harmony import */ var _directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2466);
|
|
149
|
+
/* harmony import */ var _platforms_errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(125);
|
|
150
|
+
/* harmony import */ var _telemetry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1547);
|
|
151
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_typeDefs__WEBPACK_IMPORTED_MODULE_1__, _directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__]);
|
|
152
|
+
([_typeDefs__WEBPACK_IMPORTED_MODULE_1__, _directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
89
153
|
|
|
90
|
-
/***/ }),
|
|
91
154
|
|
|
92
|
-
/***/ 7881:
|
|
93
|
-
/***/ ((module) => {
|
|
94
155
|
|
|
95
|
-
module.exports = require("isomorphic-unfetch");
|
|
96
156
|
|
|
97
|
-
/***/ }),
|
|
98
157
|
|
|
99
|
-
/***/ 5471:
|
|
100
|
-
/***/ ((module) => {
|
|
101
158
|
|
|
102
|
-
module.exports = require("p-limit");
|
|
103
159
|
|
|
104
|
-
/***/ }),
|
|
105
160
|
|
|
106
|
-
|
|
107
|
-
|
|
161
|
+
const platforms = {
|
|
162
|
+
vtex: {
|
|
163
|
+
getResolvers: _platforms_vtex__WEBPACK_IMPORTED_MODULE_0__/* .getResolvers */ .y,
|
|
164
|
+
getContextFactory: _platforms_vtex__WEBPACK_IMPORTED_MODULE_0__/* .getContextFactory */ .E,
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
const directives = [
|
|
168
|
+
_directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z
|
|
169
|
+
];
|
|
170
|
+
const getTypeDefs = () => [typeDefs, ...directives.map(d => d.typeDefs)];
|
|
171
|
+
const getResolvers = (options) => platforms[options.platform].getResolvers(options);
|
|
172
|
+
const getContextFactory = (options) => platforms[options.platform].getContextFactory(options);
|
|
173
|
+
const getSchema = async (options) => {
|
|
174
|
+
const schema = makeExecutableSchema({
|
|
175
|
+
resolvers: getResolvers(options),
|
|
176
|
+
typeDefs: getTypeDefs(),
|
|
177
|
+
});
|
|
178
|
+
return directives.reduce((s, d) => d.transformer(s), schema);
|
|
179
|
+
};
|
|
108
180
|
|
|
109
|
-
|
|
181
|
+
//# sourceMappingURL=index.js.map
|
|
182
|
+
__webpack_async_result__();
|
|
183
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
110
184
|
|
|
111
185
|
/***/ }),
|
|
112
186
|
|
|
113
|
-
/***/
|
|
114
|
-
/***/ ((
|
|
187
|
+
/***/ 125:
|
|
188
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
115
189
|
|
|
116
|
-
|
|
190
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
191
|
+
/* harmony export */ "T9": () => (/* binding */ isFastStoreError),
|
|
192
|
+
/* harmony export */ "dR": () => (/* binding */ NotFoundError),
|
|
193
|
+
/* harmony export */ "oY": () => (/* binding */ BadRequestError)
|
|
194
|
+
/* harmony export */ });
|
|
195
|
+
/* unused harmony exports isNotFoundError, isBadRequestError */
|
|
196
|
+
class FastStoreError extends Error {
|
|
197
|
+
extensions;
|
|
198
|
+
constructor(extensions, message) {
|
|
199
|
+
super(message);
|
|
200
|
+
this.extensions = extensions;
|
|
201
|
+
this.name = 'FastStoreError';
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
class BadRequestError extends FastStoreError {
|
|
205
|
+
constructor(message) {
|
|
206
|
+
super({ status: 400, type: 'BadRequestError' }, message);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
class NotFoundError extends FastStoreError {
|
|
210
|
+
constructor(message) {
|
|
211
|
+
super({ status: 404, type: 'NotFoundError' }, message);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const isFastStoreError = (error) => error?.name === 'FastStoreError';
|
|
215
|
+
const isNotFoundError = (error) => error?.extensions?.type === 'NotFoundError';
|
|
216
|
+
const isBadRequestError = (error) => error?.extensions?.type === 'BadRequestError';
|
|
217
|
+
//# sourceMappingURL=errors.js.map
|
|
117
218
|
|
|
118
219
|
/***/ }),
|
|
119
220
|
|
|
120
|
-
/***/
|
|
121
|
-
/***/ ((
|
|
221
|
+
/***/ 9567:
|
|
222
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
122
223
|
|
|
123
|
-
module.exports = require("tslib");
|
|
124
224
|
|
|
125
|
-
|
|
225
|
+
// EXPORTS
|
|
226
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
227
|
+
"E": () => (/* binding */ getContextFactory),
|
|
228
|
+
"y": () => (/* binding */ getResolvers)
|
|
229
|
+
});
|
|
126
230
|
|
|
127
|
-
|
|
128
|
-
|
|
231
|
+
;// CONCATENATED MODULE: external "isomorphic-unfetch"
|
|
232
|
+
const external_isomorphic_unfetch_namespaceObject = require("isomorphic-unfetch");
|
|
233
|
+
var external_isomorphic_unfetch_default = /*#__PURE__*/__webpack_require__.n(external_isomorphic_unfetch_namespaceObject);
|
|
234
|
+
// EXTERNAL MODULE: ../api/dist/esm/package.json
|
|
235
|
+
var esm_package = __webpack_require__(5713);
|
|
236
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/fetch.js
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
const USER_AGENT = `${esm_package/* name */.u2}@${esm_package/* version */.i8}`;
|
|
240
|
+
const fetchAPI = async (info, init) => {
|
|
241
|
+
const response = await external_isomorphic_unfetch_default()(info, {
|
|
242
|
+
...init,
|
|
243
|
+
headers: {
|
|
244
|
+
...init?.headers,
|
|
245
|
+
'User-Agent': USER_AGENT,
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
if (response.ok) {
|
|
249
|
+
return response.status !== 204 ? response.json() : undefined;
|
|
250
|
+
}
|
|
251
|
+
console.error(info, init, response);
|
|
252
|
+
const text = await response.text();
|
|
253
|
+
throw new Error(text);
|
|
254
|
+
};
|
|
255
|
+
//# sourceMappingURL=fetch.js.map
|
|
256
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/commerce/index.js
|
|
257
|
+
|
|
258
|
+
const BASE_INIT = {
|
|
259
|
+
method: 'POST',
|
|
260
|
+
headers: {
|
|
261
|
+
'content-type': 'application/json',
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
const VtexCommerce = ({ account, environment, incrementAddress }, ctx) => {
|
|
265
|
+
const base = `https://${account}.${environment}.com.br`;
|
|
266
|
+
return {
|
|
267
|
+
catalog: {
|
|
268
|
+
salesChannel: (sc) => fetchAPI(`${base}/api/catalog_system/pub/saleschannel/${sc}`),
|
|
269
|
+
brand: {
|
|
270
|
+
list: () => fetchAPI(`${base}/api/catalog_system/pub/brand/list`),
|
|
271
|
+
},
|
|
272
|
+
category: {
|
|
273
|
+
tree: (depth = 3) => fetchAPI(`${base}/api/catalog_system/pub/category/tree/${depth}`),
|
|
274
|
+
},
|
|
275
|
+
portal: {
|
|
276
|
+
pagetype: (slug) => fetchAPI(`${base}/api/catalog_system/pub/portal/pagetype/${slug}`),
|
|
277
|
+
},
|
|
278
|
+
products: {
|
|
279
|
+
crossselling: ({ type, productId, groupByProduct = true, }) => {
|
|
280
|
+
const params = new URLSearchParams({
|
|
281
|
+
sc: ctx.storage.channel.salesChannel,
|
|
282
|
+
groupByProduct: groupByProduct.toString(),
|
|
283
|
+
});
|
|
284
|
+
return fetchAPI(`${base}/api/catalog_system/pub/products/crossselling/${type}/${productId}?${params}`);
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
checkout: {
|
|
289
|
+
simulation: (args, { salesChannel } = ctx.storage.channel) => {
|
|
290
|
+
const params = new URLSearchParams({
|
|
291
|
+
sc: salesChannel,
|
|
292
|
+
});
|
|
293
|
+
return fetchAPI(`${base}/api/checkout/pub/orderForms/simulation?${params.toString()}`, {
|
|
294
|
+
...BASE_INIT,
|
|
295
|
+
body: JSON.stringify(args),
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
shippingData: ({ id, index, deliveryMode, selectedAddresses, }, setDeliveryWindow) => {
|
|
299
|
+
const deliveryWindow = setDeliveryWindow
|
|
300
|
+
? {
|
|
301
|
+
startDateUtc: deliveryMode?.deliveryWindow?.startDate,
|
|
302
|
+
endDateUtc: deliveryMode?.deliveryWindow?.endDate,
|
|
303
|
+
}
|
|
304
|
+
: null;
|
|
305
|
+
const mappedBody = {
|
|
306
|
+
logisticsInfo: Array.from({ length: index }, (_, itemIndex) => ({
|
|
307
|
+
itemIndex,
|
|
308
|
+
selectedDeliveryChannel: deliveryMode?.deliveryChannel || null,
|
|
309
|
+
selectedSla: deliveryMode?.deliveryMethod || null,
|
|
310
|
+
deliveryWindow: deliveryWindow,
|
|
311
|
+
})),
|
|
312
|
+
selectedAddresses: selectedAddresses,
|
|
313
|
+
clearAddressIfPostalCodeNotFound: incrementAddress,
|
|
314
|
+
};
|
|
315
|
+
return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/attachments/shippingData`, {
|
|
316
|
+
...BASE_INIT,
|
|
317
|
+
body: JSON.stringify(mappedBody),
|
|
318
|
+
headers: {
|
|
319
|
+
'content-type': 'application/json',
|
|
320
|
+
cookie: ctx.headers.cookie,
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
orderForm: ({ id, refreshOutdatedData = true, channel = ctx.storage.channel, }) => {
|
|
325
|
+
const { salesChannel } = channel;
|
|
326
|
+
const params = new URLSearchParams({
|
|
327
|
+
refreshOutdatedData: refreshOutdatedData.toString(),
|
|
328
|
+
sc: salesChannel,
|
|
329
|
+
});
|
|
330
|
+
const requestInit = ctx.headers
|
|
331
|
+
? {
|
|
332
|
+
...BASE_INIT,
|
|
333
|
+
headers: {
|
|
334
|
+
'content-type': 'application/json',
|
|
335
|
+
cookie: ctx.headers.cookie,
|
|
336
|
+
},
|
|
337
|
+
}
|
|
338
|
+
: BASE_INIT;
|
|
339
|
+
return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}?${params.toString()}`, requestInit);
|
|
340
|
+
},
|
|
341
|
+
clearOrderFormMessages: ({ id }) => {
|
|
342
|
+
return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/messages/clear`, {
|
|
343
|
+
...BASE_INIT,
|
|
344
|
+
body: '{}',
|
|
345
|
+
});
|
|
346
|
+
},
|
|
347
|
+
updateOrderFormItems: ({ id, orderItems, allowOutdatedData = 'paymentData', salesChannel = ctx.storage.channel.salesChannel, shouldSplitItem = true, }) => {
|
|
348
|
+
const params = new URLSearchParams({
|
|
349
|
+
allowOutdatedData,
|
|
350
|
+
sc: salesChannel,
|
|
351
|
+
});
|
|
352
|
+
const items = JSON.stringify({
|
|
353
|
+
orderItems,
|
|
354
|
+
noSplitItem: !shouldSplitItem,
|
|
355
|
+
});
|
|
356
|
+
const requestInit = ctx.headers
|
|
357
|
+
? {
|
|
358
|
+
headers: {
|
|
359
|
+
'content-type': 'application/json',
|
|
360
|
+
cookie: ctx.headers.cookie,
|
|
361
|
+
},
|
|
362
|
+
body: items,
|
|
363
|
+
method: 'PATCH',
|
|
364
|
+
}
|
|
365
|
+
: {
|
|
366
|
+
headers: {
|
|
367
|
+
'content-type': 'application/json',
|
|
368
|
+
},
|
|
369
|
+
body: items,
|
|
370
|
+
method: 'PATCH',
|
|
371
|
+
};
|
|
372
|
+
return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/items?${params}`, requestInit);
|
|
373
|
+
},
|
|
374
|
+
setCustomData: ({ id, appId, key, value, }) => {
|
|
375
|
+
return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/customData/${appId}/${key}`, {
|
|
376
|
+
...BASE_INIT,
|
|
377
|
+
body: JSON.stringify({ value }),
|
|
378
|
+
method: 'PUT',
|
|
379
|
+
});
|
|
380
|
+
},
|
|
381
|
+
region: async ({ postalCode, geoCoordinates, country, salesChannel, }) => {
|
|
382
|
+
const params = new URLSearchParams({
|
|
383
|
+
country: country,
|
|
384
|
+
sc: salesChannel ?? '',
|
|
385
|
+
});
|
|
386
|
+
postalCode
|
|
387
|
+
? params.append('postalCode', postalCode)
|
|
388
|
+
: params.append('geoCoordinates', `${geoCoordinates?.longitude};${geoCoordinates?.latitude}`);
|
|
389
|
+
const url = `${base}/api/checkout/pub/regions/?${params.toString()}`;
|
|
390
|
+
return fetchAPI(url);
|
|
391
|
+
},
|
|
392
|
+
address: async ({ postalCode, country, }) => {
|
|
393
|
+
return fetchAPI(`${base}/api/checkout/pub/postal-code/${country}/${postalCode}`);
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
session: (search) => {
|
|
397
|
+
const params = new URLSearchParams(search);
|
|
398
|
+
params.set('items', 'profile.id,profile.email,profile.firstName,profile.lastName,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol');
|
|
399
|
+
return fetchAPI(`${base}/api/sessions?${params.toString()}`, {
|
|
400
|
+
method: 'POST',
|
|
401
|
+
headers: {
|
|
402
|
+
'content-type': 'application/json',
|
|
403
|
+
cookie: ctx.headers.cookie,
|
|
404
|
+
},
|
|
405
|
+
body: '{}',
|
|
406
|
+
});
|
|
407
|
+
},
|
|
408
|
+
subscribeToNewsletter: (data) => {
|
|
409
|
+
return fetchAPI(`${base}/api/dataentities/NL/documents/`, {
|
|
410
|
+
...BASE_INIT,
|
|
411
|
+
body: JSON.stringify({ ...data, isNewsletterOptIn: true }),
|
|
412
|
+
method: 'PATCH',
|
|
413
|
+
});
|
|
414
|
+
},
|
|
415
|
+
};
|
|
416
|
+
};
|
|
417
|
+
//# sourceMappingURL=index.js.map
|
|
418
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/search/index.js
|
|
419
|
+
|
|
420
|
+
const POLICY_KEY = 'trade-policy';
|
|
421
|
+
const REGION_KEY = 'region-id';
|
|
422
|
+
const CHANNEL_KEYS = new Set([POLICY_KEY, REGION_KEY]);
|
|
423
|
+
const isFacetBoolean = (facet) => facet.type === 'TEXT';
|
|
424
|
+
const IntelligentSearch = ({ account, environment, hideUnavailableItems }, ctx) => {
|
|
425
|
+
const base = `https://${account}.${environment}.com.br/api/io`;
|
|
426
|
+
const getPolicyFacet = () => {
|
|
427
|
+
const { salesChannel } = ctx.storage.channel;
|
|
428
|
+
if (!salesChannel) {
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
431
|
+
return {
|
|
432
|
+
key: POLICY_KEY,
|
|
433
|
+
value: salesChannel,
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
const getRegionFacet = () => {
|
|
437
|
+
const { regionId, seller } = ctx.storage.channel;
|
|
438
|
+
const sellerRegionId = seller
|
|
439
|
+
? Buffer.from(`SW#${seller}`).toString('base64')
|
|
440
|
+
: null;
|
|
441
|
+
const facet = sellerRegionId ?? regionId;
|
|
442
|
+
if (!facet) {
|
|
443
|
+
return null;
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
key: REGION_KEY,
|
|
447
|
+
value: facet,
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
const addDefaultFacets = (facets) => {
|
|
451
|
+
const withDefaultFacets = facets.filter(({ key }) => !CHANNEL_KEYS.has(key));
|
|
452
|
+
const policyFacet = facets.find(({ key }) => key === POLICY_KEY) ?? getPolicyFacet();
|
|
453
|
+
const regionFacet = facets.find(({ key }) => key === REGION_KEY) ?? getRegionFacet();
|
|
454
|
+
if (policyFacet !== null) {
|
|
455
|
+
withDefaultFacets.push(policyFacet);
|
|
456
|
+
}
|
|
457
|
+
if (regionFacet !== null) {
|
|
458
|
+
withDefaultFacets.push(regionFacet);
|
|
459
|
+
}
|
|
460
|
+
return withDefaultFacets;
|
|
461
|
+
};
|
|
462
|
+
const search = ({ query = '', page, count, sort = '', selectedFacets = [], type, fuzzy = 'auto', }) => {
|
|
463
|
+
const params = new URLSearchParams({
|
|
464
|
+
page: (page + 1).toString(),
|
|
465
|
+
count: count.toString(),
|
|
466
|
+
query,
|
|
467
|
+
sort,
|
|
468
|
+
fuzzy,
|
|
469
|
+
locale: ctx.storage.locale,
|
|
470
|
+
});
|
|
471
|
+
if (hideUnavailableItems !== undefined) {
|
|
472
|
+
params.append('hideUnavailableItems', hideUnavailableItems.toString());
|
|
473
|
+
}
|
|
474
|
+
const pathname = addDefaultFacets(selectedFacets)
|
|
475
|
+
.map(({ key, value }) => `${key}/${value}`)
|
|
476
|
+
.join('/');
|
|
477
|
+
return fetchAPI(`${base}/_v/api/intelligent-search/${type}/${pathname}?${params.toString()}`);
|
|
478
|
+
};
|
|
479
|
+
const products = (args) => search({ ...args, type: 'product_search' });
|
|
480
|
+
const suggestedTerms = (args) => {
|
|
481
|
+
const params = new URLSearchParams({
|
|
482
|
+
query: args.query?.toString() ?? '',
|
|
483
|
+
locale: ctx.storage.locale,
|
|
484
|
+
});
|
|
485
|
+
return fetchAPI(`${base}/_v/api/intelligent-search/search_suggestions?${params.toString()}`);
|
|
486
|
+
};
|
|
487
|
+
const topSearches = () => {
|
|
488
|
+
const params = new URLSearchParams({
|
|
489
|
+
locale: ctx.storage.locale,
|
|
490
|
+
});
|
|
491
|
+
return fetchAPI(`${base}/_v/api/intelligent-search/top_searches?${params.toString()}`);
|
|
492
|
+
};
|
|
493
|
+
const facets = (args) => search({ ...args, type: 'facets' });
|
|
494
|
+
return {
|
|
495
|
+
facets,
|
|
496
|
+
products,
|
|
497
|
+
suggestedTerms,
|
|
498
|
+
topSearches,
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
//# sourceMappingURL=index.js.map
|
|
502
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/sp/index.js
|
|
503
|
+
/**
|
|
504
|
+
* Client for SP, Intelligent search's analytics event API
|
|
505
|
+
* More info at: https://www.notion.so/vtexhandbook/Event-API-Documentation-48eee26730cf4d7f80f8fd7262231f84
|
|
506
|
+
*/
|
|
507
|
+
|
|
508
|
+
const THIRTY_MINUTES_S = 30 * 60;
|
|
509
|
+
const ONE_YEAR_S = 365 * 24 * 3600;
|
|
510
|
+
const randomUUID = () => (Math.random() * 1e6).toFixed(0);
|
|
511
|
+
const timelapsed = (past) => (Date.now() - past) / 1e3;
|
|
512
|
+
const createId = (expiresSecond) => {
|
|
513
|
+
let payload = randomUUID();
|
|
514
|
+
let createdAt = Date.now();
|
|
515
|
+
return () => {
|
|
516
|
+
if (timelapsed(createdAt) > expiresSecond) {
|
|
517
|
+
payload = randomUUID();
|
|
518
|
+
createdAt = Date.now();
|
|
519
|
+
}
|
|
520
|
+
return payload;
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
const user = {
|
|
524
|
+
anonymous: createId(ONE_YEAR_S),
|
|
525
|
+
session: createId(THIRTY_MINUTES_S),
|
|
526
|
+
};
|
|
527
|
+
const SP = ({ account }, _) => {
|
|
528
|
+
const base = `https://sp.vtex.com/event-api/v1/${account}/event`;
|
|
529
|
+
const sendEvent = (options) => {
|
|
530
|
+
return fetchAPI(base, {
|
|
531
|
+
method: 'POST',
|
|
532
|
+
body: JSON.stringify({
|
|
533
|
+
...options,
|
|
534
|
+
agent: '@faststore/api',
|
|
535
|
+
anonymous: user.anonymous(), // 'zZlNhqz1vFJP6iPG5Oqtt'
|
|
536
|
+
session: user.session(), // 'Om1TNluGvgmSgU5OOTvkkd'
|
|
537
|
+
}),
|
|
538
|
+
headers: {
|
|
539
|
+
'content-type': 'application/json',
|
|
540
|
+
},
|
|
541
|
+
});
|
|
542
|
+
};
|
|
543
|
+
return {
|
|
544
|
+
sendEvent,
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
//# sourceMappingURL=index.js.map
|
|
548
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/index.js
|
|
129
549
|
|
|
130
|
-
module.exports = import("@envelop/core");;
|
|
131
550
|
|
|
132
|
-
/***/ }),
|
|
133
551
|
|
|
134
|
-
|
|
135
|
-
|
|
552
|
+
const getClients = (options, ctx) => {
|
|
553
|
+
const search = IntelligentSearch(options, ctx);
|
|
554
|
+
const commerce = VtexCommerce(options, ctx);
|
|
555
|
+
const sp = SP(options, ctx);
|
|
556
|
+
return {
|
|
557
|
+
search,
|
|
558
|
+
commerce,
|
|
559
|
+
sp,
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
//# sourceMappingURL=index.js.map
|
|
563
|
+
// EXTERNAL MODULE: ../api/node_modules/dataloader/index.js
|
|
564
|
+
var dataloader = __webpack_require__(3057);
|
|
565
|
+
var dataloader_default = /*#__PURE__*/__webpack_require__.n(dataloader);
|
|
566
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/salesChannel.js
|
|
567
|
+
|
|
568
|
+
const getSalesChannelLoader = (_, clients) => {
|
|
569
|
+
const loader = async (channels) => Promise.all(channels.map((sc) => clients.commerce.catalog.salesChannel(sc)));
|
|
570
|
+
return new (dataloader_default())(loader);
|
|
571
|
+
};
|
|
572
|
+
//# sourceMappingURL=salesChannel.js.map
|
|
573
|
+
;// CONCATENATED MODULE: external "p-limit"
|
|
574
|
+
const external_p_limit_namespaceObject = require("p-limit");
|
|
575
|
+
var external_p_limit_default = /*#__PURE__*/__webpack_require__.n(external_p_limit_namespaceObject);
|
|
576
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/simulation.js
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
// Limits concurrent requests to the API per request cycle
|
|
580
|
+
const CONCURRENT_REQUESTS_MAX = 1;
|
|
581
|
+
const getSimulationLoader = (_, clients) => {
|
|
582
|
+
const limit = external_p_limit_default()(CONCURRENT_REQUESTS_MAX);
|
|
583
|
+
const loader = async (simulationArgs) => {
|
|
584
|
+
const allItems = simulationArgs.reduce((acc, { items }) => {
|
|
585
|
+
return [...acc, items];
|
|
586
|
+
}, []);
|
|
587
|
+
const items = [...allItems.flat()];
|
|
588
|
+
const simulation = await clients.commerce.checkout.simulation({
|
|
589
|
+
country: simulationArgs[0].country,
|
|
590
|
+
postalCode: simulationArgs[0].postalCode,
|
|
591
|
+
items,
|
|
592
|
+
});
|
|
593
|
+
// Sort and filter simulation since Checkout API may return
|
|
594
|
+
// items that we didn't ask for
|
|
595
|
+
const simulated = simulation.items.reduce((acc, item) => {
|
|
596
|
+
const index = item.requestIndex;
|
|
597
|
+
if (typeof index === 'number' && index < acc.length) {
|
|
598
|
+
acc[index] = item;
|
|
599
|
+
}
|
|
600
|
+
return acc;
|
|
601
|
+
}, Array(items.length).fill(null));
|
|
602
|
+
const itemsIndices = allItems.reduce((acc, curr) => [...acc, curr.length + acc[acc.length - 1]], [0]);
|
|
603
|
+
return allItems.map((__, index) => ({
|
|
604
|
+
...simulation,
|
|
605
|
+
items: simulated
|
|
606
|
+
.slice(itemsIndices[index], itemsIndices[index + 1])
|
|
607
|
+
.filter((item) => Boolean(item)),
|
|
608
|
+
}));
|
|
609
|
+
};
|
|
610
|
+
const limited = async (allItems) => limit(loader, allItems);
|
|
611
|
+
return new (dataloader_default())(limited, {
|
|
612
|
+
maxBatchSize: 50,
|
|
613
|
+
});
|
|
614
|
+
};
|
|
615
|
+
//# sourceMappingURL=simulation.js.map
|
|
616
|
+
;// CONCATENATED MODULE: external "sanitize-html"
|
|
617
|
+
const external_sanitize_html_namespaceObject = require("sanitize-html");
|
|
618
|
+
var external_sanitize_html_default = /*#__PURE__*/__webpack_require__.n(external_sanitize_html_namespaceObject);
|
|
619
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/sanitizeHtml.js
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* For now, we're using sanitize-html's default set
|
|
623
|
+
* of allowed tags and attributes, which don't even include img elements
|
|
624
|
+
*
|
|
625
|
+
* It is known many client depends on pontentially vulnerable tags, such as script tags
|
|
626
|
+
* We chose to be restrictive at first, and document those restrictions later.
|
|
627
|
+
*
|
|
628
|
+
* When expanding the set of allowed tags and attributes, please consider performance, privacy and security.
|
|
629
|
+
*
|
|
630
|
+
* This possibily breaks compatibility with Portal and Store Framework,
|
|
631
|
+
* which both allows an enormous amount of tags and attributes
|
|
632
|
+
*
|
|
633
|
+
* This was a thoughtful decision that can be reviewed in the future given
|
|
634
|
+
* research was made to back up those changes.
|
|
635
|
+
*/
|
|
636
|
+
const sanitizeHtml = (dirty, options) => external_sanitize_html_default()(dirty, options);
|
|
637
|
+
//# sourceMappingURL=sanitizeHtml.js.map
|
|
638
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/enhanceSku.js
|
|
639
|
+
|
|
640
|
+
function sanitizeProduct(product) {
|
|
641
|
+
return {
|
|
642
|
+
...product,
|
|
643
|
+
description: product.description
|
|
644
|
+
? sanitizeHtml(product.description)
|
|
645
|
+
: product.description,
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
const enhanceSku = (item, product) => ({
|
|
649
|
+
...item,
|
|
650
|
+
isVariantOf: sanitizeProduct(product),
|
|
651
|
+
});
|
|
652
|
+
//# sourceMappingURL=enhanceSku.js.map
|
|
653
|
+
// EXTERNAL MODULE: ../api/dist/esm/src/platforms/errors.js
|
|
654
|
+
var errors = __webpack_require__(125);
|
|
655
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/sku.js
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
const getSkuLoader = (_, clients) => {
|
|
660
|
+
const loader = async (skuIds) => {
|
|
661
|
+
const { products } = await clients.search.products({
|
|
662
|
+
query: `sku:${skuIds.join(';')}`,
|
|
663
|
+
page: 0,
|
|
664
|
+
count: skuIds.length,
|
|
665
|
+
});
|
|
666
|
+
const skuBySkuId = products.reduce((acc, product) => {
|
|
667
|
+
for (const sku of product.items) {
|
|
668
|
+
acc[sku.itemId] = enhanceSku(sku, product);
|
|
669
|
+
}
|
|
670
|
+
return acc;
|
|
671
|
+
}, {});
|
|
672
|
+
const skus = skuIds.map((skuId) => skuBySkuId[skuId]);
|
|
673
|
+
const missingSkus = skuIds.filter((skuId) => !skuBySkuId[skuId]);
|
|
674
|
+
if (missingSkus.length > 0) {
|
|
675
|
+
throw new errors/* NotFoundError */.dR(`Search API did not found the following skus: ${missingSkus.join(',')}`);
|
|
676
|
+
}
|
|
677
|
+
return skus;
|
|
678
|
+
};
|
|
679
|
+
return new (dataloader_default())(loader, {
|
|
680
|
+
maxBatchSize: 99, // Max allowed batch size of Search API
|
|
681
|
+
});
|
|
682
|
+
};
|
|
683
|
+
//# sourceMappingURL=sku.js.map
|
|
684
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/collection.js
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
// Limits concurrent requests to 20 so that they don't timeout
|
|
689
|
+
const collection_CONCURRENT_REQUESTS_MAX = 20;
|
|
690
|
+
const collectionPageTypes = new Set([
|
|
691
|
+
'brand',
|
|
692
|
+
'category',
|
|
693
|
+
'department',
|
|
694
|
+
'subcategory',
|
|
695
|
+
'collection',
|
|
696
|
+
'cluster',
|
|
697
|
+
]);
|
|
698
|
+
const isCollectionPageType = (x) => typeof x.pageType === 'string' &&
|
|
699
|
+
collectionPageTypes.has(x.pageType.toLowerCase());
|
|
700
|
+
const getCollectionLoader = (_, clients) => {
|
|
701
|
+
const limit = external_p_limit_default()(collection_CONCURRENT_REQUESTS_MAX);
|
|
702
|
+
const loader = async (slugs) => {
|
|
703
|
+
return Promise.all(slugs.map((slug) => limit(async () => {
|
|
704
|
+
const page = await clients.commerce.catalog.portal.pagetype(slug);
|
|
705
|
+
if (isCollectionPageType(page)) {
|
|
706
|
+
return page;
|
|
707
|
+
}
|
|
708
|
+
throw new errors/* NotFoundError */.dR(`Catalog returned ${page.pageType} for slug: ${slug}. This usually happens when there is more than one category with the same name in the same category tree level.`);
|
|
709
|
+
})));
|
|
710
|
+
};
|
|
711
|
+
return new (dataloader_default())(loader, {
|
|
712
|
+
// DataLoader is being used to cache requests, not to batch them
|
|
713
|
+
batch: false,
|
|
714
|
+
});
|
|
715
|
+
};
|
|
716
|
+
//# sourceMappingURL=collection.js.map
|
|
717
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/index.js
|
|
136
718
|
|
|
137
|
-
module.exports = import("@envelop/graphql-jit");;
|
|
138
719
|
|
|
139
|
-
/***/ }),
|
|
140
720
|
|
|
141
|
-
/***/ 4656:
|
|
142
|
-
/***/ ((module) => {
|
|
143
721
|
|
|
144
|
-
|
|
722
|
+
const getLoaders = (options, { clients }) => {
|
|
723
|
+
const skuLoader = getSkuLoader(options, clients);
|
|
724
|
+
const simulationLoader = getSimulationLoader(options, clients);
|
|
725
|
+
const collectionLoader = getCollectionLoader(options, clients);
|
|
726
|
+
const salesChannelLoader = getSalesChannelLoader(options, clients);
|
|
727
|
+
return {
|
|
728
|
+
skuLoader,
|
|
729
|
+
simulationLoader,
|
|
730
|
+
collectionLoader,
|
|
731
|
+
salesChannelLoader
|
|
732
|
+
};
|
|
733
|
+
};
|
|
734
|
+
//# sourceMappingURL=index.js.map
|
|
735
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/productStock.js
|
|
736
|
+
const inStock = (offer) => offer.AvailableQuantity > 0;
|
|
737
|
+
const price = (offer) => offer.spotPrice ?? 0;
|
|
738
|
+
const sellingPrice = (offer) => offer.Price ?? 0;
|
|
739
|
+
const availability = (available) => available ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock';
|
|
740
|
+
// Smallest Available Spot Price First
|
|
741
|
+
const bestOfferFirst = (a, b) => {
|
|
742
|
+
if (inStock(a) && !inStock(b)) {
|
|
743
|
+
return -1;
|
|
744
|
+
}
|
|
745
|
+
if (!inStock(a) && inStock(b)) {
|
|
746
|
+
return 1;
|
|
747
|
+
}
|
|
748
|
+
return price(a) - price(b);
|
|
749
|
+
};
|
|
750
|
+
const inStockOrderFormItem = (itemAvailability) => itemAvailability === 'available';
|
|
751
|
+
//# sourceMappingURL=productStock.js.map
|
|
752
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/aggregateOffer.js
|
|
753
|
+
|
|
754
|
+
const StoreAggregateOffer = {
|
|
755
|
+
highPrice: (offers) => {
|
|
756
|
+
const availableOffers = offers.filter(inStock);
|
|
757
|
+
const highOffer = availableOffers[availableOffers.length - 1];
|
|
758
|
+
return highOffer != null ? price(highOffer) : 0;
|
|
759
|
+
},
|
|
760
|
+
lowPrice: (offers) => {
|
|
761
|
+
const [lowOffer] = offers.filter(inStock);
|
|
762
|
+
return lowOffer ? price(lowOffer) : 0;
|
|
763
|
+
},
|
|
764
|
+
offerCount: (offers) => offers.length,
|
|
765
|
+
priceCurrency: async (_, __, ctx) => {
|
|
766
|
+
const { loaders: { salesChannelLoader }, storage: { channel } } = ctx;
|
|
767
|
+
const sc = await salesChannelLoader.load(channel.salesChannel);
|
|
768
|
+
return sc.CurrencyCode ?? '';
|
|
769
|
+
},
|
|
770
|
+
offers: (offers) => offers,
|
|
771
|
+
};
|
|
772
|
+
//# sourceMappingURL=aggregateOffer.js.map
|
|
773
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/aggregateRating.js
|
|
774
|
+
// TODO: Add a review system integration
|
|
775
|
+
const StoreAggregateRating = {
|
|
776
|
+
ratingValue: () => 5,
|
|
777
|
+
reviewCount: () => 0,
|
|
778
|
+
};
|
|
779
|
+
//# sourceMappingURL=aggregateRating.js.map
|
|
780
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/slugify.js
|
|
781
|
+
/**
|
|
782
|
+
* VTEX catalog slugify function
|
|
783
|
+
*
|
|
784
|
+
* Copied from:
|
|
785
|
+
* https://github.com/vtex/rewriter/blob/1ce2010783e0586cab42534ce2fb7a983d8a3a84/node/clients/catalog.ts#L72
|
|
786
|
+
*
|
|
787
|
+
* Sometimes, we need to slugify strings for creating urls. An example is the
|
|
788
|
+
* brand urls, where we create them from the brand's name.
|
|
789
|
+
* This slugify function should match exactly what VTEX catalog generates. Any mismatch
|
|
790
|
+
* will lead to broken links.
|
|
791
|
+
* Hopefully, we had this function implemented on VTEX IO and we've been using it for
|
|
792
|
+
* years now. However, looking at the code, I think we can save lots of computing. I'm
|
|
793
|
+
* in a hurry for doing these tests now, so I'll leave a small TODO.
|
|
794
|
+
*
|
|
795
|
+
* TODO: Research for better ways of computing this slugify function. Things I'd try are:
|
|
796
|
+
* - Join those 3 regexs for special characters into a single one.
|
|
797
|
+
* - Replace the regexp of `removeDiacritics` function with a Map. We can make the complexity
|
|
798
|
+
* of this function be O(n) with n=string.length
|
|
799
|
+
*
|
|
800
|
+
*/
|
|
801
|
+
const from = 'ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a';
|
|
802
|
+
const to = 'AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa';
|
|
803
|
+
const removeDiacritics = (str) => {
|
|
804
|
+
let newStr = str.slice(0);
|
|
805
|
+
for (let i = 0; i < from.length; i++) {
|
|
806
|
+
newStr = newStr.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
|
|
807
|
+
}
|
|
808
|
+
return newStr;
|
|
809
|
+
};
|
|
810
|
+
const slugifySpecialCharacters = (str) => {
|
|
811
|
+
return str.replace(/[·/_,:]/, '-');
|
|
812
|
+
};
|
|
813
|
+
function slugify(str) {
|
|
814
|
+
const noCommas = str.replace(/,/g, '');
|
|
815
|
+
const replaced = noCommas.replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, '-');
|
|
816
|
+
const slugified = slugifySpecialCharacters(removeDiacritics(replaced));
|
|
817
|
+
return slugified.toLowerCase();
|
|
818
|
+
}
|
|
819
|
+
//# sourceMappingURL=slugify.js.map
|
|
820
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/collection.js
|
|
145
821
|
|
|
146
|
-
/***/ }),
|
|
147
822
|
|
|
148
|
-
|
|
149
|
-
|
|
823
|
+
const isBrand = (x) => x.type === 'brand' ||
|
|
824
|
+
(isCollectionPageType(x) && x.pageType.toLowerCase() === 'brand');
|
|
825
|
+
const isCollection = (x) => isCollectionPageType(x) && x.pageType.toLowerCase() === 'collection';
|
|
826
|
+
const slugifyRoot = (root) => {
|
|
827
|
+
if (isBrand(root) || isCollection(root)) {
|
|
828
|
+
return slugify(root.name);
|
|
829
|
+
}
|
|
830
|
+
if (isCollectionPageType(root)) {
|
|
831
|
+
return new URL(`https://${root.url}`).pathname.slice(1).toLowerCase();
|
|
832
|
+
}
|
|
833
|
+
return new URL(root.url).pathname.slice(1).toLowerCase();
|
|
834
|
+
};
|
|
835
|
+
const StoreCollection = {
|
|
836
|
+
id: ({ id }) => id.toString(),
|
|
837
|
+
slug: (root) => slugifyRoot(root),
|
|
838
|
+
seo: (root) => isBrand(root) || isCollectionPageType(root)
|
|
839
|
+
? {
|
|
840
|
+
title: root.title,
|
|
841
|
+
description: root.metaTagDescription,
|
|
842
|
+
}
|
|
843
|
+
: {
|
|
844
|
+
title: root.Title,
|
|
845
|
+
description: root.MetaTagDescription,
|
|
846
|
+
},
|
|
847
|
+
type: (root) => isBrand(root)
|
|
848
|
+
? 'Brand'
|
|
849
|
+
: isCollectionPageType(root)
|
|
850
|
+
? root.pageType
|
|
851
|
+
: root.level === 0
|
|
852
|
+
? 'Department'
|
|
853
|
+
: 'Category',
|
|
854
|
+
meta: (root) => {
|
|
855
|
+
const slug = slugifyRoot(root);
|
|
856
|
+
return isBrand(root)
|
|
857
|
+
? {
|
|
858
|
+
selectedFacets: [{ key: 'brand', value: slug }],
|
|
859
|
+
}
|
|
860
|
+
: isCollection(root)
|
|
861
|
+
? {
|
|
862
|
+
selectedFacets: [{ key: 'productclusterids', value: root.id }],
|
|
863
|
+
}
|
|
864
|
+
: {
|
|
865
|
+
selectedFacets: slug.split('/').map((segment, index) => ({
|
|
866
|
+
key: `category-${index + 1}`,
|
|
867
|
+
value: segment,
|
|
868
|
+
})),
|
|
869
|
+
};
|
|
870
|
+
},
|
|
871
|
+
breadcrumbList: async (root, _, ctx) => {
|
|
872
|
+
const { loaders: { collectionLoader }, } = ctx;
|
|
873
|
+
const slug = slugifyRoot(root);
|
|
874
|
+
/**
|
|
875
|
+
* Split slug into segments so we fetch all data for
|
|
876
|
+
* the breadcrumb. For instance, if we get `/foo/bar`
|
|
877
|
+
* we need all metadata for both `/foo` and `/bar` and
|
|
878
|
+
* thus we need to fetch pageType for `/foo` and `/bar`
|
|
879
|
+
*/
|
|
880
|
+
const segments = slug.split('/').filter((segment) => Boolean(segment));
|
|
881
|
+
const slugs = segments.map((__, index) => segments.slice(0, index + 1).join('/'));
|
|
882
|
+
const collections = await Promise.all(slugs.map(async (s) => {
|
|
883
|
+
const collection = await collectionLoader.load(s);
|
|
884
|
+
return { slug: s, ...collection };
|
|
885
|
+
}));
|
|
886
|
+
return {
|
|
887
|
+
itemListElement: collections.map((collection, index) => ({
|
|
888
|
+
item: isCollection(collection)
|
|
889
|
+
? `/${collection.slug}`
|
|
890
|
+
: new URL(`https://${collection.url}`).pathname.toLowerCase(),
|
|
891
|
+
name: collection.name,
|
|
892
|
+
position: index + 1,
|
|
893
|
+
})),
|
|
894
|
+
numberOfItems: collections.length,
|
|
895
|
+
};
|
|
896
|
+
},
|
|
897
|
+
};
|
|
898
|
+
//# sourceMappingURL=collection.js.map
|
|
899
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/facets.js
|
|
900
|
+
|
|
901
|
+
const FACET_CROSS_SELLING_MAP = {
|
|
902
|
+
buy: "whoboughtalsobought",
|
|
903
|
+
view: "whosawalsosaw",
|
|
904
|
+
similars: "similars",
|
|
905
|
+
viewAndBought: "whosawalsobought",
|
|
906
|
+
accessories: "accessories",
|
|
907
|
+
suggestions: "suggestions",
|
|
908
|
+
};
|
|
909
|
+
/**
|
|
910
|
+
* Transform facets from the store to VTEX platform facets.
|
|
911
|
+
* For instance, the channel in Store becomes trade-policy and regionId in VTEX's realm
|
|
912
|
+
* */
|
|
913
|
+
const transformSelectedFacet = ({ key, value }) => {
|
|
914
|
+
switch (key) {
|
|
915
|
+
case 'price': {
|
|
916
|
+
return { key, value: value.replace('-to-', ':') };
|
|
917
|
+
}
|
|
918
|
+
case 'channel':
|
|
919
|
+
case 'locale':
|
|
920
|
+
case "buy":
|
|
921
|
+
case "view":
|
|
922
|
+
case "similars":
|
|
923
|
+
case "viewAndBought":
|
|
924
|
+
case "accessories":
|
|
925
|
+
case "suggestions": {
|
|
926
|
+
return []; // remove this facet from search
|
|
927
|
+
}
|
|
928
|
+
default:
|
|
929
|
+
return { key, value };
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
const parseRange = (range) => {
|
|
933
|
+
const splitted = range.split(':').map(Number);
|
|
934
|
+
if (splitted.length !== 2 ||
|
|
935
|
+
Number.isNaN(splitted[0]) ||
|
|
936
|
+
Number.isNaN(splitted[1])) {
|
|
937
|
+
return null;
|
|
938
|
+
}
|
|
939
|
+
return splitted;
|
|
940
|
+
};
|
|
941
|
+
const isCrossSelling = (x) => typeof FACET_CROSS_SELLING_MAP[x] === "string";
|
|
942
|
+
const findCrossSelling = (facets) => {
|
|
943
|
+
const filtered = facets?.filter((x) => isCrossSelling(x.key));
|
|
944
|
+
if (Array.isArray(filtered) && filtered.length > 1) {
|
|
945
|
+
throw new errors/* BadRequestError */.oY(`You passed ${filtered.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${filtered.map(x => x.key).join(',')}`);
|
|
946
|
+
}
|
|
947
|
+
return filtered?.[0] ?? null;
|
|
948
|
+
};
|
|
949
|
+
const findSlug = (facets) => facets?.find((x) => x.key === 'slug')?.value ?? null;
|
|
950
|
+
const findSkuId = (facets) => facets?.find((x) => x.key === 'id')?.value ?? null;
|
|
951
|
+
const findLocale = (facets) => facets?.find((x) => x.key === 'locale')?.value ?? null;
|
|
952
|
+
const findChannel = (facets) => facets?.find((facet) => facet.key === 'channel')?.value ?? null;
|
|
953
|
+
//# sourceMappingURL=facets.js.map
|
|
954
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/orderStatistics.js
|
|
955
|
+
/**
|
|
956
|
+
* More info at: https://en.wikipedia.org/wiki/Order_statistic
|
|
957
|
+
*/
|
|
958
|
+
// O(n) search to find the max of an array
|
|
959
|
+
const min = (array, cmp) => {
|
|
960
|
+
let best = 0;
|
|
961
|
+
for (let curr = 1; curr < array.length; curr++) {
|
|
962
|
+
if (cmp(array[best], array[curr]) > 0) {
|
|
963
|
+
best = curr;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
return array[best];
|
|
967
|
+
};
|
|
968
|
+
//# sourceMappingURL=orderStatistics.js.map
|
|
969
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/facet.js
|
|
150
970
|
|
|
151
|
-
module.exports = import("@envelop/validation-cache");;
|
|
152
971
|
|
|
153
|
-
|
|
972
|
+
const StoreFacet = {
|
|
973
|
+
__resolveType: ({ type }) => type === 'TEXT' ? 'StoreFacetBoolean' : 'StoreFacetRange',
|
|
974
|
+
};
|
|
975
|
+
const StoreFacetBoolean = {
|
|
976
|
+
key: ({ key }) => key,
|
|
977
|
+
label: ({ name }) => name,
|
|
978
|
+
values: ({ values }) => values.sort((a, b) => a.name.localeCompare(b.name)),
|
|
979
|
+
};
|
|
980
|
+
const StoreFacetRange = {
|
|
981
|
+
key: ({ key }) => key,
|
|
982
|
+
label: ({ name }) => name,
|
|
983
|
+
min: ({ values, key }, _, { storage: { searchArgs } }) => {
|
|
984
|
+
/**
|
|
985
|
+
* Fetch the selected range the user queried.
|
|
986
|
+
*
|
|
987
|
+
* This is necessary because, differently from boolean facets, Search API does
|
|
988
|
+
* not return the selected values, making us have to implement it in here
|
|
989
|
+
*/
|
|
990
|
+
const selectedRange = parseRange(searchArgs?.selectedFacets?.find((facet) => facet.key === key)?.value ??
|
|
991
|
+
'');
|
|
992
|
+
const facet = min(values, (a, b) => a.range.from - b.range.from);
|
|
993
|
+
const globalMin = facet?.range.from ?? 0;
|
|
994
|
+
return {
|
|
995
|
+
selected: selectedRange?.[0] ?? globalMin,
|
|
996
|
+
absolute: globalMin,
|
|
997
|
+
};
|
|
998
|
+
},
|
|
999
|
+
max: ({ values, key }, _, { storage: { searchArgs } }) => {
|
|
1000
|
+
/**
|
|
1001
|
+
* Fetch the selected range the user queried.
|
|
1002
|
+
*
|
|
1003
|
+
* This is necessary because, differently from boolean facets, Search API does
|
|
1004
|
+
* not return the selected values, making us have to implement it in here
|
|
1005
|
+
*/
|
|
1006
|
+
const selectedRange = parseRange(searchArgs?.selectedFacets?.find((facet) => facet.key === key)?.value ??
|
|
1007
|
+
'');
|
|
1008
|
+
const facet = min(values, (a, b) => b.range.to - a.range.to);
|
|
1009
|
+
const globalMax = facet?.range.to ?? 0;
|
|
1010
|
+
return {
|
|
1011
|
+
selected: selectedRange?.[1] ?? globalMax,
|
|
1012
|
+
absolute: globalMax,
|
|
1013
|
+
};
|
|
1014
|
+
},
|
|
1015
|
+
};
|
|
1016
|
+
//# sourceMappingURL=facet.js.map
|
|
1017
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/faceValue.js
|
|
1018
|
+
const StoreFacetValueBoolean = {
|
|
1019
|
+
value: ({ value }) => value,
|
|
1020
|
+
label: ({ name }) => name || 'unknown',
|
|
1021
|
+
selected: ({ selected }) => selected,
|
|
1022
|
+
quantity: ({ quantity }) => quantity,
|
|
1023
|
+
};
|
|
1024
|
+
//# sourceMappingURL=faceValue.js.map
|
|
1025
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/subscribeToNewsletter.js
|
|
1026
|
+
const subscribeToNewsletter = async (_, { data }, { clients: { commerce } }) => {
|
|
1027
|
+
const response = await commerce.subscribeToNewsletter(data);
|
|
1028
|
+
return { id: response?.Id };
|
|
1029
|
+
};
|
|
1030
|
+
//# sourceMappingURL=subscribeToNewsletter.js.map
|
|
1031
|
+
;// CONCATENATED MODULE: external "fast-deep-equal"
|
|
1032
|
+
const external_fast_deep_equal_namespaceObject = require("fast-deep-equal");
|
|
1033
|
+
var external_fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(external_fast_deep_equal_namespaceObject);
|
|
1034
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/channel.js
|
|
1035
|
+
class ChannelMarshal {
|
|
1036
|
+
static parse(channelString) {
|
|
1037
|
+
try {
|
|
1038
|
+
const parsedChannel = JSON.parse(channelString);
|
|
1039
|
+
return {
|
|
1040
|
+
seller: parsedChannel.seller ?? '',
|
|
1041
|
+
regionId: parsedChannel.regionId ?? '',
|
|
1042
|
+
salesChannel: parsedChannel.salesChannel ?? '',
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
1045
|
+
catch (error) {
|
|
1046
|
+
console.error(error);
|
|
1047
|
+
throw new Error('Malformed channel string');
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
static stringify(channel) {
|
|
1051
|
+
return JSON.stringify(channel);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
//# sourceMappingURL=channel.js.map
|
|
1055
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/contex.js
|
|
154
1056
|
|
|
155
|
-
|
|
156
|
-
|
|
1057
|
+
const mutateChannelContext = (ctx, channelString) => {
|
|
1058
|
+
ctx.storage.channel = ChannelMarshal.parse(channelString);
|
|
1059
|
+
};
|
|
1060
|
+
const mutateLocaleContext = (ctx, locale) => {
|
|
1061
|
+
ctx.storage.locale = locale;
|
|
1062
|
+
};
|
|
1063
|
+
//# sourceMappingURL=contex.js.map
|
|
1064
|
+
;// CONCATENATED MODULE: external "crypto"
|
|
1065
|
+
const external_crypto_namespaceObject = require("crypto");
|
|
1066
|
+
var external_crypto_default = /*#__PURE__*/__webpack_require__.n(external_crypto_namespaceObject);
|
|
1067
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/md5.js
|
|
1068
|
+
|
|
1069
|
+
const md5 = (payload) => external_crypto_default().createHash('md5').update(payload).digest('hex');
|
|
1070
|
+
//# sourceMappingURL=md5.js.map
|
|
1071
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/propertyValue.js
|
|
1072
|
+
|
|
1073
|
+
const VALUE_REFERENCES = {
|
|
1074
|
+
attachment: 'ATTACHMENT',
|
|
1075
|
+
specification: 'SPECIFICATION',
|
|
1076
|
+
};
|
|
1077
|
+
function attachmentToPropertyValue(attachment) {
|
|
1078
|
+
return {
|
|
1079
|
+
name: attachment.name,
|
|
1080
|
+
value: attachment.content,
|
|
1081
|
+
valueReference: VALUE_REFERENCES.attachment,
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
function getPropertyId(item) {
|
|
1085
|
+
return md5(`${item.name}:${JSON.stringify(item.value)}:${item.valueReference}`);
|
|
1086
|
+
}
|
|
1087
|
+
//# sourceMappingURL=propertyValue.js.map
|
|
1088
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/shouldUpdateShippingData.js
|
|
1089
|
+
const shouldUpdateShippingData = (orderForm, session) => {
|
|
1090
|
+
if (!hasSessionPostalCodeOrGeoCoordinates(session)) {
|
|
1091
|
+
return { updateShipping: false, addressChanged: false };
|
|
1092
|
+
}
|
|
1093
|
+
if (!hasItems(orderForm)) {
|
|
1094
|
+
return { updateShipping: false, addressChanged: false };
|
|
1095
|
+
}
|
|
1096
|
+
const [selectedAddress] = orderForm?.shippingData?.selectedAddresses ?? [];
|
|
1097
|
+
if (checkPostalCode(selectedAddress, session.postalCode) ||
|
|
1098
|
+
checkGeoCoordinates(selectedAddress, session.geoCoordinates) ||
|
|
1099
|
+
checkAddressType(selectedAddress, session.addressType)) {
|
|
1100
|
+
return { updateShipping: true, addressChanged: true };
|
|
1101
|
+
}
|
|
1102
|
+
// The logisticsInfo will always exist if there´s at least one item inside the cart
|
|
1103
|
+
const { logisticsInfo } = orderForm.shippingData;
|
|
1104
|
+
if (shouldUpdateDeliveryInfo(logisticsInfo, session)) {
|
|
1105
|
+
return { updateShipping: true, addressChanged: false };
|
|
1106
|
+
}
|
|
1107
|
+
return { updateShipping: false, addressChanged: false };
|
|
1108
|
+
};
|
|
1109
|
+
// Validate if theres any postal Code or GeoCoordinates set at the session
|
|
1110
|
+
const hasSessionPostalCodeOrGeoCoordinates = (session) => {
|
|
1111
|
+
return (!!session.postalCode ||
|
|
1112
|
+
(session.geoCoordinates?.latitude && session.geoCoordinates?.longitude));
|
|
1113
|
+
};
|
|
1114
|
+
// Validate if theres a difference between the session postal code and orderForm postal code
|
|
1115
|
+
const checkPostalCode = (address, postalCode) => {
|
|
1116
|
+
return typeof postalCode === 'string' && address?.postalCode !== postalCode;
|
|
1117
|
+
};
|
|
1118
|
+
// Validate if theres a difference between the session geoCoords and orderForm geoCoords
|
|
1119
|
+
const checkGeoCoordinates = (address, geoCoordinates) => {
|
|
1120
|
+
return (typeof geoCoordinates?.latitude === 'number' &&
|
|
1121
|
+
typeof geoCoordinates?.longitude === 'number' &&
|
|
1122
|
+
(address?.geoCoordinates[0] !== geoCoordinates?.longitude ||
|
|
1123
|
+
address?.geoCoordinates[1] !== geoCoordinates?.latitude));
|
|
1124
|
+
};
|
|
1125
|
+
const checkAddressType = (address, addressType) => {
|
|
1126
|
+
return typeof addressType === 'string' && address?.addressType !== addressType;
|
|
1127
|
+
};
|
|
1128
|
+
// Validate if theres any item inside the orderForm
|
|
1129
|
+
const hasItems = (orderForm) => {
|
|
1130
|
+
return orderForm.items.length !== 0;
|
|
1131
|
+
};
|
|
1132
|
+
const shouldUpdateDeliveryInfo = (logisticsInfo, session) => {
|
|
1133
|
+
const deliveryChannel = session?.deliveryMode?.deliveryChannel;
|
|
1134
|
+
const deliveryMethod = session?.deliveryMode?.deliveryMethod;
|
|
1135
|
+
const { startDate, endDate } = session?.deliveryMode?.deliveryWindow || {};
|
|
1136
|
+
return logisticsInfo.some(({ selectedDeliveryChannel, selectedSla, slas }) => {
|
|
1137
|
+
const checkDeliveryChannel = deliveryChannel && selectedDeliveryChannel !== deliveryChannel;
|
|
1138
|
+
const checkDeliveryMethod = deliveryMethod && selectedSla !== deliveryMethod;
|
|
1139
|
+
return slas?.some((sla) => {
|
|
1140
|
+
if ((checkDeliveryChannel && sla.deliveryChannel === deliveryChannel) ||
|
|
1141
|
+
(checkDeliveryMethod && sla.id === deliveryMethod)) {
|
|
1142
|
+
return true;
|
|
1143
|
+
}
|
|
1144
|
+
return (startDate &&
|
|
1145
|
+
endDate &&
|
|
1146
|
+
sla.deliveryChannel === deliveryChannel &&
|
|
1147
|
+
sla.id === deliveryMethod &&
|
|
1148
|
+
(!sla?.deliveryWindow ||
|
|
1149
|
+
sla?.deliveryWindow?.startDateUtc !== startDate ||
|
|
1150
|
+
sla?.deliveryWindow?.endDateUtc !== endDate) &&
|
|
1151
|
+
sla.availableDeliveryWindows?.some((window) => window?.startDateUtc === startDate &&
|
|
1152
|
+
window?.endDateUtc === endDate));
|
|
1153
|
+
});
|
|
1154
|
+
});
|
|
1155
|
+
};
|
|
1156
|
+
//# sourceMappingURL=shouldUpdateShippingData.js.map
|
|
1157
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/getAddressOrderForm.js
|
|
1158
|
+
const getAddressOrderForm = (orderForm, session, addressChanged) => {
|
|
1159
|
+
const postalCode = session.postalCode;
|
|
1160
|
+
const geoCoordinates = session.geoCoordinates;
|
|
1161
|
+
const availableAddresses = orderForm?.shippingData?.availableAddresses ?? [];
|
|
1162
|
+
const selectedAddresses = orderForm?.shippingData?.selectedAddresses ?? [];
|
|
1163
|
+
// Validate if no change for the address was made and the deliveryMode has changed we can return the address from the orderForm
|
|
1164
|
+
if (!addressChanged && selectedAddresses.length > 0) {
|
|
1165
|
+
return [selectedAddresses[0]];
|
|
1166
|
+
}
|
|
1167
|
+
// Validate if the address from the session already exists at the availableAddresses from the OrderForm to avoid duplication
|
|
1168
|
+
if (addressChanged && availableAddresses.length > 0) {
|
|
1169
|
+
for (const address of availableAddresses) {
|
|
1170
|
+
if (postalCode && geoCoordinates) {
|
|
1171
|
+
const addressMatcher = address.postalCode === postalCode ||
|
|
1172
|
+
(address.geoCoordinates[0] === geoCoordinates.longitude &&
|
|
1173
|
+
address.geoCoordinates[1] === geoCoordinates.latitude);
|
|
1174
|
+
if (addressMatcher) {
|
|
1175
|
+
return [address];
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
if (postalCode && !geoCoordinates) {
|
|
1179
|
+
const addressMatcher = address.postalCode === postalCode;
|
|
1180
|
+
if (addressMatcher) {
|
|
1181
|
+
return [address];
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
if (geoCoordinates && !postalCode) {
|
|
1185
|
+
const addressMatcher = address.geoCoordinates[0] === geoCoordinates.longitude &&
|
|
1186
|
+
address.geoCoordinates[1] === geoCoordinates.latitude;
|
|
1187
|
+
if (addressMatcher) {
|
|
1188
|
+
return [address];
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
return null;
|
|
1194
|
+
};
|
|
1195
|
+
//# sourceMappingURL=getAddressOrderForm.js.map
|
|
1196
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/createNewAddress.js
|
|
1197
|
+
const createNewAddress = (session) => {
|
|
1198
|
+
const postalCode = session.postalCode;
|
|
1199
|
+
const geoCoordinates = session.geoCoordinates;
|
|
1200
|
+
// If the address from the session has changed and it do not exist we will create the new one
|
|
1201
|
+
const addressSession = {
|
|
1202
|
+
addressType: session.addressType || null,
|
|
1203
|
+
postalCode: postalCode || null,
|
|
1204
|
+
city: null,
|
|
1205
|
+
state: null,
|
|
1206
|
+
country: session.country || null,
|
|
1207
|
+
street: null,
|
|
1208
|
+
number: null,
|
|
1209
|
+
neighborhood: null,
|
|
1210
|
+
complement: null,
|
|
1211
|
+
reference: null,
|
|
1212
|
+
geoCoordinates: [],
|
|
1213
|
+
};
|
|
1214
|
+
if (geoCoordinates) {
|
|
1215
|
+
const latitude = typeof geoCoordinates === 'object' && 'latitude' in geoCoordinates
|
|
1216
|
+
? geoCoordinates.latitude
|
|
1217
|
+
: null;
|
|
1218
|
+
const longitude = typeof geoCoordinates === 'object' && 'longitude' in geoCoordinates
|
|
1219
|
+
? geoCoordinates.longitude
|
|
1220
|
+
: null;
|
|
1221
|
+
addressSession.geoCoordinates =
|
|
1222
|
+
latitude !== null && longitude !== null ? [longitude, latitude] : [];
|
|
1223
|
+
}
|
|
1224
|
+
return [addressSession];
|
|
1225
|
+
};
|
|
1226
|
+
//# sourceMappingURL=createNewAddress.js.map
|
|
1227
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/validateCart.js
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
|
|
1235
|
+
const isAttachment = (value) => value.valueReference === VALUE_REFERENCES.attachment;
|
|
1236
|
+
const getId = (item) => [
|
|
1237
|
+
item.itemOffered.sku,
|
|
1238
|
+
item.seller.identifier,
|
|
1239
|
+
item.price < 0.01 ? 'Gift' : undefined,
|
|
1240
|
+
item.itemOffered.additionalProperty
|
|
1241
|
+
?.filter(isAttachment)
|
|
1242
|
+
.map(getPropertyId)
|
|
1243
|
+
.join('-'),
|
|
1244
|
+
]
|
|
1245
|
+
.filter(Boolean)
|
|
1246
|
+
.join('::');
|
|
1247
|
+
const orderFormItemToOffer = (item, index) => ({
|
|
1248
|
+
listPrice: item.listPrice / 100,
|
|
1249
|
+
price: item.sellingPrice / 100,
|
|
1250
|
+
quantity: item.quantity,
|
|
1251
|
+
seller: { identifier: item.seller },
|
|
1252
|
+
itemOffered: {
|
|
1253
|
+
sku: item.id,
|
|
1254
|
+
image: [],
|
|
1255
|
+
name: item.name,
|
|
1256
|
+
additionalProperty: item.attachments.map(attachmentToPropertyValue),
|
|
1257
|
+
},
|
|
1258
|
+
index,
|
|
1259
|
+
});
|
|
1260
|
+
const offerToOrderItemInput = (offer) => ({
|
|
1261
|
+
quantity: offer.quantity,
|
|
1262
|
+
seller: offer.seller.identifier,
|
|
1263
|
+
id: offer.itemOffered.sku,
|
|
1264
|
+
index: offer.index,
|
|
1265
|
+
attachments: (offer.itemOffered.additionalProperty?.filter(isAttachment) ?? []).map((attachment) => ({
|
|
1266
|
+
name: attachment.name,
|
|
1267
|
+
content: attachment.value,
|
|
1268
|
+
})),
|
|
1269
|
+
});
|
|
1270
|
+
const groupById = (offers) => offers.reduce((acc, item) => {
|
|
1271
|
+
const id = getId(item);
|
|
1272
|
+
if (!acc.has(id)) {
|
|
1273
|
+
acc.set(id, []);
|
|
1274
|
+
}
|
|
1275
|
+
acc.get(id)?.push(item);
|
|
1276
|
+
return acc;
|
|
1277
|
+
}, new Map());
|
|
1278
|
+
const equals = (storeOrder, orderForm) => {
|
|
1279
|
+
const pick = (item, index) => ({
|
|
1280
|
+
...item,
|
|
1281
|
+
itemOffered: {
|
|
1282
|
+
sku: item.itemOffered.sku,
|
|
1283
|
+
},
|
|
1284
|
+
index,
|
|
1285
|
+
});
|
|
1286
|
+
const orderFormItems = orderForm.items.map(orderFormItemToOffer).map(pick);
|
|
1287
|
+
const storeOrderItems = storeOrder.acceptedOffer.map(pick);
|
|
1288
|
+
const isSameOrder = storeOrder.orderNumber === orderForm.orderFormId;
|
|
1289
|
+
const orderItemsAreSync = external_fast_deep_equal_default()(orderFormItems, storeOrderItems);
|
|
1290
|
+
return isSameOrder && orderItemsAreSync;
|
|
1291
|
+
};
|
|
1292
|
+
const joinItems = (form) => {
|
|
1293
|
+
const itemsById = form.items.reduce((acc, item) => {
|
|
1294
|
+
const id = getId(orderFormItemToOffer(item));
|
|
1295
|
+
if (!acc[id]) {
|
|
1296
|
+
acc[id] = [];
|
|
1297
|
+
}
|
|
1298
|
+
acc[id].push(item);
|
|
1299
|
+
return acc;
|
|
1300
|
+
}, {});
|
|
1301
|
+
return {
|
|
1302
|
+
...form,
|
|
1303
|
+
items: Object.values(itemsById).map((items) => {
|
|
1304
|
+
const [item] = items;
|
|
1305
|
+
const quantity = items.reduce((acc, i) => acc + i.quantity, 0);
|
|
1306
|
+
const totalPrice = items.reduce((acc, i) => acc +
|
|
1307
|
+
(i?.priceDefinition?.total ??
|
|
1308
|
+
(i?.quantity ?? 0) * (i?.sellingPrice ?? 0)), 0);
|
|
1309
|
+
return {
|
|
1310
|
+
...item,
|
|
1311
|
+
quantity,
|
|
1312
|
+
sellingPrice: totalPrice / quantity,
|
|
1313
|
+
};
|
|
1314
|
+
}),
|
|
1315
|
+
};
|
|
1316
|
+
};
|
|
1317
|
+
const orderFormToCart = async (form, skuLoader) => {
|
|
1318
|
+
return {
|
|
1319
|
+
order: {
|
|
1320
|
+
orderNumber: form.orderFormId,
|
|
1321
|
+
acceptedOffer: form.items.map(async (item) => ({
|
|
1322
|
+
...item,
|
|
1323
|
+
product: await skuLoader.load(item.id),
|
|
1324
|
+
})),
|
|
1325
|
+
},
|
|
1326
|
+
messages: form.messages.map(({ text, status }) => ({
|
|
1327
|
+
text,
|
|
1328
|
+
status: status.toUpperCase(),
|
|
1329
|
+
})),
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
const getOrderFormEtag = ({ items }) => md5(JSON.stringify(items));
|
|
1333
|
+
const setOrderFormEtag = async (form, commerce) => {
|
|
1334
|
+
try {
|
|
1335
|
+
const orderForm = await commerce.checkout.setCustomData({
|
|
1336
|
+
id: form.orderFormId,
|
|
1337
|
+
appId: 'faststore',
|
|
1338
|
+
key: 'cartEtag',
|
|
1339
|
+
value: getOrderFormEtag(form),
|
|
1340
|
+
});
|
|
1341
|
+
return orderForm;
|
|
1342
|
+
}
|
|
1343
|
+
catch (err) {
|
|
1344
|
+
console.error('Error while setting custom data to orderForm.\n Make sure to add the following custom app to the orderForm: \n{"fields":["cartEtag"],"id":"faststore","major":1}.\n More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api');
|
|
1345
|
+
throw err;
|
|
1346
|
+
}
|
|
1347
|
+
};
|
|
1348
|
+
/**
|
|
1349
|
+
* Checks if cartEtag stored on customData is up to date
|
|
1350
|
+
* @description If cartEtag is not up to date, this means that
|
|
1351
|
+
* another system changed the cart, like Checkout UI or Order Placed
|
|
1352
|
+
*/
|
|
1353
|
+
const isOrderFormStale = (form) => {
|
|
1354
|
+
const faststoreData = form.customData?.customApps.find((app) => app.id === 'faststore');
|
|
1355
|
+
const oldEtag = faststoreData?.fields?.cartEtag;
|
|
1356
|
+
if (oldEtag == null) {
|
|
1357
|
+
return true;
|
|
1358
|
+
}
|
|
1359
|
+
const newEtag = getOrderFormEtag(form);
|
|
1360
|
+
return newEtag !== oldEtag;
|
|
1361
|
+
};
|
|
1362
|
+
// Returns the regionalized orderForm
|
|
1363
|
+
const getOrderForm = async (id, { clients: { commerce } }) => {
|
|
1364
|
+
return commerce.checkout.orderForm({
|
|
1365
|
+
id,
|
|
1366
|
+
});
|
|
1367
|
+
};
|
|
1368
|
+
const clearOrderFormMessages = async (id, { clients: { commerce } }) => {
|
|
1369
|
+
return commerce.checkout.clearOrderFormMessages({
|
|
1370
|
+
id,
|
|
1371
|
+
});
|
|
1372
|
+
};
|
|
1373
|
+
const updateOrderFormShippingData = async (orderForm, session, { clients: { commerce } }) => {
|
|
1374
|
+
// Stores that are not yet providing the session while validating the cart
|
|
1375
|
+
// should not be able to update the shipping data
|
|
1376
|
+
//
|
|
1377
|
+
// This was causing errors while validating regionalizated carts
|
|
1378
|
+
// because the following code was trying to change the shippingData to an undefined address/session
|
|
1379
|
+
if (!session) {
|
|
1380
|
+
return orderForm;
|
|
1381
|
+
}
|
|
1382
|
+
const { updateShipping, addressChanged } = shouldUpdateShippingData(orderForm, session);
|
|
1383
|
+
if (updateShipping) {
|
|
1384
|
+
// Check if the orderForm address matches the one from the session
|
|
1385
|
+
const oldAddress = getAddressOrderForm(orderForm, session, addressChanged);
|
|
1386
|
+
const address = oldAddress ? oldAddress : createNewAddress(session);
|
|
1387
|
+
const selectedAddresses = address;
|
|
1388
|
+
const hasDeliveryWindow = session.deliveryMode?.deliveryWindow
|
|
1389
|
+
? true
|
|
1390
|
+
: false;
|
|
1391
|
+
if (hasDeliveryWindow) {
|
|
1392
|
+
// if you have a Delivery Window you have to first get the delivery window to set the desired after
|
|
1393
|
+
await commerce.checkout.shippingData({
|
|
1394
|
+
id: orderForm.orderFormId,
|
|
1395
|
+
index: orderForm.items.length,
|
|
1396
|
+
deliveryMode: session.deliveryMode,
|
|
1397
|
+
selectedAddresses: selectedAddresses,
|
|
1398
|
+
}, false);
|
|
1399
|
+
}
|
|
1400
|
+
return commerce.checkout.shippingData({
|
|
1401
|
+
id: orderForm.orderFormId,
|
|
1402
|
+
index: orderForm.items.length,
|
|
1403
|
+
deliveryMode: session.deliveryMode,
|
|
1404
|
+
selectedAddresses: selectedAddresses,
|
|
1405
|
+
}, true);
|
|
1406
|
+
}
|
|
1407
|
+
return orderForm;
|
|
1408
|
+
};
|
|
1409
|
+
/**
|
|
1410
|
+
* This resolver implements the optimistic cart behavior. The main idea in here
|
|
1411
|
+
* is that we receive a cart from the UI (as query params) and we validate it with
|
|
1412
|
+
* the commerce platform. If the cart is valid, we return null, if the cart is
|
|
1413
|
+
* invalid according to the commerce platform, we return the new cart the UI should use
|
|
1414
|
+
* instead.
|
|
1415
|
+
*
|
|
1416
|
+
* The algorithm is something like:
|
|
1417
|
+
* 1. Fetch orderForm from VTEX
|
|
1418
|
+
* 2. Compute delta changes between the orderForm and the UI's cart
|
|
1419
|
+
* 3. Update the orderForm in VTEX platform accordingly
|
|
1420
|
+
* 4. If any changes were made, send to the UI the new cart. Null otherwise
|
|
1421
|
+
*/
|
|
1422
|
+
const validateCart = async (_, { cart: { order }, session }, ctx) => {
|
|
1423
|
+
const { orderNumber, acceptedOffer, shouldSplitItem } = order;
|
|
1424
|
+
const { clients: { commerce }, loaders: { skuLoader }, } = ctx;
|
|
1425
|
+
const channel = session?.channel;
|
|
1426
|
+
const locale = session?.locale;
|
|
1427
|
+
if (channel) {
|
|
1428
|
+
mutateChannelContext(ctx, channel);
|
|
1429
|
+
}
|
|
1430
|
+
if (locale) {
|
|
1431
|
+
mutateLocaleContext(ctx, locale);
|
|
1432
|
+
}
|
|
1433
|
+
// Step1: Get OrderForm from VTEX Commerce
|
|
1434
|
+
const orderForm = await getOrderForm(orderNumber, ctx);
|
|
1435
|
+
// Clear messages so it doesn't keep populating toasts on a loop
|
|
1436
|
+
// In the next validateCart mutation it will only have messages if a new message is created on orderForm
|
|
1437
|
+
if (orderForm.messages.length !== 0) {
|
|
1438
|
+
await clearOrderFormMessages(orderNumber, ctx);
|
|
1439
|
+
}
|
|
1440
|
+
// Step1.5: Check if another system changed the orderForm with this orderNumber
|
|
1441
|
+
// If so, this means the user interacted with this cart elsewhere and expects
|
|
1442
|
+
// to see this new cart state instead of what's stored on the user's browser.
|
|
1443
|
+
const isStale = isOrderFormStale(orderForm);
|
|
1444
|
+
if (isStale && orderNumber) {
|
|
1445
|
+
const newOrderForm = await setOrderFormEtag(orderForm, commerce).then(joinItems);
|
|
1446
|
+
return orderFormToCart(newOrderForm, skuLoader);
|
|
1447
|
+
}
|
|
1448
|
+
// Step2: Process items from both browser and checkout so they have the same shape
|
|
1449
|
+
const browserItemsById = groupById(acceptedOffer);
|
|
1450
|
+
const originItemsById = groupById(orderForm.items.map(orderFormItemToOffer));
|
|
1451
|
+
const originItems = Array.from(originItemsById.entries()); // items on the VTEX platform backend
|
|
1452
|
+
const browserItems = Array.from(browserItemsById.entries()); // items on the user's browser
|
|
1453
|
+
// Step3: Compute delta changes
|
|
1454
|
+
const { itemsToAdd, itemsToUpdate } = browserItems.reduce((acc, [id, items]) => {
|
|
1455
|
+
const maybeOriginItem = originItemsById.get(id);
|
|
1456
|
+
// Adding new items to cart
|
|
1457
|
+
if (!maybeOriginItem) {
|
|
1458
|
+
items.forEach((item) => acc.itemsToAdd.push(item));
|
|
1459
|
+
return acc;
|
|
1460
|
+
}
|
|
1461
|
+
// Update existing items
|
|
1462
|
+
const [head, ...tail] = maybeOriginItem;
|
|
1463
|
+
const totalQuantity = items.reduce((acc, curr) => acc + curr.quantity, 0);
|
|
1464
|
+
// set total quantity to first item
|
|
1465
|
+
acc.itemsToUpdate.push({
|
|
1466
|
+
...head,
|
|
1467
|
+
quantity: totalQuantity,
|
|
1468
|
+
});
|
|
1469
|
+
// Remove all the rest
|
|
1470
|
+
tail.forEach((item) => acc.itemsToUpdate.push({ ...item, quantity: 0 }));
|
|
1471
|
+
return acc;
|
|
1472
|
+
}, {
|
|
1473
|
+
itemsToAdd: [],
|
|
1474
|
+
itemsToUpdate: [],
|
|
1475
|
+
});
|
|
1476
|
+
const itemsToDelete = originItems
|
|
1477
|
+
.filter(([id]) => !browserItemsById.has(id))
|
|
1478
|
+
.flatMap(([, items]) => items.map((item) => ({ ...item, quantity: 0 })));
|
|
1479
|
+
const changes = [...itemsToAdd, ...itemsToUpdate, ...itemsToDelete].map(offerToOrderItemInput);
|
|
1480
|
+
if (changes.length === 0) {
|
|
1481
|
+
return null;
|
|
1482
|
+
}
|
|
1483
|
+
// Step4: Apply delta changes to order form
|
|
1484
|
+
const updatedOrderForm = await commerce.checkout
|
|
1485
|
+
// update orderForm items
|
|
1486
|
+
.updateOrderFormItems({
|
|
1487
|
+
id: orderForm.orderFormId,
|
|
1488
|
+
orderItems: changes,
|
|
1489
|
+
shouldSplitItem,
|
|
1490
|
+
})
|
|
1491
|
+
// update orderForm shippingData
|
|
1492
|
+
.then((form) => updateOrderFormShippingData(form, session, ctx))
|
|
1493
|
+
// update orderForm etag so we know last time we touched this orderForm
|
|
1494
|
+
.then((form) => setOrderFormEtag(form, commerce))
|
|
1495
|
+
.then(joinItems);
|
|
1496
|
+
const equalMessages = external_fast_deep_equal_default()(orderForm.messages, updatedOrderForm.messages);
|
|
1497
|
+
// Step5: If no changes detected before/after updating orderForm, the order is validated
|
|
1498
|
+
if (equals(order, updatedOrderForm) && equalMessages) {
|
|
1499
|
+
return null;
|
|
1500
|
+
}
|
|
1501
|
+
// Step6: There were changes, convert orderForm to StoreCart
|
|
1502
|
+
return orderFormToCart(updatedOrderForm, skuLoader);
|
|
1503
|
+
};
|
|
1504
|
+
//# sourceMappingURL=validateCart.js.map
|
|
1505
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/validateSession.js
|
|
1506
|
+
|
|
1507
|
+
|
|
1508
|
+
const validateSession = async (_, { session: oldSession, search }, { clients }) => {
|
|
1509
|
+
const channel = ChannelMarshal.parse(oldSession.channel ?? '');
|
|
1510
|
+
const postalCode = String(oldSession.postalCode ?? '').replace(/\D/g, '');
|
|
1511
|
+
const geoCoordinates = oldSession.geoCoordinates ?? null;
|
|
1512
|
+
const country = oldSession.country ?? '';
|
|
1513
|
+
const params = new URLSearchParams(search);
|
|
1514
|
+
const salesChannel = params.get('sc') ?? channel.salesChannel;
|
|
1515
|
+
params.set('sc', salesChannel);
|
|
1516
|
+
const [regionData, sessionData] = await Promise.all([
|
|
1517
|
+
postalCode || geoCoordinates
|
|
1518
|
+
? clients.commerce.checkout.region({
|
|
1519
|
+
postalCode,
|
|
1520
|
+
geoCoordinates,
|
|
1521
|
+
country,
|
|
1522
|
+
salesChannel,
|
|
1523
|
+
})
|
|
1524
|
+
: Promise.resolve(null),
|
|
1525
|
+
clients.commerce.session(params.toString()).catch(() => null),
|
|
1526
|
+
]);
|
|
1527
|
+
const profile = sessionData?.namespaces.profile ?? null;
|
|
1528
|
+
const store = sessionData?.namespaces.store ?? null;
|
|
1529
|
+
const region = regionData?.[0];
|
|
1530
|
+
// Set seller only if it's inside a region
|
|
1531
|
+
const seller = region?.sellers.find((seller) => channel.seller === seller.id);
|
|
1532
|
+
const newSession = {
|
|
1533
|
+
...oldSession,
|
|
1534
|
+
currency: {
|
|
1535
|
+
code: store?.currencyCode.value ?? oldSession.currency.code,
|
|
1536
|
+
symbol: store?.currencySymbol.value ?? oldSession.currency.symbol,
|
|
1537
|
+
},
|
|
1538
|
+
country: store?.countryCode.value ?? oldSession.country,
|
|
1539
|
+
channel: ChannelMarshal.stringify({
|
|
1540
|
+
salesChannel: store?.channel?.value ?? channel.salesChannel,
|
|
1541
|
+
regionId: region?.id ?? channel.regionId,
|
|
1542
|
+
seller: seller?.id,
|
|
1543
|
+
}),
|
|
1544
|
+
person: profile?.id
|
|
1545
|
+
? {
|
|
1546
|
+
id: profile.id?.value ?? '',
|
|
1547
|
+
email: profile.email?.value ?? '',
|
|
1548
|
+
givenName: profile.firstName?.value ?? '',
|
|
1549
|
+
familyName: profile.lastName?.value ?? '',
|
|
1550
|
+
}
|
|
1551
|
+
: null,
|
|
1552
|
+
};
|
|
1553
|
+
if (external_fast_deep_equal_default()(oldSession, newSession)) {
|
|
1554
|
+
return null;
|
|
1555
|
+
}
|
|
1556
|
+
return newSession;
|
|
1557
|
+
};
|
|
1558
|
+
//# sourceMappingURL=validateSession.js.map
|
|
1559
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/mutation.js
|
|
157
1560
|
|
|
158
|
-
module.exports = import("@graphql-tools/load-files");;
|
|
159
1561
|
|
|
160
|
-
/***/ }),
|
|
161
1562
|
|
|
162
|
-
|
|
163
|
-
|
|
1563
|
+
const Mutation = {
|
|
1564
|
+
validateCart: validateCart,
|
|
1565
|
+
validateSession: validateSession,
|
|
1566
|
+
subscribeToNewsletter: subscribeToNewsletter,
|
|
1567
|
+
};
|
|
1568
|
+
//# sourceMappingURL=mutation.js.map
|
|
1569
|
+
// EXTERNAL MODULE: external "graphql"
|
|
1570
|
+
var external_graphql_ = __webpack_require__(7343);
|
|
1571
|
+
;// CONCATENATED MODULE: external "graphql/language"
|
|
1572
|
+
const language_namespaceObject = require("graphql/language");
|
|
1573
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/objectOrString.js
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
const ObjectOrString = new external_graphql_.GraphQLScalarType({
|
|
1577
|
+
name: 'ObjectOrString',
|
|
1578
|
+
description: 'A string or the string representation of an object (a stringified object).',
|
|
1579
|
+
parseValue: toObjectOrString,
|
|
1580
|
+
serialize: stringify,
|
|
1581
|
+
parseLiteral(ast) {
|
|
1582
|
+
if (ast.kind === language_namespaceObject.Kind.STRING) {
|
|
1583
|
+
return getValueAsObjectOrString(ast.value);
|
|
1584
|
+
}
|
|
1585
|
+
return null;
|
|
1586
|
+
},
|
|
1587
|
+
});
|
|
1588
|
+
function toObjectOrString(value) {
|
|
1589
|
+
if (typeof value === 'string') {
|
|
1590
|
+
return getValueAsObjectOrString(value);
|
|
1591
|
+
}
|
|
1592
|
+
return null;
|
|
1593
|
+
}
|
|
1594
|
+
function getValueAsObjectOrString(value) {
|
|
1595
|
+
try {
|
|
1596
|
+
return JSON.parse(value);
|
|
1597
|
+
}
|
|
1598
|
+
catch (e) {
|
|
1599
|
+
return value;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
function stringify(value) {
|
|
1603
|
+
if (typeof value === 'object') {
|
|
1604
|
+
return JSON.stringify(value);
|
|
1605
|
+
}
|
|
1606
|
+
if (typeof value === 'string') {
|
|
1607
|
+
return value;
|
|
1608
|
+
}
|
|
1609
|
+
return null;
|
|
1610
|
+
}
|
|
1611
|
+
//# sourceMappingURL=objectOrString.js.map
|
|
1612
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/offer.js
|
|
1613
|
+
|
|
1614
|
+
const isSearchItem = (item) => 'Price' in item && 'seller' in item && 'product' in item;
|
|
1615
|
+
const isOrderFormItem = (item) => 'skuName' in item;
|
|
1616
|
+
const StoreOffer = {
|
|
1617
|
+
priceCurrency: async (_, __, ctx) => {
|
|
1618
|
+
const { loaders: { salesChannelLoader }, storage: { channel } } = ctx;
|
|
1619
|
+
const sc = await salesChannelLoader.load(channel.salesChannel);
|
|
1620
|
+
return sc.CurrencyCode ?? '';
|
|
1621
|
+
},
|
|
1622
|
+
priceValidUntil: (root) => {
|
|
1623
|
+
if (isSearchItem(root)) {
|
|
1624
|
+
return root.PriceValidUntil ?? '';
|
|
1625
|
+
}
|
|
1626
|
+
if (isOrderFormItem(root)) {
|
|
1627
|
+
return root.priceValidUntil ?? '';
|
|
1628
|
+
}
|
|
1629
|
+
return null;
|
|
1630
|
+
},
|
|
1631
|
+
itemCondition: () => 'https://schema.org/NewCondition',
|
|
1632
|
+
availability: async (root) => {
|
|
1633
|
+
if (isSearchItem(root)) {
|
|
1634
|
+
return availability(inStock(root));
|
|
1635
|
+
}
|
|
1636
|
+
if (isOrderFormItem(root)) {
|
|
1637
|
+
return availability(inStockOrderFormItem(root.availability));
|
|
1638
|
+
}
|
|
1639
|
+
return null;
|
|
1640
|
+
},
|
|
1641
|
+
seller: (root, _, ctx) => {
|
|
1642
|
+
if (isSearchItem(root)) {
|
|
1643
|
+
return {
|
|
1644
|
+
identifier: ctx.storage.channel?.seller || root.seller.sellerId || '',
|
|
1645
|
+
};
|
|
1646
|
+
}
|
|
1647
|
+
if (isOrderFormItem(root)) {
|
|
1648
|
+
return {
|
|
1649
|
+
identifier: root.seller,
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
return null;
|
|
1653
|
+
},
|
|
1654
|
+
price: (root) => {
|
|
1655
|
+
if (isSearchItem(root)) {
|
|
1656
|
+
return price(root);
|
|
1657
|
+
}
|
|
1658
|
+
if (isOrderFormItem(root)) {
|
|
1659
|
+
return root.sellingPrice / 1e2;
|
|
1660
|
+
}
|
|
1661
|
+
return null;
|
|
1662
|
+
},
|
|
1663
|
+
sellingPrice: (root) => {
|
|
1664
|
+
if (isSearchItem(root)) {
|
|
1665
|
+
return sellingPrice(root);
|
|
1666
|
+
}
|
|
1667
|
+
if (isOrderFormItem(root)) {
|
|
1668
|
+
return root.sellingPrice / 1e2;
|
|
1669
|
+
}
|
|
1670
|
+
return null;
|
|
1671
|
+
},
|
|
1672
|
+
listPrice: (root) => {
|
|
1673
|
+
if (isSearchItem(root)) {
|
|
1674
|
+
return root.ListPrice ?? 0;
|
|
1675
|
+
}
|
|
1676
|
+
if (isOrderFormItem(root)) {
|
|
1677
|
+
return root.listPrice / 1e2;
|
|
1678
|
+
}
|
|
1679
|
+
return null;
|
|
1680
|
+
},
|
|
1681
|
+
itemOffered: (root) => {
|
|
1682
|
+
if (isSearchItem(root)) {
|
|
1683
|
+
return root.product;
|
|
1684
|
+
}
|
|
1685
|
+
if (isOrderFormItem(root)) {
|
|
1686
|
+
return {
|
|
1687
|
+
...root.product,
|
|
1688
|
+
attachmentsValues: root.attachments,
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
return null;
|
|
1692
|
+
},
|
|
1693
|
+
quantity: (root) => {
|
|
1694
|
+
if (isSearchItem(root)) {
|
|
1695
|
+
return root.AvailableQuantity ?? 0;
|
|
1696
|
+
}
|
|
1697
|
+
if (isOrderFormItem(root)) {
|
|
1698
|
+
return root.quantity;
|
|
1699
|
+
}
|
|
1700
|
+
return null;
|
|
1701
|
+
},
|
|
1702
|
+
};
|
|
1703
|
+
//# sourceMappingURL=offer.js.map
|
|
1704
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/canonical.js
|
|
1705
|
+
const canonicalFromProduct = ({ linkText }) => `/${linkText}/p`;
|
|
1706
|
+
//# sourceMappingURL=canonical.js.map
|
|
1707
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/enhanceCommercialOffer.js
|
|
1708
|
+
const enhanceCommercialOffer = ({ offer, seller, product, }) => ({
|
|
1709
|
+
...offer,
|
|
1710
|
+
product,
|
|
1711
|
+
seller,
|
|
1712
|
+
});
|
|
1713
|
+
//# sourceMappingURL=enhanceCommercialOffer.js.map
|
|
1714
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/product.js
|
|
164
1715
|
|
|
165
|
-
module.exports = import("@graphql-tools/schema");;
|
|
166
1716
|
|
|
167
|
-
/***/ }),
|
|
168
1717
|
|
|
169
|
-
/***/ 6113:
|
|
170
|
-
/***/ ((module) => {
|
|
171
1718
|
|
|
172
|
-
module.exports = require("crypto");
|
|
173
1719
|
|
|
174
|
-
|
|
1720
|
+
const DEFAULT_IMAGE = {
|
|
1721
|
+
imageText: 'image',
|
|
1722
|
+
imageUrl: 'https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg',
|
|
1723
|
+
};
|
|
1724
|
+
const getSlug = (link, id) => `${link}-${id}`;
|
|
1725
|
+
const getPath = (link, id) => `/${getSlug(link, id)}/p`;
|
|
1726
|
+
const nonEmptyArray = (array) => Array.isArray(array) && array.length > 0 ? array : null;
|
|
1727
|
+
const StoreProduct = {
|
|
1728
|
+
productID: ({ itemId }) => itemId,
|
|
1729
|
+
name: ({ isVariantOf, name }) => name ?? isVariantOf.productName,
|
|
1730
|
+
slug: ({ isVariantOf: { linkText }, itemId }) => getSlug(linkText, itemId),
|
|
1731
|
+
description: ({ isVariantOf: { description } }) => description,
|
|
1732
|
+
seo: ({ isVariantOf }) => ({
|
|
1733
|
+
title: isVariantOf.productName,
|
|
1734
|
+
description: isVariantOf.description,
|
|
1735
|
+
canonical: canonicalFromProduct(isVariantOf),
|
|
1736
|
+
}),
|
|
1737
|
+
brand: ({ isVariantOf: { brand } }) => ({ name: brand }),
|
|
1738
|
+
breadcrumbList: ({ isVariantOf: { categories, productName, linkText }, itemId, }) => {
|
|
1739
|
+
return {
|
|
1740
|
+
itemListElement: [
|
|
1741
|
+
...categories.reverse().map((categoryPath, index) => {
|
|
1742
|
+
const splitted = categoryPath.split('/');
|
|
1743
|
+
const name = splitted[splitted.length - 2];
|
|
1744
|
+
const item = splitted.map(slugify).join('/');
|
|
1745
|
+
return {
|
|
1746
|
+
name,
|
|
1747
|
+
item,
|
|
1748
|
+
position: index + 1,
|
|
1749
|
+
};
|
|
1750
|
+
}),
|
|
1751
|
+
{
|
|
1752
|
+
name: productName,
|
|
1753
|
+
item: getPath(linkText, itemId),
|
|
1754
|
+
position: categories.length + 1,
|
|
1755
|
+
},
|
|
1756
|
+
],
|
|
1757
|
+
numberOfItems: categories.length,
|
|
1758
|
+
};
|
|
1759
|
+
},
|
|
1760
|
+
image: ({ images }) => (nonEmptyArray(images) ?? [DEFAULT_IMAGE]).map(({ imageUrl, imageText }) => ({
|
|
1761
|
+
alternateName: imageText ?? '',
|
|
1762
|
+
url: imageUrl.replace('vteximg.com.br', 'vtexassets.com'),
|
|
1763
|
+
})),
|
|
1764
|
+
sku: ({ itemId }) => itemId,
|
|
1765
|
+
gtin: ({ referenceId }) => referenceId[0]?.Value ?? '',
|
|
1766
|
+
review: () => [],
|
|
1767
|
+
aggregateRating: () => ({}),
|
|
1768
|
+
offers: (root) => root.sellers
|
|
1769
|
+
.map((seller) => enhanceCommercialOffer({
|
|
1770
|
+
offer: seller.commertialOffer,
|
|
1771
|
+
seller,
|
|
1772
|
+
product: root,
|
|
1773
|
+
}))
|
|
1774
|
+
.sort(bestOfferFirst),
|
|
1775
|
+
isVariantOf: (root) => root,
|
|
1776
|
+
additionalProperty: ({
|
|
1777
|
+
// Search uses the name variations for specifications
|
|
1778
|
+
variations: specifications = [], attachmentsValues = [], }) => {
|
|
1779
|
+
const propertyValueSpecifications = specifications.flatMap(({ name, values }) => values.map((value) => ({
|
|
1780
|
+
name,
|
|
1781
|
+
value,
|
|
1782
|
+
valueReference: VALUE_REFERENCES.specification,
|
|
1783
|
+
})));
|
|
1784
|
+
const propertyValueAttachments = attachmentsValues.map(attachmentToPropertyValue);
|
|
1785
|
+
return [...propertyValueSpecifications, ...propertyValueAttachments];
|
|
1786
|
+
},
|
|
1787
|
+
releaseDate: ({ isVariantOf: { releaseDate } }) => releaseDate ?? ''
|
|
1788
|
+
};
|
|
1789
|
+
//# sourceMappingURL=product.js.map
|
|
1790
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/productGroup.js
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
const BLOCKED_SPECIFICATIONS = new Set(['allSpecifications']);
|
|
1794
|
+
const StoreProductGroup = {
|
|
1795
|
+
hasVariant: (root) => root.isVariantOf.items.map((item) => enhanceSku(item, root.isVariantOf)),
|
|
1796
|
+
productGroupID: ({ isVariantOf }) => isVariantOf.productId,
|
|
1797
|
+
name: (root) => root.isVariantOf.productName,
|
|
1798
|
+
skuVariants: (root) => root,
|
|
1799
|
+
additionalProperty: ({ isVariantOf: { specificationGroups } }) => specificationGroups
|
|
1800
|
+
// Filter sku specifications so we don't mix them with product specs.
|
|
1801
|
+
.filter((specificationGroup) => !BLOCKED_SPECIFICATIONS.has(specificationGroup.name))
|
|
1802
|
+
// Transform specs back into product specs.
|
|
1803
|
+
.flatMap(({ specifications }) => specifications.flatMap(({ name, values }) => values.map((value) => ({
|
|
1804
|
+
name,
|
|
1805
|
+
value,
|
|
1806
|
+
valueReference: VALUE_REFERENCES.specification,
|
|
1807
|
+
})))),
|
|
1808
|
+
};
|
|
1809
|
+
//# sourceMappingURL=productGroup.js.map
|
|
1810
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/propertyValue.js
|
|
1811
|
+
|
|
1812
|
+
const StorePropertyValue = {
|
|
1813
|
+
propertyID: (root) => getPropertyId(root),
|
|
1814
|
+
name: ({ name }) => name,
|
|
1815
|
+
value: ({ value }) => value,
|
|
1816
|
+
valueReference: ({ valueReference }) => valueReference,
|
|
1817
|
+
};
|
|
1818
|
+
//# sourceMappingURL=propertyValue.js.map
|
|
1819
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/sort.js
|
|
1820
|
+
const SORT_MAP = {
|
|
1821
|
+
price_desc: 'price:desc',
|
|
1822
|
+
price_asc: 'price:asc',
|
|
1823
|
+
orders_desc: 'orders:desc',
|
|
1824
|
+
name_desc: 'name:desc',
|
|
1825
|
+
name_asc: 'name:asc',
|
|
1826
|
+
release_desc: 'release:desc',
|
|
1827
|
+
discount_desc: 'discount:desc',
|
|
1828
|
+
score_desc: '',
|
|
1829
|
+
};
|
|
1830
|
+
//# sourceMappingURL=sort.js.map
|
|
1831
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/sku.js
|
|
1832
|
+
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* This function implements Portal heuristics for returning the best sku for a product.
|
|
1836
|
+
*
|
|
1837
|
+
* The best sku is the one with the best (cheapest available) offer
|
|
1838
|
+
* */
|
|
1839
|
+
const pickBestSku = (skus) => {
|
|
1840
|
+
const offersBySku = skus.flatMap((sku) => sku.sellers.map((seller) => ({
|
|
1841
|
+
offer: seller.commertialOffer,
|
|
1842
|
+
sku,
|
|
1843
|
+
})));
|
|
1844
|
+
const best = min(offersBySku, ({ offer: o1 }, { offer: o2 }) => bestOfferFirst(o1, o2));
|
|
1845
|
+
return best ? best.sku : skus[0];
|
|
1846
|
+
};
|
|
1847
|
+
const isValidSkuId = (skuId) => skuId !== '' && !Number.isNaN(Number(skuId));
|
|
1848
|
+
//# sourceMappingURL=sku.js.map
|
|
1849
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/query.js
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
|
|
1854
|
+
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
|
|
1858
|
+
const Query = {
|
|
1859
|
+
product: async (_, { locator }, ctx) => {
|
|
1860
|
+
// Insert channel in context for later usage
|
|
1861
|
+
const channel = findChannel(locator);
|
|
1862
|
+
const locale = findLocale(locator);
|
|
1863
|
+
const id = findSkuId(locator);
|
|
1864
|
+
const slug = findSlug(locator);
|
|
1865
|
+
if (channel) {
|
|
1866
|
+
mutateChannelContext(ctx, channel);
|
|
1867
|
+
}
|
|
1868
|
+
if (locale) {
|
|
1869
|
+
mutateLocaleContext(ctx, locale);
|
|
1870
|
+
}
|
|
1871
|
+
const { loaders: { skuLoader }, clients: { commerce, search }, } = ctx;
|
|
1872
|
+
try {
|
|
1873
|
+
const skuId = id ?? slug?.split('-').pop() ?? '';
|
|
1874
|
+
if (!isValidSkuId(skuId)) {
|
|
1875
|
+
throw new Error('Invalid SkuId');
|
|
1876
|
+
}
|
|
1877
|
+
const sku = await skuLoader.load(skuId);
|
|
1878
|
+
/**
|
|
1879
|
+
* Here be dragons 🦄🦄🦄
|
|
1880
|
+
*
|
|
1881
|
+
* In some cases, the slug has a valid skuId for a different
|
|
1882
|
+
* product. This condition makes sure that the fetched sku
|
|
1883
|
+
* is the one we actually asked for
|
|
1884
|
+
* */
|
|
1885
|
+
if (slug &&
|
|
1886
|
+
sku.isVariantOf.linkText &&
|
|
1887
|
+
!slug.startsWith(sku.isVariantOf.linkText)) {
|
|
1888
|
+
throw new Error(`Slug was set but the fetched sku does not satisfy the slug condition. slug: ${slug}, linkText: ${sku.isVariantOf.linkText}`);
|
|
1889
|
+
}
|
|
1890
|
+
return sku;
|
|
1891
|
+
}
|
|
1892
|
+
catch (err) {
|
|
1893
|
+
if (slug == null) {
|
|
1894
|
+
throw new errors/* BadRequestError */.oY('Missing slug or id');
|
|
1895
|
+
}
|
|
1896
|
+
const route = await commerce.catalog.portal.pagetype(`${slug}/p`);
|
|
1897
|
+
if (route.pageType !== 'Product' || !route.id) {
|
|
1898
|
+
throw new errors/* NotFoundError */.dR(`No product found for slug ${slug}`);
|
|
1899
|
+
}
|
|
1900
|
+
const { products: [product], } = await search.products({
|
|
1901
|
+
page: 0,
|
|
1902
|
+
count: 1,
|
|
1903
|
+
query: `product:${route.id}`,
|
|
1904
|
+
});
|
|
1905
|
+
if (!product) {
|
|
1906
|
+
throw new errors/* NotFoundError */.dR(`No product found for id ${route.id}`);
|
|
1907
|
+
}
|
|
1908
|
+
const sku = pickBestSku(product.items);
|
|
1909
|
+
return enhanceSku(sku, product);
|
|
1910
|
+
}
|
|
1911
|
+
},
|
|
1912
|
+
collection: (_, { slug }, ctx) => {
|
|
1913
|
+
const { loaders: { collectionLoader }, } = ctx;
|
|
1914
|
+
return collectionLoader.load(slug);
|
|
1915
|
+
},
|
|
1916
|
+
search: async (_, { first, after: maybeAfter, sort, term, selectedFacets }, ctx) => {
|
|
1917
|
+
// Insert channel in context for later usage
|
|
1918
|
+
const channel = findChannel(selectedFacets);
|
|
1919
|
+
const locale = findLocale(selectedFacets);
|
|
1920
|
+
const crossSelling = findCrossSelling(selectedFacets);
|
|
1921
|
+
if (channel) {
|
|
1922
|
+
mutateChannelContext(ctx, channel);
|
|
1923
|
+
}
|
|
1924
|
+
if (locale) {
|
|
1925
|
+
mutateLocaleContext(ctx, locale);
|
|
1926
|
+
}
|
|
1927
|
+
let query = term;
|
|
1928
|
+
/**
|
|
1929
|
+
* In case we are using crossSelling, we need to modify the search
|
|
1930
|
+
* we will be performing on our search engine. The idea in here
|
|
1931
|
+
* is to use the cross selling API for fetching the productIds our
|
|
1932
|
+
* search will return for us.
|
|
1933
|
+
* Doing this two request workflow makes it possible to have cross
|
|
1934
|
+
* selling with Search features, like pagination, internationalization
|
|
1935
|
+
* etc
|
|
1936
|
+
*/
|
|
1937
|
+
if (crossSelling) {
|
|
1938
|
+
const products = await ctx.clients.commerce.catalog.products.crossselling({
|
|
1939
|
+
type: FACET_CROSS_SELLING_MAP[crossSelling.key],
|
|
1940
|
+
productId: crossSelling.value,
|
|
1941
|
+
});
|
|
1942
|
+
query = `product:${products
|
|
1943
|
+
.map((x) => x.productId)
|
|
1944
|
+
.slice(0, first)
|
|
1945
|
+
.join(';')}`;
|
|
1946
|
+
}
|
|
1947
|
+
const after = maybeAfter ? Number(maybeAfter) : 0;
|
|
1948
|
+
const searchArgs = {
|
|
1949
|
+
page: Math.ceil(after / first),
|
|
1950
|
+
count: first,
|
|
1951
|
+
query: query ?? undefined,
|
|
1952
|
+
sort: SORT_MAP[sort ?? 'score_desc'],
|
|
1953
|
+
selectedFacets: selectedFacets?.flatMap(transformSelectedFacet) ?? [],
|
|
1954
|
+
};
|
|
1955
|
+
const productSearchPromise = ctx.clients.search.products(searchArgs);
|
|
1956
|
+
return { searchArgs, productSearchPromise };
|
|
1957
|
+
},
|
|
1958
|
+
allProducts: async (_, { first, after: maybeAfter }, ctx) => {
|
|
1959
|
+
const { clients: { search }, } = ctx;
|
|
1960
|
+
const after = maybeAfter ? Number(maybeAfter) : 0;
|
|
1961
|
+
const products = await search.products({
|
|
1962
|
+
page: Math.ceil(after / first),
|
|
1963
|
+
count: first,
|
|
1964
|
+
});
|
|
1965
|
+
const skus = products.products
|
|
1966
|
+
.map((product) => product.items.map((sku) => enhanceSku(sku, product)))
|
|
1967
|
+
.flat()
|
|
1968
|
+
.filter((sku) => sku.sellers.length > 0);
|
|
1969
|
+
return {
|
|
1970
|
+
pageInfo: {
|
|
1971
|
+
hasNextPage: products.pagination.after.length > 0,
|
|
1972
|
+
hasPreviousPage: products.pagination.before.length > 0,
|
|
1973
|
+
startCursor: '0',
|
|
1974
|
+
endCursor: products.recordsFiltered.toString(),
|
|
1975
|
+
totalCount: products.recordsFiltered,
|
|
1976
|
+
},
|
|
1977
|
+
// after + index is bigger than after+first itself because of the array flat() above
|
|
1978
|
+
edges: skus.map((sku, index) => ({
|
|
1979
|
+
node: sku,
|
|
1980
|
+
cursor: (after + index).toString(),
|
|
1981
|
+
})),
|
|
1982
|
+
};
|
|
1983
|
+
},
|
|
1984
|
+
allCollections: async (_, { first, after: maybeAfter }, ctx) => {
|
|
1985
|
+
const { clients: { commerce }, } = ctx;
|
|
1986
|
+
const after = maybeAfter ? Number(maybeAfter) : 0;
|
|
1987
|
+
const [brands, tree] = await Promise.all([
|
|
1988
|
+
commerce.catalog.brand.list(),
|
|
1989
|
+
commerce.catalog.category.tree(),
|
|
1990
|
+
]);
|
|
1991
|
+
const categories = [];
|
|
1992
|
+
const dfs = (node, level) => {
|
|
1993
|
+
categories.push({ ...node, level });
|
|
1994
|
+
for (const child of node.children) {
|
|
1995
|
+
dfs(child, level + 1);
|
|
1996
|
+
}
|
|
1997
|
+
};
|
|
1998
|
+
for (const node of tree) {
|
|
1999
|
+
dfs(node, 0);
|
|
2000
|
+
}
|
|
2001
|
+
const collections = [
|
|
2002
|
+
...brands
|
|
2003
|
+
.filter((brand) => brand.isActive)
|
|
2004
|
+
.map((x) => ({ ...x, type: 'brand' })),
|
|
2005
|
+
...categories,
|
|
2006
|
+
];
|
|
2007
|
+
const validCollections = collections
|
|
2008
|
+
// Nullable slugs may cause one route to override the other
|
|
2009
|
+
.filter((node) => Boolean(StoreCollection.slug(node, null, ctx, null)));
|
|
2010
|
+
return {
|
|
2011
|
+
pageInfo: {
|
|
2012
|
+
hasNextPage: validCollections.length - after > first,
|
|
2013
|
+
hasPreviousPage: after > 0,
|
|
2014
|
+
startCursor: '0',
|
|
2015
|
+
endCursor: (Math.min(first, validCollections.length - after) - 1).toString(),
|
|
2016
|
+
totalCount: validCollections.length,
|
|
2017
|
+
},
|
|
2018
|
+
edges: validCollections
|
|
2019
|
+
.slice(after, after + first)
|
|
2020
|
+
.map((node, index) => ({
|
|
2021
|
+
node,
|
|
2022
|
+
cursor: (after + index).toString(),
|
|
2023
|
+
})),
|
|
2024
|
+
};
|
|
2025
|
+
},
|
|
2026
|
+
shipping: async (_, { country, items, postalCode }, ctx) => {
|
|
2027
|
+
const { loaders: { simulationLoader }, clients: { commerce }, } = ctx;
|
|
2028
|
+
const [simulation, address] = await Promise.all([
|
|
2029
|
+
simulationLoader.load({ country, items, postalCode }),
|
|
2030
|
+
commerce.checkout.address({ postalCode, country }),
|
|
2031
|
+
]);
|
|
2032
|
+
return {
|
|
2033
|
+
...simulation,
|
|
2034
|
+
address,
|
|
2035
|
+
};
|
|
2036
|
+
},
|
|
2037
|
+
redirect: async (_, { term, selectedFacets }, ctx) => {
|
|
2038
|
+
// Currently the search redirection can be done through a search term or filter (facet) so we limit the redirect query to always have one of these values otherwise we do not execute it.
|
|
2039
|
+
// https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4Gd2wLQFbCwTsh8RUDwSoL?&utm_source=autocomplete
|
|
2040
|
+
if (!term && (!selectedFacets || !selectedFacets.length)) {
|
|
2041
|
+
return null;
|
|
2042
|
+
}
|
|
2043
|
+
const { redirect } = await ctx.clients.search.products({
|
|
2044
|
+
page: 1,
|
|
2045
|
+
count: 1,
|
|
2046
|
+
query: term ?? undefined,
|
|
2047
|
+
selectedFacets: selectedFacets?.flatMap(transformSelectedFacet) ?? [],
|
|
2048
|
+
});
|
|
2049
|
+
return {
|
|
2050
|
+
url: redirect,
|
|
2051
|
+
};
|
|
2052
|
+
},
|
|
2053
|
+
sellers: async (_, { postalCode, geoCoordinates, country, salesChannel }, ctx) => {
|
|
2054
|
+
const { clients: { commerce }, } = ctx;
|
|
2055
|
+
const regionData = await commerce.checkout.region({
|
|
2056
|
+
postalCode,
|
|
2057
|
+
geoCoordinates,
|
|
2058
|
+
country,
|
|
2059
|
+
salesChannel,
|
|
2060
|
+
});
|
|
2061
|
+
const region = regionData?.[0];
|
|
2062
|
+
const { id, sellers } = region;
|
|
2063
|
+
return {
|
|
2064
|
+
id,
|
|
2065
|
+
sellers,
|
|
2066
|
+
};
|
|
2067
|
+
},
|
|
2068
|
+
};
|
|
2069
|
+
//# sourceMappingURL=query.js.map
|
|
2070
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/review.js
|
|
2071
|
+
const StoreReview = {
|
|
2072
|
+
reviewRating: () => ({
|
|
2073
|
+
ratingValue: 5,
|
|
2074
|
+
bestRating: 5,
|
|
2075
|
+
}),
|
|
2076
|
+
author: () => ({
|
|
2077
|
+
name: '',
|
|
2078
|
+
}),
|
|
2079
|
+
};
|
|
2080
|
+
//# sourceMappingURL=review.js.map
|
|
2081
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/searchResult.js
|
|
2082
|
+
|
|
2083
|
+
|
|
2084
|
+
const isRootFacet = (facet, isDepartment, isBrand) => isDepartment
|
|
2085
|
+
? facet.key === 'category-1'
|
|
2086
|
+
: isBrand
|
|
2087
|
+
? facet.key === 'brand'
|
|
2088
|
+
: false;
|
|
2089
|
+
const StoreSearchResult = {
|
|
2090
|
+
suggestions: async (root, _, ctx) => {
|
|
2091
|
+
const { clients: { search }, } = ctx;
|
|
2092
|
+
const { searchArgs } = root;
|
|
2093
|
+
// If there's no search query, suggest the most popular searches.
|
|
2094
|
+
if (!searchArgs.query) {
|
|
2095
|
+
const topSearches = await search.topSearches();
|
|
2096
|
+
return {
|
|
2097
|
+
terms: topSearches.searches.map((item) => ({
|
|
2098
|
+
value: item.term,
|
|
2099
|
+
count: item.count,
|
|
2100
|
+
})),
|
|
2101
|
+
products: [],
|
|
2102
|
+
};
|
|
2103
|
+
}
|
|
2104
|
+
const { productSearchPromise } = root;
|
|
2105
|
+
const [terms, productSearchResult] = await Promise.all([
|
|
2106
|
+
search.suggestedTerms(searchArgs),
|
|
2107
|
+
productSearchPromise,
|
|
2108
|
+
]);
|
|
2109
|
+
const skus = productSearchResult.products
|
|
2110
|
+
.map((product) => {
|
|
2111
|
+
// What determines the presentation of the SKU is the price order
|
|
2112
|
+
// https://help.vtex.com/pt/tutorial/ordenando-imagens-na-vitrine-e-na-pagina-de-produto--tutorials_278
|
|
2113
|
+
const maybeSku = pickBestSku(product.items);
|
|
2114
|
+
return maybeSku && enhanceSku(maybeSku, product);
|
|
2115
|
+
})
|
|
2116
|
+
.filter((sku) => !!sku);
|
|
2117
|
+
const { searches } = terms;
|
|
2118
|
+
return {
|
|
2119
|
+
terms: searches.map((item) => ({ value: item.term, count: item.count })),
|
|
2120
|
+
products: skus,
|
|
2121
|
+
};
|
|
2122
|
+
},
|
|
2123
|
+
products: async ({ productSearchPromise }) => {
|
|
2124
|
+
const productSearchResult = await productSearchPromise;
|
|
2125
|
+
const skus = productSearchResult.products
|
|
2126
|
+
.map((product) => {
|
|
2127
|
+
// What determines the presentation of the SKU is the price order
|
|
2128
|
+
// https://help.vtex.com/pt/tutorial/ordenando-imagens-na-vitrine-e-na-pagina-de-produto--tutorials_278
|
|
2129
|
+
const maybeSku = pickBestSku(product.items);
|
|
2130
|
+
return maybeSku && enhanceSku(maybeSku, product);
|
|
2131
|
+
})
|
|
2132
|
+
.filter((sku) => !!sku);
|
|
2133
|
+
return {
|
|
2134
|
+
pageInfo: {
|
|
2135
|
+
hasNextPage: productSearchResult.pagination.after.length > 0,
|
|
2136
|
+
hasPreviousPage: productSearchResult.pagination.before.length > 0,
|
|
2137
|
+
startCursor: '0',
|
|
2138
|
+
endCursor: productSearchResult.recordsFiltered.toString(),
|
|
2139
|
+
totalCount: productSearchResult.recordsFiltered,
|
|
2140
|
+
},
|
|
2141
|
+
edges: skus.map((sku, index) => ({
|
|
2142
|
+
node: sku,
|
|
2143
|
+
cursor: index.toString(),
|
|
2144
|
+
})),
|
|
2145
|
+
};
|
|
2146
|
+
},
|
|
2147
|
+
facets: async ({ searchArgs }, _, ctx) => {
|
|
2148
|
+
const { clients: { search: is }, } = ctx;
|
|
2149
|
+
ctx.storage.searchArgs = searchArgs;
|
|
2150
|
+
const { facets = [] } = await is.facets(searchArgs);
|
|
2151
|
+
const isCollectionPage = !searchArgs.query;
|
|
2152
|
+
const isDepartment = searchArgs.selectedFacets?.length
|
|
2153
|
+
? searchArgs.selectedFacets[0].key === 'category-1'
|
|
2154
|
+
: false;
|
|
2155
|
+
const isBrand = searchArgs.selectedFacets?.length
|
|
2156
|
+
? searchArgs.selectedFacets[0].key === 'brand'
|
|
2157
|
+
: false;
|
|
2158
|
+
const filteredFacets = facets
|
|
2159
|
+
// Remove root facet on category and brand pages
|
|
2160
|
+
// TODO: Hide category filters for category pages. E.g. /office/desks
|
|
2161
|
+
.filter((facet) => !isCollectionPage || !isRootFacet(facet, isDepartment, isBrand));
|
|
2162
|
+
return filteredFacets;
|
|
2163
|
+
},
|
|
2164
|
+
metadata: async ({ searchArgs, productSearchPromise }) => {
|
|
2165
|
+
if (!searchArgs.query) {
|
|
2166
|
+
return null;
|
|
2167
|
+
}
|
|
2168
|
+
const productSearchResult = await productSearchPromise;
|
|
2169
|
+
return {
|
|
2170
|
+
isTermMisspelled: productSearchResult.correction?.misspelled ?? false,
|
|
2171
|
+
logicalOperator: productSearchResult.operator,
|
|
2172
|
+
};
|
|
2173
|
+
},
|
|
2174
|
+
};
|
|
2175
|
+
//# sourceMappingURL=searchResult.js.map
|
|
2176
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/seo.js
|
|
2177
|
+
const StoreSeo = {
|
|
2178
|
+
title: ({ title }) => title ?? '',
|
|
2179
|
+
description: ({ description }) => description ?? '',
|
|
2180
|
+
canonical: ({ canonical }) => canonical ?? '',
|
|
2181
|
+
titleTemplate: () => '',
|
|
2182
|
+
};
|
|
2183
|
+
//# sourceMappingURL=seo.js.map
|
|
2184
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/shippingSLA.js
|
|
2185
|
+
const units = ['bd', 'd', 'h', 'm'];
|
|
2186
|
+
const isUnit = (x) => units.includes(x);
|
|
2187
|
+
const localizedEstimates = {
|
|
2188
|
+
bd: {
|
|
2189
|
+
0: 'Today',
|
|
2190
|
+
1: 'In 1 business day',
|
|
2191
|
+
other: `Up to # business days`,
|
|
2192
|
+
},
|
|
2193
|
+
d: {
|
|
2194
|
+
0: 'Today',
|
|
2195
|
+
1: 'In 1 day',
|
|
2196
|
+
other: 'Up to # days',
|
|
2197
|
+
},
|
|
2198
|
+
h: {
|
|
2199
|
+
0: 'Now',
|
|
2200
|
+
1: 'In 1 hour',
|
|
2201
|
+
other: 'Up to # hours',
|
|
2202
|
+
},
|
|
2203
|
+
m: {
|
|
2204
|
+
0: 'Now',
|
|
2205
|
+
1: 'In 1 minute',
|
|
2206
|
+
other: 'Up to # minutes',
|
|
2207
|
+
},
|
|
2208
|
+
};
|
|
2209
|
+
/**
|
|
2210
|
+
* Transforms estimate (e.g 3bd) into friendly format (e.g Up to 3 business days)
|
|
2211
|
+
* based on https://github.com/vtex-apps/shipping-estimate-translator/blob/13e17055d6353dd3f3f4c31bae77ab049002809b/messages/en.json
|
|
2212
|
+
*/
|
|
2213
|
+
const getLocalizedEstimates = (estimate) => {
|
|
2214
|
+
const [amount, unit] = [estimate.split(/\D+/)[0], estimate.split(/[0-9]+/)[1]];
|
|
2215
|
+
const isAmountNumber = amount !== '' && !Number.isNaN(Number(amount));
|
|
2216
|
+
const isUnitValid = isUnit(unit);
|
|
2217
|
+
if (!isAmountNumber || !isUnitValid) {
|
|
2218
|
+
return '';
|
|
2219
|
+
}
|
|
2220
|
+
const amountKey = Number(amount) < 2 ? Number(amount) : 'other';
|
|
2221
|
+
return localizedEstimates[unit][amountKey].replace('#', amount) ?? '';
|
|
2222
|
+
};
|
|
2223
|
+
const ShippingSLA = {
|
|
2224
|
+
carrier: (root) => root?.friendlyName ?? root?.name ?? '',
|
|
2225
|
+
price: (root) => (root?.price ? root.price / 100 : root?.price),
|
|
2226
|
+
localizedEstimates: (root) => root?.shippingEstimate ? getLocalizedEstimates(root.shippingEstimate) : '',
|
|
2227
|
+
};
|
|
2228
|
+
//# sourceMappingURL=shippingSLA.js.map
|
|
2229
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/skuVariants.js
|
|
2230
|
+
function findSkuVariantImage(availableImages) {
|
|
2231
|
+
return (availableImages.find((imageProperties) => imageProperties.imageLabel === 'skuvariation') ?? availableImages[0]);
|
|
2232
|
+
}
|
|
2233
|
+
function createSlugsMap(variants, dominantVariantName, baseSlug) {
|
|
2234
|
+
/**
|
|
2235
|
+
* Maps property value combinations to their respective SKU's slug. Enables
|
|
2236
|
+
* us to retrieve the slug for the SKU that matches the currently selected
|
|
2237
|
+
* variations in O(1) time.
|
|
2238
|
+
*
|
|
2239
|
+
* Example: `'Color-Red-Size-40': 'classic-shoes-37'`
|
|
2240
|
+
*/
|
|
2241
|
+
const slugsMap = {};
|
|
2242
|
+
variants.forEach((variant) => {
|
|
2243
|
+
const skuSpecificationProperties = variant.variations;
|
|
2244
|
+
if (skuSpecificationProperties.length === 0) {
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
// Make sure that the 'name-value' pair for the dominant variation
|
|
2248
|
+
// is always the first one.
|
|
2249
|
+
const dominantNameValue = `${dominantVariantName}-${skuSpecificationProperties.find((variationDetails) => variationDetails.name === dominantVariantName)?.values[0] ?? ''}`;
|
|
2250
|
+
const skuVariantKey = skuSpecificationProperties.reduce((acc, property) => {
|
|
2251
|
+
const shouldIgnore = property.name === dominantVariantName;
|
|
2252
|
+
if (shouldIgnore) {
|
|
2253
|
+
return acc;
|
|
2254
|
+
}
|
|
2255
|
+
return acc + `-${property.name}-${property.values[0]}`;
|
|
2256
|
+
}, dominantNameValue);
|
|
2257
|
+
slugsMap[skuVariantKey] = `${baseSlug}-${variant.itemId}`;
|
|
2258
|
+
});
|
|
2259
|
+
return slugsMap;
|
|
2260
|
+
}
|
|
2261
|
+
function getActiveSkuVariations(variations) {
|
|
2262
|
+
const activeVariations = {};
|
|
2263
|
+
variations.forEach((variation) => {
|
|
2264
|
+
activeVariations[variation.name] = variation.values[0];
|
|
2265
|
+
});
|
|
2266
|
+
return activeVariations;
|
|
2267
|
+
}
|
|
2268
|
+
function getVariantsByName(skuSpecifications) {
|
|
2269
|
+
const variants = {};
|
|
2270
|
+
skuSpecifications?.forEach((specification) => {
|
|
2271
|
+
variants[specification.field.originalName ?? specification.field.name] =
|
|
2272
|
+
specification.values.map((value) => value.originalName ?? value.name);
|
|
2273
|
+
});
|
|
2274
|
+
return variants;
|
|
2275
|
+
}
|
|
2276
|
+
function compare(a, b) {
|
|
2277
|
+
// Values are always represented as Strings, so we need to handle numbers
|
|
2278
|
+
// in this special case.
|
|
2279
|
+
if (!Number.isNaN(Number(a) - Number(b))) {
|
|
2280
|
+
return Number(a) - Number(b);
|
|
2281
|
+
}
|
|
2282
|
+
if (a < b) {
|
|
2283
|
+
return -1;
|
|
2284
|
+
}
|
|
2285
|
+
if (a > b) {
|
|
2286
|
+
return 1;
|
|
2287
|
+
}
|
|
2288
|
+
return 0;
|
|
2289
|
+
}
|
|
2290
|
+
function sortVariants(variantsByName) {
|
|
2291
|
+
const sortedVariants = variantsByName;
|
|
2292
|
+
for (const variantProperty in variantsByName) {
|
|
2293
|
+
variantsByName[variantProperty].sort((a, b) => compare(a.value, b.value));
|
|
2294
|
+
}
|
|
2295
|
+
return sortedVariants;
|
|
2296
|
+
}
|
|
2297
|
+
function getFormattedVariations(variants, dominantVariantName, dominantVariantValue) {
|
|
2298
|
+
/**
|
|
2299
|
+
* SKU options already formatted and indexed by their property name.
|
|
2300
|
+
*
|
|
2301
|
+
* Ex: {
|
|
2302
|
+
* `Size`: [
|
|
2303
|
+
* { label: '42', value: '42' },
|
|
2304
|
+
* { label: '41', value: '41' },
|
|
2305
|
+
* { label: '39', value: '39' },
|
|
2306
|
+
* ]
|
|
2307
|
+
* }
|
|
2308
|
+
*/
|
|
2309
|
+
const variantsByName = {};
|
|
2310
|
+
const previouslySeenPropertyValues = new Set();
|
|
2311
|
+
variants.forEach((variant) => {
|
|
2312
|
+
if (variant.variations.length === 0) {
|
|
2313
|
+
return;
|
|
2314
|
+
}
|
|
2315
|
+
const variantImageToUse = findSkuVariantImage(variant.images);
|
|
2316
|
+
const dominantVariantEntry = variant.variations.find((variation) => variation.name === dominantVariantName);
|
|
2317
|
+
const matchesDominantVariant = dominantVariantEntry?.values[0] === dominantVariantValue;
|
|
2318
|
+
if (!matchesDominantVariant) {
|
|
2319
|
+
const nameValueIdentifier = `${dominantVariantName}-${dominantVariantEntry?.values[0]}`;
|
|
2320
|
+
if (!dominantVariantEntry ||
|
|
2321
|
+
previouslySeenPropertyValues.has(nameValueIdentifier)) {
|
|
2322
|
+
return;
|
|
2323
|
+
}
|
|
2324
|
+
previouslySeenPropertyValues.add(nameValueIdentifier);
|
|
2325
|
+
const formattedVariant = {
|
|
2326
|
+
src: variantImageToUse.imageUrl,
|
|
2327
|
+
alt: variantImageToUse.imageLabel ?? '',
|
|
2328
|
+
label: `${dominantVariantName}: ${dominantVariantEntry.values[0]}`,
|
|
2329
|
+
value: dominantVariantEntry.values[0],
|
|
2330
|
+
};
|
|
2331
|
+
if (variantsByName[dominantVariantEntry.name]) {
|
|
2332
|
+
variantsByName[dominantVariantEntry.name].push(formattedVariant);
|
|
2333
|
+
}
|
|
2334
|
+
else {
|
|
2335
|
+
variantsByName[dominantVariantEntry.name] = [formattedVariant];
|
|
2336
|
+
}
|
|
2337
|
+
return;
|
|
2338
|
+
}
|
|
2339
|
+
variant.variations.forEach((variationProperty) => {
|
|
2340
|
+
const nameValueIdentifier = `${variationProperty.name}-${variationProperty.values[0]}`;
|
|
2341
|
+
if (previouslySeenPropertyValues.has(nameValueIdentifier)) {
|
|
2342
|
+
return;
|
|
2343
|
+
}
|
|
2344
|
+
previouslySeenPropertyValues.add(nameValueIdentifier);
|
|
2345
|
+
const formattedVariant = {
|
|
2346
|
+
src: variantImageToUse.imageUrl,
|
|
2347
|
+
alt: variantImageToUse.imageLabel ?? '',
|
|
2348
|
+
label: `${variationProperty.name}: ${variationProperty.values[0]}`,
|
|
2349
|
+
value: variationProperty.values[0],
|
|
2350
|
+
};
|
|
2351
|
+
if (variantsByName[variationProperty.name]) {
|
|
2352
|
+
variantsByName[variationProperty.name].push(formattedVariant);
|
|
2353
|
+
}
|
|
2354
|
+
else {
|
|
2355
|
+
variantsByName[variationProperty.name] = [formattedVariant];
|
|
2356
|
+
}
|
|
2357
|
+
});
|
|
2358
|
+
});
|
|
2359
|
+
return sortVariants(variantsByName);
|
|
2360
|
+
}
|
|
2361
|
+
//# sourceMappingURL=skuVariants.js.map
|
|
2362
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/skuVariations.js
|
|
2363
|
+
|
|
2364
|
+
const SkuVariants = {
|
|
2365
|
+
activeVariations: (root) => getActiveSkuVariations(root.variations),
|
|
2366
|
+
allVariantsByName: (root) => getVariantsByName(root.isVariantOf.skuSpecifications),
|
|
2367
|
+
slugsMap: (root, args) => createSlugsMap(root.isVariantOf.items, args.dominantVariantName ?? root.variations[0]?.name, root.isVariantOf.linkText),
|
|
2368
|
+
availableVariations: (root, args) => {
|
|
2369
|
+
const dominantVariantName = args.dominantVariantName ?? root.variations[0]?.name;
|
|
2370
|
+
const activeVariations = getActiveSkuVariations(root.variations);
|
|
2371
|
+
const activeDominantVariationValue = activeVariations[dominantVariantName];
|
|
2372
|
+
const filteredFormattedVariations = getFormattedVariations(root.isVariantOf.items, dominantVariantName, activeDominantVariationValue);
|
|
2373
|
+
return filteredFormattedVariations;
|
|
2374
|
+
},
|
|
2375
|
+
};
|
|
2376
|
+
//# sourceMappingURL=skuVariations.js.map
|
|
2377
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/index.js
|
|
175
2378
|
|
|
176
|
-
/***/ 3307:
|
|
177
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
178
2379
|
|
|
179
|
-
var __webpack_unused_export__;
|
|
180
|
-
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=__webpack_require__(4246),i=e(__webpack_require__(7881)),t=e(__webpack_require__(3057)),a=e(__webpack_require__(5471)),r=e(__webpack_require__(6109)),o=e(__webpack_require__(2404)),l=e(__webpack_require__(6113)),d=__webpack_require__(7343),s=__webpack_require__(6548),u=__webpack_require__(1718),c=__webpack_require__(1283),m=__webpack_require__(4161),p=__webpack_require__(5196),k=__webpack_require__(2793),v=__webpack_require__(6969),g=__webpack_require__(357),y=__webpack_require__(7006),f=__webpack_require__(4691),N=__webpack_require__(8973);const S=async(e,n)=>{const t=await i(e,{...n,headers:{...null==n?void 0:n.headers,"User-Agent":"@faststore/api@2.2.38"}});if(t.ok)return 204!==t.status?t.json():void 0;console.error(e,n,t);const a=await t.text();throw new Error(a)},h={method:"POST",headers:{"content-type":"application/json"}},b=new Set(["trade-policy","region-id"]),T=({account:e,environment:n,hideUnavailableItems:i},t)=>{const a=`https://${e}.${n}.com.br/api/io`,r=({query:e="",page:n,count:r,sort:o="",selectedFacets:l=[],type:d,fuzzy:s="auto"})=>{const u=new URLSearchParams({page:(n+1).toString(),count:r.toString(),query:e,sort:o,fuzzy:s,locale:t.storage.locale});void 0!==i&&u.append("hideUnavailableItems",i.toString());const c=(e=>{var n,i;const a=e.filter(({key:e})=>!b.has(e)),r=null!=(n=e.find(({key:e})=>"trade-policy"===e))?n:(()=>{const{salesChannel:e}=t.storage.channel;return e?{key:"trade-policy",value:e}:null})(),o=null!=(i=e.find(({key:e})=>"region-id"===e))?i:(()=>{const{regionId:e,seller:n}=t.storage.channel,i=n?Buffer.from("SW#"+n).toString("base64"):null,a=null!=i?i:e;return a?{key:"region-id",value:a}:null})();return null!==r&&a.push(r),null!==o&&a.push(o),a})(l).map(({key:e,value:n})=>`${e}/${n}`).join("/");return S(`${a}/_v/api/intelligent-search/${d}/${c}?${u.toString()}`)};return{facets:e=>r({...e,type:"facets"}),products:e=>r({...e,type:"product_search"}),suggestedTerms:e=>{var n,i;const r=new URLSearchParams({query:null!=(n=null==(i=e.query)?void 0:i.toString())?n:"",locale:t.storage.locale});return S(`${a}/_v/api/intelligent-search/search_suggestions?${r.toString()}`)},topSearches:()=>{const e=new URLSearchParams({locale:t.storage.locale});return S(`${a}/_v/api/intelligent-search/top_searches?${e.toString()}`)}}},V=()=>(1e6*Math.random()).toFixed(0),D=e=>{let n=V(),i=Date.now();return()=>{var t;return t=i,(Date.now()-t)/1e3>e&&(n=V(),i=Date.now()),n}},I={anonymous:D(31536e3),session:D(1800)};function w(e){return{...e,description:e.description?(n=e.description,r(n,void 0)):e.description};var n}const F=(e,n)=>({...e,isVariantOf:w(n)});class C extends Error{constructor(e,n){super(n),this.extensions=e,this.name="FastStoreError"}}class O extends C{constructor(e){super({status:400,type:"BadRequestError"},e)}}class P extends C{constructor(e){super({status:404,type:"NotFoundError"},e)}}const A=new Set(["brand","category","department","subcategory","collection","cluster"]),L=e=>"string"==typeof e.pageType&&A.has(e.pageType.toLowerCase()),E=e=>e.AvailableQuantity>0,R=e=>{var n;return null!=(n=e.spotPrice)?n:0},x=e=>e?"https://schema.org/InStock":"https://schema.org/OutOfStock",M=(e,n)=>E(e)&&!E(n)?-1:!E(e)&&E(n)?1:R(e)-R(n),U={highPrice:e=>{const n=e.filter(E),i=n[n.length-1];return null!=i?R(i):0},lowPrice:e=>{const[n]=e.filter(E);return n?R(n):0},offerCount:e=>e.length,priceCurrency:async(e,n,i)=>{var t;const{loaders:{salesChannelLoader:a},storage:{channel:r}}=i;return null!=(t=(await a.load(r.salesChannel)).CurrencyCode)?t:""},offers:e=>e},q="ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a";function j(e){return(e=>e.replace(/[·/_,:]/,"-"))((e=>{let n=e.slice(0);for(let e=0;e<q.length;e++)n=n.replace(new RegExp(q.charAt(e),"g"),"AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa".charAt(e));return n})(e.replace(/,/g,"").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g,"-"))).toLowerCase()}const _=e=>"brand"===e.type||L(e)&&"brand"===e.pageType.toLowerCase(),B=e=>L(e)&&"collection"===e.pageType.toLowerCase(),$=e=>_(e)||B(e)?j(e.name):L(e)?new URL("https://"+e.url).pathname.slice(1).toLowerCase():new URL(e.url).pathname.slice(1).toLowerCase(),G={id:({id:e})=>e.toString(),slug:e=>$(e),seo:e=>_(e)||L(e)?{title:e.title,description:e.metaTagDescription}:{title:e.Title,description:e.MetaTagDescription},type:e=>_(e)?"Brand":L(e)?e.pageType:0===e.level?"Department":"Category",meta:e=>{const n=$(e);return _(e)?{selectedFacets:[{key:"brand",value:n}]}:B(e)?{selectedFacets:[{key:"productclusterids",value:e.id}]}:{selectedFacets:n.split("/").map((e,n)=>({key:"category-"+(n+1),value:e}))}},breadcrumbList:async(e,n,i)=>{const{loaders:{collectionLoader:t}}=i,a=$(e).split("/").filter(e=>Boolean(e)),r=a.map((e,n)=>a.slice(0,n+1).join("/")),o=await Promise.all(r.map(async e=>({slug:e,...await t.load(e)})));return{itemListElement:o.map((e,n)=>({item:B(e)?"/"+e.slug:new URL("https://"+e.url).pathname.toLowerCase(),name:e.name,position:n+1})),numberOfItems:o.length}}},z={buy:"whoboughtalsobought",view:"whosawalsosaw",similars:"similars",viewAndBought:"whosawalsobought",accessories:"accessories",suggestions:"suggestions"},K=({key:e,value:n})=>{switch(e){case"price":return{key:e,value:n.replace("-to-",":")};case"channel":case"locale":case"buy":case"view":case"similars":case"viewAndBought":case"accessories":case"suggestions":return[];default:return{key:e,value:n}}},W=e=>{const n=e.split(":").map(Number);return 2!==n.length||Number.isNaN(n[0])||Number.isNaN(n[1])?null:n},Q=e=>{var n,i;return null!=(n=null==e||null==(i=e.find(e=>"locale"===e.key))?void 0:i.value)?n:null},X=e=>{var n,i;return null!=(n=null==e||null==(i=e.find(e=>"channel"===e.key))?void 0:i.value)?n:null},Y=(e,n)=>{let i=0;for(let t=1;t<e.length;t++)n(e[i],e[t])>0&&(i=t);return e[i]},J={key:({key:e})=>e,label:({name:e})=>e,min:({values:e,key:n},i,{storage:{searchArgs:t}})=>{var a,r,o,l,d;const s=W(null!=(a=null==t||null==(r=t.selectedFacets)||null==(o=r.find(e=>e.key===n))?void 0:o.value)?a:""),u=Y(e,(e,n)=>e.range.from-n.range.from),c=null!=(l=null==u?void 0:u.range.from)?l:0;return{selected:null!=(d=null==s?void 0:s[0])?d:c,absolute:c}},max:({values:e,key:n},i,{storage:{searchArgs:t}})=>{var a,r,o,l,d;const s=W(null!=(a=null==t||null==(r=t.selectedFacets)||null==(o=r.find(e=>e.key===n))?void 0:o.value)?a:""),u=Y(e,(e,n)=>n.range.to-e.range.to),c=null!=(l=null==u?void 0:u.range.to)?l:0;return{selected:null!=(d=null==s?void 0:s[1])?d:c,absolute:c}}};class H{static parse(e){try{var n,i,t;const a=JSON.parse(e);return{seller:null!=(n=a.seller)?n:"",regionId:null!=(i=a.regionId)?i:"",salesChannel:null!=(t=a.salesChannel)?t:""}}catch(e){throw console.error(e),new Error("Malformed channel string")}}static stringify(e){return JSON.stringify(e)}}const Z=(e,n)=>{e.storage.channel=H.parse(n)},ee=(e,n)=>{e.storage.locale=n},ne=e=>l.createHash("md5").update(e).digest("hex");function ie(e){return{name:e.name,value:e.content,valueReference:"ATTACHMENT"}}function te(e){return ne(`${e.name}:${JSON.stringify(e.value)}:${e.valueReference}`)}const ae=e=>"ATTACHMENT"===e.valueReference,re=e=>{var n;return[e.itemOffered.sku,e.seller.identifier,e.price<.01?"Gift":void 0,null==(n=e.itemOffered.additionalProperty)?void 0:n.filter(ae).map(te).join("-")].filter(Boolean).join("::")},oe=(e,n)=>({listPrice:e.listPrice/100,price:e.sellingPrice/100,quantity:e.quantity,seller:{identifier:e.seller},itemOffered:{sku:e.id,image:[],name:e.name,additionalProperty:e.attachments.map(ie)},index:n}),le=e=>{var n,i;return{quantity:e.quantity,seller:e.seller.identifier,id:e.itemOffered.sku,index:e.index,attachments:(null!=(n=null==(i=e.itemOffered.additionalProperty)?void 0:i.filter(ae))?n:[]).map(e=>({name:e.name,content:e.value}))}},de=e=>e.reduce((e,n)=>{var i;const t=re(n);return e.has(t)||e.set(t,[]),null==(i=e.get(t))||i.push(n),e},new Map),se=e=>{const n=e.items.reduce((e,n)=>{const i=re(oe(n));return e[i]||(e[i]=[]),e[i].push(n),e},{});return{...e,items:Object.values(n).map(e=>{const[n]=e,i=e.reduce((e,n)=>e+n.quantity,0);return{...n,quantity:i,sellingPrice:e.reduce((e,n)=>{var i,t,a,r;return e+(null!=(i=null==n||null==(t=n.priceDefinition)?void 0:t.total)?i:(null!=(a=null==n?void 0:n.quantity)?a:0)*(null!=(r=null==n?void 0:n.sellingPrice)?r:0))},0)/i}})}},ue=async(e,n)=>({order:{orderNumber:e.orderFormId,acceptedOffer:e.items.map(async e=>({...e,product:await n.load(e.id)}))},messages:e.messages.map(({text:e,status:n})=>({text:e,status:n.toUpperCase()}))}),ce=({items:e})=>ne(JSON.stringify(e)),me=async(e,n)=>{try{return await n.checkout.setCustomData({id:e.orderFormId,appId:"faststore",key:"cartEtag",value:ce(e)})}catch(e){throw console.error('Error while setting custom data to orderForm.\n Make sure to add the following custom app to the orderForm: \n{"fields":["cartEtag"],"id":"faststore","major":1}.\n More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api'),e}},pe={validateCart:async(e,{cart:{order:n},session:i},t)=>{const{orderNumber:a,acceptedOffer:r,shouldSplitItem:l}=n,{clients:{commerce:d},loaders:{skuLoader:s}}=t,u=null==i?void 0:i.channel,c=null==i?void 0:i.locale;u&&Z(t,u),c&&ee(t,c);const m=await(async(e,{clients:{commerce:n}})=>n.checkout.orderForm({id:e}))(a,t);if(0!==m.messages.length&&await(async(e,{clients:{commerce:n}})=>n.checkout.clearOrderFormMessages({id:e}))(a,t),(e=>{var n,i;const t=null==(n=e.customData)?void 0:n.customApps.find(e=>"faststore"===e.id),a=null==t||null==(i=t.fields)?void 0:i.cartEtag;return null==a||ce(e)!==a})(m)&&a){const e=await me(m,d).then(se);return ue(e,s)}const p=de(r),k=de(m.items.map(oe)),v=Array.from(k.entries()),g=Array.from(p.entries()),{itemsToAdd:y,itemsToUpdate:f}=g.reduce((e,[n,i])=>{const t=k.get(n);if(!t)return i.forEach(n=>e.itemsToAdd.push(n)),e;const[a,...r]=t,o=i.reduce((e,n)=>e+n.quantity,0);return e.itemsToUpdate.push({...a,quantity:o}),r.forEach(n=>e.itemsToUpdate.push({...n,quantity:0})),e},{itemsToAdd:[],itemsToUpdate:[]}),N=[...y,...f,...v.filter(([e])=>!p.has(e)).flatMap(([,e])=>e.map(e=>({...e,quantity:0})))].map(le);if(0===N.length)return null;const S=await d.checkout.updateOrderFormItems({id:m.orderFormId,orderItems:N,shouldSplitItem:l}).then(e=>(async(e,n,{clients:{commerce:i}})=>{if(!n)return e;const{updateShipping:t,addressChanged:a}=((e,n)=>{var i,t;if(!(e=>{var n,i;return!!e.postalCode||(null==(n=e.geoCoordinates)?void 0:n.latitude)&&(null==(i=e.geoCoordinates)?void 0:i.longitude)})(n))return{updateShipping:!1,addressChanged:!1};if(!(e=>0!==e.items.length)(e))return{updateShipping:!1,addressChanged:!1};const[a]=null!=(i=null==e||null==(t=e.shippingData)?void 0:t.selectedAddresses)?i:[];if(r=a,"string"==typeof(o=n.postalCode)&&(null==r?void 0:r.postalCode)!==o||((e,n)=>"number"==typeof(null==n?void 0:n.latitude)&&"number"==typeof(null==n?void 0:n.longitude)&&((null==e?void 0:e.geoCoordinates[0])!==(null==n?void 0:n.longitude)||(null==e?void 0:e.geoCoordinates[1])!==(null==n?void 0:n.latitude)))(a,n.geoCoordinates)||((e,n)=>"string"==typeof n&&(null==e?void 0:e.addressType)!==n)(a,n.addressType))return{updateShipping:!0,addressChanged:!0};var r,o;const{logisticsInfo:l}=e.shippingData;return((e,n)=>{var i,t,a;const r=null==n||null==(i=n.deliveryMode)?void 0:i.deliveryChannel,o=null==n||null==(t=n.deliveryMode)?void 0:t.deliveryMethod,{startDate:l,endDate:d}=(null==n||null==(a=n.deliveryMode)?void 0:a.deliveryWindow)||{};return e.some(({selectedDeliveryChannel:e,selectedSla:n,slas:i})=>{const t=r&&e!==r,a=o&&n!==o;return null==i?void 0:i.some(e=>{var n,i,s;return!!(t&&e.deliveryChannel===r||a&&e.id===o)||l&&d&&e.deliveryChannel===r&&e.id===o&&(!(null!=e&&e.deliveryWindow)||(null==e||null==(n=e.deliveryWindow)?void 0:n.startDateUtc)!==l||(null==e||null==(i=e.deliveryWindow)?void 0:i.endDateUtc)!==d)&&(null==(s=e.availableDeliveryWindows)?void 0:s.some(e=>(null==e?void 0:e.startDateUtc)===l&&(null==e?void 0:e.endDateUtc)===d))})})})(l,n)?{updateShipping:!0,addressChanged:!1}:{updateShipping:!1,addressChanged:!1}})(e,n);if(t){var r;const t=((e,n,i)=>{var t,a,r,o;const l=n.postalCode,d=n.geoCoordinates,s=null!=(t=null==e||null==(a=e.shippingData)?void 0:a.availableAddresses)?t:[],u=null!=(r=null==e||null==(o=e.shippingData)?void 0:o.selectedAddresses)?r:[];if(!i&&u.length>0)return[u[0]];if(i&&s.length>0)for(const e of s){if(l&&d&&(e.postalCode===l||e.geoCoordinates[0]===d.longitude&&e.geoCoordinates[1]===d.latitude))return[e];if(l&&!d&&e.postalCode===l)return[e];if(d&&!l&&e.geoCoordinates[0]===d.longitude&&e.geoCoordinates[1]===d.latitude)return[e]}return null})(e,n,a)||(e=>{const n=e.geoCoordinates,i={addressType:e.addressType||null,postalCode:e.postalCode||null,city:null,state:null,country:e.country||null,street:null,number:null,neighborhood:null,complement:null,reference:null,geoCoordinates:[]};if(n){const e="object"==typeof n&&"latitude"in n?n.latitude:null,t="object"==typeof n&&"longitude"in n?n.longitude:null;i.geoCoordinates=null!==e&&null!==t?[t,e]:[]}return[i]})(n);return!(null==(r=n.deliveryMode)||!r.deliveryWindow)&&await i.checkout.shippingData({id:e.orderFormId,index:e.items.length,deliveryMode:n.deliveryMode,selectedAddresses:t},!1),i.checkout.shippingData({id:e.orderFormId,index:e.items.length,deliveryMode:n.deliveryMode,selectedAddresses:t},!0)}return e})(e,i,t)).then(e=>me(e,d)).then(se),h=o(m.messages,S.messages);return((e,n)=>{const i=(e,n)=>({...e,itemOffered:{sku:e.itemOffered.sku},index:n}),t=n.items.map(oe).map(i),a=e.acceptedOffer.map(i),r=e.orderNumber===n.orderFormId,l=o(t,a);return r&&l})(n,S)&&h?null:ue(S,s)},validateSession:async(e,{session:n,search:i},{clients:t})=>{var a,r,l,d,s,u,c,m,p,k,v,g,y,f,N,S,h,b,T,V,D;const I=H.parse(null!=(a=n.channel)?a:""),w=String(null!=(r=n.postalCode)?r:"").replace(/\D/g,""),F=null!=(l=n.geoCoordinates)?l:null,C=null!=(d=n.country)?d:"",O=new URLSearchParams(i),P=null!=(s=O.get("sc"))?s:I.salesChannel;O.set("sc",P);const[A,L]=await Promise.all([w||F?t.commerce.checkout.region({postalCode:w,geoCoordinates:F,country:C,salesChannel:P}):Promise.resolve(null),t.commerce.session(O.toString()).catch(()=>null)]),E=null!=(u=null==L?void 0:L.namespaces.profile)?u:null,R=null!=(c=null==L?void 0:L.namespaces.store)?c:null,x=null==A?void 0:A[0],M=null==x?void 0:x.sellers.find(e=>I.seller===e.id),U={...n,currency:{code:null!=(m=null==R?void 0:R.currencyCode.value)?m:n.currency.code,symbol:null!=(p=null==R?void 0:R.currencySymbol.value)?p:n.currency.symbol},country:null!=(k=null==R?void 0:R.countryCode.value)?k:n.country,channel:H.stringify({salesChannel:null!=(v=null==R||null==(g=R.channel)?void 0:g.value)?v:I.salesChannel,regionId:null!=(y=null==x?void 0:x.id)?y:I.regionId,seller:null==M?void 0:M.id}),person:null!=E&&E.id?{id:null!=(f=null==(N=E.id)?void 0:N.value)?f:"",email:null!=(S=null==(h=E.email)?void 0:h.value)?S:"",givenName:null!=(b=null==(T=E.firstName)?void 0:T.value)?b:"",familyName:null!=(V=null==(D=E.lastName)?void 0:D.value)?V:""}:null};return o(n,U)?null:U},subscribeToNewsletter:async(e,{data:n},{clients:{commerce:i}})=>{const t=await i.subscribeToNewsletter(n);return{id:null==t?void 0:t.Id}}},ke=new d.GraphQLScalarType({name:"ObjectOrString",description:"A string or the string representation of an object (a stringified object).",parseValue:function(e){return"string"==typeof e?ve(e):null},serialize:function(e){return"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null},parseLiteral:e=>e.kind===s.Kind.STRING?ve(e.value):null});function ve(e){try{return JSON.parse(e)}catch(n){return e}}const ge=e=>"Price"in e&&"seller"in e&&"product"in e,ye=e=>"skuName"in e,fe={priceCurrency:async(e,n,i)=>{var t;const{loaders:{salesChannelLoader:a},storage:{channel:r}}=i;return null!=(t=(await a.load(r.salesChannel)).CurrencyCode)?t:""},priceValidUntil:e=>{var n,i;return ge(e)?null!=(n=e.PriceValidUntil)?n:"":ye(e)?null!=(i=e.priceValidUntil)?i:"":null},itemCondition:()=>"https://schema.org/NewCondition",availability:async e=>ge(e)?x(E(e)):ye(e)?x("available"===e.availability):null,seller:(e,n,i)=>{var t;return ge(e)?{identifier:(null==(t=i.storage.channel)?void 0:t.seller)||e.seller.sellerId||""}:ye(e)?{identifier:e.seller}:null},price:e=>ge(e)?R(e):ye(e)?e.sellingPrice/100:null,sellingPrice:e=>{return ge(e)?null!=(n=e.Price)?n:0:ye(e)?e.sellingPrice/100:null;var n},listPrice:e=>{var n;return ge(e)?null!=(n=e.ListPrice)?n:0:ye(e)?e.listPrice/100:null},itemOffered:e=>ge(e)?e.product:ye(e)?{...e.product,attachmentsValues:e.attachments}:null,quantity:e=>{var n;return ge(e)?null!=(n=e.AvailableQuantity)?n:0:ye(e)?e.quantity:null}},Ne=({linkText:e})=>`/${e}/p`,Se={imageText:"image",imageUrl:"https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg"},he=(e,n)=>`${e}-${n}`,be={productID:({itemId:e})=>e,name:({isVariantOf:e,name:n})=>null!=n?n:e.productName,slug:({isVariantOf:{linkText:e},itemId:n})=>he(e,n),description:({isVariantOf:{description:e}})=>e,seo:({isVariantOf:e})=>({title:e.productName,description:e.description,canonical:Ne(e)}),brand:({isVariantOf:{brand:e}})=>({name:e}),breadcrumbList:({isVariantOf:{categories:e,productName:n,linkText:i},itemId:t})=>{return{itemListElement:[...e.reverse().map((e,n)=>{const i=e.split("/");return{name:i[i.length-2],item:i.map(j).join("/"),position:n+1}}),{name:n,item:(a=i,r=t,`/${he(a,r)}/p`),position:e.length+1}],numberOfItems:e.length};var a,r},image:({images:e})=>{var n,i;return(null!=(i=e,n=Array.isArray(i)&&i.length>0?i:null)?n:[Se]).map(({imageUrl:e,imageText:n})=>({alternateName:null!=n?n:"",url:e.replace("vteximg.com.br","vtexassets.com")}))},sku:({itemId:e})=>e,gtin:({referenceId:e})=>{var n,i;return null!=(n=null==(i=e[0])?void 0:i.Value)?n:""},review:()=>[],aggregateRating:()=>({}),offers:e=>e.sellers.map(n=>(({offer:e,seller:n,product:i})=>({...e,product:i,seller:n}))({offer:n.commertialOffer,seller:n,product:e})).sort(M),isVariantOf:e=>e,additionalProperty:({variations:e=[],attachmentsValues:n=[]})=>[...e.flatMap(({name:e,values:n})=>n.map(n=>({name:e,value:n,valueReference:"SPECIFICATION"}))),...n.map(ie)],releaseDate:({isVariantOf:{releaseDate:e}})=>null!=e?e:""},Te=new Set(["allSpecifications"]),Ve={price_desc:"price:desc",price_asc:"price:asc",orders_desc:"orders:desc",name_desc:"name:desc",name_asc:"name:asc",release_desc:"release:desc",discount_desc:"discount:desc",score_desc:""},De=e=>{const n=e.flatMap(e=>e.sellers.map(n=>({offer:n.commertialOffer,sku:e}))),i=Y(n,({offer:e},{offer:n})=>M(e,n));return i?i.sku:e[0]},Ie={product:async(e,{locator:n},i)=>{const t=X(n),a=Q(n),r=null!=(l=null==(o=n)||null==(d=o.find(e=>"id"===e.key))?void 0:d.value)?l:null;var o,l,d;const s=(e=>{var n,i;return null!=(n=null==e||null==(i=e.find(e=>"slug"===e.key))?void 0:i.value)?n:null})(n);t&&Z(i,t),a&&ee(i,a);const{loaders:{skuLoader:u},clients:{commerce:c,search:m}}=i;try{var p;const e=null!=(p=null!=r?r:null==s?void 0:s.split("-").pop())?p:"";if(!(e=>""!==e&&!Number.isNaN(Number(e)))(e))throw new Error("Invalid SkuId");const n=await u.load(e);if(s&&n.isVariantOf.linkText&&!s.startsWith(n.isVariantOf.linkText))throw new Error(`Slug was set but the fetched sku does not satisfy the slug condition. slug: ${s}, linkText: ${n.isVariantOf.linkText}`);return n}catch(e){if(null==s)throw new O("Missing slug or id");const n=await c.catalog.portal.pagetype(s+"/p");if("Product"!==n.pageType||!n.id)throw new P("No product found for slug "+s);const{products:[i]}=await m.products({page:0,count:1,query:"product:"+n.id});if(!i)throw new P("No product found for id "+n.id);const t=De(i.items);return F(t,i)}},collection:(e,{slug:n},i)=>{const{loaders:{collectionLoader:t}}=i;return t.load(n)},search:async(e,{first:n,after:i,sort:t,term:a,selectedFacets:r},o)=>{var l,d;const s=X(r),u=Q(r),c=(e=>{var n;const i=null==e?void 0:e.filter(e=>(e=>"string"==typeof z[e])(e.key));if(Array.isArray(i)&&i.length>1)throw new O(`You passed ${i.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${i.map(e=>e.key).join(",")}`);return null!=(n=null==i?void 0:i[0])?n:null})(r);s&&Z(o,s),u&&ee(o,u);let m=a;c&&(m="product:"+(await o.clients.commerce.catalog.products.crossselling({type:z[c.key],productId:c.value})).map(e=>e.productId).slice(0,n).join(";"));const p=i?Number(i):0,k={page:Math.ceil(p/n),count:n,query:null!=(l=m)?l:void 0,sort:Ve[null!=t?t:"score_desc"],selectedFacets:null!=(d=null==r?void 0:r.flatMap(K))?d:[]};return{searchArgs:k,productSearchPromise:o.clients.search.products(k)}},allProducts:async(e,{first:n,after:i},t)=>{const{clients:{search:a}}=t,r=i?Number(i):0,o=await a.products({page:Math.ceil(r/n),count:n}),l=o.products.map(e=>e.items.map(n=>F(n,e))).flat().filter(e=>e.sellers.length>0);return{pageInfo:{hasNextPage:o.pagination.after.length>0,hasPreviousPage:o.pagination.before.length>0,startCursor:"0",endCursor:o.recordsFiltered.toString(),totalCount:o.recordsFiltered},edges:l.map((e,n)=>({node:e,cursor:(r+n).toString()}))}},allCollections:async(e,{first:n,after:i},t)=>{const{clients:{commerce:a}}=t,r=i?Number(i):0,[o,l]=await Promise.all([a.catalog.brand.list(),a.catalog.category.tree()]),d=[],s=(e,n)=>{d.push({...e,level:n});for(const i of e.children)s(i,n+1)};for(const e of l)s(e,0);const u=[...o.filter(e=>e.isActive).map(e=>({...e,type:"brand"})),...d].filter(e=>Boolean(G.slug(e,null,t,null)));return{pageInfo:{hasNextPage:u.length-r>n,hasPreviousPage:r>0,startCursor:"0",endCursor:(Math.min(n,u.length-r)-1).toString(),totalCount:u.length},edges:u.slice(r,r+n).map((e,n)=>({node:e,cursor:(r+n).toString()}))}},shipping:async(e,{country:n,items:i,postalCode:t},a)=>{const{loaders:{simulationLoader:r},clients:{commerce:o}}=a,[l,d]=await Promise.all([r.load({country:n,items:i,postalCode:t}),o.checkout.address({postalCode:t,country:n})]);return{...l,address:d}},redirect:async(e,{term:n,selectedFacets:i},t)=>{var a;if(!(n||i&&i.length))return null;const{redirect:r}=await t.clients.search.products({page:1,count:1,query:null!=n?n:void 0,selectedFacets:null!=(a=null==i?void 0:i.flatMap(K))?a:[]});return{url:r}},sellers:async(e,{postalCode:n,geoCoordinates:i,country:t,salesChannel:a},r)=>{const{clients:{commerce:o}}=r,l=await o.checkout.region({postalCode:n,geoCoordinates:i,country:t,salesChannel:a}),d=null==l?void 0:l[0],{id:s,sellers:u}=d;return{id:s,sellers:u}}},we=["bd","d","h","m"],Fe={bd:{0:"Today",1:"In 1 business day",other:"Up to # business days"},d:{0:"Today",1:"In 1 day",other:"Up to # days"},h:{0:"Now",1:"In 1 hour",other:"Up to # hours"},m:{0:"Now",1:"In 1 minute",other:"Up to # minutes"}};function Ce(e){const n={};return e.forEach(e=>{n[e.name]=e.values[0]}),n}function Oe(e,n){return Number.isNaN(Number(e)-Number(n))?e<n?-1:e>n?1:0:Number(e)-Number(n)}const Pe={StoreCollection:G,StoreAggregateOffer:U,StoreProduct:be,StoreSeo:{title:({title:e})=>null!=e?e:"",description:({description:e})=>null!=e?e:"",canonical:({canonical:e})=>null!=e?e:"",titleTemplate:()=>""},StoreFacet:{__resolveType:({type:e})=>"TEXT"===e?"StoreFacetBoolean":"StoreFacetRange"},StoreFacetBoolean:{key:({key:e})=>e,label:({name:e})=>e,values:({values:e})=>e.sort((e,n)=>e.name.localeCompare(n.name))},StoreFacetRange:J,StoreFacetValueBoolean:{value:({value:e})=>e,label:({name:e})=>e||"unknown",selected:({selected:e})=>e,quantity:({quantity:e})=>e},StoreOffer:fe,StoreAggregateRating:{ratingValue:()=>5,reviewCount:()=>0},StoreReview:{reviewRating:()=>({ratingValue:5,bestRating:5}),author:()=>({name:""})},StoreProductGroup:{hasVariant:e=>e.isVariantOf.items.map(n=>F(n,e.isVariantOf)),productGroupID:({isVariantOf:e})=>e.productId,name:e=>e.isVariantOf.productName,skuVariants:e=>e,additionalProperty:({isVariantOf:{specificationGroups:e}})=>e.filter(e=>!Te.has(e.name)).flatMap(({specifications:e})=>e.flatMap(({name:e,values:n})=>n.map(n=>({name:e,value:n,valueReference:"SPECIFICATION"}))))},StoreSearchResult:{suggestions:async(e,n,i)=>{const{clients:{search:t}}=i,{searchArgs:a}=e;if(!a.query)return{terms:(await t.topSearches()).searches.map(e=>({value:e.term,count:e.count})),products:[]};const{productSearchPromise:r}=e,[o,l]=await Promise.all([t.suggestedTerms(a),r]),d=l.products.map(e=>{const n=De(e.items);return n&&F(n,e)}).filter(e=>!!e),{searches:s}=o;return{terms:s.map(e=>({value:e.term,count:e.count})),products:d}},products:async({productSearchPromise:e})=>{const n=await e,i=n.products.map(e=>{const n=De(e.items);return n&&F(n,e)}).filter(e=>!!e);return{pageInfo:{hasNextPage:n.pagination.after.length>0,hasPreviousPage:n.pagination.before.length>0,startCursor:"0",endCursor:n.recordsFiltered.toString(),totalCount:n.recordsFiltered},edges:i.map((e,n)=>({node:e,cursor:n.toString()}))}},facets:async({searchArgs:e},n,i)=>{var t,a;const{clients:{search:r}}=i;i.storage.searchArgs=e;const{facets:o=[]}=await r.facets(e),l=!e.query,d=!(null==(t=e.selectedFacets)||!t.length)&&"category-1"===e.selectedFacets[0].key,s=!(null==(a=e.selectedFacets)||!a.length)&&"brand"===e.selectedFacets[0].key;return o.filter(e=>!l||!((e,n,i)=>n?"category-1"===e.key:!!i&&"brand"===e.key)(e,d,s))},metadata:async({searchArgs:e,productSearchPromise:n})=>{var i,t;if(!e.query)return null;const a=await n;return{isTermMisspelled:null!=(i=null==(t=a.correction)?void 0:t.misspelled)&&i,logicalOperator:a.operator}}},StorePropertyValue:{propertyID:e=>te(e),name:({name:e})=>e,value:({value:e})=>e,valueReference:({valueReference:e})=>e},SkuVariants:{activeVariations:e=>Ce(e.variations),allVariantsByName:e=>function(e){const n={};return null==e||e.forEach(e=>{var i;n[null!=(i=e.field.originalName)?i:e.field.name]=e.values.map(e=>{var n;return null!=(n=e.originalName)?n:e.name})}),n}(e.isVariantOf.skuSpecifications),slugsMap:(e,n)=>{var i,t;return function(e,n,i){const t={};return e.forEach(e=>{var a,r;const o=e.variations;if(0===o.length)return;const l=`${n}-${null!=(a=null==(r=o.find(e=>e.name===n))?void 0:r.values[0])?a:""}`,d=o.reduce((e,i)=>i.name===n?e:e+`-${i.name}-${i.values[0]}`,l);t[d]=`${i}-${e.itemId}`}),t}(e.isVariantOf.items,null!=(i=n.dominantVariantName)?i:null==(t=e.variations[0])?void 0:t.name,e.isVariantOf.linkText)},availableVariations:(e,n)=>{var i,t;const a=null!=(i=n.dominantVariantName)?i:null==(t=e.variations[0])?void 0:t.name,r=Ce(e.variations);return function(e,n,i){const t={},a=new Set;return e.forEach(e=>{if(0===e.variations.length)return;const r=null!=(l=(o=e.images).find(e=>"skuvariation"===e.imageLabel))?l:o[0];var o,l;const d=e.variations.find(e=>e.name===n);if((null==d?void 0:d.values[0])===i)e.variations.forEach(e=>{var n;const i=`${e.name}-${e.values[0]}`;if(a.has(i))return;a.add(i);const o={src:r.imageUrl,alt:null!=(n=r.imageLabel)?n:"",label:`${e.name}: ${e.values[0]}`,value:e.values[0]};t[e.name]?t[e.name].push(o):t[e.name]=[o]});else{var s;const e=`${n}-${null==d?void 0:d.values[0]}`;if(!d||a.has(e))return;a.add(e);const i={src:r.imageUrl,alt:null!=(s=r.imageLabel)?s:"",label:`${n}: ${d.values[0]}`,value:d.values[0]};t[d.name]?t[d.name].push(i):t[d.name]=[i]}}),function(e){const n=e;for(const n in e)e[n].sort((e,n)=>Oe(e.value,n.value));return n}(t)}(e.isVariantOf.items,a,r[a])}},ShippingSLA:{carrier:e=>{var n,i;return null!=(n=null!=(i=null==e?void 0:e.friendlyName)?i:null==e?void 0:e.name)?n:""},price:e=>null!=e&&e.price?e.price/100:null==e?void 0:e.price,localizedEstimates:e=>null!=e&&e.shippingEstimate?(e=>{var n;const[i,t]=[e.split(/\D+/)[0],e.split(/[0-9]+/)[1]],a=""!==i&&!Number.isNaN(Number(i)),r=we.includes(t);if(!a||!r)return"";const o=Number(i)<2?Number(i):"other";return null!=(n=Fe[t][o].replace("#",i))?n:""})(e.shippingEstimate):""},ObjectOrString:ke,Query:Ie,Mutation:pe};var Ae={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Address information.",block:!0},name:{kind:"Name",value:"Address"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address postal code",block:!0},name:{kind:"Name",value:"postalCode"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address city",block:!0},name:{kind:"Name",value:"city"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address state",block:!0},name:{kind:"Name",value:"state"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address country",block:!0},name:{kind:"Name",value:"country"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address street",block:!0},name:{kind:"Name",value:"street"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address number",block:!0},name:{kind:"Name",value:"number"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address neighborhood",block:!0},name:{kind:"Name",value:"neighborhood"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address complement",block:!0},name:{kind:"Name",value:"complement"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address reference",block:!0},name:{kind:"Name",value:"reference"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address geoCoordinates",block:!0},name:{kind:"Name",value:"geoCoordinates"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]}],loc:{start:0,end:554}};Ae.loc.source={body:'"""\nAddress information.\n"""\ntype Address {\n """\n Address postal code\n """\n postalCode: String\n """\n Address city\n """\n city: String\n """\n Address state\n """\n state: String\n """\n Address country\n """\n country: String\n """\n Address street\n """\n street: String\n """\n Address number\n """\n number: String\n """\n Address neighborhood\n """\n neighborhood: String\n """\n Address complement\n """\n complement: String\n """\n Address reference\n """\n reference: String\n """\n Address geoCoordinates\n """\n geoCoordinates: [Float]\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Le={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Aggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.",block:!0},name:{kind:"Name",value:"StoreAggregateOffer"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Highest price among all sellers.",block:!0},name:{kind:"Name",value:"highPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Lowest price among all sellers.",block:!0},name:{kind:"Name",value:"lowPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of sellers selling this SKU.",block:!0},name:{kind:"Name",value:"offerCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ISO code of the currency used for the offer prices.",block:!0},name:{kind:"Name",value:"priceCurrency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with information on each available offer.",block:!0},name:{kind:"Name",value:"offers"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOffer"}}}}},directives:[]}]}],loc:{start:0,end:516}};Le.loc.source={body:'"""\nAggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.\n"""\ntype StoreAggregateOffer {\n """\n Highest price among all sellers.\n """\n highPrice: Float!\n """\n Lowest price among all sellers.\n """\n lowPrice: Float!\n """\n Number of sellers selling this SKU.\n """\n offerCount: Int!\n """\n ISO code of the currency used for the offer prices.\n """\n priceCurrency: String!\n """\n Array with information on each available offer.\n """\n offers: [StoreOffer!]!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ee={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Average rating, based on multiple ratings or reviews.",block:!0},name:{kind:"Name",value:"StoreAggregateRating"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Value of the aggregate rating.",block:!0},name:{kind:"Name",value:"ratingValue"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Total number of ratings.",block:!0},name:{kind:"Name",value:"reviewCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:218}};Ee.loc.source={body:'"""\nAverage rating, based on multiple ratings or reviews.\n"""\ntype StoreAggregateRating {\n """\n Value of the aggregate rating.\n """\n ratingValue: Float!\n """\n Total number of ratings.\n """\n reviewCount: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Re={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"information about the author of a product review or rating.",block:!0},name:{kind:"Name",value:"StoreAuthor"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Author name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:132}};Re.loc.source={body:'"""\ninformation about the author of a product review or rating.\n"""\ntype StoreAuthor {\n """\n Author name.\n """\n name: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var xe={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Brand of a given product.",block:!0},name:{kind:"Name",value:"StoreBrand"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Brand name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:96}};xe.loc.source={body:'"""\nBrand of a given product.\n"""\ntype StoreBrand {\n """\n Brand name.\n """\n name: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Me={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Item of a list.",block:!0},name:{kind:"Name",value:"StoreListItem"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"List item value.",block:!0},name:{kind:"Name",value:"item"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Name of the list item.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Position of the item in the list.",block:!0},name:{kind:"Name",value:"position"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"List of items consisting of chain linked web pages, ending with the current page.",block:!0},name:{kind:"Name",value:"StoreBreadcrumbList"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with breadcrumb elements.",block:!0},name:{kind:"Name",value:"itemListElement"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreListItem"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of breadcrumbs in the list.",block:!0},name:{kind:"Name",value:"numberOfItems"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:486}};Me.loc.source={body:'"""\nItem of a list.\n"""\ntype StoreListItem {\n """\n List item value.\n """\n item: String!\n """\n Name of the list item.\n """\n name: String!\n """\n Position of the item in the list.\n """\n position: Int!\n}\n\n"""\nList of items consisting of chain linked web pages, ending with the current page.\n"""\ntype StoreBreadcrumbList {\n """\n Array with breadcrumb elements.\n """\n itemListElement: [StoreListItem!]!\n """\n Number of breadcrumbs in the list.\n """\n numberOfItems: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ue={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Shopping cart message.",block:!0},name:{kind:"Name",value:"StoreCartMessage"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Shopping cart message text.",block:!0},name:{kind:"Name",value:"text"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Shopping cart message status, which can be `INFO`, `WARNING` or `ERROR`.",block:!0},name:{kind:"Name",value:"status"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreStatus"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Shopping cart information.",block:!0},name:{kind:"Name",value:"StoreCart"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Order information, including `orderNumber` and `acceptedOffer`.",block:!0},name:{kind:"Name",value:"order"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOrder"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of shopping cart messages.",block:!0},name:{kind:"Name",value:"messages"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCartMessage"}}}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Shopping cart input.",block:!0},name:{kind:"Name",value:"IStoreCart"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Order information, including `orderNumber`, `acceptedOffer` and `shouldSplitItem`.",block:!0},name:{kind:"Name",value:"order"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOrder"}}},directives:[]}]}],loc:{start:0,end:628}};Ue.loc.source={body:'"""\nShopping cart message.\n"""\ntype StoreCartMessage {\n """\n Shopping cart message text.\n """\n text: String!\n """\n Shopping cart message status, which can be `INFO`, `WARNING` or `ERROR`.\n """\n status: StoreStatus!\n}\n\n"""\nShopping cart information.\n"""\ntype StoreCart {\n """\n Order information, including `orderNumber` and `acceptedOffer`.\n """\n order: StoreOrder!\n """\n List of shopping cart messages.\n """\n messages: [StoreCartMessage!]!\n}\n\n"""\nShopping cart input.\n"""\ninput IStoreCart {\n """\n Order information, including `orderNumber`, `acceptedOffer` and `shouldSplitItem`.\n """\n order: IStoreOrder!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var qe={kind:"Document",definitions:[{kind:"EnumTypeDefinition",description:{kind:"StringValue",value:"Product collection type. Possible values are `Department`, `Category`, `Brand`, `Cluster`, `SubCategory` or `Collection`.",block:!0},name:{kind:"Name",value:"StoreCollectionType"},directives:[],values:[{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"First level of product categorization.",block:!0},name:{kind:"Name",value:"Department"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Second level of product categorization.",block:!0},name:{kind:"Name",value:"Category"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Third level of product categorization.",block:!0},name:{kind:"Name",value:"SubCategory"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Product brand.",block:!0},name:{kind:"Name",value:"Brand"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Product cluster.",block:!0},name:{kind:"Name",value:"Cluster"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Product collection.",block:!0},name:{kind:"Name",value:"Collection"},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product collection facet, used for search.",block:!0},name:{kind:"Name",value:"StoreCollectionFacet"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet key.",block:!0},name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet value.",block:!0},name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Collection meta information. Used for search.",block:!0},name:{kind:"Name",value:"StoreCollectionMeta"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of selected collection facets.",block:!0},name:{kind:"Name",value:"selectedFacets"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionFacet"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product collection information.",block:!0},name:{kind:"Name",value:"StoreCollection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Meta tag data.",block:!0},name:{kind:"Name",value:"seo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSeo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of items consisting of chain linked web pages, ending with the current page.",block:!0},name:{kind:"Name",value:"breadcrumbList"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBreadcrumbList"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection meta information. Used for search.",block:!0},name:{kind:"Name",value:"meta"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionMeta"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection ID.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Corresponding collection URL slug, with which to retrieve this entity.",block:!0},name:{kind:"Name",value:"slug"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection type.",block:!0},name:{kind:"Name",value:"type"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionType"}}},directives:[]}]}],loc:{start:0,end:1361}};qe.loc.source={body:'"""\nProduct collection type. Possible values are `Department`, `Category`, `Brand`, `Cluster`, `SubCategory` or `Collection`.\n"""\nenum StoreCollectionType {\n """\n First level of product categorization.\n """\n Department\n """\n Second level of product categorization.\n """\n Category\n """\n Third level of product categorization.\n """\n SubCategory\n """\n Product brand.\n """\n Brand\n """\n Product cluster.\n """\n Cluster\n """\n Product collection.\n """\n Collection\n}\n\n"""\nProduct collection facet, used for search.\n"""\ntype StoreCollectionFacet {\n """\n Facet key.\n """\n key: String!\n """\n Facet value.\n """\n value: String!\n}\n\n"""\nCollection meta information. Used for search.\n"""\ntype StoreCollectionMeta {\n """\n List of selected collection facets.\n """\n selectedFacets: [StoreCollectionFacet!]!\n}\n\n"""\nProduct collection information.\n"""\ntype StoreCollection {\n """\n Meta tag data.\n """\n seo: StoreSeo!\n """\n List of items consisting of chain linked web pages, ending with the current page.\n """\n breadcrumbList: StoreBreadcrumbList!\n """\n Collection meta information. Used for search.\n """\n meta: StoreCollectionMeta!\n """\n Collection ID.\n """\n id: ID!\n """\n Corresponding collection URL slug, with which to retrieve this entity.\n """\n slug: String!\n """\n Collection type.\n """\n type: StoreCollectionType!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var je={kind:"Document",definitions:[{kind:"UnionTypeDefinition",name:{kind:"Name",value:"StoreFacet"},directives:[],types:[{kind:"NamedType",name:{kind:"Name",value:"StoreFacetRange"}},{kind:"NamedType",name:{kind:"Name",value:"StoreFacetBoolean"}}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search facet range information.",block:!0},name:{kind:"Name",value:"StoreFacetRange"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet key.",block:!0},name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet label.",block:!0},name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Minimum facet range value.",block:!0},name:{kind:"Name",value:"min"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetValueRange"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Maximum facet range value.",block:!0},name:{kind:"Name",value:"max"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetValueRange"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search facet boolean information.",block:!0},name:{kind:"Name",value:"StoreFacetBoolean"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet key.",block:!0},name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet label.",block:!0},name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with information on each facet value.",block:!0},name:{kind:"Name",value:"values"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetValueBoolean"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search facet range value information. Used for minimum and maximum range values.",block:!0},name:{kind:"Name",value:"StoreFacetValueRange"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search facet range absolute value.",block:!0},name:{kind:"Name",value:"absolute"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search facet range selected value.",block:!0},name:{kind:"Name",value:"selected"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of a specific facet value.",block:!0},name:{kind:"Name",value:"StoreFacetValueBoolean"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet value.",block:!0},name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet value label.",block:!0},name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates whether facet is selected.",block:!0},name:{kind:"Name",value:"selected"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of items with this facet.",block:!0},name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:1160}};je.loc.source={body:'union StoreFacet = StoreFacetRange | StoreFacetBoolean\n\n"""\nSearch facet range information.\n"""\ntype StoreFacetRange {\n """\n Facet key.\n """\n key: String!\n """\n Facet label.\n """\n label: String!\n """\n Minimum facet range value.\n """\n min: StoreFacetValueRange!\n """\n Maximum facet range value.\n """\n max: StoreFacetValueRange!\n}\n\n"""\nSearch facet boolean information.\n"""\ntype StoreFacetBoolean {\n """\n Facet key.\n """\n key: String!\n """\n Facet label.\n """\n label: String!\n """\n Array with information on each facet value.\n """\n values: [StoreFacetValueBoolean!]!\n}\n\n"""\nSearch facet range value information. Used for minimum and maximum range values.\n"""\ntype StoreFacetValueRange {\n """\n Search facet range absolute value.\n """\n absolute: Float!\n """\n Search facet range selected value.\n """\n selected: Float!\n}\n\n"""\nInformation of a specific facet value.\n"""\ntype StoreFacetValueBoolean {\n """\n Facet value.\n """\n value: String!\n """\n Facet value label.\n """\n label: String!\n """\n Indicates whether facet is selected.\n """\n selected: Boolean!\n """\n Number of items with this facet.\n """\n quantity: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var _e={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Image.",block:!0},name:{kind:"Name",value:"StoreImage"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Image URL.",block:!0},name:{kind:"Name",value:"url"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Alias for the image.",block:!0},name:{kind:"Name",value:"alternateName"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Image input.",block:!0},name:{kind:"Name",value:"IStoreImage"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Image input URL.",block:!0},name:{kind:"Name",value:"url"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Alias for the input image.",block:!0},name:{kind:"Name",value:"alternateName"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:291}};_e.loc.source={body:'"""\nImage.\n"""\ntype StoreImage {\n """\n Image URL.\n """\n url: String!\n """\n Alias for the image.\n """\n alternateName: String!\n}\n\n"""\nImage input.\n"""\ninput IStoreImage {\n """\n Image input URL.\n """\n url: String!\n """\n Alias for the input image.\n """\n alternateName: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Be={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"Mutation"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns `null`.",block:!0},name:{kind:"Name",value:"validateCart"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"cart"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreCart"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"session"},type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSession"}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"StoreCart"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Updates a web session with the specified values.",block:!0},name:{kind:"Name",value:"validateSession"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"session"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSession"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"search"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"StoreSession"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Subscribes a new person to the newsletter list.",block:!0},name:{kind:"Name",value:"subscribeToNewsletter"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"data"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IPersonNewsletter"}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"PersonNewsletter"}},directives:[]}]}],loc:{start:0,end:570}};Be.loc.source={body:'type Mutation {\n """\n Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns `null`.\n """\n validateCart(cart: IStoreCart!, session: IStoreSession): StoreCart\n """\n Updates a web session with the specified values.\n """\n validateSession(session: IStoreSession!, search: String!): StoreSession\n """\n Subscribes a new person to the newsletter list.\n """\n subscribeToNewsletter(data: IPersonNewsletter!): PersonNewsletter\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var $e={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Newsletter information.",block:!0},name:{kind:"Name",value:"PersonNewsletter"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Person's ID in the newsletter list.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Person data input to the newsletter.",block:!0},name:{kind:"Name",value:"IPersonNewsletter"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Person's name.",block:!0},name:{kind:"Name",value:"name"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Person's email.",block:!0},name:{kind:"Name",value:"email"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:289}};$e.loc.source={body:'"""\nNewsletter information.\n"""\n\ntype PersonNewsletter {\n """\n Person\'s ID in the newsletter list.\n """\n id: String!\n}\n\n"""\nPerson data input to the newsletter.\n"""\ninput IPersonNewsletter {\n """\n Person\'s name.\n """\n name: String!\n """\n Person\'s email.\n """\n email: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ge={kind:"Document",definitions:[{kind:"ScalarTypeDefinition",name:{kind:"Name",value:"ObjectOrString"},directives:[]}],loc:{start:0,end:21}};Ge.loc.source={body:"scalar ObjectOrString",name:"GraphQL request",locationOffset:{line:1,column:1}};var ze={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Offer information.",block:!0},name:{kind:"Name",value:"StoreOffer"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:'This is displayed as the "from" price in the context of promotions\' price comparison. This may change before it reaches the shelf.',block:!0},name:{kind:"Name",value:"listPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Computed price before applying coupons, taxes or benefits. This may change before it reaches the shelf.",block:!0},name:{kind:"Name",value:"sellingPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ISO code of the currency used for the offer prices.",block:!0},name:{kind:"Name",value:"priceCurrency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Also known as spot price.",block:!0},name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.",block:!0},name:{kind:"Name",value:"priceValidUntil"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Offer item condition.",block:!0},name:{kind:"Name",value:"itemCondition"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Offer item availability.",block:!0},name:{kind:"Name",value:"availability"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Seller responsible for the offer.",block:!0},name:{kind:"Name",value:"seller"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOrganization"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Information on the item being offered.",block:!0},name:{kind:"Name",value:"itemOffered"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of items offered.",block:!0},name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Offer input.",block:!0},name:{kind:"Name",value:"IStoreOffer"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Also known as spot price.",block:!0},name:{kind:"Name",value:"price"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:'This is displayed as the "from" price in the context of promotions\' price comparison. This may change before it reaches the shelf.',block:!0},name:{kind:"Name",value:"listPrice"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Seller responsible for the offer.",block:!0},name:{kind:"Name",value:"seller"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOrganization"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Information on the item being offered.",block:!0},name:{kind:"Name",value:"itemOffered"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreProduct"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Number of items offered.",block:!0},name:{kind:"Name",value:"quantity"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:1501}};ze.loc.source={body:'"""\nOffer information.\n"""\ntype StoreOffer {\n """\n This is displayed as the "from" price in the context of promotions\' price comparison. This may change before it reaches the shelf.\n """\n listPrice: Float!\n """\n Computed price before applying coupons, taxes or benefits. This may change before it reaches the shelf.\n """\n sellingPrice: Float!\n """\n ISO code of the currency used for the offer prices.\n """\n priceCurrency: String!\n """\n Also known as spot price.\n """\n price: Float!\n """\n Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.\n """\n priceValidUntil: String!\n """\n Offer item condition.\n """\n itemCondition: String!\n """\n Offer item availability.\n """\n availability: String!\n """\n Seller responsible for the offer.\n """\n seller: StoreOrganization!\n """\n Information on the item being offered.\n """\n itemOffered: StoreProduct!\n """\n Number of items offered.\n """\n quantity: Int!\n}\n\n"""\nOffer input.\n"""\ninput IStoreOffer {\n """\n Also known as spot price.\n """\n price: Float!\n """\n This is displayed as the "from" price in the context of promotions\' price comparison. This may change before it reaches the shelf.\n """\n listPrice: Float!\n """\n Seller responsible for the offer.\n """\n seller: IStoreOrganization!\n """\n Information on the item being offered.\n """\n itemOffered: IStoreProduct!\n """\n Number of items offered.\n """\n quantity: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ke={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of a specific order.",block:!0},name:{kind:"Name",value:"StoreOrder"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).",block:!0},name:{kind:"Name",value:"orderNumber"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with information on each accepted offer.",block:!0},name:{kind:"Name",value:"acceptedOffer"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOffer"}}}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Order input.",block:!0},name:{kind:"Name",value:"IStoreOrder"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).",block:!0},name:{kind:"Name",value:"orderNumber"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Array with information on each accepted offer.",block:!0},name:{kind:"Name",value:"acceptedOffer"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOffer"}}}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Indicates whether or not items with attachments should be split.",block:!0},name:{kind:"Name",value:"shouldSplitItem"},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}]}],loc:{start:0,end:740}};Ke.loc.source={body:'"""\nInformation of a specific order.\n"""\ntype StoreOrder {\n """\n ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).\n """\n orderNumber: String!\n """\n Array with information on each accepted offer.\n """\n acceptedOffer: [StoreOffer!]!\n}\n\n"""\nOrder input.\n"""\ninput IStoreOrder {\n """\n ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).\n """\n orderNumber: String!\n """\n Array with information on each accepted offer.\n """\n acceptedOffer: [IStoreOffer!]!\n """\n Indicates whether or not items with attachments should be split.\n """\n shouldSplitItem: Boolean\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var We={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Organization.",block:!0},name:{kind:"Name",value:"StoreOrganization"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Organization ID.",block:!0},name:{kind:"Name",value:"identifier"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Organization input.",block:!0},name:{kind:"Name",value:"IStoreOrganization"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Organization ID.",block:!0},name:{kind:"Name",value:"identifier"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:213}};We.loc.source={body:'"""\nOrganization.\n"""\ntype StoreOrganization {\n """\n Organization ID.\n """\n identifier: String!\n}\n\n"""\nOrganization input.\n"""\ninput IStoreOrganization {\n """\n Organization ID.\n """\n identifier: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Qe={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Whenever you make a query that allows for pagination, such as `allProducts` or `allCollections`, you can check `StorePageInfo` to learn more about the complete set of items and use it to paginate your queries.",block:!0},name:{kind:"Name",value:"StorePageInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates whether there is at least one more page with items after the ones returned in the current query.",block:!0},name:{kind:"Name",value:"hasNextPage"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates whether there is at least one more page with items before the ones returned in the current query.",block:!0},name:{kind:"Name",value:"hasPreviousPage"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Cursor corresponding to the first possible item.",block:!0},name:{kind:"Name",value:"startCursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Cursor corresponding to the last possible item.",block:!0},name:{kind:"Name",value:"endCursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Total number of items (products or collections), not pages.",block:!0},name:{kind:"Name",value:"totalCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:798}};Qe.loc.source={body:'"""\nWhenever you make a query that allows for pagination, such as `allProducts` or `allCollections`, you can check `StorePageInfo` to learn more about the complete set of items and use it to paginate your queries.\n"""\ntype StorePageInfo {\n """\n Indicates whether there is at least one more page with items after the ones returned in the current query.\n """\n hasNextPage: Boolean!\n """\n Indicates whether there is at least one more page with items before the ones returned in the current query.\n """\n hasPreviousPage: Boolean!\n """\n Cursor corresponding to the first possible item.\n """\n startCursor: String!\n """\n Cursor corresponding to the last possible item.\n """\n endCursor: String!\n """\n Total number of items (products or collections), not pages.\n """\n totalCount: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Xe={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Client profile data.",block:!0},name:{kind:"Name",value:"StorePerson"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Client ID.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Client email.",block:!0},name:{kind:"Name",value:"email"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Client first name.",block:!0},name:{kind:"Name",value:"givenName"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Client last name.",block:!0},name:{kind:"Name",value:"familyName"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Client profile data.",block:!0},name:{kind:"Name",value:"IStorePerson"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Client ID.",block:!0},name:{kind:"Name",value:"id"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Client email.",block:!0},name:{kind:"Name",value:"email"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Client first name.",block:!0},name:{kind:"Name",value:"givenName"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Client last name.",block:!0},name:{kind:"Name",value:"familyName"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:487}};Xe.loc.source={body:'"""\nClient profile data.\n"""\ntype StorePerson {\n """\n Client ID.\n """\n id: String!\n """\n Client email.\n """\n email: String!\n """\n Client first name.\n """\n givenName: String!\n """\n Client last name.\n """\n familyName: String!\n}\n\n"""\nClient profile data.\n"""\ninput IStorePerson {\n """\n Client ID.\n """\n id: String!\n """\n Client email.\n """\n email: String!\n """\n Client first name.\n """\n givenName: String!\n """\n Client last name.\n """\n familyName: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ye={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.",block:!0},name:{kind:"Name",value:"StoreProduct"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Meta tag data.",block:!0},name:{kind:"Name",value:"seo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSeo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of items consisting of chain linked web pages, ending with the current page.",block:!0},name:{kind:"Name",value:"breadcrumbList"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBreadcrumbList"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Corresponding collection URL slug, with which to retrieve this entity.",block:!0},name:{kind:"Name",value:"slug"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.",block:!0},name:{kind:"Name",value:"productID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product brand.",block:!0},name:{kind:"Name",value:"brand"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBrand"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product description.",block:!0},name:{kind:"Name",value:"description"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of images.",block:!0},name:{kind:"Name",value:"image"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreImage"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Aggregate offer information.",block:!0},name:{kind:"Name",value:"offers"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAggregateOffer"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Stock Keeping Unit. Merchant-specific ID for the product.",block:!0},name:{kind:"Name",value:"sku"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Global Trade Item Number.",block:!0},name:{kind:"Name",value:"gtin"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with review information.",block:!0},name:{kind:"Name",value:"review"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreReview"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Aggregate ratings data.",block:!0},name:{kind:"Name",value:"aggregateRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAggregateRating"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates product group related to this product.",block:!0},name:{kind:"Name",value:"isVariantOf"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductGroup"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of additional properties.",block:!0},name:{kind:"Name",value:"additionalProperty"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePropertyValue"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The product's release date. Formatted using https://en.wikipedia.org/wiki/ISO_8601",block:!0},name:{kind:"Name",value:"releaseDate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Product input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.",block:!0},name:{kind:"Name",value:"IStoreProduct"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Stock Keeping Unit. Merchant-specific ID for the product.",block:!0},name:{kind:"Name",value:"sku"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Product name.",block:!0},name:{kind:"Name",value:"name"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Array of product images.",block:!0},name:{kind:"Name",value:"image"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreImage"}}}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Custom Product Additional Properties.",block:!0},name:{kind:"Name",value:"additionalProperty"},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStorePropertyValue"}}}},directives:[]}]}],loc:{start:0,end:2274}};Ye.loc.source={body:'"""\nProduct information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n"""\ntype StoreProduct {\n """\n Meta tag data.\n """\n seo: StoreSeo!\n """\n List of items consisting of chain linked web pages, ending with the current page.\n """\n breadcrumbList: StoreBreadcrumbList!\n """\n Corresponding collection URL slug, with which to retrieve this entity.\n """\n slug: String!\n """\n Product name.\n """\n name: String!\n """\n Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.\n """\n productID: String!\n """\n Product brand.\n """\n brand: StoreBrand!\n """\n Product description.\n """\n description: String!\n """\n Array of images.\n """\n image: [StoreImage!]!\n """\n Aggregate offer information.\n """\n offers: StoreAggregateOffer!\n """\n Stock Keeping Unit. Merchant-specific ID for the product.\n """\n sku: String!\n """\n Global Trade Item Number.\n """\n gtin: String!\n """\n Array with review information.\n """\n review: [StoreReview!]!\n """\n Aggregate ratings data.\n """\n aggregateRating: StoreAggregateRating!\n """\n Indicates product group related to this product.\n """\n isVariantOf: StoreProductGroup!\n """\n Array of additional properties.\n """\n additionalProperty: [StorePropertyValue!]!\n """\n The product\'s release date. Formatted using https://en.wikipedia.org/wiki/ISO_8601\n """\n releaseDate: String!\n}\n\n"""\nProduct input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n"""\ninput IStoreProduct {\n """\n Stock Keeping Unit. Merchant-specific ID for the product.\n """\n sku: String!\n """\n Product name.\n """\n name: String!\n """\n Array of product images.\n """\n image: [IStoreImage!]!\n """\n Custom Product Additional Properties.\n """\n additionalProperty: [IStorePropertyValue!]\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Je={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.",block:!0},name:{kind:"Name",value:"StoreProductGroup"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).",block:!0},name:{kind:"Name",value:"hasVariant"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product group ID.",block:!0},name:{kind:"Name",value:"productGroupID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product group name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of additional properties.",block:!0},name:{kind:"Name",value:"additionalProperty"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePropertyValue"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Object containing data structures to facilitate handling different SKU\nvariant properties. Specially useful for implementing SKU selection \ncomponents.",block:!0},name:{kind:"Name",value:"skuVariants"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"SkuVariants"}},directives:[]}]}],loc:{start:0,end:1113}};Je.loc.source={body:'"""\nProduct group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n"""\ntype StoreProductGroup {\n """\n Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).\n """\n hasVariant: [StoreProduct!]!\n """\n Product group ID.\n """\n productGroupID: String!\n """\n Product group name.\n """\n name: String!\n """\n Array of additional properties.\n """\n additionalProperty: [StorePropertyValue!]!\n """\n Object containing data structures to facilitate handling different SKU\n variant properties. Specially useful for implementing SKU selection \n components.\n """\n skuVariants: SkuVariants\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var He={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Properties that can be associated with products and products groups.",block:!0},name:{kind:"Name",value:"StorePropertyValue"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Property id. This propert changes according to the content of the object.",block:!0},name:{kind:"Name",value:"propertyID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Property value. May hold a string or the string representation of an object.",block:!0},name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ObjectOrString"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Property name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Specifies the nature of the value",block:!0},name:{kind:"Name",value:"valueReference"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStorePropertyValue"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Property id. This propert changes according to the content of the object.",block:!0},name:{kind:"Name",value:"propertyID"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Property value. May hold a string or the string representation of an object.",block:!0},name:{kind:"Name",value:"value"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ObjectOrString"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Property name.",block:!0},name:{kind:"Name",value:"name"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Specifies the nature of the value",block:!0},name:{kind:"Name",value:"valueReference"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:825}};He.loc.source={body:'"""\nProperties that can be associated with products and products groups.\n"""\ntype StorePropertyValue {\n """\n Property id. This propert changes according to the content of the object.\n """\n propertyID: String!\n """\n Property value. May hold a string or the string representation of an object.\n """\n value: ObjectOrString!\n """\n Property name.\n """\n name: String!\n """\n Specifies the nature of the value\n """\n valueReference: String!\n}\n\ninput IStorePropertyValue {\n """\n Property id. This propert changes according to the content of the object.\n """\n propertyID: String\n """\n Property value. May hold a string or the string representation of an object.\n """\n value: ObjectOrString!\n """\n Property name.\n """\n name: String!\n """\n Specifies the nature of the value\n """\n valueReference: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ze={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Each product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination.",block:!0},name:{kind:"Name",value:"StoreProductEdge"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Each product node contains the information of a product returned by the query.",block:!0},name:{kind:"Name",value:"node"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product cursor. Used as pagination reference.",block:!0},name:{kind:"Name",value:"cursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product connections, including pagination information and products returned by the query.",block:!0},name:{kind:"Name",value:"StoreProductConnection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product pagination information.",block:!0},name:{kind:"Name",value:"pageInfo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePageInfo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with product connection edges, each containing a product and a corresponding cursor.",block:!0},name:{kind:"Name",value:"edges"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductEdge"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Each collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination.",block:!0},name:{kind:"Name",value:"StoreCollectionEdge"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Each collection node contains the information of a product collection returned by the query.",block:!0},name:{kind:"Name",value:"node"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollection"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection cursor. Used as pagination reference.",block:!0},name:{kind:"Name",value:"cursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Collection connections, including pagination information and collections returned by the query.",block:!0},name:{kind:"Name",value:"StoreCollectionConnection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection pagination information.",block:!0},name:{kind:"Name",value:"pageInfo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePageInfo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with collection connection page edges, each containing a collection and a corresponding cursor..",block:!0},name:{kind:"Name",value:"edges"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionEdge"}}}}},directives:[]}]},{kind:"EnumTypeDefinition",description:{kind:"StringValue",value:"Product search results sorting options.",block:!0},name:{kind:"Name",value:"StoreSort"},directives:[],values:[{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by price, from highest to lowest.",block:!0},name:{kind:"Name",value:"price_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by price, from lowest to highest.",block:!0},name:{kind:"Name",value:"price_asc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by orders, from highest to lowest.",block:!0},name:{kind:"Name",value:"orders_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by name, in reverse alphabetical order.",block:!0},name:{kind:"Name",value:"name_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by name, in alphabetical order.",block:!0},name:{kind:"Name",value:"name_asc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by release date, from highest to lowest.",block:!0},name:{kind:"Name",value:"release_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by discount value, from highest to lowest.",block:!0},name:{kind:"Name",value:"discount_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by product score, from highest to lowest.",block:!0},name:{kind:"Name",value:"score_desc"},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Selected search facet input.",block:!0},name:{kind:"Name",value:"IStoreSelectedFacet"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Selected search facet key.",block:!0},name:{kind:"Name",value:"key"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Selected search facet value.",block:!0},name:{kind:"Name",value:"value"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"EnumTypeDefinition",description:{kind:"StringValue",value:"Search facet type.",block:!0},name:{kind:"Name",value:"StoreFacetType"},directives:[],values:[{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Indicates boolean search facet.",block:!0},name:{kind:"Name",value:"BOOLEAN"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Indicates range type search facet.",block:!0},name:{kind:"Name",value:"RANGE"},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Suggestion term.",block:!0},name:{kind:"Name",value:"StoreSuggestionTerm"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"The term.",block:!0},name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Its occurrences count.",block:!0},name:{kind:"Name",value:"count"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Suggestions information.",block:!0},name:{kind:"Name",value:"StoreSuggestions"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with suggestion terms.",block:!0},name:{kind:"Name",value:"terms"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSuggestionTerm"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with suggestion products' information.",block:!0},name:{kind:"Name",value:"products"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search result.",block:!0},name:{kind:"Name",value:"SearchMetadata"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates if the search term was misspelled.",block:!0},name:{kind:"Name",value:"isTermMisspelled"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Logical operator used to run the search.",block:!0},name:{kind:"Name",value:"logicalOperator"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search result.",block:!0},name:{kind:"Name",value:"StoreSearchResult"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search result products.",block:!0},name:{kind:"Name",value:"products"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductConnection"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of search result facets.",block:!0},name:{kind:"Name",value:"facets"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacet"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search result suggestions.",block:!0},name:{kind:"Name",value:"suggestions"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSuggestions"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search result metadata. Additional data can be used to send analytics events.",block:!0},name:{kind:"Name",value:"metadata"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"SearchMetadata"}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IGeoCoordinates"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The latitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"latitude"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The longitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"longitude"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"Query"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns the details of a product based on the specified locator.",block:!0},name:{kind:"Name",value:"product"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"An array of selected search facets.",block:!0},name:{kind:"Name",value:"locator"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns the details of a collection based on the collection slug.",block:!0},name:{kind:"Name",value:"collection"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Collection slug.",block:!0},name:{kind:"Name",value:"slug"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollection"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns the result of a product, facet, or suggestion search.",block:!0},name:{kind:"Name",value:"search"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search pagination argument, indicating how many results should be returned from the complete result list.",block:!0},name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search pagination argument, indicating the cursor corresponding with the item after which the results should be fetched.",block:!0},name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search results sorting mode.",block:!0},name:{kind:"Name",value:"sort"},type:{kind:"NamedType",name:{kind:"Name",value:"StoreSort"}},defaultValue:{kind:"EnumValue",value:"score_desc"},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search term.",block:!0},name:{kind:"Name",value:"term"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"StringValue",value:"",block:!1},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Array of selected search facets.",block:!0},name:{kind:"Name",value:"selectedFacets"},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSearchResult"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns information about all products.",block:!0},name:{kind:"Name",value:"allProducts"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Product pagination argument, indicating how many items should be returned from the complete result list.",block:!0},name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Product pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.",block:!0},name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductConnection"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns information about all collections.",block:!0},name:{kind:"Name",value:"allCollections"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Collection pagination argument, indicating how many items should be returned from the complete result list.",block:!0},name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Collection pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.",block:!0},name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionConnection"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns information about shipping simulation.",block:!0},name:{kind:"Name",value:"shipping"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"List of SKU products",block:!0},name:{kind:"Name",value:"items"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IShippingItem"}}}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Postal code to freight calculator",block:!0},name:{kind:"Name",value:"postalCode"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Country of postal code",block:!0},name:{kind:"Name",value:"country"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"ShippingData"}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns if there's a redirect for a search.",block:!0},name:{kind:"Name",value:"redirect"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search term.",block:!0},name:{kind:"Name",value:"term"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Array of selected search facets.",block:!0},name:{kind:"Name",value:"selectedFacets"},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"StoreRedirect"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns a list of sellers available for a specific localization.",block:!0},name:{kind:"Name",value:"sellers"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Postal code input to calculate sellers",block:!0},name:{kind:"Name",value:"postalCode"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Geocoordinates input to calculate sellers",block:!0},name:{kind:"Name",value:"geoCoordinates"},type:{kind:"NamedType",name:{kind:"Name",value:"IGeoCoordinates"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Country of localization",block:!0},name:{kind:"Name",value:"country"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Sales channel of the navigation",block:!0},name:{kind:"Name",value:"salesChannel"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"SellersData"}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Redirect informations, including url returned by the query.\nhttps://schema.org/Thing",block:!0},name:{kind:"Name",value:"StoreRedirect"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"URL to redirect",block:!0},name:{kind:"Name",value:"url"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Regionalization with sellers information.",block:!0},name:{kind:"Name",value:"SellersData"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Identification of region.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of sellers.",block:!0},name:{kind:"Name",value:"sellers"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"SellerInfo"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of sellers.",block:!0},name:{kind:"Name",value:"SellerInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Identification of the seller",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Name of the seller",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Logo of the seller",block:!0},name:{kind:"Name",value:"logo"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}]}],loc:{start:0,end:7490}};Ze.loc.source={body:'"""\nEach product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination.\n"""\ntype StoreProductEdge {\n """\n Each product node contains the information of a product returned by the query.\n """\n node: StoreProduct!\n """\n Product cursor. Used as pagination reference.\n """\n cursor: String!\n}\n\n"""\nProduct connections, including pagination information and products returned by the query.\n"""\ntype StoreProductConnection {\n """\n Product pagination information.\n """\n pageInfo: StorePageInfo!\n """\n Array with product connection edges, each containing a product and a corresponding cursor.\n """\n edges: [StoreProductEdge!]!\n}\n\n"""\nEach collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination.\n"""\ntype StoreCollectionEdge {\n """\n Each collection node contains the information of a product collection returned by the query.\n """\n node: StoreCollection!\n """\n Collection cursor. Used as pagination reference.\n """\n cursor: String!\n}\n\n"""\nCollection connections, including pagination information and collections returned by the query.\n"""\ntype StoreCollectionConnection {\n """\n Collection pagination information.\n """\n pageInfo: StorePageInfo!\n """\n Array with collection connection page edges, each containing a collection and a corresponding cursor..\n """\n edges: [StoreCollectionEdge!]!\n}\n\n"""\nProduct search results sorting options.\n"""\nenum StoreSort {\n """\n Sort by price, from highest to lowest.\n """\n price_desc\n """\n Sort by price, from lowest to highest.\n """\n price_asc\n """\n Sort by orders, from highest to lowest.\n """\n orders_desc\n """\n Sort by name, in reverse alphabetical order.\n """\n name_desc\n """\n Sort by name, in alphabetical order.\n """\n name_asc\n """\n Sort by release date, from highest to lowest.\n """\n release_desc\n """\n Sort by discount value, from highest to lowest.\n """\n discount_desc\n """\n Sort by product score, from highest to lowest.\n """\n score_desc\n}\n\n"""\nSelected search facet input.\n"""\ninput IStoreSelectedFacet {\n """\n Selected search facet key.\n """\n key: String!\n """\n Selected search facet value.\n """\n value: String!\n}\n\n"""\nSearch facet type.\n"""\nenum StoreFacetType {\n """\n Indicates boolean search facet.\n """\n BOOLEAN\n """\n Indicates range type search facet.\n """\n RANGE\n}\n\n"""\nSuggestion term.\n"""\ntype StoreSuggestionTerm {\n """\n The term.\n """\n value: String!\n """\n Its occurrences count.\n """\n count: Int!\n}\n\n"""\nSuggestions information.\n"""\ntype StoreSuggestions {\n """\n Array with suggestion terms.\n """\n terms: [StoreSuggestionTerm!]!\n """\n Array with suggestion products\' information.\n """\n products: [StoreProduct!]!\n}\n\n"""\nSearch result.\n"""\ntype SearchMetadata {\n """\n Indicates if the search term was misspelled.\n """\n isTermMisspelled: Boolean!\n """\n Logical operator used to run the search.\n """\n logicalOperator: String!\n}\n\n"""\nSearch result.\n"""\ntype StoreSearchResult {\n """\n Search result products.\n """\n products: StoreProductConnection!\n """\n Array of search result facets.\n """\n facets: [StoreFacet!]!\n """\n Search result suggestions.\n """\n suggestions: StoreSuggestions!\n """\n Search result metadata. Additional data can be used to send analytics events.\n """\n metadata: SearchMetadata\n}\n\ninput IGeoCoordinates {\n """\n The latitude of the geographic coordinates.\n """\n latitude: Float!\n """\n The longitude of the geographic coordinates.\n """\n longitude: Float!\n}\n\ntype Query {\n """\n Returns the details of a product based on the specified locator.\n """\n product(\n """\n An array of selected search facets.\n """\n locator: [IStoreSelectedFacet!]!\n ): StoreProduct!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns the details of a collection based on the collection slug.\n """\n collection(\n """\n Collection slug.\n """\n slug: String!\n ): StoreCollection!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns the result of a product, facet, or suggestion search.\n """\n search(\n """\n Search pagination argument, indicating how many results should be returned from the complete result list.\n """\n first: Int!\n """\n Search pagination argument, indicating the cursor corresponding with the item after which the results should be fetched.\n """\n after: String\n """\n Search results sorting mode.\n """\n sort: StoreSort = score_desc\n """\n Search term.\n """\n term: String = ""\n """\n Array of selected search facets.\n """\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreSearchResult!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns information about all products.\n """\n allProducts(\n """\n Product pagination argument, indicating how many items should be returned from the complete result list.\n """\n first: Int!\n """\n Product pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.\n """\n after: String\n ): StoreProductConnection!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns information about all collections.\n """\n allCollections(\n """\n Collection pagination argument, indicating how many items should be returned from the complete result list.\n """\n first: Int!\n """\n Collection pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.\n """\n after: String\n ): StoreCollectionConnection!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns information about shipping simulation.\n """\n shipping(\n """\n List of SKU products\n """\n items: [IShippingItem!]!\n """\n Postal code to freight calculator\n """\n postalCode: String!\n """\n Country of postal code\n """\n country: String!\n ): ShippingData\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns if there\'s a redirect for a search.\n """\n redirect(\n """\n Search term.\n """\n term: String\n """\n Array of selected search facets.\n """\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreRedirect\n\n\n """\n Returns a list of sellers available for a specific localization.\n """\n sellers(\n """\n Postal code input to calculate sellers\n """\n postalCode: String\n """\n Geocoordinates input to calculate sellers\n """\n geoCoordinates: IGeoCoordinates\n """\n Country of localization\n """\n country: String!\n """\n Sales channel of the navigation\n """\n salesChannel: String\n ): SellersData\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n}\n\n"""\nRedirect informations, including url returned by the query.\nhttps://schema.org/Thing\n"""\ntype StoreRedirect {\n """\n URL to redirect\n """\n url: String\n}\n\n"""\nRegionalization with sellers information.\n"""\ntype SellersData {\n """\n Identification of region.\n """\n id: String\n """\n List of sellers.\n """\n sellers: [SellerInfo]\n}\n\n"""\nInformation of sellers.\n"""\ntype SellerInfo {\n """\n Identification of the seller\n """\n id: String\n """\n Name of the seller\n """\n name: String\n """\n Logo of the seller\n """\n logo: String\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var en={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of a given review rating.",block:!0},name:{kind:"Name",value:"StoreReviewRating"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Rating value.",block:!0},name:{kind:"Name",value:"ratingValue"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Best rating value.",block:!0},name:{kind:"Name",value:"bestRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of a given review.",block:!0},name:{kind:"Name",value:"StoreReview"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Review rating information.",block:!0},name:{kind:"Name",value:"reviewRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreReviewRating"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Review author.",block:!0},name:{kind:"Name",value:"author"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAuthor"}}},directives:[]}]}],loc:{start:0,end:366}};en.loc.source={body:'"""\nInformation of a given review rating.\n"""\ntype StoreReviewRating {\n """\n Rating value.\n """\n ratingValue: Float!\n """\n Best rating value.\n """\n bestRating: Float!\n}\n\n"""\nInformation of a given review.\n"""\ntype StoreReview {\n """\n Review rating information.\n """\n reviewRating: StoreReviewRating!\n """\n Review author.\n """\n author: StoreAuthor!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var nn={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search Engine Optimization (SEO) tags data.",block:!0},name:{kind:"Name",value:"StoreSeo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Title tag.",block:!0},name:{kind:"Name",value:"title"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Title template tag.",block:!0},name:{kind:"Name",value:"titleTemplate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Description tag.",block:!0},name:{kind:"Name",value:"description"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Canonical tag.",block:!0},name:{kind:"Name",value:"canonical"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:275}};nn.loc.source={body:'"""\nSearch Engine Optimization (SEO) tags data.\n"""\ntype StoreSeo {\n """\n Title tag.\n """\n title: String!\n """\n Title template tag.\n """\n titleTemplate: String!\n """\n Description tag.\n """\n description: String!\n """\n Canonical tag.\n """\n canonical: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var tn={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Currency information.",block:!0},name:{kind:"Name",value:"StoreCurrency"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Currency code (e.g: USD).",block:!0},name:{kind:"Name",value:"code"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Currency symbol (e.g: $).",block:!0},name:{kind:"Name",value:"symbol"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreCurrency"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Currency code (e.g: USD).",block:!0},name:{kind:"Name",value:"code"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Currency symbol (e.g: $).",block:!0},name:{kind:"Name",value:"symbol"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Geographic coordinates information.",block:!0},name:{kind:"Name",value:"StoreGeoCoordinates"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"The latitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"latitude"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The longitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"longitude"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreGeoCoordinates"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The latitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"latitude"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The longitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"longitude"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Delivery window information.",block:!0},name:{kind:"Name",value:"StoreDeliveryWindow"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery window start date information.",block:!0},name:{kind:"Name",value:"startDate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery window end date information.",block:!0},name:{kind:"Name",value:"endDate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Delivery window information.",block:!0},name:{kind:"Name",value:"IStoreDeliveryWindow"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery window start date information.",block:!0},name:{kind:"Name",value:"startDate"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery window end date information.",block:!0},name:{kind:"Name",value:"endDate"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Delivery mode information.",block:!0},name:{kind:"Name",value:"StoreDeliveryMode"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery channel information of the session.",block:!0},name:{kind:"Name",value:"deliveryChannel"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery method information of the session.",block:!0},name:{kind:"Name",value:"deliveryMethod"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery window information of the session.",block:!0},name:{kind:"Name",value:"deliveryWindow"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"StoreDeliveryWindow"}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreDeliveryMode"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery channel information of the session.",block:!0},name:{kind:"Name",value:"deliveryChannel"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery method information of the session.",block:!0},name:{kind:"Name",value:"deliveryMethod"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery window information of the session.",block:!0},name:{kind:"Name",value:"deliveryWindow"},type:{kind:"NamedType",name:{kind:"Name",value:"IStoreDeliveryWindow"}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Session information.",block:!0},name:{kind:"Name",value:"StoreSession"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session locale.",block:!0},name:{kind:"Name",value:"locale"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session currency.",block:!0},name:{kind:"Name",value:"currency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCurrency"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session country.",block:!0},name:{kind:"Name",value:"country"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session channel.",block:!0},name:{kind:"Name",value:"channel"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session delivery mode.",block:!0},name:{kind:"Name",value:"deliveryMode"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"StoreDeliveryMode"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session address type.",block:!0},name:{kind:"Name",value:"addressType"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session postal code.",block:!0},name:{kind:"Name",value:"postalCode"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session input geoCoordinates.",block:!0},name:{kind:"Name",value:"geoCoordinates"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"StoreGeoCoordinates"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session input person.",block:!0},name:{kind:"Name",value:"person"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"StorePerson"}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Session input.",block:!0},name:{kind:"Name",value:"IStoreSession"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input locale.",block:!0},name:{kind:"Name",value:"locale"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input currency.",block:!0},name:{kind:"Name",value:"currency"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreCurrency"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input country.",block:!0},name:{kind:"Name",value:"country"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input channel.",block:!0},name:{kind:"Name",value:"channel"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input delivery mode.",block:!0},name:{kind:"Name",value:"deliveryMode"},type:{kind:"NamedType",name:{kind:"Name",value:"IStoreDeliveryMode"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input address type.",block:!0},name:{kind:"Name",value:"addressType"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input postal code.",block:!0},name:{kind:"Name",value:"postalCode"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input geoCoordinates.",block:!0},name:{kind:"Name",value:"geoCoordinates"},type:{kind:"NamedType",name:{kind:"Name",value:"IStoreGeoCoordinates"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input person.",block:!0},name:{kind:"Name",value:"person"},type:{kind:"NamedType",name:{kind:"Name",value:"IStorePerson"}},directives:[]}]}],loc:{start:0,end:3027}};tn.loc.source={body:'"""\nCurrency information.\n"""\ntype StoreCurrency {\n """\n Currency code (e.g: USD).\n """\n code: String!\n """\n Currency symbol (e.g: $).\n """\n symbol: String!\n}\n\ninput IStoreCurrency {\n """\n Currency code (e.g: USD).\n """\n code: String!\n """\n Currency symbol (e.g: $).\n """\n symbol: String!\n}\n\n"""\nGeographic coordinates information.\n"""\ntype StoreGeoCoordinates {\n """\n The latitude of the geographic coordinates.\n """\n latitude: Float!\n """\n The longitude of the geographic coordinates.\n """\n longitude: Float!\n}\n\ninput IStoreGeoCoordinates {\n """\n The latitude of the geographic coordinates.\n """\n latitude: Float!\n """\n The longitude of the geographic coordinates.\n """\n longitude: Float!\n}\n\n"""\nDelivery window information.\n"""\ntype StoreDeliveryWindow {\n """\n The delivery window start date information.\n """\n startDate: String!\n """\n The delivery window end date information.\n """\n endDate: String!\n}\n\n"""\nDelivery window information.\n"""\ninput IStoreDeliveryWindow {\n """\n The delivery window start date information.\n """\n startDate: String!\n """\n The delivery window end date information.\n """\n endDate: String!\n}\n\n"""\nDelivery mode information.\n"""\ntype StoreDeliveryMode {\n """\n The delivery channel information of the session.\n """\n deliveryChannel: String!\n """\n The delivery method information of the session.\n """\n deliveryMethod: String!\n """\n The delivery window information of the session.\n """\n deliveryWindow: StoreDeliveryWindow\n}\n\ninput IStoreDeliveryMode {\n """\n The delivery channel information of the session.\n """\n deliveryChannel: String!\n """\n The delivery method information of the session.\n """\n deliveryMethod: String!\n """\n The delivery window information of the session.\n """\n deliveryWindow: IStoreDeliveryWindow\n}\n\n"""\nSession information.\n"""\ntype StoreSession {\n """\n Session locale.\n """\n locale: String!\n """\n Session currency.\n """\n currency: StoreCurrency!\n """\n Session country.\n """\n country: String!\n """\n Session channel.\n """\n channel: String\n """\n Session delivery mode.\n """\n deliveryMode: StoreDeliveryMode\n """\n Session address type.\n """\n addressType: String\n """\n Session postal code.\n """\n postalCode: String\n """\n Session input geoCoordinates.\n """\n geoCoordinates: StoreGeoCoordinates\n """\n Session input person.\n """\n person: StorePerson\n}\n\n"""\nSession input.\n"""\ninput IStoreSession {\n """\n Session input locale.\n """\n locale: String!\n """\n Session input currency.\n """\n currency: IStoreCurrency!\n """\n Session input country.\n """\n country: String!\n """\n Session input channel.\n """\n channel: String\n """\n Session input delivery mode.\n """\n deliveryMode: IStoreDeliveryMode\n """\n Session input address type.\n """\n addressType: String\n """\n Session input postal code.\n """\n postalCode: String\n """\n Session input geoCoordinates.\n """\n geoCoordinates: IStoreGeoCoordinates\n """\n Session input person.\n """\n person: IStorePerson\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var an={kind:"Document",definitions:[{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Shipping Simulation item input.",block:!0},name:{kind:"Name",value:"IShippingItem"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"ShippingItem ID / Sku.",block:!0},name:{kind:"Name",value:"id"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Number of items.",block:!0},name:{kind:"Name",value:"quantity"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Seller responsible for the ShippingItem.",block:!0},name:{kind:"Name",value:"seller"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Shipping Simulation information.",block:!0},name:{kind:"Name",value:"ShippingData"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of LogisticsItem.",block:!0},name:{kind:"Name",value:"items"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"LogisticsItem"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of LogisticsInfo.",block:!0},name:{kind:"Name",value:"logisticsInfo"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"LogisticsInfo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of MessageInfo.",block:!0},name:{kind:"Name",value:"messages"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"MessageInfo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address information.",block:!0},name:{kind:"Name",value:"address"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Address"}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Shipping Simulation Logistic Item.",block:!0},name:{kind:"Name",value:"LogisticsItem"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem ID / Sku.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"requestIndex"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of items.",block:!0},name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Seller responsible for the ShippingItem.",block:!0},name:{kind:"Name",value:"seller"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of Sellers.",block:!0},name:{kind:"Name",value:"sellerChain"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem tax.",block:!0},name:{kind:"Name",value:"tax"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.",block:!0},name:{kind:"Name",value:"priceValidUntil"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem price.",block:!0},name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem listPrice.",block:!0},name:{kind:"Name",value:"listPrice"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem rewardValue.",block:!0},name:{kind:"Name",value:"rewardValue"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem sellingPrice.",block:!0},name:{kind:"Name",value:"sellingPrice"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem measurementUnit.",block:!0},name:{kind:"Name",value:"measurementUnit"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem unitMultiplier.",block:!0},name:{kind:"Name",value:"unitMultiplier"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem availability.",block:!0},name:{kind:"Name",value:"availability"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"LogisticsInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsInfo itemIndex.",block:!0},name:{kind:"Name",value:"itemIndex"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsInfo selectedSla.",block:!0},name:{kind:"Name",value:"selectedSla"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of LogisticsInfo ShippingSLA.",block:!0},name:{kind:"Name",value:"slas"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"ShippingSLA"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"ShippingSLA"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA id.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA price.",block:!0},name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Float"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA shipping estimate.",block:!0},name:{kind:"Name",value:"shippingEstimate"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA localized shipping estimate.\nNote: this will always return a localized string for locale `en-US`.",block:!0},name:{kind:"Name",value:"localizedEstimates"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA available delivery windows.",block:!0},name:{kind:"Name",value:"availableDeliveryWindows"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"AvailableDeliveryWindows"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA shipping estimate date.",block:!0},name:{kind:"Name",value:"shippingEstimateDate"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of ShippingSLA delivery ids.",block:!0},name:{kind:"Name",value:"deliveryIds"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"DeliveryIds"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA delivery channel.",block:!0},name:{kind:"Name",value:"deliveryChannel"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA friendly name.",block:!0},name:{kind:"Name",value:"friendlyName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA carrier.",block:!0},name:{kind:"Name",value:"carrier"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA pickup point id.",block:!0},name:{kind:"Name",value:"pickupPointId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA pickup store info.",block:!0},name:{kind:"Name",value:"pickupStoreInfo"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"PickupStoreInfo"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA pickup distance.",block:!0},name:{kind:"Name",value:"pickupDistance"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Float"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"AvailableDeliveryWindows"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window start date in UTC",block:!0},name:{kind:"Name",value:"startDateUtc"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window end date in UTC",block:!0},name:{kind:"Name",value:"endDateUtc"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window price",block:!0},name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window list price",block:!0},name:{kind:"Name",value:"listPrice"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window tax",block:!0},name:{kind:"Name",value:"tax"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"DeliveryIds"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds courier id",block:!0},name:{kind:"Name",value:"courierId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds warehouse id",block:!0},name:{kind:"Name",value:"warehouseId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds dock id",block:!0},name:{kind:"Name",value:"dockId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds courier name",block:!0},name:{kind:"Name",value:"courierName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds quantity",block:!0},name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"PickupStoreInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupStoreInfo friendly name.",block:!0},name:{kind:"Name",value:"friendlyName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupStoreInfo address.",block:!0},name:{kind:"Name",value:"address"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"PickupAddress"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupStoreInfo additional information.",block:!0},name:{kind:"Name",value:"additionalInfo"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupStoreInfo dock id.",block:!0},name:{kind:"Name",value:"dockId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Information if the store has pickup enable.",block:!0},name:{kind:"Name",value:"isPickupStore"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"PickupAddress"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress address type.",block:!0},name:{kind:"Name",value:"addressType"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress receiver name.",block:!0},name:{kind:"Name",value:"receiverName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress address id.",block:!0},name:{kind:"Name",value:"addressId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress postal code.",block:!0},name:{kind:"Name",value:"postalCode"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress city.",block:!0},name:{kind:"Name",value:"city"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress state.",block:!0},name:{kind:"Name",value:"state"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress country.",block:!0},name:{kind:"Name",value:"country"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress street.",block:!0},name:{kind:"Name",value:"street"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress number.",block:!0},name:{kind:"Name",value:"number"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress neighborhood.",block:!0},name:{kind:"Name",value:"neighborhood"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress complement.",block:!0},name:{kind:"Name",value:"complement"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress reference.",block:!0},name:{kind:"Name",value:"reference"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress geo coordinates.",block:!0},name:{kind:"Name",value:"geoCoordinates"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"MessageInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageInfo code.",block:!0},name:{kind:"Name",value:"code"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageInfo text.",block:!0},name:{kind:"Name",value:"text"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageInfo status.",block:!0},name:{kind:"Name",value:"status"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageInfo fields.",block:!0},name:{kind:"Name",value:"fields"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"MessageFields"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"MessageFields"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageFields item index.",block:!0},name:{kind:"Name",value:"itemIndex"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageFields ean.",block:!0},name:{kind:"Name",value:"ean"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageFields sku name.",block:!0},name:{kind:"Name",value:"skuName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}]}],loc:{start:0,end:5041}};an.loc.source={body:'"""\nShipping Simulation item input.\n"""\ninput IShippingItem {\n """\n ShippingItem ID / Sku.\n """\n id: String!\n """\n Number of items.\n """\n quantity: Int!\n """\n Seller responsible for the ShippingItem.\n """\n seller: String!\n}\n\n"""\nShipping Simulation information.\n"""\ntype ShippingData {\n """\n List of LogisticsItem.\n """\n items: [LogisticsItem]\n """\n List of LogisticsInfo.\n """\n logisticsInfo: [LogisticsInfo]\n """\n List of MessageInfo.\n """\n messages: [MessageInfo]\n """\n Address information.\n """\n address: Address\n}\n\n"""\nShipping Simulation Logistic Item.\n"""\ntype LogisticsItem {\n """\n LogisticsItem ID / Sku.\n """\n id: String\n requestIndex: Int\n """\n Number of items.\n """\n quantity: Int\n """\n Seller responsible for the ShippingItem.\n """\n seller: String\n """\n List of Sellers.\n """\n sellerChain: [String]\n """\n LogisticsItem tax.\n """\n tax: Int\n """\n Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.\n """\n priceValidUntil: String\n """\n LogisticsItem price.\n """\n price: Int\n """\n LogisticsItem listPrice.\n """\n listPrice: Int\n """\n LogisticsItem rewardValue.\n """\n rewardValue: Int\n """\n LogisticsItem sellingPrice.\n """\n sellingPrice: Int\n """\n LogisticsItem measurementUnit.\n """\n measurementUnit: String\n """\n LogisticsItem unitMultiplier.\n """\n unitMultiplier: Int\n """\n LogisticsItem availability.\n """\n availability: String\n}\n\ntype LogisticsInfo {\n """\n LogisticsInfo itemIndex.\n """\n itemIndex: String\n """\n LogisticsInfo selectedSla.\n """\n selectedSla: String\n """\n List of LogisticsInfo ShippingSLA.\n """\n slas: [ShippingSLA]\n}\n\ntype ShippingSLA {\n """\n ShippingSLA id.\n """\n id: String\n """\n ShippingSLA name.\n """\n name: String\n """\n ShippingSLA price.\n """\n price: Float\n """\n ShippingSLA shipping estimate.\n """\n shippingEstimate: String\n """\n ShippingSLA localized shipping estimate.\n Note: this will always return a localized string for locale `en-US`.\n """\n localizedEstimates: String\n """\n ShippingSLA available delivery windows.\n """\n availableDeliveryWindows: [AvailableDeliveryWindows]\n """\n ShippingSLA shipping estimate date.\n """\n shippingEstimateDate: String\n """\n List of ShippingSLA delivery ids.\n """\n deliveryIds: [DeliveryIds]\n """\n ShippingSLA delivery channel.\n """\n deliveryChannel: String\n """\n ShippingSLA friendly name.\n """\n friendlyName: String\n """\n ShippingSLA carrier.\n """\n carrier: String\n """\n ShippingSLA pickup point id.\n """\n pickupPointId: String\n """\n ShippingSLA pickup store info.\n """\n pickupStoreInfo: PickupStoreInfo\n """\n ShippingSLA pickup distance.\n """\n pickupDistance: Float\n}\n\ntype AvailableDeliveryWindows {\n """\n Available delivery window start date in UTC\n """\n startDateUtc: String\n """\n Available delivery window end date in UTC\n """\n endDateUtc: String\n """\n Available delivery window price\n """\n price: Int\n """\n Available delivery window list price\n """\n listPrice: Int\n """\n Available delivery window tax\n """\n tax: Int\n}\n\ntype DeliveryIds {\n """\n DeliveryIds courier id\n """\n courierId: String\n """\n DeliveryIds warehouse id\n """\n warehouseId: String\n """\n DeliveryIds dock id\n """\n dockId: String\n """\n DeliveryIds courier name\n """\n courierName: String\n """\n DeliveryIds quantity\n """\n quantity: Int\n}\n\ntype PickupStoreInfo {\n """\n PickupStoreInfo friendly name.\n """\n friendlyName: String\n """\n PickupStoreInfo address.\n """\n address: PickupAddress\n """\n PickupStoreInfo additional information.\n """\n additionalInfo: String\n """\n PickupStoreInfo dock id.\n """\n dockId: String\n """\n Information if the store has pickup enable.\n """\n isPickupStore: Boolean\n}\n\ntype PickupAddress {\n """\n PickupAddress address type.\n """\n addressType: String\n """\n PickupAddress receiver name.\n """\n receiverName: String\n """\n PickupAddress address id.\n """\n addressId: String\n """\n PickupAddress postal code.\n """\n postalCode: String\n """\n PickupAddress city.\n """\n city: String\n """\n PickupAddress state.\n """\n state: String\n """\n PickupAddress country.\n """\n country: String\n """\n PickupAddress street.\n """\n street: String\n """\n PickupAddress number.\n """\n number: String\n """\n PickupAddress neighborhood.\n """\n neighborhood: String\n """\n PickupAddress complement.\n """\n complement: String\n """\n PickupAddress reference.\n """\n reference: String\n """\n PickupAddress geo coordinates.\n """\n geoCoordinates: [Float]\n}\n\ntype MessageInfo {\n """\n MessageInfo code.\n """\n code: String\n """\n MessageInfo text.\n """\n text: String\n """\n MessageInfo status.\n """\n status: String\n """\n MessageInfo fields.\n """\n fields: MessageFields\n}\n\ntype MessageFields {\n """\n MessageFields item index.\n """\n itemIndex: String\n """\n MessageFields ean.\n """\n ean: String\n """\n MessageFields sku name.\n """\n skuName: String\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var rn={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"SkuVariants"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"SKU property values for the current SKU.",block:!0},name:{kind:"Name",value:"activeVariations"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"ActiveVariations"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"All available options for each SKU variant property, indexed by their name.",block:!0},name:{kind:"Name",value:"allVariantsByName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"VariantsByName"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Maps property value combinations to their respective SKU's slug. Enables\nus to retrieve the slug for the SKU that matches the currently selected\nvariations in O(1) time.\nIf `dominantVariantName` is not present, the first variant will be \nconsidered the dominant one.",block:!0},name:{kind:"Name",value:"slugsMap"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"dominantVariantName"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"SlugsMap"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available options for each varying SKU property, taking into account the\n`dominantVariantName` property. Returns all available options for the\ndominant property, and only options that can be combined with its current\nvalue for other properties.\nIf `dominantVariantName` is not present, the first variant will be \nconsidered the dominant one.",block:!0},name:{kind:"Name",value:"availableVariations"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"dominantVariantName"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"FormattedVariants"}},directives:[]}]},{kind:"ScalarTypeDefinition",description:{kind:"StringValue",value:"Example:\n\n```json\n{\n 'Color-Red-Size-40': 'classic-shoes-37'\n}\n```",block:!0},name:{kind:"Name",value:"SlugsMap"},directives:[]},{kind:"ScalarTypeDefinition",description:{kind:"StringValue",value:"Example:\n\n```json\n{\n Color: 'Red', Size: '42'\n}\n```",block:!0},name:{kind:"Name",value:"ActiveVariations"},directives:[]},{kind:"ScalarTypeDefinition",description:{kind:"StringValue",value:'Example:\n\n```json\n{\n Color: [ "Red", "Blue", "Green" ],\n Size: [ "40", "41" ]\n}\n```',block:!0},name:{kind:"Name",value:"VariantsByName"},directives:[]},{kind:"ScalarTypeDefinition",description:{kind:"StringValue",value:'Example:\n\n```json\n{\n Color: [\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n },\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n }\n ],\n Size: [\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n }\n ]\n}\n```',block:!0},name:{kind:"Name",value:"FormattedVariants"},directives:[]}],loc:{start:0,end:1776}};rn.loc.source={body:'type SkuVariants {\n """\n SKU property values for the current SKU.\n """\n activeVariations: ActiveVariations\n """\n All available options for each SKU variant property, indexed by their name.\n """\n allVariantsByName: VariantsByName\n """\n Maps property value combinations to their respective SKU\'s slug. Enables\n us to retrieve the slug for the SKU that matches the currently selected\n variations in O(1) time.\n If `dominantVariantName` is not present, the first variant will be \n considered the dominant one.\n """\n slugsMap(dominantVariantName: String): SlugsMap\n """\n Available options for each varying SKU property, taking into account the\n `dominantVariantName` property. Returns all available options for the\n dominant property, and only options that can be combined with its current\n value for other properties.\n If `dominantVariantName` is not present, the first variant will be \n considered the dominant one.\n """\n availableVariations(dominantVariantName: String): FormattedVariants\n}\n\n"""\nExample:\n\n```json\n{\n \'Color-Red-Size-40\': \'classic-shoes-37\'\n}\n```\n"""\nscalar SlugsMap\n"""\nExample:\n\n```json\n{\n Color: \'Red\', Size: \'42\'\n}\n```\n"""\nscalar ActiveVariations\n"""\nExample:\n\n```json\n{\n Color: [ "Red", "Blue", "Green" ],\n Size: [ "40", "41" ]\n}\n```\n"""\nscalar VariantsByName\n"""\nExample:\n\n```json\n{\n Color: [\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n },\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n }\n ],\n Size: [\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n }\n ]\n}\n```\n"""\nscalar FormattedVariants\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var on={kind:"Document",definitions:[{kind:"EnumTypeDefinition",description:{kind:"StringValue",value:"Status used to indicate a message type. For instance, a shopping cart informative or error message.",block:!0},name:{kind:"Name",value:"StoreStatus"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"INFO"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"WARNING"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"ERROR"},directives:[]}]}],loc:{start:0,end:154}};on.loc.source={body:'"""\nStatus used to indicate a message type. For instance, a shopping cart informative or error message.\n"""\nenum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};const ln=[Ze,Be,Ae,xe,Me,qe,je,_e,Qe,Ye,nn,ze,Ee,en,Re,Je,We,Le,Ke,Ue,on,He,Xe,Ge,tn,$e,rn,an].map(d.print).join("\n"),dn=(e,n)=>"number"==typeof e&&"number"==typeof n?e>n?n:e:"number"==typeof e?e:n,sn={typeDefs:"directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION",transformer:e=>u.mapSchema(e,{[u.MapperKind.OBJECT_FIELD]:n=>{var i;const t=null==(i=u.getDirective(e,n,"cacheControl"))?void 0:i[0];if(t){const{sMaxAge:e,staleWhileRevalidate:i,scope:a}=t,r=n.resolve;n.resolve=(n,t,o,l)=>{var d,s,u,c,m;return o.cacheControl={sMaxAge:dn(null==(d=o.cacheControl)?void 0:d.sMaxAge,e),staleWhileRevalidate:dn(null==(s=o.cacheControl)?void 0:s.staleWhileRevalidate,i),scope:(c=null==(u=o.cacheControl)?void 0:u.scope,m=a,"string"==typeof c&&"string"==typeof m?"public"===c&&"public"===m?"public":"private":c||m)},null==r?void 0:r(n,t,o,l)}}return n}})};var un;!function(e){e.EXECUTION_ERROR="graphql.error",e.EXECUTION_RESULT="graphql.result",e.RESOLVER_EXECUTION_ERROR="graphql.resolver.error",e.RESOLVER_EXCEPTION="graphql.resolver.exception",e.RESOLVER_FIELD_NAME="graphql.resolver.fieldName",e.RESOLVER_TYPE_NAME="graphql.resolver.typeName",e.RESOLVER_RESULT_TYPE="graphql.resolver.resultType",e.RESOLVER_ARGS="graphql.resolver.args",e.EXECUTION_OPERATION_NAME="graphql.operation.name",e.EXECUTION_OPERATION_TYPE="graphql.operation.type",e.EXECUTION_OPERATION_DOCUMENT="graphql.document",e.EXECUTION_VARIABLES="graphql.variables"}(un||(un={}));const cn=Symbol("OPEN_TELEMETRY_GRAPHQL");function mn(e){const n=[];let i=0===n.length&&Number.isInteger(e.key)?e.prev:e;for(;i;)n.push(i.key),i=i.prev;return[...n].reverse().join(".")}const pn={vtex:{getResolvers:e=>Pe,getContextFactory:e=>n=>{var i;return n.storage={channel:H.parse(e.channel),flags:null!=(i=e.flags)?i:{},locale:e.locale},n.clients=((e,n)=>({search:T(e,n),commerce:(({account:e,environment:n,incrementAddress:i},t)=>{const a=`https://${e}.${n}.com.br`;return{catalog:{salesChannel:e=>S(`${a}/api/catalog_system/pub/saleschannel/${e}`),brand:{list:()=>S(a+"/api/catalog_system/pub/brand/list")},category:{tree:(e=3)=>S(`${a}/api/catalog_system/pub/category/tree/${e}`)},portal:{pagetype:e=>S(`${a}/api/catalog_system/pub/portal/pagetype/${e}`)},products:{crossselling:({type:e,productId:n,groupByProduct:i=!0})=>{const r=new URLSearchParams({sc:t.storage.channel.salesChannel,groupByProduct:i.toString()});return S(`${a}/api/catalog_system/pub/products/crossselling/${e}/${n}?${r}`)}}},checkout:{simulation:(e,{salesChannel:n}=t.storage.channel)=>{const i=new URLSearchParams({sc:n});return S(`${a}/api/checkout/pub/orderForms/simulation?${i.toString()}`,{...h,body:JSON.stringify(e)})},shippingData:({id:e,index:n,deliveryMode:r,selectedAddresses:o},l)=>{var d,s;const u=l?{startDateUtc:null==r||null==(d=r.deliveryWindow)?void 0:d.startDate,endDateUtc:null==r||null==(s=r.deliveryWindow)?void 0:s.endDate}:null,c={logisticsInfo:Array.from({length:n},(e,n)=>({itemIndex:n,selectedDeliveryChannel:(null==r?void 0:r.deliveryChannel)||null,selectedSla:(null==r?void 0:r.deliveryMethod)||null,deliveryWindow:u})),selectedAddresses:o,clearAddressIfPostalCodeNotFound:i};return S(`${a}/api/checkout/pub/orderForm/${e}/attachments/shippingData`,{...h,body:JSON.stringify(c),headers:{"content-type":"application/json",cookie:t.headers.cookie}})},orderForm:({id:e,refreshOutdatedData:n=!0,channel:i=t.storage.channel})=>{const{salesChannel:r}=i,o=new URLSearchParams({refreshOutdatedData:n.toString(),sc:r}),l=t.headers?{...h,headers:{"content-type":"application/json",cookie:t.headers.cookie}}:h;return S(`${a}/api/checkout/pub/orderForm/${e}?${o.toString()}`,l)},clearOrderFormMessages:({id:e})=>S(`${a}/api/checkout/pub/orderForm/${e}/messages/clear`,{...h,body:"{}"}),updateOrderFormItems:({id:e,orderItems:n,allowOutdatedData:i="paymentData",salesChannel:r=t.storage.channel.salesChannel,shouldSplitItem:o=!0})=>{const l=new URLSearchParams({allowOutdatedData:i,sc:r}),d=JSON.stringify({orderItems:n,noSplitItem:!o});return S(`${a}/api/checkout/pub/orderForm/${e}/items?${l}`,t.headers?{headers:{"content-type":"application/json",cookie:t.headers.cookie},body:d,method:"PATCH"}:{headers:{"content-type":"application/json"},body:d,method:"PATCH"})},setCustomData:({id:e,appId:n,key:i,value:t})=>S(`${a}/api/checkout/pub/orderForm/${e}/customData/${n}/${i}`,{...h,body:JSON.stringify({value:t}),method:"PUT"}),region:async({postalCode:e,geoCoordinates:n,country:i,salesChannel:t})=>{const r=new URLSearchParams({country:i,sc:null!=t?t:""});e?r.append("postalCode",e):r.append("geoCoordinates",`${null==n?void 0:n.longitude};${null==n?void 0:n.latitude}`);const o=`${a}/api/checkout/pub/regions/?${r.toString()}`;return S(o)},address:async({postalCode:e,country:n})=>S(`${a}/api/checkout/pub/postal-code/${n}/${e}`)},session:e=>{const n=new URLSearchParams(e);return n.set("items","profile.id,profile.email,profile.firstName,profile.lastName,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol"),S(`${a}/api/sessions?${n.toString()}`,{method:"POST",headers:{"content-type":"application/json",cookie:t.headers.cookie},body:"{}"})},subscribeToNewsletter:e=>S(a+"/api/dataentities/NL/documents/",{...h,body:JSON.stringify({...e,isNewsletterOptIn:!0}),method:"PATCH"})}})(e,n),sp:(({account:e},n)=>{const i=`https://sp.vtex.com/event-api/v1/${e}/event`;return{sendEvent:e=>S(i,{method:"POST",body:JSON.stringify({...e,agent:"@faststore/api",anonymous:I.anonymous(),session:I.session()}),headers:{"content-type":"application/json"}})}})(e)}))(e,n),n.loaders=((e,{clients:n})=>({skuLoader:((e,n)=>new t(async e=>{const{products:i}=await n.search.products({query:"sku:"+e.join(";"),page:0,count:e.length}),t=i.reduce((e,n)=>{for(const i of n.items)e[i.itemId]=F(i,n);return e},{}),a=e.map(e=>t[e]),r=e.filter(e=>!t[e]);if(r.length>0)throw new P("Search API did not found the following skus: "+r.join(","));return a},{maxBatchSize:99}))(0,n),simulationLoader:((e,n)=>{const i=a(1),r=async e=>{const i=e.reduce((e,{items:n})=>[...e,n],[]),t=[...i.flat()],a=await n.commerce.checkout.simulation({country:e[0].country,postalCode:e[0].postalCode,items:t}),r=a.items.reduce((e,n)=>{const i=n.requestIndex;return"number"==typeof i&&i<e.length&&(e[i]=n),e},Array(t.length).fill(null)),o=i.reduce((e,n)=>[...e,n.length+e[e.length-1]],[0]);return i.map((e,n)=>({...a,items:r.slice(o[n],o[n+1]).filter(e=>Boolean(e))}))};return new t(async e=>i(r,e),{maxBatchSize:50})})(0,n),collectionLoader:((e,n)=>{const i=a(20);return new t(async e=>Promise.all(e.map(e=>i(async()=>{const i=await n.commerce.catalog.portal.pagetype(e);if(L(i))return i;throw new P(`Catalog returned ${i.pageType} for slug: ${e}. This usually happens when there is more than one category with the same name in the same category tree level.`)}))),{batch:!1})})(0,n),salesChannelLoader:((e,n)=>new t(async e=>Promise.all(e.map(e=>n.commerce.catalog.salesChannel(e)))))(0,n)}))(0,n),n}}},kn=[sn],vn=()=>[ln,...kn.map(e=>e.typeDefs)],gn=e=>pn[e.platform].getResolvers(e);__webpack_unused_export__=O,__webpack_unused_export__=P,exports.getContextFactory=e=>pn[e.platform].getContextFactory(e),exports.getResolvers=gn,__webpack_unused_export__=async e=>{const i=n.makeExecutableSchema({resolvers:gn(e),typeDefs:vn()});return kn.reduce((e,n)=>n.transformer(e),i)},__webpack_unused_export__=function(e,n){var i;const t={url:"dev"===(null==n?void 0:n.mode)?"opentelemetry-collector-beta.vtex.systems":"opentelemetry-collector.vtex.systems"},a=new c.BasicTracerProvider({resource:new m.Resource({"service.name":"faststore-api","service.version":"2.2.38","service.name_and_version":"faststore-api@2.2.38",platform:e.platform,[e.platform+".account"]:e.account,[e.platform+".environment"]:e.environment,locale:e.locale})}),r=new k.LoggerProvider,o=new p.OTLPTraceExporter(t),l=new v.OTLPLogsExporter({url:"opentelemetry-collector.vtex.systems"}),s=new c.SimpleSpanProcessor(o),u=new k.SimpleLogRecordProcessor(l);if(a.addSpanProcessor(s),r.addLogRecordProcessor(u),"verbose"===(null==n?void 0:n.mode)||"dev"===(null==n?void 0:n.mode)){const e=new c.ConsoleSpanExporter,n=new c.SimpleSpanProcessor(e),i=new k.ConsoleLogRecordExporter,t=new k.SimpleLogRecordProcessor(i);a.addSpanProcessor(n),r.addLogRecordProcessor(t)}return{useFaststoreTelemetry:((e,n,i,t)=>function(){const i=e.getTracer("faststore-api"),a=n.getLogger("faststore-api"),r={};return{onPluginInit({addPlugin:e}){e(y.useOnResolve(({info:e,context:n})=>{if(n&&"object"==typeof n&&n[cn]){var t,a;i.getActiveSpanProcessor();const l=n[cn].spanContext().spanId,{fieldName:d,returnType:s,parentType:u,path:c}=e,m=c.prev&&mn(c.prev);let p=null;var o;m&&r[l][m]?p=r[l][m]:(p=f.trace.setSpan(f.context.active(),n[cn]),r[l]=null!=(o=r[l])?o:{});const k=Number.isInteger(null==(t=c.prev)?void 0:t.key)?`[${null==(a=c.prev)?void 0:a.key}]`:"",v=i.startSpan(`${u.toString()}.${d}${k}`,{attributes:{[un.RESOLVER_FIELD_NAME]:d,[un.RESOLVER_TYPE_NAME]:u.toString(),[un.RESOLVER_RESULT_TYPE]:s.toString(),"meta.span.path":mn(c)}},p),g=f.trace.setSpan(p,v);return r[l][mn(c)]=g,({result:e})=>{e instanceof Error&&(v.setAttributes({error:!0,"exception.category":un.RESOLVER_EXECUTION_ERROR,"exception.message":e.message,"exception.type":e.name}),v.recordException(e)),v.end()}}return()=>{}}))},onExecute({args:e,extendContext:n}){var r,o;const l=null==(r=e.document.definitions.filter(e=>e.kind===d.Kind.OPERATION_DEFINITION).map(e=>e.operation))?void 0:r[0];let s="GraphQL Operation";l&&e.operationName?s=`${l} ${e.operationName}`:l&&!e.operationName&&(s=l);const u=i.startSpan(s,{kind:f.SpanKind.SERVER,attributes:{[un.EXECUTION_OPERATION_NAME]:null!=(o=e.operationName)?o:void 0,[un.EXECUTION_OPERATION_TYPE]:null!=l?l:void 0,[un.EXECUTION_OPERATION_DOCUMENT]:d.print(e.document)}}),c=f.context.active(),m={onExecuteDone({result:n}){var i,r;if(g.isAsyncIterable(n))return u.end(),void console.warn('Plugin "newrelic" encountered a AsyncIterator which is not supported yet, so tracing data is not available for the operation.');const o={context:c,attributes:{"service.name":"faststore-api","service.version":"1.12.38","service.name_and_version":"faststore-api@1.12.38","vtex.search_index":"faststore_beta_api",[un.EXECUTION_OPERATION_NAME]:null!=(i=e.operationName)?i:void 0,[un.EXECUTION_OPERATION_DOCUMENT]:d.print(e.document),[un.EXECUTION_VARIABLES]:JSON.stringify(null!=(r=e.variableValues)?r:{})}};void 0===n.data||n.errors&&n.errors.length>0||(o.severityNumber=N.SeverityNumber.INFO,o.severityText="Info",o.attributes[un.EXECUTION_RESULT]=JSON.stringify(n)),n.errors&&n.errors.length>0&&(o.severityNumber=N.SeverityNumber.ERROR,o.severityText="Error",o.attributes[un.EXECUTION_ERROR]=JSON.stringify(n.errors),u.setAttributes({error:!0,"exception.category":un.EXECUTION_ERROR,"exception.message":JSON.stringify(n.errors)})),t&&a.emit(o),u.end()}};return n({[cn]:u}),m}}})(a,r,0,null!=(i=null==n?void 0:n.experimentalSendLogs)&&i)}},__webpack_unused_export__=vn,__webpack_unused_export__=e=>{var n;return"BadRequestError"===(null==e||null==(n=e.extensions)?void 0:n.type)},exports.isFastStoreError=e=>"FastStoreError"===(null==e?void 0:e.name),__webpack_unused_export__=e=>{var n;return"NotFoundError"===(null==e||null==(n=e.extensions)?void 0:n.type)},exports.stringifyCacheControl=({scope:e="private",sMaxAge:n=0,staleWhileRevalidate:i=0})=>`${e}, s-maxage=${n}, stale-while-revalidate=${i}`;
|
|
181
|
-
//# sourceMappingURL=api.cjs.production.min.js.map
|
|
182
2380
|
|
|
183
2381
|
|
|
184
|
-
/***/ }),
|
|
185
2382
|
|
|
186
|
-
/***/ 2898:
|
|
187
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
188
2383
|
|
|
189
2384
|
|
|
190
2385
|
|
|
191
2386
|
|
|
192
|
-
if (true) {
|
|
193
|
-
module.exports = __webpack_require__(3307)
|
|
194
|
-
} else {}
|
|
195
2387
|
|
|
196
2388
|
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
|
|
2392
|
+
|
|
2393
|
+
|
|
2394
|
+
|
|
2395
|
+
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
const Resolvers = {
|
|
2399
|
+
StoreCollection: StoreCollection,
|
|
2400
|
+
StoreAggregateOffer: StoreAggregateOffer,
|
|
2401
|
+
StoreProduct: StoreProduct,
|
|
2402
|
+
StoreSeo: StoreSeo,
|
|
2403
|
+
StoreFacet: StoreFacet,
|
|
2404
|
+
StoreFacetBoolean: StoreFacetBoolean,
|
|
2405
|
+
StoreFacetRange: StoreFacetRange,
|
|
2406
|
+
StoreFacetValueBoolean: StoreFacetValueBoolean,
|
|
2407
|
+
StoreOffer: StoreOffer,
|
|
2408
|
+
StoreAggregateRating: StoreAggregateRating,
|
|
2409
|
+
StoreReview: StoreReview,
|
|
2410
|
+
StoreProductGroup: StoreProductGroup,
|
|
2411
|
+
StoreSearchResult: StoreSearchResult,
|
|
2412
|
+
StorePropertyValue: StorePropertyValue,
|
|
2413
|
+
SkuVariants: SkuVariants,
|
|
2414
|
+
ShippingSLA: ShippingSLA,
|
|
2415
|
+
ObjectOrString: ObjectOrString,
|
|
2416
|
+
Query: Query,
|
|
2417
|
+
Mutation: Mutation,
|
|
2418
|
+
};
|
|
2419
|
+
const getContextFactory = (options) => (ctx) => {
|
|
2420
|
+
ctx.storage = {
|
|
2421
|
+
channel: ChannelMarshal.parse(options.channel),
|
|
2422
|
+
flags: options.flags ?? {},
|
|
2423
|
+
locale: options.locale,
|
|
2424
|
+
};
|
|
2425
|
+
ctx.clients = getClients(options, ctx);
|
|
2426
|
+
ctx.loaders = getLoaders(options, ctx);
|
|
2427
|
+
return ctx;
|
|
2428
|
+
};
|
|
2429
|
+
const getResolvers = (_) => Resolvers;
|
|
2430
|
+
//# sourceMappingURL=index.js.map
|
|
2431
|
+
|
|
2432
|
+
/***/ }),
|
|
2433
|
+
|
|
2434
|
+
/***/ 1547:
|
|
2435
|
+
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
|
|
2436
|
+
|
|
2437
|
+
|
|
2438
|
+
// UNUSED EXPORTS: getTelemetry
|
|
2439
|
+
|
|
2440
|
+
;// CONCATENATED MODULE: external "@opentelemetry/sdk-trace-base"
|
|
2441
|
+
const sdk_trace_base_namespaceObject = require("@opentelemetry/sdk-trace-base");
|
|
2442
|
+
;// CONCATENATED MODULE: external "@opentelemetry/resources"
|
|
2443
|
+
const resources_namespaceObject = require("@opentelemetry/resources");
|
|
2444
|
+
;// CONCATENATED MODULE: external "@opentelemetry/exporter-trace-otlp-grpc"
|
|
2445
|
+
const exporter_trace_otlp_grpc_namespaceObject = require("@opentelemetry/exporter-trace-otlp-grpc");
|
|
2446
|
+
;// CONCATENATED MODULE: external "@opentelemetry/sdk-logs"
|
|
2447
|
+
const sdk_logs_namespaceObject = require("@opentelemetry/sdk-logs");
|
|
2448
|
+
;// CONCATENATED MODULE: external "@opentelemetry/exporter-logs-otlp-grpc"
|
|
2449
|
+
const exporter_logs_otlp_grpc_namespaceObject = require("@opentelemetry/exporter-logs-otlp-grpc");
|
|
2450
|
+
;// CONCATENATED MODULE: external "@opentelemetry/api"
|
|
2451
|
+
const api_namespaceObject = require("@opentelemetry/api");
|
|
2452
|
+
;// CONCATENATED MODULE: external "@opentelemetry/api-logs"
|
|
2453
|
+
const api_logs_namespaceObject = require("@opentelemetry/api-logs");
|
|
2454
|
+
// EXTERNAL MODULE: external "graphql"
|
|
2455
|
+
var external_graphql_ = __webpack_require__(7343);
|
|
2456
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/telemetry/useFaststoreTelemetry.js
|
|
2457
|
+
|
|
2458
|
+
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
var AttributeName;
|
|
2464
|
+
(function (AttributeName) {
|
|
2465
|
+
AttributeName["EXECUTION_ERROR"] = "graphql.error";
|
|
2466
|
+
AttributeName["EXECUTION_RESULT"] = "graphql.result";
|
|
2467
|
+
AttributeName["RESOLVER_EXECUTION_ERROR"] = "graphql.resolver.error";
|
|
2468
|
+
AttributeName["RESOLVER_EXCEPTION"] = "graphql.resolver.exception";
|
|
2469
|
+
AttributeName["RESOLVER_FIELD_NAME"] = "graphql.resolver.fieldName";
|
|
2470
|
+
AttributeName["RESOLVER_TYPE_NAME"] = "graphql.resolver.typeName";
|
|
2471
|
+
AttributeName["RESOLVER_RESULT_TYPE"] = "graphql.resolver.resultType";
|
|
2472
|
+
AttributeName["RESOLVER_ARGS"] = "graphql.resolver.args";
|
|
2473
|
+
AttributeName["EXECUTION_OPERATION_NAME"] = "graphql.operation.name";
|
|
2474
|
+
AttributeName["EXECUTION_OPERATION_TYPE"] = "graphql.operation.type";
|
|
2475
|
+
AttributeName["EXECUTION_OPERATION_DOCUMENT"] = "graphql.document";
|
|
2476
|
+
AttributeName["EXECUTION_VARIABLES"] = "graphql.variables";
|
|
2477
|
+
})(AttributeName || (AttributeName = {}));
|
|
2478
|
+
const tracingSpanSymbol = Symbol('OPEN_TELEMETRY_GRAPHQL');
|
|
2479
|
+
function getResolverSpanKey(path) {
|
|
2480
|
+
const nodes = [];
|
|
2481
|
+
// If the first node (after reversed, it will be the last one) is an integer, that is, identifies a list,
|
|
2482
|
+
// we don't want to include it in the key. Note that this will only happen when analysing .prev paths in
|
|
2483
|
+
// a list of elements. We just want to remove the initial node that is a integer, not all of them.
|
|
2484
|
+
//
|
|
2485
|
+
// Nodes with keys 6bc73341b2a183fc::product::image::0::url would not be able to find
|
|
2486
|
+
// parents with key 6bc73341b2a183fc::product::image because of the "0" list index -
|
|
2487
|
+
// it would search for 6bc73341b2a183fc::product::image::0
|
|
2488
|
+
let currentPath = nodes.length === 0 && Number.isInteger(path.key) ? path.prev : path;
|
|
2489
|
+
while (currentPath) {
|
|
2490
|
+
nodes.push(currentPath.key);
|
|
2491
|
+
currentPath = currentPath.prev;
|
|
2492
|
+
}
|
|
2493
|
+
return [...nodes].reverse().join('.');
|
|
2494
|
+
}
|
|
2495
|
+
const useFaststoreTelemetry_getFaststoreTelemetryPlugin = (tracingProvider, loggerProvider, serviceName, experimentalSendLogs) => {
|
|
2496
|
+
return function useFaststoreTelemetry() {
|
|
2497
|
+
const tracer = tracingProvider.getTracer(serviceName);
|
|
2498
|
+
const logger = loggerProvider.getLogger(serviceName);
|
|
2499
|
+
const resolverContextsByRootSpans = {};
|
|
2500
|
+
return {
|
|
2501
|
+
onPluginInit({ addPlugin }) {
|
|
2502
|
+
addPlugin(
|
|
2503
|
+
// eslint-disable-next-line
|
|
2504
|
+
useOnResolve(({ info, context }) => {
|
|
2505
|
+
if (context &&
|
|
2506
|
+
typeof context === 'object' &&
|
|
2507
|
+
context[tracingSpanSymbol]) {
|
|
2508
|
+
tracer.getActiveSpanProcessor();
|
|
2509
|
+
const rootContextSpanId = context[tracingSpanSymbol].spanContext().spanId;
|
|
2510
|
+
const { fieldName, returnType, parentType, path } = info;
|
|
2511
|
+
const previousResolverSpanKey = path.prev && getResolverSpanKey(path.prev);
|
|
2512
|
+
let ctx = null;
|
|
2513
|
+
if (previousResolverSpanKey &&
|
|
2514
|
+
resolverContextsByRootSpans[rootContextSpanId][previousResolverSpanKey]) {
|
|
2515
|
+
ctx =
|
|
2516
|
+
resolverContextsByRootSpans[rootContextSpanId][previousResolverSpanKey];
|
|
2517
|
+
}
|
|
2518
|
+
else {
|
|
2519
|
+
ctx = openTelTrace.setSpan(openTelContext.active(), context[tracingSpanSymbol]);
|
|
2520
|
+
resolverContextsByRootSpans[rootContextSpanId] =
|
|
2521
|
+
resolverContextsByRootSpans[rootContextSpanId] ?? {};
|
|
2522
|
+
}
|
|
2523
|
+
const resolverIndexInList = Number.isInteger(path.prev?.key)
|
|
2524
|
+
? `[${path.prev?.key}]`
|
|
2525
|
+
: '';
|
|
2526
|
+
const resolverSpan = tracer.startSpan(`${parentType.toString()}.${fieldName}${resolverIndexInList}`, {
|
|
2527
|
+
attributes: {
|
|
2528
|
+
[AttributeName.RESOLVER_FIELD_NAME]: fieldName,
|
|
2529
|
+
[AttributeName.RESOLVER_TYPE_NAME]: parentType.toString(),
|
|
2530
|
+
[AttributeName.RESOLVER_RESULT_TYPE]: returnType.toString(),
|
|
2531
|
+
'meta.span.path': getResolverSpanKey(path),
|
|
2532
|
+
},
|
|
2533
|
+
}, ctx);
|
|
2534
|
+
const resolverCtx = openTelTrace.setSpan(ctx, resolverSpan);
|
|
2535
|
+
resolverContextsByRootSpans[rootContextSpanId][getResolverSpanKey(path)] = resolverCtx;
|
|
2536
|
+
return ({ result }) => {
|
|
2537
|
+
if (result instanceof Error) {
|
|
2538
|
+
resolverSpan.setAttributes({
|
|
2539
|
+
error: true,
|
|
2540
|
+
'exception.category': AttributeName.RESOLVER_EXECUTION_ERROR,
|
|
2541
|
+
'exception.message': result.message,
|
|
2542
|
+
'exception.type': result.name,
|
|
2543
|
+
});
|
|
2544
|
+
resolverSpan.recordException(result);
|
|
2545
|
+
}
|
|
2546
|
+
resolverSpan.end();
|
|
2547
|
+
};
|
|
2548
|
+
}
|
|
2549
|
+
return () => { };
|
|
2550
|
+
}));
|
|
2551
|
+
},
|
|
2552
|
+
onExecute({ args, extendContext }) {
|
|
2553
|
+
const operationType = args.document.definitions
|
|
2554
|
+
.filter((def) => def.kind === Kind.OPERATION_DEFINITION)
|
|
2555
|
+
.map((def) => def.operation)?.[0];
|
|
2556
|
+
// Span name according to Semantic Conventions
|
|
2557
|
+
// https://github.com/open-telemetry/semantic-conventions
|
|
2558
|
+
let spanName = 'GraphQL Operation';
|
|
2559
|
+
if (operationType && args.operationName) {
|
|
2560
|
+
spanName = `${operationType} ${args.operationName}`;
|
|
2561
|
+
}
|
|
2562
|
+
else if (operationType && !args.operationName) {
|
|
2563
|
+
spanName = operationType;
|
|
2564
|
+
}
|
|
2565
|
+
const executionSpan = tracer.startSpan(spanName, {
|
|
2566
|
+
kind: SpanKind.SERVER,
|
|
2567
|
+
attributes: {
|
|
2568
|
+
[AttributeName.EXECUTION_OPERATION_NAME]: args.operationName ?? undefined,
|
|
2569
|
+
[AttributeName.EXECUTION_OPERATION_TYPE]: operationType ?? undefined,
|
|
2570
|
+
[AttributeName.EXECUTION_OPERATION_DOCUMENT]: print(args.document),
|
|
2571
|
+
},
|
|
2572
|
+
});
|
|
2573
|
+
const executeContext = openTelContext.active();
|
|
2574
|
+
const resultCbs = {
|
|
2575
|
+
onExecuteDone({ result }) {
|
|
2576
|
+
if (isAsyncIterable(result)) {
|
|
2577
|
+
executionSpan.end();
|
|
2578
|
+
// eslint-disable-next-line no-console
|
|
2579
|
+
console.warn(`Plugin "newrelic" encountered a AsyncIterator which is not supported yet, so tracing data is not available for the operation.`);
|
|
2580
|
+
return;
|
|
2581
|
+
}
|
|
2582
|
+
const logRecord = {
|
|
2583
|
+
context: executeContext,
|
|
2584
|
+
attributes: {
|
|
2585
|
+
'service.name': 'faststore-api',
|
|
2586
|
+
'service.version': '1.12.38',
|
|
2587
|
+
'service.name_and_version': 'faststore-api@1.12.38',
|
|
2588
|
+
'vtex.search_index': 'faststore_beta_api',
|
|
2589
|
+
[AttributeName.EXECUTION_OPERATION_NAME]: args.operationName ?? undefined,
|
|
2590
|
+
[AttributeName.EXECUTION_OPERATION_DOCUMENT]: print(args.document),
|
|
2591
|
+
[AttributeName.EXECUTION_VARIABLES]: JSON.stringify(args.variableValues ?? {}),
|
|
2592
|
+
},
|
|
2593
|
+
};
|
|
2594
|
+
if (typeof result.data !== 'undefined' &&
|
|
2595
|
+
!(result.errors && result.errors.length > 0)) {
|
|
2596
|
+
logRecord.severityNumber = SeverityNumber.INFO;
|
|
2597
|
+
logRecord.severityText = 'Info';
|
|
2598
|
+
logRecord.attributes[AttributeName.EXECUTION_RESULT] =
|
|
2599
|
+
JSON.stringify(result);
|
|
2600
|
+
}
|
|
2601
|
+
if (result.errors && result.errors.length > 0) {
|
|
2602
|
+
logRecord.severityNumber = SeverityNumber.ERROR;
|
|
2603
|
+
logRecord.severityText = 'Error';
|
|
2604
|
+
logRecord.attributes[AttributeName.EXECUTION_ERROR] =
|
|
2605
|
+
JSON.stringify(result.errors);
|
|
2606
|
+
executionSpan.setAttributes({
|
|
2607
|
+
error: true,
|
|
2608
|
+
'exception.category': AttributeName.EXECUTION_ERROR,
|
|
2609
|
+
'exception.message': JSON.stringify(result.errors),
|
|
2610
|
+
});
|
|
2611
|
+
}
|
|
2612
|
+
if (experimentalSendLogs) {
|
|
2613
|
+
logger.emit(logRecord);
|
|
2614
|
+
}
|
|
2615
|
+
executionSpan.end();
|
|
2616
|
+
},
|
|
2617
|
+
};
|
|
2618
|
+
extendContext({
|
|
2619
|
+
[tracingSpanSymbol]: executionSpan,
|
|
2620
|
+
});
|
|
2621
|
+
return resultCbs;
|
|
2622
|
+
},
|
|
2623
|
+
};
|
|
2624
|
+
};
|
|
2625
|
+
};
|
|
2626
|
+
//# sourceMappingURL=useFaststoreTelemetry.js.map
|
|
2627
|
+
// EXTERNAL MODULE: ../api/dist/esm/package.json
|
|
2628
|
+
var esm_package = __webpack_require__(5713);
|
|
2629
|
+
;// CONCATENATED MODULE: ../api/dist/esm/src/telemetry/index.js
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
|
|
2633
|
+
|
|
2634
|
+
|
|
2635
|
+
|
|
2636
|
+
|
|
2637
|
+
const FASTSTORE_API_VERSION = esm_package/* version */.i8;
|
|
2638
|
+
// TODO: These urls are hardcoded for now, but they should be configurable via ENV variables
|
|
2639
|
+
// They are only acessible from within the VTEX network, so they are not a security risk
|
|
2640
|
+
const TRACE_COLLECTOR_URL = 'opentelemetry-collector.vtex.systems';
|
|
2641
|
+
const TRACE_COLLECTOR_URL_DEV = 'opentelemetry-collector-beta.vtex.systems';
|
|
2642
|
+
const LOG_COLLECTOR_URL = 'opentelemetry-collector.vtex.systems';
|
|
2643
|
+
function getTelemetry(APIOptions, telemetryOptions) {
|
|
2644
|
+
const honeycombCollectorOptions = {
|
|
2645
|
+
url: telemetryOptions?.mode === 'dev'
|
|
2646
|
+
? TRACE_COLLECTOR_URL_DEV
|
|
2647
|
+
: TRACE_COLLECTOR_URL,
|
|
2648
|
+
};
|
|
2649
|
+
const openSearchCollectorOptions = {
|
|
2650
|
+
url: LOG_COLLECTOR_URL,
|
|
2651
|
+
};
|
|
2652
|
+
// Create a new tracer provider
|
|
2653
|
+
const tracerProvider = new BasicTracerProvider({
|
|
2654
|
+
resource: new Resource({
|
|
2655
|
+
'service.name': 'faststore-api',
|
|
2656
|
+
'service.version': FASTSTORE_API_VERSION,
|
|
2657
|
+
'service.name_and_version': `faststore-api@${FASTSTORE_API_VERSION}`,
|
|
2658
|
+
platform: APIOptions.platform,
|
|
2659
|
+
[`${APIOptions.platform}.account`]: APIOptions.account,
|
|
2660
|
+
[`${APIOptions.platform}.environment`]: APIOptions.environment,
|
|
2661
|
+
// TODO: include the following properties in the logs
|
|
2662
|
+
// [`${APIOptions.platform}.options.hideUnavailableItems`]:
|
|
2663
|
+
// APIOptions.hideUnavailableItems,
|
|
2664
|
+
// [`${APIOptions.platform}.flags.enableOrderFormSync`]:
|
|
2665
|
+
// APIOptions.flags?.enableOrderFormSync,
|
|
2666
|
+
// channel: APIOptions.channel,
|
|
2667
|
+
locale: APIOptions.locale,
|
|
2668
|
+
}),
|
|
2669
|
+
});
|
|
2670
|
+
const loggerProvider = new LoggerProvider();
|
|
2671
|
+
// Create trace exporter
|
|
2672
|
+
const honeycombExporter = new OTLPTraceExporter(honeycombCollectorOptions);
|
|
2673
|
+
// Create log exporter
|
|
2674
|
+
const openSearchExporter = new OTLPLogsExporter(openSearchCollectorOptions);
|
|
2675
|
+
// Set up a span processor to export spans to Honeycomb
|
|
2676
|
+
const honeyCombSpanProcessor = new SimpleSpanProcessor(honeycombExporter);
|
|
2677
|
+
// Set up a log record processor to export spans to OpenSearch
|
|
2678
|
+
const openSearchLogProcessor = new SimpleLogRecordProcessor(openSearchExporter);
|
|
2679
|
+
// Register the span processor with the tracer provider
|
|
2680
|
+
tracerProvider.addSpanProcessor(honeyCombSpanProcessor);
|
|
2681
|
+
// Register the log record processor with the log provider
|
|
2682
|
+
loggerProvider.addLogRecordProcessor(openSearchLogProcessor);
|
|
2683
|
+
if (telemetryOptions?.mode === 'verbose' ||
|
|
2684
|
+
telemetryOptions?.mode === 'dev') {
|
|
2685
|
+
// Set up a console exporter for verbose mode
|
|
2686
|
+
const consoleExporter = new ConsoleSpanExporter();
|
|
2687
|
+
const verboseTraceProcessor = new SimpleSpanProcessor(consoleExporter);
|
|
2688
|
+
// Set up processors for verbose mode
|
|
2689
|
+
const consoleLogExporter = new ConsoleLogRecordExporter();
|
|
2690
|
+
const veboseLogRecordExporter = new SimpleLogRecordProcessor(consoleLogExporter);
|
|
2691
|
+
tracerProvider.addSpanProcessor(verboseTraceProcessor);
|
|
2692
|
+
loggerProvider.addLogRecordProcessor(veboseLogRecordExporter);
|
|
2693
|
+
}
|
|
2694
|
+
const useFaststoreTelemetry = getFaststoreTelemetryPlugin(
|
|
2695
|
+
// The @opentelemetry/sdk-trace-base was renamed from @opentelemetry/tracing but the
|
|
2696
|
+
// envelop plugin doesn't support this change yet. This causes the class type to be incompatible,
|
|
2697
|
+
// even if they are the same. https://github.com/n1ru4l/envelop/issues/1610
|
|
2698
|
+
tracerProvider, loggerProvider, 'faststore-api', telemetryOptions?.experimentalSendLogs ?? false);
|
|
2699
|
+
return { useFaststoreTelemetry };
|
|
2700
|
+
}
|
|
2701
|
+
//# sourceMappingURL=index.js.map
|
|
2702
|
+
|
|
2703
|
+
/***/ }),
|
|
2704
|
+
|
|
2705
|
+
/***/ 1419:
|
|
2706
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
2707
|
+
|
|
2708
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
2709
|
+
/* unused harmony export typeDefs */
|
|
2710
|
+
/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7343);
|
|
2711
|
+
/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphql__WEBPACK_IMPORTED_MODULE_0__);
|
|
2712
|
+
/* harmony import */ var _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5774);
|
|
2713
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_1__]);
|
|
2714
|
+
_graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
2715
|
+
|
|
2716
|
+
|
|
2717
|
+
// Empty string ('') is interpreted as the current dir. Referencing it as './' won't work.
|
|
2718
|
+
const typeDefs = (0,_graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_1__.loadFilesSync)('', { extensions: ['.graphql'] })
|
|
2719
|
+
.map(graphql__WEBPACK_IMPORTED_MODULE_0__.print)
|
|
2720
|
+
.join('\n');
|
|
2721
|
+
//# sourceMappingURL=index.js.map
|
|
2722
|
+
__webpack_async_result__();
|
|
2723
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
2724
|
+
|
|
197
2725
|
/***/ }),
|
|
198
2726
|
|
|
199
2727
|
/***/ 5278:
|
|
@@ -226,10 +2754,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
226
2754
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
227
2755
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
228
2756
|
/* harmony export */ });
|
|
229
|
-
/* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
2757
|
+
/* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7449);
|
|
230
2758
|
/* harmony import */ var _server__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(350);
|
|
231
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_server__WEBPACK_IMPORTED_MODULE_1__]);
|
|
232
|
-
_server__WEBPACK_IMPORTED_MODULE_1__ =
|
|
2759
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_faststore_api__WEBPACK_IMPORTED_MODULE_0__, _server__WEBPACK_IMPORTED_MODULE_1__]);
|
|
2760
|
+
([_faststore_api__WEBPACK_IMPORTED_MODULE_0__, _server__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
233
2761
|
|
|
234
2762
|
|
|
235
2763
|
|
|
@@ -280,11 +2808,11 @@ const handler = async (request, response) => {
|
|
|
280
2808
|
const hasErrors = Array.isArray(errors);
|
|
281
2809
|
|
|
282
2810
|
if (hasErrors) {
|
|
283
|
-
const error = errors.find(_faststore_api__WEBPACK_IMPORTED_MODULE_0__.isFastStoreError);
|
|
2811
|
+
const error = errors.find(_faststore_api__WEBPACK_IMPORTED_MODULE_0__/* .isFastStoreError */ .T9);
|
|
284
2812
|
response.status(error?.extensions.status ?? 500);
|
|
285
2813
|
}
|
|
286
2814
|
|
|
287
|
-
const cacheControl = !hasErrors && extensions.cacheControl ? (0,_faststore_api__WEBPACK_IMPORTED_MODULE_0__.stringifyCacheControl)(extensions.cacheControl) : 'no-cache, no-store';
|
|
2815
|
+
const cacheControl = !hasErrors && extensions.cacheControl ? (0,_faststore_api__WEBPACK_IMPORTED_MODULE_0__/* .stringifyCacheControl */ .Ve)(extensions.cacheControl) : 'no-cache, no-store';
|
|
288
2816
|
response.setHeader('cache-control', cacheControl);
|
|
289
2817
|
response.setHeader('content-type', 'application/json');
|
|
290
2818
|
response.send(JSON.stringify({
|
|
@@ -317,7 +2845,7 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|
|
317
2845
|
/* harmony import */ var _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7886);
|
|
318
2846
|
/* harmony import */ var _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4656);
|
|
319
2847
|
/* harmony import */ var _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6093);
|
|
320
|
-
/* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
2848
|
+
/* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7449);
|
|
321
2849
|
/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7343);
|
|
322
2850
|
/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(graphql__WEBPACK_IMPORTED_MODULE_6__);
|
|
323
2851
|
/* harmony import */ var _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6550);
|
|
@@ -326,8 +2854,8 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|
|
326
2854
|
/* harmony import */ var _customizations_src_graphql_vtex_resolvers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(9148);
|
|
327
2855
|
/* harmony import */ var _customizations_src_graphql_thirdParty_resolvers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5278);
|
|
328
2856
|
/* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1863);
|
|
329
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_envelop_core__WEBPACK_IMPORTED_MODULE_1__, _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__, _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__, _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__, _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__, _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_8__]);
|
|
330
|
-
([_envelop_core__WEBPACK_IMPORTED_MODULE_1__, _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__, _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__, _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__, _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__, _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
2857
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_envelop_core__WEBPACK_IMPORTED_MODULE_1__, _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__, _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__, _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__, _faststore_api__WEBPACK_IMPORTED_MODULE_5__, _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__, _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_8__]);
|
|
2858
|
+
([_envelop_core__WEBPACK_IMPORTED_MODULE_1__, _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__, _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__, _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__, _faststore_api__WEBPACK_IMPORTED_MODULE_5__, _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__, _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
331
2859
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
332
2860
|
|
|
333
2861
|
|
|
@@ -343,10 +2871,10 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_env
|
|
|
343
2871
|
|
|
344
2872
|
|
|
345
2873
|
const persistedQueries = new Map(Object.entries(_generated_graphql_persisted_json__WEBPACK_IMPORTED_MODULE_9__));
|
|
346
|
-
const apiContextFactory = (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__.getContextFactory)(_options__WEBPACK_IMPORTED_MODULE_10__/* .apiOptions */ .e);
|
|
2874
|
+
const apiContextFactory = (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__/* .getContextFactory */ .E9)(_options__WEBPACK_IMPORTED_MODULE_10__/* .apiOptions */ .e);
|
|
347
2875
|
|
|
348
2876
|
const formatError = err => {
|
|
349
|
-
if (err instanceof graphql__WEBPACK_IMPORTED_MODULE_6__.GraphQLError && (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__.isFastStoreError)(err.originalError)) {
|
|
2877
|
+
if (err instanceof graphql__WEBPACK_IMPORTED_MODULE_6__.GraphQLError && (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__/* .isFastStoreError */ .T9)(err.originalError)) {
|
|
350
2878
|
return err;
|
|
351
2879
|
}
|
|
352
2880
|
|
|
@@ -362,7 +2890,7 @@ function loadGeneratedSchema() {
|
|
|
362
2890
|
|
|
363
2891
|
function getFinalAPISchema() {
|
|
364
2892
|
const generatedSchema = loadGeneratedSchema();
|
|
365
|
-
const nativeResolvers = (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__.getResolvers)(_options__WEBPACK_IMPORTED_MODULE_10__/* .apiOptions */ .e);
|
|
2893
|
+
const nativeResolvers = (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__/* .getResolvers */ .yd)(_options__WEBPACK_IMPORTED_MODULE_10__/* .apiOptions */ .e);
|
|
366
2894
|
return (0,_graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__.makeExecutableSchema)({
|
|
367
2895
|
typeDefs: generatedSchema,
|
|
368
2896
|
resolvers: [nativeResolvers, _customizations_src_graphql_vtex_resolvers__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, _customizations_src_graphql_thirdParty_resolvers__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z]
|
|
@@ -444,6 +2972,13 @@ const apiOptions = {
|
|
|
444
2972
|
|
|
445
2973
|
/***/ }),
|
|
446
2974
|
|
|
2975
|
+
/***/ 5713:
|
|
2976
|
+
/***/ ((module) => {
|
|
2977
|
+
|
|
2978
|
+
module.exports = JSON.parse('{"u2":"@faststore/api","i8":"2.2.43"}');
|
|
2979
|
+
|
|
2980
|
+
/***/ }),
|
|
2981
|
+
|
|
447
2982
|
/***/ 9609:
|
|
448
2983
|
/***/ ((module) => {
|
|
449
2984
|
|
|
@@ -458,7 +2993,7 @@ module.exports = JSON.parse('{"ServerCollectionPageQuery":"query ServerCollectio
|
|
|
458
2993
|
var __webpack_require__ = require("../../webpack-api-runtime.js");
|
|
459
2994
|
__webpack_require__.C(exports);
|
|
460
2995
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
461
|
-
var __webpack_exports__ = __webpack_require__.X(0, [
|
|
2996
|
+
var __webpack_exports__ = __webpack_require__.X(0, [57,576], () => (__webpack_exec__(295)));
|
|
462
2997
|
module.exports = __webpack_exports__;
|
|
463
2998
|
|
|
464
2999
|
})();
|