cloudcommerce 0.0.71 → 0.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/CHANGELOG.md +38 -0
  3. package/package.json +9 -9
  4. package/packages/api/package.json +1 -1
  5. package/packages/apps/correios/package.json +1 -1
  6. package/packages/apps/custom-shipping/package.json +1 -1
  7. package/packages/apps/discounts/package.json +1 -1
  8. package/packages/apps/frenet/CHANGELOG.md +1 -0
  9. package/packages/apps/frenet/README.md +1 -0
  10. package/packages/apps/frenet/lib/frenet.d.ts +2 -0
  11. package/packages/apps/frenet/lib/frenet.js +6 -0
  12. package/packages/apps/frenet/lib/frenet.js.map +1 -0
  13. package/packages/apps/frenet/lib/index.d.ts +1 -0
  14. package/packages/apps/{tiny-erp → frenet}/lib/index.js +1 -1
  15. package/packages/apps/{tiny-erp → frenet}/lib/index.js.map +1 -1
  16. package/packages/apps/frenet/lib-mjs/calculate-frenet.mjs +152 -0
  17. package/packages/apps/frenet/package.json +28 -0
  18. package/packages/apps/frenet/src/frenet.ts +7 -0
  19. package/packages/apps/frenet/src/index.ts +1 -0
  20. package/packages/apps/frenet/tsconfig.json +6 -0
  21. package/packages/apps/tiny-erp/package.json +1 -1
  22. package/packages/cli/config/firebase.json +47 -0
  23. package/packages/cli/package.json +1 -1
  24. package/packages/config/lib/config.js +9 -8
  25. package/packages/config/lib/config.js.map +1 -1
  26. package/packages/config/package.json +1 -1
  27. package/packages/config/src/config.ts +11 -10
  28. package/packages/events/package.json +1 -1
  29. package/packages/firebase/lib/config.d.ts +3 -0
  30. package/packages/firebase/lib/config.js +3 -0
  31. package/packages/firebase/lib/config.js.map +1 -1
  32. package/packages/firebase/package.json +1 -1
  33. package/packages/firebase/src/config.ts +3 -0
  34. package/packages/modules/package.json +3 -1
  35. package/packages/modules/schemas/@checkout.cjs +28 -28
  36. package/packages/modules/schemas/apply_discount.cjs +2 -2
  37. package/packages/modules/schemas/calculate_shipping.cjs +4 -4
  38. package/packages/modules/schemas/create_transaction.cjs +30 -30
  39. package/packages/modules/schemas/list_payments.cjs +6 -6
  40. package/packages/modules/src/firebase/ajv.ts +2 -1
  41. package/packages/modules/src/firebase/call-app-module.ts +5 -0
  42. package/packages/modules/src/firebase/handle-module.ts +5 -1
  43. package/packages/modules/src/firebase/serve-modules-api.ts +5 -3
  44. package/packages/passport/lib/firebase/handle-passport.js +96 -92
  45. package/packages/passport/lib/firebase/serve-passport-api.js +35 -34
  46. package/packages/passport/lib/firebase.js +5 -7
  47. package/packages/passport/lib/index.js +2 -1
  48. package/packages/passport/package.json +1 -1
  49. package/packages/ssr/lib/firebase/serve-storefront.js +37 -55
  50. package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
  51. package/packages/ssr/lib/firebase.js +2 -4
  52. package/packages/ssr/lib/index.js +1 -2
  53. package/packages/ssr/package.json +1 -1
  54. package/packages/ssr/src/firebase/serve-storefront.ts +13 -36
  55. package/packages/storefront/astro.config.mjs +2 -0
  56. package/packages/storefront/dist/client/LoginModal.d6b935cf.js +1 -0
  57. package/packages/storefront/dist/client/assets/{_...98510c96.css → _...27b7eb4d.css} +1 -1
  58. package/packages/storefront/dist/client/assets/_...b3f65c5c.css +1 -0
  59. package/packages/storefront/dist/client/assets/fallback-index.90217cf0.css +1 -0
  60. package/packages/storefront/dist/client/assets/{404.530428e5.css → fallback.9cd2ed3f.css} +1 -1
  61. package/packages/storefront/dist/client/assets/{index.53a3a3e0.css → index.c5a9ea80.css} +1 -1
  62. package/packages/storefront/dist/client/chunks/index.esm.69f70489.js +1726 -0
  63. package/packages/storefront/dist/client/chunks/index.esm2017.1194d1a1.js +457 -0
  64. package/packages/storefront/dist/client/chunks/runtime-core.esm-bundler.a7337834.js +1 -0
  65. package/packages/storefront/dist/client/client.80b904f3.js +1 -0
  66. package/packages/storefront/dist/client/hoisted.24787260.js +376 -0
  67. package/packages/storefront/dist/server/entry.mjs +672 -144
  68. package/packages/storefront/package.json +13 -11
  69. package/packages/storefront/src/assets/firebaseui.css +648 -0
  70. package/packages/storefront/src/env.d.ts +1 -0
  71. package/packages/storefront/src/{components → lib/components}/Card.astro +0 -0
  72. package/packages/storefront/src/lib/components/LoginModal.vue +89 -0
  73. package/packages/storefront/src/lib/layouts/Layout.astro +84 -0
  74. package/packages/storefront/src/lib/layouts/meta/Head.astro +7 -0
  75. package/packages/storefront/src/lib/layouts/meta/Json.astro +34 -0
  76. package/packages/storefront/src/lib/ssr-context.ts +131 -0
  77. package/packages/storefront/src/lib/views/[...slug].astro +77 -0
  78. package/packages/storefront/src/lib/views/app/index.astro +0 -0
  79. package/packages/storefront/src/{pages/404.astro → lib/views/fallback.astro} +6 -1
  80. package/packages/storefront/src/lib/views/index.astro +87 -0
  81. package/packages/storefront/src/pages/[...slug].astro +12 -76
  82. package/packages/storefront/src/pages/fallback.astro +13 -0
  83. package/packages/storefront/src/pages/index.astro +15 -79
  84. package/packages/storefront/storefront.config.mjs +23 -6
  85. package/packages/storefront/tsconfig.json +4 -1
  86. package/packages/types/package.json +1 -1
  87. package/packages/apps/tiny-erp/lib/event-to-tiny.js +0 -115
  88. package/packages/apps/tiny-erp/lib/event-to-tiny.js.map +0 -1
  89. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js +0 -79
  90. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js.map +0 -1
  91. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +0 -84
  92. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js.map +0 -1
  93. package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js +0 -58
  94. package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js.map +0 -1
  95. package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js +0 -7
  96. package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js.map +0 -1
  97. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +0 -92
  98. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js.map +0 -1
  99. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +0 -158
  100. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js.map +0 -1
  101. package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js +0 -46
  102. package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js.map +0 -1
  103. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +0 -193
  104. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js.map +0 -1
  105. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +0 -199
  106. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js.map +0 -1
  107. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +0 -129
  108. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js.map +0 -1
  109. package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js +0 -34
  110. package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js.map +0 -1
  111. package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js +0 -39
  112. package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js.map +0 -1
  113. package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js +0 -47
  114. package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js.map +0 -1
  115. package/packages/apps/tiny-erp/lib/tiny-erp.js +0 -18
  116. package/packages/apps/tiny-erp/lib/tiny-erp.js.map +0 -1
  117. package/packages/apps/tiny-erp/lib/tiny-webhook.js +0 -92
  118. package/packages/apps/tiny-erp/lib/tiny-webhook.js.map +0 -1
  119. package/packages/modules/lib/firebase/ajv.js +0 -33
  120. package/packages/modules/lib/firebase/ajv.js.map +0 -1
  121. package/packages/modules/lib/firebase/call-app-module.js +0 -130
  122. package/packages/modules/lib/firebase/call-app-module.js.map +0 -1
  123. package/packages/modules/lib/firebase/checkout.js +0 -1
  124. package/packages/modules/lib/firebase/checkout.js.map +0 -1
  125. package/packages/modules/lib/firebase/handle-module.js +0 -165
  126. package/packages/modules/lib/firebase/handle-module.js.map +0 -1
  127. package/packages/modules/lib/firebase/proxy-apps.js +0 -1
  128. package/packages/modules/lib/firebase/proxy-apps.js.map +0 -1
  129. package/packages/modules/lib/firebase/serve-modules-api.js +0 -57
  130. package/packages/modules/lib/firebase/serve-modules-api.js.map +0 -1
  131. package/packages/modules/lib/firebase.js +0 -13
  132. package/packages/modules/lib/firebase.js.map +0 -1
  133. package/packages/modules/lib/index.js +0 -25
  134. package/packages/modules/lib/index.js.map +0 -1
  135. package/packages/storefront/dist/client/assets/404-_...d4aa8aff.css +0 -1
  136. package/packages/storefront/dist/client/assets/404-index.d9230d24.css +0 -1
  137. package/packages/storefront/dist/client/client.6d48c590.js +0 -1
  138. package/packages/storefront/src/layouts/Layout.astro +0 -63
  139. package/packages/storefront/src/types.ts +0 -18
