cloudcommerce 0.39.0 → 0.40.1
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/CHANGELOG.md +67 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +6 -6
- package/packages/api/lib/api.d.ts +2 -2
- package/packages/api/package.json +1 -1
- package/packages/api/types/applications.d.ts +15 -0
- package/packages/api/types/authentications.d.ts +14 -0
- package/packages/api/types/brands.d.ts +17 -0
- package/packages/api/types/carts.d.ts +12 -0
- package/packages/api/types/categories.d.ts +17 -0
- package/packages/api/types/collections.d.ts +15 -0
- package/packages/api/types/customers.d.ts +12 -0
- package/packages/api/types/grids.d.ts +15 -0
- package/packages/api/types/orders.d.ts +15 -0
- package/packages/api/types/products.d.ts +17 -0
- package/packages/api/types/stores.d.ts +15 -0
- package/packages/api/types.d.ts +34 -8
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +2 -2
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +2 -2
- package/packages/apps/discounts/package.json +2 -2
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/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/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +2 -2
- package/packages/apps/mandae/package.json +2 -2
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/pagarme-v5/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 +2 -2
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/config/firebase.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +5 -5
- package/packages/eslint/storefront.eslintrc.cjs +1 -0
- 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/i19anyPrice.txt +1 -0
- package/packages/i18n/lib/en_us/i19filterOut.txt +1 -0
- package/packages/i18n/lib/en_us/i19loadMoreProducts.txt +1 -0
- package/packages/i18n/lib/en_us/i19noProductsFound.txt +1 -0
- package/packages/i18n/lib/en_us/i19noProductsFoundFor$1.txt +1 -0
- package/packages/i18n/lib/en_us/i19noProductsInBrandMsg.txt +1 -0
- package/packages/i18n/lib/en_us/i19noProductsInCategoryMsg.txt +1 -0
- package/packages/i18n/lib/en_us.d.ts +8 -3
- package/packages/i18n/lib/en_us.js +8 -3
- package/packages/i18n/lib/en_us.js.map +1 -1
- package/packages/i18n/lib/pt_br/i19anyPrice.txt +1 -0
- package/packages/i18n/lib/pt_br/i19filterOut.txt +1 -0
- package/packages/i18n/lib/pt_br/i19loadMoreProducts.txt +1 -0
- package/packages/i18n/lib/pt_br/i19noItemSelected.txt +1 -1
- package/packages/i18n/lib/pt_br/i19noProductsFoundFor$1.txt +1 -0
- package/packages/i18n/lib/pt_br/i19noProductsInBrandMsg.txt +1 -0
- package/packages/i18n/lib/pt_br/i19noProductsInCategoryMsg.txt +1 -0
- package/packages/i18n/lib/pt_br.d.ts +9 -4
- package/packages/i18n/lib/pt_br.js +9 -4
- package/packages/i18n/lib/pt_br.js.map +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/i18n/src/en_us.ts +8 -3
- package/packages/i18n/src/pt_br.ts +9 -4
- package/packages/modules/package.json +2 -2
- package/packages/passport/package.json +1 -1
- package/packages/ssr/events.js +0 -0
- package/packages/ssr/package.json +6 -6
- package/packages/storefront/dist/client/_astro/AccountPage.Osc6ffV0.js +1 -0
- package/packages/storefront/dist/client/_astro/{CartSidebar.1kUFk9Xn.js → CartSidebar.LrfpXG2B.js} +1 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.Zf6kCaqD.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.N4d9fV8H.js +1 -0
- package/packages/storefront/dist/client/_astro/{Prices.PuQc6C7F.js → Prices.eQ9Vd255.js} +1 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.Ln_jf57U.js +7 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.X389bv9S.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.vj6lVDCr.js +1 -0
- package/packages/storefront/dist/client/_astro/{QuantitySelector.YNmWjN8y.js → QuantitySelector.qSJQlvTe.js} +1 -1
- package/packages/storefront/dist/client/_astro/SearchModal.BrVoDBvg.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchShowcase.KAz3nwco.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.mFKGzhIu.js +7 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper._suIQ7WC.js +1 -0
- package/packages/storefront/dist/client/_astro/_slug_.cfRx-rdA.css +1 -0
- package/packages/storefront/dist/client/_astro/client.PdegUP6S.js +1 -0
- package/packages/storefront/dist/client/_astro/{customer-session._VkzXnXT.js → customer-session.KkTHFOXl.js} +1 -1
- package/packages/storefront/dist/client/_astro/ecom-icon_12falx.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_15pqnO.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_t3guw.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-utils.Ld2zf-Ve.js +1 -0
- package/packages/storefront/dist/client/_astro/{format-money.FMQXgKHB.js → format-money.Axn0YFLJ.js} +1 -1
- package/packages/storefront/dist/client/_astro/grid-title.GntHOijE.js +1 -0
- package/packages/storefront/dist/client/_astro/headphone_T2Jjc.avif +0 -0
- package/packages/storefront/dist/client/_astro/headphone_Z1CG18r.webp +0 -0
- package/packages/storefront/dist/client/_astro/{hoisted._FbzheVm.js → hoisted.3ec9NcvP.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.B6fKrLPR.js → hoisted.UnTlypMd.js} +1 -1
- package/packages/storefront/dist/client/_astro/{i18n.m7SpISxy.js → i18n.3-NUtxYq.js} +1 -1
- package/packages/storefront/dist/client/_astro/{img.zh-Drf-O.js → img.pozlYdd3.js} +1 -1
- package/packages/storefront/dist/client/_astro/{index.XrHFaN2F.js → index.TkCbiY_p.js} +1 -1
- package/packages/storefront/dist/client/_astro/{index.5PN-EYMS.js → index.m6fK0JXC.js} +1 -1
- package/packages/storefront/dist/client/_astro/logo_1UBsBq.webp +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1K5PE9.png +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1KIIl1.avif +0 -0
- package/packages/storefront/dist/client/_astro/{modules-info.sD0tdb2b.js → modules-info.mmwB1qIJ.js} +1 -1
- package/packages/storefront/dist/client/_astro/name.49dZlpDx.js +1 -0
- package/packages/storefront/dist/client/_astro/passion_LHbe9.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_Z23MeUb.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1TtOHY.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1f5opX.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_IUskt.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Uxfdf.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z15uApA.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1Ap1Im.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1JT1HB.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_ZY9mtN.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_tMFW0.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1TgQXS.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_2Nm1z.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_DIqwR.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z1IKDb2.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z29FI4V.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z2kFHGk.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_ZkpPFI.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_jXzBi.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_x1l16.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_1TSfW7.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect89_Z1re32x.webp +0 -0
- package/packages/storefront/dist/client/_astro/sf-utils.yjuG8NjM.js +1 -0
- package/packages/storefront/dist/client/_astro/{shopping-cart.A-1jhlKi.js → shopping-cart.Ean2uW2R.js} +1 -1
- package/packages/storefront/dist/client/_astro/use-analytics.Y7amTmnr.js +1 -0
- package/packages/storefront/dist/client/_astro/{use-product-card.erbOV6Fv.js → use-product-card.zB4z32bC.js} +1 -1
- package/packages/storefront/dist/client/_astro/use-text-value.f9pDzruv.js +4 -0
- package/packages/storefront/dist/client/app/account/index.html +56 -0
- package/packages/storefront/dist/client/app/index.html +96 -0
- package/packages/storefront/dist/client/headset-gamer-corsair-hs40-raptor-ca-9011122-naap-vinho/index.html +107 -0
- package/packages/storefront/dist/client/index.html +120 -0
- package/packages/storefront/dist/client/macbook-apple-pro-15.4-intel-core-i7-2.6ghz-ram-16gb-ssd-512gb-mr972ll/a-prata/index.html +107 -0
- package/packages/storefront/dist/client/mouse-gamer-corsair-optico-harpoon-rgb-ch-9301011-na/index.html +107 -0
- package/packages/storefront/dist/client/teclado-gamer-fortrek-mecanico-k5-rgb-outemu-blue-preto/index.html +107 -0
- package/packages/storefront/dist/client/~fallback/index.html +74 -0
- package/packages/storefront/dist/server/chunks/{CartSidebar_hAgJQJgm.mjs → CartSidebar_gCUGFy65.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{SearchModal_eWb5SdQM.mjs → SearchModal_2uYZ9tHy.mjs} +4 -5
- package/packages/storefront/dist/server/chunks/{_.._S7DDBn_b.mjs → _.._FnNLvTNv.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{account_3ySmGzMc.mjs → account_iZ2QmK5E.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/astro/{assets-service_QlOZG8ov.mjs → assets-service_TpUb271h.mjs} +58 -136
- package/packages/storefront/dist/server/chunks/{astro_zcC1GStV.mjs → astro_PpArQAsY.mjs} +4 -4
- package/packages/storefront/dist/server/chunks/{index_nIwq11oA.mjs → index_1q5IpD39.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{index_uAR5ZV4d.mjs → index_JEU6B2DI.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{node_2VvC7trl.mjs → node_wOa5hJmt.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{__MSibDuuV.mjs → __cEcxuEWe.mjs} +1674 -422
- package/packages/storefront/dist/server/chunks/pages/{account_iG-YqJ5q.mjs → account_WliDuQOB.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/pages/{index_BtDyKPh_.mjs → index_2bQLkQf-.mjs} +3 -3
- package/packages/storefront/dist/server/chunks/pages/{node_bKqL47eZ.mjs → node_ZaY4t9qW.mjs} +21 -2
- package/packages/storefront/dist/server/chunks/pages/{~fallback_73R5VA6j.mjs → ~fallback_TL5hPXF_.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/{~fallback_7q1dqY4e.mjs → ~fallback_wxuqpDXG.mjs} +1 -1
- package/packages/storefront/dist/server/entry.mjs +34 -16
- package/packages/storefront/dist/server/{manifest_dSwvaOdW.mjs → manifest_YgAgEwvF.mjs} +17 -16
- package/packages/storefront/dist/server/renderers.mjs +14 -3
- package/packages/storefront/package.json +12 -12
- package/packages/storefront/src/helpers/sf-utils.ts +11 -0
- package/packages/storefront/src/lib/$storefront.d.ts +7 -1
- package/packages/storefront/src/lib/components/Drawer.vue +13 -8
- package/packages/storefront/src/lib/components/globals/ALink.vue +1 -1
- package/packages/storefront/src/lib/composables/use-pagination.ts +61 -0
- package/packages/storefront/src/lib/composables/use-product-shelf.ts +29 -19
- package/packages/storefront/src/lib/composables/use-search-filters.ts +271 -0
- package/packages/storefront/src/lib/composables/use-search-modal.ts +2 -11
- package/packages/storefront/src/lib/composables/use-search-showcase.ts +168 -22
- package/packages/storefront/src/lib/composables/use-sku-selector.ts +3 -8
- package/packages/storefront/src/lib/layouts/use-page-main.ts +20 -8
- package/packages/storefront/src/lib/state/search-engine.ts +19 -6
- package/packages/storefront/tsconfig.json +1 -1
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/pnpm-workspace.yaml +0 -2
- package/packages/i18n/lib/en_us/i19noProduct.txt +0 -1
- package/packages/i18n/lib/en_us/i19noResultsFor.txt +0 -1
- package/packages/i18n/lib/pt_br/i19noResultsFor.txt +0 -1
- package/packages/storefront/dist/client/_astro/AccountPage.j0C5JBLY.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.tR1dVXyu.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.FelC04wE.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductCard.ephJafAE.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.B6Ih5MGf.js +0 -7
- package/packages/storefront/dist/client/_astro/ProductShelf.GESxuPZ_.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchContainer.BzixfU3R.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.F7vbwxIv.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.5vR1LgSW.js +0 -10
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.sk5AFsEV.js +0 -1
- package/packages/storefront/dist/client/_astro/_slug_.r8QHNfdw.css +0 -1
- package/packages/storefront/dist/client/_astro/client.RF8UxjZd.js +0 -1
- package/packages/storefront/dist/client/_astro/ecom-utils.gJYgRPRz.js +0 -1
- package/packages/storefront/dist/client/_astro/name.HU5l7TJo.js +0 -1
- package/packages/storefront/dist/client/_astro/sf-utils.5t7r9A2G.js +0 -1
- package/packages/storefront/dist/client/_astro/use-analytics.1EVxbrS7.js +0 -1
- /package/packages/i18n/lib/en_us/{i19relatedProduct.txt → i19relatedProducts.txt} +0 -0
- /package/packages/i18n/lib/pt_br/{i19noProduct.txt → i19noProductsFound.txt} +0 -0
- /package/packages/i18n/lib/pt_br/{i19relatedProduct.txt → i19relatedProducts.txt} +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import '@astrojs/internal-helpers/path';
|
|
2
|
-
import {
|
|
2
|
+
import { A as AstroError, c as ExpectedImageOptions, E as ExpectedImage, d as InvalidImageService, e as createAstro, f as createComponent, g as ImageMissingAlt, r as renderTemplate, m as maybeRenderHead, h as addAttribute, s as spreadAttributes, u as unescapeHTML, i as renderComponent, j as createTransitionScope, k as renderSlotToString, l as renderAllHeadContent, n as renderSlot, F as Fragment } from '../astro_PpArQAsY.mjs';
|
|
3
3
|
import 'kleur/colors';
|
|
4
4
|
import api from '@cloudcommerce/api';
|
|
5
5
|
import { EventEmitter } from 'node:events';
|
|
6
6
|
import fs, { copyFileSync } from 'node:fs';
|
|
7
7
|
import { resolve, join, basename as basename$1 } from 'node:path';
|
|
8
8
|
import config from '@cloudcommerce/config';
|
|
9
|
-
import { img, price, formatMoney, randomObjectId, nickname, inStock, name, onPromotion, categoriesList, imgSizes, variationsGrids, specTextValue,
|
|
9
|
+
import { img, price, formatMoney, randomObjectId, nickname, inStock, gridTitle, name, onPromotion, categoriesList, imgSizes, variationsGrids, specTextValue, specValueByText } from '@ecomplus/utils';
|
|
10
10
|
import 'clsx';
|
|
11
11
|
/* empty css */
|
|
12
12
|
import { renderSync, parse, ELEMENT_NODE, walkSync } from 'ultrahtml';
|
|
13
13
|
import mime from 'mime/lite.js';
|
|
14
|
-
import { i as isESMImportedImage,
|
|
14
|
+
import { i as isESMImportedImage, a as isLocalService, b as isRemoteImage, D as DEFAULT_HASH_PROPS } from '../astro/assets-service_TpUb271h.mjs';
|
|
15
15
|
import imageSize from 'image-size';
|
|
16
|
-
import { reactive, computed, shallowRef, useSSRContext, defineComponent, resolveComponent, mergeProps, withCtx, withDirectives, createVNode, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, watch, ref, toRef, nextTick, withModifiers, renderSlot as renderSlot$1, Teleport, resolveDynamicComponent, onMounted, createTextVNode, toDisplayString, defineAsyncComponent, vModelText, Suspense, createSlots, shallowReactive, withAsyncContext, inject, provide } from 'vue';
|
|
17
|
-
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrRenderClass, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderSlot, ssrRenderTeleport, ssrRenderVNode, ssrInterpolate, ssrRenderSuspense } from 'vue/server-renderer';
|
|
18
|
-
import { watchDebounced, useDebounceFn, useTimeout, promiseTimeout, watchOnce, onClickOutside, useElementHover, createReusableTemplate
|
|
16
|
+
import { reactive, computed, shallowRef, useSSRContext, defineComponent, resolveComponent, mergeProps, withCtx, withDirectives, createVNode, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, watch, ref, toRef, nextTick, withModifiers, renderSlot as renderSlot$1, Teleport, resolveDynamicComponent, onMounted, createTextVNode, toDisplayString, defineAsyncComponent, vModelText, Suspense, createSlots, shallowReactive, withAsyncContext, inject, provide, vModelRadio } from 'vue';
|
|
17
|
+
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrRenderClass, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderSlot, ssrRenderTeleport, ssrRenderVNode, ssrInterpolate, ssrRenderSuspense, ssrLooseEqual } from 'vue/server-renderer';
|
|
18
|
+
import { watchDebounced, useDebounceFn, useTimeout, promiseTimeout, watchOnce, onClickOutside, useUrlSearchParams, useElementHover, createReusableTemplate } from '@vueuse/core';
|
|
19
19
|
import mitt from 'mitt';
|
|
20
|
-
import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
|
|
20
|
+
import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem, Listbox, ListboxButton, ListboxOptions, ListboxOption } from '@headlessui/vue';
|
|
21
21
|
|
|
22
22
|
const _export_sfc = (sfc, props) => {
|
|
23
23
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -27,6 +27,83 @@ const _export_sfc = (sfc, props) => {
|
|
|
27
27
|
return target;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
async function getConfiguredImageService() {
|
|
31
|
+
if (!globalThis?.astroAsset?.imageService) {
|
|
32
|
+
const { default: service } = await import(
|
|
33
|
+
// @ts-expect-error
|
|
34
|
+
'../astro/assets-service_TpUb271h.mjs'
|
|
35
|
+
).then(n => n.s).catch((e) => {
|
|
36
|
+
const error = new AstroError(InvalidImageService);
|
|
37
|
+
error.cause = e;
|
|
38
|
+
throw error;
|
|
39
|
+
});
|
|
40
|
+
if (!globalThis.astroAsset)
|
|
41
|
+
globalThis.astroAsset = {};
|
|
42
|
+
globalThis.astroAsset.imageService = service;
|
|
43
|
+
return service;
|
|
44
|
+
}
|
|
45
|
+
return globalThis.astroAsset.imageService;
|
|
46
|
+
}
|
|
47
|
+
async function getImage$1(options, imageConfig) {
|
|
48
|
+
if (!options || typeof options !== "object") {
|
|
49
|
+
throw new AstroError({
|
|
50
|
+
...ExpectedImageOptions,
|
|
51
|
+
message: ExpectedImageOptions.message(JSON.stringify(options))
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (typeof options.src === "undefined") {
|
|
55
|
+
throw new AstroError({
|
|
56
|
+
...ExpectedImage,
|
|
57
|
+
message: ExpectedImage.message(
|
|
58
|
+
options.src,
|
|
59
|
+
"undefined",
|
|
60
|
+
JSON.stringify(options)
|
|
61
|
+
)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const service = await getConfiguredImageService();
|
|
65
|
+
const resolvedOptions = {
|
|
66
|
+
...options,
|
|
67
|
+
src: typeof options.src === "object" && "then" in options.src ? (await options.src).default ?? await options.src : options.src
|
|
68
|
+
};
|
|
69
|
+
const clonedSrc = isESMImportedImage(resolvedOptions.src) ? (
|
|
70
|
+
// @ts-expect-error - clone is a private, hidden prop
|
|
71
|
+
resolvedOptions.src.clone ?? resolvedOptions.src
|
|
72
|
+
) : resolvedOptions.src;
|
|
73
|
+
resolvedOptions.src = clonedSrc;
|
|
74
|
+
const validatedOptions = service.validateOptions ? await service.validateOptions(resolvedOptions, imageConfig) : resolvedOptions;
|
|
75
|
+
const srcSetTransforms = service.getSrcSet ? await service.getSrcSet(validatedOptions, imageConfig) : [];
|
|
76
|
+
let imageURL = await service.getURL(validatedOptions, imageConfig);
|
|
77
|
+
let srcSets = await Promise.all(
|
|
78
|
+
srcSetTransforms.map(async (srcSet) => ({
|
|
79
|
+
transform: srcSet.transform,
|
|
80
|
+
url: await service.getURL(srcSet.transform, imageConfig),
|
|
81
|
+
descriptor: srcSet.descriptor,
|
|
82
|
+
attributes: srcSet.attributes
|
|
83
|
+
}))
|
|
84
|
+
);
|
|
85
|
+
if (isLocalService(service) && globalThis.astroAsset.addStaticImage && !(isRemoteImage(validatedOptions.src) && imageURL === validatedOptions.src)) {
|
|
86
|
+
const propsToHash = service.propertiesToHash ?? DEFAULT_HASH_PROPS;
|
|
87
|
+
imageURL = globalThis.astroAsset.addStaticImage(validatedOptions, propsToHash);
|
|
88
|
+
srcSets = srcSetTransforms.map((srcSet) => ({
|
|
89
|
+
transform: srcSet.transform,
|
|
90
|
+
url: globalThis.astroAsset.addStaticImage(srcSet.transform, propsToHash),
|
|
91
|
+
descriptor: srcSet.descriptor,
|
|
92
|
+
attributes: srcSet.attributes
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
rawOptions: resolvedOptions,
|
|
97
|
+
options: validatedOptions,
|
|
98
|
+
src: imageURL,
|
|
99
|
+
srcSet: {
|
|
100
|
+
values: srcSets,
|
|
101
|
+
attribute: srcSets.map((srcSet) => `${srcSet.url} ${srcSet.descriptor}`).join(", ")
|
|
102
|
+
},
|
|
103
|
+
attributes: service.getHTMLAttributes !== void 0 ? await service.getHTMLAttributes(validatedOptions, imageConfig) : {}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
30
107
|
const $$Astro$h = createAstro("https://demo.ecomplus.app");
|
|
31
108
|
const $$Image = createComponent(async ($$result, $$props, $$slots) => {
|
|
32
109
|
const Astro2 = $$result.createAstro($$Astro$h, $$props, $$slots);
|
|
@@ -113,6 +190,16 @@ const termify = (str) => {
|
|
|
113
190
|
const getSearchUrl = (term, baseUrl = "/s/") => {
|
|
114
191
|
return `${baseUrl}${encodeURIComponent(termify(term))}`;
|
|
115
192
|
};
|
|
193
|
+
const scrollToEl = (el, top = 0) => {
|
|
194
|
+
while (el.offsetParent) {
|
|
195
|
+
top += el.offsetTop;
|
|
196
|
+
el = el.offsetParent;
|
|
197
|
+
}
|
|
198
|
+
return window.scroll({
|
|
199
|
+
top,
|
|
200
|
+
behavior: "smooth"
|
|
201
|
+
});
|
|
202
|
+
};
|
|
116
203
|
|
|
117
204
|
global.__storefrontCMS = (fs, resolvePath) => {
|
|
118
205
|
const { STOREFRONT_BASE_DIR } = process.env;
|
|
@@ -1104,6 +1191,37 @@ const $$Base = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
1104
1191
|
` })}`;
|
|
1105
1192
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Base.astro", void 0);
|
|
1106
1193
|
|
|
1194
|
+
const emitter = new EventEmitter();
|
|
1195
|
+
const useSharedData = async (props) => {
|
|
1196
|
+
const { field, timeout = 1e3 } = props;
|
|
1197
|
+
let value = props.value;
|
|
1198
|
+
const $data = global.$storefront.data;
|
|
1199
|
+
if (value) {
|
|
1200
|
+
$data[field] = value;
|
|
1201
|
+
emitter.emit(field, value);
|
|
1202
|
+
} else if ($data[field]) {
|
|
1203
|
+
value = $data[field];
|
|
1204
|
+
} else {
|
|
1205
|
+
value = await new Promise((resolve) => {
|
|
1206
|
+
const callback = (_value) => {
|
|
1207
|
+
resolve(_value);
|
|
1208
|
+
clearTimeout(timer);
|
|
1209
|
+
};
|
|
1210
|
+
const abort = () => {
|
|
1211
|
+
resolve(null);
|
|
1212
|
+
emitter.removeListener(field, callback);
|
|
1213
|
+
};
|
|
1214
|
+
const timer = setTimeout(abort, timeout);
|
|
1215
|
+
emitter.once(field, callback);
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
return {
|
|
1219
|
+
value,
|
|
1220
|
+
getInlineClientJS: () => `
|
|
1221
|
+
window.$storefront.data['${field}'] = ${JSON.stringify(value)};`
|
|
1222
|
+
};
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1107
1225
|
const checkObjNotNull = (obj) => {
|
|
1108
1226
|
return Object.values(obj).filter((val) => val).length;
|
|
1109
1227
|
};
|
|
@@ -1156,10 +1274,13 @@ const loadingGlobalInfoPreset = new Promise((resolve) => {
|
|
|
1156
1274
|
});
|
|
1157
1275
|
|
|
1158
1276
|
let userAgent;
|
|
1277
|
+
let screenWidth;
|
|
1159
1278
|
{
|
|
1160
1279
|
userAgent = "";
|
|
1280
|
+
screenWidth = 0;
|
|
1161
1281
|
}
|
|
1162
1282
|
const isMobile = /Android|iPhone|iPad|iPod|webOS/i.test(userAgent);
|
|
1283
|
+
const isScreenLg = screenWidth >= 1024;
|
|
1163
1284
|
|
|
1164
1285
|
const networkNames = [
|
|
1165
1286
|
"whatsapp",
|
|
@@ -1267,7 +1388,7 @@ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
|
|
|
1267
1388
|
} = layoutContent;
|
|
1268
1389
|
const pitchBar = parseLayoutContent(layoutContent);
|
|
1269
1390
|
let { categories } = apiState;
|
|
1270
|
-
if (
|
|
1391
|
+
if (listedCategoryFields !== null) {
|
|
1271
1392
|
try {
|
|
1272
1393
|
categories = (await api.get("categories", {
|
|
1273
1394
|
fields: listedCategoryFields || [
|
|
@@ -1285,8 +1406,10 @@ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
|
|
|
1285
1406
|
console.error(err);
|
|
1286
1407
|
}
|
|
1287
1408
|
}
|
|
1409
|
+
if (categories) {
|
|
1410
|
+
useSharedData({ field: "categories", value: categories });
|
|
1411
|
+
}
|
|
1288
1412
|
const shopHeader = {
|
|
1289
|
-
categories,
|
|
1290
1413
|
menuCategorySlugs: inlineMenuCategories?.featured,
|
|
1291
1414
|
menuRandomCategories: inlineMenuCategories?.random,
|
|
1292
1415
|
isAlphabeticalSortSubmenu
|
|
@@ -1297,36 +1420,7 @@ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
|
|
|
1297
1420
|
};
|
|
1298
1421
|
};
|
|
1299
1422
|
|
|
1300
|
-
const
|
|
1301
|
-
const useSharedData = async ({ field, value, timeout = 1e3 }) => {
|
|
1302
|
-
const $data = global.$storefront.data;
|
|
1303
|
-
if (value) {
|
|
1304
|
-
$data[field] = value;
|
|
1305
|
-
emitter.emit(field, value);
|
|
1306
|
-
} else if ($data[field]) {
|
|
1307
|
-
value = $data[field];
|
|
1308
|
-
} else {
|
|
1309
|
-
value = await new Promise((resolve) => {
|
|
1310
|
-
const callback = (_value) => {
|
|
1311
|
-
resolve(_value);
|
|
1312
|
-
clearTimeout(timer);
|
|
1313
|
-
};
|
|
1314
|
-
const abort = () => {
|
|
1315
|
-
resolve(null);
|
|
1316
|
-
emitter.removeListener(field, callback);
|
|
1317
|
-
};
|
|
1318
|
-
const timer = setTimeout(abort, timeout);
|
|
1319
|
-
emitter.once(field, callback);
|
|
1320
|
-
});
|
|
1321
|
-
}
|
|
1322
|
-
return {
|
|
1323
|
-
value,
|
|
1324
|
-
inlineClientJS: `
|
|
1325
|
-
window.$storefront.data['${field}'] = ${JSON.stringify(value)};`
|
|
1326
|
-
};
|
|
1327
|
-
};
|
|
1328
|
-
|
|
1329
|
-
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
1423
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
1330
1424
|
__name: "PitchBar",
|
|
1331
1425
|
props: {
|
|
1332
1426
|
slides: {}
|
|
@@ -1343,7 +1437,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
1343
1437
|
return __returned__;
|
|
1344
1438
|
}
|
|
1345
1439
|
});
|
|
1346
|
-
function _sfc_ssrRender$
|
|
1440
|
+
function _sfc_ssrRender$v(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1347
1441
|
const _component_Carousel = resolveComponent("Carousel");
|
|
1348
1442
|
const _component_ALink = resolveComponent("ALink");
|
|
1349
1443
|
const _component_CarouselControl = resolveComponent("CarouselControl");
|
|
@@ -1436,13 +1530,13 @@ function _sfc_ssrRender$t(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1436
1530
|
}, _parent));
|
|
1437
1531
|
_push(`</div></div>`);
|
|
1438
1532
|
}
|
|
1439
|
-
const _sfc_setup$
|
|
1440
|
-
_sfc_main$
|
|
1533
|
+
const _sfc_setup$v = _sfc_main$v.setup;
|
|
1534
|
+
_sfc_main$v.setup = (props, ctx) => {
|
|
1441
1535
|
const ssrContext = useSSRContext();
|
|
1442
1536
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PitchBar.vue");
|
|
1443
|
-
return _sfc_setup$
|
|
1537
|
+
return _sfc_setup$v ? _sfc_setup$v(props, ctx) : void 0;
|
|
1444
1538
|
};
|
|
1445
|
-
const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1539
|
+
const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["ssrRender", _sfc_ssrRender$v]]);
|
|
1446
1540
|
|
|
1447
1541
|
const useStorage = (key, initialValue, storage = globalThis.localStorage) => {
|
|
1448
1542
|
if (!storage) {
|
|
@@ -1826,7 +1920,7 @@ const useShopHeader = (props) => {
|
|
|
1826
1920
|
};
|
|
1827
1921
|
};
|
|
1828
1922
|
|
|
1829
|
-
const _sfc_main$
|
|
1923
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
1830
1924
|
__name: "Drawer",
|
|
1831
1925
|
props: {
|
|
1832
1926
|
modelValue: { type: Boolean, default: false },
|
|
@@ -1837,6 +1931,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
1837
1931
|
hasCloseButton: { type: Boolean, default: true },
|
|
1838
1932
|
anchorEl: {},
|
|
1839
1933
|
backdropTarget: { default: "#teleported-top" },
|
|
1934
|
+
canLockScroll: { type: Boolean, default: true },
|
|
1840
1935
|
maxWidth: {},
|
|
1841
1936
|
class: {}
|
|
1842
1937
|
},
|
|
@@ -1862,16 +1957,20 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
1862
1957
|
const scrollbarWidth = ref(0);
|
|
1863
1958
|
watch(toRef(props, "modelValue"), async (isOpen) => {
|
|
1864
1959
|
if (isOpen) {
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1960
|
+
if (props.canLockScroll) {
|
|
1961
|
+
scrollbarWidth.value = window.innerWidth - document.documentElement.clientWidth;
|
|
1962
|
+
document.body.style.overflow = "hidden";
|
|
1963
|
+
document.body.style.paddingRight = `${scrollbarWidth.value}px`;
|
|
1964
|
+
}
|
|
1868
1965
|
setTimeout(() => {
|
|
1869
1966
|
document.addEventListener("click", outsideClickListener, { passive: true });
|
|
1870
1967
|
document.addEventListener("keydown", escClickListener, { passive: true });
|
|
1871
1968
|
}, 500);
|
|
1872
1969
|
} else {
|
|
1873
|
-
|
|
1874
|
-
|
|
1970
|
+
if (props.canLockScroll) {
|
|
1971
|
+
document.body.style.overflow = "";
|
|
1972
|
+
document.body.style.paddingRight = "";
|
|
1973
|
+
}
|
|
1875
1974
|
document.removeEventListener("click", outsideClickListener);
|
|
1876
1975
|
document.removeEventListener("keydown", escClickListener);
|
|
1877
1976
|
}
|
|
@@ -1924,7 +2023,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
1924
2023
|
return __returned__;
|
|
1925
2024
|
}
|
|
1926
2025
|
});
|
|
1927
|
-
function _sfc_ssrRender$
|
|
2026
|
+
function _sfc_ssrRender$u(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1928
2027
|
const _component_Fade = resolveComponent("Fade");
|
|
1929
2028
|
_push(ssrRenderComponent(_component_Fade, mergeProps({
|
|
1930
2029
|
slide: $setup.slideTo,
|
|
@@ -1950,9 +2049,9 @@ function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1950
2049
|
...$setup.customClassList
|
|
1951
2050
|
], "z-40 w-screen p-0"])}"${ssrIncludeBooleanAttr($props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
|
|
1952
2051
|
if ($props.hasCloseButton) {
|
|
1953
|
-
_push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([$props.placement === "end" ? "left-2" : "right-2", "absolute top-2 z-30"])}" data-drawer-close${_scopeId}>`);
|
|
2052
|
+
_push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([$props.placement === "end" ? "left-2" : "right-2", "absolute top-2 z-30 rounded"])}" data-drawer-close${_scopeId}>`);
|
|
1954
2053
|
ssrRenderSlot(_ctx.$slots, "close", {}, () => {
|
|
1955
|
-
_push2(`<i class="i-close text-base-400 hover:text-base-600 text-3xl"${_scopeId}></i>`);
|
|
2054
|
+
_push2(`<i class="i-close text-base-400 hover:text-base-600 m-0 text-3xl"${_scopeId}></i>`);
|
|
1956
2055
|
}, _push2, _parent2, _scopeId);
|
|
1957
2056
|
_push2(`</button>`);
|
|
1958
2057
|
} else {
|
|
@@ -2017,11 +2116,11 @@ function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2017
2116
|
type: "button",
|
|
2018
2117
|
"aria-label": "Fechar",
|
|
2019
2118
|
onClick: withModifiers($setup.close, ["prevent"]),
|
|
2020
|
-
class: ["absolute top-2 z-30", $props.placement === "end" ? "left-2" : "right-2"],
|
|
2119
|
+
class: ["absolute top-2 z-30 rounded", $props.placement === "end" ? "left-2" : "right-2"],
|
|
2021
2120
|
"data-drawer-close": ""
|
|
2022
2121
|
}, [
|
|
2023
2122
|
renderSlot$1(_ctx.$slots, "close", {}, () => [
|
|
2024
|
-
createVNode("i", { class: "i-close text-base-400 hover:text-base-600 text-3xl" })
|
|
2123
|
+
createVNode("i", { class: "i-close text-base-400 hover:text-base-600 m-0 text-3xl" })
|
|
2025
2124
|
])
|
|
2026
2125
|
], 2)) : createCommentVNode("", true),
|
|
2027
2126
|
renderSlot$1(_ctx.$slots, "default")
|
|
@@ -2050,13 +2149,13 @@ function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2050
2149
|
_: 3
|
|
2051
2150
|
}, _parent));
|
|
2052
2151
|
}
|
|
2053
|
-
const _sfc_setup$
|
|
2054
|
-
_sfc_main$
|
|
2152
|
+
const _sfc_setup$u = _sfc_main$u.setup;
|
|
2153
|
+
_sfc_main$u.setup = (props, ctx) => {
|
|
2055
2154
|
const ssrContext = useSSRContext();
|
|
2056
2155
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Drawer.vue");
|
|
2057
|
-
return _sfc_setup$
|
|
2156
|
+
return _sfc_setup$u ? _sfc_setup$u(props, ctx) : void 0;
|
|
2058
2157
|
};
|
|
2059
|
-
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2158
|
+
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["ssrRender", _sfc_ssrRender$u]]);
|
|
2060
2159
|
|
|
2061
2160
|
const storageKey$1 = "ecomSession";
|
|
2062
2161
|
const emptySession = {
|
|
@@ -2095,7 +2194,7 @@ const initializeFirebaseAuth = (canWaitIdle) => {
|
|
|
2095
2194
|
return;
|
|
2096
2195
|
};
|
|
2097
2196
|
|
|
2098
|
-
const _sfc_main$
|
|
2197
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
2099
2198
|
__name: "AccountLink",
|
|
2100
2199
|
props: {
|
|
2101
2200
|
to: {},
|
|
@@ -2130,20 +2229,20 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
2130
2229
|
return __returned__;
|
|
2131
2230
|
}
|
|
2132
2231
|
});
|
|
2133
|
-
function _sfc_ssrRender$
|
|
2232
|
+
function _sfc_ssrRender$t(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2134
2233
|
_push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
|
|
2135
2234
|
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
2136
2235
|
_push(`</a>`);
|
|
2137
2236
|
}
|
|
2138
|
-
const _sfc_setup$
|
|
2139
|
-
_sfc_main$
|
|
2237
|
+
const _sfc_setup$t = _sfc_main$t.setup;
|
|
2238
|
+
_sfc_main$t.setup = (props, ctx) => {
|
|
2140
2239
|
const ssrContext = useSSRContext();
|
|
2141
2240
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/AccountLink.vue");
|
|
2142
|
-
return _sfc_setup$
|
|
2241
|
+
return _sfc_setup$t ? _sfc_setup$t(props, ctx) : void 0;
|
|
2143
2242
|
};
|
|
2144
|
-
const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2243
|
+
const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["ssrRender", _sfc_ssrRender$t]]);
|
|
2145
2244
|
|
|
2146
|
-
const _sfc_main$
|
|
2245
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
2147
2246
|
__name: "SocialNetworkIcon",
|
|
2148
2247
|
props: {
|
|
2149
2248
|
as: { default: "i" },
|
|
@@ -2179,18 +2278,18 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
2179
2278
|
return __returned__;
|
|
2180
2279
|
}
|
|
2181
2280
|
});
|
|
2182
|
-
function _sfc_ssrRender$
|
|
2281
|
+
function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2183
2282
|
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
|
|
2184
2283
|
}
|
|
2185
|
-
const _sfc_setup$
|
|
2186
|
-
_sfc_main$
|
|
2284
|
+
const _sfc_setup$s = _sfc_main$s.setup;
|
|
2285
|
+
_sfc_main$s.setup = (props, ctx) => {
|
|
2187
2286
|
const ssrContext = useSSRContext();
|
|
2188
2287
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkIcon.vue");
|
|
2189
|
-
return _sfc_setup$
|
|
2288
|
+
return _sfc_setup$s ? _sfc_setup$s(props, ctx) : void 0;
|
|
2190
2289
|
};
|
|
2191
|
-
const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2290
|
+
const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["ssrRender", _sfc_ssrRender$s]]);
|
|
2192
2291
|
|
|
2193
|
-
const _sfc_main$
|
|
2292
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
2194
2293
|
__name: "SocialNetworkLink",
|
|
2195
2294
|
props: {
|
|
2196
2295
|
network: {},
|
|
@@ -2216,7 +2315,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2216
2315
|
return __returned__;
|
|
2217
2316
|
}
|
|
2218
2317
|
});
|
|
2219
|
-
function _sfc_ssrRender$
|
|
2318
|
+
function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2220
2319
|
const _component_ALink = resolveComponent("ALink");
|
|
2221
2320
|
_push(ssrRenderComponent(_component_ALink, mergeProps({ href: $setup.fixedHref }, _attrs), {
|
|
2222
2321
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
@@ -2237,15 +2336,15 @@ function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2237
2336
|
_: 3
|
|
2238
2337
|
}, _parent));
|
|
2239
2338
|
}
|
|
2240
|
-
const _sfc_setup$
|
|
2241
|
-
_sfc_main$
|
|
2339
|
+
const _sfc_setup$r = _sfc_main$r.setup;
|
|
2340
|
+
_sfc_main$r.setup = (props, ctx) => {
|
|
2242
2341
|
const ssrContext = useSSRContext();
|
|
2243
2342
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkLink.vue");
|
|
2244
|
-
return _sfc_setup$
|
|
2343
|
+
return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
|
|
2245
2344
|
};
|
|
2246
|
-
const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2345
|
+
const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["ssrRender", _sfc_ssrRender$r]]);
|
|
2247
2346
|
|
|
2248
|
-
const _sfc_main$
|
|
2347
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
2249
2348
|
__name: "ShopSidenavCategory",
|
|
2250
2349
|
props: {
|
|
2251
2350
|
categoryTree: {}
|
|
@@ -2268,7 +2367,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2268
2367
|
return __returned__;
|
|
2269
2368
|
}
|
|
2270
2369
|
});
|
|
2271
|
-
function _sfc_ssrRender$
|
|
2370
|
+
function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2272
2371
|
const _component_AImg = resolveComponent("AImg");
|
|
2273
2372
|
const _component_ShopSidenavCategory = resolveComponent("ShopSidenavCategory", true);
|
|
2274
2373
|
_push(`<li${ssrRenderAttrs(mergeProps({ class: "text-base-800 text-lg" }, _attrs))}>`);
|
|
@@ -2306,15 +2405,15 @@ function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2306
2405
|
}
|
|
2307
2406
|
_push(`</li>`);
|
|
2308
2407
|
}
|
|
2309
|
-
const _sfc_setup$
|
|
2310
|
-
_sfc_main$
|
|
2408
|
+
const _sfc_setup$q = _sfc_main$q.setup;
|
|
2409
|
+
_sfc_main$q.setup = (props, ctx) => {
|
|
2311
2410
|
const ssrContext = useSSRContext();
|
|
2312
2411
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenavCategory.vue");
|
|
2313
|
-
return _sfc_setup$
|
|
2412
|
+
return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
|
|
2314
2413
|
};
|
|
2315
|
-
const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2414
|
+
const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["ssrRender", _sfc_ssrRender$q]]);
|
|
2316
2415
|
|
|
2317
|
-
const _sfc_main$
|
|
2416
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
2318
2417
|
__name: "ShopSidenav",
|
|
2319
2418
|
props: {
|
|
2320
2419
|
categoryTrees: {}
|
|
@@ -2335,7 +2434,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2335
2434
|
return __returned__;
|
|
2336
2435
|
}
|
|
2337
2436
|
});
|
|
2338
|
-
function _sfc_ssrRender$
|
|
2437
|
+
function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2339
2438
|
_push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex h-full flex-col bg-white" }, _attrs))}><nav class="grow py-4"><ul class="relative h-full"><!--[-->`);
|
|
2340
2439
|
ssrRenderList($props.categoryTrees, (categoryTree, i) => {
|
|
2341
2440
|
_push(ssrRenderComponent($setup["ShopSidenavCategory"], {
|
|
@@ -2376,13 +2475,13 @@ function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2376
2475
|
});
|
|
2377
2476
|
_push(`<!--]--></ul></footer></aside>`);
|
|
2378
2477
|
}
|
|
2379
|
-
const _sfc_setup$
|
|
2380
|
-
_sfc_main$
|
|
2478
|
+
const _sfc_setup$p = _sfc_main$p.setup;
|
|
2479
|
+
_sfc_main$p.setup = (props, ctx) => {
|
|
2381
2480
|
const ssrContext = useSSRContext();
|
|
2382
2481
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenav.vue");
|
|
2383
|
-
return _sfc_setup$
|
|
2482
|
+
return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
|
|
2384
2483
|
};
|
|
2385
|
-
const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2484
|
+
const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["ssrRender", _sfc_ssrRender$p]]);
|
|
2386
2485
|
|
|
2387
2486
|
const useShopHeaderSubmenu = (props) => {
|
|
2388
2487
|
const categoryPicture = computed(() => {
|
|
@@ -2431,7 +2530,7 @@ const useShopHeaderSubmenu = (props) => {
|
|
|
2431
2530
|
};
|
|
2432
2531
|
};
|
|
2433
2532
|
|
|
2434
|
-
const _sfc_main$
|
|
2533
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
2435
2534
|
__name: "ShopHeaderSubmenu",
|
|
2436
2535
|
props: {
|
|
2437
2536
|
categoryTree: {},
|
|
@@ -2460,7 +2559,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2460
2559
|
return __returned__;
|
|
2461
2560
|
}
|
|
2462
2561
|
});
|
|
2463
|
-
function _sfc_ssrRender$
|
|
2562
|
+
function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2464
2563
|
const _component_Fade = resolveComponent("Fade");
|
|
2465
2564
|
const _component_AImg = resolveComponent("AImg");
|
|
2466
2565
|
_push(ssrRenderComponent($setup["Popover"], _attrs, {
|
|
@@ -2774,15 +2873,15 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2774
2873
|
_: 3
|
|
2775
2874
|
}, _parent));
|
|
2776
2875
|
}
|
|
2777
|
-
const _sfc_setup$
|
|
2778
|
-
_sfc_main$
|
|
2876
|
+
const _sfc_setup$o = _sfc_main$o.setup;
|
|
2877
|
+
_sfc_main$o.setup = (props, ctx) => {
|
|
2779
2878
|
const ssrContext = useSSRContext();
|
|
2780
2879
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderSubmenu.vue");
|
|
2781
|
-
return _sfc_setup$
|
|
2880
|
+
return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
|
|
2782
2881
|
};
|
|
2783
|
-
const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2882
|
+
const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["ssrRender", _sfc_ssrRender$o]]);
|
|
2784
2883
|
|
|
2785
|
-
const _sfc_main$
|
|
2884
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
2786
2885
|
__name: "ShopHeaderMenu",
|
|
2787
2886
|
props: {
|
|
2788
2887
|
inlineMenuTrees: {}
|
|
@@ -2798,7 +2897,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
2798
2897
|
return __returned__;
|
|
2799
2898
|
}
|
|
2800
2899
|
});
|
|
2801
|
-
function _sfc_ssrRender$
|
|
2900
|
+
function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2802
2901
|
_push(`<nav${ssrRenderAttrs(_attrs)}><ul class="${ssrRenderClass([$props.inlineMenuTrees.length < 7 ? "text-base" : "text-sm", "text-base-700 flex gap-4 xl:gap-5"])}"><!--[-->`);
|
|
2803
2902
|
ssrRenderList($props.inlineMenuTrees, (categoryTree, i) => {
|
|
2804
2903
|
_push(`<li>`);
|
|
@@ -2811,7 +2910,7 @@ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2811
2910
|
open ? "underline" : null
|
|
2812
2911
|
], "inline group-hover:underline"])}"${_scopeId}>${ssrInterpolate(categoryTree.name)}</h3>`);
|
|
2813
2912
|
if ($setup.hasOneLevelSubcategories) {
|
|
2814
|
-
_push2(`<i class="${ssrRenderClass([open ? "rotate-
|
|
2913
|
+
_push2(`<i class="${ssrRenderClass([open ? "-rotate-90" : "rotate-90", "i-chevron-right text-base-400 group-hover:text-primary-subtle ml-1 transition-transform"])}"${_scopeId}></i>`);
|
|
2815
2914
|
} else {
|
|
2816
2915
|
_push2(`<!---->`);
|
|
2817
2916
|
}
|
|
@@ -2827,7 +2926,7 @@ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2827
2926
|
}, toDisplayString(categoryTree.name), 3),
|
|
2828
2927
|
$setup.hasOneLevelSubcategories ? (openBlock(), createBlock("i", {
|
|
2829
2928
|
key: 0,
|
|
2830
|
-
class: ["i-chevron-
|
|
2929
|
+
class: ["i-chevron-right text-base-400 group-hover:text-primary-subtle ml-1 transition-transform", open ? "-rotate-90" : "rotate-90"]
|
|
2831
2930
|
}, null, 2)) : createCommentVNode("", true)
|
|
2832
2931
|
])
|
|
2833
2932
|
];
|
|
@@ -2842,15 +2941,15 @@ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2842
2941
|
});
|
|
2843
2942
|
_push(`<!--]--></ul></nav>`);
|
|
2844
2943
|
}
|
|
2845
|
-
const _sfc_setup$
|
|
2846
|
-
_sfc_main$
|
|
2944
|
+
const _sfc_setup$n = _sfc_main$n.setup;
|
|
2945
|
+
_sfc_main$n.setup = (props, ctx) => {
|
|
2847
2946
|
const ssrContext = useSSRContext();
|
|
2848
2947
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderMenu.vue");
|
|
2849
|
-
return _sfc_setup$
|
|
2948
|
+
return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
|
|
2850
2949
|
};
|
|
2851
|
-
const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2950
|
+
const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["ssrRender", _sfc_ssrRender$n]]);
|
|
2852
2951
|
|
|
2853
|
-
const _sfc_main$
|
|
2952
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
2854
2953
|
__name: "AccountMenu",
|
|
2855
2954
|
setup(__props, { expose: __expose }) {
|
|
2856
2955
|
__expose();
|
|
@@ -2877,7 +2976,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
2877
2976
|
return __returned__;
|
|
2878
2977
|
}
|
|
2879
2978
|
});
|
|
2880
|
-
function _sfc_ssrRender$
|
|
2979
|
+
function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2881
2980
|
const _component_Fade = resolveComponent("Fade");
|
|
2882
2981
|
const _component_ALink = resolveComponent("ALink");
|
|
2883
2982
|
_push(ssrRenderComponent($setup["Menu"], mergeProps({
|
|
@@ -2976,7 +3075,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2976
3075
|
if (_push5) {
|
|
2977
3076
|
_push5(ssrRenderComponent($setup["AccountLink"], {
|
|
2978
3077
|
to: "orders",
|
|
2979
|
-
class: ["block p-2", active ? "bg-
|
|
3078
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
2980
3079
|
}, {
|
|
2981
3080
|
default: withCtx((_3, _push6, _parent6, _scopeId5) => {
|
|
2982
3081
|
if (_push6) {
|
|
@@ -2993,7 +3092,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2993
3092
|
return [
|
|
2994
3093
|
createVNode($setup["AccountLink"], {
|
|
2995
3094
|
to: "orders",
|
|
2996
|
-
class: ["block p-2", active ? "bg-
|
|
3095
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
2997
3096
|
}, {
|
|
2998
3097
|
default: withCtx(() => [
|
|
2999
3098
|
createTextVNode(toDisplayString("Meus pedidos"))
|
|
@@ -3010,7 +3109,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3010
3109
|
if (_push5) {
|
|
3011
3110
|
_push5(ssrRenderComponent($setup["AccountLink"], {
|
|
3012
3111
|
to: "favorites",
|
|
3013
|
-
class: ["block p-2", active ? "bg-
|
|
3112
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3014
3113
|
}, {
|
|
3015
3114
|
default: withCtx((_3, _push6, _parent6, _scopeId5) => {
|
|
3016
3115
|
if (_push6) {
|
|
@@ -3028,7 +3127,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3028
3127
|
return [
|
|
3029
3128
|
createVNode($setup["AccountLink"], {
|
|
3030
3129
|
to: "favorites",
|
|
3031
|
-
class: ["block p-2", active ? "bg-
|
|
3130
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3032
3131
|
}, {
|
|
3033
3132
|
default: withCtx(() => [
|
|
3034
3133
|
createVNode("i", { class: "i-heart mr-1" }),
|
|
@@ -3051,7 +3150,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3051
3150
|
if (_push5) {
|
|
3052
3151
|
_push5(ssrRenderComponent(_component_ALink, {
|
|
3053
3152
|
href,
|
|
3054
|
-
class: ["block p-2", active ? "bg-
|
|
3153
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3055
3154
|
}, {
|
|
3056
3155
|
default: withCtx((_3, _push6, _parent6, _scopeId5) => {
|
|
3057
3156
|
if (_push6) {
|
|
@@ -3068,7 +3167,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3068
3167
|
return [
|
|
3069
3168
|
createVNode(_component_ALink, {
|
|
3070
3169
|
href,
|
|
3071
|
-
class: ["block p-2", active ? "bg-
|
|
3170
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3072
3171
|
}, {
|
|
3073
3172
|
default: withCtx(() => [
|
|
3074
3173
|
createTextVNode(toDisplayString(title), 1)
|
|
@@ -3164,7 +3263,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3164
3263
|
default: withCtx(({ active }) => [
|
|
3165
3264
|
createVNode($setup["AccountLink"], {
|
|
3166
3265
|
to: "orders",
|
|
3167
|
-
class: ["block p-2", active ? "bg-
|
|
3266
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3168
3267
|
}, {
|
|
3169
3268
|
default: withCtx(() => [
|
|
3170
3269
|
createTextVNode(toDisplayString("Meus pedidos"))
|
|
@@ -3178,7 +3277,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3178
3277
|
default: withCtx(({ active }) => [
|
|
3179
3278
|
createVNode($setup["AccountLink"], {
|
|
3180
3279
|
to: "favorites",
|
|
3181
|
-
class: ["block p-2", active ? "bg-
|
|
3280
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3182
3281
|
}, {
|
|
3183
3282
|
default: withCtx(() => [
|
|
3184
3283
|
createVNode("i", { class: "i-heart mr-1" }),
|
|
@@ -3197,7 +3296,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3197
3296
|
default: withCtx(({ active }) => [
|
|
3198
3297
|
createVNode(_component_ALink, {
|
|
3199
3298
|
href,
|
|
3200
|
-
class: ["block p-2", active ? "bg-
|
|
3299
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3201
3300
|
}, {
|
|
3202
3301
|
default: withCtx(() => [
|
|
3203
3302
|
createTextVNode(toDisplayString(title), 1)
|
|
@@ -3275,7 +3374,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3275
3374
|
default: withCtx(({ active }) => [
|
|
3276
3375
|
createVNode($setup["AccountLink"], {
|
|
3277
3376
|
to: "orders",
|
|
3278
|
-
class: ["block p-2", active ? "bg-
|
|
3377
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3279
3378
|
}, {
|
|
3280
3379
|
default: withCtx(() => [
|
|
3281
3380
|
createTextVNode(toDisplayString("Meus pedidos"))
|
|
@@ -3289,7 +3388,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3289
3388
|
default: withCtx(({ active }) => [
|
|
3290
3389
|
createVNode($setup["AccountLink"], {
|
|
3291
3390
|
to: "favorites",
|
|
3292
|
-
class: ["block p-2", active ? "bg-
|
|
3391
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3293
3392
|
}, {
|
|
3294
3393
|
default: withCtx(() => [
|
|
3295
3394
|
createVNode("i", { class: "i-heart mr-1" }),
|
|
@@ -3308,7 +3407,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3308
3407
|
default: withCtx(({ active }) => [
|
|
3309
3408
|
createVNode(_component_ALink, {
|
|
3310
3409
|
href,
|
|
3311
|
-
class: ["block p-2", active ? "bg-
|
|
3410
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3312
3411
|
}, {
|
|
3313
3412
|
default: withCtx(() => [
|
|
3314
3413
|
createTextVNode(toDisplayString(title), 1)
|
|
@@ -3414,7 +3513,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3414
3513
|
default: withCtx(({ active }) => [
|
|
3415
3514
|
createVNode($setup["AccountLink"], {
|
|
3416
3515
|
to: "orders",
|
|
3417
|
-
class: ["block p-2", active ? "bg-
|
|
3516
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3418
3517
|
}, {
|
|
3419
3518
|
default: withCtx(() => [
|
|
3420
3519
|
createTextVNode(toDisplayString("Meus pedidos"))
|
|
@@ -3428,7 +3527,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3428
3527
|
default: withCtx(({ active }) => [
|
|
3429
3528
|
createVNode($setup["AccountLink"], {
|
|
3430
3529
|
to: "favorites",
|
|
3431
|
-
class: ["block p-2", active ? "bg-
|
|
3530
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3432
3531
|
}, {
|
|
3433
3532
|
default: withCtx(() => [
|
|
3434
3533
|
createVNode("i", { class: "i-heart mr-1" }),
|
|
@@ -3447,7 +3546,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3447
3546
|
default: withCtx(({ active }) => [
|
|
3448
3547
|
createVNode(_component_ALink, {
|
|
3449
3548
|
href,
|
|
3450
|
-
class: ["block p-2", active ? "bg-
|
|
3549
|
+
class: ["block p-2", active ? "bg-primary-100 text-primary" : null]
|
|
3451
3550
|
}, {
|
|
3452
3551
|
default: withCtx(() => [
|
|
3453
3552
|
createTextVNode(toDisplayString(title), 1)
|
|
@@ -3501,15 +3600,15 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3501
3600
|
_: 3
|
|
3502
3601
|
}, _parent));
|
|
3503
3602
|
}
|
|
3504
|
-
const _sfc_setup$
|
|
3505
|
-
_sfc_main$
|
|
3603
|
+
const _sfc_setup$m = _sfc_main$m.setup;
|
|
3604
|
+
_sfc_main$m.setup = (props, ctx) => {
|
|
3506
3605
|
const ssrContext = useSSRContext();
|
|
3507
3606
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/AccountMenu.vue");
|
|
3508
|
-
return _sfc_setup$
|
|
3607
|
+
return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
|
|
3509
3608
|
};
|
|
3510
|
-
const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3609
|
+
const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["ssrRender", _sfc_ssrRender$m]]);
|
|
3511
3610
|
|
|
3512
|
-
const _sfc_main$
|
|
3611
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
3513
3612
|
__name: "ShopHeader",
|
|
3514
3613
|
props: {
|
|
3515
3614
|
searchInput: {},
|
|
@@ -3520,8 +3619,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3520
3619
|
},
|
|
3521
3620
|
setup(__props, { expose: __expose }) {
|
|
3522
3621
|
__expose();
|
|
3523
|
-
const SearchModal = defineAsyncComponent(() => import('../
|
|
3524
|
-
const CartSidebar = defineAsyncComponent(() => import('../
|
|
3622
|
+
const SearchModal = defineAsyncComponent(() => import('../SearchModal_2uYZ9tHy.mjs'));
|
|
3623
|
+
const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_gCUGFy65.mjs'));
|
|
3525
3624
|
const props = __props;
|
|
3526
3625
|
const header = ref(null);
|
|
3527
3626
|
const searchInput = ref(null);
|
|
@@ -3551,7 +3650,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3551
3650
|
return __returned__;
|
|
3552
3651
|
}
|
|
3553
3652
|
});
|
|
3554
|
-
function _sfc_ssrRender$
|
|
3653
|
+
function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3555
3654
|
const _component_Fade = resolveComponent("Fade");
|
|
3556
3655
|
const _component_Skeleton = resolveComponent("Skeleton");
|
|
3557
3656
|
_push(`<header${ssrRenderAttrs(mergeProps({
|
|
@@ -3570,10 +3669,10 @@ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3570
3669
|
_push(ssrRenderComponent(_component_Fade, null, {
|
|
3571
3670
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3572
3671
|
if (_push2) {
|
|
3573
|
-
_push2(`<div style="${ssrRenderStyle($setup.isSearchOpen ? null : { display: "none" })}" class="absolute -right-0.5 -top-2 flex items-stretch"${_scopeId}><div class="hidden w-12 bg-gradient-to-r from-transparent to-white sm:block"${_scopeId}></div><input type="search" id="HeaderSearch" name="q"${ssrRenderAttr("value", $setup.searchTerm)} class="to-primary-50 border-primary/20 border-1 w-72 max-w-md bg-gradient-to-r from-white py-3 pl-5 pr-12 text-base ring-0 md:w-screen"${ssrRenderAttr("placeholder", `${"Buscar produtos"} ...`)}${_scopeId}></div>`);
|
|
3672
|
+
_push2(`<div style="${ssrRenderStyle($setup.isSearchOpen ? null : { display: "none" })}" class="absolute -right-0.5 -top-2.5 flex items-stretch"${_scopeId}><div class="hidden w-12 bg-gradient-to-r from-transparent to-white sm:block"${_scopeId}></div><input type="search" id="HeaderSearch" name="q"${ssrRenderAttr("value", $setup.searchTerm)} class="to-primary-50 border-primary/20 border-1 w-72 max-w-md bg-gradient-to-r from-white py-3 pl-5 pr-12 text-base ring-0 md:w-screen"${ssrRenderAttr("placeholder", `${"Buscar produtos"} ...`)}${_scopeId}></div>`);
|
|
3574
3673
|
} else {
|
|
3575
3674
|
return [
|
|
3576
|
-
withDirectives(createVNode("div", { class: "absolute -right-0.5 -top-2 flex items-stretch" }, [
|
|
3675
|
+
withDirectives(createVNode("div", { class: "absolute -right-0.5 -top-2.5 flex items-stretch" }, [
|
|
3577
3676
|
createVNode("div", { class: "hidden w-12 bg-gradient-to-r from-transparent to-white sm:block" }),
|
|
3578
3677
|
withDirectives(createVNode("input", {
|
|
3579
3678
|
ref: "searchInput",
|
|
@@ -3762,13 +3861,13 @@ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3762
3861
|
}
|
|
3763
3862
|
_push(`</header>`);
|
|
3764
3863
|
}
|
|
3765
|
-
const _sfc_setup$
|
|
3766
|
-
_sfc_main$
|
|
3864
|
+
const _sfc_setup$l = _sfc_main$l.setup;
|
|
3865
|
+
_sfc_main$l.setup = (props, ctx) => {
|
|
3767
3866
|
const ssrContext = useSSRContext();
|
|
3768
3867
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeader.vue");
|
|
3769
|
-
return _sfc_setup$
|
|
3868
|
+
return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
|
|
3770
3869
|
};
|
|
3771
|
-
const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3870
|
+
const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["ssrRender", _sfc_ssrRender$l]]);
|
|
3772
3871
|
|
|
3773
3872
|
var __freeze$2 = Object.freeze;
|
|
3774
3873
|
var __defProp$2 = Object.defineProperty;
|
|
@@ -3783,13 +3882,10 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3783
3882
|
const LogoHeading = isHomepage ? "h1" : "h2";
|
|
3784
3883
|
const {
|
|
3785
3884
|
pitchBar,
|
|
3786
|
-
shopHeader
|
|
3885
|
+
shopHeader
|
|
3787
3886
|
} = await usePageHeader({ routeContext });
|
|
3788
|
-
const {
|
|
3789
|
-
|
|
3790
|
-
value: categories?.map(({ _id, ...c }) => c)
|
|
3791
|
-
});
|
|
3792
|
-
return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a$2 || (_a$2 = __template$2(["\n ", "\n ", "\n\n<script>", "<\/script>\n", ""])), pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`, pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(inlineClientJS), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
|
|
3887
|
+
const { getInlineClientJS } = await useSharedData({ field: "categories" });
|
|
3888
|
+
return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a$2 || (_a$2 = __template$2(["\n ", "\n ", "\n\n<script>", "<\/script>\n", ""])), pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`, pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(getInlineClientJS()), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
|
|
3793
3889
|
${maybeRenderHead()}<a href="/">
|
|
3794
3890
|
${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "default": ($$result4) => renderTemplate`
|
|
3795
3891
|
${renderComponent($$result4, "Picture", $$Picture, { "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}
|
|
@@ -3798,7 +3894,7 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3798
3894
|
` })}` })))}`;
|
|
3799
3895
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
|
|
3800
3896
|
|
|
3801
|
-
const _sfc_main$
|
|
3897
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
3802
3898
|
__name: "PaymentMethodFlag",
|
|
3803
3899
|
props: {
|
|
3804
3900
|
as: { default: "i" },
|
|
@@ -3834,22 +3930,22 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3834
3930
|
return __returned__;
|
|
3835
3931
|
}
|
|
3836
3932
|
});
|
|
3837
|
-
function _sfc_ssrRender$
|
|
3933
|
+
function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3838
3934
|
if (!$setup.iconClassName) {
|
|
3839
3935
|
_push(`<b${ssrRenderAttrs(mergeProps({ class: "mb-1 text-[57%] leading-none tracking-tighter text-black" }, _attrs))}>${ssrInterpolate($setup.props.flag)}</b>`);
|
|
3840
3936
|
} else {
|
|
3841
3937
|
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
|
|
3842
3938
|
}
|
|
3843
3939
|
}
|
|
3844
|
-
const _sfc_setup$
|
|
3845
|
-
_sfc_main$
|
|
3940
|
+
const _sfc_setup$k = _sfc_main$k.setup;
|
|
3941
|
+
_sfc_main$k.setup = (props, ctx) => {
|
|
3846
3942
|
const ssrContext = useSSRContext();
|
|
3847
3943
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/PaymentMethodFlag.vue");
|
|
3848
|
-
return _sfc_setup$
|
|
3944
|
+
return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
|
|
3849
3945
|
};
|
|
3850
|
-
const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3946
|
+
const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["ssrRender", _sfc_ssrRender$k]]);
|
|
3851
3947
|
|
|
3852
|
-
const _sfc_main$
|
|
3948
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
3853
3949
|
__name: "FooterStamps",
|
|
3854
3950
|
props: {
|
|
3855
3951
|
stamps: {}
|
|
@@ -3861,7 +3957,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3861
3957
|
return __returned__;
|
|
3862
3958
|
}
|
|
3863
3959
|
});
|
|
3864
|
-
function _sfc_ssrRender$
|
|
3960
|
+
function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3865
3961
|
const _component_ALink = resolveComponent("ALink");
|
|
3866
3962
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><div class="flex flex-wrap items-start justify-between gap-5 lg:flex-nowrap"><ul class="mx-auto flex items-center gap-x-6 gap-y-3 overflow-x-auto md:mx-0 md:flex-wrap md:overflow-hidden lg:gap-x-8"><!--[-->`);
|
|
3867
3963
|
ssrRenderList($props.stamps, (stamp, i) => {
|
|
@@ -3960,15 +4056,15 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3960
4056
|
}, _parent));
|
|
3961
4057
|
_push(`</div></div>`);
|
|
3962
4058
|
}
|
|
3963
|
-
const _sfc_setup$
|
|
3964
|
-
_sfc_main$
|
|
4059
|
+
const _sfc_setup$j = _sfc_main$j.setup;
|
|
4060
|
+
_sfc_main$j.setup = (props, ctx) => {
|
|
3965
4061
|
const ssrContext = useSSRContext();
|
|
3966
4062
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/FooterStamps.vue");
|
|
3967
|
-
return _sfc_setup$
|
|
4063
|
+
return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
|
|
3968
4064
|
};
|
|
3969
|
-
const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4065
|
+
const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
|
|
3970
4066
|
|
|
3971
|
-
const _sfc_main$
|
|
4067
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
3972
4068
|
__name: "ShopFooter",
|
|
3973
4069
|
props: {
|
|
3974
4070
|
stamps: {},
|
|
@@ -3986,7 +4082,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
3986
4082
|
return __returned__;
|
|
3987
4083
|
}
|
|
3988
4084
|
});
|
|
3989
|
-
function _sfc_ssrRender$
|
|
4085
|
+
function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3990
4086
|
const _component_ALink = resolveComponent("ALink");
|
|
3991
4087
|
_push(`<footer${ssrRenderAttrs(mergeProps({ class: "bg-base-50 border-base-100 mt-auto w-screen border-t py-2" }, _attrs))}><div class="ui-section"><div class="border-base-200 flex flex-wrap justify-between gap-y-5 border-b pb-7 sm:gap-x-10 lg:flex-nowrap"><div class="shrink">`);
|
|
3992
4088
|
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
|
|
@@ -4084,13 +4180,13 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4084
4180
|
_push(ssrRenderComponent($setup["FooterStamps"], { stamps: $props.stamps }, null, _parent));
|
|
4085
4181
|
_push(`</footer>`);
|
|
4086
4182
|
}
|
|
4087
|
-
const _sfc_setup$
|
|
4088
|
-
_sfc_main$
|
|
4183
|
+
const _sfc_setup$i = _sfc_main$i.setup;
|
|
4184
|
+
_sfc_main$i.setup = (props, ctx) => {
|
|
4089
4185
|
const ssrContext = useSSRContext();
|
|
4090
4186
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopFooter.vue");
|
|
4091
|
-
return _sfc_setup$
|
|
4187
|
+
return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
|
|
4092
4188
|
};
|
|
4093
|
-
const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4189
|
+
const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
|
|
4094
4190
|
|
|
4095
4191
|
const $$Astro$7 = createAstro("https://demo.ecomplus.app");
|
|
4096
4192
|
const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
|
|
@@ -4142,6 +4238,19 @@ const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4142
4238
|
` })}` })}`;
|
|
4143
4239
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageFooter.astro", void 0);
|
|
4144
4240
|
|
|
4241
|
+
const i19aboveOf = "Acima de";
|
|
4242
|
+
const i19brands = "Marcas";
|
|
4243
|
+
const i19categories = "Categorias";
|
|
4244
|
+
const i19discount = "Desconto";
|
|
4245
|
+
const i19highestPrice = "Maior preço";
|
|
4246
|
+
const i19lowestPrice = "Menor preço";
|
|
4247
|
+
const i19name = "Nome";
|
|
4248
|
+
const i19relatedProducts = "Produtos relacionados";
|
|
4249
|
+
const i19releases = "Lançamentos";
|
|
4250
|
+
const i19relevance = "Relevância";
|
|
4251
|
+
const i19sales = "Vendas";
|
|
4252
|
+
const i19upTo = "Até";
|
|
4253
|
+
|
|
4145
4254
|
const useProductShelf = (props) => {
|
|
4146
4255
|
const title = ref(props.title || "");
|
|
4147
4256
|
const titleLink = ref(props.titleLink || "");
|
|
@@ -4152,31 +4261,39 @@ const useProductShelf = (props) => {
|
|
|
4152
4261
|
if (!props.products) {
|
|
4153
4262
|
isFetching.value = true;
|
|
4154
4263
|
fetching = (async () => {
|
|
4155
|
-
let searchQuery = props.searchQuery || "";
|
|
4156
|
-
let collection;
|
|
4157
|
-
if (props.collectionId) {
|
|
4158
|
-
try {
|
|
4159
|
-
const { data } = await api.get(`collections/${props.collectionId}`);
|
|
4160
|
-
collection = data;
|
|
4161
|
-
} catch (err) {
|
|
4162
|
-
console.error(err);
|
|
4163
|
-
fetchError.value = err;
|
|
4164
|
-
}
|
|
4165
|
-
const productIds = collection?.products;
|
|
4166
|
-
if (Array.isArray(productIds) && productIds.length) {
|
|
4167
|
-
searchQuery += `&_id=${productIds.slice(0, 60).join(",")}`;
|
|
4168
|
-
}
|
|
4169
|
-
if (!title.value && title.value !== null && collection?.name) {
|
|
4170
|
-
title.value = collection?.name;
|
|
4171
|
-
}
|
|
4172
|
-
}
|
|
4173
4264
|
const limit = props.limit || 24;
|
|
4174
4265
|
const offset = props.page ? (props.page - 1) * limit : 0;
|
|
4175
4266
|
let endpointQuery = `offset=${offset}&limit=${limit}`;
|
|
4176
4267
|
if (props.sort) {
|
|
4177
4268
|
endpointQuery += `&sort=${props.sort}`;
|
|
4178
4269
|
}
|
|
4179
|
-
|
|
4270
|
+
if (props.isRelatedProducts) {
|
|
4271
|
+
const { apiContext } = globalThis.$storefront;
|
|
4272
|
+
if (apiContext?.resource === "products") {
|
|
4273
|
+
endpointQuery = `like=${apiContext.doc._id}`;
|
|
4274
|
+
title.value = i19relatedProducts;
|
|
4275
|
+
}
|
|
4276
|
+
} else {
|
|
4277
|
+
let searchQuery = props.searchQuery || "";
|
|
4278
|
+
let collection;
|
|
4279
|
+
if (props.collectionId) {
|
|
4280
|
+
try {
|
|
4281
|
+
const { data } = await api.get(`collections/${props.collectionId}`);
|
|
4282
|
+
collection = data;
|
|
4283
|
+
} catch (err) {
|
|
4284
|
+
console.error(err);
|
|
4285
|
+
fetchError.value = err;
|
|
4286
|
+
}
|
|
4287
|
+
const productIds = collection?.products;
|
|
4288
|
+
if (Array.isArray(productIds) && productIds.length) {
|
|
4289
|
+
searchQuery += `&_id=${productIds.slice(0, 60).join(",")}`;
|
|
4290
|
+
}
|
|
4291
|
+
if (!title.value && title.value !== null && collection?.name) {
|
|
4292
|
+
title.value = collection?.name;
|
|
4293
|
+
}
|
|
4294
|
+
}
|
|
4295
|
+
endpointQuery += searchQuery;
|
|
4296
|
+
}
|
|
4180
4297
|
try {
|
|
4181
4298
|
const { data } = await api.get(`search/v1?${endpointQuery}`);
|
|
4182
4299
|
if (props.isShuffle) {
|
|
@@ -4261,10 +4378,10 @@ const search = async ({
|
|
|
4261
4378
|
};
|
|
4262
4379
|
class SearchEngine {
|
|
4263
4380
|
fields;
|
|
4264
|
-
term = ref(
|
|
4381
|
+
term = ref(null);
|
|
4265
4382
|
isWithCount = ref(true);
|
|
4266
4383
|
isWithBuckets = ref(true);
|
|
4267
|
-
params =
|
|
4384
|
+
params = reactive({});
|
|
4268
4385
|
pageSize = ref(24);
|
|
4269
4386
|
pageNumber = ref(1);
|
|
4270
4387
|
#isFetching = ref(false);
|
|
@@ -4302,7 +4419,7 @@ class SearchEngine {
|
|
|
4302
4419
|
});
|
|
4303
4420
|
}
|
|
4304
4421
|
async fetch(term) {
|
|
4305
|
-
if (term && term !== this.term.value) {
|
|
4422
|
+
if (term !== void 0 && term !== this.term.value) {
|
|
4306
4423
|
this.term.value = term;
|
|
4307
4424
|
this.pageNumber.value = 1;
|
|
4308
4425
|
}
|
|
@@ -4338,52 +4455,443 @@ class SearchEngine {
|
|
|
4338
4455
|
this.#wasFetched.value = true;
|
|
4339
4456
|
const { data } = response;
|
|
4340
4457
|
if (data.meta) {
|
|
4341
|
-
this.
|
|
4342
|
-
Object.assign(this.meta, data.meta);
|
|
4458
|
+
this.setResult(data);
|
|
4343
4459
|
}
|
|
4344
|
-
data.result.forEach((item) => this.products.push(item));
|
|
4345
4460
|
if (this.#fulfillFetching) {
|
|
4346
4461
|
this.#fulfillFetching();
|
|
4347
4462
|
}
|
|
4348
4463
|
}
|
|
4349
4464
|
}
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
let { term, searchEngine } = props;
|
|
4354
|
-
if (props.ssrError && false) {
|
|
4355
|
-
console.error(new Error(`SSR search error: ${props.ssrError}`));
|
|
4356
|
-
if (window.location.pathname.startsWith("/s/")) {
|
|
4357
|
-
window.location.href = `/s?q=${encodeURIComponent(term || "")}`;
|
|
4465
|
+
setResult(data) {
|
|
4466
|
+
if (data.meta) {
|
|
4467
|
+
Object.assign(this.meta, data.meta);
|
|
4358
4468
|
}
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
searchEngine = new SearchEngine({ debounce: 50 });
|
|
4363
|
-
if (term === void 0 && false) {
|
|
4364
|
-
term = new URLSearchParams(window.location.search).get("q") || null;
|
|
4469
|
+
if (data.result) {
|
|
4470
|
+
this.products.splice(0);
|
|
4471
|
+
data.result.forEach((item) => this.products.push(item));
|
|
4365
4472
|
}
|
|
4366
|
-
if (
|
|
4367
|
-
|
|
4473
|
+
if (data.meta && data.result) {
|
|
4474
|
+
this.#wasFetched.value = true;
|
|
4368
4475
|
}
|
|
4369
4476
|
}
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
searchEngine
|
|
4477
|
+
}
|
|
4478
|
+
|
|
4479
|
+
const useSearchActiveFilters = ({ searchEngine, fixedParams }) => {
|
|
4480
|
+
const activeFilters = computed(() => {
|
|
4481
|
+
const filters = {};
|
|
4482
|
+
Object.keys(searchEngine.params).forEach((param) => {
|
|
4483
|
+
if (fixedParams?.[param])
|
|
4484
|
+
return;
|
|
4485
|
+
const val = searchEngine.params[param];
|
|
4486
|
+
if (val === void 0)
|
|
4487
|
+
return;
|
|
4488
|
+
switch (param) {
|
|
4489
|
+
case "sort":
|
|
4490
|
+
case "term":
|
|
4491
|
+
case "limit":
|
|
4492
|
+
case "offset":
|
|
4493
|
+
case "count":
|
|
4494
|
+
case "buckets":
|
|
4495
|
+
case "fields":
|
|
4496
|
+
return;
|
|
4497
|
+
}
|
|
4498
|
+
filters[param] = val;
|
|
4499
|
+
});
|
|
4500
|
+
return filters;
|
|
4376
4501
|
});
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4502
|
+
const filtersCount = computed(() => {
|
|
4503
|
+
const paramKeys = Object.keys(activeFilters.value);
|
|
4504
|
+
const fields = [];
|
|
4505
|
+
paramKeys.forEach((key) => {
|
|
4506
|
+
const field = key.replace(/[^\w.]/g, "");
|
|
4507
|
+
if (field === "specs" && Array.isArray(activeFilters.value[key])) {
|
|
4508
|
+
activeFilters.value[key].forEach((specAndVal) => {
|
|
4509
|
+
const [spec] = specAndVal.split(":");
|
|
4510
|
+
const specField = `specs.${spec}`;
|
|
4511
|
+
if (!fields.includes(specField)) {
|
|
4512
|
+
fields.push(specField);
|
|
4513
|
+
}
|
|
4514
|
+
});
|
|
4515
|
+
return;
|
|
4516
|
+
}
|
|
4517
|
+
if (!fields.includes(field)) {
|
|
4518
|
+
fields.push(field);
|
|
4519
|
+
}
|
|
4520
|
+
});
|
|
4521
|
+
return fields.length;
|
|
4522
|
+
});
|
|
4523
|
+
return { activeFilters, filtersCount };
|
|
4383
4524
|
};
|
|
4384
|
-
|
|
4385
|
-
const
|
|
4386
|
-
const
|
|
4525
|
+
const useSearchFilters = (props) => {
|
|
4526
|
+
const { searchEngine, fixedParams } = props;
|
|
4527
|
+
const resultMeta = computed(() => searchEngine.meta);
|
|
4528
|
+
const resultBuckets = computed(() => searchEngine.meta.buckets);
|
|
4529
|
+
const { activeFilters, filtersCount } = useSearchActiveFilters(props);
|
|
4530
|
+
watch(searchEngine.params, () => {
|
|
4531
|
+
searchEngine.fetch();
|
|
4532
|
+
});
|
|
4533
|
+
let _lastParamChanged = null;
|
|
4534
|
+
const clearFilters = () => {
|
|
4535
|
+
Object.keys(searchEngine.params).forEach((param) => {
|
|
4536
|
+
if (fixedParams?.[param])
|
|
4537
|
+
return;
|
|
4538
|
+
delete searchEngine.params[param];
|
|
4539
|
+
});
|
|
4540
|
+
_lastParamChanged = null;
|
|
4541
|
+
};
|
|
4542
|
+
const getPriceRangeKey = ({ min, max }) => {
|
|
4543
|
+
return `${min || null}/${max || null}`;
|
|
4544
|
+
};
|
|
4545
|
+
const currentPriceRange = computed(() => {
|
|
4546
|
+
const { params } = searchEngine;
|
|
4547
|
+
return {
|
|
4548
|
+
min: Number(params["price>"]),
|
|
4549
|
+
max: Number(params["price<"])
|
|
4550
|
+
};
|
|
4551
|
+
});
|
|
4552
|
+
const priceRanges = ref([]);
|
|
4553
|
+
const _updatePriceRanges = useDebounceFn(() => {
|
|
4554
|
+
priceRanges.value.splice(0);
|
|
4555
|
+
resultBuckets.value?.prices?.forEach((priceRange) => {
|
|
4556
|
+
if (priceRange.min)
|
|
4557
|
+
priceRange.min = Math.round(priceRange.min * 100) / 100;
|
|
4558
|
+
if (priceRange.max)
|
|
4559
|
+
priceRange.max = Math.round(priceRange.max * 100) / 100;
|
|
4560
|
+
priceRanges.value.push({
|
|
4561
|
+
range: priceRange,
|
|
4562
|
+
key: getPriceRangeKey(priceRange)
|
|
4563
|
+
});
|
|
4564
|
+
});
|
|
4565
|
+
if (!Number.isNaN(currentPriceRange.value.min)) {
|
|
4566
|
+
const checkedPriceRange = priceRanges.value.find(({ range }) => {
|
|
4567
|
+
return range.min === currentPriceRange.value.min && range.max === currentPriceRange.value.max;
|
|
4568
|
+
});
|
|
4569
|
+
if (!checkedPriceRange) {
|
|
4570
|
+
priceRanges.value.unshift({
|
|
4571
|
+
range: {
|
|
4572
|
+
...currentPriceRange.value,
|
|
4573
|
+
count: resultMeta.value.count || 0,
|
|
4574
|
+
avg: null
|
|
4575
|
+
},
|
|
4576
|
+
key: getPriceRangeKey(currentPriceRange.value)
|
|
4577
|
+
});
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
}, 50);
|
|
4581
|
+
_updatePriceRanges();
|
|
4582
|
+
const priceRangeKey = ref(getPriceRangeKey(currentPriceRange.value));
|
|
4583
|
+
watch(priceRangeKey, () => {
|
|
4584
|
+
_lastParamChanged = "price";
|
|
4585
|
+
const priceRange = priceRanges.value.find(({ range }) => {
|
|
4586
|
+
return getPriceRangeKey(range) === priceRangeKey.value;
|
|
4587
|
+
});
|
|
4588
|
+
if (priceRange) {
|
|
4589
|
+
const { min, max } = priceRange.range;
|
|
4590
|
+
if (min) {
|
|
4591
|
+
searchEngine.params["price>"] = min;
|
|
4592
|
+
} else {
|
|
4593
|
+
delete searchEngine.params["price>"];
|
|
4594
|
+
}
|
|
4595
|
+
if (max) {
|
|
4596
|
+
searchEngine.params["price<"] = max;
|
|
4597
|
+
} else {
|
|
4598
|
+
delete searchEngine.params["price<"];
|
|
4599
|
+
}
|
|
4600
|
+
return;
|
|
4601
|
+
}
|
|
4602
|
+
delete searchEngine.params["price>"];
|
|
4603
|
+
delete searchEngine.params["price<"];
|
|
4604
|
+
});
|
|
4605
|
+
const getPriceRangeLabel = ({ min, max }) => {
|
|
4606
|
+
if (min && max) {
|
|
4607
|
+
if (max === min) {
|
|
4608
|
+
return formatMoney(max);
|
|
4609
|
+
}
|
|
4610
|
+
return `${formatMoney(min)} ${i19upTo.toLowerCase()} ${formatMoney(max)}`;
|
|
4611
|
+
}
|
|
4612
|
+
if (!min && max) {
|
|
4613
|
+
return `${i19upTo} ${formatMoney(max)}`;
|
|
4614
|
+
}
|
|
4615
|
+
return `${i19aboveOf} ${formatMoney(min || 0)}`;
|
|
4616
|
+
};
|
|
4617
|
+
const filterOptions = ref([]);
|
|
4618
|
+
const _updateFilterOptions = useDebounceFn(() => {
|
|
4619
|
+
for (let i = 0; i < filterOptions.value.length; i++) {
|
|
4620
|
+
const { field } = filterOptions.value[i];
|
|
4621
|
+
if (field !== _lastParamChanged) {
|
|
4622
|
+
filterOptions.value.splice(i, 1);
|
|
4623
|
+
i -= 1;
|
|
4624
|
+
}
|
|
4625
|
+
}
|
|
4626
|
+
const buckets = resultBuckets.value;
|
|
4627
|
+
if (buckets) {
|
|
4628
|
+
[["brands", i19brands], ["categories", i19categories]].forEach(([resource, title]) => {
|
|
4629
|
+
const field = `${resource}.name`;
|
|
4630
|
+
if (buckets[field] && _lastParamChanged !== field) {
|
|
4631
|
+
filterOptions.value.push({
|
|
4632
|
+
title,
|
|
4633
|
+
options: buckets[field],
|
|
4634
|
+
field
|
|
4635
|
+
});
|
|
4636
|
+
}
|
|
4637
|
+
});
|
|
4638
|
+
if (buckets.specs) {
|
|
4639
|
+
const { grids } = globalThis.$storefront.data;
|
|
4640
|
+
Object.keys(buckets.specs).forEach((specAndVal) => {
|
|
4641
|
+
const [spec, value] = specAndVal.split(":");
|
|
4642
|
+
if (value) {
|
|
4643
|
+
const field = `specs.${spec}`;
|
|
4644
|
+
if (_lastParamChanged === field)
|
|
4645
|
+
return;
|
|
4646
|
+
const title = gridTitle(spec, grids || []);
|
|
4647
|
+
let filterOption = filterOptions.value.find((_filterOption) => {
|
|
4648
|
+
return _filterOption.field === field;
|
|
4649
|
+
});
|
|
4650
|
+
if (!filterOption) {
|
|
4651
|
+
filterOption = { title, options: {}, field };
|
|
4652
|
+
filterOptions.value.push(filterOption);
|
|
4653
|
+
}
|
|
4654
|
+
filterOption.options[value] = buckets.specs[specAndVal];
|
|
4655
|
+
}
|
|
4656
|
+
});
|
|
4657
|
+
}
|
|
4658
|
+
}
|
|
4659
|
+
}, 50);
|
|
4660
|
+
_updateFilterOptions();
|
|
4661
|
+
const parseSpecsField = (field, value) => {
|
|
4662
|
+
const [, spec] = field.split(".");
|
|
4663
|
+
return ["specs,", `${spec}:${value}`];
|
|
4664
|
+
};
|
|
4665
|
+
const checkFilterOption = (field, value) => {
|
|
4666
|
+
if (field.startsWith("specs.")) {
|
|
4667
|
+
[field, value] = parseSpecsField(field, value);
|
|
4668
|
+
}
|
|
4669
|
+
const fieldParams = activeFilters.value[field];
|
|
4670
|
+
if (fieldParams === value)
|
|
4671
|
+
return true;
|
|
4672
|
+
if (Array.isArray(fieldParams) && fieldParams.includes(value))
|
|
4673
|
+
return true;
|
|
4674
|
+
return false;
|
|
4675
|
+
};
|
|
4676
|
+
const toggleFilterOption = (field, value) => {
|
|
4677
|
+
_lastParamChanged = field;
|
|
4678
|
+
console.log({ _lastParamChanged });
|
|
4679
|
+
if (field.startsWith("specs.")) {
|
|
4680
|
+
[field, value] = parseSpecsField(field, value);
|
|
4681
|
+
}
|
|
4682
|
+
const isToActivate = !checkFilterOption(field, value);
|
|
4683
|
+
let fieldParams = searchEngine.params[field];
|
|
4684
|
+
if (!Array.isArray(fieldParams)) {
|
|
4685
|
+
fieldParams = [];
|
|
4686
|
+
searchEngine.params[field] = fieldParams;
|
|
4687
|
+
}
|
|
4688
|
+
if (isToActivate) {
|
|
4689
|
+
fieldParams.push(value);
|
|
4690
|
+
} else {
|
|
4691
|
+
for (let i = 0; i < fieldParams.length; i++) {
|
|
4692
|
+
if (fieldParams[i] === value) {
|
|
4693
|
+
fieldParams.splice(i, 1);
|
|
4694
|
+
break;
|
|
4695
|
+
}
|
|
4696
|
+
}
|
|
4697
|
+
}
|
|
4698
|
+
};
|
|
4699
|
+
watch(resultBuckets, () => {
|
|
4700
|
+
if (_lastParamChanged !== "price") {
|
|
4701
|
+
_updatePriceRanges();
|
|
4702
|
+
}
|
|
4703
|
+
_updateFilterOptions();
|
|
4704
|
+
});
|
|
4705
|
+
return {
|
|
4706
|
+
resultMeta,
|
|
4707
|
+
resultBuckets,
|
|
4708
|
+
activeFilters,
|
|
4709
|
+
filtersCount,
|
|
4710
|
+
clearFilters,
|
|
4711
|
+
getPriceRangeKey,
|
|
4712
|
+
priceRanges,
|
|
4713
|
+
priceRangeKey,
|
|
4714
|
+
getPriceRangeLabel,
|
|
4715
|
+
filterOptions,
|
|
4716
|
+
checkFilterOption,
|
|
4717
|
+
toggleFilterOption
|
|
4718
|
+
};
|
|
4719
|
+
};
|
|
4720
|
+
|
|
4721
|
+
const useSearchShowcase = (props) => {
|
|
4722
|
+
let { term } = props;
|
|
4723
|
+
const canUseUrlParams = props.canUseUrlParams !== false;
|
|
4724
|
+
const urlParams = canUseUrlParams ? useUrlSearchParams("history") : null;
|
|
4725
|
+
if (props.ssrError && false) {
|
|
4726
|
+
console.error(new Error(`SSR search error: ${props.ssrError}`));
|
|
4727
|
+
if (window.location.pathname.startsWith("/s/")) {
|
|
4728
|
+
window.location.href = `/s?q=${encodeURIComponent(term || "")}`;
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
const products = shallowReactive(props.products || []);
|
|
4732
|
+
const searchEngine = new SearchEngine({ debounce: 50 });
|
|
4733
|
+
if (term === void 0 && false) {
|
|
4734
|
+
term = new URLSearchParams(window.location.search).get("q") || null;
|
|
4735
|
+
}
|
|
4736
|
+
if (term !== void 0) {
|
|
4737
|
+
searchEngine.term.value = term;
|
|
4738
|
+
}
|
|
4739
|
+
Object.assign(searchEngine.params, props.fixedParams);
|
|
4740
|
+
if (urlParams) {
|
|
4741
|
+
Object.keys(urlParams).forEach((param) => {
|
|
4742
|
+
if (param === "sort") {
|
|
4743
|
+
searchEngine.params.sort = urlParams.sort;
|
|
4744
|
+
return;
|
|
4745
|
+
}
|
|
4746
|
+
if (param === "p") {
|
|
4747
|
+
const pageNumber = parseInt(String(urlParams.p), 10);
|
|
4748
|
+
if (pageNumber >= 1)
|
|
4749
|
+
searchEngine.pageNumber.value = pageNumber;
|
|
4750
|
+
return;
|
|
4751
|
+
}
|
|
4752
|
+
if (param.startsWith("f\\")) {
|
|
4753
|
+
const field = param.substring(2);
|
|
4754
|
+
searchEngine.params[field] = urlParams[param];
|
|
4755
|
+
}
|
|
4756
|
+
});
|
|
4757
|
+
}
|
|
4758
|
+
if (!searchEngine.wasFetched.value) {
|
|
4759
|
+
if (props.products || props.resultMeta) {
|
|
4760
|
+
searchEngine.setResult({
|
|
4761
|
+
result: props.products,
|
|
4762
|
+
meta: props.resultMeta
|
|
4763
|
+
});
|
|
4764
|
+
}
|
|
4765
|
+
if (!props.products) {
|
|
4766
|
+
searchEngine.fetch().catch(console.error);
|
|
4767
|
+
}
|
|
4768
|
+
}
|
|
4769
|
+
searchEngine.isWithCount.value = true;
|
|
4770
|
+
searchEngine.isWithBuckets.value = true;
|
|
4771
|
+
const resultMeta = ref({
|
|
4772
|
+
count: 0,
|
|
4773
|
+
...props.resultMeta || searchEngine.meta
|
|
4774
|
+
});
|
|
4775
|
+
watch(searchEngine.products, () => {
|
|
4776
|
+
products.splice(0);
|
|
4777
|
+
searchEngine.products.forEach((item) => products.push(item));
|
|
4778
|
+
resultMeta.value = {
|
|
4779
|
+
count: 0,
|
|
4780
|
+
...searchEngine.meta
|
|
4781
|
+
};
|
|
4782
|
+
});
|
|
4783
|
+
const totalPages = computed(() => {
|
|
4784
|
+
const { count } = searchEngine.meta;
|
|
4785
|
+
if (!count || products.length < 2)
|
|
4786
|
+
return 1;
|
|
4787
|
+
return Math.ceil(count / searchEngine.pageSize.value);
|
|
4788
|
+
});
|
|
4789
|
+
watch(searchEngine.pageNumber, (pageNumber) => {
|
|
4790
|
+
if (urlParams) {
|
|
4791
|
+
urlParams.p = `${pageNumber}`;
|
|
4792
|
+
}
|
|
4793
|
+
searchEngine.fetch();
|
|
4794
|
+
});
|
|
4795
|
+
const startWatchingFetch = () => {
|
|
4796
|
+
watch(searchEngine.isFetching, (isFetching) => {
|
|
4797
|
+
const el = props.showcase?.value;
|
|
4798
|
+
if (!isFetching && el) {
|
|
4799
|
+
setTimeout(() => {
|
|
4800
|
+
scrollToEl(el, isScreenLg ? -25 : 0);
|
|
4801
|
+
}, 50);
|
|
4802
|
+
}
|
|
4803
|
+
});
|
|
4804
|
+
};
|
|
4805
|
+
if (searchEngine.wasFetched.value) {
|
|
4806
|
+
startWatchingFetch();
|
|
4807
|
+
} else {
|
|
4808
|
+
watchOnce(searchEngine.wasFetched, startWatchingFetch);
|
|
4809
|
+
}
|
|
4810
|
+
const { activeFilters, filtersCount } = useSearchActiveFilters({
|
|
4811
|
+
searchEngine,
|
|
4812
|
+
fixedParams: props.fixedParams
|
|
4813
|
+
});
|
|
4814
|
+
if (urlParams) {
|
|
4815
|
+
watch(activeFilters, (params) => {
|
|
4816
|
+
if (urlParams) {
|
|
4817
|
+
Object.keys(urlParams).forEach((param) => {
|
|
4818
|
+
if (param.startsWith("f\\"))
|
|
4819
|
+
delete urlParams[param];
|
|
4820
|
+
});
|
|
4821
|
+
}
|
|
4822
|
+
Object.keys(params).forEach((param) => {
|
|
4823
|
+
const val = params[param];
|
|
4824
|
+
if (typeof val === "string" || typeof val === "number") {
|
|
4825
|
+
urlParams[`f\\${param}`] = `${val}`;
|
|
4826
|
+
return;
|
|
4827
|
+
}
|
|
4828
|
+
if (Array.isArray(val) && typeof val[0] === "string") {
|
|
4829
|
+
urlParams[`f\\${param}`] = val;
|
|
4830
|
+
}
|
|
4831
|
+
});
|
|
4832
|
+
});
|
|
4833
|
+
}
|
|
4834
|
+
const sortOptions = [
|
|
4835
|
+
{
|
|
4836
|
+
value: null,
|
|
4837
|
+
label: i19relevance
|
|
4838
|
+
},
|
|
4839
|
+
{
|
|
4840
|
+
value: "-sales",
|
|
4841
|
+
label: i19sales
|
|
4842
|
+
},
|
|
4843
|
+
{
|
|
4844
|
+
value: "price",
|
|
4845
|
+
label: i19lowestPrice
|
|
4846
|
+
},
|
|
4847
|
+
{
|
|
4848
|
+
value: "-price",
|
|
4849
|
+
label: i19highestPrice
|
|
4850
|
+
},
|
|
4851
|
+
{
|
|
4852
|
+
value: "-price_discount",
|
|
4853
|
+
label: i19discount
|
|
4854
|
+
},
|
|
4855
|
+
{
|
|
4856
|
+
value: "-created_at",
|
|
4857
|
+
label: i19releases
|
|
4858
|
+
},
|
|
4859
|
+
{
|
|
4860
|
+
value: "name",
|
|
4861
|
+
label: i19name
|
|
4862
|
+
}
|
|
4863
|
+
];
|
|
4864
|
+
const sortOption = ref(null);
|
|
4865
|
+
watch(sortOption, () => {
|
|
4866
|
+
searchEngine.params.sort = sortOption.value || void 0;
|
|
4867
|
+
searchEngine.fetch();
|
|
4868
|
+
});
|
|
4869
|
+
if (urlParams) {
|
|
4870
|
+
if (typeof urlParams.sort === "string" && urlParams.sort) {
|
|
4871
|
+
sortOption.value = urlParams.sort;
|
|
4872
|
+
}
|
|
4873
|
+
watch(searchEngine.params, (params) => {
|
|
4874
|
+
delete urlParams.sort;
|
|
4875
|
+
if (params.sort)
|
|
4876
|
+
urlParams.sort = String(params.sort);
|
|
4877
|
+
});
|
|
4878
|
+
}
|
|
4879
|
+
return {
|
|
4880
|
+
searchEngine,
|
|
4881
|
+
fetching: searchEngine.fetching.value,
|
|
4882
|
+
isFetching: searchEngine.isFetching,
|
|
4883
|
+
products,
|
|
4884
|
+
resultMeta,
|
|
4885
|
+
totalPages,
|
|
4886
|
+
activeFilters,
|
|
4887
|
+
filtersCount,
|
|
4888
|
+
sortOptions,
|
|
4889
|
+
sortOption
|
|
4890
|
+
};
|
|
4891
|
+
};
|
|
4892
|
+
|
|
4893
|
+
const now = Date.now();
|
|
4894
|
+
const parseBanners = (banners) => {
|
|
4387
4895
|
const validBanners = [];
|
|
4388
4896
|
banners.forEach(({
|
|
4389
4897
|
startsAt,
|
|
@@ -4470,13 +4978,38 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
|
|
|
4470
4978
|
};
|
|
4471
4979
|
return;
|
|
4472
4980
|
}
|
|
4473
|
-
if (type === "search-
|
|
4981
|
+
if (type === "search-showcase" || type === "context-showcase") {
|
|
4474
4982
|
const props = { ...sectionContent };
|
|
4475
|
-
if (
|
|
4983
|
+
if (type === "context-showcase") {
|
|
4984
|
+
if (routeContext.fetchingApiContext) {
|
|
4985
|
+
await routeContext.fetchingApiContext;
|
|
4986
|
+
}
|
|
4987
|
+
const { resource, doc } = routeContext.apiContext;
|
|
4988
|
+
if (resource === "categories" || resource === "brands") {
|
|
4989
|
+
const params = { [`${resource}.name`]: [doc.name] };
|
|
4990
|
+
if (resource === "categories") {
|
|
4991
|
+
const { value: categories } = await useSharedData({ field: "categories" });
|
|
4992
|
+
categories?.forEach(({ name, parent }) => {
|
|
4993
|
+
if (name && parent && (parent._id === doc._id || parent.slug === doc.slug)) {
|
|
4994
|
+
params[`categories.name`].push(name);
|
|
4995
|
+
}
|
|
4996
|
+
});
|
|
4997
|
+
}
|
|
4998
|
+
props.fixedParams = params;
|
|
4999
|
+
} else if (resource === "collections") {
|
|
5000
|
+
const { products } = doc;
|
|
5001
|
+
if (products?.length) {
|
|
5002
|
+
props.fixedParams = { _id: products };
|
|
5003
|
+
}
|
|
5004
|
+
}
|
|
5005
|
+
} else if (routeContext.searchPageTerm !== void 0) {
|
|
4476
5006
|
props.term = routeContext.searchPageTerm || null;
|
|
4477
|
-
|
|
5007
|
+
}
|
|
5008
|
+
if (props.term !== void 0 || props.fixedParams) {
|
|
5009
|
+
const { searchEngine, fetching } = useSearchShowcase(props);
|
|
4478
5010
|
await fetching;
|
|
4479
5011
|
props.products = searchEngine.products;
|
|
5012
|
+
props.resultMeta = searchEngine.meta;
|
|
4480
5013
|
props.ssrError = searchEngine.fetchError.value?.message;
|
|
4481
5014
|
}
|
|
4482
5015
|
sections[index] = { type, props };
|
|
@@ -4496,12 +5029,20 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
|
|
|
4496
5029
|
case "product-details":
|
|
4497
5030
|
case "related-products":
|
|
4498
5031
|
case "doc-description":
|
|
5032
|
+
case "doc-banners":
|
|
4499
5033
|
case "product-specifications":
|
|
5034
|
+
case "page-title":
|
|
4500
5035
|
sections[index] = {
|
|
4501
5036
|
type,
|
|
4502
5037
|
props: sectionContent
|
|
4503
5038
|
};
|
|
4504
5039
|
return;
|
|
5040
|
+
case "custom-html":
|
|
5041
|
+
sections[index] = {
|
|
5042
|
+
type,
|
|
5043
|
+
props: { html: sectionContent.html || "" }
|
|
5044
|
+
};
|
|
5045
|
+
return;
|
|
4505
5046
|
}
|
|
4506
5047
|
if (typeof handleCustomSection === "function") {
|
|
4507
5048
|
const { props } = await handleCustomSection(
|
|
@@ -4572,7 +5113,7 @@ const useBanner = (props) => {
|
|
|
4572
5113
|
};
|
|
4573
5114
|
};
|
|
4574
5115
|
|
|
4575
|
-
const _sfc_main$
|
|
5116
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
4576
5117
|
__name: "Banner",
|
|
4577
5118
|
props: {
|
|
4578
5119
|
img: {},
|
|
@@ -4599,7 +5140,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
4599
5140
|
return __returned__;
|
|
4600
5141
|
}
|
|
4601
5142
|
});
|
|
4602
|
-
function _sfc_ssrRender$
|
|
5143
|
+
function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
4603
5144
|
const _component_ALink = resolveComponent("ALink");
|
|
4604
5145
|
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
4605
5146
|
class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 sm:grid-cols-2 items-center" : null]
|
|
@@ -4667,13 +5208,13 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4667
5208
|
}
|
|
4668
5209
|
_push(`</div>`);
|
|
4669
5210
|
}
|
|
4670
|
-
const _sfc_setup$
|
|
4671
|
-
_sfc_main$
|
|
5211
|
+
const _sfc_setup$h = _sfc_main$h.setup;
|
|
5212
|
+
_sfc_main$h.setup = (props, ctx) => {
|
|
4672
5213
|
const ssrContext = useSSRContext();
|
|
4673
5214
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Banner.vue");
|
|
4674
|
-
return _sfc_setup$
|
|
5215
|
+
return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
|
|
4675
5216
|
};
|
|
4676
|
-
const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5217
|
+
const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
|
|
4677
5218
|
|
|
4678
5219
|
const $$Astro$5 = createAstro("https://demo.ecomplus.app");
|
|
4679
5220
|
const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
|
|
@@ -4681,7 +5222,7 @@ const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4681
5222
|
Astro2.self = $$BannersGrid;
|
|
4682
5223
|
const { banners } = Astro2.props;
|
|
4683
5224
|
return renderTemplate`${maybeRenderHead()}<section class="ui-section">
|
|
4684
|
-
<ul class="flex flex-wrap lg:flex-nowrap
|
|
5225
|
+
<ul class="flex flex-wrap gap-4 lg:flex-nowrap">
|
|
4685
5226
|
${banners.map((banner) => renderTemplate`<li class="lg:flex-1 [&_img]:w-full [&_img]:object-cover">
|
|
4686
5227
|
${renderComponent($$result, "Banner", Banner, { ...banner }, { "picture": ($$result2) => renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { ...banner, "slot": "picture" })}` })}
|
|
4687
5228
|
</li>`)}
|
|
@@ -4968,7 +5509,7 @@ const usePrices = (props) => {
|
|
|
4968
5509
|
};
|
|
4969
5510
|
};
|
|
4970
5511
|
|
|
4971
|
-
const _sfc_main$
|
|
5512
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
4972
5513
|
__name: "Prices",
|
|
4973
5514
|
props: {
|
|
4974
5515
|
isBig: { type: Boolean },
|
|
@@ -5003,7 +5544,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
5003
5544
|
return __returned__;
|
|
5004
5545
|
}
|
|
5005
5546
|
});
|
|
5006
|
-
function _sfc_ssrRender$
|
|
5547
|
+
function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5007
5548
|
const _component_Fade = resolveComponent("Fade");
|
|
5008
5549
|
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
5009
5550
|
class: ["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]", $props.isBig ? "text-lg" : null]
|
|
@@ -5133,15 +5674,15 @@ function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
5133
5674
|
}, _parent));
|
|
5134
5675
|
_push(`</div>`);
|
|
5135
5676
|
}
|
|
5136
|
-
const _sfc_setup$
|
|
5137
|
-
_sfc_main$
|
|
5677
|
+
const _sfc_setup$g = _sfc_main$g.setup;
|
|
5678
|
+
_sfc_main$g.setup = (props, ctx) => {
|
|
5138
5679
|
const ssrContext = useSSRContext();
|
|
5139
5680
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
|
|
5140
|
-
return _sfc_setup$
|
|
5681
|
+
return _sfc_setup$g ? _sfc_setup$g(props, ctx) : void 0;
|
|
5141
5682
|
};
|
|
5142
|
-
const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5683
|
+
const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["ssrRender", _sfc_ssrRender$g]]);
|
|
5143
5684
|
|
|
5144
|
-
const _sfc_main$
|
|
5685
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
5145
5686
|
__name: "ProductCard",
|
|
5146
5687
|
props: {
|
|
5147
5688
|
product: {},
|
|
@@ -5176,7 +5717,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
5176
5717
|
return __returned__;
|
|
5177
5718
|
}
|
|
5178
5719
|
});
|
|
5179
|
-
function _sfc_ssrRender$
|
|
5720
|
+
function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5180
5721
|
const _component_ALink = resolveComponent("ALink");
|
|
5181
5722
|
const _component_AImg = resolveComponent("AImg");
|
|
5182
5723
|
_push(`<article${ssrRenderAttrs(mergeProps({
|
|
@@ -5319,17 +5860,18 @@ function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
5319
5860
|
}, _parent));
|
|
5320
5861
|
_push(`</article>`);
|
|
5321
5862
|
}
|
|
5322
|
-
const _sfc_setup$
|
|
5323
|
-
_sfc_main$
|
|
5863
|
+
const _sfc_setup$f = _sfc_main$f.setup;
|
|
5864
|
+
_sfc_main$f.setup = (props, ctx) => {
|
|
5324
5865
|
const ssrContext = useSSRContext();
|
|
5325
5866
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductCard.vue");
|
|
5326
|
-
return _sfc_setup$
|
|
5867
|
+
return _sfc_setup$f ? _sfc_setup$f(props, ctx) : void 0;
|
|
5327
5868
|
};
|
|
5328
|
-
const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5869
|
+
const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["ssrRender", _sfc_ssrRender$f]]);
|
|
5329
5870
|
|
|
5330
|
-
const _sfc_main$
|
|
5871
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
5331
5872
|
__name: "ProductShelf",
|
|
5332
5873
|
props: {
|
|
5874
|
+
isGrid: { type: Boolean },
|
|
5333
5875
|
collectionId: {},
|
|
5334
5876
|
searchQuery: {},
|
|
5335
5877
|
sort: {},
|
|
@@ -5338,7 +5880,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
5338
5880
|
isShuffle: { type: Boolean },
|
|
5339
5881
|
limit: {},
|
|
5340
5882
|
page: {},
|
|
5341
|
-
products: {}
|
|
5883
|
+
products: {},
|
|
5884
|
+
isRelatedProducts: { type: Boolean }
|
|
5342
5885
|
},
|
|
5343
5886
|
async setup(__props, { expose: __expose }) {
|
|
5344
5887
|
__expose();
|
|
@@ -5363,13 +5906,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
5363
5906
|
return __returned__;
|
|
5364
5907
|
}
|
|
5365
5908
|
});
|
|
5366
|
-
function _sfc_ssrRender$
|
|
5909
|
+
function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5367
5910
|
const _component_ALink = resolveComponent("ALink");
|
|
5368
|
-
const _component_Carousel = resolveComponent("Carousel");
|
|
5369
5911
|
const _component_CarouselControl = resolveComponent("CarouselControl");
|
|
5370
5912
|
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
|
|
5371
5913
|
if ($setup.title) {
|
|
5372
|
-
_push(`<div class="mx-auto mb-
|
|
5914
|
+
_push(`<div class="mx-auto mb-4 max-w-prose text-center"><h2 class="ui-text-brand text-3xl">`);
|
|
5373
5915
|
_push(ssrRenderComponent(_component_ALink, {
|
|
5374
5916
|
href: $setup.titleLink,
|
|
5375
5917
|
class: $setup.titleLink ? "ui-link" : "text-base-700"
|
|
@@ -5389,50 +5931,9 @@ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
5389
5931
|
} else {
|
|
5390
5932
|
_push(`<!---->`);
|
|
5391
5933
|
}
|
|
5392
|
-
_push(
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
_push2(ssrRenderComponent($setup["DefineCarouselControl"], null, {
|
|
5396
|
-
default: withCtx(({ isPrev }, _push3, _parent3, _scopeId2) => {
|
|
5397
|
-
if (_push3) {
|
|
5398
|
-
_push3(ssrRenderComponent(_component_CarouselControl, {
|
|
5399
|
-
style: $setup.products.length > 2 ? null : { display: "none" },
|
|
5400
|
-
class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
|
|
5401
|
-
"is-prev": isPrev
|
|
5402
|
-
}, null, _parent3, _scopeId2));
|
|
5403
|
-
} else {
|
|
5404
|
-
return [
|
|
5405
|
-
withDirectives(createVNode(_component_CarouselControl, {
|
|
5406
|
-
class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
|
|
5407
|
-
"is-prev": isPrev
|
|
5408
|
-
}, null, 8, ["class", "is-prev"]), [
|
|
5409
|
-
[vShow, $setup.products.length > 2]
|
|
5410
|
-
])
|
|
5411
|
-
];
|
|
5412
|
-
}
|
|
5413
|
-
}),
|
|
5414
|
-
_: 1
|
|
5415
|
-
}, _parent2, _scopeId));
|
|
5416
|
-
_push2(ssrRenderComponent($setup["ReuseCarouselControl"], { "is-prev": true }, null, _parent2, _scopeId));
|
|
5417
|
-
_push2(ssrRenderComponent($setup["ReuseCarouselControl"], null, null, _parent2, _scopeId));
|
|
5418
|
-
} else {
|
|
5419
|
-
return [
|
|
5420
|
-
createVNode($setup["DefineCarouselControl"], null, {
|
|
5421
|
-
default: withCtx(({ isPrev }) => [
|
|
5422
|
-
withDirectives(createVNode(_component_CarouselControl, {
|
|
5423
|
-
class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
|
|
5424
|
-
"is-prev": isPrev
|
|
5425
|
-
}, null, 8, ["class", "is-prev"]), [
|
|
5426
|
-
[vShow, $setup.products.length > 2]
|
|
5427
|
-
])
|
|
5428
|
-
]),
|
|
5429
|
-
_: 1
|
|
5430
|
-
}),
|
|
5431
|
-
createVNode($setup["ReuseCarouselControl"], { "is-prev": true }),
|
|
5432
|
-
createVNode($setup["ReuseCarouselControl"])
|
|
5433
|
-
];
|
|
5434
|
-
}
|
|
5435
|
-
}),
|
|
5934
|
+
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.isGrid ? "ul" : "Carousel"), {
|
|
5935
|
+
class: ["group/shelf", $props.isGrid && "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4"]
|
|
5936
|
+
}, createSlots({
|
|
5436
5937
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5437
5938
|
if (_push2) {
|
|
5438
5939
|
_push2(`<!--[-->`);
|
|
@@ -5461,17 +5962,66 @@ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
5461
5962
|
];
|
|
5462
5963
|
}
|
|
5463
5964
|
}),
|
|
5464
|
-
_:
|
|
5465
|
-
},
|
|
5965
|
+
_: 2
|
|
5966
|
+
}, [
|
|
5967
|
+
!$props.isGrid ? {
|
|
5968
|
+
name: "controls",
|
|
5969
|
+
fn: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5970
|
+
if (_push2) {
|
|
5971
|
+
_push2(ssrRenderComponent($setup["DefineCarouselControl"], null, {
|
|
5972
|
+
default: withCtx(({ isPrev }, _push3, _parent3, _scopeId2) => {
|
|
5973
|
+
if (_push3) {
|
|
5974
|
+
_push3(ssrRenderComponent(_component_CarouselControl, {
|
|
5975
|
+
style: $setup.products.length > 2 ? null : { display: "none" },
|
|
5976
|
+
class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
|
|
5977
|
+
"is-prev": isPrev
|
|
5978
|
+
}, null, _parent3, _scopeId2));
|
|
5979
|
+
} else {
|
|
5980
|
+
return [
|
|
5981
|
+
withDirectives(createVNode(_component_CarouselControl, {
|
|
5982
|
+
class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
|
|
5983
|
+
"is-prev": isPrev
|
|
5984
|
+
}, null, 8, ["class", "is-prev"]), [
|
|
5985
|
+
[vShow, $setup.products.length > 2]
|
|
5986
|
+
])
|
|
5987
|
+
];
|
|
5988
|
+
}
|
|
5989
|
+
}),
|
|
5990
|
+
_: 1
|
|
5991
|
+
}, _parent2, _scopeId));
|
|
5992
|
+
_push2(ssrRenderComponent($setup["ReuseCarouselControl"], { "is-prev": true }, null, _parent2, _scopeId));
|
|
5993
|
+
_push2(ssrRenderComponent($setup["ReuseCarouselControl"], null, null, _parent2, _scopeId));
|
|
5994
|
+
} else {
|
|
5995
|
+
return [
|
|
5996
|
+
createVNode($setup["DefineCarouselControl"], null, {
|
|
5997
|
+
default: withCtx(({ isPrev }) => [
|
|
5998
|
+
withDirectives(createVNode(_component_CarouselControl, {
|
|
5999
|
+
class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
|
|
6000
|
+
"is-prev": isPrev
|
|
6001
|
+
}, null, 8, ["class", "is-prev"]), [
|
|
6002
|
+
[vShow, $setup.products.length > 2]
|
|
6003
|
+
])
|
|
6004
|
+
]),
|
|
6005
|
+
_: 1
|
|
6006
|
+
}),
|
|
6007
|
+
createVNode($setup["ReuseCarouselControl"], { "is-prev": true }),
|
|
6008
|
+
createVNode($setup["ReuseCarouselControl"])
|
|
6009
|
+
];
|
|
6010
|
+
}
|
|
6011
|
+
}),
|
|
6012
|
+
key: "0"
|
|
6013
|
+
} : void 0
|
|
6014
|
+
])), _parent);
|
|
6015
|
+
ssrRenderSlot(_ctx.$slots, "append", {}, null, _push, _parent);
|
|
5466
6016
|
_push(`</section>`);
|
|
5467
6017
|
}
|
|
5468
|
-
const _sfc_setup$
|
|
5469
|
-
_sfc_main$
|
|
6018
|
+
const _sfc_setup$e = _sfc_main$e.setup;
|
|
6019
|
+
_sfc_main$e.setup = (props, ctx) => {
|
|
5470
6020
|
const ssrContext = useSSRContext();
|
|
5471
6021
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductShelf.vue");
|
|
5472
|
-
return _sfc_setup$
|
|
6022
|
+
return _sfc_setup$e ? _sfc_setup$e(props, ctx) : void 0;
|
|
5473
6023
|
};
|
|
5474
|
-
const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6024
|
+
const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["ssrRender", _sfc_ssrRender$e]]);
|
|
5475
6025
|
|
|
5476
6026
|
const useBreadcrumbs = async (props = {}) => {
|
|
5477
6027
|
const { settings, apiContext, data } = globalThis.$storefront;
|
|
@@ -5568,7 +6118,7 @@ const $$Breadcrumbs = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
5568
6118
|
</section>`}`;
|
|
5569
6119
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Breadcrumbs.astro", void 0);
|
|
5570
6120
|
|
|
5571
|
-
const _sfc_main$
|
|
6121
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
5572
6122
|
__name: "ContentClearfix",
|
|
5573
6123
|
props: {
|
|
5574
6124
|
html: {}
|
|
@@ -5582,18 +6132,18 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
5582
6132
|
return __returned__;
|
|
5583
6133
|
}
|
|
5584
6134
|
});
|
|
5585
|
-
function _sfc_ssrRender$
|
|
6135
|
+
function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5586
6136
|
_push(`<article${ssrRenderAttrs(mergeProps({ class: "prose !max-w-full overflow-x-auto" }, _attrs))}><div class="[&_iframe]:max-w-full [&_img]:max-w-full [&_table]:max-w-full">${$setup.parsedHTML}</div></article>`);
|
|
5587
6137
|
}
|
|
5588
|
-
const _sfc_setup$
|
|
5589
|
-
_sfc_main$
|
|
6138
|
+
const _sfc_setup$d = _sfc_main$d.setup;
|
|
6139
|
+
_sfc_main$d.setup = (props, ctx) => {
|
|
5590
6140
|
const ssrContext = useSSRContext();
|
|
5591
6141
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ContentClearfix.vue");
|
|
5592
|
-
return _sfc_setup$
|
|
6142
|
+
return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
|
|
5593
6143
|
};
|
|
5594
|
-
const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6144
|
+
const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
|
|
5595
6145
|
|
|
5596
|
-
const _sfc_main$
|
|
6146
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
5597
6147
|
__name: "Collapse",
|
|
5598
6148
|
props: {
|
|
5599
6149
|
title: {}
|
|
@@ -5605,20 +6155,20 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5605
6155
|
return __returned__;
|
|
5606
6156
|
}
|
|
5607
6157
|
});
|
|
5608
|
-
function _sfc_ssrRender$
|
|
5609
|
-
_push(`<details${ssrRenderAttrs(mergeProps({ class: "[&_i]:open
|
|
6158
|
+
function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
6159
|
+
_push(`<details${ssrRenderAttrs(mergeProps({ class: "group my-4 md:my-5 [&_i]:open:-rotate-90" }, _attrs))}><summary role="button" class="text-base-700 hover:text-base-800 [&>i]:hover:text-primary list-none text-2xl font-medium lowercase group-open:mb-3"><i class="i-chevron-right mr-1 rotate-90"></i><span>${ssrInterpolate($props.title)}</span></summary>`);
|
|
5610
6160
|
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
5611
6161
|
_push(`</details>`);
|
|
5612
6162
|
}
|
|
5613
|
-
const _sfc_setup$
|
|
5614
|
-
_sfc_main$
|
|
6163
|
+
const _sfc_setup$c = _sfc_main$c.setup;
|
|
6164
|
+
_sfc_main$c.setup = (props, ctx) => {
|
|
5615
6165
|
const ssrContext = useSSRContext();
|
|
5616
6166
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Collapse.vue");
|
|
5617
|
-
return _sfc_setup$
|
|
6167
|
+
return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
|
|
5618
6168
|
};
|
|
5619
|
-
const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6169
|
+
const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
|
|
5620
6170
|
|
|
5621
|
-
const _sfc_main$
|
|
6171
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
5622
6172
|
__name: "DocDescription",
|
|
5623
6173
|
props: {
|
|
5624
6174
|
apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
|
|
@@ -5633,7 +6183,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
5633
6183
|
return __returned__;
|
|
5634
6184
|
}
|
|
5635
6185
|
});
|
|
5636
|
-
function _sfc_ssrRender$
|
|
6186
|
+
function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5637
6187
|
if ($setup.html) {
|
|
5638
6188
|
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
|
|
5639
6189
|
_push(ssrRenderComponent($setup["Collapse"], {
|
|
@@ -5656,15 +6206,48 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
5656
6206
|
_push(`<!---->`);
|
|
5657
6207
|
}
|
|
5658
6208
|
}
|
|
5659
|
-
const _sfc_setup$
|
|
5660
|
-
_sfc_main$
|
|
6209
|
+
const _sfc_setup$b = _sfc_main$b.setup;
|
|
6210
|
+
_sfc_main$b.setup = (props, ctx) => {
|
|
5661
6211
|
const ssrContext = useSSRContext();
|
|
5662
6212
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/DocDescription.vue");
|
|
5663
|
-
return _sfc_setup$
|
|
6213
|
+
return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
|
|
5664
6214
|
};
|
|
5665
|
-
const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6215
|
+
const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
|
|
5666
6216
|
|
|
5667
|
-
const _sfc_main$
|
|
6217
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
6218
|
+
__name: "DocBanners",
|
|
6219
|
+
props: {
|
|
6220
|
+
apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
|
|
6221
|
+
title: {}
|
|
6222
|
+
},
|
|
6223
|
+
setup(__props, { expose: __expose }) {
|
|
6224
|
+
__expose();
|
|
6225
|
+
const props = __props;
|
|
6226
|
+
const pictures = computed(() => props.apiDoc.pictures || []);
|
|
6227
|
+
const __returned__ = { props, pictures };
|
|
6228
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
6229
|
+
return __returned__;
|
|
6230
|
+
}
|
|
6231
|
+
});
|
|
6232
|
+
function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
6233
|
+
const _component_AImg = resolveComponent("AImg");
|
|
6234
|
+
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><ul class="flex flex-wrap gap-4 lg:flex-nowrap"><!--[-->`);
|
|
6235
|
+
ssrRenderList($setup.pictures, (picture, i) => {
|
|
6236
|
+
_push(`<li class="lg:flex-1 [&_img]:w-full [&_img]:object-cover">`);
|
|
6237
|
+
_push(ssrRenderComponent(_component_AImg, { picture }, null, _parent));
|
|
6238
|
+
_push(`</li>`);
|
|
6239
|
+
});
|
|
6240
|
+
_push(`<!--]--></ul></section>`);
|
|
6241
|
+
}
|
|
6242
|
+
const _sfc_setup$a = _sfc_main$a.setup;
|
|
6243
|
+
_sfc_main$a.setup = (props, ctx) => {
|
|
6244
|
+
const ssrContext = useSSRContext();
|
|
6245
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/DocBanners.vue");
|
|
6246
|
+
return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
|
|
6247
|
+
};
|
|
6248
|
+
const DocBanners = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
|
|
6249
|
+
|
|
6250
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
5668
6251
|
__name: "CheckoutLink",
|
|
5669
6252
|
props: {
|
|
5670
6253
|
to: { default: "cart" },
|
|
@@ -5719,20 +6302,20 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
5719
6302
|
return __returned__;
|
|
5720
6303
|
}
|
|
5721
6304
|
});
|
|
5722
|
-
function _sfc_ssrRender$
|
|
6305
|
+
function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5723
6306
|
_push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
|
|
5724
6307
|
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
5725
6308
|
_push(`</a>`);
|
|
5726
6309
|
}
|
|
5727
|
-
const _sfc_setup$
|
|
5728
|
-
_sfc_main$
|
|
6310
|
+
const _sfc_setup$9 = _sfc_main$9.setup;
|
|
6311
|
+
_sfc_main$9.setup = (props, ctx) => {
|
|
5729
6312
|
const ssrContext = useSSRContext();
|
|
5730
6313
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CheckoutLink.vue");
|
|
5731
|
-
return _sfc_setup$
|
|
6314
|
+
return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
|
|
5732
6315
|
};
|
|
5733
|
-
const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6316
|
+
const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
|
|
5734
6317
|
|
|
5735
|
-
const _sfc_main$
|
|
6318
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
5736
6319
|
__name: "QuantitySelectorControl",
|
|
5737
6320
|
props: {
|
|
5738
6321
|
isMinus: { type: Boolean }
|
|
@@ -5749,7 +6332,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5749
6332
|
return __returned__;
|
|
5750
6333
|
}
|
|
5751
6334
|
});
|
|
5752
|
-
function _sfc_ssrRender$
|
|
6335
|
+
function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5753
6336
|
_push(`<button${ssrRenderAttrs(mergeProps({
|
|
5754
6337
|
type: "button",
|
|
5755
6338
|
class: "leading-12 enabled:text-primary enabled:hover:bg-primary-100/70 h-12 w-10 text-xl disabled:opacity-40",
|
|
@@ -5766,16 +6349,16 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
5766
6349
|
}, _push, _parent);
|
|
5767
6350
|
_push(`</button>`);
|
|
5768
6351
|
}
|
|
5769
|
-
const _sfc_setup$
|
|
5770
|
-
_sfc_main$
|
|
6352
|
+
const _sfc_setup$8 = _sfc_main$8.setup;
|
|
6353
|
+
_sfc_main$8.setup = (props, ctx) => {
|
|
5771
6354
|
const ssrContext = useSSRContext();
|
|
5772
6355
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelectorControl.vue");
|
|
5773
|
-
return _sfc_setup$
|
|
6356
|
+
return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
|
|
5774
6357
|
};
|
|
5775
|
-
const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6358
|
+
const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
|
|
5776
6359
|
|
|
5777
6360
|
const quantitySelectorKey = Symbol("quantitySelector");
|
|
5778
|
-
const _sfc_main$
|
|
6361
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
5779
6362
|
__name: "QuantitySelector",
|
|
5780
6363
|
props: {
|
|
5781
6364
|
modelValue: { default: 1 },
|
|
@@ -5824,7 +6407,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
5824
6407
|
return __returned__;
|
|
5825
6408
|
}
|
|
5826
6409
|
});
|
|
5827
|
-
function _sfc_ssrRender$
|
|
6410
|
+
function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5828
6411
|
_push(`<div${ssrRenderAttrs(mergeProps({ "data-quantity-selector": "" }, _attrs))}>`);
|
|
5829
6412
|
ssrRenderSlot(_ctx.$slots, "label", { inputId: $setup.inputId, value: $setup.value }, () => {
|
|
5830
6413
|
_push(`<label${ssrRenderAttr("for", $setup.inputId)} class="sr-only">${ssrInterpolate("Quantidade")}</label>`);
|
|
@@ -5861,15 +6444,15 @@ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
5861
6444
|
}, _push, _parent);
|
|
5862
6445
|
_push(`</div></div>`);
|
|
5863
6446
|
}
|
|
5864
|
-
const _sfc_setup$
|
|
5865
|
-
_sfc_main$
|
|
6447
|
+
const _sfc_setup$7 = _sfc_main$7.setup;
|
|
6448
|
+
_sfc_main$7.setup = (props, ctx) => {
|
|
5866
6449
|
const ssrContext = useSSRContext();
|
|
5867
6450
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelector.vue");
|
|
5868
|
-
return _sfc_setup$
|
|
6451
|
+
return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
|
|
5869
6452
|
};
|
|
5870
|
-
const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6453
|
+
const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
|
|
5871
6454
|
|
|
5872
|
-
const _sfc_main$
|
|
6455
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
5873
6456
|
__name: "ImagesGallery",
|
|
5874
6457
|
props: {
|
|
5875
6458
|
pictures: {}
|
|
@@ -5926,7 +6509,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
5926
6509
|
return __returned__;
|
|
5927
6510
|
}
|
|
5928
6511
|
});
|
|
5929
|
-
function _sfc_ssrRender$
|
|
6512
|
+
function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5930
6513
|
const _component_Carousel = resolveComponent("Carousel");
|
|
5931
6514
|
const _component_AImg = resolveComponent("AImg");
|
|
5932
6515
|
const _component_CarouselControl = resolveComponent("CarouselControl");
|
|
@@ -6106,18 +6689,17 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
6106
6689
|
}
|
|
6107
6690
|
_push(`</div></div>`);
|
|
6108
6691
|
}
|
|
6109
|
-
const _sfc_setup$
|
|
6110
|
-
_sfc_main$
|
|
6692
|
+
const _sfc_setup$6 = _sfc_main$6.setup;
|
|
6693
|
+
_sfc_main$6.setup = (props, ctx) => {
|
|
6111
6694
|
const ssrContext = useSSRContext();
|
|
6112
6695
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ImagesGallery.vue");
|
|
6113
|
-
return _sfc_setup$
|
|
6696
|
+
return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
|
|
6114
6697
|
};
|
|
6115
|
-
const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6698
|
+
const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
|
|
6116
6699
|
|
|
6117
6700
|
const useSkuSelector = (props) => {
|
|
6118
|
-
|
|
6119
|
-
if (!grids) {
|
|
6120
|
-
grids = shallowReactive([]);
|
|
6701
|
+
const grids = shallowReactive(globalThis.$storefront.data.grids || []);
|
|
6702
|
+
if (!grids.length) {
|
|
6121
6703
|
api.get("grids").then(({ data: { result } }) => {
|
|
6122
6704
|
result.forEach((grid) => grids.push(grid));
|
|
6123
6705
|
});
|
|
@@ -6222,7 +6804,7 @@ const useSkuSelector = (props) => {
|
|
|
6222
6804
|
};
|
|
6223
6805
|
};
|
|
6224
6806
|
|
|
6225
|
-
const _sfc_main$
|
|
6807
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
6226
6808
|
__name: "SkuSelector",
|
|
6227
6809
|
props: {
|
|
6228
6810
|
variations: {},
|
|
@@ -6250,10 +6832,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
6250
6832
|
return __returned__;
|
|
6251
6833
|
}
|
|
6252
6834
|
});
|
|
6253
|
-
function _sfc_ssrRender$
|
|
6835
|
+
function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
6254
6836
|
_push(`<div${ssrRenderAttrs(_attrs)}><!--[-->`);
|
|
6255
6837
|
ssrRenderList($setup.variationsGrids, (options, gridId) => {
|
|
6256
|
-
_push(`<div><span class="text-base-700 text-sm font-medium">${ssrInterpolate($setup.getGridTitle(gridId))}: `);
|
|
6838
|
+
_push(`<div class="mt-3"><span class="text-base-700 text-sm font-medium">${ssrInterpolate($setup.getGridTitle(gridId))}: `);
|
|
6257
6839
|
if ($setup.selectedOptions[gridId]) {
|
|
6258
6840
|
_push(`<strong class="text-base-800">${ssrInterpolate($setup.selectedOptions[gridId])}</strong>`);
|
|
6259
6841
|
} else {
|
|
@@ -6264,10 +6846,10 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
6264
6846
|
_push(`<ul class="mt-2 flex gap-2"><!--[-->`);
|
|
6265
6847
|
ssrRenderList(options, (optionText, i) => {
|
|
6266
6848
|
_push(`<li><button class="${ssrRenderClass([[
|
|
6267
|
-
$setup.selectedOptions[gridId] === optionText ? "border-
|
|
6268
|
-
gridId === "colors" ? "h-9 w-9 text-[
|
|
6269
|
-
$setup.activeVariationsGrids[gridId].includes(optionText) ? "text-
|
|
6270
|
-
], "ring-
|
|
6849
|
+
$setup.selectedOptions[gridId] === optionText ? "border-primary ring-2" : null,
|
|
6850
|
+
gridId === "colors" ? "h-9 w-9 text-[0px]" : "px-2.5 py-2 leading-none",
|
|
6851
|
+
$setup.activeVariationsGrids[gridId].includes(optionText) ? "text-primary-950 bg-primary-100 border-primary-400" : "text-primary-600 bg-primary-200 border-primary-300"
|
|
6852
|
+
], "ring-primary/60 rounded border"])}" style="${ssrRenderStyle(gridId === "colors" ? $setup.getColorOptionBg(optionText) : void 0)}">${ssrInterpolate(optionText)}</button></li>`);
|
|
6271
6853
|
});
|
|
6272
6854
|
_push(`<!--]--></ul>`);
|
|
6273
6855
|
} else {
|
|
@@ -6277,15 +6859,15 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
6277
6859
|
});
|
|
6278
6860
|
_push(`<!--]--></div>`);
|
|
6279
6861
|
}
|
|
6280
|
-
const _sfc_setup$
|
|
6281
|
-
_sfc_main$
|
|
6862
|
+
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
6863
|
+
_sfc_main$5.setup = (props, ctx) => {
|
|
6282
6864
|
const ssrContext = useSSRContext();
|
|
6283
6865
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SkuSelector.vue");
|
|
6284
|
-
return _sfc_setup$
|
|
6866
|
+
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
6285
6867
|
};
|
|
6286
|
-
const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6868
|
+
const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
|
|
6287
6869
|
|
|
6288
|
-
const _sfc_main$
|
|
6870
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
6289
6871
|
__name: "ProductDetails",
|
|
6290
6872
|
props: {
|
|
6291
6873
|
product: { default: () => globalThis.$storefront.apiContext?.doc }
|
|
@@ -6338,7 +6920,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6338
6920
|
return __returned__;
|
|
6339
6921
|
}
|
|
6340
6922
|
});
|
|
6341
|
-
function _sfc_ssrRender$
|
|
6923
|
+
function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
6342
6924
|
const _component_Fade = resolveComponent("Fade");
|
|
6343
6925
|
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section relative grid grid-cols-1 items-start gap-5 md:gap-4 lg:grid-cols-4 2xl:gap-6" }, _attrs))}><div class="w-full lg:col-span-3">`);
|
|
6344
6926
|
if ($setup.product.pictures?.length) {
|
|
@@ -6427,15 +7009,15 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
6427
7009
|
ssrRenderSlot(_ctx.$slots, "description", {}, null, _push, _parent);
|
|
6428
7010
|
_push(`</div></section>`);
|
|
6429
7011
|
}
|
|
6430
|
-
const _sfc_setup$
|
|
6431
|
-
_sfc_main$
|
|
7012
|
+
const _sfc_setup$4 = _sfc_main$4.setup;
|
|
7013
|
+
_sfc_main$4.setup = (props, ctx) => {
|
|
6432
7014
|
const ssrContext = useSSRContext();
|
|
6433
7015
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductDetails.vue");
|
|
6434
|
-
return _sfc_setup$
|
|
7016
|
+
return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
6435
7017
|
};
|
|
6436
|
-
const ProductDetails = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
7018
|
+
const ProductDetails = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
|
|
6437
7019
|
|
|
6438
|
-
const _sfc_main$
|
|
7020
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
6439
7021
|
__name: "ProductSpecifications",
|
|
6440
7022
|
props: {
|
|
6441
7023
|
product: { default: () => globalThis.$storefront.apiContext?.doc },
|
|
@@ -6456,7 +7038,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6456
7038
|
return __returned__;
|
|
6457
7039
|
}
|
|
6458
7040
|
});
|
|
6459
|
-
function _sfc_ssrRender$
|
|
7041
|
+
function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
6460
7042
|
if ($setup.hasSpecs) {
|
|
6461
7043
|
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
|
|
6462
7044
|
_push(ssrRenderComponent($setup["Collapse"], {
|
|
@@ -6492,108 +7074,369 @@ function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
6492
7074
|
_push(`<!---->`);
|
|
6493
7075
|
}
|
|
6494
7076
|
}
|
|
6495
|
-
const _sfc_setup$
|
|
6496
|
-
_sfc_main$
|
|
7077
|
+
const _sfc_setup$3 = _sfc_main$3.setup;
|
|
7078
|
+
_sfc_main$3.setup = (props, ctx) => {
|
|
6497
7079
|
const ssrContext = useSSRContext();
|
|
6498
7080
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductSpecifications.vue");
|
|
6499
|
-
return _sfc_setup$
|
|
7081
|
+
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
6500
7082
|
};
|
|
6501
|
-
const ProductSpecifications = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
7083
|
+
const ProductSpecifications = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
|
|
6502
7084
|
|
|
6503
|
-
const
|
|
6504
|
-
|
|
7085
|
+
const usePagination = (props) => {
|
|
7086
|
+
const totalPages = computed(() => {
|
|
7087
|
+
if (props.totalPages)
|
|
7088
|
+
return props.totalPages;
|
|
7089
|
+
if (props.totalItems && props.pageSize) {
|
|
7090
|
+
return Math.ceil(props.totalItems / props.pageSize);
|
|
7091
|
+
}
|
|
7092
|
+
return 1;
|
|
7093
|
+
});
|
|
7094
|
+
const pageNumber = computed(() => {
|
|
7095
|
+
const currentPage = props.page || 1;
|
|
7096
|
+
if (currentPage < 1)
|
|
7097
|
+
return 1;
|
|
7098
|
+
if (currentPage > totalPages.value)
|
|
7099
|
+
return totalPages.value;
|
|
7100
|
+
return currentPage;
|
|
7101
|
+
});
|
|
7102
|
+
const maxPages = computed(() => props.maxPages || 10);
|
|
7103
|
+
const startPage = computed(() => {
|
|
7104
|
+
if (totalPages.value <= maxPages.value)
|
|
7105
|
+
return 1;
|
|
7106
|
+
const maxPagesBeforeCurrent = Math.floor(maxPages.value / 2);
|
|
7107
|
+
const maxPagesAfterCurrent = Math.ceil(maxPages.value / 2) - 1;
|
|
7108
|
+
if (pageNumber.value <= maxPagesBeforeCurrent)
|
|
7109
|
+
return 1;
|
|
7110
|
+
if (pageNumber.value + maxPagesAfterCurrent >= totalPages.value) {
|
|
7111
|
+
return totalPages.value - maxPages.value + 1;
|
|
7112
|
+
}
|
|
7113
|
+
return pageNumber.value - maxPagesBeforeCurrent;
|
|
7114
|
+
});
|
|
7115
|
+
const endPage = computed(() => {
|
|
7116
|
+
if (totalPages.value <= maxPages.value)
|
|
7117
|
+
return totalPages.value;
|
|
7118
|
+
const maxPagesBeforeCurrent = Math.floor(maxPages.value / 2);
|
|
7119
|
+
const maxPagesAfterCurrent = Math.ceil(maxPages.value / 2) - 1;
|
|
7120
|
+
if (pageNumber.value <= maxPagesBeforeCurrent)
|
|
7121
|
+
return maxPages.value;
|
|
7122
|
+
if (pageNumber.value + maxPagesAfterCurrent >= totalPages.value) {
|
|
7123
|
+
return totalPages.value;
|
|
7124
|
+
}
|
|
7125
|
+
return pageNumber.value + maxPagesAfterCurrent;
|
|
7126
|
+
});
|
|
7127
|
+
const pages = computed(() => {
|
|
7128
|
+
return Array.from(Array(endPage.value + 1 - startPage.value).keys()).map((i) => startPage.value + i);
|
|
7129
|
+
});
|
|
7130
|
+
return {
|
|
7131
|
+
totalPages,
|
|
7132
|
+
startPage,
|
|
7133
|
+
endPage,
|
|
7134
|
+
pages
|
|
7135
|
+
};
|
|
7136
|
+
};
|
|
7137
|
+
|
|
7138
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
7139
|
+
__name: "Pagination",
|
|
6505
7140
|
props: {
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
isShuffle: { type: Boolean },
|
|
6512
|
-
limit: {},
|
|
6513
|
-
page: {},
|
|
6514
|
-
products: {}
|
|
7141
|
+
totalItems: {},
|
|
7142
|
+
totalPages: {},
|
|
7143
|
+
page: { default: 1 },
|
|
7144
|
+
pageSize: {},
|
|
7145
|
+
maxPages: { default: 7 }
|
|
6515
7146
|
},
|
|
6516
|
-
|
|
7147
|
+
emits: ["update:page"],
|
|
7148
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
6517
7149
|
__expose();
|
|
6518
|
-
let __temp, __restore;
|
|
6519
7150
|
const props = __props;
|
|
6520
|
-
const
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
fetching,
|
|
6524
|
-
products
|
|
6525
|
-
} = useProductShelf(props);
|
|
6526
|
-
{
|
|
6527
|
-
[__temp, __restore] = withAsyncContext(() => fetching), await __temp, __restore();
|
|
6528
|
-
}
|
|
6529
|
-
const __returned__ = { props, title, titleLink, fetching, products, ProductCard };
|
|
7151
|
+
const emit = __emit;
|
|
7152
|
+
const { totalPages, pages } = usePagination(props);
|
|
7153
|
+
const __returned__ = { props, emit, totalPages, pages };
|
|
6530
7154
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
6531
7155
|
return __returned__;
|
|
6532
7156
|
}
|
|
6533
7157
|
});
|
|
6534
|
-
function _sfc_ssrRender$
|
|
7158
|
+
function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
6535
7159
|
const _component_ALink = resolveComponent("ALink");
|
|
6536
|
-
_push(`<
|
|
6537
|
-
|
|
6538
|
-
|
|
7160
|
+
_push(`<ol${ssrRenderAttrs(mergeProps({ class: "text-base-900 flex justify-center gap-1.5 text-center text-sm font-medium leading-9" }, _attrs))}><li>`);
|
|
7161
|
+
_push(ssrRenderComponent(_component_ALink, {
|
|
7162
|
+
href: $props.page > 1 ? `?p=${$props.page - 1}` : null,
|
|
7163
|
+
onClick: ($event) => $props.page > 1 && $setup.emit("update:page", $props.page - 1),
|
|
7164
|
+
class: ["mr-1 block min-w-9 rounded border px-3", $props.page > 1 ? "border-base-100 hover:bg-base-100" : "border-transparent text-base-500"]
|
|
7165
|
+
}, {
|
|
7166
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
7167
|
+
if (_push2) {
|
|
7168
|
+
_push2(`<i class="i-arrow-right rotate-180"${_scopeId}></i><span class="ml-1.5 hidden md:inline"${_scopeId}>${ssrInterpolate("Anterior")}</span>`);
|
|
7169
|
+
} else {
|
|
7170
|
+
return [
|
|
7171
|
+
createVNode("i", { class: "i-arrow-right rotate-180" }),
|
|
7172
|
+
createVNode("span", { class: "ml-1.5 hidden md:inline" }, toDisplayString("Anterior"))
|
|
7173
|
+
];
|
|
7174
|
+
}
|
|
7175
|
+
}),
|
|
7176
|
+
_: 1
|
|
7177
|
+
}, _parent));
|
|
7178
|
+
_push(`</li><!--[-->`);
|
|
7179
|
+
ssrRenderList($setup.pages, (pageN) => {
|
|
7180
|
+
_push(`<li>`);
|
|
6539
7181
|
_push(ssrRenderComponent(_component_ALink, {
|
|
6540
|
-
href: $
|
|
6541
|
-
|
|
7182
|
+
href: pageN !== $props.page ? `?p=${pageN}` : null,
|
|
7183
|
+
onClick: ($event) => $setup.emit("update:page", pageN),
|
|
7184
|
+
class: ["block w-9 rounded border ring-black/10", pageN === $props.page ? "bg-base-50 border-base-100 ring text-base-700" : "border-transparent hover:bg-base-100"]
|
|
6542
7185
|
}, {
|
|
6543
7186
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
6544
7187
|
if (_push2) {
|
|
6545
|
-
_push2(`${ssrInterpolate(
|
|
7188
|
+
_push2(`${ssrInterpolate(pageN)}`);
|
|
6546
7189
|
} else {
|
|
6547
7190
|
return [
|
|
6548
|
-
createTextVNode(toDisplayString(
|
|
7191
|
+
createTextVNode(toDisplayString(pageN), 1)
|
|
6549
7192
|
];
|
|
6550
7193
|
}
|
|
6551
7194
|
}),
|
|
6552
|
-
_:
|
|
7195
|
+
_: 2
|
|
6553
7196
|
}, _parent));
|
|
6554
|
-
_push(`</
|
|
7197
|
+
_push(`</li>`);
|
|
7198
|
+
});
|
|
7199
|
+
_push(`<!--]--><li>`);
|
|
7200
|
+
_push(ssrRenderComponent(_component_ALink, {
|
|
7201
|
+
href: $props.page < $setup.totalPages ? `?p=${$props.page + 1}` : null,
|
|
7202
|
+
onClick: ($event) => $props.page < $setup.totalPages && $setup.emit("update:page", $props.page + 1),
|
|
7203
|
+
class: ["ml-1 block min-w-9 rounded border px-3", $props.page < $setup.totalPages ? "border-base-100 hover:bg-base-100" : "border-transparent text-base-500"]
|
|
7204
|
+
}, {
|
|
7205
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
7206
|
+
if (_push2) {
|
|
7207
|
+
_push2(`<span class="mr-1.5 hidden md:inline"${_scopeId}>${ssrInterpolate("Pr\xF3ximo")}</span><i class="i-arrow-right"${_scopeId}></i>`);
|
|
7208
|
+
} else {
|
|
7209
|
+
return [
|
|
7210
|
+
createVNode("span", { class: "mr-1.5 hidden md:inline" }, toDisplayString("Pr\xF3ximo")),
|
|
7211
|
+
createVNode("i", { class: "i-arrow-right" })
|
|
7212
|
+
];
|
|
7213
|
+
}
|
|
7214
|
+
}),
|
|
7215
|
+
_: 1
|
|
7216
|
+
}, _parent));
|
|
7217
|
+
_push(`</li></ol>`);
|
|
7218
|
+
}
|
|
7219
|
+
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
7220
|
+
_sfc_main$2.setup = (props, ctx) => {
|
|
7221
|
+
const ssrContext = useSSRContext();
|
|
7222
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Pagination.vue");
|
|
7223
|
+
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
7224
|
+
};
|
|
7225
|
+
const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
|
|
7226
|
+
|
|
7227
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
7228
|
+
__name: "SearchFilters",
|
|
7229
|
+
props: {
|
|
7230
|
+
searchEngine: {},
|
|
7231
|
+
fixedParams: {}
|
|
7232
|
+
},
|
|
7233
|
+
setup(__props, { expose: __expose }) {
|
|
7234
|
+
__expose();
|
|
7235
|
+
const props = __props;
|
|
7236
|
+
const {
|
|
7237
|
+
resultBuckets,
|
|
7238
|
+
activeFilters,
|
|
7239
|
+
filtersCount,
|
|
7240
|
+
clearFilters,
|
|
7241
|
+
priceRanges,
|
|
7242
|
+
priceRangeKey,
|
|
7243
|
+
getPriceRangeLabel,
|
|
7244
|
+
filterOptions,
|
|
7245
|
+
checkFilterOption,
|
|
7246
|
+
toggleFilterOption
|
|
7247
|
+
} = useSearchFilters(props);
|
|
7248
|
+
const __returned__ = { props, resultBuckets, activeFilters, filtersCount, clearFilters, priceRanges, priceRangeKey, getPriceRangeLabel, filterOptions, checkFilterOption, toggleFilterOption, Collapse };
|
|
7249
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
7250
|
+
return __returned__;
|
|
7251
|
+
}
|
|
7252
|
+
});
|
|
7253
|
+
function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
7254
|
+
_push(`<aside${ssrRenderAttrs(mergeProps({ class: "bg-base-50/40 h-screen overflow-y-auto" }, _attrs))}><header class="px-6 pb-3 pt-5 text-center">`);
|
|
7255
|
+
if ($setup.filtersCount) {
|
|
7256
|
+
_push(`<button class="ui-btn-sm ui-btn-danger py-1">${ssrInterpolate("Limpar filtros")} <i class="i-trash ml-0.5"></i></button>`);
|
|
7257
|
+
} else {
|
|
7258
|
+
_push(`<p class="text-base-500 border border-transparent pb-1 text-base font-semibold">${ssrInterpolate("Filtrar resultados")}</p>`);
|
|
7259
|
+
}
|
|
7260
|
+
_push(`</header>`);
|
|
7261
|
+
if ($setup.resultBuckets) {
|
|
7262
|
+
_push(`<article class="px-6 pb-3">`);
|
|
7263
|
+
if ($setup.priceRanges) {
|
|
7264
|
+
_push(ssrRenderComponent($setup["Collapse"], {
|
|
7265
|
+
title: "Pre\xE7o",
|
|
7266
|
+
class: "[&>summary]:text-xl",
|
|
7267
|
+
open: ""
|
|
7268
|
+
}, {
|
|
7269
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
7270
|
+
if (_push2) {
|
|
7271
|
+
_push2(`<div class="space-y-1.5"${_scopeId}><!--[-->`);
|
|
7272
|
+
ssrRenderList($setup.priceRanges, ({ range, key }) => {
|
|
7273
|
+
_push2(`<div class="flex items-center"${_scopeId}><input type="radio"${ssrRenderAttr("id", `priceRange-${key}`)} name="priceRange"${ssrRenderAttr("value", key)}${ssrIncludeBooleanAttr(ssrLooseEqual($setup.priceRangeKey, key)) ? " checked" : ""}${_scopeId}><label${ssrRenderAttr("for", `priceRange-${key}`)} class="cursor-pointer px-3 text-sm"${_scopeId}>${ssrInterpolate($setup.getPriceRangeLabel(range))} <small class="text-base-500 font-medium"${_scopeId}> (${ssrInterpolate(range.count)}) </small></label></div>`);
|
|
7274
|
+
});
|
|
7275
|
+
_push2(`<!--]-->`);
|
|
7276
|
+
if ($setup.activeFilters["price<"] || $setup.activeFilters["price>"]) {
|
|
7277
|
+
_push2(`<div class="flex items-center"${_scopeId}><input type="radio" id="priceRange-null" name="priceRange"${ssrRenderAttr("value", null)}${ssrIncludeBooleanAttr(ssrLooseEqual($setup.priceRangeKey, null)) ? " checked" : ""}${_scopeId}><label for="priceRange-null" class="cursor-pointer px-3 text-sm"${_scopeId}>${ssrInterpolate("Qualquer pre\xE7o")}</label></div>`);
|
|
7278
|
+
} else {
|
|
7279
|
+
_push2(`<!---->`);
|
|
7280
|
+
}
|
|
7281
|
+
_push2(`</div>`);
|
|
7282
|
+
} else {
|
|
7283
|
+
return [
|
|
7284
|
+
createVNode("div", { class: "space-y-1.5" }, [
|
|
7285
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.priceRanges, ({ range, key }) => {
|
|
7286
|
+
return openBlock(), createBlock("div", {
|
|
7287
|
+
key: `prices-${key}`,
|
|
7288
|
+
class: "flex items-center"
|
|
7289
|
+
}, [
|
|
7290
|
+
withDirectives(createVNode("input", {
|
|
7291
|
+
type: "radio",
|
|
7292
|
+
id: `priceRange-${key}`,
|
|
7293
|
+
name: "priceRange",
|
|
7294
|
+
value: key,
|
|
7295
|
+
"onUpdate:modelValue": ($event) => $setup.priceRangeKey = $event
|
|
7296
|
+
}, null, 8, ["id", "value", "onUpdate:modelValue"]), [
|
|
7297
|
+
[vModelRadio, $setup.priceRangeKey]
|
|
7298
|
+
]),
|
|
7299
|
+
createVNode("label", {
|
|
7300
|
+
for: `priceRange-${key}`,
|
|
7301
|
+
class: "cursor-pointer px-3 text-sm"
|
|
7302
|
+
}, [
|
|
7303
|
+
createTextVNode(toDisplayString($setup.getPriceRangeLabel(range)) + " ", 1),
|
|
7304
|
+
createVNode("small", { class: "text-base-500 font-medium" }, " (" + toDisplayString(range.count) + ") ", 1)
|
|
7305
|
+
], 8, ["for"])
|
|
7306
|
+
]);
|
|
7307
|
+
}), 128)),
|
|
7308
|
+
$setup.activeFilters["price<"] || $setup.activeFilters["price>"] ? (openBlock(), createBlock("div", {
|
|
7309
|
+
key: 0,
|
|
7310
|
+
class: "flex items-center"
|
|
7311
|
+
}, [
|
|
7312
|
+
withDirectives(createVNode("input", {
|
|
7313
|
+
type: "radio",
|
|
7314
|
+
id: "priceRange-null",
|
|
7315
|
+
name: "priceRange",
|
|
7316
|
+
value: null,
|
|
7317
|
+
"onUpdate:modelValue": ($event) => $setup.priceRangeKey = $event
|
|
7318
|
+
}, null, 8, ["onUpdate:modelValue"]), [
|
|
7319
|
+
[vModelRadio, $setup.priceRangeKey]
|
|
7320
|
+
]),
|
|
7321
|
+
createVNode("label", {
|
|
7322
|
+
for: "priceRange-null",
|
|
7323
|
+
class: "cursor-pointer px-3 text-sm"
|
|
7324
|
+
}, toDisplayString("Qualquer pre\xE7o"))
|
|
7325
|
+
])) : createCommentVNode("", true)
|
|
7326
|
+
])
|
|
7327
|
+
];
|
|
7328
|
+
}
|
|
7329
|
+
}),
|
|
7330
|
+
_: 1
|
|
7331
|
+
}, _parent));
|
|
7332
|
+
} else {
|
|
7333
|
+
_push(`<!---->`);
|
|
7334
|
+
}
|
|
7335
|
+
_push(`<!--[-->`);
|
|
7336
|
+
ssrRenderList($setup.filterOptions, ({ title, options, field }) => {
|
|
7337
|
+
_push(ssrRenderComponent($setup["Collapse"], {
|
|
7338
|
+
key: field,
|
|
7339
|
+
title,
|
|
7340
|
+
class: "[&>summary]:text-xl",
|
|
7341
|
+
open: !!$setup.activeFilters[field]
|
|
7342
|
+
}, {
|
|
7343
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
7344
|
+
if (_push2) {
|
|
7345
|
+
_push2(`<div class="space-y-1.5"${_scopeId}><!--[-->`);
|
|
7346
|
+
ssrRenderList(options, (count, value, i) => {
|
|
7347
|
+
_push2(`<div class="flex items-center"${_scopeId}><input type="checkbox"${ssrRenderAttr("id", `${field}-${value}`)}${ssrRenderAttr("value", value)}${ssrIncludeBooleanAttr($setup.checkFilterOption(field, value)) ? " checked" : ""}${_scopeId}><label${ssrRenderAttr("for", `${field}-${value}`)} class="cursor-pointer px-3 text-sm"${_scopeId}>${ssrInterpolate(value)} <small class="text-base-500 font-medium"${_scopeId}> (${ssrInterpolate(count)}) </small></label></div>`);
|
|
7348
|
+
});
|
|
7349
|
+
_push2(`<!--]--></div>`);
|
|
7350
|
+
} else {
|
|
7351
|
+
return [
|
|
7352
|
+
createVNode("div", { class: "space-y-1.5" }, [
|
|
7353
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList(options, (count, value, i) => {
|
|
7354
|
+
return openBlock(), createBlock("div", {
|
|
7355
|
+
key: `${field}-${i}`,
|
|
7356
|
+
class: "flex items-center"
|
|
7357
|
+
}, [
|
|
7358
|
+
createVNode("input", {
|
|
7359
|
+
type: "checkbox",
|
|
7360
|
+
id: `${field}-${value}`,
|
|
7361
|
+
value,
|
|
7362
|
+
checked: $setup.checkFilterOption(field, value),
|
|
7363
|
+
onChange: ($event) => $setup.toggleFilterOption(field, value)
|
|
7364
|
+
}, null, 40, ["id", "value", "checked", "onChange"]),
|
|
7365
|
+
createVNode("label", {
|
|
7366
|
+
for: `${field}-${value}`,
|
|
7367
|
+
class: "cursor-pointer px-3 text-sm"
|
|
7368
|
+
}, [
|
|
7369
|
+
createTextVNode(toDisplayString(value) + " ", 1),
|
|
7370
|
+
createVNode("small", { class: "text-base-500 font-medium" }, " (" + toDisplayString(count) + ") ", 1)
|
|
7371
|
+
], 8, ["for"])
|
|
7372
|
+
]);
|
|
7373
|
+
}), 128))
|
|
7374
|
+
])
|
|
7375
|
+
];
|
|
7376
|
+
}
|
|
7377
|
+
}),
|
|
7378
|
+
_: 2
|
|
7379
|
+
}, _parent));
|
|
7380
|
+
});
|
|
7381
|
+
_push(`<!--]--></article>`);
|
|
6555
7382
|
} else {
|
|
6556
7383
|
_push(`<!---->`);
|
|
6557
7384
|
}
|
|
6558
|
-
_push(
|
|
6559
|
-
ssrRenderList($setup.products, (product) => {
|
|
6560
|
-
_push(`<li>`);
|
|
6561
|
-
_push(ssrRenderComponent($setup["ProductCard"], { product }, null, _parent));
|
|
6562
|
-
_push(`</li>`);
|
|
6563
|
-
});
|
|
6564
|
-
_push(`<!--]--></ul></section>`);
|
|
7385
|
+
_push(`</aside>`);
|
|
6565
7386
|
}
|
|
6566
7387
|
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
6567
7388
|
_sfc_main$1.setup = (props, ctx) => {
|
|
6568
7389
|
const ssrContext = useSSRContext();
|
|
6569
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/
|
|
7390
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SearchFilters.vue");
|
|
6570
7391
|
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
6571
7392
|
};
|
|
6572
|
-
const
|
|
7393
|
+
const SearchFilters = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
|
|
6573
7394
|
|
|
6574
7395
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6575
|
-
__name: "
|
|
7396
|
+
__name: "SearchShowcase",
|
|
6576
7397
|
props: {
|
|
6577
|
-
searchEngine: {},
|
|
6578
7398
|
term: {},
|
|
6579
|
-
|
|
7399
|
+
fixedParams: {},
|
|
6580
7400
|
products: {},
|
|
6581
|
-
|
|
7401
|
+
resultMeta: {},
|
|
7402
|
+
ssrError: {},
|
|
7403
|
+
canUseUrlParams: { type: Boolean, default: true },
|
|
7404
|
+
showcase: {}
|
|
6582
7405
|
},
|
|
6583
7406
|
async setup(__props, { expose: __expose }) {
|
|
6584
7407
|
__expose();
|
|
6585
7408
|
let __temp, __restore;
|
|
6586
7409
|
const props = __props;
|
|
7410
|
+
const showcase = ref(null);
|
|
6587
7411
|
const {
|
|
6588
|
-
|
|
7412
|
+
searchEngine,
|
|
6589
7413
|
fetching,
|
|
6590
7414
|
isFetching,
|
|
6591
|
-
products
|
|
6592
|
-
|
|
7415
|
+
products,
|
|
7416
|
+
resultMeta,
|
|
7417
|
+
totalPages,
|
|
7418
|
+
filtersCount,
|
|
7419
|
+
sortOptions,
|
|
7420
|
+
sortOption
|
|
7421
|
+
} = useSearchShowcase({ ...props, showcase });
|
|
6593
7422
|
{
|
|
6594
7423
|
[__temp, __restore] = withAsyncContext(() => fetching), await __temp, __restore();
|
|
6595
7424
|
}
|
|
6596
|
-
const
|
|
7425
|
+
const wasFetched = computed(() => searchEngine.wasFetched.value);
|
|
7426
|
+
const searchTerm = computed(() => searchEngine.term.value);
|
|
7427
|
+
const hasFiltersBar = computed(() => {
|
|
7428
|
+
return wasFetched && !!(resultMeta.value.count > 4 || filtersCount.value);
|
|
7429
|
+
});
|
|
7430
|
+
const isFiltersOpen = ref(false);
|
|
7431
|
+
const __returned__ = { props, showcase, searchEngine, fetching, isFetching, products, resultMeta, totalPages, filtersCount, sortOptions, sortOption, wasFetched, searchTerm, hasFiltersBar, isFiltersOpen, get Listbox() {
|
|
7432
|
+
return Listbox;
|
|
7433
|
+
}, get ListboxButton() {
|
|
7434
|
+
return ListboxButton;
|
|
7435
|
+
}, get ListboxOptions() {
|
|
7436
|
+
return ListboxOptions;
|
|
7437
|
+
}, get ListboxOption() {
|
|
7438
|
+
return ListboxOption;
|
|
7439
|
+
}, Drawer, Pagination, ProductShelf, SearchFilters };
|
|
6597
7440
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
6598
7441
|
return __returned__;
|
|
6599
7442
|
}
|
|
@@ -6602,10 +7445,15 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
|
|
|
6602
7445
|
const _component_Skeleton = resolveComponent("Skeleton");
|
|
6603
7446
|
const _component_Fade = resolveComponent("Fade");
|
|
6604
7447
|
_push(`<!--[-->`);
|
|
6605
|
-
if ($setup.
|
|
7448
|
+
if ($setup.searchTerm) {
|
|
7449
|
+
_push(`<section class="${ssrRenderClass([$setup.hasFiltersBar ? "relative z-[14] -mb-4" : "mb-0", "ui-section-slim text-base-700 px-6 text-center text-xl lowercase"])}">${ssrInterpolate("Buscando por")} <h1 class="text-base-800 inline font-bold italic">${ssrInterpolate($setup.searchTerm)}</h1></section>`);
|
|
7450
|
+
} else {
|
|
7451
|
+
_push(`<!---->`);
|
|
7452
|
+
}
|
|
7453
|
+
if ($setup.isFetching && !$setup.products.length) {
|
|
6606
7454
|
_push(`<div class="ui-section relative min-h-[300px]">`);
|
|
6607
7455
|
_push(ssrRenderComponent(_component_Skeleton, {
|
|
6608
|
-
class: "absolute top-0 w-full",
|
|
7456
|
+
class: "absolute top-0 w-full px-5",
|
|
6609
7457
|
"is-bold": "",
|
|
6610
7458
|
"is-large": ""
|
|
6611
7459
|
}, null, _parent));
|
|
@@ -6613,13 +7461,411 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
|
|
|
6613
7461
|
} else {
|
|
6614
7462
|
_push(`<!---->`);
|
|
6615
7463
|
}
|
|
6616
|
-
_push(
|
|
7464
|
+
_push(`<article class="relative">`);
|
|
7465
|
+
_push(ssrRenderComponent(_component_Fade, null, {
|
|
7466
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
7467
|
+
if (_push2) {
|
|
7468
|
+
if ($setup.hasFiltersBar) {
|
|
7469
|
+
_push2(`<section class="ui-section-slim sticky-header:translate-y-16 lg:sticky-header:translate-y-14 to-base-100 sticky top-0 z-[12] flex items-center justify-between rounded-b bg-white/80 px-6 py-4 shadow-sm backdrop-blur-sm transition-transform"${_scopeId}><strong class="text-base-700 font-medium lowercase"${_scopeId}>`);
|
|
7470
|
+
if ($setup.resultMeta.count > 1) {
|
|
7471
|
+
_push2(`<!--[-->${ssrInterpolate($setup.resultMeta.count)} <span class="hidden lg:inline"${_scopeId}>${ssrInterpolate("Itens encontrados")}</span><span class="lg:hidden"${_scopeId}>${ssrInterpolate("Produtos")}</span><!--]-->`);
|
|
7472
|
+
} else {
|
|
7473
|
+
_push2(`<!---->`);
|
|
7474
|
+
}
|
|
7475
|
+
_push2(`</strong><div class="flex items-center gap-4"${_scopeId}><span class="hidden text-xl leading-none md:block"${_scopeId}><i class="i-adjustments-horizontal text-base-600 m-0"${_scopeId}></i></span><button class="ui-btn-sm ui-btn-secondary relative"${_scopeId}><span class="hidden md:inline"${_scopeId}>${ssrInterpolate("Filtrar produtos")}</span><span class="md:hidden"${_scopeId}><i class="i-adjustments-horizontal mr-1"${_scopeId}></i> ${ssrInterpolate("Filtrar")}</span>`);
|
|
7476
|
+
if ($setup.filtersCount) {
|
|
7477
|
+
_push2(`<span class="ui-badge-pill-sm outline-secondary/80 outline-3 absolute -right-1.5 -top-1 outline"${_scopeId}>${ssrInterpolate($setup.filtersCount)}</span>`);
|
|
7478
|
+
} else {
|
|
7479
|
+
_push2(`<!---->`);
|
|
7480
|
+
}
|
|
7481
|
+
_push2(`</button>`);
|
|
7482
|
+
_push2(ssrRenderComponent($setup["Listbox"], {
|
|
7483
|
+
modelValue: $setup.sortOption,
|
|
7484
|
+
"onUpdate:modelValue": ($event) => $setup.sortOption = $event,
|
|
7485
|
+
as: "div",
|
|
7486
|
+
class: "text-base-800 relative text-sm"
|
|
7487
|
+
}, {
|
|
7488
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
7489
|
+
if (_push3) {
|
|
7490
|
+
_push3(ssrRenderComponent($setup["ListboxButton"], { class: "ui-btn-sm ui-btn-secondary" }, {
|
|
7491
|
+
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
|
|
7492
|
+
if (_push4) {
|
|
7493
|
+
_push4(`${ssrInterpolate("Ordenar")}`);
|
|
7494
|
+
} else {
|
|
7495
|
+
return [
|
|
7496
|
+
createTextVNode(toDisplayString("Ordenar"))
|
|
7497
|
+
];
|
|
7498
|
+
}
|
|
7499
|
+
}),
|
|
7500
|
+
_: 1
|
|
7501
|
+
}, _parent3, _scopeId2));
|
|
7502
|
+
_push3(ssrRenderComponent(_component_Fade, null, {
|
|
7503
|
+
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
|
|
7504
|
+
if (_push4) {
|
|
7505
|
+
_push4(ssrRenderComponent($setup["ListboxOptions"], { class: "divide-base-100 absolute right-0 mt-2 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none" }, {
|
|
7506
|
+
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
|
|
7507
|
+
if (_push5) {
|
|
7508
|
+
_push5(`<!--[-->`);
|
|
7509
|
+
ssrRenderList($setup.sortOptions, ({ label, value }) => {
|
|
7510
|
+
_push5(ssrRenderComponent($setup["ListboxOption"], {
|
|
7511
|
+
key: value || "sort",
|
|
7512
|
+
value,
|
|
7513
|
+
as: "template"
|
|
7514
|
+
}, {
|
|
7515
|
+
default: withCtx(({ selected, active }, _push6, _parent6, _scopeId5) => {
|
|
7516
|
+
if (_push6) {
|
|
7517
|
+
_push6(`<li${_scopeId5}>`);
|
|
7518
|
+
ssrRenderVNode(_push6, createVNode(resolveDynamicComponent(selected ? "div" : "button"), {
|
|
7519
|
+
class: ["flex w-full py-2 pl-3 pr-6", !selected && active && "bg-secondary-100 text-secondary"]
|
|
7520
|
+
}, {
|
|
7521
|
+
default: withCtx((_5, _push7, _parent7, _scopeId6) => {
|
|
7522
|
+
if (_push7) {
|
|
7523
|
+
_push7(`<div class="w-5"${_scopeId6}><i style="${ssrRenderStyle(selected ? null : { display: "none" })}" class="i-check"${_scopeId6}></i></div> ${ssrInterpolate(label)}`);
|
|
7524
|
+
} else {
|
|
7525
|
+
return [
|
|
7526
|
+
createVNode("div", { class: "w-5" }, [
|
|
7527
|
+
withDirectives(createVNode("i", { class: "i-check" }, null, 512), [
|
|
7528
|
+
[vShow, selected]
|
|
7529
|
+
])
|
|
7530
|
+
]),
|
|
7531
|
+
createTextVNode(" " + toDisplayString(label), 1)
|
|
7532
|
+
];
|
|
7533
|
+
}
|
|
7534
|
+
}),
|
|
7535
|
+
_: 2
|
|
7536
|
+
}), _parent6, _scopeId5);
|
|
7537
|
+
_push6(`</li>`);
|
|
7538
|
+
} else {
|
|
7539
|
+
return [
|
|
7540
|
+
createVNode("li", null, [
|
|
7541
|
+
(openBlock(), createBlock(resolveDynamicComponent(selected ? "div" : "button"), {
|
|
7542
|
+
class: ["flex w-full py-2 pl-3 pr-6", !selected && active && "bg-secondary-100 text-secondary"]
|
|
7543
|
+
}, {
|
|
7544
|
+
default: withCtx(() => [
|
|
7545
|
+
createVNode("div", { class: "w-5" }, [
|
|
7546
|
+
withDirectives(createVNode("i", { class: "i-check" }, null, 512), [
|
|
7547
|
+
[vShow, selected]
|
|
7548
|
+
])
|
|
7549
|
+
]),
|
|
7550
|
+
createTextVNode(" " + toDisplayString(label), 1)
|
|
7551
|
+
]),
|
|
7552
|
+
_: 2
|
|
7553
|
+
}, 1032, ["class"]))
|
|
7554
|
+
])
|
|
7555
|
+
];
|
|
7556
|
+
}
|
|
7557
|
+
}),
|
|
7558
|
+
_: 2
|
|
7559
|
+
}, _parent5, _scopeId4));
|
|
7560
|
+
});
|
|
7561
|
+
_push5(`<!--]-->`);
|
|
7562
|
+
} else {
|
|
7563
|
+
return [
|
|
7564
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.sortOptions, ({ label, value }) => {
|
|
7565
|
+
return openBlock(), createBlock($setup["ListboxOption"], {
|
|
7566
|
+
key: value || "sort",
|
|
7567
|
+
value,
|
|
7568
|
+
as: "template"
|
|
7569
|
+
}, {
|
|
7570
|
+
default: withCtx(({ selected, active }) => [
|
|
7571
|
+
createVNode("li", null, [
|
|
7572
|
+
(openBlock(), createBlock(resolveDynamicComponent(selected ? "div" : "button"), {
|
|
7573
|
+
class: ["flex w-full py-2 pl-3 pr-6", !selected && active && "bg-secondary-100 text-secondary"]
|
|
7574
|
+
}, {
|
|
7575
|
+
default: withCtx(() => [
|
|
7576
|
+
createVNode("div", { class: "w-5" }, [
|
|
7577
|
+
withDirectives(createVNode("i", { class: "i-check" }, null, 512), [
|
|
7578
|
+
[vShow, selected]
|
|
7579
|
+
])
|
|
7580
|
+
]),
|
|
7581
|
+
createTextVNode(" " + toDisplayString(label), 1)
|
|
7582
|
+
]),
|
|
7583
|
+
_: 2
|
|
7584
|
+
}, 1032, ["class"]))
|
|
7585
|
+
])
|
|
7586
|
+
]),
|
|
7587
|
+
_: 2
|
|
7588
|
+
}, 1032, ["value"]);
|
|
7589
|
+
}), 128))
|
|
7590
|
+
];
|
|
7591
|
+
}
|
|
7592
|
+
}),
|
|
7593
|
+
_: 1
|
|
7594
|
+
}, _parent4, _scopeId3));
|
|
7595
|
+
} else {
|
|
7596
|
+
return [
|
|
7597
|
+
createVNode($setup["ListboxOptions"], { class: "divide-base-100 absolute right-0 mt-2 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none" }, {
|
|
7598
|
+
default: withCtx(() => [
|
|
7599
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.sortOptions, ({ label, value }) => {
|
|
7600
|
+
return openBlock(), createBlock($setup["ListboxOption"], {
|
|
7601
|
+
key: value || "sort",
|
|
7602
|
+
value,
|
|
7603
|
+
as: "template"
|
|
7604
|
+
}, {
|
|
7605
|
+
default: withCtx(({ selected, active }) => [
|
|
7606
|
+
createVNode("li", null, [
|
|
7607
|
+
(openBlock(), createBlock(resolveDynamicComponent(selected ? "div" : "button"), {
|
|
7608
|
+
class: ["flex w-full py-2 pl-3 pr-6", !selected && active && "bg-secondary-100 text-secondary"]
|
|
7609
|
+
}, {
|
|
7610
|
+
default: withCtx(() => [
|
|
7611
|
+
createVNode("div", { class: "w-5" }, [
|
|
7612
|
+
withDirectives(createVNode("i", { class: "i-check" }, null, 512), [
|
|
7613
|
+
[vShow, selected]
|
|
7614
|
+
])
|
|
7615
|
+
]),
|
|
7616
|
+
createTextVNode(" " + toDisplayString(label), 1)
|
|
7617
|
+
]),
|
|
7618
|
+
_: 2
|
|
7619
|
+
}, 1032, ["class"]))
|
|
7620
|
+
])
|
|
7621
|
+
]),
|
|
7622
|
+
_: 2
|
|
7623
|
+
}, 1032, ["value"]);
|
|
7624
|
+
}), 128))
|
|
7625
|
+
]),
|
|
7626
|
+
_: 1
|
|
7627
|
+
})
|
|
7628
|
+
];
|
|
7629
|
+
}
|
|
7630
|
+
}),
|
|
7631
|
+
_: 1
|
|
7632
|
+
}, _parent3, _scopeId2));
|
|
7633
|
+
} else {
|
|
7634
|
+
return [
|
|
7635
|
+
createVNode($setup["ListboxButton"], { class: "ui-btn-sm ui-btn-secondary" }, {
|
|
7636
|
+
default: withCtx(() => [
|
|
7637
|
+
createTextVNode(toDisplayString("Ordenar"))
|
|
7638
|
+
]),
|
|
7639
|
+
_: 1
|
|
7640
|
+
}),
|
|
7641
|
+
createVNode(_component_Fade, null, {
|
|
7642
|
+
default: withCtx(() => [
|
|
7643
|
+
createVNode($setup["ListboxOptions"], { class: "divide-base-100 absolute right-0 mt-2 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none" }, {
|
|
7644
|
+
default: withCtx(() => [
|
|
7645
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.sortOptions, ({ label, value }) => {
|
|
7646
|
+
return openBlock(), createBlock($setup["ListboxOption"], {
|
|
7647
|
+
key: value || "sort",
|
|
7648
|
+
value,
|
|
7649
|
+
as: "template"
|
|
7650
|
+
}, {
|
|
7651
|
+
default: withCtx(({ selected, active }) => [
|
|
7652
|
+
createVNode("li", null, [
|
|
7653
|
+
(openBlock(), createBlock(resolveDynamicComponent(selected ? "div" : "button"), {
|
|
7654
|
+
class: ["flex w-full py-2 pl-3 pr-6", !selected && active && "bg-secondary-100 text-secondary"]
|
|
7655
|
+
}, {
|
|
7656
|
+
default: withCtx(() => [
|
|
7657
|
+
createVNode("div", { class: "w-5" }, [
|
|
7658
|
+
withDirectives(createVNode("i", { class: "i-check" }, null, 512), [
|
|
7659
|
+
[vShow, selected]
|
|
7660
|
+
])
|
|
7661
|
+
]),
|
|
7662
|
+
createTextVNode(" " + toDisplayString(label), 1)
|
|
7663
|
+
]),
|
|
7664
|
+
_: 2
|
|
7665
|
+
}, 1032, ["class"]))
|
|
7666
|
+
])
|
|
7667
|
+
]),
|
|
7668
|
+
_: 2
|
|
7669
|
+
}, 1032, ["value"]);
|
|
7670
|
+
}), 128))
|
|
7671
|
+
]),
|
|
7672
|
+
_: 1
|
|
7673
|
+
})
|
|
7674
|
+
]),
|
|
7675
|
+
_: 1
|
|
7676
|
+
})
|
|
7677
|
+
];
|
|
7678
|
+
}
|
|
7679
|
+
}),
|
|
7680
|
+
_: 1
|
|
7681
|
+
}, _parent2, _scopeId));
|
|
7682
|
+
_push2(`</div></section>`);
|
|
7683
|
+
} else {
|
|
7684
|
+
_push2(`<!---->`);
|
|
7685
|
+
}
|
|
7686
|
+
} else {
|
|
7687
|
+
return [
|
|
7688
|
+
$setup.hasFiltersBar ? (openBlock(), createBlock("section", {
|
|
7689
|
+
key: 0,
|
|
7690
|
+
class: "ui-section-slim sticky-header:translate-y-16 lg:sticky-header:translate-y-14 to-base-100 sticky top-0 z-[12] flex items-center justify-between rounded-b bg-white/80 px-6 py-4 shadow-sm backdrop-blur-sm transition-transform"
|
|
7691
|
+
}, [
|
|
7692
|
+
createVNode("strong", { class: "text-base-700 font-medium lowercase" }, [
|
|
7693
|
+
$setup.resultMeta.count > 1 ? (openBlock(), createBlock(Fragment$1, { key: 0 }, [
|
|
7694
|
+
createTextVNode(toDisplayString($setup.resultMeta.count) + " ", 1),
|
|
7695
|
+
createVNode("span", { class: "hidden lg:inline" }, toDisplayString("Itens encontrados")),
|
|
7696
|
+
createVNode("span", { class: "lg:hidden" }, toDisplayString("Produtos"))
|
|
7697
|
+
], 64)) : createCommentVNode("", true)
|
|
7698
|
+
]),
|
|
7699
|
+
createVNode("div", { class: "flex items-center gap-4" }, [
|
|
7700
|
+
createVNode("span", { class: "hidden text-xl leading-none md:block" }, [
|
|
7701
|
+
createVNode("i", { class: "i-adjustments-horizontal text-base-600 m-0" })
|
|
7702
|
+
]),
|
|
7703
|
+
createVNode("button", {
|
|
7704
|
+
onClick: ($event) => $setup.isFiltersOpen = !$setup.isFiltersOpen,
|
|
7705
|
+
class: "ui-btn-sm ui-btn-secondary relative"
|
|
7706
|
+
}, [
|
|
7707
|
+
createVNode("span", { class: "hidden md:inline" }, toDisplayString("Filtrar produtos")),
|
|
7708
|
+
createVNode("span", { class: "md:hidden" }, [
|
|
7709
|
+
createVNode("i", { class: "i-adjustments-horizontal mr-1" }),
|
|
7710
|
+
createTextVNode(" " + toDisplayString("Filtrar"))
|
|
7711
|
+
]),
|
|
7712
|
+
$setup.filtersCount ? (openBlock(), createBlock("span", {
|
|
7713
|
+
key: 0,
|
|
7714
|
+
class: "ui-badge-pill-sm outline-secondary/80 outline-3 absolute -right-1.5 -top-1 outline"
|
|
7715
|
+
}, toDisplayString($setup.filtersCount), 1)) : createCommentVNode("", true)
|
|
7716
|
+
], 8, ["onClick"]),
|
|
7717
|
+
createVNode($setup["Listbox"], {
|
|
7718
|
+
modelValue: $setup.sortOption,
|
|
7719
|
+
"onUpdate:modelValue": ($event) => $setup.sortOption = $event,
|
|
7720
|
+
as: "div",
|
|
7721
|
+
class: "text-base-800 relative text-sm"
|
|
7722
|
+
}, {
|
|
7723
|
+
default: withCtx(() => [
|
|
7724
|
+
createVNode($setup["ListboxButton"], { class: "ui-btn-sm ui-btn-secondary" }, {
|
|
7725
|
+
default: withCtx(() => [
|
|
7726
|
+
createTextVNode(toDisplayString("Ordenar"))
|
|
7727
|
+
]),
|
|
7728
|
+
_: 1
|
|
7729
|
+
}),
|
|
7730
|
+
createVNode(_component_Fade, null, {
|
|
7731
|
+
default: withCtx(() => [
|
|
7732
|
+
createVNode($setup["ListboxOptions"], { class: "divide-base-100 absolute right-0 mt-2 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none" }, {
|
|
7733
|
+
default: withCtx(() => [
|
|
7734
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.sortOptions, ({ label, value }) => {
|
|
7735
|
+
return openBlock(), createBlock($setup["ListboxOption"], {
|
|
7736
|
+
key: value || "sort",
|
|
7737
|
+
value,
|
|
7738
|
+
as: "template"
|
|
7739
|
+
}, {
|
|
7740
|
+
default: withCtx(({ selected, active }) => [
|
|
7741
|
+
createVNode("li", null, [
|
|
7742
|
+
(openBlock(), createBlock(resolveDynamicComponent(selected ? "div" : "button"), {
|
|
7743
|
+
class: ["flex w-full py-2 pl-3 pr-6", !selected && active && "bg-secondary-100 text-secondary"]
|
|
7744
|
+
}, {
|
|
7745
|
+
default: withCtx(() => [
|
|
7746
|
+
createVNode("div", { class: "w-5" }, [
|
|
7747
|
+
withDirectives(createVNode("i", { class: "i-check" }, null, 512), [
|
|
7748
|
+
[vShow, selected]
|
|
7749
|
+
])
|
|
7750
|
+
]),
|
|
7751
|
+
createTextVNode(" " + toDisplayString(label), 1)
|
|
7752
|
+
]),
|
|
7753
|
+
_: 2
|
|
7754
|
+
}, 1032, ["class"]))
|
|
7755
|
+
])
|
|
7756
|
+
]),
|
|
7757
|
+
_: 2
|
|
7758
|
+
}, 1032, ["value"]);
|
|
7759
|
+
}), 128))
|
|
7760
|
+
]),
|
|
7761
|
+
_: 1
|
|
7762
|
+
})
|
|
7763
|
+
]),
|
|
7764
|
+
_: 1
|
|
7765
|
+
})
|
|
7766
|
+
]),
|
|
7767
|
+
_: 1
|
|
7768
|
+
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
7769
|
+
])
|
|
7770
|
+
])) : createCommentVNode("", true)
|
|
7771
|
+
];
|
|
7772
|
+
}
|
|
7773
|
+
}),
|
|
7774
|
+
_: 1
|
|
7775
|
+
}, _parent));
|
|
7776
|
+
_push(ssrRenderComponent($setup["ProductShelf"], {
|
|
7777
|
+
products: $setup.products,
|
|
7778
|
+
"is-grid": ""
|
|
7779
|
+
}, {
|
|
7780
|
+
append: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
7781
|
+
if (_push2) {
|
|
7782
|
+
_push2(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
7783
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
7784
|
+
if (_push3) {
|
|
7785
|
+
if (!$setup.isFetching && $setup.totalPages > 1) {
|
|
7786
|
+
_push3(`<nav class="mt-3 lg:mt-4"${_scopeId2}>`);
|
|
7787
|
+
_push3(ssrRenderComponent($setup["Pagination"], {
|
|
7788
|
+
page: $setup.searchEngine.pageNumber.value,
|
|
7789
|
+
"onUpdate:page": ($event) => $setup.searchEngine.pageNumber.value = $event,
|
|
7790
|
+
"total-pages": $setup.totalPages
|
|
7791
|
+
}, null, _parent3, _scopeId2));
|
|
7792
|
+
_push3(`</nav>`);
|
|
7793
|
+
} else {
|
|
7794
|
+
_push3(`<!---->`);
|
|
7795
|
+
}
|
|
7796
|
+
} else {
|
|
7797
|
+
return [
|
|
7798
|
+
!$setup.isFetching && $setup.totalPages > 1 ? (openBlock(), createBlock("nav", {
|
|
7799
|
+
key: 0,
|
|
7800
|
+
class: "mt-3 lg:mt-4"
|
|
7801
|
+
}, [
|
|
7802
|
+
createVNode($setup["Pagination"], {
|
|
7803
|
+
page: $setup.searchEngine.pageNumber.value,
|
|
7804
|
+
"onUpdate:page": ($event) => $setup.searchEngine.pageNumber.value = $event,
|
|
7805
|
+
"total-pages": $setup.totalPages
|
|
7806
|
+
}, null, 8, ["page", "onUpdate:page", "total-pages"])
|
|
7807
|
+
])) : createCommentVNode("", true)
|
|
7808
|
+
];
|
|
7809
|
+
}
|
|
7810
|
+
}),
|
|
7811
|
+
_: 1
|
|
7812
|
+
}, _parent2, _scopeId));
|
|
7813
|
+
} else {
|
|
7814
|
+
return [
|
|
7815
|
+
createVNode(_component_Fade, { slide: "down" }, {
|
|
7816
|
+
default: withCtx(() => [
|
|
7817
|
+
!$setup.isFetching && $setup.totalPages > 1 ? (openBlock(), createBlock("nav", {
|
|
7818
|
+
key: 0,
|
|
7819
|
+
class: "mt-3 lg:mt-4"
|
|
7820
|
+
}, [
|
|
7821
|
+
createVNode($setup["Pagination"], {
|
|
7822
|
+
page: $setup.searchEngine.pageNumber.value,
|
|
7823
|
+
"onUpdate:page": ($event) => $setup.searchEngine.pageNumber.value = $event,
|
|
7824
|
+
"total-pages": $setup.totalPages
|
|
7825
|
+
}, null, 8, ["page", "onUpdate:page", "total-pages"])
|
|
7826
|
+
])) : createCommentVNode("", true)
|
|
7827
|
+
]),
|
|
7828
|
+
_: 1
|
|
7829
|
+
})
|
|
7830
|
+
];
|
|
7831
|
+
}
|
|
7832
|
+
}),
|
|
7833
|
+
_: 1
|
|
7834
|
+
}, _parent));
|
|
7835
|
+
_push(ssrRenderComponent(_component_Fade, null, {
|
|
7836
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
7837
|
+
if (_push2) {
|
|
7838
|
+
if ($setup.isFetching) {
|
|
7839
|
+
_push2(`<div class="absolute left-0 top-0 z-[14] h-full w-full bg-white/40"${_scopeId}></div>`);
|
|
7840
|
+
} else {
|
|
7841
|
+
_push2(`<!---->`);
|
|
7842
|
+
}
|
|
7843
|
+
} else {
|
|
7844
|
+
return [
|
|
7845
|
+
$setup.isFetching ? (openBlock(), createBlock("div", {
|
|
7846
|
+
key: 0,
|
|
7847
|
+
class: "absolute left-0 top-0 z-[14] h-full w-full bg-white/40"
|
|
7848
|
+
})) : createCommentVNode("", true)
|
|
7849
|
+
];
|
|
7850
|
+
}
|
|
7851
|
+
}),
|
|
7852
|
+
_: 1
|
|
7853
|
+
}, _parent));
|
|
7854
|
+
_push(`</article>`);
|
|
7855
|
+
_push(ssrRenderComponent($setup["Drawer"], {
|
|
7856
|
+
modelValue: $setup.isFiltersOpen,
|
|
7857
|
+
"onUpdate:modelValue": ($event) => $setup.isFiltersOpen = $event,
|
|
7858
|
+
placement: "end",
|
|
7859
|
+
"backdrop-target": null,
|
|
7860
|
+
"can-lock-scroll": false,
|
|
7861
|
+
class: "!z-[80] bg-white shadow [&_[data-drawer-close]]:bg-white/80"
|
|
7862
|
+
}, {
|
|
6617
7863
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
6618
7864
|
if (_push2) {
|
|
6619
|
-
_push2(ssrRenderComponent($setup["
|
|
7865
|
+
_push2(ssrRenderComponent($setup["SearchFilters"], { "search-engine": $setup.searchEngine }, null, _parent2, _scopeId));
|
|
6620
7866
|
} else {
|
|
6621
7867
|
return [
|
|
6622
|
-
createVNode($setup["
|
|
7868
|
+
createVNode($setup["SearchFilters"], { "search-engine": $setup.searchEngine }, null, 8, ["search-engine"])
|
|
6623
7869
|
];
|
|
6624
7870
|
}
|
|
6625
7871
|
}),
|
|
@@ -6630,10 +7876,10 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
|
|
|
6630
7876
|
const _sfc_setup = _sfc_main.setup;
|
|
6631
7877
|
_sfc_main.setup = (props, ctx) => {
|
|
6632
7878
|
const ssrContext = useSSRContext();
|
|
6633
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/
|
|
7879
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SearchShowcase.vue");
|
|
6634
7880
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
6635
7881
|
};
|
|
6636
|
-
const
|
|
7882
|
+
const SearchShowcase = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
6637
7883
|
|
|
6638
7884
|
const $$Astro$3 = createAstro("https://demo.ecomplus.app");
|
|
6639
7885
|
const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
|
|
@@ -6649,26 +7895,32 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
6649
7895
|
}
|
|
6650
7896
|
});
|
|
6651
7897
|
const { isHomepage } = routeContext;
|
|
6652
|
-
return renderTemplate`${maybeRenderHead()}<article class="
|
|
7898
|
+
return renderTemplate`${maybeRenderHead()}<article class="mt-6 mb-9 md:mt-8 md:mb-12">
|
|
6653
7899
|
${sections.map(async ({ type, props }) => {
|
|
6654
7900
|
switch (type) {
|
|
6655
7901
|
case "product-shelf":
|
|
6656
7902
|
return isHomepage ? renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}` : renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
|
|
7903
|
+
case "related-products":
|
|
7904
|
+
props.isRelatedProducts = true;
|
|
7905
|
+
return renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
|
|
6657
7906
|
case "banners-grid":
|
|
6658
7907
|
return renderTemplate`${renderComponent($$result, "BannersGrid", $$BannersGrid, { ...props })}`;
|
|
6659
7908
|
case "breadcrumbs":
|
|
6660
7909
|
return renderTemplate`${renderComponent($$result, "Breadcrumbs", $$Breadcrumbs, {})}`;
|
|
6661
7910
|
case "doc-description":
|
|
6662
7911
|
return renderTemplate`${renderComponent($$result, "DocDescription", DocDescription, {})}`;
|
|
7912
|
+
case "doc-banners":
|
|
7913
|
+
return renderTemplate`${renderComponent($$result, "DocBanners", DocBanners, {})}`;
|
|
6663
7914
|
case "product-details":
|
|
6664
7915
|
const { hasDescription, hasSpecifications, ...detailsProps } = props;
|
|
6665
7916
|
return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
|
|
6666
7917
|
${renderComponent($$result2, "ProductDetails", ProductDetails, { ...detailsProps, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/ProductDetails.vue", "client:component-export": "default" }, { "description": ($$result3) => renderTemplate`${renderComponent($$result3, "Fragment", Fragment, { "slot": "description" }, { "default": ($$result4) => renderTemplate`${hasDescription && renderTemplate`${renderComponent($$result4, "DocDescription", DocDescription, {})}`}${hasSpecifications && renderTemplate`${renderComponent($$result4, "ProductSpecifications", ProductSpecifications, {})}`}` })}` })}
|
|
6667
7918
|
` })}`;
|
|
6668
|
-
case "search-
|
|
7919
|
+
case "search-showcase":
|
|
7920
|
+
case "context-showcase":
|
|
6669
7921
|
return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
|
|
6670
7922
|
<article class="min-h-[500px]">
|
|
6671
|
-
${renderComponent($$result2, "
|
|
7923
|
+
${renderComponent($$result2, "SearchShowcase", SearchShowcase, { ...props, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/SearchShowcase.vue", "client:component-export": "default" })}
|
|
6672
7924
|
</article>
|
|
6673
7925
|
` })}`;
|
|
6674
7926
|
case "c:foo":
|
|
@@ -6688,8 +7940,8 @@ const $$Astro$2 = createAstro("https://demo.ecomplus.app");
|
|
|
6688
7940
|
const $$SharedData = createComponent(async ($$result, $$props, $$slots) => {
|
|
6689
7941
|
const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
|
|
6690
7942
|
Astro2.self = $$SharedData;
|
|
6691
|
-
const {
|
|
6692
|
-
return renderTemplate(_a || (_a = __template(["<script>", "<\/script>"])), unescapeHTML(
|
|
7943
|
+
const { getInlineClientJS } = await useSharedData(Astro2.props);
|
|
7944
|
+
return renderTemplate(_a || (_a = __template(["<script>", "<\/script>"])), unescapeHTML(getInlineClientJS()));
|
|
6693
7945
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/SharedData.astro", void 0);
|
|
6694
7946
|
|
|
6695
7947
|
const $$Astro$1 = createAstro("https://demo.ecomplus.app");
|