cloudcommerce 2.6.3 → 2.6.4

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 (155) hide show
  1. package/.github/workflows/test-apps.yml +1 -1
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +2 -0
  4. package/ecomplus-stores/barradoce/functions/many/package.json +3 -3
  5. package/ecomplus-stores/barradoce/functions/ssr/content/reviews.json +71 -0
  6. package/ecomplus-stores/barradoce/functions/ssr/content/types.d.ts +5 -0
  7. package/ecomplus-stores/barradoce/functions/ssr/package.json +6 -6
  8. package/ecomplus-stores/barradoce/functions/ssr/src/env.d.ts +1 -0
  9. package/ecomplus-stores/barradoce/functions/with-apps/package.json +3 -3
  10. package/ecomplus-stores/barradoce/package.json +2 -2
  11. package/package.json +7 -7
  12. package/packages/api/package.json +1 -1
  13. package/packages/apps/affiliate-program/package.json +1 -1
  14. package/packages/apps/correios/package.json +1 -1
  15. package/packages/apps/custom-payment/package.json +1 -1
  16. package/packages/apps/custom-shipping/package.json +1 -1
  17. package/packages/apps/datafrete/package.json +1 -1
  18. package/packages/apps/discounts/package.json +1 -1
  19. package/packages/apps/emails/package.json +1 -1
  20. package/packages/apps/fb-conversions/package.json +1 -1
  21. package/packages/apps/flash-courier/package.json +1 -1
  22. package/packages/apps/frenet/package.json +1 -1
  23. package/packages/apps/galaxpay/package.json +1 -1
  24. package/packages/apps/google-analytics/package.json +1 -1
  25. package/packages/apps/jadlog/package.json +1 -1
  26. package/packages/apps/loyalty-points/package.json +1 -1
  27. package/packages/apps/mandae/package.json +1 -1
  28. package/packages/apps/melhor-envio/package.json +1 -1
  29. package/packages/apps/mercadopago/package.json +1 -1
  30. package/packages/apps/pagarme/package.json +2 -2
  31. package/packages/apps/pagarme-v5/package.json +1 -1
  32. package/packages/apps/paghiper/package.json +1 -1
  33. package/packages/apps/pix/package.json +1 -1
  34. package/packages/apps/tiny-erp/package.json +1 -1
  35. package/packages/apps/webhooks/package.json +1 -1
  36. package/packages/cli/package.json +2 -2
  37. package/packages/config/package.json +1 -1
  38. package/packages/emails/package.json +2 -2
  39. package/packages/eslint/package.json +6 -6
  40. package/packages/events/package.json +1 -1
  41. package/packages/feeds/package.json +1 -1
  42. package/packages/firebase/package.json +2 -2
  43. package/packages/i18n/package.json +1 -1
  44. package/packages/modules/package.json +1 -1
  45. package/packages/passport/package.json +1 -1
  46. package/packages/ssr/lib/lib/cron-ssr-save-views.js +2 -1
  47. package/packages/ssr/lib/lib/cron-ssr-save-views.js.map +1 -1
  48. package/packages/ssr/package.json +4 -4
  49. package/packages/ssr/src/lib/cron-ssr-save-views.ts +2 -1
  50. package/packages/storefront/dist/client/_astro/AccountPage.B4WZaOzX.js +1 -0
  51. package/packages/storefront/dist/client/_astro/CartSidebar.DAGdpIcU.js +1 -0
  52. package/packages/storefront/dist/client/_astro/HeroSlider.Dq_9kcdU.js +1 -0
  53. package/packages/storefront/dist/client/_astro/PitchBar.BwLlIs6F.js +1 -0
  54. package/packages/storefront/dist/client/_astro/Prices.BgHTq5id.js +1 -0
  55. package/packages/storefront/dist/client/_astro/ProductDetails.CnYNdPl5.js +7 -0
  56. package/packages/storefront/dist/client/_astro/ProductShelf.kfADQTUO.js +1 -0
  57. package/packages/storefront/dist/client/_astro/SearchModal.DcmvABes.js +1 -0
  58. package/packages/storefront/dist/client/_astro/SearchShowcase.C9GWwOnF.js +1 -0
  59. package/packages/storefront/dist/client/_astro/ShippingCalculator.DE01D7dt.js +1 -0
  60. package/packages/storefront/dist/client/_astro/ShopHeader.Cf4t6O6z.js +7 -0
  61. package/packages/storefront/dist/client/_astro/_commonjsHelpers.Cpj98o6Y.js +1 -0
  62. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.CBemkWnU.js +5 -0
  63. package/packages/storefront/dist/client/_astro/{_slug_.4W7qhV-L.css → _slug_.DX_OkMX7.css} +1 -1
  64. package/packages/storefront/dist/client/_astro/{afetch.OifQZgwR.js → afetch.DPLba2tr.js} +1 -1
  65. package/packages/storefront/dist/client/_astro/client.CdXC84C5.js +1 -0
  66. package/packages/storefront/dist/client/_astro/customer-session.CNe1heRH.js +7 -0
  67. package/packages/storefront/dist/client/_astro/{firebase-app.iLdzDVjL.js → firebase-app.CBckq0Sj.js} +1 -1
  68. package/packages/storefront/dist/client/_astro/{format-money.1_HtF5S2.js → format-money.DINpWB0x.js} +1 -1
  69. package/packages/storefront/dist/client/_astro/grid-title.D4m7-g3h.js +1 -0
  70. package/packages/storefront/dist/client/_astro/hoisted.B2rH1xwX.js +8 -0
  71. package/packages/storefront/dist/client/_astro/hoisted.DBPXHTEb.js +1 -0
  72. package/packages/storefront/dist/client/_astro/hoisted.EBqhuD5o.js +1 -0
  73. package/packages/storefront/dist/client/_astro/{hoisted.GaT7bmE3.js → hoisted.ut_nNM_H.js} +1 -1
  74. package/packages/storefront/dist/client/_astro/i18n.B3skIOFg.js +1 -0
  75. package/packages/storefront/dist/client/_astro/img-sizes.rFK7so02.js +1 -0
  76. package/packages/storefront/dist/client/_astro/img.D5a6GzeE.js +1 -0
  77. package/packages/storefront/dist/client/_astro/index.CFw6O-Kt.js +1 -0
  78. package/packages/storefront/dist/client/_astro/index.DBfgCyd-.js +1 -0
  79. package/packages/storefront/dist/client/_astro/{modules-info.HP6478mG.js → modules-info.BHKiT6oA.js} +1 -1
  80. package/packages/storefront/dist/client/_astro/name.BZA9xqh-.js +1 -0
  81. package/packages/storefront/dist/client/_astro/photoswipe.esm.C0FT-EY-.js +4 -0
  82. package/packages/storefront/dist/client/_astro/price.CHiL6Z1J.js +1 -0
  83. package/packages/storefront/dist/client/_astro/sf-utils.Cigv01cN.js +13 -0
  84. package/packages/storefront/dist/client/_astro/shopping-cart.D-w8Z-4p.js +1 -0
  85. package/packages/storefront/dist/client/_astro/use-analytics.CQDdNgwF.js +1 -0
  86. package/packages/storefront/dist/client/_astro/use-cms-preview.4Hq7LCmA.js +1 -0
  87. package/packages/storefront/dist/client/_astro/use-product-card.CQRlRsNX.js +1 -0
  88. package/packages/storefront/dist/client/_astro/use-text-value.UjCYLWjm.js +4 -0
  89. package/packages/storefront/dist/client/img/uploads/logo.png +0 -0
  90. package/packages/storefront/dist/server/chunks/{CartSidebar_3_1aFp67.mjs → CartSidebar_BmwcZuxv.mjs} +36 -4
  91. package/packages/storefront/dist/server/chunks/{SearchModal_2azP1u7P.mjs → SearchModal_BvEnUvAx.mjs} +4 -3
  92. package/packages/storefront/dist/server/chunks/_.._DORZHe_Z.mjs +5 -0
  93. package/packages/storefront/dist/server/chunks/{_page__qqIVxbal.mjs → _page__DU3kNewy.mjs} +1 -1
  94. package/packages/storefront/dist/server/chunks/{account_vK6pmJlz.mjs → account_CaTloREf.mjs} +1 -1
  95. package/packages/storefront/dist/server/chunks/astro/{assets-service_631fRtTy.mjs → assets-service_B77Hm2ue.mjs} +2 -2
  96. package/packages/storefront/dist/server/chunks/{astro_u-oSb215.mjs → astro_ISB6VLqs.mjs} +178 -59
  97. package/packages/storefront/dist/server/chunks/index_BTDpenpc.mjs +5 -0
  98. package/packages/storefront/dist/server/chunks/index_D0q4ab_n.mjs +5 -0
  99. package/packages/storefront/dist/server/chunks/{node_zqXXqc-u.mjs → node_C7sdLKL4.mjs} +1 -1
  100. package/packages/storefront/dist/server/chunks/pages/{__ZucPYaOo.mjs → __B4CsSrck.mjs} +1751 -344
  101. package/packages/storefront/dist/server/chunks/pages/{_page__0sN9U0SD.mjs → _page__sb5Idhgp.mjs} +2 -3
  102. package/packages/storefront/dist/server/chunks/pages/{account_OQr_6KN1.mjs → account_iWjHfkwu.mjs} +2 -3
  103. package/packages/storefront/dist/server/chunks/pages/{index_3IjgOEIq.mjs → index_BZlpKBRL.mjs} +41 -4
  104. package/packages/storefront/dist/server/chunks/pages/node_GFu-CQ19.mjs +852 -0
  105. package/packages/storefront/dist/server/chunks/pages/{~fallback_133FK-CP.mjs → ~fallback_C07rzeay.mjs} +2 -3
  106. package/packages/storefront/dist/server/chunks/{index__05fnqFh.mjs → ~fallback_YpJa9BIL.mjs} +1 -1
  107. package/packages/storefront/dist/server/entry.mjs +751 -912
  108. package/packages/storefront/dist/server/manifest_KFjAaJaC.mjs +201 -0
  109. package/packages/storefront/dist/server/renderers.mjs +1 -1
  110. package/packages/storefront/package.json +6 -6
  111. package/packages/storefront/src/lib/content.d.ts +4 -1
  112. package/packages/storefront/src/lib/custom-content.d.ts +9 -0
  113. package/packages/storefront/src/lib/ssr-context.ts +6 -4
  114. package/packages/test-base/package.json +1 -1
  115. package/packages/types/package.json +1 -1
  116. package/packages/storefront/dist/client/_astro/AccountPage.0M6_FdU6.js +0 -1
  117. package/packages/storefront/dist/client/_astro/CartSidebar.L0Vbhsdt.js +0 -1
  118. package/packages/storefront/dist/client/_astro/HeroSlider.ju9TsLrJ.js +0 -1
  119. package/packages/storefront/dist/client/_astro/PitchBar.yqD9ycx5.js +0 -1
  120. package/packages/storefront/dist/client/_astro/Prices.xI1rdM1e.js +0 -1
  121. package/packages/storefront/dist/client/_astro/ProductDetails.FQtM5kpd.js +0 -7
  122. package/packages/storefront/dist/client/_astro/ProductShelf.-4fsYkPB.js +0 -1
  123. package/packages/storefront/dist/client/_astro/ProductShelf.GAAhKdTN.js +0 -1
  124. package/packages/storefront/dist/client/_astro/QuantitySelector.v7L8EYOR.js +0 -1
  125. package/packages/storefront/dist/client/_astro/SearchModal.rasg5jV6.js +0 -1
  126. package/packages/storefront/dist/client/_astro/SearchShowcase.kA6jICYo.js +0 -1
  127. package/packages/storefront/dist/client/_astro/ShopHeader.v_L96Y90.js +0 -7
  128. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.xATGHWd9.js +0 -5
  129. package/packages/storefront/dist/client/_astro/client.YJ00ta5M.js +0 -1
  130. package/packages/storefront/dist/client/_astro/customer-session.ZD6tLDQJ.js +0 -7
  131. package/packages/storefront/dist/client/_astro/grid-title.pK2Nn3i-.js +0 -1
  132. package/packages/storefront/dist/client/_astro/hoisted.ICXGWNEA.js +0 -1
  133. package/packages/storefront/dist/client/_astro/hoisted.XOXTrHqn.js +0 -1
  134. package/packages/storefront/dist/client/_astro/i18n.zhlBzJt8.js +0 -1
  135. package/packages/storefront/dist/client/_astro/img-sizes.gxAI9JNh.js +0 -1
  136. package/packages/storefront/dist/client/_astro/img.AnjeGdy_.js +0 -1
  137. package/packages/storefront/dist/client/_astro/index.KfrHdfOH.js +0 -1
  138. package/packages/storefront/dist/client/_astro/index.ShNlAyu1.js +0 -1
  139. package/packages/storefront/dist/client/_astro/name.VA3MEpe0.js +0 -1
  140. package/packages/storefront/dist/client/_astro/photoswipe.esm.Ylh9TGkz.js +0 -4
  141. package/packages/storefront/dist/client/_astro/price.Easct8WC.js +0 -1
  142. package/packages/storefront/dist/client/_astro/sf-utils.c42cbZ9W.js +0 -13
  143. package/packages/storefront/dist/client/_astro/shopping-cart.nSNNOrp9.js +0 -1
  144. package/packages/storefront/dist/client/_astro/use-analytics.wTmoP8B1.js +0 -1
  145. package/packages/storefront/dist/client/_astro/use-product-card.UFr8SCuD.js +0 -1
  146. package/packages/storefront/dist/client/_astro/use-text-value.lKqoIagH.js +0 -4
  147. package/packages/storefront/dist/server/chunks/_.._19fCuQdO.mjs +0 -5
  148. package/packages/storefront/dist/server/chunks/pages/node_OmjWRf8D.mjs +0 -112
  149. package/packages/storefront/dist/server/chunks/~fallback_Wahcp9Wk.mjs +0 -5
  150. package/packages/storefront/dist/server/manifest_9FASPYUE.mjs +0 -202
  151. /package/packages/storefront/dist/client/_astro/{index-bea2a320.eWykogwr.js → index-bea2a320.CHELEM8n.js} +0 -0
  152. /package/packages/storefront/dist/client/_astro/{photoswipe-lightbox.esm.dZBqKD9u.js → photoswipe-lightbox.esm.BbYxSZIB.js} +0 -0
  153. /package/packages/storefront/dist/client/_astro/{photoswipe.0V7m2jWu.js → photoswipe.CNpEZKfy.js} +0 -0
  154. /package/packages/storefront/dist/client/_astro/{server-data.4C60Esyt.js → server-data.CUHTES8a.js} +0 -0
  155. /package/packages/storefront/dist/server/chunks/{photoswipe_IcWDJiwc.mjs → photoswipe_wusPJBJF.mjs} +0 -0
@@ -1,22 +1,21 @@
1
1
  import { img, imgSizes, i18n, formatMoney, price, randomObjectId, nickname, inStock, gridTitle, categoriesList, name, onPromotion, variationsGrids, specTextValue, specValueByText } from '@ecomplus/utils';
2
2
  import '@astrojs/internal-helpers/path';
3
- import { A as AstroError, c as ExpectedImageOptions, E as ExpectedImage, d as InvalidImageService, e as createAstro, f as createComponent, g as ImageMissingAlt, r as renderTemplate, m as maybeRenderHead, h as addAttribute, s as spreadAttributes, u as unescapeHTML, i as renderComponent, j as createTransitionScope, k as renderSlotToString, l as renderAllHeadContent, n as renderSlot$1, F as Fragment } from '../astro_u-oSb215.mjs';
3
+ import { A as AstroError, c as ExpectedImageOptions, E as ExpectedImage, F as FailedToFetchRemoteImageDimensions, d as InvalidImageService, e as createAstro, f as createComponent, g as ImageMissingAlt, r as renderTemplate, m as maybeRenderHead, h as addAttribute, s as spreadAttributes, u as unescapeHTML, i as renderComponent, j as createTransitionScope, k as renderSlotToString, l as renderAllHeadContent, n as renderSlot$1, o as Fragment } from '../astro_ISB6VLqs.mjs';
4
4
  import 'kleur/colors';
5
- import 'cssesc';
6
5
  import api from '@cloudcommerce/api';
7
6
  import { EventEmitter } from 'node:events';
8
- import { useSSRContext, defineComponent, computed, createVNode, resolveDynamicComponent, mergeProps, withCtx, renderSlot, inject, ref, watch, toRef, onMounted, onBeforeUnmount, provide, getCurrentInstance, reactive, shallowRef, resolveComponent, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, nextTick, withModifiers, Teleport, createTextVNode, toDisplayString, defineAsyncComponent, vModelText, Suspense, createSlots, shallowReactive, withAsyncContext, vModelRadio } from 'vue';
7
+ import { useSSRContext, defineComponent, computed, createVNode, resolveDynamicComponent, mergeProps, withCtx, renderSlot, inject, ref, watch, toRef, onMounted, onBeforeUnmount, provide, getCurrentInstance, reactive, shallowRef, resolveComponent, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, mergeModels, useModel, nextTick, withModifiers, Teleport, createTextVNode, toDisplayString, defineAsyncComponent, vModelText, Suspense, createSlots, shallowReactive, withAsyncContext, vModelRadio } from 'vue';
9
8
  import fs, { copyFileSync } from 'node:fs';
10
9
  import { resolve, join, basename as basename$1 } from 'node:path';
11
10
  import { parse } from 'yaml';
12
11
  import config from '@cloudcommerce/config';
13
12
  import 'clsx';
14
13
  /* empty css */
15
- import { renderSync, parse as parse$1, ELEMENT_NODE, walkSync } from 'ultrahtml';
14
+ import { renderSync, parse as parse$1, walkSync, ELEMENT_NODE } from 'ultrahtml';
16
15
  import mime from 'mime/lite.js';
17
- import { i as isESMImportedImage, a as isLocalService, b as isRemoteImage, D as DEFAULT_HASH_PROPS } from '../astro/assets-service_631fRtTy.mjs';
16
+ import { i as isRemoteImage, a as isESMImportedImage, b as isLocalService, D as DEFAULT_HASH_PROPS } from '../astro/assets-service_B77Hm2ue.mjs';
18
17
  import imageSize from 'image-size';
19
- import { ssrRenderSlotInner, ssrRenderVNode, ssrRenderSlot, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate, ssrRenderSuspense, ssrLooseEqual } from 'vue/server-renderer';
18
+ import { ssrRenderSlotInner, ssrRenderVNode, ssrRenderSlot, ssrRenderAttrs, ssrRenderClass, ssrRenderList, ssrRenderComponent, ssrRenderStyle, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate, ssrRenderSuspense, ssrLooseEqual } from 'vue/server-renderer';
20
19
  import { useScroll, useElementHover, useDebounceFn, watchDebounced, useTimeout, promiseTimeout, watchOnce, onClickOutside, useUrlSearchParams, createReusableTemplate } from '@vueuse/core';
21
20
  import mitt from 'mitt';
22
21
  import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem, Listbox, ListboxButton, ListboxOptions, ListboxOption } from '@headlessui/vue';
@@ -30,7 +29,7 @@ const _export_sfc = (sfc, props) => {
30
29
  return target;
31
30
  };
32
31
 
33
- const _sfc_main$G = /* @__PURE__ */ defineComponent({
32
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
34
33
  __name: "Fade",
35
34
  props: {
36
35
  speed: { default: "default" },
@@ -165,18 +164,18 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
165
164
  return __returned__;
166
165
  }
167
166
  });
168
- function _sfc_ssrRender$G(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
167
+ function _sfc_ssrRender$H(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
169
168
  ssrRenderSlotInner(_ctx.$slots, "default", {}, null, _push, _parent, null, true);
170
169
  }
171
- const _sfc_setup$G = _sfc_main$G.setup;
172
- _sfc_main$G.setup = (props, ctx) => {
170
+ const _sfc_setup$H = _sfc_main$H.setup;
171
+ _sfc_main$H.setup = (props, ctx) => {
173
172
  const ssrContext = useSSRContext();
174
173
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/globals/Fade.vue");
175
- return _sfc_setup$G ? _sfc_setup$G(props, ctx) : void 0;
174
+ return _sfc_setup$H ? _sfc_setup$H(props, ctx) : void 0;
176
175
  };
177
- const Fade = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["ssrRender", _sfc_ssrRender$G]]);
176
+ const Fade = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["ssrRender", _sfc_ssrRender$H]]);
178
177
 
179
- const _sfc_main$F = /* @__PURE__ */ defineComponent({
178
+ const _sfc_main$G = /* @__PURE__ */ defineComponent({
180
179
  __name: "ALink",
181
180
  props: {
182
181
  href: {},
@@ -203,7 +202,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
203
202
  return __returned__;
204
203
  }
205
204
  });
206
- function _sfc_ssrRender$F(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
205
+ function _sfc_ssrRender$G(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
207
206
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.href ? "a" : "span"), mergeProps({
208
207
  href: $props.href,
209
208
  target: $setup.linkTarget,
@@ -221,15 +220,15 @@ function _sfc_ssrRender$F(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
221
220
  _: 3
222
221
  }), _parent);
223
222
  }
224
- const _sfc_setup$F = _sfc_main$F.setup;
225
- _sfc_main$F.setup = (props, ctx) => {
223
+ const _sfc_setup$G = _sfc_main$G.setup;
224
+ _sfc_main$G.setup = (props, ctx) => {
226
225
  const ssrContext = useSSRContext();
227
226
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/globals/ALink.vue");
228
- return _sfc_setup$F ? _sfc_setup$F(props, ctx) : void 0;
227
+ return _sfc_setup$G ? _sfc_setup$G(props, ctx) : void 0;
229
228
  };
230
- const ALink = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["ssrRender", _sfc_ssrRender$F]]);
229
+ const ALink = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["ssrRender", _sfc_ssrRender$G]]);
231
230
 
232
- const _sfc_main$E = /* @__PURE__ */ defineComponent({
231
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
233
232
  __name: "AImg",
234
233
  props: {
235
234
  picture: {},
@@ -263,23 +262,24 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
263
262
  return __returned__;
264
263
  }
265
264
  });
266
- function _sfc_ssrRender$E(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
265
+ function _sfc_ssrRender$F(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
267
266
  _push(`<img${ssrRenderAttrs(mergeProps($setup.attrs, _attrs))}>`);
268
267
  }
269
- const _sfc_setup$E = _sfc_main$E.setup;
270
- _sfc_main$E.setup = (props, ctx) => {
268
+ const _sfc_setup$F = _sfc_main$F.setup;
269
+ _sfc_main$F.setup = (props, ctx) => {
271
270
  const ssrContext = useSSRContext();
272
271
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/globals/AImg.vue");
273
- return _sfc_setup$E ? _sfc_setup$E(props, ctx) : void 0;
272
+ return _sfc_setup$F ? _sfc_setup$F(props, ctx) : void 0;
274
273
  };
275
- const AImg = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["ssrRender", _sfc_ssrRender$E]]);
274
+ const AImg = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["ssrRender", _sfc_ssrRender$F]]);
276
275
 
