@davi-ai/retorik-framework 3.2.0 → 3.2.2

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 (51) hide show
  1. package/dist/AttachmentDetail.1e06c2a5.js +1757 -0
  2. package/dist/AttachmentDetail.1e06c2a5.js.map +1 -0
  3. package/dist/AttachmentDetail.c6c297df.js +1732 -0
  4. package/dist/AttachmentDetail.c6c297df.js.map +1 -0
  5. package/dist/CustomView.080c8028.js +143 -0
  6. package/dist/CustomView.080c8028.js.map +1 -0
  7. package/dist/CustomView.90d2a13d.js +134 -0
  8. package/dist/CustomView.90d2a13d.js.map +1 -0
  9. package/dist/Emergency.423214ad.js +301 -0
  10. package/dist/Emergency.423214ad.js.map +1 -0
  11. package/dist/Emergency.a21f837c.js +292 -0
  12. package/dist/Emergency.a21f837c.js.map +1 -0
  13. package/dist/FullScreenImage.1fe27198.js +70 -0
  14. package/dist/FullScreenImage.1fe27198.js.map +1 -0
  15. package/dist/FullScreenImage.9a9b978e.js +83 -0
  16. package/dist/FullScreenImage.9a9b978e.js.map +1 -0
  17. package/dist/HistoryList.50ff0fd9.js +242 -0
  18. package/dist/HistoryList.50ff0fd9.js.map +1 -0
  19. package/dist/HistoryList.5fd6aa12.js +228 -0
  20. package/dist/HistoryList.5fd6aa12.js.map +1 -0
  21. package/dist/LanguageChoice.1579b654.js +125 -0
  22. package/dist/LanguageChoice.1579b654.js.map +1 -0
  23. package/dist/LanguageChoice.61e36c1d.js +116 -0
  24. package/dist/LanguageChoice.61e36c1d.js.map +1 -0
  25. package/dist/LittleWeatherContainer.07937cf3.js +57 -0
  26. package/dist/LittleWeatherContainer.07937cf3.js.map +1 -0
  27. package/dist/LittleWeatherContainer.d27a6b8a.js +44 -0
  28. package/dist/LittleWeatherContainer.d27a6b8a.js.map +1 -0
  29. package/dist/NewsContainer.67f04b19.js +730 -0
  30. package/dist/NewsContainer.67f04b19.js.map +1 -0
  31. package/dist/NewsContainer.932174e9.js +755 -0
  32. package/dist/NewsContainer.932174e9.js.map +1 -0
  33. package/dist/SpiritEngineWrapper.1d8db53d.js +82 -0
  34. package/dist/SpiritEngineWrapper.1d8db53d.js.map +1 -0
  35. package/dist/SpiritEngineWrapper.27e9c120.js +96 -0
  36. package/dist/SpiritEngineWrapper.27e9c120.js.map +1 -0
  37. package/dist/ThreeJsWrapper.09c689b8.js +141 -0
  38. package/dist/ThreeJsWrapper.09c689b8.js.map +1 -0
  39. package/dist/ThreeJsWrapper.7918143f.js +128 -0
  40. package/dist/ThreeJsWrapper.7918143f.js.map +1 -0
  41. package/dist/Weather.661c2cac.js +282 -0
  42. package/dist/Weather.661c2cac.js.map +1 -0
  43. package/dist/Weather.fb22fba3.js +268 -0
  44. package/dist/Weather.fb22fba3.js.map +1 -0
  45. package/dist/index.d.ts +69 -50
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +23055 -23224
  48. package/dist/index.js.map +1 -1
  49. package/dist/index.modern.js +22278 -22376
  50. package/dist/index.modern.js.map +1 -1
  51. package/package.json +4 -36
