@burdenoff/microfe-tours 2026.625.1 → 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.
@@ -3,651 +3,646 @@ import { useToursPermissionAccess as t } from "../hooks/useToursPermissionAccess
3
3
  import { TOUR_PERMISSIONS as n } from "../../constants/permissions.js";
4
4
  import { useToursI18n as ee } from "../i18n.js";
5
5
  import { emitToursApiFailed as r } from "../telemetry.js";
6
- import { useMediaLibrary as te } from "../hooks/useMediaLibrary.js";
7
- import { useStepSequencer as i } from "../hooks/useStepSequencer.js";
8
- import { useTourBuilder as a } from "../hooks/useTourBuilder.js";
6
+ import { useMediaLibrary as i } from "../hooks/useMediaLibrary.js";
7
+ import { useStepSequencer as a } from "../hooks/useStepSequencer.js";
8
+ import { useTourBuilder as te } from "../hooks/useTourBuilder.js";
9
9
  import { useEffect as o, useState as s } from "react";
10
- import { PermissionGate as ne } from "@burdenoff/fe-libs/shared/components";
11
- import { ArrowLeft as re, ChevronDown as c, ChevronLeft as l, ChevronRight as u, ChevronUp as d, Menu as f, Paperclip as ie, Plus as p, Save as ae, Trash2 as oe, X as se } from "lucide-react";
12
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
13
- import { useNavigate as ce, useParams as g } from "react-router-dom";
14
- import { Button as _, GlassCard as v, OptionalFields as y } from "@burdenoff/fe-libs/ui";
15
- import { useEventBus as b } from "@burdenoff/fe-libs/shared/events";
10
+ import { PermissionGate as c } from "@burdenoff/fe-libs/shared/components";
11
+ import { ArrowLeft as l, ChevronDown as u, ChevronLeft as d, ChevronRight as f, ChevronUp as p, Menu as m, Paperclip as ne, Plus as h, Save as re, Trash2 as ie, X as g } from "lucide-react";
12
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
13
+ import { useNavigate as ae, useParams as y } from "react-router-dom";
14
+ import { Button as b, GlassCard as x, IllustratedEmptyState as S, OptionalFields as oe, PagePurpose as se } from "@burdenoff/fe-libs/ui";
15
+ import { useEventBus as ce } from "@burdenoff/fe-libs/shared/events";
16
16
  //#region src/tours/pages/StepEditorPage.tsx
