cloudcommerce 0.24.1 → 0.26.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/workflows/test-e2e.yml +2 -2
- package/CHANGELOG.md +43 -0
- package/action.yml +2 -2
- package/ecomplus-stores/barra-doce/.idx/dev.nix +24 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.json +11 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.json +11 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.json +11 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +30 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +7 -7
- package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +2 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +149 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +2 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +68 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +6 -6
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +2 -0
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/iluminim/.idx/dev.nix +24 -0
- package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
- package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/contato.json +11 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/terms.json +11 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/trocas.json +11 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/layout.json +30 -0
- package/ecomplus-stores/iluminim/functions/ssr/package.json +7 -7
- package/ecomplus-stores/iluminim/functions/ssr/src/assets/style.css +2 -2
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopFooter.vue +149 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +2 -2
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageFooter.astro +68 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +1 -1
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/index.astro +2 -0
- package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/iluminim/package.json +2 -2
- package/ecomplus-stores/monocard/.idx/dev.nix +24 -0
- package/ecomplus-stores/monocard/functions/ssr/package.json +1 -1
- package/ecomplus-stores/tia-sonia/.idx/dev.nix +24 -0
- package/package.json +6 -6
- package/packages/api/package.json +1 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +5 -3
- package/packages/apps/correios/tests/calculate-shipping.test.mjs +45 -0
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +4 -2
- package/packages/apps/custom-shipping/tests/calculate-shipping.test.mjs +37 -0
- package/packages/apps/datafrete/package.json +2 -2
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +2 -2
- package/packages/apps/flash-courier/package.json +2 -2
- package/packages/apps/frenet/package.json +2 -2
- package/packages/apps/galaxpay/package.json +2 -2
- package/packages/apps/google-analytics/package.json +2 -2
- package/packages/apps/jadlog/package.json +2 -2
- package/packages/apps/loyalty-points/package.json +4 -2
- package/packages/apps/loyalty-points/tests/1-list-payments.test.mjs +37 -0
- package/packages/apps/loyalty-points/tests/2-create-transaction.test.mjs +41 -0
- package/packages/apps/melhor-envio/package.json +2 -2
- package/packages/apps/mercadopago/package.json +5 -3
- package/packages/apps/mercadopago/tests/1-list-payments.test.mjs +37 -0
- package/packages/apps/mercadopago/tests/2-create-transaction.test.mjs +42 -0
- package/packages/apps/pagarme/package.json +2 -2
- package/packages/apps/paghiper/package.json +2 -2
- package/packages/apps/pix/package.json +2 -2
- package/packages/apps/tiny-erp/package.json +2 -2
- package/packages/apps/webhooks/package.json +2 -2
- package/packages/cli/lib/cli.js +5 -1
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/cli.ts +5 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +2 -2
- package/packages/eslint/package.json +5 -5
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +2 -2
- package/packages/i18n/lib/en_us/i19allProducts.txt +1 -0
- package/packages/i18n/lib/en_us/i19institutional.txt +1 -0
- package/packages/i18n/lib/en_us.d.ts +2 -0
- package/packages/i18n/lib/en_us.js +2 -0
- package/packages/i18n/lib/en_us.js.map +1 -1
- package/packages/i18n/lib/pt_br/i19allProducts.txt +1 -0
- package/packages/i18n/lib/pt_br/i19institutional.txt +1 -0
- package/packages/i18n/lib/pt_br.d.ts +2 -0
- package/packages/i18n/lib/pt_br.js +2 -0
- package/packages/i18n/lib/pt_br.js.map +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/i18n/src/en_us.ts +2 -0
- package/packages/i18n/src/pt_br.ts +2 -0
- package/packages/modules/package.json +4 -3
- package/packages/modules/tests/modules.test.mjs +7 -8
- package/packages/passport/package.json +1 -1
- package/packages/ssr/lib/firebase/serve-storefront.js +44 -33
- package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
- package/packages/ssr/package.json +6 -6
- package/packages/ssr/src/firebase/serve-storefront.ts +45 -34
- package/packages/storefront/config/storefront.cms.js +3 -1
- package/packages/storefront/config/storefront.config.mjs +8 -2
- package/packages/storefront/dist/client/_astro/{Carousel.63d511ab.js → Carousel.926668f2.js} +1 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.eadba34f.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.1f0524aa.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.7407eeaf.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.562a32ab.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.763cd2ca.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.126900a6.js +4 -0
- package/packages/storefront/dist/client/_astro/_...slug_.36cd433d.css +1 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.ee681fa8.js +1 -0
- package/packages/storefront/dist/client/_astro/api.a2eda23e.js +1 -0
- package/packages/storefront/dist/client/_astro/client.e6d9439a.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.1df8af9a.js → firebase-app.93857bfb.js} +121 -91
- package/packages/storefront/dist/client/_astro/format-money.923559cc.js +1 -0
- package/packages/storefront/dist/client/_astro/img.ec6ba316.js +1 -0
- package/packages/storefront/dist/client/_astro/index.709ac149.js +1 -0
- package/packages/storefront/dist/client/_astro/modules-info.48980668.js +1 -0
- package/packages/storefront/dist/client/manifest.webmanifest +1 -1
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/CartSidebar.2b555408.mjs +393 -0
- package/packages/storefront/dist/server/chunks/SearchModal.f418e188.mjs +44 -0
- package/packages/storefront/dist/server/chunks/_...d32bcc0c.mjs +35 -0
- package/packages/storefront/dist/server/chunks/{account@_@astro.a02ffb0b.mjs → account@_@astro.0106855f.mjs} +12 -4
- package/packages/storefront/dist/server/chunks/{astro.a7611b51.mjs → astro.bb5b7191.mjs} +141 -91
- package/packages/storefront/dist/server/chunks/{_...5323ec5a.mjs → endpoint@_@js.35807882.mjs} +12 -4
- package/packages/storefront/dist/server/chunks/{index@_@astro.d898498a.mjs → index@_@astro.477f5af1.mjs} +12 -4
- package/packages/storefront/dist/server/chunks/{index@_@astro.42c693b9.mjs → index@_@astro.e5a61d6e.mjs} +12 -4
- package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.0f33557e.mjs → _...slug_.astro.fd8a229f.mjs} +673 -937
- package/packages/storefront/dist/server/chunks/pages/{account.astro.9325adb2.mjs → account.astro.3b21bff8.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/endpoint.js.247079ba.mjs +119 -0
- package/packages/storefront/dist/server/chunks/pages/{index.astro.0f31fa39.mjs → index.astro.dab642f5.mjs} +605 -58
- package/packages/storefront/dist/server/chunks/pages/{~fallback.astro.bd93f01e.mjs → ~fallback.astro.7630c0d6.mjs} +25 -7
- package/packages/storefront/dist/server/chunks/{~fallback@_@astro.d17419ae.mjs → ~fallback@_@astro.65227dd7.mjs} +12 -4
- package/packages/storefront/dist/server/entry.mjs +28 -11
- package/packages/storefront/dist/server/manifest.webmanifest +1 -1
- package/packages/storefront/dist/server/renderers.mjs +80 -25
- package/packages/storefront/package.json +9 -8
- package/packages/storefront/src/helpers/server-data.ts +14 -17
- package/packages/storefront/src/images/use-ssr-picture.ts +18 -3
- package/packages/storefront/src/lib/components/BannerPictures.astro +4 -4
- package/packages/storefront/src/lib/components/PaymentMethodFlag.vue +2 -2
- package/packages/storefront/src/lib/components/SharedData.astro +1 -1
- package/packages/storefront/src/lib/composables/use-shared-data.ts +18 -3
- package/packages/storefront/src/lib/content.d.ts +36 -2
- package/packages/storefront/src/lib/layouts/Base.astro +3 -2
- package/packages/storefront/src/lib/layouts/use-page-main.ts +2 -2
- package/packages/storefront/src/lib/ssr-context.ts +1 -1
- package/packages/test-base/CHANGELOG.md +1 -0
- package/packages/test-base/README.md +7 -0
- package/packages/test-base/lib/endpoints.js +23 -0
- package/packages/test-base/lib/endpoints.js.map +1 -0
- package/packages/test-base/lib/index.js +4 -0
- package/packages/test-base/lib/index.js.map +1 -0
- package/packages/test-base/lib/playloads.js +14 -0
- package/packages/test-base/lib/playloads.js.map +1 -0
- package/packages/test-base/package.json +28 -0
- package/packages/test-base/payloads/calculate-shipping.json +37 -0
- package/packages/test-base/payloads/create-transaction.json +116 -0
- package/packages/test-base/payloads/list-payments.json +125 -0
- package/packages/test-base/src/endpoints.ts +37 -0
- package/packages/test-base/src/index.ts +3 -0
- package/packages/test-base/src/playloads.ts +24 -0
- package/packages/test-base/tsconfig.json +3 -0
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/.gitkeep +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/.gitkeep +0 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.8d2ea532.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.c2a2ad79.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.8572765c.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.4a105932.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.2400b065.js +0 -4
- package/packages/storefront/dist/client/_astro/_...slug_.a786e016.css +0 -1
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.48e557ba.js +0 -1
- package/packages/storefront/dist/client/_astro/client.9dbf6b61.js +0 -1
- package/packages/storefront/dist/client/_astro/ecom-icon_CDmhA.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_Z27EX9f.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_Zo1CLq.png +0 -0
- package/packages/storefront/dist/client/_astro/headphone_22qtrt.avif +0 -0
- package/packages/storefront/dist/client/_astro/headphone_247ud8.avif +0 -0
- package/packages/storefront/dist/client/_astro/headphone_Z1hoMcQ.webp +0 -0
- package/packages/storefront/dist/client/_astro/headphone_Z1j5MXv.webp +0 -0
- package/packages/storefront/dist/client/_astro/img.7def76a1.js +0 -1
- package/packages/storefront/dist/client/_astro/index.c0c35ead.js +0 -1
- package/packages/storefront/dist/client/_astro/logo_144owC.webp +0 -0
- package/packages/storefront/dist/client/_astro/logo_1ug3XF.png +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1EIN1I.avif +0 -0
- package/packages/storefront/dist/client/_astro/passion_29BEzB.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_2sykkb.avif +0 -0
- package/packages/storefront/dist/client/_astro/passion_HYj6i.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_Z18ANwS.avif +0 -0
- package/packages/storefront/dist/client/_astro/passion_ZK2FPz.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_pVNbE.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1EUYOa.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1Sqf3x.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1VeSii.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_2wFECM.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_7mg8W.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Kv492.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1DNkkN.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1IS4wy.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Zt4vbx.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1Bqr36.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1pj5UP.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_2dVuzq.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_HaXay.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z100iy0.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z2i1RBz.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_ZMRWqJ.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_mPQHw.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_xyq7d.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_1DkX0O.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_2uIqYp.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect89_Z1rGPGT.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_ZAjmIj.avif +0 -0
- package/packages/storefront/dist/client/~fallback.html +0 -98
- package/packages/storefront/dist/client/~index.html +0 -134
- package/packages/storefront/dist/server/images.dist.csv +0 -38
- package/packages/storefront/dist/server/images.src.csv +0 -11
- package/packages/storefront/dist/server/stylesheets.csv +0 -1
|
@@ -3,9 +3,43 @@ import type { SettingsContent as _SettingsContent } from '@cloudcommerce/types';
|
|
|
3
3
|
export type SettingsContent = _SettingsContent &
|
|
4
4
|
Omit<typeof import('content/settings.json'), Exclude<keyof _SettingsContent, 'metafields'>>;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type _LayoutContent = typeof import('content/layout.json');
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type LayoutContent = Omit<_LayoutContent, 'header' | 'footer'> & {
|
|
9
|
+
header: Record<string, unknown> & _LayoutContent['header'],
|
|
10
|
+
footer: Record<string, unknown> & Partial<_LayoutContent['footer']>,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export interface PageContent {
|
|
14
|
+
meta_title: string;
|
|
15
|
+
meta_description: string;
|
|
16
|
+
hero: {
|
|
17
|
+
[k: string]: unknown,
|
|
18
|
+
autoplay?: number,
|
|
19
|
+
slides: Array<{
|
|
20
|
+
[k: string]: unknown,
|
|
21
|
+
start?: string,
|
|
22
|
+
end?: string,
|
|
23
|
+
img: string,
|
|
24
|
+
alt?: string,
|
|
25
|
+
mobile_img?: string,
|
|
26
|
+
href?: string,
|
|
27
|
+
title?: string,
|
|
28
|
+
subtitle?: string
|
|
29
|
+
button_link?: string,
|
|
30
|
+
button_text?: string,
|
|
31
|
+
}>,
|
|
32
|
+
};
|
|
33
|
+
sections: Array<Record<string, any> & {
|
|
34
|
+
type: string,
|
|
35
|
+
}>;
|
|
36
|
+
title?: string;
|
|
37
|
+
date?: string;
|
|
38
|
+
thumbnail?: string;
|
|
39
|
+
author?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
body?: string;
|
|
42
|
+
}
|
|
9
43
|
|
|
10
44
|
export type ContentFilename = 'settings'
|
|
11
45
|
| 'layout'
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { Head } from 'astro-capo';
|
|
2
3
|
import BaseBody from '@@sf/layouts/BaseBody.astro';
|
|
3
4
|
|
|
4
5
|
const { getContent } = Astro.locals.routeContext;
|
|
5
6
|
const { custom_code: customCodeContent } = await getContent('layout');
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
<
|
|
9
|
+
<Head>
|
|
9
10
|
<slot name="base-head" />
|
|
10
11
|
{customCodeContent?.css && <style>{customCodeContent.css}</style>}
|
|
11
12
|
{customCodeContent?.html_head && <Fragment set:html={customCodeContent.html_head} />}
|
|
@@ -13,7 +14,7 @@ const { custom_code: customCodeContent } = await getContent('layout');
|
|
|
13
14
|
<script src="../scripts/modules-info-preset"></script>
|
|
14
15
|
</slot>
|
|
15
16
|
<slot name="before-head-end" />
|
|
16
|
-
</
|
|
17
|
+
</Head>
|
|
17
18
|
<BaseBody>
|
|
18
19
|
<slot />
|
|
19
20
|
{customCodeContent?.html_body && <Fragment set:html={customCodeContent.html_body} />}
|
|
@@ -12,7 +12,7 @@ export interface Props {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const now = Date.now();
|
|
15
|
-
const parseBanners = (banners:
|
|
15
|
+
const parseBanners = (banners: PageContent['hero']['slides']) => {
|
|
16
16
|
const validBanners: UseBannerProps[] = [];
|
|
17
17
|
banners.forEach(({
|
|
18
18
|
img,
|
|
@@ -38,7 +38,7 @@ const parseBanners = (banners: Partial<PageContent['hero']['slides'][0]>[]) => {
|
|
|
38
38
|
|
|
39
39
|
export const usePageHero = async ({ routeContext }: Props) => {
|
|
40
40
|
const { cmsContent } = routeContext;
|
|
41
|
-
const heroSlider: Omit<
|
|
41
|
+
const heroSlider: Omit<PageContent['hero'], 'slides'>
|
|
42
42
|
& { slides: UseBannerProps[] } = { slides: [] };
|
|
43
43
|
const heroContent = cmsContent?.hero;
|
|
44
44
|
if (heroContent) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Please refer to GitHub [repository releases](https://github.com/ecomplus/cloud-commerce/releases) or monorepo unified [CHANGELOG.md](https://github.com/ecomplus/cloud-commerce/blob/main/CHANGELOG.md).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import url from 'node:url';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const { DEPLOY_REGION, FIREBASE_PROJECT_ID } = process.env;
|
|
6
|
+
const region = DEPLOY_REGION || 'us-east4';
|
|
7
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
8
|
+
const dirStore = path.join(__dirname, '../../../store');
|
|
9
|
+
let projectId = FIREBASE_PROJECT_ID;
|
|
10
|
+
if (!projectId) {
|
|
11
|
+
try {
|
|
12
|
+
const firebaserc = JSON.parse(fs.readFileSync(path.join(dirStore, '.firebaserc'), { encoding: 'utf-8' }));
|
|
13
|
+
projectId = firebaserc.projects.default;
|
|
14
|
+
} catch (e) {
|
|
15
|
+
projectId = 'ecom2-demo';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const baseUrl = `http://127.0.0.1:5001/${projectId}/${region}`;
|
|
19
|
+
const modulesUrl = `${baseUrl}/modules`;
|
|
20
|
+
const passportUrl = `${baseUrl}/passport`;
|
|
21
|
+
|
|
22
|
+
export { baseUrl, modulesUrl, passportUrl };
|
|
23
|
+
// # sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../src/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,EACJ,aAAa,EACb,mBAAmB,GACpB,GAAG,OAAO,CAAC,GAAG,CAAC;AAEhB,MAAM,MAAM,GAAG,aAAa,IAAI,UAAU,CAAC;AAC3C,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAExD,IAAI,SAAS,GAAG,mBAAmB,CAAC;AACpC,IAAI,CAAC,SAAS,EAAE;IACd,IAAI;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAC3B,EAAE,CAAC,YAAY,CACb,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,EAClC,EAAE,QAAQ,EAAE,OAAO,EAAE,CACtB,CACF,CAAC;QACF,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC;KACzC;IAAC,OAAO,CAAC,EAAE;QACV,SAAS,GAAG,YAAY,CAAC;KAC1B;CACF;AAED,MAAM,OAAO,GAAG,yBAAyB,SAAS,IAAI,MAAM,EAAE,CAAC;AAC/D,MAAM,UAAU,GAAG,GAAG,OAAO,UAAU,CAAC;AACxC,MAAM,WAAW,GAAG,GAAG,OAAO,WAAW,CAAC;AAE1C,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,GACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import url from 'node:url';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
6
|
+
const getPayload = (pathFile) => {
|
|
7
|
+
return JSON.parse(fs.readFileSync(path.join(__dirname, pathFile), { encoding: 'utf-8' }));
|
|
8
|
+
};
|
|
9
|
+
const bodyCalculateShipping = getPayload('../payloads/calculate-shipping.json');
|
|
10
|
+
const bodyListPayments = getPayload('../payloads/list-payments.json');
|
|
11
|
+
const bodyCreateTransaction = getPayload('../payloads/create-transaction.json');
|
|
12
|
+
|
|
13
|
+
export { bodyCalculateShipping, bodyListPayments, bodyCreateTransaction };
|
|
14
|
+
// # sourceMappingURL=playloads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playloads.js","sourceRoot":"","sources":["../src/playloads.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEnE,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,EAAE;IACtC,OAAO,IAAI,CAAC,KAAK,CACf,EAAE,CAAC,YAAY,CACb,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,EAC9B,EAAE,QAAQ,EAAE,OAAO,EAAE,CACtB,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,UAAU,CAAC,qCAAqC,CAAC,CAAC;AAChF,MAAM,gBAAgB,GAAG,UAAU,CAAC,gCAAgC,CAAC,CAAC;AACtE,MAAM,qBAAqB,GAAG,UAAU,CAAC,qCAAqC,CAAC,CAAC;AAEhF,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,GACtB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cloudcommerce/test-base",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"version": "0.26.0",
|
|
6
|
+
"description": "E-Com Plus Cloud Commerce basic setup for testing",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/ecomplus/cloud-commerce.git",
|
|
11
|
+
"directory": "packages/test-base"
|
|
12
|
+
},
|
|
13
|
+
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
|
|
14
|
+
"license": "Apache 2.0 with Commons Clause",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/test-base#readme",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "bash ../../scripts/build-lib.sh"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@cloudcommerce/api": "workspace:*"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@cloudcommerce/types": "workspace:*"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"to": {
|
|
3
|
+
"zip": "35701134"
|
|
4
|
+
},
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"product_id": "6166cb1528ace502aea2dc36",
|
|
8
|
+
"variation_id": "693120163769524850000003",
|
|
9
|
+
"sku": "GIE2742-405-2",
|
|
10
|
+
"name": "Vaso para Orquídeas / M",
|
|
11
|
+
"quantity": 1,
|
|
12
|
+
"currency_id": "BRL",
|
|
13
|
+
"currency_symbol": "R$",
|
|
14
|
+
"price": 99.75,
|
|
15
|
+
"final_price": 99.75,
|
|
16
|
+
"dimensions": {
|
|
17
|
+
"width": {
|
|
18
|
+
"unit": "cm",
|
|
19
|
+
"value": 30
|
|
20
|
+
},
|
|
21
|
+
"height": {
|
|
22
|
+
"unit": "cm",
|
|
23
|
+
"value": 30
|
|
24
|
+
},
|
|
25
|
+
"length": {
|
|
26
|
+
"unit": "cm",
|
|
27
|
+
"value": 30
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"weight": {
|
|
31
|
+
"unit": "kg",
|
|
32
|
+
"value": 0.5
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"subtotal": 99.75
|
|
37
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"items": [
|
|
3
|
+
{
|
|
4
|
+
"_id": "344153168658920073000000",
|
|
5
|
+
"visible": true,
|
|
6
|
+
"available": true,
|
|
7
|
+
"manage_stock": true,
|
|
8
|
+
"sales": 76,
|
|
9
|
+
"total_sold": 6683.85,
|
|
10
|
+
"name": "Vaso para Orquídeas / M",
|
|
11
|
+
"sku": "GIE2742-405-2",
|
|
12
|
+
"price": 99.75,
|
|
13
|
+
"base_price": 24.99,
|
|
14
|
+
"price_effective_date": {
|
|
15
|
+
"start": "2021-10-06T03:00:00.000Z",
|
|
16
|
+
"end": "2021-10-15T03:00:00.000Z"
|
|
17
|
+
},
|
|
18
|
+
"cost_price": 21.99,
|
|
19
|
+
"quantity": 1,
|
|
20
|
+
"pictures": [
|
|
21
|
+
{
|
|
22
|
+
"zoom": {
|
|
23
|
+
"url": "https://ecoms1.com/1173/@v3/1634126448701-vaso-orquideas.webp",
|
|
24
|
+
"size": "900x900",
|
|
25
|
+
"alt": "vaso-orquideas"
|
|
26
|
+
},
|
|
27
|
+
"_id": "854260163412645020000000"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"categories": [
|
|
31
|
+
{
|
|
32
|
+
"_id": "5f81f29eb2161709fa3da64f",
|
|
33
|
+
"name": "Cerâmica"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"short_description": "Vaso para Orquídeas em Cerâmica",
|
|
37
|
+
"slug": "vaso-para-orquideas",
|
|
38
|
+
"commodity_type": "physical",
|
|
39
|
+
"ad_relevance": 0,
|
|
40
|
+
"currency_id": "BRL",
|
|
41
|
+
"currency_symbol": "R$",
|
|
42
|
+
"condition": "new",
|
|
43
|
+
"adult": false,
|
|
44
|
+
"auto_fill_related_products": true,
|
|
45
|
+
"views": 0,
|
|
46
|
+
"dimensions": {
|
|
47
|
+
"width": {
|
|
48
|
+
"unit": "cm",
|
|
49
|
+
"value": 30
|
|
50
|
+
},
|
|
51
|
+
"height": {
|
|
52
|
+
"unit": "cm",
|
|
53
|
+
"value": 30
|
|
54
|
+
},
|
|
55
|
+
"length": {
|
|
56
|
+
"unit": "cm",
|
|
57
|
+
"value": 30
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"weight": {
|
|
61
|
+
"unit": "kg",
|
|
62
|
+
"value": 0.5
|
|
63
|
+
},
|
|
64
|
+
"updated_at": "2023-06-06T22:54:56.420Z",
|
|
65
|
+
"store_id": 1173,
|
|
66
|
+
"created_at": "2023-05-24T17:48:21.549Z",
|
|
67
|
+
"customizations": [],
|
|
68
|
+
"specifications": {
|
|
69
|
+
"size": [
|
|
70
|
+
{
|
|
71
|
+
"text": "M",
|
|
72
|
+
"value": "m"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"product_id": "6166cb1528ace502aea2dc36",
|
|
77
|
+
"variation_id": "693120163769524850000003",
|
|
78
|
+
"picture": {
|
|
79
|
+
"zoom": {
|
|
80
|
+
"url": "https://ecoms1.com/1173/@v3/1634126448701-vaso-orquideas.webp",
|
|
81
|
+
"size": "900x900",
|
|
82
|
+
"alt": "vaso-orquideas"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"max_quantity": 4,
|
|
86
|
+
"final_price": 99.75,
|
|
87
|
+
"min_quantity": 1
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"buyer": {
|
|
91
|
+
"customer_id": "621781e57963422eee198e7f",
|
|
92
|
+
"email": "fulanociclano@email.com",
|
|
93
|
+
"birth_date": {
|
|
94
|
+
"day": 25,
|
|
95
|
+
"month": 12,
|
|
96
|
+
"year": 1990
|
|
97
|
+
},
|
|
98
|
+
"fullname": "Fulano Ciclano",
|
|
99
|
+
"doc_number": "21645193292",
|
|
100
|
+
"registry_type": "p",
|
|
101
|
+
"phone": {
|
|
102
|
+
"number": "31999999999"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"amount": {
|
|
106
|
+
"subtotal": 99.75,
|
|
107
|
+
"freight": 0.00,
|
|
108
|
+
"total": 99.75
|
|
109
|
+
},
|
|
110
|
+
"payment_method": {
|
|
111
|
+
"code": "account_deposit",
|
|
112
|
+
"name": "Pix - Mercado Pago"
|
|
113
|
+
},
|
|
114
|
+
"order_number": 4977,
|
|
115
|
+
"order_id": "6490a0d15e606903703fdf92"
|
|
116
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"items": [
|
|
3
|
+
{
|
|
4
|
+
"quantity": 1,
|
|
5
|
+
"customizations": [],
|
|
6
|
+
"product_id": "6166cb1528ace502aea2dc36",
|
|
7
|
+
"variation_id": "693120163769524850000003",
|
|
8
|
+
"picture": {
|
|
9
|
+
"zoom": {
|
|
10
|
+
"url": "https://ecoms1.com/1173/@v3/1634126448701-vaso-orquideas.webp",
|
|
11
|
+
"size": "900x900",
|
|
12
|
+
"alt": "vaso-orquideas"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"sku": "GIE2742-405-2",
|
|
16
|
+
"name": "Vaso para Orquídeas / M",
|
|
17
|
+
"price": 99.75,
|
|
18
|
+
"final_price": 99.75,
|
|
19
|
+
"_id": "e17926a16871999536691111",
|
|
20
|
+
"stock_status": "released",
|
|
21
|
+
"specifications": {
|
|
22
|
+
"size": [
|
|
23
|
+
{
|
|
24
|
+
"text": "M",
|
|
25
|
+
"value": "m"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"visible": true,
|
|
30
|
+
"available": true,
|
|
31
|
+
"manage_stock": true,
|
|
32
|
+
"sales": 77,
|
|
33
|
+
"total_sold": 6783.6,
|
|
34
|
+
"base_price": 24.99,
|
|
35
|
+
"price_effective_date": {
|
|
36
|
+
"start": "2021-10-06T03:00:00.000Z",
|
|
37
|
+
"end": "2021-10-15T03:00:00.000Z"
|
|
38
|
+
},
|
|
39
|
+
"cost_price": 21.99,
|
|
40
|
+
"categories": [
|
|
41
|
+
{
|
|
42
|
+
"_id": "5f81f29eb2161709fa3da64f",
|
|
43
|
+
"name": "Cerâmica"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"short_description": "Vaso para Orquídeas em Cerâmica",
|
|
47
|
+
"slug": "vaso-para-orquideas",
|
|
48
|
+
"commodity_type": "physical",
|
|
49
|
+
"currency_id": "BRL",
|
|
50
|
+
"currency_symbol": "R$",
|
|
51
|
+
"condition": "new",
|
|
52
|
+
"auto_fill_related_products": true,
|
|
53
|
+
"dimensions": {
|
|
54
|
+
"width": {
|
|
55
|
+
"unit": "cm",
|
|
56
|
+
"value": 30
|
|
57
|
+
},
|
|
58
|
+
"height": {
|
|
59
|
+
"unit": "cm",
|
|
60
|
+
"value": 30
|
|
61
|
+
},
|
|
62
|
+
"length": {
|
|
63
|
+
"unit": "cm",
|
|
64
|
+
"value": 30
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"weight": {
|
|
68
|
+
"unit": "kg",
|
|
69
|
+
"value": 0.5
|
|
70
|
+
},
|
|
71
|
+
"updated_at": "2023-06-19T18:39:14.573Z",
|
|
72
|
+
"store_id": 1173,
|
|
73
|
+
"created_at": "2023-05-24T17:48:21.549Z",
|
|
74
|
+
"min_quantity": 1,
|
|
75
|
+
"max_quantity": 3
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"amount": {
|
|
79
|
+
"subtotal": 99.75,
|
|
80
|
+
"freight": 0,
|
|
81
|
+
"discount": 0,
|
|
82
|
+
"total": 99.75
|
|
83
|
+
},
|
|
84
|
+
"domain": "leaodejuda.netlify.app",
|
|
85
|
+
"can_fetch_when_selected": true,
|
|
86
|
+
"currency_id": "BRL",
|
|
87
|
+
"currency_symbol": "R$",
|
|
88
|
+
"customer": {
|
|
89
|
+
"_id": "621781e57963422eee198e7f",
|
|
90
|
+
"main_email": "wis.tech7l@gmail.com",
|
|
91
|
+
"display_name": "Wisley",
|
|
92
|
+
"name": {
|
|
93
|
+
"given_name": "Wisley",
|
|
94
|
+
"family_name": "Alves"
|
|
95
|
+
},
|
|
96
|
+
"birth_date": {
|
|
97
|
+
"day": 22,
|
|
98
|
+
"month": 10,
|
|
99
|
+
"year": 1993
|
|
100
|
+
},
|
|
101
|
+
"photos": [
|
|
102
|
+
"https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=5215435488508219&height=50&width=50&ext=1648299747&hash=AeRW9liwzh7S8_nDRNc"
|
|
103
|
+
],
|
|
104
|
+
"phones": [
|
|
105
|
+
{
|
|
106
|
+
"number": "31920006175"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"registry_type": "p",
|
|
110
|
+
"doc_number": "21645193292",
|
|
111
|
+
"addresses": [
|
|
112
|
+
{
|
|
113
|
+
"_id": "801165164564353427100000",
|
|
114
|
+
"zip": "35701134",
|
|
115
|
+
"province_code": "MG",
|
|
116
|
+
"name": "Wisley Alves",
|
|
117
|
+
"city": "Sete Lagoas",
|
|
118
|
+
"borough": "Progresso",
|
|
119
|
+
"street": "Rua Santo André",
|
|
120
|
+
"default": true,
|
|
121
|
+
"number": 81
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import url from 'node:url';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
DEPLOY_REGION,
|
|
7
|
+
FIREBASE_PROJECT_ID,
|
|
8
|
+
} = process.env;
|
|
9
|
+
|
|
10
|
+
const region = DEPLOY_REGION || 'us-east4';
|
|
11
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
12
|
+
const dirStore = path.join(__dirname, '../../../store');
|
|
13
|
+
|
|
14
|
+
let projectId = FIREBASE_PROJECT_ID;
|
|
15
|
+
if (!projectId) {
|
|
16
|
+
try {
|
|
17
|
+
const firebaserc = JSON.parse(
|
|
18
|
+
fs.readFileSync(
|
|
19
|
+
path.join(dirStore, '.firebaserc'),
|
|
20
|
+
{ encoding: 'utf-8' },
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
projectId = firebaserc.projects.default;
|
|
24
|
+
} catch (e) {
|
|
25
|
+
projectId = 'ecom2-demo';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const baseUrl = `http://127.0.0.1:5001/${projectId}/${region}`;
|
|
30
|
+
const modulesUrl = `${baseUrl}/modules`;
|
|
31
|
+
const passportUrl = `${baseUrl}/passport`;
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
baseUrl,
|
|
35
|
+
modulesUrl,
|
|
36
|
+
passportUrl,
|
|
37
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import url from 'node:url';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
6
|
+
|
|
7
|
+
const getPayload = (pathFile: string) => {
|
|
8
|
+
return JSON.parse(
|
|
9
|
+
fs.readFileSync(
|
|
10
|
+
path.join(__dirname, pathFile),
|
|
11
|
+
{ encoding: 'utf-8' },
|
|
12
|
+
),
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const bodyCalculateShipping = getPayload('../payloads/calculate-shipping.json');
|
|
17
|
+
const bodyListPayments = getPayload('../payloads/list-payments.json');
|
|
18
|
+
const bodyCreateTransaction = getPayload('../payloads/create-transaction.json');
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
bodyCalculateShipping,
|
|
22
|
+
bodyListPayments,
|
|
23
|
+
bodyCreateTransaction,
|
|
24
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c,_ as w,d as y,o as s,a as o,g as f,w as l,u as k,n as b,h as p,y as v,x,i as u,e as d,f as T,v as C,b as m,F as S,r as B,L as H}from"./_plugin-vue_export-helper.48e557ba.js";import{C as L,a as j}from"./Carousel.63d511ab.js";import{p as g}from"./index.c0c35ead.js";import"./session-utm.744b0db3.js";const N=a=>{const r=c(()=>a.title?g(a.title).value:""),t=c(()=>a.subtitle?g(a.subtitle).value:""),e=c(()=>a.buttonText?g(a.buttonText).value:""),i=c(()=>!!(r.value||t.value||e.value));return{parsedTitle:r,parsedSubtitle:t,parsedButtonText:e,hasHeader:i}},P=y({__name:"Banner",props:{img:{},alt:{},mobileImg:{},href:{},title:{},subtitle:{},buttonLink:{},buttonText:{},headingTag:{default:"h3"}},setup(a,{expose:r}){r();const t=a,{hasHeader:e,parsedTitle:i,parsedSubtitle:_,parsedButtonText:h}=N(t),n={props:t,hasHeader:e,parsedTitle:i,parsedSubtitle:_,parsedButtonText:h};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),V={key:0,class:"p-12 xl:ps-32 mb-3 sm:mb-0"},D={key:1,class:"text-lg mt-4 md:mt-6"};function z(a,r,t,e,i,_){return s(),o("div",{class:b(["mx-auto overflow-x-hidden",e.hasHeader?"grid grid-cols-1 sm:grid-cols-2 items-center":null])},[(s(),f(p(t.href?"a-link":"span"),{href:t.href,class:b(e.hasHeader?"sm:order-last [&_img]:max-w-full sm:[&_img]:max-w-none [&_img]:aspect-video sm:[&_img]:aspect-[2.5] [&_img]:object-cover":"[&_img]:max-w-full")},{default:l(()=>[k(a.$slots,"picture")]),_:3},8,["href","class"])),e.hasHeader?(s(),o("div",V,[e.parsedTitle?(s(),f(p(t.headingTag),{key:0,class:"ui-title mt-1"},{default:l(()=>[v(x(e.parsedTitle),1)]),_:1})):u("",!0),e.parsedSubtitle?(s(),o("p",D,x(e.parsedSubtitle),1)):u("",!0),e.parsedButtonText?(s(),f(p(t.buttonLink?"a-link":"span"),{key:2,href:t.buttonLink,class:"ui-btn-lg ui-btn-contrast min-w-[150px] mt-7 md:mt-10"},{default:l(()=>[v(x(e.parsedButtonText),1)]),_:1},8,["href"])):u("",!0)])):u("",!0)],2)}const F=w(P,[["render",z]]),O=y({__name:"HeroSlider",props:{autoplay:{},slides:{}},setup(a,{expose:r}){r();const t={Carousel:L,CarouselControl:j,Banner:F};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}}),E={class:"relative mx-auto"},I={class:"absolute z-10 bottom-5 flex justify-end items-center w-screen right-5 xl:right-auto xl:max-w-screen-xl xl:left-1/2 xl:-ms-[640px]"},q={class:"relative w-20 h-10 rounded-full bg-white/50 text-primary shadow-sm ring-1 ring-black/5"},A=m("i",{class:"i-arrow-left"},null,-1),G=m("i",{class:"i-arrow-right"},null,-1);function J(a,r,t,e,i,_){return s(),o("section",E,[d(e.Carousel,{autoplay:t.autoplay,class:"secondary [&>*]:items-center"},{controls:l(()=>[T(m("div",I,[m("div",q,[d(e.CarouselControl,{class:"w-10 h-10 rounded-full hover:bg-primary/10","is-prev":""},{default:l(()=>[A]),_:1}),d(e.CarouselControl,{class:"w-10 h-10 rounded-full hover:bg-primary/10"},{default:l(()=>[G]),_:1})])],512),[[C,t.slides.length>1]])]),default:l(()=>[(s(!0),o(S,null,B(t.slides,(h,n)=>(s(),o("li",{key:n,class:"shrink-0 basis-full"},[d(e.Banner,H({...h,headingTag:n===0?"h2":"h3"},{class:"w-screen max-w-screen-2xl"}),{picture:l(()=>[k(a.$slots,`picture-${n}`)]),_:2},1040)]))),128))]),_:3},8,["autoplay"])])}const U=w(O,[["render",J]]);export{U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as _,c as u,_ as f,d as m,a as l,b as h,e as d,w as p,o,f as v,v as C,F as g,r as b,g as w,h as x,n as y,i as S}from"./_plugin-vue_export-helper.48e557ba.js";import{p as k}from"./index.c0c35ead.js";import{C as B,a as P}from"./Carousel.63d511ab.js";import"./session-utm.744b0db3.js";function V(t,s){{const a=btoa(JSON.stringify({filename:t}));window.parent.postMessage(JSON.parse(JSON.stringify({type:"open",filename:t,id:a})),window.location.origin),window.addEventListener("message",e=>{e.data.id===a&&s(e.data.data)})}}const L=t=>{const s=_(null);return window.$isCmsPreview&&V(t,a=>{s.value=a}),{liveContent:s}},N=t=>{const s={slides:[]};return t.header?.pitch_bar&&(s.slides=t.header.pitch_bar),s},O=t=>{const{liveContent:s}=L("layout"),a=u(()=>(s.value?N(s.value).slides:t.slides).map(({html:n})=>k(n).value.replace(/<\/?p>/g,"").replace(/<(\/?d-md)>/g,"<$1>"))),e=u(()=>a.value.filter(r=>r).length);return{parsedContents:a,countValidSlides:e}},J=m({__name:"PitchBar",props:{slides:{}},setup(t,{expose:s}){s();const a=t,{parsedContents:e,countValidSlides:r}=O(a),n={props:a,parsedContents:e,countValidSlides:r,Carousel:B,CarouselControl:P};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),M={class:"bg-base-100 relative z-20"},z={class:"container md:w-2/3 mx-auto px-3 py-1"},D=["innerHTML"],E={class:"text-xl leading-none text-base-400"};function F(t,s,a,e,r,n){return o(),l("div",M,[h("div",z,[d(e.Carousel,{autoplay:e.countValidSlides>1?7e3:void 0},{controls:p(()=>[v(h("div",E,[d(e.CarouselControl,{class:"pr-2 bg-base-100 hover:text-base-700","is-prev":""}),d(e.CarouselControl,{class:"pl-2 bg-base-100 hover:text-base-700"})],512),[[C,e.countValidSlides>1]])]),default:p(()=>[(o(!0),l(g,null,b(a.slides,(i,c)=>(o(),l("li",{key:c,class:"shrink-0 basis-full h-full text-center"},[(o(),w(x(i.href?"ALink":"span"),{href:i.href,target:i.target,class:y(["inline-block px-8",i.href?"hover:underline":null])},{default:p(()=>[e.parsedContents[c]?(o(),l("span",{key:0,innerHTML:e.parsedContents[c],class:"prose text-sm text-base-800"},null,8,D)):S("",!0)]),_:2},1032,["href","target","class"]))]))),128))]),_:1},8,["autoplay"])])])}const R=f(J,[["render",F]]);export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as J,Q as L,k as K,N as x,c,O as w,_ as U,d as Q,m as G,o as _,a as h,x as d,i as p,b as O,y as V,n as M,e as q,w as B}from"./_plugin-vue_export-helper.48e557ba.js";import{i as H}from"./img.7def76a1.js";import{h as Y,j as F,k as X,l as Z}from"./index.c0c35ead.js";const tt=(t,e=J.get("lang"))=>e&&t.i18n&&t.i18n[e]?t.i18n[e]:t.name||t.title||H(t.i18n,e)||"",Mt=tt,et=()=>{let t=Math.floor(Math.random()*1e6).toString()+Date.now();for(;t.length<24;)t+="0";return t},at=et,st=(t,e,a=globalThis.localStorage)=>{if(!a)return L(e);let s;const i=a.getItem(t);if(i)try{s=JSON.parse(i)}catch{s=null,a.removeItem(t)}const n=L(s||e);return K(n,()=>{a.setItem(t,JSON.stringify(n))}),n},nt=(t,{flags:e})=>!t.flags&&!e?!0:!t.flags||!e||t.flags.length!==e.length?!1:t.flags.every(a=>e.includes(a)),it=(t,e)=>{if(typeof e.product_id!="string"||typeof e.quantity!="number"||!(e.quantity>=0)||typeof e.price!="number"||!(e.price>=0))return null;const{items:a}=t;if(!e.kit_product)for(let i=0;i<a.length;i++){const n=a[i];if(!n.kit_product&&n.product_id===e.product_id&&n.variation_id===e.variation_id&&(!n.customizations||!n.customizations.length)&&nt(n,e))return n.quantity+=e.quantity,e.price&&(n.price=e.price),e.final_price&&(n.final_price=e.final_price),n}const s={...e};if((!e._id||e._id===e.variation_id||a.find(({_id:i})=>i===e._id))&&(s._id=at()),e.customizations){const i=[];e.customizations.forEach((n,r)=>{i[r]={...n}}),s.customizations=i}return a.push(s),s},rt=(t,e,a)=>{(typeof a!="number"||Number.isNaN(a))&&(a=t.min_quantity||1);const s=t.min_quantity||0,i=e&&t.variations?t.variations.find(({_id:r})=>r===e):void 0,n={product_id:t._id,variation_id:e,sku:i?.sku||t.sku,name:i?.name||t.name,slug:t.slug,production_time:i?.production_time||t.production_time,currency_id:t.currency_id,currency_symbol:t.currency_symbol,base_price:i?.base_price||t.base_price,max_quantity:t.quantity,quantity:s>0?Math.max(s,a):a,price:x(t)};return i?.picture_id&&t.pictures&&(n.picture=t.pictures.find(r=>r._id===i.picture_id)),!n.picture&&t.pictures&&([n.picture]=t.pictures),n},ot="ecomShoppingCart",ct={items:[]},D=st(ot,ct),R=c(()=>D.items.map(t=>{let e=t.kit_product?.price&&t.kit_product.pack_quantity?t.kit_product.price/t.kit_product.pack_quantity:t.price;Array.isArray(t.customizations)&&t.customizations.forEach(i=>{if(i.add_to_price){const{type:n,addition:r}=i.add_to_price;e+=n==="fixed"?r:t.price*(r/100)}}),t.final_price=e;const a=t.min_quantity||1,s=t.max_quantity;return typeof t.quantity!="number"||Number.isNaN(t.quantity)||t.quantity<a?t.quantity=a:s&&t.quantity>s&&(t.quantity=s),t})),z=c(()=>R.value.reduce((t,e)=>t+e.quantity*(e.final_price||e.price),0)),zt=c(()=>R.value.reduce((t,e)=>t+e.quantity,0)),A=c({get(){return{...D,subtotal:z.value}},set(t){Object.assign(D,t,{subtotal:z.value})}}),lt=t=>{const e=A.value;it(e,t)&&(A.value.items=e.items)},It=t=>{for(let e=0;e<A.value.items.length;e++)if(A.value.items[e]._id===t){A.value.items.splice(e,1);break}},$t=(t,e,a)=>lt(rt(t,e,a));globalThis.__apiCache||(globalThis.__apiCache={});const N=typeof process=="object"&&process?.env||globalThis;class I extends Error{constructor(e,a,s,i=!1){a?(super(a.statusText),this.data=a.data,this.statusCode=a.status):super(s||"Request error"),this.config=e,this.response=a,this.isTimeout=i}}const ut={middleware(t){const e={...t.headers};if(!t.isNoAuth)if(t.accessToken)e.Authorization=`Bearer ${t.accessToken}`;else{const n=t.authenticationId||N.ECOM_AUTHENTICATION_ID,r=t.apiKey||N.ECOM_API_KEY;if(n&&r){const l=`${n}:${r}`,f=typeof Buffer=="function"?Buffer.from(l).toString("base64"):btoa(l);e.Authorization=`Basic ${f}`}}let a=t.baseUrl||N.API_BASE_URL||"https://ecomplus.io/v2";const{endpoint:s,params:i}=t;if(s!=="login"&&s!=="authenticate"&&s!=="ask-auth-callback"&&s!=="check-username"){const n=t.storeId||N.ECOM_STORE_ID;if(!n)throw new Error("`storeId` must be set in config or `ECOM_STORE_ID` env var");a+=`/:${n}`;const r=t.lang||N.ECOM_LANG;r&&(a+=`,lang:${r}`)}if(a+=`/${s}`,typeof i=="string")a+=`?${i}`;else{const n=i||{};if(["fields","sort"].forEach(r=>{const l=t[r];l&&!n[r]&&(n[r]=l.join(","))}),["limit","offset","count","buckets","concise","verbose"].forEach(r=>{const l=t[r];l&&!n[r]&&(n[r]=l)}),Object.keys(n).length){const r=new URLSearchParams;Object.keys(n).forEach(l=>{const f=n[l];Array.isArray(f)?f.forEach(g=>{r.append(l,g)}):f!==void 0&&r.append(l,f)}),a+=`?${r.toString()}`}}return{url:a,headers:e}}},y=async(t,e=0)=>{const a=globalThis.$apiMergeConfig?{...globalThis.$apiMergeConfig,...t}:t,{url:s,headers:i}=ut.middleware(a),{method:n="get",timeout:r=2e4,maxRetries:l=3,cacheMaxAge:f=6e5}=a,g=n==="get"&&a.canCache;let k;if(g){k=`${s}${JSON.stringify(i)}`;const v=globalThis.__apiCache[k];if(v&&Date.now()-v.timestamp<=f)return{...v.res,config:a}}const T=a.body||a.data;let b;T&&(b=JSON.stringify(T),i["Content-Type"]="application/json",i["Content-Length"]=b.length.toString());const C=new AbortController;let E=!1;const j=setTimeout(()=>{C.abort(),E=!0},r);let u;try{u=await(a.fetch||fetch)(s,{method:n,headers:i,body:b,signal:C.signal})}catch(v){throw new I(a,u,v.message,E)}if(clearTimeout(j),u){if(u.ok){const o={...u,data:await u.json()};return g&&k&&(globalThis.__apiCache[k]={timestamp:Date.now(),res:o}),{...o,config:a}}const{status:v}=u;if(l<e&&(v===429||v>=500)){const o=u.headers.get("retry-after");return new Promise((m,P)=>{setTimeout(()=>{y(t,e+1).then(m).catch(P)},o&&parseInt(o,10)||5e3)})}}try{u.data=await u?.json()}catch{}throw new I(a,u)},dt=(t,e)=>y({...e,endpoint:t}),mt=(t,e,a)=>y({...a,method:"post",endpoint:t,body:e}),_t=(t,e,a)=>y({...a,method:"put",endpoint:t,body:e}),ht=(t,e,a)=>y({...a,method:"patch",endpoint:t,body:e}),W=(t,e)=>y({...e,method:"delete",endpoint:t});y.get=dt;y.post=mt;y.put=_t;y.patch=ht;y.del=W;y.delete=W;const $=(t,e)=>{const{type:a,value:s}=e;let i;return s?(a==="percentage"?i=t*((100-s)/100):i=t-s,i>0?i:0):t},ft=t=>{const e=c(()=>t.product||{price:t.price||0,base_price:t.basePrice}),a=c(()=>{const{variations:o}=e.value;if(o){const m=x(e.value);for(let P=0;P<o.length;P++)if(x({...e.value,...o[P]})>m)return!0}return!1}),s=c(()=>{const o=x(e.value),m=Y.value;return m&&(!m.min_amount||o>m.min_amount)?$(o,m):o}),i=c(()=>{if(w(e.value))return e.value.base_price;const o=x(e.value);return o>s.value?o:0}),n=c(()=>t.installmentsOption||F.value||{max_number:1}),r=c(()=>{if(n.value.max_number<=1)return 1;const o=n.value.min_installment||5,m=Math.floor(s.value/o);return Math.min(m,n.value.max_number)}),l=c(()=>n.value.monthly_interest||0),f=c(()=>{if(r.value>=2){if(!l.value)return s.value/r.value;const o=l.value/100;return s.value*o/(1-(1+o)**-r.value)}return 0}),g=c(()=>{const o=t.discountOption||X.value;return o&&(!o.min_amount||o.min_amount<=s.value)&&(!t.isAmountTotal||o.apply_at==="total")?o:{}}),k=c(()=>{const{label:o}=g.value;return o?o.includes(" ")?o:`via ${o}`:""}),T=c(()=>$(s.value,g.value)),b=c(()=>{if(t.loyaltyPointsProgram)return t.loyaltyPointsProgram;const o=Z.value;if(o){const m=Object.keys(o);for(let P=0;P<m.length;P++){const S=o[m[P]];if(S?.earn_percentage&&S.earn_percentage>0)return S}}return{ratio:0}}),C=c(()=>b.value.min_subtotal_to_earn||0),E=c(()=>b.value.name||""),j=c(()=>b.value.earn_percentage||0),u=c(()=>j.value*b.value.ratio),v=c(()=>u.value>=1?s.value*(u.value/100):0);return{hasVariedPrices:a,salePrice:s,comparePrice:i,installmentsObject:n,installmentsNumber:r,monthlyInterest:l,installmentValue:f,discountObject:g,discountLabel:k,priceWithDiscount:T,pointsProgramObject:b,pointsMinPrice:C,pointsProgramName:E,earnPointsPercentage:j,cashbackPercentage:u,cashbackValue:v}},pt=Q({__name:"Prices",props:{isBig:{type:Boolean},isLiteral:{type:Boolean},hasCashback:{type:Boolean,default:!0},hasPriceOptions:{type:Boolean,default:!0},product:{},price:{},basePrice:{},isAmountTotal:{type:Boolean},installmentsOption:{},discountOption:{},loyaltyPointsProgram:{}},setup(t,{expose:e}){e();const a=t,{hasVariedPrices:s,salePrice:i,comparePrice:n,cashbackPercentage:r,cashbackValue:l,installmentsNumber:f,monthlyInterest:g,installmentValue:k,priceWithDiscount:T,discountLabel:b}=ft(a),C={props:a,hasVariedPrices:s,salePrice:i,comparePrice:n,cashbackPercentage:r,cashbackValue:l,installmentsNumber:f,monthlyInterest:g,installmentValue:k,priceWithDiscount:T,discountLabel:b};return Object.defineProperty(C,"__isScriptSetup",{enumerable:!1,value:!0}),C}}),yt={key:0,class:"text-base-500 mr-1 text-[87%]"},bt={key:0},vt={key:1},gt={key:0},Pt={key:0,class:"relative z-10"},kt=["data-tooltip"],Ot=O("i",{class:"i-arrow-uturn-left mr-1"},null,-1),Ct={class:"font-medium"},Tt=O("small",null," cashback",-1),Nt={key:0},xt={key:0},At={key:1},Et={key:2},jt={key:0},St={key:0},qt={key:1};function Bt(t,e,a,s,i,n){const r=G("Fade");return _(),h("div",{class:M(["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]",a.isBig?"text-lg":null]),"data-prices":""},[s.comparePrice?(_(),h("span",yt,[a.isLiteral?(_(),h("small",bt,d("De "))):p("",!0),O("s",null,d(t.$money(s.comparePrice)),1),a.isLiteral?(_(),h("small",vt,d(" Por"))):p("",!0)])):p("",!0),O("strong",{class:M(["inline-block text-base-800",a.isBig?"text-5xl block":null])},[s.hasVariedPrices?(_(),h("small",gt,d("A partir de "))):p("",!0),V(" "+d(t.$money(s.salePrice)),1)],2),q(r,{slide:"down"},{default:B(()=>[s.cashbackValue&&a.hasCashback?(_(),h("div",Pt,[O("span",{"data-tooltip":"Receba $1 de volta".replace("$1",t.$percentage(s.cashbackPercentage))},[Ot,O("span",Ct,d(t.$money(s.cashbackValue)),1),Tt],8,kt)])):p("",!0)]),_:1}),q(r,{slide:"down"},{default:B(()=>[s.installmentValue&&a.hasPriceOptions?(_(),h("div",Nt,[a.isLiteral?(_(),h("small",xt,d("Até "))):p("",!0),V(" "+d(s.installmentsNumber)+"x ",1),a.isLiteral?(_(),h("small",At,d(" De "))):p("",!0),O("span",null,d(t.$money(s.installmentValue)),1),!s.monthlyInterest&&a.isLiteral?(_(),h("small",Et,d("Sem juros"))):p("",!0)])):p("",!0)]),_:1}),q(r,{slide:"down"},{default:B(()=>[s.priceWithDiscount<s.salePrice&&a.hasPriceOptions?(_(),h("div",jt,[s.discountLabel?p("",!0):(_(),h("small",St,d("A partir de "))),O("span",null,d(t.$money(s.priceWithDiscount)),1),s.discountLabel?(_(),h("small",qt,d(` ${s.discountLabel}`),1)):p("",!0)])):p("",!0)]),_:1})],2)}const Rt=U(pt,[["render",Bt]]);export{Rt as P,y as a,$t as b,Mt as g,rt as p,It as r,A as s,zt as t,st as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as _,M as j,N as L,c as p,O as Q,_ as V,d as q,m as B,o as s,a as d,g as S,w as C,b as m,F as E,e as b,i as I,y as x,x as y,h as O,n as T,q as M,f as F,v as H,r as z}from"./_plugin-vue_export-helper.48e557ba.js";import{a as A,g as D,b as R,P as G}from"./Prices.8572765c.js";import{C as J,a as K}from"./Carousel.63d511ab.js";import{e as U,g as W}from"./index.c0c35ead.js";import{g as X}from"./img.7def76a1.js";import"./session-utm.744b0db3.js";const Y=e=>e&&e.min_quantity||1,Z=Y,$=e=>!e.hasOwnProperty("quantity")||e.quantity>=Z(e),N=$,tt=e=>{const a=_(e.title||""),i=_(e.titleLink||""),t=_(!1);let u=null;const r=_(null),l=j(e.products||[]);return e.products||(t.value=!0,u=(async()=>{let c=e.searchQuery||"",h;if(e.collectionId){try{const{data:o}=await A.get(`collections/${e.collectionId}`);h=o}catch(o){console.error(o),r.value=o}const n=h?.products;Array.isArray(n)&&n.length&&(c+=`&_id=${n.slice(0,60).join(",")}`),!a.value&&a.value!==null&&h?.name&&(a.value=h?.name)}const v=e.limit||24;let f=`offset=${e.page?(e.page-1)*v:0}&limit=${v}`;e.sort&&(f+=`&sort=${e.sort}`),f+=c;try{const{data:n}=await A.get(`search/v1?${f}`);if(e.isShuffle){let o=n.result.filter(w=>w.available&&N(w)).length,g,k;for(;o;)k=Math.floor(Math.random()*o--),g=n.result[o],n.result[o]=n.result[k],n.result[k]=g}n.result.forEach(o=>l.push(o))}catch(n){console.error(n),r.value=n}t.value=!1})()),{title:a,titleLink:i,isFetching:t,fetching:u,fetchError:r,products:l}},et=e=>{const a=_(!1);let i=null;const t=_(null),{productId:u}=e,r=j({...e.product,_id:e.product?._id||u,price:L(e.product||{})});!e.product&&u&&(a.value=!0,i=(async()=>{try{const{data:o}=await A.get(`products/${u}`);Object.assign(r,o)}catch(o){console.error(o),t.value=o}a.value=!1})());const l=p(()=>D(r)),c=p(()=>{const{slug:o}=r;return typeof o=="string"?`/${o}`:null}),h=p(()=>{const{pictures:o}=r,g=[];return o&&o.forEach(k=>{const w=X(k);w&&g.push(w)}),g}),v=p(()=>N(r)),P=p(()=>v.value&&r.available&&r.visible),f=p(()=>{if(Q(r)){const o=r.base_price;return Math.round((o-L(r))*100/o)}return 0}),n=p(()=>r.has_variations?!0:!!r.variations?.length);return{isFetching:a,fetching:i,fetchError:t,product:r,title:l,link:c,images:h,isInStock:v,isActive:P,discountPercentage:f,hasVariations:n}},ot=q({__name:"ProductCard",props:{product:{},productId:{},headingTag:{default:"h3"}},setup(e,{expose:a}){a();const i=e,{product:t,title:u,link:r,images:l,isInStock:c,isActive:h,discountPercentage:v,hasVariations:P}=et(i),f=_(null),n=U(f),o=_(!1);W(n,()=>{o.value=!0});const g={props:i,product:t,title:u,link:r,images:l,isInStock:c,isActive:h,discountPercentage:v,hasVariations:P,card:f,isHovered:n,wasHoveredOnce:o,get addProductToCart(){return R},Prices:G};return Object.defineProperty(g,"__isScriptSetup",{enumerable:!1,value:!0}),g}}),rt=["data-sku"],nt={class:"aspect-square p-2 motion-safe:group-hover:scale-110 transition-transform"},at={class:"relative w-full h-full bg-white rounded overflow-hidden group-hover:rounded-none"},st={key:1,class:"w-full h-full bg-gradient-to-br from-base-50/20 to-base-100"},it={key:0,class:"uno-bm03rg"},lt={class:"relative flex flex-col grow justify-between p-4 group-hover:backdrop-blur-md bg-white/40 z-10"},ct={class:"pt-2"},ut={key:0},dt={key:1,class:"ui-badge bg-warning-100 text-warning-700"},ht=m("span",{class:"inline-block h-4 w-4 leading-none text-base text-center bg-on-primary text-primary opacity-80 rounded-full mr-1"}," + ",-1);function ft(e,a,i,t,u,r){const l=B("AImg");return s(),d("article",{ref:"card","data-sku":t.product.sku,class:"relative h-full max-w-[350px] mx-auto py-3 group"},[(s(),S(O(t.link?"ALink":"span"),{href:t.link,class:"flex flex-col h-full rounded overflow-hidden group-hover:shadow group-hover:ring-1 ring-black/5"},{default:C(()=>[m("div",nt,[m("div",at,[t.images?.length?(s(),d(E,{key:0},[b(l,{picture:t.images[0],alt:t.title,class:"absolute top-0 left-0 block w-full h-full object-cover"},null,8,["picture","alt"]),t.images[1]&&t.wasHoveredOnce?(s(),S(l,{key:0,picture:t.images[1],alt:t.title,class:"absolute top-0 left-0 block w-full h-full object-cover opacity-0 group-hover:opacity-100 transition-opacity motion-safe:duration-300 text-transparent z-10"},null,8,["picture","alt"])):I("",!0)],64)):(s(),d("div",st))])]),t.discountPercentage?(s(),d("span",it,[x(" -"),m("strong",null,y(t.discountPercentage),1),x("% ")])):I("",!0),m("div",lt,[(s(),S(O(i.headingTag),{class:T(["ui-link no-underline line-clamp-2",[t.isActive?"text-base-700":"text-base-500",t.link?"group-hover:underline group-hover:text-primary":null]])},{default:C(()=>[x(y(t.title),1)]),_:1},8,["class"])),m("div",ct,[t.isActive?(s(),d("div",ut,[b(t.Prices,{product:t.product},null,8,["product"])])):(s(),d("span",dt,y(t.isInStock?"Inativo":"Sem estoque"),1))]),t.isActive&&!t.hasVariations?(s(),d("button",{key:0,class:"uno-3suct9 ui-btn-sm ui-btn-primary",onClick:a[0]||(a[0]=M(c=>t.addProductToCart(t.product),["prevent"]))},[ht,x(" "+y("Adicionar ao carrinho"))])):I("",!0)])]),_:1},8,["href"]))],8,rt)}const gt=V(ot,[["render",ft]]),mt=q({__name:"ProductShelf",props:{collectionId:{},searchQuery:{},sort:{},title:{},titleLink:{},isShuffle:{type:Boolean},limit:{},page:{},products:{}},async setup(e,{expose:a}){a();const i=e,{title:t,titleLink:u,fetching:r,products:l}=tt(i),c={props:i,title:t,titleLink:u,fetching:r,products:l,Carousel:J,CarouselControl:K,ProductCard:gt};return Object.defineProperty(c,"__isScriptSetup",{enumerable:!1,value:!0}),c}}),_t={class:"ui-section"},vt={key:0,class:"max-w-prose mx-auto text-center mb-2"},pt={class:"ui-text-brand text-3xl"},bt={key:1,class:"text-base-700"},yt={class:"text-3xl lg:text-2xl leading-none text-primary lg:opacity-0 group-hover/shelf:opacity-90 transition-opacity"};function kt(e,a,i,t,u,r){const l=B("ALink");return s(),d("section",_t,[t.title?(s(),d("div",vt,[m("h2",pt,[t.titleLink?(s(),S(l,{key:0,href:t.titleLink,class:"ui-link"},{default:C(()=>[x(y(t.title),1)]),_:1},8,["href"])):(s(),d("span",bt,y(t.title),1))])])):I("",!0),b(t.Carousel,{class:"group/shelf"},{controls:C(()=>[F(m("div",yt,[b(t.CarouselControl,{class:"!top-1/2 !-left-4 w-12 h-12 bg-transparent lg:bg-white/80 lg:hover:bg-primary-300/60 rounded-full lg:shadow-sm lg:ring-1 ring-black/5","is-prev":""}),b(t.CarouselControl,{class:"!top-1/2 !-right-4 w-12 h-12 bg-transparent lg:bg-white/80 lg:hover:bg-primary-300/60 rounded-full lg:shadow-sm lg:ring-1 ring-black/5"})],512),[[H,t.products.length>2]])]),default:C(()=>[(s(!0),d(E,null,z(t.products,c=>(s(),d("li",{key:c._id,class:"basis-1/2 md:basis-1/3 lg:basis-1/4 shrink-0"},[b(t.ProductCard,{product:c},null,8,["product"])]))),128))]),_:1})])}const At=V(mt,[["render",kt]]);export{At as default};
|