@anker-in/ui 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,18 +4,17 @@ var React2 = require('react');
4
4
  var clsx = require('clsx');
5
5
  var tailwindMerge = require('tailwind-merge');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
- var headlessUi = require('@anker-in/headless-ui');
8
7
  var IndexBar = require('antd-mobile/es/components/index-bar');
9
8
  var List = require('antd-mobile/es/components/list');
10
9
  require('antd-mobile/es/components/index-bar/index-bar.css');
11
10
  require('antd-mobile/es/components/list/list.css');
12
- var react = require('swiper/react');
13
11
  var dayjs = require('dayjs');
14
12
  require('dayjs/locale/zh-cn');
15
13
  var antd = require('antd');
16
14
  var dayLocaleData = require('dayjs/plugin/localeData');
17
15
  var weekday = require('dayjs/plugin/weekday');
18
16
  var weekOfYear = require('dayjs/plugin/weekOfYear');
17
+ var react = require('swiper/react');
19
18
 
20
19
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
21
20
 
@@ -36,158 +35,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
36
35
  function cn(...inputs) {
37
36
  return tailwindMerge.twMerge(clsx.clsx(inputs));
38
37
  }
39
- var defaultTabs = [
40
- { id: "upcoming-events", label: "Upcoming Events" },
41
- { id: "find-demoroom", label: "Find Demoroom" },
42
- { id: "4-easy-steps", label: "4 Easy Steps" },
43
- { id: "faq", label: "FAQ" }
44
- ];
45
- var HelpNav = ({
46
- tabs = defaultTabs,
47
- activeTabId: controlledActiveTabId,
48
- onTabChange,
49
- activeBorderColor = "#3ADB67",
50
- className,
51
- ...props
52
- }) => {
53
- const [internalActiveTabId, setInternalActiveTabId] = React2.useState(
54
- tabs[1]?.id || tabs[0]?.id
55
- );
56
- const activeTabId = controlledActiveTabId ?? internalActiveTabId;
57
- const handleTabClick = (tabId) => {
58
- if (!controlledActiveTabId) {
59
- setInternalActiveTabId(tabId);
60
- }
61
- onTabChange?.(tabId);
62
- };
63
- return /* @__PURE__ */ jsxRuntime.jsx(
64
- "div",
65
- {
66
- className: cn(
67
- "w-full pt-5 flex items-center justify-center gap-8 pb-8",
68
- className
69
- ),
70
- ...props,
71
- children: tabs.map((tab) => {
72
- const isActive = tab.id === activeTabId;
73
- return /* @__PURE__ */ jsxRuntime.jsxs(
74
- "button",
75
- {
76
- onClick: () => handleTabClick(tab.id),
77
- className: cn(
78
- "relative text-[#080A0F]",
79
- "pb-4",
80
- "flex items-center gap-2",
81
- "transition-all duration-200",
82
- "outline-none focus:outline-none"
83
- ),
84
- style: {
85
- fontSize: "18px",
86
- fontWeight: 600,
87
- letterSpacing: "-0.36px",
88
- lineHeight: "25.2px"
89
- },
90
- children: [
91
- tab.label,
92
- isActive && /* @__PURE__ */ jsxRuntime.jsx(
93
- "span",
94
- {
95
- className: "absolute bottom-0 left-0 right-0 h-1 rounded-t",
96
- style: {
97
- backgroundColor: activeBorderColor,
98
- height: "4px"
99
- }
100
- }
101
- )
102
- ]
103
- },
104
- tab.id
105
- );
106
- })
107
- }
108
- );
109
- };
110
- HelpNav.displayName = "HelpNav";
111
- var EventCard = ({
112
- title,
113
- description,
114
- backgroundImage,
115
- aspectRatio,
116
- variant = "medium",
117
- buttons = [],
118
- subtitle,
119
- className,
120
- ...props
121
- }) => {
122
- const isLarge = variant === "large";
123
- const isMedium = variant === "medium";
124
- const isProduct = variant === "product";
125
- return /* @__PURE__ */ jsxRuntime.jsx(
126
- "div",
127
- {
128
- className: cn("rounded-3xl overflow-hidden relative", className),
129
- style: {
130
- backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
131
- backgroundSize: "cover",
132
- backgroundPosition: "center",
133
- aspectRatio
134
- },
135
- ...props,
136
- children: /* @__PURE__ */ jsxRuntime.jsxs(
137
- "div",
138
- {
139
- className: cn(
140
- "relative h-full flex flex-col",
141
- isLarge && "justify-center pl-8",
142
- !isLarge && "justify-end pl-8 pb-8"
143
- ),
144
- children: [
145
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
146
- /* @__PURE__ */ jsxRuntime.jsx(
147
- "h3",
148
- {
149
- className: cn(
150
- "font-semibold mb-3",
151
- isLarge && "text-3xl text-gray-900",
152
- isMedium && "text-2xl text-white",
153
- isProduct && "text-2xl text-gray-900"
154
- ),
155
- children: title
156
- }
157
- ),
158
- subtitle && isProduct && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 mb-4", children: subtitle }),
159
- description && /* @__PURE__ */ jsxRuntime.jsx(
160
- "p",
161
- {
162
- className: cn(
163
- "text-sm leading-relaxed",
164
- isMedium && "text-white/90",
165
- (isLarge || isProduct) && "text-gray-600"
166
- ),
167
- children: description
168
- }
169
- )
170
- ] }),
171
- buttons.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-3 mt-6", children: buttons.map((button, index) => /* @__PURE__ */ jsxRuntime.jsx(
172
- "button",
173
- {
174
- onClick: button.onClick,
175
- className: cn(
176
- "px-6 py-3 rounded-full font-medium text-sm transition-all duration-200",
177
- button.variant === "primary" && "bg-gray-900 text-white hover:bg-gray-800",
178
- button.variant === "secondary" && "bg-white text-gray-900 border border-gray-300 hover:bg-gray-50"
179
- ),
180
- children: button.label
181
- },
182
- index
183
- )) })
184
- ]
185
- }
186
- )
187
- }
188
- );
189
- };
190
- EventCard.displayName = "EventCard";
191
38
  var Title = ({
192
39
  title = "",
193
40
  ...props
@@ -195,275 +42,6 @@ var Title = ({
195
42
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[48px] font-semibold mb-12 text-[#080A0F]", children: title }) });
196
43
  };
197
44
  Title.displayName = "Title";
198
- var defaultEvents = [
199
- {
200
- variant: "large",
201
- title: "IFA 2025 Event Name Event Name",
202
- description: "Corem ipsum dolor sit amet, consectetur adipiscing elit.",
203
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
204
- buttons: [
205
- {
206
- label: "Schedule Now",
207
- variant: "primary"
208
- }
209
- ],
210
- aspectRatio: "1664 / 640"
211
- },
212
- {
213
- variant: "medium",
214
- title: "Local Event Name Local Event Name Local Event Name",
215
- description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
216
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
217
- buttons: [
218
- {
219
- label: "Schedule Now",
220
- variant: "primary"
221
- }
222
- ],
223
- aspectRatio: "824 / 640"
224
- },
225
- {
226
- variant: "product",
227
- title: "Anker Prime",
228
- subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
229
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
230
- buttons: [
231
- {
232
- label: "Learn More",
233
- variant: "secondary"
234
- },
235
- {
236
- label: "Shop Now",
237
- variant: "primary"
238
- }
239
- ],
240
- aspectRatio: "824 / 640"
241
- },
242
- {
243
- variant: "medium",
244
- title: "Local Event Name Local Event Name Local Event Name",
245
- description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
246
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
247
- buttons: [
248
- {
249
- label: "Schedule Now",
250
- variant: "primary"
251
- }
252
- ],
253
- aspectRatio: "824 / 640"
254
- },
255
- {
256
- variant: "product",
257
- title: "Anker Prime",
258
- subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
259
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
260
- buttons: [
261
- {
262
- label: "Learn More",
263
- variant: "secondary"
264
- },
265
- {
266
- label: "Shop Now",
267
- variant: "primary"
268
- }
269
- ],
270
- aspectRatio: "824 / 640"
271
- }
272
- ];
273
- var UpcomingEvents = ({
274
- title = "Upcoming Events",
275
- events = defaultEvents,
276
- showViewMore = true,
277
- onViewMore,
278
- className,
279
- ...props
280
- }) => {
281
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), ...props, children: [
282
- /* @__PURE__ */ jsxRuntime.jsx(Title, { title }),
283
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-6 mb-[64px]", children: events.map((event, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(index === 0 ? "col-span-2" : ""), children: /* @__PURE__ */ jsxRuntime.jsx(EventCard, { ...event }) }, index)) }),
284
- showViewMore && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
285
- "button",
286
- {
287
- onClick: onViewMore,
288
- className: "inline-flex items-center gap-2 text-gray-700 hover:text-gray-900 transition-colors duration-200",
289
- children: [
290
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold", children: "View More" }),
291
- /* @__PURE__ */ jsxRuntime.jsx(
292
- "svg",
293
- {
294
- width: "16",
295
- height: "16",
296
- viewBox: "0 0 16 16",
297
- fill: "none",
298
- xmlns: "http://www.w3.org/2000/svg",
299
- className: "transition-transform duration-200 group-hover:translate-y-0.5",
300
- children: /* @__PURE__ */ jsxRuntime.jsx(
301
- "path",
302
- {
303
- d: "M8 3L8 13M8 13L12 9M8 13L4 9",
304
- stroke: "currentColor",
305
- strokeWidth: "2",
306
- strokeLinecap: "round",
307
- strokeLinejoin: "round"
308
- }
309
- )
310
- }
311
- )
312
- ]
313
- }
314
- ) })
315
- ] });
316
- };
317
- UpcomingEvents.displayName = "UpcomingEvents";
318
- var defaultBannerData = {
319
- title: "See it. Touch it. Make it Locally.",
320
- subTitle: "Visit your local studio right around the corner.",
321
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
322
- backgroundImageMobile: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
323
- };
324
- var Banner = ({
325
- data = defaultBannerData,
326
- className,
327
- style,
328
- ...props
329
- }) => {
330
- return /* @__PURE__ */ jsxRuntime.jsxs(
331
- "div",
332
- {
333
- className: cn("relative"),
334
- style: { aspectRatio: "1920/480", ...style },
335
- ...props,
336
- children: [
337
- data?.backgroundImage && /* @__PURE__ */ jsxRuntime.jsx(
338
- "img",
339
- {
340
- src: data.backgroundImage,
341
- alt: "",
342
- className: "inset-0 h-full w-full object-cover"
343
- }
344
- ),
345
- /* @__PURE__ */ jsxRuntime.jsxs(
346
- "div",
347
- {
348
- className: cn(
349
- "absolute flex flex-col gap-4 justify-center m-auto top-0 bottom-0 left-0 right-0 z-10",
350
- className
351
- ),
352
- children: [
353
- /* @__PURE__ */ jsxRuntime.jsx(
354
- headlessUi.Text,
355
- {
356
- className: "text-[48px] font-bold text-white leading-[1]",
357
- html: data?.title
358
- }
359
- ),
360
- /* @__PURE__ */ jsxRuntime.jsx(
361
- headlessUi.Text,
362
- {
363
- className: "text-[18px] font-bold text-white leading-[1.4]",
364
- html: data?.subTitle
365
- }
366
- )
367
- ]
368
- }
369
- )
370
- ]
371
- }
372
- );
373
- };
374
- Banner.displayName = "Banner";
375
- var BreadCrumbs = ({
376
- items,
377
- className,
378
- ...props
379
- }) => {
380
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center py-6 gap-1 text-[18px]", className), ...props, children: items?.map((item, i) => {
381
- const isLast = i === items?.length - 1;
382
- return /* @__PURE__ */ jsxRuntime.jsxs(
383
- headlessUi.Link,
384
- {
385
- className: cn(
386
- "flex items-center gap-1 text-[#6D6D6F] no-underline",
387
- isLast && "text-[#080A0F]",
388
- item?.link ? "cursor-pointer" : "cursor-default hover:text-[#080A0F]"
389
- ),
390
- href: item?.link,
391
- children: [
392
- item?.label,
393
- !isLast && /* @__PURE__ */ jsxRuntime.jsx("span", { children: "/" })
394
- ]
395
- },
396
- i
397
- );
398
- }) });
399
- };
400
- BreadCrumbs.displayName = "BreadCrumbs";
401
- var defaultSteps = [
402
- {
403
- stepNumber: 1,
404
- title: 'Find a demo room you would like to visit, and click "Schedule Now"',
405
- description: 'Find a demo room you would like to visit, and click "Schedule Now"',
406
- mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
407
- },
408
- {
409
- stepNumber: 2,
410
- title: "Fill out the form and confirm your time of visit",
411
- description: "Fill out the form and confirm your time of visit",
412
- mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
413
- },
414
- {
415
- stepNumber: 3,
416
- title: "Once you arrive at the demo room, scan the QR code to check in",
417
- description: "Once you arrive at the demo room, scan the QR code to check in",
418
- mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
419
- },
420
- {
421
- stepNumber: 4,
422
- title: "Have fun!",
423
- description: "Have fun!",
424
- mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
425
- }
426
- ];
427
- var EasySteps = ({
428
- title = "Schedule in 4 Easy Steps",
429
- steps = defaultSteps,
430
- className,
431
- ...props
432
- }) => {
433
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), ...props, children: [
434
- /* @__PURE__ */ jsxRuntime.jsx(Title, { title }),
435
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 md:grid-cols-2 gap-6", children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
436
- "div",
437
- {
438
- className: cn(
439
- "bg-white rounded-2xl overflow-hidden",
440
- "border border-gray-200",
441
- "hover:shadow-lg transition-shadow duration-200"
442
- ),
443
- children: [
444
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-6 pb-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
445
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-semibold text-gray-900", children: [
446
- "Step ",
447
- step.stepNumber,
448
- ":"
449
- ] }),
450
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-900 font-medium flex-1", children: step.title })
451
- ] }) }),
452
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full aspect-[356/220] bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(
453
- "img",
454
- {
455
- src: step.mapImage,
456
- alt: `Step ${step.stepNumber} - ${step.title}`,
457
- className: "w-full h-full object-cover"
458
- }
459
- ) })
460
- ]
461
- },
462
- step.stepNumber
463
- )) })
464
- ] });
465
- };
466
- EasySteps.displayName = "EasySteps";
467
45
  var StudioCard = ({
468
46
  code,
469
47
  name,
@@ -474,25 +52,48 @@ var StudioCard = ({
474
52
  zipCode,
475
53
  country = "United States",
476
54
  euifyMakeModel,
55
+ distance,
477
56
  onSchedule,
478
57
  className,
58
+ style,
479
59
  ...props
480
60
  }) => {
481
61
  const fullAddress = `${address}, ${city}, ${state} ${country} ${zipCode}`;
62
+ const [isHovered, setIsHovered] = React2__default.default.useState(false);
482
63
  const handleScheduleClick = () => {
483
64
  onSchedule?.(code);
484
65
  };
66
+ const formatDistance = (dist) => {
67
+ if (dist < 1) {
68
+ return `${Math.round(dist * 1e3)} m`;
69
+ }
70
+ return `${dist.toFixed(1)} km`;
71
+ };
485
72
  return /* @__PURE__ */ jsxRuntime.jsxs(
486
73
  "div",
487
74
  {
488
- className: cn(
489
- "p-6",
490
- "hover:shadow-lg transition-shadow duration-200",
491
- className
492
- ),
493
75
  ...props,
76
+ className: cn("p-6 cursor-pointer transition-colors duration-200", className),
77
+ style: {
78
+ backgroundColor: isHovered ? "#f3f4f6" : "transparent",
79
+ ...style
80
+ },
81
+ onMouseEnter: (e) => {
82
+ setIsHovered(true);
83
+ props.onMouseEnter?.(e);
84
+ },
85
+ onMouseLeave: (e) => {
86
+ setIsHovered(false);
87
+ props.onMouseLeave?.(e);
88
+ },
494
89
  children: [
495
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-semibold text-gray-900 mb-4", children: name }),
90
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between mb-4", children: [
91
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-semibold text-gray-900", children: name }),
92
+ distance !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-medium text-[#2E8B57] bg-[#E8F5E9] px-3 py-1 rounded-full whitespace-nowrap ml-2", children: [
93
+ formatDistance(distance),
94
+ " away"
95
+ ] })
96
+ ] }),
496
97
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
497
98
  /* @__PURE__ */ jsxRuntime.jsxs(
498
99
  "svg",
@@ -638,7 +239,7 @@ var StudioCard = ({
638
239
  "w-full px-6 py-3 rounded-full",
639
240
  "bg-white text-gray-900 border border-gray-900",
640
241
  "font-medium text-sm",
641
- "hover:bg-gray-900 hover:text-white",
242
+ "hover:bg-gray-900",
642
243
  "transition-all duration-200"
643
244
  ),
644
245
  children: "Schedule Now"
@@ -667,6 +268,7 @@ var defaultLocations = [
667
268
  var StudioMap = ({
668
269
  googleMapsApiKey,
669
270
  locations = defaultLocations,
271
+ hoveredLocationId,
670
272
  defaultCenter = { lat: 39.8283, lng: -98.5795 },
671
273
  // US center
672
274
  defaultZoom = 4,
@@ -815,7 +417,7 @@ var StudioMap = ({
815
417
  if (btn) {
816
418
  btn.addEventListener("click", () => {
817
419
  if (onSchedule) {
818
- onSchedule(location);
420
+ onSchedule(location.id);
819
421
  }
820
422
  });
821
423
  }
@@ -836,6 +438,82 @@ var StudioMap = ({
836
438
  googleMapRef.current.fitBounds(bounds);
837
439
  }
838
440
  }, [isLoaded, locations, onSchedule]);
441
+ React2__default.default.useEffect(() => {
442
+ if (!isLoaded || !googleMapRef.current || !hoveredLocationId) {
443
+ if (!hoveredLocationId && infoWindowRef.current) {
444
+ infoWindowRef.current.close();
445
+ }
446
+ return;
447
+ }
448
+ const location = locations.find((loc) => loc.id === hoveredLocationId);
449
+ const markerIndex = locations.findIndex(
450
+ (loc) => loc.id === hoveredLocationId
451
+ );
452
+ const marker = markersRef.current[markerIndex];
453
+ if (location && marker) {
454
+ const content = `
455
+ <div style="padding: 16px; max-width: 300px; font-family: system-ui, sans-serif;">
456
+ <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600;">${location.name}</h3>
457
+ ${location.availableTime ? `<div style="margin-bottom: 8px; color: #666;">
458
+ <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
459
+ <path d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"/>
460
+ </svg>
461
+ <span style="vertical-align: middle;">Available ${location.availableTime}</span>
462
+ </div>` : ""}
463
+ <div style="margin-bottom: 8px; color: #666;">
464
+ <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
465
+ <path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd"/>
466
+ </svg>
467
+ <span style="vertical-align: middle;">${location.address}, ${location.city}, ${location.state} ${location.country} ${location.zipCode}</span>
468
+ </div>
469
+ ${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
470
+ <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
471
+ <path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"/>
472
+ </svg>
473
+ <span style="vertical-align: middle;">${location.euifyMakeModel}</span>
474
+ </div>` : ""}
475
+ <button
476
+ id="schedule-btn-hover-${location.id}"
477
+ style="
478
+ width: 100%;
479
+ padding: 10px 16px;
480
+ background: #000;
481
+ color: #fff;
482
+ border: none;
483
+ border-radius: 6px;
484
+ font-weight: 500;
485
+ cursor: pointer;
486
+ font-size: 14px;
487
+ "
488
+ onmouseover="this.style.background='#333'"
489
+ onmouseout="this.style.background='#000'"
490
+ >
491
+ Schedule Now
492
+ </button>
493
+ </div>
494
+ `;
495
+ if (infoWindowRef.current) {
496
+ infoWindowRef.current.setContent(content);
497
+ infoWindowRef.current.open(googleMapRef.current, marker);
498
+ google.maps.event.addListenerOnce(
499
+ infoWindowRef.current,
500
+ "domready",
501
+ () => {
502
+ const btn = document.getElementById(
503
+ `schedule-btn-hover-${location.id}`
504
+ );
505
+ if (btn) {
506
+ btn.addEventListener("click", () => {
507
+ if (onSchedule) {
508
+ onSchedule(location.id);
509
+ }
510
+ });
511
+ }
512
+ }
513
+ );
514
+ }
515
+ }
516
+ }, [hoveredLocationId, isLoaded, locations, onSchedule]);
839
517
  if (!googleMapsApiKey) {
840
518
  return /* @__PURE__ */ jsxRuntime.jsx(
841
519
  "div",
@@ -1040,6 +718,66 @@ function useCreateBooking(client) {
1040
718
  createBooking
1041
719
  };
1042
720
  }
721
+ function useBooking(client, token, locale, options) {
722
+ const [state, setState] = React2.useState({
723
+ data: null,
724
+ loading: true,
725
+ error: null
726
+ });
727
+ const enabled = options?.enabled !== false;
728
+ React2.useEffect(() => {
729
+ if (!enabled || !token) return;
730
+ let cancelled = false;
731
+ const fetchData = async () => {
732
+ setState((prev) => ({ ...prev, loading: true, error: null }));
733
+ try {
734
+ const data = await client.getBooking(token, locale);
735
+ if (!cancelled) {
736
+ setState({ data, loading: false, error: null });
737
+ }
738
+ } catch (error) {
739
+ if (!cancelled) {
740
+ setState({
741
+ data: null,
742
+ loading: false,
743
+ error: error instanceof ApiError ? error : new ApiError(1006, "Unknown error")
744
+ });
745
+ }
746
+ }
747
+ };
748
+ fetchData();
749
+ return () => {
750
+ cancelled = true;
751
+ };
752
+ }, [client, token, locale, enabled]);
753
+ return state;
754
+ }
755
+ function useCancelBooking(client) {
756
+ const [state, setState] = React2.useState({
757
+ data: null,
758
+ loading: false,
759
+ error: null
760
+ });
761
+ const cancelBooking = React2.useCallback(
762
+ async (token, locale) => {
763
+ setState({ data: null, loading: true, error: null });
764
+ try {
765
+ const result = await client.cancelBooking(token, locale);
766
+ setState({ data: result, loading: false, error: null });
767
+ return result;
768
+ } catch (error) {
769
+ const apiError = error instanceof ApiError ? error : new ApiError(1006, "Unknown error");
770
+ setState({ data: null, loading: false, error: apiError });
771
+ throw apiError;
772
+ }
773
+ },
774
+ [client]
775
+ );
776
+ return {
777
+ ...state,
778
+ cancelBooking
779
+ };
780
+ }
1043
781
  var AntdMobileIsolated = ({
1044
782
  children,
1045
783
  className,
@@ -1084,24 +822,62 @@ var AntdMobileIsolated = ({
1084
822
  AntdMobileIsolated.displayName = "AntdMobileIsolated";
1085
823
 
1086
824
  // src/components/DemoRoom/utils/addressParser.ts
825
+ var KNOWN_COUNTRIES = [
826
+ "United States",
827
+ "United Kingdom",
828
+ "American Samoa",
829
+ "United Arab Emirates",
830
+ "Bosnia and Herzegovina",
831
+ "Trinidad and Tobago",
832
+ "Saint Kitts and Nevis",
833
+ "Antigua and Barbuda",
834
+ "Saint Vincent and the Grenadines",
835
+ "S\xE3o Tom\xE9 and Pr\xEDncipe",
836
+ "United States Minor Outlying Islands",
837
+ "British Virgin Islands",
838
+ "United States Virgin Islands",
839
+ "Cayman Islands",
840
+ "Cook Islands",
841
+ "Falkland Islands",
842
+ "Faroe Islands",
843
+ "Marshall Islands",
844
+ "Northern Mariana Islands",
845
+ "Pitcairn Islands",
846
+ "Solomon Islands",
847
+ "Turks and Caicos Islands",
848
+ "Wallis and Futuna"
849
+ ];
1087
850
  function parseAddress(address) {
1088
- const parts = address.split(",").map((part) => part.trim());
851
+ const parts = address.split(",").map((part) => part.trim()).filter(Boolean);
1089
852
  let country = "United States";
1090
853
  let state = "";
1091
854
  let city = "";
1092
- if (parts.length >= 3) {
1093
- city = parts[1] || "";
1094
- state = parts[2]?.split(" ")[0] || "";
1095
- country = parts[3] || country;
1096
- } else if (parts.length === 2) {
1097
- city = parts[0] || "";
1098
- state = parts[1]?.split(" ")[0] || "";
1099
- } else if (parts.length === 1) {
1100
- city = parts[0] || "";
855
+ if (parts.length === 0) {
856
+ return { country, state, city };
1101
857
  }
1102
- return {
1103
- country: country.trim(),
1104
- state: state.trim(),
858
+ const lastPart = parts[parts.length - 1];
859
+ const matchedCountry = KNOWN_COUNTRIES.find(
860
+ (knownCountry) => lastPart.toLowerCase() === knownCountry.toLowerCase()
861
+ );
862
+ if (matchedCountry) {
863
+ country = matchedCountry;
864
+ if (parts.length >= 2) {
865
+ state = parts[parts.length - 2].split(" ")[0];
866
+ }
867
+ if (parts.length >= 3) {
868
+ city = parts[parts.length - 3];
869
+ }
870
+ } else {
871
+ if (parts.length >= 2) {
872
+ state = parts[parts.length - 1].split(" ")[0];
873
+ city = parts[parts.length - 2];
874
+ } else if (parts.length === 1) {
875
+ city = parts[0];
876
+ }
877
+ }
878
+ return {
879
+ country: country.trim(),
880
+ state: state.trim(),
1105
881
  city: city.trim()
1106
882
  };
1107
883
  }
@@ -1185,9 +961,7 @@ var LocationFilter = ({
1185
961
  items = locationData.countries;
1186
962
  break;
1187
963
  case "state":
1188
- items = selectedCountry ? locationData.states.filter(
1189
- (s) => s.parentCode === selectedCountry
1190
- ) : [];
964
+ items = selectedCountry ? locationData.states.filter((s) => s.parentCode === selectedCountry) : [];
1191
965
  break;
1192
966
  case "city":
1193
967
  items = selectedState ? locationData.cities.filter((c) => c.parentCode === selectedState) : [];
@@ -1204,6 +978,7 @@ var LocationFilter = ({
1204
978
  () => groupByAlphabet(filteredItems),
1205
979
  [filteredItems]
1206
980
  );
981
+ const showIndexBar = filteredItems.length >= 10;
1207
982
  const handleItemClick = (item) => {
1208
983
  if (currentLevel === "country") {
1209
984
  setSelectedCountry(item.code);
@@ -1247,42 +1022,30 @@ var LocationFilter = ({
1247
1022
  style: { background: "#F8F8F8" },
1248
1023
  className: "rounded-[12px] rounded-b-none h-[72px] font-bold text-[14px] flex flex-col",
1249
1024
  children: [
1250
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-[20px] pt-[12px] pb-[8px]", children: [
1251
- /* @__PURE__ */ jsxRuntime.jsx(
1252
- "input",
1253
- {
1254
- type: "text",
1255
- placeholder: "Please enter the search city",
1256
- value: searchQuery,
1257
- onChange: (e) => setSearchQuery(e.target.value),
1258
- className: "flex-1 h-[32px] px-[12px] rounded-[6px] border border-[#E4E5E6] text-[14px] outline-none focus:border-[#2E8B57]"
1259
- }
1260
- ),
1261
- /* @__PURE__ */ jsxRuntime.jsx(
1262
- "button",
1263
- {
1264
- onClick: onClose,
1265
- className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-center",
1266
- children: /* @__PURE__ */ jsxRuntime.jsx(
1267
- "svg",
1268
- {
1269
- xmlns: "http://www.w3.org/2000/svg",
1270
- width: "24",
1271
- height: "24",
1272
- viewBox: "0 0 24 24",
1273
- fill: "none",
1274
- children: /* @__PURE__ */ jsxRuntime.jsx(
1275
- "path",
1276
- {
1277
- d: "M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",
1278
- fill: "#1D1D1F"
1279
- }
1280
- )
1281
- }
1282
- )
1283
- }
1284
- )
1285
- ] }),
1025
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end px-[20px] pt-[12px] pb-[8px]", children: /* @__PURE__ */ jsxRuntime.jsx(
1026
+ "button",
1027
+ {
1028
+ onClick: onClose,
1029
+ className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-end",
1030
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1031
+ "svg",
1032
+ {
1033
+ xmlns: "http://www.w3.org/2000/svg",
1034
+ width: "24",
1035
+ height: "24",
1036
+ viewBox: "0 0 24 24",
1037
+ fill: "none",
1038
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1039
+ "path",
1040
+ {
1041
+ d: "M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",
1042
+ fill: "#1D1D1F"
1043
+ }
1044
+ )
1045
+ }
1046
+ )
1047
+ }
1048
+ ) }),
1286
1049
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center px-[20px] gap-[16px] pb-[8px]", children: [
1287
1050
  /* @__PURE__ */ jsxRuntime.jsx(
1288
1051
  "button",
@@ -1325,38 +1088,26 @@ var LocationFilter = ({
1325
1088
  ]
1326
1089
  }
1327
1090
  ),
1328
- /* @__PURE__ */ jsxRuntime.jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default, { style: { height: "100%" }, children: groupedItems.map((group) => {
1091
+ /* @__PURE__ */ jsxRuntime.jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: showIndexBar ? /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default, { style: { height: "100%" }, children: groupedItems.map((group) => {
1329
1092
  const { title, items } = group;
1330
1093
  return /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default.Panel, { index: title, title, children: /* @__PURE__ */ jsxRuntime.jsx(List__default.default, { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
1331
1094
  List__default.default.Item,
1332
1095
  {
1333
- clickable: true,
1334
1096
  onClick: () => handleItemClick(item),
1335
- extra: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[8px]", children: [
1336
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[#767880] text-[14px]", children: item.count }),
1337
- /* @__PURE__ */ jsxRuntime.jsx(
1338
- "svg",
1339
- {
1340
- xmlns: "http://www.w3.org/2000/svg",
1341
- width: "16",
1342
- height: "16",
1343
- viewBox: "0 0 16 16",
1344
- fill: "none",
1345
- children: /* @__PURE__ */ jsxRuntime.jsx(
1346
- "path",
1347
- {
1348
- d: "M6.4 12L5.6 11.2L9.06667 7.73333L5.6 4.26667L6.4 3.46667L10.6667 7.73333L6.4 12Z",
1349
- fill: "#767880"
1350
- }
1351
- )
1352
- }
1353
- )
1354
- ] }),
1097
+ style: { cursor: "pointer" },
1355
1098
  children: item.name
1356
1099
  },
1357
1100
  item.code
1358
1101
  )) }) }, title);
1359
- }) }) })
1102
+ }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(List__default.default, { children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
1103
+ List__default.default.Item,
1104
+ {
1105
+ onClick: () => handleItemClick(item),
1106
+ style: { cursor: "pointer" },
1107
+ children: item.name
1108
+ },
1109
+ item.code
1110
+ )) }) }) })
1360
1111
  ]
1361
1112
  }
1362
1113
  );
@@ -1479,6 +1230,7 @@ var RoomsList = ({
1479
1230
  }) => {
1480
1231
  const [showLocationFilter, setShowLocationFilter] = React2.useState(false);
1481
1232
  const [selectedLocation, setSelectedLocation] = React2.useState();
1233
+ const [hoveredRoomId, setHoveredRoomId] = React2.useState(null);
1482
1234
  const {
1483
1235
  data: demoRooms,
1484
1236
  loading,
@@ -1491,25 +1243,9 @@ var RoomsList = ({
1491
1243
  const studioLocations = React2.useMemo(() => {
1492
1244
  if (!demoRooms) return defaultStudioLocations;
1493
1245
  return demoRooms.map((room) => {
1494
- const timeslots = [
1495
- {
1496
- id: 130,
1497
- start_time: "2026-01-13T09:00:00-05:00",
1498
- end_time: "2026-01-13T10:00:00-05:00",
1499
- capacity: 5,
1500
- booked_count: 2,
1501
- status: "available"
1502
- },
1503
- {
1504
- id: 131,
1505
- start_time: "2026-01-13T14:00:00-05:00",
1506
- end_time: "2026-01-13T15:00:00-05:00",
1507
- capacity: 5,
1508
- booked_count: 5,
1509
- status: "full"
1510
- }
1511
- ];
1512
- const nextAvailableTimeslot = (room.timeslots?.length ? room.timeslots : timeslots)?.find((slot) => slot.status === "available");
1246
+ const nextAvailableTimeslot = room?.timeslots?.find(
1247
+ (slot) => slot.status === "available"
1248
+ );
1513
1249
  const { country, state, city } = parseAddress(room.address);
1514
1250
  return {
1515
1251
  id: room.code,
@@ -1560,18 +1296,18 @@ var RoomsList = ({
1560
1296
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, ...props, children: [
1561
1297
  /* @__PURE__ */ jsxRuntime.jsx(Title, { title: "Find a Studio Near You" }),
1562
1298
  loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: "Loading demo rooms..." }) }) }),
1563
- error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center text-red-600", children: [
1299
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", style: { color: "#FF4D4D" }, children: [
1564
1300
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: "Failed to load demo rooms" }),
1565
1301
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm mt-2", children: error.message })
1566
1302
  ] }) }),
1567
- !loading && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[794px] overflow-auto gap-4", children: [
1303
+ !loading && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[794px] gap-4", children: [
1568
1304
  /* @__PURE__ */ jsxRuntime.jsxs(
1569
1305
  "div",
1570
1306
  {
1571
1307
  className: "flex-none relative w-[420px]",
1572
1308
  style: { height: "794px" },
1573
1309
  children: [
1574
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-[12px] items-center h-[72px] mb-4 font-bold text-[16px] gap-10 flex bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: [
1310
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[12px] mb-4 bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-[40px] font-bold text-[16px] gap-10 flex items-center", children: [
1575
1311
  /* @__PURE__ */ jsxRuntime.jsxs(
1576
1312
  "button",
1577
1313
  {
@@ -1627,7 +1363,7 @@ var RoomsList = ({
1627
1363
  }
1628
1364
  )
1629
1365
  ] })
1630
- ] }),
1366
+ ] }) }),
1631
1367
  /* @__PURE__ */ jsxRuntime.jsx(
1632
1368
  "div",
1633
1369
  {
@@ -1645,7 +1381,9 @@ var RoomsList = ({
1645
1381
  state: item?.state,
1646
1382
  zipCode: item?.zipCode,
1647
1383
  euifyMakeModel: item?.euifyMakeModel || "",
1648
- onSchedule
1384
+ onSchedule,
1385
+ onMouseEnter: () => setHoveredRoomId(item.id),
1386
+ onMouseLeave: () => setHoveredRoomId(null)
1649
1387
  },
1650
1388
  item.id
1651
1389
  );
@@ -1672,9 +1410,8 @@ var RoomsList = ({
1672
1410
  {
1673
1411
  googleMapsApiKey,
1674
1412
  locations: filteredStudioLocations,
1675
- onSchedule: () => {
1676
- console.log(111);
1677
- },
1413
+ hoveredLocationId: hoveredRoomId,
1414
+ onSchedule,
1678
1415
  mapHeight: "794px"
1679
1416
  }
1680
1417
  ) })
@@ -1811,11 +1548,39 @@ var DemoRoomApiClient = class {
1811
1548
  });
1812
1549
  }
1813
1550
  /**
1814
- * 根据 token 获取预约信息
1815
- * @param token 预约 token
1551
+ * 根据 token 获取预约详情(支持多语言)
1552
+ * @param token 预约凭证 (cancel_token)
1553
+ * @param locale 语言偏好(可选,也可以通过 Accept-Language Header)
1554
+ */
1555
+ async getBooking(token, locale) {
1556
+ const headers = {};
1557
+ if (locale) {
1558
+ headers["Accept-Language"] = locale;
1559
+ }
1560
+ const response = await this.request(
1561
+ `/api/v1/store/bookings/${token}`,
1562
+ { headers }
1563
+ );
1564
+ return response.booking;
1565
+ }
1566
+ /**
1567
+ * 取消预约(支持多语言邮件通知)
1568
+ * @param token 预约凭证 (cancel_token)
1569
+ * @param locale 语言偏好(可选,用于邮件通知)
1816
1570
  */
1817
- async getBooking(token) {
1818
- return this.request(`/api/v1/store/bookings/${token}`);
1571
+ async cancelBooking(token, locale) {
1572
+ const headers = {};
1573
+ if (locale) {
1574
+ headers["Accept-Language"] = locale;
1575
+ }
1576
+ const response = await this.request(
1577
+ `/api/v1/store/bookings/${token}/cancel`,
1578
+ {
1579
+ method: "POST",
1580
+ headers
1581
+ }
1582
+ );
1583
+ return response.booking;
1819
1584
  }
1820
1585
  };
1821
1586
  function createDemoRoomApi(config) {
@@ -1823,7 +1588,7 @@ function createDemoRoomApi(config) {
1823
1588
  }
1824
1589
  var DemoRoom = ({
1825
1590
  className,
1826
- layoutClassName = "w-safe11",
1591
+ layoutClassName,
1827
1592
  googleMapsApiKey,
1828
1593
  apiConfig,
1829
1594
  teamCode,
@@ -1835,382 +1600,104 @@ var DemoRoom = ({
1835
1600
  () => createDemoRoomApi(apiConfig),
1836
1601
  [apiConfig]
1837
1602
  );
1838
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(className), ...props, children: [
1839
- /* @__PURE__ */ jsxRuntime.jsx(Banner, { className: layoutClassName }),
1840
- /* @__PURE__ */ jsxRuntime.jsx(
1841
- BreadCrumbs,
1842
- {
1843
- className: layoutClassName,
1844
- items: [{ label: "Home", link: "/" }, { label: "Demo Room" }]
1845
- }
1846
- ),
1847
- /* @__PURE__ */ jsxRuntime.jsx(HelpNav, {}),
1848
- /* @__PURE__ */ jsxRuntime.jsx(UpcomingEvents, { className: layoutClassName }),
1849
- /* @__PURE__ */ jsxRuntime.jsx(
1850
- RoomsList,
1851
- {
1852
- className: layoutClassName,
1853
- googleMapsApiKey,
1854
- apiClient,
1855
- teamCode,
1856
- brandWebsite,
1857
- onSchedule
1858
- }
1859
- ),
1860
- /* @__PURE__ */ jsxRuntime.jsx(EasySteps, { className: layoutClassName })
1861
- ] });
1603
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
1604
+ RoomsList,
1605
+ {
1606
+ className: layoutClassName,
1607
+ googleMapsApiKey,
1608
+ apiClient,
1609
+ teamCode,
1610
+ brandWebsite,
1611
+ onSchedule
1612
+ }
1613
+ ) });
1862
1614
  };
1863
1615
  DemoRoom.displayName = "DemoRoom";
1864
- var Navigation;
1865
- var Pagination;
1866
- var Autoplay;
1867
- var swiperVersion = "11+";
1868
- try {
1869
- const modules = __require("swiper/modules");
1870
- Navigation = modules.Navigation;
1871
- Pagination = modules.Pagination;
1872
- Autoplay = modules.Autoplay;
1873
- swiperVersion = "11+";
1874
- } catch (e) {
1875
- try {
1876
- const SwiperCore = __require("swiper");
1877
- const SwiperNavigation = __require("swiper/modules/navigation");
1878
- const SwiperPagination = __require("swiper/modules/pagination");
1879
- const SwiperAutoplay = __require("swiper/modules/autoplay");
1880
- const SwiperClass = SwiperCore.default || SwiperCore;
1881
- if (SwiperClass && SwiperClass.use) {
1882
- SwiperClass.use([
1883
- SwiperNavigation.default || SwiperNavigation,
1884
- SwiperPagination.default || SwiperPagination,
1885
- SwiperAutoplay.default || SwiperAutoplay
1886
- ]);
1616
+ var QuestionnaireForm = ({
1617
+ questions,
1618
+ onSubmit,
1619
+ pageData,
1620
+ loading = false,
1621
+ className
1622
+ }) => {
1623
+ console.log(pageData);
1624
+ const [responses, setResponses] = React2.useState({});
1625
+ const [errors, setErrors] = React2.useState({});
1626
+ const [agreements, setAgreements] = React2.useState({});
1627
+ const [agreementError, setAgreementError] = React2.useState("");
1628
+ const getQuestionId = (question) => {
1629
+ return question.id || question.key || "";
1630
+ };
1631
+ const handleChange = (questionId, value) => {
1632
+ setResponses((prev) => ({
1633
+ ...prev,
1634
+ [questionId]: value
1635
+ }));
1636
+ if (errors[questionId]) {
1637
+ setErrors((prev) => {
1638
+ const newErrors = { ...prev };
1639
+ delete newErrors[questionId];
1640
+ return newErrors;
1641
+ });
1887
1642
  }
1888
- Navigation = SwiperNavigation.default || SwiperNavigation;
1889
- Pagination = SwiperPagination.default || SwiperPagination;
1890
- Autoplay = SwiperAutoplay.default || SwiperAutoplay;
1891
- swiperVersion = "8";
1892
- } catch (e2) {
1893
- console.warn("Failed to load swiper modules:", e2);
1894
- }
1895
- }
1896
- if (typeof window !== "undefined") {
1897
- try {
1898
- __require("swiper/css");
1899
- __require("swiper/css/navigation");
1900
- __require("swiper/css/pagination");
1901
- } catch (e) {
1902
- try {
1903
- __require("swiper/swiper.min.css");
1904
- __require("swiper/modules/navigation/navigation.min.css");
1905
- __require("swiper/modules/pagination/pagination.min.css");
1906
- } catch (e2) {
1907
- console.warn("Failed to load swiper styles");
1643
+ };
1644
+ const handleCheckboxChange = (questionId, optionValue, checked) => {
1645
+ const currentValues = responses[questionId] || [];
1646
+ const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
1647
+ handleChange(questionId, newValues);
1648
+ };
1649
+ const handleAgreementChange = (index, checked) => {
1650
+ setAgreements((prev) => ({
1651
+ ...prev,
1652
+ [index]: checked
1653
+ }));
1654
+ if (checked && agreementError) {
1655
+ setAgreementError("");
1908
1656
  }
1909
- }
1910
- }
1911
- var defaultDescriptions = [
1912
- "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
1913
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos."
1914
- ];
1915
- var defaultImages = [
1916
- "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1917
- "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
1918
- ];
1919
- var DemoRoomDetail = ({
1920
- apiClient,
1921
- demoRoomCode,
1922
- locale,
1923
- title: titleProp,
1924
- descriptions: descriptionsProp,
1925
- devices: devicesProp,
1926
- address: addressProp,
1927
- mapsLink,
1928
- images: imagesProp,
1929
- className,
1930
- ...props
1931
- }) => {
1932
- const {
1933
- data: demoRoom,
1934
- loading,
1935
- error
1936
- } = useDemoRoom(
1937
- apiClient,
1938
- demoRoomCode || "",
1939
- locale,
1940
- { enabled: !!apiClient && !!demoRoomCode }
1941
- );
1942
- const title = demoRoom?.name || titleProp || "Design District Demo Room";
1943
- const descriptions = demoRoom?.description ? [demoRoom.description] : descriptionsProp || defaultDescriptions;
1944
- const devices = demoRoom?.description || devicesProp || "eufyMake E1, eufyMake M5";
1945
- const address = demoRoom?.address || addressProp || "1111 8th St, San Francisco, CA United States 94108";
1946
- const images = demoRoom?.images && demoRoom.images.length > 0 ? demoRoom.images : imagesProp || defaultImages;
1947
- const googleMapsLink = mapsLink || (demoRoom?.latitude && demoRoom?.longitude ? `https://www.google.com/maps/search/?api=1&query=${demoRoom.latitude},${demoRoom.longitude}` : "#");
1948
- if (loading && apiClient && demoRoomCode) {
1949
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
1950
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
1951
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12 bg-gray-200 rounded animate-pulse" }),
1952
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-24 bg-gray-200 rounded animate-pulse" }),
1953
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
1954
- ] }),
1955
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
1956
- ] }) });
1957
- }
1958
- if (error && apiClient && demoRoomCode) {
1959
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center text-red-600 py-8", children: [
1960
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-medium", children: "Failed to load demo room details" }),
1961
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", children: error.message })
1962
- ] }) });
1963
- }
1964
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
1965
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
1966
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
1967
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsxRuntime.jsx(
1968
- "p",
1969
- {
1970
- className: "text-base text-gray-600 leading-relaxed",
1971
- children: desc
1972
- },
1973
- index
1974
- )) }),
1975
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
1976
- /* @__PURE__ */ jsxRuntime.jsxs(
1977
- "svg",
1978
- {
1979
- width: "24",
1980
- height: "24",
1981
- viewBox: "0 0 24 24",
1982
- fill: "none",
1983
- xmlns: "http://www.w3.org/2000/svg",
1984
- className: "flex-shrink-0 mt-0.5",
1985
- children: [
1986
- /* @__PURE__ */ jsxRuntime.jsx(
1987
- "rect",
1988
- {
1989
- x: "3",
1990
- y: "3",
1991
- width: "18",
1992
- height: "18",
1993
- rx: "2",
1994
- stroke: "currentColor",
1995
- strokeWidth: "2"
1996
- }
1997
- ),
1998
- /* @__PURE__ */ jsxRuntime.jsx(
1999
- "path",
2000
- {
2001
- d: "M8 10H16",
2002
- stroke: "currentColor",
2003
- strokeWidth: "2",
2004
- strokeLinecap: "round"
2005
- }
2006
- ),
2007
- /* @__PURE__ */ jsxRuntime.jsx(
2008
- "path",
2009
- {
2010
- d: "M8 14H16",
2011
- stroke: "currentColor",
2012
- strokeWidth: "2",
2013
- strokeLinecap: "round"
2014
- }
2015
- )
2016
- ]
2017
- }
2018
- ),
2019
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900", children: devices })
2020
- ] }),
2021
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
2022
- /* @__PURE__ */ jsxRuntime.jsxs(
2023
- "svg",
2024
- {
2025
- width: "24",
2026
- height: "24",
2027
- viewBox: "0 0 24 24",
2028
- fill: "none",
2029
- xmlns: "http://www.w3.org/2000/svg",
2030
- className: "flex-shrink-0 mt-0.5",
2031
- children: [
2032
- /* @__PURE__ */ jsxRuntime.jsx(
2033
- "path",
2034
- {
2035
- d: "M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2Z",
2036
- stroke: "currentColor",
2037
- strokeWidth: "2",
2038
- strokeLinecap: "round",
2039
- strokeLinejoin: "round"
2040
- }
2041
- ),
2042
- /* @__PURE__ */ jsxRuntime.jsx(
2043
- "circle",
2044
- {
2045
- cx: "12",
2046
- cy: "9",
2047
- r: "2.5",
2048
- stroke: "currentColor",
2049
- strokeWidth: "2"
2050
- }
2051
- )
2052
- ]
2053
- }
2054
- ),
2055
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
2056
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: address }),
2057
- /* @__PURE__ */ jsxRuntime.jsxs(
2058
- "a",
2059
- {
2060
- href: googleMapsLink,
2061
- target: "_blank",
2062
- rel: "noopener noreferrer",
2063
- className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
2064
- children: [
2065
- "Open in Google Maps",
2066
- /* @__PURE__ */ jsxRuntime.jsx(
2067
- "svg",
2068
- {
2069
- width: "12",
2070
- height: "12",
2071
- viewBox: "0 0 12 12",
2072
- fill: "none",
2073
- xmlns: "http://www.w3.org/2000/svg",
2074
- children: /* @__PURE__ */ jsxRuntime.jsx(
2075
- "path",
2076
- {
2077
- d: "M3 9L9 3M9 3H3M9 3V9",
2078
- stroke: "currentColor",
2079
- strokeWidth: "1.5",
2080
- strokeLinecap: "round",
2081
- strokeLinejoin: "round"
2082
- }
2083
- )
2084
- }
2085
- )
2086
- ]
2087
- }
2088
- )
2089
- ] })
2090
- ] })
2091
- ] }),
2092
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
2093
- react.Swiper,
2094
- {
2095
- ...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
2096
- spaceBetween: 0,
2097
- slidesPerView: 1,
2098
- navigation: true,
2099
- pagination: { clickable: true },
2100
- autoplay: {
2101
- delay: 3e3,
2102
- disableOnInteraction: false
2103
- },
2104
- loop: true,
2105
- className: "h-full rounded-2xl",
2106
- children: images.map((img, index) => /* @__PURE__ */ jsxRuntime.jsx(react.SwiperSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(
2107
- "img",
2108
- {
2109
- src: img,
2110
- alt: `Demo room view ${index + 1}`,
2111
- className: "w-full h-full object-cover"
2112
- }
2113
- ) }) }, index))
2114
- }
2115
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
2116
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
2117
- "svg",
2118
- {
2119
- width: "32",
2120
- height: "32",
2121
- viewBox: "0 0 32 32",
2122
- fill: "none",
2123
- xmlns: "http://www.w3.org/2000/svg",
2124
- children: [
2125
- /* @__PURE__ */ jsxRuntime.jsx(
2126
- "rect",
2127
- {
2128
- x: "4",
2129
- y: "8",
2130
- width: "24",
2131
- height: "16",
2132
- rx: "2",
2133
- stroke: "currentColor",
2134
- strokeWidth: "2"
2135
- }
2136
- ),
2137
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
2138
- /* @__PURE__ */ jsxRuntime.jsx(
2139
- "path",
2140
- {
2141
- d: "M28 20L22 14L16 20",
2142
- stroke: "currentColor",
2143
- strokeWidth: "2",
2144
- strokeLinecap: "round",
2145
- strokeLinejoin: "round"
2146
- }
2147
- )
2148
- ]
2149
- }
2150
- ) }),
2151
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 text-sm", children: "Demo Room Images" })
2152
- ] }) }) })
2153
- ] }) });
2154
- };
2155
- DemoRoomDetail.displayName = "DemoRoomDetail";
2156
- var QuestionnaireForm = ({
2157
- questions,
2158
- onSubmit,
2159
- loading = false,
2160
- className
2161
- }) => {
2162
- const [responses, setResponses] = React2.useState({});
2163
- const [errors, setErrors] = React2.useState({});
2164
- const getQuestionId = (question) => {
2165
- return question.id || question.key || "";
2166
- };
2167
- const handleChange = (questionId, value) => {
2168
- setResponses((prev) => ({
2169
- ...prev,
2170
- [questionId]: value
2171
- }));
2172
- if (errors[questionId]) {
2173
- setErrors((prev) => {
2174
- const newErrors = { ...prev };
2175
- delete newErrors[questionId];
2176
- return newErrors;
2177
- });
2178
- }
2179
- };
2180
- const handleCheckboxChange = (questionId, optionValue, checked) => {
2181
- const currentValues = responses[questionId] || [];
2182
- const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
2183
- handleChange(questionId, newValues);
2184
- };
2185
- const validateForm = () => {
2186
- const newErrors = {};
2187
- questions.forEach((question) => {
2188
- if (question.required) {
2189
- const questionId = getQuestionId(question);
2190
- const value = responses[questionId];
2191
- if (!value || Array.isArray(value) && value.length === 0) {
2192
- newErrors[questionId] = "This field is required";
2193
- }
2194
- }
2195
- });
2196
- setErrors(newErrors);
2197
- return Object.keys(newErrors).length === 0;
2198
- };
2199
- const handleSubmit = (e) => {
2200
- e.preventDefault();
2201
- if (validateForm()) {
2202
- onSubmit?.(responses);
2203
- }
2204
- };
2205
- const renderQuestion = (question) => {
2206
- const questionId = getQuestionId(question);
2207
- const hasError = !!errors[questionId];
2208
- switch (question.type) {
2209
- case "text":
2210
- case "email":
2211
- case "tel":
2212
- return /* @__PURE__ */ jsxRuntime.jsx(
2213
- "input",
1657
+ };
1658
+ const validateForm = () => {
1659
+ const newErrors = {};
1660
+ questions.forEach((question) => {
1661
+ if (question.required) {
1662
+ const questionId = getQuestionId(question);
1663
+ const value = responses[questionId];
1664
+ if (!value || Array.isArray(value) && value.length === 0) {
1665
+ newErrors[questionId] = "This field is required";
1666
+ }
1667
+ }
1668
+ });
1669
+ const agrees = pageData?.agrees || [];
1670
+ if (agrees.length > 0) {
1671
+ const allAgreed = agrees.every(
1672
+ (_, index) => agreements[index]
1673
+ );
1674
+ if (!allAgreed) {
1675
+ setAgreementError(
1676
+ "Please agree to all terms and conditions to continue"
1677
+ );
1678
+ setErrors(newErrors);
1679
+ return false;
1680
+ }
1681
+ }
1682
+ setErrors(newErrors);
1683
+ setAgreementError("");
1684
+ return Object.keys(newErrors).length === 0;
1685
+ };
1686
+ const handleSubmit = (e) => {
1687
+ e.preventDefault();
1688
+ if (validateForm()) {
1689
+ onSubmit?.(responses);
1690
+ }
1691
+ };
1692
+ const renderQuestion = (question) => {
1693
+ const questionId = getQuestionId(question);
1694
+ const hasError = !!errors[questionId];
1695
+ switch (question.type) {
1696
+ case "text":
1697
+ case "email":
1698
+ case "tel":
1699
+ return /* @__PURE__ */ jsxRuntime.jsx(
1700
+ "input",
2214
1701
  {
2215
1702
  type: question.type,
2216
1703
  value: responses[questionId] || "",
@@ -2239,7 +1726,7 @@ var QuestionnaireForm = ({
2239
1726
  }
2240
1727
  );
2241
1728
  case "radio":
2242
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: question.options?.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
1729
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: question?.options?.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
2243
1730
  "label",
2244
1731
  {
2245
1732
  className: "flex items-center gap-3 cursor-pointer group",
@@ -2261,7 +1748,7 @@ var QuestionnaireForm = ({
2261
1748
  option.value || option.label
2262
1749
  )) });
2263
1750
  case "checkbox":
2264
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: question.options?.map((option) => {
1751
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: question?.options?.map((option) => {
2265
1752
  const optionValue = option.value || option.label;
2266
1753
  const isChecked = (responses[questionId] || []).includes(
2267
1754
  optionValue
@@ -2319,8 +1806,8 @@ var QuestionnaireForm = ({
2319
1806
  return null;
2320
1807
  }
2321
1808
  };
2322
- return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: [
2323
- questions.map((question) => {
1809
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pb-[80px]", children: [
1810
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8", children: /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: questions?.map((question) => {
2324
1811
  const questionId = getQuestionId(question);
2325
1812
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
2326
1813
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "block", children: [
@@ -2332,24 +1819,51 @@ var QuestionnaireForm = ({
2332
1819
  ] }),
2333
1820
  renderQuestion(question),
2334
1821
  question.hint && !errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: question.hint }),
2335
- errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-500", children: errors[questionId] })
1822
+ errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", style: { color: "#FF4D4D" }, children: errors[questionId] })
2336
1823
  ] }, questionId);
2337
- }),
2338
- /* @__PURE__ */ jsxRuntime.jsx(
2339
- "button",
2340
- {
2341
- type: "submit",
2342
- disabled: loading,
2343
- className: cn(
2344
- "w-full px-6 py-4 rounded-full",
2345
- "bg-[#3ADB67] text-white font-medium text-base",
2346
- "hover:bg-[#2FC257] transition-colors",
2347
- "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2348
- "disabled:opacity-50 disabled:cursor-not-allowed"
2349
- ),
2350
- children: loading ? "Submitting..." : "Submit Booking"
2351
- }
2352
- )
1824
+ }) }) }),
1825
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center", children: [
1826
+ pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 mt-8", children: [
1827
+ pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
1828
+ /* @__PURE__ */ jsxRuntime.jsx(
1829
+ "input",
1830
+ {
1831
+ type: "checkbox",
1832
+ id: `agreement-${index}`,
1833
+ checked: agreements[index] || false,
1834
+ onChange: (e) => handleAgreementChange(index, e.target.checked),
1835
+ className: "w-5 h-5 rounded border-gray-300 text-[#2FC257] focus:ring-[#2FC257] cursor-pointer flex-shrink-0"
1836
+ }
1837
+ ),
1838
+ /* @__PURE__ */ jsxRuntime.jsx(
1839
+ "label",
1840
+ {
1841
+ htmlFor: `agreement-${index}`,
1842
+ className: "text-sm text-gray-700 cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
1843
+ dangerouslySetInnerHTML: { __html: agreeContent },
1844
+ "aria-label": `Agreement ${index + 1}`
1845
+ }
1846
+ )
1847
+ ] }, index)),
1848
+ agreementError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: agreementError })
1849
+ ] }),
1850
+ /* @__PURE__ */ jsxRuntime.jsx(
1851
+ "button",
1852
+ {
1853
+ type: "submit",
1854
+ disabled: loading,
1855
+ onClick: handleSubmit,
1856
+ className: cn(
1857
+ "w-fit mt-6 px-6 py-4 rounded-full",
1858
+ "bg-[#080A0F] text-white font-medium text-base",
1859
+ "hover:bg-[#2FC257] transition-colors",
1860
+ "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
1861
+ "disabled:opacity-50 disabled:cursor-not-allowed"
1862
+ ),
1863
+ children: loading ? "Submitting..." : "Submit Booking"
1864
+ }
1865
+ )
1866
+ ] })
2353
1867
  ] });
