@burdenoff/microfe-tours 2026.626.1 → 2026.720.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.
|
@@ -4,19 +4,19 @@ import { useTourLifecycle as n } from "../hooks/useTourLifecycle.js";
|
|
|
4
4
|
import { useToursPermissionAccess as r } from "../hooks/useToursPermissionAccess.js";
|
|
5
5
|
import { TOUR_PERMISSIONS as i } from "../../constants/permissions.js";
|
|
6
6
|
import { useToursI18n as ee } from "../i18n.js";
|
|
7
|
-
import { emitToursApiFailed as
|
|
8
|
-
import { useTourBuilder as
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { PermissionGate as
|
|
11
|
-
import { ArrowLeft as
|
|
12
|
-
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
-
import { useNavigate as
|
|
14
|
-
import { Button as
|
|
15
|
-
import { useGatewayClient as
|
|
16
|
-
import { useEventBus as
|
|
7
|
+
import { emitToursApiFailed as te } from "../telemetry.js";
|
|
8
|
+
import { useTourBuilder as ne } from "../hooks/useTourBuilder.js";
|
|
9
|
+
import { useEffect as a, useMemo as o, useRef as re, useState as s } from "react";
|
|
10
|
+
import { PermissionGate as ie } from "@burdenoff/fe-libs/shared/components";
|
|
11
|
+
import { ArrowLeft as ae, BarChart3 as c, Calendar as l, Eye as u, LayoutTemplate as oe, ListOrdered as d, Save as se, Sparkles as f } from "lucide-react";
|
|
12
|
+
import { Fragment as ce, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
+
import { useNavigate as le, useParams as ue } from "react-router-dom";
|
|
14
|
+
import { Button as de, CTAOverflowMenu as fe, EmphasisPanel as pe, GlassCard as me, NextSteps as he, PagePurpose as ge } 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
17
|
import { gql as h } from "@apollo/client/core";
|
|
18
18
|
//#region src/tours/pages/TourBuilderPage.tsx
|
|
19
|
-
var
|
|
19
|
+
var ye = 250, be = h`
|
|
20
20
|
mutation SeedVibeControlsUserTours {
|
|
21
21
|
seedVibeControlsUserTours {
|
|
22
22
|
productId
|
|
@@ -33,8 +33,25 @@ var ve = 250, ye = h`
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
`, xe = h`
|
|
37
|
+
mutation SeedBuildmyiqUserTours {
|
|
38
|
+
seedBuildmyiqUserTours {
|
|
39
|
+
productId
|
|
40
|
+
workspaceId
|
|
41
|
+
createdCount
|
|
42
|
+
updatedCount
|
|
43
|
+
totalCount
|
|
44
|
+
tours {
|
|
45
|
+
tourId
|
|
46
|
+
slug
|
|
47
|
+
name
|
|
48
|
+
action
|
|
49
|
+
stepCount
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
36
53
|
`;
|
|
37
|
-
function
|
|
54
|
+
function Se(e) {
|
|
38
55
|
if (!e || typeof e != "object") return null;
|
|
39
56
|
let t = e, n = t.error;
|
|
40
57
|
if (n instanceof Error) return n.message;
|
|
@@ -414,6 +431,231 @@ var g = [
|
|
|
414
431
|
pageLabel: "Search",
|
|
415
432
|
path: "/search",
|
|
416
433
|
isModuleHome: !0
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
productId: "buildmyiq",
|
|
437
|
+
moduleId: "dashboard",
|
|
438
|
+
moduleLabel: "Dashboard",
|
|
439
|
+
pageId: "dashboard",
|
|
440
|
+
pageLabel: "Dashboard",
|
|
441
|
+
path: "/dashboard",
|
|
442
|
+
isModuleHome: !0
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
productId: "buildmyiq",
|
|
446
|
+
moduleId: "catalog",
|
|
447
|
+
moduleLabel: "Course Catalog",
|
|
448
|
+
pageId: "home",
|
|
449
|
+
pageLabel: "Catalog",
|
|
450
|
+
path: "/catalog",
|
|
451
|
+
isModuleHome: !0
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
productId: "buildmyiq",
|
|
455
|
+
moduleId: "catalog",
|
|
456
|
+
moduleLabel: "Course Catalog",
|
|
457
|
+
pageId: "detail",
|
|
458
|
+
pageLabel: "Course Detail",
|
|
459
|
+
path: "/catalog/:courseId"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
productId: "buildmyiq",
|
|
463
|
+
moduleId: "learning",
|
|
464
|
+
moduleLabel: "My Learning",
|
|
465
|
+
pageId: "home",
|
|
466
|
+
pageLabel: "My Learning",
|
|
467
|
+
path: "/learning",
|
|
468
|
+
isModuleHome: !0
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
productId: "buildmyiq",
|
|
472
|
+
moduleId: "learning",
|
|
473
|
+
moduleLabel: "My Learning",
|
|
474
|
+
pageId: "player",
|
|
475
|
+
pageLabel: "Lesson Player",
|
|
476
|
+
path: "/learning/:enrollmentId"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
productId: "buildmyiq",
|
|
480
|
+
moduleId: "paths",
|
|
481
|
+
moduleLabel: "Skill Journeys",
|
|
482
|
+
pageId: "home",
|
|
483
|
+
pageLabel: "Skill Journeys",
|
|
484
|
+
path: "/paths",
|
|
485
|
+
isModuleHome: !0
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
productId: "buildmyiq",
|
|
489
|
+
moduleId: "authoring",
|
|
490
|
+
moduleLabel: "Authoring",
|
|
491
|
+
pageId: "home",
|
|
492
|
+
pageLabel: "Authoring",
|
|
493
|
+
path: "/authoring",
|
|
494
|
+
isModuleHome: !0
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
productId: "buildmyiq",
|
|
498
|
+
moduleId: "authoring",
|
|
499
|
+
moduleLabel: "Authoring",
|
|
500
|
+
pageId: "builder",
|
|
501
|
+
pageLabel: "Course Builder",
|
|
502
|
+
path: "/authoring/:courseId"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
productId: "buildmyiq",
|
|
506
|
+
moduleId: "assessments",
|
|
507
|
+
moduleLabel: "Assessments",
|
|
508
|
+
pageId: "home",
|
|
509
|
+
pageLabel: "Assessments",
|
|
510
|
+
path: "/assessments",
|
|
511
|
+
isModuleHome: !0
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
productId: "buildmyiq",
|
|
515
|
+
moduleId: "assessments",
|
|
516
|
+
moduleLabel: "Assessments",
|
|
517
|
+
pageId: "detail",
|
|
518
|
+
pageLabel: "Assessment Detail",
|
|
519
|
+
path: "/assessments/:assessmentId"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
productId: "buildmyiq",
|
|
523
|
+
moduleId: "assessments",
|
|
524
|
+
moduleLabel: "Assessments",
|
|
525
|
+
pageId: "take",
|
|
526
|
+
pageLabel: "Take Assessment",
|
|
527
|
+
path: "/assessments/:assessmentId/take"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
productId: "buildmyiq",
|
|
531
|
+
moduleId: "insights",
|
|
532
|
+
moduleLabel: "Insights",
|
|
533
|
+
pageId: "home",
|
|
534
|
+
pageLabel: "Insights",
|
|
535
|
+
path: "/insights",
|
|
536
|
+
isModuleHome: !0
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
productId: "buildmyiq",
|
|
540
|
+
moduleId: "submissions",
|
|
541
|
+
moduleLabel: "Submissions",
|
|
542
|
+
pageId: "home",
|
|
543
|
+
pageLabel: "Submissions",
|
|
544
|
+
path: "/submissions",
|
|
545
|
+
isModuleHome: !0
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
productId: "buildmyiq",
|
|
549
|
+
moduleId: "cohorts",
|
|
550
|
+
moduleLabel: "Cohorts",
|
|
551
|
+
pageId: "home",
|
|
552
|
+
pageLabel: "Cohorts",
|
|
553
|
+
path: "/cohorts",
|
|
554
|
+
isModuleHome: !0
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
productId: "buildmyiq",
|
|
558
|
+
moduleId: "skills",
|
|
559
|
+
moduleLabel: "Skills",
|
|
560
|
+
pageId: "home",
|
|
561
|
+
pageLabel: "Skills",
|
|
562
|
+
path: "/skills",
|
|
563
|
+
isModuleHome: !0
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
productId: "buildmyiq",
|
|
567
|
+
moduleId: "certificates",
|
|
568
|
+
moduleLabel: "Certificates",
|
|
569
|
+
pageId: "home",
|
|
570
|
+
pageLabel: "Certificates",
|
|
571
|
+
path: "/certificates",
|
|
572
|
+
isModuleHome: !0
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
productId: "collabkin",
|
|
576
|
+
moduleId: "dashboard",
|
|
577
|
+
moduleLabel: "Dashboard",
|
|
578
|
+
pageId: "dashboard",
|
|
579
|
+
pageLabel: "Dashboard",
|
|
580
|
+
path: "/collabkin",
|
|
581
|
+
isModuleHome: !0
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
productId: "collabkin",
|
|
585
|
+
moduleId: "trees",
|
|
586
|
+
moduleLabel: "Family Trees",
|
|
587
|
+
pageId: "home",
|
|
588
|
+
pageLabel: "Family Trees",
|
|
589
|
+
path: "/collabkin/trees",
|
|
590
|
+
isModuleHome: !0
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
productId: "collabkin",
|
|
594
|
+
moduleId: "trees",
|
|
595
|
+
moduleLabel: "Family Trees",
|
|
596
|
+
pageId: "detail",
|
|
597
|
+
pageLabel: "Tree Detail",
|
|
598
|
+
path: "/collabkin/trees/:treeId"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
productId: "collabkin",
|
|
602
|
+
moduleId: "people",
|
|
603
|
+
moduleLabel: "People",
|
|
604
|
+
pageId: "home",
|
|
605
|
+
pageLabel: "People",
|
|
606
|
+
path: "/collabkin/people",
|
|
607
|
+
isModuleHome: !0
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
productId: "collabkin",
|
|
611
|
+
moduleId: "people",
|
|
612
|
+
moduleLabel: "People",
|
|
613
|
+
pageId: "detail",
|
|
614
|
+
pageLabel: "Person Detail",
|
|
615
|
+
path: "/collabkin/people/:personId"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
productId: "collabkin",
|
|
619
|
+
moduleId: "memories",
|
|
620
|
+
moduleLabel: "Memories",
|
|
621
|
+
pageId: "home",
|
|
622
|
+
pageLabel: "Memories",
|
|
623
|
+
path: "/collabkin/memories",
|
|
624
|
+
isModuleHome: !0
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
productId: "collabkin",
|
|
628
|
+
moduleId: "memories",
|
|
629
|
+
moduleLabel: "Memories",
|
|
630
|
+
pageId: "detail",
|
|
631
|
+
pageLabel: "Memory Detail",
|
|
632
|
+
path: "/collabkin/memories/:memoryId"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
productId: "collabkin",
|
|
636
|
+
moduleId: "stories",
|
|
637
|
+
moduleLabel: "Stories",
|
|
638
|
+
pageId: "home",
|
|
639
|
+
pageLabel: "Stories",
|
|
640
|
+
path: "/collabkin/stories",
|
|
641
|
+
isModuleHome: !0
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
productId: "collabkin",
|
|
645
|
+
moduleId: "stories",
|
|
646
|
+
moduleLabel: "Stories",
|
|
647
|
+
pageId: "detail",
|
|
648
|
+
pageLabel: "Story Detail",
|
|
649
|
+
path: "/collabkin/stories/:storyId"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
productId: "collabkin",
|
|
653
|
+
moduleId: "timeline",
|
|
654
|
+
moduleLabel: "Timeline",
|
|
655
|
+
pageId: "home",
|
|
656
|
+
pageLabel: "Timeline",
|
|
657
|
+
path: "/collabkin/timeline",
|
|
658
|
+
isModuleHome: !0
|
|
417
659
|
}
|
|
418
660
|
];
|
|
419
661
|
function _(e) {
|
|
@@ -423,7 +665,7 @@ function v(e) {
|
|
|
423
665
|
let t = _(e);
|
|
424
666
|
return t ? g.filter((e) => e.productId === t) : [];
|
|
425
667
|
}
|
|
426
|
-
function
|
|
668
|
+
function Ce(e) {
|
|
427
669
|
let t = /* @__PURE__ */ new Map();
|
|
428
670
|
for (let n of v(e)) (!t.get(n.moduleId) || n.isModuleHome) && t.set(n.moduleId, {
|
|
429
671
|
moduleId: n.moduleId,
|
|
@@ -432,7 +674,7 @@ function xe(e) {
|
|
|
432
674
|
});
|
|
433
675
|
return [...t.values()];
|
|
434
676
|
}
|
|
435
|
-
function
|
|
677
|
+
function we(e, t) {
|
|
436
678
|
let n = _(t);
|
|
437
679
|
return n ? v(e).flatMap((e) => e.moduleId === n ? [{
|
|
438
680
|
pageId: e.pageId,
|
|
@@ -441,14 +683,14 @@ function Se(e, t) {
|
|
|
441
683
|
}] : []) : [];
|
|
442
684
|
}
|
|
443
685
|
function y() {
|
|
444
|
-
let { tr: h } = ee(), { tourId: g } =
|
|
686
|
+
let { tr: h } = ee(), { tourId: g } = ue(), _ = le(), v = e(), { basePath: y = "/" } = v, b = ve(), x = _e("global"), { hasPermission: S, isLoading: C } = r(), w = !g || g === "new", T = S(i.TOUR_CREATE), E = S(i.TOUR_UPDATE), Te = S(i.TOUR_TEMPLATE_CREATE), D = w ? T : E, O = T && E, k = T && E, { tour: A, loadTour: j, createTour: Ee, updateTour: De, saving: M, validationErrors: N, error: Oe } = ne(g), { saveAsTemplate: ke } = n(), { data: Ae, loading: P } = t({
|
|
445
687
|
variables: {
|
|
446
|
-
limit:
|
|
688
|
+
limit: ye,
|
|
447
689
|
offset: 0
|
|
448
690
|
},
|
|
449
691
|
fetchPolicy: "cache-and-network",
|
|
450
|
-
skip:
|
|
451
|
-
}), [F, I] =
|
|
692
|
+
skip: C || !D
|
|
693
|
+
}), [F, I] = s({
|
|
452
694
|
name: "",
|
|
453
695
|
description: "",
|
|
454
696
|
productId: "",
|
|
@@ -461,90 +703,90 @@ function y() {
|
|
|
461
703
|
displayOrder: 1,
|
|
462
704
|
startDate: "",
|
|
463
705
|
endDate: ""
|
|
464
|
-
}), [L, R] =
|
|
465
|
-
|
|
466
|
-
|
|
706
|
+
}), [L, R] = s(!1), [z, B] = s(!1), [V, H] = s(!1), [je, Me] = s(!1), [U, Ne] = s(null), [Pe, Fe] = s(null), [Ie, Le] = s(!1), [W, Re] = s(null), [ze, Be] = s(null), G = re(!1), K = o(() => [...Ae?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [Ae]), q = o(() => new Set(K.map((e) => e.slug)), [K]), J = o(() => Ce(F.productId), [F.productId]), Y = o(() => new Set(J.map((e) => e.moduleId)), [J]), X = o(() => we(F.productId, F.moduleId), [F.moduleId, F.productId]), Z = o(() => new Set(X.map((e) => e.pageId)), [X]);
|
|
707
|
+
a(() => {
|
|
708
|
+
G.current || !C && D && g && g !== "new" && j(g);
|
|
467
709
|
}, [
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
710
|
+
D,
|
|
711
|
+
j,
|
|
712
|
+
C,
|
|
471
713
|
g
|
|
472
|
-
]),
|
|
473
|
-
|
|
474
|
-
}, [
|
|
714
|
+
]), a(() => {
|
|
715
|
+
A && !G.current && (I(A), G.current = !0);
|
|
716
|
+
}, [A]), a(() => {
|
|
475
717
|
if (!F.productId || P) {
|
|
476
718
|
R(!1);
|
|
477
719
|
return;
|
|
478
720
|
}
|
|
479
|
-
R(
|
|
721
|
+
R(K.length > 0 && !q.has(F.productId));
|
|
480
722
|
}, [
|
|
481
723
|
F.productId,
|
|
482
|
-
|
|
483
|
-
|
|
724
|
+
q,
|
|
725
|
+
K.length,
|
|
484
726
|
P
|
|
485
|
-
]),
|
|
727
|
+
]), a(() => {
|
|
486
728
|
if (!F.productId || !F.moduleId) {
|
|
487
729
|
B(!1);
|
|
488
730
|
return;
|
|
489
731
|
}
|
|
490
|
-
B(
|
|
732
|
+
B(J.length === 0 || !Y.has(F.moduleId));
|
|
491
733
|
}, [
|
|
492
734
|
F.moduleId,
|
|
493
735
|
F.productId,
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
]),
|
|
736
|
+
Y,
|
|
737
|
+
J.length
|
|
738
|
+
]), a(() => {
|
|
497
739
|
if (!F.productId || !F.pageId) {
|
|
498
740
|
H(!1);
|
|
499
741
|
return;
|
|
500
742
|
}
|
|
501
|
-
H(
|
|
743
|
+
H(X.length === 0 || !Z.has(F.pageId));
|
|
502
744
|
}, [
|
|
503
745
|
F.pageId,
|
|
504
746
|
F.productId,
|
|
505
|
-
|
|
506
|
-
|
|
747
|
+
Z,
|
|
748
|
+
X.length
|
|
507
749
|
]);
|
|
508
|
-
let
|
|
750
|
+
let Ve = !!(F.productId && !L && !q.has(F.productId)), He = !!(F.moduleId && !z && !Y.has(F.moduleId)), Ue = !!(F.pageId && !V && !Z.has(F.pageId)), We = async (e) => {
|
|
509
751
|
e.preventDefault();
|
|
510
752
|
try {
|
|
511
|
-
g && g !== "new" ? await
|
|
753
|
+
g && g !== "new" ? await De(g, F) : await Ee(F);
|
|
512
754
|
} catch {
|
|
513
|
-
|
|
755
|
+
te(b, "tour.save", v);
|
|
514
756
|
}
|
|
515
|
-
},
|
|
757
|
+
}, Ge = () => {
|
|
516
758
|
_(`${y}/list`);
|
|
517
|
-
},
|
|
759
|
+
}, Q = (e) => {
|
|
518
760
|
if (!e) return "";
|
|
519
761
|
let t = new Date(e);
|
|
520
762
|
return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
521
|
-
},
|
|
763
|
+
}, Ke = async () => {
|
|
522
764
|
if (!g || g === "new") return;
|
|
523
|
-
let e = `${F.name ||
|
|
765
|
+
let e = `${F.name || A?.name || "Tour"} Template`, t = window.prompt("Template name", e);
|
|
524
766
|
if (!t) return;
|
|
525
767
|
let n = window.prompt("Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)", "ONBOARDING") || "ONBOARDING";
|
|
526
768
|
try {
|
|
527
|
-
await
|
|
769
|
+
await ke(g, {
|
|
528
770
|
name: t,
|
|
529
771
|
description: F.description,
|
|
530
772
|
category: n,
|
|
531
773
|
isPublic: !1
|
|
532
774
|
}), _(`${y}/templates`);
|
|
533
775
|
} catch {
|
|
534
|
-
|
|
776
|
+
te(b, "template.save", v);
|
|
535
777
|
}
|
|
536
|
-
},
|
|
778
|
+
}, qe = async () => {
|
|
537
779
|
if (window.confirm(h("tourBuilder.seedVibeControls.confirm"))) {
|
|
538
|
-
|
|
780
|
+
Me(!0), Ne(null), Fe(null);
|
|
539
781
|
try {
|
|
540
|
-
let e = await
|
|
782
|
+
let e = await x.mutate({ mutation: be }), t = Se(e);
|
|
541
783
|
if (t) throw Error(t);
|
|
542
784
|
let n = e.data?.seedVibeControlsUserTours;
|
|
543
785
|
if (!n) throw Error("Seed mutation returned no result.");
|
|
544
|
-
|
|
786
|
+
Ne(n);
|
|
545
787
|
} catch (e) {
|
|
546
788
|
let t = e instanceof Error ? e.message : h("tourBuilder.seedVibeControls.error");
|
|
547
|
-
|
|
789
|
+
Fe(t), b.emit("tours.api.failed", {
|
|
548
790
|
route: "/tours",
|
|
549
791
|
operation: "tour.seed_vibecontrols_user_tours",
|
|
550
792
|
errorMessage: t,
|
|
@@ -552,82 +794,104 @@ function y() {
|
|
|
552
794
|
workspaceId: v.workspaceId
|
|
553
795
|
}, { component: "microfe-tours" });
|
|
554
796
|
} finally {
|
|
555
|
-
|
|
797
|
+
Me(!1);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}, Je = async () => {
|
|
801
|
+
if (window.confirm(h("tourBuilder.seedBuildmyiq.confirm"))) {
|
|
802
|
+
Le(!0), Re(null), Be(null);
|
|
803
|
+
try {
|
|
804
|
+
let e = await x.mutate({ mutation: xe }), t = Se(e);
|
|
805
|
+
if (t) throw Error(t);
|
|
806
|
+
let n = e.data?.seedBuildmyiqUserTours;
|
|
807
|
+
if (!n) throw Error("Seed mutation returned no result.");
|
|
808
|
+
Re(n);
|
|
809
|
+
} catch (e) {
|
|
810
|
+
let t = e instanceof Error ? e.message : h("tourBuilder.seedBuildmyiq.error");
|
|
811
|
+
Be(t), b.emit("tours.api.failed", {
|
|
812
|
+
route: "/tours",
|
|
813
|
+
operation: "tour.seed_buildmyiq_user_tours",
|
|
814
|
+
errorMessage: t,
|
|
815
|
+
productId: v.productId,
|
|
816
|
+
workspaceId: v.workspaceId
|
|
817
|
+
}, { component: "microfe-tours" });
|
|
818
|
+
} finally {
|
|
819
|
+
Le(!1);
|
|
556
820
|
}
|
|
557
821
|
}
|
|
558
|
-
},
|
|
822
|
+
}, Ye = g && g !== "new" ? [
|
|
559
823
|
{
|
|
560
|
-
label:
|
|
824
|
+
label: A?.steps && A.steps.length > 0 ? `${h("tourBuilder.editSteps")} (${A.steps.length})` : h("tourBuilder.editSteps"),
|
|
561
825
|
onSelect: () => _(`${y}/${g}/steps`),
|
|
562
|
-
icon: /* @__PURE__ */ p(
|
|
826
|
+
icon: /* @__PURE__ */ p(d, { size: 16 })
|
|
563
827
|
},
|
|
564
828
|
{
|
|
565
829
|
label: h("tourBuilder.preview"),
|
|
566
830
|
onSelect: () => _(`${y}/${g}/preview`),
|
|
567
|
-
icon: /* @__PURE__ */ p(
|
|
831
|
+
icon: /* @__PURE__ */ p(u, { size: 16 })
|
|
568
832
|
},
|
|
569
833
|
{
|
|
570
834
|
label: h("tourBuilder.analytics"),
|
|
571
835
|
onSelect: () => _(`${y}/${g}/analytics`),
|
|
572
|
-
icon: /* @__PURE__ */ p(
|
|
836
|
+
icon: /* @__PURE__ */ p(c, { size: 16 })
|
|
573
837
|
},
|
|
574
838
|
{
|
|
575
839
|
label: "Schedule",
|
|
576
840
|
onSelect: () => _(`${y}/${g}/schedule`),
|
|
577
|
-
icon: /* @__PURE__ */ p(
|
|
841
|
+
icon: /* @__PURE__ */ p(l, { size: 16 })
|
|
578
842
|
},
|
|
579
|
-
...
|
|
843
|
+
...Te ? [{
|
|
580
844
|
label: "Save as Template",
|
|
581
|
-
onSelect: () => void
|
|
582
|
-
icon: /* @__PURE__ */ p(
|
|
845
|
+
onSelect: () => void Ke(),
|
|
846
|
+
icon: /* @__PURE__ */ p(oe, { size: 16 })
|
|
583
847
|
}] : []
|
|
584
|
-
] : [], $ = g && g !== "new" &&
|
|
848
|
+
] : [], $ = g && g !== "new" && E ? [
|
|
585
849
|
{
|
|
586
850
|
id: "edit-steps",
|
|
587
851
|
label: h("tourBuilder.nextStepEditSteps"),
|
|
588
852
|
description: h("tourBuilder.nextStepEditStepsDesc"),
|
|
589
|
-
icon: /* @__PURE__ */ p(
|
|
853
|
+
icon: /* @__PURE__ */ p(d, { size: 16 }),
|
|
590
854
|
onClick: () => _(`${y}/${g}/steps`)
|
|
591
855
|
},
|
|
592
856
|
{
|
|
593
857
|
id: "preview",
|
|
594
858
|
label: h("tourBuilder.nextStepPreview"),
|
|
595
859
|
description: h("tourBuilder.nextStepPreviewDesc"),
|
|
596
|
-
icon: /* @__PURE__ */ p(
|
|
860
|
+
icon: /* @__PURE__ */ p(u, { size: 16 }),
|
|
597
861
|
onClick: () => _(`${y}/${g}/preview`)
|
|
598
862
|
},
|
|
599
863
|
{
|
|
600
864
|
id: "schedule",
|
|
601
865
|
label: h("tourBuilder.nextStepSchedule"),
|
|
602
866
|
description: h("tourBuilder.nextStepScheduleDesc"),
|
|
603
|
-
icon: /* @__PURE__ */ p(
|
|
867
|
+
icon: /* @__PURE__ */ p(l, { size: 16 }),
|
|
604
868
|
onClick: () => _(`${y}/${g}/schedule`)
|
|
605
869
|
},
|
|
606
870
|
{
|
|
607
871
|
id: "analytics",
|
|
608
872
|
label: h("tourBuilder.nextStepAnalytics"),
|
|
609
873
|
description: h("tourBuilder.nextStepAnalyticsDesc"),
|
|
610
|
-
icon: /* @__PURE__ */ p(
|
|
874
|
+
icon: /* @__PURE__ */ p(c, { size: 16 }),
|
|
611
875
|
onClick: () => _(`${y}/${g}/analytics`)
|
|
612
876
|
}
|
|
613
877
|
] : [];
|
|
614
|
-
return
|
|
878
|
+
return C ? /* @__PURE__ */ p("div", {
|
|
615
879
|
className: "flex h-full items-center justify-center p-3 sm:p-6",
|
|
616
880
|
children: /* @__PURE__ */ p("p", {
|
|
617
881
|
className: "text-sm text-text-secondary",
|
|
618
882
|
children: h("tourBuilder.loading")
|
|
619
883
|
})
|
|
620
|
-
}) :
|
|
884
|
+
}) : D ? /* @__PURE__ */ m("div", {
|
|
621
885
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 max-w-4xl mx-auto",
|
|
622
886
|
children: [
|
|
623
887
|
/* @__PURE__ */ m("div", {
|
|
624
888
|
className: "flex items-center gap-4",
|
|
625
889
|
children: [/* @__PURE__ */ p("button", {
|
|
626
890
|
type: "button",
|
|
627
|
-
onClick:
|
|
891
|
+
onClick: Ge,
|
|
628
892
|
className: "p-2 hover:bg-accent rounded-md",
|
|
629
893
|
"aria-label": h("tourBuilder.goBack"),
|
|
630
|
-
children: /* @__PURE__ */ p(
|
|
894
|
+
children: /* @__PURE__ */ p(ae, { size: 20 })
|
|
631
895
|
}), /* @__PURE__ */ m("div", {
|
|
632
896
|
className: "flex-1",
|
|
633
897
|
children: [/* @__PURE__ */ p("h1", {
|
|
@@ -639,13 +903,13 @@ function y() {
|
|
|
639
903
|
})]
|
|
640
904
|
})]
|
|
641
905
|
}),
|
|
642
|
-
/* @__PURE__ */ p(
|
|
643
|
-
$.length > 0 ? /* @__PURE__ */ p(
|
|
906
|
+
/* @__PURE__ */ p(ge, { children: h("tourBuilder.purpose") }),
|
|
907
|
+
$.length > 0 ? /* @__PURE__ */ p(he, {
|
|
644
908
|
storageKey: "tours-builder",
|
|
645
909
|
title: h("tourBuilder.nextStepsTitle"),
|
|
646
910
|
steps: $
|
|
647
911
|
}) : null,
|
|
648
|
-
|
|
912
|
+
w ? /* @__PURE__ */ m(ce, { children: [/* @__PURE__ */ m(pe, {
|
|
649
913
|
className: "p-4 sm:p-6",
|
|
650
914
|
children: [
|
|
651
915
|
/* @__PURE__ */ m("div", {
|
|
@@ -661,37 +925,78 @@ function y() {
|
|
|
661
925
|
})]
|
|
662
926
|
}), /* @__PURE__ */ m("button", {
|
|
663
927
|
type: "button",
|
|
664
|
-
onClick: () => void
|
|
665
|
-
disabled:
|
|
928
|
+
onClick: () => void qe(),
|
|
929
|
+
disabled: je || !O,
|
|
666
930
|
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",
|
|
667
|
-
children: [/* @__PURE__ */ p(
|
|
931
|
+
children: [/* @__PURE__ */ p(f, { size: 18 }), h(je ? "tourBuilder.seedVibeControls.loading" : "tourBuilder.seedVibeControls.button")]
|
|
668
932
|
})]
|
|
669
933
|
}),
|
|
670
|
-
|
|
934
|
+
O ? null : /* @__PURE__ */ p("p", {
|
|
671
935
|
className: "mt-3 text-sm text-text-secondary",
|
|
672
936
|
children: h("tourBuilder.seedVibeControls.permissionHint")
|
|
673
937
|
}),
|
|
674
|
-
|
|
938
|
+
Pe ? /* @__PURE__ */ p("p", {
|
|
675
939
|
className: "mt-3 text-sm text-status-error-text",
|
|
676
|
-
children:
|
|
940
|
+
children: Pe
|
|
677
941
|
}) : null,
|
|
678
|
-
|
|
942
|
+
U ? /* @__PURE__ */ p("div", {
|
|
679
943
|
className: "mt-3 rounded-md border border-border-seam bg-bg-surface p-3 text-sm text-text-secondary",
|
|
680
944
|
children: h("tourBuilder.seedVibeControls.result", {
|
|
681
|
-
totalCount:
|
|
682
|
-
productId:
|
|
683
|
-
workspaceId:
|
|
684
|
-
createdCount:
|
|
685
|
-
updatedCount:
|
|
945
|
+
totalCount: U.totalCount,
|
|
946
|
+
productId: U.productId,
|
|
947
|
+
workspaceId: U.workspaceId,
|
|
948
|
+
createdCount: U.createdCount,
|
|
949
|
+
updatedCount: U.updatedCount
|
|
686
950
|
})
|
|
687
951
|
}) : null
|
|
688
952
|
]
|
|
689
|
-
})
|
|
953
|
+
}), /* @__PURE__ */ m(pe, {
|
|
954
|
+
className: "p-4 sm:p-6",
|
|
955
|
+
children: [
|
|
956
|
+
/* @__PURE__ */ m("div", {
|
|
957
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
958
|
+
children: [/* @__PURE__ */ m("div", {
|
|
959
|
+
className: "space-y-1",
|
|
960
|
+
children: [/* @__PURE__ */ p("h2", {
|
|
961
|
+
className: "text-lg font-semibold text-text-primary",
|
|
962
|
+
children: h("tourBuilder.seedBuildmyiq.title")
|
|
963
|
+
}), /* @__PURE__ */ p("p", {
|
|
964
|
+
className: "text-sm text-text-secondary",
|
|
965
|
+
children: h("tourBuilder.seedBuildmyiq.description")
|
|
966
|
+
})]
|
|
967
|
+
}), /* @__PURE__ */ m("button", {
|
|
968
|
+
type: "button",
|
|
969
|
+
onClick: () => void Je(),
|
|
970
|
+
disabled: Ie || !k,
|
|
971
|
+
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",
|
|
972
|
+
children: [/* @__PURE__ */ p(f, { size: 18 }), h(Ie ? "tourBuilder.seedBuildmyiq.loading" : "tourBuilder.seedBuildmyiq.button")]
|
|
973
|
+
})]
|
|
974
|
+
}),
|
|
975
|
+
k ? null : /* @__PURE__ */ p("p", {
|
|
976
|
+
className: "mt-3 text-sm text-text-secondary",
|
|
977
|
+
children: h("tourBuilder.seedBuildmyiq.permissionHint")
|
|
978
|
+
}),
|
|
979
|
+
ze ? /* @__PURE__ */ p("p", {
|
|
980
|
+
className: "mt-3 text-sm text-status-error-text",
|
|
981
|
+
children: ze
|
|
982
|
+
}) : null,
|
|
983
|
+
W ? /* @__PURE__ */ p("div", {
|
|
984
|
+
className: "mt-3 rounded-md border border-border-seam bg-bg-surface p-3 text-sm text-text-secondary",
|
|
985
|
+
children: h("tourBuilder.seedBuildmyiq.result", {
|
|
986
|
+
totalCount: W.totalCount,
|
|
987
|
+
productId: W.productId,
|
|
988
|
+
workspaceId: W.workspaceId,
|
|
989
|
+
createdCount: W.createdCount,
|
|
990
|
+
updatedCount: W.updatedCount
|
|
991
|
+
})
|
|
992
|
+
}) : null
|
|
993
|
+
]
|
|
994
|
+
})] }) : null,
|
|
690
995
|
/* @__PURE__ */ m("form", {
|
|
691
|
-
onSubmit:
|
|
996
|
+
onSubmit: We,
|
|
692
997
|
className: "space-y-6",
|
|
693
998
|
children: [
|
|
694
|
-
/* @__PURE__ */ m(
|
|
999
|
+
/* @__PURE__ */ m(me, {
|
|
695
1000
|
treatment: "plain",
|
|
696
1001
|
className: "p-4 sm:p-6 border-border-seam",
|
|
697
1002
|
children: [/* @__PURE__ */ p("h2", {
|
|
@@ -769,7 +1074,7 @@ function y() {
|
|
|
769
1074
|
disabled: !0,
|
|
770
1075
|
children: "Loading products…"
|
|
771
1076
|
}) : null,
|
|
772
|
-
|
|
1077
|
+
K.map((e) => /* @__PURE__ */ m("option", {
|
|
773
1078
|
value: e.slug,
|
|
774
1079
|
children: [
|
|
775
1080
|
e.name,
|
|
@@ -778,7 +1083,7 @@ function y() {
|
|
|
778
1083
|
")"
|
|
779
1084
|
]
|
|
780
1085
|
}, e.id)),
|
|
781
|
-
|
|
1086
|
+
Ve ? /* @__PURE__ */ m("option", {
|
|
782
1087
|
value: F.productId,
|
|
783
1088
|
children: ["Current: ", F.productId]
|
|
784
1089
|
}) : null,
|
|
@@ -838,7 +1143,7 @@ function y() {
|
|
|
838
1143
|
value: "",
|
|
839
1144
|
children: "All modules"
|
|
840
1145
|
}),
|
|
841
|
-
|
|
1146
|
+
J.map((e) => /* @__PURE__ */ m("option", {
|
|
842
1147
|
value: e.moduleId,
|
|
843
1148
|
children: [
|
|
844
1149
|
e.label,
|
|
@@ -847,7 +1152,7 @@ function y() {
|
|
|
847
1152
|
")"
|
|
848
1153
|
]
|
|
849
1154
|
}, e.moduleId)),
|
|
850
|
-
|
|
1155
|
+
He ? /* @__PURE__ */ m("option", {
|
|
851
1156
|
value: F.moduleId,
|
|
852
1157
|
children: ["Current: ", F.moduleId]
|
|
853
1158
|
}) : null,
|
|
@@ -900,7 +1205,7 @@ function y() {
|
|
|
900
1205
|
value: "",
|
|
901
1206
|
children: "All pages"
|
|
902
1207
|
}),
|
|
903
|
-
|
|
1208
|
+
X.map((e) => /* @__PURE__ */ m("option", {
|
|
904
1209
|
value: e.pageId,
|
|
905
1210
|
children: [
|
|
906
1211
|
e.label,
|
|
@@ -909,7 +1214,7 @@ function y() {
|
|
|
909
1214
|
")"
|
|
910
1215
|
]
|
|
911
1216
|
}, e.pageId)),
|
|
912
|
-
|
|
1217
|
+
Ue ? /* @__PURE__ */ m("option", {
|
|
913
1218
|
value: F.pageId,
|
|
914
1219
|
children: ["Current: ", F.pageId]
|
|
915
1220
|
}) : null,
|
|
@@ -952,7 +1257,7 @@ function y() {
|
|
|
952
1257
|
]
|
|
953
1258
|
})]
|
|
954
1259
|
}),
|
|
955
|
-
/* @__PURE__ */ m(
|
|
1260
|
+
/* @__PURE__ */ m(me, {
|
|
956
1261
|
treatment: "plain",
|
|
957
1262
|
className: "p-4 sm:p-6 border-border-seam",
|
|
958
1263
|
children: [/* @__PURE__ */ p("h2", {
|
|
@@ -1026,7 +1331,7 @@ function y() {
|
|
|
1026
1331
|
}), /* @__PURE__ */ p("input", {
|
|
1027
1332
|
id: "tour-start-date",
|
|
1028
1333
|
type: "datetime-local",
|
|
1029
|
-
value:
|
|
1334
|
+
value: Q(F.startDate),
|
|
1030
1335
|
onChange: (e) => I({
|
|
1031
1336
|
...F,
|
|
1032
1337
|
startDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
@@ -1040,7 +1345,7 @@ function y() {
|
|
|
1040
1345
|
}), /* @__PURE__ */ p("input", {
|
|
1041
1346
|
id: "tour-end-date",
|
|
1042
1347
|
type: "datetime-local",
|
|
1043
|
-
value:
|
|
1348
|
+
value: Q(F.endDate),
|
|
1044
1349
|
onChange: (e) => I({
|
|
1045
1350
|
...F,
|
|
1046
1351
|
endDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
@@ -1052,24 +1357,24 @@ function y() {
|
|
|
1052
1357
|
]
|
|
1053
1358
|
})]
|
|
1054
1359
|
}),
|
|
1055
|
-
|
|
1360
|
+
Oe && /* @__PURE__ */ m("div", {
|
|
1056
1361
|
className: "border border-status-error-border rounded-md p-4 bg-status-error-bg/10",
|
|
1057
1362
|
children: [/* @__PURE__ */ p("h3", {
|
|
1058
1363
|
className: "font-semibold text-status-error-text mb-2",
|
|
1059
1364
|
children: h("tourBuilder.errorTitle")
|
|
1060
1365
|
}), /* @__PURE__ */ p("p", {
|
|
1061
1366
|
className: "text-sm text-status-error-text",
|
|
1062
|
-
children:
|
|
1367
|
+
children: Oe.message
|
|
1063
1368
|
})]
|
|
1064
1369
|
}),
|
|
1065
|
-
|
|
1370
|
+
N.length > 0 && /* @__PURE__ */ m("div", {
|
|
1066
1371
|
className: "border border-status-error-border rounded-md p-4 bg-status-error-bg/10",
|
|
1067
1372
|
children: [/* @__PURE__ */ p("h3", {
|
|
1068
1373
|
className: "font-semibold text-status-error-text mb-2",
|
|
1069
1374
|
children: h("tourBuilder.validationErrorsTitle")
|
|
1070
1375
|
}), /* @__PURE__ */ p("ul", {
|
|
1071
1376
|
className: "list-disc list-inside space-y-1",
|
|
1072
|
-
children:
|
|
1377
|
+
children: N.map((e) => /* @__PURE__ */ p("li", {
|
|
1073
1378
|
className: "text-sm text-status-error-text",
|
|
1074
1379
|
children: e.message
|
|
1075
1380
|
}, e.message))
|
|
@@ -1077,15 +1382,15 @@ function y() {
|
|
|
1077
1382
|
}),
|
|
1078
1383
|
/* @__PURE__ */ m("div", {
|
|
1079
1384
|
className: "flex flex-wrap items-center gap-3",
|
|
1080
|
-
children: [/* @__PURE__ */ p(
|
|
1081
|
-
permission:
|
|
1082
|
-
children: /* @__PURE__ */ m(
|
|
1385
|
+
children: [/* @__PURE__ */ p(ie, {
|
|
1386
|
+
permission: w ? i.TOUR_CREATE : i.TOUR_UPDATE,
|
|
1387
|
+
children: /* @__PURE__ */ m(de, {
|
|
1083
1388
|
type: "submit",
|
|
1084
|
-
disabled:
|
|
1389
|
+
disabled: M || !D,
|
|
1085
1390
|
className: "flex-1 min-w-[200px] min-h-[44px]",
|
|
1086
|
-
children: [/* @__PURE__ */ p(
|
|
1391
|
+
children: [/* @__PURE__ */ p(se, { size: 20 }), h(M ? "tourBuilder.saving" : g && g !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
|
|
1087
1392
|
})
|
|
1088
|
-
}), g && g !== "new" &&
|
|
1393
|
+
}), g && g !== "new" && Ye.length > 0 && /* @__PURE__ */ p(fe, { actions: Ye })]
|
|
1089
1394
|
})
|
|
1090
1395
|
]
|
|
1091
1396
|
})
|
|
@@ -1099,10 +1404,10 @@ function y() {
|
|
|
1099
1404
|
children: h("tourBuilder.accessDeniedTitle")
|
|
1100
1405
|
}), /* @__PURE__ */ p("p", {
|
|
1101
1406
|
className: "text-sm text-text-secondary",
|
|
1102
|
-
children: h(
|
|
1407
|
+
children: h(w ? "tourBuilder.createAccessDeniedMessage" : "tourBuilder.updateAccessDeniedMessage")
|
|
1103
1408
|
})] }), /* @__PURE__ */ p("button", {
|
|
1104
1409
|
type: "button",
|
|
1105
|
-
onClick:
|
|
1410
|
+
onClick: Ge,
|
|
1106
1411
|
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",
|
|
1107
1412
|
children: h("tourBuilder.goBack")
|
|
1108
1413
|
})]
|