@@ -1,13 +1,14 @@
1
1
  import * as adapter from '@astrojs/node/server.js';
2
- import { defineComponent, h, createSSRApp } from 'vue';
3
- import { renderToString as renderToString$1 } from 'vue/server-renderer';
2
+ import { defineComponent, h, createSSRApp, ref, useSSRContext } from 'vue';
3
+ import { renderToString as renderToString$1, ssrInterpolate, ssrRenderSlot } from 'vue/server-renderer';
4
4
  import { escape } from 'html-escaper';
5
- /* empty css *//* empty css */import { fileURLToPath } from 'url';
6
- import { readFileSync } from 'fs';
5
+ import mime from 'mime';
6
+ import sharp from 'sharp';
7
+ /* empty css *//* empty css */import { fileURLToPath } from 'url';
8
+ import fs from 'fs';
7
9
  import { resolve } from 'path';
8
10
  import Deepmerge from '@fastify/deepmerge';
9
- /* empty css *//* empty css *//* empty css */import 'mime';
10
- import 'kleur/colors';
11
+ /* empty css *//* empty css *//* empty css */import 'kleur/colors';
11
12
  import 'string-width';
12
13
  import 'path-browserify';
13
14
  import { compile } from 'path-to-regexp';
@@ -30,7 +31,7 @@ const StaticHtml = defineComponent({
30
31
  });
31
32
 
32
33
  function check$1(Component) {
33
- return !!Component['ssrRender'];
34
+ return !!Component['ssrRender'] || !!Component['__ssrInlineRender'];
34
35
  }
35
36
 
