@anker-in/ui 0.3.8 → 0.3.10-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10927,6 +10927,9 @@ var QuestionnaireForm2 = ({
10927
10927
  questions,
10928
10928
  onSubmit,
10929
10929
  onCancel,
10930
+ onFormStart,
10931
+ onFormFieldChange,
10932
+ onFormSubmit,
10930
10933
  pageData,
10931
10934
  selectedTimeslotId,
10932
10935
  loading = false,
@@ -11038,6 +11041,52 @@ var QuestionnaireForm2 = ({
11038
11041
  const getQuestionId = (question) => {
11039
11042
  return question.key || question.id || "";
11040
11043
  };
11044
+ const hasFormStartedRef = React15.useRef(false);
11045
+ const emitFormStart = () => {
11046
+ if (hasFormStartedRef.current) return;
11047
+ hasFormStartedRef.current = true;
11048
+ onFormStart?.();
11049
+ };
11050
+ const lastReportedValuesRef = React15.useRef({});
11051
+ const totalSteps = visibleQuestions.length + (pageData?.agrees?.length || 0);
11052
+ const stripHtml = (html) => html.replace(/<[^>]+>/g, "").trim();
11053
+ const resolveOptionLabel = (question, rawValue) => {
11054
+ const option = question?.options?.find(
11055
+ (opt) => (opt.value || opt.label) === rawValue
11056
+ );
11057
+ return option?.label || rawValue;
11058
+ };
11059
+ const getStepIndex = (questionId) => {
11060
+ const index = visibleQuestions.findIndex(
11061
+ (q) => getQuestionId(q) === questionId
11062
+ );
11063
+ return index >= 0 ? index + 1 : 0;
11064
+ };
11065
+ const emitFieldChange = (ctx) => {
11066
+ onFormFieldChange?.({
11067
+ stepIndex: getStepIndex(ctx.questionId),
11068
+ totalSteps,
11069
+ fieldId: ctx.questionId,
11070
+ fieldLabel: ctx.fieldLabel,
11071
+ fieldType: ctx.fieldType,
11072
+ value: ctx.value
11073
+ });
11074
+ };
11075
+ const emitBlurFieldChange = (question, rawValue) => {
11076
+ const questionId = getQuestionId(question);
11077
+ const trimmed = rawValue.trim();
11078
+ if (!trimmed || trimmed === lastReportedValuesRef.current[questionId]) {
11079
+ return false;
11080
+ }
11081
+ lastReportedValuesRef.current[questionId] = trimmed;
11082
+ emitFieldChange({
11083
+ questionId,
11084
+ fieldLabel: question.label,
11085
+ fieldType: question.type,
11086
+ value: trimmed
11087
+ });
11088
+ return true;
11089
+ };
11041
11090
  const handleChange = (questionId, value) => {
11042
11091
  setResponses((prev) => ({
11043
11092
  ...prev,
@@ -11071,6 +11120,13 @@ var QuestionnaireForm2 = ({
11071
11120
  ...prev,
11072
11121
  [questionId]: code
11073
11122
  }));
11123
+ const question = visibleQuestions.find(
11124
+ (q) => getQuestionId(q) === questionId
11125
+ );
11126
+ const phoneNumber = String(responses[questionId] || "").trim();
11127
+ if (question && phoneNumber) {
11128
+ emitBlurFieldChange(question, `${code} ${phoneNumber}`);
11129
+ }
11074
11130
  };
11075
11131
  const handleCheckboxChange = (questionId, optionValue, checked) => {
11076
11132
  const currentValues = responses[questionId] || [];
@@ -11078,6 +11134,7 @@ var QuestionnaireForm2 = ({
11078
11134
  handleChange(questionId, newValues);
11079
11135
  };
11080
11136
  const handleAgreementChange = (index, checked) => {
11137
+ emitFormStart();
11081
11138
  setAgreements((prev) => ({
11082
11139
  ...prev,
11083
11140
  [index]: checked
@@ -11085,6 +11142,15 @@ var QuestionnaireForm2 = ({
11085
11142
  if (checked && agreementError) {
11086
11143
  setAgreementError("");
11087
11144
  }
11145
+ const agreeContent = pageData?.agrees?.[index] || "";
11146
+ onFormFieldChange?.({
11147
+ stepIndex: visibleQuestions.length + index + 1,
11148
+ totalSteps,
11149
+ fieldId: `agreement-${index}`,
11150
+ fieldLabel: stripHtml(agreeContent),
11151
+ fieldType: "agreement",
11152
+ value: checked
11153
+ });
11088
11154
  };
11089
11155
  const handleOtherInputChange = (questionId, value) => {
11090
11156
  setOtherInputs((prev) => ({
@@ -11144,6 +11210,7 @@ var QuestionnaireForm2 = ({
11144
11210
  }
11145
11211
  }
11146
11212
  });
11213
+ onFormSubmit?.({ responses: finalResponses });
11147
11214
  onSubmit?.(finalResponses);
11148
11215
  } else {
11149
11216
  setTimeout(() => {
@@ -11170,6 +11237,7 @@ var QuestionnaireForm2 = ({
11170
11237
  type: question.type,
11171
11238
  value: responses[questionId] || "",
11172
11239
  onChange: (e) => handleChange(questionId, e.target.value),
11240
+ onBlur: () => emitBlurFieldChange(question, String(responses[questionId] || "")),
11173
11241
  placeholder: question.placeholder,
11174
11242
  className: cn(
11175
11243
  "w-full px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
@@ -11185,7 +11253,12 @@ var QuestionnaireForm2 = ({
11185
11253
  type: "email",
11186
11254
  value: responses[questionId] || "",
11187
11255
  onChange: (e) => handleChange(questionId, e.target.value),
11188
- onBlur: (e) => handleEmailBlur(questionId, e.target.value),
11256
+ onBlur: (e) => {
11257
+ handleEmailBlur(questionId, e.target.value);
11258
+ if (e.target.value.trim() && EMAIL_REGEX.test(e.target.value)) {
11259
+ emitBlurFieldChange(question, e.target.value);
11260
+ }
11261
+ },
11189
11262
  placeholder: question.placeholder,
11190
11263
  className: cn(
11191
11264
  "w-full px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
@@ -11240,6 +11313,13 @@ var QuestionnaireForm2 = ({
11240
11313
  type: "tel",
11241
11314
  value: responses[questionId] || "",
11242
11315
  onChange: (e) => handleChange(questionId, e.target.value),
11316
+ onBlur: () => {
11317
+ const code = phoneCountryCodes[questionId] || "+1";
11318
+ const phoneNumber = String(responses[questionId] || "").trim();
11319
+ if (phoneNumber) {
11320
+ emitBlurFieldChange(question, `${code} ${phoneNumber}`);
11321
+ }
11322
+ },
11243
11323
  placeholder: question.placeholder,
11244
11324
  className: cn(
11245
11325
  "flex-1 px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
@@ -11255,6 +11335,7 @@ var QuestionnaireForm2 = ({
11255
11335
  {
11256
11336
  value: responses[questionId] || "",
11257
11337
  onChange: (e) => handleChange(questionId, e.target.value),
11338
+ onBlur: () => emitBlurFieldChange(question, String(responses[questionId] || "")),
11258
11339
  placeholder: question.placeholder,
11259
11340
  rows: 4,
11260
11341
  className: cn(
@@ -11278,7 +11359,16 @@ var QuestionnaireForm2 = ({
11278
11359
  name: questionId,
11279
11360
  value: option.value || option.label,
11280
11361
  checked: responses[questionId] === (option.value || option.label),
11281
- onChange: (e) => handleChange(questionId, e.target.value),
11362
+ onChange: (e) => {
11363
+ emitFormStart();
11364
+ handleChange(questionId, e.target.value);
11365
+ emitFieldChange({
11366
+ questionId,
11367
+ fieldLabel: question.label,
11368
+ fieldType: "radio",
11369
+ value: resolveOptionLabel(question, e.target.value)
11370
+ });
11371
+ },
11282
11372
  className: "w-5 h-5 appearance-none cursor-pointer flex-shrink-0",
11283
11373
  style: {
11284
11374
  backgroundImage: responses[questionId] === (option.value || option.label) ? "url(https://cdn.shopify.com/s/files/1/0569/5147/2268/files/SelectBox.png?v=1769507941)" : "url(https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Frame_2121235232_2.png?v=1769507995)",
@@ -11310,15 +11400,23 @@ var QuestionnaireForm2 = ({
11310
11400
  value: optionValue,
11311
11401
  checked: isOtherOption ? isOtherSelected : responses[questionId] === optionValue,
11312
11402
  onChange: (e) => {
11403
+ emitFormStart();
11313
11404
  if (isOtherOption) {
11314
11405
  handleChange(questionId, "__other__");
11315
11406
  setOtherInputs((prev) => ({
11316
11407
  ...prev,
11317
11408
  [questionId]: ""
11318
11409
  }));
11319
- } else {
11320
- handleChange(questionId, e.target.value);
11410
+ return;
11321
11411
  }
11412
+ handleChange(questionId, e.target.value);
11413
+ lastReportedValuesRef.current[questionId] = e.target.value;
11414
+ emitFieldChange({
11415
+ questionId,
11416
+ fieldLabel: question.label,
11417
+ fieldType: "radio_with_other",
11418
+ value: resolveOptionLabel(question, e.target.value)
11419
+ });
11322
11420
  },
11323
11421
  className: "w-5 h-5 appearance-none cursor-pointer flex-shrink-0",
11324
11422
  style: {
@@ -11337,6 +11435,10 @@ var QuestionnaireForm2 = ({
11337
11435
  type: "text",
11338
11436
  value: otherInputs[questionId] || "",
11339
11437
  onChange: (e) => handleOtherInputChange(questionId, e.target.value),
11438
+ onBlur: () => emitBlurFieldChange(
11439
+ question,
11440
+ String(otherInputs[questionId] || "")
11441
+ ),
11340
11442
  placeholder: question.placeholder || "Please specify...",
11341
11443
  className: cn(
11342
11444
  "w-full px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
@@ -11364,11 +11466,25 @@ var QuestionnaireForm2 = ({
11364
11466
  {
11365
11467
  type: "checkbox",
11366
11468
  checked: isChecked,
11367
- onChange: (e) => handleCheckboxChange(
11368
- questionId,
11369
- optionValue,
11370
- e.target.checked
11371
- ),
11469
+ onChange: (e) => {
11470
+ emitFormStart();
11471
+ handleCheckboxChange(
11472
+ questionId,
11473
+ optionValue,
11474
+ e.target.checked
11475
+ );
11476
+ const newChecked = e.target.checked ? [...responses[questionId] || [], optionValue] : (responses[questionId] || []).filter(
11477
+ (v) => v !== optionValue
11478
+ );
11479
+ emitFieldChange({
11480
+ questionId,
11481
+ fieldLabel: question.label,
11482
+ fieldType: "checkbox",
11483
+ value: newChecked.map(
11484
+ (v) => resolveOptionLabel(question, v)
11485
+ )
11486
+ });
11487
+ },
11372
11488
  className: "w-4 h-4 text-[#fff] rounded",
11373
11489
  style: {
11374
11490
  accentColor: "#080A0F"
@@ -11392,7 +11508,16 @@ var QuestionnaireForm2 = ({
11392
11508
  "select",
11393
11509
  {
11394
11510
  value: defaultValue,
11395
- onChange: (e) => handleChange(questionId, e.target.value),
11511
+ onChange: (e) => {
11512
+ emitFormStart();
11513
+ handleChange(questionId, e.target.value);
11514
+ emitFieldChange({
11515
+ questionId,
11516
+ fieldLabel: question.label,
11517
+ fieldType: "select",
11518
+ value: resolveOptionLabel(question, e.target.value)
11519
+ });
11520
+ },
11396
11521
  className: cn(
11397
11522
  "w-full px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
11398
11523
  "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
@@ -11414,118 +11539,130 @@ var QuestionnaireForm2 = ({
11414
11539
  return null;
11415
11540
  }
11416
11541
  };
11417
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pb-[80px] light", children: [
11418
- visibleQuestions && visibleQuestions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-[12px] p-8 dark:bg-white l:p-4", children: /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: visibleQuestions.map((question) => {
11419
- const questionId = getQuestionId(question);
11420
- const hasError = !!errors[questionId];
11421
- return /* @__PURE__ */ jsxRuntime.jsxs(
11422
- "div",
11423
- {
11424
- className: "space-y-2",
11425
- "data-has-error": hasError ? "true" : "false",
11426
- children: [
11427
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "block", children: [
11428
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-base font-bold text-[#080A0F] dark:text-[#080A0F]", children: [
11429
- question.label,
11430
- question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500 ml-1", children: "*" })
11431
- ] }),
11432
- question.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm text-gray-600 dark:text-gray-600 font-bold mt-1", children: question.description }),
11433
- question.type === "email" && questionId === "email" && pageData?.emailDescription && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm text-gray-600 dark:text-gray-600 font-bold mt-1", children: pageData.emailDescription })
11434
- ] }),
11435
- renderQuestion(question),
11436
- question.hint && !errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-500 font-bold", children: question.hint }),
11437
- errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx(
11438
- "p",
11542
+ return /* @__PURE__ */ jsxRuntime.jsxs(
11543
+ "div",
11544
+ {
11545
+ className: "pb-[80px] light",
11546
+ onFocusCapture: (e) => {
11547
+ const tag = e.target?.tagName;
11548
+ if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") {
11549
+ emitFormStart();
11550
+ }
11551
+ },
11552
+ children: [
11553
+ visibleQuestions && visibleQuestions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-[12px] p-8 dark:bg-white l:p-4", children: /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: visibleQuestions.map((question) => {
11554
+ const questionId = getQuestionId(question);
11555
+ const hasError = !!errors[questionId];
11556
+ return /* @__PURE__ */ jsxRuntime.jsxs(
11557
+ "div",
11558
+ {
11559
+ className: "space-y-2",
11560
+ "data-has-error": hasError ? "true" : "false",
11561
+ children: [
11562
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "block", children: [
11563
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-base font-bold text-[#080A0F] dark:text-[#080A0F]", children: [
11564
+ question.label,
11565
+ question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500 ml-1", children: "*" })
11566
+ ] }),
11567
+ question.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm text-gray-600 dark:text-gray-600 font-bold mt-1", children: question.description }),
11568
+ question.type === "email" && questionId === "email" && pageData?.emailDescription && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm text-gray-600 dark:text-gray-600 font-bold mt-1", children: pageData.emailDescription })
11569
+ ] }),
11570
+ renderQuestion(question),
11571
+ question.hint && !errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-500 font-bold", children: question.hint }),
11572
+ errors[questionId] && /* @__PURE__ */ jsxRuntime.jsx(
11573
+ "p",
11574
+ {
11575
+ className: "text-sm font-bold",
11576
+ style: { color: "#FF4D4D" },
11577
+ children: errors[questionId]
11578
+ }
11579
+ )
11580
+ ]
11581
+ },
11582
+ questionId
11583
+ );
11584
+ }) }) }),
11585
+ !!selectedTimeslotId && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col justify-center", children: [
11586
+ pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
11587
+ "div",
11588
+ {
11589
+ className: "space-y-4 mt-8",
11590
+ "data-has-error": agreementError ? "true" : "false",
11591
+ children: [
11592
+ pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
11593
+ /* @__PURE__ */ jsxRuntime.jsx(
11594
+ "input",
11595
+ {
11596
+ type: "checkbox",
11597
+ id: `agreement-${index}`,
11598
+ checked: agreements[index] || false,
11599
+ onChange: (e) => handleAgreementChange(index, e.target.checked),
11600
+ className: "w-4 h-4 border border-[#080A0F] rounded text-[#fff] cursor-pointer flex-shrink-0",
11601
+ style: {
11602
+ accentColor: "#080A0F"
11603
+ }
11604
+ }
11605
+ ),
11606
+ /* @__PURE__ */ jsxRuntime.jsx(
11607
+ "label",
11608
+ {
11609
+ htmlFor: `agreement-${index}`,
11610
+ className: "text-sm text-gray-700 dark:text-gray-700 font-bold cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
11611
+ dangerouslySetInnerHTML: { __html: agreeContent },
11612
+ "aria-label": `Agreement ${index + 1}`
11613
+ }
11614
+ )
11615
+ ] }, index)),
11616
+ agreementError && /* @__PURE__ */ jsxRuntime.jsx(
11617
+ "p",
11618
+ {
11619
+ className: "text-sm font-bold mt-2",
11620
+ style: { color: "#FF4D4D" },
11621
+ children: agreementError
11622
+ }
11623
+ )
11624
+ ]
11625
+ }
11626
+ ),
11627
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
11628
+ /* @__PURE__ */ jsxRuntime.jsx(
11629
+ "button",
11439
11630
  {
11440
- className: "text-sm font-bold",
11441
- style: { color: "#FF4D4D" },
11442
- children: errors[questionId]
11631
+ type: "submit",
11632
+ disabled: loading,
11633
+ onClick: handleSubmit,
11634
+ className: cn(
11635
+ "w-fit mt-6 px-6 py-4 rounded-full",
11636
+ "bg-[#080A0F] text-white font-bold text-base",
11637
+ "hover:bg-[#2FC257] hover:text-[#080A0F] transition-colors",
11638
+ "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
11639
+ "disabled:opacity-50 disabled:cursor-not-allowed"
11640
+ ),
11641
+ children: loading ? pageData?.submitting || "Submitting..." : pageData?.submit || "Submit Booking"
11443
11642
  }
11444
- )
11445
- ]
11446
- },
11447
- questionId
11448
- );
11449
- }) }) }),
11450
- !!selectedTimeslotId && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col justify-center", children: [
11451
- pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
11452
- "div",
11453
- {
11454
- className: "space-y-4 mt-8",
11455
- "data-has-error": agreementError ? "true" : "false",
11456
- children: [
11457
- pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
11458
- /* @__PURE__ */ jsxRuntime.jsx(
11459
- "input",
11460
- {
11461
- type: "checkbox",
11462
- id: `agreement-${index}`,
11463
- checked: agreements[index] || false,
11464
- onChange: (e) => handleAgreementChange(index, e.target.checked),
11465
- className: "w-4 h-4 border border-[#080A0F] rounded text-[#fff] cursor-pointer flex-shrink-0",
11466
- style: {
11467
- accentColor: "#080A0F"
11468
- }
11469
- }
11470
- ),
11471
- /* @__PURE__ */ jsxRuntime.jsx(
11472
- "label",
11473
- {
11474
- htmlFor: `agreement-${index}`,
11475
- className: "text-sm text-gray-700 dark:text-gray-700 font-bold cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
11476
- dangerouslySetInnerHTML: { __html: agreeContent },
11477
- "aria-label": `Agreement ${index + 1}`
11478
- }
11479
- )
11480
- ] }, index)),
11481
- agreementError && /* @__PURE__ */ jsxRuntime.jsx(
11482
- "p",
11643
+ ),
11644
+ pageData?.discardEdit && !!initialResponses && /* @__PURE__ */ jsxRuntime.jsx(
11645
+ "button",
11483
11646
  {
11484
- className: "text-sm font-bold mt-2",
11485
- style: { color: "#FF4D4D" },
11486
- children: agreementError
11647
+ type: "submit",
11648
+ onClick: () => {
11649
+ onCancel?.();
11650
+ },
11651
+ className: cn(
11652
+ "w-fit mt-6 px-6 py-4 rounded-full",
11653
+ "border-[#080A0F] border-2 text-[#080A0F] font-bold text-base",
11654
+ "transition-colors",
11655
+ "disabled:opacity-50 disabled:cursor-not-allowed"
11656
+ ),
11657
+ children: pageData?.discardEdit
11487
11658
  }
11488
11659
  )
11489
- ]
11490
- }
11491
- ),
11492
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
11493
- /* @__PURE__ */ jsxRuntime.jsx(
11494
- "button",
11495
- {
11496
- type: "submit",
11497
- disabled: loading,
11498
- onClick: handleSubmit,
11499
- className: cn(
11500
- "w-fit mt-6 px-6 py-4 rounded-full",
11501
- "bg-[#080A0F] text-white font-bold text-base",
11502
- "hover:bg-[#2FC257] hover:text-[#080A0F] transition-colors",
11503
- "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
11504
- "disabled:opacity-50 disabled:cursor-not-allowed"
11505
- ),
11506
- children: loading ? pageData?.submitting || "Submitting..." : pageData?.submit || "Submit Booking"
11507
- }
11508
- ),
11509
- pageData?.discardEdit && !!initialResponses && /* @__PURE__ */ jsxRuntime.jsx(
11510
- "button",
11511
- {
11512
- type: "submit",
11513
- onClick: () => {
11514
- onCancel?.();
11515
- },
11516
- className: cn(
11517
- "w-fit mt-6 px-6 py-4 rounded-full",
11518
- "border-[#080A0F] border-2 text-[#080A0F] font-bold text-base",
11519
- "transition-colors",
11520
- "disabled:opacity-50 disabled:cursor-not-allowed"
11521
- ),
11522
- children: pageData?.discardEdit
11523
- }
11524
- )
11525
- ] }),
11526
- error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center w-full p-4", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[#FF4D4D] font-bold", children: pageData?.errorMsg?.[String(error.code)] || pageData?.errorMsg?.[error.code || ""] || error.message }) })
11527
- ] })
11528
- ] });
11660
+ ] }),
11661
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center w-full p-4", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[#FF4D4D] font-bold", children: pageData?.errorMsg?.[String(error.code)] || pageData?.errorMsg?.[error.code || ""] || error.message }) })
11662
+ ] })
11663
+ ]
11664
+ }
11665
+ );
11529
11666
  };
