@burdenoff/microfe-tours 2026.624.1 → 2026.625.1

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.
@@ -7,15 +7,16 @@ import { useToursI18n as ee } from "../i18n.js";
7
7
  import { emitToursApiFailed as a } from "../telemetry.js";
8
8
  import { useTourBuilder as te } from "../hooks/useTourBuilder.js";
9
9
  import { useEffect as o, useMemo as s, useRef as ne, useState as c } from "react";
10
- import { PermissionGate as l } from "@burdenoff/fe-libs/shared/components";
11
- import { ArrowLeft as re, BarChart3 as ie, Calendar as ae, Eye as oe, LayoutTemplate as se, ListOrdered as ce, Save as le, Sparkles as ue } from "lucide-react";
12
- import { Fragment as de, jsx as u, jsxs as d } from "react/jsx-runtime";
10
+ import { PermissionGate as re } from "@burdenoff/fe-libs/shared/components";
11
+ import { ArrowLeft as ie, BarChart3 as ae, Calendar as oe, Eye as se, LayoutTemplate as ce, ListOrdered as le, Save as ue, Sparkles as de } from "lucide-react";
12
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
13
13
  import { useNavigate as fe, useParams as pe } from "react-router-dom";
14
- import { useGatewayClient as me } from "@burdenoff/fe-libs/shared/graphql";
15
- import { useEventBus as he } from "@burdenoff/fe-libs/shared/events";
14
+ import { Button as me, CTAOverflowMenu as he, EmphasisPanel as ge, GlassCard as d } from "@burdenoff/fe-libs/ui";
15
+ import { useGatewayClient as _e } from "@burdenoff/fe-libs/shared/graphql";
16
+ import { useEventBus as ve } from "@burdenoff/fe-libs/shared/events";
16
17
  import { gql as f } from "@apollo/client/core";
17
18
  //#region src/tours/pages/TourBuilderPage.tsx