36
37
  async function renderToStaticMarkup$1(Component, props, slotted) {
@@ -48,7 +49,7 @@ const _renderer1 = {
48
49
  renderToStaticMarkup: renderToStaticMarkup$1,
49
50
  };
50
51
 
51
- const ASTRO_VERSION = "1.1.5";
52
+ const ASTRO_VERSION = "1.2.2";
52
53
  function createDeprecatedFetchContentFn() {
53
54
  return () => {
54
55
  throw new Error("Deprecated: Astro.fetchContent() has been replaced with Astro.glob().");
@@ -169,17 +170,35 @@ const PROP_TYPE = {
169
170
  BigInt: 6,
170
171
  URL: 7
171
172
  };
172
- function serializeArray(value) {
173
- return value.map((v) => convertToSerializedForm(v));
173
+ function serializeArray(value, metadata = {}, parents = /* @__PURE__ */ new WeakSet()) {
174
+ if (parents.has(value)) {
175
+ throw new Error(`Cyclic reference detected while serializing props for <${metadata.displayName} client:${metadata.hydrate}>!
176
+
177
+ Cyclic references cannot be safely serialized for client-side usage. Please remove the cyclic reference.`);
178
+ }
179
+ parents.add(value);
180
+ const serialized = value.map((v) => {
181
+ return convertToSerializedForm(v, metadata, parents);
182
+ });
183
+ parents.delete(value);
184
+ return serialized;
174
185
  }
175
- function serializeObject(value) {
176
- return Object.fromEntries(
186
+ function serializeObject(value, metadata = {}, parents = /* @__PURE__ */ new WeakSet()) {
187
+ if (parents.has(value)) {
188
+ throw new Error(`Cyclic reference detected while serializing props for <${metadata.displayName} client:${metadata.hydrate}>!
189
+
190
+ Cyclic references cannot be safely serialized for client-side usage. Please remove the cyclic reference.`);
191
+ }
192
+ parents.add(value);
193
+ const serialized = Object.fromEntries(
177
194
  Object.entries(value).map(([k, v]) => {
178
- return [k, convertToSerializedForm(v)];
195
+ return [k, convertToSerializedForm(v, metadata, parents)];
179
196
  })
180
197
  );
198
+ parents.delete(value);
199
+ return serialized;
181
200
  }
182
- function convertToSerializedForm(value) {
201
+ function convertToSerializedForm(value, metadata = {}, parents = /* @__PURE__ */ new WeakSet()) {
183
202
  const tag = Object.prototype.toString.call(value);
184
203
  switch (tag) {
185
204
  case "[object Date]": {
@@ -189,10 +208,16 @@ function convertToSerializedForm(value) {
189
208
  return [PROP_TYPE.RegExp, value.source];
190
209
  }
191
210
  case "[object Map]": {
192
- return [PROP_TYPE.Map, JSON.stringify(serializeArray(Array.from(value)))];
211
+ return [
212
+ PROP_TYPE.Map,
213
+ JSON.stringify(serializeArray(Array.from(value), metadata, parents))
214
+ ];
193
215
  }
194
216
  case "[object Set]": {
195
- return [PROP_TYPE.Set, JSON.stringify(serializeArray(Array.from(value)))];
217
+ return [
218
+ PROP_TYPE.Set,
219
+ JSON.stringify(serializeArray(Array.from(value), metadata, parents))
220
+ ];
196
221
  }
197
222
  case "[object BigInt]": {
198
223
  return [PROP_TYPE.BigInt, value.toString()];
@@ -201,19 +226,20 @@ function convertToSerializedForm(value) {
201
226
  return [PROP_TYPE.URL, value.toString()];
202
227
  }
203
228
  case "[object Array]": {
204
- return [PROP_TYPE.JSON, JSON.stringify(serializeArray(value))];
229
+ return [PROP_TYPE.JSON, JSON.stringify(serializeArray(value, metadata, parents))];
205
230
  }
206
231
  default: {
207
232
  if (value !== null && typeof value === "object") {
208
- return [PROP_TYPE.Value, serializeObject(value)];
233
+ return [PROP_TYPE.Value, serializeObject(value, metadata, parents)];
209
234
  } else {
210
235
  return [PROP_TYPE.Value, value];
211
236
  }
212
237
  }
213
238
  }
214
239
  }
215
- function serializeProps(props) {
216
- return JSON.stringify(serializeObject(props));
240
+ function serializeProps(props, metadata) {
241
+ const serialized = JSON.stringify(serializeObject(props, metadata));
242
+ return serialized;
217
243
  }
218
244
 
219
245
  function serializeListValue(value) {
@@ -323,11 +349,11 @@ async function generateHydrateScript(scriptOptions, metadata) {
323
349
  island.props[key] = value;
324
350
  }
325
351
  }
326
- island.props["component-url"] = await result.resolve(componentUrl);
352
+ island.props["component-url"] = await result.resolve(decodeURI(componentUrl));
327
353
  if (renderer.clientEntrypoint) {
328
354
  island.props["component-export"] = componentExport.value;
329
- island.props["renderer-url"] = await result.resolve(renderer.clientEntrypoint);
330
- island.props["props"] = escapeHTML(serializeProps(props));
355
+ island.props["renderer-url"] = await result.resolve(decodeURI(renderer.clientEntrypoint));
356
+ island.props["props"] = escapeHTML(serializeProps(props, metadata));
331
357
  }
332
358
  island.props["ssr"] = "";
333
359
  island.props["client"] = hydrate;
@@ -917,7 +943,8 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr
917
943
  `<!--${metadata.componentExport.value}:${metadata.componentUrl}-->
918
944
  ${html}
919
945
  ${serializeProps(
920
- props
946
+ props,
947
+ metadata
921
948
  )}`
922
949
  );
923
950
  const island = await generateHydrateScript(
@@ -1266,6 +1293,186 @@ var server_default = {
1266
1293
  renderToStaticMarkup
1267
1294
  };
1268
1295
 
1296
+ function isOutputFormat(value) {
1297
+ return ["avif", "jpeg", "png", "webp"].includes(value);
1298
+ }
1299
+ function isAspectRatioString(value) {
1300
+ return /^\d*:\d*$/.test(value);
1301
+ }
1302
+
1303
+ class SharpService {
1304
+ async getImageAttributes(transform) {
1305
+ const { width, height, src, format, quality, aspectRatio, fit, position, background, ...rest } = transform;
1306
+ return {
1307
+ ...rest,
1308
+ width,
1309
+ height
1310
+ };
1311
+ }
1312
+ serializeTransform(transform) {
1313
+ const searchParams = new URLSearchParams();
1314
+ if (transform.quality) {
1315
+ searchParams.append("q", transform.quality.toString());
1316
+ }
1317
+ if (transform.format) {
1318
+ searchParams.append("f", transform.format);
1319
+ }
1320
+ if (transform.width) {
1321
+ searchParams.append("w", transform.width.toString());
1322
+ }
1323
+ if (transform.height) {
1324
+ searchParams.append("h", transform.height.toString());
1325
+ }
1326
+ if (transform.aspectRatio) {
1327
+ searchParams.append("ar", transform.aspectRatio.toString());
1328
+ }
1329
+ if (transform.fit) {
1330
+ searchParams.append("fit", transform.fit);
1331
+ }
1332
+ if (transform.background) {
1333
+ searchParams.append("bg", transform.background);
1334
+ }
1335
+ if (transform.position) {
1336
+ searchParams.append("p", encodeURI(transform.position));
1337
+ }
1338
+ return { searchParams };
1339
+ }
1340
+ parseTransform(searchParams) {
1341
+ let transform = { src: searchParams.get("href") };
1342
+ if (searchParams.has("q")) {
1343
+ transform.quality = parseInt(searchParams.get("q"));
1344
+ }
1345
+ if (searchParams.has("f")) {
1346
+ const format = searchParams.get("f");
1347
+ if (isOutputFormat(format)) {
1348
+ transform.format = format;
1349
+ }
1350
+ }
1351
+ if (searchParams.has("w")) {
1352
+ transform.width = parseInt(searchParams.get("w"));
1353
+ }
1354
+ if (searchParams.has("h")) {
1355
+ transform.height = parseInt(searchParams.get("h"));
1356
+ }
1357
+ if (searchParams.has("ar")) {
1358
+ const ratio = searchParams.get("ar");
1359
+ if (isAspectRatioString(ratio)) {
1360
+ transform.aspectRatio = ratio;
1361
+ } else {
1362
+ transform.aspectRatio = parseFloat(ratio);
1363
+ }
1364
+ }
1365
+ if (searchParams.has("fit")) {
1366
+ transform.fit = searchParams.get("fit");
1367
+ }
1368
+ if (searchParams.has("p")) {
1369
+ transform.position = decodeURI(searchParams.get("p"));
1370
+ }
1371
+ if (searchParams.has("bg")) {
1372
+ transform.background = searchParams.get("bg");
1373
+ }
1374
+ return transform;
1375
+ }
1376
+ async transform(inputBuffer, transform) {
1377
+ const sharpImage = sharp(inputBuffer, { failOnError: false, pages: -1 });
1378
+ sharpImage.rotate();
1379
+ if (transform.width || transform.height) {
1380
+ const width = transform.width && Math.round(transform.width);
1381
+ const height = transform.height && Math.round(transform.height);
1382
+ sharpImage.resize({
1383
+ width,
1384
+ height,
1385
+ fit: transform.fit,
1386
+ position: transform.position,
1387
+ background: transform.background
1388
+ });
1389
+ }
1390
+ if (transform.background) {
1391
+ sharpImage.flatten({ background: transform.background });
1392
+ }
1393
+ if (transform.format) {
1394
+ sharpImage.toFormat(transform.format, { quality: transform.quality });
1395
+ }
1396
+ const { data, info } = await sharpImage.toBuffer({ resolveWithObject: true });
1397
+ return {
1398
+ data,
1399
+ format: info.format
1400
+ };
1401
+ }
1402
+ }
1403
+ const service = new SharpService();
1404
+ var sharp_default = service;
1405
+
1406
+ const fnv1a52 = (str) => {
1407
+ const len = str.length;
1408
+ let i = 0, t0 = 0, v0 = 8997, t1 = 0, v1 = 33826, t2 = 0, v2 = 40164, t3 = 0, v3 = 52210;
1409
+ while (i < len) {
1410
+ v0 ^= str.charCodeAt(i++);
1411
+ t0 = v0 * 435;
1412
+ t1 = v1 * 435;
1413
+ t2 = v2 * 435;
1414
+ t3 = v3 * 435;
1415
+ t2 += v0 << 8;
1416
+ t3 += v1 << 8;
1417
+ t1 += t0 >>> 16;
1418
+ v0 = t0 & 65535;
1419
+ t2 += t1 >>> 16;
1420
+ v1 = t1 & 65535;
1421
+ v3 = t3 + (t2 >>> 16) & 65535;
1422
+ v2 = t2 & 65535;
1423
+ }
1424
+ return (v3 & 15) * 281474976710656 + v2 * 4294967296 + v1 * 65536 + (v0 ^ v3 >> 4);
1425
+ };
1426
+ const etag = (payload, weak = false) => {
1427
+ const prefix = weak ? 'W/"' : '"';
1428
+ return prefix + fnv1a52(payload).toString(36) + payload.length.toString(36) + '"';
1429
+ };
1430
+
1431
+ function isRemoteImage(src) {
1432
+ return /^http(s?):\/\//.test(src);
1433
+ }
1434
+
1435
+ async function loadRemoteImage(src) {
1436
+ try {
1437
+ const res = await fetch(src);
1438
+ if (!res.ok) {
1439
+ return void 0;
1440
+ }
1441
+ return Buffer.from(await res.arrayBuffer());
1442
+ } catch {
1443
+ return void 0;
1444
+ }
1445
+ }
1446
+ const get$1 = async ({ request }) => {
1447
+ try {
1448
+ const url = new URL(request.url);
1449
+ const transform = sharp_default.parseTransform(url.searchParams);
1450
+ let inputBuffer = void 0;
1451
+ const sourceUrl = isRemoteImage(transform.src) ? new URL(transform.src) : new URL(transform.src, url.origin);
1452
+ inputBuffer = await loadRemoteImage(sourceUrl);
1453
+ if (!inputBuffer) {
1454
+ return new Response("Not Found", { status: 404 });
1455
+ }
1456
+ const { data, format } = await sharp_default.transform(inputBuffer, transform);
1457
+ return new Response(data, {
1458
+ status: 200,
1459
+ headers: {
1460
+ "Content-Type": mime.getType(format) || "",
1461
+ "Cache-Control": "public, max-age=31536000",
1462
+ ETag: etag(data.toString()),
1463
+ Date: new Date().toUTCString()
1464
+ }
1465
+ });
1466
+ } catch (err) {
1467
+ return new Response(`Server Error: ${err}`, { status: 500 });
1468
+ }
1469
+ };
1470
+
1471
+ const _page0 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1472
+ __proto__: null,
1473
+ get: get$1
1474
+ }, Symbol.toStringTag, { value: 'Module' }));
1475
+
1269
1476
  // @ts-ignore
1270
1477
  const _env$1 = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{LANG:process.env.LANG,ECOM_STORE_ID:process.env.ECOM_STORE_ID,BASE_URL:'/',}))
1271
1478
  || (typeof process === 'object' && process?.env)
@@ -1430,7 +1637,7 @@ api.del = del;
1430
1637
  api.delete = del;
1431
1638
  // # sourceMappingURL=api.js.map
1432
1639
 
1433
- const $$module1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1640
+ const $$module1$4 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1434
1641
  __proto__: null,
1435
1642
  default: api,
1436
1643
  setMiddleware,
@@ -1457,19 +1664,20 @@ const _env = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PRO
1457
1664
  || globalThis;
1458
1665
  const deepmerge = Deepmerge();
1459
1666
  const self = globalThis.__cloudCommerce || {
1460
- config: {
1461
- lang: _env.ECOM_LANG || DEFAULT_LANG,
1462
- currency: _env.ECOM_CURRENCY || DEFAULT_CURRENCY,
1463
- currencySymbol: _env.ECOM_CURRENCY_SYMBOL || DEFAULT_CURRENCY_SYMBOL,
1464
- countryCode: _env.ECOM_COUNTRY_CODE || DEFAULT_COUNTRY_CODE,
1465
- storeId: Number(_env.ECOM_STORE_ID),
1466
- },
1667
+ config: {},
1467
1668
  };
1468
1669
  globalThis.__cloudCommerce = self;
1469
1670
 
1470
1671
  const config = {
1471
1672
  get() {
1472
- return self.config;
1673
+ return {
1674
+ lang: _env.ECOM_LANG || DEFAULT_LANG,
1675
+ currency: _env.ECOM_CURRENCY || DEFAULT_CURRENCY,
1676
+ currencySymbol: _env.ECOM_CURRENCY_SYMBOL || DEFAULT_CURRENCY_SYMBOL,
1677
+ countryCode: _env.ECOM_COUNTRY_CODE || DEFAULT_COUNTRY_CODE,
1678
+ storeId: Number(_env.ECOM_STORE_ID),
1679
+ ...self.config,
1680
+ };
1473
1681
  },
1474
1682
  set(config) {
1475
1683
  self.config = deepmerge(self.config, config);
@@ -1480,14 +1688,12 @@ const config = {
1480
1688
  };
1481
1689
  // # sourceMappingURL=config.js.map
1482
1690
 
1483
- const getConfig = () => {
1691
+ const _getConfig = () => {
1484
1692
  const {
1485
1693
  STOREFRONT_BASE_DIR,
1486
1694
  VITE_ECOM_STORE_ID,
1487
1695
  } = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{STOREFRONT_BASE_DIR:process.env.STOREFRONT_BASE_DIR,ECOM_STORE_ID:process.env.ECOM_STORE_ID,})) || process.env;
1488
1696
 
1489
- const { storeId, lang } = config.get();
1490
-
1491
1697
  let baseDir;
1492
1698
  if (STOREFRONT_BASE_DIR) {
1493
1699
  const currentDir = fileURLToPath(new URL('.', import.meta.url));
@@ -1500,9 +1706,24 @@ const getConfig = () => {
1500
1706
  config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
1501
1707
  }
1502
1708
 
1503
- const settings = JSON.parse(
1504
- readFileSync(resolve(dirContent, 'settings.json'), 'utf8'),
1505
- );
1709
+ const {
1710
+ storeId,
1711
+ lang,
1712
+ countryCode,
1713
+ currency,
1714
+ currencySymbol,
1715
+ } = config.get();
1716
+
1717
+ const cms = (filename) => {
1718
+ if (filename.endsWith('/')) {
1719
+ const dirColl = resolve(dirContent, filename);
1720
+ return fs.readdirSync(dirColl).map((_filename) => _filename.replace('.json', ''));
1721
+ }
1722
+ const filepath = resolve(dirContent, `${filename}.json`);
1723
+ return JSON.parse(fs.readFileSync(filepath, 'utf8'));
1724
+ };
1725
+
1726
+ const settings = cms('settings');
1506
1727
  const { domain } = settings;
1507
1728
  const primaryColor = settings.primary_color || '#20c997';
1508
1729
  const secondaryColor = settings.secondary_color || '#343a40';
@@ -1510,64 +1731,294 @@ const getConfig = () => {
1510
1731
  return {
1511
1732
  storeId,
1512
1733
  lang,
1734
+ countryCode,
1735
+ currency,
1736
+ currencySymbol,
1513
1737
  domain,
1514
1738
  primaryColor,
1515
1739
  secondaryColor,
1516
1740
  settings,
1741
+ cms,
1517
1742
  };
1518
1743
  };
1519
1744
 
1745
+ const getConfig = _getConfig;
1746
+ if (!globalThis.api_prefetch_endpoints) {
1747
+ globalThis.api_prefetch_endpoints = ["categories"];
1748
+ }
1749
+ const setResponseCache = (Astro, maxAge, sMaxAge) => {
1750
+ const headerName = Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true}, { SSR: true }).PROD ? "Cache-Control" : "X-Cache-Control";
1751
+ let cacheControl = `public, max-age=${maxAge}`;
1752
+ if (sMaxAge) {
1753
+ cacheControl += `, s-maxage=${sMaxAge}, stale-while-revalidate=86400`;
1754
+ }
1755
+ Astro.response.headers.set(headerName, cacheControl);
1756
+ };
1757
+ const loadPageContext = async (Astro, {
1758
+ cmsCollection,
1759
+ apiPrefetchEndpoints = globalThis.api_prefetch_endpoints
1760
+ } = {}) => {
1761
+ const urlPath = Astro.url.pathname;
1762
+ const { slug } = Astro.params;
1763
+ const config = getConfig();
1764
+ let cmsContent;
1765
+ let apiResource;
1766
+ let apiDoc;
1767
+ const apiState = {};
1768
+ const apiOptions = {
1769
+ fetch,
1770
+ isNoAuth: true
1771
+ };
1772
+ const apiFetchings = [
1773
+ null,
1774
+ ...apiPrefetchEndpoints.map((endpoint) => api.get(endpoint, apiOptions))
1775
+ ];
1776
+ if (slug) {
1777
+ if (cmsCollection) {
1778
+ cmsContent = config.cms(`${cmsCollection}/${slug}`);
1779
+ } else {
1780
+ apiFetchings[0] = api.get(`slugs/${slug}`, apiOptions);
1781
+ }
1782
+ }
1783
+ try {
1784
+ const [slugResponse, ...prefetchResponses] = await Promise.all(apiFetchings);
1785
+ if (slugResponse) {
1786
+ apiResource = slugResponse.data.resource;
1787
+ apiDoc = slugResponse.data.doc;
1788
+ apiState[`${apiResource}/${apiDoc._id}`] = apiDoc;
1789
+ }
1790
+ prefetchResponses.forEach(({ config: { endpoint }, data }) => {
1791
+ apiState[endpoint] = data;
1792
+ });
1793
+ } catch (err) {
1794
+ const error = err;
1795
+ const status = error.statusCode || 500;
1796
+ if (status === 404) {
1797
+ if (urlPath.endsWith("/")) {
1798
+ err.redirectUrl = urlPath.slice(0, -1);
1799
+ err.astroResponse = Astro.redirect(err.redirectUrl);
1800
+ throw err;
1801
+ }
1802
+ setResponseCache(Astro, 120, 300);
1803
+ } else {
1804
+ console.error(error);
1805
+ setResponseCache(Astro, 30);
1806
+ Astro.response.headers.set("X-SSR-Error", error.message);
1807
+ }
1808
+ Astro.response.status = status;
1809
+ err.responseHTML = `<html><head>
1810
+ <meta http-equiv="refresh" content="0;
1811
+ url=/fallback?status=${status}&url=${encodeURIComponent(urlPath)}"/>
1812
+ </head>
1813
+ <body></body></html>`;
1814
+ throw err;
1815
+ }
1816
+ if (urlPath === "/fallback") {
1817
+ setResponseCache(Astro, 3600, 86400);
1818
+ } else {
1819
+ setResponseCache(Astro, 120, 600);
1820
+ }
1821
+ return {
1822
+ ...config,
1823
+ cmsContent,
1824
+ apiResource,
1825
+ apiDoc,
1826
+ apiState
1827
+ };
1828
+ };
1829
+
1830
+ const $$module2$2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1831
+ __proto__: null,
1832
+ default: loadPageContext,
1833
+ getConfig,
1834
+ loadPageContext
1835
+ }, Symbol.toStringTag, { value: 'Module' }));
1836
+
1837
+ const $$metadata$a = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/meta/Head.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1838
+ const $$Astro$a = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/meta/Head.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1839
+ const $$Head = createComponent(async ($$result, $$props, $$slots) => {
1840
+ const Astro2 = $$result.createAstro($$Astro$a, $$props, $$slots);
1841
+ Astro2.self = $$Head;
1842
+ return renderTemplate`<meta charset="UTF-8">
1843
+ <meta name="viewport" content="width=device-width">
1844
+ <link rel="icon" type="image/x-icon" href="/favicon.ico">
1845
+ `;
1846
+ });
1847
+
1848
+ const $$file$a = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/meta/Head.astro";
1849
+ const $$url$a = undefined;
1850
+
1520
1851
  const $$module2$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1521
1852
  __proto__: null,
1522
- default: getConfig
1853
+ $$metadata: $$metadata$a,
1854
+ default: $$Head,
1855
+ file: $$file$a,
1856
+ url: $$url$a
1523
1857
  }, Symbol.toStringTag, { value: 'Module' }));