277
- const rowClassName = "bg-gray-200 rounded-md dark:bg-gray-700";
278
- const _sfc_main$D = /* @__PURE__ */ defineComponent({
276
+ const rowClassName = "bg-base-200 rounded-md";
277
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
279
278
  __name: "Skeleton",
280
279
  props: {
281
280
  isBold: { type: Boolean },
282
- isLarge: { type: Boolean }
281
+ isLarge: { type: Boolean },
282
+ numRows: { default: 6 }
283
283
  },
284
284
  setup(__props, { expose: __expose }) {
285
285
  __expose();
@@ -295,19 +295,44 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
295
295
  return __returned__;
296
296
  }
297
297
  });
298
- function _sfc_ssrRender$D(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
298
+ function _sfc_ssrRender$E(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
299
299
  _push(`<div${ssrRenderAttrs(mergeProps({
300
300
  role: "status",
301
301
  class: ["animate-pulse", $props.isLarge ? "max-w-4xl" : "max-w-sm"]
302
- }, _attrs))}><div class="${ssrRenderClass([$setup.firstRowClassName, $props.isLarge ? "w-96" : "w-48"])}"></div><div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[680px]" : "max-w-[340px]"])}"></div><div class="${ssrRenderClass($setup.nextRowsClassName)}"></div><div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[660px]" : "max-w-[330px]"])}"></div><div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[600px]" : "max-w-[300px]"])}"></div><div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[720px]" : "max-w-[360px]"])}"></div><span class="sr-only">Loading...</span></div>`);
302
+ }, _attrs))}><div class="${ssrRenderClass([$setup.firstRowClassName, $props.isLarge ? "w-96" : "w-48"])}"></div>`);
303
+ if ($props.numRows > 1) {
304
+ _push(`<div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[680px]" : "max-w-[340px]"])}"></div>`);
305
+ } else {
306
+ _push(`<!---->`);
307
+ }
308
+ if ($props.numRows > 2) {
309
+ _push(`<div class="${ssrRenderClass($setup.nextRowsClassName)}"></div>`);
310
+ } else {
311
+ _push(`<!---->`);
312
+ }
313
+ if ($props.numRows > 3) {
314
+ _push(`<div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[660px]" : "max-w-[330px]"])}"></div>`);
315
+ } else {
316
+ _push(`<!---->`);
317
+ }
318
+ if ($props.numRows > 4) {
319
+ _push(`<div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[600px]" : "max-w-[300px]"])}"></div>`);
320
+ } else {
321
+ _push(`<!---->`);
322
+ }
323
+ _push(`<!--[-->`);
324
+ ssrRenderList($props.numRows - 5, (n) => {
325
+ _push(`<div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[720px]" : "max-w-[360px]"])}"></div>`);
326
+ });
327
+ _push(`<!--]--><span class="sr-only">Loading...</span></div>`);
303
328
  }
304
- const _sfc_setup$D = _sfc_main$D.setup;
305
- _sfc_main$D.setup = (props, ctx) => {
329
+ const _sfc_setup$E = _sfc_main$E.setup;
330
+ _sfc_main$E.setup = (props, ctx) => {
306
331
  const ssrContext = useSSRContext();
307
332
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/globals/Skeleton.vue");
308
- return _sfc_setup$D ? _sfc_setup$D(props, ctx) : void 0;
333
+ return _sfc_setup$E ? _sfc_setup$E(props, ctx) : void 0;
309
334
  };
310
- const Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["ssrRender", _sfc_ssrRender$D]]);
335
+ const Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["ssrRender", _sfc_ssrRender$E]]);
311
336
 
312
337
  if (!globalThis.__sfIds)
313
338
  globalThis.__sfIds = {};
@@ -366,7 +391,7 @@ const createApp$1 = (app) => {
366
391
  app.component("Skeleton", Skeleton);
367
392
  };
368
393
 
369
- const _sfc_main$C = /* @__PURE__ */ defineComponent({
394
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
370
395
  __name: "CarouselControl",
371
396
  props: {
372
397
  isPrev: { type: Boolean, default: false }
@@ -380,7 +405,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
380
405
  return __returned__;
381
406
  }
382
407
  });
383
- function _sfc_ssrRender$C(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
408
+ function _sfc_ssrRender$D(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
384
409
  _push(`<button${ssrRenderAttrs(mergeProps({
385
410
  type: "button",
386
411
  "aria-label": !$props.isPrev ? "Pr\xF3ximo" : "Anterior",
@@ -397,16 +422,16 @@ function _sfc_ssrRender$C(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
397
422
  }, _push, _parent);
398
423
  _push(`</button>`);
399
424
  }
400
- const _sfc_setup$C = _sfc_main$C.setup;
401
- _sfc_main$C.setup = (props, ctx) => {
425
+ const _sfc_setup$D = _sfc_main$D.setup;
426
+ _sfc_main$D.setup = (props, ctx) => {
402
427
  const ssrContext = useSSRContext();
403
428
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CarouselControl.vue");
404
- return _sfc_setup$C ? _sfc_setup$C(props, ctx) : void 0;
429
+ return _sfc_setup$D ? _sfc_setup$D(props, ctx) : void 0;
405
430
  };
406
- const CarouselControl = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["ssrRender", _sfc_ssrRender$C]]);
431
+ const CarouselControl = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["ssrRender", _sfc_ssrRender$D]]);
407
432
 
408
433
  const carouselKey = Symbol("carousel");
409
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
434
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
410
435
  __name: "Carousel",
411
436
  props: {
412
437
  as: { default: "ul" },
@@ -588,7 +613,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
588
613
  return __returned__;
589
614
  }
590
615
  });