2354
1868
  };
2355
1869
  dayjs__default.default.extend(dayLocaleData__default.default);
@@ -2359,27 +1873,29 @@ var DateTimePicker = ({
2359
1873
  apiClient,
2360
1874
  demoRoomCode,
2361
1875
  timezone,
1876
+ pageData,
2362
1877
  locale,
2363
1878
  onBookingSuccess
2364
1879
  }) => {
2365
1880
  const { token } = antd.theme.useToken();
2366
1881
  const [selectMonth, setSelectMonth] = React2.useState("");
2367
1882
  const [selectedDate, setSelectedDate] = React2.useState(dayjs__default.default());
2368
- const [selectedTimeslotId, setSelectedTimeslotId] = React2.useState(null);
1883
+ const [selectedTimeslotId, setSelectedTimeslotId] = React2.useState(
1884
+ null
1885
+ );
2369
1886
  const [showQuestionnaire, setShowQuestionnaire] = React2.useState(false);
2370
- const { createBooking, loading: bookingLoading, error: bookingError } = useCreateBooking(apiClient);
2371
1887
  const {
2372
- data: demoRoom
2373
- } = useDemoRoom(
1888
+ createBooking,
1889
+ loading: bookingLoading,
1890
+ error: bookingError
1891
+ } = useCreateBooking(apiClient);
1892
+ const { data: demoRoom } = useDemoRoom(
2374
1893
  apiClient,
2375
1894
  demoRoomCode || "",
2376
1895
  locale,
2377
1896
  { enabled: !!demoRoomCode }
2378
1897
  );
2379
- const {
2380
- data: questionnaire,
2381
- loading: questionnaireLoading
2382
- } = useQuestionnaire(
1898
+ const { data: questionnaire, loading: questionnaireLoading } = useQuestionnaire(
2383
1899
  apiClient,
2384
1900
  demoRoomCode || "",
2385
1901
  demoRoom?.questionnaire_id,
@@ -2447,13 +1963,8 @@ var DateTimePicker = ({
2447
1963
  }
2448
1964
  }
2449
1965
  },
2450
- children: /* @__PURE__ */ jsxRuntime.jsxs(
2451
- "div",
2452
- {
2453
- style: wrapperStyle,
2454
- className: "calendar-custom-cell",
2455
- children: [
2456
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
1966
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: wrapperStyle, className: "calendar-custom-cell", children: [
1967
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
2457
1968
  .calendar-custom-cell .ant-picker-cell {
2458
1969
  padding: 6px !important;
2459
1970
  }
@@ -2488,136 +1999,134 @@ var DateTimePicker = ({
2488
1999
  line-height: 48px !important;
2489
2000
  }
2490
2001
  ` }),
2491
- /* @__PURE__ */ jsxRuntime.jsx(
2492
- antd.Calendar,
2493
- {
2494
- fullscreen: false,
2495
- value: selectedDate,
2496
- onChange: (date) => setSelectedDate(date),
2497
- headerRender: ({ value, onChange }) => {
2498
- const year = value.year();
2499
- const month = value.month();
2500
- const yearOptions = Array.from({ length: 20 }, (_, i) => {
2501
- const label = year - 10 + i;
2502
- return { label, value: label };
2503
- });
2504
- const monthOptions = value.localeData().months().map((label, index) => ({
2505
- label,
2506
- value: index
2507
- }));
2508
- const monthText = monthOptions?.find((item) => {
2509
- return item?.value === month;
2510
- });
2511
- setSelectMonth(monthText?.label || "");
2512
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
2513
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
2514
- /* @__PURE__ */ jsxRuntime.jsx(
2515
- antd.Select,
2516
- {
2517
- value: month,
2518
- options: monthOptions,
2519
- onChange: (newMonth) => {
2520
- const now = value.clone().month(newMonth);
2521
- onChange(now);
2522
- },
2523
- variant: "borderless",
2524
- className: "text-2xl font-medium",
2525
- popupMatchSelectWidth: false,
2526
- style: {
2527
- fontSize: "24px",
2528
- fontWeight: 500
2529
- }
2530
- }
2531
- ),
2532
- /* @__PURE__ */ jsxRuntime.jsx(
2533
- antd.Select,
2534
- {
2535
- value: year,
2536
- options: yearOptions,
2537
- onChange: (newYear) => {
2538
- const now = value.clone().year(newYear);
2539
- onChange(now);
2540
- },
2541
- variant: "borderless",
2542
- className: "text-2xl font-medium",
2543
- popupMatchSelectWidth: false,
2544
- style: {
2545
- fontSize: "24px",
2546
- fontWeight: 500
2547
- }
2548
- }
2549
- )
2550
- ] }),
2551
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2552
- /* @__PURE__ */ jsxRuntime.jsx(
2553
- "button",
2002
+ /* @__PURE__ */ jsxRuntime.jsx(
2003
+ antd.Calendar,
2004
+ {
2005
+ fullscreen: false,
2006
+ value: selectedDate,
2007
+ onChange: (date) => setSelectedDate(date),
2008
+ headerRender: ({ value, onChange }) => {
2009
+ const year = value.year();
2010
+ const month = value.month();
2011
+ const yearOptions = Array.from({ length: 20 }, (_, i) => {
2012
+ const label = year - 10 + i;
2013
+ return { label, value: label };
2014
+ });
2015
+ const monthOptions = value.localeData().months().map((label, index) => ({
2016
+ label,
2017
+ value: index
2018
+ }));
2019
+ const monthText = monthOptions?.find((item) => {
2020
+ return item?.value === month;
2021
+ });
2022
+ setSelectMonth(monthText?.label || "");
2023
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
2024
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
2025
+ /* @__PURE__ */ jsxRuntime.jsx(
2026
+ antd.Select,
2027
+ {
2028
+ value: month,
2029
+ options: monthOptions,
2030
+ onChange: (newMonth) => {
2031
+ const now = value.clone().month(newMonth);
2032
+ onChange(now);
2033
+ },
2034
+ variant: "borderless",
2035
+ className: "text-2xl font-medium",
2036
+ popupMatchSelectWidth: false,
2037
+ style: {
2038
+ fontSize: "24px",
2039
+ fontWeight: 500
2040
+ }
2041
+ }
2042
+ ),
2043
+ /* @__PURE__ */ jsxRuntime.jsx(
2044
+ antd.Select,
2045
+ {
2046
+ value: year,
2047
+ options: yearOptions,
2048
+ onChange: (newYear) => {
2049
+ const now = value.clone().year(newYear);
2050
+ onChange(now);
2051
+ },
2052
+ variant: "borderless",
2053
+ className: "text-2xl font-medium",
2054
+ popupMatchSelectWidth: false,
2055
+ style: {
2056
+ fontSize: "24px",
2057
+ fontWeight: 500
2058
+ }
2059
+ }
2060
+ )
2061
+ ] }),
2062
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2063
+ /* @__PURE__ */ jsxRuntime.jsx(
2064
+ "button",
2065
+ {
2066
+ onClick: () => {
2067
+ const newDate = value.subtract(1, "month");
2068
+ onChange(newDate);
2069
+ },
2070
+ className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2071
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2072
+ "svg",
2554
2073
  {
2555
- onClick: () => {
2556
- const newDate = value.subtract(1, "month");
2557
- onChange(newDate);
2558
- },
2559
- className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2074
+ width: "20",
2075
+ height: "20",
2076
+ viewBox: "0 0 20 20",
2077
+ fill: "none",
2078
+ xmlns: "http://www.w3.org/2000/svg",
2560
2079
  children: /* @__PURE__ */ jsxRuntime.jsx(
2561
- "svg",
2080
+ "path",
2562
2081
  {
2563
- width: "20",
2564
- height: "20",
2565
- viewBox: "0 0 20 20",
2566
- fill: "none",
2567
- xmlns: "http://www.w3.org/2000/svg",
2568
- children: /* @__PURE__ */ jsxRuntime.jsx(
2569
- "path",
2570
- {
2571
- d: "M12 16L6 10L12 4",
2572
- stroke: "currentColor",
2573
- strokeWidth: "2",
2574
- strokeLinecap: "round",
2575
- strokeLinejoin: "round"
2576
- }
2577
- )
2082
+ d: "M12 16L6 10L12 4",
2083
+ stroke: "currentColor",
2084
+ strokeWidth: "2",
2085
+ strokeLinecap: "round",
2086
+ strokeLinejoin: "round"
2578
2087
  }
2579
2088
  )
2580
2089
  }
2581
- ),
2582
- /* @__PURE__ */ jsxRuntime.jsx(
2583
- "button",
2090
+ )
2091
+ }
2092
+ ),
2093
+ /* @__PURE__ */ jsxRuntime.jsx(
2094
+ "button",
2095
+ {
2096
+ onClick: () => {
2097
+ const newDate = value.add(1, "month");
2098
+ onChange(newDate);
2099
+ },
2100
+ className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2101
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2102
+ "svg",
2584
2103
  {
2585
- onClick: () => {
2586
- const newDate = value.add(1, "month");
2587
- onChange(newDate);
2588
- },
2589
- className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2104
+ width: "20",
2105
+ height: "20",
2106
+ viewBox: "0 0 20 20",
2107
+ fill: "none",
2108
+ xmlns: "http://www.w3.org/2000/svg",
2590
2109
  children: /* @__PURE__ */ jsxRuntime.jsx(
2591
- "svg",
2110
+ "path",
2592
2111
  {
2593
- width: "20",
2594
- height: "20",
2595
- viewBox: "0 0 20 20",
2596
- fill: "none",
2597
- xmlns: "http://www.w3.org/2000/svg",
2598
- children: /* @__PURE__ */ jsxRuntime.jsx(
2599
- "path",
2600
- {
2601
- d: "M8 4L14 10L8 16",
2602
- stroke: "currentColor",
2603
- strokeWidth: "2",
2604
- strokeLinecap: "round",
2605
- strokeLinejoin: "round"
2606
- }
2607
- )
2112
+ d: "M8 4L14 10L8 16",
2113
+ stroke: "currentColor",
2114
+ strokeWidth: "2",
2115
+ strokeLinecap: "round",
2116
+ strokeLinejoin: "round"
2608
2117
  }
2609
2118
  )
2610
2119
  }
2611
2120
  )
2612
- ] })
2613
- ] });
2614
- },
2615
- onPanelChange
2616
- }
2617
- )
2618
- ]
2619
- }
2620
- )
2121
+ }
2122
+ )
2123
+ ] })
2124
+ ] });
2125
+ },
2126
+ onPanelChange
2127
+ }
2128
+ )
2129
+ ] })
2621
2130
  }
2622
2131
  ),
2623
2132
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-[24px] rounded-[12px] flex-1", children: [
@@ -2697,7 +2206,7 @@ var DateTimePicker = ({
2697
2206
  className: `
2698
2207
  rounded-[20px] w-full flex items-center justify-center gap-4 h-[76px]
2699
2208
  border text-center transition-colors
2700
- ${isSelected ? "border-[#3ADB67] bg-[#3ADB67] text-white cursor-pointer" : isAvailable ? "border-[#E4E5E6] hover:border-[#3ADB67] hover:bg-[#3ADB67] hover:text-white cursor-pointer" : "border-[#E4E5E6] bg-[#F5F5F5] text-[#BDBDBD] cursor-not-allowed"}
2209
+ ${isSelected ? "border-[#3ADB67] bg-[#3ADB67] text-white cursor-pointer" : isAvailable ? "border-[#E4E5E6] hover:border-[#3ADB67] hover:bg-[#3ADB67] cursor-pointer" : "border-[#E4E5E6] bg-[#F5F5F5] text-[#BDBDBD] cursor-not-allowed"}
2701
2210
  `,
2702
2211
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
2703
2212
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTimeslot(slot) }),
@@ -2719,11 +2228,12 @@ var DateTimePicker = ({
2719
2228
  ] }),
2720
2229
  showQuestionnaire && questionnaire && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-12", children: [
2721
2230
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[48px] font-bold text-center mb-8", children: "Fill out Form" }),
2722
- questionnaireLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-[#767880] py-8", children: "Loading questionnaire..." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8", children: /* @__PURE__ */ jsxRuntime.jsx(
2231
+ questionnaireLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-[#767880] py-8", children: "Loading questionnaire..." }) : /* @__PURE__ */ jsxRuntime.jsx(
2723
2232
  QuestionnaireForm,
2724
2233
  {
2725
2234
  questions: questionnaire.questions,
2726
2235
  loading: bookingLoading,
2236
+ pageData,
2727
2237
  onSubmit: async (responses) => {
2728
2238
  try {
2729
2239
  const customerName = responses.name || responses.customer_name || "";
@@ -2748,7 +2258,7 @@ var DateTimePicker = ({
2748
2258
  }
2749
2259
  }
2750
2260
  }
2751
- ) })
2261
+ )
2752
2262
  ] }),
2753
2263
  bookingError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-8 p-4 bg-red-50 border border-red-200 rounded-lg text-red-600 max-w-2xl mx-auto", children: [
2754
2264
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: "Booking failed" }),
@@ -2757,11 +2267,310 @@ var DateTimePicker = ({
2757
2267
  ] });
2758
2268
  };
2759
2269
  var DateTimePicker_default = DateTimePicker;
2270
+ var Navigation;
2271
+ var Pagination;
2272
+ var Autoplay;
2273
+ var swiperVersion = "11+";
2274
+ try {
2275
+ const modules = __require("swiper/modules");
2276
+ Navigation = modules.Navigation;
2277
+ Pagination = modules.Pagination;
2278
+ Autoplay = modules.Autoplay;
2279
+ swiperVersion = "11+";
2280
+ } catch (e) {
2281
+ try {
2282
+ const SwiperCore = __require("swiper");
2283
+ const SwiperNavigation = __require("swiper/modules/navigation");
2284
+ const SwiperPagination = __require("swiper/modules/pagination");
2285
+ const SwiperAutoplay = __require("swiper/modules/autoplay");
2286
+ const SwiperClass = SwiperCore.default || SwiperCore;
2287
+ if (SwiperClass && SwiperClass.use) {
2288
+ SwiperClass.use([
2289
+ SwiperNavigation.default || SwiperNavigation,
2290
+ SwiperPagination.default || SwiperPagination,
2291
+ SwiperAutoplay.default || SwiperAutoplay
2292
+ ]);
2293
+ }
2294
+ Navigation = SwiperNavigation.default || SwiperNavigation;
2295
+ Pagination = SwiperPagination.default || SwiperPagination;
2296
+ Autoplay = SwiperAutoplay.default || SwiperAutoplay;
2297
+ swiperVersion = "8";
2298
+ } catch (e2) {
2299
+ console.warn("Failed to load swiper modules:", e2);
2300
+ }
2301
+ }
2302
+ if (typeof window !== "undefined") {
2303
+ try {
2304
+ __require("swiper/css");
2305
+ __require("swiper/css/navigation");
2306
+ __require("swiper/css/pagination");
2307
+ } catch (e) {
2308
+ try {
2309
+ __require("swiper/swiper.min.css");
2310
+ __require("swiper/modules/navigation/navigation.min.css");
2311
+ __require("swiper/modules/pagination/pagination.min.css");
2312
+ } catch (e2) {
2313
+ console.warn("Failed to load swiper styles");
2314
+ }
2315
+ }
2316
+ }
2317
+ var defaultDescriptions = [
2318
+ "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
2319
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos."
2320
+ ];
2321
+ var defaultImages = [
2322
+ "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
2323
+ "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
2324
+ ];
2325
+ var DemoRoomDetail = ({
2326
+ apiClient,
2327
+ demoRoomCode,
2328
+ locale,
2329
+ title: titleProp,
2330
+ descriptions: descriptionsProp,
2331
+ devices: devicesProp,
2332
+ address: addressProp,
2333
+ mapsLink,
2334
+ images: imagesProp,
2335
+ className,
2336
+ ...props
2337
+ }) => {
2338
+ const {
2339
+ data: demoRoom,
2340
+ loading,
2341
+ error
2342
+ } = useDemoRoom(
2343
+ apiClient,
2344
+ demoRoomCode || "",
2345
+ locale,
2346
+ { enabled: !!apiClient && !!demoRoomCode }
2347
+ );
2348
+ const title = demoRoom?.name || titleProp || "Design District Demo Room";
2349
+ const descriptions = demoRoom?.description ? [demoRoom.description] : descriptionsProp || defaultDescriptions;
2350
+ const devices = demoRoom?.description || devicesProp || "eufyMake E1, eufyMake M5";
2351
+ const address = demoRoom?.address || addressProp || "1111 8th St, San Francisco, CA United States 94108";
2352
+ const images = demoRoom?.images && demoRoom.images.length > 0 ? demoRoom.images : imagesProp || defaultImages;
2353
+ const googleMapsLink = mapsLink || (() => {
2354
+ if (demoRoom?.latitude && demoRoom?.longitude) {
2355
+ return `https://www.google.com/maps/search/?api=1&query=${demoRoom.latitude},${demoRoom.longitude}`;
2356
+ } else {
2357
+ return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;
2358
+ }
2359
+ })();
2360
+ if (loading && apiClient && demoRoomCode) {
2361
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
2362
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2363
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12 bg-gray-200 rounded animate-pulse" }),
2364
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-24 bg-gray-200 rounded animate-pulse" }),
2365
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
2366
+ ] }),
2367
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
2368
+ ] }) });
2369
+ }
2370
+ if (error && apiClient && demoRoomCode) {
2371
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center text-red-600 py-8", children: [
2372
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-medium", children: "Failed to load demo room details" }),
2373
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", children: error.message })
2374
+ ] }) });
2375
+ }
2376
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
2377
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2378
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
2379
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsxRuntime.jsx(
2380
+ "p",
2381
+ {
2382
+ className: "text-base text-gray-600 leading-relaxed",
2383
+ children: desc
2384
+ },
2385
+ index
2386
+ )) }),
2387
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
2388
+ /* @__PURE__ */ jsxRuntime.jsxs(
2389
+ "svg",
2390
+ {
2391
+ width: "24",
2392
+ height: "24",
2393
+ viewBox: "0 0 24 24",
2394
+ fill: "none",
2395
+ xmlns: "http://www.w3.org/2000/svg",
2396
+ className: "flex-shrink-0 mt-0.5",
2397
+ children: [
2398
+ /* @__PURE__ */ jsxRuntime.jsx(
2399
+ "rect",
2400
+ {
2401
+ x: "3",
2402
+ y: "3",
2403
+ width: "18",
2404
+ height: "18",
2405
+ rx: "2",
2406
+ stroke: "currentColor",
2407
+ strokeWidth: "2"
2408
+ }
2409
+ ),
2410
+ /* @__PURE__ */ jsxRuntime.jsx(
2411
+ "path",
2412
+ {
2413
+ d: "M8 10H16",
2414
+ stroke: "currentColor",
2415
+ strokeWidth: "2",
2416
+ strokeLinecap: "round"
2417
+ }
2418
+ ),
2419
+ /* @__PURE__ */ jsxRuntime.jsx(
2420
+ "path",
2421
+ {
2422
+ d: "M8 14H16",
2423
+ stroke: "currentColor",
2424
+ strokeWidth: "2",
2425
+ strokeLinecap: "round"
2426
+ }
2427
+ )
2428
+ ]
2429
+ }
2430
+ ),
2431
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900", children: devices })
2432
+ ] }),
2433
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
2434
+ /* @__PURE__ */ jsxRuntime.jsxs(
2435
+ "svg",
2436
+ {
2437
+ width: "24",
2438
+ height: "24",
2439
+ viewBox: "0 0 24 24",
2440
+ fill: "none",
2441
+ xmlns: "http://www.w3.org/2000/svg",
2442
+ className: "flex-shrink-0 mt-0.5",
2443
+ children: [
2444
+ /* @__PURE__ */ jsxRuntime.jsx(
2445
+ "path",
2446
+ {
2447
+ d: "M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2Z",
2448
+ stroke: "currentColor",
2449
+ strokeWidth: "2",
2450
+ strokeLinecap: "round",
2451
+ strokeLinejoin: "round"
2452
+ }
2453
+ ),
2454
+ /* @__PURE__ */ jsxRuntime.jsx(
2455
+ "circle",
2456
+ {
2457
+ cx: "12",
2458
+ cy: "9",
2459
+ r: "2.5",
2460
+ stroke: "currentColor",
2461
+ strokeWidth: "2"
2462
+ }
2463
+ )
2464
+ ]
2465
+ }
2466
+ ),
2467
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
2468
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: address }),
2469
+ /* @__PURE__ */ jsxRuntime.jsxs(
2470
+ "a",
2471
+ {
2472
+ href: googleMapsLink,
2473
+ target: "_blank",
2474
+ rel: "noopener noreferrer",
2475
+ className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
2476
+ children: [
2477
+ "Open in Google Maps",
2478
+ /* @__PURE__ */ jsxRuntime.jsx(
2479
+ "svg",
2480
+ {
2481
+ width: "12",
2482
+ height: "12",
2483
+ viewBox: "0 0 12 12",
2484
+ fill: "none",
2485
+ xmlns: "http://www.w3.org/2000/svg",
2486
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2487
+ "path",
2488
+ {
2489
+ d: "M3 9L9 3M9 3H3M9 3V9",
2490
+ stroke: "currentColor",
2491
+ strokeWidth: "1.5",
2492
+ strokeLinecap: "round",
2493
+ strokeLinejoin: "round"
2494
+ }
2495
+ )
2496
+ }
2497
+ )
2498
+ ]
2499
+ }
2500
+ )
2501
+ ] })
2502
+ ] })
2503
+ ] }),
2504
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
2505
+ react.Swiper,
2506
+ {
2507
+ ...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
2508
+ spaceBetween: 0,
2509
+ slidesPerView: 1,
2510
+ navigation: true,
2511
+ pagination: { clickable: true },
2512
+ autoplay: {
2513
+ delay: 3e3,
2514
+ disableOnInteraction: false
2515
+ },
2516
+ loop: true,
2517
+ className: "h-full rounded-2xl",
2518
+ children: images.map((img, index) => /* @__PURE__ */ jsxRuntime.jsx(react.SwiperSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(
2519
+ "img",
2520
+ {
2521
+ src: img,
2522
+ alt: `Demo room view ${index + 1}`,
2523
+ className: "w-full h-full object-cover"
2524
+ }
2525
+ ) }) }, index))
2526
+ }
2527
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
2528
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
2529
+ "svg",
2530
+ {
2531
+ width: "32",
2532
+ height: "32",
2533
+ viewBox: "0 0 32 32",
2534
+ fill: "none",
2535
+ xmlns: "http://www.w3.org/2000/svg",
2536
+ children: [
2537
+ /* @__PURE__ */ jsxRuntime.jsx(
2538
+ "rect",
2539
+ {
2540
+ x: "4",
2541
+ y: "8",
2542
+ width: "24",
2543
+ height: "16",
2544
+ rx: "2",
2545
+ stroke: "currentColor",
2546
+ strokeWidth: "2"
2547
+ }
2548
+ ),
2549
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
2550
+ /* @__PURE__ */ jsxRuntime.jsx(
2551
+ "path",
2552
+ {
2553
+ d: "M28 20L22 14L16 20",
2554
+ stroke: "currentColor",
2555
+ strokeWidth: "2",
2556
+ strokeLinecap: "round",
2557
+ strokeLinejoin: "round"
2558
+ }
2559
+ )
2560
+ ]
2561
+ }
2562
+ ) }),
2563
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 text-sm", children: "Demo Room Images" })
2564
+ ] }) }) })
2565
+ ] }) });
2566
+ };
2567
+ DemoRoomDetail.displayName = "DemoRoomDetail";
2760
2568
  var BookingForm = ({
2761
2569
  layoutClassName,
2762
2570
  className,
2763
2571
  apiConfig,
2764
2572
  demoRoomCode,
2573
+ pageData,
2765
2574
  timezone,
2766
2575
  handleBookingSuccess,
2767
2576
  ...props
@@ -2771,24 +2580,15 @@ var BookingForm = ({
2771
2580
  [apiConfig]
2772
2581
  );
2773
2582
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2774
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), ...props, children: [
2775
- /* @__PURE__ */ jsxRuntime.jsx(
2776
- BreadCrumbs,
2777
- {
2778
- className: layoutClassName,
2779
- items: [{ label: "Home", link: "/" }, { label: "Demo Room" }]
2780
- }
2781
- ),
2782
- /* @__PURE__ */ jsxRuntime.jsx(
2783
- DemoRoomDetail,
2784
- {
2785
- className: cn("mt-8", layoutClassName),
2786
- apiClient,
2787
- demoRoomCode,
2788
- locale: apiConfig.locale
2789
- }
2790
- )
2791
- ] }),
2583
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
2584
+ DemoRoomDetail,
2585
+ {
2586
+ className: cn("mt-8", layoutClassName),
2587
+ apiClient,
2588
+ demoRoomCode,
2589
+ locale: apiConfig.locale
2590
+ }
2591
+ ) }),
2792
2592
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-[#f5f5f5]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
2793
2593
  DateTimePicker_default,
2794
2594
  {
@@ -2796,7 +2596,8 @@ var BookingForm = ({
2796
2596
  demoRoomCode,
2797
2597
  timezone,
2798
2598
  locale: apiConfig.locale,
2799
- onBookingSuccess: handleBookingSuccess
2599
+ onBookingSuccess: handleBookingSuccess,
2600
+ pageData
2800
2601
  }
2801
2602
  ) }) })