1524
1858
 
1525
1859
  var __freeze = Object.freeze;
1526
1860
  var __defProp = Object.defineProperty;
1527
1861
  var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
1528
1862
  var _a;
1529
- const $$metadata$5 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", { modules: [{ module: $$module2$1, specifier: "../../storefront.config.mjs", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1530
- const $$Astro$5 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1863
+ const $$metadata$9 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/meta/Json.astro", { modules: [{ module: $$module2$2, specifier: "../../ssr-context", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1864
+ const $$Astro$9 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/meta/Json.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1865
+ const $$Json = createComponent(async ($$result, $$props, $$slots) => {
1866
+ const Astro2 = $$result.createAstro($$Astro$9, $$props, $$slots);
1867
+ Astro2.self = $$Json;
1868
+ const {
1869
+ storeId,
1870
+ lang,
1871
+ countryCode,
1872
+ currency,
1873
+ currencySymbol,
1874
+ domain,
1875
+ settings
1876
+ } = getConfig();
1877
+ const inlineClientJS = `
1878
+ window._settings = ${JSON.stringify({
1879
+ ...settings,
1880
+ store_id: storeId,
1881
+ lang,
1882
+ country_code: countryCode,
1883
+ currency,
1884
+ currency_symbol: currencySymbol
1885
+ })};`;
1886
+ const inlineJSONLd = JSON.stringify({
1887
+ "@context": "http://schema.org",
1888
+ "@type": "Organization",
1889
+ name: settings.name,
1890
+ url: `https://${domain}/`,
1891
+ logo: `https://${domain}${settings.logo}`
1892
+ });
1893
+ return renderTemplate(_a || (_a = __template(["<script>", '<\/script>\n<script type="application/ld+json">', "<\/script>\n"])), markHTMLString(inlineClientJS), markHTMLString(inlineJSONLd));
1894
+ });
1895
+
1896
+ const $$file$9 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/meta/Json.astro";
1897
+ const $$url$9 = undefined;
1898
+
1899
+ const $$module3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1900
+ __proto__: null,
1901
+ $$metadata: $$metadata$9,
1902
+ default: $$Json,
1903
+ file: $$file$9,
1904
+ url: $$url$9
1905
+ }, Symbol.toStringTag, { value: 'Module' }));
1906
+
1907
+ const _sfc_main = {
1908
+ setup() {
1909
+ const count = ref(0);
1910
+ const add = () => {
1911
+ count.value += 1;
1912
+ };
1913
+ const subtract = () => {
1914
+ count.value -= 1;
1915
+ };
1916
+ return {
1917
+ count,
1918
+ add,
1919
+ subtract
1920
+ };
1921
+ }
1922
+ };
1923
+
1924
+ const _export_sfc = (sfc, props) => {
1925
+ const target = sfc.__vccOpts || sfc;
1926
+ for (const [key, val] of props) {
1927
+ target[key] = val;
1928
+ }
1929
+ return target;
1930
+ };
1931
+
1932
+ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1933
+ _push(`<!--[--><div class="counter"><button>-</button><pre>${ssrInterpolate($setup.count)}</pre><button>+</button></div><div class="counter-message">`);
1934
+ ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
1935
+ _push(`</div><div id="firebaseui-auth-container"></div><!--]-->`);
1936
+ }
1937
+ const _sfc_setup = _sfc_main.setup;
1938
+ _sfc_main.setup = (props, ctx) => {
1939
+ const ssrContext = useSSRContext();
1940
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/LoginModal.vue");
1941
+ return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
1942
+ };
1943
+ const LoginModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
1944
+
1945
+ const $$module4 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1946
+ __proto__: null,
1947
+ default: LoginModal
1948
+ }, Symbol.toStringTag, { value: 'Module' }));
1949
+
1950
+ const $$metadata$8 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Layout.astro", { modules: [{ module: $$module2$2, specifier: "../ssr-context", assert: {} }, { module: $$module2$1, specifier: "./meta/Head.astro", assert: {} }, { module: $$module3, specifier: "./meta/Json.astro", assert: {} }, { module: $$module4, specifier: "../components/LoginModal.vue", assert: {} }], hydratedComponents: [LoginModal], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set(["idle"]), hoisted: [{ type: "inline", value: `
1951
+ // Import Firebase in compat version for Auth UI
1952
+ // https://github.com/firebase/firebaseui-web#starting-the-sign-in-flow
1953
+ import firebase from "firebase/compat/app";
1954
+ import { getAnalytics } from "firebase/analytics";
1955
+ // @ts-ignore
1956
+ const firebaseConfig = window.firebaseConfig || {
1957
+ apiKey: "AIzaSyCrVzemDgpyp9i6ni7Yc5ZuEVfXYwl-4J0",
1958
+ authDomain: "ecom2-002.firebaseapp.com",
1959
+ projectId: "ecom2-002",
1960
+ storageBucket: "ecom2-002.appspot.com",
1961
+ messagingSenderId: "402807248219",
1962
+ appId: "1:402807248219:web:cf7d57759751e74776367e",
1963
+ measurementId: "G-SC592CE0GB"
1964
+ };
1965
+ // @ts-ignore
1966
+ window.firebase = firebase;
1967
+ const app = firebase.initializeApp(firebaseConfig);
1968
+ const analytics = getAnalytics(app);
1969
+ ` }] });
1970
+ const $$Astro$8 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Layout.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1531
1971
  const $$Layout = createComponent(async ($$result, $$props, $$slots) => {
1532
- const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
1972
+ const Astro2 = $$result.createAstro($$Astro$8, $$props, $$slots);
1533
1973
  Astro2.self = $$Layout;
1534
- const { title } = Astro2.props;
1535
1974
  const { lang } = getConfig();
1975
+ const { title } = Astro2.props;
1536
1976
  const STYLES = [];
1537
1977
  for (const STYLE of STYLES)
1538
1978
  $$result.styles.add(STYLE);
1539
- return renderTemplate(_a || (_a = __template(['<html lang="en" class="astro-DEZ7DR5X">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width">\n <link rel="icon" type="image/x-icon" href="/favicon.ico">\n <title>', `</title>
1540
- <link rel="stylesheet" media="print" onload="this.media='all'" href="https://www.gstatic.com/firebasejs/ui/6.0.1/firebase-ui-auth.css">
1541
- `, '</head>\n<body class="astro-DEZ7DR5X">\n ', '\n <script async type="text/partytown"', "><\/script>\n</body>\n</html>\n\n"])), title, renderHead($$result), renderSlot($$result, $$slots["default"]), addAttribute(`https://www.gstatic.com/firebasejs/ui/6.0.1/firebase-ui-auth__${lang}.js`, "src"));
1979
+ return renderTemplate`<html${addAttribute(lang.replace("_", "-"), "lang")} class="astro-6MFH5UJ4">
1980
+ <head>
1981
+ ${renderComponent($$result, "MetaHead", $$Head, { "class": "astro-6MFH5UJ4" })}
1982
+ <title>${title}</title>
1983
+ ${renderHead($$result)}</head>
1984
+ <body class="astro-6MFH5UJ4">
1985
+ ${renderComponent($$result, "LoginModal", LoginModal, { "client:idle": true, "client:component-hydration": "idle", "client:component-path": "/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/LoginModal.vue", "client:component-export": "default", "class": "astro-6MFH5UJ4" })}
1986
+ ${renderSlot($$result, $$slots["default"])}
1987
+ ${renderComponent($$result, "MetaJson", $$Json, { "class": "astro-6MFH5UJ4" })}
1988
+ ${renderSlot($$result, $$slots["firebase-init"])}
1989
+ </body>
1990
+ </html>
1991
+
1992
+ `;
1542
1993
  });
