@pisell/private-materials 6.12.434 → 6.12.436
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/es/components/vendingMachine/CustomerScreens.js +16 -12
- package/es/components/vendingMachine/customer.less +23 -25
- package/es/components/venueBookingSales/VenueBookingShared.js +3 -2
- package/es/components/venueBookingSales/presentation.js +27 -1
- package/es/plus/pisellReservation/utils/calendarBookingSelection.js +4 -4
- package/es/plus/saasDevice/devicePasscodes/model.js +4 -4
- package/es/plus/venueBookingDesign/shared/CheckoutBenefits.js +2 -27
- package/es/plus/venueBookingDesign/shared/Layout.js +3 -33
- package/es/plus/venueBookingDesign/shared/kiosk-viewport.js +60 -7
- package/es/plus/walletPassGallery/components/timelineSection/index.js +4 -4
- package/es/pro/skuDetailModal/flow/calendarEntry.js +2 -2
- package/lib/components/vendingMachine/CustomerScreens.js +9 -5
- package/lib/components/vendingMachine/customer.less +23 -25
- package/lib/components/venueBookingSales/VenueBookingShared.js +2 -1
- package/lib/components/venueBookingSales/presentation.js +27 -0
- package/lib/plus/venueBookingDesign/shared/CheckoutBenefits.js +1 -26
- package/lib/plus/venueBookingDesign/shared/Layout.js +2 -32
- package/lib/plus/venueBookingDesign/shared/kiosk-viewport.js +60 -7
- package/package.json +2 -2
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import useLocale from "../../hooks/useLocale.js";
|
|
1
2
|
import { useVendingLocale } from "./locales.js";
|
|
2
3
|
import CustomerLanguageSelect from "./CustomerLanguageSelect.js";
|
|
3
4
|
import React, { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
4
5
|
import { Alert } from "antd";
|
|
6
|
+
import { PisellBrand } from "@pisell/materials";
|
|
5
7
|
import "./customer.less";
|
|
6
8
|
//#region src/components/vendingMachine/CustomerScreens.tsx
|
|
7
|
-
function Icon({ name }) {
|
|
9
|
+
function Icon$1({ name }) {
|
|
8
10
|
return /* @__PURE__ */ React.createElement("span", {
|
|
9
11
|
className: `vm-prototype-icon vm-prototype-icon-${name}`,
|
|
10
12
|
"aria-hidden": "true"
|
|
@@ -33,20 +35,22 @@ function Brand({ name, subtitle, compact = false }) {
|
|
|
33
35
|
}
|
|
34
36
|
function ScanHint({ pill = false }) {
|
|
35
37
|
const { text: t } = useVendingLocale();
|
|
36
|
-
return /* @__PURE__ */ React.createElement("div", { className: `vm-customer-scan-hint${pill ? " vm-customer-scan-hint-pill" : ""}` }, /* @__PURE__ */ React.createElement(Icon, { name: "qr-code" }), /* @__PURE__ */ React.createElement("span", null, t("scanHint")), /* @__PURE__ */ React.createElement(Icon, { name: "arrow-down" }));
|
|
38
|
+
return /* @__PURE__ */ React.createElement("div", { className: `vm-customer-scan-hint${pill ? " vm-customer-scan-hint-pill" : ""}` }, /* @__PURE__ */ React.createElement(Icon$1, { name: "qr-code" }), /* @__PURE__ */ React.createElement("span", null, t("scanHint")), /* @__PURE__ */ React.createElement(Icon$1, { name: "arrow-down" }));
|
|
37
39
|
}
|
|
38
40
|
function TechnicalSupportBar({ active, onRequestSettings }) {
|
|
39
|
-
const
|
|
41
|
+
const locale = useLocale();
|
|
40
42
|
const taps = useRef([]);
|
|
41
43
|
useEffect(() => {
|
|
42
44
|
taps.current = [];
|
|
43
45
|
}, [active]);
|
|
44
|
-
return /* @__PURE__ */ React.createElement("
|
|
45
|
-
type: "button",
|
|
46
|
+
return /* @__PURE__ */ React.createElement("fieldset", {
|
|
46
47
|
className: "vm-customer-technical-support",
|
|
47
|
-
disabled: !active
|
|
48
|
+
disabled: !active
|
|
49
|
+
}, /* @__PURE__ */ React.createElement(PisellBrand, {
|
|
50
|
+
locale,
|
|
48
51
|
onClick: (event) => {
|
|
49
52
|
event.stopPropagation();
|
|
53
|
+
if (!active) return;
|
|
50
54
|
const now = Date.now();
|
|
51
55
|
taps.current = [...taps.current.filter((at) => now - at < 3e3), now];
|
|
52
56
|
if (taps.current.length >= 5) {
|
|
@@ -54,7 +58,7 @@ function TechnicalSupportBar({ active, onRequestSettings }) {
|
|
|
54
58
|
onRequestSettings();
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
|
-
}
|
|
61
|
+
}));
|
|
58
62
|
}
|
|
59
63
|
function IdleScreen({ brand, subtitle, active, onStart, onRequestSettings }) {
|
|
60
64
|
const { text: t } = useVendingLocale();
|
|
@@ -70,7 +74,7 @@ function IdleScreen({ brand, subtitle, active, onStart, onRequestSettings }) {
|
|
|
70
74
|
}), /* @__PURE__ */ React.createElement("div", { className: "vm-customer-idle-copy" }, /* @__PURE__ */ React.createElement("h1", null, t("idleTitle")), /* @__PURE__ */ React.createElement("p", null, t("idleDescription")))), /* @__PURE__ */ React.createElement("div", { className: "vm-customer-idle-actions" }, /* @__PURE__ */ React.createElement("div", { className: "vm-customer-start" }, /* @__PURE__ */ React.createElement("div", {
|
|
71
75
|
className: "vm-customer-touch",
|
|
72
76
|
"aria-hidden": "true"
|
|
73
|
-
}, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-pulse" }), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-pulse" }), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-hand" }, /* @__PURE__ */ React.createElement(Icon, { name: "hand" }))), /* @__PURE__ */ React.createElement("p", { className: "vm-customer-touch-label" }, t("touch")))), /* @__PURE__ */ React.createElement("div", { className: "vm-customer-idle-footer" }, /* @__PURE__ */ React.createElement(ScanHint, { pill: true }))), /* @__PURE__ */ React.createElement("button", {
|
|
77
|
+
}, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-pulse" }), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-pulse" }), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-hand" }, /* @__PURE__ */ React.createElement(Icon$1, { name: "hand" }))), /* @__PURE__ */ React.createElement("p", { className: "vm-customer-touch-label" }, t("touch")))), /* @__PURE__ */ React.createElement("div", { className: "vm-customer-idle-footer" }, /* @__PURE__ */ React.createElement(ScanHint, { pill: true }))), /* @__PURE__ */ React.createElement("button", {
|
|
74
78
|
type: "button",
|
|
75
79
|
className: "vm-customer-idle-hitarea",
|
|
76
80
|
"aria-label": t("touch"),
|
|
@@ -94,11 +98,11 @@ function CustomerHome({ brand, machine, locale = "en", languageDisabled = false,
|
|
|
94
98
|
className: "vm-customer-buy",
|
|
95
99
|
disabled: !ready,
|
|
96
100
|
onClick: onBuy
|
|
97
|
-
}, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-icon" }, /* @__PURE__ */ React.createElement(Icon, { name: "footprints" })), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-copy" }, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-title" }, t("buy")), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-description" }, t("buyDescription"))), /* @__PURE__ */ React.createElement(Icon, { name: "chevron-right" })), /* @__PURE__ */ React.createElement("button", {
|
|
101
|
+
}, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-icon" }, /* @__PURE__ */ React.createElement(Icon$1, { name: "footprints" })), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-copy" }, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-title" }, t("buy")), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-description" }, t("buyDescription"))), /* @__PURE__ */ React.createElement(Icon$1, { name: "chevron-right" })), /* @__PURE__ */ React.createElement("button", {
|
|
98
102
|
type: "button",
|
|
99
103
|
className: "vm-customer-buy vm-customer-redeem",
|
|
100
104
|
onClick: onRedeem
|
|
101
|
-
}, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-icon" }, /* @__PURE__ */ React.createElement(Icon, { name: "qr-code" })), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-copy" }, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-title" }, t("redeem")), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-description" }, t("redeemDescription"))), /* @__PURE__ */ React.createElement(Icon, { name: "chevron-right" }))), !ready && failed && /* @__PURE__ */ React.createElement("div", { className: "vm-customer-load-error" }, /* @__PURE__ */ React.createElement(Alert, {
|
|
105
|
+
}, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-icon" }, /* @__PURE__ */ React.createElement(Icon$1, { name: "qr-code" })), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-copy" }, /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-title" }, t("redeem")), /* @__PURE__ */ React.createElement("span", { className: "vm-customer-buy-description" }, t("redeemDescription"))), /* @__PURE__ */ React.createElement(Icon$1, { name: "chevron-right" }))), !ready && failed && /* @__PURE__ */ React.createElement("div", { className: "vm-customer-load-error" }, /* @__PURE__ */ React.createElement(Alert, {
|
|
102
106
|
type: "error",
|
|
103
107
|
message: t("loadError"),
|
|
104
108
|
action: /* @__PURE__ */ React.createElement("button", {
|
|
@@ -109,7 +113,7 @@ function CustomerHome({ brand, machine, locale = "en", languageDisabled = false,
|
|
|
109
113
|
type: "button",
|
|
110
114
|
className: "vm-customer-help",
|
|
111
115
|
onClick: onHelp
|
|
112
|
-
}, /* @__PURE__ */ React.createElement(Icon, { name: "life-buoy" }), t("help")), /* @__PURE__ */ React.createElement("div", { className: "vm-customer-machine-row" }, /* @__PURE__ */ React.createElement("button", {
|
|
116
|
+
}, /* @__PURE__ */ React.createElement(Icon$1, { name: "life-buoy" }), t("help")), /* @__PURE__ */ React.createElement("div", { className: "vm-customer-machine-row" }, /* @__PURE__ */ React.createElement("button", {
|
|
113
117
|
type: "button",
|
|
114
118
|
className: "vm-customer-machine",
|
|
115
119
|
tabIndex: -1,
|
|
@@ -117,4 +121,4 @@ function CustomerHome({ brand, machine, locale = "en", languageDisabled = false,
|
|
|
117
121
|
}, machine))));
|
|
118
122
|
}
|
|
119
123
|
//#endregion
|
|
120
|
-
export { Brand, CustomerBrandLogoContext, CustomerHome, CustomerViewport, Icon, IdleScreen };
|
|
124
|
+
export { Brand, CustomerBrandLogoContext, CustomerHome, CustomerViewport, Icon$1 as Icon, IdleScreen };
|
|
@@ -70,6 +70,8 @@
|
|
|
70
70
|
|
|
71
71
|
.vm-customer-idle {
|
|
72
72
|
position: relative;
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
73
75
|
width: 100%;
|
|
74
76
|
height: 100%;
|
|
75
77
|
overflow: hidden;
|
|
@@ -144,9 +146,9 @@
|
|
|
144
146
|
display: grid;
|
|
145
147
|
grid-template-rows: auto minmax(200px, 1fr) auto;
|
|
146
148
|
row-gap: 32px;
|
|
147
|
-
|
|
149
|
+
flex: 1 0 auto;
|
|
148
150
|
min-height: min-content;
|
|
149
|
-
padding:
|
|
151
|
+
padding: 28px 40px 40px;
|
|
150
152
|
}
|
|
151
153
|
.vm-customer-idle-header,
|
|
152
154
|
.vm-customer-idle-actions,
|
|
@@ -214,10 +216,9 @@
|
|
|
214
216
|
}
|
|
215
217
|
.vm-customer-idle-copy {
|
|
216
218
|
flex-shrink: 0;
|
|
217
|
-
margin-top:
|
|
219
|
+
margin-top: 36px;
|
|
218
220
|
h1 {
|
|
219
221
|
font-size: 64px;
|
|
220
|
-
line-height: 1;
|
|
221
222
|
display: -webkit-box;
|
|
222
223
|
-webkit-box-orient: vertical;
|
|
223
224
|
-webkit-line-clamp: 3;
|
|
@@ -301,30 +302,25 @@
|
|
|
301
302
|
background: rgba(255, 255, 255, 0.8);
|
|
302
303
|
line-height: 1.4;
|
|
303
304
|
}
|
|
304
|
-
.vm-customer-
|
|
305
|
-
|
|
305
|
+
.vm-customer-technical-support {
|
|
306
|
+
--pisell-brand-inset: clamp(18px, 4.44cqw, 64px);
|
|
307
|
+
--pisell-brand-font-size: clamp(12px, 2.04cqw, 28px);
|
|
308
|
+
--pisell-brand-top-height: clamp(50px, 10.37cqw, 148px);
|
|
309
|
+
--pisell-brand-top-gap: clamp(14px, 2.41cqw, 34px);
|
|
310
|
+
--pisell-brand-top-logo-width: clamp(76px, 16.67cqw, 240px);
|
|
311
|
+
position: relative;
|
|
306
312
|
z-index: 3;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
313
|
+
flex: none;
|
|
314
|
+
min-width: 0;
|
|
315
|
+
height: var(--pisell-brand-top-height);
|
|
310
316
|
margin: 0;
|
|
311
317
|
border: 0;
|
|
312
|
-
padding:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
line-height: normal;
|
|
317
|
-
text-align: center;
|
|
318
|
-
touch-action: manipulation;
|
|
319
|
-
user-select: none;
|
|
320
|
-
&:focus-visible {
|
|
321
|
-
outline-offset: -3px;
|
|
318
|
+
padding: 0;
|
|
319
|
+
|
|
320
|
+
.pisell-brand__content::before {
|
|
321
|
+
--brand-surface: #efe8fc;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
.vm-customer-canvas .vm-customer-home > .vm-customer-technical-support {
|
|
325
|
-
position: relative;
|
|
326
|
-
flex-shrink: 0;
|
|
327
|
-
}
|
|
328
324
|
.vm-customer-canvas .vm-customer-idle-hitarea {
|
|
329
325
|
position: absolute;
|
|
330
326
|
z-index: 2;
|
|
@@ -352,6 +348,8 @@
|
|
|
352
348
|
padding: 0 var(--vm-customer-gutter);
|
|
353
349
|
}
|
|
354
350
|
.vm-customer-home-toolbar {
|
|
351
|
+
position: relative;
|
|
352
|
+
z-index: 3;
|
|
355
353
|
justify-content: space-between;
|
|
356
354
|
gap: 24px;
|
|
357
355
|
> .vm-customer-brand {
|
|
@@ -619,10 +617,10 @@
|
|
|
619
617
|
.vm-customer-idle-layout {
|
|
620
618
|
grid-template-rows: auto minmax(160px, 1fr) auto;
|
|
621
619
|
gap: 24px;
|
|
622
|
-
padding:
|
|
620
|
+
padding-inline: 20px;
|
|
621
|
+
padding-bottom: 24px;
|
|
623
622
|
}
|
|
624
623
|
.vm-customer-idle-copy {
|
|
625
|
-
margin-top: 32px;
|
|
626
624
|
h1 {
|
|
627
625
|
font-size: 44px;
|
|
628
626
|
}
|
|
@@ -9,7 +9,7 @@ import { Button as Button$2 } from "../../plus/venueBookingDesign/shared/Control
|
|
|
9
9
|
import { OrderItem, PriceBreakdown } from "../../plus/venueBookingDesign/shared/OrderContent.js";
|
|
10
10
|
import { Notice } from "../../plus/venueBookingDesign/shared/Feedback.js";
|
|
11
11
|
import { CheckoutBenefits } from "../../plus/venueBookingDesign/shared/CheckoutBenefits.js";
|
|
12
|
-
import {
|
|
12
|
+
import { createDescriptionTextResolver, localizedText } from "./presentation.js";
|
|
13
13
|
import { calendarDateLabel } from "../../plus/venueBookingDesign/booking-date.js";
|
|
14
14
|
import BookingProductDetailModal from "../../pro/bookingProductDetailModal/index.js";
|
|
15
15
|
import { prepareBookingProduct } from "./availability/prepareProduct.js";
|
|
@@ -230,6 +230,7 @@ function VenuePreviewCatalog({ runtime, preview, showFilters }) {
|
|
|
230
230
|
function VenueCatalog({ runtime, showFilters = true, formatAmount = runtime.amount }) {
|
|
231
231
|
var _runtime$engine;
|
|
232
232
|
const { mode, locale, context, variant, scopeKey, date, main, props, productQuantities, disabled, text, partyMain, composer, run, openProduct } = runtime;
|
|
233
|
+
const descriptionPreview = useMemo(() => createDescriptionTextResolver(locale), [scopeKey, locale]);
|
|
233
234
|
const displayProducts = useVenueCatalogPromotions(main.products, runtime.sales.bookingTicket, (_runtime$engine = runtime.engine) === null || _runtime$engine === void 0 || (_runtime$engine = _runtime$engine.appHelper) === null || _runtime$engine === void 0 || (_runtime$engine = _runtime$engine.utils) === null || _runtime$engine === void 0 ? void 0 : _runtime$engine.promotionEvaluator, locale);
|
|
234
235
|
const renderCard = useMemo(() => createVenueCatalogCardRenderer({
|
|
235
236
|
mode,
|
|
@@ -294,7 +295,7 @@ function VenueCatalog({ runtime, showFilters = true, formatAmount = runtime.amou
|
|
|
294
295
|
const selected = mode === "party" && Number((_composer$detail$id = composer === null || composer === void 0 ? void 0 : composer.detail.id) !== null && _composer$detail$id !== void 0 ? _composer$detail$id : partyMain === null || partyMain === void 0 ? void 0 : partyMain.line.product_id) === Number(product.id);
|
|
295
296
|
return {
|
|
296
297
|
disabled: disabled || main.loading || !!main.error || !canOpen,
|
|
297
|
-
description:
|
|
298
|
+
description: descriptionPreview(product.description),
|
|
298
299
|
businessInfo: mode === "party" && capacity.partySize || capacity.durationMinutes ? /* @__PURE__ */ React.createElement("div", { className: "party-meta venue-booking-sales__facts" }, mode === "party" && capacity.partySize && /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(Users, {
|
|
299
300
|
size: 15,
|
|
300
301
|
"aria-hidden": "true"
|
|
@@ -14,12 +14,38 @@ function localizedText(value, locale) {
|
|
|
14
14
|
function descriptionText(value, locale) {
|
|
15
15
|
const text = localizedText(value, locale);
|
|
16
16
|
if (typeof DOMParser === "undefined") return text.replace(/<br\s*\/?\s*>|<\/(?:p|div|li|h[1-6])>/gi, "\n").replace(/<[^>]*>/g, "").trim();
|
|
17
|
+
if (!/[<&\r\0]/.test(text)) return text.replace(/\n{3,}/g, "\n\n").trim();
|
|
17
18
|
const body = new DOMParser().parseFromString(text, "text/html").body;
|
|
18
19
|
body.querySelectorAll("script, style, template").forEach((node) => node.remove());
|
|
19
20
|
body.querySelectorAll("br").forEach((node) => node.replaceWith("\n"));
|
|
20
21
|
body.querySelectorAll("p, div, li, h1, h2, h3, h4, h5, h6, blockquote, tr").forEach((node) => node.append("\n"));
|
|
21
22
|
return (body.textContent || "").replace(/\n{3,}/g, "\n\n").trim();
|
|
22
23
|
}
|
|
24
|
+
/** One catalog owns this cache; retain strings only, never parsed Documents.
|
|
25
|
+
* Key the actual localized copy so updates to an existing product are visible. */
|
|
26
|
+
function createDescriptionTextResolver(locale) {
|
|
27
|
+
const previews = /* @__PURE__ */ new Map();
|
|
28
|
+
const maxEntries = 64;
|
|
29
|
+
const maxCharacters = 256e3;
|
|
30
|
+
let characters = 0;
|
|
31
|
+
return (value) => {
|
|
32
|
+
const text = localizedText(value, locale);
|
|
33
|
+
if (typeof DOMParser === "undefined" || !/[<&\r\0]/.test(text)) return descriptionText(text, locale);
|
|
34
|
+
const cached = previews.get(text);
|
|
35
|
+
if (cached !== void 0) return cached;
|
|
36
|
+
const preview = descriptionText(text, locale);
|
|
37
|
+
const size = text.length + preview.length;
|
|
38
|
+
if (size > maxCharacters) return preview;
|
|
39
|
+
while (previews.size >= maxEntries || characters + size > maxCharacters) {
|
|
40
|
+
const oldest = previews.keys().next().value;
|
|
41
|
+
characters -= oldest.length + previews.get(oldest).length;
|
|
42
|
+
previews.delete(oldest);
|
|
43
|
+
}
|
|
44
|
+
previews.set(text, preview);
|
|
45
|
+
characters += size;
|
|
46
|
+
return preview;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
23
49
|
const emptyConfiguration = (productId) => ({
|
|
24
50
|
skuValue: {
|
|
25
51
|
product_id: productId,
|
|
@@ -48,4 +74,4 @@ function dateInTimezone(timezone) {
|
|
|
48
74
|
return `${part("year")}-${part("month")}-${part("day")}`;
|
|
49
75
|
}
|
|
50
76
|
//#endregion
|
|
51
|
-
export { dateInTimezone, descriptionText, emptyConfiguration, localizedText, orderIdentity };
|
|
77
|
+
export { createDescriptionTextResolver, dateInTimezone, descriptionText, emptyConfiguration, localizedText, orderIdentity };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import utc from "dayjs/plugin/utc";
|
|
3
|
+
import timezone from "dayjs/plugin/timezone";
|
|
4
4
|
//#region src/plus/pisellReservation/utils/calendarBookingSelection.ts
|
|
5
|
-
dayjs.extend(
|
|
6
|
-
dayjs.extend(
|
|
5
|
+
dayjs.extend(utc);
|
|
6
|
+
dayjs.extend(timezone);
|
|
7
7
|
/** Resolve the same shop clock used by the POS host; previews use the device clock. */
|
|
8
8
|
function resolveReservationTimeZone(utils) {
|
|
9
9
|
var _utils$getStore$getSt, _utils$getStore, _utils$getStore$getSt2, _utils$store, _utils$store$getState, _utils$getApp, _utils$getApp$getStor, _utils$getApp$getStor2, _core$tenant, _core$core, _core$core2, _state$core, _state$core2, _utils$getData, _state$global, _state$global2, _state$global3;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import utc from "dayjs/plugin/utc";
|
|
4
|
+
import timezone from "dayjs/plugin/timezone";
|
|
5
5
|
//#region src/plus/saasDevice/devicePasscodes/model.ts
|
|
6
|
-
dayjs.extend(
|
|
7
|
-
dayjs.extend(
|
|
6
|
+
dayjs.extend(utc);
|
|
7
|
+
dayjs.extend(timezone);
|
|
8
8
|
const INITIAL_DEVICE_PASSCODE_STATE = {
|
|
9
9
|
deviceIds: [],
|
|
10
10
|
devicesById: {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import { useBookingUI } from "../context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { observeReservedElementHeight } from "./kiosk-viewport.js";
|
|
4
4
|
import { Button } from "./Controls.js";
|
|
5
5
|
import { Dialog, legacyBookingOverlaySelector } from "../Dialog.js";
|
|
6
6
|
import { translate } from "../i18n.js";
|
|
@@ -64,34 +64,9 @@ function CheckoutBenefits({ status, needsAttention = false, hidden = false, disa
|
|
|
64
64
|
const currentStatus = status !== null && status !== void 0 ? status : t("benefitsTitle");
|
|
65
65
|
const inviteAttention = !noticed && !disabled && !needsAttention;
|
|
66
66
|
useLayoutEffect(() => {
|
|
67
|
-
var _window$visualViewpor;
|
|
68
67
|
const element = trigger.current;
|
|
69
68
|
if (!element) return;
|
|
70
|
-
|
|
71
|
-
const measure = () => {
|
|
72
|
-
const height = kiosk ? kioskLogicalElementHeight(element) : element.getBoundingClientRect().height;
|
|
73
|
-
if (height > 0) scope === null || scope === void 0 || scope.style.setProperty("--checkout-benefits-height", `${height}px`);
|
|
74
|
-
};
|
|
75
|
-
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(measure);
|
|
76
|
-
observer === null || observer === void 0 || observer.observe(element);
|
|
77
|
-
const bodyObserver = kiosk ? new MutationObserver(measure) : void 0;
|
|
78
|
-
bodyObserver === null || bodyObserver === void 0 || bodyObserver.observe(document.body, {
|
|
79
|
-
attributes: true,
|
|
80
|
-
attributeFilter: ["style", "class"]
|
|
81
|
-
});
|
|
82
|
-
window.addEventListener("resize", measure);
|
|
83
|
-
if (kiosk) (_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.addEventListener("resize", measure);
|
|
84
|
-
if (kiosk) document.body.addEventListener("transitionend", measure);
|
|
85
|
-
measure();
|
|
86
|
-
return () => {
|
|
87
|
-
var _window$visualViewpor2;
|
|
88
|
-
observer === null || observer === void 0 || observer.disconnect();
|
|
89
|
-
bodyObserver === null || bodyObserver === void 0 || bodyObserver.disconnect();
|
|
90
|
-
window.removeEventListener("resize", measure);
|
|
91
|
-
(_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.removeEventListener("resize", measure);
|
|
92
|
-
document.body.removeEventListener("transitionend", measure);
|
|
93
|
-
scope === null || scope === void 0 || scope.style.removeProperty("--checkout-benefits-height");
|
|
94
|
-
};
|
|
69
|
+
return observeReservedElementHeight(element, "--checkout-benefits-height", kiosk);
|
|
95
70
|
}, [kiosk]);
|
|
96
71
|
const close = () => {
|
|
97
72
|
setOpen(false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useOptionalBookingUI } from "../context.js";
|
|
2
|
-
import {
|
|
2
|
+
import { observeReservedElementHeight } from "./kiosk-viewport.js";
|
|
3
3
|
import React, { useLayoutEffect, useRef } from "react";
|
|
4
4
|
//#region src/plus/venueBookingDesign/shared/Layout.tsx
|
|
5
5
|
/** Fixed positioning, mobile breakpoint, keyboard/modal exclusion and safe area have one owner. */
|
|
@@ -8,39 +8,9 @@ function MobileActionBar({ lang, children, className = "" }) {
|
|
|
8
8
|
const kiosk = ((_useOptionalBookingUI = useOptionalBookingUI()) === null || _useOptionalBookingUI === void 0 ? void 0 : _useOptionalBookingUI.presentationPlatform) === "kiosk";
|
|
9
9
|
const ref = useRef(null);
|
|
10
10
|
useLayoutEffect(() => {
|
|
11
|
-
var _window$visualViewpor;
|
|
12
11
|
const bar = ref.current;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const measure = () => {
|
|
16
|
-
const height = kiosk ? kioskLogicalElementHeight(bar) : bar.getBoundingClientRect().height;
|
|
17
|
-
if (height > 0) scope === null || scope === void 0 || scope.style.setProperty("--mobile-action-bar-height", `${height}px`);
|
|
18
|
-
};
|
|
19
|
-
const schedule = () => {
|
|
20
|
-
cancelAnimationFrame(frame);
|
|
21
|
-
frame = requestAnimationFrame(measure);
|
|
22
|
-
};
|
|
23
|
-
const observer = new ResizeObserver(schedule);
|
|
24
|
-
observer.observe(bar);
|
|
25
|
-
const bodyObserver = kiosk ? new MutationObserver(schedule) : void 0;
|
|
26
|
-
bodyObserver === null || bodyObserver === void 0 || bodyObserver.observe(document.body, {
|
|
27
|
-
attributes: true,
|
|
28
|
-
attributeFilter: ["style", "class"]
|
|
29
|
-
});
|
|
30
|
-
window.addEventListener("resize", schedule);
|
|
31
|
-
if (kiosk) (_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.addEventListener("resize", schedule);
|
|
32
|
-
if (kiosk) document.body.addEventListener("transitionend", schedule);
|
|
33
|
-
measure();
|
|
34
|
-
return () => {
|
|
35
|
-
var _window$visualViewpor2;
|
|
36
|
-
cancelAnimationFrame(frame);
|
|
37
|
-
observer.disconnect();
|
|
38
|
-
bodyObserver === null || bodyObserver === void 0 || bodyObserver.disconnect();
|
|
39
|
-
window.removeEventListener("resize", schedule);
|
|
40
|
-
(_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.removeEventListener("resize", schedule);
|
|
41
|
-
document.body.removeEventListener("transitionend", schedule);
|
|
42
|
-
scope === null || scope === void 0 || scope.style.removeProperty("--mobile-action-bar-height");
|
|
43
|
-
};
|
|
12
|
+
if (!bar) return;
|
|
13
|
+
return observeReservedElementHeight(bar, "--mobile-action-bar-height", kiosk);
|
|
44
14
|
}, [kiosk]);
|
|
45
15
|
return /* @__PURE__ */ React.createElement("div", {
|
|
46
16
|
ref,
|
|
@@ -16,11 +16,64 @@ function getKioskBodyScaleY(preferTarget = true) {
|
|
|
16
16
|
function kioskLogicalElementHeight(element) {
|
|
17
17
|
return element.getBoundingClientRect().height / getKioskBodyScaleY(false);
|
|
18
18
|
}
|
|
19
|
+
/** Reserve layout space without re-reading transformed geometry on every animation. */
|
|
20
|
+
function observeReservedElementHeight(element, property, kiosk) {
|
|
21
|
+
var _window$visualViewpor;
|
|
22
|
+
const scope = element.closest(".booking-ui");
|
|
23
|
+
if (!scope) return () => {};
|
|
24
|
+
let frame = 0;
|
|
25
|
+
let lastHeight = 0;
|
|
26
|
+
let borderBoxHeight;
|
|
27
|
+
const measure = () => {
|
|
28
|
+
frame = 0;
|
|
29
|
+
const height = kiosk && borderBoxHeight !== void 0 ? borderBoxHeight : kiosk ? kioskLogicalElementHeight(element) : element.getBoundingClientRect().height;
|
|
30
|
+
const next = Math.round(height * 64) / 64;
|
|
31
|
+
if (next > 0 && next !== lastHeight) {
|
|
32
|
+
lastHeight = next;
|
|
33
|
+
scope.style.setProperty(property, `${next}px`);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const schedule = () => {
|
|
37
|
+
if (!frame) frame = requestAnimationFrame(measure);
|
|
38
|
+
};
|
|
39
|
+
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver((entries) => {
|
|
40
|
+
if (kiosk) {
|
|
41
|
+
const entry = entries.find((item) => item.target === element);
|
|
42
|
+
const box = entry === null || entry === void 0 ? void 0 : entry.borderBoxSize;
|
|
43
|
+
const size = Array.isArray(box) ? box[0] : box;
|
|
44
|
+
if (size && Number.isFinite(size.blockSize)) borderBoxHeight = size.blockSize;
|
|
45
|
+
}
|
|
46
|
+
schedule();
|
|
47
|
+
});
|
|
48
|
+
observer === null || observer === void 0 || observer.observe(element, { box: "border-box" });
|
|
49
|
+
const bodyObserver = kiosk ? new MutationObserver(schedule) : void 0;
|
|
50
|
+
bodyObserver === null || bodyObserver === void 0 || bodyObserver.observe(document.body, {
|
|
51
|
+
attributes: true,
|
|
52
|
+
attributeFilter: ["style", "class"]
|
|
53
|
+
});
|
|
54
|
+
const finishScaleTransition = (event) => {
|
|
55
|
+
if (event.target === document.body && event.propertyName === "transform") schedule();
|
|
56
|
+
};
|
|
57
|
+
window.addEventListener("resize", schedule);
|
|
58
|
+
if (kiosk) (_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.addEventListener("resize", schedule);
|
|
59
|
+
if (kiosk) document.body.addEventListener("transitionend", finishScaleTransition);
|
|
60
|
+
measure();
|
|
61
|
+
return () => {
|
|
62
|
+
var _window$visualViewpor2;
|
|
63
|
+
cancelAnimationFrame(frame);
|
|
64
|
+
observer === null || observer === void 0 || observer.disconnect();
|
|
65
|
+
bodyObserver === null || bodyObserver === void 0 || bodyObserver.disconnect();
|
|
66
|
+
window.removeEventListener("resize", schedule);
|
|
67
|
+
(_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.removeEventListener("resize", schedule);
|
|
68
|
+
document.body.removeEventListener("transitionend", finishScaleTransition);
|
|
69
|
+
scope.style.removeProperty(property);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
19
72
|
/** Read the host's logical viewport; never add a second page scale or keyboard deduction. */
|
|
20
73
|
function useKioskViewportHeight(root, enabled) {
|
|
21
74
|
const [height, setHeight] = useState();
|
|
22
75
|
useLayoutEffect(() => {
|
|
23
|
-
var _window$
|
|
76
|
+
var _window$visualViewpor4;
|
|
24
77
|
if (!enabled || !root) {
|
|
25
78
|
setHeight(void 0);
|
|
26
79
|
return;
|
|
@@ -28,9 +81,9 @@ function useKioskViewportHeight(root, enabled) {
|
|
|
28
81
|
let frame = 0;
|
|
29
82
|
const container = root.parentElement;
|
|
30
83
|
const measure = () => {
|
|
31
|
-
var _window$
|
|
84
|
+
var _window$visualViewpor3;
|
|
32
85
|
const scale = getKioskBodyScaleY();
|
|
33
|
-
const visibleHeight = ((_window$
|
|
86
|
+
const visibleHeight = ((_window$visualViewpor3 = window.visualViewport) === null || _window$visualViewpor3 === void 0 ? void 0 : _window$visualViewpor3.height) || window.innerHeight;
|
|
34
87
|
const logicalHeight = visibleHeight / scale;
|
|
35
88
|
const containerHeight = (container === null || container === void 0 ? void 0 : container.clientHeight) || window.innerHeight;
|
|
36
89
|
const next = Math.abs(scale - 1) < .001 ? `min(var(--app-content-height, ${containerHeight}px), ${visibleHeight}px)` : `${logicalHeight}px`;
|
|
@@ -51,20 +104,20 @@ function useKioskViewportHeight(root, enabled) {
|
|
|
51
104
|
const containerObserver = typeof ResizeObserver === "undefined" || !container ? void 0 : new ResizeObserver(schedule);
|
|
52
105
|
containerObserver === null || containerObserver === void 0 || containerObserver.observe(container);
|
|
53
106
|
window.addEventListener("resize", schedule);
|
|
54
|
-
(_window$
|
|
107
|
+
(_window$visualViewpor4 = window.visualViewport) === null || _window$visualViewpor4 === void 0 || _window$visualViewpor4.addEventListener("resize", schedule);
|
|
55
108
|
document.body.addEventListener("transitionend", finishScaleTransition);
|
|
56
109
|
measure();
|
|
57
110
|
return () => {
|
|
58
|
-
var _window$
|
|
111
|
+
var _window$visualViewpor5;
|
|
59
112
|
cancelAnimationFrame(frame);
|
|
60
113
|
bodyObserver.disconnect();
|
|
61
114
|
containerObserver === null || containerObserver === void 0 || containerObserver.disconnect();
|
|
62
115
|
window.removeEventListener("resize", schedule);
|
|
63
|
-
(_window$
|
|
116
|
+
(_window$visualViewpor5 = window.visualViewport) === null || _window$visualViewpor5 === void 0 || _window$visualViewpor5.removeEventListener("resize", schedule);
|
|
64
117
|
document.body.removeEventListener("transitionend", finishScaleTransition);
|
|
65
118
|
};
|
|
66
119
|
}, [enabled, root]);
|
|
67
120
|
return enabled ? height : void 0;
|
|
68
121
|
}
|
|
69
122
|
//#endregion
|
|
70
|
-
export {
|
|
123
|
+
export { observeReservedElementHeight, useKioskViewportHeight };
|
|
@@ -7,12 +7,12 @@ import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
|
7
7
|
import { locales } from "@pisell/utils";
|
|
8
8
|
import { Button, PisellEmpty, PisellModal, PisellStatisticList, Skeleton, Timeline, usePisellConfig } from "@pisell/materials";
|
|
9
9
|
import { useRequest } from "ahooks";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import utc from "dayjs/plugin/utc";
|
|
11
|
+
import timezone from "dayjs/plugin/timezone";
|
|
12
12
|
import "./index.less";
|
|
13
13
|
//#region src/plus/walletPassGallery/components/timelineSection/index.tsx
|
|
14
|
-
dayjs.extend(
|
|
15
|
-
dayjs.extend(
|
|
14
|
+
dayjs.extend(timezone);
|
|
15
|
+
dayjs.extend(utc);
|
|
16
16
|
const stateTimeUnix = 1723255863;
|
|
17
17
|
const POLL_INTERVAL = 2e3;
|
|
18
18
|
const POLL_MAX_TIMES = 5;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import { isMultiDayProduct } from "../../../components/booking/info2/service/addService/utils.js";
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
|
-
import
|
|
4
|
+
import utc from "dayjs/plugin/utc";
|
|
5
5
|
//#region src/pro/skuDetailModal/flow/calendarEntry.ts
|
|
6
|
-
dayjs.extend(
|
|
6
|
+
dayjs.extend(utc);
|
|
7
7
|
/** Calendar timestamps belong to the shop clock, rather than the browser clock. */
|
|
8
8
|
function calendarDateTime(value) {
|
|
9
9
|
const matched = value.match(/(Z|([+-])(\d{2}):(\d{2}))$/i);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_useLocale = require("../../hooks/useLocale.js");
|
|
2
3
|
const require_locales = require("./locales.js");
|
|
3
4
|
const require_CustomerLanguageSelect = require("./CustomerLanguageSelect.js");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
react = require_runtime.__toESM(react);
|
|
6
7
|
let antd = require("antd");
|
|
8
|
+
let _pisell_materials = require("@pisell/materials");
|
|
7
9
|
require("./customer.less");
|
|
8
10
|
//#region src/components/vendingMachine/CustomerScreens.tsx
|
|
9
11
|
function Icon({ name }) {
|
|
@@ -38,17 +40,19 @@ function ScanHint({ pill = false }) {
|
|
|
38
40
|
return /* @__PURE__ */ react.default.createElement("div", { className: `vm-customer-scan-hint${pill ? " vm-customer-scan-hint-pill" : ""}` }, /* @__PURE__ */ react.default.createElement(Icon, { name: "qr-code" }), /* @__PURE__ */ react.default.createElement("span", null, t("scanHint")), /* @__PURE__ */ react.default.createElement(Icon, { name: "arrow-down" }));
|
|
39
41
|
}
|
|
40
42
|
function TechnicalSupportBar({ active, onRequestSettings }) {
|
|
41
|
-
const
|
|
43
|
+
const locale = require_useLocale.default();
|
|
42
44
|
const taps = (0, react.useRef)([]);
|
|
43
45
|
(0, react.useEffect)(() => {
|
|
44
46
|
taps.current = [];
|
|
45
47
|
}, [active]);
|
|
46
|
-
return /* @__PURE__ */ react.default.createElement("
|
|
47
|
-
type: "button",
|
|
48
|
+
return /* @__PURE__ */ react.default.createElement("fieldset", {
|
|
48
49
|
className: "vm-customer-technical-support",
|
|
49
|
-
disabled: !active
|
|
50
|
+
disabled: !active
|
|
51
|
+
}, /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellBrand, {
|
|
52
|
+
locale,
|
|
50
53
|
onClick: (event) => {
|
|
51
54
|
event.stopPropagation();
|
|
55
|
+
if (!active) return;
|
|
52
56
|
const now = Date.now();
|
|
53
57
|
taps.current = [...taps.current.filter((at) => now - at < 3e3), now];
|
|
54
58
|
if (taps.current.length >= 5) {
|
|
@@ -56,7 +60,7 @@ function TechnicalSupportBar({ active, onRequestSettings }) {
|
|
|
56
60
|
onRequestSettings();
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
|
-
}
|
|
63
|
+
}));
|
|
60
64
|
}
|
|
61
65
|
function IdleScreen({ brand, subtitle, active, onStart, onRequestSettings }) {
|
|
62
66
|
const { text: t } = require_locales.useVendingLocale();
|