ublo-lib 1.35.18 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/es/common/components/date-picker/calendar.d.ts.map +1 -1
  2. package/es/common/components/date-picker/calendar.js +8 -12
  3. package/es/common/components/date-picker/calendar.module.css +8 -0
  4. package/es/common/components/date-picker/date-picker.module.css +0 -44
  5. package/es/common/components/scrolling-carousel/scrolling-carousel.module.css +4 -0
  6. package/es/lbm/components/instant-search/facet-switch.d.ts +8 -0
  7. package/es/lbm/components/instant-search/facet-switch.d.ts.map +1 -0
  8. package/es/lbm/components/instant-search/facet-switch.js +15 -0
  9. package/es/lbm/components/instant-search/facet-switch.module.css +19 -0
  10. package/es/lbm/components/instant-search/faqs.d.ts +12 -0
  11. package/es/lbm/components/instant-search/faqs.d.ts.map +1 -0
  12. package/es/lbm/components/instant-search/faqs.js +44 -0
  13. package/es/lbm/components/instant-search/faqs.module.css +102 -0
  14. package/es/lbm/components/instant-search/hooks/use-constant.d.ts +2 -0
  15. package/es/lbm/components/instant-search/hooks/use-constant.d.ts.map +1 -0
  16. package/es/lbm/components/instant-search/hooks/use-constant.js +8 -0
  17. package/es/lbm/components/instant-search/hooks/use-debounced-search.d.ts +11 -0
  18. package/es/lbm/components/instant-search/hooks/use-debounced-search.d.ts.map +1 -0
  19. package/es/lbm/components/instant-search/hooks/use-debounced-search.js +12 -0
  20. package/es/lbm/components/instant-search/hooks/use-search.d.ts +17 -0
  21. package/es/lbm/components/instant-search/hooks/use-search.d.ts.map +1 -0
  22. package/es/lbm/components/instant-search/hooks/use-search.js +10 -0
  23. package/es/lbm/components/instant-search/i18n.json +32 -0
  24. package/es/lbm/components/instant-search/index.d.ts +3 -0
  25. package/es/lbm/components/instant-search/index.d.ts.map +1 -0
  26. package/es/lbm/components/instant-search/index.js +2 -0
  27. package/es/lbm/components/instant-search/instant-search.d.ts +19 -0
  28. package/es/lbm/components/instant-search/instant-search.d.ts.map +1 -0
  29. package/es/lbm/components/instant-search/instant-search.js +64 -0
  30. package/es/lbm/components/instant-search/instant-search.module.css +8 -0
  31. package/es/lbm/components/instant-search/links.d.ts +12 -0
  32. package/es/lbm/components/instant-search/links.d.ts.map +1 -0
  33. package/es/lbm/components/instant-search/links.js +30 -0
  34. package/es/lbm/components/instant-search/links.module.css +96 -0
  35. package/es/lbm/components/instant-search/no-product.d.ts +6 -0
  36. package/es/lbm/components/instant-search/no-product.d.ts.map +1 -0
  37. package/es/lbm/components/instant-search/no-product.js +4 -0
  38. package/es/lbm/components/instant-search/products.d.ts +14 -0
  39. package/es/lbm/components/instant-search/products.d.ts.map +1 -0
  40. package/es/lbm/components/instant-search/products.js +47 -0
  41. package/es/lbm/components/instant-search/products.module.css +163 -0
  42. package/es/lbm/components/instant-search/results.d.ts +79 -0
  43. package/es/lbm/components/instant-search/results.d.ts.map +1 -0
  44. package/es/lbm/components/instant-search/results.js +34 -0
  45. package/es/lbm/components/instant-search/results.module.css +85 -0
  46. package/es/lbm/components/instant-search/search-input.d.ts +15 -0
  47. package/es/lbm/components/instant-search/search-input.d.ts.map +1 -0
  48. package/es/lbm/components/instant-search/search-input.js +56 -0
  49. package/es/lbm/components/instant-search/search-input.module.css +88 -0
  50. package/es/lbm/components/instant-search/services/api.d.ts +2 -0
  51. package/es/lbm/components/instant-search/services/api.d.ts.map +1 -0
  52. package/es/lbm/components/instant-search/services/api.js +22 -0
  53. package/es/lbm/components/instant-search/services/lumiplan-api.d.ts +9 -0
  54. package/es/lbm/components/instant-search/services/lumiplan-api.d.ts.map +1 -0
  55. package/es/lbm/components/instant-search/services/lumiplan-api.js +37 -0
  56. package/es/lbm/components/instant-search/services/messages.d.ts +2 -0
  57. package/es/lbm/components/instant-search/services/messages.d.ts.map +1 -0
  58. package/es/lbm/components/instant-search/services/messages.js +5 -0
  59. package/es/lbm/components/instant-search/services/utils.d.ts +4 -0
  60. package/es/lbm/components/instant-search/services/utils.d.ts.map +1 -0
  61. package/es/lbm/components/instant-search/services/utils.js +28 -0
  62. package/es/lbm/components/instant-search/widgets/access.d.ts +8 -0
  63. package/es/lbm/components/instant-search/widgets/access.d.ts.map +1 -0
  64. package/es/lbm/components/instant-search/widgets/access.js +29 -0
  65. package/es/lbm/components/instant-search/widgets/activity.d.ts +8 -0
  66. package/es/lbm/components/instant-search/widgets/activity.d.ts.map +1 -0
  67. package/es/lbm/components/instant-search/widgets/activity.js +74 -0
  68. package/es/lbm/components/instant-search/widgets/activity.module.css +6 -0
  69. package/es/lbm/components/instant-search/widgets/components/card.d.ts +11 -0
  70. package/es/lbm/components/instant-search/widgets/components/card.d.ts.map +1 -0
  71. package/es/lbm/components/instant-search/widgets/components/card.js +15 -0
  72. package/es/lbm/components/instant-search/widgets/components/card.module.css +60 -0
  73. package/es/lbm/components/instant-search/widgets/components/metric.d.ts +8 -0
  74. package/es/lbm/components/instant-search/widgets/components/metric.d.ts.map +1 -0
  75. package/es/lbm/components/instant-search/widgets/components/metric.js +6 -0
  76. package/es/lbm/components/instant-search/widgets/components/metric.module.css +12 -0
  77. package/es/lbm/components/instant-search/widgets/components/status-with-icon.d.ts +9 -0
  78. package/es/lbm/components/instant-search/widgets/components/status-with-icon.d.ts.map +1 -0
  79. package/es/lbm/components/instant-search/widgets/components/status-with-icon.js +5 -0
  80. package/es/lbm/components/instant-search/widgets/components/status-with-icon.module.css +12 -0
  81. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.d.ts +9 -0
  82. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.d.ts.map +1 -0
  83. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.js +37 -0
  84. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.module.css +33 -0
  85. package/es/lbm/components/instant-search/widgets/lift.d.ts +8 -0
  86. package/es/lbm/components/instant-search/widgets/lift.d.ts.map +1 -0
  87. package/es/lbm/components/instant-search/widgets/lift.js +52 -0
  88. package/es/lbm/components/instant-search/widgets/lift.module.css +6 -0
  89. package/es/lbm/components/instant-search/widgets/lifts.d.ts +8 -0
  90. package/es/lbm/components/instant-search/widgets/lifts.d.ts.map +1 -0
  91. package/es/lbm/components/instant-search/widgets/lifts.js +26 -0
  92. package/es/lbm/components/instant-search/widgets/msem-widget.d.ts +8 -0
  93. package/es/lbm/components/instant-search/widgets/msem-widget.d.ts.map +1 -0
  94. package/es/lbm/components/instant-search/widgets/msem-widget.js +31 -0
  95. package/es/lbm/components/instant-search/widgets/msem-widget.module.css +51 -0
  96. package/es/lbm/components/instant-search/widgets/openings.d.ts +8 -0
  97. package/es/lbm/components/instant-search/widgets/openings.d.ts.map +1 -0
  98. package/es/lbm/components/instant-search/widgets/openings.js +32 -0
  99. package/es/lbm/components/instant-search/widgets/slope.d.ts +8 -0
  100. package/es/lbm/components/instant-search/widgets/slope.d.ts.map +1 -0
  101. package/es/lbm/components/instant-search/widgets/slope.js +73 -0
  102. package/es/lbm/components/instant-search/widgets/slope.module.css +26 -0
  103. package/es/lbm/components/instant-search/widgets/slopes.d.ts +8 -0
  104. package/es/lbm/components/instant-search/widgets/slopes.d.ts.map +1 -0
  105. package/es/lbm/components/instant-search/widgets/slopes.js +26 -0
  106. package/es/lbm/components/instant-search/widgets/snow.d.ts +9 -0
  107. package/es/lbm/components/instant-search/widgets/snow.d.ts.map +1 -0
  108. package/es/lbm/components/instant-search/widgets/snow.js +25 -0
  109. package/es/lbm/components/instant-search/widgets/types.d.ts +27 -0
  110. package/es/lbm/components/instant-search/widgets/types.d.ts.map +1 -0
  111. package/es/lbm/components/instant-search/widgets/types.js +1 -0
  112. package/es/lbm/components/instant-search/widgets/weather.d.ts +9 -0
  113. package/es/lbm/components/instant-search/widgets/weather.d.ts.map +1 -0
  114. package/es/lbm/components/instant-search/widgets/weather.js +36 -0
  115. package/es/lbm/components/instant-search/widgets/weather.module.css +32 -0
  116. package/es/lbm/components/instant-search/widgets/webcam.d.ts +8 -0
  117. package/es/lbm/components/instant-search/widgets/webcam.d.ts.map +1 -0
  118. package/es/lbm/components/instant-search/widgets/webcam.js +9 -0
  119. package/es/lbm/components/instant-search/widgets/webcam.module.css +13 -0
  120. package/es/lbm/components/instant-search/widgets.d.ts +11 -0
  121. package/es/lbm/components/instant-search/widgets.d.ts.map +1 -0
  122. package/es/lbm/components/instant-search/widgets.js +68 -0
  123. package/es/lbm/components/instant-search/widgets.module.css +14 -0
  124. package/package.json +3 -3
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LiftsIcons from "../../lumiplan/icons/lifts";
4
+ import * as LumiplanApi from "../services/lumiplan-api";
5
+ import Card from "./components/card";
6
+ import StatusWithIcon from "./components/status-with-icon";
7
+ import Loader from "dt-design-system/es/loader";
8
+ import css from "./lift.module.css";
9
+ const LIFT_ICONS = {
10
+ TRAIN: LiftsIcons.Teleski,
11
+ FUNICULAR: LiftsIcons.Teleski,
12
+ TRAM: LiftsIcons.Teleski,
13
+ CABRIOLET_GONDOLA: LiftsIcons.Telecabine,
14
+ GONDOLA: LiftsIcons.Telecabine,
15
+ COMBINED_CHAIR_GONDOLA_LIFT: LiftsIcons.Telecabine,
16
+ DETACHABLE_BUBBLE_CHAIRLIFT: LiftsIcons.Telecabine,
17
+ DETACHABLE_CHAIRLIFT: LiftsIcons.TelesiegeDebrayable,
18
+ CHAIRLIFT: LiftsIcons.Telesiege,
19
+ SURFACE_LIFT: LiftsIcons.Teleski,
20
+ MAGIC_CARPET: LiftsIcons.TapisRoulant,
21
+ ROPE_TOW: LiftsIcons.Teleski,
22
+ DEFAULT: LiftsIcons.Teleski,
23
+ };
24
+ const Lift = ({ doc, ...props }) => {
25
+ const [pois, setPois] = React.useState([]);
26
+ const [loading, setLoading] = React.useState(true);
27
+ React.useEffect(() => {
28
+ const runEffect = async () => {
29
+ setLoading(true);
30
+ const data = await LumiplanApi.fetchPois();
31
+ setPois(data);
32
+ setLoading(false);
33
+ };
34
+ runEffect();
35
+ }, []);
36
+ if (loading) {
37
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
38
+ }
39
+ const lift = pois
40
+ .flatMap((poi) => poi.lifts)
41
+ .filter((lift) => lift !== undefined)
42
+ .find((poi) => poi.name === doc.document.title);
43
+ if (!lift) {
44
+ return null;
45
+ }
46
+ const Icon = LIFT_ICONS[lift.liftType] || LIFT_ICONS.DEFAULT;
47
+ const open = lift.openingStatus && lift.openingStatus === "OPEN";
48
+ const label = open ? "Ouverte" : "Fermée";
49
+ return (_jsx(Card, { doc: doc, ...props, children: _jsxs(StatusWithIcon, { icon: Icon, children: [_jsx("b", { className: open ? css.green : css.red, children: label }), lift.openingTimesReal &&
50
+ lift.openingTimesReal.map((time, i) => (_jsxs("div", { children: [time.beginTime, " - ", time.endTime] }, i)))] }) }));
51
+ };
52
+ export default Lift;
@@ -0,0 +1,6 @@
1
+ .green {
2
+ color: hsl(var(--green));
3
+ }
4
+ .red {
5
+ color: hsl(var(--red));
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Lifts: ({ doc, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Lifts;
8
+ //# sourceMappingURL=lifts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifts.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/lifts.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAItC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,KAAK,sBAAuB,KAAK,4CAkCtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import Card from "./components/card";
5
+ import Metric from "./components/metric";
6
+ import Loader from "dt-design-system/es/loader";
7
+ const Lifts = ({ doc, ...props }) => {
8
+ const [nOpen, setNOpen] = React.useState(0);
9
+ const [nTotal, setNTotal] = React.useState(0);
10
+ const [loading, setLoading] = React.useState(true);
11
+ React.useEffect(() => {
12
+ const runEffect = async () => {
13
+ setLoading(true);
14
+ const data = await LumiplanApi.fetchLifts();
15
+ setNOpen(data.count.open);
16
+ setNTotal(data.count.total);
17
+ setLoading(false);
18
+ };
19
+ runEffect();
20
+ }, []);
21
+ if (loading) {
22
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
23
+ }
24
+ return (_jsx(Card, { doc: doc, ...props, children: _jsxs(Metric, { children: [_jsx("b", { children: nOpen }), nTotal !== 0 && (_jsxs(_Fragment, { children: ["/", _jsx("b", { children: nTotal })] }))] }) }));
25
+ };
26
+ export default Lifts;
@@ -0,0 +1,8 @@
1
+ import { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ export default function MsemWidget({ doc }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=msem-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"msem-widget.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/msem-widget.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAwDjC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,GAAG,EAAE,EAAE,KAAK,2CA4BhD"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Button from "dt-design-system/es/button";
3
+ import * as Utils from "../services/utils";
4
+ import getConfig from "next/config";
5
+ import * as MseM from "../../../../future/components/msem";
6
+ import css from "./msem-widget.module.css";
7
+ const { publicRuntimeConfig } = getConfig();
8
+ const { channel, resort } = publicRuntimeConfig;
9
+ const WIDGET_ICONS = {
10
+ DEFAULT: "cart-circle",
11
+ };
12
+ const startWidget = (widget, merchantCode, merchantSlug) => {
13
+ const options = {
14
+ resort,
15
+ channel,
16
+ verticalMargin: 100,
17
+ merchant: merchantCode,
18
+ theme: "/msem-theme.css",
19
+ };
20
+ const presets = {
21
+ merchantSlug,
22
+ };
23
+ MseM.loadWidget(widget, options, presets);
24
+ };
25
+ export default function MsemWidget({ doc }) {
26
+ const { document: { title: _title, target: widget, path: merchantCodeAndSlug }, highlight, } = doc;
27
+ const [merchantCode, merchantSlug] = merchantCodeAndSlug.split("|");
28
+ const icon = WIDGET_ICONS[widget] || WIDGET_ICONS.DEFAULT;
29
+ const title = Utils.getHighlight("title", highlight) || _title;
30
+ return (_jsx(Button, { tag: "a", className: css.card, onClick: () => startWidget(widget, merchantCode, merchantSlug), noRipple: true, variant: "transparent", children: _jsxs("div", { className: css.iconAndName, children: [_jsx("svg", { width: 36, height: 36, viewBox: "0 0 24 24", children: _jsx("use", { xlinkHref: `/static/images/sprites/icons.svg#icon-${icon}` }) }), _jsx("div", { dangerouslySetInnerHTML: { __html: title }, className: css.title })] }) }));
31
+ }
@@ -0,0 +1,51 @@
1
+ .card {
2
+ width: 100%;
3
+ display: flex;
4
+ position: relative;
5
+ height: 75px;
6
+ flex-direction: column;
7
+ gap: 4px;
8
+ justify-content: space-between;
9
+ align-items: center;
10
+ overflow: hidden;
11
+ color: var(--ds-grey-500, #484848);
12
+ background-color: var(--ds-grey-000, #fff);
13
+ border-radius: var(--ds-input-radius, var(--ds-radius-200, 8px));
14
+ border: var(--ds-input-border, 1px solid var(--ds-grey-300, #d7d7d7));
15
+ font-size: 13px;
16
+ }
17
+
18
+ .card mark {
19
+ position: relative;
20
+ display: inline-block;
21
+ font-weight: 700;
22
+ color: var(--ds-secondary, var(--ds-blue-400, #4177f6));
23
+ background-color: transparent;
24
+ }
25
+
26
+ .card mark::before {
27
+ content: "";
28
+ position: absolute;
29
+ top: 0;
30
+ left: 0;
31
+ width: 100%;
32
+ height: 100%;
33
+ background-color: var(--ds-secondary, var(--ds-blue-400, #4177f6));
34
+ border-radius: calc(var(--ds-radius-100, 6px) / 3);
35
+ opacity: 0.15;
36
+ }
37
+
38
+ .iconAndName {
39
+ flex-grow: 1;
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 8px;
43
+ width: 100%;
44
+ }
45
+
46
+ .title {
47
+ font-weight: 700;
48
+ font-size: 13px;
49
+ line-height: 1;
50
+ padding-top: 4px;
51
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Openings: ({ ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Openings;
8
+ //# sourceMappingURL=openings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openings.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/openings.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAWtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,QAAQ,iBAAkB,KAAK,4CAoCpC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import Card from "./components/card";
5
+ import Metric from "./components/metric";
6
+ import Loader from "dt-design-system/es/loader";
7
+ const dateOptions = {
8
+ day: "numeric",
9
+ month: "short",
10
+ year: "numeric",
11
+ };
12
+ const Openings = ({ ...props }) => {
13
+ const [openings, setOpenings] = React.useState([]);
14
+ const [loading, setLoading] = React.useState(true);
15
+ React.useEffect(() => {
16
+ const runEffect = async () => {
17
+ setLoading(true);
18
+ const { availability: { openingDate, closingDate }, } = await LumiplanApi.fetchResortOpening();
19
+ setOpenings([
20
+ new Date(openingDate).toLocaleDateString("fr", dateOptions),
21
+ new Date(closingDate).toLocaleDateString("fr", dateOptions),
22
+ ]);
23
+ setLoading(false);
24
+ };
25
+ runEffect();
26
+ }, []);
27
+ if (loading) {
28
+ return (_jsx(Card, { ...props, children: _jsx(Loader, { variant: "overlay" }) }));
29
+ }
30
+ return (_jsx(Card, { ...props, children: _jsx(Metric, { long: true, children: openings.map((part, i) => (_jsxs("div", { children: [i === 0 ? "Ouverture" : "Fermeture", " : ", _jsx("b", { children: part })] }, i))) }) }));
31
+ };
32
+ export default Openings;
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Slope: ({ doc, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Slope;
8
+ //# sourceMappingURL=slope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slope.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/slope.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AA+CtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,KAAK,sBAAuB,KAAK,4CAqCtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as TrailIcons from "../../lumiplan/icons/trails";
4
+ import * as LumiplanApi from "../services/lumiplan-api";
5
+ import Card from "./components/card";
6
+ import StatusWithIcon from "./components/status-with-icon";
7
+ import Loader from "dt-design-system/es/loader";
8
+ import css from "./slope.module.css";
9
+ const TRAIL_ICONS = {
10
+ BIKE_PARK: TrailIcons.VTT,
11
+ BOARDERCROSS: TrailIcons.BoarderCross,
12
+ BUMP_TRAIL: TrailIcons.ChampDeBosse,
13
+ COASTER: TrailIcons.LugeSurRail,
14
+ CROSS_COUNTRY_MOUNTAIN_BIKING: TrailIcons.BoarderCross,
15
+ CROSS_COUNTRY_SKIING: TrailIcons.SkiAlpin,
16
+ DOWNHILL_MOUNTAIN_BIKING: TrailIcons.VTT,
17
+ DOWNHILL_SKIING: TrailIcons.SkiAlpin,
18
+ EBIKE: TrailIcons.VTT,
19
+ ENDURO: TrailIcons.VTT,
20
+ FREERIDE_AREA_OFF_PIST: TrailIcons.SkiAlpin,
21
+ FREERIDE_SKI_ITINERARY: TrailIcons.SkiAlpin,
22
+ FUN_ZONE: TrailIcons.Freeride,
23
+ GATE: TrailIcons.Freeride,
24
+ GLADES: TrailIcons.Freeride,
25
+ ILLUMINATED_TRAIL: TrailIcons.PisteEclairee,
26
+ MULTI_USE_TRAIL: TrailIcons.Freeride,
27
+ MTB_ENDURO: TrailIcons.VTT,
28
+ PATH: TrailIcons.Pieton,
29
+ PEDESTRIAN: TrailIcons.Pieton,
30
+ ROUTE_OF_CROSS_COUNTRY: TrailIcons.SkiAlpin,
31
+ SKI_TOURING: TrailIcons.Freeride,
32
+ SLEDDING_HILL: TrailIcons.Luge,
33
+ SNOWPARK: TrailIcons.Snowpark,
34
+ SNOWPARK_LINE: TrailIcons.Snowpark,
35
+ SNOWSHOE: TrailIcons.Raquette,
36
+ SNOWTUBING: TrailIcons.Snowtubing,
37
+ TERRAIN_PARK: TrailIcons.Snowpark,
38
+ TERRAIN_PARK_US: TrailIcons.Snowpark,
39
+ TRAIL_RUNNING: TrailIcons.Pieton,
40
+ TREETOP_ADVENTURE_PARK: TrailIcons.Accrobranche,
41
+ TYROLEAN: TrailIcons.Tyrolienne,
42
+ VIDEO_ZONE: TrailIcons.Freeride,
43
+ UNDEF: TrailIcons.Freeride,
44
+ DEFAULT: TrailIcons.Freeride,
45
+ };
46
+ const Slope = ({ doc, ...props }) => {
47
+ const [pois, setPois] = React.useState([]);
48
+ const [loading, setLoading] = React.useState(true);
49
+ React.useEffect(() => {
50
+ const runEffect = async () => {
51
+ setLoading(true);
52
+ const data = await LumiplanApi.fetchPois();
53
+ setPois(data);
54
+ setLoading(false);
55
+ };
56
+ runEffect();
57
+ }, []);
58
+ if (loading) {
59
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
60
+ }
61
+ const slope = pois
62
+ .flatMap((poi) => poi.trails)
63
+ .filter((slope) => slope !== undefined)
64
+ .find((poi) => poi.name === doc.document.title);
65
+ if (!slope) {
66
+ return null;
67
+ }
68
+ const Icon = TRAIL_ICONS[slope.trailType] || TRAIL_ICONS.DEFAULT;
69
+ const open = slope.openingStatus === "OPEN";
70
+ const label = open ? "Piste Ouverte" : "Piste Fermée";
71
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(StatusWithIcon, { icon: Icon, iconClassName: css[slope.trailLevel], children: _jsx("b", { className: open ? css.green : css.red, children: label }) }) }));
72
+ };
73
+ export default Slope;
@@ -0,0 +1,26 @@
1
+ .GREEN {
2
+ fill: #00a52c;
3
+ line-height: 0;
4
+ }
5
+ .BLUE {
6
+ fill: #0062ae;
7
+ line-height: 0;
8
+ }
9
+ .RED {
10
+ fill: #f4000f;
11
+ line-height: 0;
12
+ }
13
+ .BLACK {
14
+ fill: #000;
15
+ line-height: 0;
16
+ }
17
+ .YELLOW {
18
+ fill: #f9d71c;
19
+ line-height: 0;
20
+ }
21
+ .green {
22
+ color: hsl(var(--green));
23
+ }
24
+ .red {
25
+ color: hsl(var(--red));
26
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Slopes: ({ ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Slopes;
8
+ //# sourceMappingURL=slopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slopes.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/slopes.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAKtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,MAAM,iBAAkB,KAAK,4CAkClC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import Card from "./components/card";
5
+ import Metric from "./components/metric";
6
+ import Loader from "dt-design-system/es/loader";
7
+ const Slopes = ({ ...props }) => {
8
+ const [nOpen, setNOpen] = React.useState(0);
9
+ const [nTotal, setNTotal] = React.useState(0);
10
+ const [loading, setLoading] = React.useState(true);
11
+ React.useEffect(() => {
12
+ const runEffect = async () => {
13
+ setLoading(true);
14
+ const data = await LumiplanApi.fetchSlopes();
15
+ setNOpen(data.count.open);
16
+ setNTotal(data.count.total);
17
+ setLoading(false);
18
+ };
19
+ runEffect();
20
+ }, []);
21
+ if (loading) {
22
+ return (_jsx(Card, { ...props, children: _jsx(Loader, { variant: "overlay" }) }));
23
+ }
24
+ return (_jsx(Card, { ...props, children: _jsxs(Metric, { children: [_jsx("b", { children: nOpen }), nTotal !== 0 && (_jsxs(_Fragment, { children: ["/", _jsx("b", { children: nTotal })] }))] }) }));
25
+ };
26
+ export default Slopes;
@@ -0,0 +1,9 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ summit?: boolean;
5
+ sendPlausibleGoal: (path: string) => void;
6
+ };
7
+ declare const Snow: ({ doc, summit, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default Snow;
9
+ //# sourceMappingURL=snow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snow.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/snow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAKtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,IAAI,8BAA+B,KAAK,4CA8B7C,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import Card from "./components/card";
5
+ import Metric from "./components/metric";
6
+ import Loader from "dt-design-system/es/loader";
7
+ const Snow = ({ doc, summit, ...props }) => {
8
+ const [snow, setSnow] = React.useState(null);
9
+ React.useEffect(() => {
10
+ const runEffect = async () => {
11
+ const { snowZones } = await LumiplanApi.fetchSnow();
12
+ const zoneSnow = snowZones.find((zone) => zone.name === (summit ? "Sommet" : "Station"));
13
+ if (!zoneSnow) {
14
+ return;
15
+ }
16
+ setSnow(zoneSnow.snowTotalDepth);
17
+ };
18
+ runEffect();
19
+ }, [summit]);
20
+ if (!snow) {
21
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
22
+ }
23
+ return (_jsx(Card, { doc: doc, ...props, children: _jsxs(Metric, { children: [snow.value, " ", snow.unit === "CENTIMETER" ? "cm" : snow.unit] }) }));
24
+ };
25
+ export default Snow;
@@ -0,0 +1,27 @@
1
+ export type POI = {
2
+ trails?: {
3
+ name: string;
4
+ trailType: string;
5
+ trailLevel: string;
6
+ openingStatus: string;
7
+ }[];
8
+ lifts?: {
9
+ name: string;
10
+ liftType: string;
11
+ openingStatus: string;
12
+ openingTimesReal: {
13
+ beginTime: string;
14
+ endTime: string;
15
+ }[];
16
+ }[];
17
+ activities?: {
18
+ name: string;
19
+ activityType: string;
20
+ openingStatus: string;
21
+ openingTimesReal: {
22
+ beginTime: string;
23
+ endTime: string;
24
+ }[];
25
+ }[];
26
+ };
27
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,GAAG;IAChB,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC5D,EAAE,CAAC;IACJ,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC5D,EAAE,CAAC;CACL,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ summit?: boolean;
5
+ sendPlausibleGoal: (path: string) => void;
6
+ };
7
+ declare const Weather: ({ doc, summit, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default Weather;
9
+ //# sourceMappingURL=weather.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/weather.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAQtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,OAAO,8BAA+B,KAAK,4CA6DhD,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import WeatherIcon from "../../lumiplan/weather/weather-icon";
5
+ import Card from "./components/card";
6
+ import css from "./weather.module.css";
7
+ import Loader from "dt-design-system/es/loader";
8
+ const switchHour = 17;
9
+ const Weather = ({ doc, summit, ...props }) => {
10
+ const [weather, setWeather] = React.useState(null);
11
+ const useTomorrow = new Date().getHours() > switchHour;
12
+ React.useEffect(() => {
13
+ const todayOrTomorrow = new Date();
14
+ if (todayOrTomorrow.getHours() > switchHour) {
15
+ todayOrTomorrow.setDate(todayOrTomorrow.getDate() + 1);
16
+ }
17
+ const runEffect = async () => {
18
+ const { weatherZones } = await LumiplanApi.fetchWeather();
19
+ const zoneWeather = weatherZones.find((zone) => zone.name === (summit ? "Sommet" : "Station"));
20
+ if (!zoneWeather) {
21
+ return;
22
+ }
23
+ setWeather(zoneWeather.weatherInfos.find((info) => info.date === todayOrTomorrow.toISOString().slice(0, 10)));
24
+ };
25
+ runEffect();
26
+ }, [summit]);
27
+ if (!weather) {
28
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
29
+ }
30
+ return (_jsx(Card, { doc: doc, ...props, children: _jsxs("div", { className: css.ampm, children: [weather.am &&
31
+ weather.am.temperature &&
32
+ weather.am.temperature.value && (_jsxs("div", { className: css.column, children: [_jsxs("div", { children: [useTomorrow ? "Demain" : "Ce", " matin"] }), _jsxs("div", { className: css.statusTemp, children: [_jsx(WeatherIcon, { sky: weather.am.skyStatus }), weather.am.temperature.value, "\u00B0C"] })] })), weather.pm &&
33
+ weather.pm.temperature &&
34
+ weather.pm.temperature.value && (_jsxs("div", { className: css.column, children: [_jsxs("div", { children: [useTomorrow ? "Demain" : "Cet", " apr\u00E8s-midi"] }), _jsxs("div", { className: css.statusTemp, children: [_jsx(WeatherIcon, { sky: weather.pm.skyStatus }), weather.pm.temperature.value, "\u00B0C"] })] }))] }) }));
35
+ };
36
+ export default Weather;
@@ -0,0 +1,32 @@
1
+ .ampm {
2
+ display: flex;
3
+ flex-direction: row;
4
+ gap: 1rem;
5
+ justify-content: center;
6
+ align-items: center;
7
+ flex-grow: 1;
8
+ }
9
+ .ampm > :first-child {
10
+ padding-right: 1rem;
11
+ border-right: solid 1px #ccc;
12
+ }
13
+ .column {
14
+ display: flex;
15
+ flex-direction: column;
16
+ justify-content: center;
17
+ align-items: center;
18
+ font-size: var(--label);
19
+ }
20
+
21
+ .statusTemp {
22
+ display: flex;
23
+ flex-direction: row;
24
+ gap: 8px;
25
+ justify-content: center;
26
+ align-items: center;
27
+ font-weight: 700;
28
+ }
29
+ .statusTemp > svg {
30
+ width: 32px;
31
+ height: 32px;
32
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Webcam: ({ doc, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Webcam;
8
+ //# sourceMappingURL=webcam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webcam.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/webcam.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,MAAM,sBAAuB,KAAK,4CAUvC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as Icons from "dt-design-system/es/icons";
3
+ import Card from "./components/card";
4
+ import css from "./webcam.module.css";
5
+ const Webcam = ({ doc, ...props }) => {
6
+ const { document: { image, text }, } = doc;
7
+ return (_jsxs(Card, { doc: doc, ...props, overlayTitle: true, children: [_jsx(Icons.PlayCircle, { className: css.icon }), _jsx("img", { src: image, alt: text, className: css.webcam })] }));
8
+ };
9
+ export default Webcam;
@@ -0,0 +1,13 @@
1
+ .webcam {
2
+ object-fit: cover;
3
+ flex-grow: 1;
4
+ }
5
+
6
+ .icon {
7
+ position: absolute;
8
+ top: 12px;
9
+ width: 30px;
10
+ height: 30px;
11
+ fill: var(--ds-grey-000, #fff);
12
+ filter: var(--ds-shadow-100, 0px 3px 6px rgba(0, 0, 0, 0.12));
13
+ }
@@ -0,0 +1,11 @@
1
+ import type { Hit } from "./results";
2
+ type Props = {
3
+ lang: string;
4
+ widgets: Hit[];
5
+ loading: boolean;
6
+ sendPlausibleGoal: (path: string) => void;
7
+ faqsMaximized: boolean;
8
+ };
9
+ export default function Widgets({ widgets, loading, faqsMaximized, ...props }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=widgets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/instant-search/widgets.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAkBrC,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IAEjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAIF,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,aAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,2CA8DP"}