cloudcommerce 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/ecomplus-stores/monocard/functions/ssr/package.json +0 -2
  3. package/ecomplus-stores/tia-sonia/functions/ssr/package.json +0 -2
  4. package/package.json +6 -6
  5. package/packages/api/package.json +1 -1
  6. package/packages/apps/correios/package.json +2 -2
  7. package/packages/apps/custom-payment/package.json +1 -1
  8. package/packages/apps/custom-shipping/package.json +1 -1
  9. package/packages/apps/datafrete/package.json +2 -2
  10. package/packages/apps/discounts/package.json +1 -1
  11. package/packages/apps/emails/package.json +1 -1
  12. package/packages/apps/fb-conversions/package.json +1 -1
  13. package/packages/apps/frenet/package.json +2 -2
  14. package/packages/apps/galaxpay/package.json +2 -2
  15. package/packages/apps/google-analytics/package.json +2 -2
  16. package/packages/apps/infinitepay/package.json +2 -2
  17. package/packages/apps/jadlog/package.json +2 -2
  18. package/packages/apps/loyalty-points/package.json +1 -1
  19. package/packages/apps/melhor-envio/CHANGELOG.md +1 -0
  20. package/packages/apps/melhor-envio/README.md +1 -0
  21. package/packages/apps/melhor-envio/events.js +1 -0
  22. package/packages/apps/melhor-envio/lib/functions-lib/database.d.ts +18 -0
  23. package/packages/apps/melhor-envio/lib/functions-lib/database.js +115 -0
  24. package/packages/apps/melhor-envio/lib/functions-lib/database.js.map +1 -0
  25. package/packages/apps/melhor-envio/lib/functions-lib/events-to-melhor-envio.d.ts +7 -0
  26. package/packages/apps/melhor-envio/lib/functions-lib/events-to-melhor-envio.js +112 -0
  27. package/packages/apps/melhor-envio/lib/functions-lib/events-to-melhor-envio.js.map +1 -0
  28. package/packages/apps/melhor-envio/lib/functions-lib/new-label.d.ts +42 -0
  29. package/packages/apps/melhor-envio/lib/functions-lib/new-label.js +185 -0
  30. package/packages/apps/melhor-envio/lib/functions-lib/new-label.js.map +1 -0
  31. package/packages/apps/melhor-envio/lib/functions-lib/order-is-valid.d.ts +5 -0
  32. package/packages/apps/melhor-envio/lib/functions-lib/order-is-valid.js +40 -0
  33. package/packages/apps/melhor-envio/lib/functions-lib/order-is-valid.js.map +1 -0
  34. package/packages/apps/melhor-envio/lib/functions-lib/tracking-codes.d.ts +2 -0
  35. package/packages/apps/melhor-envio/lib/functions-lib/tracking-codes.js +164 -0
  36. package/packages/apps/melhor-envio/lib/functions-lib/tracking-codes.js.map +1 -0
  37. package/packages/apps/melhor-envio/lib/index.d.ts +1 -0
  38. package/packages/apps/melhor-envio/lib/index.js +2 -0
  39. package/packages/apps/melhor-envio/lib/index.js.map +1 -0
  40. package/packages/apps/melhor-envio/lib/melhor-envio-events.d.ts +6 -0
  41. package/packages/apps/melhor-envio/lib/melhor-envio-events.js +17 -0
  42. package/packages/apps/melhor-envio/lib/melhor-envio-events.js.map +1 -0
  43. package/packages/apps/melhor-envio/lib/melhor-envio.d.ts +2 -0
  44. package/packages/apps/melhor-envio/lib/melhor-envio.js +6 -0
  45. package/packages/apps/melhor-envio/lib/melhor-envio.js.map +1 -0
  46. package/packages/apps/melhor-envio/lib-mjs/calculate-melhor-envio.mjs +341 -0
  47. package/packages/apps/melhor-envio/lib-mjs/functions/client-melhor-envio.mjs +14 -0
  48. package/packages/apps/melhor-envio/lib-mjs/functions/error-handling.mjs +62 -0
  49. package/packages/apps/melhor-envio/lib-mjs/functions/new-shipment.mjs +119 -0
  50. package/packages/apps/melhor-envio/package.json +36 -0
  51. package/packages/apps/melhor-envio/src/functions-lib/database.ts +140 -0
  52. package/packages/apps/melhor-envio/src/functions-lib/events-to-melhor-envio.ts +137 -0
  53. package/packages/apps/melhor-envio/src/functions-lib/new-label.ts +214 -0
  54. package/packages/apps/melhor-envio/src/functions-lib/order-is-valid.ts +51 -0
  55. package/packages/apps/melhor-envio/src/functions-lib/tracking-codes.ts +191 -0
  56. package/packages/apps/melhor-envio/src/index.ts +1 -0
  57. package/packages/apps/melhor-envio/src/melhor-envio-events.ts +24 -0
  58. package/packages/apps/melhor-envio/src/melhor-envio.ts +7 -0
  59. package/packages/apps/melhor-envio/tsconfig.json +6 -0
  60. package/packages/apps/mercadopago/package.json +2 -2
  61. package/packages/apps/pagarme/package.json +2 -2
  62. package/packages/apps/paghiper/package.json +3 -3
  63. package/packages/apps/pix/package.json +2 -2
  64. package/packages/apps/tiny-erp/package.json +2 -2
  65. package/packages/cli/package.json +1 -1
  66. package/packages/config/package.json +1 -1
  67. package/packages/emails/package.json +3 -3
  68. package/packages/events/lib/firebase.js +2 -0
  69. package/packages/events/lib/firebase.js.map +1 -1
  70. package/packages/events/package.json +2 -1
  71. package/packages/events/src/firebase.ts +2 -0
  72. package/packages/firebase/lib/config.d.ts +4 -0
  73. package/packages/firebase/lib/config.js +7 -0
  74. package/packages/firebase/lib/config.js.map +1 -1
  75. package/packages/firebase/package.json +2 -2
  76. package/packages/firebase/src/config.ts +8 -0
  77. package/packages/i18n/lib/en_us/i19buyTogether.txt +1 -0
  78. package/packages/i18n/lib/en_us/i19buyTogetherWith.txt +1 -0
  79. package/packages/i18n/lib/en_us/i19report.txt +1 -0
  80. package/packages/i18n/lib/en_us/i19toggleMenu.txt +1 -0
  81. package/packages/i18n/lib/en_us/i19uponRequest.txt +1 -0
  82. package/packages/i18n/lib/en_us/i19usedPoints.txt +1 -0
  83. package/packages/i18n/lib/en_us.d.ts +6 -0
  84. package/packages/i18n/lib/en_us.js +6 -0
  85. package/packages/i18n/lib/en_us.js.map +1 -1
  86. package/packages/i18n/lib/pt_br/i19buyTogether.txt +1 -0
  87. package/packages/i18n/lib/pt_br/i19buyTogetherWith.txt +1 -0
  88. package/packages/i18n/lib/pt_br/i19report.txt +1 -0
  89. package/packages/i18n/lib/pt_br/i19toggleMenu.txt +1 -0
  90. package/packages/i18n/lib/pt_br/i19uponRequest.txt +1 -0
  91. package/packages/i18n/lib/pt_br/i19usedPoints.txt +1 -0
  92. package/packages/i18n/lib/pt_br.d.ts +6 -0
  93. package/packages/i18n/lib/pt_br.js +6 -0
  94. package/packages/i18n/lib/pt_br.js.map +1 -1
  95. package/packages/i18n/package.json +1 -1
  96. package/packages/i18n/src/en_us.ts +6 -0
  97. package/packages/i18n/src/pt_br.ts +6 -0
  98. package/packages/modules/lib/firebase/call-app-module.js +5 -0
  99. package/packages/modules/lib/firebase/call-app-module.js.map +1 -1
  100. package/packages/modules/package.json +3 -2
  101. package/packages/modules/src/firebase/call-app-module.ts +5 -0
  102. package/packages/passport/package.json +1 -1
  103. package/packages/ssr/package.json +3 -4
  104. package/packages/storefront/.eslintrc.cjs +1 -1
  105. package/packages/storefront/astro.config.mjs +8 -1
  106. package/packages/storefront/dist/client/_astro/PitchBar.209c6645.js +1 -0
  107. package/packages/storefront/dist/client/_astro/Prices.6fbcb5ac.js +1 -0
  108. package/packages/storefront/dist/client/_astro/Prices.vue_vue_type_script_setup_true_lang.44f23680.js +1 -0
  109. package/packages/storefront/dist/client/_astro/ProductCard.ee5eee91.js +1 -0
  110. package/packages/storefront/dist/client/_astro/ShopHeader.b801c785.js +1 -0
  111. package/packages/storefront/dist/client/_astro/_...slug_.32968ccf.css +1 -0
  112. package/packages/storefront/dist/client/_astro/client.5a46cc02.js +1 -0
  113. package/packages/storefront/dist/client/_astro/index.844a4059.js +1 -0
  114. package/packages/storefront/dist/client/_astro/{modules-info.dde776b4.js → modules-info.d9373e21.js} +1 -1
  115. package/packages/storefront/dist/client/_astro/runtime-core.esm-bundler.f04cee62.js +1 -0
  116. package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.00313542.js +1 -0
  117. package/packages/storefront/dist/client/_astro/server.60de185d.css +1 -0
  118. package/packages/storefront/dist/client/_astro/use-component-variant.58788b6e.js +1 -0
  119. package/packages/storefront/dist/client/fallback/index.html +13 -7
  120. package/packages/storefront/dist/client/sw.js +1 -1
  121. package/packages/storefront/dist/server/chunks/pages/{all.c27193d6.mjs → all.23de4e5c.mjs} +444 -186
  122. package/packages/storefront/dist/server/chunks/{prerender.89f63027.mjs → prerender.f40361a3.mjs} +0 -0
  123. package/packages/storefront/dist/server/entry.mjs +39 -4452
  124. package/packages/storefront/package.json +4 -5
  125. package/packages/storefront/src/lib/assets/base.css +16 -11
  126. package/packages/storefront/src/lib/components/Carousel.vue +52 -82
  127. package/packages/storefront/src/lib/components/Drawer.vue +103 -0
  128. package/packages/storefront/src/lib/components/PitchBar.vue +16 -11
  129. package/packages/storefront/src/lib/components/Prices.vue +5 -5
  130. package/packages/storefront/src/lib/components/ShopHeader.vue +82 -0
  131. package/packages/storefront/src/lib/components/StickyHeader.vue +71 -43
  132. package/packages/storefront/src/lib/components/globals/Fade.vue +10 -14
  133. package/packages/storefront/src/lib/composables/use-component-variant.ts +6 -2
  134. package/packages/storefront/src/lib/composables/use-prices.ts +4 -2
  135. package/packages/storefront/src/lib/layouts/BaseBody.astro +1 -0
  136. package/packages/storefront/src/lib/layouts/PagesHeader.astro +28 -13
  137. package/packages/storefront/tailwind.config.cjs +4 -0
  138. package/packages/storefront/uno.config.cjs +1 -1
  139. package/packages/types/package.json +1 -1
  140. package/packages/storefront/dist/client/_astro/PitchBar.f3579a5b.js +0 -1
  141. package/packages/storefront/dist/client/_astro/Prices.8e5cead5.js +0 -1
  142. package/packages/storefront/dist/client/_astro/Prices.vue_vue_type_script_setup_true_lang.b8cbeb54.js +0 -1
  143. package/packages/storefront/dist/client/_astro/ProductCard.6d8b6d86.js +0 -1
  144. package/packages/storefront/dist/client/_astro/StickyHeader.7b0f3963.js +0 -1
  145. package/packages/storefront/dist/client/_astro/_...slug_.97285eba.css +0 -1
  146. package/packages/storefront/dist/client/_astro/client.3e777d4c.js +0 -1
  147. package/packages/storefront/dist/client/_astro/runtime-core.esm-bundler.7cf33881.js +0 -1
  148. package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.1a4c7407.js +0 -1
  149. package/packages/storefront/dist/client/_astro/server.4d9646d8.css +0 -1