1543
1994
 
1544
- const $$file$5 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro";
1545
- const $$url$5 = undefined;
1995
+ const $$file$8 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Layout.astro";
1996
+ const $$url$8 = undefined;
1546
1997
 
1547
- const $$module3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1998
+ const $$module1$3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1548
1999
  __proto__: null,
1549
- $$metadata: $$metadata$5,
2000
+ $$metadata: $$metadata$8,
1550
2001
  default: $$Layout,
1551
- file: $$file$5,
1552
- url: $$url$5
2002
+ file: $$file$8,
2003
+ url: $$url$8
1553
2004
  }, Symbol.toStringTag, { value: 'Module' }));
1554
2005
 
1555
- const $$metadata$4 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1556
- const $$Astro$4 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
2006
+ const $$metadata$7 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/Card.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
2007
+ const $$Astro$7 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/Card.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1557
2008
  const $$Card = createComponent(async ($$result, $$props, $$slots) => {
1558
- const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
2009
+ const Astro2 = $$result.createAstro($$Astro$7, $$props, $$slots);
1559
2010
  Astro2.self = $$Card;
1560
2011
  const { href, title, body } = Astro2.props;
1561
2012
  const STYLES = [];
1562
2013
  for (const STYLE of STYLES)
1563
2014
  $$result.styles.add(STYLE);
1564
- return renderTemplate`${maybeRenderHead($$result)}<li class="link-card astro-ASCHB54V">
1565
- <a${addAttribute(href, "href")} class="astro-ASCHB54V">
1566
- <h2 class="astro-ASCHB54V">
2015
+ return renderTemplate`${maybeRenderHead($$result)}<li class="link-card astro-ZCG72YVN">
2016
+ <a${addAttribute(href, "href")} class="astro-ZCG72YVN">
2017
+ <h2 class="astro-ZCG72YVN">
1567
2018
  ${title}
1568
- <span class="astro-ASCHB54V">&rarr;</span>
2019
+ <span class="astro-ZCG72YVN">&rarr;</span>
1569
2020
  </h2>
1570
- <p class="astro-ASCHB54V">
2021
+ <p class="astro-ZCG72YVN">
1571
2022
  ${body}
1572
2023
  </p>
1573
2024
  </a>
@@ -1575,41 +2026,41 @@ const $$Card = createComponent(async ($$result, $$props, $$slots) => {
1575
2026
  `;
1576
2027
  });
1577
2028
 
1578
- const $$file$4 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro";
1579
- const $$url$4 = undefined;
2029
+ const $$file$7 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/Card.astro";
2030
+ const $$url$7 = undefined;
1580
2031
 
1581
2032
  const $$module2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1582
2033
  __proto__: null,
1583
- $$metadata: $$metadata$4,
2034
+ $$metadata: $$metadata$7,
1584
2035
  default: $$Card,
1585
- file: $$file$4,
1586
- url: $$url$4
2036
+ file: $$file$7,
2037
+ url: $$url$7
1587
2038
  }, Symbol.toStringTag, { value: 'Module' }));
1588
2039
 
1589
- const $$metadata$3 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1590
- const $$Astro$3 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1591
- const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
1592
- const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
1593
- Astro2.self = $$Index$1;
2040
+ const $$metadata$6 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/index.astro", { modules: [{ module: $$module1$4, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module1$3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
2041
+ const $$Astro$6 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
2042
+ const $$Index$2 = createComponent(async ($$result, $$props, $$slots) => {
2043
+ const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
2044
+ Astro2.self = $$Index$2;
1594
2045
  const products = (await api.get("products")).data.result;
1595
2046
  const STYLES = [];
1596
2047
  for (const STYLE of STYLES)
1597
2048
  $$result.styles.add(STYLE);
1598
- return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "Welcome to Astro.", "class": "astro-C3E44E3K" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-C3E44E3K">
1599
- <h1 class="astro-C3E44E3K">Welcome to <span class="text-gradient astro-C3E44E3K">Astro</span></h1>
1600
- <p class="instructions astro-C3E44E3K">
1601
- Check out the <code class="astro-C3E44E3K">src/pages</code> directory to get started.<br class="astro-C3E44E3K">
1602
- <strong class="astro-C3E44E3K">Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
2049
+ return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "Welcome to Astro.", "class": "astro-EBY2X3Y6" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-EBY2X3Y6">
2050
+ <h1 class="astro-EBY2X3Y6">Welcome to <span class="text-gradient astro-EBY2X3Y6">Astro</span></h1>
2051
+ <p class="instructions astro-EBY2X3Y6">
2052
+ Check out the <code class="astro-EBY2X3Y6">src/pages</code> directory to get started.<br class="astro-EBY2X3Y6">
2053
+ <strong class="astro-EBY2X3Y6">Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
1603
2054
  </p>
1604
- <ul role="list" class="link-card-grid astro-C3E44E3K">
1605
- ${renderComponent($$result, "Card", $$Card, { "href": "https://docs.astro.build/", "title": "Documentation", "body": "Learn how Astro works and explore the official API docs.", "class": "astro-C3E44E3K" })}
1606
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/integrations/", "title": "Integrations", "body": "Supercharge your project with new frameworks and libraries.", "class": "astro-C3E44E3K" })}
1607
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/themes/", "title": "Themes", "body": "Explore a galaxy of community-built starter themes.", "class": "astro-C3E44E3K" })}
1608
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/chat/", "title": "Chat", "body": "Come say hi to our amazing Discord community. \u2764\uFE0F", "class": "astro-C3E44E3K" })}
2055
+ <ul role="list" class="link-card-grid astro-EBY2X3Y6">
2056
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://docs.astro.build/", "title": "Documentation", "body": "Learn how Astro works and explore the official API docs.", "class": "astro-EBY2X3Y6" })}
2057
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/integrations/", "title": "Integrations", "body": "Supercharge your project with new frameworks and libraries.", "class": "astro-EBY2X3Y6" })}
2058
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/themes/", "title": "Themes", "body": "Explore a galaxy of community-built starter themes.", "class": "astro-EBY2X3Y6" })}
2059
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/chat/", "title": "Chat", "body": "Come say hi to our amazing Discord community. \u2764\uFE0F", "class": "astro-EBY2X3Y6" })}
1609
2060
  </ul>
1610
- <ul role="list" class="mt-3 fs-20 astro-C3E44E3K">
1611
- ${products.map((product) => renderTemplate`<li class="astro-C3E44E3K">
1612
- <a${addAttribute(`/${product.slug}`, "href")} class="astro-C3E44E3K">${product.sku}</a>
2061
+ <ul role="list" class="mt-3 fs-20 astro-EBY2X3Y6">
2062
+ ${products.map((product) => renderTemplate`<li class="astro-EBY2X3Y6">
2063
+ <a${addAttribute(`/${product.slug}`, "href")} class="astro-EBY2X3Y6">${product.sku}</a>
1613
2064
  </li>`)}
1614
2065
  </ul>
1615
2066
  </main>` })}
@@ -1617,107 +2068,184 @@ const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
1617
2068
  `;
1618
2069
  });
1619
2070
 
1620
- const $$file$3 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro";
1621
- const $$url$3 = "";
2071
+ const $$file$6 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/index.astro";
2072
+ const $$url$6 = undefined;
1622
2073
 
1623
- const _page0 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2074
+ const $$module1$2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1624
2075
  __proto__: null,
1625
- $$metadata: $$metadata$3,
2076
+ $$metadata: $$metadata$6,
2077
+ default: $$Index$2,
2078
+ file: $$file$6,
2079
+ url: $$url$6
2080
+ }, Symbol.toStringTag, { value: 'Module' }));
2081
+
2082
+ const $$metadata$5 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", { modules: [{ module: $$module1$2, specifier: "../lib/views/index.astro", assert: {} }, { module: $$module2$2, specifier: "../lib/ssr-context", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
2083
+ const $$Astro$5 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
2084
+ const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
2085
+ const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
2086
+ Astro2.self = $$Index$1;
2087
+ let pageContext;
2088
+ let loadError;
2089
+ try {
2090
+ pageContext = await loadPageContext(Astro2);
2091
+ } catch (err) {
2092
+ if (err.astroResponse) {
2093
+ return err.astroResponse;
2094
+ }
2095
+ loadError = err;
2096
+ }
2097
+ return renderTemplate`${pageContext && renderTemplate`${renderComponent($$result, "ViewHome", $$Index$2, { "pageContext": pageContext })}`}
2098
+ ${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": () => renderTemplate`${markHTMLString(loadError.responseHTML)}` })}`}`;
2099
+ });
2100
+
2101
+ const $$file$5 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro";
2102
+ const $$url$5 = "";
2103
+
2104
+ const _page1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2105
+ __proto__: null,
2106
+ $$metadata: $$metadata$5,
1626
2107
  default: $$Index$1,
1627
- file: $$file$3,
1628
- url: $$url$3
2108
+ file: $$file$5,
2109
+ url: $$url$5
1629
2110
  }, Symbol.toStringTag, { value: 'Module' }));
1630
2111
 
1631
- const $$metadata$2 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro", { modules: [{ module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1632
- const $$Astro$2 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1633
- const $$404 = createComponent(async ($$result, $$props, $$slots) => {
1634
- const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
1635
- Astro2.self = $$404;
2112
+ const $$metadata$4 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/fallback.astro", { modules: [{ module: $$module1$3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
2113
+ const $$Astro$4 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/fallback.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
2114
+ const $$Fallback$1 = createComponent(async ($$result, $$props, $$slots) => {
2115
+ const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
2116
+ Astro2.self = $$Fallback$1;
1636
2117
  const STYLES = [];
1637
2118
  for (const STYLE of STYLES)
1638
2119
  $$result.styles.add(STYLE);
1639
- return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "Welcome to Astro.", "class": "astro-7FYMG5AV" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-7FYMG5AV">
1640
- <h1 class="astro-7FYMG5AV">404</h1>
1641
- <p class="instructions astro-7FYMG5AV">
1642
- Check out the <code class="astro-7FYMG5AV">src/pages</code> directory to get started.<br class="astro-7FYMG5AV">
1643
- <strong class="astro-7FYMG5AV">Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
2120
+ return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "Welcome to Astro.", "class": "astro-BZIQPEHV" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-BZIQPEHV">
2121
+ <h1 class="astro-BZIQPEHV">Error :/</h1>
2122
+ <p class="instructions astro-BZIQPEHV">
2123
+ Check out the <code class="astro-BZIQPEHV">src/pages</code> directory to get started.<br class="astro-BZIQPEHV">
2124
+ <strong class="astro-BZIQPEHV">Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
1644
2125
  </p>
1645
- <ul role="list" class="link-card-grid astro-7FYMG5AV">
1646
- ${renderComponent($$result, "Card", $$Card, { "href": "https://docs.astro.build/", "title": "Documentation", "body": "Learn how Astro works and explore the official API docs.", "class": "astro-7FYMG5AV" })}
1647
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/integrations/", "title": "Integrations", "body": "Supercharge your project with new frameworks and libraries.", "class": "astro-7FYMG5AV" })}
1648
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/themes/", "title": "Themes", "body": "Explore a galaxy of community-built starter themes.", "class": "astro-7FYMG5AV" })}
1649
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/chat/", "title": "Chat", "body": "Come say hi to our amazing Discord community. \u2764\uFE0F", "class": "astro-7FYMG5AV" })}
2126
+ <ul role="list" class="link-card-grid astro-BZIQPEHV">
2127
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://docs.astro.build/", "title": "Documentation", "body": "Learn how Astro works and explore the official API docs.", "class": "astro-BZIQPEHV" })}
2128
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/integrations/", "title": "Integrations", "body": "Supercharge your project with new frameworks and libraries.", "class": "astro-BZIQPEHV" })}
2129
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/themes/", "title": "Themes", "body": "Explore a galaxy of community-built starter themes.", "class": "astro-BZIQPEHV" })}
2130
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/chat/", "title": "Chat", "body": "Come say hi to our amazing Discord community. \u2764\uFE0F", "class": "astro-BZIQPEHV" })}
1650
2131
  </ul>
1651
2132
  </main>` })}