17
- function x() {
18
- let { tr: x } = ee(), { tourId: S, stepId: C } = g(), le = ce(), w = e(), { basePath: T = "/" } = w, E = b(), { hasPermission: D } = t(), O = D(n.TOUR_STEP_CREATE), k = D(n.TOUR_STEP_UPDATE), A = D(n.TOUR_STEP_DELETE), { tour: j, loadTour: M, syncSteps: N, saving: P } = a(S), { steps: F, selectedStep: I, selectStep: L, createStep: R, deleteStep: z, updateStepField: B, moveStep: V } = i(), { media: H, fetchMedia: U, attachToStep: W, loading: ue } = te(), [G, K] = s(!1), [q, de] = s(() => typeof window < "u" && window.innerWidth < 768), [J, Y] = s(""), [X, fe] = s("body"), [pe, Z] = s(!1);
17
+ function C() {
18
+ let { tr: C } = ee(), { tourId: w, stepId: T } = y(), le = ae(), E = e(), { basePath: D = "/" } = E, O = ce(), { hasPermission: k } = t(), A = k(n.TOUR_STEP_CREATE), j = k(n.TOUR_STEP_UPDATE), M = k(n.TOUR_STEP_DELETE), { tour: N, loadTour: P, syncSteps: F, saving: I } = te(w), { steps: L, selectedStep: R, selectStep: z, createStep: B, deleteStep: ue, updateStepField: V, moveStep: H } = a(), { media: U, fetchMedia: W, attachToStep: de, loading: fe } = i(), [G, K] = s(!1), [q, pe] = s(() => typeof window < "u" && window.innerWidth < 768), [J, Y] = s(""), [X, me] = s("body"), [he, Z] = s(!1);
19
19
  o(() => {
20
20
  let e = () => {
21
21
  let e = window.innerWidth < 768;
22
- de(e), e || K(!1);
22
+ pe(e), e || K(!1);
23
23
  };
24
24
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
25
25
  }, []), o(() => {
26
- S && M(S);
27
- }, [S, M]), o(() => {
28
- U();
29
- }, [U]), o(() => {
30
- let e = C || I?.id;
31
- if (e && F.length > 0) {
32
- let t = F.find((t) => t.id === e);
33
- t && L(t);
26
+ w && P(w);
27
+ }, [w, P]), o(() => {
28
+ W();
29
+ }, [W]), o(() => {
30
+ let e = T || R?.id;
31
+ if (e && L.length > 0) {
32
+ let t = L.find((t) => t.id === e);
33
+ t && z(t);
34
34
  }
35
35
  }, [
36
- C,
37
- F,
36
+ T,
38
37
  L,
39
- I?.id
38
+ z,
39
+ R?.id
40
40
  ]);
41
41
  let Q = () => {
42
- R();
43
- }, me = async () => {
44
- if (S) try {
45
- await N(S, F);
42
+ B();
43
+ }, ge = async () => {
44
+ if (w) try {
45
+ await F(w, L);
46
46
  } catch {
47
- r(E, "step.save", w);
47
+ r(O, "step.save", E);
48
48
  }
49
- }, he = () => {
50
- le(`${T}/${S}/edit`);
51
- }, ge = async () => {
52
- if (!(!I || !S || !J)) {
53
- if (I.id.startsWith("temp_")) {
49
+ }, _e = () => {
50
+ le(`${D}/${w}/edit`);
51
+ }, ve = async () => {
52
+ if (!(!R || !w || !J)) {
53
+ if (R.id.startsWith("temp_")) {
54
54
  window.alert("Save your steps before attaching media to them.");
55
55
  return;
56
56
  }
57
57
  try {
58
- Z(!0), await W(I.id, J, X, (I.media?.length ?? 0) + 1), await M(S), Y("");
58
+ Z(!0), await de(R.id, J, X, (R.media?.length ?? 0) + 1), await P(w), Y("");
59
59
  } catch {
60
- r(E, "media.attach", w);
60
+ r(O, "media.attach", E);
61
61
  } finally {
62
62
  Z(!1);
63
63
  }
64
64
  }
65
65
  }, $ = (e) => {
66
- L(e), q && K(!1);
66
+ z(e), q && K(!1);
67
67
  };
68
- return /* @__PURE__ */ h("div", {
68
+ return /* @__PURE__ */ v("div", {
69
69
  className: "flex flex-col h-full bg-bg-surface",
70
- children: [/* @__PURE__ */ h("div", {
71
- className: "border-b border-border-subtle p-3 sm:p-4 flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 bg-bg-surface",
72
- children: [/* @__PURE__ */ h("div", {
73
- className: "flex items-center gap-3",
74
- children: [/* @__PURE__ */ m("button", {
75
- type: "button",
76
- onClick: he,
77
- className: "p-2 hover:bg-accent rounded-md shrink-0",
78
- "aria-label": x("stepEditor.goBack"),
79
- children: /* @__PURE__ */ m(re, { size: 20 })
80
- }), /* @__PURE__ */ h("div", {
81
- className: "flex-1 min-w-0",
82
- children: [/* @__PURE__ */ h("h1", {
83
- className: "text-base sm:text-lg font-semibold truncate",
84
- children: [
85
- j?.name || x("stepEditor.tourFallback"),
86
- " - ",
87
- x("stepEditor.stepsLabel")
88
- ]
89
- }), /* @__PURE__ */ h("p", {
90
- className: "text-xs sm:text-sm text-text-secondary",
91
- children: [
92
- F.length,
93
- " ",
94
- x("stepEditor.stepsCount")
95
- ]
96
- })]
97
- })]
98
- }), /* @__PURE__ */ h("div", {
99
- className: "flex items-center gap-2 sm:gap-3 ml-auto",
100
- children: [
101
- q && /* @__PURE__ */ h("button", {
70
+ children: [
71
+ /* @__PURE__ */ v("div", {
72
+ className: "border-b border-border-subtle p-3 sm:p-4 flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 bg-bg-surface",
73
+ children: [/* @__PURE__ */ v("div", {
74
+ className: "flex items-center gap-3",
75
+ children: [/* @__PURE__ */ _("button", {
102
76
  type: "button",
103
- onClick: () => K(!G),
104
- className: "px-3 py-2 border border-border-subtle rounded-md hover:bg-accent flex items-center gap-2 sm:hidden",
105
- children: [
106
- /* @__PURE__ */ m(f, { size: 18 }),
107
- /* @__PURE__ */ m("span", {
108
- className: "text-sm",
109
- children: x("stepEditor.steps")
110
- }),
111
- F.length > 0 && /* @__PURE__ */ m("span", {
112
- className: "px-1.5 py-0.5 text-xs bg-action-primary-bg/20 rounded-full",
113
- children: F.length
114
- })
115
- ]
116
- }),
117
- O && /* @__PURE__ */ h("button", {
118
- type: "button",
119
- onClick: Q,
120
- className: "px-3 sm:px-4 py-2 border border-border-subtle rounded-md hover:bg-accent flex items-center gap-2 text-sm sm:text-base",
121
- children: [/* @__PURE__ */ m(p, { size: 18 }), /* @__PURE__ */ m("span", {
122
- className: "hidden xs:inline",
123
- children: x("stepEditor.addStep")
77
+ onClick: _e,
78
+ className: "p-2 hover:bg-accent rounded-md shrink-0",
79
+ "aria-label": C("stepEditor.goBack"),
80
+ children: /* @__PURE__ */ _(l, { size: 20 })
81
+ }), /* @__PURE__ */ v("div", {
82
+ className: "flex-1 min-w-0",
83
+ children: [/* @__PURE__ */ v("h1", {
84
+ className: "text-base sm:text-lg font-semibold truncate",
85
+ children: [
86
+ N?.name || C("stepEditor.tourFallback"),
87
+ " - ",
88
+ C("stepEditor.stepsLabel")
89
+ ]
90
+ }), /* @__PURE__ */ v("p", {
91
+ className: "text-xs sm:text-sm text-text-secondary",
92
+ children: [
93
+ L.length,
94
+ " ",
95
+ C("stepEditor.stepsCount")
96
+ ]
124
97
  })]
125
- }),
126
- /* @__PURE__ */ m(ne, {
127
- permission: n.TOUR_STEP_UPDATE,
128
- children: /* @__PURE__ */ h(_, {
98
+ })]
99
+ }), /* @__PURE__ */ v("div", {
100
+ className: "flex items-center gap-2 sm:gap-3 ml-auto",
101
+ children: [
102
+ q && /* @__PURE__ */ v("button", {
129
103
  type: "button",
130
- onClick: me,
131
- disabled: P || !k,
132
- className: "min-h-[44px] text-sm sm:text-base",
133
- children: [/* @__PURE__ */ m(ae, { size: 18 }), /* @__PURE__ */ m("span", {
104
+ onClick: () => K(!G),
105
+ className: "px-3 py-2 border border-border-subtle rounded-md hover:bg-accent flex items-center gap-2 sm:hidden",
106
+ children: [
107
+ /* @__PURE__ */ _(m, { size: 18 }),
108
+ /* @__PURE__ */ _("span", {
109
+ className: "text-sm",
110
+ children: C("stepEditor.steps")
111
+ }),
112
+ L.length > 0 && /* @__PURE__ */ _("span", {
113
+ className: "px-1.5 py-0.5 text-xs bg-action-primary-bg/20 rounded-full",
114
+ children: L.length
115
+ })
116
+ ]
117
+ }),
118
+ A && /* @__PURE__ */ v("button", {
119
+ type: "button",
120
+ onClick: Q,
121
+ className: "px-3 sm:px-4 py-2 border border-border-subtle rounded-md hover:bg-accent flex items-center gap-2 text-sm sm:text-base",
122
+ children: [/* @__PURE__ */ _(h, { size: 18 }), /* @__PURE__ */ _("span", {
134
123
  className: "hidden xs:inline",
135
- children: x(P ? "stepEditor.saving" : "stepEditor.save")
124
+ children: C("stepEditor.addStep")
136
125
  })]
126
+ }),
127
+ /* @__PURE__ */ _(c, {
128
+ permission: n.TOUR_STEP_UPDATE,
129
+ children: /* @__PURE__ */ v(b, {
130
+ type: "button",
131
+ onClick: ge,
132
+ disabled: I || !j,
133
+ className: "min-h-[44px] text-sm sm:text-base",
134
+ children: [/* @__PURE__ */ _(re, { size: 18 }), /* @__PURE__ */ _("span", {
135
+ className: "hidden xs:inline",
136
+ children: C(I ? "stepEditor.saving" : "stepEditor.save")
137
+ })]
138
+ })
137
139
  })
138
- })
139
- ]
140
- })]
141
- }), /* @__PURE__ */ h("div", {
142
- className: "flex-1 flex overflow-hidden relative",
143
- children: [
144
- q && G && /* @__PURE__ */ m("button", {
145
- type: "button",
146
- "aria-label": x("stepEditor.closeSteps"),
147
- className: "fixed inset-0 bg-foreground/40 z-40 md:hidden",
148
- onClick: () => K(!1)
149
- }),
150
- /* @__PURE__ */ h("div", {
151
- className: `
140
+ ]
141
+ })]
142
+ }),
143
+ /* @__PURE__ */ _("div", {
144
+ className: "px-3 sm:px-4 pt-3 sm:pt-4",
145
+ children: /* @__PURE__ */ _(se, { children: C("stepEditor.purpose") })
146
+ }),
147
+ /* @__PURE__ */ v("div", {
148
+ className: "flex-1 flex overflow-hidden relative",
149
+ children: [
150
+ q && G && /* @__PURE__ */ _("button", {
151
+ type: "button",
152
+ "aria-label": C("stepEditor.closeSteps"),
153
+ className: "fixed inset-0 bg-foreground/40 z-40 md:hidden",
154
+ onClick: () => K(!1)
155
+ }),
156
+ /* @__PURE__ */ v("div", {
157
+ className: `
152
158
  ${q ? "fixed inset-y-0 left-0 z-50 w-[min(18rem,calc(100vw-2rem))] transform transition-transform duration-300" : "w-64 lg:w-80 shrink-0"}
153
159
  ${q && !G ? "-translate-x-full" : "translate-x-0"}
154
160
  border-r border-border-subtle overflow-y-auto bg-bg-surface
155
161
  `,
156
- children: [q && /* @__PURE__ */ h("div", {
157
- className: "flex items-center justify-between p-4 border-b border-border-subtle sticky top-0 bg-bg-surface z-10",
158
- children: [/* @__PURE__ */ m("h2", {
159
- className: "font-semibold",
160
- children: x("stepEditor.tourSteps")
161
- }), /* @__PURE__ */ m("button", {
162
- type: "button",
163
- onClick: () => K(!1),
164
- className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md",
165
- "aria-label": x("stepEditor.closeSteps"),
166
- children: /* @__PURE__ */ m(se, { size: 20 })
167
- })]
168
- }), /* @__PURE__ */ m("div", {
169
- className: "p-3 sm:p-4 space-y-2",
170
- children: F.length === 0 ? /* @__PURE__ */ h("div", {
171
- className: "text-center py-8 text-text-secondary",
172
- children: [/* @__PURE__ */ m("p", {
173
- className: "text-sm",
174
- children: x("stepEditor.noStepsYet")
175
- }), /* @__PURE__ */ m("p", {
176
- className: "text-xs mt-1",
177
- children: x("stepEditor.clickAddStep")
162
+ children: [q && /* @__PURE__ */ v("div", {
163
+ className: "flex items-center justify-between p-4 border-b border-border-subtle sticky top-0 bg-bg-surface z-10",
164
+ children: [/* @__PURE__ */ _("h2", {
165
+ className: "font-semibold",
166
+ children: C("stepEditor.tourSteps")
167
+ }), /* @__PURE__ */ _("button", {
168
+ type: "button",
169
+ onClick: () => K(!1),
170
+ className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md",
171
+ "aria-label": C("stepEditor.closeSteps"),
172
+ children: /* @__PURE__ */ _(g, { size: 20 })
178
173
  })]
179
- }) : F.map((e, t) => /* @__PURE__ */ m("div", {
180
- role: "button",
181
- tabIndex: 0,
182
- onClick: () => $(e),
183
- onKeyDown: (t) => {
184
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(e));
185
- },
186
- className: `p-3 border rounded-md cursor-pointer transition-colors ${I?.id === e.id ? "border-primary bg-action-primary-bg/10 shadow-[var(--shadow-pop)]" : "border-border-seam hover:bg-accent"}`,
187
- children: /* @__PURE__ */ h("div", {
188
- className: "flex items-start justify-between gap-2",
189
- children: [/* @__PURE__ */ h("div", {
190
- className: "flex-1 min-w-0",
191
- children: [
192
- /* @__PURE__ */ h("div", {
193
- className: "text-xs text-text-secondary mb-1",
194
- children: [
195
- x("stepEditor.stepNumber"),
196
- " ",
197
- t + 1
198
- ]
199
- }),
200
- /* @__PURE__ */ m("div", {
201
- className: "font-medium text-sm truncate",
202
- children: e.title || x("stepEditor.untitled")
203
- }),
204
- e.targetSelector && /* @__PURE__ */ m("div", {
205
- className: "text-xs text-text-secondary mt-1 truncate font-mono",
206
- children: e.targetSelector
207
- })
208
- ]
209
- }), A && /* @__PURE__ */ h("div", {
210
- className: "flex items-center gap-1 shrink-0",
174
+ }), /* @__PURE__ */ _("div", {
175
+ className: "p-3 sm:p-4 space-y-2",
176
+ children: L.length === 0 ? /* @__PURE__ */ v("div", {
177
+ className: "text-center py-8 text-text-secondary",
178
+ children: [/* @__PURE__ */ _("p", {
179
+ className: "text-sm",
180
+ children: C("stepEditor.noStepsYet")
181
+ }), /* @__PURE__ */ _("p", {
182
+ className: "text-xs mt-1",
183
+ children: C("stepEditor.clickAddStep")
184
+ })]
185
+ }) : L.map((e, t) => /* @__PURE__ */ _("div", {
186
+ role: "button",
187
+ tabIndex: 0,
188
+ onClick: () => $(e),
189
+ onKeyDown: (t) => {
190
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(e));
191
+ },
192
+ className: `p-3 border rounded-md cursor-pointer transition-colors ${R?.id === e.id ? "border-primary bg-action-primary-bg/10 shadow-[var(--shadow-pop)]" : "border-border-seam hover:bg-accent"}`,
193
+ children: /* @__PURE__ */ v("div", {
194
+ className: "flex items-start justify-between gap-2",
195
+ children: [/* @__PURE__ */ v("div", {
196
+ className: "flex-1 min-w-0",
197
+ children: [
198
+ /* @__PURE__ */ v("div", {
199
+ className: "text-xs text-text-secondary mb-1",
200
+ children: [
201
+ C("stepEditor.stepNumber"),
202
+ " ",
203
+ t + 1
204
+ ]
205
+ }),
206
+ /* @__PURE__ */ _("div", {
207
+ className: "font-medium text-sm truncate",
208
+ children: e.title || C("stepEditor.untitled")
209
+ }),
210
+ e.targetSelector && /* @__PURE__ */ _("div", {
211
+ className: "text-xs text-text-secondary mt-1 truncate font-mono",
212
+ children: e.targetSelector
213
+ })
214
+ ]
215
+ }), M && /* @__PURE__ */ v("div", {
216
+ className: "flex items-center gap-1 shrink-0",
217
+ children: [
218
+ /* @__PURE__ */ _("button", {
219
+ type: "button",
220
+ onClick: (e) => {
221
+ e.stopPropagation(), t > 0 && H(t, t - 1);
222
+ },
223
+ className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-accent rounded",
224
+ title: "Move step up",
225
+ "aria-label": "Move step up",
226
+ disabled: t === 0,
227
+ children: /* @__PURE__ */ _(p, { size: 14 })
228
+ }),
229
+ /* @__PURE__ */ _("button", {
230
+ type: "button",
231
+ onClick: (e) => {
232
+ e.stopPropagation(), t < L.length - 1 && H(t, t + 1);
233
+ },
234
+ className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-accent rounded",
235
+ title: "Move step down",
236
+ "aria-label": "Move step down",
237
+ disabled: t === L.length - 1,
238
+ children: /* @__PURE__ */ _(u, { size: 14 })
239
+ }),
240
+ /* @__PURE__ */ _("button", {
241
+ type: "button",
242
+ onClick: (t) => {
243
+ t.stopPropagation(), ue(e.id);
244
+ },
245
+ className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-status-error-bg/10 rounded text-status-error-text",
246
+ title: C("stepEditor.deleteStep"),
247
+ "aria-label": C("stepEditor.deleteStep"),
248
+ children: /* @__PURE__ */ _(ie, { size: 14 })
249
+ })
250
+ ]
251
+ })]
252
+ })
253
+ }, e.id))
254
+ })]
255
+ }),
256
+ /* @__PURE__ */ _("div", {
257
+ className: "flex-1 overflow-y-auto p-4 sm:p-6",
258
+ children: R ? /* @__PURE__ */ v("div", {
259
+ className: "max-w-2xl mx-auto space-y-4 sm:space-y-6",
260
+ children: [
261
+ q && L.length > 1 && /* @__PURE__ */ v("div", {
262
+ className: "flex items-center justify-between bg-bg-sunken/50 rounded-lg p-2 mb-4",
211
263
  children: [
212
- /* @__PURE__ */ m("button", {
264
+ /* @__PURE__ */ _("button", {
213
265
  type: "button",
214
- onClick: (e) => {
215
- e.stopPropagation(), t > 0 && V(t, t - 1);
266
+ onClick: () => {
267
+ let e = L.findIndex((e) => e.id === R.id);
268
+ e > 0 && z(L[e - 1]);
216
269
  },
217
- className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-accent rounded",
218
- title: "Move step up",
219
- "aria-label": "Move step up",
220
- disabled: t === 0,
221
- children: /* @__PURE__ */ m(d, { size: 14 })
270
+ disabled: L.findIndex((e) => e.id === R.id) === 0,
271
+ className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md disabled:opacity-30",
272
+ "aria-label": C("stepEditor.previousStep"),
273
+ children: /* @__PURE__ */ _(d, { size: 20 })
222
274
  }),
223
- /* @__PURE__ */ m("button", {
224
- type: "button",
225
- onClick: (e) => {
226
- e.stopPropagation(), t < F.length - 1 && V(t, t + 1);
227
- },
228
- className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-accent rounded",
229
- title: "Move step down",
230
- "aria-label": "Move step down",
231
- disabled: t === F.length - 1,
232
- children: /* @__PURE__ */ m(c, { size: 14 })
275
+ /* @__PURE__ */ v("span", {
276
+ className: "text-sm text-text-secondary",
277
+ children: [
278
+ C("stepEditor.stepNumber"),
279
+ " ",
280
+ L.findIndex((e) => e.id === R.id) + 1,
281
+ " ",
282
+ C("stepEditor.of"),
283
+ " ",
284
+ L.length
285
+ ]
233
286
  }),
234
- /* @__PURE__ */ m("button", {
287
+ /* @__PURE__ */ _("button", {
235
288
  type: "button",
236
- onClick: (t) => {
237
- t.stopPropagation(), z(e.id);
289
+ onClick: () => {
290
+ let e = L.findIndex((e) => e.id === R.id);
291
+ e < L.length - 1 && z(L[e + 1]);
238
292
  },
239
- className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-status-error-bg/10 rounded text-status-error-text",
240
- title: x("stepEditor.deleteStep"),
241
- "aria-label": x("stepEditor.deleteStep"),
242
- children: /* @__PURE__ */ m(oe, { size: 14 })
293
+ disabled: L.findIndex((e) => e.id === R.id) === L.length - 1,
294
+ className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md disabled:opacity-30",
295
+ "aria-label": C("stepEditor.nextStep"),
296
+ children: /* @__PURE__ */ _(f, { size: 20 })
243
297
  })
244
298
  ]
245
- })]
246
- })
247
- }, e.id))
248
- })]
249
- }),
250
- /* @__PURE__ */ m("div", {
251
- className: "flex-1 overflow-y-auto p-4 sm:p-6",
252
- children: I ? /* @__PURE__ */ h("div", {
253
- className: "max-w-2xl mx-auto space-y-4 sm:space-y-6",
254
- children: [
255
- q && F.length > 1 && /* @__PURE__ */ h("div", {
256
- className: "flex items-center justify-between bg-bg-sunken/50 rounded-lg p-2 mb-4",
257
- children: [
258
- /* @__PURE__ */ m("button", {
259
- type: "button",
260
- onClick: () => {
261
- let e = F.findIndex((e) => e.id === I.id);
262
- e > 0 && L(F[e - 1]);
263
- },
264
- disabled: F.findIndex((e) => e.id === I.id) === 0,
265
- className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md disabled:opacity-30",
266
- "aria-label": x("stepEditor.previousStep"),
267
- children: /* @__PURE__ */ m(l, { size: 20 })
268
- }),
269
- /* @__PURE__ */ h("span", {
270
- className: "text-sm text-text-secondary",
299
+ }),
300
+ /* @__PURE__ */ _("h2", {
301
+ className: "text-lg sm:text-xl font-semibold",
302
+ children: C("stepEditor.editStep")
303
+ }),
304
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
305
+ className: "block text-sm font-medium mb-2",
306
+ htmlFor: "step-editor-title",
307
+ children: [C("stepEditor.stepTitle"), " *"]
308
+ }), /* @__PURE__ */ _("input", {
309
+ id: "step-editor-title",
310
+ type: "text",
311
+ value: R.title,
312
+ onChange: (e) => V(R.id, "title", e.target.value),
313
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm sm:text-base",
314
+ placeholder: C("stepEditor.stepTitlePlaceholder"),
315
+ "aria-label": C("stepEditor.stepTitle")
316
+ })] }),
317
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
318
+ className: "block text-sm font-medium mb-2",
319
+ htmlFor: "step-editor-content",
320
+ children: [C("stepEditor.content"), " *"]
321
+ }), /* @__PURE__ */ _("textarea", {
322
+ id: "step-editor-content",
323
+ value: R.content,
324
+ onChange: (e) => V(R.id, "content", e.target.value),
325
+ rows: 4,
326
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm sm:text-base resize-y min-h-[100px]",
327
+ placeholder: C("stepEditor.contentPlaceholder"),
328
+ "aria-label": C("stepEditor.content")
329
+ })] }),
330
+ /* @__PURE__ */ v("div", { children: [
331
+ /* @__PURE__ */ v("label", {
332
+ className: "block text-sm font-medium mb-2",
333
+ htmlFor: "step-editor-css-selector",
271
334
  children: [
272
- x("stepEditor.stepNumber"),
273
- " ",
274
- F.findIndex((e) => e.id === I.id) + 1,
275
- " ",
276
- x("stepEditor.of"),
277
- " ",
278
- F.length
335
+ C("stepEditor.cssSelector"),
336
+ " *",
337
+ /* @__PURE__ */ v("span", {
338
+ className: "text-text-secondary font-normal ml-2",
339
+ children: [
340
+ "(",
341
+ C("stepEditor.targetElement"),
342
+ ")"
343
+ ]
344
+ })
279
345
  ]
280
346
  }),
281
- /* @__PURE__ */ m("button", {
282
- type: "button",
283
- onClick: () => {
284
- let e = F.findIndex((e) => e.id === I.id);
285
- e < F.length - 1 && L(F[e + 1]);
286
- },
287
- disabled: F.findIndex((e) => e.id === I.id) === F.length - 1,
288
- className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md disabled:opacity-30",
289
- "aria-label": x("stepEditor.nextStep"),
290
- children: /* @__PURE__ */ m(u, { size: 20 })
347
+ /* @__PURE__ */ _("input", {
348
+ id: "step-editor-css-selector",
349
+ type: "text",
350
+ value: R.targetSelector || "",
351
+ onChange: (e) => V(R.id, "targetSelector", e.target.value),
352
+ placeholder: C("stepEditor.cssSelectorPlaceholder"),
353
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface font-mono text-sm",
354
+ "aria-label": "{tr('stepEditor.cssSelector')} *\n \n ({tr('stepEditor.targetElement')})"
355
+ }),
356
+ /* @__PURE__ */ _("p", {
357
+ className: "text-xs text-text-secondary mt-1",
358
+ children: C("stepEditor.dataTourHint")
291
359
  })
292
- ]
293
- }),
294
- /* @__PURE__ */ m("h2", {
295
- className: "text-lg sm:text-xl font-semibold",
296
- children: x("stepEditor.editStep")
297
- }),
298
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
299
- className: "block text-sm font-medium mb-2",
300
- htmlFor: "step-editor-title",
301
- children: [x("stepEditor.stepTitle"), " *"]
302
- }), /* @__PURE__ */ m("input", {
303
- id: "step-editor-title",
304
- type: "text",
305
- value: I.title,
306
- onChange: (e) => B(I.id, "title", e.target.value),
307
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm sm:text-base",
308
- placeholder: x("stepEditor.stepTitlePlaceholder"),
309
- "aria-label": x("stepEditor.stepTitle")
310
- })] }),
311
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
312
- className: "block text-sm font-medium mb-2",
313
- htmlFor: "step-editor-content",
314
- children: [x("stepEditor.content"), " *"]
315
- }), /* @__PURE__ */ m("textarea", {
316
- id: "step-editor-content",
317
- value: I.content,
318
- onChange: (e) => B(I.id, "content", e.target.value),
319
- rows: 4,
320
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm sm:text-base resize-y min-h-[100px]",
321
- placeholder: x("stepEditor.contentPlaceholder"),
322
- "aria-label": x("stepEditor.content")
323
- })] }),
324
- /* @__PURE__ */ h("div", { children: [
325
- /* @__PURE__ */ h("label", {
360
+ ] }),
361
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
326
362
  className: "block text-sm font-medium mb-2",
327
- htmlFor: "step-editor-css-selector",
363
+ htmlFor: "step-editor-placement",
364
+ children: C("stepEditor.tooltipPlacement")
365
+ }), /* @__PURE__ */ v("select", {
366
+ id: "step-editor-placement",
367
+ value: R.placement,
368
+ onChange: (e) => V(R.id, "placement", e.target.value),
369
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm sm:text-base",
370
+ "aria-label": C("stepEditor.tooltipPlacement"),
328
371
  children: [
329
- x("stepEditor.cssSelector"),
330
- " *",
331
- /* @__PURE__ */ h("span", {
332
- className: "text-text-secondary font-normal ml-2",
333
- children: [
334
- "(",
335
- x("stepEditor.targetElement"),
336
- ")"
337
- ]
372
+ /* @__PURE__ */ _("option", {
373
+ value: "AUTO",
374
+ children: C("stepEditor.placementAuto")
375
+ }),
376
+ /* @__PURE__ */ _("option", {
377
+ value: "TOP",
378
+ children: C("stepEditor.placementTop")
379
+ }),
380
+ /* @__PURE__ */ _("option", {
381
+ value: "BOTTOM",
382
+ children: C("stepEditor.placementBottom")
383
+ }),
384
+ /* @__PURE__ */ _("option", {
385
+ value: "LEFT",
386
+ children: C("stepEditor.placementLeft")
387
+ }),
388
+ /* @__PURE__ */ _("option", {
389
+ value: "RIGHT",
390
+ children: C("stepEditor.placementRight")
391
+ }),
392
+ /* @__PURE__ */ _("option", {
393
+ value: "CENTER",
394
+ children: C("stepEditor.placementCenter")
338
395
  })
339
396
  ]
397
+ })] }),
398
+ /* @__PURE__ */ v("details", {
399
+ className: "border border-border-subtle rounded-md",
400
+ children: [/* @__PURE__ */ _("summary", {
401
+ className: "px-4 py-3 cursor-pointer font-medium text-sm hover:bg-accent/50 rounded-t-md",
402
+ children: C("stepEditor.deviceSpecificSelectors")
403
+ }), /* @__PURE__ */ v("div", {
404
+ className: "p-4 pt-0 space-y-3 border-t border-border-subtle",
405
+ children: [
406
+ /* @__PURE__ */ _("p", {
407
+ className: "text-xs text-text-secondary mb-3",
408
+ children: C("stepEditor.deviceSelectorHint")
409
+ }),
410
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
411
+ className: "block text-xs font-medium mb-1",
412
+ htmlFor: "step-editor-mobile-selector",
413
+ children: C("stepEditor.mobileSelector")
414
+ }), /* @__PURE__ */ _("input", {
415
+ id: "step-editor-mobile-selector",
416
+ type: "text",
417
+ value: R.targetSelectorMobile || "",
418
+ onChange: (e) => V(R.id, "targetSelectorMobile", e.target.value),
419
+ placeholder: C("stepEditor.leaveEmptyDefault"),
420
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono",
421
+ "aria-label": C("stepEditor.mobileSelector")
422
+ })] }),
423
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
424
+ className: "block text-xs font-medium mb-1",
425
+ htmlFor: "step-editor-tablet-selector",
426
+ children: C("stepEditor.tabletSelector")
427
+ }), /* @__PURE__ */ _("input", {
428
+ id: "step-editor-tablet-selector",
429
+ type: "text",
430
+ value: R.targetSelectorTablet || "",
431
+ onChange: (e) => V(R.id, "targetSelectorTablet", e.target.value),
432
+ placeholder: C("stepEditor.leaveEmptyDefault"),
433
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono",
434
+ "aria-label": C("stepEditor.tabletSelector")
435
+ })] }),
436
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
437
+ className: "block text-xs font-medium mb-1",
438
+ htmlFor: "step-editor-desktop-selector",
439
+ children: C("stepEditor.desktopSelector")
440
+ }), /* @__PURE__ */ _("input", {
441
+ id: "step-editor-desktop-selector",
442
+ type: "text",
443
+ value: R.targetSelectorDesktop || "",
444
+ onChange: (e) => V(R.id, "targetSelectorDesktop", e.target.value),
445
+ placeholder: C("stepEditor.leaveEmptyDefault"),
446
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono",
447
+ "aria-label": C("stepEditor.desktopSelector")
448
+ })] })
449
+ ]
450
+ })]
340
451
  }),
341
- /* @__PURE__ */ m("input", {
342
- id: "step-editor-css-selector",
343
- type: "text",
344
- value: I.targetSelector || "",
345
- onChange: (e) => B(I.id, "targetSelector", e.target.value),
346
- placeholder: x("stepEditor.cssSelectorPlaceholder"),
347
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface font-mono text-sm",
348
- "aria-label": "{tr('stepEditor.cssSelector')} *\n \n ({tr('stepEditor.targetElement')})"
452
+ /* @__PURE__ */ v("div", {
453
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
454
+ children: [/* @__PURE__ */ v("label", {
455
+ className: "flex items-center gap-3 cursor-pointer rounded-md border border-border-subtle p-3",
456
+ children: [/* @__PURE__ */ _("input", {
457
+ type: "checkbox",
458
+ checked: R.requireInteraction ?? !1,
459
+ onChange: (e) => V(R.id, "requireInteraction", e.target.checked),
460
+ className: "size-4 rounded",
461
+ "aria-label": "Require interaction"
462
+ }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("div", {
463
+ className: "text-sm font-medium",
464
+ children: "Require interaction"
465
+ }), /* @__PURE__ */ _("div", {
466
+ className: "text-xs text-text-secondary",
467
+ children: "User must interact with the highlighted element before advancing."
468
+ })] })]
469
+ }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
470
+ className: "block text-sm font-medium mb-2",
471
+ htmlFor: "step-editor-wait-timeout",
472
+ children: "Wait for timeout (ms)"
473
+ }), /* @__PURE__ */ _("input", {
474
+ id: "step-editor-wait-timeout",
475
+ type: "number",
476
+ min: "0",
477
+ value: R.waitForTimeout ?? "",
478
+ onChange: (e) => V(R.id, "waitForTimeout", e.target.value ? Number(e.target.value) : void 0),
479
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm",
480
+ placeholder: "1500",
481
+ "aria-label": "Wait for timeout (ms)"
482
+ })] })]
349
483
  }),
350
- /* @__PURE__ */ m("p", {
351
- className: "text-xs text-text-secondary mt-1",
352
- children: x("stepEditor.dataTourHint")
353
- })
354
- ] }),
355
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
356
- className: "block text-sm font-medium mb-2",
357
- htmlFor: "step-editor-placement",
358
- children: x("stepEditor.tooltipPlacement")
359
- }), /* @__PURE__ */ h("select", {
360
- id: "step-editor-placement",
361
- value: I.placement,
362
- onChange: (e) => B(I.id, "placement", e.target.value),
363
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm sm:text-base",
364
- "aria-label": x("stepEditor.tooltipPlacement"),
365
- children: [
366
- /* @__PURE__ */ m("option", {
367
- value: "AUTO",
368
- children: x("stepEditor.placementAuto")
369
- }),
370
- /* @__PURE__ */ m("option", {
371
- value: "TOP",
372
- children: x("stepEditor.placementTop")
373
- }),
374
- /* @__PURE__ */ m("option", {
375
- value: "BOTTOM",
376
- children: x("stepEditor.placementBottom")
377
- }),
378
- /* @__PURE__ */ m("option", {
379
- value: "LEFT",
380
- children: x("stepEditor.placementLeft")
381
- }),
382
- /* @__PURE__ */ m("option", {
383
- value: "RIGHT",
384
- children: x("stepEditor.placementRight")
385
- }),
386
- /* @__PURE__ */ m("option", {
387
- value: "CENTER",
388
- children: x("stepEditor.placementCenter")
389
- })
390
- ]
391
- })] }),
392
- /* @__PURE__ */ h("details", {
393
- className: "border border-border-subtle rounded-md",
394
- children: [/* @__PURE__ */ m("summary", {
395
- className: "px-4 py-3 cursor-pointer font-medium text-sm hover:bg-accent/50 rounded-t-md",
396
- children: x("stepEditor.deviceSpecificSelectors")
397
- }), /* @__PURE__ */ h("div", {
398
- className: "p-4 pt-0 space-y-3 border-t border-border-subtle",
399
- children: [
400
- /* @__PURE__ */ m("p", {
401
- className: "text-xs text-text-secondary mb-3",
402
- children: x("stepEditor.deviceSelectorHint")
403
- }),
404
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
405
- className: "block text-xs font-medium mb-1",
406
- htmlFor: "step-editor-mobile-selector",
407
- children: x("stepEditor.mobileSelector")
408
- }), /* @__PURE__ */ m("input", {
409
- id: "step-editor-mobile-selector",
410
- type: "text",
411
- value: I.targetSelectorMobile || "",
412
- onChange: (e) => B(I.id, "targetSelectorMobile", e.target.value),
413
- placeholder: x("stepEditor.leaveEmptyDefault"),
414
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono",
415
- "aria-label": x("stepEditor.mobileSelector")
416
- })] }),
417
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
418
- className: "block text-xs font-medium mb-1",
419
- htmlFor: "step-editor-tablet-selector",
420
- children: x("stepEditor.tabletSelector")
421
- }), /* @__PURE__ */ m("input", {
422
- id: "step-editor-tablet-selector",
484
+ /* @__PURE__ */ v(oe, {
485
+ title: "Advanced settings",
486
+ description: "Step-timing waits, skip conditions, and analytics tags.",
487
+ children: [/* @__PURE__ */ v("div", {
488
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
489
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
490
+ className: "block text-sm font-medium mb-2",
491
+ htmlFor: "step-editor-wait-selector",
492
+ children: "Wait for selector"
493
+ }), /* @__PURE__ */ _("input", {
494
+ id: "step-editor-wait-selector",
423
495
  type: "text",
424
- value: I.targetSelectorTablet || "",
425
- onChange: (e) => B(I.id, "targetSelectorTablet", e.target.value),
426
- placeholder: x("stepEditor.leaveEmptyDefault"),
496
+ value: R.waitForSelector || "",
497
+ onChange: (e) => V(R.id, "waitForSelector", e.target.value || void 0),
427
498
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono",
428
- "aria-label": x("stepEditor.tabletSelector")
429
- })] }),
430
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
431
- className: "block text-xs font-medium mb-1",
432
- htmlFor: "step-editor-desktop-selector",
433
- children: x("stepEditor.desktopSelector")
434
- }), /* @__PURE__ */ m("input", {
435
- id: "step-editor-desktop-selector",
499
+ placeholder: "[data-tour='agents-tabs']",
500
+ "aria-label": "Wait for selector"
501
+ })] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
502
+ className: "block text-sm font-medium mb-2",
503
+ htmlFor: "step-editor-wait-event",
504
+ children: "Wait for event"
505
+ }), /* @__PURE__ */ _("input", {
506
+ id: "step-editor-wait-event",
436
507
  type: "text",
437
- value: I.targetSelectorDesktop || "",
438
- onChange: (e) => B(I.id, "targetSelectorDesktop", e.target.value),
439
- placeholder: x("stepEditor.leaveEmptyDefault"),
508
+ value: R.waitForEvent || "",
509
+ onChange: (e) => V(R.id, "waitForEvent", e.target.value || void 0),
510
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm",
511
+ placeholder: "tour:ready",
512
+ "aria-label": "Wait for event"
513
+ })] })]
514
+ }), /* @__PURE__ */ v("div", {
515
+ className: "mt-4",
516
+ children: [/* @__PURE__ */ _("label", {
517
+ className: "block text-sm font-medium mb-2",
518
+ htmlFor: "step-editor-skip-conditions",
519
+ children: "Skip conditions (JSON)"
520
+ }), /* @__PURE__ */ _("textarea", {
521
+ id: "step-editor-skip-conditions",
522
+ value: R.skipConditions ? JSON.stringify(R.skipConditions, null, 2) : "",
523
+ onChange: (e) => {
524
+ let t = e.target.value.trim();
525
+ if (!t) {
526
+ V(R.id, "skipConditions", void 0);
527
+ return;
528
+ }
529
+ try {
530
+ V(R.id, "skipConditions", JSON.parse(t));
531
+ } catch {
532
+ V(R.id, "skipConditions", t);
533
+ }
534
+ },
535
+ rows: 4,
440
536
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono",
441
- "aria-label": x("stepEditor.desktopSelector")
442
- })] })
443
- ]
444
- })]
445
- }),
446
- /* @__PURE__ */ h("div", {
447
- className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
448
- children: [/* @__PURE__ */ h("label", {
449
- className: "flex items-center gap-3 cursor-pointer rounded-md border border-border-subtle p-3",
450
- children: [/* @__PURE__ */ m("input", {
451
- type: "checkbox",
452
- checked: I.requireInteraction ?? !1,
453
- onChange: (e) => B(I.id, "requireInteraction", e.target.checked),
454
- className: "size-4 rounded",
455
- "aria-label": "Require interaction"
456
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
457
- className: "text-sm font-medium",
458
- children: "Require interaction"
459
- }), /* @__PURE__ */ m("div", {
460
- className: "text-xs text-text-secondary",
461
- children: "User must interact with the highlighted element before advancing."
462
- })] })]
463
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
464
- className: "block text-sm font-medium mb-2",
465
- htmlFor: "step-editor-wait-timeout",
466
- children: "Wait for timeout (ms)"
467
- }), /* @__PURE__ */ m("input", {
468
- id: "step-editor-wait-timeout",
469
- type: "number",
470
- min: "0",
471
- value: I.waitForTimeout ?? "",
472
- onChange: (e) => B(I.id, "waitForTimeout", e.target.value ? Number(e.target.value) : void 0),
473
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm",
474
- placeholder: "1500",
475
- "aria-label": "Wait for timeout (ms)"
476
- })] })]
477
- }),
478
- /* @__PURE__ */ h(y, {
479
- title: "Advanced settings",
480
- description: "Step-timing waits, skip conditions, and analytics tags.",
481
- children: [/* @__PURE__ */ h("div", {
482
- className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
483
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
484
- className: "block text-sm font-medium mb-2",
485
- htmlFor: "step-editor-wait-selector",
486
- children: "Wait for selector"
487
- }), /* @__PURE__ */ m("input", {
488
- id: "step-editor-wait-selector",
489
- type: "text",
490
- value: I.waitForSelector || "",
491
- onChange: (e) => B(I.id, "waitForSelector", e.target.value || void 0),
492
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono",
493
- placeholder: "[data-tour='agents-tabs']",
494
- "aria-label": "Wait for selector"
495
- })] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
496
- className: "block text-sm font-medium mb-2",
497
- htmlFor: "step-editor-wait-event",
498
- children: "Wait for event"
499
- }), /* @__PURE__ */ m("input", {
500
- id: "step-editor-wait-event",
501
- type: "text",
502
- value: I.waitForEvent || "",
503
- onChange: (e) => B(I.id, "waitForEvent", e.target.value || void 0),
504
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm",
505
- placeholder: "tour:ready",
506
- "aria-label": "Wait for event"
507
- })] })]
508
- }), /* @__PURE__ */ h("div", {
509
- className: "mt-4",
510
- children: [/* @__PURE__ */ m("label", {
511
- className: "block text-sm font-medium mb-2",
512
- htmlFor: "step-editor-skip-conditions",
513
- children: "Skip conditions (JSON)"
514
- }), /* @__PURE__ */ m("textarea", {
515
- id: "step-editor-skip-conditions",
516
- value: I.skipConditions ? JSON.stringify(I.skipConditions, null, 2) : "",
517
- onChange: (e) => {
518
- let t = e.target.value.trim();
519
- if (!t) {
520
- B(I.id, "skipConditions", void 0);
521
- return;
522
- }
523
- try {
524
- B(I.id, "skipConditions", JSON.parse(t));
525
- } catch {
526
- B(I.id, "skipConditions", t);
527
- }
528
- },
529
- rows: 4,
530
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono",
531
- placeholder: "{\"selectorMissing\":\"[data-tour=\\\"missing\\\"]\"}",
532
- "aria-label": "Skip conditions (JSON)"
533
- })]
534
- })]
535
- }),
536
- /* @__PURE__ */ h(v, {
537
- treatment: "plain",
538
- className: "p-4 space-y-4 border-border-seam",
539
- children: [
540
- /* @__PURE__ */ h("div", {
541
- className: "flex items-center gap-2",
542
- children: [/* @__PURE__ */ m(ie, { size: 18 }), /* @__PURE__ */ m("h3", {
543
- className: "text-sm font-semibold",
544
- children: "Step media"
537
+ placeholder: "{\"selectorMissing\":\"[data-tour=\\\"missing\\\"]\"}",
538
+ "aria-label": "Skip conditions (JSON)"
545
539
  })]
546
- }),
547
- I.media && I.media.length > 0 ? /* @__PURE__ */ m("div", {
548
- className: "space-y-2",
549
- children: I.media.map((e) => /* @__PURE__ */ h("div", {
550
- className: "flex items-center justify-between rounded-md border border-border-subtle p-2 text-sm",
551
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
552
- className: "font-medium",
553
- children: e.media.name
554
- }), /* @__PURE__ */ m("div", {
555
- className: "text-xs text-text-secondary",
556
- children: e.position
557
- })] }), /* @__PURE__ */ m("span", {
558
- className: "text-xs text-text-secondary",
559
- children: e.media.type
540
+ })]
541
+ }),
542
+ /* @__PURE__ */ v(x, {
543
+ treatment: "plain",
544
+ className: "p-4 space-y-4 border-border-seam",
545
+ children: [
546
+ /* @__PURE__ */ v("div", {
547
+ className: "flex items-center gap-2",
548
+ children: [/* @__PURE__ */ _(ne, { size: 18 }), /* @__PURE__ */ _("h3", {
549
+ className: "text-sm font-semibold",
550
+ children: "Step media"
560
551
  })]
561
- }, e.id))
562
- }) : /* @__PURE__ */ m("p", {
563
- className: "text-sm text-text-secondary",
564
- children: "No media attached to this step yet."
565
- }),
566
- /* @__PURE__ */ h("div", {
567
- className: "grid grid-cols-1 gap-3 sm:grid-cols-[minmax(0,1fr)_160px_auto]",
568
- children: [
569
- /* @__PURE__ */ h("select", {
570
- value: J,
571
- onChange: (e) => Y(e.target.value),
572
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm",
573
- "aria-label": "Select media to attach",
574
- children: [/* @__PURE__ */ m("option", {
575
- value: "",
576
- children: ue ? "Loading media..." : "Select uploaded media"
577
- }), H.map((e) => /* @__PURE__ */ h("option", {
578
- value: e.id,
552
+ }),
553
+ R.media && R.media.length > 0 ? /* @__PURE__ */ _("div", {
554
+ className: "space-y-2",
555
+ children: R.media.map((e) => /* @__PURE__ */ v("div", {
556
+ className: "flex items-center justify-between rounded-md border border-border-subtle p-2 text-sm",
557
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("div", {
558
+ className: "font-medium",
559
+ children: e.media.name
560
+ }), /* @__PURE__ */ _("div", {
561
+ className: "text-xs text-text-secondary",
562
+ children: e.position
563
+ })] }), /* @__PURE__ */ _("span", {
564
+ className: "text-xs text-text-secondary",
565
+ children: e.media.type
566
+ })]
567
+ }, e.id))
568
+ }) : /* @__PURE__ */ _("p", {
569
+ className: "text-sm text-text-secondary",
570
+ children: "No media attached to this step yet."
571
+ }),
572
+ /* @__PURE__ */ v("div", {
573
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-[minmax(0,1fr)_160px_auto]",
574
+ children: [
575
+ /* @__PURE__ */ v("select", {
576
+ value: J,
577
+ onChange: (e) => Y(e.target.value),
578
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm",
579
+ "aria-label": "Select media to attach",
580
+ children: [/* @__PURE__ */ _("option", {
581
+ value: "",
582
+ children: fe ? "Loading media..." : "Select uploaded media"
583
+ }), U.map((e) => /* @__PURE__ */ v("option", {
584
+ value: e.id,
585
+ children: [
586
+ e.name,
587
+ " (",
588
+ e.type,
589
+ ")"
590
+ ]
591
+ }, e.id))]
592
+ }),
593
+ /* @__PURE__ */ v("select", {
594
+ value: X,
595
+ onChange: (e) => me(e.target.value),
596
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm",
597
+ "aria-label": "Attachment position",
579
598
  children: [
580
- e.name,
581
- " (",
582
- e.type,
583
- ")"
599
+ /* @__PURE__ */ _("option", {
600
+ value: "header",
601
+ children: "Header"
602
+ }),
603
+ /* @__PURE__ */ _("option", {
604
+ value: "body",
605
+ children: "Body"
606
+ }),
607
+ /* @__PURE__ */ _("option", {
608
+ value: "footer",
609
+ children: "Footer"
610
+ })
584
611
  ]
585
- }, e.id))]
586
- }),
587
- /* @__PURE__ */ h("select", {
588
- value: X,
589
- onChange: (e) => fe(e.target.value),
590
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm",
591
- "aria-label": "Attachment position",
592
- children: [
593
- /* @__PURE__ */ m("option", {
594
- value: "header",
595
- children: "Header"
596
- }),
597
- /* @__PURE__ */ m("option", {
598
- value: "body",
599
- children: "Body"
600
- }),
601
- /* @__PURE__ */ m("option", {
602
- value: "footer",
603
- children: "Footer"
604
- })
605
- ]
606
- }),
607
- /* @__PURE__ */ m("button", {
608
- type: "button",
609
- onClick: ge,
610
- disabled: pe || !J,
611
- className: "px-4 py-2 min-h-[44px] border border-border-subtle rounded-md hover:bg-accent disabled:opacity-50",
612
- children: "Attach"
613
- })
614
- ]
615
- })
616
- ]
617
- })
618
- ]
619
- }) : /* @__PURE__ */ h("div", {
620
- className: "flex flex-col items-center justify-center h-full text-center px-4",
621
- children: [
622
- /* @__PURE__ */ m("div", {
623
- className: "size-16 bg-bg-sunken rounded-full flex items-center justify-center mb-4",
624
- children: /* @__PURE__ */ m(p, {
625
- size: 24,
626
- className: "text-text-secondary"
612
+ }),
613
+ /* @__PURE__ */ _("button", {
614
+ type: "button",
615
+ onClick: ve,
616
+ disabled: he || !J,
617
+ className: "px-4 py-2 min-h-[44px] border border-border-subtle rounded-md hover:bg-accent disabled:opacity-50",
618
+ children: "Attach"
619
+ })
620
+ ]
621
+ })
622
+ ]
627
623
  })
628
- }),
629
- /* @__PURE__ */ m("p", {
630
- className: "text-text-secondary mb-2",
631
- children: x("stepEditor.noStepSelected")
632
- }),
633
- /* @__PURE__ */ m("p", {
634
- className: "text-sm text-text-secondary mb-4",
635
- children: F.length > 0 ? x("stepEditor.selectStepToEdit") : x("stepEditor.createFirstStep")
636
- }),
637
- F.length === 0 && O && /* @__PURE__ */ h("button", {
638
- type: "button",
639
- onClick: Q,
640
- className: "px-4 py-2 min-h-[44px] bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 flex items-center gap-2",
641
- children: [/* @__PURE__ */ m(p, { size: 18 }), x("stepEditor.addFirstStep")]
624
+ ]
625
+ }) : /* @__PURE__ */ _("div", {
626
+ className: "flex items-center justify-center h-full",
627
+ children: /* @__PURE__ */ _(S, {
628
+ illustration: L.length > 0 ? "empty-generic" : "onboarding",
629
+ title: C("stepEditor.emptyTitle"),
630
+ description: L.length > 0 ? C("stepEditor.selectStepToEdit") : C("stepEditor.createFirstStep"),
631
+ action: L.length === 0 && A ? /* @__PURE__ */ v(b, {
632
+ type: "button",
633
+ onClick: Q,
634
+ className: "min-h-[44px]",
635
+ children: [/* @__PURE__ */ _(h, { size: 18 }), C("stepEditor.addFirstStep")]
636
+ }) : void 0
642
637
  })
643
- ]
638
+ })
644
639
  })
645
- })
646
- ]
647
- })]
640
+ ]
641
+ })
642
+ ]
648
643
  });
649
644
  }
650
645
  //#endregion
651
- export { x as StepEditorPage };
646
+ export { C as StepEditorPage };
652
647
 
653
648
  //# sourceMappingURL=StepEditorPage.js.map