cloudcommerce 2.6.2 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test-apps.yml +1 -1
- package/CHANGELOG.md +21 -0
- package/README.md +2 -0
- package/ecomplus-stores/barradoce/functions/many/package.json +3 -3
- package/ecomplus-stores/barradoce/functions/ssr/content/reviews.json +71 -0
- package/ecomplus-stores/barradoce/functions/ssr/content/types.d.ts +5 -0
- package/ecomplus-stores/barradoce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barradoce/functions/ssr/src/components/ProductDetails.vue +2 -1
- package/ecomplus-stores/barradoce/functions/ssr/src/env.d.ts +1 -0
- package/ecomplus-stores/barradoce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barradoce/package.json +2 -2
- package/package.json +7 -7
- package/packages/api/package.json +1 -1
- package/packages/apps/affiliate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/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 +1 -1
- package/packages/apps/mandae/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +2 -2
- package/packages/apps/pagarme-v5/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +2 -2
- package/packages/eslint/package.json +6 -6
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +2 -2
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/lib/lib/cron-ssr-save-views.js +71 -66
- package/packages/ssr/lib/lib/cron-ssr-save-views.js.map +1 -1
- package/packages/ssr/package.json +6 -6
- package/packages/ssr/src/lib/cron-ssr-save-views.ts +84 -77
- package/packages/storefront/dist/client/_astro/AccountPage.B4WZaOzX.js +1 -0
- package/packages/storefront/dist/client/_astro/CartSidebar.DAGdpIcU.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.Dq_9kcdU.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.BwLlIs6F.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.BgHTq5id.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.CnYNdPl5.js +7 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.kfADQTUO.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.DcmvABes.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchShowcase.C9GWwOnF.js +1 -0
- package/packages/storefront/dist/client/_astro/ShippingCalculator.DE01D7dt.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.Cf4t6O6z.js +7 -0
- package/packages/storefront/dist/client/_astro/_commonjsHelpers.Cpj98o6Y.js +1 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.CBemkWnU.js +5 -0
- package/packages/storefront/dist/client/_astro/{_slug_.4W7qhV-L.css → _slug_.DX_OkMX7.css} +1 -1
- package/packages/storefront/dist/client/_astro/{afetch.OifQZgwR.js → afetch.DPLba2tr.js} +1 -1
- package/packages/storefront/dist/client/_astro/client.CdXC84C5.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session.CNe1heRH.js +7 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.iLdzDVjL.js → firebase-app.CBckq0Sj.js} +1 -1
- package/packages/storefront/dist/client/_astro/{format-money.1_HtF5S2.js → format-money.DINpWB0x.js} +1 -1
- package/packages/storefront/dist/client/_astro/grid-title.D4m7-g3h.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.B2rH1xwX.js +8 -0
- package/packages/storefront/dist/client/_astro/hoisted.DBPXHTEb.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.EBqhuD5o.js +1 -0
- package/packages/storefront/dist/client/_astro/{hoisted.GaT7bmE3.js → hoisted.ut_nNM_H.js} +1 -1
- package/packages/storefront/dist/client/_astro/i18n.B3skIOFg.js +1 -0
- package/packages/storefront/dist/client/_astro/img-sizes.rFK7so02.js +1 -0
- package/packages/storefront/dist/client/_astro/img.D5a6GzeE.js +1 -0
- package/packages/storefront/dist/client/_astro/index.CFw6O-Kt.js +1 -0
- package/packages/storefront/dist/client/_astro/index.DBfgCyd-.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.HP6478mG.js → modules-info.BHKiT6oA.js} +1 -1
- package/packages/storefront/dist/client/_astro/name.BZA9xqh-.js +1 -0
- package/packages/storefront/dist/client/_astro/photoswipe.esm.C0FT-EY-.js +4 -0
- package/packages/storefront/dist/client/_astro/price.CHiL6Z1J.js +1 -0
- package/packages/storefront/dist/client/_astro/sf-utils.Cigv01cN.js +13 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.D-w8Z-4p.js +1 -0
- package/packages/storefront/dist/client/_astro/use-analytics.CQDdNgwF.js +1 -0
- package/packages/storefront/dist/client/_astro/use-cms-preview.4Hq7LCmA.js +1 -0
- package/packages/storefront/dist/client/_astro/use-product-card.CQRlRsNX.js +1 -0
- package/packages/storefront/dist/client/_astro/use-text-value.UjCYLWjm.js +4 -0
- package/packages/storefront/dist/client/img/uploads/logo.png +0 -0
- package/packages/storefront/dist/server/chunks/{CartSidebar_3_1aFp67.mjs → CartSidebar_BmwcZuxv.mjs} +36 -4
- package/packages/storefront/dist/server/chunks/{SearchModal_2azP1u7P.mjs → SearchModal_BvEnUvAx.mjs} +4 -3
- package/packages/storefront/dist/server/chunks/_.._DORZHe_Z.mjs +5 -0
- package/packages/storefront/dist/server/chunks/{_page__qqIVxbal.mjs → _page__DU3kNewy.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{account_vK6pmJlz.mjs → account_CaTloREf.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/astro/{assets-service_631fRtTy.mjs → assets-service_B77Hm2ue.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/{astro_u-oSb215.mjs → astro_ISB6VLqs.mjs} +178 -59
- package/packages/storefront/dist/server/chunks/index_BTDpenpc.mjs +5 -0
- package/packages/storefront/dist/server/chunks/index_D0q4ab_n.mjs +5 -0
- package/packages/storefront/dist/server/chunks/{node_zqXXqc-u.mjs → node_C7sdLKL4.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{__ZucPYaOo.mjs → __B4CsSrck.mjs} +1751 -344
- package/packages/storefront/dist/server/chunks/pages/{_page__0sN9U0SD.mjs → _page__sb5Idhgp.mjs} +2 -3
- package/packages/storefront/dist/server/chunks/pages/{account_OQr_6KN1.mjs → account_iWjHfkwu.mjs} +2 -3
- package/packages/storefront/dist/server/chunks/pages/{index_3IjgOEIq.mjs → index_BZlpKBRL.mjs} +41 -4
- package/packages/storefront/dist/server/chunks/pages/node_GFu-CQ19.mjs +852 -0
- package/packages/storefront/dist/server/chunks/pages/{~fallback_133FK-CP.mjs → ~fallback_C07rzeay.mjs} +2 -3
- package/packages/storefront/dist/server/chunks/{index__05fnqFh.mjs → ~fallback_YpJa9BIL.mjs} +1 -1
- package/packages/storefront/dist/server/entry.mjs +751 -912
- package/packages/storefront/dist/server/manifest_KFjAaJaC.mjs +201 -0
- package/packages/storefront/dist/server/renderers.mjs +1 -1
- package/packages/storefront/package.json +8 -8
- package/packages/storefront/src/lib/composables/use-breadcrumbs.ts +2 -1
- package/packages/storefront/src/lib/composables/use-search-showcase.ts +2 -1
- package/packages/storefront/src/lib/content.d.ts +4 -1
- package/packages/storefront/src/lib/custom-content.d.ts +9 -0
- package/packages/storefront/src/lib/ssr-context.ts +6 -4
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/client/_astro/AccountPage.0M6_FdU6.js +0 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.L0Vbhsdt.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.ju9TsLrJ.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.yqD9ycx5.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.xI1rdM1e.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.FQtM5kpd.js +0 -7
- package/packages/storefront/dist/client/_astro/ProductShelf.-4fsYkPB.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.GAAhKdTN.js +0 -1
- package/packages/storefront/dist/client/_astro/QuantitySelector.v7L8EYOR.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.rasg5jV6.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchShowcase.kA6jICYo.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.v_L96Y90.js +0 -7
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.xATGHWd9.js +0 -5
- package/packages/storefront/dist/client/_astro/client.YJ00ta5M.js +0 -1
- package/packages/storefront/dist/client/_astro/customer-session.ZD6tLDQJ.js +0 -7
- package/packages/storefront/dist/client/_astro/grid-title.pK2Nn3i-.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.ICXGWNEA.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.XOXTrHqn.js +0 -1
- package/packages/storefront/dist/client/_astro/i18n.zhlBzJt8.js +0 -1
- package/packages/storefront/dist/client/_astro/img-sizes.gxAI9JNh.js +0 -1
- package/packages/storefront/dist/client/_astro/img.AnjeGdy_.js +0 -1
- package/packages/storefront/dist/client/_astro/index.KfrHdfOH.js +0 -1
- package/packages/storefront/dist/client/_astro/index.ShNlAyu1.js +0 -1
- package/packages/storefront/dist/client/_astro/name.VA3MEpe0.js +0 -1
- package/packages/storefront/dist/client/_astro/photoswipe.esm.Ylh9TGkz.js +0 -4
- package/packages/storefront/dist/client/_astro/price.Easct8WC.js +0 -1
- package/packages/storefront/dist/client/_astro/sf-utils.c42cbZ9W.js +0 -13
- package/packages/storefront/dist/client/_astro/shopping-cart.nSNNOrp9.js +0 -1
- package/packages/storefront/dist/client/_astro/use-analytics.wTmoP8B1.js +0 -1
- package/packages/storefront/dist/client/_astro/use-product-card.UFr8SCuD.js +0 -1
- package/packages/storefront/dist/client/_astro/use-text-value.lKqoIagH.js +0 -4
- package/packages/storefront/dist/server/chunks/_.._19fCuQdO.mjs +0 -5
- package/packages/storefront/dist/server/chunks/pages/node_OmjWRf8D.mjs +0 -112
- package/packages/storefront/dist/server/chunks/~fallback_Wahcp9Wk.mjs +0 -5
- package/packages/storefront/dist/server/manifest_9FASPYUE.mjs +0 -202
- /package/packages/storefront/dist/client/_astro/{index-bea2a320.eWykogwr.js → index-bea2a320.CHELEM8n.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{photoswipe-lightbox.esm.dZBqKD9u.js → photoswipe-lightbox.esm.BbYxSZIB.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{photoswipe.0V7m2jWu.js → photoswipe.CNpEZKfy.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{server-data.4C60Esyt.js → server-data.CUHTES8a.js} +0 -0
- /package/packages/storefront/dist/server/chunks/{photoswipe_IcWDJiwc.mjs → photoswipe_wusPJBJF.mjs} +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import 'cookie';
|
|
2
|
+
import { bold, red, yellow, dim, blue } from 'kleur/colors';
|
|
3
|
+
import 'string-width';
|
|
4
|
+
import '@astrojs/internal-helpers/path';
|
|
5
|
+
import './chunks/astro_ISB6VLqs.mjs';
|
|
6
|
+
import 'clsx';
|
|
7
|
+
import { compile } from 'path-to-regexp';
|
|
8
|
+
|
|
9
|
+
const dateTimeFormat = new Intl.DateTimeFormat([], {
|
|
10
|
+
hour: "2-digit",
|
|
11
|
+
minute: "2-digit",
|
|
12
|
+
second: "2-digit",
|
|
13
|
+
hour12: false
|
|
14
|
+
});
|
|
15
|
+
const levels = {
|
|
16
|
+
debug: 20,
|
|
17
|
+
info: 30,
|
|
18
|
+
warn: 40,
|
|
19
|
+
error: 50,
|
|
20
|
+
silent: 90
|
|
21
|
+
};
|
|
22
|
+
function log(opts, level, label, message, newLine = true) {
|
|
23
|
+
const logLevel = opts.level;
|
|
24
|
+
const dest = opts.dest;
|
|
25
|
+
const event = {
|
|
26
|
+
label,
|
|
27
|
+
level,
|
|
28
|
+
message,
|
|
29
|
+
newLine
|
|
30
|
+
};
|
|
31
|
+
if (!isLogLevelEnabled(logLevel, level)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
dest.write(event);
|
|
35
|
+
}
|
|
36
|
+
function isLogLevelEnabled(configuredLogLevel, level) {
|
|
37
|
+
return levels[configuredLogLevel] <= levels[level];
|
|
38
|
+
}
|
|
39
|
+
function info(opts, label, message, newLine = true) {
|
|
40
|
+
return log(opts, "info", label, message, newLine);
|
|
41
|
+
}
|
|
42
|
+
function warn(opts, label, message, newLine = true) {
|
|
43
|
+
return log(opts, "warn", label, message, newLine);
|
|
44
|
+
}
|
|
45
|
+
function error(opts, label, message, newLine = true) {
|
|
46
|
+
return log(opts, "error", label, message, newLine);
|
|
47
|
+
}
|
|
48
|
+
function debug(...args) {
|
|
49
|
+
if ("_astroGlobalDebug" in globalThis) {
|
|
50
|
+
globalThis._astroGlobalDebug(...args);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function getEventPrefix({ level, label }) {
|
|
54
|
+
const timestamp = `${dateTimeFormat.format(/* @__PURE__ */ new Date())}`;
|
|
55
|
+
const prefix = [];
|
|
56
|
+
if (level === "error" || level === "warn") {
|
|
57
|
+
prefix.push(bold(timestamp));
|
|
58
|
+
prefix.push(`[${level.toUpperCase()}]`);
|
|
59
|
+
} else {
|
|
60
|
+
prefix.push(timestamp);
|
|
61
|
+
}
|
|
62
|
+
if (label) {
|
|
63
|
+
prefix.push(`[${label}]`);
|
|
64
|
+
}
|
|
65
|
+
if (level === "error") {
|
|
66
|
+
return red(prefix.join(" "));
|
|
67
|
+
}
|
|
68
|
+
if (level === "warn") {
|
|
69
|
+
return yellow(prefix.join(" "));
|
|
70
|
+
}
|
|
71
|
+
if (prefix.length === 1) {
|
|
72
|
+
return dim(prefix[0]);
|
|
73
|
+
}
|
|
74
|
+
return dim(prefix[0]) + " " + blue(prefix.splice(1).join(" "));
|
|
75
|
+
}
|
|
76
|
+
if (typeof process !== "undefined") {
|
|
77
|
+
let proc = process;
|
|
78
|
+
if ("argv" in proc && Array.isArray(proc.argv)) {
|
|
79
|
+
if (proc.argv.includes("--verbose")) ; else if (proc.argv.includes("--silent")) ; else ;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
class Logger {
|
|
83
|
+
options;
|
|
84
|
+
constructor(options) {
|
|
85
|
+
this.options = options;
|
|
86
|
+
}
|
|
87
|
+
info(label, message, newLine = true) {
|
|
88
|
+
info(this.options, label, message, newLine);
|
|
89
|
+
}
|
|
90
|
+
warn(label, message, newLine = true) {
|
|
91
|
+
warn(this.options, label, message, newLine);
|
|
92
|
+
}
|
|
93
|
+
error(label, message, newLine = true) {
|
|
94
|
+
error(this.options, label, message, newLine);
|
|
95
|
+
}
|
|
96
|
+
debug(label, ...messages) {
|
|
97
|
+
debug(label, ...messages);
|
|
98
|
+
}
|
|
99
|
+
level() {
|
|
100
|
+
return this.options.level;
|
|
101
|
+
}
|
|
102
|
+
forkIntegrationLogger(label) {
|
|
103
|
+
return new AstroIntegrationLogger(this.options, label);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
class AstroIntegrationLogger {
|
|
107
|
+
options;
|
|
108
|
+
label;
|
|
109
|
+
constructor(logging, label) {
|
|
110
|
+
this.options = logging;
|
|
111
|
+
this.label = label;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Creates a new logger instance with a new label, but the same log options.
|
|
115
|
+
*/
|
|
116
|
+
fork(label) {
|
|
117
|
+
return new AstroIntegrationLogger(this.options, label);
|
|
118
|
+
}
|
|
119
|
+
info(message) {
|
|
120
|
+
info(this.options, this.label, message);
|
|
121
|
+
}
|
|
122
|
+
warn(message) {
|
|
123
|
+
warn(this.options, this.label, message);
|
|
124
|
+
}
|
|
125
|
+
error(message) {
|
|
126
|
+
error(this.options, this.label, message);
|
|
127
|
+
}
|
|
128
|
+
debug(message) {
|
|
129
|
+
debug(this.label, message);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getRouteGenerator(segments, addTrailingSlash) {
|
|
134
|
+
const template = segments.map((segment) => {
|
|
135
|
+
return "/" + segment.map((part) => {
|
|
136
|
+
if (part.spread) {
|
|
137
|
+
return `:${part.content.slice(3)}(.*)?`;
|
|
138
|
+
} else if (part.dynamic) {
|
|
139
|
+
return `:${part.content}`;
|
|
140
|
+
} else {
|
|
141
|
+
return part.content.normalize().replace(/\?/g, "%3F").replace(/#/g, "%23").replace(/%5B/g, "[").replace(/%5D/g, "]").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
142
|
+
}
|
|
143
|
+
}).join("");
|
|
144
|
+
}).join("");
|
|
145
|
+
let trailing = "";
|
|
146
|
+
if (addTrailingSlash === "always" && segments.length) {
|
|
147
|
+
trailing = "/";
|
|
148
|
+
}
|
|
149
|
+
const toPath = compile(template + trailing);
|
|
150
|
+
return toPath;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function deserializeRouteData(rawRouteData) {
|
|
154
|
+
return {
|
|
155
|
+
route: rawRouteData.route,
|
|
156
|
+
type: rawRouteData.type,
|
|
157
|
+
pattern: new RegExp(rawRouteData.pattern),
|
|
158
|
+
params: rawRouteData.params,
|
|
159
|
+
component: rawRouteData.component,
|
|
160
|
+
generate: getRouteGenerator(rawRouteData.segments, rawRouteData._meta.trailingSlash),
|
|
161
|
+
pathname: rawRouteData.pathname || void 0,
|
|
162
|
+
segments: rawRouteData.segments,
|
|
163
|
+
prerender: rawRouteData.prerender,
|
|
164
|
+
redirect: rawRouteData.redirect,
|
|
165
|
+
redirectRoute: rawRouteData.redirectRoute ? deserializeRouteData(rawRouteData.redirectRoute) : void 0,
|
|
166
|
+
fallbackRoutes: rawRouteData.fallbackRoutes.map((fallback) => {
|
|
167
|
+
return deserializeRouteData(fallback);
|
|
168
|
+
}),
|
|
169
|
+
isIndex: rawRouteData.isIndex
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function deserializeManifest(serializedManifest) {
|
|
174
|
+
const routes = [];
|
|
175
|
+
for (const serializedRoute of serializedManifest.routes) {
|
|
176
|
+
routes.push({
|
|
177
|
+
...serializedRoute,
|
|
178
|
+
routeData: deserializeRouteData(serializedRoute.routeData)
|
|
179
|
+
});
|
|
180
|
+
const route = serializedRoute;
|
|
181
|
+
route.routeData = deserializeRouteData(serializedRoute.routeData);
|
|
182
|
+
}
|
|
183
|
+
const assets = new Set(serializedManifest.assets);
|
|
184
|
+
const componentMetadata = new Map(serializedManifest.componentMetadata);
|
|
185
|
+
const clientDirectives = new Map(serializedManifest.clientDirectives);
|
|
186
|
+
return {
|
|
187
|
+
// in case user middleware exists, this no-op middleware will be reassigned (see plugin-ssr.ts)
|
|
188
|
+
middleware(_, next) {
|
|
189
|
+
return next();
|
|
190
|
+
},
|
|
191
|
+
...serializedManifest,
|
|
192
|
+
assets,
|
|
193
|
+
componentMetadata,
|
|
194
|
+
clientDirectives,
|
|
195
|
+
routes
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const manifest = deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","isIndex":false,"route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/astro@4.4.4_@types+node@18.19.18_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node.js","pathname":"/_image","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.DBPXHTEb.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.DX_OkMX7.css"}],"routeData":{"route":"/~fallback","isIndex":false,"type":"page","pattern":"^\\/~fallback\\/?$","segments":[[{"content":"~fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/~fallback.astro","pathname":"/~fallback","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.B2rH1xwX.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.DX_OkMX7.css"}],"routeData":{"route":"/admin","isIndex":true,"type":"page","pattern":"^\\/admin\\/?$","segments":[[{"content":"admin","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/admin/index.astro","pathname":"/admin","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.ut_nNM_H.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.DX_OkMX7.css"}],"routeData":{"route":"/app/account","isIndex":false,"type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.EBqhuD5o.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.DX_OkMX7.css"}],"routeData":{"route":"/app","isIndex":true,"type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.ut_nNM_H.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.DX_OkMX7.css"}],"routeData":{"route":"/blog/[page]","isIndex":false,"type":"page","pattern":"^\\/blog\\/([^/]+?)\\/?$","segments":[[{"content":"blog","dynamic":false,"spread":false}],[{"content":"page","dynamic":true,"spread":false}]],"params":["page"],"component":"src/pages/blog/[page].astro","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.ut_nNM_H.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.DX_OkMX7.css"}],"routeData":{"route":"/[...slug]","isIndex":false,"type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}}],"site":"https://demo.ecomplus.app","base":"/","trailingSlash":"ignore","compressHTML":false,"componentMetadata":[["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/[...slug]@_@astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astrojs-ssr-virtual-entry",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/admin/index.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/admin/index@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/account.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/app/account@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/app/index@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/blog/[page].astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/blog/[page]@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/~fallback.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/~fallback@_@astro",{"propagation":"in-tree","containsHead":false}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var l=(s,i,o)=>{let r=async()=>{await(await s())()},t=typeof i.value==\"object\"?i.value:void 0,c={rootMargin:t==null?void 0:t.rootMargin},n=new IntersectionObserver(e=>{for(let a of e)if(a.isIntersecting){n.disconnect(),r();break}},c);for(let e of o.children)n.observe(e)};(self.Astro||(self.Astro={})).visible=l;window.dispatchEvent(new Event(\"astro:visible\"));})();"],["context","(()=>{var w=r=>new Promise(n=>{let i={},t=new IntersectionObserver(o=>{for(let d of o)if(d.isIntersecting){t.disconnect(),n();break}},i);for(let o of r.children)t.observe(o)}),v=new Promise(r=>{let n=new AbortController;[\"keydown\",\"mousemove\",\"pointerdown\",\"touchstart\",\"scroll\"].forEach(i=>{document.addEventListener(i,()=>{r(),n.abort()},{once:!0,passive:!0,signal:n.signal})})}),f=(r,n,i)=>{let t=(Array.isArray(n.value)?n.value:[n.value]).reduce((e,s)=>(typeof s==\"string\"&&s.split(\",\").forEach(u=>{e.push(u)}),e),[]),o=!t.length||t.includes(\"lazy\"),d=!o&&t.includes(\"eager\"),c=async()=>{t.includes(\"interaction\")&&await v,await(await r())()},a=async()=>{for(let e=0;e<t.length;e++)if(typeof t[e]==\"string\"&&t[e].startsWith(\"data:\")){let s=t[e].substring(5);if(!window.$storefront?.data?.[s]){window.addEventListener(`storefront:data:${s}`,a,{once:!0});return}}if(o&&await w(i),o||t.includes(\"idle\")){if(typeof window.requestIdleCallback==\"function\"){window.requestIdleCallback(c);return}setTimeout(c,100);return}c()};if(d){a();return}let l=window.$storefront?.apiContext?.doc._id||null;if(window._firstLoadContextId===l&&window._emitedContextId===l){a(),document.addEventListener(\"astro:beforeload\",()=>{delete window._firstLoadContextId},{once:!0});return}window.addEventListener(\"storefront:apiContext\",a,{once:!0})};(self.Astro||(self.Astro={})).context=f;window.dispatchEvent(new Event(\"astro:context\"));})();\n"],["sf","(()=>{var w=r=>new Promise(n=>{let i={},t=new IntersectionObserver(o=>{for(let d of o)if(d.isIntersecting){t.disconnect(),n();break}},i);for(let o of r.children)t.observe(o)}),v=new Promise(r=>{let n=new AbortController;[\"keydown\",\"mousemove\",\"pointerdown\",\"touchstart\",\"scroll\"].forEach(i=>{document.addEventListener(i,()=>{r(),n.abort()},{once:!0,passive:!0,signal:n.signal})})}),f=(r,n,i)=>{let t=(Array.isArray(n.value)?n.value:[n.value]).reduce((e,s)=>(typeof s==\"string\"&&s.split(\",\").forEach(u=>{e.push(u)}),e),[]),o=!t.length||t.includes(\"lazy\"),d=!o&&t.includes(\"eager\"),c=async()=>{t.includes(\"interaction\")&&await v,await(await r())()},a=async()=>{for(let e=0;e<t.length;e++)if(typeof t[e]==\"string\"&&t[e].startsWith(\"data:\")){let s=t[e].substring(5);if(!window.$storefront?.data?.[s]){window.addEventListener(`storefront:data:${s}`,a,{once:!0});return}}if(o&&await w(i),o||t.includes(\"idle\")){if(typeof window.requestIdleCallback==\"function\"){window.requestIdleCallback(c);return}setTimeout(c,100);return}c()};if(d){a();return}let l=window.$storefront?.apiContext?.doc._id||null;if(window._firstLoadContextId===l&&window._emitedContextId===l){a(),document.addEventListener(\"astro:beforeload\",()=>{delete window._firstLoadContextId},{once:!0});return}window.addEventListener(\"storefront:apiContext\",a,{once:!0})};(self.Astro||(self.Astro={})).sf=f;window.dispatchEvent(new Event(\"astro:sf\"));})();\n"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000noop-middleware":"_noop-middleware.mjs","/src/pages/blog/[page].astro":"chunks/pages/_page__sb5Idhgp.mjs","/src/pages/app/account.astro":"chunks/pages/account_iWjHfkwu.mjs","/../../node_modules/.pnpm/astro@4.4.4_@types+node@18.19.18_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node.js":"chunks/pages/node_GFu-CQ19.mjs","/src/pages/~fallback.astro":"chunks/pages/~fallback_C07rzeay.mjs","\u0000@astrojs-manifest":"manifest_KFjAaJaC.mjs","\u0000@astro-page:../../node_modules/.pnpm/astro@4.4.4_@types+node@18.19.18_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_C7sdLKL4.mjs","\u0000@astro-page:src/pages/~fallback@_@astro":"chunks/~fallback_YpJa9BIL.mjs","\u0000@astro-page:src/pages/admin/index@_@astro":"chunks/index_BTDpenpc.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account_CaTloREf.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index_D0q4ab_n.mjs","\u0000@astro-page:src/pages/blog/[page]@_@astro":"chunks/_page__DU3kNewy.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_.._DORZHe_Z.mjs","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/SearchModal.vue":"_astro/SearchModal.DcmvABes.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/CartSidebar.vue":"_astro/CartSidebar.DAGdpIcU.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.css?inline":"_astro/photoswipe.CNpEZKfy.js","/astro/hoisted.js?q=2":"_astro/hoisted.DBPXHTEb.js","~/components/PitchBar.vue":"_astro/PitchBar.BwLlIs6F.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe-lightbox.esm.js":"_astro/photoswipe-lightbox.esm.BbYxSZIB.js","@astrojs/vue/client.js":"_astro/client.CdXC84C5.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.CBckq0Sj.js","/astro/hoisted.js?q=1":"_astro/hoisted.EBqhuD5o.js","~/components/ProductShelf.vue":"_astro/ProductShelf.kfADQTUO.js","/astro/hoisted.js?q=3":"_astro/hoisted.ut_nNM_H.js","~/components/SearchShowcase.vue":"_astro/SearchShowcase.C9GWwOnF.js","/astro/hoisted.js?q=0":"_astro/hoisted.B2rH1xwX.js","~/components/HeroSlider.vue":"_astro/HeroSlider.Dq_9kcdU.js","~/components/AccountPage.vue":"_astro/AccountPage.B4WZaOzX.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.esm.js":"_astro/photoswipe.esm.C0FT-EY-.js","~/components/ShopHeader.vue":"_astro/ShopHeader.Cf4t6O6z.js","~/components/ProductDetails.vue":"_astro/ProductDetails.CnYNdPl5.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/_slug_.DX_OkMX7.css","/robots.txt","/_astro/AccountPage.B4WZaOzX.js","/_astro/CartSidebar.DAGdpIcU.js","/_astro/HeroSlider.Dq_9kcdU.js","/_astro/PitchBar.BwLlIs6F.js","/_astro/Prices.BgHTq5id.js","/_astro/ProductDetails.CnYNdPl5.js","/_astro/ProductShelf.kfADQTUO.js","/_astro/SearchModal.DcmvABes.js","/_astro/SearchShowcase.C9GWwOnF.js","/_astro/ShippingCalculator.DE01D7dt.js","/_astro/ShopHeader.Cf4t6O6z.js","/_astro/_commonjsHelpers.Cpj98o6Y.js","/_astro/_plugin-vue_export-helper.CBemkWnU.js","/_astro/afetch.DPLba2tr.js","/_astro/client.CdXC84C5.js","/_astro/customer-session.CNe1heRH.js","/_astro/firebase-app.CBckq0Sj.js","/_astro/format-money.DINpWB0x.js","/_astro/grid-title.D4m7-g3h.js","/_astro/hoisted.B2rH1xwX.js","/_astro/hoisted.DBPXHTEb.js","/_astro/hoisted.EBqhuD5o.js","/_astro/hoisted.ut_nNM_H.js","/_astro/i18n.B3skIOFg.js","/_astro/img-sizes.rFK7so02.js","/_astro/img.D5a6GzeE.js","/_astro/index-bea2a320.CHELEM8n.js","/_astro/index.CFw6O-Kt.js","/_astro/index.DBfgCyd-.js","/_astro/modules-info.BHKiT6oA.js","/_astro/name.BZA9xqh-.js","/_astro/photoswipe-lightbox.esm.BbYxSZIB.js","/_astro/photoswipe.CNpEZKfy.js","/_astro/photoswipe.esm.C0FT-EY-.js","/_astro/price.CHiL6Z1J.js","/_astro/server-data.CUHTES8a.js","/_astro/sf-utils.Cigv01cN.js","/_astro/shopping-cart.D-w8Z-4p.js","/_astro/use-analytics.CQDdNgwF.js","/_astro/use-cms-preview.4Hq7LCmA.js","/_astro/use-product-card.CQRlRsNX.js","/_astro/use-text-value.UjCYLWjm.js","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp"],"buildFormat":"directory"});
|
|
200
|
+
|
|
201
|
+
export { AstroIntegrationLogger as A, Logger as L, getEventPrefix as g, levels as l, manifest };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, createSSRApp } from 'vue';
|
|
2
2
|
import { renderToString } from 'vue/server-renderer';
|
|
3
|
-
import { o as mod, p as createApp } from './chunks/pages/
|
|
3
|
+
import { o as mod, p as createApp } from './chunks/pages/__B4CsSrck.mjs';
|
|
4
4
|
|
|
5
5
|
const setup = async (app) => {
|
|
6
6
|
if ('default' in mod) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.6.
|
|
4
|
+
"version": "2.6.4",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"bin": {
|
|
7
7
|
"storefront": "./scripts/build-prod.sh"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lint:fix": "eslint -c ../eslint/storefront.staged.eslintrc.cjs src/lib/**/*.{ts,vue,astro} --fix"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@astrojs/node": "8.2.
|
|
33
|
+
"@astrojs/node": "8.2.1",
|
|
34
34
|
"@astrojs/vue": "4.0.8",
|
|
35
35
|
"@cloudcommerce/api": "workspace:*",
|
|
36
36
|
"@cloudcommerce/config": "workspace:*",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"@vite-pwa/astro": "^0.3.0",
|
|
45
45
|
"@vueuse/core": "10.8.0",
|
|
46
46
|
"@webcontainer/api": "^1.1.9",
|
|
47
|
-
"astro": "4.4.
|
|
47
|
+
"astro": "4.4.4",
|
|
48
48
|
"astro-capo": "^0.0.1",
|
|
49
49
|
"chroma-js": "^2.4.2",
|
|
50
|
-
"dotenv": "^16.4.
|
|
50
|
+
"dotenv": "^16.4.5",
|
|
51
51
|
"firebase": "^10.8.0",
|
|
52
52
|
"image-size": "^1.1.1",
|
|
53
53
|
"mime": "^3.0.0",
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
"tailwindcss": "^3.4.1",
|
|
58
58
|
"unocss": "^0.58.5",
|
|
59
59
|
"unplugin-auto-import": "^0.17.5",
|
|
60
|
-
"vite": "^5.
|
|
60
|
+
"vite": "^5.1.4",
|
|
61
61
|
"vite-plugin-pwa": "^0.19.0",
|
|
62
|
-
"vue": "^3.4.
|
|
62
|
+
"vue": "^3.4.20",
|
|
63
63
|
"wade": "0.3.3",
|
|
64
|
-
"yaml": "^2.
|
|
64
|
+
"yaml": "^2.4.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@cloudcommerce/eslint": "workspace:*",
|
|
68
68
|
"@cloudcommerce/types": "workspace:*",
|
|
69
|
-
"@types/react": "^18.2.
|
|
69
|
+
"@types/react": "^18.2.58"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -4,13 +4,14 @@ import type {
|
|
|
4
4
|
Brands,
|
|
5
5
|
Collections,
|
|
6
6
|
} from '@cloudcommerce/api/types';
|
|
7
|
+
import type { SectionPreviewProps } from '@@sf/state/use-cms-preview';
|
|
7
8
|
import {
|
|
8
9
|
name as getName,
|
|
9
10
|
categoriesList as getCategoriesList,
|
|
10
11
|
} from '@ecomplus/utils';
|
|
11
12
|
import useSharedData from '@@sf/composables/use-shared-data';
|
|
12
13
|
|
|
13
|
-
export interface Props {
|
|
14
|
+
export interface Props extends Partial<SectionPreviewProps> {
|
|
14
15
|
apiDoc?: Partial<Products | Categories | Brands | Collections>;
|
|
15
16
|
categories?: Partial<Categories>[];
|
|
16
17
|
domain?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { SearchItem } from '@cloudcommerce/types';
|
|
3
3
|
import type { SearchEngineInstance } from '@@sf/state/search-engine';
|
|
4
|
+
import type { SectionPreviewProps } from '@@sf/state/use-cms-preview';
|
|
4
5
|
import {
|
|
5
6
|
ref,
|
|
6
7
|
computed,
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
import { SearchEngine } from '@@sf/state/search-engine';
|
|
22
23
|
import { useSearchActiveFilters } from '@@sf/composables/use-search-filters';
|
|
23
24
|
|
|
24
|
-
export interface Props {
|
|
25
|
+
export interface Props extends Partial<SectionPreviewProps> {
|
|
25
26
|
term?: string | null;
|
|
26
27
|
pageSize?: number;
|
|
27
28
|
fixedParams?: SearchEngineInstance['params'];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SettingsContent as _SettingsContent } from '@cloudcommerce/types';
|
|
2
|
+
import type { CustomContent } from '@@sf/custom-content';
|
|
2
3
|
|
|
3
4
|
export type SettingsContent = _SettingsContent &
|
|
4
5
|
Omit<typeof import('content/settings.json'), Exclude<keyof _SettingsContent, 'metafields'>>;
|
|
@@ -58,13 +59,15 @@ export interface PageContent {
|
|
|
58
59
|
|
|
59
60
|
export type ContentFilename = 'settings'
|
|
60
61
|
| 'layout'
|
|
62
|
+
| keyof CustomContent
|
|
61
63
|
| `${string}/`
|
|
62
64
|
| `${string}/${string}`;
|
|
63
65
|
|
|
64
66
|
export type ContentData<T extends ContentFilename> =
|
|
65
|
-
T extends `${string}/` ? Array<string> :
|
|
66
67
|
T extends 'settings' ? SettingsContent :
|
|
67
68
|
T extends 'layout' ? LayoutContent :
|
|
69
|
+
T extends keyof CustomContent ? CustomContent[T] :
|
|
70
|
+
T extends `${string}/` ? Array<string> :
|
|
68
71
|
T extends `${string}/${string}` ? PageContent | null :
|
|
69
72
|
null;
|
|
70
73
|
|
|
@@ -51,7 +51,8 @@ if (!globalThis.$storefront) {
|
|
|
51
51
|
globalThis.$storefront = new Proxy({
|
|
52
52
|
settings: {},
|
|
53
53
|
data: {},
|
|
54
|
-
|
|
54
|
+
// @ts-expect-error: URL is retrived from `target.getSession().url`
|
|
55
|
+
url: undefined,
|
|
55
56
|
getSession(sid?: string) {
|
|
56
57
|
if (!sid && !!getCurrentInstance()) {
|
|
57
58
|
sid = inject('sid');
|
|
@@ -62,7 +63,7 @@ if (!globalThis.$storefront) {
|
|
|
62
63
|
} = (sid && sessions[sid]) || (global.__sfSession as typeof sessions[string]);
|
|
63
64
|
return { url, apiContext };
|
|
64
65
|
},
|
|
65
|
-
onLoad(callback: (
|
|
66
|
+
onLoad(callback: () => void) {
|
|
66
67
|
emitter.once('load', callback);
|
|
67
68
|
},
|
|
68
69
|
}, {
|
|
@@ -213,11 +214,12 @@ const loadRouteContext = async (
|
|
|
213
214
|
apiState[`${apiResource}/${apiDoc._id}`] = apiDoc;
|
|
214
215
|
sessions[sid].apiContext = {
|
|
215
216
|
resource: apiResource,
|
|
216
|
-
|
|
217
|
+
// @ts-expect-error: `apiDoc` not strictly typed as resource interface
|
|
218
|
+
doc: apiDoc,
|
|
217
219
|
timestamp: Date.now(),
|
|
218
220
|
};
|
|
219
221
|
sessions[sid]._timer = setTimeout(() => {
|
|
220
|
-
// @ts-
|
|
222
|
+
// @ts-expect-error: mem clearing
|
|
221
223
|
sessions[sid] = null;
|
|
222
224
|
delete sessions[sid];
|
|
223
225
|
}, 6000);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as f,w as h,d as P,c as T,N as C,O as l,P as c,$ as F,S as i,T as b,Q as r,R as S,X as k,U as A,V as L,W as U,a3 as V,a4 as M,Y as R,Z as j}from"./sf-utils.c42cbZ9W.js";import{_ as N,a as I,v as B,w as x}from"./_plugin-vue_export-helper.xATGHWd9.js";import{e as O,f as _,E as q,a as D,d as E}from"./customer-session.ZD6tLDQJ.js";import{u as z}from"./index.ShNlAyu1.js";import{g as W,b as Y,c as $}from"./index-bea2a320.eWykogwr.js";import{b as G}from"./index.KfrHdfOH.js";import"./server-data.4C60Esyt.js";const K=m=>{O();const s=m?.canUseUrlParams!==!1?z("history"):{},e=s.sign_up!==void 0&&s.sign_up!=="0",a=s.password!==void 0&&s.password!=="0",u=f(e),n=f(!e&&!a);h(u,p=>{p?(n.value=!0,s.sign_up="1"):s.sign_up="0"}),h(n,p=>{s.password=p?"0":"1"});const o=f(""),d=f(!1),g=G(async p=>{d.value=!0;const v=Date.now(),y=W();if(_.value){window.localStorage.setItem(q,_.value);try{if(n.value){const w=new URL(p||window.location.toString());w.searchParams.append("email",_.value),await Y(y,_.value,{url:w.toString(),handleCodeInApp:!0})}else await $(y,_.value,o.value)}catch(w){console.warn(w.code),console.error(w)}setTimeout(()=>{d.value=!1},Math.min(2e3-(Date.now()-v),1))}},2e3);return{isLinkSignIn:n,isSignUp:u,email:_,password:o,isSubmitting:d,submitLogin:g}},Q=P({__name:"LoginForm",props:{loginLinkActionUrl:{}},setup(m,{expose:t}){t();const{isLinkSignIn:s,isSignUp:e,email:a,password:u,isSubmitting:n,submitLogin:o}=K(),d=f(!1),g=f(0),p=T(()=>g.value>9);h(n,()=>{!n.value&&s.value&&(d.value=!0,g.value+=1)}),h([a,e],()=>{d.value=!1}),h(p,()=>{s.value=!1});const v={isLinkSignIn:s,isSignUp:e,email:a,password:u,isSubmitting:n,submitLogin:o,isEmailSentMsg:d,countEmailsSent:g,isLinkSignInBlocked:p,get customerName(){return D}};return Object.defineProperty(v,"__isScriptSetup",{enumerable:!1,value:!0}),v}}),X={class:"text-base-600 mb-4 text-2xl font-light"},Z={key:0},H={key:1,class:"lowercase"},J={key:0,for:"login-form-email"},ee={class:"relative"},se=["disabled"],te={key:0,class:"text-success-800 absolute left-0 top-0 mt-4 font-medium"},ne=i("i",{class:"i-check mr-1"},null,-1);function ie(m,t,s,e,a,u){const n=C("Fade");return l(),c("form",{class:"text-base-800 w-full max-w-sm bg-white p-6 text-base md:p-8",onSubmit:t[4]||(t[4]=x(()=>e.submitLogin(s.loginLinkActionUrl),["prevent"]))},[F(m.$slots,"head"),i("p",X,[b(r("Olá")+" "),e.customerName?(l(),c("span",Z,r(e.customerName),1)):(l(),c("span",H,r("Visitante")))]),e.isLinkSignIn?(l(),c("label",J,r("Enviar link de acesso por e-mail"))):S("",!0),k(i("input",{id:"login-form-email",type:"email",placeholder:"email@mail.com","onUpdate:modelValue":t[0]||(t[0]=o=>e.email=o),class:"mb-0.5 mt-2 w-full",required:""},null,512),[[I,e.email]]),e.isLinkSignIn?S("",!0):k((l(),c("input",{key:1,type:"password",placeholder:"Senha","onUpdate:modelValue":t[1]||(t[1]=o=>e.password=o),class:"mb-0.5 mt-2 w-full lowercase",required:""},null,512)),[[I,e.password]]),i("div",ee,[i("div",{class:A(["transition-opacity",e.isEmailSentMsg&&"opacity-0 invisible"])},[k(i("a",{href:"?password",class:"text-base-500 ui-link text-right text-sm lowercase",onClick:t[2]||(t[2]=x(o=>e.isLinkSignIn=!e.isLinkSignIn,["prevent"]))},r(e.isLinkSignIn?"Entrar com senha":"Esqueci minha senha"),513),[[B,!e.isSignUp&&!e.isLinkSignInBlocked]]),i("button",{type:"submit",disabled:e.isSubmitting,class:A(["ui-btn-lg ui-btn-primary mb-2 mt-5 w-full",e.isSubmitting&&"opacity-50"])},r(e.isSignUp?"Cadastrar":"Acessar minha conta"),11,se)],2),L(n,{speed:"slow"},{default:U(()=>[e.isEmailSentMsg?(l(),c("p",te,[ne,b(" "+r("Te enviamos o e-mail, verifique sua caixa de entrada e spam se necessário."),1)])):S("",!0)]),_:1}),i("a",{href:"?sign_up",class:"ui-btn-lg ui-btn-contrast block w-full text-center",onClick:t[3]||(t[3]=x(o=>e.isSignUp=!e.isSignUp,["prevent"]))},r(e.isSignUp?"Acessar minha conta":"Criar uma conta"),1)])],32)}const ae=N(Q,[["render",ie]]),oe=P({__name:"AccountPage",setup(m,{expose:t}){t();let s=null;{const{location:a}=window,u=new URLSearchParams(a.search).get("return_url");if(!u){const n=new URL(a.toString());n.pathname="/app/",n.hash=`#${a.pathname.replace("/app/","/")}`,s=n.toString()}h(E,()=>{E.value&&(a.href=u||s)},{immediate:!0})}const e={get loginLinkActionUrl(){return s},set loginLinkActionUrl(a){s=a},LoginForm:ae};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),re={class:"from-secondary-700 to-secondary-950 flex min-h-screen w-full flex-col justify-center bg-gradient-to-br"},le={class:"mx-auto p-4"},ce=i("section",{class:"ui-section text-center"},[i("a",{href:"/",class:"text-base-200 hover:text-white"},[i("i",{class:"i-arrow-right mr-1 rotate-180"}),b(" "+r("Ir para a loja"))])],-1),me={class:"overflow-hidden rounded-md shadow-md ring-4 ring-black/10"},ue={class:"mb-5 text-center"},de={href:"/",class:"inline-block"},pe={key:0,class:"ui-section px-0"},ge={class:"mx-auto flex max-w-sm flex-wrap items-center justify-evenly gap-4 px-3"};function _e(m,t,s,e,a,u){const n=C("ALink");return l(),c("article",re,[i("div",le,[ce,i("section",me,[L(e.LoginForm,V(M({loginLinkActionUrl:e.loginLinkActionUrl})),{head:U(()=>[i("div",ue,[i("a",de,[F(m.$slots,"logo")])])]),_:3},16)]),m.$settings.serviceLinks?.length?(l(),c("nav",pe,[i("ul",ge,[(l(!0),c(R,null,j(m.$settings.serviceLinks,({title:o,href:d},g)=>(l(),c("li",{key:`s-${g}`},[L(n,{href:d,class:"text-base-200 ui-link hover:text-white"},{default:U(()=>[b(r(o),1)]),_:2},1032,["href"])]))),128))])])):S("",!0)])])}const xe=N(oe,[["render",_e]]);export{xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as b,w as x}from"./_plugin-vue_export-helper.xATGHWd9.js";import{c as p,d as v,N as f,O as i,P as m,V as d,W as y,a0 as C,R as h,Q as o,S as t,T as g,Y as I,Z as S}from"./sf-utils.c42cbZ9W.js";import{f as w}from"./modules-info.HP6478mG.js";import{p as V,r as P,s as F,t as z}from"./shopping-cart.nSNNOrp9.js";import{Q as j,C as N}from"./QuantitySelector.v7L8EYOR.js";import{P as k}from"./Prices.xI1rdM1e.js";import{g as A}from"./name.VA3MEpe0.js";import{g as L}from"./img.AnjeGdy_.js";import"./afetch.OifQZgwR.js";import"./server-data.4C60Esyt.js";import"./format-money.1_HtF5S2.js";import"./price.Easct8WC.js";import"./customer-session.ZD6tLDQJ.js";import"./index.KfrHdfOH.js";import"./i18n.zhlBzJt8.js";const q=a=>{const s=p(()=>!a.item&&a.product?V(a.product):null),r=p(()=>a.item||s.value),e=p(()=>A(r.value)),n=p(()=>{const{slug:l}=r.value;return typeof l=="string"?`/${l}`:null}),u=p(()=>{if(r.value.picture)return L(r.value.picture,void 0,a.pictureSize||"small")}),c=p(()=>r.value.final_price||r.value.price);return{cartItem:r,title:e,link:n,image:u,finalPrice:c}},B=v({__name:"CartItem",props:{item:{},product:{},pictureSize:{}},setup(a,{expose:s}){s();const r=a,{cartItem:e,title:n,link:u,image:c,finalPrice:l}=q(r),_={props:r,cartItem:e,title:n,link:u,image:c,finalPrice:l,get removeCartItem(){return P},QuantitySelector:j,Prices:k};return Object.defineProperty(_,"__isScriptSetup",{enumerable:!1,value:!0}),_}}),Q={class:"relative bg-white shadow-sm"},E={class:"text-base-700 group-hover:text-base-900 flex-auto py-2 text-sm group-hover:underline"},O=t("span",{class:"border-3 border-danger-700/30 text-danger-800 flex size-5 flex-col justify-center rounded-full text-sm leading-none"},[t("i",{class:"i-close mx-auto my-0"})],-1),M=[O],R={class:"border-base-100 flex items-center justify-between border-t-2"},T={class:"border-base-100 border-r-2"};function D(a,s,r,e,n,u){const c=f("AImg"),l=f("ALink");return i(),m("article",Q,[d(l,{href:e.link,class:"group flex items-center gap-5 p-4"},{default:y(()=>[e.image?(i(),C(c,{key:0,picture:e.image,alt:e.title,class:"size-20 object-cover"},null,8,["picture","alt"])):h("",!0),t("p",E,o(e.title),1)]),_:1},8,["href"]),e.cartItem._id?(i(),m("button",{key:0,onClick:s[0]||(s[0]=x(_=>e.removeCartItem(e.cartItem._id),["stop"])),class:"absolute right-0 top-0 p-2 opacity-70 hover:opacity-100","aria-label":"Remover"},M)):h("",!0),t("div",R,[t("div",T,[d(e.QuantitySelector,{modelValue:e.cartItem.quantity,"onUpdate:modelValue":s[1]||(s[1]=_=>e.cartItem.quantity=_),min:e.cartItem.min_quantity,max:e.cartItem.max_quantity},null,8,["modelValue","min","max"])]),d(e.Prices,{"base-price":e.cartItem.base_price,price:e.finalPrice,"has-cashback":!1,"has-price-options":!1,class:"px-4 py-2.5 text-right text-[95%]"},null,8,["base-price","price"])])])}const U=b(B,[["render",D]]),W=v({__name:"CartSidebar",emits:["close"],setup(a,{expose:s,emit:r}){s();const n={emit:r,get freeShippingFromValue(){return w},get shoppingCart(){return F},get totalItems(){return z},CheckoutLink:N,Prices:k,CartItem:U};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),Y={class:"flex h-screen flex-col bg-white"},Z={class:"z-10 flex items-center justify-end gap-3 px-6 py-4 shadow ring-1 ring-black/5"},G=t("span",{class:"text-base-600 text-right text-base font-medium"},o("Meu carrinho de compras"),-1),H={class:"min-w-[3rem] text-right"},J={class:"ui-badge-pill-lg"},K={class:"bg-base-50 grow overflow-y-auto"},X={key:0,class:"text-center text-sm"},$={key:0,class:"secondary-subtle p-3"},ee=t("strong",{class:"lowercase"},o("Frete grátis"),-1),te={key:1,class:"bg-success-50 text-success-800 p-3"},re=t("i",{class:"text-success-900 i-check mr-1"},null,-1),se={class:"px-4 pb-2 pt-4"},ae={class:"z-10 px-5 pb-3 pt-4 ring-2 ring-black/5"},oe={class:"grid grid-cols-5 items-center gap-3 text-right"},ie=t("div",{class:"col-span-2"},o("Subtotal"),-1),ne=t("i",{class:"i-check mr-2"},null,-1),ce=t("i",{class:"i-arrow-right mr-1 rotate-180"},null,-1);function le(a,s,r,e,n,u){return i(),m("aside",Y,[t("header",Z,[G,t("span",H,[t("span",J,o(e.totalItems),1)])]),t("article",K,[e.freeShippingFromValue?(i(),m("div",X,[e.freeShippingFromValue>e.shoppingCart.subtotal?(i(),m("div",$,[g(o("Adicione $1 para ganhar".replace("$1",a.$money(e.freeShippingFromValue-e.shoppingCart.subtotal)))+" ",1),ee])):(i(),m("div",te,[re,g(" "+o("Frete grátis a partir de")+" "+o(a.$money(e.freeShippingFromValue)),1)]))])):h("",!0),t("ul",se,[(i(!0),m(I,null,S(e.shoppingCart.items,(c,l)=>(i(),m("li",{key:l},[d(e.CartItem,{item:c,class:"mb-3"},null,8,["item"])]))),128))])]),t("footer",ae,[t("div",oe,[ie,d(e.Prices,{price:e.shoppingCart.subtotal,class:"col-span-3 text-lg"},null,8,["price"])]),d(e.CheckoutLink,{to:"checkout",class:"ui-btn-lg ui-btn-primary my-2.5 w-full text-right"},{default:y(()=>[ne,g(" "+o("Finalizar compra"))]),_:1}),t("a",{href:"#",onClick:s[0]||(s[0]=x(c=>e.emit("close"),["prevent"])),class:"text-base-500 ui-link hover:text-base-700 text-sm"},[ce,g(" "+o("Continuar comprando"))])])])}const Se=b(W,[["render",le]]);export{Se as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,d as w,N as x,O as r,P as l,V as c,W as o,$ as T,U as b,a0 as v,Q as f,T as y,a1 as B,R as m,a as C,I as H,X as L,S as _,Y as N,Z as P,a2 as V}from"./sf-utils.c42cbZ9W.js";import{_ as S,v as j}from"./_plugin-vue_export-helper.xATGHWd9.js";import{p as g}from"./modules-info.HP6478mG.js";import"./afetch.OifQZgwR.js";import"./server-data.4C60Esyt.js";import"./format-money.1_HtF5S2.js";import"./price.Easct8WC.js";const z=s=>{const a=d(()=>s.title?g(s.title).value:""),t=d(()=>s.subtitle?g(s.subtitle).value:""),e=d(()=>s.buttonText?g(s.buttonText).value:""),i=d(()=>!!(a.value||t.value||e.value));return{parsedTitle:a,parsedSubtitle:t,parsedButtonText:e,hasHeader:i}},D=w({__name:"Banner",props:{img:{},alt:{},mobileImg:{},href:{},title:{},subtitle:{},buttonLink:{},buttonText:{},headingTag:{default:"h3"}},setup(s,{expose:a}){a();const t=s,{hasHeader:e,parsedTitle:i,parsedSubtitle:p,parsedButtonText:n}=z(t),u={props:t,hasHeader:e,parsedTitle:i,parsedSubtitle:p,parsedButtonText:n};return Object.defineProperty(u,"__isScriptSetup",{enumerable:!1,value:!0}),u}}),M={key:0,class:"mb-3 p-12 sm:mb-0 xl:ps-32"},O={key:1,class:"mt-4 text-lg md:mt-6"};function A(s,a,t,e,i,p){const n=x("ALink");return r(),l("div",{class:b(["mx-auto overflow-x-hidden",e.hasHeader?"grid grid-cols-1 sm:grid-cols-2 items-center":null])},[c(n,{href:t.href,class:b(e.hasHeader?"sm:order-last [&_img]:max-w-full sm:[&_img]:max-w-none [&_img]:aspect-video sm:[&_img]:aspect-[2.5] [&_img]:object-cover":"[&_img]:max-w-full")},{default:o(()=>[T(s.$slots,"picture")]),_:3},8,["href","class"]),e.hasHeader?(r(),l("div",M,[e.parsedTitle?(r(),v(B(t.headingTag),{key:0,class:"ui-title mt-1"},{default:o(()=>[y(f(e.parsedTitle),1)]),_:1})):m("",!0),e.parsedSubtitle?(r(),l("p",O,f(e.parsedSubtitle),1)):m("",!0),e.parsedButtonText?(r(),v(n,{key:2,href:t.buttonLink,class:"ui-btn-lg ui-btn-contrast mt-7 min-w-[150px] md:mt-10"},{default:o(()=>[y(f(e.parsedButtonText),1)]),_:1},8,["href"])):m("",!0)])):m("",!0)],2)}const I=S(D,[["render",A]]),E=w({__name:"HeroSlider",props:{autoplay:{},slides:{}},setup(s,{expose:a}){a();const t=C(!1);H(()=>{t.value=!0});const e={isMounted:t,Banner:I};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),F={class:"relative mx-auto mb-9 md:mb-12"},Q={class:"absolute bottom-5 right-5 z-10 flex w-screen items-center justify-end xl:left-1/2 xl:right-auto xl:-ms-[640px] xl:max-w-screen-xl"},R=_("i",{class:"i-arrow-right rotate-180"},null,-1),U=_("i",{class:"i-arrow-right"},null,-1);function W(s,a,t,e,i,p){const n=x("CarouselControl"),u=x("Carousel");return r(),l("section",F,[c(u,{autoplay:t.autoplay,class:"secondary [&>*]:items-center"},{controls:o(()=>[L(_("div",Q,[_("div",{class:b(["text-primary relative h-10 w-20 rounded-full bg-white/50 shadow-sm ring-1 ring-black/5 transition-opacity",e.isMounted?"opacity-100":"opacity-20 [&>*]:cursor-wait"])},[c(n,{class:"hover:bg-primary/10 size-10 rounded-full","is-prev":""},{default:o(()=>[R]),_:1}),c(n,{class:"hover:bg-primary/10 size-10 rounded-full"},{default:o(()=>[U]),_:1})],2)],512),[[j,t.slides.length>1]])]),default:o(()=>[(r(!0),l(N,null,P(t.slides,(k,h)=>(r(),l("li",{key:h,class:"shrink-0 basis-full"},[c(e.Banner,V({...k,headingTag:h===0?"h2":"h3"},{class:"w-screen max-w-screen-2xl"}),{picture:o(()=>[T(s.$slots,`picture-${h}`)]),_:2},1040)]))),128))]),_:3},8,["autoplay"])])}const $=S(E,[["render",W]]);export{$ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as C,c as m,d as g,P as r,S as h,V as i,W as p,N as u,O as l,X as x,Y as b,Z as w,U as S,R as y}from"./sf-utils.c42cbZ9W.js";import{_ as B,v as k}from"./_plugin-vue_export-helper.xATGHWd9.js";import{p as P}from"./modules-info.HP6478mG.js";import"./afetch.OifQZgwR.js";import"./server-data.4C60Esyt.js";import"./format-money.1_HtF5S2.js";import"./price.Easct8WC.js";function V(t,e){{const s=btoa(JSON.stringify({filename:t}));window.parent.postMessage(JSON.parse(JSON.stringify({type:"open",filename:t,id:s})),window.location.origin),window.addEventListener("message",n=>{n.data.id===s&&e(n.data.data)})}}const L=t=>{const e=C(null);return window.$isCmsPreview&&V(t,s=>{e.value=s}),{liveContent:e}},N=t=>{const e={slides:[]};return t.header?.pitchBar&&(e.slides=t.header.pitchBar),e},O=t=>{const{liveContent:e}=L("layout"),s=m(()=>(e.value?N(e.value).slides:t.slides).map(({html:o})=>P(o).value.replace(/<\/?p>/g,"").replace(/<(\/?d-md)>/g,"<$1>"))),n=m(()=>s.value.filter(a=>a).length);return{parsedContents:s,countValidSlides:n}},J=g({__name:"PitchBar",props:{slides:{}},setup(t,{expose:e}){e();const s=t,{parsedContents:n,countValidSlides:a}=O(s),o={props:s,parsedContents:n,countValidSlides:a};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),M={class:"bg-base-100 relative z-20"},z={class:"container mx-auto px-3 py-1 md:w-2/3"},A=["innerHTML"],E={class:"text-base-400 text-xl leading-none"};function H(t,e,s,n,a,o){const f=u("ALink"),_=u("CarouselControl"),v=u("Carousel");return l(),r("div",M,[h("div",z,[i(v,{autoplay:n.countValidSlides>1?7e3:void 0},{controls:p(()=>[x(h("div",E,[i(_,{class:"bg-base-100 hover:text-base-700 pr-2","is-prev":""}),i(_,{class:"bg-base-100 hover:text-base-700 pl-2"})],512),[[k,n.countValidSlides>1]])]),default:p(()=>[(l(!0),r(b,null,w(s.slides,(c,d)=>(l(),r("li",{key:d,class:"h-full shrink-0 basis-full text-center"},[i(f,{href:c.href,target:c.target,class:S(["inline-block px-8",c.href?"hover:underline":null])},{default:p(()=>[n.parsedContents[d]?(l(),r("span",{key:0,innerHTML:n.parsedContents[d],class:"text-base-800 prose text-sm"},null,8,A)):y("",!0)]),_:2},1032,["href","target","class"])]))),128))]),_:1},8,["autoplay"])])])}const X=B(J,[["render",H]]);export{X as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as I}from"./_plugin-vue_export-helper.xATGHWd9.js";import{c as s,d as A,N as S,O as o,P as i,Q as r,R as c,S as h,T as N,U as C,V as B,W as L}from"./sf-utils.c42cbZ9W.js";import{a as z,i as T,d as E,l as M}from"./modules-info.HP6478mG.js";import{g,c as F}from"./price.Easct8WC.js";const W=(a,l)=>{const{type:n,value:e}=l;let d;return e?(n==="percentage"?d=a*((100-e)/100):d=a-e,d>0?d:0):a},R=a=>{const l=s(()=>a.product||{price:a.price||0,base_price:a.basePrice}),n=s(()=>{const{variations:t}=l.value;if(t){const u=g(l.value);for(let P=0;P<t.length;P++)if(g({...l.value,...t[P]})>u)return!0}return!1}),e=s(()=>{const t=g(l.value),u=z.value;return u&&(!u.min_amount||t>u.min_amount)?W(t,u):t}),d=s(()=>{if(F(l.value))return l.value.base_price;const t=g(l.value);return t>e.value?t:0}),_=s(()=>a.installmentsOption||T.value||{max_number:1}),m=s(()=>{if(_.value.max_number<=1)return 1;const t=_.value.min_installment||5,u=Math.floor(e.value/t);return Math.min(u,_.value.max_number)}),b=s(()=>_.value.monthly_interest||0),k=s(()=>{if(m.value>=2){if(!b.value)return e.value/m.value;const t=b.value/100;return e.value*t/(1-(1+t)**-m.value)}return 0}),f=s(()=>{const t=a.discountOption||E.value;return t&&(!t.min_amount||t.min_amount<=e.value)&&(!a.isAmountTotal||t.apply_at==="total")?t:{}}),O=s(()=>{const{label:t}=f.value;return t?t.includes(" ")?t:`via ${t}`:""}),V=s(()=>W(e.value,f.value)),v=s(()=>{if(a.loyaltyPointsProgram)return a.loyaltyPointsProgram;const t=M.value;if(t){const u=Object.keys(t);for(let P=0;P<u.length;P++){const p=t[u[P]];if(p?.earn_percentage&&p.earn_percentage>0)return p}}return{ratio:0}}),y=s(()=>v.value.min_subtotal_to_earn||0),j=s(()=>v.value.name||""),D=s(()=>v.value.earn_percentage||0),x=s(()=>D.value*v.value.ratio),w=s(()=>x.value>=1?e.value*(x.value/100):0);return{hasVariedPrices:n,salePrice:e,comparePrice:d,installmentsObject:_,installmentsNumber:m,monthlyInterest:b,installmentValue:k,discountObject:f,discountLabel:O,priceWithDiscount:V,pointsProgramObject:v,pointsMinPrice:y,pointsProgramName:j,earnPointsPercentage:D,cashbackPercentage:x,cashbackValue:w}},Q=A({__name:"Prices",props:{isBig:{type:Boolean},isLiteral:{type:Boolean},hasCashback:{type:Boolean,default:!0},hasPriceOptions:{type:Boolean,default:!0},product:{},price:{},basePrice:{},isAmountTotal:{type:Boolean},installmentsOption:{},discountOption:{},loyaltyPointsProgram:{}},setup(a,{expose:l}){l();const n=a,{hasVariedPrices:e,salePrice:d,comparePrice:_,cashbackPercentage:m,cashbackValue:b,installmentsNumber:k,monthlyInterest:f,installmentValue:O,priceWithDiscount:V,discountLabel:v}=R(n),y={props:n,hasVariedPrices:e,salePrice:d,comparePrice:_,cashbackPercentage:m,cashbackValue:b,installmentsNumber:k,monthlyInterest:f,installmentValue:O,priceWithDiscount:V,discountLabel:v};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),U={key:0,class:"text-base-500 mr-1 text-[87%]"},q={key:0},G={key:1},H={key:0},J={key:0,class:"relative z-10"},K=["data-tooltip"],X=h("i",{class:"i-arrow-uturn-left mr-1"},null,-1),Y={class:"font-medium"},Z=h("small",null," cashback",-1),$={key:0},ee={key:0},te={key:1},ae={key:2},ne={key:0},se={key:0},re={key:1};function oe(a,l,n,e,d,_){const m=S("Fade");return o(),i("div",{class:C(["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]",n.isBig?"text-lg":null])},[e.comparePrice?(o(),i("span",U,[n.isLiteral?(o(),i("small",q,r("De "))):c("",!0),h("s",null,r(a.$money(e.comparePrice)),1),n.isLiteral?(o(),i("small",G,r(" Por"))):c("",!0)])):c("",!0),h("strong",{class:C(["text-base-800",n.isBig?"text-4xl block":"inline-block"])},[e.hasVariedPrices?(o(),i("small",H,r("A partir de "))):c("",!0),N(" "+r(a.$money(e.salePrice)),1)],2),B(m,{slide:"down"},{default:L(()=>[e.cashbackValue&&n.hasCashback?(o(),i("div",J,[h("span",{"data-tooltip":"Receba $1 de volta".replace("$1",a.$percentage(e.cashbackPercentage))},[X,h("span",Y,r(a.$money(e.cashbackValue)),1),Z],8,K)])):c("",!0)]),_:1}),B(m,{slide:"down"},{default:L(()=>[e.installmentValue&&n.hasPriceOptions?(o(),i("div",$,[n.isLiteral?(o(),i("small",ee,r("Até "))):c("",!0),N(" "+r(e.installmentsNumber)+"x ",1),n.isLiteral?(o(),i("small",te,r(" De "))):c("",!0),h("span",null,r(a.$money(e.installmentValue)),1),!e.monthlyInterest&&n.isLiteral?(o(),i("small",ae,r(" Sem juros"))):c("",!0)])):c("",!0)]),_:1}),B(m,{slide:"down"},{default:L(()=>[e.priceWithDiscount<e.salePrice&&n.hasPriceOptions?(o(),i("div",ne,[e.discountLabel?c("",!0):(o(),i("small",se,r("A partir de "))),h("span",null,r(a.$money(e.priceWithDiscount)),1),e.discountLabel?(o(),i("small",re,r(` ${e.discountLabel}`),1)):c("",!0)])):c("",!0)]),_:1})],2)}const me=I(Q,[["render",oe]]);export{me as P};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{d as E,a as C,N as P,O as u,P as m,a0 as A,W as V,R as b,S as v,Y as w,U as z,V as k,Z as I,ac as F,a7 as Z,M as H,r as j,w as T,aa as M,c as Q,T as D,Q as S,ad as J,I as K,$ as X}from"./sf-utils.c42cbZ9W.js";import{_ as G,w as $}from"./_plugin-vue_export-helper.xATGHWd9.js";import{u as tt}from"./index.ShNlAyu1.js";import{a as et}from"./shopping-cart.nSNNOrp9.js";import{u as ot}from"./use-product-card.UFr8SCuD.js";import{C as rt,Q as it}from"./QuantitySelector.v7L8EYOR.js";import{P as at}from"./Prices.xI1rdM1e.js";import{_ as B}from"./customer-session.ZD6tLDQJ.js";import"./server-data.4C60Esyt.js";import{g as nt}from"./img-sizes.gxAI9JNh.js";import"./index.KfrHdfOH.js";import{g as st}from"./grid-title.pK2Nn3i-.js";import"./use-analytics.wTmoP8B1.js";import"./price.Easct8WC.js";import"./name.VA3MEpe0.js";import"./i18n.zhlBzJt8.js";import"./img.AnjeGdy_.js";import"./modules-info.HP6478mG.js";import"./afetch.OifQZgwR.js";import"./format-money.1_HtF5S2.js";const R=(r,i,a)=>{if(typeof r!="object"||r===null)return[];let t=[];if(typeof r=="object"&&r!==null)if(Array.isArray(r))r.length&&(r[0].specifications?r.forEach(e=>{t=t.concat(R(e,i,a))}):r[0].text&&(t=r));else{const{specifications:e}=r;if(e)for(const n in e)e[n]&&n===i&&(t=e[i]);if(t&&!t.length&&Array.isArray(a)&&a.length){let n,d;return a&&(d=a.find(s=>s.grid_id===i))&&d.options&&(n=d.options.map(s=>{let l;return s.colors&&s.colors.length?l=s.colors[0]:l=s.option_id,{text:s.text,value:l}})),R(n,i)}}return t},W=R,lt=(r,i,a,t=", ")=>{let e=W(r,i,a);if(e.length){let n=e[0].text;for(let d=1;d<e.length;d++)n+=t+e[d].text;return n}return null},Y=lt,ct=(r,i,a,t)=>{const e=W(r,a,t);for(let n=0;n<e.length;n++)if(e[n].text===i)return e[n].value},dt=ct,ut=(r,i,a,t)=>{let e={};return r&&Array.isArray(r.variations)&&r.variations.forEach(n=>{if(a&&n.quantity<=0)return;let d=n.specifications,s=l=>Y(n,l,t);if(d){if(i){for(let l in i)if(i.hasOwnProperty(l)&&(!d[l]||s(l)!==i[l]))return}for(let l in d)if(d.hasOwnProperty(l)){let p=s(l);if(!e.hasOwnProperty(l))e[l]=[];else if(e[l].indexOf(p)!==-1)continue;e[l].push(p)}}}),e},q=ut,mt=E({__name:"ImagesGallery",props:{pictures:{}},setup(r,{expose:i}){i();const a=C(0),t=C("");let e;const n=C(!1),s={activeIndex:a,psId:t,get lightbox(){return e},set lightbox(l){e=l},isLoadingLightbox:n,zoom:l=>{if(t.value=`ps-${Z()}`,!e&&!n.value){n.value=!0;const p="photoswipe-style";Promise.all([B(()=>import("./photoswipe-lightbox.esm.dZBqKD9u.js"),__vite__mapDeps([])),B(()=>import("./photoswipe.esm.Ylh9TGkz.js"),__vite__mapDeps([])),!document.getElementById(p)&&B(()=>import("./photoswipe.0V7m2jWu.js"),__vite__mapDeps([]))]).then(([{default:o},{default:c},_])=>{if(_){const{default:y}=_,g=document.createElement("style");g.id=p,g.textContent=y,document.head.appendChild(g)}e=new o({gallery:`#${t.value} > div`,children:"a",pswpModule:c,showAnimationDuration:300,hideAnimationDuration:300}),e.init(),e.loadAndOpen(l),n.value=!1})}},get getImgSizes(){return nt}};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}}),pt={class:"-mx-4 flex w-screen gap-3 sm:mx-0 sm:w-full md:h-[525px] 2xl:gap-5"},ft=["onClick"],gt=v("span",{class:"absolute bottom-0 block h-2 w-full bg-gradient-to-b from-transparent to-white"},null,-1),_t={class:"relative aspect-square h-full grow md:aspect-auto"},ht={key:0,class:"bg-base-200 i-arrow-path absolute left-1/2 top-1/2 -ml-7 -mt-7 size-14 animate-spin","aria-label":"Carregando"},vt={key:1,class:"mt-2 flex justify-center gap-1.5 md:hidden"},yt=["aria-label","onClick"];function bt(r,i,a,t,e,n){const d=P("AImg"),s=P("CarouselControl"),l=P("Carousel"),p=P("ALink");return u(),m("div",pt,[a.pictures.length>1?(u(),A(l,{key:0,axis:"y",class:"group hidden w-[300px] shrink-0 md:block"},{controls:V(()=>[v("span",null,[a.pictures.length>6?(u(),A(s,{key:0,class:"text-primary hover:bg-primary-300/60 !bottom-3 !left-1/2 -ml-5 size-10 rounded-full bg-white/60 text-xl opacity-0 shadow-sm ring-1 ring-black/5 group-hover:opacity-90"})):b("",!0),gt])]),default:V(()=>[(u(!0),m(w,null,I(Math.ceil(a.pictures.length/2),o=>(u(),m("li",{key:o,class:z(["grid w-full grid-cols-2 gap-3 px-1 pb-3",o===1&&"pt-1"])},[(u(!0),m(w,null,I([1,2].map(c=>(o-1)*2+(c-1)),c=>(u(),m(w,{key:`${o}-${c}`},[c<a.pictures.length?(u(),m("button",{key:0,class:"bg-secondary-100 block rounded md:h-[175px]",onClick:_=>t.activeIndex=c},[k(d,{picture:a.pictures[c],class:z(["ring-secondary/10 size-full rounded border-2 object-cover opacity-90 transition-colors",c===t.activeIndex?"border-secondary/50 ring-4 cursor-auto":"border-transparent hover:border-primary hover:ring-4 hover:ring-primary/20"])},null,8,["picture","class"])],8,ft)):b("",!0)],64))),128))],2))),128))]),_:1})):b("",!0),v("div",_t,[k(l,{as:"div",index:t.activeIndex,"onUpdate:index":i[1]||(i[1]=o=>t.activeIndex=o),class:z(["text-base-600 [&_i]:i-arrow-right mx-auto size-full max-w-[525px] [&>*]:h-full [&_i]:mx-2 [&_i]:text-2xl",t.isLoadingLightbox&&"opacity-80"]),id:t.psId},{default:V(()=>[i[0]||(F(-1),i[0]=(u(!0),m(w,null,I(a.pictures,(o,c)=>(u(),A(p,{key:`big-${c}`,href:o.zoom?.size&&o.zoom.url,"data-pswp-width":t.getImgSizes(o.zoom||"").width,"data-pswp-height":t.getImgSizes(o.zoom||"").height,target:"_blank",rel:"noreferrer",class:z(["shrink-0 basis-full",o.zoom?.size&&"cursor-zoom-in"]),onClick:$(()=>o.zoom?.size&&t.zoom(c),["prevent"])},{default:V(()=>[k(d,{picture:o,"preferred-size":"big",class:"size-full rounded object-cover",fetchpriority:c===0?"high":"low",loading:c===0?"eager":"lazy"},null,8,["picture","fetchpriority","loading"])]),_:2},1032,["href","data-pswp-width","data-pswp-height","class","onClick"]))),128)),F(1),i[0])]),_:1},8,["index","class","id"]),t.isLoadingLightbox?(u(),m("i",ht)):b("",!0),a.pictures.length>1?(u(),m("ul",vt,[(u(!0),m(w,null,I(a.pictures.length,o=>(u(),m("li",{key:`d-${o}`},[v("button",{class:z(["bg-base-700 block h-1.5 w-3 rounded-full",t.activeIndex!==o-1&&"opacity-40"]),"aria-label":`Imagem ${o}`,onClick:c=>t.activeIndex=o-1},null,10,yt)]))),128))])):b("",!0)])])}const xt=G(mt,[["render",bt]]),kt=r=>{const i=H(r.grids||globalThis.$storefront.data.grids||[]);i.length||window.addEventListener("storefront:data:data",()=>{globalThis.$storefront.data.grids?.forEach(o=>i.push(o))},{once:!0});const a=j({}),t=j({});T(M(r,"variations"),()=>{Object.assign(t,q(r,void 0,!0));const o=q(r);Object.keys(o).forEach(c=>{t[c]?a[c]=t[c]:delete a[c]})},{immediate:!0});const e=Q(()=>Object.keys(a)),n=j({}),d=C(),s=({optionText:o,gridId:c,gridIndex:_})=>{n[c]=o;const y={};for(let f=0;f<=_;f++){const h=e[f];n[h]&&(y[h]=n[h])}const g=q(r,y,!0);for(let f=_+1;f<e.value.length;f++){const h=e[f],O=g[h];t[h]=O,n[h]&&!O.includes(n[h])&&delete n[h]}const x=r.variations.slice(0);for(let f=0;f<x.length;f++){const h=x[f],{specifications:O}=h,N=Object.keys(O);for(let L=0;L<N.length;L++){const U=N[L];if(n[U]!==Y(h,U)){x.splice(f,1),f-=1;break}}}d.value=x[0]?._id||null};return T(M(r,"variationId"),o=>{if(!o||o===d.value)return;const c=r.variations.find(x=>x._id===o);if(!c){d.value=null;return}const{specifications:_}=c,y=Object.keys(_),g=(x=0)=>{const f=y[x];if(y[x]&&_[f]&&_[f].length===1){const h=_[f][0].text;a[f].find(O=>O===h)&&(s({optionText:h,gridId:f,gridIndex:e.value.indexOf(f)}),g(x+1))}};g()},{immediate:!0}),{grids:i,variationsGrids:a,activeVariationsGrids:t,selectOption:s,selectedOptions:n,variationId:d,getGridTitle:o=>st(o,i),getColorOptionBg:o=>{const c=o.split(",").map(_=>dt(r.variations,_.trim(),"colors"));return c.length>1?`background:linear-gradient(to right bottom, ${c[0]} 50%, ${c[1]} 50%)`:`background:${c[0]}`}}},wt=E({__name:"SkuSelector",props:{variations:{},variationId:{},grids:{}},emits:["update:variationId"],setup(r,{expose:i,emit:a}){i();const t=r,e=a,{variationsGrids:n,activeVariationsGrids:d,selectOption:s,selectedOptions:l,variationId:p,getGridTitle:o,getColorOptionBg:c}=kt(t);T(p,y=>{e("update:variationId",y)});const _={props:t,emit:e,variationsGrids:n,activeVariationsGrids:d,selectOption:s,selectedOptions:l,variationId:p,getGridTitle:o,getColorOptionBg:c};return Object.defineProperty(_,"__isScriptSetup",{enumerable:!1,value:!0}),_}}),St={class:"text-base-700 text-sm font-medium"},Ct={key:0,class:"text-base-800"},Ot={key:0,class:"mt-2 flex gap-2"},zt=["onClick"];function Vt(r,i,a,t,e,n){return u(),m("div",null,[(u(!0),m(w,null,I(t.variationsGrids,(d,s)=>(u(),m("div",{key:s,class:"mt-3"},[v("span",St,[D(S(t.getGridTitle(s))+": ",1),t.selectedOptions[s]?(u(),m("strong",Ct,S(t.selectedOptions[s]),1)):b("",!0)]),d.length<7?(u(),m("ul",Ot,[(u(!0),m(w,null,I(d,(l,p)=>(u(),m("li",{key:`${s}-${p}`},[v("button",{class:z(["ring-primary/60 rounded border",[t.selectedOptions[s]===l?"border-primary ring-2":null,s==="colors"?"size-9 text-[0px]":"px-2.5 py-2 leading-none",t.activeVariationsGrids[s].includes(l)?"border-primary-400 bg-primary-100 text-primary-950":"border-primary-300 bg-primary-200 text-primary-600"]]),style:J(s==="colors"&&t.getColorOptionBg(l)),onClick:o=>t.selectOption({optionText:l,gridId:s,gridIndex:p})},S(l),15,zt)]))),128))])):b("",!0)]))),128))])}const It=G(wt,[["render",Vt]]),Pt=E({__name:"ShippingCalculator",setup(r,{expose:i}){i();const a={};return Object.defineProperty(a,"__isScriptSetup",{enumerable:!1,value:!0}),a}});function At(r,i,a,t,e,n){return u(),m("div")}const Tt=G(Pt,[["render",At]]),Et=E({__name:"ProductDetails",props:{product:{default:()=>globalThis.$storefront.apiContext?.doc}},setup(r,{expose:i}){i();const a=r,{product:t,title:e,isActive:n}=ot(a),d=C(t.min_quantity||1),s=tt("history"),l=C(!1),p=C(null);T(p,g=>{g&&(s.var=g,l.value=!1)}),K(()=>{T(s,({var:g})=>{typeof g=="string"&&g&&(p.value=g)},{immediate:!0})});const o=Q(()=>!!(!t.variations?.length||p.value)),c=g=>(o.value?l.value=!1:(g&&g.preventDefault(),l.value=!0),!l.value),y={props:a,product:t,title:e,isActive:n,quantity:d,params:s,hasSkuSelectionAlert:l,variationId:p,isSkuSelected:o,checkVariation:c,addToCart:()=>{c()&&et(t,p.value?p.value:void 0)},CheckoutLink:rt,QuantitySelector:it,Prices:at,ImagesGallery:xt,SkuSelector:It,ShippingCalculator:Tt};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),Gt={class:"ui-section relative grid grid-cols-1 items-start gap-5 md:gap-4 lg:grid-cols-4 2xl:gap-6"},Lt={class:"w-full lg:col-span-3"},jt={class:"lg:sticky-header:translate-y-14 top-0 py-4 transition-transform lg:sticky"},Bt={class:"text-secondary-900 ui-text-brand text-lg"},qt={key:0,class:"mt-5"},Dt={key:0,class:"ui-alert inline-block"},Rt=v("i",{class:"i-arrow-right ml-1 -rotate-90"},null,-1),Nt={class:"mt-5 flex flex-wrap items-center gap-x-4 gap-y-2 md:flex-nowrap lg:mt-4 lg:flex-wrap"},Ut=v("i",{class:"i-chevron-double-right mr-1"},null,-1),Ft=["data-tooltip"],Mt={class:"w-full lg:col-span-3"};function Qt(r,i,a,t,e,n){const d=P("Fade");return u(),m("section",Gt,[v("div",Lt,[t.product.pictures?.length?(u(),A(t.ImagesGallery,{key:0,pictures:t.product.pictures},null,8,["pictures"])):b("",!0)]),v("div",jt,[v("h1",Bt,S(t.title),1),t.isActive?(u(),m("div",qt,[k(t.Prices,{product:t.product,"is-big":"","is-literal":""},null,8,["product"]),t.product.variations?(u(),A(t.SkuSelector,{key:0,variations:t.product.variations,"variation-id":t.variationId,"onUpdate:variationId":i[0]||(i[0]=s=>t.variationId=s),class:"my-4"},null,8,["variations","variation-id"])):b("",!0),k(d,{slide:"down"},{default:V(()=>[t.hasSkuSelectionAlert?(u(),m("div",Dt,[D(S("Por favor selecione uma opção em cada campo acima")+" "),Rt])):b("",!0)]),_:1}),v("div",Nt,[k(t.QuantitySelector,{modelValue:t.quantity,"onUpdate:modelValue":i[1]||(i[1]=s=>t.quantity=s),min:t.product.min_quantity,max:t.product.quantity,class:"border-base-100 rounded md:mr-5 lg:mb-2 lg:mr-auto lg:border-2"},null,8,["modelValue","min","max"]),k(t.CheckoutLink,{class:"ui-btn-lg ui-btn-primary grow text-center",to:"checkout","cart-item":{product_id:t.product._id,quantity:t.quantity,variation_id:t.variationId||void 0},"data-tooltip":t.isSkuSelected?null:"Escolha os detalhes do produto para comprar",onClick:t.checkVariation},{default:V(()=>[Ut,D(" "+S("Comprar"))]),_:1},8,["cart-item","data-tooltip"]),v("button",{class:"ui-btn-lg ui-btn-contrast grow",onClick:$(t.addToCart,["prevent"]),"data-tooltip":t.isSkuSelected?null:"Escolha os detalhes do produto para comprar"},S("Adicionar ao carrinho"),8,Ft)]),k(t.ShippingCalculator)])):b("",!0)]),v("div",Mt,[X(r.$slots,"description")])])}const me=G(Et,[["render",Qt]]);export{me as default};
|
|
2
|
-
function __vite__mapDeps(indexes) {
|
|
3
|
-
if (!__vite__mapDeps.viteFileDeps) {
|
|
4
|
-
__vite__mapDeps.viteFileDeps = []
|
|
5
|
-
}
|
|
6
|
-
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as p,M as z,d as I,N as w,O as r,P as d,V as h,W as b,a0 as S,R as C,S as v,T as y,Q as x,a1 as L,U as P,a7 as N,an as R,$ as V,X as j,Y as B,Z as M}from"./sf-utils.c42cbZ9W.js";import{_ as T,w as O,v as D}from"./_plugin-vue_export-helper.xATGHWd9.js";import{b as Q,c as E}from"./index.ShNlAyu1.js";import{b as A}from"./customer-session.ZD6tLDQJ.js";import{c as G,u as H}from"./use-product-card.UFr8SCuD.js";import{g as q}from"./index.KfrHdfOH.js";import"./server-data.4C60Esyt.js";import{a as F}from"./shopping-cart.nSNNOrp9.js";import{P as U}from"./Prices.xI1rdM1e.js";const Ce="Acima de",Pe="Marcas",we="Categorias",Se="Desconto",Ae="Maior preço",Ie="Menor preço",Le="Nome",W="Produtos relacionados",Te="Lançamentos",ze="Relevância",Ne="Vendas",Re="Até",X=t=>{const s=p(t.title||""),i=p(t.titleLink||""),e=p(!1);let _=null;const u=p(null),n=z(t.products||[]);return t.products||(e.value=!0,_=(async()=>{const f=t.limit||24;let g=`offset=${t.page?(t.page-1)*f:0}&limit=${f}`;if(t.sort&&(g+=`&sort=${t.sort}`),t.isRelatedProducts){const{apiContext:o}=globalThis.$storefront;o?.resource==="products"&&(g=`like=${o.doc._id}`,!s.value&&s.value!==null&&(s.value=W))}else{let o=t.searchQuery||"",a;if(t.collectionId){try{const{data:c}=await A.get(`collections/${t.collectionId}`);a=c}catch(c){console.error(c),u.value=c}const m=a?.products;Array.isArray(m)&&m.length&&(o+=`&_id=${m.slice(0,60).join(",")}`),!s.value&&s.value!==null&&a?.name&&(s.value=a?.name)}g+=o}try{const{data:o}=await A.get(`search/v1?${g}`);if(t.isShuffle){let a=o.result.filter(k=>k.available&&G(k)).length,m,c;for(;a;)c=Math.floor(Math.random()*a--),m=o.result[a],o.result[a]=o.result[c],o.result[c]=m}o.result.forEach(a=>n.push(a))}catch(o){console.error(o),u.value=o}e.value=!1})()),{title:s,titleLink:i,isFetching:e,fetching:_,fetchError:u,products:n}},Y=I({__name:"ProductCard",props:{product:{},productId:{},listName:{},listId:{},headingTag:{default:"h3"}},setup(t,{expose:s}){s();const i=t,{product:e,title:_,link:u,images:n,isInStock:f,isActive:l,discountPercentage:g,hasVariations:o}=H(i),a=p(null),m=Q(a),c=p(!1);q(m,()=>{c.value=!0});const k={props:i,product:e,title:_,link:u,images:n,isInStock:f,isActive:l,discountPercentage:g,hasVariations:o,card:a,isHovered:m,wasHoveredOnce:c,get addProductToCart(){return F},Prices:U};return Object.defineProperty(k,"__isScriptSetup",{enumerable:!1,value:!0}),k}}),Z=["data-sku"],J={class:"aspect-square p-2 transition-transform motion-safe:group-hover:scale-110"},K={class:"relative size-full overflow-hidden rounded bg-white group-hover:rounded-none"},$={key:0,class:"text-xs text-opacity-70"},ee={key:1,class:"from-base-50/20 to-base-100 size-full bg-gradient-to-br"},te={key:0,class:"uno-bm03rg"},oe={class:"relative z-10 flex grow flex-col justify-between p-4"},se={class:"pt-2"},ae={key:0},re={key:1,class:"bg-warning-100 text-warning-700 ui-badge"},ie=v("span",{class:"bg-on-primary text-primary mr-1 inline-block size-4 rounded-full text-center text-base leading-none opacity-80"}," + ",-1);function ne(t,s,i,e,_,u){const n=w("AImg"),f=w("ALink");return r(),d("article",{ref:"card","data-sku":e.product.sku,class:"group relative mx-auto h-full max-w-[350px] px-0.5 py-3 hover:z-[1]"},[h(f,{href:e.link,class:"flex h-full flex-col overflow-hidden rounded bg-white ring-black/5 group-hover:shadow group-hover:ring-1"},{default:b(()=>[v("div",J,[v("div",K,[e.images?.length?(r(),d("span",$,[h(n,{picture:e.images[0],alt:e.title,class:"absolute left-0 top-0 block size-full object-cover"},null,8,["picture","alt"]),e.images[1]&&e.wasHoveredOnce?(r(),S(n,{key:0,picture:e.images[1],alt:e.title,class:"absolute left-0 top-0 z-10 block size-full object-cover text-transparent opacity-0 transition-opacity group-hover:opacity-100 motion-safe:duration-300"},null,8,["picture","alt"])):C("",!0)])):(r(),d("div",ee))])]),e.discountPercentage?(r(),d("span",te,[y(" -"),v("strong",null,x(e.discountPercentage),1),y("% ")])):C("",!0),v("div",oe,[(r(),S(L(i.headingTag),{class:P(["ui-link line-clamp-2 no-underline",[e.isActive?"text-base-700":"text-base-500",e.link?"group-hover:text-primary group-hover:underline":null]])},{default:b(()=>[y(x(e.title),1)]),_:1},8,["class"])),v("div",se,[e.isActive?(r(),d("div",ae,[h(e.Prices,{product:e.product},null,8,["product"])])):(r(),d("span",re,x(e.isInStock?"Inativo":"Sem estoque"),1))]),e.isActive&&!e.hasVariations?(r(),d("button",{key:0,class:"uno-3suct9 ui-btn-sm ui-btn-primary",onClick:s[0]||(s[0]=O(l=>e.addProductToCart(e.product),["stop","prevent"]))},[ie,y(" "+x("Adicionar ao carrinho"))])):C("",!0)])]),_:1},8,["href"])],8,Z)}const le=T(Y,[["render",ne]]),ce=I({__name:"ProductShelf",props:{isGrid:{type:Boolean},collectionId:{},searchQuery:{},sort:{},title:{},titleLink:{},isShuffle:{type:Boolean},limit:{},page:{},products:{},isRelatedProducts:{type:Boolean}},async setup(t,{expose:s}){s();const i=t,[e,_]=E(),{title:u,titleLink:n,fetching:f,products:l}=X(i),g=u.value||`Shelf ${N()}`,o={props:i,DefineCarouselControl:e,ReuseCarouselControl:_,title:u,titleLink:n,fetching:f,products:l,listName:g,ProductCard:le};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),de={class:"ui-section"},ue={key:0,class:"mx-auto mb-4 max-w-prose text-center"},fe={class:"ui-text-brand text-3xl"};function me(t,s,i,e,_,u){const n=w("ALink"),f=w("CarouselControl");return r(),d("section",de,[e.title?(r(),d("div",ue,[v("h2",fe,[h(n,{href:e.titleLink,class:P(e.titleLink?"ui-link":"text-base-700")},{default:b(()=>[y(x(e.title),1)]),_:1},8,["href","class"])])])):C("",!0),(r(),S(L(i.isGrid?"ul":"Carousel"),{class:P(["group/shelf",i.isGrid&&"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4"])},R({default:b(()=>[(r(!0),d(B,null,M(e.products,l=>(r(),d("li",{key:l._id,class:"shrink-0 basis-1/2 md:basis-1/3 lg:basis-1/4"},[h(e.ProductCard,{product:l,"list-name":e.listName},null,8,["product","list-name"])]))),128))]),_:2},[i.isGrid?void 0:{name:"controls",fn:b(()=>[h(e.DefineCarouselControl,null,{default:b(({isPrev:l})=>[j(h(f,{class:P(["uno-t0rdy7",l?"!-left-4":"!-right-4"]),"is-prev":l},null,8,["class","is-prev"]),[[D,e.products.length>2]])]),_:1}),h(e.ReuseCarouselControl,{"is-prev":!0}),h(e.ReuseCarouselControl)]),key:"0"}]),1032,["class"])),V(t.$slots,"append")])}const Ve=T(ce,[["render",me]]);export{Ve as P,we as a,Re as b,Ce as c,ze as d,Ne as e,Ie as f,Ae as g,Se as h,Pe as i,Te as j,Le as k};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./sf-utils.c42cbZ9W.js";import{P as j}from"./ProductShelf.-4fsYkPB.js";import"./_plugin-vue_export-helper.xATGHWd9.js";import"./index.ShNlAyu1.js";import"./index.KfrHdfOH.js";import"./customer-session.ZD6tLDQJ.js";import"./server-data.4C60Esyt.js";import"./use-product-card.UFr8SCuD.js";import"./use-analytics.wTmoP8B1.js";import"./shopping-cart.nSNNOrp9.js";import"./price.Easct8WC.js";import"./afetch.OifQZgwR.js";import"./name.VA3MEpe0.js";import"./i18n.zhlBzJt8.js";import"./img.AnjeGdy_.js";import"./Prices.xI1rdM1e.js";import"./modules-info.HP6478mG.js";import"./format-money.1_HtF5S2.js";export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as v,w as V,a as U}from"./_plugin-vue_export-helper.xATGHWd9.js";import{d as S,c as y,O as m,P as f,$ as u,a6 as q,Y as k,T as B,a as P,a7 as $,a8 as T,S as x,Q as j,a3 as I,a4 as g,X as z,V as w,W as C}from"./sf-utils.c42cbZ9W.js";import"./server-data.4C60Esyt.js";const N=S({__name:"CheckoutLink",props:{to:{default:"cart"},cartUrl:{default:globalThis.$storefront?.settings.cartUrl||"/app/#/cart"},checkoutUrl:{default:globalThis.$storefront?.settings.checkoutUrl||"/app/#/checkout"},cartId:{},cartItem:{}},setup(a,{expose:i}){i();const t=a,e=y(()=>{let n=t.to==="cart"?t.cartUrl:t.checkoutUrl;if(t.cartId)n+=`/${t.cartId}`;else if(t.cartItem){const o={product_id:t.cartItem.product_id},{variation_id:l,quantity:d,sku:c,customizations:p}=t.cartItem;l&&(o.variation_id=l),d&&(o.quantity=String(d)),c&&(o.sku=c),p&&p.forEach(({label:r,option:_,attachment:M},Q)=>{const b=`customizations.${Q}.`;r&&(o[b+"label"]=r),_&&(_._id&&(o[b+"option._id"]=_._id),o[b+"option.text"]=_.text),M&&(o[b+"attachment"]=M)}),n+="?"+new URLSearchParams(o).toString()}return n}),s={props:t,href:e};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}}),O=["href"];function L(a,i,t,e,s,n){return m(),f("a",{href:e.href},[u(a.$slots,"default")],8,O)}const ee=v(N,[["render",L]]),D=S({__name:"QuantitySelectorControl",props:{isMinus:{type:Boolean}},setup(a,{expose:i}){i();const{value:t,isBoundMin:e,isBoundMax:s}=q(h),n={value:t,isBoundMin:e,isBoundMax:s};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),E=["data-quantity-selector-control","aria-label","disabled"];function R(a,i,t,e,s,n){return m(),f("button",{type:"button",class:"leading-12 h-12 w-10 text-xl enabled:text-primary enabled:hover:bg-primary-100/70 disabled:opacity-40","data-quantity-selector-control":t.isMinus?"minus":"plus","aria-label":t.isMinus?"Menos":"Mais",disabled:t.isMinus?e.isBoundMin:e.isBoundMax,onClick:i[0]||(i[0]=V(o=>e.value+=t.isMinus?-1:1,["prevent"]))},[u(a.$slots,"default",{},()=>[t.isMinus?(m(),f(k,{key:0},[B("−")],64)):(m(),f(k,{key:1},[B("+")],64))])],8,E)}const F=v(D,[["render",R]]),h=Symbol("quantitySelector"),K=S({__name:"QuantitySelector",props:{modelValue:{default:1},min:{default:1},max:{},step:{},disabled:{type:Boolean},readonly:{type:Boolean}},emits:["update:modelValue"],setup(a,{expose:i,emit:t}){i();const e=a,s=t,n=P(null),o=$("NInput"),l=y({get(){return e.modelValue},set(r){r<e.min&&(r=e.min,n.value.value=`${r}`),e.max&&r>e.max&&(r=e.max,n.value.value=`${r}`),s("update:modelValue",r)}}),d=y(()=>e.min>=l.value),c=y(()=>e.max<=l.value);T(h,{value:l,isBoundMin:d,isBoundMax:c});const p={quantitySelectorKey:h,props:e,emit:s,input:n,inputId:o,value:l,isBoundMin:d,isBoundMax:c,QuantitySelectorControl:F};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),W={"data-quantity-selector":""},X=["for"],Y={class:"flex items-center"},A=["id","min","max","step","disabled","readonly"];function G(a,i,t,e,s,n){return m(),f("div",W,[u(a.$slots,"label",I(g({inputId:e.inputId,value:e.value})),()=>[x("label",{for:e.inputId,class:"sr-only"},j("Quantidade"),8,X)]),x("div",Y,[z(x("input",{ref:"input",type:"number",id:e.inputId,"onUpdate:modelValue":i[0]||(i[0]=o=>e.value=o),min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:"h-12 w-14 border-transparent px-2 text-center text-lg [-moz-appearance:_textfield] [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none"},null,8,A),[[U,e.value]]),u(a.$slots,"controls",I(g({value:e.value,isBoundMin:e.isBoundMin,isBoundMax:e.isBoundMax})),()=>[w(e.QuantitySelectorControl,{"is-minus":"",class:"order-first"},{default:C(()=>[u(a.$slots,"minus")]),_:3}),w(e.QuantitySelectorControl,{class:"order-last"},{default:C(()=>[u(a.$slots,"plus")]),_:3})])])])}const te=v(K,[["render",G]]);export{ee as C,te as Q};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as Z}from"./_plugin-vue_export-helper.xATGHWd9.js";import{a9 as Q,a as T,w as V,aa as q,d as J,N as j,O as f,P as w,V as F,W as x,U as O,Y as R,Q as L,T as U,Z as M,S,R as H,a0 as z,ab as K}from"./sf-utils.c42cbZ9W.js";import"./server-data.4C60Esyt.js";import{S as X,s as G}from"./use-analytics.wTmoP8B1.js";import{P as $}from"./ProductShelf.-4fsYkPB.js";import"./customer-session.ZD6tLDQJ.js";import"./index.KfrHdfOH.js";import"./shopping-cart.nSNNOrp9.js";import"./price.Easct8WC.js";import"./afetch.OifQZgwR.js";import"./name.VA3MEpe0.js";import"./i18n.zhlBzJt8.js";import"./index.ShNlAyu1.js";import"./use-product-card.UFr8SCuD.js";import"./img.AnjeGdy_.js";import"./Prices.xI1rdM1e.js";import"./modules-info.HP6478mG.js";import"./format-money.1_HtF5S2.js";var ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function te(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Y={exports:{}};(function(n){(function(a,i){n.exports?n.exports=i():a.Wade=i()})(ee,function(){var a={stopWords:["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","see","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"],punctuationRE:/[.,!?:;"']/g},i=function(e,o){for(var r=o,c=0;c<e.length&&(r=r[e[c]])!==void 0;c++);return r},t=function(e,o,r,c){for(var h=null,s=0;s<e.length;s++){var u=e[s];(h=r[u])===void 0?(r[u]=o.length,o.push({index:u,score:c})):o[h].score+=c}},k=function(e,o,r,c,h){var s=i(e,o);s!==void 0&&s.id!==void 0&&t(s.id,r,c,h)},g=function(e,o,r,c,h){var s=i(e,o);if(s!==void 0)for(var u=[s],m=null,d=0;u.length!==0;){(m=u[d]).id!==void 0&&t(m.id,r,c,h),u.pop(),d--;for(var _ in m)u.push(m[_]),d++}},v=function(e){var o=e.length-1;return e[0]===" "&&(e=e.substring(1)),e[o]===" "&&(e=e.substring(0,o)),e.split(" ")},y=function(e){return e.toLowerCase()},p=function(e){return e.replace(a.punctuationRE,"")},E=function(e){for(var o=v(e),r=o.length;r--!=0;)l.config.stopWords.indexOf(o[r])!==-1&&o.splice(r,1);return o.join(" ")},l=function(e){var o=function(u){var m=o.index,d=l.process(u);if(d===!1)return[];for(var _=v(d),W=_.length,b=W-1,C=1/W,B=[],N={},P=0;P<b;P++)k(_[P],m,B,N,C);return g(_[b],m,B,N,C),B};if(Array.isArray(e)){for(var r=e.length,c=new Array(r),h=null,s=0;s<r;s++)(h=l.process(e[s]))!==!1&&(c[s]=h);o.index=l.index(c),o.data=c}else o.index=e.index,o.data=e.data;return o};return l.pipeline=[y,p,E],l.process=function(e){for(var o=l.pipeline,r=0;r<o.length;r++)e=o[r](e);return e.length!==0&&e},l.index=function(e){for(var o={},r=0;r<e.length;r++){var c=e[r];if(c!==void 0)for(var h=v(c),s=0;s<h.length;s++){for(var u=h[s],m=u.length-1,d=o,_=0;_<m;_++){var W=u[_],b=d[W];b=b===void 0?{}:b,d[W]=b,d=b}var C=u[m];d[C]===void 0?d[C]={id:[r]}:(d=d[C]).id===void 0?d.id=[r]:d.id.push(r)}}return o},l.save=function(e){return{data:e.data,index:e.index}},l.config=a,l.version="0.3.3",l})})(Y);var oe=Y.exports;const I=te(oe),A=[];["categories","brands","collections"].forEach(n=>{const a=globalThis.$storefront.data[n];if(a)for(let i=0;i<a.length;i++){const t=a[i];t.name&&t.slug&&A.push({text:Q(`${t.name} ${t.short_description}`),type:n,data:t})}});let D;A.length&&(globalThis.$storefront.settings.lang==="pt_br"&&(I.config.stopWords=["e","a","o","de","para","com","tem"]),D=I(A.map(({text:n})=>n)));const re=n=>{const a=new X({debounce:n.fetchDebounce||300});a.pageSize.value=n.productsLimit||12,a.isWithCount.value=!0,a.isWithBuckets.value=!1;const i=T(0),t=T([]);V(q(n,"term"),async g=>{if(a.fetch(g),D){const v=D(Q(g));t.value=v.map(({index:y})=>{const{name:p,slug:E}=A[y].data;return{title:p,href:`/${E}`}})}},{immediate:!0}),V(a.meta,()=>{i.value=a.meta.count||0});const k=T([]);return V(G,()=>{k.value=G.filter(g=>g!==n.term)},{immediate:!0}),{searchHistory:k,searchEngine:a,isFetching:a.isFetching,products:a.products,productCount:i,linkHits:t}},ne=J({__name:"SearchModal",props:{term:{},fetchDebounce:{},productsLimit:{}},setup(n,{expose:a}){a();const i=n,{searchHistory:t,isFetching:k,products:g,productCount:v,linkHits:y}=re(i),p={props:i,searchHistory:t,isFetching:k,products:g,productCount:v,linkHits:y,get getSearchUrl(){return K},ProductShelf:$};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),ae={class:"relative"},ie={key:0,class:"bg-base-100/80 grid grid-cols-1 items-center gap-4 p-4 backdrop-blur-md md:grid-cols-2 md:rounded-b lg:mt-5 lg:grid-cols-3 lg:rounded"},se={class:"flex items-center justify-end gap-4 md:order-2"},le={key:0,class:"text-base-900 text-right text-sm lowercase"},ce=["href"],de={class:"lg:col-span-2"},ue=["href"],he=S("i",{class:"i-clock m-0","aria-label":"Buscar novamente"},null,-1);function fe(n,a,i,t,k,g){const v=j("ALink"),y=j("Carousel"),p=j("Fade"),E=j("Skeleton");return f(),w("article",ae,[F(p,{slide:"down"},{default:x(()=>[t.linkHits.length?(f(),w("section",{key:0,class:O(["bg-white p-4",!t.isFetching&&t.products.length?"lg:rounded-t":"lg:rounded"])},[S("nav",null,[F(y,{"wrapper-key":i.term,class:"px-6 [&>ul]:gap-3"},{default:x(()=>[(f(!0),w(R,null,M(t.linkHits,({title:l,href:e},o)=>(f(),w("li",{key:o,class:"shrink-0"},[F(v,{href:e,class:"ui-link"},{default:x(()=>[U(L(l),1)]),_:2},1032,["href"])]))),128))]),_:1},8,["wrapper-key"])])],2)):H("",!0)]),_:1}),t.isFetching?(f(),z(E,{key:0,class:"absolute top-0 w-full px-5 pt-20"})):H("",!0),F(p,{"is-leave-to":!1},{default:x(()=>[!t.isFetching&&t.products.length?(f(),z(t.ProductShelf,{key:0,products:t.products,class:O(["m-0 max-w-none bg-white px-4 lg:[&_[data-carousel-control=next]]:!-right-10 lg:[&_[data-carousel-control=previous]]:!-left-10",t.linkHits.length?"lg:rounded-b":"lg:rounded"])},null,8,["products","class"])):H("",!0)]),_:1}),F(p,{"is-leave-to":!1},{default:x(()=>[!t.isFetching&&(t.searchHistory.length||t.productCount>t.products.length)?(f(),w("section",ie,[S("div",se,[t.productCount>1?(f(),w("p",le,[S("strong",null,L(t.productCount),1),U(" "+L("Itens encontrados"))])):H("",!0),t.productCount>t.products.length?(f(),w("a",{key:1,href:t.getSearchUrl(i.term),class:"ui-btn ui-btn-primary w-auto whitespace-nowrap text-center"},L("Ver todos"),8,ce)):H("",!0)]),S("div",de,[S("nav",null,[F(y,{"wrapper-key":i.term,class:"px-6 [&>ul]:gap-2.5"},{previous:x(()=>[he]),default:x(()=>[(f(!0),w(R,null,M(t.searchHistory,(l,e)=>(f(),w("li",{key:e,class:"shrink-0"},[S("a",{href:t.getSearchUrl(l),class:"text-base-700 ui-link text-sm font-normal"},L(l),9,ue)]))),128))]),_:1},8,["wrapper-key"])])])])):H("",!0)]),_:1})])}const Ae=Z(ne,[["render",fe]]);export{Ae as default};
|