1652
2133
 
1653
2134
  `;
1654
2135
  });
1655
2136
 
1656
- const $$file$2 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro";
1657
- const $$url$2 = "/404";
2137
+ const $$file$4 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/fallback.astro";
2138
+ const $$url$4 = undefined;
1658
2139
 
1659
- const _page1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2140
+ const $$module1$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2141
+ __proto__: null,
2142
+ $$metadata: $$metadata$4,
2143
+ default: $$Fallback$1,
2144
+ file: $$file$4,
2145
+ url: $$url$4
2146
+ }, Symbol.toStringTag, { value: 'Module' }));
2147
+
2148
+ const $$metadata$3 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/fallback.astro", { modules: [{ module: $$module1$1, specifier: "../lib/views/fallback.astro", assert: {} }, { module: $$module2$2, specifier: "../lib/ssr-context", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
2149
+ const $$Astro$3 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/fallback.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
2150
+ const $$Fallback = createComponent(async ($$result, $$props, $$slots) => {
2151
+ const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
2152
+ Astro2.self = $$Fallback;
2153
+ let pageContext;
2154
+ try {
2155
+ pageContext = await loadPageContext(Astro2);
2156
+ } catch (err) {
2157
+ return err.astroResponse;
2158
+ }
2159
+ return renderTemplate`${renderComponent($$result, "ViewFallback", $$Fallback$1, { "pageContext": pageContext })}`;
2160
+ });
2161
+
2162
+ const $$file$3 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/fallback.astro";
2163
+ const $$url$3 = "/fallback";
2164
+
2165
+ const _page2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2166
+ __proto__: null,
2167
+ $$metadata: $$metadata$3,
2168
+ default: $$Fallback,
2169
+ file: $$file$3,
2170
+ url: $$url$3
2171
+ }, Symbol.toStringTag, { value: 'Module' }));
2172
+
2173
+ const $$metadata$2 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
2174
+ const $$Astro$2 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
2175
+ const $$Index = createComponent(async ($$result, $$props, $$slots) => {
2176
+ const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
2177
+ Astro2.self = $$Index;
2178
+ return renderTemplate``;
2179
+ });
2180
+
2181
+ const $$file$2 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro";
2182
+ const $$url$2 = "/app";
2183
+
2184
+ const _page3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1660
2185
  __proto__: null,
1661
2186
  $$metadata: $$metadata$2,
1662
- default: $$404,
2187
+ default: $$Index,
1663
2188
  file: $$file$2,
1664
2189
  url: $$url$2
1665
2190
  }, Symbol.toStringTag, { value: 'Module' }));
1666
2191
 
1667
- const $$metadata$1 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1668
- const $$Astro$1 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1669
- const $$Index = createComponent(async ($$result, $$props, $$slots) => {
2192
+ const $$metadata$1 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/[...slug].astro", { modules: [{ module: $$module1$3, specifier: "../layouts/Layout.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
2193
+ const $$Astro$1 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/[...slug].astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
2194
+ const $$$1 = createComponent(async ($$result, $$props, $$slots) => {
1670
2195
  const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
1671
- Astro2.self = $$Index;
1672
- return renderTemplate``;
2196
+ Astro2.self = $$$1;
2197
+ const { pageContext } = Astro2.props;
2198
+ const { apiResource, apiDoc } = pageContext;
2199
+ const STYLES = [];
2200
+ for (const STYLE of STYLES)
2201
+ $$result.styles.add(STYLE);
2202
+ return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": apiDoc.name, "class": "astro-P5QKJ2WB" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-P5QKJ2WB">
2203
+ <h1 class="astro-P5QKJ2WB">Hello <span class="text-gradient astro-P5QKJ2WB">${apiDoc.name}</span></h1>
2204
+ <hr class="astro-P5QKJ2WB">
2205
+ <div class="mt-3 astro-P5QKJ2WB">
2206
+ <mark class="astro-P5QKJ2WB">${apiDoc._id}</mark> from <i class="astro-P5QKJ2WB">${apiResource}</i>
2207
+ <p class="astro-P5QKJ2WB">${Math.random()}</p>
2208
+ <em class="astro-P5QKJ2WB">Lorem ipsum dolor sit amet</em>
2209
+ </div>
2210
+ </main>` })}
2211
+
2212
+ `;
1673
2213
  });
1674
2214
 
1675
- const $$file$1 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro";
1676
- const $$url$1 = "/app";
2215
+ const $$file$1 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/views/[...slug].astro";
2216
+ const $$url$1 = undefined;
1677
2217
 
1678
- const _page2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2218
+ const $$module1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1679
2219
  __proto__: null,
1680
2220
  $$metadata: $$metadata$1,
1681
- default: $$Index,
2221
+ default: $$$1,
1682
2222
  file: $$file$1,
1683
2223
  url: $$url$1
1684
2224
  }, Symbol.toStringTag, { value: 'Module' }));
1685
2225
 
1686
- const $$metadata = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module2$1, specifier: "../../storefront.config.mjs", assert: {} }, { module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
2226
+ const $$metadata = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", { modules: [{ module: $$module1, specifier: "../lib/views/[...slug].astro", assert: {} }, { module: $$module2$2, specifier: "../lib/ssr-context", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1687
2227
  const $$Astro = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1688
2228
  const $$ = createComponent(async ($$result, $$props, $$slots) => {
1689
2229
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
1690
2230
  Astro2.self = $$;
1691
- const { slug } = Astro2.params;
1692
- let resource;
1693
- let doc;
2231
+ let pageContext;
2232
+ let loadError;
1694
2233
  try {
1695
- const { data } = await api.get(`slugs/${slug}`, { fetch });
1696
- resource = data.resource;
1697
- doc = data.doc;
1698
- } catch {
1699
- return Astro2.redirect(`/404?url=${encodeURIComponent(`/${slug}`)}`);
2234
+ pageContext = await loadPageContext(Astro2);
2235
+ } catch (err) {
2236
+ if (err.astroResponse) {
2237
+ return err.astroResponse;
2238
+ }
2239
+ loadError = err;
1700
2240
  }
1701
- const STYLES = [];
1702
- for (const STYLE of STYLES)
1703
- $$result.styles.add(STYLE);
1704
- return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": doc.name, "class": "astro-WWHJ5KDF" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-WWHJ5KDF">
1705
- <h1 class="astro-WWHJ5KDF">Hello <span class="text-gradient astro-WWHJ5KDF">${doc.name}</span></h1>
1706
- <hr class="astro-WWHJ5KDF">
1707
- <div class="mt-3 astro-WWHJ5KDF">
1708
- <mark class="astro-WWHJ5KDF">${doc._id}</mark> from <i class="astro-WWHJ5KDF">${resource}</i>
1709
- <p class="astro-WWHJ5KDF">${Math.random()}</p>
1710
- <em class="astro-WWHJ5KDF">Lorem ipsum dolor sit amet</em>
1711
- </div>
1712
- </main>` })}
1713
-
1714
- `;
2241
+ return renderTemplate`${pageContext && renderTemplate`${renderComponent($$result, "ViewWildcard", $$$1, { "pageContext": pageContext })}`}
2242
+ ${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": () => renderTemplate`${markHTMLString(loadError.responseHTML)}` })}`}`;
1715
2243
  });
