cloudcommerce 0.4.1 → 0.5.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.
- package/.github/renovate.json +1 -1
- package/CHANGELOG.md +25 -0
- package/action.yml +1 -2
- package/package.json +7 -7
- package/packages/api/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/infinitepay/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +2 -2
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +3 -3
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/events/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/lib/firebase/checkout.js +4 -1
- package/packages/modules/lib/firebase/checkout.js.map +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/modules/src/firebase/checkout.ts +4 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +3 -3
- package/packages/storefront/config/storefront.cms.cjs +31 -5
- package/packages/storefront/config/storefront.cms.mjs +31 -5
- package/packages/storefront/dist/client/_astro/PitchBar.df2672ff.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.99fa99bf.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductCard.a322c854.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.abd6dec6.js +1 -0
- package/packages/storefront/dist/client/_astro/_...slug_.648728f3.css +1 -0
- package/packages/storefront/dist/client/_astro/{runtime-core.esm-bundler.a0432a8e.js → _plugin-vue_export-helper.e6f0b936.js} +1 -1
- package/packages/storefront/dist/client/_astro/client.e6b58b55.js +1 -0
- package/packages/storefront/dist/client/_astro/index.5dd878ac.js +1 -0
- package/packages/storefront/dist/client/_astro/modules-info.e8935203.js +1 -0
- package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.e8b26f2c.js +1 -0
- package/packages/storefront/dist/client/fallback/index.html +8 -8
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/{astro.0f5b754a.mjs → astro.7d9d5f6e.mjs} +100 -38
- package/packages/storefront/dist/server/chunks/pages/{all.671e6bc1.mjs → all.ba8f4b85.mjs} +766 -660
- package/packages/storefront/dist/server/chunks/{prerender.fd8cdc24.mjs → prerender.8cd4ad42.mjs} +0 -0
- package/packages/storefront/dist/server/entry.mjs +98 -46
- package/packages/storefront/package.json +8 -8
- package/packages/storefront/src/lib/assets/base.css +6 -0
- package/packages/storefront/src/lib/cms.d.ts +25 -0
- package/packages/storefront/src/lib/components/Drawer.vue +1 -1
- package/packages/storefront/src/lib/composables/use-shop-header.ts +79 -0
- package/packages/storefront/src/lib/layouts/Base.astro +4 -5
- package/packages/storefront/src/lib/layouts/BaseHead.astro +7 -7
- package/packages/storefront/src/lib/layouts/PagesHeader.astro +5 -23
- package/packages/storefront/src/lib/ssr-context.ts +3 -4
- package/packages/storefront/src/lib/state/modules-info.ts +1 -1
- package/packages/storefront/tailwind.config.cjs +0 -4
- package/packages/types/index.ts +7 -0
- package/packages/types/package.json +1 -1
- package/pnpm-workspace.yaml +3 -3
- package/packages/storefront/dist/client/_astro/PitchBar.004b6ea4.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.f311909a.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.vue_vue_type_script_setup_true_lang.ef47de70.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductCard.34de5097.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.cbfee289.js +0 -1
- package/packages/storefront/dist/client/_astro/_...slug_.bcc33d9d.css +0 -1
- package/packages/storefront/dist/client/_astro/client.56d86c9b.js +0 -1
- package/packages/storefront/dist/client/_astro/index.2d12be6c.js +0 -1
- package/packages/storefront/dist/client/_astro/modules-info.0debb0b0.js +0 -1
- package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.0e5774ce.js +0 -1
- package/packages/storefront/src/lib/components/ShopHeader.vue +0 -111
- package/packages/storefront/src/lib/components/ShopSidenav.vue +0 -26
- package/packages/storefront/src/lib/types/cms-code.d.ts +0 -5
- package/packages/storefront/src/lib/types/cms-contacts.d.ts +0 -5
- package/packages/storefront/src/lib/types/cms-header.d.ts +0 -5
- package/packages/storefront/src/lib/types/cms-settings.d.ts +0 -8
- package/packages/storefront/src/lib/types/cms-social.d.ts +0 -5
|
@@ -9,17 +9,25 @@ import 'node:os';
|
|
|
9
9
|
import sizeOf from 'image-size';
|
|
10
10
|
import 'magic-string';
|
|
11
11
|
import 'node:stream';
|
|
12
|
-
import { c as createAstro, a as createComponent, r as renderTemplate, b as addAttribute,
|
|
12
|
+
import { c as createAstro, a as createComponent, r as renderTemplate, b as addAttribute, u as unescapeHTML, m as maybeRenderHead, d as renderSlot, e as renderComponent, f as renderHead, F as Fragment, s as spreadAttributes } from '../astro.7d9d5f6e.mjs';
|
|
13
13
|
import api from '@cloudcommerce/api';
|
|
14
|
-
import { reactive, computed, defineComponent, inject,
|
|
15
|
-
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate } from 'vue/server-renderer';
|
|
14
|
+
import { reactive, computed, defineComponent, inject, useSSRContext, mergeProps, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, resolveComponent, withModifiers, Teleport, toDisplayString, createTextVNode } from 'vue';
|
|
16
15
|
import { img, price, formatMoney, onPromotion } from '@ecomplus/utils';
|
|
16
|
+
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate } from 'vue/server-renderer';
|
|
17
17
|
/* empty css */import { EventEmitter } from 'node:events';
|
|
18
18
|
import fs, { readFileSync } from 'node:fs';
|
|
19
19
|
import config from '@cloudcommerce/config';
|
|
20
20
|
import { resolve as resolve$1 } from 'path';
|
|
21
21
|
/* empty css */import { useScroll, useElementHover, useDebounceFn, useTimeout, promiseTimeout } from '@vueuse/core';
|
|
22
22
|
|
|
23
|
+
const _export_sfc = (sfc, props) => {
|
|
24
|
+
const target = sfc.__vccOpts || sfc;
|
|
25
|
+
for (const [key, val] of props) {
|
|
26
|
+
target[key] = val;
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
};
|
|
30
|
+
|
|
23
31
|
function isOutputFormat(value) {
|
|
24
32
|
return ["avif", "jpeg", "jpg", "png", "webp"].includes(value);
|
|
25
33
|
}
|
|
@@ -242,12 +250,38 @@ const getCMS = () => {
|
|
|
242
250
|
const dirContent = resolve(baseDir, 'content');
|
|
243
251
|
|
|
244
252
|
const cms = (filename) => {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
253
|
+
// MUST be sync for 'settings'
|
|
254
|
+
// Async with other content to support external CMS integration
|
|
255
|
+
const loadLocal = () => {
|
|
256
|
+
if (filename.endsWith('/')) {
|
|
257
|
+
const dirColl = resolve(dirContent, filename);
|
|
258
|
+
return new Promise((resolve) => {
|
|
259
|
+
const slugs = fs.existsSync(dirColl)
|
|
260
|
+
? fs.readdirSync(dirColl).map((file) => file.replace('.json', ''))
|
|
261
|
+
: [];
|
|
262
|
+
resolve(slugs);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
const filepath = resolve(dirContent, `${filename}.json`);
|
|
266
|
+
const content = fs.existsSync(filepath)
|
|
267
|
+
? JSON.parse(fs.readFileSync(filepath, 'utf8'))
|
|
268
|
+
: null;
|
|
269
|
+
return filename === 'settings'
|
|
270
|
+
? content
|
|
271
|
+
: new Promise((resolve) => { resolve(content); });
|
|
272
|
+
};
|
|
273
|
+
const handler = globalThis.storefront_cms_handler;
|
|
274
|
+
if (typeof handler === 'function') {
|
|
275
|
+
try {
|
|
276
|
+
const content = handler({ dirContent, filename, loadLocal });
|
|
277
|
+
if (content) {
|
|
278
|
+
return content;
|
|
279
|
+
}
|
|
280
|
+
} catch {
|
|
281
|
+
//
|
|
282
|
+
}
|
|
248
283
|
}
|
|
249
|
-
|
|
250
|
-
return JSON.parse(fs.readFileSync(filepath, 'utf8'));
|
|
284
|
+
return loadLocal();
|
|
251
285
|
};
|
|
252
286
|
|
|
253
287
|
let settings;
|
|
@@ -362,7 +396,7 @@ const loadPageContext = async (Astro, {
|
|
|
362
396
|
];
|
|
363
397
|
if (slug) {
|
|
364
398
|
if (cmsCollection) {
|
|
365
|
-
cmsContent = config.cms(`${cmsCollection}/${slug}`);
|
|
399
|
+
cmsContent = await config.cms(`${cmsCollection}/${slug}`);
|
|
366
400
|
} else {
|
|
367
401
|
apiFetchings[0] = api.get(`slugs/${slug}`, apiOptions);
|
|
368
402
|
}
|
|
@@ -420,7 +454,7 @@ const loadPageContext = async (Astro, {
|
|
|
420
454
|
return pageContext;
|
|
421
455
|
};
|
|
422
456
|
|
|
423
|
-
const pwaInfo =
|
|
457
|
+
const pwaInfo = undefined;
|
|
424
458
|
|
|
425
459
|
function isRemoteImage(src) {
|
|
426
460
|
return /^(https?:)?\/\//.test(src);
|
|
@@ -684,7 +718,7 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
684
718
|
isLowResolution: true
|
|
685
719
|
})).src : "/favicon.ico";
|
|
686
720
|
const canonicalUrl = new URL(Astro2.url.pathname, Astro2.site || `https://${domain}`);
|
|
687
|
-
const
|
|
721
|
+
const cmsMetatags = await cms("metatags");
|
|
688
722
|
const ogLocale = lang.length === 2 ? lang : lang.substring(0, 2) + lang.slice(3).toUpperCase();
|
|
689
723
|
let ogImage;
|
|
690
724
|
if (apiDoc) {
|
|
@@ -692,8 +726,8 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
692
726
|
ogImage = picture && picture.url;
|
|
693
727
|
}
|
|
694
728
|
if (!ogImage) {
|
|
695
|
-
if (
|
|
696
|
-
ogImage =
|
|
729
|
+
if (cmsMetatags?.og_image) {
|
|
730
|
+
ogImage = cmsMetatags.og_image.charAt(0) === "/" ? `https://${domain}${cmsMetatags.og_image}` : cmsMetatags.og_image;
|
|
697
731
|
}
|
|
698
732
|
} else {
|
|
699
733
|
ogImage = ogImage.replace(/(\w+\.)?(ecoms\d)\.com/i, "$2-nyc3.nyc3.cdn.digitaloceanspaces.com");
|
|
@@ -717,11 +751,11 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
717
751
|
<meta property="og:type" content="website">
|
|
718
752
|
<meta property="og:locale"${addAttribute(ogLocale, "content")}>
|
|
719
753
|
${ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`}
|
|
720
|
-
${
|
|
754
|
+
${cmsMetatags?.fb_app_id && renderTemplate`<meta property="fb:app_id"${addAttribute(cmsMetatags.fb_app_id, "content")}>`}
|
|
721
755
|
<meta name="twitter:card" content="summary">
|
|
722
|
-
${
|
|
756
|
+
${cmsMetatags?.twitter_username && renderTemplate`<meta name="twitter:site"${addAttribute(cmsMetatags.twitter_username, "content")}>`}
|
|
723
757
|
<meta name="ecom-store-id"${addAttribute(String(storeId), "content")}>
|
|
724
|
-
${pwaInfo
|
|
758
|
+
${pwaInfo }
|
|
725
759
|
`;
|
|
726
760
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro");
|
|
727
761
|
|
|
@@ -810,16 +844,16 @@ const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
810
844
|
Astro2.self = $$Base$1;
|
|
811
845
|
const { pageContext, title } = Astro2.props;
|
|
812
846
|
const { cms } = pageContext;
|
|
813
|
-
const cmsCustomCode = cms("code");
|
|
847
|
+
const cmsCustomCode = await cms("code");
|
|
814
848
|
return renderTemplate`<head>
|
|
815
849
|
${renderComponent($$result, "BaseHead", $$BaseHead, { "pageContext": pageContext, "title": title })}
|
|
816
850
|
${renderComponent($$result, "BaseStateJson", $$BaseStateJson, { "pageContext": pageContext })}
|
|
817
|
-
${cmsCustomCode
|
|
818
|
-
${cmsCustomCode
|
|
851
|
+
${cmsCustomCode?.css && renderTemplate`<style>{cmsCustomCode.css}</style>`}
|
|
852
|
+
${cmsCustomCode?.html_head && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(cmsCustomCode.html_head)}` })}`}
|
|
819
853
|
${renderSlot($$result, $$slots["base-head-scripts"])}
|
|
820
854
|
${renderSlot($$result, $$slots["before-head-end"])}
|
|
821
855
|
${renderHead($$result)}</head>
|
|
822
|
-
${renderComponent($$result, "BaseBody", $$BaseBody, { "pageContext": pageContext }, { "default": () => renderTemplate`${renderSlot($$
|
|
856
|
+
${renderComponent($$result, "BaseBody", $$BaseBody, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["default"])}${cmsCustomCode?.html_body && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(cmsCustomCode.html_body)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])}${renderSlot($$result2, $$slots["before-body-end"])}` })}`;
|
|
823
857
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro");
|
|
824
858
|
|
|
825
859
|
var __freeze = Object.freeze;
|
|
@@ -838,7 +872,7 @@ const $$Base = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
838
872
|
const Astro2 = $$result.createAstro($$Astro$b, $$props, $$slots);
|
|
839
873
|
Astro2.self = $$Base;
|
|
840
874
|
const { pageContext, title } = Astro2.props;
|
|
841
|
-
return renderTemplate`${renderComponent($$result, "Base", $$Base$1, { "pageContext": pageContext, "title": title }, { "before-head-end": () => renderTemplate`${renderComponent($$
|
|
875
|
+
return renderTemplate`${renderComponent($$result, "Base", $$Base$1, { "pageContext": pageContext, "title": title }, { "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["default"])}` })}`;
|
|
842
876
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Base.astro");
|
|
843
877
|
|
|
844
878
|
const $$Astro$a = createAstro("https://ecom2-002.web.app");
|
|
@@ -888,7 +922,7 @@ const $$Picture$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
888
922
|
delete image.height;
|
|
889
923
|
return renderTemplate`${maybeRenderHead($$result)}<picture>
|
|
890
924
|
${sources.map((attrs2) => renderTemplate`<source${spreadAttributes(attrs2)}${addAttribute(sizes, "sizes")}>`)}
|
|
891
|
-
<img${spreadAttributes(image)}${addAttribute(loading, "loading")}${addAttribute(decoding, "decoding")}${
|
|
925
|
+
<img${spreadAttributes(image)}${addAttribute(loading, "loading")}${addAttribute(decoding, "decoding")}${spreadAttributes(attrs)}>
|
|
892
926
|
</picture>`;
|
|
893
927
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/node_modules/@astrojs/image/components/Picture.astro");
|
|
894
928
|
|
|
@@ -977,7 +1011,7 @@ loadingGlobalInfoPreset.then((modulesInfoPreset) => {
|
|
|
977
1011
|
});
|
|
978
1012
|
const parsePhrase = (phrase, modName, varName, formatValue = formatMoney) => {
|
|
979
1013
|
return computed(() => {
|
|
980
|
-
const searchString = `{
|
|
1014
|
+
const searchString = `{${varName}}`;
|
|
981
1015
|
const index = phrase.indexOf(searchString);
|
|
982
1016
|
if (index > -1) {
|
|
983
1017
|
const fieldValue = modulesInfo[modName][varName];
|
|
@@ -1011,38 +1045,40 @@ const usePitchBar = (props) => {
|
|
|
1011
1045
|
|
|
1012
1046
|
const carouselKey = Symbol("carousel");
|
|
1013
1047
|
|
|
1014
|
-
const _sfc_main$
|
|
1048
|
+
const _sfc_main$8 = defineComponent({
|
|
1015
1049
|
__name: "CarouselControl",
|
|
1016
|
-
__ssrInlineRender: true,
|
|
1017
1050
|
props: {
|
|
1018
1051
|
direction: { default: 1 }
|
|
1019
1052
|
},
|
|
1020
|
-
setup(__props) {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
"data-carousel-control": __props.direction > 0 ? "next" : "previous"
|
|
1027
|
-
}, _attrs))}>`);
|
|
1028
|
-
ssrRenderSlot(_ctx.$slots, "default", {}, () => {
|
|
1029
|
-
_push(`<i class="${ssrRenderClass([__props.direction > 0 ? "i-chevron-right" : "i-chevron-left", "m-0"])}"></i>`);
|
|
1030
|
-
}, _push, _parent);
|
|
1031
|
-
_push(`</button>`);
|
|
1032
|
-
};
|
|
1053
|
+
setup(__props, { expose }) {
|
|
1054
|
+
expose();
|
|
1055
|
+
const { changeSlide } = inject(carouselKey);
|
|
1056
|
+
const __returned__ = { changeSlide };
|
|
1057
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1058
|
+
return __returned__;
|
|
1033
1059
|
}
|
|
1034
1060
|
});
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1061
|
+
function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1062
|
+
_push(`<button${ssrRenderAttrs(mergeProps({
|
|
1063
|
+
type: "button",
|
|
1064
|
+
"aria-label": $props.direction > 0 ? "Pr\xF3ximo" : "Anterior",
|
|
1065
|
+
"data-carousel-control": $props.direction > 0 ? "next" : "previous"
|
|
1066
|
+
}, _attrs))}>`);
|
|
1067
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, () => {
|
|
1068
|
+
_push(`<i class="${ssrRenderClass([$props.direction > 0 ? "i-chevron-right" : "i-chevron-left", "m-0"])}"></i>`);
|
|
1069
|
+
}, _push, _parent);
|
|
1070
|
+
_push(`</button>`);
|
|
1071
|
+
}
|
|
1072
|
+
const _sfc_setup$8 = _sfc_main$8.setup;
|
|
1073
|
+
_sfc_main$8.setup = (props, ctx) => {
|
|
1038
1074
|
const ssrContext = useSSRContext();
|
|
1039
1075
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CarouselControl.vue");
|
|
1040
|
-
return _sfc_setup$
|
|
1076
|
+
return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
|
|
1041
1077
|
};
|
|
1078
|
+
const CarouselControl = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
|
|
1042
1079
|
|
|
1043
|
-
const _sfc_main$
|
|
1080
|
+
const _sfc_main$7 = defineComponent({
|
|
1044
1081
|
__name: "Carousel",
|
|
1045
|
-
__ssrInlineRender: true,
|
|
1046
1082
|
props: {
|
|
1047
1083
|
as: { default: "ul" },
|
|
1048
1084
|
modelValue: { default: 1 },
|
|
@@ -1051,7 +1087,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1051
1087
|
emits: [
|
|
1052
1088
|
"update:modelValue"
|
|
1053
1089
|
],
|
|
1054
|
-
setup(__props, { emit }) {
|
|
1090
|
+
setup(__props, { expose, emit }) {
|
|
1091
|
+
expose();
|
|
1055
1092
|
const props = __props;
|
|
1056
1093
|
const currentIndex = ref(props.modelValue - 1);
|
|
1057
1094
|
watch(toRef(props, "modelValue"), (modelValue) => {
|
|
@@ -1155,7 +1192,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1155
1192
|
calcCurrentIndex();
|
|
1156
1193
|
calcIndexCount();
|
|
1157
1194
|
};
|
|
1158
|
-
useDebounceFn(calcOnInit, 400);
|
|
1195
|
+
const onResize = useDebounceFn(calcOnInit, 400);
|
|
1159
1196
|
onMounted(() => {
|
|
1160
1197
|
calcOnInit();
|
|
1161
1198
|
});
|
|
@@ -1168,184 +1205,188 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1168
1205
|
isBoundLeft,
|
|
1169
1206
|
isBoundRight
|
|
1170
1207
|
});
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
ref_key: "wrapper",
|
|
1179
|
-
ref: wrapper,
|
|
1180
|
-
"data-carousel-wrapper": ""
|
|
1181
|
-
}, {
|
|
1182
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1183
|
-
if (_push2) {
|
|
1184
|
-
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
1185
|
-
} else {
|
|
1186
|
-
return [
|
|
1187
|
-
renderSlot$1(_ctx.$slots, "default")
|
|
1188
|
-
];
|
|
1189
|
-
}
|
|
1190
|
-
}),
|
|
1191
|
-
_: 3
|
|
1192
|
-
}), _parent);
|
|
1193
|
-
ssrRenderSlot(_ctx.$slots, "controls", {
|
|
1194
|
-
changeSlide,
|
|
1195
|
-
isBoundLeft: unref(isBoundLeft),
|
|
1196
|
-
isBoundRight: unref(isBoundRight),
|
|
1197
|
-
currentPage: currentIndex.value + 1,
|
|
1198
|
-
pageCount: indexCount.value + 1
|
|
1199
|
-
}, () => {
|
|
1200
|
-
_push(ssrRenderComponent(_sfc_main$7, { direction: -1 }, {
|
|
1201
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1202
|
-
if (_push2) {
|
|
1203
|
-
ssrRenderSlot(_ctx.$slots, "previous", {}, null, _push2, _parent2, _scopeId);
|
|
1204
|
-
} else {
|
|
1205
|
-
return [
|
|
1206
|
-
renderSlot$1(_ctx.$slots, "previous")
|
|
1207
|
-
];
|
|
1208
|
-
}
|
|
1209
|
-
}),
|
|
1210
|
-
_: 3
|
|
1211
|
-
}, _parent));
|
|
1212
|
-
_push(ssrRenderComponent(_sfc_main$7, null, {
|
|
1213
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1214
|
-
if (_push2) {
|
|
1215
|
-
ssrRenderSlot(_ctx.$slots, "next", {}, null, _push2, _parent2, _scopeId);
|
|
1216
|
-
} else {
|
|
1217
|
-
return [
|
|
1218
|
-
renderSlot$1(_ctx.$slots, "next")
|
|
1219
|
-
];
|
|
1220
|
-
}
|
|
1221
|
-
}),
|
|
1222
|
-
_: 3
|
|
1223
|
-
}, _parent));
|
|
1224
|
-
}, _push, _parent);
|
|
1225
|
-
_push(`</div>`);
|
|
1226
|
-
};
|
|
1208
|
+
const __returned__ = { props, emit, currentIndex, wrapper, currentPos, isScrolling, arrivedState, isBoundLeft, isBoundRight, slidesWidth, wrapperScrollWidth, wrapperVisibleWidth, indexCount, calcWrapperWidth, calcSlidesWidth, calcNextWidth, calcCurrentIndex, calcIndexCount, get autoplayTimer() {
|
|
1209
|
+
return autoplayTimer;
|
|
1210
|
+
}, set autoplayTimer(v) {
|
|
1211
|
+
autoplayTimer = v;
|
|
1212
|
+
}, restartAutoplay, changeSlide, carousel, isHovered, calcOnInit, onResize, CarouselControl };
|
|
1213
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1214
|
+
return __returned__;
|
|
1227
1215
|
}
|
|
1228
1216
|
});
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1217
|
+
function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1218
|
+
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
1219
|
+
ref: "carousel",
|
|
1220
|
+
"data-carousel": ""
|
|
1221
|
+
}, _attrs))}>`);
|
|
1222
|
+
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), {
|
|
1223
|
+
ref: "wrapper",
|
|
1224
|
+
"data-carousel-wrapper": ""
|
|
1225
|
+
}, {
|
|
1226
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1227
|
+
if (_push2) {
|
|
1228
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
1229
|
+
} else {
|
|
1230
|
+
return [
|
|
1231
|
+
renderSlot$1(_ctx.$slots, "default")
|
|
1232
|
+
];
|
|
1233
|
+
}
|
|
1234
|
+
}),
|
|
1235
|
+
_: 3
|
|
1236
|
+
}), _parent);
|
|
1237
|
+
ssrRenderSlot(_ctx.$slots, "controls", {
|
|
1238
|
+
changeSlide: $setup.changeSlide,
|
|
1239
|
+
isBoundLeft: $setup.isBoundLeft,
|
|
1240
|
+
isBoundRight: $setup.isBoundRight,
|
|
1241
|
+
currentPage: $setup.currentIndex + 1,
|
|
1242
|
+
pageCount: $setup.indexCount + 1
|
|
1243
|
+
}, () => {
|
|
1244
|
+
_push(ssrRenderComponent($setup["CarouselControl"], { direction: -1 }, {
|
|
1245
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1246
|
+
if (_push2) {
|
|
1247
|
+
ssrRenderSlot(_ctx.$slots, "previous", {}, null, _push2, _parent2, _scopeId);
|
|
1248
|
+
} else {
|
|
1249
|
+
return [
|
|
1250
|
+
renderSlot$1(_ctx.$slots, "previous")
|
|
1251
|
+
];
|
|
1252
|
+
}
|
|
1253
|
+
}),
|
|
1254
|
+
_: 3
|
|
1255
|
+
}, _parent));
|
|
1256
|
+
_push(ssrRenderComponent($setup["CarouselControl"], null, {
|
|
1257
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1258
|
+
if (_push2) {
|
|
1259
|
+
ssrRenderSlot(_ctx.$slots, "next", {}, null, _push2, _parent2, _scopeId);
|
|
1260
|
+
} else {
|
|
1261
|
+
return [
|
|
1262
|
+
renderSlot$1(_ctx.$slots, "next")
|
|
1263
|
+
];
|
|
1264
|
+
}
|
|
1265
|
+
}),
|
|
1266
|
+
_: 3
|
|
1267
|
+
}, _parent));
|
|
1268
|
+
}, _push, _parent);
|
|
1269
|
+
_push(`</div>`);
|
|
1270
|
+
}
|
|
1271
|
+
const _sfc_setup$7 = _sfc_main$7.setup;
|
|
1272
|
+
_sfc_main$7.setup = (props, ctx) => {
|
|
1232
1273
|
const ssrContext = useSSRContext();
|
|
1233
1274
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Carousel.vue");
|
|
1234
|
-
return _sfc_setup$
|
|
1275
|
+
return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
|
|
1235
1276
|
};
|
|
1277
|
+
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
|
|
1236
1278
|
|
|
1237
|
-
const _sfc_main$
|
|
1279
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1238
1280
|
__name: "PitchBar",
|
|
1239
|
-
__ssrInlineRender: true,
|
|
1240
1281
|
props: {
|
|
1241
1282
|
slides: null
|
|
1242
1283
|
},
|
|
1243
|
-
setup(__props) {
|
|
1284
|
+
setup(__props, { expose }) {
|
|
1285
|
+
expose();
|
|
1244
1286
|
const props = __props;
|
|
1245
1287
|
const {
|
|
1246
1288
|
parsedContents,
|
|
1247
1289
|
countValidSlides
|
|
1248
1290
|
} = usePitchBar(props);
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1291
|
+
const __returned__ = { props, parsedContents, countValidSlides, Carousel, CarouselControl };
|
|
1292
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1293
|
+
return __returned__;
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1297
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "bg-base-100 relative z-1" }, _attrs))}><div class="container md:w-2/3 mx-auto px-3 py-1">`);
|
|
1298
|
+
_push(ssrRenderComponent($setup["Carousel"], {
|
|
1299
|
+
autoplay: $setup.countValidSlides > 1 ? 7e3 : null
|
|
1300
|
+
}, {
|
|
1301
|
+
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1302
|
+
if (_push2) {
|
|
1303
|
+
_push2(`<div style="${ssrRenderStyle($setup.countValidSlides > 1 ? null : { display: "none" })}" class="text-xl leading-none text-base-400"${_scopeId}>`);
|
|
1304
|
+
_push2(ssrRenderComponent($setup["CarouselControl"], {
|
|
1305
|
+
direction: -1,
|
|
1306
|
+
class: "pr-2 bg-base-100 hover:text-base-700"
|
|
1307
|
+
}, null, _parent2, _scopeId));
|
|
1308
|
+
_push2(ssrRenderComponent($setup["CarouselControl"], { class: "pl-2 bg-base-100 hover:text-base-700" }, null, _parent2, _scopeId));
|
|
1309
|
+
_push2(`</div>`);
|
|
1310
|
+
} else {
|
|
1311
|
+
return [
|
|
1312
|
+
withDirectives(createVNode("div", { class: "text-xl leading-none text-base-400" }, [
|
|
1313
|
+
createVNode($setup["CarouselControl"], {
|
|
1258
1314
|
direction: -1,
|
|
1259
1315
|
class: "pr-2 bg-base-100 hover:text-base-700"
|
|
1260
|
-
},
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1316
|
+
}),
|
|
1317
|
+
createVNode($setup["CarouselControl"], { class: "pl-2 bg-base-100 hover:text-base-700" })
|
|
1318
|
+
], 512), [
|
|
1319
|
+
[vShow, $setup.countValidSlides > 1]
|
|
1320
|
+
])
|
|
1321
|
+
];
|
|
1322
|
+
}
|
|
1323
|
+
}),
|
|
1324
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1325
|
+
if (_push2) {
|
|
1326
|
+
_push2(`<!--[-->`);
|
|
1327
|
+
ssrRenderList($props.slides, (slide, i) => {
|
|
1328
|
+
_push2(`<li${_scopeId}>`);
|
|
1329
|
+
ssrRenderVNode(_push2, createVNode(resolveDynamicComponent(slide.href ? "ALink" : "span"), {
|
|
1330
|
+
href: slide.href,
|
|
1331
|
+
target: slide.target,
|
|
1332
|
+
class: ["inline-block px-8", slide.href ? "hover:underline" : null]
|
|
1333
|
+
}, {
|
|
1334
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
1335
|
+
if (_push3) {
|
|
1336
|
+
if ($setup.parsedContents[i]) {
|
|
1337
|
+
_push3(`<span class="prose text-sm text-base-800"${_scopeId2}>${$setup.parsedContents[i]}</span>`);
|
|
1338
|
+
} else {
|
|
1339
|
+
_push3(`<!---->`);
|
|
1340
|
+
}
|
|
1341
|
+
} else {
|
|
1342
|
+
return [
|
|
1343
|
+
$setup.parsedContents[i] ? (openBlock(), createBlock("span", {
|
|
1344
|
+
key: 0,
|
|
1345
|
+
innerHTML: $setup.parsedContents[i],
|
|
1346
|
+
class: "prose text-sm text-base-800"
|
|
1347
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1348
|
+
];
|
|
1349
|
+
}
|
|
1350
|
+
}),
|
|
1351
|
+
_: 2
|
|
1352
|
+
}), _parent2, _scopeId);
|
|
1353
|
+
_push2(`</li>`);
|
|
1354
|
+
});
|
|
1355
|
+
_push2(`<!--]-->`);
|
|
1356
|
+
} else {
|
|
1357
|
+
return [
|
|
1358
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($props.slides, (slide, i) => {
|
|
1359
|
+
return openBlock(), createBlock("li", { key: i }, [
|
|
1360
|
+
(openBlock(), createBlock(resolveDynamicComponent(slide.href ? "ALink" : "span"), {
|
|
1283
1361
|
href: slide.href,
|
|
1284
1362
|
target: slide.target,
|
|
1285
1363
|
class: ["inline-block px-8", slide.href ? "hover:underline" : null]
|
|
1286
1364
|
}, {
|
|
1287
|
-
default: withCtx((
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
} else {
|
|
1295
|
-
return [
|
|
1296
|
-
unref(parsedContents)[i] ? (openBlock(), createBlock("span", {
|
|
1297
|
-
key: 0,
|
|
1298
|
-
innerHTML: unref(parsedContents)[i],
|
|
1299
|
-
class: "prose text-sm text-base-800"
|
|
1300
|
-
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1301
|
-
];
|
|
1302
|
-
}
|
|
1303
|
-
}),
|
|
1365
|
+
default: withCtx(() => [
|
|
1366
|
+
$setup.parsedContents[i] ? (openBlock(), createBlock("span", {
|
|
1367
|
+
key: 0,
|
|
1368
|
+
innerHTML: $setup.parsedContents[i],
|
|
1369
|
+
class: "prose text-sm text-base-800"
|
|
1370
|
+
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1371
|
+
]),
|
|
1304
1372
|
_: 2
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
}, {
|
|
1318
|
-
default: withCtx(() => [
|
|
1319
|
-
unref(parsedContents)[i] ? (openBlock(), createBlock("span", {
|
|
1320
|
-
key: 0,
|
|
1321
|
-
innerHTML: unref(parsedContents)[i],
|
|
1322
|
-
class: "prose text-sm text-base-800"
|
|
1323
|
-
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1324
|
-
]),
|
|
1325
|
-
_: 2
|
|
1326
|
-
}, 1032, ["href", "target", "class"]))
|
|
1327
|
-
]);
|
|
1328
|
-
}), 128))
|
|
1329
|
-
];
|
|
1330
|
-
}
|
|
1331
|
-
}),
|
|
1332
|
-
_: 1
|
|
1333
|
-
}, _parent));
|
|
1334
|
-
_push(`</div></div>`);
|
|
1335
|
-
};
|
|
1336
|
-
}
|
|
1337
|
-
});
|
|
1338
|
-
|
|
1339
|
-
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
1340
|
-
_sfc_main$5.setup = (props, ctx) => {
|
|
1373
|
+
}, 1032, ["href", "target", "class"]))
|
|
1374
|
+
]);
|
|
1375
|
+
}), 128))
|
|
1376
|
+
];
|
|
1377
|
+
}
|
|
1378
|
+
}),
|
|
1379
|
+
_: 1
|
|
1380
|
+
}, _parent));
|
|
1381
|
+
_push(`</div></div>`);
|
|
1382
|
+
}
|
|
1383
|
+
const _sfc_setup$6 = _sfc_main$6.setup;
|
|
1384
|
+
_sfc_main$6.setup = (props, ctx) => {
|
|
1341
1385
|
const ssrContext = useSSRContext();
|
|
1342
1386
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PitchBar.vue");
|
|
1343
|
-
return _sfc_setup$
|
|
1387
|
+
return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
|
|
1344
1388
|
};
|
|
1345
|
-
|
|
1346
|
-
const i19myAccount = "Minha conta";
|
|
1347
|
-
const i19openCart = "Abrir carrinho";
|
|
1348
|
-
const i19searchProducts = "Buscar produtos";
|
|
1389
|
+
const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
|
|
1349
1390
|
|
|
1350
1391
|
const useStickyHeader = (props) => {
|
|
1351
1392
|
const {
|
|
@@ -1389,9 +1430,58 @@ const useStickyHeader = (props) => {
|
|
|
1389
1430
|
};
|
|
1390
1431
|
};
|
|
1391
1432
|
|
|
1392
|
-
const
|
|
1433
|
+
const filterMainCategories = (categories) => {
|
|
1434
|
+
return categories.filter(({ slug, parent }) => {
|
|
1435
|
+
return slug && !parent;
|
|
1436
|
+
});
|
|
1437
|
+
};
|
|
1438
|
+
const filterSubcategories = (categories, parentCategory) => {
|
|
1439
|
+
return categories.filter(({ slug, parent }) => {
|
|
1440
|
+
if (slug && parent) {
|
|
1441
|
+
return parent._id === parentCategory._id || parent.slug && parent.slug === parentCategory.slug;
|
|
1442
|
+
}
|
|
1443
|
+
return false;
|
|
1444
|
+
});
|
|
1445
|
+
};
|
|
1446
|
+
const useShopHeader = (props) => {
|
|
1447
|
+
const { header } = props;
|
|
1448
|
+
const {
|
|
1449
|
+
isSticky,
|
|
1450
|
+
staticHeight,
|
|
1451
|
+
staticY
|
|
1452
|
+
} = useStickyHeader({ header });
|
|
1453
|
+
const positionY = computed(() => {
|
|
1454
|
+
return isSticky.value ? header.value.offsetHeight : staticY.value;
|
|
1455
|
+
});
|
|
1456
|
+
const mainCategories = filterMainCategories(props.categories);
|
|
1457
|
+
const getSubcategories = (parentCategory) => {
|
|
1458
|
+
return filterSubcategories(props.categories, parentCategory);
|
|
1459
|
+
};
|
|
1460
|
+
const getCategoryTree = (parentCategory) => {
|
|
1461
|
+
return {
|
|
1462
|
+
...parentCategory,
|
|
1463
|
+
subcategories: getSubcategories(parentCategory).map((subcategory) => {
|
|
1464
|
+
return getCategoryTree(subcategory);
|
|
1465
|
+
})
|
|
1466
|
+
};
|
|
1467
|
+
};
|
|
1468
|
+
const categoryTrees = mainCategories.map(getCategoryTree);
|
|
1469
|
+
const isSidenavOpen = ref(false);
|
|
1470
|
+
return {
|
|
1471
|
+
isSticky,
|
|
1472
|
+
staticHeight,
|
|
1473
|
+
staticY,
|
|
1474
|
+
positionY,
|
|
1475
|
+
mainCategories,
|
|
1476
|
+
getSubcategories,
|
|
1477
|
+
getCategoryTree,
|
|
1478
|
+
categoryTrees,
|
|
1479
|
+
isSidenavOpen
|
|
1480
|
+
};
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
const _sfc_main$5 = defineComponent({
|
|
1393
1484
|
__name: "Drawer",
|
|
1394
|
-
__ssrInlineRender: true,
|
|
1395
1485
|
props: {
|
|
1396
1486
|
modelValue: { type: Boolean, default: false },
|
|
1397
1487
|
placement: { default: "start" },
|
|
@@ -1401,7 +1491,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1401
1491
|
emits: [
|
|
1402
1492
|
"update:modelValue"
|
|
1403
1493
|
],
|
|
1404
|
-
setup(__props, { emit }) {
|
|
1494
|
+
setup(__props, { expose, emit }) {
|
|
1495
|
+
expose();
|
|
1405
1496
|
const props = __props;
|
|
1406
1497
|
const close = () => emit("update:modelValue", false);
|
|
1407
1498
|
const drawer = ref(null);
|
|
@@ -1446,247 +1537,264 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1446
1537
|
const isPlacementX = computed(() => {
|
|
1447
1538
|
return props.placement === "start" || props.placement === "end";
|
|
1448
1539
|
});
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
ssrRenderTeleport(_push2, (_push3) => {
|
|
1475
|
-
_push3(ssrRenderComponent(_component_Fade, null, {
|
|
1476
|
-
default: withCtx((_2, _push4, _parent3, _scopeId2) => {
|
|
1477
|
-
if (_push4) {
|
|
1478
|
-
if (__props.modelValue) {
|
|
1479
|
-
_push4(`<div class="fixed top-0 left-0 w-screen h-screen bg-black/50 z-40" data-drawer-backdrop${_scopeId2}></div>`);
|
|
1480
|
-
} else {
|
|
1481
|
-
_push4(`<!---->`);
|
|
1482
|
-
}
|
|
1483
|
-
} else {
|
|
1484
|
-
return [
|
|
1485
|
-
__props.modelValue ? (openBlock(), createBlock("div", {
|
|
1486
|
-
key: 0,
|
|
1487
|
-
class: "fixed top-0 left-0 w-screen h-screen bg-black/50 z-40",
|
|
1488
|
-
"data-drawer-backdrop": ""
|
|
1489
|
-
})) : createCommentVNode("", true)
|
|
1490
|
-
];
|
|
1491
|
-
}
|
|
1492
|
-
}),
|
|
1493
|
-
_: 1
|
|
1494
|
-
}, _parent2, _scopeId));
|
|
1495
|
-
}, "#teleported-top", false, _parent2);
|
|
1496
|
-
_push2(`</dialog>`);
|
|
1497
|
-
} else {
|
|
1498
|
-
_push2(`<!---->`);
|
|
1499
|
-
}
|
|
1540
|
+
const __returned__ = { props, emit, close, drawer, outsideClickListener, escClickListener, slideTo, isFixed, isPlacementX };
|
|
1541
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1542
|
+
return __returned__;
|
|
1543
|
+
}
|
|
1544
|
+
});
|
|
1545
|
+
function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1546
|
+
const _component_Fade = resolveComponent("Fade");
|
|
1547
|
+
_push(ssrRenderComponent(_component_Fade, mergeProps({
|
|
1548
|
+
slide: $setup.slideTo,
|
|
1549
|
+
speed: "slow",
|
|
1550
|
+
"is-floating": ""
|
|
1551
|
+
}, _attrs), {
|
|
1552
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1553
|
+
if (_push2) {
|
|
1554
|
+
if ($props.modelValue) {
|
|
1555
|
+
_push2(`<dialog class="${ssrRenderClass([[
|
|
1556
|
+
$props.position,
|
|
1557
|
+
$setup.isFixed ? `top-0 left-0 ${$setup.isPlacementX ? "h-screen" : ""}` : null
|
|
1558
|
+
], "w-screen max-w-sm shadow p-0 m-0 z-50"])}"${ssrIncludeBooleanAttr($props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
|
|
1559
|
+
if ($props.hasCloseButton) {
|
|
1560
|
+
_push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([$props.placement === "end" ? "left-2" : "right-2", "absolute top-2"])}" data-drawer-close${_scopeId}>`);
|
|
1561
|
+
ssrRenderSlot(_ctx.$slots, "close", {}, () => {
|
|
1562
|
+
_push2(`<i class="i-close text-base-400 text-3xl"${_scopeId}></i>`);
|
|
1563
|
+
}, _push2, _parent2, _scopeId);
|
|
1564
|
+
_push2(`</button>`);
|
|
1500
1565
|
} else {
|
|
1501
|
-
|
|
1502
|
-
|
|
1566
|
+
_push2(`<!---->`);
|
|
1567
|
+
}
|
|
1568
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
1569
|
+
_push2(`</div>`);
|
|
1570
|
+
ssrRenderTeleport(_push2, (_push3) => {
|
|
1571
|
+
_push3(ssrRenderComponent(_component_Fade, null, {
|
|
1572
|
+
default: withCtx((_2, _push4, _parent3, _scopeId2) => {
|
|
1573
|
+
if (_push4) {
|
|
1574
|
+
if ($props.modelValue) {
|
|
1575
|
+
_push4(`<div class="fixed top-0 left-0 w-screen h-screen bg-black/50 z-40" data-drawer-backdrop${_scopeId2}></div>`);
|
|
1576
|
+
} else {
|
|
1577
|
+
_push4(`<!---->`);
|
|
1578
|
+
}
|
|
1579
|
+
} else {
|
|
1580
|
+
return [
|
|
1581
|
+
$props.modelValue ? (openBlock(), createBlock("div", {
|
|
1582
|
+
key: 0,
|
|
1583
|
+
class: "fixed top-0 left-0 w-screen h-screen bg-black/50 z-40",
|
|
1584
|
+
"data-drawer-backdrop": ""
|
|
1585
|
+
})) : createCommentVNode("", true)
|
|
1586
|
+
];
|
|
1587
|
+
}
|
|
1588
|
+
}),
|
|
1589
|
+
_: 1
|
|
1590
|
+
}, _parent2, _scopeId));
|
|
1591
|
+
}, "#teleported-top", false, _parent2);
|
|
1592
|
+
_push2(`</dialog>`);
|
|
1593
|
+
} else {
|
|
1594
|
+
_push2(`<!---->`);
|
|
1595
|
+
}
|
|
1596
|
+
} else {
|
|
1597
|
+
return [
|
|
1598
|
+
$props.modelValue ? (openBlock(), createBlock("dialog", {
|
|
1599
|
+
key: 0,
|
|
1600
|
+
ref: "drawer",
|
|
1601
|
+
class: ["w-screen max-w-sm shadow p-0 m-0 z-50", [
|
|
1602
|
+
$props.position,
|
|
1603
|
+
$setup.isFixed ? `top-0 left-0 ${$setup.isPlacementX ? "h-screen" : ""}` : null
|
|
1604
|
+
]],
|
|
1605
|
+
open: $props.modelValue,
|
|
1606
|
+
"data-drawer": $props.placement
|
|
1607
|
+
}, [
|
|
1608
|
+
createVNode("div", { class: "relative h-full" }, [
|
|
1609
|
+
$props.hasCloseButton ? (openBlock(), createBlock("button", {
|
|
1503
1610
|
key: 0,
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
]],
|
|
1510
|
-
open: __props.modelValue,
|
|
1511
|
-
"data-drawer": __props.placement
|
|
1611
|
+
type: "button",
|
|
1612
|
+
"aria-label": "Fechar",
|
|
1613
|
+
onClick: withModifiers($setup.close, ["prevent"]),
|
|
1614
|
+
class: ["absolute top-2", $props.placement === "end" ? "left-2" : "right-2"],
|
|
1615
|
+
"data-drawer-close": ""
|
|
1512
1616
|
}, [
|
|
1513
|
-
|
|
1514
|
-
|
|
1617
|
+
renderSlot$1(_ctx.$slots, "close", {}, () => [
|
|
1618
|
+
createVNode("i", { class: "i-close text-base-400 text-3xl" })
|
|
1619
|
+
])
|
|
1620
|
+
], 10, ["onClick"])) : createCommentVNode("", true),
|
|
1621
|
+
renderSlot$1(_ctx.$slots, "default")
|
|
1622
|
+
]),
|
|
1623
|
+
(openBlock(), createBlock(Teleport, { to: "#teleported-top" }, [
|
|
1624
|
+
createVNode(_component_Fade, null, {
|
|
1625
|
+
default: withCtx(() => [
|
|
1626
|
+
$props.modelValue ? (openBlock(), createBlock("div", {
|
|
1515
1627
|
key: 0,
|
|
1516
|
-
|
|
1517
|
-
"
|
|
1518
|
-
|
|
1519
|
-
class: ["absolute top-2", __props.placement === "end" ? "left-2" : "right-2"],
|
|
1520
|
-
"data-drawer-close": ""
|
|
1521
|
-
}, [
|
|
1522
|
-
renderSlot$1(_ctx.$slots, "close", {}, () => [
|
|
1523
|
-
createVNode("i", { class: "i-close text-base-400 text-3xl" })
|
|
1524
|
-
])
|
|
1525
|
-
], 10, ["onClick"])) : createCommentVNode("", true),
|
|
1526
|
-
renderSlot$1(_ctx.$slots, "default")
|
|
1628
|
+
class: "fixed top-0 left-0 w-screen h-screen bg-black/50 z-40",
|
|
1629
|
+
"data-drawer-backdrop": ""
|
|
1630
|
+
})) : createCommentVNode("", true)
|
|
1527
1631
|
]),
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1632
|
+
_: 1
|
|
1633
|
+
})
|
|
1634
|
+
]))
|
|
1635
|
+
], 10, ["open", "data-drawer"])) : createCommentVNode("", true)
|
|
1636
|
+
];
|
|
1637
|
+
}
|
|
1638
|
+
}),
|
|
1639
|
+
_: 3
|
|
1640
|
+
}, _parent));
|
|
1641
|
+
}
|
|
1642
|
+
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
1643
|
+
_sfc_main$5.setup = (props, ctx) => {
|
|
1644
|
+
const ssrContext = useSSRContext();
|
|
1645
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Drawer.vue");
|
|
1646
|
+
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
1647
|
+
};
|
|
1648
|
+
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
|
|
1649
|
+
|
|
1650
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1651
|
+
__name: "ShopSidenavCategory",
|
|
1652
|
+
props: {
|
|
1653
|
+
categoryTree: null
|
|
1654
|
+
},
|
|
1655
|
+
setup(__props, { expose }) {
|
|
1656
|
+
expose();
|
|
1657
|
+
const isOpen = ref(false);
|
|
1658
|
+
const isFaded = ref(true);
|
|
1659
|
+
watch(isOpen, (_isOpen) => {
|
|
1660
|
+
if (_isOpen) {
|
|
1661
|
+
setTimeout(() => {
|
|
1662
|
+
isFaded.value = false;
|
|
1663
|
+
}, 25);
|
|
1664
|
+
} else {
|
|
1665
|
+
isFaded.value = true;
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
const __returned__ = { isOpen, isFaded };
|
|
1669
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1670
|
+
return __returned__;
|
|
1547
1671
|
}
|
|
1548
1672
|
});
|
|
1549
|
-
|
|
1673
|
+
function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1674
|
+
const _component_ShopSidenavCategory = resolveComponent("ShopSidenavCategory", true);
|
|
1675
|
+
_push(`<li${ssrRenderAttrs(mergeProps({ class: "text-lg text-base-800" }, _attrs))}>`);
|
|
1676
|
+
if ($props.categoryTree.subcategories.length) {
|
|
1677
|
+
_push(`<details class="bg-white overflow-y-auto overflow-x-hidden z-10 open:absolute open:top-0 open:left-0 open:w-full open:h-full"><summary class="${ssrRenderClass([$setup.isOpen ? "bg-base-100" : null, "cursor-pointer list-none px-6 py-3 active:bg-base-100 transition-colors"])}"><i class="${ssrRenderClass(!$setup.isOpen ? "i-arrow-right float-right mb-0 mt-1 text-xl text-base-500" : "i-arrow-left text-lg")}"></i>`);
|
|
1678
|
+
if (!$setup.isOpen && $props.categoryTree.icon) {
|
|
1679
|
+
_push(`<img loading="lazy"${ssrRenderAttr("src", $props.categoryTree.icon.url)} class="w-auto h-5 inline mr-3">`);
|
|
1680
|
+
} else {
|
|
1681
|
+
_push(`<!---->`);
|
|
1682
|
+
}
|
|
1683
|
+
_push(`<h3 class="${ssrRenderClass([$setup.isOpen ? "ml-4 text-base" : null, "inline"])}">${ssrInterpolate($props.categoryTree.name)}</h3></summary><ul class="${ssrRenderClass([$setup.isFaded ? "opacity-20" : "opacity-100", "mt-2 transition-opacity"])}" tabindex="-1"><!--[-->`);
|
|
1684
|
+
ssrRenderList($props.categoryTree.subcategories, (subcategoryTree) => {
|
|
1685
|
+
_push(ssrRenderComponent(_component_ShopSidenavCategory, {
|
|
1686
|
+
key: subcategoryTree._id,
|
|
1687
|
+
"category-tree": subcategoryTree
|
|
1688
|
+
}, null, _parent));
|
|
1689
|
+
});
|
|
1690
|
+
_push(`<!--]--><li><a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} class="block px-6 py-3 text-base underline active:bg-base-200">${ssrInterpolate("Ver toda a categoria $1".replace("$1", $props.categoryTree.name))}</a></li></ul></details>`);
|
|
1691
|
+
} else {
|
|
1692
|
+
_push(`<a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} class="block px-6 py-3 active:bg-base-200">`);
|
|
1693
|
+
if (!$setup.isOpen && $props.categoryTree.icon) {
|
|
1694
|
+
_push(`<img loading="lazy"${ssrRenderAttr("src", $props.categoryTree.icon.url)} class="w-auto h-5 inline mr-3">`);
|
|
1695
|
+
} else {
|
|
1696
|
+
_push(`<!---->`);
|
|
1697
|
+
}
|
|
1698
|
+
_push(`<h3 class="inline">${ssrInterpolate($props.categoryTree.name)}</h3></a>`);
|
|
1699
|
+
}
|
|
1700
|
+
_push(`</li>`);
|
|
1701
|
+
}
|
|
1550
1702
|
const _sfc_setup$4 = _sfc_main$4.setup;
|
|
1551
1703
|
_sfc_main$4.setup = (props, ctx) => {
|
|
1552
1704
|
const ssrContext = useSSRContext();
|
|
1553
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/
|
|
1705
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenavCategory.vue");
|
|
1554
1706
|
return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
1555
1707
|
};
|
|
1708
|
+
const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
|
|
1556
1709
|
|
|
1557
1710
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1558
1711
|
__name: "ShopSidenav",
|
|
1559
|
-
__ssrInlineRender: true,
|
|
1560
1712
|
props: {
|
|
1561
|
-
|
|
1713
|
+
categoryTrees: null
|
|
1562
1714
|
},
|
|
1563
|
-
setup(__props) {
|
|
1564
|
-
|
|
1565
|
-
const
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
return (_ctx, _push, _parent, _attrs) => {
|
|
1569
|
-
_push(`<aside${ssrRenderAttrs(mergeProps({ "data-sidenav": "" }, _attrs))}><nav class="py-5" data-sidenav-nav><ul><!--[-->`);
|
|
1570
|
-
ssrRenderList(unref(mainCategories), (mainCategory) => {
|
|
1571
|
-
_push(`<li><a${ssrRenderAttr("href", `/${mainCategory.slug}`)}>${ssrInterpolate(mainCategory.name)}</a></li>`);
|
|
1572
|
-
});
|
|
1573
|
-
_push(`<!--]--></ul></nav></aside>`);
|
|
1574
|
-
};
|
|
1715
|
+
setup(__props, { expose }) {
|
|
1716
|
+
expose();
|
|
1717
|
+
const __returned__ = { ShopSidenavCategory };
|
|
1718
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1719
|
+
return __returned__;
|
|
1575
1720
|
}
|
|
1576
1721
|
});
|
|
1577
|
-
|
|
1722
|
+
function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1723
|
+
_push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex flex-col h-full" }, _attrs))}><nav class="py-4 grow"><ul class="relative h-full"><!--[-->`);
|
|
1724
|
+
ssrRenderList($props.categoryTrees, (categoryTree) => {
|
|
1725
|
+
_push(ssrRenderComponent($setup["ShopSidenavCategory"], {
|
|
1726
|
+
key: categoryTree._id,
|
|
1727
|
+
"category-tree": categoryTree
|
|
1728
|
+
}, null, _parent));
|
|
1729
|
+
});
|
|
1730
|
+
_push(`<!--]--></ul></nav></aside>`);
|
|
1731
|
+
}
|
|
1578
1732
|
const _sfc_setup$3 = _sfc_main$3.setup;
|
|
1579
1733
|
_sfc_main$3.setup = (props, ctx) => {
|
|
1580
1734
|
const ssrContext = useSSRContext();
|
|
1581
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/
|
|
1735
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenav.vue");
|
|
1582
1736
|
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
1583
1737
|
};
|
|
1738
|
+
const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
|
|
1584
1739
|
|
|
1585
1740
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1586
1741
|
__name: "ShopHeader",
|
|
1587
|
-
__ssrInlineRender: true,
|
|
1588
1742
|
props: {
|
|
1589
1743
|
categories: null
|
|
1590
1744
|
},
|
|
1591
|
-
setup(__props) {
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
icon: "i-search",
|
|
1595
|
-
onClick: () => {
|
|
1596
|
-
},
|
|
1597
|
-
label: i19searchProducts
|
|
1598
|
-
},
|
|
1599
|
-
account: {
|
|
1600
|
-
icon: "i-account",
|
|
1601
|
-
onClick: () => {
|
|
1602
|
-
},
|
|
1603
|
-
label: i19myAccount
|
|
1604
|
-
},
|
|
1605
|
-
cart: {
|
|
1606
|
-
icon: "i-shopping-cart",
|
|
1607
|
-
onClick: () => {
|
|
1608
|
-
},
|
|
1609
|
-
label: i19openCart
|
|
1610
|
-
}
|
|
1611
|
-
});
|
|
1612
|
-
const isSidenavOpen = ref(false);
|
|
1745
|
+
setup(__props, { expose }) {
|
|
1746
|
+
expose();
|
|
1747
|
+
const props = __props;
|
|
1613
1748
|
const header = ref(null);
|
|
1614
1749
|
const {
|
|
1615
1750
|
isSticky,
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
});
|
|
1622
|
-
return
|
|
1623
|
-
_push(`<header${ssrRenderAttrs(mergeProps({
|
|
1624
|
-
ref_key: "header",
|
|
1625
|
-
ref: header,
|
|
1626
|
-
class: ["top-0 z-50 transition-colors", [
|
|
1627
|
-
unref(isSticky) && !isSidenavOpen.value ? "bg-white/80" : "bg-white",
|
|
1628
|
-
unref(isSticky) ? "backdrop-blur-md shadow py-2 md:py-3" : "py-3 sm:py-4 md:py-5"
|
|
1629
|
-
]]
|
|
1630
|
-
}, _attrs))}><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">`);
|
|
1631
|
-
ssrRenderSlot(_ctx.$slots, "sidenav-toggle", {}, () => {
|
|
1632
|
-
_push(`<div class="md:hidden" data-sidenav-toggle><button class="px-2 my-1"${ssrRenderAttr("aria-label", "Abrir/fechar menu")}>`);
|
|
1633
|
-
ssrRenderSlot(_ctx.$slots, "sidenav-toggle-content", {}, () => {
|
|
1634
|
-
_push(`<i class="${ssrRenderClass([isSidenavOpen.value ? "i-close" : "i-menu", "text-base-500 text-3xl"])}"></i>`);
|
|
1635
|
-
}, _push, _parent);
|
|
1636
|
-
_push(`</button></div>`);
|
|
1637
|
-
}, _push, _parent);
|
|
1638
|
-
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
|
|
1639
|
-
ssrRenderSlot(_ctx.$slots, "nav", {}, null, _push, _parent);
|
|
1640
|
-
ssrRenderSlot(_ctx.$slots, "buttons", {}, () => {
|
|
1641
|
-
_push(`<div class="px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800" data-header-buttons><!--[-->`);
|
|
1642
|
-
ssrRenderList(buttons.value, ({ icon, onClick, label }, name) => {
|
|
1643
|
-
ssrRenderSlot(_ctx.$slots, "button", mergeProps({ key: name }, { name, icon, onClick }), () => {
|
|
1644
|
-
_push(`<button class="${ssrRenderClass(name === "account" ? "hidden sm:block" : null)}"${ssrRenderAttr("aria-label", label)}${ssrRenderAttr("data-header-button", name)}>`);
|
|
1645
|
-
ssrRenderSlot(_ctx.$slots, "button-content", { name, icon }, () => {
|
|
1646
|
-
_push(`<i class="${ssrRenderClass([icon, "hover:text-primary w-7 h-7 hover:scale-110 active:scale-125"])}"></i>`);
|
|
1647
|
-
}, _push, _parent);
|
|
1648
|
-
_push(`</button>`);
|
|
1649
|
-
}, _push, _parent);
|
|
1650
|
-
});
|
|
1651
|
-
_push(`<!--]--></div>`);
|
|
1652
|
-
}, _push, _parent);
|
|
1653
|
-
_push(`</div>`);
|
|
1654
|
-
_push(ssrRenderComponent(_sfc_main$4, {
|
|
1655
|
-
modelValue: isSidenavOpen.value,
|
|
1656
|
-
"onUpdate:modelValue": ($event) => isSidenavOpen.value = $event,
|
|
1657
|
-
"has-close-button": false,
|
|
1658
|
-
position: "absolute",
|
|
1659
|
-
class: "mt-2 -z-1",
|
|
1660
|
-
style: { height: `calc(100vh - ${unref(sidenavHeight)}px + .5rem)` }
|
|
1661
|
-
}, {
|
|
1662
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1663
|
-
if (_push2) {
|
|
1664
|
-
_push2(ssrRenderComponent(_sfc_main$3, {
|
|
1665
|
-
class: "bg-white pt-6",
|
|
1666
|
-
categories: __props.categories
|
|
1667
|
-
}, null, _parent2, _scopeId));
|
|
1668
|
-
} else {
|
|
1669
|
-
return [
|
|
1670
|
-
createVNode(_sfc_main$3, {
|
|
1671
|
-
class: "bg-white pt-6",
|
|
1672
|
-
categories: __props.categories
|
|
1673
|
-
}, null, 8, ["categories"])
|
|
1674
|
-
];
|
|
1675
|
-
}
|
|
1676
|
-
}),
|
|
1677
|
-
_: 1
|
|
1678
|
-
}, _parent));
|
|
1679
|
-
_push(`</header>`);
|
|
1680
|
-
};
|
|
1751
|
+
positionY,
|
|
1752
|
+
categoryTrees,
|
|
1753
|
+
isSidenavOpen
|
|
1754
|
+
} = useShopHeader({ ...props, header });
|
|
1755
|
+
const __returned__ = { props, header, isSticky, positionY, categoryTrees, isSidenavOpen, Drawer, ShopSidenav };
|
|
1756
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1757
|
+
return __returned__;
|
|
1681
1758
|
}
|
|
1682
1759
|
});
|
|
1683
|
-
|
|
1760
|
+
function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1761
|
+
_push(`<header${ssrRenderAttrs(mergeProps({
|
|
1762
|
+
ref: "header",
|
|
1763
|
+
class: ["top-0 z-50 transition-colors", [
|
|
1764
|
+
$setup.isSticky && !$setup.isSidenavOpen ? "bg-white/80" : "bg-white",
|
|
1765
|
+
$setup.isSticky ? "backdrop-blur-md shadow py-2 md:py-3" : "py-3 sm:py-4 md:py-5"
|
|
1766
|
+
]]
|
|
1767
|
+
}, _attrs))}><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"><div class="md:hidden"><button class="px-2 my-1"${ssrRenderAttr("aria-label", "Abrir/fechar menu")}><i class="${ssrRenderClass([$setup.isSidenavOpen ? "i-close" : "i-menu", "text-base-500 text-3xl"])}"></i></button></div>`);
|
|
1768
|
+
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
|
|
1769
|
+
_push(`<nav class="hidden md:block"></nav><div class="px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800"><button${ssrRenderAttr("aria-label", "Buscar produtos")}><i class="i-search w-7 h-7 hover:text-primary hover:scale-110 active:scale-125"></i></button><button class="hidden sm:block"${ssrRenderAttr("aria-label", "Minha conta")}><i class="i-account w-7 h-7 hover:text-primary hover:scale-110 active:scale-125"></i></button><button${ssrRenderAttr("aria-label", "Abrir carrinho")}><i class="i-shopping-cart w-7 h-7 hover:text-primary hover:scale-110 active:scale-125"></i></button></div></div>`);
|
|
1770
|
+
_push(ssrRenderComponent($setup["Drawer"], {
|
|
1771
|
+
modelValue: $setup.isSidenavOpen,
|
|
1772
|
+
"onUpdate:modelValue": ($event) => $setup.isSidenavOpen = $event,
|
|
1773
|
+
"has-close-button": false,
|
|
1774
|
+
position: "absolute",
|
|
1775
|
+
class: "mt-3 -z-1",
|
|
1776
|
+
style: { height: `calc(100vh - ${$setup.positionY}px + .5rem)` }
|
|
1777
|
+
}, {
|
|
1778
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1779
|
+
if (_push2) {
|
|
1780
|
+
_push2(ssrRenderComponent($setup["ShopSidenav"], mergeProps({ class: "bg-white pt-6" }, { categoryTrees: $setup.categoryTrees }), null, _parent2, _scopeId));
|
|
1781
|
+
} else {
|
|
1782
|
+
return [
|
|
1783
|
+
createVNode($setup["ShopSidenav"], mergeProps({ class: "bg-white pt-6" }, { categoryTrees: $setup.categoryTrees }), null, 16)
|
|
1784
|
+
];
|
|
1785
|
+
}
|
|
1786
|
+
}),
|
|
1787
|
+
_: 1
|
|
1788
|
+
}, _parent));
|
|
1789
|
+
_push(`</header>`);
|
|
1790
|
+
}
|
|
1684
1791
|
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
1685
1792
|
_sfc_main$2.setup = (props, ctx) => {
|
|
1686
1793
|
const ssrContext = useSSRContext();
|
|
1687
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/
|
|
1794
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeader.vue");
|
|
1688
1795
|
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
1689
1796
|
};
|
|
1797
|
+
const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
|
|
1690
1798
|
|
|
1691
1799
|
const $$Astro$7 = createAstro("https://ecom2-002.web.app");
|
|
1692
1800
|
const $$PagesHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
@@ -1696,33 +1804,25 @@ const $$PagesHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1696
1804
|
pageContext: {
|
|
1697
1805
|
isHomepage,
|
|
1698
1806
|
apiState,
|
|
1699
|
-
settings,
|
|
1700
1807
|
cms
|
|
1701
1808
|
}
|
|
1702
1809
|
} = Astro2.props;
|
|
1703
|
-
const
|
|
1810
|
+
const cmsHeader = await cms("header");
|
|
1704
1811
|
const pitchBar = { slides: [] };
|
|
1705
|
-
if (
|
|
1706
|
-
pitchBar.slides =
|
|
1707
|
-
} else if (header.marketing_stripe) {
|
|
1708
|
-
pitchBar.slides = [{
|
|
1709
|
-
href: header.marketing_stripe.link,
|
|
1710
|
-
html: header.marketing_stripe.text
|
|
1711
|
-
}];
|
|
1812
|
+
if (cmsHeader?.pitch_bar) {
|
|
1813
|
+
pitchBar.slides = cmsHeader.pitch_bar;
|
|
1712
1814
|
}
|
|
1713
1815
|
const shopHeader = {
|
|
1714
1816
|
categories: apiState.categories
|
|
1715
1817
|
};
|
|
1716
1818
|
const LogoHeading = Astro2.props.logoHeading || (isHomepage ? "h1" : "h2");
|
|
1717
|
-
return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": () => renderTemplate`${renderSlot($$
|
|
1718
|
-
${pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$
|
|
1719
|
-
${pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$
|
|
1720
|
-
`)}${renderSlot($$
|
|
1721
|
-
${renderComponent($$
|
|
1722
|
-
${maybeRenderHead($$
|
|
1723
|
-
${renderComponent($$
|
|
1724
|
-
${renderComponent($$result, "Picture", $$Picture, { "src": header.logo || settings.logo, "alt": settings.name, "widths": [300], "sizes": "150px", "fetchpriority": "high", "class": "hover:drop-shadow-sm" })}
|
|
1725
|
-
`)}` })}
|
|
1819
|
+
return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["pitch-bar"], renderTemplate`
|
|
1820
|
+
${pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result2, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`}
|
|
1821
|
+
${pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result2, "PitchBar", PitchBar, { ...pitchBar })}`}
|
|
1822
|
+
`)}${renderSlot($$result2, $$slots["sticky-header"], renderTemplate`
|
|
1823
|
+
${renderComponent($$result2, "ShopHeader", ShopHeader, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result3) => renderTemplate`${renderComponent($$result3, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result4) => renderTemplate`${renderSlot($$result4, $$slots["logo"], renderTemplate`
|
|
1824
|
+
${maybeRenderHead($$result4)}<a href="/">
|
|
1825
|
+
${renderComponent($$result4, "LogoHeading", LogoHeading, {}, { "default": ($$result5) => renderTemplate`${renderSlot($$result5, $$slots["logo-picture"])}` })}
|
|
1726
1826
|
</a>
|
|
1727
1827
|
`)}` })}` })}
|
|
1728
1828
|
`)}` })}`;
|
|
@@ -1734,9 +1834,9 @@ const $$Pages = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1734
1834
|
Astro2.self = $$Pages;
|
|
1735
1835
|
const { pageContext, title } = Astro2.props;
|
|
1736
1836
|
const { settings } = pageContext;
|
|
1737
|
-
return renderTemplate`${renderComponent($$result, "Base", $$Base, { "pageContext": pageContext, "title": title }, { "default": () => renderTemplate`${renderSlot($$
|
|
1738
|
-
${renderComponent($$
|
|
1739
|
-
`)}${renderSlot($$
|
|
1837
|
+
return renderTemplate`${renderComponent($$result, "Base", $$Base, { "pageContext": pageContext, "title": title }, { "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["header"], renderTemplate`
|
|
1838
|
+
${renderComponent($$result2, "Header", $$PagesHeader, { "pageContext": pageContext }, { "logo-picture": ($$result3) => renderTemplate`${renderComponent($$result3, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "sizes": "150px", "fetchpriority": "high", "class": "hover:drop-shadow-sm" })}` })}
|
|
1839
|
+
`)}${renderSlot($$result2, $$slots["default"])}` })}`;
|
|
1740
1840
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Pages.astro");
|
|
1741
1841
|
|
|
1742
1842
|
const getPriceWithDiscount = (price, discount) => {
|
|
@@ -1891,9 +1991,8 @@ const usePrices = (props) => {
|
|
|
1891
1991
|
};
|
|
1892
1992
|
};
|
|
1893
1993
|
|
|
1894
|
-
const _sfc_main$1 =
|
|
1994
|
+
const _sfc_main$1 = defineComponent({
|
|
1895
1995
|
__name: "Prices",
|
|
1896
|
-
__ssrInlineRender: true,
|
|
1897
1996
|
props: {
|
|
1898
1997
|
product: null,
|
|
1899
1998
|
price: null,
|
|
@@ -1906,7 +2005,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1906
2005
|
hasCashback: { type: Boolean, default: true },
|
|
1907
2006
|
hasPriceOptions: { type: Boolean, default: true }
|
|
1908
2007
|
},
|
|
1909
|
-
setup(__props) {
|
|
2008
|
+
setup(__props, { expose }) {
|
|
2009
|
+
expose();
|
|
1910
2010
|
const props = __props;
|
|
1911
2011
|
const {
|
|
1912
2012
|
hasVariedPrices,
|
|
@@ -1920,267 +2020,273 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1920
2020
|
priceWithDiscount,
|
|
1921
2021
|
discountLabel
|
|
1922
2022
|
} = usePrices(props);
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
2023
|
+
const __returned__ = { props, hasVariedPrices, salePrice, comparePrice, cashbackPercentage, cashbackValue, installmentsNumber, monthlyInterest, installmentValue, priceWithDiscount, discountLabel };
|
|
2024
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
2025
|
+
return __returned__;
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2029
|
+
const _component_Fade = resolveComponent("Fade");
|
|
2030
|
+
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
2031
|
+
class: ["text-base-600", $props.isBig ? "text-lg" : null],
|
|
2032
|
+
"data-prices": ""
|
|
2033
|
+
}, _attrs))}>`);
|
|
2034
|
+
if ($setup.comparePrice) {
|
|
2035
|
+
_push(`<span class="text-base-500 mr-1">`);
|
|
2036
|
+
if ($props.isLiteral) {
|
|
2037
|
+
_push(`<small>${ssrInterpolate(`${"De"} `)}</small>`);
|
|
2038
|
+
} else {
|
|
2039
|
+
_push(`<!---->`);
|
|
2040
|
+
}
|
|
2041
|
+
_push(`<s>${ssrInterpolate(_ctx.$money($setup.comparePrice))}</s>`);
|
|
2042
|
+
if ($props.isLiteral) {
|
|
2043
|
+
_push(`<small>${ssrInterpolate(` ${"Por"}`)}</small>`);
|
|
2044
|
+
} else {
|
|
2045
|
+
_push(`<!---->`);
|
|
2046
|
+
}
|
|
2047
|
+
_push(`</span>`);
|
|
2048
|
+
} else {
|
|
2049
|
+
_push(`<!---->`);
|
|
2050
|
+
}
|
|
2051
|
+
_push(`<strong class="${ssrRenderClass([$props.isBig ? "text-5xl block" : null, "inline-block text-base-800"])}">`);
|
|
2052
|
+
if ($setup.hasVariedPrices) {
|
|
2053
|
+
_push(`<small>${ssrInterpolate(`${"A partir de"} `)}</small>`);
|
|
2054
|
+
} else {
|
|
2055
|
+
_push(`<!---->`);
|
|
2056
|
+
}
|
|
2057
|
+
_push(` ${ssrInterpolate(_ctx.$money($setup.salePrice))}</strong>`);
|
|
2058
|
+
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
2059
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
2060
|
+
if (_push2) {
|
|
2061
|
+
if ($setup.cashbackValue && $props.hasCashback) {
|
|
2062
|
+
_push2(`<div class="relative z-10"${_scopeId}><span${ssrRenderAttr("data-tooltip", "Receba $1 de volta".replace("$1", _ctx.$percentage($setup.cashbackPercentage)))}${_scopeId}><i class="i-cashback mr-1"${_scopeId}></i><span class="font-medium"${_scopeId}>${ssrInterpolate(_ctx.$money($setup.cashbackValue))}</span><small${_scopeId}> cashback</small></span></div>`);
|
|
1939
2063
|
} else {
|
|
1940
|
-
|
|
2064
|
+
_push2(`<!---->`);
|
|
1941
2065
|
}
|
|
1942
|
-
_push(`</span>`);
|
|
1943
|
-
} else {
|
|
1944
|
-
_push(`<!---->`);
|
|
1945
|
-
}
|
|
1946
|
-
_push(`<strong class="${ssrRenderClass([__props.isBig ? "text-5xl block" : null, "inline-block text-base-800"])}">`);
|
|
1947
|
-
if (unref(hasVariedPrices)) {
|
|
1948
|
-
_push(`<small>${ssrInterpolate(`${"A partir de"} `)}</small>`);
|
|
1949
2066
|
} else {
|
|
1950
|
-
|
|
2067
|
+
return [
|
|
2068
|
+
$setup.cashbackValue && $props.hasCashback ? (openBlock(), createBlock("div", {
|
|
2069
|
+
key: 0,
|
|
2070
|
+
class: "relative z-10"
|
|
2071
|
+
}, [
|
|
2072
|
+
createVNode("span", {
|
|
2073
|
+
"data-tooltip": "Receba $1 de volta".replace("$1", _ctx.$percentage($setup.cashbackPercentage))
|
|
2074
|
+
}, [
|
|
2075
|
+
createVNode("i", { class: "i-cashback mr-1" }),
|
|
2076
|
+
createVNode("span", { class: "font-medium" }, toDisplayString(_ctx.$money($setup.cashbackValue)), 1),
|
|
2077
|
+
createVNode("small", null, " cashback")
|
|
2078
|
+
], 8, ["data-tooltip"])
|
|
2079
|
+
])) : createCommentVNode("", true)
|
|
2080
|
+
];
|
|
1951
2081
|
}
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2082
|
+
}),
|
|
2083
|
+
_: 1
|
|
2084
|
+
}, _parent));
|
|
2085
|
+
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
2086
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
2087
|
+
if (_push2) {
|
|
2088
|
+
if ($setup.installmentValue && $props.hasPriceOptions) {
|
|
2089
|
+
_push2(`<div${_scopeId}>`);
|
|
2090
|
+
if ($props.isLiteral) {
|
|
2091
|
+
_push2(`<small${_scopeId}>${ssrInterpolate(`${"At\xE9"} `)}</small>`);
|
|
1961
2092
|
} else {
|
|
1962
|
-
|
|
1963
|
-
unref(cashbackValue) && __props.hasCashback ? (openBlock(), createBlock("div", {
|
|
1964
|
-
key: 0,
|
|
1965
|
-
class: "relative z-10"
|
|
1966
|
-
}, [
|
|
1967
|
-
createVNode("span", {
|
|
1968
|
-
"data-tooltip": "Receba $1 de volta".replace("$1", _ctx.$percentage(unref(cashbackPercentage)))
|
|
1969
|
-
}, [
|
|
1970
|
-
createVNode("i", { class: "i-cashback mr-1" }),
|
|
1971
|
-
createVNode("span", { class: "font-medium" }, toDisplayString(_ctx.$money(unref(cashbackValue))), 1),
|
|
1972
|
-
createVNode("small", null, " cashback")
|
|
1973
|
-
], 8, ["data-tooltip"])
|
|
1974
|
-
])) : createCommentVNode("", true)
|
|
1975
|
-
];
|
|
2093
|
+
_push2(`<!---->`);
|
|
1976
2094
|
}
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
1981
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1982
|
-
if (_push2) {
|
|
1983
|
-
if (unref(installmentValue) && __props.hasPriceOptions) {
|
|
1984
|
-
_push2(`<div${_scopeId}>`);
|
|
1985
|
-
if (__props.isLiteral) {
|
|
1986
|
-
_push2(`<small${_scopeId}>${ssrInterpolate(`${"Até"} `)}</small>`);
|
|
1987
|
-
} else {
|
|
1988
|
-
_push2(`<!---->`);
|
|
1989
|
-
}
|
|
1990
|
-
_push2(` ${ssrInterpolate(unref(installmentsNumber))}x `);
|
|
1991
|
-
if (__props.isLiteral) {
|
|
1992
|
-
_push2(`<small${_scopeId}>${ssrInterpolate(` ${"De"} `)}</small>`);
|
|
1993
|
-
} else {
|
|
1994
|
-
_push2(`<!---->`);
|
|
1995
|
-
}
|
|
1996
|
-
_push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$money(unref(installmentValue)))}</span>`);
|
|
1997
|
-
if (!unref(monthlyInterest) && __props.isLiteral) {
|
|
1998
|
-
_push2(`<small${_scopeId}>${ssrInterpolate("Sem juros")}</small>`);
|
|
1999
|
-
} else {
|
|
2000
|
-
_push2(`<!---->`);
|
|
2001
|
-
}
|
|
2002
|
-
_push2(`</div>`);
|
|
2003
|
-
} else {
|
|
2004
|
-
_push2(`<!---->`);
|
|
2005
|
-
}
|
|
2095
|
+
_push2(` ${ssrInterpolate($setup.installmentsNumber)}x `);
|
|
2096
|
+
if ($props.isLiteral) {
|
|
2097
|
+
_push2(`<small${_scopeId}>${ssrInterpolate(` ${"De"} `)}</small>`);
|
|
2006
2098
|
} else {
|
|
2007
|
-
|
|
2008
|
-
unref(installmentValue) && __props.hasPriceOptions ? (openBlock(), createBlock("div", { key: 0 }, [
|
|
2009
|
-
__props.isLiteral ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"Até"} `))) : createCommentVNode("", true),
|
|
2010
|
-
createTextVNode(" " + toDisplayString(unref(installmentsNumber)) + "x ", 1),
|
|
2011
|
-
__props.isLiteral ? (openBlock(), createBlock("small", { key: 1 }, toDisplayString(` ${"De"} `))) : createCommentVNode("", true),
|
|
2012
|
-
createVNode("span", null, toDisplayString(_ctx.$money(unref(installmentValue))), 1),
|
|
2013
|
-
!unref(monthlyInterest) && __props.isLiteral ? (openBlock(), createBlock("small", { key: 2 }, toDisplayString("Sem juros"))) : createCommentVNode("", true)
|
|
2014
|
-
])) : createCommentVNode("", true)
|
|
2015
|
-
];
|
|
2099
|
+
_push2(`<!---->`);
|
|
2016
2100
|
}
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
2021
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
2022
|
-
if (_push2) {
|
|
2023
|
-
if (unref(priceWithDiscount) < unref(salePrice) && __props.hasPriceOptions) {
|
|
2024
|
-
_push2(`<div${_scopeId}>`);
|
|
2025
|
-
if (!unref(discountLabel)) {
|
|
2026
|
-
_push2(`<small${_scopeId}>${ssrInterpolate(`${"A partir de"} `)}</small>`);
|
|
2027
|
-
} else {
|
|
2028
|
-
_push2(`<!---->`);
|
|
2029
|
-
}
|
|
2030
|
-
_push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$money(unref(priceWithDiscount)))}</span>`);
|
|
2031
|
-
if (unref(discountLabel)) {
|
|
2032
|
-
_push2(`<small${_scopeId}>${ssrInterpolate(` ${unref(discountLabel)}`)}</small>`);
|
|
2033
|
-
} else {
|
|
2034
|
-
_push2(`<!---->`);
|
|
2035
|
-
}
|
|
2036
|
-
_push2(`</div>`);
|
|
2037
|
-
} else {
|
|
2038
|
-
_push2(`<!---->`);
|
|
2039
|
-
}
|
|
2101
|
+
_push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$money($setup.installmentValue))}</span>`);
|
|
2102
|
+
if (!$setup.monthlyInterest && $props.isLiteral) {
|
|
2103
|
+
_push2(`<small${_scopeId}>${ssrInterpolate("Sem juros")}</small>`);
|
|
2040
2104
|
} else {
|
|
2041
|
-
|
|
2042
|
-
unref(priceWithDiscount) < unref(salePrice) && __props.hasPriceOptions ? (openBlock(), createBlock("div", { key: 0 }, [
|
|
2043
|
-
!unref(discountLabel) ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"A partir de"} `))) : createCommentVNode("", true),
|
|
2044
|
-
createVNode("span", null, toDisplayString(_ctx.$money(unref(priceWithDiscount))), 1),
|
|
2045
|
-
unref(discountLabel) ? (openBlock(), createBlock("small", { key: 1 }, toDisplayString(` ${unref(discountLabel)}`), 1)) : createCommentVNode("", true)
|
|
2046
|
-
])) : createCommentVNode("", true)
|
|
2047
|
-
];
|
|
2105
|
+
_push2(`<!---->`);
|
|
2048
2106
|
}
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2107
|
+
_push2(`</div>`);
|
|
2108
|
+
} else {
|
|
2109
|
+
_push2(`<!---->`);
|
|
2110
|
+
}
|
|
2111
|
+
} else {
|
|
2112
|
+
return [
|
|
2113
|
+
$setup.installmentValue && $props.hasPriceOptions ? (openBlock(), createBlock("div", { key: 0 }, [
|
|
2114
|
+
$props.isLiteral ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"At\xE9"} `))) : createCommentVNode("", true),
|
|
2115
|
+
createTextVNode(" " + toDisplayString($setup.installmentsNumber) + "x ", 1),
|
|
2116
|
+
$props.isLiteral ? (openBlock(), createBlock("small", { key: 1 }, toDisplayString(` ${"De"} `))) : createCommentVNode("", true),
|
|
2117
|
+
createVNode("span", null, toDisplayString(_ctx.$money($setup.installmentValue)), 1),
|
|
2118
|
+
!$setup.monthlyInterest && $props.isLiteral ? (openBlock(), createBlock("small", { key: 2 }, toDisplayString("Sem juros"))) : createCommentVNode("", true)
|
|
2119
|
+
])) : createCommentVNode("", true)
|
|
2120
|
+
];
|
|
2121
|
+
}
|
|
2122
|
+
}),
|
|
2123
|
+
_: 1
|
|
2124
|
+
}, _parent));
|
|
2125
|
+
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
2126
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
2127
|
+
if (_push2) {
|
|
2128
|
+
if ($setup.priceWithDiscount < $setup.salePrice && $props.hasPriceOptions) {
|
|
2129
|
+
_push2(`<div${_scopeId}>`);
|
|
2130
|
+
if (!$setup.discountLabel) {
|
|
2131
|
+
_push2(`<small${_scopeId}>${ssrInterpolate(`${"A partir de"} `)}</small>`);
|
|
2132
|
+
} else {
|
|
2133
|
+
_push2(`<!---->`);
|
|
2134
|
+
}
|
|
2135
|
+
_push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$money($setup.priceWithDiscount))}</span>`);
|
|
2136
|
+
if ($setup.discountLabel) {
|
|
2137
|
+
_push2(`<small${_scopeId}>${ssrInterpolate(` ${$setup.discountLabel}`)}</small>`);
|
|
2138
|
+
} else {
|
|
2139
|
+
_push2(`<!---->`);
|
|
2140
|
+
}
|
|
2141
|
+
_push2(`</div>`);
|
|
2142
|
+
} else {
|
|
2143
|
+
_push2(`<!---->`);
|
|
2144
|
+
}
|
|
2145
|
+
} else {
|
|
2146
|
+
return [
|
|
2147
|
+
$setup.priceWithDiscount < $setup.salePrice && $props.hasPriceOptions ? (openBlock(), createBlock("div", { key: 0 }, [
|
|
2148
|
+
!$setup.discountLabel ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"A partir de"} `))) : createCommentVNode("", true),
|
|
2149
|
+
createVNode("span", null, toDisplayString(_ctx.$money($setup.priceWithDiscount)), 1),
|
|
2150
|
+
$setup.discountLabel ? (openBlock(), createBlock("small", { key: 1 }, toDisplayString(` ${$setup.discountLabel}`), 1)) : createCommentVNode("", true)
|
|
2151
|
+
])) : createCommentVNode("", true)
|
|
2152
|
+
];
|
|
2153
|
+
}
|
|
2154
|
+
}),
|
|
2155
|
+
_: 1
|
|
2156
|
+
}, _parent));
|
|
2157
|
+
_push(`</div>`);
|
|
2158
|
+
}
|
|
2057
2159
|
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
2058
2160
|
_sfc_main$1.setup = (props, ctx) => {
|
|
2059
2161
|
const ssrContext = useSSRContext();
|
|
2060
2162
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
|
|
2061
2163
|
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
2062
2164
|
};
|
|
2165
|
+
const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
|
|
2063
2166
|
|
|
2064
|
-
const _sfc_main =
|
|
2167
|
+
const _sfc_main = defineComponent({
|
|
2065
2168
|
__name: "ProductCard",
|
|
2066
|
-
__ssrInlineRender: true,
|
|
2067
2169
|
props: {
|
|
2068
2170
|
as: { default: "div" }
|
|
2069
2171
|
},
|
|
2070
|
-
setup(__props) {
|
|
2172
|
+
setup(__props, { expose }) {
|
|
2173
|
+
expose();
|
|
2071
2174
|
const price = ref(12);
|
|
2072
2175
|
const isBig = ref(false);
|
|
2073
2176
|
setTimeout(() => {
|
|
2074
2177
|
price.value = 8;
|
|
2075
2178
|
isBig.value = true;
|
|
2076
2179
|
}, 5e3);
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
if (_push2) {
|
|
2081
|
-
_push2(ssrRenderComponent(_sfc_main$1, null, {
|
|
2082
|
-
default: withCtx(({ salePrice }, _push3, _parent3, _scopeId2) => {
|
|
2083
|
-
if (_push3) {
|
|
2084
|
-
_push3(` ProductCard ${ssrInterpolate(salePrice)}`);
|
|
2085
|
-
} else {
|
|
2086
|
-
return [
|
|
2087
|
-
createTextVNode(" ProductCard " + toDisplayString(salePrice), 1)
|
|
2088
|
-
];
|
|
2089
|
-
}
|
|
2090
|
-
}),
|
|
2091
|
-
_: 1
|
|
2092
|
-
}, _parent2, _scopeId));
|
|
2093
|
-
_push2(ssrRenderComponent(_sfc_main$1, {
|
|
2094
|
-
product: { price: price.value }
|
|
2095
|
-
}, null, _parent2, _scopeId));
|
|
2096
|
-
_push2(ssrRenderComponent(_sfc_main$1, {
|
|
2097
|
-
price: 12,
|
|
2098
|
-
"base-price": 17
|
|
2099
|
-
}, null, _parent2, _scopeId));
|
|
2100
|
-
_push2(ssrRenderComponent(_sfc_main$1, {
|
|
2101
|
-
price: 12,
|
|
2102
|
-
"base-price": 16,
|
|
2103
|
-
"is-literal": true
|
|
2104
|
-
}, null, _parent2, _scopeId));
|
|
2105
|
-
_push2(ssrRenderComponent(_sfc_main$1, {
|
|
2106
|
-
price: 12,
|
|
2107
|
-
"is-big": isBig.value
|
|
2108
|
-
}, null, _parent2, _scopeId));
|
|
2109
|
-
_push2(ssrRenderComponent(_sfc_main$1, {
|
|
2110
|
-
price: 14,
|
|
2111
|
-
"base-price": 18,
|
|
2112
|
-
"is-big": isBig.value,
|
|
2113
|
-
"is-literal": true
|
|
2114
|
-
}, null, _parent2, _scopeId));
|
|
2115
|
-
_push2(ssrRenderComponent(_sfc_main$1, {
|
|
2116
|
-
price: 12,
|
|
2117
|
-
"base-price": 16
|
|
2118
|
-
}, {
|
|
2119
|
-
"compare-value": withCtx(({ comparePrice }, _push3, _parent3, _scopeId2) => {
|
|
2120
|
-
if (_push3) {
|
|
2121
|
-
_push3(` x${ssrInterpolate(comparePrice)}`);
|
|
2122
|
-
} else {
|
|
2123
|
-
return [
|
|
2124
|
-
createTextVNode(" x" + toDisplayString(comparePrice), 1)
|
|
2125
|
-
];
|
|
2126
|
-
}
|
|
2127
|
-
}),
|
|
2128
|
-
_: 1
|
|
2129
|
-
}, _parent2, _scopeId));
|
|
2130
|
-
} else {
|
|
2131
|
-
return [
|
|
2132
|
-
createVNode(_sfc_main$1, null, {
|
|
2133
|
-
default: withCtx(({ salePrice }) => [
|
|
2134
|
-
createTextVNode(" ProductCard " + toDisplayString(salePrice), 1)
|
|
2135
|
-
]),
|
|
2136
|
-
_: 1
|
|
2137
|
-
}),
|
|
2138
|
-
createVNode(_sfc_main$1, {
|
|
2139
|
-
product: { price: price.value }
|
|
2140
|
-
}, null, 8, ["product"]),
|
|
2141
|
-
createVNode(_sfc_main$1, {
|
|
2142
|
-
price: 12,
|
|
2143
|
-
"base-price": 17
|
|
2144
|
-
}),
|
|
2145
|
-
createVNode(_sfc_main$1, {
|
|
2146
|
-
price: 12,
|
|
2147
|
-
"base-price": 16,
|
|
2148
|
-
"is-literal": true
|
|
2149
|
-
}),
|
|
2150
|
-
createVNode(_sfc_main$1, {
|
|
2151
|
-
price: 12,
|
|
2152
|
-
"is-big": isBig.value
|
|
2153
|
-
}, null, 8, ["is-big"]),
|
|
2154
|
-
createVNode(_sfc_main$1, {
|
|
2155
|
-
price: 14,
|
|
2156
|
-
"base-price": 18,
|
|
2157
|
-
"is-big": isBig.value,
|
|
2158
|
-
"is-literal": true
|
|
2159
|
-
}, null, 8, ["is-big"]),
|
|
2160
|
-
createVNode(_sfc_main$1, {
|
|
2161
|
-
price: 12,
|
|
2162
|
-
"base-price": 16
|
|
2163
|
-
}, {
|
|
2164
|
-
"compare-value": withCtx(({ comparePrice }) => [
|
|
2165
|
-
createTextVNode(" x" + toDisplayString(comparePrice), 1)
|
|
2166
|
-
]),
|
|
2167
|
-
_: 1
|
|
2168
|
-
})
|
|
2169
|
-
];
|
|
2170
|
-
}
|
|
2171
|
-
}),
|
|
2172
|
-
_: 1
|
|
2173
|
-
}), _parent);
|
|
2174
|
-
};
|
|
2180
|
+
const __returned__ = { price, isBig, Prices };
|
|
2181
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
2182
|
+
return __returned__;
|
|
2175
2183
|
}
|
|
2176
2184
|
});
|
|
2177
|
-
|
|
2185
|
+
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2186
|
+
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), _attrs, {
|
|
2187
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
2188
|
+
if (_push2) {
|
|
2189
|
+
_push2(ssrRenderComponent($setup["Prices"], null, {
|
|
2190
|
+
default: withCtx(({ salePrice }, _push3, _parent3, _scopeId2) => {
|
|
2191
|
+
if (_push3) {
|
|
2192
|
+
_push3(` ProductCard ${ssrInterpolate(salePrice)}`);
|
|
2193
|
+
} else {
|
|
2194
|
+
return [
|
|
2195
|
+
createTextVNode(" ProductCard " + toDisplayString(salePrice), 1)
|
|
2196
|
+
];
|
|
2197
|
+
}
|
|
2198
|
+
}),
|
|
2199
|
+
_: 1
|
|
2200
|
+
}, _parent2, _scopeId));
|
|
2201
|
+
_push2(ssrRenderComponent($setup["Prices"], {
|
|
2202
|
+
product: { price: $setup.price }
|
|
2203
|
+
}, null, _parent2, _scopeId));
|
|
2204
|
+
_push2(ssrRenderComponent($setup["Prices"], {
|
|
2205
|
+
price: 12,
|
|
2206
|
+
"base-price": 17
|
|
2207
|
+
}, null, _parent2, _scopeId));
|
|
2208
|
+
_push2(ssrRenderComponent($setup["Prices"], {
|
|
2209
|
+
price: 12,
|
|
2210
|
+
"base-price": 16,
|
|
2211
|
+
"is-literal": true
|
|
2212
|
+
}, null, _parent2, _scopeId));
|
|
2213
|
+
_push2(ssrRenderComponent($setup["Prices"], {
|
|
2214
|
+
price: 12,
|
|
2215
|
+
"is-big": $setup.isBig
|
|
2216
|
+
}, null, _parent2, _scopeId));
|
|
2217
|
+
_push2(ssrRenderComponent($setup["Prices"], {
|
|
2218
|
+
price: 14,
|
|
2219
|
+
"base-price": 18,
|
|
2220
|
+
"is-big": $setup.isBig,
|
|
2221
|
+
"is-literal": true
|
|
2222
|
+
}, null, _parent2, _scopeId));
|
|
2223
|
+
_push2(ssrRenderComponent($setup["Prices"], {
|
|
2224
|
+
price: 12,
|
|
2225
|
+
"base-price": 16
|
|
2226
|
+
}, {
|
|
2227
|
+
"compare-value": withCtx(({ comparePrice }, _push3, _parent3, _scopeId2) => {
|
|
2228
|
+
if (_push3) {
|
|
2229
|
+
_push3(` x${ssrInterpolate(comparePrice)}`);
|
|
2230
|
+
} else {
|
|
2231
|
+
return [
|
|
2232
|
+
createTextVNode(" x" + toDisplayString(comparePrice), 1)
|
|
2233
|
+
];
|
|
2234
|
+
}
|
|
2235
|
+
}),
|
|
2236
|
+
_: 1
|
|
2237
|
+
}, _parent2, _scopeId));
|
|
2238
|
+
} else {
|
|
2239
|
+
return [
|
|
2240
|
+
createVNode($setup["Prices"], null, {
|
|
2241
|
+
default: withCtx(({ salePrice }) => [
|
|
2242
|
+
createTextVNode(" ProductCard " + toDisplayString(salePrice), 1)
|
|
2243
|
+
]),
|
|
2244
|
+
_: 1
|
|
2245
|
+
}),
|
|
2246
|
+
createVNode($setup["Prices"], {
|
|
2247
|
+
product: { price: $setup.price }
|
|
2248
|
+
}, null, 8, ["product"]),
|
|
2249
|
+
createVNode($setup["Prices"], {
|
|
2250
|
+
price: 12,
|
|
2251
|
+
"base-price": 17
|
|
2252
|
+
}),
|
|
2253
|
+
createVNode($setup["Prices"], {
|
|
2254
|
+
price: 12,
|
|
2255
|
+
"base-price": 16,
|
|
2256
|
+
"is-literal": true
|
|
2257
|
+
}),
|
|
2258
|
+
createVNode($setup["Prices"], {
|
|
2259
|
+
price: 12,
|
|
2260
|
+
"is-big": $setup.isBig
|
|
2261
|
+
}, null, 8, ["is-big"]),
|
|
2262
|
+
createVNode($setup["Prices"], {
|
|
2263
|
+
price: 14,
|
|
2264
|
+
"base-price": 18,
|
|
2265
|
+
"is-big": $setup.isBig,
|
|
2266
|
+
"is-literal": true
|
|
2267
|
+
}, null, 8, ["is-big"]),
|
|
2268
|
+
createVNode($setup["Prices"], {
|
|
2269
|
+
price: 12,
|
|
2270
|
+
"base-price": 16
|
|
2271
|
+
}, {
|
|
2272
|
+
"compare-value": withCtx(({ comparePrice }) => [
|
|
2273
|
+
createTextVNode(" x" + toDisplayString(comparePrice), 1)
|
|
2274
|
+
]),
|
|
2275
|
+
_: 1
|
|
2276
|
+
})
|
|
2277
|
+
];
|
|
2278
|
+
}
|
|
2279
|
+
}),
|
|
2280
|
+
_: 1
|
|
2281
|
+
}), _parent);
|
|
2282
|
+
}
|
|
2178
2283
|
const _sfc_setup = _sfc_main.setup;
|
|
2179
2284
|
_sfc_main.setup = (props, ctx) => {
|
|
2180
2285
|
const ssrContext = useSSRContext();
|
|
2181
2286
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ProductCard.vue");
|
|
2182
2287
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
2183
2288
|
};
|
|
2289
|
+
const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
2184
2290
|
|
|
2185
2291
|
const $$Astro$5 = createAstro("https://ecom2-002.web.app");
|
|
2186
2292
|
const $$Home = createComponent(async ($$result, $$props, $$slots) => {
|
|
@@ -2227,8 +2333,8 @@ const $$Home = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
2227
2333
|
</label>
|
|
2228
2334
|
</div>
|
|
2229
2335
|
</div>
|
|
2230
|
-
${renderComponent($$result, "Prices",
|
|
2231
|
-
${renderComponent($$result, "ProductCard",
|
|
2336
|
+
${renderComponent($$result, "Prices", Prices, { "price": 10, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/Prices.vue", "client:component-export": "default" })}
|
|
2337
|
+
${renderComponent($$result, "ProductCard", ProductCard, { "client:load": true, "client:component-hydration": "load", "client:component-path": "@@sf/components/ProductCard.vue", "client:component-export": "default" })}
|
|
2232
2338
|
</main>`;
|
|
2233
2339
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Home.astro");
|
|
2234
2340
|
|
|
@@ -2247,8 +2353,8 @@ const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
2247
2353
|
loadError = err;
|
|
2248
2354
|
}
|
|
2249
2355
|
return renderTemplate`<html${addAttribute(pageContext?.lang.replace("_", "-"), "lang")}>
|
|
2250
|
-
${pageContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": () => renderTemplate`${renderComponent($$
|
|
2251
|
-
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": () => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
2356
|
+
${pageContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate`${renderComponent($$result2, "HomeMain", $$Home, { "pageContext": pageContext })}` })}`}
|
|
2357
|
+
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
2252
2358
|
</html>`;
|
|
2253
2359
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro");
|
|
2254
2360
|
|
|
@@ -2335,8 +2441,8 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
2335
2441
|
loadError = err;
|
|
2336
2442
|
}
|
|
2337
2443
|
return renderTemplate`<html${addAttribute(pageContext?.lang.replace("_", "-"), "lang")}>
|
|
2338
|
-
${pageContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": () => renderTemplate`${renderComponent($$
|
|
2339
|
-
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": () => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
2444
|
+
${pageContext && renderTemplate`${renderComponent($$result, "PagesLayout", $$Pages, { "pageContext": pageContext }, { "default": ($$result2) => renderTemplate`${renderComponent($$result2, "WildcardMain", $$Wildcard, { "pageContext": pageContext })}` })}`}
|
|
2445
|
+
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
2340
2446
|
</html>`;
|
|
2341
2447
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro");
|
|
2342
2448
|
|
|
@@ -2351,4 +2457,4 @@ const _page5 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
2351
2457
|
url: $$url
|
|
2352
2458
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
2353
2459
|
|
|
2354
|
-
export { $$Pages as $,
|
|
2460
|
+
export { $$Pages as $, _export_sfc as _, _page0 as a, _page1 as b, _page3 as c, _page4 as d, _page5 as e, loadPageContext as l };
|