11530
11667
  dayjs4__default.default.extend(dayLocaleData__default.default);
11531
11668
  dayjs4__default.default.extend(weekday__default.default);
@@ -11545,7 +11682,8 @@ var DateTimePicker2 = ({
11545
11682
  onBookingSuccess,
11546
11683
  onQuestionnaireSubmit,
11547
11684
  selectedPurposeType,
11548
- podDesignId
11685
+ podDesignId,
11686
+ trackCallbacks
11549
11687
  }) => {
11550
11688
  const { token: themeToken } = antd.theme.useToken();
11551
11689
  const [selectedDate, setSelectedDate] = React15.useState(
@@ -11934,9 +12072,14 @@ var DateTimePicker2 = ({
11934
12072
  {
11935
12073
  fullscreen: false,
11936
12074
  value: calendarValue,
11937
- onSelect: (date) => {
12075
+ onSelect: (date, info) => {
11938
12076
  setSelectedDate(date);
11939
12077
  setCalendarValue(date);
12078
+ if (info?.source === "date") {
12079
+ trackCallbacks?.onDateSelect?.({
12080
+ date: date.format("YYYY-MM-DD")
12081
+ });
12082
+ }
11940
12083
  },
11941
12084
  onPanelChange: (date) => {
11942
12085
  setCalendarValue(date);
@@ -12024,6 +12167,10 @@ var DateTimePicker2 = ({
12024
12167
  onClick: () => {
12025
12168
  const newDate = value.subtract(1, "month");
12026
12169
  onChange(newDate);
12170
+ trackCallbacks?.onMonthChange?.({
12171
+ direction: "left",
12172
+ month: newDate.format("YYYY-MM")
12173
+ });
12027
12174
  },
12028
12175
  className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
12029
12176
  children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -12054,6 +12201,10 @@ var DateTimePicker2 = ({
12054
12201
  onClick: () => {
12055
12202
  const newDate = value.add(1, "month");
12056
12203
  onChange(newDate);
12204
+ trackCallbacks?.onMonthChange?.({
12205
+ direction: "right",
12206
+ month: newDate.format("YYYY-MM")
12207
+ });
12057
12208
  },
12058
12209
  className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
12059
12210
  children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -12101,6 +12252,10 @@ var DateTimePicker2 = ({
12101
12252
  if (!newDate.isBefore(dayjs4__default.default(), "day")) {
12102
12253
  setSelectedDate(newDate);
12103
12254
  setCalendarValue(newDate);
12255
+ trackCallbacks?.onDateStepClick?.({
12256
+ direction: "left",
12257
+ date: newDate.format("YYYY-MM-DD")
12258
+ });
12104
12259
  }
12105
12260
  }
12106
12261
  },
@@ -12134,6 +12289,10 @@ var DateTimePicker2 = ({
12134
12289
  const newDate = selectedDate.add(1, "day");
12135
12290
  setSelectedDate(newDate);
12136
12291
  setCalendarValue(newDate);
12292
+ trackCallbacks?.onDateStepClick?.({
12293
+ direction: "right",
12294
+ date: newDate.format("YYYY-MM-DD")
12295
+ });
12137
12296
  }
12138
12297
  },
12139
12298
  disabled: !selectedDate,
@@ -12170,6 +12329,10 @@ var DateTimePicker2 = ({
12170
12329
  onClick: () => {
12171
12330
  if (isAvailable) {
12172
12331
  setSelectedTimeslotId(slot.id);
12332
+ trackCallbacks?.onTimeslotSelect?.({
12333
+ slotId: slot.id,
12334
+ label: formatTimeslot(slot)
12335
+ });
12173
12336
  }
12174
12337
  },
12175
12338
  className: `
@@ -12207,6 +12370,9 @@ var DateTimePicker2 = ({
12207
12370
  selectedTimeslotId,
12208
12371
  error: bookingError || editError,
12209
12372
  initialResponses,
12373
+ onFormStart: trackCallbacks?.onFormStart,
12374
+ onFormFieldChange: trackCallbacks?.onFormFieldChange,
12375
+ onFormSubmit: trackCallbacks?.onFormSubmit,
12210
12376
  onCancel: () => {
12211
12377
  onBookingSuccess?.(token || "");
12212
12378
  },
@@ -12289,6 +12455,8 @@ var DemoRoomDetail2 = ({
12289
12455
  openInGoogleMaps: "Open in Google Maps",
12290
12456
  demoRoomImages: "Demo Room Images"
12291
12457
  },
12458
+ onGoogleMapsClick,
12459
+ onImageSlideChange,
12292
12460
  className,
12293
12461
  ...props
12294
12462
  }) => {
@@ -12317,6 +12485,7 @@ var DemoRoomDetail2 = ({
12317
12485
  }
12318
12486
  return "#";
12319
12487
  })();
12488
+ const userSlideTriggerRef = React15.useRef(null);
12320
12489
  const isLoading = isManagedByParent ? !!demoRoomLoading : loading && shouldFetch;
12321
12490
  if (isLoading) {
12322
12491
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full pb-4", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
@@ -12430,6 +12599,12 @@ var DemoRoomDetail2 = ({
12430
12599
  href: googleMapsLink,
12431
12600
  target: "_blank",
12432
12601
  rel: "noopener noreferrer",
12602
+ onClick: () => {
12603
+ onGoogleMapsClick?.({
12604
+ demoRoomName: title,
12605
+ url: googleMapsLink
12606
+ });
12607
+ },
12433
12608
  className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
12434
12609
  children: [
12435
12610
  pageData.openInGoogleMaps,
@@ -12459,8 +12634,27 @@ var DemoRoomDetail2 = ({
12459
12634
  ] })
12460
12635
  ] })
12461
12636
  ] }),
12462
- images.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative l:w-full min-l:h-[400px] rounded-2xl overflow-hidden demo-room-swiper", children: [
12463
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
12637
+ images.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
12638
+ "div",
12639
+ {
12640
+ className: "relative l:w-full min-l:h-[400px] rounded-2xl overflow-hidden demo-room-swiper",
12641
+ onClickCapture: (e) => {
12642
+ const target = e.target;
12643
+ const bullet = target.closest(".swiper-pagination-bullet");
12644
+ if (bullet && !bullet.classList.contains("swiper-pagination-bullet-active")) {
12645
+ userSlideTriggerRef.current = "pagination";
12646
+ return;
12647
+ }
12648
+ if (target.closest(".swiper-button-prev")) {
12649
+ userSlideTriggerRef.current = "prev";
12650
+ return;
12651
+ }
12652
+ if (target.closest(".swiper-button-next")) {
12653
+ userSlideTriggerRef.current = "next";
12654
+ }
12655
+ },
12656
+ children: [
12657
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
12464
12658
  .demo-room-swiper .swiper-pagination-bullet {
12465
12659
  background-color: rgba(255, 255, 255, 0.5);
12466
12660
  }
@@ -12490,31 +12684,53 @@ var DemoRoomDetail2 = ({
12490
12684
  right: 16px !important;
12491
12685
  }
12492
12686
  ` }),
12493
- /* @__PURE__ */ jsxRuntime.jsx(
12494
- Swiper2,
12495
- {
12496
- modules: [Navigation, Pagination, Autoplay],
12497
- spaceBetween: 0,
12498
- slidesPerView: 1,
12499
- navigation: images.length > 1,
12500
- pagination: images.length > 1 ? { clickable: true } : false,
12501
- autoplay: images.length > 1 ? {
12502
- delay: 3e3,
12503
- disableOnInteraction: false
12504
- } : false,
12505
- loop: images.length > 1,
12506
- className: "h-full rounded-2xl",
12507
- children: images.map((img, index) => /* @__PURE__ */ jsxRuntime.jsx(SwiperSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(
12508
- "img",
12687
+ /* @__PURE__ */ jsxRuntime.jsx(
12688
+ Swiper2,
12509
12689
  {
12510
- src: img,
12511
- alt: `Demo room view ${index + 1}`,
12512
- className: "w-full h-full object-cover"
12690
+ modules: [Navigation, Pagination, Autoplay],
12691
+ spaceBetween: 0,
12692
+ slidesPerView: 1,
12693
+ navigation: images.length > 1,
12694
+ pagination: images.length > 1 ? { clickable: true } : false,
12695
+ autoplay: images.length > 1 ? {
12696
+ delay: 3e3,
12697
+ disableOnInteraction: false
12698
+ } : false,
12699
+ loop: images.length > 1,
12700
+ className: "h-full rounded-2xl",
12701
+ onSliderFirstMove: () => {
12702
+ userSlideTriggerRef.current = "swipe";
12703
+ },
12704
+ onTouchEnd: () => {
12705
+ setTimeout(() => {
12706
+ if (userSlideTriggerRef.current === "swipe") {
12707
+ userSlideTriggerRef.current = null;
12708
+ }
12709
+ }, 0);
12710
+ },
12711
+ onSlideChange: (swiper) => {
12712
+ const trigger = userSlideTriggerRef.current;
12713
+ if (!trigger) return;
12714
+ userSlideTriggerRef.current = null;
12715
+ onImageSlideChange?.({
12716
+ trigger,
12717
+ activeIndex: swiper.realIndex,
12718
+ imageUrl: images[swiper.realIndex] || ""
12719
+ });
12720
+ },
12721
+ children: images.map((img, index) => /* @__PURE__ */ jsxRuntime.jsx(SwiperSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(
12722
+ "img",
12723
+ {
12724
+ src: img,
12725
+ alt: `Demo room view ${index + 1}`,
12726
+ className: "w-full h-full object-cover"
12727
+ }
12728
+ ) }) }, index))
12513
12729
  }
12514
- ) }) }, index))
12515
- }
12516
- )
12517
- ] })
12730
+ )
12731
+ ]
12732
+ }
12733
+ )
12518
12734
  ]