1716
2244
 
1717
2245
  const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro";
1718
2246
  const $$url = "/[...slug]";
1719
2247
 
1720
- const _page3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2248
+ const _page4 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1721
2249
  __proto__: null,
1722
2250
  $$metadata,
1723
2251
  default: $$,
@@ -1725,7 +2253,7 @@ const _page3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1725
2253
  url: $$url
1726
2254
  }, Symbol.toStringTag, { value: 'Module' }));
1727
2255
 
1728
- const pageMap = new Map([['src/pages/index.astro', _page0],['src/pages/404.astro', _page1],['src/pages/app/index.astro', _page2],['src/pages/[...slug].astro', _page3],]);
2256
+ const pageMap = new Map([['../../node_modules/.pnpm/@astrojs+image@0.7.0/node_modules/@astrojs/image/dist/endpoint.js', _page0],['src/pages/index.astro', _page1],['src/pages/fallback.astro', _page2],['src/pages/app/index.astro', _page3],['src/pages/[...slug].astro', _page4],]);
1729
2257
  const renderers = [Object.assign({"name":"astro:jsx","serverEntrypoint":"astro/jsx/server.js","jsxImportSource":"astro"}, { ssr: server_default }),Object.assign({"name":"@astrojs/vue","clientEntrypoint":"@astrojs/vue/client.js","serverEntrypoint":"@astrojs/vue/server.js"}, { ssr: _renderer1 }),];