@@ -12,15 +12,14 @@ import 'node:stream';
12
12
  import 'slash';
13
13
  import { c as createAstro, a as createComponent, r as renderTemplate, b as addAttribute, d as renderComponent, u as unescapeHTML, F as Fragment, m as maybeRenderHead, e as renderSlot, f as renderHead, s as spreadAttributes } from '../astro.89bd9221.mjs';
14
14
  import api from '@cloudcommerce/api';
15
- import { reactive, computed, defineComponent, inject, mergeProps, useSSRContext, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, unref, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, toRefs, resolveComponent, toDisplayString, createTextVNode } from 'vue';
16
- import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrInterpolate, ssrRenderAttr } from 'vue/server-renderer';
15
+ import { reactive, computed, defineComponent, inject, mergeProps, useSSRContext, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, unref, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, resolveComponent, withModifiers, createTextVNode, toDisplayString } from 'vue';
16
+ import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrRenderTeleport, ssrIncludeBooleanAttr, ssrRenderAttr, ssrInterpolate } from 'vue/server-renderer';
17
17
  import { img, price, formatMoney, onPromotion } from '@ecomplus/utils';
18
18
  /* empty css */import { EventEmitter } from 'node:events';
19
19
  import fs, { readFileSync } from 'node:fs';
20
20
  import config from '@cloudcommerce/config';
21
21
  import { resolve as resolve$1 } from 'path';
22
- /* empty css */import 'lodash/debounce.js';
23
- import { useElementHover } from '@vueuse/core';
22
+ /* empty css */import { useScroll, useElementHover, useDebounceFn, useTimeout, promiseTimeout } from '@vueuse/core';
24
23
 
25
24
  function isOutputFormat(value) {
26
25
  return ["avif", "jpeg", "jpg", "png", "webp"].includes(value);
@@ -800,6 +799,7 @@ const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
800
799
  return renderTemplate`${maybeRenderHead($$result)}<body>
801
800
  ${renderSlot($$result, $$slots["default"])}
802
801
  ${renderSlot($$result, $$slots["before-body-end"])}
802
+ <div id="teleported"></div>
803
803
  </body>`;
804
804
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseBody.astro");
805
805
 
@@ -995,7 +995,7 @@ const parseShippingPhrase = (phrase) => {
995
995
 
996
996
  const carouselKey = Symbol("carousel");
997
997
 
998
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
998
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
999
999
  __name: "CarouselControl",
1000
1000
  __ssrInlineRender: true,
1001
1001
  props: {
@@ -1017,14 +1017,14 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1017
1017
  }
1018
1018
  });