2802
2603
  ] });
@@ -2806,24 +2607,29 @@ var BookingSuccess = ({
2806
2607
  bookingData: initialBookingData,
2807
2608
  token,
2808
2609
  apiConfig,
2809
- onBackToHome,
2610
+ onScheduleAgain,
2611
+ onCancelSuccess,
2810
2612
  className
2811
2613
  }) => {
2812
- const [bookingData, setBookingData] = React2.useState(initialBookingData || null);
2614
+ const [bookingData, setBookingData] = React2.useState(
2615
+ initialBookingData || null
2616
+ );
2813
2617
  const [loading, setLoading] = React2.useState(false);
2814
- const [error, setError] = React2.useState(null);
2618
+ const [isCancelled, setIsCancelled] = React2.useState(false);
2619
+ const [showCancelDialog, setShowCancelDialog] = React2.useState(false);
2620
+ const [cancelLoading, setCancelLoading] = React2.useState(false);
2621
+ const [cancelError, setCancelError] = React2.useState(null);
2815
2622
  React2.useEffect(() => {
2816
2623
  if (token && apiConfig && !initialBookingData) {
2817
2624
  const fetchBookingData = async () => {
2818
2625
  setLoading(true);
2819
- setError(null);
2820
2626
  try {
2821
2627
  const apiClient = createDemoRoomApi(apiConfig);
2822
- const booking = await apiClient.getBooking(token);
2628
+ const booking = await apiClient.getBooking(token, apiConfig.locale);
2823
2629
  setBookingData(booking);
2630
+ setIsCancelled(booking.status === "cancelled");
2824
2631
  } catch (err) {
2825
2632
  console.error("Failed to fetch booking data:", err);
2826
- setError("Failed to load booking information");
2827
2633
  } finally {
2828
2634
  setLoading(false);
2829
2635
  }
@@ -2831,142 +2637,267 @@ var BookingSuccess = ({
2831
2637
  fetchBookingData();
2832
2638
  }
2833
2639
  }, [token, apiConfig, initialBookingData]);
2640
+ const handleCancelAppointment = async () => {
2641
+ if (!token || !apiConfig) {
2642
+ setCancelError("Unable to cancel: Missing token or API configuration");
2643
+ return;
2644
+ }
2645
+ setCancelLoading(true);
2646
+ setCancelError(null);
2647
+ try {
2648
+ const apiClient = createDemoRoomApi(apiConfig);
2649
+ const cancelledBooking = await apiClient.cancelBooking(
2650
+ token,
2651
+ apiConfig.locale
2652
+ );
2653
+ if (cancelledBooking) {
2654
+ setBookingData(cancelledBooking);
2655
+ }
2656
+ setIsCancelled(true);
2657
+ setShowCancelDialog(false);
2658
+ if (onCancelSuccess && cancelledBooking) {
2659
+ onCancelSuccess(cancelledBooking);
2660
+ }
2661
+ } catch (err) {
2662
+ console.error("Failed to cancel booking:", err);
2663
+ setCancelError("Failed to cancel appointment. Please try again.");
2664
+ } finally {
2665
+ setCancelLoading(false);
2666
+ }
2667
+ };
2834
2668
  if (loading) {
2835
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen bg-[#F5F5F5] py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-2xl mx-auto text-center", children: [
2836
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin w-16 h-16 mx-auto mb-4 border-4 border-[#3ADB67] border-t-transparent rounded-full" }),
2837
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xl text-gray-600", children: "Loading booking information..." })
2838
- ] }) });
2669
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-3xl mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "animate-pulse space-y-6", children: [
2670
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 bg-gray-200 rounded w-1/3" }),
2671
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-24 bg-gray-200 rounded" }),
2672
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
2673
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-20 bg-gray-200 rounded" }),
2674
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-20 bg-gray-200 rounded" }),
2675
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-20 bg-gray-200 rounded" })
2676
+ ] })
2677
+ ] }) }) });
2839
2678
  }