591
- function _sfc_ssrRender$B(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
616
+ function _sfc_ssrRender$C(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
592
617
  _push(`<div${ssrRenderAttrs(mergeProps({
593
618
  ref: "carousel",
594
619
  class: `relative ${!$setup.isX ? "overflow-hidden" : ""}`,
@@ -652,13 +677,13 @@ function _sfc_ssrRender$B(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
652
677
  }, _push, _parent);
653
678
  _push(`</div>`);
654
679
  }
655
- const _sfc_setup$B = _sfc_main$B.setup;
656
- _sfc_main$B.setup = (props, ctx) => {
680
+ const _sfc_setup$C = _sfc_main$C.setup;
681
+ _sfc_main$C.setup = (props, ctx) => {
657
682
  const ssrContext = useSSRContext();
658
683
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Carousel.vue");
659
- return _sfc_setup$B ? _sfc_setup$B(props, ctx) : void 0;
684
+ return _sfc_setup$C ? _sfc_setup$C(props, ctx) : void 0;
660
685
  };
661
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["ssrRender", _sfc_ssrRender$B]]);
686
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["ssrRender", _sfc_ssrRender$C]]);
662
687
 
663
688
  const createApp = (app) => {
664
689
  createApp$1(app);
@@ -671,11 +696,823 @@ const mod = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
671
696
  default: createApp
672
697
  }, Symbol.toStringTag, { value: 'Module' }));
673
698
 
699
+ const decoder = new TextDecoder();
700
+ const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
701
+ const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + ("0" + i.toString(16)).slice(-2), "");
702
+ const readInt16LE = (input, offset = 0) => {
703
+ const val = input[offset] + input[offset + 1] * 2 ** 8;
704
+ return val | (val & 2 ** 15) * 131070;
705
+ };
706
+ const readUInt16BE = (input, offset = 0) => input[offset] * 2 ** 8 + input[offset + 1];
707
+ const readUInt16LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8;
708
+ const readUInt24LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16;
709
+ const readInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + (input[offset + 3] << 24);
710
+ const readUInt32BE = (input, offset = 0) => input[offset] * 2 ** 24 + input[offset + 1] * 2 ** 16 + input[offset + 2] * 2 ** 8 + input[offset + 3];
711
+ const readUInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + input[offset + 3] * 2 ** 24;
712
+ const methods = {
713
+ readUInt16BE,
714
+ readUInt16LE,
715
+ readUInt32BE,
716
+ readUInt32LE
717
+ };
718
+ function readUInt(input, bits, offset, isBigEndian) {
719
+ offset = offset || 0;
720
+ const endian = isBigEndian ? "BE" : "LE";
721
+ const methodName = "readUInt" + bits + endian;
722
+ return methods[methodName](input, offset);
723
+ }
724
+ function readBox(buffer, offset) {
725
+ if (buffer.length - offset < 4)
726
+ return;
727
+ const boxSize = readUInt32BE(buffer, offset);
728
+ if (buffer.length - offset < boxSize)
729
+ return;
730
+ return {
731
+ name: toUTF8String(buffer, 4 + offset, 8 + offset),
732
+ offset,
733
+ size: boxSize
734
+ };
735
+ }
736
+ function findBox(buffer, boxName, offset) {
737
+ while (offset < buffer.length) {
738
+ const box = readBox(buffer, offset);
739
+ if (!box)
740
+ break;
741
+ if (box.name === boxName)
742
+ return box;
743
+ offset += box.size;
744
+ }
745
+ }
746
+
747
+ const BMP = {
748
+ validate: (input) => toUTF8String(input, 0, 2) === "BM",
749
+ calculate: (input) => ({
750
+ height: Math.abs(readInt32LE(input, 22)),
751
+ width: readUInt32LE(input, 18)
752
+ })
753
+ };
754
+
755
+ const TYPE_ICON = 1;
756
+ const SIZE_HEADER$1 = 2 + 2 + 2;
757
+ const SIZE_IMAGE_ENTRY = 1 + 1 + 1 + 1 + 2 + 2 + 4 + 4;
758
+ function getSizeFromOffset(input, offset) {
759
+ const value = input[offset];
760
+ return value === 0 ? 256 : value;
761
+ }
762
+ function getImageSize$1(input, imageIndex) {
763
+ const offset = SIZE_HEADER$1 + imageIndex * SIZE_IMAGE_ENTRY;
764
+ return {
765
+ height: getSizeFromOffset(input, offset + 1),
766
+ width: getSizeFromOffset(input, offset)
767
+ };
768
+ }
769
+ const ICO = {
770
+ validate(input) {
771
+ const reserved = readUInt16LE(input, 0);
772
+ const imageCount = readUInt16LE(input, 4);
773
+ if (reserved !== 0 || imageCount === 0)
774
+ return false;
775
+ const imageType = readUInt16LE(input, 2);
776
+ return imageType === TYPE_ICON;
777
+ },
778
+ calculate(input) {
779
+ const nbImages = readUInt16LE(input, 4);
780
+ const imageSize = getImageSize$1(input, 0);
781
+ if (nbImages === 1)
782
+ return imageSize;
783
+ const imgs = [imageSize];
784
+ for (let imageIndex = 1; imageIndex < nbImages; imageIndex += 1) {
785
+ imgs.push(getImageSize$1(input, imageIndex));
786
+ }
787
+ return {
788
+ height: imageSize.height,
789
+ images: imgs,
790
+ width: imageSize.width
791
+ };
792
+ }
793
+ };
794
+
795
+ const TYPE_CURSOR = 2;
796
+ const CUR = {
797
+ validate(input) {
798
+ const reserved = readUInt16LE(input, 0);
799
+ const imageCount = readUInt16LE(input, 4);
800
+ if (reserved !== 0 || imageCount === 0)
801
+ return false;
802
+ const imageType = readUInt16LE(input, 2);
803
+ return imageType === TYPE_CURSOR;
804
+ },
805
+ calculate: (input) => ICO.calculate(input)
806
+ };
807
+
808
+ const DDS = {
809
+ validate: (input) => readUInt32LE(input, 0) === 542327876,
810
+ calculate: (input) => ({
811
+ height: readUInt32LE(input, 12),
812
+ width: readUInt32LE(input, 16)
813
+ })
814
+ };
815
+
816
+ const gifRegexp = /^GIF8[79]a/;
817
+ const GIF = {
818
+ validate: (input) => gifRegexp.test(toUTF8String(input, 0, 6)),
819
+ calculate: (input) => ({
820
+ height: readUInt16LE(input, 8),
821
+ width: readUInt16LE(input, 6)
822
+ })
823
+ };
824
+
825
+ const brandMap = {
826
+ avif: "avif",
827
+ mif1: "heif",
828
+ msf1: "heif",
829
+ // hief-sequence
830
+ heic: "heic",
831
+ heix: "heic",
832
+ hevc: "heic",
833
+ // heic-sequence
834
+ hevx: "heic"
835
+ // heic-sequence
836
+ };
837
+ function detectBrands(buffer, start, end) {
838
+ let brandsDetected = {};
839
+ for (let i = start; i <= end; i += 4) {
840
+ const brand = toUTF8String(buffer, i, i + 4);
841
+ if (brand in brandMap) {
842
+ brandsDetected[brand] = 1;
843
+ }
844
+ }
845
+ if ("avif" in brandsDetected) {
846
+ return "avif";
847
+ } else if ("heic" in brandsDetected || "heix" in brandsDetected || "hevc" in brandsDetected || "hevx" in brandsDetected) {
848
+ return "heic";
849
+ } else if ("mif1" in brandsDetected || "msf1" in brandsDetected) {
850
+ return "heif";
851
+ }
852
+ }
853
+ const HEIF = {
854
+ validate(buffer) {
855
+ const ftype = toUTF8String(buffer, 4, 8);
856
+ const brand = toUTF8String(buffer, 8, 12);
857
+ return "ftyp" === ftype && brand in brandMap;
858
+ },
859
+ calculate(buffer) {
860
+ const metaBox = findBox(buffer, "meta", 0);
861
+ const iprpBox = metaBox && findBox(buffer, "iprp", metaBox.offset + 12);
862
+ const ipcoBox = iprpBox && findBox(buffer, "ipco", iprpBox.offset + 8);
863
+ const ispeBox = ipcoBox && findBox(buffer, "ispe", ipcoBox.offset + 8);
864
+ if (ispeBox) {
865
+ return {
866
+ height: readUInt32BE(buffer, ispeBox.offset + 16),
867
+ width: readUInt32BE(buffer, ispeBox.offset + 12),
868
+ type: detectBrands(buffer, 8, metaBox.offset)
869
+ };
870
+ }
871
+ throw new TypeError("Invalid HEIF, no size found");
872
+ }
873
+ };
874
+
875
+ const SIZE_HEADER = 4 + 4;
876
+ const FILE_LENGTH_OFFSET = 4;
877
+ const ENTRY_LENGTH_OFFSET = 4;
878
+ const ICON_TYPE_SIZE = {
879
+ ICON: 32,
880
+ "ICN#": 32,
881
+ // m => 16 x 16
882
+ "icm#": 16,
883
+ icm4: 16,
884
+ icm8: 16,
885
+ // s => 16 x 16
886
+ "ics#": 16,
887
+ ics4: 16,
888
+ ics8: 16,
889
+ is32: 16,
890
+ s8mk: 16,
891
+ icp4: 16,
892
+ // l => 32 x 32
893
+ icl4: 32,
894
+ icl8: 32,
895
+ il32: 32,
896
+ l8mk: 32,
897
+ icp5: 32,
898
+ ic11: 32,
899
+ // h => 48 x 48
900
+ ich4: 48,
901
+ ich8: 48,
902
+ ih32: 48,
903
+ h8mk: 48,
904
+ // . => 64 x 64
905
+ icp6: 64,
906
+ ic12: 32,
907
+ // t => 128 x 128
908
+ it32: 128,
909
+ t8mk: 128,
910
+ ic07: 128,
911
+ // . => 256 x 256
912
+ ic08: 256,
913
+ ic13: 256,
914
+ // . => 512 x 512
915
+ ic09: 512,
916
+ ic14: 512,
917
+ // . => 1024 x 1024
918
+ ic10: 1024
919
+ };
920
+ function readImageHeader(input, imageOffset) {
921
+ const imageLengthOffset = imageOffset + ENTRY_LENGTH_OFFSET;
922
+ return [
923
+ toUTF8String(input, imageOffset, imageLengthOffset),
924
+ readUInt32BE(input, imageLengthOffset)
925
+ ];
926
+ }
927
+ function getImageSize(type) {
928
+ const size = ICON_TYPE_SIZE[type];
929
+ return { width: size, height: size, type };
930
+ }
931
+ const ICNS = {
932
+ validate: (input) => toUTF8String(input, 0, 4) === "icns",
933
+ calculate(input) {
934
+ const inputLength = input.length;
935
+ const fileLength = readUInt32BE(input, FILE_LENGTH_OFFSET);
936
+ let imageOffset = SIZE_HEADER;
937
+ let imageHeader = readImageHeader(input, imageOffset);
938
+ let imageSize = getImageSize(imageHeader[0]);
939
+ imageOffset += imageHeader[1];
940
+ if (imageOffset === fileLength)
941
+ return imageSize;
942
+ const result = {
943
+ height: imageSize.height,
944
+ images: [imageSize],
945
+ width: imageSize.width
946
+ };
947
+ while (imageOffset < fileLength && imageOffset < inputLength) {
948
+ imageHeader = readImageHeader(input, imageOffset);
949
+ imageSize = getImageSize(imageHeader[0]);
950
+ imageOffset += imageHeader[1];
951
+ result.images.push(imageSize);
952
+ }
953
+ return result;
954
+ }
955
+ };
956
+
957
+ const J2C = {
958
+ // TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
959
+ validate: (input) => toHexString(input, 0, 4) === "ff4fff51",
960
+ calculate: (input) => ({
961
+ height: readUInt32BE(input, 12),
962
+ width: readUInt32BE(input, 8)
963
+ })
964
+ };
965
+
966
+ const JP2 = {
967
+ validate(input) {
968
+ if (readUInt32BE(input, 4) !== 1783636e3 || readUInt32BE(input, 0) < 1)
969
+ return false;
970
+ const ftypBox = findBox(input, "ftyp", 0);
971
+ if (!ftypBox)
972
+ return false;
973
+ return readUInt32BE(input, ftypBox.offset + 4) === 1718909296;
974
+ },
975
+ calculate(input) {
976
+ const jp2hBox = findBox(input, "jp2h", 0);
977
+ const ihdrBox = jp2hBox && findBox(input, "ihdr", jp2hBox.offset + 8);
978
+ if (ihdrBox) {
979
+ return {
980
+ height: readUInt32BE(input, ihdrBox.offset + 8),
981
+ width: readUInt32BE(input, ihdrBox.offset + 12)
982
+ };
983
+ }
984
+ throw new TypeError("Unsupported JPEG 2000 format");
985
+ }
986
+ };
987
+
988
+ const EXIF_MARKER = "45786966";
989
+ const APP1_DATA_SIZE_BYTES = 2;
990
+ const EXIF_HEADER_BYTES = 6;
991
+ const TIFF_BYTE_ALIGN_BYTES = 2;
992
+ const BIG_ENDIAN_BYTE_ALIGN = "4d4d";
993
+ const LITTLE_ENDIAN_BYTE_ALIGN = "4949";
994
+ const IDF_ENTRY_BYTES = 12;
995
+ const NUM_DIRECTORY_ENTRIES_BYTES = 2;
996
+ function isEXIF(input) {
997
+ return toHexString(input, 2, 6) === EXIF_MARKER;
998
+ }
999
+ function extractSize(input, index) {
1000
+ return {
1001
+ height: readUInt16BE(input, index),
1002
+ width: readUInt16BE(input, index + 2)
1003
+ };
1004
+ }
1005
+ function extractOrientation(exifBlock, isBigEndian) {
1006
+ const idfOffset = 8;
1007
+ const offset = EXIF_HEADER_BYTES + idfOffset;
1008
+ const idfDirectoryEntries = readUInt(exifBlock, 16, offset, isBigEndian);
1009
+ for (let directoryEntryNumber = 0; directoryEntryNumber < idfDirectoryEntries; directoryEntryNumber++) {
1010
+ const start = offset + NUM_DIRECTORY_ENTRIES_BYTES + directoryEntryNumber * IDF_ENTRY_BYTES;
1011
+ const end = start + IDF_ENTRY_BYTES;
1012
+ if (start > exifBlock.length) {
1013
+ return;
1014
+ }
1015
+ const block = exifBlock.slice(start, end);
1016
+ const tagNumber = readUInt(block, 16, 0, isBigEndian);
1017
+ if (tagNumber === 274) {
1018
+ const dataFormat = readUInt(block, 16, 2, isBigEndian);
1019
+ if (dataFormat !== 3) {
1020
+ return;
1021
+ }
1022
+ const numberOfComponents = readUInt(block, 32, 4, isBigEndian);
1023
+ if (numberOfComponents !== 1) {
1024
+ return;
1025
+ }
1026
+ return readUInt(block, 16, 8, isBigEndian);
1027
+ }
1028
+ }
1029
+ }
1030
+ function validateExifBlock(input, index) {
1031
+ const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index);
1032
+ const byteAlign = toHexString(
1033
+ exifBlock,
1034
+ EXIF_HEADER_BYTES,
1035
+ EXIF_HEADER_BYTES + TIFF_BYTE_ALIGN_BYTES
1036
+ );
1037
+ const isBigEndian = byteAlign === BIG_ENDIAN_BYTE_ALIGN;
1038
+ const isLittleEndian = byteAlign === LITTLE_ENDIAN_BYTE_ALIGN;
1039
+ if (isBigEndian || isLittleEndian) {
1040
+ return extractOrientation(exifBlock, isBigEndian);
1041
+ }
1042
+ }
1043
+ function validateInput(input, index) {
1044
+ if (index > input.length) {
1045
+ throw new TypeError("Corrupt JPG, exceeded buffer limits");
1046
+ }
1047
+ }
1048
+ const JPG = {
1049
+ validate: (input) => toHexString(input, 0, 2) === "ffd8",
1050
+ calculate(input) {
1051
+ input = input.slice(4);
1052
+ let orientation;
1053
+ let next;
1054
+ while (input.length) {
1055
+ const i = readUInt16BE(input, 0);
1056
+ if (input[i] !== 255) {
1057
+ input = input.slice(1);
1058
+ continue;
1059
+ }
1060
+ if (isEXIF(input)) {
1061
+ orientation = validateExifBlock(input, i);
1062
+ }
1063
+ validateInput(input, i);
1064
+ next = input[i + 1];
1065
+ if (next === 192 || next === 193 || next === 194) {
1066
+ const size = extractSize(input, i + 5);
1067
+ if (!orientation) {
1068
+ return size;
1069
+ }
1070
+ return {
1071
+ height: size.height,
1072
+ orientation,
1073
+ width: size.width
1074
+ };
1075
+ }
1076
+ input = input.slice(i + 2);
1077
+ }
1078
+ throw new TypeError("Invalid JPG, no size found");
1079
+ }
1080
+ };
1081
+
1082
+ const KTX = {
1083
+ validate: (input) => {
1084
+ const signature = toUTF8String(input, 1, 7);
1085
+ return ["KTX 11", "KTX 20"].includes(signature);
1086
+ },
1087
+ calculate: (input) => {
1088
+ const type = input[5] === 49 ? "ktx" : "ktx2";
1089
+ const offset = type === "ktx" ? 36 : 20;
1090
+ return {
1091
+ height: readUInt32LE(input, offset + 4),
1092
+ width: readUInt32LE(input, offset),
1093
+ type
1094
+ };
1095
+ }
1096
+ };
1097
+
1098
+ const pngSignature = "PNG\r\n\n";
1099
+ const pngImageHeaderChunkName = "IHDR";
1100
+ const pngFriedChunkName = "CgBI";
1101
+ const PNG = {
1102
+ validate(input) {
1103
+ if (pngSignature === toUTF8String(input, 1, 8)) {
1104
+ let chunkName = toUTF8String(input, 12, 16);
1105
+ if (chunkName === pngFriedChunkName) {
1106
+ chunkName = toUTF8String(input, 28, 32);
1107
+ }
1108
+ if (chunkName !== pngImageHeaderChunkName) {
1109
+ throw new TypeError("Invalid PNG");
1110
+ }
1111
+ return true;
1112
+ }
1113
+ return false;
1114
+ },
1115
+ calculate(input) {
1116
+ if (toUTF8String(input, 12, 16) === pngFriedChunkName) {
1117
+ return {
1118
+ height: readUInt32BE(input, 36),
1119
+ width: readUInt32BE(input, 32)
1120
+ };
1121
+ }
1122
+ return {
1123
+ height: readUInt32BE(input, 20),
1124
+ width: readUInt32BE(input, 16)
1125
+ };
1126
+ }
1127
+ };
1128
+
1129
+ const PNMTypes = {
1130
+ P1: "pbm/ascii",
1131
+ P2: "pgm/ascii",
1132
+ P3: "ppm/ascii",
1133
+ P4: "pbm",
1134
+ P5: "pgm",
1135
+ P6: "ppm",
1136
+ P7: "pam",
1137
+ PF: "pfm"
1138
+ };
1139
+ const handlers = {
1140
+ default: (lines) => {
1141
+ let dimensions = [];
1142
+ while (lines.length > 0) {
1143
+ const line = lines.shift();
1144
+ if (line[0] === "#") {
1145
+ continue;
1146
+ }
1147
+ dimensions = line.split(" ");
1148
+ break;
1149
+ }
1150
+ if (dimensions.length === 2) {
1151
+ return {
1152
+ height: parseInt(dimensions[1], 10),
1153
+ width: parseInt(dimensions[0], 10)
1154
+ };
1155
+ } else {
1156
+ throw new TypeError("Invalid PNM");
1157
+ }
1158
+ },
1159
+ pam: (lines) => {
1160
+ const size = {};
1161
+ while (lines.length > 0) {
1162
+ const line = lines.shift();
1163
+ if (line.length > 16 || line.charCodeAt(0) > 128) {
1164
+ continue;
1165
+ }
1166
+ const [key, value] = line.split(" ");
1167
+ if (key && value) {
1168
+ size[key.toLowerCase()] = parseInt(value, 10);
1169
+ }
1170
+ if (size.height && size.width) {
1171
+ break;
1172
+ }
1173
+ }
1174
+ if (size.height && size.width) {
1175
+ return {
1176
+ height: size.height,
1177
+ width: size.width
1178
+ };
1179
+ } else {
1180
+ throw new TypeError("Invalid PAM");
1181
+ }
1182
+ }
1183
+ };
1184
+ const PNM = {
1185
+ validate: (input) => toUTF8String(input, 0, 2) in PNMTypes,
1186
+ calculate(input) {
1187
+ const signature = toUTF8String(input, 0, 2);
1188
+ const type = PNMTypes[signature];
1189
+ const lines = toUTF8String(input, 3).split(/[\r\n]+/);
1190
+ const handler = handlers[type] || handlers.default;
1191
+ return handler(lines);
1192
+ }
1193
+ };
1194
+
1195
+ const PSD = {
1196
+ validate: (input) => toUTF8String(input, 0, 4) === "8BPS",
1197
+ calculate: (input) => ({
1198
+ height: readUInt32BE(input, 14),
1199
+ width: readUInt32BE(input, 18)
1200
+ })
1201
+ };
1202
+
1203
+ const svgReg = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/;
1204
+ const extractorRegExps = {
1205
+ height: /\sheight=(['"])([^%]+?)\1/,
1206
+ root: svgReg,
1207
+ viewbox: /\sviewBox=(['"])(.+?)\1/i,
1208
+ width: /\swidth=(['"])([^%]+?)\1/
1209
+ };
1210
+ const INCH_CM = 2.54;
1211
+ const units = {
1212
+ in: 96,
1213
+ cm: 96 / INCH_CM,
1214
+ em: 16,
1215
+ ex: 8,
1216
+ m: 96 / INCH_CM * 100,
1217
+ mm: 96 / INCH_CM / 10,
1218
+ pc: 96 / 72 / 12,
1219
+ pt: 96 / 72,
1220
+ px: 1
1221
+ };
1222
+ const unitsReg = new RegExp(
1223
+ // eslint-disable-next-line regexp/prefer-d
1224
+ `^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`
1225
+ );
1226
+ function parseLength(len) {
1227
+ const m = unitsReg.exec(len);
1228
+ if (!m) {
1229
+ return void 0;
1230
+ }
1231
+ return Math.round(Number(m[1]) * (units[m[2]] || 1));
1232
+ }
1233
+ function parseViewbox(viewbox) {
1234
+ const bounds = viewbox.split(" ");
1235
+ return {
1236
+ height: parseLength(bounds[3]),
1237
+ width: parseLength(bounds[2])
1238
+ };
1239
+ }
1240
+ function parseAttributes(root) {
1241
+ const width = root.match(extractorRegExps.width);
1242
+ const height = root.match(extractorRegExps.height);
1243
+ const viewbox = root.match(extractorRegExps.viewbox);
1244
+ return {
1245
+ height: height && parseLength(height[2]),
1246
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
1247
+ viewbox: viewbox && parseViewbox(viewbox[2]),
1248
+ width: width && parseLength(width[2])
1249
+ };
1250
+ }
1251
+ function calculateByDimensions(attrs) {
1252
+ return {
1253
+ height: attrs.height,
1254
+ width: attrs.width
1255
+ };
1256
+ }
1257
+ function calculateByViewbox(attrs, viewbox) {
1258
+ const ratio = viewbox.width / viewbox.height;
1259
+ if (attrs.width) {
1260
+ return {
1261
+ height: Math.floor(attrs.width / ratio),
1262
+ width: attrs.width
1263
+ };
1264
+ }
1265
+ if (attrs.height) {
1266
+ return {
1267
+ height: attrs.height,
1268
+ width: Math.floor(attrs.height * ratio)
1269
+ };
1270
+ }
1271
+ return {
1272
+ height: viewbox.height,
1273
+ width: viewbox.width
1274
+ };
1275
+ }
1276
+ const SVG = {
1277
+ // Scan only the first kilo-byte to speed up the check on larger files
1278
+ validate: (input) => svgReg.test(toUTF8String(input, 0, 1e3)),
1279
+ calculate(input) {
1280
+ const root = toUTF8String(input).match(extractorRegExps.root);
1281
+ if (root) {
1282
+ const attrs = parseAttributes(root[0]);
1283
+ if (attrs.width && attrs.height) {
1284
+ return calculateByDimensions(attrs);
1285
+ }
1286
+ if (attrs.viewbox) {
1287
+ return calculateByViewbox(attrs, attrs.viewbox);
1288
+ }
1289
+ }
1290
+ throw new TypeError("Invalid SVG");
1291
+ }
1292
+ };
1293
+
1294
+ const TGA = {
1295
+ validate(input) {
1296
+ return readUInt16LE(input, 0) === 0 && readUInt16LE(input, 4) === 0;
1297
+ },
1298
+ calculate(input) {
1299
+ return {
1300
+ height: readUInt16LE(input, 14),
1301
+ width: readUInt16LE(input, 12)
1302
+ };
1303
+ }
1304
+ };
1305
+
1306
+ function readIFD(input, isBigEndian) {
1307
+ const ifdOffset = readUInt(input, 32, 4, isBigEndian);
1308
+ return input.slice(ifdOffset + 2);
1309
+ }
1310
+ function readValue(input, isBigEndian) {
1311
+ const low = readUInt(input, 16, 8, isBigEndian);
1312
+ const high = readUInt(input, 16, 10, isBigEndian);
1313
+ return (high << 16) + low;
1314
+ }
1315
+ function nextTag(input) {
1316
+ if (input.length > 24) {
1317
+ return input.slice(12);
1318
+ }
1319
+ }
1320
+ function extractTags(input, isBigEndian) {
1321
+ const tags = {};
1322
+ let temp = input;
1323
+ while (temp && temp.length) {
1324
+ const code = readUInt(temp, 16, 0, isBigEndian);
1325
+ const type = readUInt(temp, 16, 2, isBigEndian);
1326
+ const length = readUInt(temp, 32, 4, isBigEndian);
1327
+ if (code === 0) {
1328
+ break;
1329
+ } else {
1330
+ if (length === 1 && (type === 3 || type === 4)) {
1331
+ tags[code] = readValue(temp, isBigEndian);
1332
+ }
1333
+ temp = nextTag(temp);
1334
+ }
1335
+ }
1336
+ return tags;
1337
+ }
1338
+ function determineEndianness(input) {
1339
+ const signature = toUTF8String(input, 0, 2);
1340
+ if ("II" === signature) {
1341
+ return "LE";
1342
+ } else if ("MM" === signature) {
1343
+ return "BE";
1344
+ }
1345
+ }
1346
+ const signatures = [
1347
+ // '492049', // currently not supported
1348
+ "49492a00",
1349
+ // Little endian
1350
+ "4d4d002a"
1351
+ // Big Endian
1352
+ // '4d4d002a', // BigTIFF > 4GB. currently not supported
1353
+ ];
1354
+ const TIFF = {
1355
+ validate: (input) => signatures.includes(toHexString(input, 0, 4)),
1356
+ calculate(input) {
1357
+ const isBigEndian = determineEndianness(input) === "BE";
1358
+ const ifdBuffer = readIFD(input, isBigEndian);
1359
+ const tags = extractTags(ifdBuffer, isBigEndian);
1360
+ const width = tags[256];
1361
+ const height = tags[257];
1362
+ if (!width || !height) {
1363
+ throw new TypeError("Invalid Tiff. Missing tags");
1364
+ }
1365
+ return { height, width };
1366
+ }
1367
+ };
1368
+
1369
+ function calculateExtended(input) {
1370
+ return {
1371
+ height: 1 + readUInt24LE(input, 7),
1372
+ width: 1 + readUInt24LE(input, 4)
1373
+ };
1374
+ }
1375
+ function calculateLossless(input) {
1376
+ return {
1377
+ height: 1 + ((input[4] & 15) << 10 | input[3] << 2 | (input[2] & 192) >> 6),
1378
+ width: 1 + ((input[2] & 63) << 8 | input[1])
1379
+ };
1380
+ }
1381
+ function calculateLossy(input) {
1382
+ return {
1383
+ height: readInt16LE(input, 8) & 16383,
1384
+ width: readInt16LE(input, 6) & 16383
1385
+ };
1386
+ }
1387
+ const WEBP = {
1388
+ validate(input) {
1389
+ const riffHeader = "RIFF" === toUTF8String(input, 0, 4);
1390
+ const webpHeader = "WEBP" === toUTF8String(input, 8, 12);
1391
+ const vp8Header = "VP8" === toUTF8String(input, 12, 15);
1392
+ return riffHeader && webpHeader && vp8Header;
1393
+ },
1394
+ calculate(input) {
1395
+ const chunkHeader = toUTF8String(input, 12, 16);
1396
+ input = input.slice(20, 30);
1397
+ if (chunkHeader === "VP8X") {
1398
+ const extendedHeader = input[0];
1399
+ const validStart = (extendedHeader & 192) === 0;
1400
+ const validEnd = (extendedHeader & 1) === 0;
1401
+ if (validStart && validEnd) {
1402
+ return calculateExtended(input);
1403
+ } else {
1404
+ throw new TypeError("Invalid WebP");
1405
+ }
1406
+ }
1407
+ if (chunkHeader === "VP8 " && input[0] !== 47) {
1408
+ return calculateLossy(input);
1409
+ }
1410
+ const signature = toHexString(input, 3, 6);
1411
+ if (chunkHeader === "VP8L" && signature !== "9d012a") {
1412
+ return calculateLossless(input);
1413
+ }
1414
+ throw new TypeError("Invalid WebP");
1415
+ }
1416
+ };
1417
+
1418
+ const typeHandlers = /* @__PURE__ */ new Map([
1419
+ ["bmp", BMP],
1420
+ ["cur", CUR],
1421
+ ["dds", DDS],
1422
+ ["gif", GIF],
1423
+ ["heif", HEIF],
1424
+ ["icns", ICNS],
1425
+ ["ico", ICO],
1426
+ ["j2c", J2C],
1427
+ ["jp2", JP2],
1428
+ ["jpg", JPG],
1429
+ ["ktx", KTX],
1430
+ ["png", PNG],
1431
+ ["pnm", PNM],
1432
+ ["psd", PSD],
1433
+ ["svg", SVG],
1434
+ ["tga", TGA],
1435
+ ["tiff", TIFF],
1436
+ ["webp", WEBP]
1437
+ ]);
1438
+ const types = Array.from(typeHandlers.keys());
1439
+
1440
+ const firstBytes = /* @__PURE__ */ new Map([
1441
+ [56, "psd"],
1442
+ [66, "bmp"],
1443
+ [68, "dds"],
1444
+ [71, "gif"],
1445
+ [73, "tiff"],
1446
+ [77, "tiff"],
1447
+ [82, "webp"],
1448
+ [105, "icns"],
1449
+ [137, "png"],
1450
+ [255, "jpg"]
1451
+ ]);
1452
+ function detector(input) {
1453
+ const byte = input[0];
1454
+ const type = firstBytes.get(byte);
1455
+ if (type && typeHandlers.get(type).validate(input)) {
1456
+ return type;
1457
+ }
1458
+ return types.find((fileType) => typeHandlers.get(fileType).validate(input));
1459
+ }
1460
+
1461
+ const globalOptions = {
1462
+ disabledTypes: []
1463
+ };
1464
+ function lookup(input) {
1465
+ const type = detector(input);
1466
+ if (typeof type !== "undefined") {
1467
+ if (globalOptions.disabledTypes.indexOf(type) > -1) {
1468
+ throw new TypeError("disabled file type: " + type);
1469
+ }
1470
+ const size = typeHandlers.get(type).calculate(input);
1471
+ if (size !== void 0) {
1472
+ size.type = size.type ?? type;
1473
+ return size;
1474
+ }
1475
+ }
1476
+ throw new TypeError("unsupported file type: " + type);
1477
+ }
1478
+
1479
+ async function probe(url) {
1480
+ const response = await fetch(url);
1481
+ if (!response.body || !response.ok) {
1482
+ throw new Error("Failed to fetch image");
1483
+ }
1484
+ const reader = response.body.getReader();
1485
+ let done, value;
1486
+ let accumulatedChunks = new Uint8Array();
1487
+ while (!done) {
1488
+ const readResult = await reader.read();
1489
+ done = readResult.done;
1490
+ if (done)
1491
+ break;
1492
+ if (readResult.value) {
1493
+ value = readResult.value;
1494
+ let tmp = new Uint8Array(accumulatedChunks.length + value.length);
1495
+ tmp.set(accumulatedChunks, 0);
1496
+ tmp.set(value, accumulatedChunks.length);
1497
+ accumulatedChunks = tmp;
1498
+ try {
1499
+ const dimensions = lookup(accumulatedChunks);
1500
+ if (dimensions) {
1501
+ await reader.cancel();
1502
+ return dimensions;
1503
+ }
1504
+ } catch (error) {
1505
+ }
1506
+ }
1507
+ }
1508
+ throw new Error("Failed to parse the size");
1509
+ }
1510
+
674
1511
  async function getConfiguredImageService() {
675
1512
  if (!globalThis?.astroAsset?.imageService) {
676
1513
  const { default: service } = await import(
677
1514
  // @ts-expect-error
678
- '../astro/assets-service_631fRtTy.mjs'
1515
+ '../astro/assets-service_B77Hm2ue.mjs'
679
1516
  ).then(n => n.s).catch((e) => {
680
1517
  const error = new AstroError(InvalidImageService);
681
1518
  error.cause = e;
@@ -710,6 +1547,19 @@ async function getImage$1(options, imageConfig) {
710
1547
  ...options,
711
1548
  src: typeof options.src === "object" && "then" in options.src ? (await options.src).default ?? await options.src : options.src
712
1549
  };
1550
+ if (options.inferSize && isRemoteImage(resolvedOptions.src)) {
1551
+ try {
1552
+ const result = await probe(resolvedOptions.src);
1553
+ resolvedOptions.width ??= result.width;
1554
+ resolvedOptions.height ??= result.height;
1555
+ delete resolvedOptions.inferSize;
1556
+ } catch {
1557
+ throw new AstroError({
1558
+ ...FailedToFetchRemoteImageDimensions,
1559
+ message: FailedToFetchRemoteImageDimensions.message(resolvedOptions.src)
1560
+ });
1561
+ }
1562
+ }
713
1563
  const originalPath = isESMImportedImage(resolvedOptions.src) ? resolvedOptions.src.fsPath : resolvedOptions.src;
714
1564
  const clonedSrc = isESMImportedImage(resolvedOptions.src) ? (
715
1565
  // @ts-expect-error - clone is a private, hidden prop
@@ -798,9 +1648,9 @@ const $$Picture$1 = createComponent(async ($$result, $$props, $$slots) => {
798
1648
  densities: props.densities
799
1649
  });
800
1650
  const imgAdditionalAttributes = {};
801
- const sourceAdditionaAttributes = {};
1651
+ const sourceAdditionalAttributes = {};
802
1652
  if (props.sizes) {
803
- sourceAdditionaAttributes.sizes = props.sizes;
1653
+ sourceAdditionalAttributes.sizes = props.sizes;
804
1654
  }
805
1655
  if (fallbackImage.srcSet.values.length > 0) {
806
1656
  imgAdditionalAttributes.srcset = fallbackImage.srcSet.attribute;
@@ -808,7 +1658,7 @@ const $$Picture$1 = createComponent(async ($$result, $$props, $$slots) => {
808
1658
  return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttributes)}>
809
1659
  ${Object.entries(optimizedImages).map(([_, image]) => {
810
1660
  const srcsetAttribute = props.densities || !props.densities && !props.widths ? `${image.src}${image.srcSet.values.length > 0 ? ", " + image.srcSet.attribute : ""}` : image.srcSet.attribute;
811
- return renderTemplate`<source${addAttribute(srcsetAttribute, "srcset")}${addAttribute("image/" + image.options.format, "type")}${spreadAttributes(sourceAdditionaAttributes)}>`;
1661
+ return renderTemplate`<source${addAttribute(srcsetAttribute, "srcset")}${addAttribute("image/" + image.options.format, "type")}${spreadAttributes(sourceAdditionalAttributes)}>`;
812
1662
  })}
813
1663
  <img${addAttribute(fallbackImage.src, "src")}${spreadAttributes(imgAdditionalAttributes)}${spreadAttributes(fallbackImage.attributes)}>
814
1664
  </picture>`;
@@ -821,22 +1671,29 @@ const imageConfig = {"service":{"entrypoint":"astro/assets/services/sharp","conf
821
1671
  const i19aboveOf = "Acima de";
822
1672
  const i19brands = "Marcas";
823
1673
  const i19categories = "Categorias";
1674
+ const i19days = "Dias";
824
1675
  const i19discount = "Desconto";
825
1676
  const i19error = "Erro";
826
1677
  const i19errorMsg = "Ocorreu um erro, tente novamente ou entre em contato conosco.";
1678
+ const i19free = "Grátis";
1679
+ const i19freeShipping = "Frete grátis";
827
1680
  const i19highestPrice = "Maior preço";
828
1681
  const i19home = "Início";
829
1682
  const i19lowestPrice = "Menor preço";
830
1683
  const i19myAccount = "Minha conta";
831
1684
  const i19name = "Nome";
832
1685
  const i19notFound = "Não encontrado";
1686
+ const i19pickUpToday = "Retire hoje";
1687
+ const i19receiveToday = "Receba hoje";
833
1688
  const i19relatedProducts = "Produtos relacionados";
834
1689
  const i19releases = "Lançamentos";
835
1690
  const i19relevance = "Relevância";
836
1691
  const i19sales = "Vendas";
837
1692
  const i19searchProducts = "Buscar produtos";
838
1693
  const i19shoppingCart = "Carrinho de compras";
1694
+ const i19untilTomorrow = "Até amanhã";
839
1695
  const i19upTo = "Até";
1696
+ const i19workingDays = "Dias úteis";
840
1697
 
841
1698
  global.__storefrontCMS = (fs, resolvePath, _parseMatter) => {
842
1699
  const { STOREFRONT_BASE_DIR } = process.env;
@@ -847,8 +1704,8 @@ global.__storefrontCMS = (fs, resolvePath, _parseMatter) => {
847
1704
  baseDir = process.cwd();
848
1705
  }
849
1706
  process.env.STOREFRONT_BASE_DIR = baseDir;
850
- const dirContent = resolvePath(baseDir, 'content');
851
- const resolveContent = (filename) => resolvePath(dirContent, filename);
1707
+ const contentDir = resolvePath(baseDir, 'content');
1708
+ const resolveContent = (filename) => resolvePath(contentDir, filename);
852
1709
 
853
1710
  const contentCache = {};
854
1711
  const getContent = (filename) => {
@@ -891,7 +1748,7 @@ global.__storefrontCMS = (fs, resolvePath, _parseMatter) => {
891
1748
  const handler = globalThis.$storefrontCmsHandler;
892
1749
  if (typeof handler === 'function') {
893
1750
  try {
894
- const content = handler({ dirContent, filename, loadLocal });
1751
+ const content = handler({ contentDir, filename, loadLocal });
895
1752
  if (content) {
896
1753
  return content;
897
1754
  }
@@ -1002,19 +1859,25 @@ if (!globalThis.$apiPrefetchEndpoints) {
1002
1859
  globalThis.$apiPrefetchEndpoints = [];
1003
1860
  }
1004
1861
  const sessions = {};
1862
+ global.__sfSessions = sessions;
1005
1863
  if (!globalThis.$storefront) {
1006
1864
  globalThis.$storefront = new Proxy({
1007
1865
  settings: {},
1008
1866
  data: {},
1867
+ // @ts-expect-error: URL is retrived from `target.getSession().url`
1009
1868
  url: void 0,
1010
1869
  getSession(sid) {
1011
1870
  if (!sid && !!getCurrentInstance()) {
1012
1871
  sid = inject("sid");
1013
1872
  }
1014
- return sid && sessions[sid] || global.__sfSession;
1873
+ const {
1874
+ url,
1875
+ apiContext
1876
+ } = sid && sessions[sid] || global.__sfSession;
1877
+ return { url, apiContext };
1015
1878
  },
1016
- onLoad(callback, sid) {
1017
- emitter$1.once(sid ? `load:${sid}` : "load", callback);
1879
+ onLoad(callback) {
1880
+ emitter$1.once("load", callback);
1018
1881
  }
1019
1882
  }, {
1020
1883
  get(target, prop) {
@@ -1055,7 +1918,28 @@ const loadRouteContext = async (Astro, {
1055
1918
  let urlPath = Astro.url.pathname;
1056
1919
  const isPreview = urlPath.startsWith("/~preview");
1057
1920
  if (isPreview) {
1058
- urlPath = urlPath.replace("/~preview", "");
1921
+ urlPath = urlPath.replace(/^\/~[^/]+\/?/, "/");
1922
+ const getQueryContent = (filename) => {
1923
+ const contentJson = Astro.url.searchParams.get(`content:${filename}`);
1924
+ if (typeof contentJson === "string") {
1925
+ try {
1926
+ const content = JSON.parse(contentJson);
1927
+ return content;
1928
+ } catch {
1929
+ }
1930
+ }
1931
+ return null;
1932
+ };
1933
+ global.$storefrontCmsHandler = ({ filename, loadLocal }) => {
1934
+ const content = getQueryContent(filename);
1935
+ if (filename === "settings")
1936
+ return content || loadLocal();
1937
+ return new Promise((resolve) => {
1938
+ if (content)
1939
+ resolve(content);
1940
+ loadLocal().then(resolve);
1941
+ });
1942
+ };
1059
1943
  }
1060
1944
  const isHomepage = urlPath === "/";
1061
1945
  const isSearchPage = !isHomepage && (urlPath.startsWith("/s/") || urlPath === "/s");
@@ -1068,7 +1952,9 @@ const loadRouteContext = async (Astro, {
1068
1952
  }
1069
1953
  const config = getConfig();
1070
1954
  globalThis.$storefront.settings = config.settings;
1071
- let cmsContent = { sections: [] };
1955
+ let cmsContent = {
1956
+ sections: []
1957
+ };
1072
1958
  const apiState = {};
1073
1959
  const apiPrefetchings = [
1074
1960
  ...apiPrefetchEndpoints.map((endpoint) => {
@@ -1082,13 +1968,14 @@ const loadRouteContext = async (Astro, {
1082
1968
  error: null
1083
1969
  };
1084
1970
  const { slug } = Astro.params;
1971
+ let contentFilename;
1085
1972
  if (isHomepage) {
1086
- cmsContent = await config.getContent("pages/home");
1973
+ contentFilename = "pages/home";
1087
1974
  } else if (isSearchPage) {
1088
- cmsContent = await config.getContent("pages/search");
1975
+ contentFilename = "pages/search";
1089
1976
  } else if (slug && typeof slug === "string") {
1090
1977
  if (contentCollection) {
1091
- cmsContent = await config.getContent(`${contentCollection}/${slug}`);
1978
+ contentFilename = `${contentCollection}/${slug}`;
1092
1979
  } else if (slug.startsWith("_api/") || slug === "_analytics") {
1093
1980
  const err = new Error(`/${slug} route not implemented on SSR directly`);
1094
1981
  Astro.response.status = 501;
@@ -1100,22 +1987,25 @@ const loadRouteContext = async (Astro, {
1100
1987
  api.get(`slugs/${slug}`).then((response) => {
1101
1988
  Object.assign(apiContext, response.data);
1102
1989
  const apiResource = apiContext.resource;
1103
- config.getContent(`pages/${apiResource}`).then((_cmsContent) => {
1990
+ contentFilename = `pages/${apiResource}`;
1991
+ config.getContent(contentFilename).then((_cmsContent) => {
1104
1992
  if (cmsContent && _cmsContent) {
1105
1993
  Object.assign(cmsContent, _cmsContent);
1994
+ cmsContent.$filename = contentFilename;
1106
1995
  }
1107
1996
  }).catch(console.warn);
1108
1997
  const apiDoc = apiContext.doc;
1109
1998
  apiState[`${apiResource}/${apiDoc._id}`] = apiDoc;
1110
1999
  sessions[sid].apiContext = {
1111
2000
  resource: apiResource,
2001
+ // @ts-expect-error: `apiDoc` not strictly typed as resource interface
1112
2002
  doc: apiDoc,
1113
2003
  timestamp: Date.now()
1114
2004
  };
1115
- setTimeout(() => {
2005
+ sessions[sid]._timer = setTimeout(() => {
1116
2006
  sessions[sid] = null;
1117
2007
  delete sessions[sid];
1118
- }, 5e3);
2008
+ }, 6e3);
1119
2009
  resolve(null);
1120
2010
  }).catch((err) => {
1121
2011
  if (prefetchingsIndex > -1) {
@@ -1131,6 +2021,11 @@ const loadRouteContext = async (Astro, {
1131
2021
  }
1132
2022
  }
1133
2023
  }
2024
+ if (contentFilename) {
2025
+ cmsContent = await config.getContent(contentFilename);
2026
+ if (cmsContent)
2027
+ cmsContent.$filename = contentFilename;
2028
+ }
1134
2029
  try {
1135
2030
  (await Promise.all(apiPrefetchings)).forEach((response) => {
1136
2031
  if (response) {
@@ -1184,6 +2079,11 @@ const loadRouteContext = async (Astro, {
1184
2079
  } else {
1185
2080
  setResponseCache(Astro, 120, 180);
1186
2081
  }
2082
+ if (Astro.url.searchParams.get("webcontainer") !== null || urlPath.startsWith("/admin/ide")) {
2083
+ Astro.response.headers.set("Cross-Origin-Embedder-Policy", "require-corp");
2084
+ Astro.response.headers.set("Cross-Origin-Opener-Policy", "same-origin");
2085
+ Astro.response.headers.set("Cross-Origin-Resource-Policy", "cross-origin");
2086
+ }
1187
2087
  const routeContext = {
1188
2088
  ...config,
1189
2089
  isHomepage,
@@ -1199,8 +2099,8 @@ const loadRouteContext = async (Astro, {
1199
2099
  };
1200
2100
  Astro.locals.routeContext = routeContext;
1201
2101
  Astro.cookies.set("sid", sid);
1202
- emitter$1.emit("load", routeContext);
1203
- emitter$1.emit(`load:${sid}`, routeContext);
2102
+ Astro.response.headers.set("X-SId", sid);
2103
+ emitter$1.emit("load", { ...config, apiState });
1204
2104
  globalThis.__sfIds = {};
1205
2105
  return routeContext;
1206
2106
  };
@@ -1295,7 +2195,12 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
1295
2195
  }
1296
2196
  let inlineClientJS = `
1297
2197
  window._emitApiContext = (id = null) => {
1298
- console.log('[ctx] emit ' + id);
2198
+ $storefront.url = new URL(window.location.toString());
2199
+ $storefront.getSession = (/* sid */) => ({
2200
+ url: $storefront.url,
2201
+ apiContext: $storefront.apiContext,
2202
+ });
2203
+ console.debug('[ctx] emit ' + id);
1299
2204
  window.dispatchEvent(new Event('storefront:apiContext'));
1300
2205
  window._emitedContextId = id;
1301
2206
  window.__sfIds = {};
@@ -1341,16 +2246,11 @@ setTimeout(() => {
1341
2246
  inlineClientJS += `
1342
2247
  window._firstLoadContextId = '${apiDoc._id}';`;
1343
2248
  contextInlineClientJS = `
1344
- $storefront.url = new URL(window.location.toString());
1345
2249
  $storefront.apiContext = ${JSON.stringify({
1346
2250
  resource: apiContext.resource,
1347
2251
  doc: minifyApiDoc({ ...apiDoc }),
1348
2252
  timestamp: Date.now()
1349
2253
  })};
1350
- $storefront.getSession = (/* sid */) => {
1351
- url: $storefront.url,
1352
- apiContext: $storefront.apiContext,
1353
- };
1354
2254
  $storefront.context /* DEPRECATED */ = $storefront.apiContext;
1355
2255
  _emitApiContext('${apiDoc._id}');`;
1356
2256
  } else {
@@ -1373,7 +2273,8 @@ window.$isCmsPreview = true;`;
1373
2273
  url: `https://${domain}/`,
1374
2274
  logo: `https://${domain}${settings.logo}`
1375
2275
  });
1376
- return renderTemplate(_c || (_c = __template$3(['<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width">\n<meta name="theme-color"', '>\n<link rel="icon" type="image/png"', ' sizes="32x32">\n', "\n", "\n", '\n<meta name="author"', '>\n<meta name="generator"', '>\n<link rel="canonical"', ">\n", '\n<meta name="apple-mobile-web-app-capable" content="yes">\n<meta name="apple-mobile-web-app-status-bar-style" content="default">\n<meta property="og:site_name"', '>\n<meta property="og:url"', '>\n<meta property="og:title"', '>\n<meta property="og:description"', '>\n<meta property="og:type" content="website">\n<meta property="og:locale"', ">\n", "\n", '\n<meta name="twitter:card" content="summary">\n', '\n<meta name="ecom-store-id"', ">\n\n", "\n\n<script", ">", '</script>\n<script type="application/ld+json">', "</script>\n\n", "\n", ""])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title && renderTemplate`<title>${title}</title>`, description && renderTemplate`<meta name="description"${addAttribute(description, "content")}>`, addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fbAppId && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fbAppId, "content")}>`, metatagsContent?.twitterUsername && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitterUsername, "content")}>`, addAttribute(String(storeId), "content"), isPWA , addAttribute(createTransitionScope($$result, "kvdive2p"), "data-astro-transition-persist"), unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd), hasViewTransitions && renderTemplate`${renderComponent($$result, "ViewTransitions", $$ViewTransitions, { "fallback": "none" })}`, contextInlineClientJS && renderTemplate(_b || (_b = __template$3(["<script>", "</script>"])), unescapeHTML(contextInlineClientJS)));
2276
+ const generator = `e-com.plus @cloudcommerce/storefront, ${Astro2.generator}`;
2277
+ return renderTemplate(_c || (_c = __template$3(['<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width">\n<meta name="theme-color"', '>\n<link rel="icon" type="image/png"', ' sizes="32x32">\n', "\n", "\n", '\n<meta name="author"', '>\n<meta name="generator"', '>\n<link rel="canonical"', ">\n", '\n<meta name="apple-mobile-web-app-capable" content="yes">\n<meta name="apple-mobile-web-app-status-bar-style" content="default">\n<meta property="og:site_name"', '>\n<meta property="og:url"', '>\n<meta property="og:title"', '>\n<meta property="og:description"', '>\n<meta property="og:type" content="website">\n<meta property="og:locale"', ">\n", "\n", '\n<meta name="twitter:card" content="summary">\n', '\n<meta name="ecom-store-id"', ">\n\n", "\n\n<script", ">", '</script>\n<script type="application/ld+json">', "</script>\n\n", "\n", ""])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title && renderTemplate`<title>${title}</title>`, description && renderTemplate`<meta name="description"${addAttribute(description, "content")}>`, addAttribute(settings.name, "content"), addAttribute(generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fbAppId && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fbAppId, "content")}>`, metatagsContent?.twitterUsername && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitterUsername, "content")}>`, addAttribute(String(storeId), "content"), isPWA , addAttribute(createTransitionScope($$result, "kvdive2p"), "data-astro-transition-persist"), unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd), hasViewTransitions && renderTemplate`${renderComponent($$result, "ViewTransitions", $$ViewTransitions, { "fallback": "none" })}`, contextInlineClientJS && renderTemplate(_b || (_b = __template$3(["<script>", "</script>"])), unescapeHTML(contextInlineClientJS)));
1377
2278
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", "self");
1378
2279
 
1379
2280
  function has(value) {
@@ -2018,6 +2919,62 @@ if (global.$storefront) {
2018
2919
  setSocialNetworks();
2019
2920
  }
2020
2921
 
2922
+ const afetch = (url, init, timeout = 1e4) => {
2923
+ let abortController;
2924
+ let timer;
2925
+ if (timeout) {
2926
+ abortController = new AbortController();
2927
+ timer = setTimeout(() => {
2928
+ abortController.abort();
2929
+ }, timeout);
2930
+ }
2931
+ let body;
2932
+ if (init?.body) {
2933
+ if (typeof init.body === "object") {
2934
+ body = JSON.stringify(init.body);
2935
+ init.headers = {
2936
+ ...init.headers,
2937
+ "Content-Type": "application/json",
2938
+ "Content-Length": body.length.toString()
2939
+ };
2940
+ } else {
2941
+ body = init.body;
2942
+ }
2943
+ }
2944
+ if (init?.params && typeof url === "string") {
2945
+ let query = "";
2946
+ Object.keys(init.params).forEach((key) => {
2947
+ const value = init.params[key];
2948
+ if (value === void 0)
2949
+ return;
2950
+ if (Array.isArray(value)) {
2951
+ value.forEach((val) => {
2952
+ query += `&${key}=${val}`;
2953
+ });
2954
+ return;
2955
+ }
2956
+ query += `&${key}=${value}`;
2957
+ });
2958
+ if (query) {
2959
+ if (!url.includes("?"))
2960
+ url += `?${query.slice(1)}`;
2961
+ else
2962
+ url += query;
2963
+ }
2964
+ }
2965
+ const promise = fetch(url, {
2966
+ ...init,
2967
+ body,
2968
+ signal: abortController?.signal
2969
+ });
2970
+ promise.finally(() => {
2971
+ if (timer) {
2972
+ clearTimeout(timer);
2973
+ }
2974
+ });
2975
+ return promise;
2976
+ };
2977
+
2021
2978
  const emptyInfo = {
2022
2979
  list_payments: {},
2023
2980
  calculate_shipping: {},
@@ -2027,6 +2984,12 @@ const modulesInfo = reactive(emptyInfo);
2027
2984
  loadingGlobalInfoPreset.then((modulesInfoPreset) => {
2028
2985
  Object.assign(modulesInfo, modulesInfoPreset);
2029
2986
  });
2987
+ const fetchModule = (modName, reqOptions) => {
2988
+ const { hostname } = window.location;
2989
+ const { domain } = globalThis.$storefront.settings;
2990
+ const modulesBaseUri = hostname !== "localhost" && hostname !== "127.0.0.1" ? `https://${domain}/_api/modules/` : "/_api/modules/";
2991
+ return afetch(`${modulesBaseUri}${modName}`, reqOptions);
2992
+ };
2030
2993
  const freeShippingFromValue = computed(() => {
2031
2994
  return modulesInfo.calculate_shipping.free_shipping_from_value;
2032
2995
  });
@@ -2061,9 +3024,46 @@ const parseShippingPhrase = (phrase) => {
2061
3024
  return parsePhrase(phrase, "calculate_shipping", "free_shipping_from_value");
2062
3025
  };
2063
3026
 
2064
- const useCmsPreview = (filename) => {
2065
- const liveContent = shallowRef(null);
3027
+ function useCmsPreview(filename) {
3028
+ if (Array.isArray(filename)) {
3029
+ filename[1];
3030
+ filename[2];
3031
+ filename = filename[0];
3032
+ }
3033
+ const liveContent = shallowRef();
2066
3034
  return { liveContent };
3035
+ }
3036
+ const useSectionPreview = ({ cmsPreview }, refs) => {
3037
+ if (cmsPreview) {
3038
+ const { contentFilename, sectionIndex } = cmsPreview;
3039
+ const {
3040
+ liveContent
3041
+ } = useCmsPreview([contentFilename, "sections", sectionIndex]);
3042
+ if (refs) {
3043
+ watch(liveContent, (data) => {
3044
+ if (!data)
3045
+ return;
3046
+ Object.keys(refs).forEach((key) => {
3047
+ if (refs[key].value !== void 0) {
3048
+ if (data[key] === void 0)
3049
+ return;
3050
+ refs[key].value = data[key];
3051
+ return;
3052
+ }
3053
+ if (!data[key])
3054
+ return;
3055
+ if (Array.isArray(refs[key])) {
3056
+ refs[key].splice(0);
3057
+ data[key].forEach((v) => refs[key].push(v));
3058
+ return;
3059
+ }
3060
+ Object.assign(refs[key], data[key]);
3061
+ });
3062
+ });
3063
+ }
3064
+ return { liveContent };
3065
+ }
3066
+ return null;
2067
3067
  };
2068
3068
 
2069
3069
  const parseLayoutContent = (layoutContent) => {
@@ -2074,9 +3074,9 @@ const parseLayoutContent = (layoutContent) => {
2074
3074
  return pitchBar;
2075
3075
  };
2076
3076
  const usePitchBar = (props) => {
2077
- const { liveContent } = useCmsPreview();
3077
+ const { liveContent } = useCmsPreview(["layout", "header", "pitchBar"]);
2078
3078
  const parsedContents = computed(() => {
2079
- const slides = liveContent.value ? parseLayoutContent(liveContent.value).slides : props.slides;
3079
+ const slides = liveContent.value || props.slides;
2080
3080
  return slides.map(({ html }) => {
2081
3081
  return parseShippingPhrase(html).value.replace(/<\/?p>/g, "").replace(/&lt;(\/?d-md)&gt;/g, "<$1>");
2082
3082
  });
@@ -2133,7 +3133,7 @@ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
2133
3133
  };
2134
3134
  };
2135
3135
 
2136
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
3136
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2137
3137
  __name: "PitchBar",
2138
3138
  props: {
2139
3139
  slides: {}
@@ -2150,7 +3150,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
2150
3150
  return __returned__;
2151
3151
  }
2152
3152
  });
2153
- function _sfc_ssrRender$A(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3153
+ function _sfc_ssrRender$B(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2154
3154
  const _component_Carousel = resolveComponent("Carousel");
2155
3155
  const _component_ALink = resolveComponent("ALink");
2156
3156
  const _component_CarouselControl = resolveComponent("CarouselControl");
@@ -2243,13 +3243,13 @@ function _sfc_ssrRender$A(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2243
3243
  }, _parent));
2244
3244
  _push(`</div></div>`);
2245
3245
  }
2246
- const _sfc_setup$A = _sfc_main$A.setup;
2247
- _sfc_main$A.setup = (props, ctx) => {
3246
+ const _sfc_setup$B = _sfc_main$B.setup;
3247
+ _sfc_main$B.setup = (props, ctx) => {
2248
3248
  const ssrContext = useSSRContext();
2249
3249
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PitchBar.vue");
2250
- return _sfc_setup$A ? _sfc_setup$A(props, ctx) : void 0;
3250
+ return _sfc_setup$B ? _sfc_setup$B(props, ctx) : void 0;
2251
3251
  };
2252
- const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["ssrRender", _sfc_ssrRender$A]]);
3252
+ const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["ssrRender", _sfc_ssrRender$B]]);
2253
3253
 
2254
3254
  const useStorage = (key, initialValue, storage = globalThis.localStorage, isWithBroadcast = true) => {
2255
3255
  if (!storage) {
@@ -2646,10 +3646,9 @@ const useShopHeader = (props) => {
2646
3646
  };
2647
3647
  };
2648
3648
 
2649
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
3649
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
2650
3650
  __name: "Drawer",
2651
- props: {
2652
- modelValue: { type: Boolean, default: false },
3651
+ props: /* @__PURE__ */ mergeModels({
2653
3652
  isHidden: { type: Boolean, default: false },
2654
3653
  placement: { default: "start" },
2655
3654
  position: { default: "fixed" },
@@ -2660,13 +3659,18 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2660
3659
  canLockScroll: { type: Boolean, default: true },
2661
3660
  maxWidth: {},
2662
3661
  class: {}
2663
- },
3662
+ }, {
3663
+ "modelValue": { type: Boolean, ...{ default: false } },
3664
+ "modelModifiers": {}
3665
+ }),
2664
3666
  emits: ["update:modelValue"],
2665
- setup(__props, { expose: __expose, emit: __emit }) {
3667
+ setup(__props, { expose: __expose }) {
2666
3668
  __expose();
2667
3669
  const props = __props;
2668
- const emit = __emit;
2669
- const close = () => emit("update:modelValue", false);
3670
+ const model = useModel(__props, "modelValue");
3671
+ const close = () => {
3672
+ model.value = false;
3673
+ };
2670
3674
  const drawer = ref(null);
2671
3675
  const outsideClickListener = (ev) => {
2672
3676
  if (!drawer.value?.contains(ev.target)) {
@@ -2681,7 +3685,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2681
3685
  }
2682
3686
  };
2683
3687
  const scrollbarWidth = ref(0);
2684
- watch(toRef(props, "modelValue"), async (isOpen) => {
3688
+ watch(model, async (isOpen) => {
2685
3689
  if (isOpen) {
2686
3690
  if (props.canLockScroll) {
2687
3691
  scrollbarWidth.value = window.innerWidth - document.documentElement.clientWidth;
@@ -2717,7 +3721,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2717
3721
  });
2718
3722
  const animationClassName = ref(null);
2719
3723
  if (props.animation === "scale") {
2720
- watch(toRef(props, "modelValue"), (isShown) => {
3724
+ watch(model, (isShown) => {
2721
3725
  if (!isShown) {
2722
3726
  animationClassName.value = "transition scale-90";
2723
3727
  } else {
@@ -2725,7 +3729,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2725
3729
  setTimeout(() => {
2726
3730
  animationClassName.value = "transition";
2727
3731
  setTimeout(() => {
2728
- if (props.modelValue)
3732
+ if (model.value)
2729
3733
  animationClassName.value = "";
2730
3734
  }, 300);
2731
3735
  }, 50);
@@ -2744,12 +3748,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2744
3748
  const isPlacementX = computed(() => {
2745
3749
  return props.placement === "start" || props.placement === "end";
2746
3750
  });
2747
- const __returned__ = { props, emit, close, drawer, outsideClickListener, escClickListener, scrollbarWidth, slideTo, animationClassName, customClassList, isFixed, isPlacementX };
3751
+ const __returned__ = { props, model, close, drawer, outsideClickListener, escClickListener, scrollbarWidth, slideTo, animationClassName, customClassList, isFixed, isPlacementX };
2748
3752
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
2749
3753
  return __returned__;
2750
3754
  }
2751
3755
  });
2752
- function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3756
+ function _sfc_ssrRender$A(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2753
3757
  const _component_Fade = resolveComponent("Fade");
2754
3758
  _push(ssrRenderComponent(_component_Fade, mergeProps({
2755
3759
  slide: $setup.slideTo,
@@ -2758,7 +3762,7 @@ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2758
3762
  }, _attrs), {
2759
3763
  default: withCtx((_, _push2, _parent2, _scopeId) => {
2760
3764
  if (_push2) {
2761
- if ($props.modelValue) {
3765
+ if ($setup.model) {
2762
3766
  _push2(`<dialog style="${ssrRenderStyle([
2763
3767
  !$props.isHidden ? null : { display: "none" },
2764
3768
  {
@@ -2773,7 +3777,7 @@ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2773
3777
  $setup.isFixed && $props.placement === "end" ? "left-auto right-0" : null,
2774
3778
  $setup.animationClassName,
2775
3779
  ...$setup.customClassList
2776
- ], "z-40 w-screen p-0"])}"${ssrIncludeBooleanAttr($props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
3780
+ ], "z-40 w-screen p-0"])}"${ssrIncludeBooleanAttr($setup.model) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
2777
3781
  if ($props.hasCloseButton) {
2778
3782
  _push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([$props.placement === "end" ? "left-2" : "right-2", "absolute top-2 z-30 rounded"])}" data-drawer-close${_scopeId}>`);
2779
3783
  ssrRenderSlot(_ctx.$slots, "close", {}, () => {
@@ -2790,14 +3794,14 @@ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2790
3794
  _push3(ssrRenderComponent(_component_Fade, null, {
2791
3795
  default: withCtx((_2, _push4, _parent3, _scopeId2) => {
2792
3796
  if (_push4) {
2793
- if ($props.modelValue && !$props.isHidden) {
3797
+ if ($setup.model && !$props.isHidden) {
2794
3798
  _push4(`<div class="size-screen fixed left-0 top-0 z-30 bg-black/50" data-drawer-backdrop${_scopeId2}></div>`);
2795
3799
  } else {
2796
3800
  _push4(`<!---->`);
2797
3801
  }
2798
3802
  } else {
2799
3803
  return [
2800
- $props.modelValue && !$props.isHidden ? (openBlock(), createBlock("div", {
3804
+ $setup.model && !$props.isHidden ? (openBlock(), createBlock("div", {
2801
3805
  key: 0,
2802
3806
  class: "size-screen fixed left-0 top-0 z-30 bg-black/50",
2803
3807
  "data-drawer-backdrop": ""
@@ -2817,7 +3821,7 @@ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2817
3821
  }
2818
3822
  } else {
2819
3823
  return [
2820
- $props.modelValue ? withDirectives((openBlock(), createBlock("dialog", {
3824
+ $setup.model ? withDirectives((openBlock(), createBlock("dialog", {
2821
3825
  key: 0,
2822
3826
  ref: "drawer",
2823
3827
  class: ["z-40 w-screen p-0", [
@@ -2833,7 +3837,7 @@ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2833
3837
  style: {
2834
3838
  maxWidth: $props.maxWidth ? `min(${$props.maxWidth}, calc(100vw - ${$setup.scrollbarWidth}px))` : !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` : void 0
2835
3839
  },
2836
- open: $props.modelValue,
3840
+ open: $setup.model,
2837
3841
  "data-drawer": $props.placement
2838
3842
  }, [
2839
3843
  createVNode("div", { class: "relative h-full" }, [
@@ -2857,7 +3861,7 @@ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2857
3861
  }, [
2858
3862
  createVNode(_component_Fade, null, {
2859
3863
  default: withCtx(() => [
2860
- $props.modelValue && !$props.isHidden ? (openBlock(), createBlock("div", {
3864
+ $setup.model && !$props.isHidden ? (openBlock(), createBlock("div", {
2861
3865
  key: 0,
2862
3866
  class: "size-screen fixed left-0 top-0 z-30 bg-black/50",
2863
3867
  "data-drawer-backdrop": ""
@@ -2875,13 +3879,13 @@ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2875
3879
  _: 3
2876
3880
  }, _parent));
2877
3881
  }
2878
- const _sfc_setup$z = _sfc_main$z.setup;
2879
- _sfc_main$z.setup = (props, ctx) => {
3882
+ const _sfc_setup$A = _sfc_main$A.setup;
3883
+ _sfc_main$A.setup = (props, ctx) => {
2880
3884
  const ssrContext = useSSRContext();
2881
3885
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Drawer.vue");
2882
- return _sfc_setup$z ? _sfc_setup$z(props, ctx) : void 0;
3886
+ return _sfc_setup$A ? _sfc_setup$A(props, ctx) : void 0;
2883
3887
  };
2884
- const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["ssrRender", _sfc_ssrRender$z]]);
3888
+ const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["ssrRender", _sfc_ssrRender$A]]);
2885
3889
 
2886
3890
  const storageKey$1 = "ecomSession";
2887
3891
  const emptySession = {
@@ -2920,7 +3924,7 @@ const initializeFirebaseAuth = (canWaitIdle) => {
2920
3924
  return;
2921
3925
  };
2922
3926
 
2923
- const _sfc_main$y = /* @__PURE__ */ defineComponent({
3927
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2924
3928
  __name: "AccountLink",
2925
3929
  props: {
2926
3930
  to: {},
@@ -2962,20 +3966,20 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
2962
3966
  return __returned__;
2963
3967
  }
2964
3968
  });
2965
- function _sfc_ssrRender$y(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3969
+ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2966
3970
  _push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
2967
3971
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
2968
3972
  _push(`</a>`);
2969
3973
  }
2970
- const _sfc_setup$y = _sfc_main$y.setup;
2971
- _sfc_main$y.setup = (props, ctx) => {
3974
+ const _sfc_setup$z = _sfc_main$z.setup;
3975
+ _sfc_main$z.setup = (props, ctx) => {
2972
3976
  const ssrContext = useSSRContext();
2973
3977
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/AccountLink.vue");
2974
- return _sfc_setup$y ? _sfc_setup$y(props, ctx) : void 0;
3978
+ return _sfc_setup$z ? _sfc_setup$z(props, ctx) : void 0;
2975
3979
  };
2976
- const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["ssrRender", _sfc_ssrRender$y]]);
3980
+ const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["ssrRender", _sfc_ssrRender$z]]);
2977
3981
 
2978
- const _sfc_main$x = /* @__PURE__ */ defineComponent({
3982
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
2979
3983
  __name: "SocialNetworkIcon",
2980
3984
  props: {
2981
3985
  as: { default: "i" },
@@ -3011,18 +4015,18 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
3011
4015
  return __returned__;
3012
4016
  }
3013
4017
  });
3014
- function _sfc_ssrRender$x(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4018
+ function _sfc_ssrRender$y(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3015
4019
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
3016
4020
  }
3017
- const _sfc_setup$x = _sfc_main$x.setup;
3018
- _sfc_main$x.setup = (props, ctx) => {
4021
+ const _sfc_setup$y = _sfc_main$y.setup;
4022
+ _sfc_main$y.setup = (props, ctx) => {
3019
4023
  const ssrContext = useSSRContext();
3020
4024
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkIcon.vue");
3021
- return _sfc_setup$x ? _sfc_setup$x(props, ctx) : void 0;
4025
+ return _sfc_setup$y ? _sfc_setup$y(props, ctx) : void 0;
3022
4026
  };
3023
- const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["ssrRender", _sfc_ssrRender$x]]);
4027
+ const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["ssrRender", _sfc_ssrRender$y]]);
3024
4028
 
3025
- const _sfc_main$w = /* @__PURE__ */ defineComponent({
4029
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
3026
4030
  __name: "SocialNetworkLink",
3027
4031
  props: {
3028
4032
  network: {},
@@ -3048,7 +4052,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
3048
4052
  return __returned__;
3049
4053
  }
3050
4054
  });
3051
- function _sfc_ssrRender$w(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4055
+ function _sfc_ssrRender$x(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3052
4056
  const _component_ALink = resolveComponent("ALink");
3053
4057
  _push(ssrRenderComponent(_component_ALink, mergeProps({ href: $setup.fixedHref }, _attrs), {
3054
4058
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -3069,15 +4073,15 @@ function _sfc_ssrRender$w(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3069
4073
  _: 3
3070
4074
  }, _parent));
3071
4075
  }
3072
- const _sfc_setup$w = _sfc_main$w.setup;
3073
- _sfc_main$w.setup = (props, ctx) => {
4076
+ const _sfc_setup$x = _sfc_main$x.setup;
4077
+ _sfc_main$x.setup = (props, ctx) => {
3074
4078
  const ssrContext = useSSRContext();
3075
4079
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkLink.vue");
3076
- return _sfc_setup$w ? _sfc_setup$w(props, ctx) : void 0;
4080
+ return _sfc_setup$x ? _sfc_setup$x(props, ctx) : void 0;
3077
4081
  };
3078
- const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["ssrRender", _sfc_ssrRender$w]]);
4082
+ const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["ssrRender", _sfc_ssrRender$x]]);
3079
4083
 
3080
- const _sfc_main$v = /* @__PURE__ */ defineComponent({
4084
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
3081
4085
  __name: "ShopSidenavCategory",
3082
4086
  props: {
3083
4087
  categoryTree: {}
@@ -3100,7 +4104,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
3100
4104
  return __returned__;
3101
4105
  }
3102
4106
  });
3103
- function _sfc_ssrRender$v(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4107
+ function _sfc_ssrRender$w(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3104
4108
  const _component_AImg = resolveComponent("AImg");
3105
4109
  const _component_ShopSidenavCategory = resolveComponent("ShopSidenavCategory", true);
3106
4110
  _push(`<li${ssrRenderAttrs(mergeProps({ class: "text-base-800 text-lg" }, _attrs))}>`);
@@ -3138,15 +4142,15 @@ function _sfc_ssrRender$v(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3138
4142
  }
3139
4143
  _push(`</li>`);
3140
4144
  }
3141
- const _sfc_setup$v = _sfc_main$v.setup;
3142
- _sfc_main$v.setup = (props, ctx) => {
4145
+ const _sfc_setup$w = _sfc_main$w.setup;
4146
+ _sfc_main$w.setup = (props, ctx) => {
3143
4147
  const ssrContext = useSSRContext();
3144
4148
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenavCategory.vue");
3145
- return _sfc_setup$v ? _sfc_setup$v(props, ctx) : void 0;
4149
+ return _sfc_setup$w ? _sfc_setup$w(props, ctx) : void 0;
3146
4150
  };
3147
- const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["ssrRender", _sfc_ssrRender$v]]);
4151
+ const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["ssrRender", _sfc_ssrRender$w]]);
3148
4152
 
3149
- const _sfc_main$u = /* @__PURE__ */ defineComponent({
4153
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
3150
4154
  __name: "ShopSidenav",
3151
4155
  props: {
3152
4156
  categoryTrees: {}
@@ -3167,7 +4171,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
3167
4171
  return __returned__;
3168
4172
  }
3169
4173
  });
3170
- function _sfc_ssrRender$u(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4174
+ function _sfc_ssrRender$v(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3171
4175
  _push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex h-full flex-col bg-white" }, _attrs))}><nav class="grow py-4"><ul class="relative h-full"><!--[-->`);
3172
4176
  ssrRenderList($props.categoryTrees, (categoryTree, i) => {
3173
4177
  _push(ssrRenderComponent($setup["ShopSidenavCategory"], {
@@ -3208,13 +4212,13 @@ function _sfc_ssrRender$u(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3208
4212
  });
3209
4213
  _push(`<!--]--></ul></footer></aside>`);
3210
4214
  }
3211
- const _sfc_setup$u = _sfc_main$u.setup;
3212
- _sfc_main$u.setup = (props, ctx) => {
4215
+ const _sfc_setup$v = _sfc_main$v.setup;
4216
+ _sfc_main$v.setup = (props, ctx) => {
3213
4217
  const ssrContext = useSSRContext();
3214
4218
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenav.vue");
3215
- return _sfc_setup$u ? _sfc_setup$u(props, ctx) : void 0;
4219
+ return _sfc_setup$v ? _sfc_setup$v(props, ctx) : void 0;
3216
4220
  };
3217
- const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["ssrRender", _sfc_ssrRender$u]]);
4221
+ const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["ssrRender", _sfc_ssrRender$v]]);
3218
4222
 
3219
4223
  const useShopHeaderSubmenu = (props) => {
3220
4224
  const categoryPicture = computed(() => {
@@ -3263,7 +4267,7 @@ const useShopHeaderSubmenu = (props) => {
3263
4267
  };
3264
4268
  };
3265
4269
 
3266
- const _sfc_main$t = /* @__PURE__ */ defineComponent({
4270
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
3267
4271
  __name: "ShopHeaderSubmenu",
3268
4272
  props: {
3269
4273
  categoryTree: {},
@@ -3292,7 +4296,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
3292
4296
  return __returned__;
3293
4297
  }
3294
4298
  });
3295
- function _sfc_ssrRender$t(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4299
+ function _sfc_ssrRender$u(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3296
4300
  const _component_Fade = resolveComponent("Fade");
3297
4301
  const _component_AImg = resolveComponent("AImg");
3298
4302
  _push(ssrRenderComponent($setup["Popover"], _attrs, {
@@ -3612,15 +4616,15 @@ function _sfc_ssrRender$t(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3612
4616
  _: 3
3613
4617
  }, _parent));
3614
4618
  }
3615
- const _sfc_setup$t = _sfc_main$t.setup;
3616
- _sfc_main$t.setup = (props, ctx) => {
4619
+ const _sfc_setup$u = _sfc_main$u.setup;
4620
+ _sfc_main$u.setup = (props, ctx) => {
3617
4621
  const ssrContext = useSSRContext();
3618
4622
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderSubmenu.vue");
3619
- return _sfc_setup$t ? _sfc_setup$t(props, ctx) : void 0;
4623
+ return _sfc_setup$u ? _sfc_setup$u(props, ctx) : void 0;
3620
4624
  };
3621
- const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["ssrRender", _sfc_ssrRender$t]]);
4625
+ const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["ssrRender", _sfc_ssrRender$u]]);
3622
4626
 
3623
- const _sfc_main$s = /* @__PURE__ */ defineComponent({
4627
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
3624
4628
  __name: "ShopHeaderMenu",
3625
4629
  props: {
3626
4630
  inlineMenuTrees: {}
@@ -3636,7 +4640,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
3636
4640
  return __returned__;
3637
4641
  }
3638
4642
  });
3639
- function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4643
+ function _sfc_ssrRender$t(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3640
4644
  _push(`<nav${ssrRenderAttrs(_attrs)}><ul class="${ssrRenderClass([$props.inlineMenuTrees.length < 7 ? "text-base" : "text-sm", "text-base-700 flex gap-4 xl:gap-5"])}"><!--[-->`);
3641
4645
  ssrRenderList($props.inlineMenuTrees, (categoryTree, i) => {
3642
4646
  _push(`<li>`);
@@ -3680,15 +4684,15 @@ function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3680
4684
  });
3681
4685
  _push(`<!--]--></ul></nav>`);
3682
4686
  }
3683
- const _sfc_setup$s = _sfc_main$s.setup;
3684
- _sfc_main$s.setup = (props, ctx) => {
4687
+ const _sfc_setup$t = _sfc_main$t.setup;
4688
+ _sfc_main$t.setup = (props, ctx) => {
3685
4689
  const ssrContext = useSSRContext();
3686
4690
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderMenu.vue");
3687
- return _sfc_setup$s ? _sfc_setup$s(props, ctx) : void 0;
4691
+ return _sfc_setup$t ? _sfc_setup$t(props, ctx) : void 0;
3688
4692
  };
3689
- const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["ssrRender", _sfc_ssrRender$s]]);
4693
+ const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["ssrRender", _sfc_ssrRender$t]]);
3690
4694
 
3691
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
4695
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
3692
4696
  __name: "AccountMenu",
3693
4697
  setup(__props, { expose: __expose }) {
3694
4698
  __expose();
@@ -3715,7 +4719,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
3715
4719
  return __returned__;
3716
4720
  }
3717
4721
  });
3718
- function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4722
+ function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3719
4723
  const _component_Fade = resolveComponent("Fade");
3720
4724
  const _component_ALink = resolveComponent("ALink");
3721
4725
  _push(ssrRenderComponent($setup["Menu"], mergeProps({
@@ -4342,15 +5346,15 @@ function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4342
5346
  _: 3
4343
5347
  }, _parent));
4344
5348
  }
4345
- const _sfc_setup$r = _sfc_main$r.setup;
4346
- _sfc_main$r.setup = (props, ctx) => {
5349
+ const _sfc_setup$s = _sfc_main$s.setup;
5350
+ _sfc_main$s.setup = (props, ctx) => {
4347
5351
  const ssrContext = useSSRContext();
4348
5352
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/AccountMenu.vue");
4349
- return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
5353
+ return _sfc_setup$s ? _sfc_setup$s(props, ctx) : void 0;
4350
5354
  };
4351
- const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["ssrRender", _sfc_ssrRender$r]]);
5355
+ const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["ssrRender", _sfc_ssrRender$s]]);
4352
5356
 
4353
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
5357
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
4354
5358
  __name: "ShopHeader",
4355
5359
  props: {
4356
5360
  searchInput: {},
@@ -4361,8 +5365,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
4361
5365
  },
4362
5366
  setup(__props, { expose: __expose }) {
4363
5367
  __expose();
4364
- const SearchModal = defineAsyncComponent(() => import('../SearchModal_2azP1u7P.mjs'));
4365
- const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_3_1aFp67.mjs'));
5368
+ const SearchModal = defineAsyncComponent(() => import('../SearchModal_BvEnUvAx.mjs'));
5369
+ const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_BmwcZuxv.mjs'));
4366
5370
  const props = __props;
4367
5371
  const header = ref(null);
4368
5372
  const searchInput = ref(null);
@@ -4394,7 +5398,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
4394
5398
  return __returned__;
4395
5399
  }
4396
5400
  });
4397
- function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5401
+ function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4398
5402
  const _component_Fade = resolveComponent("Fade");
4399
5403
  const _component_Skeleton = resolveComponent("Skeleton");
4400
5404
  _push(`<header${ssrRenderAttrs(mergeProps({
@@ -4613,13 +5617,13 @@ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4613
5617
  }
4614
5618
  _push(`</header>`);
4615
5619
  }
4616
- const _sfc_setup$q = _sfc_main$q.setup;
4617
- _sfc_main$q.setup = (props, ctx) => {
5620
+ const _sfc_setup$r = _sfc_main$r.setup;
5621
+ _sfc_main$r.setup = (props, ctx) => {
4618
5622
  const ssrContext = useSSRContext();
4619
5623
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeader.vue");
4620
- return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
5624
+ return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
4621
5625
  };
4622
- const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["ssrRender", _sfc_ssrRender$q]]);
5626
+ const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["ssrRender", _sfc_ssrRender$r]]);
4623
5627
 
4624
5628
  var __freeze$1 = Object.freeze;
4625
5629
  var __defProp$1 = Object.defineProperty;
@@ -4630,14 +5634,14 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
4630
5634
  const Astro2 = $$result.createAstro($$Astro$8, $$props, $$slots);
4631
5635
  Astro2.self = $$PageHeader;
4632
5636
  const { routeContext } = Astro2.locals;
4633
- const { settings, isHomepage } = routeContext;
5637
+ const { settings, isHomepage, isPreview } = routeContext;
4634
5638
  const LogoHeading = isHomepage ? "h1" : "h2";
4635
5639
  const {
4636
5640
  pitchBar,
4637
5641
  shopHeader
4638
5642
  } = await usePageHeader({ routeContext });
4639
5643
  const { getInlineClientJS } = await useSharedData({ field: "categories" });
4640
- return renderTemplate`${renderSlot$1($$result, $$slots["pitch-bar"], renderTemplate(_a$1 || (_a$1 = __template$1(["\n ", "\n ", "\n\n<script async>", "<\/script>\n", ""])), pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`, pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(getInlineClientJS()), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:context": "data:categories", "client:component-hydration": "context", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
5644
+ return renderTemplate`${renderSlot$1($$result, $$slots["pitch-bar"], renderTemplate(_a$1 || (_a$1 = __template$1(["\n ", "\n\n<script async>", "<\/script>\n", ""])), pitchBar.slides.length > 1 || isPreview ? renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:sf": "lazy", "client:component-hydration": "sf", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}` : renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(getInlineClientJS()), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:sf": "data:categories", "client:component-hydration": "sf", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
4641
5645
  ${maybeRenderHead()}<a href="/">
4642
5646
  ${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "default": ($$result4) => renderTemplate`
4643
5647
  ${renderComponent($$result4, "Picture", $$Picture, { "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "mx-auto max-w-[150px] hover:drop-shadow-sm" })}
@@ -4646,7 +5650,7 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
4646
5650
  ` })}` })))}`;
4647
5651
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
4648
5652
 
4649
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
5653
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
4650
5654
  __name: "PaymentMethodFlag",
4651
5655
  props: {
4652
5656
  as: { default: "i" },
@@ -4682,22 +5686,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
4682
5686
  return __returned__;
4683
5687
  }
4684
5688
  });
4685
- function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5689
+ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4686
5690
  if (!$setup.iconClassName) {
4687
5691
  _push(`<b${ssrRenderAttrs(mergeProps({ class: "mb-1 text-[57%] leading-none tracking-tighter text-black" }, _attrs))}>${ssrInterpolate($setup.props.flag)}</b>`);
4688
5692
  } else {
4689
5693
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
4690
5694
  }
4691
5695
  }
4692
- const _sfc_setup$p = _sfc_main$p.setup;
4693
- _sfc_main$p.setup = (props, ctx) => {
5696
+ const _sfc_setup$q = _sfc_main$q.setup;
5697
+ _sfc_main$q.setup = (props, ctx) => {
4694
5698
  const ssrContext = useSSRContext();
4695
5699
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/PaymentMethodFlag.vue");
4696
- return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
5700
+ return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
4697
5701
  };
4698
- const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["ssrRender", _sfc_ssrRender$p]]);
5702
+ const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["ssrRender", _sfc_ssrRender$q]]);
4699
5703
 
4700
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
5704
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
4701
5705
  __name: "FooterStamps",
4702
5706
  props: {
4703
5707
  stamps: {}
@@ -4709,7 +5713,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
4709
5713
  return __returned__;
4710
5714
  }
4711
5715
  });
4712
- function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5716
+ function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4713
5717
  const _component_ALink = resolveComponent("ALink");
4714
5718
  _push(`<div${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><div class="flex flex-wrap items-start justify-between gap-5 lg:flex-nowrap"><ul class="mx-auto flex items-center gap-x-6 gap-y-3 overflow-x-auto md:mx-0 md:flex-wrap md:overflow-hidden lg:gap-x-8"><!--[-->`);
4715
5719
  ssrRenderList($props.stamps, (stamp, i) => {
@@ -4808,15 +5812,15 @@ function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4808
5812
  }, _parent));
4809
5813
  _push(`</div></div>`);
4810
5814
  }
4811
- const _sfc_setup$o = _sfc_main$o.setup;
4812
- _sfc_main$o.setup = (props, ctx) => {
5815
+ const _sfc_setup$p = _sfc_main$p.setup;
5816
+ _sfc_main$p.setup = (props, ctx) => {
4813
5817
  const ssrContext = useSSRContext();
4814
5818
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/FooterStamps.vue");
4815
- return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
5819
+ return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
4816
5820
  };
4817
- const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["ssrRender", _sfc_ssrRender$o]]);
5821
+ const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["ssrRender", _sfc_ssrRender$p]]);
4818
5822
 
4819
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
5823
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
4820
5824
  __name: "ShopFooter",
4821
5825
  props: {
4822
5826
  stamps: {},
@@ -4834,7 +5838,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
4834
5838
  return __returned__;
4835
5839
  }
4836
5840
  });
4837
- function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5841
+ function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4838
5842
  const _component_ALink = resolveComponent("ALink");
4839
5843
  _push(`<footer${ssrRenderAttrs(mergeProps({ class: "border-base-100 bg-base-50 mt-auto w-screen border-t py-2" }, _attrs))}><div class="ui-section"><div class="border-base-200 flex flex-wrap justify-between gap-y-5 border-b pb-7 sm:gap-x-10 lg:flex-nowrap"><div class="shrink">`);
4840
5844
  ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
@@ -4932,13 +5936,13 @@ function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4932
5936
  _push(ssrRenderComponent($setup["FooterStamps"], { stamps: $props.stamps }, null, _parent));
4933
5937
  _push(`</footer>`);
4934
5938
  }
4935
- const _sfc_setup$n = _sfc_main$n.setup;
4936
- _sfc_main$n.setup = (props, ctx) => {
5939
+ const _sfc_setup$o = _sfc_main$o.setup;
5940
+ _sfc_main$o.setup = (props, ctx) => {
4937
5941
  const ssrContext = useSSRContext();
4938
5942
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopFooter.vue");
4939
- return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
5943
+ return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
4940
5944
  };
4941
- const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["ssrRender", _sfc_ssrRender$n]]);
5945
+ const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["ssrRender", _sfc_ssrRender$o]]);
4942
5946
 
4943
5947
  const $$Astro$7 = createAstro("https://demo.ecomplus.app");
4944
5948
  const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
@@ -5079,38 +6083,41 @@ const usePagination = (props) => {
5079
6083
  };
5080
6084
  };
5081
6085
 
5082
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
6086
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
5083
6087
  __name: "Pagination",
5084
- props: {
6088
+ props: /* @__PURE__ */ mergeModels({
5085
6089
  totalItems: {},
5086
6090
  totalPages: {},
5087
- page: { default: 1 },
6091
+ page: {},
5088
6092
  pageSize: {},
5089
6093
  maxPages: { default: 7 },
5090
6094
  isUrlPath: { type: Boolean, default: false }
5091
- },
6095
+ }, {
6096
+ "page": { default: 1 },
6097
+ "pageModifiers": {}
6098
+ }),
5092
6099
  emits: ["update:page"],
5093
- setup(__props, { expose: __expose, emit: __emit }) {
6100
+ setup(__props, { expose: __expose }) {
5094
6101
  __expose();
5095
6102
  const props = __props;
5096
- const emit = __emit;
6103
+ const page = useModel(__props, "page");
5097
6104
  const {
5098
6105
  pages,
5099
6106
  pageLinks,
5100
6107
  prevPageLink,
5101
6108
  nextPageLink
5102
6109
  } = usePagination(props);
5103
- const __returned__ = { props, emit, pages, pageLinks, prevPageLink, nextPageLink };
6110
+ const __returned__ = { props, page, pages, pageLinks, prevPageLink, nextPageLink };
5104
6111
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
5105
6112
  return __returned__;
5106
6113
  }
5107
6114
  });
5108
- function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6115
+ function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5109
6116
  const _component_ALink = resolveComponent("ALink");
5110
6117
  _push(`<ol${ssrRenderAttrs(mergeProps({ class: "text-base-900 flex justify-center gap-1.5 text-center text-sm font-medium leading-9" }, _attrs))}><li>`);
5111
6118
  _push(ssrRenderComponent(_component_ALink, {
5112
6119
  href: $setup.prevPageLink,
5113
- onClick: ($event) => $setup.prevPageLink && $setup.emit("update:page", $props.page - 1),
6120
+ onClick: ($event) => $setup.prevPageLink && ($setup.page = $setup.page - 1),
5114
6121
  class: ["mr-1 block min-w-9 rounded border px-3", $setup.prevPageLink ? "border-base-100 hover:bg-base-100" : "border-transparent text-base-500"]
5115
6122
  }, {
5116
6123
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -5129,9 +6136,9 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5129
6136
  ssrRenderList($setup.pages, (pageN, i) => {
5130
6137
  _push(`<li>`);
5131
6138
  _push(ssrRenderComponent(_component_ALink, {
5132
- href: pageN !== $props.page ? $setup.pageLinks[i] : null,
5133
- onClick: ($event) => $setup.emit("update:page", pageN),
5134
- class: ["block w-9 rounded border ring-black/10", pageN === $props.page ? "bg-base-50 border-base-100 ring text-base-700" : "border-transparent hover:bg-base-100"]
6139
+ href: pageN !== $setup.page ? $setup.pageLinks[i] : null,
6140
+ onClick: ($event) => $setup.page = pageN,
6141
+ class: ["block w-9 rounded border ring-black/10", pageN === $setup.page ? "bg-base-50 border-base-100 ring text-base-700" : "border-transparent hover:bg-base-100"]
5135
6142
  }, {
5136
6143
  default: withCtx((_, _push2, _parent2, _scopeId) => {
5137
6144
  if (_push2) {
@@ -5149,7 +6156,7 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5149
6156
  _push(`<!--]--><li>`);
5150
6157
  _push(ssrRenderComponent(_component_ALink, {
5151
6158
  href: $setup.nextPageLink,
5152
- onClick: ($event) => $setup.nextPageLink && $setup.emit("update:page", $props.page + 1),
6159
+ onClick: ($event) => $setup.nextPageLink && ($setup.page = $setup.page + 1),
5153
6160
  class: ["ml-1 block min-w-9 rounded border px-3", $setup.nextPageLink ? "border-base-100 hover:bg-base-100" : "border-transparent text-base-500"]
5154
6161
  }, {
5155
6162
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -5166,13 +6173,13 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5166
6173
  }, _parent));
5167
6174
  _push(`</li></ol>`);
5168
6175
  }
5169
- const _sfc_setup$m = _sfc_main$m.setup;
5170
- _sfc_main$m.setup = (props, ctx) => {
6176
+ const _sfc_setup$n = _sfc_main$n.setup;
6177
+ _sfc_main$n.setup = (props, ctx) => {
5171
6178
  const ssrContext = useSSRContext();
5172
6179
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Pagination.vue");
5173
- return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
6180
+ return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
5174
6181
  };
5175
- const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["ssrRender", _sfc_ssrRender$m]]);
6182
+ const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["ssrRender", _sfc_ssrRender$n]]);
5176
6183
 
5177
6184
  var __freeze = Object.freeze;
5178
6185
  var __defProp = Object.defineProperty;
@@ -5193,6 +6200,7 @@ const useProductShelf = (props) => {
5193
6200
  let fetching = null;
5194
6201
  const fetchError = ref(null);
5195
6202
  const products = shallowReactive(props.products || []);
6203
+ useSectionPreview(props, { title, titleLink, products });
5196
6204
  if (!props.products) {
5197
6205
  isFetching.value = true;
5198
6206
  fetching = (async () => {
@@ -5321,6 +6329,7 @@ class SearchEngine {
5321
6329
  params = reactive({});
5322
6330
  pageSize = ref(24);
5323
6331
  pageNumber = ref(1);
6332
+ #middlewares = [];
5324
6333
  #isFetching = ref(false);
5325
6334
  isFetching = computed(() => this.#isFetching.value);
5326
6335
  #wasFetched = ref(false);
@@ -5371,18 +6380,22 @@ class SearchEngine {
5371
6380
  });
5372
6381
  }
5373
6382
  let response;
6383
+ const searchOptions = {
6384
+ term: this.term.value,
6385
+ params: {
6386
+ ...this.params,
6387
+ limit,
6388
+ offset,
6389
+ count: this.isWithCount.value || void 0,
6390
+ buckets: this.isWithBuckets.value || void 0
6391
+ },
6392
+ fields: this.fields
6393
+ };
5374
6394
  try {
5375
- response = await this.#search({
5376
- term: this.term.value,
5377
- params: {
5378
- ...this.params,
5379
- limit,
5380
- offset,
5381
- count: this.isWithCount.value || void 0,
5382
- buckets: this.isWithBuckets.value || void 0
5383
- },
5384
- fields: this.fields
5385
- });
6395
+ for (let i = 0; i < this.#middlewares.length; i++) {
6396
+ this.#middlewares[i](searchOptions);
6397
+ }
6398
+ response = await this.#search(searchOptions);
5386
6399
  } catch (err) {
5387
6400
  if (this.#fulfillFetching) {
5388
6401
  this.#fetchError.value = err;
@@ -5402,6 +6415,9 @@ class SearchEngine {
5402
6415
  }
5403
6416
  }
5404
6417
  }
6418
+ addMiddleware(cb) {
6419
+ this.#middlewares.push(cb);
6420
+ }
5405
6421
  setResult(data) {
5406
6422
  if (data.meta) {
5407
6423
  Object.assign(this.meta, data.meta);
@@ -5671,7 +6687,7 @@ const useSearchShowcase = (props) => {
5671
6687
  }
5672
6688
  }
5673
6689
  const products = shallowReactive(props.products || []);
5674
- const searchEngine = new SearchEngine({ debounce: 50 });
6690
+ const searchEngine = props.searchEngine || new SearchEngine({ debounce: 50 });
5675
6691
  if (term === void 0 && false) {
5676
6692
  term = new URLSearchParams(window.location.search).get("q") || null;
5677
6693
  }
@@ -5884,7 +6900,7 @@ const usePageHero = async ({ routeContext }) => {
5884
6900
  }
5885
6901
  return { heroSlider };
5886
6902
  };
5887
- const usePageSections = async ({ routeContext, handleCustomSection }) => {
6903
+ const usePageSections = async ({ routeContext, handleCustomSection, searchEngine }) => {
5888
6904
  const { cmsContent } = routeContext;
5889
6905
  let sectionsContent = cmsContent?.sections;
5890
6906
  if (cmsContent?.markdown && !sectionsContent?.find(({ type }) => type === "content-entry")) {
@@ -5989,11 +7005,14 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
5989
7005
  props.term = routeContext.searchPageTerm || null;
5990
7006
  }
5991
7007
  if (props.term !== void 0 || props.fixedParams) {
5992
- const { searchEngine, fetching } = useSearchShowcase(props);
7008
+ const {
7009
+ searchEngine: resultSearchEngine,
7010
+ fetching
7011
+ } = useSearchShowcase({ ...props, searchEngine });
5993
7012
  await fetching;
5994
- props.products = searchEngine.products;
5995
- props.resultMeta = searchEngine.meta;
5996
- props.ssrError = searchEngine.fetchError.value?.message;
7013
+ props.products = resultSearchEngine.products;
7014
+ props.resultMeta = resultSearchEngine.meta;
7015
+ props.ssrError = resultSearchEngine.fetchError.value?.message;
5997
7016
  }
5998
7017
  sections[index] = { type, props };
5999
7018
  return;
@@ -6104,7 +7123,7 @@ const useBanner = (props) => {
6104
7123
  };
6105
7124
  };
6106
7125
 
6107
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
7126
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
6108
7127
  __name: "Banner",
6109
7128
  props: {
6110
7129
  img: {},
@@ -6131,7 +7150,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6131
7150
  return __returned__;
6132
7151
  }
6133
7152
  });
6134
- function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7153
+ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6135
7154
  const _component_ALink = resolveComponent("ALink");
6136
7155
  _push(`<div${ssrRenderAttrs(mergeProps({
6137
7156
  class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 sm:grid-cols-2 items-center" : null]
@@ -6199,15 +7218,15 @@ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6199
7218
  }
6200
7219
  _push(`</div>`);
6201
7220
  }
6202
- const _sfc_setup$l = _sfc_main$l.setup;
6203
- _sfc_main$l.setup = (props, ctx) => {
7221
+ const _sfc_setup$m = _sfc_main$m.setup;
7222
+ _sfc_main$m.setup = (props, ctx) => {
6204
7223
  const ssrContext = useSSRContext();
6205
7224
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Banner.vue");
6206
- return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
7225
+ return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
6207
7226
  };
6208
- const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["ssrRender", _sfc_ssrRender$l]]);
7227
+ const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["ssrRender", _sfc_ssrRender$m]]);
6209
7228
 
6210
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
7229
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6211
7230
  __name: "HeroSlider",
6212
7231
  props: {
6213
7232
  autoplay: {},
@@ -6224,7 +7243,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
6224
7243
  return __returned__;
6225
7244
  }
6226
7245
  });
6227
- function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7246
+ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6228
7247
  const _component_Carousel = resolveComponent("Carousel");
6229
7248
  const _component_CarouselControl = resolveComponent("CarouselControl");
6230
7249
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "relative mx-auto mb-9 md:mb-12" }, _attrs))}>`);
@@ -6333,13 +7352,13 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6333
7352
  }, _parent));
6334
7353
  _push(`</section>`);
6335
7354
  }
6336
- const _sfc_setup$k = _sfc_main$k.setup;
6337
- _sfc_main$k.setup = (props, ctx) => {
7355
+ const _sfc_setup$l = _sfc_main$l.setup;
7356
+ _sfc_main$l.setup = (props, ctx) => {
6338
7357
  const ssrContext = useSSRContext();
6339
7358
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/HeroSlider.vue");
6340
- return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
7359
+ return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
6341
7360
  };
6342
- const HeroSlider = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["ssrRender", _sfc_ssrRender$k]]);
7361
+ const HeroSlider = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["ssrRender", _sfc_ssrRender$l]]);
6343
7362
 
6344
7363
  const $$Astro$4 = createAstro("https://demo.ecomplus.app");
6345
7364
  const $$Hero = createComponent(async ($$result, $$props, $$slots) => {
@@ -6348,10 +7367,12 @@ const $$Hero = createComponent(async ($$result, $$props, $$slots) => {
6348
7367
  const { routeContext } = Astro2.locals;
6349
7368
  const { heroSlider } = await usePageHero({ routeContext });
6350
7369
  const heroSlides = heroSlider.slides;
6351
- return renderTemplate`${heroSlider.slides.length > 0 && renderTemplate`${renderComponent($$result, "HeroSlider", HeroSlider, { ...heroSlider, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/HeroSlider.vue", "client:component-export": "default" }, { "picture-0": ($$result2) => renderTemplate`${heroSlides[0] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-0", ...heroSlides[0], "index": 0 })}`}`, "picture-1": ($$result2) => renderTemplate`${heroSlides[1] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-1", ...heroSlides[1], "index": 1 })}`}`, "picture-2": ($$result2) => renderTemplate`${heroSlides[2] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-2", ...heroSlides[2], "index": 2 })}`}`, "picture-3": ($$result2) => renderTemplate`${heroSlides[3] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-3", ...heroSlides[3], "index": 3 })}`}`, "picture-4": ($$result2) => renderTemplate`${heroSlides[4] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-4", ...heroSlides[4], "index": 4 })}`}`, "picture-5": ($$result2) => renderTemplate`${heroSlides[5] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-5", ...heroSlides[5], "index": 5 })}`}`, "picture-6": ($$result2) => renderTemplate`${heroSlides[6] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-6", ...heroSlides[6], "index": 6 })}`}`, "picture-7": ($$result2) => renderTemplate`${heroSlides[7] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-7", ...heroSlides[7], "index": 7 })}`}`, "picture-8": ($$result2) => renderTemplate`${heroSlides[8] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-8", ...heroSlides[8], "index": 8 })}`}`, "picture-9": ($$result2) => renderTemplate`${heroSlides[9] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-9", ...heroSlides[9], "index": 9 })}`}` })}`}`;
7370
+ return renderTemplate`${heroSlider.slides.length > 0 && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
7371
+ ${renderComponent($$result2, "HeroSlider", HeroSlider, { ...heroSlider, "client:sf": "lazy", "client:component-hydration": "sf", "client:component-path": "~/components/HeroSlider.vue", "client:component-export": "default" }, { "picture-0": ($$result3) => renderTemplate`${heroSlides[0] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-0", ...heroSlides[0], "index": 0 })}`}`, "picture-1": ($$result3) => renderTemplate`${heroSlides[1] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-1", ...heroSlides[1], "index": 1 })}`}`, "picture-2": ($$result3) => renderTemplate`${heroSlides[2] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-2", ...heroSlides[2], "index": 2 })}`}`, "picture-3": ($$result3) => renderTemplate`${heroSlides[3] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-3", ...heroSlides[3], "index": 3 })}`}`, "picture-4": ($$result3) => renderTemplate`${heroSlides[4] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-4", ...heroSlides[4], "index": 4 })}`}`, "picture-5": ($$result3) => renderTemplate`${heroSlides[5] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-5", ...heroSlides[5], "index": 5 })}`}`, "picture-6": ($$result3) => renderTemplate`${heroSlides[6] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-6", ...heroSlides[6], "index": 6 })}`}`, "picture-7": ($$result3) => renderTemplate`${heroSlides[7] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-7", ...heroSlides[7], "index": 7 })}`}`, "picture-8": ($$result3) => renderTemplate`${heroSlides[8] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-8", ...heroSlides[8], "index": 8 })}`}`, "picture-9": ($$result3) => renderTemplate`${heroSlides[9] && renderTemplate`${renderComponent($$result3, "BannerPictures", $$BannerPictures, { "slot": "picture-9", ...heroSlides[9], "index": 9 })}`}` })}
7372
+ ` })}`}`;
6352
7373
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/content/Hero.astro", void 0);
6353
7374
 
6354
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
7375
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
6355
7376
  __name: "ContentClearfix",
6356
7377
  props: {
6357
7378
  html: {}
@@ -6365,16 +7386,16 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6365
7386
  return __returned__;
6366
7387
  }
6367
7388
  });
6368
- function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7389
+ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6369
7390
  _push(`<article${ssrRenderAttrs(mergeProps({ class: "!max-w-full overflow-x-auto prose" }, _attrs))}><div class="[&amp;_iframe]:max-w-full [&amp;_img]:max-w-full [&amp;_table]:max-w-full">${$setup.parsedHTML}</div></article>`);
6370
7391
  }
6371
- const _sfc_setup$j = _sfc_main$j.setup;
6372
- _sfc_main$j.setup = (props, ctx) => {
7392
+ const _sfc_setup$k = _sfc_main$k.setup;
7393
+ _sfc_main$k.setup = (props, ctx) => {
6373
7394
  const ssrContext = useSSRContext();
6374
7395
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ContentClearfix.vue");
6375
- return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
7396
+ return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
6376
7397
  };
6377
- const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
7398
+ const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["ssrRender", _sfc_ssrRender$k]]);
6378
7399
 
6379
7400
  const $$Astro$3 = createAstro("https://demo.ecomplus.app");
6380
7401
  const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
@@ -6450,12 +7471,13 @@ const useBreadcrumbs = async (props = {}) => {
6450
7471
  };
6451
7472
  };
6452
7473
 
6453
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
7474
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6454
7475
  __name: "Breadcrumbs",
6455
7476
  props: {
6456
7477
  apiDoc: {},
6457
7478
  categories: {},
6458
- domain: {}
7479
+ domain: {},
7480
+ cmsPreview: {}
6459
7481
  },
6460
7482
  async setup(__props, { expose: __expose }) {
6461
7483
  __expose();
@@ -6467,7 +7489,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6467
7489
  return __returned__;
6468
7490
  }
6469
7491
  });
6470
- function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7492
+ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6471
7493
  _push(`<!--[-->`);
6472
7494
  if ($setup.breadcrumbs.length > 1) {
6473
7495
  _push(`<section class="ui-section-slim"><nav aria-label="Breadcrumb" class="w-full overflow-hidden text-lg md:text-sm"><ol class="text-base-600 flex items-center gap-1"><li><a href="/" class="hover:text-primary"><span class="sr-only">${ssrInterpolate("In\xEDcio")}</span><i class="i-home"></i></a></li><!--[-->`);
@@ -6491,13 +7513,13 @@ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6491
7513
  }
6492
7514
  _push(`<!--]-->`);
6493
7515
  }
6494
- const _sfc_setup$i = _sfc_main$i.setup;
6495
- _sfc_main$i.setup = (props, ctx) => {
7516
+ const _sfc_setup$j = _sfc_main$j.setup;
7517
+ _sfc_main$j.setup = (props, ctx) => {
6496
7518
  const ssrContext = useSSRContext();
6497
7519
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Breadcrumbs.vue");
6498
- return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
7520
+ return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
6499
7521
  };
6500
- const Breadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
7522
+ const Breadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
6501
7523
 
6502
7524
  const emitGtagEvent = async (name, _params) => {
6503
7525
  return;
@@ -6778,7 +7800,7 @@ const usePrices = (props) => {
6778
7800
  };
6779
7801
  };
6780
7802
 
6781
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
7803
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6782
7804
  __name: "Prices",
6783
7805
  props: {
6784
7806
  isBig: { type: Boolean },
@@ -6813,7 +7835,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
6813
7835
  return __returned__;
6814
7836
  }
6815
7837
  });
6816
- function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7838
+ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6817
7839
  const _component_Fade = resolveComponent("Fade");
6818
7840
  _push(`<div${ssrRenderAttrs(mergeProps({
6819
7841
  class: ["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]", $props.isBig ? "text-lg" : null]
@@ -6943,15 +7965,15 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6943
7965
  }, _parent));
6944
7966
  _push(`</div>`);
6945
7967
  }
6946
- const _sfc_setup$h = _sfc_main$h.setup;
6947
- _sfc_main$h.setup = (props, ctx) => {
7968
+ const _sfc_setup$i = _sfc_main$i.setup;
7969
+ _sfc_main$i.setup = (props, ctx) => {
6948
7970
  const ssrContext = useSSRContext();
6949
7971
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
6950
- return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
7972
+ return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
6951
7973
  };
6952
- const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
7974
+ const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
6953
7975
 
6954
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
7976
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
6955
7977
  __name: "ProductCard",
6956
7978
  props: {
6957
7979
  product: {},
@@ -6986,7 +8008,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
6986
8008
  return __returned__;
6987
8009
  }
6988
8010
  });
6989
- function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8011
+ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6990
8012
  const _component_ALink = resolveComponent("ALink");
6991
8013
  const _component_AImg = resolveComponent("AImg");
6992
8014
  _push(`<article${ssrRenderAttrs(mergeProps({
@@ -7129,15 +8151,15 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7129
8151
  }, _parent));
7130
8152
  _push(`</article>`);
7131
8153
  }
7132
- const _sfc_setup$g = _sfc_main$g.setup;
7133
- _sfc_main$g.setup = (props, ctx) => {
8154
+ const _sfc_setup$h = _sfc_main$h.setup;
8155
+ _sfc_main$h.setup = (props, ctx) => {
7134
8156
  const ssrContext = useSSRContext();
7135
8157
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductCard.vue");
7136
- return _sfc_setup$g ? _sfc_setup$g(props, ctx) : void 0;
8158
+ return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
7137
8159
  };
7138
- const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["ssrRender", _sfc_ssrRender$g]]);
8160
+ const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
7139
8161
 
7140
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
8162
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
7141
8163
  __name: "ProductShelf",
7142
8164
  props: {
7143
8165
  isGrid: { type: Boolean },
@@ -7150,7 +8172,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
7150
8172
  limit: {},
7151
8173
  page: {},
7152
8174
  products: {},
7153
- isRelatedProducts: { type: Boolean }
8175
+ isRelatedProducts: { type: Boolean },
8176
+ cmsPreview: {}
7154
8177
  },
7155
8178
  async setup(__props, { expose: __expose }) {
7156
8179
  __expose();
@@ -7175,7 +8198,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
7175
8198
  return __returned__;
7176
8199
  }
7177
8200
  });
7178
- function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8201
+ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7179
8202
  const _component_ALink = resolveComponent("ALink");
7180
8203
  const _component_CarouselControl = resolveComponent("CarouselControl");
7181
8204
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
@@ -7284,15 +8307,15 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7284
8307
  ssrRenderSlot(_ctx.$slots, "append", {}, null, _push, _parent);
7285
8308
  _push(`</section>`);
7286
8309
  }
7287
- const _sfc_setup$f = _sfc_main$f.setup;
7288
- _sfc_main$f.setup = (props, ctx) => {
8310
+ const _sfc_setup$g = _sfc_main$g.setup;
8311
+ _sfc_main$g.setup = (props, ctx) => {
7289
8312
  const ssrContext = useSSRContext();
7290
8313
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductShelf.vue");
7291
- return _sfc_setup$f ? _sfc_setup$f(props, ctx) : void 0;
8314
+ return _sfc_setup$g ? _sfc_setup$g(props, ctx) : void 0;
7292
8315
  };
7293
- const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["ssrRender", _sfc_ssrRender$f]]);
8316
+ const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["ssrRender", _sfc_ssrRender$g]]);
7294
8317
 
7295
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
8318
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
7296
8319
  __name: "Collapse",
7297
8320
  props: {
7298
8321
  title: {}
@@ -7304,20 +8327,20 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
7304
8327
  return __returned__;
7305
8328
  }
7306
8329
  });
7307
- function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8330
+ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7308
8331
  _push(`<details${ssrRenderAttrs(mergeProps({ class: "group my-4 md:my-5 [&_i]:open:-rotate-90" }, _attrs))}><summary role="button" class="text-base-700 hover:text-base-800 [&amp;&gt;i]:hover:text-primary list-none text-2xl font-medium lowercase group-open:mb-3"><i class="i-chevron-right mr-1 rotate-90"></i><span>${ssrInterpolate($props.title)}</span></summary>`);
7309
8332
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
7310
8333
  _push(`</details>`);
7311
8334
  }
7312
- const _sfc_setup$e = _sfc_main$e.setup;
7313
- _sfc_main$e.setup = (props, ctx) => {
8335
+ const _sfc_setup$f = _sfc_main$f.setup;
8336
+ _sfc_main$f.setup = (props, ctx) => {
7314
8337
  const ssrContext = useSSRContext();
7315
8338
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Collapse.vue");
7316
- return _sfc_setup$e ? _sfc_setup$e(props, ctx) : void 0;
8339
+ return _sfc_setup$f ? _sfc_setup$f(props, ctx) : void 0;
7317
8340
  };
7318
- const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["ssrRender", _sfc_ssrRender$e]]);
8341
+ const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["ssrRender", _sfc_ssrRender$f]]);
7319
8342
 
7320
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
8343
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
7321
8344
  __name: "DocDescription",
7322
8345
  props: {
7323
8346
  apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
@@ -7326,13 +8349,13 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
7326
8349
  setup(__props, { expose: __expose }) {
7327
8350
  __expose();
7328
8351
  const props = __props;
7329
- const html = computed(() => props.apiDoc.body_html || props.apiDoc.body_text);
8352
+ const html = computed(() => props.apiDoc.body_html);
7330
8353
  const __returned__ = { props, html, ContentClearfix, Collapse };
7331
8354
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
7332
8355
  return __returned__;
7333
8356
  }
7334
8357
  });
7335
- function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8358
+ function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7336
8359
  if ($setup.html) {
7337
8360
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
7338
8361
  _push(ssrRenderComponent($setup["Collapse"], {
@@ -7355,15 +8378,15 @@ function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7355
8378
  _push(`<!---->`);
7356
8379
  }
7357
8380
  }
7358
- const _sfc_setup$d = _sfc_main$d.setup;
7359
- _sfc_main$d.setup = (props, ctx) => {
8381
+ const _sfc_setup$e = _sfc_main$e.setup;
8382
+ _sfc_main$e.setup = (props, ctx) => {
7360
8383
  const ssrContext = useSSRContext();
7361
8384
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/DocDescription.vue");
7362
- return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
8385
+ return _sfc_setup$e ? _sfc_setup$e(props, ctx) : void 0;
7363
8386
  };
7364
- const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
8387
+ const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["ssrRender", _sfc_ssrRender$e]]);
7365
8388
 
7366
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
8389
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
7367
8390
  __name: "DocBanners",
7368
8391
  props: {
7369
8392
  apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
@@ -7378,7 +8401,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
7378
8401
  return __returned__;
7379
8402
  }
7380
8403
  });
7381
- function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8404
+ function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7382
8405
  const _component_AImg = resolveComponent("AImg");
7383
8406
  if ($setup.pictures.length) {
7384
8407
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><ul class="flex flex-wrap gap-4 lg:flex-nowrap"><!--[-->`);
@@ -7392,15 +8415,15 @@ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7392
8415
  _push(`<!---->`);
7393
8416
  }
7394
8417
  }
7395
- const _sfc_setup$c = _sfc_main$c.setup;
7396
- _sfc_main$c.setup = (props, ctx) => {
8418
+ const _sfc_setup$d = _sfc_main$d.setup;
8419
+ _sfc_main$d.setup = (props, ctx) => {
7397
8420
  const ssrContext = useSSRContext();
7398
8421
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/DocBanners.vue");
7399
- return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
8422
+ return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
7400
8423
  };
7401
- const DocBanners = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
8424
+ const DocBanners = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
7402
8425
 
7403
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
8426
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
7404
8427
  __name: "CheckoutLink",
7405
8428
  props: {
7406
8429
  to: { default: "cart" },
@@ -7455,20 +8478,20 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
7455
8478
  return __returned__;
7456
8479
  }
7457
8480
  });
7458
- function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8481
+ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7459
8482
  _push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
7460
8483
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
7461
8484
  _push(`</a>`);
7462
8485
  }
7463
- const _sfc_setup$b = _sfc_main$b.setup;
7464
- _sfc_main$b.setup = (props, ctx) => {
8486
+ const _sfc_setup$c = _sfc_main$c.setup;
8487
+ _sfc_main$c.setup = (props, ctx) => {
7465
8488
  const ssrContext = useSSRContext();
7466
8489
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CheckoutLink.vue");
7467
- return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
8490
+ return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
7468
8491
  };
7469
- const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
8492
+ const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
7470
8493
 
7471
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
8494
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
7472
8495
  __name: "QuantitySelectorControl",
7473
8496
  props: {
7474
8497
  isMinus: { type: Boolean }
@@ -7485,7 +8508,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
7485
8508
  return __returned__;
7486
8509
  }
7487
8510
  });
7488
- function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8511
+ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7489
8512
  _push(`<button${ssrRenderAttrs(mergeProps({
7490
8513
  type: "button",
7491
8514
  class: "leading-12 h-12 w-10 text-xl enabled:text-primary enabled:hover:bg-primary-100/70 disabled:opacity-40",
@@ -7502,46 +8525,47 @@ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7502
8525
  }, _push, _parent);
7503
8526
  _push(`</button>`);
7504
8527
  }
7505
- const _sfc_setup$a = _sfc_main$a.setup;
7506
- _sfc_main$a.setup = (props, ctx) => {
8528
+ const _sfc_setup$b = _sfc_main$b.setup;
8529
+ _sfc_main$b.setup = (props, ctx) => {
7507
8530
  const ssrContext = useSSRContext();
7508
8531
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelectorControl.vue");
7509
- return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
8532
+ return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
7510
8533
  };
7511
- const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
8534
+ const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
7512
8535
 
7513
8536
  const quantitySelectorKey = Symbol("quantitySelector");
7514
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
8537
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
7515
8538
  __name: "QuantitySelector",
7516
- props: {
7517
- modelValue: { default: 1 },
8539
+ props: /* @__PURE__ */ mergeModels({
7518
8540
  min: { default: 1 },
7519
8541
  max: {},
7520
8542
  step: {},
7521
8543
  disabled: { type: Boolean },
7522
8544
  readonly: { type: Boolean }
7523
- },
8545
+ }, {
8546
+ "modelValue": { default: 1 },
8547
+ "modelModifiers": {}
8548
+ }),
7524
8549
  emits: ["update:modelValue"],
7525
- setup(__props, { expose: __expose, emit: __emit }) {
8550
+ setup(__props, { expose: __expose }) {
7526
8551
  __expose();
7527
8552
  const props = __props;
7528
- const emit = __emit;
8553
+ const model = useModel(__props, "modelValue");
7529
8554
  const input = ref(null);
7530
8555
  const inputId = useId("NInput");
7531
8556
  const value = computed({
7532
8557
  get() {
7533
- return props.modelValue;
8558
+ return model.value;
7534
8559
  },
7535
8560
  set(_value) {
7536
8561
  if (_value < props.min) {
7537
8562
  _value = props.min;
7538
8563
  input.value.value = `${_value}`;
7539
- }
7540
- if (props.max && _value > props.max) {
8564
+ } else if (props.max && _value > props.max) {
7541
8565
  _value = props.max;
7542
8566
  input.value.value = `${_value}`;
7543
8567
  }
7544
- emit("update:modelValue", _value);
8568
+ model.value = _value;
7545
8569
  }
7546
8570
  });
7547
8571
  const isBoundMin = computed(() => {
@@ -7555,12 +8579,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
7555
8579
  isBoundMin,
7556
8580
  isBoundMax
7557
8581
  });
7558
- const __returned__ = { quantitySelectorKey, props, emit, input, inputId, value, isBoundMin, isBoundMax, QuantitySelectorControl };
8582
+ const __returned__ = { quantitySelectorKey, props, model, input, inputId, value, isBoundMin, isBoundMax, QuantitySelectorControl };
7559
8583
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
7560
8584
  return __returned__;
7561
8585
  }
7562
8586
  });
7563
- function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8587
+ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7564
8588
  _push(`<div${ssrRenderAttrs(mergeProps({ "data-quantity-selector": "" }, _attrs))}>`);
7565
8589
  ssrRenderSlot(_ctx.$slots, "label", { inputId: $setup.inputId, value: $setup.value }, () => {
7566
8590
  _push(`<label${ssrRenderAttr("for", $setup.inputId)} class="sr-only">${ssrInterpolate("Quantidade")}</label>`);
@@ -7597,15 +8621,15 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7597
8621
  }, _push, _parent);
7598
8622
  _push(`</div></div>`);
7599
8623
  }
7600
- const _sfc_setup$9 = _sfc_main$9.setup;
7601
- _sfc_main$9.setup = (props, ctx) => {
8624
+ const _sfc_setup$a = _sfc_main$a.setup;
8625
+ _sfc_main$a.setup = (props, ctx) => {
7602
8626
  const ssrContext = useSSRContext();
7603
8627
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelector.vue");
7604
- return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
8628
+ return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
7605
8629
  };
7606
- const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
8630
+ const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
7607
8631
 
7608
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
8632
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
7609
8633
  __name: "ImagesGallery",
7610
8634
  props: {
7611
8635
  pictures: {}
@@ -7625,7 +8649,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
7625
8649
  // @ts-ignore
7626
8650
  import('photoswipe/lightbox'),
7627
8651
  import('photoswipe'),
7628
- !document.getElementById(styleId) && import('../photoswipe_IcWDJiwc.mjs')
8652
+ !document.getElementById(styleId) && import('../photoswipe_wusPJBJF.mjs')
7629
8653
  ]).then(([
7630
8654
  { default: PhotoSwipeLightbox },
7631
8655
  { default: pswpModule },
@@ -7662,7 +8686,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
7662
8686
  return __returned__;
7663
8687
  }
7664
8688
  });
7665
- function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8689
+ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7666
8690
  const _component_Carousel = resolveComponent("Carousel");
7667
8691
  const _component_AImg = resolveComponent("AImg");
7668
8692
  const _component_CarouselControl = resolveComponent("CarouselControl");
@@ -7842,13 +8866,13 @@ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7842
8866
  }
7843
8867
  _push(`</div></div>`);
7844
8868
  }
7845
- const _sfc_setup$8 = _sfc_main$8.setup;
7846
- _sfc_main$8.setup = (props, ctx) => {
8869
+ const _sfc_setup$9 = _sfc_main$9.setup;
8870
+ _sfc_main$9.setup = (props, ctx) => {
7847
8871
  const ssrContext = useSSRContext();
7848
8872
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ImagesGallery.vue");
7849
- return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
8873
+ return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
7850
8874
  };
7851
- const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
8875
+ const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
7852
8876
 
7853
8877
  const useSkuSelector = (props) => {
7854
8878
  const grids = shallowReactive(
@@ -7959,7 +8983,7 @@ const useSkuSelector = (props) => {
7959
8983
  };
7960
8984
  };
7961
8985
 
7962
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8986
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
7963
8987
  __name: "SkuSelector",
7964
8988
  props: {
7965
8989
  variations: {},
@@ -7988,7 +9012,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
7988
9012
  return __returned__;
7989
9013
  }
7990
9014
  });
7991
- function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
9015
+ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7992
9016
  _push(`<div${ssrRenderAttrs(_attrs)}><!--[-->`);
7993
9017
  ssrRenderList($setup.variationsGrids, (options, gridId) => {
7994
9018
  _push(`<div class="mt-3"><span class="text-base-700 text-sm font-medium">${ssrInterpolate($setup.getGridTitle(gridId))}: `);
@@ -8015,25 +9039,396 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
8015
9039
  });
8016
9040
  _push(`<!--]--></div>`);
8017
9041
  }
8018
- const _sfc_setup$7 = _sfc_main$7.setup;
8019
- _sfc_main$7.setup = (props, ctx) => {
9042
+ const _sfc_setup$8 = _sfc_main$8.setup;
9043
+ _sfc_main$8.setup = (props, ctx) => {
8020
9044
  const ssrContext = useSSRContext();
8021
9045
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SkuSelector.vue");
8022
- return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
9046
+ return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
9047
+ };
9048
+ const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
9049
+
9050
+ const localStorage$1 = typeof window === "object" && window.localStorage;
9051
+ const ZIP_STORAGE_KEY = "shipping-to-zip";
9052
+ const sortApps = (results, order) => {
9053
+ return results.sort((a, b) => {
9054
+ if (a.app_id === b.app_id) {
9055
+ return 0;
9056
+ }
9057
+ const indexA = order.indexOf(a.app_id);
9058
+ const indexB = order.indexOf(b.app_id);
9059
+ if (indexA > -1) {
9060
+ if (indexB > -1) {
9061
+ return indexA < indexB ? -1 : 1;
9062
+ }
9063
+ return -1;
9064
+ }
9065
+ if (indexB > -1)
9066
+ return 1;
9067
+ return 0;
9068
+ });
9069
+ };
9070
+ const reduceItemBody = (itemOrProduct) => {
9071
+ if (!itemOrProduct.product_id) {
9072
+ itemOrProduct.product_id = itemOrProduct._id;
9073
+ }
9074
+ const shippedItem = {};
9075
+ const fields = [
9076
+ "product_id",
9077
+ "variation_id",
9078
+ "sku",
9079
+ "name",
9080
+ "quantity",
9081
+ "inventory",
9082
+ "currency_id",
9083
+ "currency_symbol",
9084
+ "price",
9085
+ "final_price",
9086
+ "dimensions",
9087
+ "weight"
9088
+ ];
9089
+ fields.forEach((field) => {
9090
+ if (itemOrProduct[field] !== void 0) {
9091
+ shippedItem[field] = itemOrProduct[field];
9092
+ }
9093
+ });
9094
+ return shippedItem;
9095
+ };
9096
+ const useShippingCalculator = (props) => {
9097
+ const zipCode = props.zipCode || ref("");
9098
+ if (!zipCode.value && localStorage$1) {
9099
+ const storedZip = localStorage$1.getItem(ZIP_STORAGE_KEY);
9100
+ if (storedZip) {
9101
+ zipCode.value = storedZip;
9102
+ }
9103
+ }
9104
+ const countryCode = props.countryCode || config.get().countryCode;
9105
+ const _shippedItems = toRef(props, "shippedItems");
9106
+ const shippedItems = computed(() => {
9107
+ return _shippedItems.value?.map(reduceItemBody) || [];
9108
+ });
9109
+ const amountSubtotal = computed(() => {
9110
+ return shippedItems.value.reduce((subtotal, item) => {
9111
+ return subtotal + price(item) * item.quantity;
9112
+ }, 0);
9113
+ });
9114
+ const isFetching = ref(false);
9115
+ const fetchShippingServices = useDebounceFn((isRetry) => {
9116
+ if (isFetching.value) {
9117
+ watchOnce(isFetching, (_isFetching) => {
9118
+ if (!_isFetching)
9119
+ fetchShippingServices();
9120
+ });
9121
+ return;
9122
+ }
9123
+ const body = {
9124
+ ...props.baseParams,
9125
+ to: {
9126
+ ...props.baseParams?.to,
9127
+ zip: zipCode.value
9128
+ }
9129
+ };
9130
+ if (shippedItems.value.length) {
9131
+ body.items = shippedItems.value;
9132
+ body.subtotal = amountSubtotal.value;
9133
+ }
9134
+ isFetching.value = true;
9135
+ fetchModule("calculate_shipping", {
9136
+ method: "POST",
9137
+ params: {
9138
+ skip_ids: props.skippedAppIds
9139
+ },
9140
+ body
9141
+ }).then(async (response) => {
9142
+ if (response.status === 501)
9143
+ return;
9144
+ const data = await response.json();
9145
+ parseShippingResult(data.result, isRetry);
9146
+ }).catch((err) => {
9147
+ if (!isRetry) {
9148
+ scheduleRetry(4e3);
9149
+ }
9150
+ console.error(err);
9151
+ }).finally(() => {
9152
+ isFetching.value = false;
9153
+ });
9154
+ }, 100);
9155
+ let retryTimer = null;
9156
+ const scheduleRetry = (timeout = 1e4) => {
9157
+ if (retryTimer)
9158
+ clearTimeout(retryTimer);
9159
+ retryTimer = setTimeout(() => {
9160
+ fetchShippingServices(true);
9161
+ }, timeout);
9162
+ };
9163
+ const shippingServices = shallowReactive([]);
9164
+ const freeFromValue = ref(null);
9165
+ const hasPaidOption = ref();
9166
+ const parseShippingResult = (shippingResult = [], isRetry = false) => {
9167
+ freeFromValue.value = null;
9168
+ shippingServices.splice(0);
9169
+ if (shippingResult.length) {
9170
+ let hasSomeFailedApp = false;
9171
+ shippingResult.forEach((appResult) => {
9172
+ const { validated, error, response } = appResult;
9173
+ if (!validated || error) {
9174
+ hasSomeFailedApp = true;
9175
+ return;
9176
+ }
9177
+ if (props.skippedAppIds?.includes(appResult.app_id)) {
9178
+ return;
9179
+ }
9180
+ response.shipping_services.forEach((service) => {
9181
+ shippingServices.push({
9182
+ app_id: appResult.app_id,
9183
+ ...service
9184
+ });
9185
+ });
9186
+ const freeShippingFromValue = response.free_shipping_from_value;
9187
+ if (freeShippingFromValue && (!freeFromValue.value || freeFromValue.value > freeShippingFromValue)) {
9188
+ freeFromValue.value = freeShippingFromValue;
9189
+ }
9190
+ });
9191
+ if (!shippingServices.length) {
9192
+ if (hasSomeFailedApp) {
9193
+ if (!isRetry) {
9194
+ fetchShippingServices(true);
9195
+ } else {
9196
+ scheduleRetry();
9197
+ }
9198
+ }
9199
+ return;
9200
+ }
9201
+ shippingServices.sort((a, b) => {
9202
+ const lineA = a.shipping_line;
9203
+ const lineB = b.shipping_line;
9204
+ const priceDiff = lineA.total_price - lineB.total_price;
9205
+ if (priceDiff < 0)
9206
+ return -1;
9207
+ if (priceDiff > 0)
9208
+ return 1;
9209
+ return lineA.delivery_time?.days < lineB.delivery_time?.days ? -1 : 1;
9210
+ });
9211
+ hasPaidOption.value = Boolean(shippingServices.find((service) => {
9212
+ return service.shipping_line.total_price || service.shipping_line.price;
9213
+ }));
9214
+ const appIdsOrder = props.appIdsOrder || globalThis.ecomShippingApps || [];
9215
+ if (Array.isArray(appIdsOrder) && appIdsOrder.length) {
9216
+ sortApps(shippingServices, appIdsOrder);
9217
+ }
9218
+ }
9219
+ };
9220
+ const submitZipCode = () => {
9221
+ const _zipCode = zipCode.value;
9222
+ if (countryCode === "BR") {
9223
+ if (_zipCode?.replace(/\D/g, "").length !== 8)
9224
+ return;
9225
+ } else if (!_zipCode) {
9226
+ return;
9227
+ }
9228
+ if (localStorage$1) {
9229
+ localStorage$1.setItem(ZIP_STORAGE_KEY, _zipCode);
9230
+ }
9231
+ fetchShippingServices();
9232
+ };
9233
+ watch(zipCode, (value) => {
9234
+ if (value.length) {
9235
+ if (countryCode === "BR") {
9236
+ const fmt = value.replace(/\D/g, "");
9237
+ if (fmt.length > 5) {
9238
+ zipCode.value = fmt.substring(0, 5) + "-" + fmt.substring(5, 8);
9239
+ if (props.canAutoSubmit)
9240
+ submitZipCode();
9241
+ }
9242
+ } else {
9243
+ zipCode.value = value.substring(0, 30);
9244
+ }
9245
+ }
9246
+ }, {
9247
+ immediate: !props.shippingResult
9248
+ });
9249
+ watch(toRef(props, "shippingResult"), (shippingResult) => {
9250
+ if (!shippingResult?.length)
9251
+ return;
9252
+ parseShippingResult(shippingResult);
9253
+ }, {
9254
+ immediate: true
9255
+ });
9256
+ const productionDeadline = computed(() => {
9257
+ let maxDeadline = 0;
9258
+ _shippedItems.value?.forEach((item) => {
9259
+ if (item.quantity && item.production_time) {
9260
+ const { days, cumulative } = item.production_time;
9261
+ const itemDeadline = cumulative ? days * item.quantity : days;
9262
+ if (itemDeadline > maxDeadline) {
9263
+ maxDeadline = itemDeadline;
9264
+ }
9265
+ }
9266
+ });
9267
+ return maxDeadline;
9268
+ });
9269
+ const getShippingDeadline = (shipping) => {
9270
+ const isWorkingDays = Boolean(shipping.posting_deadline?.working_days || shipping.delivery_time?.working_days);
9271
+ let days = shipping.posting_deadline?.days || 0;
9272
+ if (shipping.delivery_time) {
9273
+ days += shipping.delivery_time.days;
9274
+ }
9275
+ days += productionDeadline.value;
9276
+ if (days > 1) {
9277
+ return `${i19upTo} ${days} ` + (isWorkingDays ? i19workingDays : i19days).toLowerCase();
9278
+ }
9279
+ if (days === 1)
9280
+ return i19untilTomorrow;
9281
+ return shipping.pick_up ? i19pickUpToday : i19receiveToday;
9282
+ };
9283
+ const getShippingPrice = (shipping) => {
9284
+ const freight = typeof shipping.total_price === "number" ? shipping.total_price : shipping.price;
9285
+ if (freight)
9286
+ return formatMoney(freight);
9287
+ return shipping.pick_up ? i19free : i19freeShipping;
9288
+ };
9289
+ return {
9290
+ zipCode,
9291
+ shippedItems,
9292
+ amountSubtotal,
9293
+ submitZipCode,
9294
+ fetchShippingServices,
9295
+ isFetching,
9296
+ freeFromValue,
9297
+ shippingServices,
9298
+ parseShippingResult,
9299
+ productionDeadline,
9300
+ getShippingDeadline,
9301
+ getShippingPrice
9302
+ };
9303
+ };
9304
+
9305
+ const _sfc_main$7 = {};
9306
+
9307
+ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs) {
9308
+ _push(`<div${ssrRenderAttrs(mergeProps({ role: "status" }, _attrs))}><svg aria-hidden="true" class="size-8 max-h-full max-w-full animate-spin fill-secondary text-base-300" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"></path><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"></path></svg><span class="sr-only">Loading...</span></div>`);
9309
+ }
9310
+ const _sfc_setup$7 = _sfc_main$7.setup;
9311
+ _sfc_main$7.setup = (props, ctx) => {
9312
+ const ssrContext = useSSRContext()
9313
+ ;(ssrContext.modules || (ssrContext.modules = new Set())).add("src/lib/components/Spinner.vue");
9314
+ return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : undefined
8023
9315
  };
8024
- const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
9316
+ const Spinner = /*#__PURE__*/_export_sfc(_sfc_main$7, [['ssrRender',_sfc_ssrRender$7]]);
8025
9317
 
8026
9318
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8027
9319
  __name: "ShippingCalculator",
9320
+ props: {
9321
+ hasLabel: { type: Boolean },
9322
+ zipCode: {},
9323
+ canAutoSubmit: { type: Boolean },
9324
+ countryCode: {},
9325
+ shippedItems: {},
9326
+ shippingResult: {},
9327
+ baseParams: {},
9328
+ skippedAppIds: {},
9329
+ appIdsOrder: {}
9330
+ },
8028
9331
  setup(__props, { expose: __expose }) {
8029
9332
  __expose();
8030
- const __returned__ = {};
9333
+ const props = __props;
9334
+ const zipCode = ref("");
9335
+ const zipInputId = useId("ZipInput");
9336
+ const {
9337
+ isFetching,
9338
+ fetchShippingServices,
9339
+ shippingServices,
9340
+ getShippingDeadline,
9341
+ getShippingPrice
9342
+ } = useShippingCalculator({ ...props, zipCode });
9343
+ const isMounted = ref(false);
9344
+ onMounted(() => {
9345
+ isMounted.value = true;
9346
+ });
9347
+ const __returned__ = { props, zipCode, zipInputId, isFetching, fetchShippingServices, shippingServices, getShippingDeadline, getShippingPrice, isMounted, Spinner };
8031
9348
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
8032
9349
  return __returned__;
8033
9350
  }
8034
9351
  });
8035
9352
  function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8036
- _push(`<div${ssrRenderAttrs(_attrs)}></div>`);
9353
+ const _component_ALink = resolveComponent("ALink");
9354
+ const _component_Fade = resolveComponent("Fade");
9355
+ _push(`<div${ssrRenderAttrs(mergeProps({ class: "max-w-sm" }, _attrs))}><form class="group"><label${ssrRenderAttr("for", $setup.zipInputId)} class="${ssrRenderClass($props.hasLabel ? "lg:text-sm text-base-700 flex flex-wrap gap-x-5 items-center mb-1.5" : "sr-only")}"><span>${ssrInterpolate("Calcular frete")}</span>`);
9356
+ if ($props.hasLabel && _ctx.$settings.countryCode === "BR") {
9357
+ _push(ssrRenderComponent(_component_ALink, {
9358
+ href: "https://buscacepinter.correios.com.br/app/endereco/index.php",
9359
+ class: "ui-link text-base-500 text-xs font-normal"
9360
+ }, {
9361
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
9362
+ if (_push2) {
9363
+ _push2(` N\xE3o sei meu CEP <i class="i-arrow-top-right-on-square mr-1 opacity-50"${_scopeId}></i>`);
9364
+ } else {
9365
+ return [
9366
+ createTextVNode(" N\xE3o sei meu CEP "),
9367
+ createVNode("i", { class: "i-arrow-top-right-on-square mr-1 opacity-50" })
9368
+ ];
9369
+ }
9370
+ }),
9371
+ _: 1
9372
+ }, _parent));
9373
+ } else {
9374
+ _push(`<!---->`);
9375
+ }
9376
+ _push(`</label><div class="relative max-w-52"><input${ssrRenderAttr("id", $setup.zipInputId)} type="tel"${ssrIncludeBooleanAttr($setup.isFetching) ? " readonly" : ""}${ssrRenderAttr("value", $setup.zipCode)} placeholder="12345-123" class="${ssrRenderClass([$setup.isFetching && "bg-base-50", "w-full"])}"><button class="${ssrRenderClass([$setup.isMounted && !$setup.shippingServices.length && $setup.zipCode.length > 1 ? "text-primary" : `${$props.hasLabel ? "text-base-400" : "text-base-600"}`, "hover:text-primary group-focus-within:text-primary absolute inset-y-0 end-0 grid w-12 place-content-center text-xl"])}"${ssrRenderAttr("aria-label", "Calcular frete")}>`);
9377
+ if ($setup.isFetching) {
9378
+ _push(ssrRenderComponent($setup["Spinner"], { class: "size-5" }, null, _parent));
9379
+ } else {
9380
+ _push(`<i class="i-truck"></i>`);
9381
+ }
9382
+ _push(`</button></div></form>`);
9383
+ _push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
9384
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
9385
+ if (_push2) {
9386
+ if (!$setup.isFetching && $setup.shippingServices.length) {
9387
+ _push2(`<ul class="divide-base-200 bg-base-50/50 border-base-100 mt-2 grow divide-y rounded border px-3 py-1"${_scopeId}><!--[-->`);
9388
+ ssrRenderList($setup.shippingServices, ({ label, shipping_line: shipping }, i) => {
9389
+ _push2(`<li class="text-base-800 py-2.5 md:text-sm"${_scopeId}><div class="flex flex-wrap items-center"${_scopeId}><div class="grow"${_scopeId}><strong class="mr-2 font-semibold"${_scopeId}>${ssrInterpolate($setup.getShippingDeadline(shipping))}</strong><span class="mr-2"${_scopeId}>${ssrInterpolate($setup.getShippingPrice(shipping))}</span></div><small class="text-base-600"${_scopeId}>${ssrInterpolate(label)}</small></div>`);
9390
+ if (shipping.delivery_instructions) {
9391
+ _push2(`<small class="text-base-700"${_scopeId}>${ssrInterpolate(shipping.delivery_instructions)}</small>`);
9392
+ } else {
9393
+ _push2(`<!---->`);
9394
+ }
9395
+ _push2(`</li>`);
9396
+ });
9397
+ _push2(`<!--]--></ul>`);
9398
+ } else {
9399
+ _push2(`<!---->`);
9400
+ }
9401
+ } else {
9402
+ return [
9403
+ !$setup.isFetching && $setup.shippingServices.length ? (openBlock(), createBlock("ul", {
9404
+ key: 0,
9405
+ class: "divide-base-200 bg-base-50/50 border-base-100 mt-2 grow divide-y rounded border px-3 py-1"
9406
+ }, [
9407
+ (openBlock(true), createBlock(Fragment$1, null, renderList($setup.shippingServices, ({ label, shipping_line: shipping }, i) => {
9408
+ return openBlock(), createBlock("li", {
9409
+ key: `${$setup.zipCode}-${i}`,
9410
+ class: "text-base-800 py-2.5 md:text-sm"
9411
+ }, [
9412
+ createVNode("div", { class: "flex flex-wrap items-center" }, [
9413
+ createVNode("div", { class: "grow" }, [
9414
+ createVNode("strong", { class: "mr-2 font-semibold" }, toDisplayString($setup.getShippingDeadline(shipping)), 1),
9415
+ createVNode("span", { class: "mr-2" }, toDisplayString($setup.getShippingPrice(shipping)), 1)
9416
+ ]),
9417
+ createVNode("small", { class: "text-base-600" }, toDisplayString(label), 1)
9418
+ ]),
9419
+ shipping.delivery_instructions ? (openBlock(), createBlock("small", {
9420
+ key: 0,
9421
+ class: "text-base-700"
9422
+ }, toDisplayString(shipping.delivery_instructions), 1)) : createCommentVNode("", true)
9423
+ ]);
9424
+ }), 128))
9425
+ ])) : createCommentVNode("", true)
9426
+ ];
9427
+ }
9428
+ }),
9429
+ _: 1
9430
+ }, _parent));
9431
+ _push(`</div>`);
8037
9432
  }