1019
1019
 
1020
- const _sfc_setup$5 = _sfc_main$5.setup;
1021
- _sfc_main$5.setup = (props, ctx) => {
1020
+ const _sfc_setup$7 = _sfc_main$7.setup;
1021
+ _sfc_main$7.setup = (props, ctx) => {
1022
1022
  const ssrContext = useSSRContext();
1023
1023
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CarouselControl.vue");
1024
- return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
1024
+ return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
1025
1025
  };
1026
1026
 
1027
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1027
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1028
1028
  __name: "Carousel",
1029
1029
  __ssrInlineRender: true,
1030
1030
  props: {
@@ -1033,50 +1033,27 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1033
1033
  autoplay: null
1034
1034
  },
1035
1035
  emits: [
1036
- "update:modelValue",
1037
- "bound-left",
1038
- "bound-right"
1036
+ "update:modelValue"
1039
1037
  ],
1040
1038
  setup(__props, { emit }) {
1041
1039
  const props = __props;
1042
- const approximatelyEqual = (v1, v2, epsilon) => {
1043
- return Math.abs(v1 - v2) <= epsilon;
1044
- };
1045
- const currentPage = ref(props.modelValue - 1);
1040
+ const currentIndex = ref(props.modelValue - 1);
1046
1041
  watch(toRef(props, "modelValue"), (modelValue) => {
1047
- currentPage.value = modelValue - 1;
1042
+ currentIndex.value = modelValue - 1;
1048
1043
  });
1049
- watch(currentPage, (current, previous) => {
1044
+ watch(currentIndex, (current, previous) => {
1050
1045
  if (current !== previous) {
1051
1046
  emit("update:modelValue", current + 1);
1052
1047
  }
1053
1048
  });
1054
1049
  const wrapper = ref(null);
1055
- const isBoundLeft = ref(true);
1056
- const isBoundRight = ref(false);
1050
+ const { x: currentPos, isScrolling, arrivedState } = useScroll(wrapper);
1051
+ const isBoundLeft = computed(() => arrivedState.left);
1052
+ const isBoundRight = computed(() => arrivedState.right);
1057
1053
  const slidesWidth = ref([]);
1058
1054
  const wrapperScrollWidth = ref(0);
1059
1055
  const wrapperVisibleWidth = ref(0);
1060
- const currentPos = ref(0);
1061
- const maxPages = ref(0);
1062
- ref(null);
1063
- ref(null);
1064
- const calcBounds = () => {
1065
- const _isBoundLeft = approximatelyEqual(currentPos.value, 0, 5);
1066
- const _isBoundRight = approximatelyEqual(
1067
- wrapperScrollWidth.value - wrapperVisibleWidth.value,
1068
- currentPos.value,
1069
- 5
1070
- );
1071
- if (_isBoundLeft) {
1072
- emit("bound-left", true);
1073
- }
1074
- isBoundLeft.value = _isBoundLeft;
1075
- if (_isBoundRight) {
1076
- emit("bound-right", true);
1077
- }
1078
- isBoundRight.value = _isBoundRight;
1079
- };
1056
+ const indexCount = ref(0);
1080
1057
  const calcWrapperWidth = () => {
1081
1058
  wrapperScrollWidth.value = wrapper.value.scrollWidth;
1082
1059
  wrapperVisibleWidth.value = wrapper.value.offsetWidth;
@@ -1089,38 +1066,24 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1089
1066
  }));
1090
1067
  };
1091
1068
  const calcNextWidth = (direction) => {
1092
- const nextSlideIndex = direction > 0 ? currentPage.value : currentPage.value + direction;
1093
- const width = slidesWidth.value[nextSlideIndex].width || 0;
1069
+ const nextSlideIndex = direction > 0 ? currentIndex.value : currentIndex.value + direction;
1070
+ const width = slidesWidth.value[nextSlideIndex]?.width || 0;
1094
1071
  if (!width) {
1095
1072
  return 0;
1096
1073
  }
1097
1074
  return width * direction;
1098
1075
  };
1099
- const calcCurrentPage = () => {
1100
- const getCurrentPage = slidesWidth.value.findIndex((slide) => {
1101
- return approximatelyEqual(slide.offsetLeft, currentPos.value, 5);
1076
+ const calcCurrentIndex = () => {
1077
+ const getCurrentIndex = slidesWidth.value.findIndex((slide) => {
1078
+ return Math.abs(slide.offsetLeft - currentPos.value) <= 5;
1102
1079
  });
1103
- if (getCurrentPage !== -1 && getCurrentPage !== -2) {
1104
- currentPage.value = getCurrentPage || 0;
1080
+ if (getCurrentIndex > -1) {
1081
+ currentIndex.value = getCurrentIndex || 0;
1105
1082
  }
1106
1083
  };
1107
- const calcCurrentPosition = () => {
1108
- currentPos.value = wrapper.value.scrollLeft || 0;
1109
- };
1110
- const calcMaxPages = () => {
1084
+ const calcIndexCount = () => {
1111
1085
  const maxPos = wrapperScrollWidth.value - wrapperVisibleWidth.value;
1112
- maxPages.value = slidesWidth.value.findIndex(({ offsetLeft }) => offsetLeft >= maxPos);
1113
- };
1114
- const calcOnInit = () => {
1115
- if (!wrapper.value) {
1116
- return;
1117
- }
1118
- calcWrapperWidth();
1119
- calcSlidesWidth();
1120
- calcCurrentPosition();
1121
- calcCurrentPage();
1122
- calcBounds();
1123
- calcMaxPages();
1086
+ indexCount.value = slidesWidth.value.findIndex(({ offsetLeft }) => offsetLeft >= maxPos - 5);
1124
1087
  };
1125
1088
  let autoplayTimer = null;
1126
1089
  const restartAutoplay = () => {
@@ -1134,13 +1097,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1134
1097
  const changeSlide = (direction) => {
1135
1098
  if (direction < 0) {
1136
1099
  if (isBoundLeft.value) {
1137
- calcMaxPages();
1138
- currentPage.value = maxPages.value - 1;
1100
+ calcIndexCount();
1101
+ currentIndex.value = indexCount.value - 1;
1139
1102
  changeSlide(1);
1140
1103
  return;
1141
1104
  }
1142
1105
  } else if (isBoundRight.value) {
1143
- currentPage.value = 1;
1106
+ currentIndex.value = 1;
1144
1107
  changeSlide(-1);
1145
1108
  return;
1146
1109
  }
@@ -1150,6 +1113,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1150
1113
  restartAutoplay();
1151
1114
  }
1152
1115
  };
1116
+ watch(isScrolling, (_isScrolling) => {
1117
+ if (_isScrolling) {
1118
+ clearTimeout(autoplayTimer);
1119
+ } else {
1120
+ calcCurrentIndex();
1121
+ restartAutoplay();
1122
+ }
1123
+ });
1153
1124
  const carousel = ref(null);
1154
1125
  const isHovered = useElementHover(carousel);
1155
1126
  watch(isHovered, (_isHovered) => {
@@ -1159,10 +1130,21 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1159
1130
  restartAutoplay();
1160
1131
  }
1161
1132
  });
1133
+ const calcOnInit = () => {
1134
+ if (!wrapper.value) {
1135
+ return;
1136
+ }
1137
+ calcWrapperWidth();
1138
+ calcSlidesWidth();
1139
+ calcCurrentIndex();
1140
+ calcIndexCount();
1141
+ };
1142
+ useDebounceFn(calcOnInit, 400);
1162
1143
  onMounted(() => {
1163
1144
  calcOnInit();
1164
1145
  });
1165
1146
  onBeforeUnmount(() => {
1147
+ clearTimeout(autoplayTimer);
1166
1148
  });
1167
1149
  provide(carouselKey, {
1168
1150
  autoplay: toRef(props, "autoplay"),
@@ -1192,8 +1174,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1192
1174
  }),
1193
1175
  _: 3
1194
1176
  }), _parent);
1195
- ssrRenderSlot(_ctx.$slots, "controls", { changeSlide, isBoundLeft: isBoundLeft.value, isBoundRight: isBoundRight.value }, () => {
1196
- _push(ssrRenderComponent(_sfc_main$5, { direction: -1 }, {
1177
+ ssrRenderSlot(_ctx.$slots, "controls", {
1178
+ changeSlide,
1179
+ isBoundLeft: unref(isBoundLeft),
1180
+ isBoundRight: unref(isBoundRight),
1181
+ currentPage: currentIndex.value + 1,
1182
+ pageCount: indexCount.value + 1
1183
+ }, () => {
1184
+ _push(ssrRenderComponent(_sfc_main$7, { direction: -1 }, {
1197
1185
  default: withCtx((_, _push2, _parent2, _scopeId) => {
1198
1186
  if (_push2) {
1199
1187
  ssrRenderSlot(_ctx.$slots, "previous", {}, null, _push2, _parent2, _scopeId);
@@ -1205,7 +1193,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1205
1193
  }),
1206
1194
  _: 3
1207
1195
  }, _parent));
1208
- _push(ssrRenderComponent(_sfc_main$5, null, {
1196
+ _push(ssrRenderComponent(_sfc_main$7, null, {
1209
1197
  default: withCtx((_, _push2, _parent2, _scopeId) => {
1210
1198
  if (_push2) {
1211
1199
  ssrRenderSlot(_ctx.$slots, "next", {}, null, _push2, _parent2, _scopeId);
@@ -1223,14 +1211,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1223
1211
  }
1224
1212
  });
1225
1213
 
1226
- const _sfc_setup$4 = _sfc_main$4.setup;
1227
- _sfc_main$4.setup = (props, ctx) => {
1214
+ const _sfc_setup$6 = _sfc_main$6.setup;
1215
+ _sfc_main$6.setup = (props, ctx) => {
1228
1216
  const ssrContext = useSSRContext();
1229
1217
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Carousel.vue");
1230
- return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
1218
+ return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
1231
1219
  };
1232
1220
 
1233
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1221
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1234
1222
  __name: "PitchBar",
1235
1223
  __ssrInlineRender: true,
1236
1224
  props: {
@@ -1248,31 +1236,38 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1248
1236
  });
1249
1237
  return (_ctx, _push, _parent, _attrs) => {
1250
1238
  _push(`<div${ssrRenderAttrs(mergeProps({
1251
- "data-pitch-bar": "",
1252
- class: "bg-base-100"
1239
+ class: "bg-base-100",
1240
+ "data-pitch-bar": ""
1253
1241
  }, _attrs))}><div class="container md:w-2/3 mx-auto px-3 py-1">`);
1254
- _push(ssrRenderComponent(_sfc_main$4, {
1242
+ _push(ssrRenderComponent(_sfc_main$6, {
1255
1243
  autoplay: unref(countValidSlides) > 1 ? 7e3 : null
1256
1244
  }, {
1257
1245
  controls: withCtx((_, _push2, _parent2, _scopeId) => {
1258
1246
  if (_push2) {
1259
- _push2(`<div style="${ssrRenderStyle(unref(countValidSlides) > 1 ? null : { display: "none" })}" class="text-xl leading-none text-base-400"${_scopeId}>`);
1260
- _push2(ssrRenderComponent(_sfc_main$5, {
1261
- direction: -1,
1262
- class: "pr-2 bg-base-100 hover:text-base-700"
1263
- }, null, _parent2, _scopeId));
1264
- _push2(ssrRenderComponent(_sfc_main$5, { class: "pl-2 bg-base-100 hover:text-base-700" }, null, _parent2, _scopeId));
1265
- _push2(`</div>`);
1247
+ ssrRenderSlot(_ctx.$slots, "controls", { countValidSlides: unref(countValidSlides) }, () => {
1248
+ _push2(`<div style="${ssrRenderStyle(unref(countValidSlides) > 1 ? null : { display: "none" })}" class="text-xl leading-none text-base-400" data-pitch-bar-controls${_scopeId}>`);
1249
+ _push2(ssrRenderComponent(_sfc_main$7, {
1250
+ direction: -1,
1251
+ class: "pr-2 bg-base-100 hover:text-base-700"
1252
+ }, null, _parent2, _scopeId));
1253
+ _push2(ssrRenderComponent(_sfc_main$7, { class: "pl-2 bg-base-100 hover:text-base-700" }, null, _parent2, _scopeId));
1254
+ _push2(`</div>`);
1255
+ }, _push2, _parent2, _scopeId);
1266
1256
  } else {
1267
1257
  return [
1268
- withDirectives(createVNode("div", { class: "text-xl leading-none text-base-400" }, [
1269
- createVNode(_sfc_main$5, {
1270
- direction: -1,
1271
- class: "pr-2 bg-base-100 hover:text-base-700"
1272
- }),
1273
- createVNode(_sfc_main$5, { class: "pl-2 bg-base-100 hover:text-base-700" })
1274
- ], 512), [
1275
- [vShow, unref(countValidSlides) > 1]
1258
+ renderSlot$1(_ctx.$slots, "controls", { countValidSlides: unref(countValidSlides) }, () => [
1259
+ withDirectives(createVNode("div", {
1260
+ class: "text-xl leading-none text-base-400",
1261
+ "data-pitch-bar-controls": ""
1262
+ }, [
1263
+ createVNode(_sfc_main$7, {
1264
+ direction: -1,
1265
+ class: "pr-2 bg-base-100 hover:text-base-700"
1266
+ }),
1267
+ createVNode(_sfc_main$7, { class: "pl-2 bg-base-100 hover:text-base-700" })
1268
+ ], 512), [
1269
+ [vShow, unref(countValidSlides) > 1]
1270
+ ])
1276
1271
  ])
1277
1272
  ];
1278
1273
  }
@@ -1285,13 +1280,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1285
1280
  ssrRenderVNode(_push2, createVNode(resolveDynamicComponent(slide.href ? "ALink" : "span"), {
1286
1281
  href: slide.href,
1287
1282
  target: slide.target,
1288
- class: slide.href ? "hover:underline" : null
1283
+ class: ["inline-block px-8", slide.href ? "hover:underline" : null]
1289
1284
  }, {
1290
1285
  default: withCtx((_2, _push3, _parent3, _scopeId2) => {
1291
1286
  if (_push3) {
1292
1287
  ssrRenderSlot(_ctx.$slots, "slide", { slide, i, parsedContents: unref(parsedContents) }, () => {
1293
1288
  if (unref(parsedContents)[i]) {
1294
- _push3(`<span class="prose text-sm text-base-800"${_scopeId2}>${unref(parsedContents)[i]}</span>`);
1289
+ _push3(`<span class="prose text-sm text-base-800" data-pitch-bar-slide${_scopeId2}>${unref(parsedContents)[i]}</span>`);
1295
1290
  } else {
1296
1291
  _push3(`<!---->`);
1297
1292
  }
@@ -1302,7 +1297,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1302
1297
  unref(parsedContents)[i] ? (openBlock(), createBlock("span", {
1303
1298
  key: 0,
1304
1299
  innerHTML: unref(parsedContents)[i],
1305
- class: "prose text-sm text-base-800"
1300
+ class: "prose text-sm text-base-800",
1301
+ "data-pitch-bar-slide": ""
1306
1302
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true)
1307
1303
  ])
1308
1304
  ];
@@ -1320,14 +1316,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1320
1316
  (openBlock(), createBlock(resolveDynamicComponent(slide.href ? "ALink" : "span"), {
1321
1317
  href: slide.href,
1322
1318
  target: slide.target,
1323
- class: slide.href ? "hover:underline" : null
1319
+ class: ["inline-block px-8", slide.href ? "hover:underline" : null]
1324
1320
  }, {
1325
1321
  default: withCtx(() => [
1326
1322
  renderSlot$1(_ctx.$slots, "slide", { slide, i, parsedContents: unref(parsedContents) }, () => [
1327
1323
  unref(parsedContents)[i] ? (openBlock(), createBlock("span", {
1328
1324
  key: 0,
1329
1325
  innerHTML: unref(parsedContents)[i],
1330
- class: "prose text-sm text-base-800"
1326
+ class: "prose text-sm text-base-800",
1327
+ "data-pitch-bar-slide": ""
1331
1328
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true)
1332
1329
  ])
1333
1330
  ]),
@@ -1345,86 +1342,354 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1345
1342
  }
1346
1343
  });
1347
1344
 
1348
- const _sfc_setup$3 = _sfc_main$3.setup;
1349
- _sfc_main$3.setup = (props, ctx) => {
1345
+ const _sfc_setup$5 = _sfc_main$5.setup;
1346
+ _sfc_main$5.setup = (props, ctx) => {
1350
1347
  const ssrContext = useSSRContext();
1351
1348
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/PitchBar.vue");
1352
- return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
1349
+ return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
1353
1350
  };
1354
1351
 
1355
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1356
- __name: "StickyHeader",
1352
+ const i19myAccount = "Minha conta";
1353
+ const i19openCart = "Abrir carrinho";
1354
+ const i19searchProducts = "Buscar produtos";
1355
+
1356
+ const useComponentVariant = (props, stringProps) => {
1357
+ return computed(() => {
1358
+ let variantName = "";
1359
+ Object.keys(props).forEach((prop) => {
1360
+ if (props[prop] === true && prop !== "modelValue") {
1361
+ variantName += ` ${prop.replace(/^(is|has)/, "")}`;
1362
+ } else if (stringProps && stringProps.includes(prop)) {
1363
+ variantName += ` ${prop}:${props[prop]}`;
1364
+ }
1365
+ });
1366
+ return variantName.slice(1);
1367
+ });
1368
+ };
1369
+
1370
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1371
+ __name: "Drawer",
1357
1372
  __ssrInlineRender: true,
1358
1373
  props: {
1359
- logo: null,
1360
- logoAltHeading: { default: "h2" }
1374
+ modelValue: { type: Boolean, default: false },
1375
+ placement: { default: "start" },
1376
+ isTeleported: { type: Boolean, default: false },
1377
+ hasCloseButton: { type: Boolean, default: true }
1361
1378
  },
1362
- setup(__props) {
1379
+ emits: [
1380
+ "update:modelValue"
1381
+ ],
1382
+ setup(__props, { emit }) {
1363
1383
  const props = __props;
1364
- const { logo } = toRefs(props);
1365
- const fade = ref(false);
1366
- setTimeout(() => {
1367
- fade.value = true;
1368
- }, 2e3);
1384
+ const close = () => emit("update:modelValue", false);
1385
+ const anchor = ref(null);
1386
+ const canvas = ref(null);
1387
+ const outsideClickListener = (ev) => {
1388
+ if (!canvas.value?.contains(ev.target)) {
1389
+ close();
1390
+ }
1391
+ };
1392
+ const escClickListener = (ev) => {
1393
+ if (ev.key === "Escape") {
1394
+ close();
1395
+ }
1396
+ };
1397
+ watch(toRef(props, "modelValue"), async (isOpen) => {
1398
+ const header = anchor.value.closest('[class*="backdrop-"]');
1399
+ if (isOpen) {
1400
+ document.body.style.overflow = "hidden";
1401
+ if (header) {
1402
+ header.style.backdropFilter = "none";
1403
+ }
1404
+ setTimeout(() => {
1405
+ document.addEventListener("click", outsideClickListener, { passive: true });
1406
+ document.addEventListener("keydown", escClickListener, { passive: true });
1407
+ }, 500);
1408
+ } else {
1409
+ document.body.style.overflow = null;
1410
+ if (header) {
1411
+ setTimeout(() => {
1412
+ header.style.backdropFilter = null;
1413
+ }, 500);
1414
+ }
1415
+ document.removeEventListener("click", outsideClickListener);
1416
+ document.removeEventListener("keydown", escClickListener);
1417
+ }
1418
+ });
1419
+ const slideTo = computed(() => {
1420
+ switch (props.placement) {
1421
+ case "start":
1422
+ return "left";
1423
+ case "end":
1424
+ return "right";
1425
+ case "top":
1426
+ return "up";
1427
+ default:
1428
+ return "down";
1429
+ }
1430
+ });
1431
+ const componentVariant = useComponentVariant(props, ["placement"]);
1369
1432
  return (_ctx, _push, _parent, _attrs) => {
1370
1433
  const _component_Fade = resolveComponent("Fade");
1371
- _push(`<header${ssrRenderAttrs(mergeProps({
1372
- class: "header bg-opacity-90 backdrop-blur-md sticky top-0 z-50 py-1 sm:py-2",
1373
- "data-sticky-header": ""
1374
- }, _attrs))}><div class="container"><div class="grid grid-flow-col auto-cols-max justify-between items-center">`);
1375
- ssrRenderSlot(_ctx.$slots, "aside", {}, () => {
1376
- _push(`<div class="header__aside md:hidden"><div class="i-bars-3-bottom-left"></div></div>`);
1377
- }, _push, _parent);
1378
- ssrRenderSlot(_ctx.$slots, "logo", { logo: unref(logo) }, () => {
1379
- if (unref(logo)) {
1380
- _push(`<a href="/">`);
1381
- ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(logo).alt && __props.logoAltHeading || "span"), { class: "m-0" }, {
1382
- default: withCtx((_, _push2, _parent2, _scopeId) => {
1383
- if (_push2) {
1384
- _push2(`<img${ssrRenderAttrs(unref(logo))}${_scopeId}>`);
1385
- } else {
1386
- return [
1387
- createVNode("img", unref(logo), null, 16)
1388
- ];
1389
- }
1390
- }),
1391
- _: 1
1392
- }), _parent);
1393
- _push(`</a>`);
1394
- } else {
1395
- _push(`<!---->`);
1396
- }
1397
- }, _push, _parent);
1398
- _push(`<div class="flex items-center">`);
1399
- ssrRenderSlot(_ctx.$slots, "actions", {}, () => {
1400
- ssrRenderSlot(_ctx.$slots, "nav", {}, () => {
1401
- _push(ssrRenderComponent(_component_Fade, {
1402
- speed: "slow",
1403
- slide: "down"
1404
- }, {
1405
- default: withCtx((_, _push2, _parent2, _scopeId) => {
1406
- if (_push2) {
1407
- if (fade.value) {
1408
- _push2(`<div class="h-20 bg-primary w-20"${_scopeId}> Fadiiing </div>`);
1434
+ _push(`<div${ssrRenderAttrs(mergeProps({
1435
+ ref_key: "anchor",
1436
+ ref: anchor,
1437
+ class: "relative"
1438
+ }, _attrs))}>`);
1439
+ ssrRenderTeleport(_push, (_push2) => {
1440
+ _push2(ssrRenderComponent(_component_Fade, {
1441
+ slide: unref(slideTo),
1442
+ speed: "slow",
1443
+ "is-floating": ""
1444
+ }, {
1445
+ default: withCtx((_, _push3, _parent2, _scopeId) => {
1446
+ if (_push3) {
1447
+ if (__props.modelValue) {
1448
+ _push3(`<dialog class="${ssrRenderClass([__props.isTeleported ? "fixed top-0 left-0" : "absolute", "w-screen max-w-sm p-0 z-50"])}"${ssrIncludeBooleanAttr(__props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", unref(componentVariant))}${_scopeId}><div class="relative"${_scopeId}>`);
1449
+ if (__props.hasCloseButton) {
1450
+ _push3(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([__props.placement === "end" ? "left-2" : "right-2", "absolute top-2"])}" data-drawer-close${_scopeId}>`);
1451
+ ssrRenderSlot(_ctx.$slots, "close", {}, () => {
1452
+ _push3(`<i class="i-close text-base-400 text-3xl"${_scopeId}></i>`);
1453
+ }, _push3, _parent2, _scopeId);
1454
+ _push3(`</button>`);
1409
1455
  } else {
1410
- _push2(`<!---->`);
1456
+ _push3(`<!---->`);
1411
1457
  }
1458
+ ssrRenderSlot(_ctx.$slots, "default", {}, null, _push3, _parent2, _scopeId);
1459
+ _push3(`</div></dialog>`);
1412
1460
  } else {
1413
- return [
1414
- fade.value ? (openBlock(), createBlock("div", {
1415
- key: 0,
1416
- class: "h-20 bg-primary w-20"
1417
- }, " Fadiiing ")) : createCommentVNode("", true)
1418
- ];
1461
+ _push3(`<!---->`);
1419
1462
  }
1420
- }),
1421
- _: 1
1422
- }, _parent));
1423
- }, _push, _parent);
1424
- ssrRenderSlot(_ctx.$slots, "search", {}, null, _push, _parent);
1425
- ssrRenderSlot(_ctx.$slots, "buttons", {}, null, _push, _parent);
1426
- }, _push, _parent);
1427
- _push(`</div></div></div></header>`);
1463
+ } else {
1464
+ return [
1465
+ __props.modelValue ? (openBlock(), createBlock("dialog", {
1466
+ key: 0,
1467
+ class: ["w-screen max-w-sm p-0 z-50", __props.isTeleported ? "fixed top-0 left-0" : "absolute"],
1468
+ open: __props.modelValue,
1469
+ "data-drawer": unref(componentVariant)
1470
+ }, [
1471
+ createVNode("div", {
1472
+ ref_key: "canvas",
1473
+ ref: canvas,
1474
+ class: "relative"
1475
+ }, [
1476
+ __props.hasCloseButton ? (openBlock(), createBlock("button", {
1477
+ key: 0,
1478
+ type: "button",
1479
+ "aria-label": "Fechar",
1480
+ onClick: withModifiers(close, ["prevent"]),
1481
+ class: ["absolute top-2", __props.placement === "end" ? "left-2" : "right-2"],
1482
+ "data-drawer-close": ""
1483
+ }, [
1484
+ renderSlot$1(_ctx.$slots, "close", {}, () => [
1485
+ createVNode("i", { class: "i-close text-base-400 text-3xl" })
1486
+ ])
1487
+ ], 10, ["onClick"])) : createCommentVNode("", true),
1488
+ renderSlot$1(_ctx.$slots, "default")
1489
+ ], 512)
1490
+ ], 10, ["open", "data-drawer"])) : createCommentVNode("", true)
1491
+ ];
1492
+ }
1493
+ }),
1494
+ _: 3
1495
+ }, _parent));
1496
+ }, "#teleported", !__props.isTeleported, _parent);
1497
+ _push(`</div>`);
1498
+ };
1499
+ }
1500
+ });
1501
+
1502
+ const _sfc_setup$4 = _sfc_main$4.setup;
1503
+ _sfc_main$4.setup = (props, ctx) => {
1504
+ const ssrContext = useSSRContext();
1505
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Drawer.vue");
1506
+ return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
1507
+ };
1508
+
1509
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1510
+ __name: "StickyHeader",
1511
+ __ssrInlineRender: true,
1512
+ props: {
1513
+ isShownOnScrollDown: { type: Boolean }
1514
+ },
1515
+ setup(__props) {
1516
+ const props = __props;
1517
+ ref(null);
1518
+ const { ready, start } = useTimeout(100, { controls: true, immediate: false });
1519
+ const height = ref(0);
1520
+ const { y } = { y: ref(0) };
1521
+ const isSticky = computed(() => ready.value && y.value > height.value * 1.5);
1522
+ const transition = ref("none");
1523
+ watch(isSticky, async (isSetSticky) => {
1524
+ if (!isSetSticky) {
1525
+ start();
1526
+ transition.value = "none";
1527
+ } else {
1528
+ await promiseTimeout(300);
1529
+ transition.value = "opacity var(--transition-slow), transform var(--transition)";
1530
+ }
1531
+ });
1532
+ const isScrollUp = ref(false);
1533
+ watch(y, (newY, oldY) => {
1534
+ isScrollUp.value = newY > 0 && newY < oldY;
1535
+ });
1536
+ const componentVariant = useComponentVariant(reactive({
1537
+ ...props,
1538
+ isSticky,
1539
+ isScrollUp
1540
+ }));
1541
+ return (_ctx, _push, _parent, _attrs) => {
1542
+ _push(`<!--[--><div style="${ssrRenderStyle(unref(isSticky) ? `height: ${height.value}px` : null)}"></div><header class="${ssrRenderClass([{
1543
+ "sticky bg-white/80 backdrop-blur-md shadow py-2 md:py-3": unref(isSticky),
1544
+ "opacity-0 -translate-y-full": unref(isSticky) && (!isScrollUp.value || __props.isShownOnScrollDown),
1545
+ "py-3 sm:py-4 md:py-5": !unref(isSticky)
1546
+ }, "z-50 top-0 will-change-transform"])}" style="${ssrRenderStyle({ transition: transition.value })}"${ssrRenderAttr("data-sticky-header", unref(componentVariant))}>`);
1547
+ ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
1548
+ _push(`</header><!--]-->`);
1549
+ };
1550
+ }
1551
+ });
1552
+
1553
+ const _sfc_setup$3 = _sfc_main$3.setup;
1554
+ _sfc_main$3.setup = (props, ctx) => {
1555
+ const ssrContext = useSSRContext();
1556
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/StickyHeader.vue");
1557
+ return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
1558
+ };
1559
+
1560
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1561
+ __name: "ShopHeader",
1562
+ __ssrInlineRender: true,
1563
+ setup(__props) {
1564
+ const buttons = ref({
1565
+ search: {
1566
+ icon: "i-search",
1567
+ onClick: () => {
1568
+ },
1569
+ label: i19searchProducts
1570
+ },
1571
+ account: {
1572
+ icon: "i-account",
1573
+ onClick: () => {
1574
+ },
1575
+ label: i19myAccount
1576
+ },
1577
+ cart: {
1578
+ icon: "i-shopping-cart",
1579
+ onClick: () => {
1580
+ },
1581
+ label: i19openCart
1582
+ }
1583
+ });
1584
+ const isSidenavOpen = ref(false);
1585
+ return (_ctx, _push, _parent, _attrs) => {
1586
+ _push(ssrRenderComponent(_sfc_main$3, _attrs, {
1587
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
1588
+ if (_push2) {
1589
+ _push2(`<div class="container lg:max-w-7xl mx-auto px-1 lg:pl-3 grid grid-flow-col grid-cols-3 justify-between items-center md:grid-cols-none md:auto-cols-max" data-header${_scopeId}>`);
1590
+ ssrRenderSlot(_ctx.$slots, "sidenav-toggle", {}, () => {
1591
+ _push2(`<div class="md:hidden" data-sidenav-toggle${_scopeId}><button class="px-2 my-1"${ssrRenderAttr("aria-label", "Abrir/fechar menu")}${_scopeId}>`);
1592
+ ssrRenderSlot(_ctx.$slots, "sidenav-toggle-content", {}, () => {
1593
+ _push2(`<i class="i-menu text-base-500 text-3xl"${_scopeId}></i>`);
1594
+ }, _push2, _parent2, _scopeId);
1595
+ _push2(`</button>`);
1596
+ _push2(ssrRenderComponent(_sfc_main$4, {
1597
+ modelValue: isSidenavOpen.value,
1598
+ "onUpdate:modelValue": ($event) => isSidenavOpen.value = $event,
1599
+ class: "-ml-1 lg:-ml-3"
1600
+ }, {
1601
+ default: withCtx((_2, _push3, _parent3, _scopeId2) => {
1602
+ if (_push3) {
1603
+ _push3(` MENU `);
1604
+ } else {
1605
+ return [
1606
+ createTextVNode(" MENU ")
1607
+ ];
1608
+ }
1609
+ }),
1610
+ _: 1
1611
+ }, _parent2, _scopeId));
1612
+ _push2(`</div>`);
1613
+ }, _push2, _parent2, _scopeId);
1614
+ ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push2, _parent2, _scopeId);
1615
+ ssrRenderSlot(_ctx.$slots, "nav", {}, null, _push2, _parent2, _scopeId);
1616
+ ssrRenderSlot(_ctx.$slots, "buttons", {}, () => {
1617
+ _push2(`<div class="px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800" data-header-buttons${_scopeId}><!--[-->`);
1618
+ ssrRenderList(buttons.value, ({ icon, onClick, label }, name) => {
1619
+ ssrRenderSlot(_ctx.$slots, "button", mergeProps({ key: name }, { name, icon, onClick }), () => {
1620
+ _push2(`<button class="${ssrRenderClass(name === "account" ? "hidden sm:block" : null)}"${ssrRenderAttr("aria-label", label)}${ssrRenderAttr("data-header-button", name)}${_scopeId}>`);
1621
+ ssrRenderSlot(_ctx.$slots, "button-content", { name, icon }, () => {
1622
+ _push2(`<i class="${ssrRenderClass([icon, "hover:text-primary w-7 h-7 hover:scale-110 active:scale-125"])}"${_scopeId}></i>`);
1623
+ }, _push2, _parent2, _scopeId);
1624
+ _push2(`</button>`);
1625
+ }, _push2, _parent2, _scopeId);
1626
+ });
1627
+ _push2(`<!--]--></div>`);
1628
+ }, _push2, _parent2, _scopeId);
1629
+ _push2(`</div>`);
1630
+ } else {
1631
+ return [
1632
+ createVNode("div", {
1633
+ class: "container lg:max-w-7xl mx-auto px-1 lg:pl-3 grid grid-flow-col grid-cols-3 justify-between items-center md:grid-cols-none md:auto-cols-max",
1634
+ "data-header": ""
1635
+ }, [
1636
+ renderSlot$1(_ctx.$slots, "sidenav-toggle", {}, () => [
1637
+ createVNode("div", {
1638
+ class: "md:hidden",
1639
+ "data-sidenav-toggle": ""
1640
+ }, [
1641
+ createVNode("button", {
1642
+ class: "px-2 my-1",
1643
+ "aria-label": "Abrir/fechar menu",
1644
+ onClick: ($event) => isSidenavOpen.value = !isSidenavOpen.value
1645
+ }, [
1646
+ renderSlot$1(_ctx.$slots, "sidenav-toggle-content", {}, () => [
1647
+ createVNode("i", { class: "i-menu text-base-500 text-3xl" })
1648
+ ])
1649
+ ], 8, ["onClick"]),
1650
+ createVNode(_sfc_main$4, {
1651
+ modelValue: isSidenavOpen.value,
1652
+ "onUpdate:modelValue": ($event) => isSidenavOpen.value = $event,
1653
+ class: "-ml-1 lg:-ml-3"
1654
+ }, {
1655
+ default: withCtx(() => [
1656
+ createTextVNode(" MENU ")
1657
+ ]),
1658
+ _: 1
1659
+ }, 8, ["modelValue", "onUpdate:modelValue"])
1660
+ ])
1661
+ ]),
1662
+ renderSlot$1(_ctx.$slots, "logo"),
1663
+ renderSlot$1(_ctx.$slots, "nav"),
1664
+ renderSlot$1(_ctx.$slots, "buttons", {}, () => [
1665
+ createVNode("div", {
1666
+ class: "px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800",
1667
+ "data-header-buttons": ""
1668
+ }, [
1669
+ (openBlock(true), createBlock(Fragment$1, null, renderList(buttons.value, ({ icon, onClick, label }, name) => {
1670
+ return renderSlot$1(_ctx.$slots, "button", mergeProps({ key: name }, { name, icon, onClick }), () => [
1671
+ createVNode("button", {
1672
+ class: name === "account" ? "hidden sm:block" : null,
1673
+ "aria-label": label,
1674
+ onClick,
1675
+ "data-header-button": name
1676
+ }, [
1677
+ renderSlot$1(_ctx.$slots, "button-content", { name, icon }, () => [
1678
+ createVNode("i", {
1679
+ class: [icon, "hover:text-primary w-7 h-7 hover:scale-110 active:scale-125"]
1680
+ }, null, 2)
1681
+ ])
1682
+ ], 10, ["aria-label", "onClick", "data-header-button"])
1683
+ ]);
1684
+ }), 128))
1685
+ ])
1686
+ ])
1687
+ ])
1688
+ ];
1689
+ }
1690
+ }),
1691
+ _: 3
1692
+ }, _parent));
1428
1693
  };
1429
1694
  }
1430
1695
  });
@@ -1432,7 +1697,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1432
1697
  const _sfc_setup$2 = _sfc_main$2.setup;
1433
1698
  _sfc_main$2.setup = (props, ctx) => {
1434
1699
  const ssrContext = useSSRContext();
1435
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/StickyHeader.vue");
1700
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ShopHeader.vue");
1436
1701
  return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
1437
1702
  };
1438
1703
 
@@ -1461,12 +1726,17 @@ const $$PagesHeader = createComponent(async ($$result, $$props, $$slots) => {
1461
1726
  const logoSrc = header.logo || settings.logo;
1462
1727
  const LogoHeading = Astro2.props.logoHeading || (isHomepage ? "h1" : "h2");
1463
1728
  return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": () => renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate`
1464
- ${pitchBar.slides.length && renderTemplate`${renderComponent($$result, "PitchBar", _sfc_main$3, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "@@sf/components/PitchBar.vue", "client:component-export": "default" })}`}
1729
+ ${pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", _sfc_main$5, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "@@sf/components/PitchBar.vue", "client:component-export": "default" })}`}
1730
+ ${pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", _sfc_main$5, { ...pitchBar })}`}
1465
1731
  `)}${renderSlot($$result, $$slots["sticky-header"], renderTemplate`
1466
- ${renderComponent($$result, "StickyHeader", _sfc_main$2, { "client:load": true, "client:component-hydration": "load", "client:component-path": "@@sf/components/StickyHeader.vue", "client:component-export": "default" }, { "logo": () => renderTemplate`${renderComponent($$result, "Fragment", Fragment, { "slot": "logo" }, { "default": () => renderTemplate`${renderSlot($$result, $$slots["logo"], renderTemplate`
1467
- ${renderComponent($$result, "LogoHeading", LogoHeading, {}, { "default": () => renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": logoSrc, "alt": settings.name, "widths": [300], "sizes": "150px", "fetchpriority": "high" })}` })}
1732
+ ${renderComponent($$result, "ShopHeader", _sfc_main$2, { "client:load": true, "client:component-hydration": "load", "client:component-path": "@@sf/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": () => renderTemplate`${renderComponent($$result, "Fragment", Fragment, { "slot": "logo" }, { "default": () => renderTemplate`${renderSlot($$result, $$slots["logo"], renderTemplate`
1733
+ ${maybeRenderHead($$result)}<a href="/">
1734
+ ${renderComponent($$result, "LogoHeading", LogoHeading, {}, { "default": () => renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": logoSrc, "alt": settings.name, "widths": [300], "sizes": "150px", "fetchpriority": "high", "class": "hover:drop-shadow-sm" })}` })}
1735
+ </a>
1468
1736
  `)}` })}` })}
1469
- `)}` })}`;
1737
+ `)}` })}
1738
+
1739
+ `;
1470
1740
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/PagesHeader.astro");
1471
1741
 
1472
1742
  const $$Astro$6 = createAstro("https://ecom2-002.web.app");
@@ -1631,18 +1901,6 @@ const usePrices = (props) => {
1631
1901
  };
1632
1902
  };
1633
1903
 
1634
- const useComponentVariant = (props) => {
1635
- return computed(() => {
1636
- let variantName = "";
1637
- Object.keys(props).forEach((prop) => {
1638
- if (props[prop] === true) {
1639
- variantName += ` ${prop.replace(/^(is|has)/, "")}`;
1640
- }
1641
- });
1642
- return variantName.slice(1);
1643
- });
1644
- };
1645
-
1646
1904
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1647
1905
  __name: "Prices",
1648
1906
  __ssrInlineRender: true,
@@ -1677,12 +1935,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1677
1935
  return (_ctx, _push, _parent, _attrs) => {
1678
1936
  const _component_Fade = resolveComponent("Fade");
1679
1937
  _push(`<div${ssrRenderAttrs(mergeProps({
1680
- "data-prices": unref(componentVariant),
1681
- class: "text-base-600"
1938
+ class: "text-base-600",
1939
+ "data-prices": unref(componentVariant)
1682
1940
  }, _attrs))}>`);
1683
1941
  if (unref(comparePrice)) {
1684
1942
  ssrRenderSlot(_ctx.$slots, "compare", { salePrice: unref(salePrice), comparePrice: unref(comparePrice) }, () => {
1685
- _push(`<span data-prices-compare class="text-base-500 mr-1">`);
1943
+ _push(`<span class="text-base-500 mr-1" data-prices-compare>`);
1686
1944
  ssrRenderSlot(_ctx.$slots, "compare-pre", {}, () => {
1687
1945
  if (__props.isLiteral) {
1688
1946
  _push(`<small>${ssrInterpolate(`${"De"} `)}</small>`);
@@ -1706,7 +1964,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1706
1964
  _push(`<!---->`);
1707
1965
  }
1708
1966
  ssrRenderSlot(_ctx.$slots, "sale", { salePrice: unref(salePrice) }, () => {
1709
- _push(`<strong data-prices-sale class="inline-block text-base-800">`);
1967
+ _push(`<strong class="inline-block text-base-800" data-prices-sale>`);
1710
1968
  ssrRenderSlot(_ctx.$slots, "sale-pre", {}, () => {
1711
1969
  if (unref(hasVariedPrices)) {
1712
1970
  _push(`<small>${ssrInterpolate(`${"A partir de"} `)}</small>`);
@@ -1726,7 +1984,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1726
1984
  if (unref(cashbackValue)) {
1727
1985
  ssrRenderSlot(_ctx.$slots, "cashback", { salePrice: unref(salePrice), cashbackValue: unref(cashbackValue), cashbackPercentage: unref(cashbackPercentage) }, () => {
1728
1986
  if (__props.hasCashback) {
1729
- _push2(`<div data-prices-cashback class="relative z-10"${_scopeId}><span${ssrRenderAttr("data-tooltip", "Receba $1 de volta".replace("$1", _ctx.$percentage(unref(cashbackPercentage))))}${_scopeId}>`);
1987
+ _push2(`<div class="relative z-10" data-prices-cashback${_scopeId}><span${ssrRenderAttr("data-tooltip", "Receba $1 de volta".replace("$1", _ctx.$percentage(unref(cashbackPercentage))))}${_scopeId}>`);
1730
1988
  ssrRenderSlot(_ctx.$slots, "cashback-pre", {}, () => {
1731
1989
  _push2(`<i class="i-cashback mr-1"${_scopeId}></i>`);
1732
1990
  }, _push2, _parent2, _scopeId);
@@ -1749,8 +2007,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1749
2007
  unref(cashbackValue) ? renderSlot$1(_ctx.$slots, "cashback", mergeProps({ key: 0 }, { salePrice: unref(salePrice), cashbackValue: unref(cashbackValue), cashbackPercentage: unref(cashbackPercentage) }), () => [
1750
2008
  __props.hasCashback ? (openBlock(), createBlock("div", {
1751
2009
  key: 0,
1752
- "data-prices-cashback": "",
1753
- class: "relative z-10"
2010
+ class: "relative z-10",
2011
+ "data-prices-cashback": ""
1754
2012
  }, [
1755
2013
  createVNode("span", {
1756
2014
  "data-tooltip": "Receba $1 de volta".replace("$1", _ctx.$percentage(unref(cashbackPercentage)))