2840
- if (error || !bookingData) {
2841
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen bg-[#F5F5F5] py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-2xl mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-[12px] border border-red-200 p-8 text-center", children: [
2842
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 mx-auto mb-4 rounded-full bg-red-100 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
2843
- "svg",
2679
+ if (!bookingData) {
2680
+ return null;
2681
+ }
2682
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-3xl mx-auto", children: [
2683
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children: "Your Appointment" }),
2684
+ isCancelled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg p-6 mb-8 flex items-center justify-between", children: [
2685
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-700", children: "This appointment has been canceled." }),
2686
+ onScheduleAgain && /* @__PURE__ */ jsxRuntime.jsx(
2687
+ "button",
2844
2688
  {
2845
- width: "32",
2846
- height: "32",
2847
- viewBox: "0 0 24 24",
2848
- fill: "none",
2849
- xmlns: "http://www.w3.org/2000/svg",
2850
- children: /* @__PURE__ */ jsxRuntime.jsx(
2851
- "path",
2689
+ onClick: onScheduleAgain,
2690
+ className: "px-6 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors whitespace-nowrap",
2691
+ children: "Schedule again"
2692
+ }
2693
+ )
2694
+ ] }),
2695
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-8 bg-white px-[48px] py-[32px] rounded-lg", children: [
2696
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2697
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Location" }),
2698
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
2699
+ bookingData.demoroom_name && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base font-medium text-gray-900", children: bookingData.demoroom_name }),
2700
+ bookingData.address && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-600", children: bookingData.address }),
2701
+ bookingData.latitude && bookingData.longitude && /* @__PURE__ */ jsxRuntime.jsx(
2702
+ "a",
2852
2703
  {
2853
- d: "M12 8V12M12 16H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",
2854
- stroke: "#EF4444",
2855
- strokeWidth: "2",
2856
- strokeLinecap: "round",
2857
- strokeLinejoin: "round"
2704
+ href: `https://www.google.com/maps/search/?api=1&query=${bookingData.latitude},${bookingData.longitude}`,
2705
+ target: "_blank",
2706
+ rel: "noopener noreferrer",
2707
+ className: "inline-flex items-center gap-1 text-base text-blue-600 hover:text-blue-700 hover:underline",
2708
+ children: "Open in Google Maps \u2197"
2858
2709
  }
2859
2710
  )