1730
2258
 
1731
2259
  if (typeof process !== "undefined") {
@@ -1797,7 +2325,7 @@ function deserializeManifest(serializedManifest) {
1797
2325
  };
1798
2326
  }
1799
2327
 
1800
- const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":["assets/404-_...d4aa8aff.css","assets/404-index.d9230d24.css","assets/index.53a3a3e0.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/404-_...d4aa8aff.css","assets/404-index.d9230d24.css","assets/404.530428e5.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/404","type":"page","pattern":"^\\/404\\/?$","segments":[[{"content":"404","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/404.astro","pathname":"/404","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/404-_...d4aa8aff.css","assets/_...98510c96.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","_meta":{"trailingSlash":"ignore"}}}],"site":"https://storefront-demo.e-com.plus/","base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"extendDefaultPlugins":false,"isAstroFlavoredMd":false},"pageMap":null,"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","@astrojs/vue/client.js":"client.6d48c590.js","astro:scripts/page.js":"page.3aa82516.js","astro:scripts/before-hydration.js":"data:text/javascript;charset=utf-8,//[no before-hydration script]"},"assets":["/assets/404.530428e5.css","/assets/404-_...d4aa8aff.css","/assets/404-index.d9230d24.css","/assets/_...98510c96.css","/assets/index.53a3a3e0.css","/client.6d48c590.js","/favicon.ico","/page.3aa82516.js","/page.3aa82516.js","/~partytown/partytown-atomics.js","/~partytown/partytown-media.js","/~partytown/partytown-sw.js","/~partytown/partytown.js"]}), {
2328
+ const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.7.0/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/_...b3f65c5c.css","assets/fallback-index.90217cf0.css","assets/index.c5a9ea80.css"],"scripts":[{"type":"external","value":"hoisted.24787260.js"},{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/_...b3f65c5c.css","assets/fallback-index.90217cf0.css","assets/fallback.9cd2ed3f.css"],"scripts":[{"type":"external","value":"hoisted.24787260.js"},{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/fallback","type":"page","pattern":"^\\/fallback\\/?$","segments":[[{"content":"fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/fallback.astro","pathname":"/fallback","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/_...b3f65c5c.css","assets/_...27b7eb4d.css"],"scripts":[{"type":"external","value":"hoisted.24787260.js"},{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","_meta":{"trailingSlash":"ignore"}}}],"site":"https://storefront-demo.e-com.plus/","base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"extendDefaultPlugins":false,"isAstroFlavoredMd":false},"pageMap":null,"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/LoginModal.vue":"LoginModal.d6b935cf.js","@astrojs/vue/client.js":"client.80b904f3.js","/astro/hoisted.js?q=0":"hoisted.24787260.js","astro:scripts/page.js":"page.3aa82516.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/assets/firebaseui.css?used":"chunks/firebaseui.f82af21f.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/.pnpm/firebase@9.9.4/node_modules/firebase/compat/auth/dist/index.esm.js":"chunks/index.esm.69f70489.js","astro:scripts/before-hydration.js":"data:text/javascript;charset=utf-8,//[no before-hydration script]"},"assets":["/assets/_...27b7eb4d.css","/assets/_...b3f65c5c.css","/assets/fallback.9cd2ed3f.css","/assets/fallback-index.90217cf0.css","/assets/index.c5a9ea80.css","/LoginModal.d6b935cf.js","/client.80b904f3.js","/favicon.ico","/hoisted.24787260.js","/page.3aa82516.js","/chunks/index.esm.69f70489.js","/chunks/index.esm2017.1194d1a1.js","/chunks/runtime-core.esm-bundler.a7337834.js","/page.3aa82516.js","/~partytown/partytown-atomics.js","/~partytown/partytown-media.js","/~partytown/partytown-sw.js","/~partytown/partytown.js"]}), {
1801
2329
  pageMap: pageMap,
1802
2330
  renderers: renderers
1803
2331
  });