@@ -0,0 +1,1732 @@
1
+ import {jsx as $dAxr5$jsx, jsxs as $dAxr5$jsxs} from "react/jsx-runtime";
2
+ import $dAxr5$react, {useState as $dAxr5$useState, useRef as $dAxr5$useRef, useEffect as $dAxr5$useEffect, useLayoutEffect as $dAxr5$useLayoutEffect, useMemo as $dAxr5$useMemo} from "react";
3
+ import {useSpring as $dAxr5$useSpring, easings as $dAxr5$easings, animated as $dAxr5$animated} from "@react-spring/web";
4
+ import $dAxr5$qrcode from "qrcode";
5
+ import {MapContainer as $dAxr5$MapContainer, TileLayer as $dAxr5$TileLayer, Marker as $dAxr5$Marker, GeoJSON as $dAxr5$GeoJSON, useMap as $dAxr5$useMap} from "react-leaflet";
6
+ import $dAxr5$leaflet from "leaflet";
7
+
8
+
9
+ function $parcel$defineInteropFlag(a) {
10
+ Object.defineProperty(a, '__esModule', {value: true, configurable: true});
11
+ }
12
+
13
+ function $parcel$export(e, n, v, s) {
14
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
+ }
16
+
17
+ var $parcel$global = globalThis;
18
+ var parcelRequire = $parcel$global["parcelRequirea39d"];
19
+ var parcelRegister = parcelRequire.register;
20
+ parcelRegister("8QAGm", function(module, exports) {
21
+
22
+ $parcel$defineInteropFlag(module.exports);
23
+
24
+ $parcel$export(module.exports, "default", () => $cccd6edc9ecbde88$export$2e2bcd8739ae039);
25
+
26
+
27
+
28
+
29
+ var $j67YK = parcelRequire("j67YK");
30
+
31
+ var $i1rfm = parcelRequire("i1rfm");
32
+
33
+ var $1x02c = parcelRequire("1x02c");
34
+
35
+ var $2fuDN = parcelRequire("2fuDN");
36
+
37
+ var $1Qww3 = parcelRequire("1Qww3");
38
+
39
+ var $aNpqK = parcelRequire("aNpqK");
40
+
41
+ var $fnQYO = parcelRequire("fnQYO");
42
+
43
+ var $8Rmrq = parcelRequire("8Rmrq");
44
+
45
+ var $4ucVo = parcelRequire("4ucVo");
46
+
47
+ var $8KJP1 = parcelRequire("8KJP1");
48
+
49
+ var $lj7lQ = parcelRequire("lj7lQ");
50
+
51
+ var $bcki5 = parcelRequire("bcki5");
52
+
53
+ var $c3PKX = parcelRequire("c3PKX");
54
+
55
+ var $jlqZa = parcelRequire("jlqZa");
56
+
57
+ var $dpafD = parcelRequire("dpafD");
58
+
59
+ var $gXOmG = parcelRequire("gXOmG");
60
+ const $cccd6edc9ecbde88$var$springEnterDuration = 1500;
61
+ const $cccd6edc9ecbde88$var$springLeaveDuration = 2500;
62
+ const $cccd6edc9ecbde88$var$AttachmentDetails = ()=>{
63
+ const detailedItemContent = (0, $fnQYO.default)();
64
+ const isRTL = (0, $2fuDN.useLocaleStore)((state)=>state.isRTL);
65
+ const locale = (0, $2fuDN.useLocaleStore)((state)=>state.locale);
66
+ const isUsedOnBorne = (0, $1x02c.useRetorikStore)((state)=>state.configuration.isUsedOnBorne);
67
+ const baseAddress = (0, $1x02c.useRetorikStore)((state)=>state.baseAddress);
68
+ const mode = (0, $i1rfm.useSpeechStore)((state)=>state.mode);
69
+ const useOldRemote = (0, $1x02c.useRetorikStore)((state)=>state.configuration.useOldRemote);
70
+ const isMobile = (0, $1Qww3.useViewStore)((state)=>state.isMobile);
71
+ const isWidget = (0, $1Qww3.useViewStore)((state)=>state.isWidget);
72
+ const currentDeviceType = (0, $1Qww3.useViewStore)((state)=>state.currentDeviceType);
73
+ const themeColors = (0, $1Qww3.useViewStore)((state)=>state.themeColors);
74
+ const closeDetailedPOI = (0, $j67YK.useUtilsStore)((state)=>state.closeDetailedPOI);
75
+ const { setRetorikEvent: setRetorikEvent, setCloseDetailedPOI: setCloseDetailedPOI } = (0, $j67YK.useUtilsStore)((state)=>state.actions);
76
+ const { sendMessage: sendMessage, sendEvent: sendEvent } = (0, $aNpqK.useDirectlineStore)((state)=>state.actions);
77
+ const [content, setContent] = (0, $dAxr5$useState)(undefined);
78
+ const [color, setColor] = (0, $dAxr5$useState)(themeColors.secondary);
79
+ const [titleHeight, setTitleHeight] = (0, $dAxr5$useState)(0);
80
+ const [spring, api] = (0, $dAxr5$useSpring)(()=>({
81
+ from: {
82
+ transform: 'translateX(0%)'
83
+ }
84
+ }));
85
+ const timerRef = (0, $dAxr5$useRef)(null);
86
+ const divRef = (0, $dAxr5$useRef)(null);
87
+ (0, $dAxr5$useEffect)(()=>{
88
+ setContent(detailedItemContent);
89
+ if (detailedItemContent) setRetorikEvent((0, $4ucVo.RetorikEvent).DetailViewOpen);
90
+ }, [
91
+ detailedItemContent
92
+ ]);
93
+ (0, $dAxr5$useEffect)(()=>{
94
+ closeDetailedPOI && handleClose();
95
+ }, [
96
+ closeDetailedPOI
97
+ ]);
98
+ (0, $dAxr5$useLayoutEffect)(()=>{
99
+ if (divRef?.current) isWidget && (0, $8KJP1.default)(null, divRef);
100
+ });
101
+ (0, $dAxr5$useEffect)(()=>{
102
+ if (content) {
103
+ if (timerRef.current) {
104
+ clearTimeout(timerRef.current);
105
+ timerRef.current = null;
106
+ }
107
+ content.category?.id && setColor((0, $8Rmrq.getColorFromCategoryId)(content.category.id, themeColors));
108
+ api.start({
109
+ from: {
110
+ transform: isRTL ? 'translateX(100%)' : 'translateX(-100%)'
111
+ },
112
+ to: {
113
+ transform: 'translateX(0%)'
114
+ },
115
+ config: {
116
+ duration: $cccd6edc9ecbde88$var$springEnterDuration,
117
+ easing: (0, $dAxr5$easings).easeInBack
118
+ }
119
+ });
120
+ }
121
+ }, [
122
+ content
123
+ ]);
124
+ const handleClose = ()=>{
125
+ if (!timerRef.current) {
126
+ api.start({
127
+ from: {
128
+ transform: 'translateX(0%)'
129
+ },
130
+ to: {
131
+ transform: isRTL ? 'translateX(100%)' : 'translateX(-100%)'
132
+ },
133
+ config: {
134
+ duration: $cccd6edc9ecbde88$var$springLeaveDuration,
135
+ easing: (0, $dAxr5$easings).easeOutExpo
136
+ }
137
+ });
138
+ setCloseDetailedPOI(false);
139
+ setRetorikEvent((0, $4ucVo.RetorikEvent).DetailViewClose);
140
+ timerRef.current = setTimeout(()=>{
141
+ sendEvent('Davi.CloseWindow', null);
142
+ sendEvent('Davi.CloseWindowDetailed', null);
143
+ setContent(undefined);
144
+ timerRef.current = null;
145
+ }, $cccd6edc9ecbde88$var$springLeaveDuration);
146
+ }
147
+ };
148
+ const sendPostBack = (value)=>{
149
+ sendMessage(undefined, value);
150
+ };
151
+ return content ? /*#__PURE__*/ (0, $dAxr5$jsx)((0, $lj7lQ.default), {
152
+ handleClose: handleClose,
153
+ className: useOldRemote ? 'rf-z-detailedPOI' : 'rf-z-[25]',
154
+ closeButtonClassName: "rf-z-util",
155
+ remoteCloseButtonZIndex: "rf-z-detailedPOI",
156
+ animation: spring,
157
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
158
+ ref: divRef,
159
+ className: "rf-relative rf-flex rf-flex-row vertical:rf-flex-col rf-h-full rf-overflow-y-scroll rf-scrollbar-hidden",
160
+ children: detailedItemContent?.template ? /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$react).Fragment, {
161
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)(detailedItemContent.template, {
162
+ props: {
163
+ ...content,
164
+ locale: locale,
165
+ isUsedOnBorne: isUsedOnBorne,
166
+ baseAddress: baseAddress,
167
+ sendPostBack: sendPostBack
168
+ },
169
+ currentDeviceType: currentDeviceType,
170
+ handleClose: handleClose
171
+ })
172
+ }) : /*#__PURE__*/ (0, $dAxr5$jsxs)((0, $dAxr5$react).Fragment, {
173
+ children: [
174
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
175
+ className: "rf-px-6 large:rf-px-8 rf-w-2/3 vertical:rf-w-full rf-mb-4 large:rf-mb-0 rf-flex rf-flex-col rf-border-r rf-border-r-silver vertical:rf-border-r-0",
176
+ children: [
177
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $bcki5.default), {
178
+ category: content.category,
179
+ title: content.title,
180
+ infoBanner: content.infoBanner,
181
+ color: color,
182
+ customerReviews: content.customerReviews,
183
+ favorite: content.favorite,
184
+ handleClose: handleClose,
185
+ setTitleHeight: setTitleHeight
186
+ }),
187
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
188
+ className: "rf-flex rf-flex-col large:rf-flex-row landscape-retorik:rf-h-full",
189
+ children: [
190
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $c3PKX.default), {
191
+ text: content.text,
192
+ otherInformations: content.otherInformations,
193
+ color: color,
194
+ url: content.downloadUri,
195
+ titleHeight: titleHeight
196
+ }),
197
+ (content.media?.length || content.review) && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $jlqZa.default), {
198
+ media: content.media,
199
+ review: content.review,
200
+ color: color
201
+ })
202
+ ]
203
+ })
204
+ ]
205
+ }),
206
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dpafD.default), {
207
+ address: content.addressStructured,
208
+ phoneNumber: content.phoneNumber,
209
+ coordinates: content.coordinates,
210
+ color: color,
211
+ customerReviews: content.customerReviews,
212
+ url: content.downloadUri
213
+ }),
214
+ isMobile && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
215
+ className: mode === (0, $4ucVo.Mode).text ? 'rf-mb-28' : 'rf-mb-16',
216
+ children: content.downloadUri && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $gXOmG.default), {
217
+ className: "rf-justify-center",
218
+ url: content.downloadUri
219
+ })
220
+ })
221
+ ]
222
+ })
223
+ })
224
+ }) : /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$react).Fragment, {});
225
+ };
226
+ var $cccd6edc9ecbde88$export$2e2bcd8739ae039 = $cccd6edc9ecbde88$var$AttachmentDetails;
227
+
228
+ });
229
+ parcelRegister("fnQYO", function(module, exports) {
230
+
231
+ $parcel$export(module.exports, "default", () => $c9e1885e3d839d78$export$2e2bcd8739ae039);
232
+
233
+
234
+ var $9GPj7 = parcelRequire("9GPj7");
235
+
236
+ var $j67YK = parcelRequire("j67YK");
237
+
238
+ var $2fuDN = parcelRequire("2fuDN");
239
+
240
+ var $1x02c = parcelRequire("1x02c");
241
+
242
+ var $jUFPv = parcelRequire("jUFPv");
243
+ const $c9e1885e3d839d78$var$useShowPOI = ()=>{
244
+ const locale = (0, $2fuDN.useLocaleStore)((state)=>state.locale);
245
+ const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
246
+ const lastBotActivity = (0, $9GPj7.useActivityStore)((state)=>state.lastBotActivity);
247
+ const triggers = (0, $j67YK.useUtilsStore)((state)=>state.detailedAttachmentTriggers);
248
+ const baseAddress = (0, $1x02c.useRetorikStore)((state)=>state.baseAddress);
249
+ const [result, setResult] = (0, $dAxr5$useState)(undefined);
250
+ (0, $dAxr5$useEffect)(()=>{
251
+ let result = undefined;
252
+ if (lastBotActivity?.value && triggers.length) triggers.forEach((trigger)=>{
253
+ if (lastBotActivity.type === trigger.type) {
254
+ if (trigger.name && trigger.name === lastBotActivity.name) {
255
+ if (trigger.contentType) {
256
+ if (trigger.contentType === lastBotActivity.value?.contentType) {
257
+ lastBotActivity.value.content.template = trigger.linkedComponent;
258
+ result = lastBotActivity.value.content;
259
+ }
260
+ } else {
261
+ const data = {
262
+ id: lastBotActivity.value?.contentItemId,
263
+ content: lastBotActivity.value?.content,
264
+ contentType: lastBotActivity.value?.contentType,
265
+ baseAddress: baseAddress,
266
+ locale: locale
267
+ };
268
+ const checkData = (0, $jUFPv.mapDetailedDataFromContentItem)(data, translation);
269
+ if (checkData) result = {
270
+ ...checkData,
271
+ template: trigger.linkedComponent
272
+ };
273
+ else {
274
+ lastBotActivity.value.template = trigger.linkedComponent;
275
+ result = lastBotActivity.value;
276
+ }
277
+ }
278
+ } else if (trigger.label && trigger.label === lastBotActivity.label) {
279
+ if (trigger.contentType) {
280
+ if (trigger.contentType === lastBotActivity.value?.contentType) {
281
+ lastBotActivity.value.content.template = trigger.linkedComponent;
282
+ result = lastBotActivity.value.content;
283
+ }
284
+ } else {
285
+ lastBotActivity.value.template = trigger.linkedComponent;
286
+ result = lastBotActivity.value;
287
+ }
288
+ }
289
+ }
290
+ });
291
+ setResult(result);
292
+ }, [
293
+ lastBotActivity
294
+ ]);
295
+ return result;
296
+ };
297
+ var $c9e1885e3d839d78$export$2e2bcd8739ae039 = $c9e1885e3d839d78$var$useShowPOI;
298
+
299
+ });
300
+ parcelRegister("jUFPv", function(module, exports) {
301
+
302
+ $parcel$export(module.exports, "mapDetailedDataFromContentItem", () => $cd660f3886f5c65b$export$af5c868343ae916a);
303
+ const $cd660f3886f5c65b$var$infoBannerContenTypes = [
304
+ 'foodestablishment',
305
+ 'event'
306
+ ];
307
+ const $cd660f3886f5c65b$var$categoryConversion = {
308
+ FoodEstablishment: 'Where to eat',
309
+ LodgingBusiness: 'Where to sleep',
310
+ TouristDestination: 'What to see',
311
+ TouristAttraction: 'What to do',
312
+ Product: 'Local products',
313
+ Service: 'Services',
314
+ Event: 'Events',
315
+ City: 'Cities',
316
+ Wine: 'Wines'
317
+ };
318
+ const $cd660f3886f5c65b$var$getCategoryFromContentType = (contentType, translation)=>{
319
+ if (contentType) {
320
+ if (Object.keys($cd660f3886f5c65b$var$categoryConversion).includes(contentType)) return {
321
+ id: $cd660f3886f5c65b$var$categoryConversion[contentType],
322
+ label: translation.poi[contentType]
323
+ };
324
+ return {
325
+ id: 'default',
326
+ label: contentType
327
+ };
328
+ }
329
+ return undefined;
330
+ };
331
+ const $cd660f3886f5c65b$export$af5c868343ae916a = (data, translation)=>{
332
+ if (data.id && data.content) try {
333
+ const content = data.content;
334
+ // Process medias
335
+ const medias = [];
336
+ content.Thing?.Image?.Paths && content.Thing.Image.Paths.length && content.Thing?.Image?.Paths?.forEach((path)=>{
337
+ medias.push({
338
+ url: `${data.baseAddress}media/${path}`
339
+ });
340
+ });
341
+ // Processed address
342
+ const address = {
343
+ addressLocality: content.Place?.AddressLocality?.Text || '',
344
+ postalCode: content.Place?.PostalCode?.Text || '',
345
+ street: content.Place?.StreetAddress?.Text || ''
346
+ };
347
+ // Processed coordinates
348
+ const coordinates = content.Place?.Latitude?.Value && content.Place?.Longitude?.Value ? {
349
+ latitude: content.Place.Latitude.Value,
350
+ longitude: content.Place.Longitude.Value
351
+ } : undefined;
352
+ // Processed review
353
+ const review = {
354
+ author: content.Review?.Author || content.Review?.AuthorCapacity ? {
355
+ name: content.Review?.Author,
356
+ capacity: content.Review?.AuthorCapacity
357
+ } : undefined,
358
+ comment: content.Review?.ReviewBody || '',
359
+ picture: content.Review?.Picture ? {
360
+ url: content.Review.Picture,
361
+ description: content.Review.PictureDescription || ''
362
+ } : undefined
363
+ };
364
+ // Process other informations
365
+ const otherInformations = [];
366
+ // Opening hours
367
+ content.LocalBusiness?.OpeningHours?.Text && otherInformations.push({
368
+ title: translation.poi.openinghours,
369
+ content: content.LocalBusiness.OpeningHours.Text
370
+ });
371
+ // Prices
372
+ content.LocalBusiness?.PriceRange?.Text && otherInformations.push({
373
+ title: translation.poi.prices,
374
+ content: content.LocalBusiness.PriceRange.Text
375
+ });
376
+ // Payment methods
377
+ content.LocalBusiness?.PaymentAccepted?.Values && content.LocalBusiness.PaymentAccepted.Values.length && otherInformations.push({
378
+ title: translation.poi.paymentmethods,
379
+ content: content.LocalBusiness.PaymentAccepted.Values
380
+ });
381
+ // Process information banner
382
+ let infoBanner;
383
+ if (data.contentType && $cd660f3886f5c65b$var$infoBannerContenTypes.includes(data.contentType.toLowerCase())) switch(data.contentType.toLowerCase()){
384
+ case 'foodestablishment':
385
+ content.Place?.MaximumAttendeeCapacity?.Value && !isNaN(parseInt(content.Place?.MaximumAttendeeCapacity?.Value)) && (infoBanner = `${translation.poi.numberofplaces} ${parseInt(content.Place?.MaximumAttendeeCapacity?.Value)}`);
386
+ break;
387
+ case 'event':
388
+ if (content.Event && content.Event.StartDate?.Value && content.Event.EndDate?.value) {
389
+ const startDate = new Date(content.Event.StartDate.Value);
390
+ const endDate = new Date(content.Event.StartDate.Value);
391
+ if (content.Event.StartDate.Value === content.Event.EndDate.value) infoBanner = `Le ${startDate.toLocaleDateString(data.locale)}`;
392
+ else infoBanner = `Du ${startDate.toLocaleDateString(data.locale)} au ${endDate.toLocaleDateString(data.locale)}`;
393
+ }
394
+ break;
395
+ }
396
+ // Hack for Wines category -> TODO : remove it !
397
+ let categoryWineTest = false;
398
+ const categories = content.Thing?.Categories?.Values;
399
+ const wineFilters = [
400
+ 'Blanc de blanc',
401
+ "Ros\xe9 Champagne",
402
+ 'Vintages',
403
+ 'Cocktail Collection',
404
+ 'AUTHIGENE Collection'
405
+ ];
406
+ if (categories && categories.length) categories.forEach((category)=>wineFilters.includes(category) && (categoryWineTest = true));
407
+ const mappedData = {
408
+ identifier: data.id,
409
+ title: content.Thing?.Name?.Text?.toString() || '',
410
+ text: content.Thing?.Description?.Text?.toString() || '',
411
+ addressStructured: address,
412
+ contact: content.PointOfInterest?.Contact?.Text?.toString() || '',
413
+ phoneNumber: content.Place?.Telephone?.Text ? content.Place.Telephone.Text.toString() : '',
414
+ category: categoryWineTest ? {
415
+ id: $cd660f3886f5c65b$var$categoryConversion.Wine,
416
+ label: translation.poi.Wine
417
+ } : $cd660f3886f5c65b$var$getCategoryFromContentType(content.contentType || data.contentType, translation),
418
+ media: medias.length ? medias : undefined,
419
+ customerReviews: content.Place?.AggregateRating?.Value,
420
+ coordinates: coordinates,
421
+ downloadUri: `${data.baseAddress}api/hospitality/${data.id}/pdf`,
422
+ favorite: !!content.Thing?.Favorite?.Value,
423
+ review: review,
424
+ infoBanner: infoBanner,
425
+ otherInformations: otherInformations
426
+ };
427
+ return mappedData;
428
+ } catch (e) {
429
+ console.log(e);
430
+ return null;
431
+ }
432
+ return null;
433
+ };
434
+
435
+ });
436
+
437
+
438
+ parcelRegister("bcki5", function(module, exports) {
439
+
440
+ $parcel$export(module.exports, "default", () => $53f8c1e84286bc25$export$2e2bcd8739ae039);
441
+
442
+
443
+
444
+ var $2fuDN = parcelRequire("2fuDN");
445
+
446
+ var $1Qww3 = parcelRequire("1Qww3");
447
+
448
+ var $g0cBD = parcelRequire("g0cBD");
449
+
450
+ var $ahoAn = parcelRequire("ahoAn");
451
+
452
+ var $28ved = parcelRequire("28ved");
453
+ const $53f8c1e84286bc25$var$DetailedTitle = ({ category: category, title: title, infoBanner: infoBanner, color: color, customerReviews: customerReviews, favorite: favorite, handleClose: handleClose, setTitleHeight: setTitleHeight })=>{
454
+ const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
455
+ const isMobile = (0, $1Qww3.useViewStore)((state)=>state.isMobile);
456
+ const titleRef = (0, $dAxr5$useRef)(null);
457
+ (0, $dAxr5$useEffect)(()=>{
458
+ titleRef?.current && setTitleHeight(titleRef.current.clientHeight);
459
+ }, [
460
+ titleRef?.current
461
+ ]);
462
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
463
+ ref: titleRef,
464
+ className: "rf-relative rf-pb-4 rf-flex-col rf-items-start rf-justify-center",
465
+ children: [
466
+ customerReviews && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $g0cBD.default), {
467
+ className: "rf-absolute rf-hidden large-vertical:rf-block rf-top-0 ltr:rf-right-0 rtl:rf-left-0",
468
+ color: color,
469
+ customerReviews: customerReviews
470
+ }),
471
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
472
+ className: "rf-w-full rf-flex rf-flex-row rf-justify-between ltr:rf-items-start rtl:rf-items-end",
473
+ children: [
474
+ isMobile && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $28ved.BackButton), {
475
+ title: translation.common.back,
476
+ handleBack: handleClose,
477
+ className: "rf-relative rf-mt-4 rf-text-size-auto"
478
+ }),
479
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
480
+ className: "rf-uppercase rf-w-fit rf-py-2 large:rf-py-3 rf-px-4 rf-bg-black rf-text-primary",
481
+ style: {
482
+ color: color
483
+ },
484
+ children: category?.label || 'category'
485
+ })
486
+ ]
487
+ }),
488
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
489
+ className: "rf-py-6 rf-title-large-bold-size-auto large-vertical:rf-pt-[16.67%] rf-flex rf-flex-row rf-items-center rf-font-bold",
490
+ children: [
491
+ favorite && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $ahoAn.FavoriteIcon), {
492
+ className: "rf-h-16 rf-w-20 ltr:rf-pr-4 rtl:rf-pl-4"
493
+ }),
494
+ title || ''
495
+ ]
496
+ }),
497
+ infoBanner && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
498
+ className: "rf-py-1 rf-px-4 rf-subtitle-size-auto rf-bg-primary rf-text-truewhite",
499
+ style: {
500
+ backgroundColor: color
501
+ },
502
+ children: infoBanner
503
+ })
504
+ ]
505
+ });
506
+ };
507
+ var $53f8c1e84286bc25$export$2e2bcd8739ae039 = $53f8c1e84286bc25$var$DetailedTitle;
508
+
509
+ });
510
+ parcelRegister("g0cBD", function(module, exports) {
511
+
512
+ $parcel$export(module.exports, "default", () => $60b578e81778debe$export$2e2bcd8739ae039);
513
+
514
+
515
+
516
+ var $ahoAn = parcelRequire("ahoAn");
517
+
518
+ var $2fuDN = parcelRequire("2fuDN");
519
+ const $60b578e81778debe$var$CommentsPennant = ({ className: className, color: color, customerReviews: customerReviews })=>{
520
+ const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
521
+ const [widthInPx, setWidthInPx] = (0, $dAxr5$useState)(0);
522
+ const pennantRef = (0, $dAxr5$useRef)(null);
523
+ (0, $dAxr5$useEffect)(()=>{
524
+ if (pennantRef.current) setWidthInPx(Math.ceil(pennantRef.current.offsetWidth / 2));
525
+ }, [
526
+ pennantRef
527
+ ]);
528
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
529
+ className: `${className} rf-flex rf-flex-col rf-justify-center rf-text-white`,
530
+ ref: pennantRef,
531
+ children: [
532
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
533
+ className: "rf-flex rf-flex-col rf-items-center rf-p-2 rf-bg-primary",
534
+ style: {
535
+ backgroundColor: color
536
+ },
537
+ children: [
538
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $ahoAn.CommentsPennantIcon), {
539
+ className: "rf-w-12 large:rf-w-14 large-vertical:rf-w-16 rf-pb-2"
540
+ }),
541
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
542
+ className: "rf-flex-col rf-text-center rf-text-size-auto rf-uppercase",
543
+ children: translation.poi.comment.split(' ').map((word, index)=>{
544
+ return /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
545
+ children: word
546
+ }, index);
547
+ })
548
+ }),
549
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
550
+ className: "rf-font-bold rf-subtitle-size-auto",
551
+ children: [
552
+ customerReviews,
553
+ "/10"
554
+ ]
555
+ })
556
+ ]
557
+ }),
558
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
559
+ className: "rf-w-0 rf-h-0 rf-border-t-0 rf-border-x-primary rf-border-b-transparent",
560
+ style: {
561
+ borderLeftColor: color,
562
+ borderRightColor: color,
563
+ borderBottomWidth: widthInPx * 2 / 3,
564
+ borderLeftWidth: widthInPx,
565
+ borderRightWidth: widthInPx
566
+ }
567
+ })
568
+ ]
569
+ });
570
+ };
571
+ var $60b578e81778debe$export$2e2bcd8739ae039 = $60b578e81778debe$var$CommentsPennant;
572
+
573
+ });
574
+
575
+
576
+ parcelRegister("c3PKX", function(module, exports) {
577
+
578
+ $parcel$export(module.exports, "default", () => $6a730642f0980161$export$2e2bcd8739ae039);
579
+
580
+
581
+
582
+ var $1x02c = parcelRequire("1x02c");
583
+
584
+ var $1Qww3 = parcelRequire("1Qww3");
585
+
586
+ var $gXOmG = parcelRequire("gXOmG");
587
+
588
+ var $AZKpV = parcelRequire("AZKpV");
589
+ const $6a730642f0980161$var$DownloadQRHeight = 200;
590
+ const $6a730642f0980161$var$DownloadSheetHeight = 100;
591
+ const $6a730642f0980161$var$DetailedText = ({ text: text, otherInformations: otherInformations, color: color, url: url, titleHeight: titleHeight })=>{
592
+ const isUsedOnBorne = (0, $1x02c.useRetorikStore)((state)=>state.configuration.isUsedOnBorne);
593
+ const isMobile = (0, $1Qww3.useViewStore)((state)=>state.isMobile);
594
+ const isLandscape = (0, $1Qww3.useViewStore)((state)=>state.isLandscape);
595
+ const currentHeight = (0, $1Qww3.useViewStore)((state)=>state.currentHeight);
596
+ const textRef = (0, $dAxr5$useRef)(null);
597
+ const otherInformationsRef = (0, $dAxr5$useRef)(null);
598
+ const [opacityStyle, setOpacityStyle] = (0, $dAxr5$useState)('');
599
+ const [otherOpacityStyle, setOtherOpacityStyle] = (0, $dAxr5$useState)('');
600
+ const processedText = (0, $dAxr5$useMemo)(()=>{
601
+ if (text) return text.replaceAll('\n', '<br>');
602
+ return '';
603
+ }, [
604
+ text
605
+ ]);
606
+ const textContainerMaxHeight = (0, $dAxr5$useMemo)(()=>{
607
+ return currentHeight - titleHeight - (isUsedOnBorne ? $6a730642f0980161$var$DownloadQRHeight : $6a730642f0980161$var$DownloadSheetHeight);
608
+ }, [
609
+ titleHeight
610
+ ]);
611
+ const [textMaxHeight, setTextMaxHeight] = (0, $dAxr5$useState)(0);
612
+ const [otherInformationsMaxHeight, setOtherInformationsMaxHeight] = (0, $dAxr5$useState)(0);
613
+ (0, $dAxr5$useEffect)(()=>{
614
+ if (textRef?.current && otherInformationsRef?.current && textContainerMaxHeight && !isMobile) {
615
+ const textHeight = isLandscape ? textContainerMaxHeight * 58 / 100 : currentHeight * 30 / 100;
616
+ const otherInformationsHeight = isLandscape ? textContainerMaxHeight * 40 / 100 : currentHeight * 18 / 100;
617
+ if (textRef.current.scrollHeight > textHeight) {
618
+ if (otherInformationsRef.current.scrollHeight > otherInformationsHeight) {
619
+ setTextMaxHeight(textHeight);
620
+ setOtherInformationsMaxHeight(otherInformationsHeight);
621
+ } else {
622
+ setTextMaxHeight(textContainerMaxHeight - otherInformationsRef.current.scrollHeight);
623
+ setOtherInformationsMaxHeight(otherInformationsHeight);
624
+ }
625
+ } else if (otherInformationsRef.current.scrollHeight > otherInformationsHeight) {
626
+ setTextMaxHeight(textHeight);
627
+ setOtherInformationsMaxHeight(textContainerMaxHeight - textRef.current.scrollHeight);
628
+ } else {
629
+ setTextMaxHeight(textHeight);
630
+ setOtherInformationsMaxHeight(otherInformationsHeight);
631
+ }
632
+ }
633
+ }, [
634
+ textRef?.current,
635
+ otherInformationsRef?.current,
636
+ textContainerMaxHeight
637
+ ]);
638
+ (0, $dAxr5$useEffect)(()=>{
639
+ if (textRef?.current && textMaxHeight) {
640
+ if (!isMobile && textRef.current.scrollHeight > textMaxHeight && textRef.current.scrollHeight > textRef.current.clientHeight) handleScroll();
641
+ else setOpacityStyle(undefined);
642
+ }
643
+ }, [
644
+ textRef?.current,
645
+ textMaxHeight
646
+ ]);
647
+ (0, $dAxr5$useEffect)(()=>{
648
+ if (otherInformationsRef?.current && otherInformationsMaxHeight) {
649
+ if (!isMobile && otherInformationsRef.current.scrollHeight > otherInformationsMaxHeight && otherInformationsRef.current.scrollHeight > otherInformationsRef.current.clientHeight) handleOtherScroll();
650
+ else setOtherOpacityStyle(undefined);
651
+ }
652
+ }, [
653
+ otherInformationsRef?.current,
654
+ otherInformationsMaxHeight
655
+ ]);
656
+ /**
657
+ * On call :
658
+ * - check if textRef.current is defined
659
+ * - set opacityStyle state depending on scroll height and current scrolling
660
+ */ const handleScroll = ()=>{
661
+ if (textRef.current) {
662
+ const maxScroll = textRef.current.scrollHeight - textRef.current.offsetHeight;
663
+ const percentage = Math.ceil(textRef.current.scrollTop / maxScroll * 40);
664
+ setOpacityStyle(`linear-gradient(to bottom, black ${60 + percentage}%, transparent 100%)`);
665
+ }
666
+ };
667
+ const handleOtherScroll = ()=>{
668
+ if (otherInformationsRef.current) {
669
+ const maxScroll = otherInformationsRef.current.scrollHeight - otherInformationsRef.current.offsetHeight;
670
+ const percentage = Math.ceil(otherInformationsRef.current.scrollTop / maxScroll * 30);
671
+ setOtherOpacityStyle(`linear-gradient(to bottom, black ${70 + percentage}%, transparent 100%)`);
672
+ }
673
+ };
674
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
675
+ className: "rf-flex rf-flex-col large:rf-pr-4 large:rf-min-w-1/2 rf-gap-4",
676
+ children: [
677
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
678
+ className: "rf-w-full rf-flex rf-flex-col rf-items-start",
679
+ style: {
680
+ maxHeight: isLandscape ? textContainerMaxHeight : undefined
681
+ },
682
+ children: [
683
+ processedText && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
684
+ ref: textRef,
685
+ className: "large-vertical:rf-max-h-[30vh] rf-font-medium rf-overflow-y-scroll rf-pb-4 rf-scroll-pb-4 rf-scrollbar-hidden",
686
+ style: {
687
+ WebkitMaskImage: opacityStyle,
688
+ maxHeight: textMaxHeight || undefined
689
+ },
690
+ onScroll: handleScroll,
691
+ dangerouslySetInnerHTML: {
692
+ __html: processedText
693
+ }
694
+ }),
695
+ otherInformations && otherInformations.length > 0 && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
696
+ ref: otherInformationsRef,
697
+ className: "large-vertical:rf-max-h-[18vh] rf-flex rf-flex-col rf-justify-start rf-text-lightgray rf-overflow-y-scroll rf-pb-4 rf-scroll-pb-4 rf-scrollbar-hidden",
698
+ style: {
699
+ WebkitMaskImage: otherOpacityStyle,
700
+ maxHeight: otherInformationsMaxHeight || undefined
701
+ },
702
+ onScroll: handleOtherScroll,
703
+ children: otherInformations.map((information, key)=>{
704
+ const tempContent = Array.isArray(information.content) ? information.content.join(' | ') : information.content;
705
+ const htmlContent = tempContent.replaceAll('\n', '<br>');
706
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)((0, $dAxr5$react).Fragment, {
707
+ children: [
708
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
709
+ className: "rf-mt-4",
710
+ style: {
711
+ color: color || 'rgb(25, 153, 177)'
712
+ },
713
+ children: information.title
714
+ }),
715
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
716
+ dangerouslySetInnerHTML: {
717
+ __html: htmlContent
718
+ }
719
+ })
720
+ ]
721
+ }, key);
722
+ })
723
+ })
724
+ ]
725
+ }),
726
+ isLandscape && url && (isUsedOnBorne ? /*#__PURE__*/ (0, $dAxr5$jsx)((0, $AZKpV.default), {
727
+ url: url
728
+ }) : /*#__PURE__*/ (0, $dAxr5$jsx)((0, $gXOmG.default), {
729
+ url: url
730
+ }))
731
+ ]
732
+ });
733
+ };
734
+ var $6a730642f0980161$export$2e2bcd8739ae039 = $6a730642f0980161$var$DetailedText;
735
+
736
+ });
737
+ parcelRegister("gXOmG", function(module, exports) {
738
+
739
+ $parcel$export(module.exports, "default", () => $5850ec0a690e2e58$export$2e2bcd8739ae039);
740
+
741
+
742
+
743
+ var $2fuDN = parcelRequire("2fuDN");
744
+
745
+ var $SZcIF = parcelRequire("SZcIF");
746
+
747
+ var $7pypd = parcelRequire("7pypd");
748
+ const $5850ec0a690e2e58$var$DownloadSheet = ({ className: className, url: url })=>{
749
+ const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
750
+ const locale = (0, $2fuDN.useLocaleStore)((state)=>state.locale);
751
+ return /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
752
+ className: `${className} rf-w-full rf-flex`,
753
+ children: /*#__PURE__*/ (0, $dAxr5$jsxs)("a", {
754
+ href: url,
755
+ className: "rf-px-5 rf-py-3 rf-h-fit rf-flex rf-flex-row rf-items-center rf-mt-8 rf-mb-16 large:rf-my-0 rf-border-2 rf-border-black rf-rounded-lg hover:rf-bg-truewhite rf-cursor-pointer rf-font-bold",
756
+ children: [
757
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $SZcIF.DownloadIcon), {
758
+ className: "rf-h-6 rf-w-6 ltr:rf-mr-1 rtl:rf-ml-1"
759
+ }),
760
+ (0, $7pypd.capitalizeFirstLetter)(translation.common.downloadsheet, locale)
761
+ ]
762
+ })
763
+ });
764
+ };
765
+ var $5850ec0a690e2e58$export$2e2bcd8739ae039 = $5850ec0a690e2e58$var$DownloadSheet;
766
+
767
+ });
768
+
769
+ parcelRegister("AZKpV", function(module, exports) {
770
+
771
+ $parcel$export(module.exports, "default", () => $11c73850a5407041$export$2e2bcd8739ae039);
772
+
773
+
774
+
775
+
776
+ var $2fuDN = parcelRequire("2fuDN");
777
+
778
+ var $1x02c = parcelRequire("1x02c");
779
+
780
+ var $7pypd = parcelRequire("7pypd");
781
+
782
+ var $3mANd = parcelRequire("3mANd");
783
+
784
+ var $eNFwL = parcelRequire("eNFwL");
785
+
786
+ var $ahoAn = parcelRequire("ahoAn");
787
+ const $11c73850a5407041$var$DownloadQR = ({ url: url })=>{
788
+ const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
789
+ const locale = (0, $2fuDN.useLocaleStore)((state)=>state.locale);
790
+ const enableDocumentPrinting = (0, $1x02c.useRetorikStore)((state)=>state.configuration.enableDocumentPrinting);
791
+ const [qrCodeData, setQrCodeData] = (0, $dAxr5$useState)(undefined);
792
+ const imageRef = (0, $dAxr5$useRef)(null);
793
+ (0, $dAxr5$useEffect)(()=>{
794
+ setQrCodeDataAsync();
795
+ }, []);
796
+ const setQrCodeDataAsync = async ()=>{
797
+ const qrCodeString = await (0, $dAxr5$qrcode).toDataURL(url);
798
+ setQrCodeData(qrCodeString);
799
+ };
800
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
801
+ className: "rf-w-full rf-flex rf-flex-row rf-items-start",
802
+ children: [
803
+ enableDocumentPrinting && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
804
+ className: "rf-w-1/2 rf-flex rf-justify-start",
805
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)((0, $eNFwL.default), {
806
+ url: url
807
+ })
808
+ }),
809
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
810
+ className: "rf-flex rf-flex-col rf-items-center rf-text-center rf-gap-2 rf-font-bold rf-text-sm",
811
+ style: {
812
+ width: enableDocumentPrinting ? '50%' : '100%'
813
+ },
814
+ children: [
815
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
816
+ className: "rf-flex rf-flex-row rf-items-start rf-gap-1 rf-italic",
817
+ children: [
818
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $ahoAn.RoundIcon), {}),
819
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
820
+ className: "rf-w-fit",
821
+ children: `${(0, $7pypd.capitalizeFirstLetter)(translation.common.downloadsheetmobile, locale)} ${translation.link.scanQR}`
822
+ })
823
+ ]
824
+ }),
825
+ qrCodeData && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
826
+ className: "large-vertical:rf-mt-4",
827
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)((0, $3mANd.default), {
828
+ ref: imageRef,
829
+ src: qrCodeData
830
+ })
831
+ })
832
+ ]
833
+ })
834
+ ]
835
+ });
836
+ };
837
+ var $11c73850a5407041$export$2e2bcd8739ae039 = $11c73850a5407041$var$DownloadQR;
838
+
839
+ });
840
+ parcelRegister("eNFwL", function(module, exports) {
841
+
842
+ $parcel$export(module.exports, "default", () => $c9e2f5668918919f$export$2e2bcd8739ae039);
843
+
844
+
845
+
846
+ var $2fuDN = parcelRequire("2fuDN");
847
+
848
+ var $j67YK = parcelRequire("j67YK");
849
+
850
+ var $ahoAn = parcelRequire("ahoAn");
851
+
852
+ var $ldRRB = parcelRequire("ldRRB");
853
+ const $c9e2f5668918919f$var$PrintingButton = ({ url: url })=>{
854
+ const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
855
+ const setModalFullscreenContent = (0, $j67YK.useUtilsStore)((state)=>state.actions.setModalFullscreenContent);
856
+ const handleClick = ()=>{
857
+ setModalFullscreenContent(/*#__PURE__*/ (0, $dAxr5$jsx)((0, $ldRRB.default), {
858
+ url: url,
859
+ printingAllowed: true
860
+ }));
861
+ };
862
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)("button", {
863
+ className: "rf-px-4 rf-py-1 rf-flex rf-flex-row rf-items-center rf-gap-2 rf-font-bold rf-text-sm rf-border-2 rf-border-black rf-rounded-lg",
864
+ onClick: handleClick,
865
+ children: [
866
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $ahoAn.PrintIcon), {}),
867
+ translation.common.printsheet
868
+ ]
869
+ });
870
+ };
871
+ var $c9e2f5668918919f$export$2e2bcd8739ae039 = $c9e2f5668918919f$var$PrintingButton;
872
+
873
+ });
874
+
875
+
876
+
877
+ parcelRegister("jlqZa", function(module, exports) {
878
+
879
+ $parcel$export(module.exports, "default", () => $e48622e3a42ac630$export$2e2bcd8739ae039);
880
+
881
+
882
+
883
+ var $19XSr = parcelRequire("19XSr");
884
+
885
+ var $7pypd = parcelRequire("7pypd");
886
+
887
+ var $9lsRd = parcelRequire("9lsRd");
888
+ const $e48622e3a42ac630$var$DetailedMedia = ({ media: media, review: review, color: color })=>{
889
+ const [landscapeImage, setLandscapeImage] = (0, $dAxr5$useState)(false);
890
+ const [carouselMedia, setCarouselMedia] = (0, $dAxr5$useState)([]);
891
+ (0, $dAxr5$useEffect)(()=>{
892
+ if (media && media.length > 0) {
893
+ let tempMedia = [];
894
+ media.forEach((med)=>{
895
+ med.url && (tempMedia = [
896
+ ...tempMedia,
897
+ {
898
+ url: med.url,
899
+ alt: med.title || 'media'
900
+ }
901
+ ]);
902
+ });
903
+ setCarouselMedia(tempMedia);
904
+ }
905
+ }, [
906
+ media
907
+ ]);
908
+ /**
909
+ * On review change :
910
+ * - check if the review contains a picture url
911
+ * - if so, create an Image with this url, and check if its width is larger than its height
912
+ * - set landscapeImage state with the result
913
+ */ (0, $dAxr5$useEffect)(()=>{
914
+ if (review?.picture?.url) {
915
+ const getImageData = async ()=>{
916
+ const image = new Image();
917
+ image.onload = ()=>{
918
+ setLandscapeImage(image.width > image.height);
919
+ };
920
+ image.src = review?.picture?.url || '';
921
+ };
922
+ getImageData();
923
+ }
924
+ }, [
925
+ review
926
+ ]);
927
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
928
+ className: "large:rf-min-w-1/2 large:rf-pl-4 rf-flex rf-flex-col rf-items-center",
929
+ children: [
930
+ carouselMedia && carouselMedia.length > 0 && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
931
+ className: "rf-relative rf-flex rf-justify-center rf-align-center rf-w-full rf-aspect-[4/3] rf-mb-4 rf-overflow-hidden",
932
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)((0, $9lsRd.Carousel), {
933
+ className: "rf-min-h-full rf-min-w-full rf-object-cover",
934
+ medias: carouselMedia,
935
+ controls: true,
936
+ timer: 3000,
937
+ color: color
938
+ })
939
+ }),
940
+ review && review.comment && /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
941
+ className: "rf-w-full rf-p-4 large:rf-mb-4 rf-flex rf-flex-col rf-gap-4 rf-bg-truewhite rf-rounded-lg rf-shadow-[0_3px_6px_#00000029]",
942
+ children: [
943
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
944
+ className: "rf-text-lightgray",
945
+ children: review.comment
946
+ }),
947
+ (review.picture || review.author) && /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
948
+ className: "rf-flex rf-flex-row rf-items-center",
949
+ children: [
950
+ review.picture && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
951
+ className: "rf-h-12 rf-w-12 rf-min-w-12 large:rf-h-16 large:rf-w-16 large:rf-min-w-16 large-vertical:rf-h-24 large-vertical:rf-w-24 large-vertical:rf-min-w-24 rf-mr-4 rf-flex rf-items-center rf-rounded-half rf-overflow-hidden",
952
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)("img", {
953
+ src: review.picture.url || (0, $19XSr.imageFiles).noimage,
954
+ alt: review.picture.description || 'auteur',
955
+ className: landscapeImage ? 'rf-h-full rf-max-w-none' : 'rf-w-full'
956
+ })
957
+ }),
958
+ review.author && /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
959
+ className: "rf-flex rf-flex-col rf-items-start",
960
+ children: [
961
+ /*#__PURE__*/ (0, $dAxr5$jsx)("p", {
962
+ className: "rf-font-bold",
963
+ children: (0, $7pypd.capitalizeFirstLetter)(review.author.name || '')
964
+ }),
965
+ /*#__PURE__*/ (0, $dAxr5$jsx)("p", {
966
+ className: "rf-italic",
967
+ children: (0, $7pypd.capitalizeFirstLetter)(review.author.capacity || '')
968
+ })
969
+ ]
970
+ })
971
+ ]
972
+ })
973
+ ]
974
+ })
975
+ ]
976
+ });
977
+ };
978
+ var $e48622e3a42ac630$export$2e2bcd8739ae039 = $e48622e3a42ac630$var$DetailedMedia;
979
+
980
+ });
981
+
982
+ parcelRegister("dpafD", function(module, exports) {
983
+
984
+ $parcel$export(module.exports, "default", () => $3df3515605343012$export$2e2bcd8739ae039);
985
+
986
+
987
+
988
+ var $1x02c = parcelRequire("1x02c");
989
+
990
+ var $1Qww3 = parcelRequire("1Qww3");
991
+
992
+ var $1ddtH = parcelRequire("1ddtH");
993
+
994
+ var $g0cBD = parcelRequire("g0cBD");
995
+
996
+ var $bjmYU = parcelRequire("bjmYU");
997
+
998
+ var $gXOmG = parcelRequire("gXOmG");
999
+
1000
+ var $AZKpV = parcelRequire("AZKpV");
1001
+ const $3df3515605343012$var$DetailedAddress = ({ address: address, phoneNumber: phoneNumber, coordinates: coordinates, color: color, customerReviews: customerReviews, url: url })=>{
1002
+ const isMobile = (0, $1Qww3.useViewStore)((state)=>state.isMobile);
1003
+ const isLandscape = (0, $1Qww3.useViewStore)((state)=>state.isLandscape);
1004
+ const isBorne = (0, $1Qww3.useViewStore)((state)=>state.isBorne);
1005
+ const currentWidth = (0, $1Qww3.useViewStore)((state)=>state.currentWidth);
1006
+ const configuration = (0, $1x02c.useRetorikStore)((state)=>state.configuration);
1007
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1008
+ className: "rf-relative rf-w-1/3 vertical:rf-w-full large:rf-bg-truewhite rf-flex rf-flex-col large-vertical:rf-flex-row",
1009
+ children: [
1010
+ customerReviews && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $g0cBD.default), {
1011
+ className: "rf-absolute large-vertical:rf-hidden rf-top-0 rf-left-1/2 rf--translate-x-1/2",
1012
+ color: color,
1013
+ customerReviews: customerReviews
1014
+ }),
1015
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1016
+ className: `rf-px-6 rf-flex rf-flex-col large-vertical:rf-w-1/2 rf-items-center rf-text-center ${customerReviews ? isBorne ? 'rf-bg-truewhite rf-justify-center' : 'rf-bg-truewhite rf-justify-start' : 'rf-justify-center'}`,
1017
+ style: {
1018
+ height: isMobile ? customerReviews ? currentWidth : undefined : isLandscape ? coordinates && coordinates.latitude && coordinates.longitude ? '50%' : '100%' : 'calc(50vw - 3rem)'
1019
+ },
1020
+ children: [
1021
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1022
+ className: customerReviews && !isBorne ? isLandscape ? 'rf-pt-[26vh] rf-pb-12' : 'rf-pt-11/20 rf-pb-12' : 'rf-py-12',
1023
+ children: address && /*#__PURE__*/ (0, $dAxr5$jsxs)((0, $dAxr5$react).Fragment, {
1024
+ children: [
1025
+ address.street && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1026
+ children: address.street
1027
+ }),
1028
+ address.addressLocality && /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1029
+ children: address.postalCode ? `${address.postalCode} ${address.addressLocality}` : address.addressLocality
1030
+ })
1031
+ ]
1032
+ })
1033
+ }),
1034
+ phoneNumber && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $1ddtH.default), {
1035
+ phoneNumber: phoneNumber
1036
+ }),
1037
+ coordinates && coordinates.latitude && coordinates.longitude && isBorne && url && (configuration.isUsedOnBorne ? /*#__PURE__*/ (0, $dAxr5$jsx)((0, $AZKpV.default), {
1038
+ url: url
1039
+ }) : /*#__PURE__*/ (0, $dAxr5$jsx)((0, $gXOmG.default), {
1040
+ className: "rf-justify-center",
1041
+ url: url
1042
+ }))
1043
+ ]
1044
+ }),
1045
+ coordinates && coordinates.latitude && coordinates.longitude ? /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1046
+ className: "rf-relative large-vertical:rf-w-1/2",
1047
+ style: {
1048
+ height: isMobile ? currentWidth : isLandscape ? '50%' : 'calc(50vw - 3rem)'
1049
+ },
1050
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)((0, $bjmYU.default), {
1051
+ latitude: coordinates.latitude,
1052
+ longitude: coordinates.longitude,
1053
+ color: color
1054
+ })
1055
+ }) : isBorne ? /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1056
+ className: "rf-flex rf-justify-center rf-items-center rf-h-[calc(50vw-3rem)] rf-w-1/2",
1057
+ children: url && (configuration.isUsedOnBorne ? /*#__PURE__*/ (0, $dAxr5$jsx)((0, $AZKpV.default), {
1058
+ url: url
1059
+ }) : /*#__PURE__*/ (0, $dAxr5$jsx)((0, $gXOmG.default), {
1060
+ className: "rf-justify-center",
1061
+ url: url
1062
+ }))
1063
+ }) : /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$react).Fragment, {})
1064
+ ]
1065
+ });
1066
+ };
1067
+ var $3df3515605343012$export$2e2bcd8739ae039 = $3df3515605343012$var$DetailedAddress;
1068
+
1069
+ });
1070
+ parcelRegister("1ddtH", function(module, exports) {
1071
+
1072
+ $parcel$export(module.exports, "default", () => $d97c62c8221704ca$export$2e2bcd8739ae039);
1073
+
1074
+
1075
+
1076
+ var $ahoAn = parcelRequire("ahoAn");
1077
+ const $d97c62c8221704ca$var$ShowPhoneNumber = ({ phoneNumber: phoneNumber })=>{
1078
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1079
+ className: "rf-px-5 rf-py-3 rf-mb-8 rf-flex rf-flex-row rf-items-center rf-font-bold",
1080
+ children: [
1081
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $ahoAn.PhoneIcon), {
1082
+ className: "rf-h-6 rf-w-6 ltr:rf-mr-2 rtl:rf-ml-2"
1083
+ }),
1084
+ phoneNumber
1085
+ ]
1086
+ });
1087
+ };
1088
+ var $d97c62c8221704ca$export$2e2bcd8739ae039 = $d97c62c8221704ca$var$ShowPhoneNumber;
1089
+
1090
+ });
1091
+
1092
+ parcelRegister("bjmYU", function(module, exports) {
1093
+
1094
+ $parcel$export(module.exports, "default", () => $92c294d459a1b852$export$2e2bcd8739ae039);
1095
+
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+ var $k60DH = parcelRequire("k60DH");
1102
+
1103
+ var $2fuDN = parcelRequire("2fuDN");
1104
+
1105
+ var $1x02c = parcelRequire("1x02c");
1106
+
1107
+ var $19XSr = parcelRequire("19XSr");
1108
+
1109
+ var $7pypd = parcelRequire("7pypd");
1110
+
1111
+ var $gKuDZ = parcelRequire("gKuDZ");
1112
+
1113
+ var $kCve4 = parcelRequire("kCve4");
1114
+
1115
+ var $3mANd = parcelRequire("3mANd");
1116
+
1117
+ var $g3FET = parcelRequire("g3FET");
1118
+
1119
+ var $ahoAn = parcelRequire("ahoAn");
1120
+ const $92c294d459a1b852$var$userIcon = (0, $dAxr5$leaflet).icon({
1121
+ iconUrl: `${(0, $19XSr.imageFiles).mapDeparture}`,
1122
+ shadowUrl: (0, $k60DH.markerShadow),
1123
+ iconSize: [
1124
+ 32,
1125
+ 41
1126
+ ],
1127
+ iconAnchor: [
1128
+ 16,
1129
+ 41
1130
+ ]
1131
+ });
1132
+ const $92c294d459a1b852$var$springDuration = 500;
1133
+ const $92c294d459a1b852$var$Map = ({ latitude: latitude, longitude: longitude, color: color })=>{
1134
+ const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
1135
+ const locale = (0, $2fuDN.useLocaleStore)((state)=>state.locale);
1136
+ const configuration = (0, $1x02c.useRetorikStore)((state)=>state.configuration);
1137
+ const [mapLayerData, setMapLayerData] = (0, $dAxr5$useState)(undefined);
1138
+ const geoJsonLayer = (0, $dAxr5$useRef)(null);
1139
+ const coordinates = configuration.position?.latitude && configuration.position?.longitude ? [
1140
+ [
1141
+ configuration.position.longitude,
1142
+ configuration.position.latitude
1143
+ ],
1144
+ [
1145
+ longitude,
1146
+ latitude
1147
+ ]
1148
+ ] : undefined;
1149
+ const [qrCodeUrl, setQrCodeUrl] = (0, $dAxr5$useState)();
1150
+ const fadeInTimerRef = (0, $dAxr5$useRef)(null);
1151
+ const [spring, api] = (0, $dAxr5$useSpring)(()=>({
1152
+ from: {
1153
+ opacity: 0
1154
+ }
1155
+ }));
1156
+ (0, $dAxr5$useEffect)(()=>{
1157
+ if (geoJsonLayer.current) mapLayerData && geoJsonLayer.current.clearLayers().addData(mapLayerData);
1158
+ }, [
1159
+ mapLayerData
1160
+ ]);
1161
+ (0, $dAxr5$useEffect)(()=>{
1162
+ qrCodeUrl && api.start({
1163
+ from: {
1164
+ opacity: 0
1165
+ },
1166
+ to: {
1167
+ opacity: 1
1168
+ },
1169
+ config: {
1170
+ duration: $92c294d459a1b852$var$springDuration
1171
+ }
1172
+ });
1173
+ return ()=>{
1174
+ fadeInTimerRef?.current && clearTimeout(fadeInTimerRef.current);
1175
+ };
1176
+ }, [
1177
+ qrCodeUrl
1178
+ ]);
1179
+ const handleCloseQrCode = ()=>{
1180
+ api.start({
1181
+ from: {
1182
+ opacity: 1
1183
+ },
1184
+ to: {
1185
+ opacity: 0
1186
+ },
1187
+ config: {
1188
+ duration: $92c294d459a1b852$var$springDuration
1189
+ }
1190
+ });
1191
+ fadeInTimerRef?.current && clearTimeout(fadeInTimerRef.current);
1192
+ fadeInTimerRef.current = setTimeout(()=>{
1193
+ setQrCodeUrl(null);
1194
+ }, $92c294d459a1b852$var$springDuration);
1195
+ };
1196
+ return /*#__PURE__*/ (0, $dAxr5$jsxs)((0, $dAxr5$react).Fragment, {
1197
+ children: [
1198
+ /*#__PURE__*/ (0, $dAxr5$jsxs)((0, $dAxr5$MapContainer), {
1199
+ center: [
1200
+ latitude,
1201
+ longitude
1202
+ ],
1203
+ zoom: 12,
1204
+ scrollWheelZoom: false,
1205
+ style: {
1206
+ height: '100%',
1207
+ width: '100%',
1208
+ zIndex: 0
1209
+ },
1210
+ attributionControl: false,
1211
+ children: [
1212
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$TileLayer), {
1213
+ url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
1214
+ }),
1215
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$Marker), {
1216
+ position: [
1217
+ latitude,
1218
+ longitude
1219
+ ]
1220
+ }),
1221
+ configuration.position?.latitude && configuration.position?.longitude && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$Marker), {
1222
+ position: [
1223
+ configuration.position.latitude,
1224
+ configuration.position.longitude
1225
+ ],
1226
+ icon: $92c294d459a1b852$var$userIcon
1227
+ }),
1228
+ mapLayerData && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$GeoJSON), {
1229
+ ref: geoJsonLayer,
1230
+ data: mapLayerData
1231
+ }),
1232
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $kCve4.default), {
1233
+ configurationPosition: [
1234
+ configuration.position?.latitude || latitude,
1235
+ configuration.position?.longitude || longitude
1236
+ ],
1237
+ coordinates: [
1238
+ latitude,
1239
+ longitude
1240
+ ],
1241
+ data: mapLayerData
1242
+ })
1243
+ ]
1244
+ }),
1245
+ coordinates && /*#__PURE__*/ (0, $dAxr5$jsx)((0, $gKuDZ.default), {
1246
+ coordinates: coordinates,
1247
+ setMapLayerData: setMapLayerData,
1248
+ color: color,
1249
+ setQrCodeUrl: setQrCodeUrl
1250
+ }),
1251
+ qrCodeUrl && /*#__PURE__*/ (0, $dAxr5$jsxs)((0, $dAxr5$animated).div, {
1252
+ className: "rf-absolute rf-h-full rf-w-full rf-top-0 rf-left-0 rf-z-ui rf-flex rf-flex-col rf-justify-center rf-items-center rf-gap-4 rf-text-truewhite",
1253
+ style: {
1254
+ background: 'rgba(18,18,18,0.7)',
1255
+ ...spring
1256
+ },
1257
+ children: [
1258
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $g3FET.default), {
1259
+ onClick: handleCloseQrCode,
1260
+ showLabel: false
1261
+ }),
1262
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1263
+ className: "rf-flex rf-flex-row rf-items-start rf-gap-1 rf-text-truewhite rf-italic",
1264
+ children: [
1265
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $ahoAn.RoundIcon), {
1266
+ className: "rf-h-4 rf-mt-[0.2rem]",
1267
+ color: "#FFF"
1268
+ }),
1269
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1270
+ className: "rf-w-fit rf-flex rf-flex-col rf-items-center",
1271
+ children: [
1272
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1273
+ children: (0, $7pypd.capitalizeFirstLetter)(translation.poi.openroutemobile, locale)
1274
+ }),
1275
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1276
+ children: translation.link.scanQR
1277
+ })
1278
+ ]
1279
+ })
1280
+ ]
1281
+ }),
1282
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $3mANd.default), {
1283
+ src: qrCodeUrl
1284
+ })
1285
+ ]
1286
+ })
1287
+ ]
1288
+ });
1289
+ };
1290
+ var $92c294d459a1b852$export$2e2bcd8739ae039 = $92c294d459a1b852$var$Map;
1291
+
1292
+ });
1293
+ parcelRegister("gKuDZ", function(module, exports) {
1294
+
1295
+ $parcel$export(module.exports, "default", () => $2bfd7077628948bb$export$2e2bcd8739ae039);
1296
+
1297
+
1298
+
1299
+
1300
+ var $2fuDN = parcelRequire("2fuDN");
1301
+
1302
+ var $1x02c = parcelRequire("1x02c");
1303
+
1304
+ var $cT90l = parcelRequire("cT90l");
1305
+
1306
+ var $7pypd = parcelRequire("7pypd");
1307
+
1308
+ var $6w54h = parcelRequire("6w54h");
1309
+ parcelRequire("aPU1T");
1310
+ var $cOucF = parcelRequire("cOucF");
1311
+ const $2bfd7077628948bb$var$Routes = ({ coordinates: coordinates, setMapLayerData: setMapLayerData, color: color, setQrCodeUrl: setQrCodeUrl })=>{
1312
+ const translation = (0, $2fuDN.useLocaleStore)((state)=>state.currentTranslations);
1313
+ const locale = (0, $2fuDN.useLocaleStore)((state)=>state.locale);
1314
+ const isUsedOnBorne = (0, $1x02c.useRetorikStore)((state)=>state.configuration.isUsedOnBorne);
1315
+ const [drivingCar, setDrivingCar] = (0, $dAxr5$useState)(undefined);
1316
+ const [cyclingRegular, setCyclingRegular] = (0, $dAxr5$useState)(undefined);
1317
+ const [footWalking, setFootWalking] = (0, $dAxr5$useState)(undefined);
1318
+ const [currentChosen, setCurrentChosen] = (0, $dAxr5$useState)(undefined);
1319
+ const travelModeRef = (0, $dAxr5$useRef)();
1320
+ /**
1321
+ * On component mount :
1322
+ * - call methods to retrieve data from openroute API
1323
+ */ (0, $dAxr5$useEffect)(()=>{
1324
+ calculateForProfile('driving-car');
1325
+ calculateForProfile('cycling-regular');
1326
+ calculateForProfile('foot-walking');
1327
+ }, []);
1328
+ /**
1329
+ * On currentChosen state change :
1330
+ * - switch on currentChosen value to display the associated data on the map
1331
+ */ (0, $dAxr5$useEffect)(()=>{
1332
+ switch(currentChosen){
1333
+ case 'drivingCar':
1334
+ drivingCar && drivingCar.features && setMapLayerData(drivingCar);
1335
+ travelModeRef.current = 'driving';
1336
+ break;
1337
+ case 'cyclingRegular':
1338
+ cyclingRegular && cyclingRegular.features && setMapLayerData(cyclingRegular);
1339
+ travelModeRef.current = 'bicycling';
1340
+ break;
1341
+ case 'footWalking':
1342
+ footWalking && footWalking.features && setMapLayerData(footWalking);
1343
+ travelModeRef.current = 'walking';
1344
+ break;
1345
+ default:
1346
+ break;
1347
+ }
1348
+ }, [
1349
+ currentChosen
1350
+ ]);
1351
+ /**
1352
+ * On drivingCar state change :
1353
+ * - if driving car data were retrieved and no course has been chosen, set currentChosen state to 'driving-car'
1354
+ */ (0, $dAxr5$useEffect)(()=>{
1355
+ drivingCar && !currentChosen && setCurrentChosen('drivingCar');
1356
+ }, [
1357
+ drivingCar
1358
+ ]);
1359
+ /**
1360
+ * On call :
1361
+ * - call the openroute API to retrieve data for the current course
1362
+ * @param profile : string
1363
+ */ const calculateForProfile = async (profile)=>{
1364
+ const url = `${(0, $cT90l.openRoute)}/${profile}/geojson`;
1365
+ const data = await fetch(url, {
1366
+ method: 'POST',
1367
+ headers: {
1368
+ Authorization: (0, $cT90l.openRouteAPIKey),
1369
+ 'Content-Type': 'application/json'
1370
+ },
1371
+ body: JSON.stringify({
1372
+ coordinates: coordinates
1373
+ })
1374
+ }).then((result)=>{
1375
+ return result.json();
1376
+ }).catch(()=>{
1377
+ return null;
1378
+ });
1379
+ if (data && !data.error) switch(profile){
1380
+ case 'driving-car':
1381
+ setDrivingCar(data);
1382
+ break;
1383
+ case 'cycling-regular':
1384
+ setCyclingRegular(data);
1385
+ break;
1386
+ case 'foot-walking':
1387
+ setFootWalking(data);
1388
+ break;
1389
+ default:
1390
+ break;
1391
+ }
1392
+ };
1393
+ const handleClick = async ()=>{
1394
+ if (travelModeRef?.current && coordinates.length === 2) {
1395
+ // Create an URL to Google Maps with coordinates and travelling mode
1396
+ const coordinatesInUrl = `origin=${coordinates[0][1]},${coordinates[0][0]}&destination=${coordinates[1][1]},${coordinates[1][0]}`;
1397
+ const fullUrl = `${(0, $cT90l.googleMapsAddress)}${coordinatesInUrl}&travelmode=${travelModeRef.current}`;
1398
+ if (isUsedOnBorne) {
1399
+ const url = await (0, $dAxr5$qrcode).toDataURL(fullUrl);
1400
+ setQrCodeUrl(url);
1401
+ } else // If we are not on a borne, open a new tab in browser
1402
+ window.open(fullUrl, '_blank');
1403
+ }
1404
+ };
1405
+ return drivingCar || cyclingRegular || footWalking ? /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1406
+ className: "rf-absolute rf-bottom-2 rf-w-full rf-flex rf-flex-row rf-gap-4 rf-justify-center",
1407
+ children: [
1408
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1409
+ className: "rf-grid rf-grid-cols-routes rf-pl-6 rf-pr-4 rf-py-2 rf-gap-4 rf-rounded-lg rf-bg-truewhite ltr:rf-text-xs rtl:rf-text-arabic large:rf-text-sm rf-shadow-[0_6px_6px_#00000029]",
1410
+ children: [
1411
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $6w54h.default), {
1412
+ summary: {
1413
+ type: 'drivingCar',
1414
+ distance: drivingCar?.features?.length ? drivingCar.features[0].properties?.summary?.distance : undefined,
1415
+ duration: drivingCar?.features?.length ? drivingCar.features[0].properties?.summary?.duration : undefined
1416
+ },
1417
+ chosen: currentChosen === 'drivingCar',
1418
+ color: color,
1419
+ onClick: setCurrentChosen
1420
+ }),
1421
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $6w54h.default), {
1422
+ summary: {
1423
+ type: 'cyclingRegular',
1424
+ distance: cyclingRegular?.features?.length ? cyclingRegular.features[0].properties?.summary?.distance : undefined,
1425
+ duration: cyclingRegular?.features?.length ? cyclingRegular.features[0].properties?.summary?.duration : undefined
1426
+ },
1427
+ chosen: currentChosen === 'cyclingRegular',
1428
+ color: color,
1429
+ onClick: setCurrentChosen
1430
+ }),
1431
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $6w54h.default), {
1432
+ summary: {
1433
+ type: 'footWalking',
1434
+ distance: footWalking?.features?.length ? footWalking.features[0].properties?.summary?.distance : undefined,
1435
+ duration: footWalking?.features?.length ? footWalking.features[0].properties?.summary?.duration : undefined
1436
+ },
1437
+ chosen: currentChosen === 'footWalking',
1438
+ color: color,
1439
+ onClick: setCurrentChosen
1440
+ })
1441
+ ]
1442
+ }),
1443
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("button", {
1444
+ className: "rf-aspect-square rf-w-3/20 rf-min-w-3/20 rf-max-w-3/20 large:rf-w-1/8 large:rf-min-w-1/8 large:rf-max-w-1/8 rf-overflow-y-hidden rf-p-1 rf-flex rf-flex-col rf-justify-evenly rf-items-center rf-border-2 rf-border-trueblack rf-rounded-lg rf-font-bold ltr:rf-text-xs rtl:rf-text-arabic large:rf-text-sm rf-bg-truewhite",
1445
+ onClick: handleClick,
1446
+ children: [
1447
+ /*#__PURE__*/ (0, $dAxr5$jsx)((0, $cOucF.default), {
1448
+ className: "rf-w-5 rf-h-5"
1449
+ }),
1450
+ (0, $7pypd.capitalizeFirstLetter)(translation.poi.route, locale)
1451
+ ]
1452
+ })
1453
+ ]
1454
+ }) : /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$react).Fragment, {});
1455
+ };
1456
+ var $2bfd7077628948bb$export$2e2bcd8739ae039 = $2bfd7077628948bb$var$Routes;
1457
+
1458
+ });
1459
+ parcelRegister("6w54h", function(module, exports) {
1460
+
1461
+ $parcel$export(module.exports, "default", () => $73226df1b7e0cbd3$export$2e2bcd8739ae039);
1462
+
1463
+
1464
+
1465
+ var $42lgr = parcelRequire("42lgr");
1466
+
1467
+ var $bdZ4o = parcelRequire("bdZ4o");
1468
+ parcelRequire("aPU1T");
1469
+ var $3YbaS = parcelRequire("3YbaS");
1470
+ var $jQTJz = parcelRequire("jQTJz");
1471
+ var $9bGh7 = parcelRequire("9bGh7");
1472
+ var $gx25q = parcelRequire("gx25q");
1473
+ const $73226df1b7e0cbd3$var$RoutesItem = ({ summary: summary, chosen: chosen, color: color, onClick: onClick })=>{
1474
+ return /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1475
+ className: "rf-flex rf-flex-col rf-justify-end hover:rf-cursor-pointer",
1476
+ onClick: ()=>onClick(summary.type),
1477
+ children: /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1478
+ className: "rf-h-full rf-flex rf-flex-row rf-gap-3 rf-items-center",
1479
+ children: [
1480
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1481
+ className: "rf-relative rf-flex rf-justify-center rf-items-center",
1482
+ children: [
1483
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1484
+ className: "rf-absolute rf-w-9 rf-h-9 rf-rounded-max",
1485
+ style: {
1486
+ backgroundColor: chosen ? color : '#EFEDF0'
1487
+ }
1488
+ }),
1489
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1490
+ className: "rf-absolute rf-w-full -rf-top-[1.15rem] rf-flex rf-justify-center",
1491
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)($gx25q.default, {
1492
+ className: "rf-w-2 rf-h-2",
1493
+ color: chosen ? color : 'transparent'
1494
+ })
1495
+ }),
1496
+ summary.type === 'drivingCar' && /*#__PURE__*/ (0, $dAxr5$jsx)($jQTJz.default, {
1497
+ className: "rf-w-5 rf-z-util",
1498
+ color: chosen ? '#FFF' : '#535252'
1499
+ }),
1500
+ summary.type === 'cyclingRegular' && /*#__PURE__*/ (0, $dAxr5$jsx)($3YbaS.default, {
1501
+ className: "rf-w-6 rf-z-util",
1502
+ color: chosen ? '#FFF' : '#535252'
1503
+ }),
1504
+ summary.type === 'footWalking' && /*#__PURE__*/ (0, $dAxr5$jsx)($9bGh7.default, {
1505
+ className: "rf-w-6 rf-z-util",
1506
+ color: chosen ? '#FFF' : '#535252'
1507
+ })
1508
+ ]
1509
+ }),
1510
+ /*#__PURE__*/ (0, $dAxr5$jsxs)("div", {
1511
+ className: "rf-flex rf-flex-col rf-justify-center rf-items-start",
1512
+ children: [
1513
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1514
+ className: "rf-whitespace-nowrap rf-font-bold",
1515
+ children: (0, $bdZ4o.default)(summary?.duration)
1516
+ }),
1517
+ /*#__PURE__*/ (0, $dAxr5$jsx)("div", {
1518
+ className: "rf-whitespace-nowrap",
1519
+ children: (0, $42lgr.default)(summary?.distance)
1520
+ })
1521
+ ]
1522
+ })
1523
+ ]
1524
+ })
1525
+ });
1526
+ };
1527
+ var $73226df1b7e0cbd3$export$2e2bcd8739ae039 = $73226df1b7e0cbd3$var$RoutesItem;
1528
+
1529
+ });
1530
+ parcelRegister("42lgr", function(module, exports) {
1531
+
1532
+ $parcel$export(module.exports, "default", () => $b4e82336f5bf7a80$export$2e2bcd8739ae039);
1533
+ const $b4e82336f5bf7a80$var$getDistanceAsString = (distance)=>{
1534
+ if (typeof distance !== 'number') return 'NC';
1535
+ if (distance <= 0) return '0 m';
1536
+ if (distance < 1) return `${distance * 100} cm`;
1537
+ if (distance < 1000) return `${distance} m`;
1538
+ if (distance >= 1000) return `${Math.ceil(distance / 1000) * 10 / 10} km`;
1539
+ return 'NC';
1540
+ };
1541
+ var $b4e82336f5bf7a80$export$2e2bcd8739ae039 = $b4e82336f5bf7a80$var$getDistanceAsString;
1542
+
1543
+ });
1544
+
1545
+ parcelRegister("bdZ4o", function(module, exports) {
1546
+
1547
+ $parcel$export(module.exports, "default", () => $842140d848c8ecfc$export$2e2bcd8739ae039);
1548
+ const $842140d848c8ecfc$var$getTimeAsString = (time)=>{
1549
+ if (typeof time !== 'number') return 'NC';
1550
+ if (time < 1) return 'NC';
1551
+ if (time < 60) return `${time} s`;
1552
+ if (time < 3600) return `${Math.ceil(time / 60)} min`;
1553
+ if (time === 3600) return `1 h`;
1554
+ if (time > 3600) {
1555
+ const hours = Math.floor(time / 3600);
1556
+ const minutes = Math.ceil((time - hours * 3600) / 60);
1557
+ return `${hours} h ${minutes === 60 ? 59 : minutes < 10 ? `0${minutes}` : minutes}`;
1558
+ }
1559
+ return 'NC';
1560
+ };
1561
+ var $842140d848c8ecfc$export$2e2bcd8739ae039 = $842140d848c8ecfc$var$getTimeAsString;
1562
+
1563
+ });
1564
+
1565
+ parcelRegister("aPU1T", function(module, exports) {
1566
+
1567
+ $parcel$export(module.exports, "CyclingRegularIcon", () => (parcelRequire("3YbaS")).default);
1568
+ $parcel$export(module.exports, "DrivingCarIcon", () => (parcelRequire("jQTJz")).default);
1569
+ $parcel$export(module.exports, "FootWalkingIcon", () => (parcelRequire("9bGh7")).default);
1570
+ $parcel$export(module.exports, "OpenLocationIcon", () => (parcelRequire("cOucF")).default);
1571
+ $parcel$export(module.exports, "TriangleIcon", () => (parcelRequire("gx25q")).default);
1572
+
1573
+ var $3YbaS = parcelRequire("3YbaS");
1574
+
1575
+ var $jQTJz = parcelRequire("jQTJz");
1576
+
1577
+ var $9bGh7 = parcelRequire("9bGh7");
1578
+
1579
+ var $cOucF = parcelRequire("cOucF");
1580
+
1581
+ var $gx25q = parcelRequire("gx25q");
1582
+
1583
+ });
1584
+ parcelRegister("3YbaS", function(module, exports) {
1585
+
1586
+ $parcel$export(module.exports, "default", () => $0bb82b96a76b574f$export$2e2bcd8739ae039);
1587
+
1588
+
1589
+ const $0bb82b96a76b574f$var$CyclingRegularIcon = ({ className: className, color: color })=>{
1590
+ return /*#__PURE__*/ (0, $dAxr5$jsx)("svg", {
1591
+ xmlns: "http://www.w3.org/2000/svg",
1592
+ viewBox: "0 0 34.168 29.135",
1593
+ className: className || 'rf-w-8 rf-h-8',
1594
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)("g", {
1595
+ transform: "translate(0.5 -1.484)",
1596
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)("path", {
1597
+ d: "M20.5,6.789a2.645,2.645,0,1,0-2.645-2.645A2.653,2.653,0,0,0,20.5,6.789Zm-13.885,8.6a6.612,6.612,0,1,0,0,13.224,6.612,6.612,0,1,0,0-13.224Zm0,11.24a4.628,4.628,0,1,1,0-9.257,4.628,4.628,0,1,1,0,9.257ZM14.282,13.4l3.174-3.174,1.058,1.058a9.264,9.264,0,0,0,6.744,2.777V11.418A6.57,6.57,0,0,1,20.5,9.434L17.984,6.922a3.242,3.242,0,0,0-2.116-.793,2.219,2.219,0,0,0-1.851.793l-3.7,3.7a2.611,2.611,0,0,0-.793,1.851,2.219,2.219,0,0,0,.793,1.851l4.232,3.7v6.612h2.645v-8.2Zm10.843,1.984A6.612,6.612,0,1,0,31.737,22,6.548,6.548,0,0,0,25.125,15.385Zm0,11.24A4.628,4.628,0,1,1,29.753,22,4.685,4.685,0,0,1,25.125,26.625Z",
1598
+ transform: "translate(0 0.484)",
1599
+ fill: color || '#fff'
1600
+ })
1601
+ })
1602
+ });
1603
+ };
1604
+ var $0bb82b96a76b574f$export$2e2bcd8739ae039 = $0bb82b96a76b574f$var$CyclingRegularIcon;
1605
+
1606
+ });
1607
+
1608
+ parcelRegister("jQTJz", function(module, exports) {
1609
+
1610
+ $parcel$export(module.exports, "default", () => $d8c56675e68c7d4c$export$2e2bcd8739ae039);
1611
+
1612
+
1613
+ const $d8c56675e68c7d4c$var$DrivingCarIcon = ({ className: className, color: color })=>{
1614
+ return /*#__PURE__*/ (0, $dAxr5$jsx)("svg", {
1615
+ xmlns: "http://www.w3.org/2000/svg",
1616
+ viewBox: "0 0 34.168 29.135",
1617
+ className: className || 'rf-w-8 rf-h-8',
1618
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)("path", {
1619
+ id: "car",
1620
+ d: "M32.385,71.254H28.507L27.43,68.559A7.217,7.217,0,0,0,20.7,64H12.471a7.219,7.219,0,0,0-6.735,4.559L4.658,71.254H.781a.777.777,0,0,0-.754.966l.389,1.554a.777.777,0,0,0,.754.589h1.3a4.116,4.116,0,0,0-1.43,3.109V80.58A4.111,4.111,0,0,0,2.076,83.3v3.5a2.073,2.073,0,0,0,2.072,2.072H6.221A2.073,2.073,0,0,0,8.293,86.8V84.725h16.58V86.8a2.073,2.073,0,0,0,2.072,2.072h2.072A2.073,2.073,0,0,0,31.09,86.8V83.3a4.109,4.109,0,0,0,1.036-2.716V77.471A4.118,4.118,0,0,0,30.7,74.362H32a.777.777,0,0,0,.754-.589l.389-1.554a.778.778,0,0,0-.754-.966ZM9.584,70.1a3.109,3.109,0,0,1,2.887-1.954H20.7A3.109,3.109,0,0,1,23.582,70.1l1.291,3.227H8.293ZM6.221,80.567a2.066,2.066,0,1,1,0-4.132,3.987,3.987,0,0,1,3.109,3.1c0,1.24-1.865,1.033-3.109,1.033Zm20.725,0c-1.243,0-3.109.207-3.109-1.033a3.987,3.987,0,0,1,3.109-3.1,2.066,2.066,0,1,1,0,4.132Z",
1621
+ transform: "translate(0.501 -63.5)",
1622
+ fill: color || '#fff'
1623
+ })
1624
+ });
1625
+ };
1626
+ var $d8c56675e68c7d4c$export$2e2bcd8739ae039 = $d8c56675e68c7d4c$var$DrivingCarIcon;
1627
+
1628
+ });
1629
+
1630
+ parcelRegister("9bGh7", function(module, exports) {
1631
+
1632
+ $parcel$export(module.exports, "default", () => $a1224a7385dee619$export$2e2bcd8739ae039);
1633
+
1634
+
1635
+ const $a1224a7385dee619$var$FootWalkingIcon = ({ className: className, color: color })=>{
1636
+ return /*#__PURE__*/ (0, $dAxr5$jsx)("svg", {
1637
+ xmlns: "http://www.w3.org/2000/svg",
1638
+ viewBox: "-6 0 34.168 29.135",
1639
+ className: className || 'rf-w-8 rf-h-8',
1640
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)("path", {
1641
+ d: "M11.4,5.249A2.625,2.625,0,1,0,8.772,2.625,2.625,2.625,0,0,0,11.4,5.249ZM16.564,13.4l-1.274-.645-.53-1.608A5.962,5.962,0,0,0,9.171,7c-1.968-.005-3.057.552-5.1,1.378A5.216,5.216,0,0,0,1.352,10.9l-.366.744a1.755,1.755,0,0,0,.776,2.346,1.726,1.726,0,0,0,2.324-.782l.366-.744a1.738,1.738,0,0,1,.9-.842l1.465-.591-.831,3.319A3.512,3.512,0,0,0,6.8,17.568l3.275,3.576a3.529,3.529,0,0,1,.815,1.515l1,4.008a1.75,1.75,0,0,0,3.4-.848l-1.214-4.866a3.5,3.5,0,0,0-.815-1.515l-2.488-2.718.94-3.756.3.9a3.487,3.487,0,0,0,1.733,2.023l1.274.645a1.726,1.726,0,0,0,2.324-.782,1.77,1.77,0,0,0-.782-2.351ZM4.048,21.1a3.393,3.393,0,0,1-.776,1.176L.538,25.01a1.75,1.75,0,1,0,2.472,2.477l3.248-3.248a3.554,3.554,0,0,0,.776-1.176l.738-1.848c-3.024-3.3-2.116-2.286-2.592-2.936L4.048,21.1Z",
1642
+ transform: "translate(0.612 0.5)",
1643
+ fill: color || '#fff'
1644
+ })
1645
+ });
1646
+ };
1647
+ var $a1224a7385dee619$export$2e2bcd8739ae039 = $a1224a7385dee619$var$FootWalkingIcon;
1648
+
1649
+ });
1650
+
1651
+ parcelRegister("cOucF", function(module, exports) {
1652
+
1653
+ $parcel$export(module.exports, "default", () => $f8052404600c8406$export$2e2bcd8739ae039);
1654
+
1655
+
1656
+ const $f8052404600c8406$var$OpenLocationIcon = ({ className: className })=>{
1657
+ return /*#__PURE__*/ (0, $dAxr5$jsx)("svg", {
1658
+ xmlns: "http://www.w3.org/2000/svg",
1659
+ viewBox: "0 0 29.771 29.771",
1660
+ className: className || 'rf-w-6 rf-h-6',
1661
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)("path", {
1662
+ d: "M29.771,0,0,14.886l11.164,3.721,3.721,11.164Z"
1663
+ })
1664
+ });
1665
+ };
1666
+ var $f8052404600c8406$export$2e2bcd8739ae039 = $f8052404600c8406$var$OpenLocationIcon;
1667
+
1668
+ });
1669
+
1670
+ parcelRegister("gx25q", function(module, exports) {
1671
+
1672
+ $parcel$export(module.exports, "default", () => $b3f74f9fd2ac5169$export$2e2bcd8739ae039);
1673
+
1674
+
1675
+ const $b3f74f9fd2ac5169$var$TriangleIcon = ({ className: className, color: color })=>{
1676
+ return /*#__PURE__*/ (0, $dAxr5$jsx)("svg", {
1677
+ xmlns: "http://www.w3.org/2000/svg",
1678
+ viewBox: "0 0 16 12",
1679
+ className: className || 'rf-w-3 rf-h-3',
1680
+ children: /*#__PURE__*/ (0, $dAxr5$jsx)("path", {
1681
+ d: "M6.336,2.5a2,2,0,0,1,3.328,0l4.263,6.394A2,2,0,0,1,12.263,12H3.737A2,2,0,0,1,2.073,8.891Z",
1682
+ fill: color || 'transparent'
1683
+ })
1684
+ });
1685
+ };
1686
+ var $b3f74f9fd2ac5169$export$2e2bcd8739ae039 = $b3f74f9fd2ac5169$var$TriangleIcon;
1687
+
1688
+ });
1689
+
1690
+
1691
+
1692
+
1693
+ parcelRegister("kCve4", function(module, exports) {
1694
+
1695
+ $parcel$export(module.exports, "default", () => $9333337694b0d9a4$export$2e2bcd8739ae039);
1696
+
1697
+
1698
+
1699
+ const $9333337694b0d9a4$var$MapUser = ({ configurationPosition: configurationPosition, coordinates: coordinates, data: data })=>{
1700
+ const map = (0, $dAxr5$useMap)();
1701
+ (0, $dAxr5$useEffect)(()=>{
1702
+ if (configurationPosition !== coordinates) {
1703
+ const coords1 = [
1704
+ ...configurationPosition
1705
+ ];
1706
+ const coords2 = [
1707
+ ...coordinates
1708
+ ];
1709
+ if (configurationPosition[0] > coordinates[0]) coords2[0] -= (configurationPosition[0] - coordinates[0]) / 2;
1710
+ else coords1[0] -= (coordinates[0] - configurationPosition[0]) / 2;
1711
+ map.flyToBounds([
1712
+ coords1,
1713
+ coords2
1714
+ ]);
1715
+ } else map.flyToBounds([
1716
+ configurationPosition,
1717
+ coordinates
1718
+ ]);
1719
+ }, [
1720
+ data
1721
+ ]);
1722
+ return /*#__PURE__*/ (0, $dAxr5$jsx)((0, $dAxr5$react).Fragment, {});
1723
+ };
1724
+ var $9333337694b0d9a4$export$2e2bcd8739ae039 = $9333337694b0d9a4$var$MapUser;
1725
+
1726
+ });
1727
+
1728
+
1729
+
1730
+
1731
+
1732
+ //# sourceMappingURL=AttachmentDetail.c6c297df.js.map