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