2860
- }
2861
- ) }),
2862
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: error || "Booking Not Found" }),
2863
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-600 mb-6", children: "We couldn't find your booking information. Please check your booking confirmation email or contact support." }),
2864
- onBackToHome && /* @__PURE__ */ jsxRuntime.jsx(
2711
+ ] })
2712
+ ] }),
2713
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2714
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Date and Time" }),
2715
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-base text-gray-900", children: [
2716
+ bookingData.booking_date,
2717
+ bookingData.time_slot && `, ${bookingData.time_slot}`,
2718
+ !bookingData.time_slot && bookingData.booking_time && `, ${bookingData.booking_time}`
2719
+ ] })
2720
+ ] }),
2721
+ bookingData.equipment && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2722
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Event" }),
2723
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: bookingData.equipment })
2724
+ ] }),
2725
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2726
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Demo Room" }),
2727
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: bookingData.demoroom_code })
2728
+ ] }),
2729
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2730
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Visitor Info" }),
2731
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
2732
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-gray-900", children: bookingData.customer_name }),
2733
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
2734
+ /* @__PURE__ */ jsxRuntime.jsx(
2735
+ "svg",
2736
+ {
2737
+ className: "w-5 h-5",
2738
+ fill: "none",
2739
+ viewBox: "0 0 24 24",
2740
+ stroke: "currentColor",
2741
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2742
+ "path",
2743
+ {
2744
+ strokeLinecap: "round",
2745
+ strokeLinejoin: "round",
2746
+ strokeWidth: 2,
2747
+ d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
2748
+ }
2749
+ )
2750
+ }
2751
+ ),
2752
+ bookingData.phone_code && bookingData.phone_number ? /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2753
+ bookingData.phone_code,
2754
+ " ",
2755
+ bookingData.phone_number
2756
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "No phone provided" })
2757
+ ] }),
2758
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
2759
+ /* @__PURE__ */ jsxRuntime.jsx(
2760
+ "svg",
2761
+ {
2762
+ className: "w-5 h-5",
2763
+ fill: "none",
2764
+ viewBox: "0 0 24 24",
2765
+ stroke: "currentColor",
2766
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2767
+ "path",
2768
+ {
2769
+ strokeLinecap: "round",
2770
+ strokeLinejoin: "round",
2771
+ strokeWidth: 2,
2772
+ d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
2773
+ }
2774
+ )
2775
+ }
2776
+ ),
2777
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: bookingData.customer_email })
2778
+ ] })
2779
+ ] })
2780
+ ] })
2781
+ ] }),
2782
+ !isCancelled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-[64px]", children: [
2783
+ /* @__PURE__ */ jsxRuntime.jsx(
2865
2784
  "button",
2866
2785
  {
2867
- onClick: onBackToHome,
2868
- className: "px-6 py-3 rounded-full bg-[#3ADB67] text-white font-medium text-base hover:bg-[#2FC257] transition-colors focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2869
- children: "Back to Home"
2786
+ onClick: () => setShowCancelDialog(true),
2787
+ disabled: cancelLoading,
2788
+ className: "text-[14px] cursor-pointer w-fit rounded-full text-[#080A0F] border border-[#080A0F] px-[20px] py-[10px] leading-[1] hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
2789
+ children: "Cancel Appointment"
2870
2790
  }
2871
- )
2872
- ] }) }) });
2873
- }
2874
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `min-h-screen bg-[#F5F5F5] py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-2xl mx-auto", children: [
2875
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [
2876
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 mx-auto mb-6 rounded-full bg-[#3ADB67] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
2877
- "svg",
2791
+ ),
2792
+ cancelError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: cancelError })
2793
+ ] }),
2794
+ showCancelDialog && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 px-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-[24px] max-w-[400px] p-8 shadow-xl relative", children: [
2795
+ /* @__PURE__ */ jsxRuntime.jsx(
2796
+ "button",
2878
2797
  {
2879
- width: "48",
2880
- height: "48",
2881
- viewBox: "0 0 32 32",
2882
- fill: "none",
2883
- xmlns: "http://www.w3.org/2000/svg",
2798
+ onClick: () => setShowCancelDialog(false),
2799
+ disabled: cancelLoading,
2800
+ className: "absolute top-6 right-[30px] w-8 h-8 flex items-center justify-center text-gray-400 hover:text-gray-600 transition-colors disabled:opacity-50",
2801
+ "aria-label": "Close",
2884
2802
  children: /* @__PURE__ */ jsxRuntime.jsx(
2885
- "path",
2803
+ "svg",
2886
2804
  {
2887
- d: "M26.6667 8L12 22.6667L5.33334 16",
2888
- stroke: "white",
2889
- strokeWidth: "3",
2890
- strokeLinecap: "round",
2891
- strokeLinejoin: "round"
2805
+ width: "24",
2806
+ height: "24",
2807
+ viewBox: "0 0 24 24",
2808
+ fill: "none",
2809
+ xmlns: "http://www.w3.org/2000/svg",
2810
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2811
+ "path",
2812
+ {
2813
+ d: "M18 6L6 18M6 6L18 18",
2814
+ stroke: "currentColor",
2815
+ strokeWidth: "2",
2816
+ strokeLinecap: "round",
2817
+ strokeLinejoin: "round"
2818
+ }
2819
+ )
2892
2820
  }
2893
2821
  )
2894
2822
  }
2895
- ) }),
2896
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[48px] font-bold text-gray-900 mb-4", children: "Booking Confirmed!" }),
2897
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xl text-gray-600", children: "Your demo room booking has been successfully confirmed." })
2898
- ] }),
2899
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8 mb-6", children: [
2900
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: "Booking Details" }),
2901
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
2902
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
2903
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-600 font-medium", children: "Booking ID" }),
2904
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.booking_id })
2905
- ] }),
2906
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
2907
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-600 font-medium", children: "Date" }),
2908
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.booking_date })
2909
- ] }),
2910
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
2911
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-600 font-medium", children: "Time" }),
2912
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.booking_time })
2913
- ] }),
2914
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
2915
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-600 font-medium", children: "Status" }),
2916
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-[#3ADB67] bg-opacity-10 text-[#3ADB67]", children: bookingData.status })
2917
- ] }),
2918
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start py-3", children: [
2919
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-600 font-medium", children: "Email" }),
2920
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.customer_email })
2921
- ] })
2922
- ] })
2923
- ] }),
2924
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-[12px] p-6 mb-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
2925
- /* @__PURE__ */ jsxRuntime.jsx(
2823
+ ),
2824
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 rounded-full bg-[#F59E0B] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
2926
2825
  "svg",
2927
2826
  {
2928
- className: "w-6 h-6 text-blue-600 flex-shrink-0 mt-0.5",
2827
+ width: "32",
2828
+ height: "32",
2829
+ viewBox: "0 0 32 32",
2929
2830
  fill: "none",
2930
- viewBox: "0 0 24 24",
2931
- stroke: "currentColor",
2831
+ xmlns: "http://www.w3.org/2000/svg",
2932
2832
  children: /* @__PURE__ */ jsxRuntime.jsx(
2933
2833
  "path",
2934
2834
  {
2835
+ d: "M16 10V17M16 22H16.01",
2836
+ stroke: "white",
2837
+ strokeWidth: "3",
2935
2838
  strokeLinecap: "round",
2936
- strokeLinejoin: "round",
2937
- strokeWidth: 2,
2938
- d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
2839
+ strokeLinejoin: "round"
2939
2840
  }
2940
2841
  )
2941
2842
  }
2942
- ),
2943
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2944
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-blue-900 mb-1", children: "Confirmation Email Sent" }),
2945
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-blue-800", children: [
2946
- "A confirmation email has been sent to ",
2947
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: bookingData.customer_email }),
2948
- " with all the booking details and instructions."
2949
- ] })
2843
+ ) }) }),
2844
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [
2845
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[18px] font-semibold text-gray-900 mb-2", children: "Are you sure you want to cancel?" }),
2846
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[14px] text-gray-600", children: "You won't be able to restore the schedule." })
2847
+ ] }),
2848
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 justify-center", children: [
2849
+ /* @__PURE__ */ jsxRuntime.jsx(
2850
+ "button",
2851
+ {
2852
+ onClick: () => setShowCancelDialog(false),
2853
+ disabled: cancelLoading,
2854
+ className: "px-8 py-3 border-2 border-black rounded-full text-black font-medium hover:bg-gray-50 transition-colors disabled:opacity-50 min-w-[120px]",
2855
+ children: "Back"
2856
+ }
2857
+ ),
2858
+ /* @__PURE__ */ jsxRuntime.jsx(
2859
+ "button",
2860
+ {
2861
+ onClick: handleCancelAppointment,
2862
+ disabled: cancelLoading,
2863
+ className: "px-8 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors disabled:opacity-50 flex items-center gap-2 min-w-[180px] justify-center",
2864
+ children: cancelLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2865
+ /* @__PURE__ */ jsxRuntime.jsxs(
2866
+ "svg",
2867
+ {
2868
+ className: "animate-spin h-5 w-5",
2869
+ xmlns: "http://www.w3.org/2000/svg",
2870
+ fill: "none",
2871
+ viewBox: "0 0 24 24",
2872
+ children: [
2873
+ /* @__PURE__ */ jsxRuntime.jsx(
2874
+ "circle",
2875
+ {
2876
+ className: "opacity-25",
2877
+ cx: "12",
2878
+ cy: "12",
2879
+ r: "10",
2880
+ stroke: "currentColor",
2881
+ strokeWidth: "4"
2882
+ }
2883
+ ),
2884
+ /* @__PURE__ */ jsxRuntime.jsx(
2885
+ "path",
2886
+ {
2887
+ className: "opacity-75",
2888
+ fill: "currentColor",
2889
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
2890
+ }
2891
+ )
2892
+ ]
2893
+ }
2894
+ ),
2895
+ "Canceling..."
2896
+ ] }) : "Cancel Appointment"
2897
+ }
2898
+ )
2950
2899
  ] })
2951
- ] }) }),
2952
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col sm:flex-row gap-4", children: [
2953
- onBackToHome && /* @__PURE__ */ jsxRuntime.jsx(
2954
- "button",
2955
- {
2956
- onClick: onBackToHome,
2957
- className: "flex-1 px-6 py-4 rounded-full bg-[#3ADB67] text-white font-medium text-base hover:bg-[#2FC257] transition-colors focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2958
- children: "Back to Home"
2959
- }
2960
- ),
2961
- /* @__PURE__ */ jsxRuntime.jsx(
2962
- "button",
2963
- {
2964
- onClick: () => window.print(),
2965
- className: "flex-1 px-6 py-4 rounded-full border-2 border-[#3ADB67] text-[#3ADB67] font-medium text-base hover:bg-[#3ADB67] hover:bg-opacity-5 transition-colors focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2966
- children: "Print Confirmation"
2967
- }
2968
- )
2969
- ] })
2900
+ ] }) })
2970
2901
  ] }) });
2971
2902
  };
2972
2903
 
@@ -3112,10 +3043,11 @@ exports.BookingForm = BookingForm;
3112
3043
  exports.BookingSuccess = BookingSuccess;
3113
3044
  exports.DemoRoom = DemoRoom;
3114
3045
  exports.DemoRoomApiClient = DemoRoomApiClient;
3115
- exports.DemoRoomDetail = DemoRoomDetail;
3116
3046
  exports.ThemeProvider = ThemeProvider;
3117
3047
  exports.cn = cn;
3118
3048
  exports.createDemoRoomApi = createDemoRoomApi;
3049
+ exports.useBooking = useBooking;
3050
+ exports.useCancelBooking = useCancelBooking;
3119
3051
  exports.useCreateBooking = useCreateBooking;
3120
3052
  exports.useDemoRoom = useDemoRoom;
3121
3053
  exports.useDemoRooms = useDemoRooms;