8038
9433
  const _sfc_setup$6 = _sfc_main$6.setup;
8039
9434
  _sfc_main$6.setup = (props, ctx) => {
@@ -8046,7 +9441,8 @@ const ShippingCalculator = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender
8046
9441
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
8047
9442
  __name: "ProductDetails",
8048
9443
  props: {
8049
- product: { default: () => globalThis.$storefront.apiContext?.doc }
9444
+ product: { default: () => globalThis.$storefront.apiContext?.doc },
9445
+ cmsPreview: {}
8050
9446
  },
8051
9447
  setup(__props, { expose: __expose }) {
8052
9448
  __expose();
@@ -8089,7 +9485,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
8089
9485
  const addToCart = () => {
8090
9486
  if (!checkVariation())
8091
9487
  return;
8092
- addProductToCart(product, variationId.value ? variationId.value : void 0);
9488
+ addProductToCart(product, variationId.value || void 0, quantity.value);
8093
9489
  };
8094
9490
  const __returned__ = { props, product, title, isActive, quantity, params, hasSkuSelectionAlert, variationId, isSkuSelected, checkVariation, addToCart, CheckoutLink, QuantitySelector, Prices, ImagesGallery, SkuSelector, ShippingCalculator };
8095
9491
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
@@ -8098,15 +9494,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
8098
9494
  });