12519
12735
  }
12520
12736
  ) });
@@ -12546,7 +12762,8 @@ function buildMirWelcomeUrl({
12546
12762
  credential,
12547
12763
  currentUrl,
12548
12764
  managerIdParam = "email",
12549
- credentialParam = "credential"
12765
+ credentialParam = "credential",
12766
+ ref
12550
12767
  }) {
12551
12768
  const url = new URL(baseUrl);
12552
12769
  if (language) {
@@ -12555,26 +12772,72 @@ function buildMirWelcomeUrl({
12555
12772
  url.searchParams.set("countrycode", countrycode);
12556
12773
  url.searchParams.set(managerIdParam, managerId);
12557
12774
  url.searchParams.set(credentialParam, credential);
12775
+ if (ref) {
12776
+ url.searchParams.set("ref", ref);
12777
+ }
12558
12778
  const redirectSource = sanitizeRedirectSource(
12559
12779
  currentUrl ?? (typeof window !== "undefined" ? window.location.href : "")
12560
12780
  );
12561
12781
  url.searchParams.set("redirect_url", encodeURIComponent(redirectSource));
12562
12782
  return url.toString();
12563
12783
  }
12564
- var ChevronIcon2 = () => /* @__PURE__ */ jsxRuntime.jsx(
12784
+ var PurposeCheckedIcon = () => /* @__PURE__ */ jsxRuntime.jsxs(
12565
12785
  "svg",
12566
12786
  {
12567
12787
  xmlns: "http://www.w3.org/2000/svg",
12568
- width: "24",
12569
- height: "24",
12570
- viewBox: "0 0 24 24",
12788
+ width: "20",
12789
+ height: "20",
12790
+ viewBox: "0 0 20 20",
12571
12791
  fill: "none",
12572
12792
  "aria-hidden": "true",
12793
+ className: "shrink-0",
12794
+ children: [
12795
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0.8", y: "0.8", width: "18.4", height: "18.4", rx: "9.2", fill: "#000F16" }),
12796
+ /* @__PURE__ */ jsxRuntime.jsx(
12797
+ "rect",
12798
+ {
12799
+ x: "0.8",
12800
+ y: "0.8",
12801
+ width: "18.4",
12802
+ height: "18.4",
12803
+ rx: "9.2",
12804
+ stroke: "#000F16",
12805
+ strokeWidth: "1.6"
12806
+ }
12807
+ ),
12808
+ /* @__PURE__ */ jsxRuntime.jsx(
12809
+ "path",
12810
+ {
12811
+ d: "M6 9.58333L8.94737 12.5L14 7.5",
12812
+ strokeWidth: "1.6",
12813
+ strokeLinecap: "round",
12814
+ strokeLinejoin: "round",
12815
+ stroke: "white"
12816
+ }
12817
+ )
12818
+ ]
12819
+ }
12820
+ );
12821
+ var PurposeRadioIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
12822
+ "svg",
12823
+ {
12824
+ xmlns: "http://www.w3.org/2000/svg",
12825
+ width: "20",
12826
+ height: "20",
12827
+ viewBox: "0 0 20 20",
12828
+ fill: "none",
12829
+ "aria-hidden": "true",
12830
+ className: "shrink-0",
12573
12831
  children: /* @__PURE__ */ jsxRuntime.jsx(
12574
- "path",
12832
+ "rect",
12575
12833
  {
12576
- d: "M16.7661 9.23364C17.078 9.5455 17.0779 10.0516 16.7661 10.3635L12.5991 14.5305C12.2874 14.842 11.782 14.8418 11.4702 14.5305L7.30322 10.3635C6.99135 10.0516 6.99135 9.54552 7.30322 9.23364C7.615 8.9221 8.1203 8.92219 8.43213 9.23364L12.0347 12.8362L15.6362 9.23364C15.9481 8.92183 16.4543 8.92181 16.7661 9.23364Z",
12577
- fill: "currentColor"
12834
+ x: "0.8",
12835
+ y: "0.8",
12836
+ width: "18.4",
12837
+ height: "18.4",
12838
+ rx: "9.2",
12839
+ stroke: "currentColor",
12840
+ strokeWidth: "1.6"
12578
12841
  }
12579
12842
  )
12580
12843
  }
@@ -12647,6 +12910,8 @@ var BookingFormO2O = ({
12647
12910
  timezone: timezone5,
12648
12911
  handleBookingSuccess,
12649
12912
  onQuestionnaireSubmit,
12913
+ podDesignRef,
12914
+ trackCallbacks,
12650
12915
  ...props
12651
12916
  }) => {
12652
12917
  const apiClient = React15.useMemo(
@@ -12744,7 +13009,8 @@ var BookingFormO2O = ({
12744
13009
  managerId: effectiveStoreManagerId,
12745
13010
  credential: effectiveMirSessionId,
12746
13011
  managerIdParam: "store_manager_id",
12747
- credentialParam: "sessionid"
13012
+ credentialParam: "sessionid",
13013
+ ref: podDesignRef
12748
13014
  });
12749
13015
  }
12750
13016
  if (!managerId) return void 0;
@@ -12755,7 +13021,8 @@ var BookingFormO2O = ({
12755
13021
  language: apiConfig?.podLanguage,
12756
13022
  countrycode: apiConfig?.podCountry,
12757
13023
  managerId,
12758
- credential: mirCredential
13024
+ credential: mirCredential,
13025
+ ref: podDesignRef
12759
13026
  });
12760
13027
  }, [
12761
13028
  isPodButtonDisabled,
@@ -12767,7 +13034,8 @@ var BookingFormO2O = ({
12767
13034
  apiConfig?.podCountry,
12768
13035
  mirCredential,
12769
13036
  effectiveStoreManagerId,
12770
- effectiveMirSessionId
13037
+ effectiveMirSessionId,
13038
+ podDesignRef
12771
13039
  ]);
12772
13040
  const dateTimePickerPageData = React15.useMemo(
12773
13041
  () => ({
@@ -12786,7 +13054,9 @@ var BookingFormO2O = ({
12786
13054
  demoRoom,
12787
13055
  demoRoomLoading,
12788
13056
  locale: apiConfig.locale,
12789
- pageData: pageData?.demoRoomDetail
13057
+ pageData: pageData?.demoRoomDetail,
13058
+ onGoogleMapsClick: trackCallbacks?.onGoogleMapsClick,
13059
+ onImageSlideChange: trackCallbacks?.onImageSlideChange
12790
13060
  }
12791
13061
  ) }),
12792
13062
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-[#f5f5f5]", children: [
@@ -12808,44 +13078,91 @@ var BookingFormO2O = ({
12808
13078
  isPodSelected && "grid-cols-2"
12809
13079
  ),
12810
13080
  children: [
12811
- /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "rounded-[16px] bg-white px-[28px] py-[24px] l:px-[16px] l:py-[20px]", children: [
12812
- /* @__PURE__ */ jsxRuntime.jsx(
12813
- "label",
12814
- {
12815
- htmlFor: "booking-purpose-select",
12816
- className: "block text-[16px] font-bold text-[#080A0F] l:text-[14px]",
12817
- children: getPurposeLabel(pageData)
12818
- }
12819
- ),
12820
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative mt-[14px]", children: [
12821
- /* @__PURE__ */ jsxRuntime.jsx(
12822
- "select",
12823
- {
12824
- id: "booking-purpose-select",
12825
- value: selectedPurpose?.type || "",
12826
- onChange: (event2) => {
12827
- setSelectedPurposeType(event2.target.value);
12828
- setIsPurposeConfirmed(true);
12829
- },
12830
- disabled: !!token,
12831
- className: cn(
12832
- "h-[48px] w-full appearance-none rounded-[8px] border border-[#D9DCE1] bg-white px-[16px] pr-[48px] text-[16px] font-medium text-[#2A2C32] outline-none transition-colors focus:border-[#080A0F] focus:ring-2 focus:ring-[#3ADB67]/30 l:text-[14px]",
12833
- token && "pointer-events-none cursor-not-allowed opacity-50"
12834
- ),
12835
- children: purposeOptions.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
12836
- "option",
12837
- {
12838
- value: item.type || "",
12839
- children: item.label || item.type
12840
- },
12841
- `${item.type || item.label || "purpose"}-${index}`
12842
- ))
12843
- }
13081
+ /* @__PURE__ */ jsxRuntime.jsxs(
13082
+ "section",
13083
+ {
13084
+ className: cn(
13085
+ "flex flex-col rounded-[16px] bg-white px-[32px] py-[24px] l:px-[16px] l:py-[20px]",
13086
+ // 双栏时左卡高度由右侧 POD 卡撑开(与下拉版一致),选项列表内部滚动,
13087
+ // 避免选项+说明过多把左卡撑得比右卡高;h-0 让本卡不参与 grid 行高计算
13088
+ isPodSelected && "min-l:h-0 min-l:min-h-full min-l:overflow-hidden"
12844
13089
  ),
12845
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-[14px] top-1/2 flex -translate-y-1/2 text-[#080A0F]", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronIcon2, {}) })
12846
- ] }),
12847
- !!selectedPurpose?.purposeNote && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-[16px] max-w-[720px] text-[14px] font-medium leading-[1.35] text-[#080A0F] l:text-[13px]", children: selectedPurpose.purposeNote })
12848
- ] }),
13090
+ children: [
13091
+ /* @__PURE__ */ jsxRuntime.jsx(
13092
+ "p",
13093
+ {
13094
+ id: "booking-purpose-label",
13095
+ className: "block text-[16px] font-bold text-[#080A0F] l:text-[14px]",
13096
+ children: getPurposeLabel(pageData)
13097
+ }
13098
+ ),
13099
+ /* @__PURE__ */ jsxRuntime.jsx(
13100
+ "div",
13101
+ {
13102
+ role: "radiogroup",
13103
+ "aria-labelledby": "booking-purpose-label",
13104
+ className: cn(
13105
+ "mt-[14px] flex min-h-0 flex-col gap-[16px] overflow-y-auto pr-[4px]",
13106
+ // 仅桌面双栏时列表受右卡高度约束内部滚动;独占一行(未选 POD / 移动端)不限高
13107
+ isPodSelected && "min-l:flex-1"
13108
+ ),
13109
+ children: purposeOptions.map((item, index) => {
13110
+ const isSelected = !!item.type && selectedPurpose?.type === item.type;
13111
+ const selectItem = () => {
13112
+ if (token) return;
13113
+ setSelectedPurposeType(item.type || "");
13114
+ setIsPurposeConfirmed(true);
13115
+ };
13116
+ return /* @__PURE__ */ jsxRuntime.jsxs(
13117
+ "div",
13118
+ {
13119
+ role: "radio",
13120
+ "aria-checked": isSelected,
13121
+ tabIndex: token ? -1 : 0,
13122
+ onClick: selectItem,
13123
+ onKeyDown: (event2) => {
13124
+ if (event2.key === "Enter" || event2.key === " ") {
13125
+ event2.preventDefault();
13126
+ selectItem();
13127
+ }
13128
+ },
13129
+ className: cn(
13130
+ "shrink-0 cursor-pointer overflow-hidden rounded-[8px] bg-[#F5F6F7] outline-none",
13131
+ token && "pointer-events-none cursor-not-allowed"
13132
+ ),
13133
+ children: [
13134
+ /* @__PURE__ */ jsxRuntime.jsxs(
13135
+ "div",
13136
+ {
13137
+ className: cn(
13138
+ "group flex h-[60px] w-full items-center gap-[12px] px-[16px] text-left text-[16px] font-bold text-[#000F16] transition-[box-shadow,color] l:text-[14px]",
13139
+ isSelected ? "bg-[#93E0EC]" : "rounded-[8px] bg-white text-[#5A5E66] shadow-[inset_0_0_0_1px_#D9DCE1] hover:text-[#000F16] hover:shadow-[inset_0_0_0_1.6px_#00CBEB]"
13140
+ ),
13141
+ children: [
13142
+ /* @__PURE__ */ jsxRuntime.jsx(
13143
+ "span",
13144
+ {
13145
+ className: cn(
13146
+ !isSelected && "text-[#D9DCE1] group-hover:text-[#00CBEB]"
13147
+ ),
13148
+ children: isSelected ? /* @__PURE__ */ jsxRuntime.jsx(PurposeCheckedIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(PurposeRadioIcon, {})
13149
+ }
13150
+ ),
13151
+ item.label || item.type
13152
+ ]
13153
+ }
13154
+ ),
13155
+ !!item.purposeNote && /* @__PURE__ */ jsxRuntime.jsx("p", { className: " px-[16px] py-[8px] text-[14px] font-medium leading-[1.35] text-[#080A0F] l:text-[13px]", children: item.purposeNote })
13156
+ ]
13157
+ },
13158
+ `${item.type || item.label || "purpose"}-${index}`
13159
+ );
13160
+ })
13161
+ }
13162
+ )
13163
+ ]
13164
+ }
13165
+ ),
12849
13166
  isPodSelected && !!selectedPodContent && /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "rounded-[16px] bg-white px-[28px] py-[20px] l:px-[16px] l:py-[20px]", children: [
12850
13167
  !!selectedPodContent.title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[16px] font-bold text-[#080A0F] l:text-[14px]", children: selectedPodContent.title }),
12851
13168
  !!selectedPodDescription && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-[6px] text-[13px] font-medium leading-[1.35] text-[#080A0F] l:text-[12px]", children: selectedPodDescription }),
@@ -12867,7 +13184,15 @@ var BookingFormO2O = ({
12867
13184
  "aria-disabled": isPodButtonDisabled,
12868
13185
  tabIndex: isPodButtonDisabled ? -1 : void 0,
12869
13186
  onClick: (event2) => {
12870
- if (isPodButtonDisabled) event2.preventDefault();
13187
+ if (isPodButtonDisabled) {
13188
+ event2.preventDefault();
13189
+ return;
13190
+ }
13191
+ trackCallbacks?.onPodDesignClick?.({
13192
+ buttonText: selectedPodButtonText || "",
13193
+ url: selectedPodButtonLink || "",
13194
+ isEditMode: isPodDesignEditMode
13195
+ });
12871
13196
  },
12872
13197
  rel: "noopener noreferrer",
12873
13198
  className: cn(
@@ -12925,7 +13250,8 @@ var BookingFormO2O = ({
12925
13250
  onQuestionnaireSubmit,
12926
13251
  pageData: dateTimePickerPageData,
12927
13252
  selectedPurposeType: selectedPurpose?.type,
12928
- podDesignId: mirSessionId
13253
+ podDesignId: mirSessionId,
13254
+ trackCallbacks
12929
13255
  }
12930
13256
  ) })
12931
13257
  ] })