18
- var ge = 250, _e = f`
19
+ var ye = 250, be = f`
19
20
  mutation SeedVibeControlsUserTours {
20
21
  seedVibeControlsUserTours {
21
22
  productId
@@ -33,7 +34,7 @@ var ge = 250, _e = f`
33
34
  }
34
35
  }
35
36
  `;
36
- function ve(e) {
37
+ function xe(e) {
37
38
  if (!e || typeof e != "object") return null;
38
39
  let t = e, n = t.error;
39
40
  if (n instanceof Error) return n.message;
@@ -422,7 +423,7 @@ function h(e) {
422
423
  let t = m(e);
423
424
  return t ? p.filter((e) => e.productId === t) : [];
424
425
  }
425
- function ye(e) {
426
+ function Se(e) {
426
427
  let t = /* @__PURE__ */ new Map();
427
428
  for (let n of h(e)) (!t.get(n.moduleId) || n.isModuleHome) && t.set(n.moduleId, {
428
429
  moduleId: n.moduleId,
@@ -431,7 +432,7 @@ function ye(e) {
431
432
  });
432
433
  return [...t.values()];
433
434
  }
434
- function be(e, t) {
435
+ function Ce(e, t) {
435
436
  let n = m(t);
436
437
  return n ? h(e).flatMap((e) => e.moduleId === n ? [{
437
438
  pageId: e.pageId,
@@ -440,9 +441,9 @@ function be(e, t) {
440
441
  }] : []) : [];
441
442
  }
442
443
  function g() {
443
- let { tr: f } = ee(), { tourId: p } = pe(), m = fe(), h = e(), { basePath: g = "/" } = h, _ = he(), xe = me("global"), { hasPermission: v, isLoading: y } = r(), b = !p || p === "new", x = v(i.TOUR_CREATE), S = v(i.TOUR_UPDATE), Se = v(i.TOUR_TEMPLATE_CREATE), C = b ? x : S, w = x && S, { tour: T, loadTour: E, createTour: Ce, updateTour: we, saving: D, validationErrors: O, error: k } = te(p), { saveAsTemplate: Te } = n(), { data: A, loading: j } = t({
444
+ let { tr: f } = ee(), { tourId: p } = pe(), m = fe(), h = e(), { basePath: g = "/" } = h, _ = ve(), we = _e("global"), { hasPermission: v, isLoading: y } = r(), b = !p || p === "new", x = v(i.TOUR_CREATE), S = v(i.TOUR_UPDATE), Te = v(i.TOUR_TEMPLATE_CREATE), C = b ? x : S, w = x && S, { tour: T, loadTour: E, createTour: Ee, updateTour: De, saving: D, validationErrors: O, error: k } = te(p), { saveAsTemplate: Oe } = n(), { data: A, loading: j } = t({
444
445
  variables: {
445
- limit: ge,
446
+ limit: ye,
446
447
  offset: 0
447
448
  },
448
449
  fetchPolicy: "cache-and-network",
@@ -460,7 +461,7 @@ function g() {
460
461
  displayOrder: 1,
461
462
  startDate: "",
462
463
  endDate: ""
463
- }), [P, F] = c(!1), [I, L] = c(!1), [R, z] = c(!1), [B, V] = c(!1), [H, U] = c(null), [W, G] = c(null), K = ne(!1), q = s(() => [...A?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [A]), J = s(() => new Set(q.map((e) => e.slug)), [q]), Y = s(() => ye(M.productId), [M.productId]), X = s(() => new Set(Y.map((e) => e.moduleId)), [Y]), Z = s(() => be(M.productId, M.moduleId), [M.moduleId, M.productId]), Q = s(() => new Set(Z.map((e) => e.pageId)), [Z]);
464
+ }), [P, F] = c(!1), [I, L] = c(!1), [R, z] = c(!1), [B, V] = c(!1), [H, U] = c(null), [W, G] = c(null), K = ne(!1), q = s(() => [...A?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [A]), J = s(() => new Set(q.map((e) => e.slug)), [q]), Y = s(() => Se(M.productId), [M.productId]), X = s(() => new Set(Y.map((e) => e.moduleId)), [Y]), Z = s(() => Ce(M.productId, M.moduleId), [M.moduleId, M.productId]), Q = s(() => new Set(Z.map((e) => e.pageId)), [Z]);
464
465
  o(() => {
465
466
  K.current || !y && C && p && p !== "new" && E(p);
466
467
  }, [
@@ -504,26 +505,26 @@ function g() {
504
505
  Q,
505
506
  Z.length
506
507
  ]);
507
- let Ee = !!(M.productId && !P && !J.has(M.productId)), De = !!(M.moduleId && !I && !X.has(M.moduleId)), Oe = !!(M.pageId && !R && !Q.has(M.pageId)), ke = async (e) => {
508
+ let ke = !!(M.productId && !P && !J.has(M.productId)), Ae = !!(M.moduleId && !I && !X.has(M.moduleId)), je = !!(M.pageId && !R && !Q.has(M.pageId)), Me = async (e) => {
508
509
  e.preventDefault();
509
510
  try {
510
- p && p !== "new" ? await we(p, M) : await Ce(M);
511
+ p && p !== "new" ? await De(p, M) : await Ee(M);
511
512
  } catch {
512
513
  a(_, "tour.save", h);
513
514
  }
514
- }, Ae = () => {
515
+ }, Ne = () => {
515
516
  m(`${g}/list`);
516
- }, $ = (e) => {
517
+ }, Pe = (e) => {
517
518
  if (!e) return "";
518
519
  let t = new Date(e);
519
520
  return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
520
- }, je = async () => {
521
+ }, Fe = async () => {
521
522
  if (!p || p === "new") return;
522
523
  let e = `${M.name || T?.name || "Tour"} Template`, t = window.prompt("Template name", e);
523
524
  if (!t) return;
524
525
  let n = window.prompt("Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)", "ONBOARDING") || "ONBOARDING";
525
526
  try {
526
- await Te(p, {
527
+ await Oe(p, {
527
528
  name: t,
528
529
  description: M.description,
529
530
  category: n,
@@ -532,11 +533,11 @@ function g() {
532
533
  } catch {
533
534
  a(_, "template.save", h);
534
535
  }
535
- }, Me = async () => {
536
+ }, Ie = async () => {
536
537
  if (window.confirm(f("tourBuilder.seedVibeControls.confirm"))) {
537
538
  V(!0), U(null), G(null);
538
539
  try {
539
- let e = await xe.mutate({ mutation: _e }), t = ve(e);
540
+ let e = await we.mutate({ mutation: be }), t = xe(e);
540
541
  if (t) throw Error(t);
541
542
  let n = e.data?.seedVibeControlsUserTours;
542
543
  if (!n) throw Error("Seed mutation returned no result.");
@@ -554,67 +555,93 @@ function g() {
554
555
  V(!1);
555
556
  }
556
557
  }
557
- };
558
- return y ? /* @__PURE__ */ u("div", {
558
+ }, $ = p && p !== "new" ? [
559
+ {
560
+ label: T?.steps && T.steps.length > 0 ? `${f("tourBuilder.editSteps")} (${T.steps.length})` : f("tourBuilder.editSteps"),
561
+ onSelect: () => m(`${g}/${p}/steps`),
562
+ icon: /* @__PURE__ */ l(le, { size: 16 })
563
+ },
564
+ {
565
+ label: f("tourBuilder.preview"),
566
+ onSelect: () => m(`${g}/${p}/preview`),
567
+ icon: /* @__PURE__ */ l(se, { size: 16 })
568
+ },
569
+ {
570
+ label: f("tourBuilder.analytics"),
571
+ onSelect: () => m(`${g}/${p}/analytics`),
572
+ icon: /* @__PURE__ */ l(ae, { size: 16 })
573
+ },
574
+ {
575
+ label: "Schedule",
576
+ onSelect: () => m(`${g}/${p}/schedule`),
577
+ icon: /* @__PURE__ */ l(oe, { size: 16 })
578
+ },
579
+ ...Te ? [{
580
+ label: "Save as Template",
581
+ onSelect: () => void Fe(),
582
+ icon: /* @__PURE__ */ l(ce, { size: 16 })
583
+ }] : []
584
+ ] : [];
585
+ return y ? /* @__PURE__ */ l("div", {
559
586
  className: "flex h-full items-center justify-center p-3 sm:p-6",
560
- children: /* @__PURE__ */ u("p", {
587
+ children: /* @__PURE__ */ l("p", {
561
588
  className: "text-sm text-text-secondary",
562
589
  children: f("tourBuilder.loading")
563
590
  })
564
- }) : C ? /* @__PURE__ */ d("div", {
591
+ }) : C ? /* @__PURE__ */ u("div", {
565
592
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6 max-w-4xl mx-auto",
566
593
  children: [
567
- /* @__PURE__ */ d("div", {
594
+ /* @__PURE__ */ u("div", {
568
595
  className: "flex items-center gap-4",
569
- children: [/* @__PURE__ */ u("button", {
596
+ children: [/* @__PURE__ */ l("button", {
570
597
  type: "button",
571
- onClick: Ae,
598
+ onClick: Ne,
572
599
  className: "p-2 hover:bg-accent rounded-md",
573
600
  "aria-label": f("tourBuilder.goBack"),
574
- children: /* @__PURE__ */ u(re, { size: 20 })
575
- }), /* @__PURE__ */ d("div", {
601
+ children: /* @__PURE__ */ l(ie, { size: 20 })
602
+ }), /* @__PURE__ */ u("div", {
576
603
  className: "flex-1",
577
- children: [/* @__PURE__ */ u("h1", {
604
+ children: [/* @__PURE__ */ l("h1", {
578
605
  className: "text-xl sm:text-2xl font-bold text-text-primary",
579
606
  children: f(p && p !== "new" ? "tourBuilder.titleEdit" : "tourBuilder.titleCreate")
580
- }), /* @__PURE__ */ u("p", {
607
+ }), /* @__PURE__ */ l("p", {
581
608
  className: "text-sm text-text-secondary",
582
609
  children: f("tourBuilder.subtitle")
583
610
  })]
584
611
  })]
585
612
  }),
586
- b ? /* @__PURE__ */ d("div", {
587
- className: "rounded-md border border-border-subtle bg-bg-surface p-4 sm:p-6",
613
+ b ? /* @__PURE__ */ u(ge, {
614
+ className: "p-4 sm:p-6",
588
615
  children: [
589
- /* @__PURE__ */ d("div", {
616
+ /* @__PURE__ */ u("div", {
590
617
  className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
591
- children: [/* @__PURE__ */ d("div", {
618
+ children: [/* @__PURE__ */ u("div", {
592
619
  className: "space-y-1",
593
- children: [/* @__PURE__ */ u("h2", {
620
+ children: [/* @__PURE__ */ l("h2", {
594
621
  className: "text-lg font-semibold text-text-primary",
595
622
  children: f("tourBuilder.seedVibeControls.title")
596
- }), /* @__PURE__ */ u("p", {
623
+ }), /* @__PURE__ */ l("p", {
597
624
  className: "text-sm text-text-secondary",
598
625
  children: f("tourBuilder.seedVibeControls.description")
599
626
  })]
600
- }), /* @__PURE__ */ d("button", {
627
+ }), /* @__PURE__ */ u("button", {
601
628
  type: "button",
602
- onClick: () => void Me(),
629
+ onClick: () => void Ie(),
603
630
  disabled: B || !w,
604
631
  className: "inline-flex min-h-11 items-center justify-center gap-2 rounded-md border border-border-subtle bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80 disabled:cursor-not-allowed disabled:opacity-50",
605
- children: [/* @__PURE__ */ u(ue, { size: 18 }), f(B ? "tourBuilder.seedVibeControls.loading" : "tourBuilder.seedVibeControls.button")]
632
+ children: [/* @__PURE__ */ l(de, { size: 18 }), f(B ? "tourBuilder.seedVibeControls.loading" : "tourBuilder.seedVibeControls.button")]
606
633
  })]
607
634
  }),
608
- w ? null : /* @__PURE__ */ u("p", {
635
+ w ? null : /* @__PURE__ */ l("p", {
609
636
  className: "mt-3 text-sm text-text-secondary",
610
637
  children: f("tourBuilder.seedVibeControls.permissionHint")
611
638
  }),
612
- W ? /* @__PURE__ */ u("p", {
639
+ W ? /* @__PURE__ */ l("p", {
613
640
  className: "mt-3 text-sm text-status-error-text",
614
641
  children: W
615
642
  }) : null,
616
- H ? /* @__PURE__ */ u("div", {
617
- className: "mt-3 rounded-md border border-border-subtle bg-bg-surface p-3 text-sm text-text-secondary",
643
+ H ? /* @__PURE__ */ l("div", {
644
+ className: "mt-3 rounded-md border border-border-seam bg-bg-surface p-3 text-sm text-text-secondary",
618
645
  children: f("tourBuilder.seedVibeControls.result", {
619
646
  totalCount: H.totalCount,
620
647
  productId: H.productId,
@@ -625,23 +652,24 @@ function g() {
625
652
  }) : null
626
653
  ]
627
654
  }) : null,
628
- /* @__PURE__ */ d("form", {
629
- onSubmit: ke,
655
+ /* @__PURE__ */ u("form", {
656
+ onSubmit: Me,
630
657
  className: "space-y-6",
631
658
  children: [
632
- /* @__PURE__ */ d("div", {
633
- className: "border border-border-subtle rounded-md p-4 sm:p-6 bg-bg-surface",
634
- children: [/* @__PURE__ */ u("h2", {
659
+ /* @__PURE__ */ u(d, {
660
+ treatment: "plain",
661
+ className: "p-4 sm:p-6 border-border-seam",
662
+ children: [/* @__PURE__ */ l("h2", {
635
663
  className: "text-lg font-semibold mb-4",
636
664
  children: f("tourBuilder.sectionBasicInfo")
637
- }), /* @__PURE__ */ d("div", {
665
+ }), /* @__PURE__ */ u("div", {
638
666
  className: "space-y-4",
639
667
  children: [
640
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
668
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
641
669
  className: "block text-sm font-medium mb-2",
642
670
  htmlFor: "tour-name",
643
671
  children: f("tourBuilder.labelName")
644
- }), /* @__PURE__ */ u("input", {
672
+ }), /* @__PURE__ */ l("input", {
645
673
  id: "tour-name",
646
674
  type: "text",
647
675
  value: M.name || "",
@@ -653,11 +681,11 @@ function g() {
653
681
  required: !0,
654
682
  "aria-label": f("tourBuilder.labelName")
655
683
  })] }),
656
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
684
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
657
685
  className: "block text-sm font-medium mb-2",
658
686
  htmlFor: "tour-description",
659
687
  children: f("tourBuilder.labelDescription")
660
- }), /* @__PURE__ */ u("textarea", {
688
+ }), /* @__PURE__ */ l("textarea", {
661
689
  id: "tour-description",
662
690
  value: M.description || "",
663
691
  onChange: (e) => N({
@@ -668,13 +696,13 @@ function g() {
668
696
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-text-primary",
669
697
  "aria-label": f("tourBuilder.labelDescription")
670
698
  })] }),
671
- /* @__PURE__ */ d("div", { children: [
672
- /* @__PURE__ */ u("label", {
699
+ /* @__PURE__ */ u("div", { children: [
700
+ /* @__PURE__ */ l("label", {
673
701
  className: "block text-sm font-medium mb-2",
674
702
  htmlFor: "product-id",
675
703
  children: f("tourBuilder.labelProductId")
676
704
  }),
677
- /* @__PURE__ */ d("select", {
705
+ /* @__PURE__ */ u("select", {
678
706
  id: "product-id",
679
707
  value: P ? "__custom__" : M.productId || "",
680
708
  onChange: (e) => {
@@ -698,15 +726,15 @@ function g() {
698
726
  required: !0,
699
727
  "aria-label": f("tourBuilder.labelProductId"),
700
728
  children: [
701
- /* @__PURE__ */ u("option", {
729
+ /* @__PURE__ */ l("option", {
702
730
  value: "",
703
731
  children: "Select product"
704
732
  }),
705
- j ? /* @__PURE__ */ u("option", {
733
+ j ? /* @__PURE__ */ l("option", {
706
734
  disabled: !0,
707
735
  children: "Loading products…"
708
736
  }) : null,
709
- q.map((e) => /* @__PURE__ */ d("option", {
737
+ q.map((e) => /* @__PURE__ */ u("option", {
710
738
  value: e.slug,
711
739
  children: [
712
740
  e.name,
@@ -715,17 +743,17 @@ function g() {
715
743
  ")"
716
744
  ]
717
745
  }, e.id)),
718
- Ee ? /* @__PURE__ */ d("option", {
746
+ ke ? /* @__PURE__ */ u("option", {
719
747
  value: M.productId,
720
748
  children: ["Current: ", M.productId]
721
749
  }) : null,
722
- /* @__PURE__ */ u("option", {
750
+ /* @__PURE__ */ l("option", {
723
751
  value: "__custom__",
724
752
  children: "Custom product slug"
725
753
  })
726
754
  ]
727
755
  }),
728
- P ? /* @__PURE__ */ u("input", {
756
+ P ? /* @__PURE__ */ l("input", {
729
757
  id: "product-id-custom",
730
758
  "aria-label": "Custom product slug",
731
759
  type: "text",
@@ -741,15 +769,15 @@ function g() {
741
769
  required: !0
742
770
  }) : null
743
771
  ] }),
744
- /* @__PURE__ */ d("div", {
772
+ /* @__PURE__ */ u("div", {
745
773
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
746
- children: [/* @__PURE__ */ d("div", { children: [
747
- /* @__PURE__ */ u("label", {
774
+ children: [/* @__PURE__ */ u("div", { children: [
775
+ /* @__PURE__ */ l("label", {
748
776
  className: "block text-sm font-medium mb-2",
749
777
  htmlFor: "module-id",
750
778
  children: "Module ID"
751
779
  }),
752
- /* @__PURE__ */ d("select", {
780
+ /* @__PURE__ */ u("select", {
753
781
  id: "module-id",
754
782
  value: I ? "__custom__" : M.moduleId || "",
755
783
  onChange: (e) => {
@@ -771,11 +799,11 @@ function g() {
771
799
  disabled: !M.productId,
772
800
  "aria-label": "Module ID",
773
801
  children: [
774
- /* @__PURE__ */ u("option", {
802
+ /* @__PURE__ */ l("option", {
775
803
  value: "",
776
804
  children: "All modules"
777
805
  }),
778
- Y.map((e) => /* @__PURE__ */ d("option", {
806
+ Y.map((e) => /* @__PURE__ */ u("option", {
779
807
  value: e.moduleId,
780
808
  children: [
781
809
  e.label,
@@ -784,17 +812,17 @@ function g() {
784
812
  ")"
785
813
  ]
786
814
  }, e.moduleId)),
787
- De ? /* @__PURE__ */ d("option", {
815
+ Ae ? /* @__PURE__ */ u("option", {
788
816
  value: M.moduleId,
789
817
  children: ["Current: ", M.moduleId]
790
818
  }) : null,
791
- /* @__PURE__ */ u("option", {
819
+ /* @__PURE__ */ l("option", {
792
820
  value: "__custom__",
793
821
  children: "Custom module ID"
794
822
  })
795
823
  ]
796
824
  }),
797
- I ? /* @__PURE__ */ u("input", {
825
+ I ? /* @__PURE__ */ l("input", {
798
826
  id: "module-id-custom",
799
827
  "aria-label": "Custom module ID",
800
828
  type: "text",
@@ -807,13 +835,13 @@ function g() {
807
835
  className: "mt-2 w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-text-primary",
808
836
  placeholder: "vibecontrols"
809
837
  }) : null
810
- ] }), /* @__PURE__ */ d("div", { children: [
811
- /* @__PURE__ */ u("label", {
838
+ ] }), /* @__PURE__ */ u("div", { children: [
839
+ /* @__PURE__ */ l("label", {
812
840
  className: "block text-sm font-medium mb-2",
813
841
  htmlFor: "page-id",
814
842
  children: "Page ID"
815
843
  }),
816
- /* @__PURE__ */ d("select", {
844
+ /* @__PURE__ */ u("select", {
817
845
  id: "page-id",
818
846
  value: R ? "__custom__" : M.pageId || "",
819
847
  onChange: (e) => {
@@ -833,11 +861,11 @@ function g() {
833
861
  disabled: !M.productId,
834
862
  "aria-label": "Page ID",
835
863
  children: [
836
- /* @__PURE__ */ u("option", {
864
+ /* @__PURE__ */ l("option", {
837
865
  value: "",
838
866
  children: "All pages"
839
867
  }),
840
- Z.map((e) => /* @__PURE__ */ d("option", {
868
+ Z.map((e) => /* @__PURE__ */ u("option", {
841
869
  value: e.pageId,
842
870
  children: [
843
871
  e.label,
@@ -846,17 +874,17 @@ function g() {
846
874
  ")"
847
875
  ]
848
876
  }, e.pageId)),
849
- Oe ? /* @__PURE__ */ d("option", {
877
+ je ? /* @__PURE__ */ u("option", {
850
878
  value: M.pageId,
851
879
  children: ["Current: ", M.pageId]
852
880
  }) : null,
853
- /* @__PURE__ */ u("option", {
881
+ /* @__PURE__ */ l("option", {
854
882
  value: "__custom__",
855
883
  children: "Custom page ID"
856
884
  })
857
885
  ]
858
886
  }),
859
- R ? /* @__PURE__ */ u("input", {
887
+ R ? /* @__PURE__ */ l("input", {
860
888
  id: "page-id-custom",
861
889
  "aria-label": "Custom page ID",
862
890
  type: "text",
@@ -870,9 +898,9 @@ function g() {
870
898
  }) : null
871
899
  ] })]
872
900
  }),
873
- /* @__PURE__ */ d("label", {
901
+ /* @__PURE__ */ u("label", {
874
902
  className: "flex items-center gap-3 cursor-pointer",
875
- children: [/* @__PURE__ */ u("input", {
903
+ children: [/* @__PURE__ */ l("input", {
876
904
  type: "checkbox",
877
905
  checked: M.isActive ?? !0,
878
906
  onChange: (e) => N({
@@ -881,7 +909,7 @@ function g() {
881
909
  }),
882
910
  className: "size-4 rounded",
883
911
  "aria-label": "Active"
884
- }), /* @__PURE__ */ u("span", {
912
+ }), /* @__PURE__ */ l("span", {
885
913
  className: "text-sm font-medium",
886
914
  children: "Active"
887
915
  })]
@@ -889,19 +917,20 @@ function g() {
889
917
  ]
890
918
  })]
891
919
  }),
892
- /* @__PURE__ */ d("div", {
893
- className: "border border-border-subtle rounded-md p-4 sm:p-6 bg-bg-surface",
894
- children: [/* @__PURE__ */ u("h2", {
920
+ /* @__PURE__ */ u(d, {
921
+ treatment: "plain",
922
+ className: "p-4 sm:p-6 border-border-seam",
923
+ children: [/* @__PURE__ */ l("h2", {
895
924
  className: "text-lg font-semibold mb-4",
896
925
  children: f("tourBuilder.sectionTriggerSettings")
897
- }), /* @__PURE__ */ d("div", {
926
+ }), /* @__PURE__ */ u("div", {
898
927
  className: "space-y-4",
899
928
  children: [
900
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
929
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
901
930
  className: "block text-sm font-medium mb-2",
902
931
  htmlFor: "trigger-type",
903
932
  children: f("tourBuilder.labelTriggerType")
904
- }), /* @__PURE__ */ d("select", {
933
+ }), /* @__PURE__ */ u("select", {
905
934
  id: "trigger-type",
906
935
  value: M.triggerType || "MANUAL",
907
936
  onChange: (e) => N({
@@ -911,33 +940,33 @@ function g() {
911
940
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-text-primary",
912
941
  "aria-label": f("tourBuilder.labelTriggerType"),
913
942
  children: [
914
- /* @__PURE__ */ u("option", {
943
+ /* @__PURE__ */ l("option", {
915
944
  value: "MANUAL",
916
945
  children: f("tourBuilder.triggerManual")
917
946
  }),
918
- /* @__PURE__ */ u("option", {
947
+ /* @__PURE__ */ l("option", {
919
948
  value: "AUTO_FIRST_VISIT",
920
949
  children: f("tourBuilder.triggerAutoFirstVisit")
921
950
  }),
922
- /* @__PURE__ */ u("option", {
951
+ /* @__PURE__ */ l("option", {
923
952
  value: "AUTO_ALWAYS",
924
953
  children: f("tourBuilder.triggerAutoAlways")
925
954
  }),
926
- /* @__PURE__ */ u("option", {
955
+ /* @__PURE__ */ l("option", {
927
956
  value: "ON_EVENT",
928
957
  children: f("tourBuilder.triggerOnEvent")
929
958
  }),
930
- /* @__PURE__ */ u("option", {
959
+ /* @__PURE__ */ l("option", {
931
960
  value: "SCHEDULED",
932
961
  children: f("tourBuilder.triggerScheduled")
933
962
  })
934
963
  ]
935
964
  })] }),
936
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
965
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
937
966
  className: "block text-sm font-medium mb-2",
938
967
  htmlFor: "priority",
939
968
  children: f("tourBuilder.labelPriority")
940
- }), /* @__PURE__ */ u("input", {
969
+ }), /* @__PURE__ */ l("input", {
941
970
  id: "priority",
942
971
  type: "number",
943
972
  min: "1",
@@ -953,30 +982,30 @@ function g() {
953
982
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-text-primary",
954
983
  "aria-label": f("tourBuilder.labelPriority")
955
984
  })] }),
956
- /* @__PURE__ */ d("div", {
985
+ /* @__PURE__ */ u("div", {
957
986
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
958
- children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
987
+ children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
959
988
  className: "block text-sm font-medium mb-2",
960
989
  htmlFor: "tour-start-date",
961
990
  children: "Start Date"
962
- }), /* @__PURE__ */ u("input", {
991
+ }), /* @__PURE__ */ l("input", {
963
992
  id: "tour-start-date",
964
993
  type: "datetime-local",
965
- value: $(M.startDate),
994
+ value: Pe(M.startDate),
966
995
  onChange: (e) => N({
967
996
  ...M,
968
997
  startDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
969
998
  }),
970
999
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-text-primary",
971
1000
  "aria-label": "Start Date"
972
- })] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1001
+ })] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
973
1002
  className: "block text-sm font-medium mb-2",
974
1003
  htmlFor: "tour-end-date",
975
1004
  children: "End Date"
976
- }), /* @__PURE__ */ u("input", {
1005
+ }), /* @__PURE__ */ l("input", {
977
1006
  id: "tour-end-date",
978
1007
  type: "datetime-local",
979
- value: $(M.endDate),
1008
+ value: Pe(M.endDate),
980
1009
  onChange: (e) => N({
981
1010
  ...M,
982
1011
  endDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
@@ -988,99 +1017,57 @@ function g() {
988
1017
  ]
989
1018
  })]
990
1019
  }),
991
- k && /* @__PURE__ */ d("div", {
1020
+ k && /* @__PURE__ */ u("div", {
992
1021
  className: "border border-status-error-border rounded-md p-4 bg-status-error-bg/10",
993
- children: [/* @__PURE__ */ u("h3", {
1022
+ children: [/* @__PURE__ */ l("h3", {
994
1023
  className: "font-semibold text-status-error-text mb-2",
995
1024
  children: f("tourBuilder.errorTitle")
996
- }), /* @__PURE__ */ u("p", {
1025
+ }), /* @__PURE__ */ l("p", {
997
1026
  className: "text-sm text-status-error-text",
998
1027
  children: k.message
999
1028
  })]
1000
1029
  }),
1001
- O.length > 0 && /* @__PURE__ */ d("div", {
1030
+ O.length > 0 && /* @__PURE__ */ u("div", {
1002
1031
  className: "border border-status-error-border rounded-md p-4 bg-status-error-bg/10",
1003
- children: [/* @__PURE__ */ u("h3", {
1032
+ children: [/* @__PURE__ */ l("h3", {
1004
1033
  className: "font-semibold text-status-error-text mb-2",
1005
1034
  children: f("tourBuilder.validationErrorsTitle")
1006
- }), /* @__PURE__ */ u("ul", {
1035
+ }), /* @__PURE__ */ l("ul", {
1007
1036
  className: "list-disc list-inside space-y-1",
1008
- children: O.map((e) => /* @__PURE__ */ u("li", {
1037
+ children: O.map((e) => /* @__PURE__ */ l("li", {
1009
1038
  className: "text-sm text-status-error-text",
1010
1039
  children: e.message
1011
1040
  }, e.message))
1012
1041
  })]
1013
1042
  }),
1014
- /* @__PURE__ */ d("div", {
1015
- className: "flex flex-wrap gap-3",
1016
- children: [/* @__PURE__ */ u(l, {
1043
+ /* @__PURE__ */ u("div", {
1044
+ className: "flex flex-wrap items-center gap-3",
1045
+ children: [/* @__PURE__ */ l(re, {
1017
1046
  permission: b ? i.TOUR_CREATE : i.TOUR_UPDATE,
1018
- children: /* @__PURE__ */ d("button", {
1047
+ children: /* @__PURE__ */ u(me, {
1019
1048
  type: "submit",
1020
1049
  disabled: D || !C,
1021
- className: "flex-1 min-w-[200px] px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 flex items-center justify-center gap-2",
1022
- children: [/* @__PURE__ */ u(le, { size: 20 }), f(D ? "tourBuilder.saving" : p && p !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
1023
- })
1024
- }), p && p !== "new" && /* @__PURE__ */ d(de, { children: [
1025
- /* @__PURE__ */ d("button", {
1026
- type: "button",
1027
- onClick: () => m(`${g}/${p}/steps`),
1028
- className: "px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/80 flex items-center gap-2",
1029
- children: [
1030
- /* @__PURE__ */ u(ce, { size: 20 }),
1031
- f("tourBuilder.editSteps"),
1032
- T?.steps && T.steps.length > 0 && /* @__PURE__ */ u("span", {
1033
- className: "ml-1 px-2 py-0.5 text-xs bg-action-primary-bg/20 rounded-full",
1034
- children: T.steps.length
1035
- })
1036
- ]
1037
- }),
1038
- /* @__PURE__ */ d("button", {
1039
- type: "button",
1040
- onClick: () => m(`${g}/${p}/preview`),
1041
- className: "px-4 py-2 border border-border-subtle rounded-md hover:bg-accent flex items-center gap-2",
1042
- children: [/* @__PURE__ */ u(oe, { size: 20 }), f("tourBuilder.preview")]
1043
- }),
1044
- /* @__PURE__ */ d("button", {
1045
- type: "button",
1046
- onClick: () => m(`${g}/${p}/analytics`),
1047
- className: "px-4 py-2 border border-border-subtle rounded-md hover:bg-accent flex items-center gap-2",
1048
- children: [/* @__PURE__ */ u(ie, { size: 20 }), f("tourBuilder.analytics")]
1049
- }),
1050
- /* @__PURE__ */ d("button", {
1051
- type: "button",
1052
- onClick: () => m(`${g}/${p}/schedule`),
1053
- className: "px-4 py-2 border border-border-subtle rounded-md hover:bg-accent flex items-center gap-2",
1054
- children: [/* @__PURE__ */ u(ae, { size: 20 }), "Schedule"]
1055
- }),
1056
- /* @__PURE__ */ u(l, {
1057
- permission: i.TOUR_TEMPLATE_CREATE,
1058
- children: /* @__PURE__ */ d("button", {
1059
- type: "button",
1060
- onClick: je,
1061
- disabled: !Se,
1062
- className: "px-4 py-2 border border-border-subtle rounded-md hover:bg-accent flex items-center gap-2 disabled:opacity-50",
1063
- children: [/* @__PURE__ */ u(se, { size: 20 }), "Save as Template"]
1064
- })
1050
+ className: "flex-1 min-w-[200px] min-h-[44px]",
1051
+ children: [/* @__PURE__ */ l(ue, { size: 20 }), f(D ? "tourBuilder.saving" : p && p !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
1065
1052
  })
1066
- ] })]
1053
+ }), p && p !== "new" && $.length > 0 && /* @__PURE__ */ l(he, { actions: $ })]
1067
1054
  })
1068
1055
  ]
1069
1056
  })
1070
1057
  ]
1071
- }) : /* @__PURE__ */ u("div", {
1058
+ }) : /* @__PURE__ */ l("div", {
1072
1059
  className: "flex h-full items-center justify-center p-3 sm:p-6",
1073
- children: /* @__PURE__ */ d("div", {
1060
+ children: /* @__PURE__ */ u("div", {
1074
1061
  className: "text-center space-y-4",
1075
- children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
1062
+ children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h2", {
1076
1063
  className: "text-lg font-semibold text-text-primary mb-2",
1077
1064
  children: f("tourBuilder.accessDeniedTitle")
1078
- }), /* @__PURE__ */ u("p", {
1065
+ }), /* @__PURE__ */ l("p", {
1079
1066
  className: "text-sm text-text-secondary",
1080
1067
  children: f(b ? "tourBuilder.createAccessDeniedMessage" : "tourBuilder.updateAccessDeniedMessage")
1081
- })] }), /* @__PURE__ */ u("button", {
1068
+ })] }), /* @__PURE__ */ l("button", {
1082
1069
  type: "button",
1083
- onClick: Ae,
1070
+ onClick: Ne,
1084
1071
  className: "inline-flex items-center justify-center rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent",
1085
1072
  children: f("tourBuilder.goBack")
1086
1073
  })]