8099
9495
  function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8100
9496
  const _component_Fade = resolveComponent("Fade");
8101
- _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section relative grid grid-cols-1 items-start gap-5 md:gap-4 lg:grid-cols-4 2xl:gap-6" }, _attrs))}><div class="w-full lg:col-span-3">`);
9497
+ _push(`<section${ssrRenderAttrs(mergeProps({ class: "relative grid grid-cols-1 items-start gap-x-5 ui-section lg:grid-cols-4 lg:gap-x-4 2xl:gap-x-6" }, _attrs))}><div class="w-full lg:col-span-3">`);
8102
9498
  if ($setup.product.pictures?.length) {
8103
9499
  _push(ssrRenderComponent($setup["ImagesGallery"], {
8104
- pictures: $setup.product.pictures
9500
+ pictures: $setup.product.pictures,
9501
+ class: "mb-5"
8105
9502
  }, null, _parent));
8106
9503
  } else {
8107
9504
  _push(`<!---->`);
8108
9505
  }
8109
- _push(`</div><div class="lg:sticky-header:translate-y-14 top-0 py-4 transition-transform lg:sticky"><h1 class="text-secondary-900 ui-text-brand text-lg">${ssrInterpolate($setup.title)}</h1>`);
9506
+ _push(`</div><div class="top-0 pt-4 transition-transform lg:sticky lg:pb-4 lg:sticky-header:translate-y-14"><h1 class="text-lg text-secondary-900 ui-text-brand">${ssrInterpolate($setup.title)}</h1>`);
8110
9507
  if ($setup.isActive) {
8111
9508
  _push(`<div class="mt-5">`);
8112
9509
  _push(ssrRenderComponent($setup["Prices"], {
@@ -8128,7 +9525,7 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
8128
9525
  default: withCtx((_, _push2, _parent2, _scopeId) => {
8129
9526
  if (_push2) {
8130
9527
  if ($setup.hasSkuSelectionAlert) {
8131
- _push2(`<div class="ui-alert inline-block"${_scopeId}>${ssrInterpolate("Por favor selecione uma op\xE7\xE3o em cada campo acima")} <i class="i-arrow-right ml-1 -rotate-90"${_scopeId}></i></div>`);
9528
+ _push2(`<div class="inline-block ui-alert"${_scopeId}>${ssrInterpolate("Por favor selecione uma op\xE7\xE3o em cada campo acima")} <i class="ml-1 -rotate-90 i-arrow-right"${_scopeId}></i></div>`);
8132
9529
  } else {
8133
9530
  _push2(`<!---->`);
8134
9531
  }
@@ -8136,10 +9533,10 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
8136
9533
  return [
8137
9534
  $setup.hasSkuSelectionAlert ? (openBlock(), createBlock("div", {
8138
9535
  key: 0,
8139
- class: "ui-alert inline-block"
9536
+ class: "inline-block ui-alert"
8140
9537
  }, [
8141
9538
  createTextVNode(toDisplayString("Por favor selecione uma op\xE7\xE3o em cada campo acima") + " "),
8142
- createVNode("i", { class: "i-arrow-right ml-1 -rotate-90" })
9539
+ createVNode("i", { class: "ml-1 -rotate-90 i-arrow-right" })
8143
9540
  ])) : createCommentVNode("", true)
8144
9541
  ];
8145
9542
  }
@@ -8152,10 +9549,10 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
8152
9549
  "onUpdate:modelValue": ($event) => $setup.quantity = $event,
8153
9550
  min: $setup.product.min_quantity,
8154
9551
  max: $setup.product.quantity,
8155
- class: "border-base-100 rounded md:mr-5 lg:mb-2 lg:mr-auto lg:border-2"
9552
+ class: "rounded border-base-100 md:mr-5 lg:mb-2 lg:mr-auto lg:border-2"
8156
9553
  }, null, _parent));
8157
9554
  _push(ssrRenderComponent($setup["CheckoutLink"], {
8158
- class: "ui-btn-lg ui-btn-primary grow text-center",
9555
+ class: "grow text-center ui-btn-lg ui-btn-primary",
8159
9556
  to: "checkout",
8160
9557
  "cart-item": {
8161
9558
  product_id: $setup.product._id,
@@ -8167,19 +9564,22 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
8167
9564
  }, {
8168
9565
  default: withCtx((_, _push2, _parent2, _scopeId) => {
8169
9566
  if (_push2) {
8170
- _push2(`<i class="i-chevron-double-right mr-1"${_scopeId}></i> ${ssrInterpolate("Comprar")}`);
9567
+ _push2(`<i class="mr-1 i-chevron-double-right"${_scopeId}></i> ${ssrInterpolate("Comprar")}`);
8171
9568
  } else {
8172
9569
  return [
8173
- createVNode("i", { class: "i-chevron-double-right mr-1" }),
9570
+ createVNode("i", { class: "mr-1 i-chevron-double-right" }),
8174
9571
  createTextVNode(" " + toDisplayString("Comprar"))
8175
9572
  ];
8176
9573
  }
8177
9574
  }),
8178
9575
  _: 1
8179
9576
  }, _parent));
8180
- _push(`<button class="ui-btn-lg ui-btn-contrast grow"${ssrRenderAttr("data-tooltip", !$setup.isSkuSelected ? "Escolha os detalhes do produto para comprar" : null)}>${ssrInterpolate("Adicionar ao carrinho")}</button></div>`);
8181
- _push(ssrRenderComponent($setup["ShippingCalculator"], null, null, _parent));
8182
- _push(`</div>`);
9577
+ _push(`<button class="grow ui-btn-lg ui-btn-contrast"${ssrRenderAttr("data-tooltip", !$setup.isSkuSelected ? "Escolha os detalhes do produto para comprar" : null)}>${ssrInterpolate("Adicionar ao carrinho")}</button></div><div class="mt-6 rounded border-2 border-base-50 border-t-base-100 p-4 lg:mt-4">`);
9578
+ _push(ssrRenderComponent($setup["ShippingCalculator"], {
9579
+ "shipped-items": [{ ...$setup.product, quantity: $setup.quantity }],
9580
+ "has-label": ""
9581
+ }, null, _parent));
9582
+ _push(`</div></div>`);
8183
9583
  } else {
8184
9584
  _push(`<!---->`);
8185
9585
  }
@@ -8438,7 +9838,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
8438
9838
  resultMeta: {},
8439
9839
  ssrError: {},
8440
9840
  canUseUrlParams: { type: Boolean, default: true },
8441
- showcase: {}
9841
+ showcase: {},
9842
+ searchEngine: {},
9843
+ cmsPreview: {}
8442
9844
  },
8443
9845
  async setup(__props, { expose: __expose }) {
8444
9846
  __expose();
@@ -9029,12 +10431,17 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
9029
10431
  const { cmsContent } = routeContext;
9030
10432
  return renderTemplate`${maybeRenderHead()}<article class="mb-9 mt-6 md:mb-12 md:mt-8">
9031
10433
  ${sections.map(async ({ type, props }, index) => {
10434
+ if (cmsContent?.$filename) {
10435
+ props.cmsPreview = {
10436
+ contentFilename: cmsContent.$filename,
10437
+ sectionIndex: index
10438
+ };
10439
+ }
9032
10440
  switch (type) {
9033
10441
  case "product-shelf":
9034
- return index === 0 || index < 2 && !cmsContent?.hero?.slides.length ? renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}` : renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
9035
10442
  case "related-products":
9036
- props.isRelatedProducts = true;
9037
- return renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
10443
+ props.isRelatedProducts = type === "related-products";
10444
+ return renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:sf": "lazy,interaction", "client:component-hydration": "sf", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
9038
10445
  case "banners-grid":
9039
10446
  return renderTemplate`${renderComponent($$result, "BannersGrid", $$BannersGrid, { ...props })}`;
9040
10447
  case "breadcrumbs":
@@ -9046,13 +10453,13 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
9046
10453
  case "product-details":
9047
10454
  const { hasDescription, hasSpecifications, ...detailsProps } = props;
9048
10455
  return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
9049
- ${renderComponent($$result2, "ProductDetails", ProductDetails, { ...detailsProps, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/ProductDetails.vue", "client:component-export": "default" }, { "description": ($$result3) => renderTemplate`${renderComponent($$result3, "Fragment", Fragment, { "slot": "description" }, { "default": ($$result4) => renderTemplate`${hasDescription && renderTemplate`${renderComponent($$result4, "DocDescription", DocDescription, {})}`}${hasSpecifications && renderTemplate`${renderComponent($$result4, "ProductSpecifications", ProductSpecifications, {})}`}` })}` })}
10456
+ ${renderComponent($$result2, "ProductDetails", ProductDetails, { ...detailsProps, "client:sf": "load", "client:component-hydration": "sf", "client:component-path": "~/components/ProductDetails.vue", "client:component-export": "default" }, { "description": ($$result3) => renderTemplate`${renderComponent($$result3, "Fragment", Fragment, { "slot": "description" }, { "default": ($$result4) => renderTemplate`${hasDescription && renderTemplate`${renderComponent($$result4, "DocDescription", DocDescription, {})}`}${hasSpecifications && renderTemplate`${renderComponent($$result4, "ProductSpecifications", ProductSpecifications, {})}`}` })}` })}
9050
10457
  ` })}`;
9051
10458
  case "search-showcase":
9052
10459
  case "context-showcase":
9053
10460
  return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
9054
10461
  <article class="min-h-[500px]">
9055
- ${renderComponent($$result2, "SearchShowcase", SearchShowcase, { ...props, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/SearchShowcase.vue", "client:component-export": "default" })}
10462
+ ${renderComponent($$result2, "SearchShowcase", SearchShowcase, { ...props, "client:sf": "load", "client:component-hydration": "sf", "client:component-path": "~/components/SearchShowcase.vue", "client:component-export": "default" })}
9056
10463
  </article>
9057
10464
  ` })}`;
9058
10465
  case "page-title":
@@ -9169,4 +10576,4 @@ const ____slug_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
9169
10576
  url: $$url
9170
10577
  }, Symbol.toStringTag, { value: 'Module' }));
9171
10578
 
9172
- export { $$Base as $, ____slug_ as A, CheckoutLink as C, FooterStamps as F, Pagination as P, QuantitySelector as Q, SearchEngine as S, _export_sfc as _, $$BaseHead as a, $$PageHeader as b, $$PageFooter as c, $$Picture as d, i19shoppingCart as e, imageConfig as f, getConfig as g, assetsDir as h, i19myAccount as i, i19error as j, i19errorMsg as k, loadRouteContext as l, i19notFound as m, i19home as n, mod as o, createApp as p, clearAccents as q, getSearchUrl as r, searchHistory as s, ProductShelf as t, parseProduct as u, removeCartItem as v, Prices as w, freeShippingFromValue as x, shoppingCart as y, totalItems as z };
10579
+ export { $$Base as $, ShippingCalculator as A, ____slug_ as B, CheckoutLink as C, FooterStamps as F, Pagination as P, QuantitySelector as Q, SearchEngine as S, _export_sfc as _, $$BaseHead as a, $$PageHeader as b, $$PageFooter as c, $$Picture as d, i19shoppingCart as e, imageConfig as f, getConfig as g, assetsDir as h, i19myAccount as i, i19error as j, i19errorMsg as k, loadRouteContext as l, i19notFound as m, i19home as n, mod as o, createApp as p, clearAccents as q, getSearchUrl as r, searchHistory as s, ProductShelf as t, parseProduct as u, removeCartItem as v, Prices as w, freeShippingFromValue as x, shoppingCart as y, totalItems as z };