@cratis/stage.runtime 4.203.0 → 4.205.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -1,32 +1,32 @@
1
1
  import "./app.css";
2
- import { t as e } from "../stageDarkSelector-DjqhPYDU.js";
2
+ import { t as e } from "../stageDarkSelector-DAwb43-P.js";
3
3
  import { createContext as t, createElement as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
4
4
  import { ColorScheme as u, DestinationKind as d, FormGenerationMode as f, FormWidthUnit as p, InteractionTriggerKind as m, LogoKind as h, PackageKind as g, componentIconLibrary as _ } from "@cratis/scene.model";
5
5
  import { ShellDiagnosticCode as v, ShellOrigin as y, createBindingResolver as b, hostProfilePackages as x, resolveArgumentSource as S, resolveBehaviors as C, resolveStringsInElement as w, resolveStringsValue as ee, runBindings as te, validateBindingExpression as ne } from "@cratis/scene.engine";
6
- import { CoreSliceDialog as T, CoreToolbarItem as E, IconAdapterProvider as re, InteractionScope as D, SceneElementView as ie, SceneNavigationContextInternal as O, SliceCommandFieldsProvider as ae, SliceDialogView as oe, SliceInvokerProvider as se, attachmentFor as ce, coreComponents as le, createBrowserDispatcher as k, createBrowserSceneHistory as ue, createHashSceneHistory as de, createIconAdapterRegistry as A, sliceDialogParameters as fe, useInteractionScope as pe, useOptionalSceneNavigation as me, useSceneNavigation as he, useSceneOutlets as ge, useSceneTheme as _e } from "@cratis/scene.react";
7
- import { ApplicationHost as ve, ColorScheme as j, ComponentName as M, LayoutThemeProvider as ye, SlotName as N, blueprintPackageCatalog as be, composeApplicationScreen as xe, defaultBlueprintComponents as Se, defaultBlueprintName as Ce, defaultBlueprintThemes as P, effectiveShellOf as we, externalComponent as F, galleryScreenTemplates as Te, layoutModes as Ee, menuThemes as De, navigationElement as Oe, previewComponents as ke, previewProfile as Ae, useLayoutConfig as je } from "@cratis/scene.blueprint.default";
6
+ import { CoreSliceDialog as T, CoreToolbarItem as E, IconAdapterProvider as re, InteractionScope as ie, SceneElementView as D, SceneNavigationContextInternal as O, SliceCommandFieldsProvider as ae, SliceDialogView as oe, SliceInvokerProvider as se, attachmentFor as ce, componentRegistryKey as le, coreComponents as k, createBrowserDispatcher as ue, createBrowserSceneHistory as de, createHashSceneHistory as A, createIconAdapterRegistry as fe, sliceDialogParameters as pe, useInteractionScope as me, useOptionalSceneNavigation as he, useSceneNavigation as ge, useSceneOutlets as _e, useSceneTheme as ve } from "@cratis/scene.react";
7
+ import { ApplicationHost as ye, ColorScheme as be, ComponentName as j, KanbanBoard as xe, LayoutThemeProvider as Se, SlotName as M, blueprintPackageCatalog as Ce, composeApplicationScreen as we, defaultBlueprintComponents as Te, defaultBlueprintName as Ee, defaultBlueprintThemes as De, effectiveShellOf as Oe, externalComponent as N, galleryScreenTemplates as P, layoutModes as ke, menuThemes as Ae, navigationElement as je, previewComponents as Me, previewProfile as Ne, useLayoutConfig as Pe } from "@cratis/scene.blueprint.default";
8
8
  import "@cratis/components/tokens";
9
9
  import "@cratis/components/CommandForm/styles";
10
10
  import "@cratis/components/Dropdown/styles";
11
11
  import "@cratis/components/Common/styles";
12
12
  import "@cratis/components/Display/styles";
13
13
  import "@cratis/scene.blueprint.default/styles.css";
14
- import { ArcContext as Me } from "@cratis/arc.react";
15
- import { ObservableQueryFor as Ne, Paging as Pe, QueryFor as Fe } from "@cratis/arc/queries";
16
- import { resolveCommand as Ie, resolveExactQuery as Le } from "@cratis/scene.components";
17
- import { Fragment as Re, jsx as I, jsxs as L } from "react/jsx-runtime";
18
- import { Button as R } from "@cratis/components/Common";
19
- import { Dialog as ze } from "@cratis/components/Dialogs";
20
- import { Message as Be } from "@cratis/components/Display";
21
- import { createPortal as Ve } from "react-dom";
22
- import { DateOnly as He, Guid as Ue } from "@cratis/fundamentals";
23
- import { Command as We } from "@cratis/arc/commands";
24
- import { CommandForm as Ge, asCommandFormField as Ke, withCommandFormFieldBinding as qe } from "@cratis/arc.react/commands";
25
- import { CalendarField as Je, CheckboxField as Ye, DropdownField as Xe, InputTextField as Ze, NumberField as Qe } from "@cratis/components/CommandForm";
26
- import { cratisComponents as $e, cratisComponentsPackageManifest as et } from "@cratis/scene.components/runtime";
27
- import { dynamicIconImports as tt } from "lucide-react/dynamic";
28
- //#region src/stageSource.ts
29
- function nt(e) {
14
+ import { ArcContext as Fe } from "@cratis/arc.react";
15
+ import { ObservableQueryFor as Ie, Paging as Le, QueryFor as Re } from "@cratis/arc/queries";
16
+ import { resolveCommand as ze, resolveExactQuery as Be } from "@cratis/scene.components";
17
+ import { Fragment as Ve, jsx as F, jsxs as I } from "react/jsx-runtime";
18
+ import { Button as L } from "@cratis/components/Common";
19
+ import { Dialog as He } from "@cratis/components/Dialogs";
20
+ import { Message as Ue } from "@cratis/components/Display";
21
+ import { createPortal as We } from "react-dom";
22
+ import { DateOnly as Ge, Guid as Ke } from "@cratis/fundamentals";
23
+ import { Command as qe } from "@cratis/arc/commands";
24
+ import { CommandForm as Je, asCommandFormField as Ye, withCommandFormFieldBinding as Xe } from "@cratis/arc.react/commands";
25
+ import { CalendarField as Ze, CheckboxField as Qe, DropdownField as $e, InputTextField as et, NumberField as tt } from "@cratis/components/CommandForm";
26
+ import { cratisComponents as nt, cratisComponentsPackageManifest as rt } from "@cratis/scene.components/runtime";
27
+ import { dynamicIconImports as it } from "lucide-react/dynamic";
28
+ // src/stageSource.ts
29
+ function at(e) {
30
30
  return {
31
31
  scene: async () => e.scene,
32
32
  routes: async () => e.routes,
@@ -34,23 +34,23 @@ function nt(e) {
34
34
  strings: async (t) => e.strings[t] ?? {}
35
35
  };
36
36
  }
37
- var rt = {
37
+ var ot = {
38
38
  scene: "stage/scene",
39
39
  routes: "stage/routes",
40
40
  locales: "stage/locales",
41
41
  strings: (e) => `stage/strings/${encodeURIComponent(e)}`
42
- }, it = t(void 0);
43
- function at({ source: e, children: t }) {
44
- return n(it.Provider, { value: e }, t);
42
+ }, st = t(void 0);
43
+ function ct({ source: e, children: t }) {
44
+ return n(st.Provider, { value: e }, t);
45
45
  }
46
- function ot() {
47
- let e = i(it);
46
+ function lt() {
47
+ let e = i(st);
48
48
  if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
49
49
  return e;
50
50
  }
51
- rt.routes;
52
- function st() {
53
- let e = ot(), [t, n] = l({
51
+ ot.routes;
52
+ function ut() {
53
+ let e = lt(), [t, n] = l({
54
54
  routes: void 0,
55
55
  ready: !1
56
56
  });
@@ -69,27 +69,25 @@ function st() {
69
69
  }), () => t.abort();
70
70
  }, [e]), t;
71
71
  }
72
- //#endregion
73
- //#region src/applyQueryChangeSet.ts
74
- function ct(e) {
72
+ // src/applyQueryChangeSet.ts
73
+ function dt(e) {
75
74
  return typeof e == "object" && e && "id" in e ? e.id : void 0;
76
75
  }
77
- function lt(e) {
76
+ function ft(e) {
78
77
  if (typeof e != "object" || !e) return e;
79
78
  let t = e.toString();
80
79
  return t === "[object Object]" ? JSON.stringify(e) : t;
81
80
  }
82
- function ut(e, t) {
83
- return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : lt(e) === lt(t);
81
+ function pt(e, t) {
82
+ return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : ft(e) === ft(t);
84
83
  }
85
- function dt(e, t) {
86
- if (t.removed.length > 0 ? ct(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => ut(ct(e), ct(t)))).map((e) => t.replaced.find((t) => ut(ct(t), ct(e))) ?? e), ...t.added];
84
+ function mt(e, t) {
85
+ if (t.removed.length > 0 ? dt(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => pt(dt(e), dt(t)))).map((e) => t.replaced.find((t) => pt(dt(t), dt(e))) ?? e), ...t.added];
87
86
  let n = new Set(t.removed.map((e) => JSON.stringify(e)));
88
87
  return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
89
88
  }
90
- //#endregion
91
- //#region src/hostedBasePath.ts
92
- function ft() {
89
+ // src/hostedBasePath.ts
90
+ function ht() {
93
91
  let e = globalThis.document?.baseURI ?? globalThis.location?.href;
94
92
  if (!e) return "";
95
93
  try {
@@ -98,62 +96,61 @@ function ft() {
98
96
  return "";
99
97
  }
100
98
  }
101
- function pt(e) {
102
- return e || ft();
99
+ function gt(e) {
100
+ return e || ht();
103
101
  }
104
- //#endregion
105
- //#region src/queryExecutor.ts
106
- var mt;
107
- function ht(e) {
108
- mt = e;
102
+ // src/queryExecutor.ts
103
+ var _t;
104
+ function vt(e) {
105
+ _t = e;
109
106
  }
110
- function gt(e, t) {
111
- let n = Le(e);
112
- return n === "ambiguous" && t && (n = Le(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), _t(n) ? n : t ? mt?.(t) : void 0;
107
+ function yt(e, t) {
108
+ let n = Be(e);
109
+ return n === "ambiguous" && t && (n = Be(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), bt(n) ? n : t ? _t?.(t) : void 0;
113
110
  }
114
- function _t(e) {
115
- return typeof e == "function" && (e.prototype instanceof Fe || e.prototype instanceof Ne);
111
+ function bt(e) {
112
+ return typeof e == "function" && (e.prototype instanceof Re || e.prototype instanceof Ie);
116
113
  }
117
- function vt(e, t) {
118
- e.setMicroservice(t.microservice), e.setApiBasePath(pt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Pe.noPaging;
114
+ function xt(e, t) {
115
+ e.setMicroservice(t.microservice), e.setApiBasePath(gt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Le.noPaging;
119
116
  }
120
- function yt(e, t, n) {
117
+ function St(e, t, n) {
121
118
  let r = new e();
122
- return vt(r, n), r.perform(t);
119
+ return xt(r, n), r.perform(t);
123
120
  }
124
- function bt(e, t, n, r) {
121
+ function Ct(e, t, n, r) {
125
122
  let i = new e();
126
- if (i instanceof Ne) return vt(i, n), i.subscribe(r, t);
123
+ if (i instanceof Ie) return xt(i, n), i.subscribe(r, t);
127
124
  }
128
- function xt(e) {
129
- if (z(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
125
+ function wt(e) {
126
+ if (R(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
130
127
  }
131
- var St = "STAGE-SCENE-ACTION-001", Ct = "item.";
132
- function z(e) {
128
+ var Tt = "STAGE-SCENE-ACTION-001", Et = "item.";
129
+ function R(e) {
133
130
  return typeof e == "object" && !!e && !Array.isArray(e);
134
131
  }
135
- function wt(e, t) {
132
+ function Dt(e, t) {
136
133
  let n = e;
137
134
  for (let e of t.split(".").filter(Boolean)) {
138
- if (!z(n)) return;
135
+ if (!R(n)) return;
139
136
  n = n[e];
140
137
  }
141
138
  return n;
142
139
  }
143
- function Tt(e) {
140
+ function Ot(e) {
144
141
  return e === null || [
145
142
  "string",
146
143
  "number",
147
144
  "boolean"
148
145
  ].includes(typeof e);
149
146
  }
150
- function Et(e, t) {
147
+ function kt(e, t) {
151
148
  if (typeof e == "number") return t[e];
152
149
  if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
153
150
  }
154
- function Dt(e, t, n, r) {
151
+ function At(e, t, n, r) {
155
152
  if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
156
- let i = Et(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
153
+ let i = kt(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
157
154
  return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
158
155
  }
159
156
  switch (t) {
@@ -168,57 +165,56 @@ function Dt(e, t, n, r) {
168
165
  default: return;
169
166
  }
170
167
  }
171
- function Ot(e, t) {
172
- if (z(e)) {
168
+ function jt(e, t) {
169
+ if (R(e)) {
173
170
  if (e.kind === "comparison") {
174
- let n = xt(e.left);
175
- if (typeof n != "string" || !n.startsWith(Ct) || typeof e.operator != "string" || !Tt(e.right)) return;
171
+ let n = wt(e.left);
172
+ if (typeof n != "string" || !n.startsWith(Et) || typeof e.operator != "string" || !Ot(e.right)) return;
176
173
  let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
177
- return Dt(wt(t, n.slice(5)), e.operator, e.right, r);
174
+ return At(Dt(t, n.slice(5)), e.operator, e.right, r);
178
175
  }
179
176
  if (e.kind === "logical") {
180
- let n = Ot(e.left, t), r = Ot(e.right, t);
177
+ let n = jt(e.left, t), r = jt(e.right, t);
181
178
  return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
182
179
  }
183
180
  }
184
181
  }
185
- function kt(e) {
186
- return e.every((e) => Ot(e, {}) !== void 0);
182
+ function Mt(e) {
183
+ return e.every((e) => jt(e, {}) !== void 0);
187
184
  }
188
- function At(e, t) {
189
- if (kt(e)) return e.findIndex((e) => Ot(e, t) === !0);
185
+ function Nt(e, t) {
186
+ if (Mt(e)) return e.findIndex((e) => jt(e, t) === !0);
190
187
  }
191
- function jt(e, t) {
192
- if (!z(e) || !Array.isArray(e.alternatives) || !z(t)) return;
193
- let n = At(e.alternatives, t);
188
+ function Pt(e, t) {
189
+ if (!R(e) || !Array.isArray(e.alternatives) || !R(t)) return;
190
+ let n = Nt(e.alternatives, t);
194
191
  if (n !== void 0) {
195
192
  if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
196
193
  if (e.kind === "otherwise") return n === -1;
197
194
  }
198
195
  }
199
- function Mt(e, t) {
200
- if (e.startsWith(Ct) && z(t)) return wt(t, e.slice(5));
196
+ function Ft(e, t) {
197
+ if (e.startsWith(Et) && R(t)) return Dt(t, e.slice(5));
201
198
  }
202
- //#endregion
203
- //#region src/stageSession.ts
204
- var Nt = "stage.session.";
205
- function Pt(e) {
199
+ // src/stageSession.ts
200
+ var It = "stage.session.";
201
+ function Lt(e) {
206
202
  try {
207
203
  return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
208
204
  } catch {
209
205
  return;
210
206
  }
211
207
  }
212
- function Ft(e) {
213
- let t = Pt(e);
208
+ function Rt(e) {
209
+ let t = Lt(e);
214
210
  if (t) return t;
215
211
  let n = globalThis.crypto.randomUUID();
216
212
  try {
217
- globalThis.localStorage?.setItem(`${Nt}${e}`, n);
213
+ globalThis.localStorage?.setItem(`${It}${e}`, n);
218
214
  } catch {}
219
215
  return n;
220
216
  }
221
- function It() {
217
+ function zt() {
222
218
  let e = {};
223
219
  try {
224
220
  let t = globalThis.localStorage;
@@ -231,9 +227,8 @@ function It() {
231
227
  } catch {}
232
228
  return e;
233
229
  }
234
- //#endregion
235
- //#region src/stageData.tsx
236
- var Lt = "cratis.stage.data-changed", Rt = t({
230
+ // src/stageData.tsx
231
+ var Bt = "cratis.stage.data-changed", Vt = t({
237
232
  locale: "",
238
233
  locales: [],
239
234
  screen: "",
@@ -257,13 +252,13 @@ var Lt = "cratis.stage.data-changed", Rt = t({
257
252
  resolveArgument: () => void 0,
258
253
  registerQueryResult: () => void 0,
259
254
  refreshVersion: 0
260
- }), zt = [
255
+ }), Ht = [
261
256
  500,
262
257
  1500,
263
258
  3e3
264
- ], Bt = {};
265
- function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, locales: o, screen: u, children: d }) {
266
- let [f, p] = l({}), [m, h] = l(0), [g, _] = l({}), [v, y] = l(), [x, C] = l({}), [w, ee] = l({}), [te, T] = l({}), [E, re] = l({ version: 0 }), D = s(() => qt(te), [te]), ie = r((e, t) => {
259
+ ], Ut = {};
260
+ function Wt({ routes: e, routesReady: t = !0, parameters: n = Ut, locale: i, locales: o, screen: u, children: d }) {
261
+ let [f, p] = l({}), [m, h] = l(0), [g, _] = l({}), [v, y] = l(), [x, C] = l({}), [w, ee] = l({}), [te, T] = l({}), [E, re] = l({ version: 0 }), ie = s(() => Xt(te), [te]), D = r((e, t) => {
267
262
  p((n) => {
268
263
  if (!t) {
269
264
  let { [e]: t, ...r } = n;
@@ -274,7 +269,7 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
274
269
  [e]: t
275
270
  };
276
271
  });
277
- }, []), O = n, ae = s(() => It(), [m]), oe = s(() => ({
272
+ }, []), O = n, ae = s(() => zt(), [m]), oe = s(() => ({
278
273
  name: u,
279
274
  keys: {
280
275
  ...ae,
@@ -296,10 +291,10 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
296
291
  })), y((t) => t === e ? void 0 : t);
297
292
  }, []), le = r((e, t, n) => {
298
293
  ee((r) => {
299
- let i = U(r[e]) ? r[e] : {};
294
+ let i = H(r[e]) ? r[e] : {};
300
295
  return {
301
296
  ...r,
302
- [e]: Kt(i, t.split(".").filter(Boolean), n)
297
+ [e]: Yt(i, t.split(".").filter(Boolean), n)
303
298
  };
304
299
  });
305
300
  }, []), k = r((e) => re((t) => ({
@@ -307,23 +302,23 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
307
302
  version: t.version + 1
308
303
  })), []), ue = c([]), de = r(() => {
309
304
  h((e) => e + 1), k();
310
- for (let e of zt) ue.current.push(setTimeout(() => k(), e));
305
+ for (let e of Ht) ue.current.push(setTimeout(() => k(), e));
311
306
  }, [k]);
312
307
  a(() => () => ue.current.forEach(clearTimeout), []), a(() => {
313
308
  let e = () => k(), t = (e) => k(e.detail?.query);
314
- return globalThis.addEventListener(Lt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
315
- globalThis.removeEventListener(Lt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
309
+ return globalThis.addEventListener(Bt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
310
+ globalThis.removeEventListener(Bt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
316
311
  };
317
312
  }, [k]);
318
313
  let A = v ? g[v] : void 0, fe = r((e) => {
319
314
  if (e === void 0 || typeof e != "string" && e.path === "$guard") return;
320
- if (typeof e == "string") return Jt(e, A, g, f, x, O, oe, i, o);
321
- let t = Ut(A, f, x, {
322
- ...D,
315
+ if (typeof e == "string") return Zt(e, A, g, f, x, O, oe, i, o);
316
+ let t = Kt(A, f, x, {
317
+ ...ie,
323
318
  ...w
324
319
  }, g);
325
320
  if (!e.kind && e.path.startsWith("component.")) return S(e.path, t);
326
- if (!e.kind) return Jt(e.path, A, g, f, x, O, oe, i, o);
321
+ if (!e.kind) return Zt(e.path, A, g, f, x, O, oe, i, o);
327
322
  let n = ne(e, t);
328
323
  return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), b(t)(e);
329
324
  }, [
@@ -332,18 +327,18 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
332
327
  o,
333
328
  x,
334
329
  O,
335
- D,
330
+ ie,
336
331
  f,
337
332
  oe,
338
333
  A,
339
334
  g
340
- ]), pe = r((e) => e ? S(e, Ut(A, f, x, {
341
- ...D,
335
+ ]), pe = r((e) => e ? S(e, Kt(A, f, x, {
336
+ ...ie,
342
337
  ...w
343
338
  }, g)) : void 0, [
344
339
  w,
345
340
  x,
346
- D,
341
+ ie,
347
342
  f,
348
343
  A,
349
344
  g
@@ -354,7 +349,7 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
354
349
  if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
355
350
  let n = { ...t };
356
351
  return delete n[e], n;
357
- }), []), ge = s(() => Ut(void 0, f, {}, {}, {}).queryResults, [f]), _e = s(() => ({
352
+ }), []), ge = s(() => Kt(void 0, f, {}, {}, {}).queryResults, [f]), _e = s(() => ({
358
353
  locale: i,
359
354
  locales: o,
360
355
  screen: u,
@@ -367,7 +362,7 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
367
362
  selections: g,
368
363
  selectRow: se,
369
364
  clearSelection: ce,
370
- setState: (e, t) => C((n) => Kt(n, e.split(".").filter(Boolean), t)),
365
+ setState: (e, t) => C((n) => Yt(n, e.split(".").filter(Boolean), t)),
371
366
  setComponentOutput: le,
372
367
  publishComponentOutputs: me,
373
368
  withdrawComponentOutputs: he,
@@ -376,7 +371,7 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
376
371
  refreshAfterCommand: de,
377
372
  resolveBinding: fe,
378
373
  resolveArgument: pe,
379
- registerQueryResult: ie,
374
+ registerQueryResult: D,
380
375
  refreshVersion: E.version,
381
376
  refreshQueryName: E.query
382
377
  }), [
@@ -388,7 +383,7 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
388
383
  k,
389
384
  E.query,
390
385
  E.version,
391
- ie,
386
+ D,
392
387
  me,
393
388
  he,
394
389
  ge,
@@ -404,14 +399,14 @@ function Vt({ routes: e, routesReady: t = !0, parameters: n = Bt, locale: i, loc
404
399
  g,
405
400
  le
406
401
  ]);
407
- return /* @__PURE__ */ I(Rt.Provider, {
402
+ return /* @__PURE__ */ F(Vt.Provider, {
408
403
  value: _e,
409
404
  children: d
410
405
  });
411
406
  }
412
- var B = () => i(Rt);
413
- function V(e) {
414
- let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o } = B(), s = i(Me), u = e.publish !== !1, d = r((e, t) => {
407
+ var z = () => i(Vt);
408
+ function B(e) {
409
+ let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o } = z(), s = i(Fe), u = e.publish !== !1, d = r((e, t) => {
415
410
  u && o(e, t);
416
411
  }, [u, o]), [f, p] = l([]), [m, h] = l(""), [g, _] = l(!1), [v, y] = l(0), b = c(0), x = c(!1), S = e.ready ?? !0, C = !!e.name && S, w = JSON.stringify(e.arguments ?? {});
417
412
  return a(() => {
@@ -421,21 +416,17 @@ function V(e) {
421
416
  }
422
417
  let t = b.current + 1;
423
418
  b.current = t;
424
- let n = new AbortController(), r = JSON.parse(w), i = gt(e.name ?? "", e.route);
419
+ let n = new AbortController(), r = JSON.parse(w), i = yt(e.name ?? "", e.route);
425
420
  _(!0), h("");
426
421
  let a = (e) => {
427
422
  b.current !== t || n.signal.aborted || (x.current = !1, p([]), h(e instanceof Error ? e.message : String(e)), _(!1));
428
423
  }, o = [], c = (e) => {
429
424
  if (b.current !== t || n.signal.aborted) return;
430
- let r = Zt(e);
431
- if (r) {
432
- a(Error(r));
433
- return;
434
- }
435
- e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? dt(o, e.changeSet) : e.data, p(Qt(o)), h(""), _(!1));
425
+ let r = en(e);
426
+ r ? a(Error(r)) : e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? mt(o, e.changeSet) : e.data, p(tn(o)), h(""), _(!1));
436
427
  };
437
428
  if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
438
- let l = i.prototype instanceof Ne, u = () => Promise.resolve().then(() => yt(i, l ? {
429
+ let l = i.prototype instanceof Ie, u = () => Promise.resolve().then(() => St(i, l ? {
439
430
  ...r,
440
431
  waitForFirstResult: !0
441
432
  } : r, s)).then(c).catch(a);
@@ -445,7 +436,7 @@ function V(e) {
445
436
  b.current !== t || n.signal.aborted || (x.current = !1, f?.unsubscribe(), f = void 0, u());
446
437
  }, 15e3);
447
438
  try {
448
- f = bt(i, r, s, (e) => {
439
+ f = Ct(i, r, s, (e) => {
449
440
  e.isReady !== !1 && globalThis.clearTimeout(m), c(e);
450
441
  });
451
442
  } catch {
@@ -471,11 +462,7 @@ function V(e) {
471
462
  e.name,
472
463
  e.scope
473
464
  ]), a(() => {
474
- if (!C) {
475
- d(e.scope, void 0);
476
- return;
477
- }
478
- d(e.scope, {
465
+ C ? d(e.scope, {
479
466
  name: e.name,
480
467
  list: e.list,
481
468
  alias: e.alias,
@@ -484,7 +471,7 @@ function V(e) {
484
471
  loading: g,
485
472
  error: m,
486
473
  arguments: JSON.parse(w)
487
- });
474
+ }) : d(e.scope, void 0);
488
475
  }, [
489
476
  C,
490
477
  w,
@@ -506,29 +493,29 @@ function V(e) {
506
493
  }
507
494
  };
508
495
  }
509
- function Ht() {
510
- globalThis.dispatchEvent(new CustomEvent(Lt));
496
+ function Gt() {
497
+ globalThis.dispatchEvent(new CustomEvent(Bt));
511
498
  }
512
- function Ut(e, t, n, r, i) {
499
+ function Kt(e, t, n, r, i) {
513
500
  let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
514
501
  return {
515
502
  dataContext: e,
516
503
  queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
517
- let n = t.list ? t.rows : Wt(t.rows);
504
+ let n = t.list ? t.rows : qt(t.rows);
518
505
  return [
519
506
  [e, n],
520
507
  ...t.name ? [[t.name, n]] : [],
521
508
  ...t.alias ? [[t.alias, n]] : []
522
509
  ];
523
510
  })),
524
- componentOutputs: Gt(r, i),
511
+ componentOutputs: Jt(r, i),
525
512
  state: n
526
513
  };
527
514
  }
528
- function Wt(e) {
515
+ function qt(e) {
529
516
  return e.length === 1 ? e[0] : e;
530
517
  }
531
- function Gt(e, t) {
518
+ function Jt(e, t) {
532
519
  let n = { ...e };
533
520
  for (let [e, r] of Object.entries(t)) r && (n[e] = {
534
521
  ...r,
@@ -536,17 +523,17 @@ function Gt(e, t) {
536
523
  });
537
524
  return n;
538
525
  }
539
- function Kt(e, t, n) {
526
+ function Yt(e, t, n) {
540
527
  let [r, ...i] = t;
541
528
  return r ? i.length === 0 ? {
542
529
  ...e,
543
530
  [r]: n
544
531
  } : {
545
532
  ...e,
546
- [r]: Kt(U(e[r]) ? e[r] : {}, i, n)
533
+ [r]: Yt(H(e[r]) ? e[r] : {}, i, n)
547
534
  } : e;
548
535
  }
549
- function qt(e) {
536
+ function Xt(e) {
550
537
  let t = {};
551
538
  for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
552
539
  ...t[e],
@@ -554,30 +541,30 @@ function qt(e) {
554
541
  };
555
542
  return t;
556
543
  }
557
- function Jt(e, t, n, r, i, a, o, s, c) {
544
+ function Zt(e, t, n, r, i, a, o, s, c) {
558
545
  if (!e) return;
559
546
  let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
560
547
  if (l.length !== 0) {
561
548
  if (l[0] === "screen") {
562
549
  if (l.length === 1) return { name: o.name };
563
- let e = H(o, l.slice(1));
564
- return e === void 0 && l[1] === "keys" && l.length === 3 ? H(t, [l[2]]) : e;
550
+ let e = V(o, l.slice(1));
551
+ return e === void 0 && l[1] === "keys" && l.length === 3 ? V(t, [l[2]]) : e;
565
552
  }
566
- return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Xt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Yt(l.slice(1).join("."), t, n) : l[0] === "state" ? H(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : H(t, l) ?? Xt(r, void 0, l.join(".")) ?? H(i, l);
553
+ return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? $t(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Qt(l.slice(1).join("."), t, n) : l[0] === "state" ? V(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : V(t, l) ?? $t(r, void 0, l.join(".")) ?? V(i, l);
567
554
  }
568
555
  }
569
- function Yt(e, t, n) {
556
+ function Qt(e, t, n) {
570
557
  let r = e?.split(".").filter(Boolean) ?? [];
571
- return r.length > 0 && Object.hasOwn(n, r[0]) ? H(n[r[0]], r.slice(1)) : r.length === 0 ? t : H(t, r);
558
+ return r.length > 0 && Object.hasOwn(n, r[0]) ? V(n[r[0]], r.slice(1)) : r.length === 0 ? t : V(t, r);
572
559
  }
573
- function Xt(e, t, n) {
560
+ function $t(e, t, n) {
574
561
  let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
575
562
  if (r.length === 0) return;
576
563
  let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
577
- return a.length === 0 ? i : i.length === 1 ? H(i[0], a) : i.map((e) => H(e, a));
564
+ return a.length === 0 ? i : i.length === 1 ? V(i[0], a) : i.map((e) => V(e, a));
578
565
  }
579
- function Zt(e) {
580
- if (!U(e)) return "";
566
+ function en(e) {
567
+ if (!H(e)) return "";
581
568
  if (e.isAuthorized === !1) return "The query answered 403.";
582
569
  if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
583
570
  let t = Array.isArray(e.exceptionMessages) ? e.exceptionMessages.filter((e) => typeof e == "string") : [];
@@ -585,58 +572,56 @@ function Zt(e) {
585
572
  }
586
573
  return "";
587
574
  }
588
- function Qt(e) {
589
- return Array.isArray(e) ? e.filter(U) : U(e) ? [e] : [];
575
+ function tn(e) {
576
+ return Array.isArray(e) ? e.filter(H) : H(e) ? [e] : [];
590
577
  }
591
- function H(e, t) {
578
+ function V(e, t) {
592
579
  let n = e;
593
580
  for (let e of t) {
594
- if (!U(n)) return;
581
+ if (!H(n)) return;
595
582
  n = n[e];
596
583
  }
597
584
  return n;
598
585
  }
599
- function U(e) {
586
+ function H(e) {
600
587
  return typeof e == "object" && !!e && !Array.isArray(e);
601
588
  }
602
- //#endregion
603
- //#region src/stageComponentOutputs.ts
604
- function $t() {
605
- let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n } = B();
589
+ // src/stageComponentOutputs.ts
590
+ function nn() {
591
+ let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n } = z();
606
592
  return a(() => () => n(e), [e, n]), r((n) => t(e, n), [t, e]);
607
593
  }
608
- //#endregion
609
- //#region src/commandExecutor.ts
610
- function W(e, t, n) {
594
+ // src/commandExecutor.ts
595
+ function U(e, t, n) {
611
596
  for (let r of [
612
597
  t,
613
598
  n?.replace(/^\//, ""),
614
599
  e
615
600
  ]) {
616
601
  if (!r) continue;
617
- let t = Ie(r);
618
- if (en(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
602
+ let t = ze(r);
603
+ if (rn(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
619
604
  }
620
605
  }
621
- function en(e) {
622
- return typeof e == "function" && e.prototype instanceof We;
606
+ function rn(e) {
607
+ return typeof e == "function" && e.prototype instanceof qe;
623
608
  }
624
- function tn(e, t) {
625
- return e.setApiBasePath(pt(t)), e;
609
+ function an(e, t) {
610
+ return e.setApiBasePath(gt(t)), e;
626
611
  }
627
- async function nn(e, t, n) {
628
- let r = W(e);
612
+ async function on(e, t, n) {
613
+ let r = U(e);
629
614
  if (!r) return {
630
615
  isSuccess: !1,
631
616
  validationErrors: [],
632
617
  messages: [`The modeled command “${e}” is not registered by this Stage.`]
633
618
  };
634
619
  let i = new r();
635
- i.setMicroservice(n.microservice), i.setApiBasePath(pt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
620
+ i.setMicroservice(n.microservice), i.setApiBasePath(gt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
636
621
  for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
637
- return rn(e, await i.execute());
622
+ return sn(e, await i.execute());
638
623
  }
639
- function rn(e, t) {
624
+ function sn(e, t) {
640
625
  let n = t.isSuccess && t.isAuthorized && t.isValid && !t.hasExceptions, r = t.isValid ? [] : t.validationResults.flatMap((e) => (e.members.length > 0 ? e.members : [""]).map((t) => ({
641
626
  member: t,
642
627
  message: e.message
@@ -652,67 +637,65 @@ function rn(e, t) {
652
637
  messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
653
638
  };
654
639
  }
655
- function an() {
656
- let e = i(Me);
657
- return r((t, n) => nn(t, n, e), [e]);
640
+ function cn() {
641
+ let e = i(Fe);
642
+ return r((t, n) => on(t, n, e), [e]);
658
643
  }
659
- //#endregion
660
- //#region src/stageNavigation.ts
661
- function on(e, t = {}) {
644
+ // src/stageNavigation.ts
645
+ function ln(e, t = {}) {
662
646
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
663
647
  return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
664
648
  }
665
- function G(e, t = {}) {
649
+ function W(e, t = {}) {
666
650
  if (!globalThis.location) return;
667
- if (sn === "path") {
668
- let n = ln(e, t);
651
+ if (un === "path") {
652
+ let n = fn(e, t);
669
653
  if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
670
654
  globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
671
655
  return;
672
656
  }
673
- let n = on(e, t);
657
+ let n = ln(e, t);
674
658
  globalThis.location.hash !== n && (globalThis.location.hash = n);
675
659
  }
676
- var sn = "hash";
677
- function cn(e) {
678
- sn = e;
660
+ var un = "hash";
661
+ function dn(e) {
662
+ un = e;
679
663
  }
680
- function ln(e, t = {}) {
664
+ function fn(e, t = {}) {
681
665
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
682
666
  return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
683
667
  }
684
- function un(e) {
685
- return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ue)).map(([e, t]) => [e, String(t)]));
668
+ function pn(e) {
669
+ return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ke)).map(([e, t]) => [e, String(t)]));
686
670
  }
687
- //#endregion
688
- //#region src/stageFormSchema.ts
689
- var dn = 8;
690
- function K(e) {
671
+ // src/stageFormSchema.ts
672
+ var mn = 8;
673
+ function G(e) {
691
674
  if (!e) return [];
692
675
  try {
693
- return fn(JSON.parse(e), 0);
676
+ return hn(JSON.parse(e), 0);
694
677
  } catch {
695
678
  return [];
696
679
  }
697
680
  }
698
- function fn(e, t) {
699
- let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = bn(e.properties) ? e.properties : {};
700
- return Object.entries(i).map(([e, i]) => pn(e, i, !n || r.has(e), t));
681
+ function hn(e, t) {
682
+ let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = Cn(e.properties) ? e.properties : {};
683
+ return Object.entries(i).map(([e, i]) => gn(e, i, !n || r.has(e), t));
701
684
  }
702
- function pn(e, t, n, r) {
685
+ function gn(e, t, n, r) {
703
686
  return {
704
687
  name: e,
705
688
  identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
706
689
  ...t?.["x-identity"] === !0 ? { identity: !0 } : {},
707
690
  required: n,
708
- ...mn(t, r)
691
+ ..._n(t, r)
709
692
  };
710
693
  }
711
- function mn(e, t) {
694
+ function _n(e, t) {
712
695
  let n = e?.type;
713
696
  if (Array.isArray(n)) {
714
697
  let r = n.filter((e) => e !== "null");
715
- return r.length === 1 ? mn({
698
+ return r.length === 1 ? _n({
716
699
  ...e,
717
700
  type: r[0]
718
701
  }, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
@@ -723,8 +706,8 @@ function mn(e, t) {
723
706
  type: "date",
724
707
  withTime: e.format === "date-time"
725
708
  };
726
- if (n === "array") return hn(e, t);
727
- if (n === "object") return gn(e, t);
709
+ if (n === "array") return vn(e, t);
710
+ if (n === "object") return yn(e, t);
728
711
  if (n === void 0 || n === "string") {
729
712
  let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
730
713
  return t.length > 0 ? {
@@ -734,77 +717,76 @@ function mn(e, t) {
734
717
  }
735
718
  return { unsupportedReason: `type ${String(n)}` };
736
719
  }
737
- function hn(e, t) {
720
+ function vn(e, t) {
738
721
  let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
739
- if (t >= dn || e?.items === void 0) return n;
740
- let r = pn("", e.items, !0, t + 1);
722
+ if (t >= mn || e?.items === void 0) return n;
723
+ let r = gn("", e.items, !0, t + 1);
741
724
  return r.unsupportedReason || r.item ? n : { item: r };
742
725
  }
743
- function gn(e, t) {
726
+ function yn(e, t) {
744
727
  let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
745
- if (t >= dn || !bn(e?.properties) || Object.keys(e.properties).length === 0) return n;
746
- let r = fn(e, t + 1), i = r.find((e) => e.unsupportedReason);
728
+ if (t >= mn || !Cn(e?.properties) || Object.keys(e.properties).length === 0) return n;
729
+ let r = hn(e, t + 1), i = r.find((e) => e.unsupportedReason);
747
730
  return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
748
731
  }
749
- function q(e) {
732
+ function K(e) {
750
733
  let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
751
734
  return t.charAt(0).toUpperCase() + t.slice(1);
752
735
  }
753
- function _n(e, t, n) {
736
+ function bn(e, t, n) {
754
737
  if (t != null) {
755
- if (e.members && bn(t)) for (let r of e.members) {
756
- let e = t[r.name], i = q(r.name);
757
- if (vn(e)) {
738
+ if (e.members && Cn(t)) for (let r of e.members) {
739
+ let e = t[r.name], i = K(r.name);
740
+ if (xn(e)) {
758
741
  if (r.required) return `${n}: ${i} is required`;
759
742
  continue;
760
743
  }
761
- let a = _n(r, e, `${n} ${i.toLowerCase()}`);
744
+ let a = bn(r, e, `${n} ${i.toLowerCase()}`);
762
745
  if (a) return a;
763
746
  }
764
747
  if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
765
- let t = vn(i) ? `${n} ${r + 1} is required` : _n(e.item, i, `${n} ${r + 1}`);
748
+ let t = xn(i) ? `${n} ${r + 1} is required` : bn(e.item, i, `${n} ${r + 1}`);
766
749
  if (t) return t;
767
750
  }
768
751
  }
769
752
  }
770
- function vn(e) {
753
+ function xn(e) {
771
754
  return e == null || e === "";
772
755
  }
773
- function yn(e, t) {
774
- return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && bn(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
756
+ function Sn(e, t) {
757
+ return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && Cn(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
775
758
  let r = e.members?.find((e) => e.name === t);
776
- return [t, r ? yn(r, n) : n];
777
- })) : e.item && Array.isArray(t) ? t.map((t) => yn(e.item, t)) : t;
759
+ return [t, r ? Sn(r, n) : n];
760
+ })) : e.item && Array.isArray(t) ? t.map((t) => Sn(e.item, t)) : t;
778
761
  }
779
- function bn(e) {
762
+ function Cn(e) {
780
763
  return typeof e == "object" && !!e && !Array.isArray(e);
781
764
  }
782
- //#endregion
783
- //#region src/StageValueFields.tsx
784
- var xn = Ke((e) => /* @__PURE__ */ I(Sn, {
765
+ // src/StageValueFields.tsx
766
+ var wn = Ye((e) => /* @__PURE__ */ F(Tn, {
785
767
  descriptor: e.descriptor,
786
- label: e.title ?? q(e.descriptor.name),
768
+ label: e.title ?? K(e.descriptor.name),
787
769
  value: e.value,
788
770
  onChange: e.onChange,
789
771
  onBlur: e.onBlur,
790
772
  invalid: e.invalid
791
773
  }), { defaultValue: void 0 });
792
- function Sn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
793
- return e.members ? /* @__PURE__ */ I(Cn, {
774
+ function Tn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
775
+ return e.members ? /* @__PURE__ */ F(En, {
794
776
  descriptor: e,
795
777
  label: t,
796
778
  value: n,
797
779
  onChange: r,
798
780
  onBlur: i,
799
781
  invalid: a
800
- }) : e.item ? /* @__PURE__ */ I(wn, {
782
+ }) : e.item ? /* @__PURE__ */ F(Dn, {
801
783
  descriptor: e,
802
784
  label: t,
803
785
  value: n,
804
786
  onChange: r,
805
787
  onBlur: i,
806
788
  invalid: a
807
- }) : /* @__PURE__ */ I(Tn, {
789
+ }) : /* @__PURE__ */ F(On, {
808
790
  descriptor: e,
809
791
  label: t,
810
792
  value: n,
@@ -813,14 +795,14 @@ function Sn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
813
795
  invalid: a
814
796
  });
815
797
  }
816
- function Cn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
817
- let o = On(n) ? n : {};
818
- return /* @__PURE__ */ L("fieldset", {
798
+ function En({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
799
+ let o = jn(n) ? n : {};
800
+ return /* @__PURE__ */ I("fieldset", {
819
801
  className: "stage-record-field",
820
802
  "data-invalid": a ? "true" : void 0,
821
- children: [/* @__PURE__ */ I("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ I(Sn, {
803
+ children: [/* @__PURE__ */ F("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ F(Tn, {
822
804
  descriptor: e,
823
- label: q(e.name),
805
+ label: K(e.name),
824
806
  value: o[e.name],
825
807
  onBlur: i,
826
808
  onChange: (t) => r({
@@ -830,74 +812,74 @@ function Cn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
830
812
  }, e.name))]
831
813
  });
832
814
  }
833
- function wn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
815
+ function Dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
834
816
  let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
835
- return /* @__PURE__ */ L("fieldset", {
817
+ return /* @__PURE__ */ I("fieldset", {
836
818
  className: "stage-list-field",
837
819
  "data-invalid": a ? "true" : void 0,
838
820
  children: [
839
- /* @__PURE__ */ I("legend", { children: t }),
840
- s.length === 0 && /* @__PURE__ */ I("p", {
821
+ /* @__PURE__ */ F("legend", { children: t }),
822
+ s.length === 0 && /* @__PURE__ */ F("p", {
841
823
  className: "stage-note",
842
824
  children: "Nothing added yet."
843
825
  }),
844
- s.map((e, n) => /* @__PURE__ */ L("div", {
826
+ s.map((e, n) => /* @__PURE__ */ I("div", {
845
827
  className: "stage-list-field__row",
846
- children: [/* @__PURE__ */ I(Sn, {
828
+ children: [/* @__PURE__ */ F(Tn, {
847
829
  descriptor: o,
848
830
  label: `${t} ${n + 1}`,
849
831
  value: e,
850
832
  onBlur: i,
851
833
  onChange: (e) => c(s.map((t, r) => r === n ? e : t))
852
- }), /* @__PURE__ */ I("button", {
834
+ }), /* @__PURE__ */ F("button", {
853
835
  type: "button",
854
836
  "aria-label": `Remove ${t} ${n + 1}`,
855
837
  onClick: () => c(s.filter((e, t) => t !== n)),
856
838
  children: "Remove"
857
839
  })]
858
840
  }, n)),
859
- /* @__PURE__ */ I("button", {
841
+ /* @__PURE__ */ F("button", {
860
842
  type: "button",
861
843
  "aria-label": `Add ${t}`,
862
- onClick: () => c([...s, En(o)]),
844
+ onClick: () => c([...s, kn(o)]),
863
845
  children: "Add"
864
846
  })
865
847
  ]
866
848
  });
867
849
  }
868
- function Tn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
850
+ function On({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
869
851
  let o = {
870
852
  "aria-invalid": a ? !0 : void 0,
871
853
  onBlur: i
872
854
  };
873
- if (e.options) return /* @__PURE__ */ L("label", {
855
+ if (e.options) return /* @__PURE__ */ I("label", {
874
856
  className: "stage-value-field",
875
- children: [/* @__PURE__ */ I("span", { children: t }), /* @__PURE__ */ L("select", {
857
+ children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ I("select", {
876
858
  ...o,
877
859
  value: typeof n == "string" ? n : "",
878
860
  onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
879
- children: [/* @__PURE__ */ I("option", {
861
+ children: [/* @__PURE__ */ F("option", {
880
862
  value: "",
881
863
  children: ""
882
- }), e.options.map((e) => /* @__PURE__ */ I("option", {
864
+ }), e.options.map((e) => /* @__PURE__ */ F("option", {
883
865
  value: e,
884
- children: q(e)
866
+ children: K(e)
885
867
  }, e))]
886
868
  })]
887
869
  });
888
870
  switch (e.type) {
889
- case "boolean": return /* @__PURE__ */ L("label", {
871
+ case "boolean": return /* @__PURE__ */ I("label", {
890
872
  className: "stage-value-field stage-value-field--check",
891
- children: [/* @__PURE__ */ I("input", {
873
+ children: [/* @__PURE__ */ F("input", {
892
874
  ...o,
893
875
  type: "checkbox",
894
876
  checked: n === !0,
895
877
  onChange: (e) => r(e.target.checked)
896
- }), /* @__PURE__ */ I("span", { children: t })]
878
+ }), /* @__PURE__ */ F("span", { children: t })]
897
879
  });
898
- case "number": return /* @__PURE__ */ L("label", {
880
+ case "number": return /* @__PURE__ */ I("label", {
899
881
  className: "stage-value-field",
900
- children: [/* @__PURE__ */ I("span", { children: t }), /* @__PURE__ */ I("input", {
882
+ children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
901
883
  ...o,
902
884
  type: "number",
903
885
  step: "any",
@@ -905,18 +887,18 @@ function Tn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
905
887
  onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
906
888
  })]
907
889
  });
908
- case "date": return /* @__PURE__ */ L("label", {
890
+ case "date": return /* @__PURE__ */ I("label", {
909
891
  className: "stage-value-field",
910
- children: [/* @__PURE__ */ I("span", { children: t }), /* @__PURE__ */ I("input", {
892
+ children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
911
893
  ...o,
912
894
  type: e.withTime ? "datetime-local" : "date",
913
895
  value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
914
- onChange: (t) => r(t.target.value === "" ? void 0 : Dn(t.target.value, e.withTime === !0))
896
+ onChange: (t) => r(t.target.value === "" ? void 0 : An(t.target.value, e.withTime === !0))
915
897
  })]
916
898
  });
917
- default: return /* @__PURE__ */ L("label", {
899
+ default: return /* @__PURE__ */ I("label", {
918
900
  className: "stage-value-field",
919
- children: [/* @__PURE__ */ I("span", { children: t }), /* @__PURE__ */ I("input", {
901
+ children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
920
902
  ...o,
921
903
  type: "text",
922
904
  value: typeof n == "string" ? n : "",
@@ -925,167 +907,205 @@ function Tn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
925
907
  });
926
908
  }
927
909
  }
928
- function En(e) {
910
+ function kn(e) {
929
911
  return e.members ? {} : void 0;
930
912
  }
931
- function Dn(e, t) {
913
+ function An(e, t) {
932
914
  if (!t) return e;
933
915
  let n = new Date(e);
934
916
  return Number.isNaN(n.getTime()) ? e : n.toISOString();
935
917
  }
936
- function On(e) {
918
+ function jn(e) {
937
919
  return typeof e == "object" && !!e && !Array.isArray(e);
938
920
  }
939
- //#endregion
940
- //#region src/StageCommandForm.tsx
941
- var kn = t(void 0), An = t(null);
942
- function jn({ element: e }) {
943
- let t = B(), n = i(Me), r = i(kn), a = i(An), o = c(null), u = s(() => Nn(e), [e]), d = s(() => dr(e), [e]), f = typeof e.properties.schema == "string", p = s(() => u ? Pn(u, d) : [], [u, d]), m = u ? W(u.command, Y(e, "typeName"), Y(e, "route")) : void 0, h = Y(e, "submitLabel") || "Submit", g = $n(e, p, t.resolveArgument), _ = Zn(e, d, t), v = JSON.stringify(_ ?? null), y = s(() => _, [v]), b = s(() => Jn(t.selections, t.queries), [t.selections, t.queries]), x = s(() => qn(t.queries), [t.queries]), S = e.properties.rowAction === !0, C = s(() => ({
921
+ // src/stageScreenTables.tsx
922
+ function Mn(e) {
923
+ let t = /* @__PURE__ */ new Set(), n = (e) => {
924
+ let r = e;
925
+ if (r.componentName !== "core:outlet") {
926
+ r.componentName === "core:table" && t.add(r.id);
927
+ for (let e of Object.values(r.slots ?? {})) e.forEach(n);
928
+ }
929
+ };
930
+ return n(e), [...t];
931
+ }
932
+ var Nn = t(void 0);
933
+ function Pn({ element: e, children: t }) {
934
+ let n = s(() => new Set(Mn(e)), [e]);
935
+ return /* @__PURE__ */ F(Nn.Provider, {
936
+ value: n,
937
+ children: t
938
+ });
939
+ }
940
+ function Fn({ children: e }) {
941
+ return /* @__PURE__ */ F(Nn.Provider, {
942
+ value: void 0,
943
+ children: e
944
+ });
945
+ }
946
+ function In() {
947
+ let e = i(Nn), { queries: t, selections: n } = z();
948
+ return s(() => {
949
+ let r = e ? Object.fromEntries(Object.entries(t).filter(([t]) => e.has(t))) : t, i = e ? Object.fromEntries(Object.entries(n).filter(([t]) => e.has(t))) : n;
950
+ return {
951
+ selectableRows: tr(r),
952
+ selectedRows: nr(i, r)
953
+ };
954
+ }, [
955
+ t,
956
+ n,
957
+ e
958
+ ]);
959
+ }
960
+ // src/StageCommandForm.tsx
961
+ var Ln = t(void 0), Rn = t(null);
962
+ function zn({ element: e }) {
963
+ let t = z(), n = i(Fe), r = i(Ln), a = i(Rn), o = c(null), u = s(() => Vn(e), [e]), d = s(() => yr(e), [e]), f = typeof e.properties.schema == "string", p = s(() => u ? Hn(u, d) : [], [u, d]), m = u ? U(u.command, J(e, "typeName"), J(e, "route")) : void 0, h = J(e, "submitLabel") || "Submit", g = sr(e, p, t.resolveArgument), _ = ar(e, d, t), v = JSON.stringify(_ ?? null), y = s(() => _, [v]), { selectableRows: b, selectedRows: x } = In(), S = e.properties.rowAction === !0, C = s(() => ({
944
964
  ...y,
945
- ...Bn(p, d, t.parameters, b, x, S),
946
- ...zn(p, t.parameters)
965
+ ...Jn(p, d, t.parameters, x, b, S),
966
+ ...qn(p, t.parameters)
947
967
  }), [
948
968
  y,
949
969
  p,
950
970
  d,
951
971
  t.parameters,
952
- b,
953
972
  x,
973
+ b,
954
974
  S
955
- ]), w = s(() => u ? Fn(u, p, d) : void 0, [
975
+ ]), w = s(() => u ? Un(u, p, d) : void 0, [
956
976
  u,
957
977
  p,
958
978
  d
959
- ]), ee = s(() => u ? lr(p, d) : [], [
979
+ ]), ee = s(() => u ? _r(p, d) : [], [
960
980
  u,
961
981
  p,
962
982
  d
963
- ]), te = s(() => u ? ur(u.layout, p) : [], [u, p]), [ne, T] = l([]);
964
- return u ? !m && !t.routesReady ? /* @__PURE__ */ L("p", {
983
+ ]), te = s(() => u ? vr(u.layout, p) : [], [u, p]), [ne, T] = l([]);
984
+ return u ? !m && !t.routesReady ? /* @__PURE__ */ I("p", {
965
985
  className: "stage-note",
966
986
  children: [
967
987
  "The modeled command “",
968
988
  u.command,
969
989
  "” is waiting for Stage routes."
970
990
  ]
971
- }) : m ? p.length === 0 && !f && e.properties.parameterless !== !0 ? /* @__PURE__ */ I(Mn, {
991
+ }) : m ? p.length === 0 && !f && e.properties.parameterless !== !0 ? /* @__PURE__ */ F(Bn, {
972
992
  form: u,
973
993
  messages: [`The modeled command “${u.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
974
- }) : ee.length > 0 ? /* @__PURE__ */ I(Mn, {
994
+ }) : ee.length > 0 ? /* @__PURE__ */ F(Bn, {
975
995
  form: u,
976
996
  messages: ee
977
- }) : /* @__PURE__ */ I("section", {
997
+ }) : /* @__PURE__ */ F("section", {
978
998
  ref: o,
979
999
  className: "stage-command-form",
980
1000
  "data-command": u.command,
981
1001
  "data-generation-mode": u.generationMode,
982
- children: /* @__PURE__ */ L(Ge, {
1002
+ children: /* @__PURE__ */ I(Je, {
983
1003
  command: m,
984
1004
  initialValues: C,
985
1005
  currentValues: g,
986
1006
  validateOn: "both",
987
1007
  validateAllFieldsOnChange: !0,
988
- onBeforeExecute: (e) => tn(e, n.apiBasePath),
989
- onFieldValidate: (e, t, n, r) => cr(p, d, t, r),
990
- onValidationFailure: (e) => T(sr(p, e)),
1008
+ onBeforeExecute: (e) => an(e, n.apiBasePath),
1009
+ onFieldValidate: (e, t, n, r) => gr(p, d, t, r),
1010
+ onValidationFailure: (e) => T(hr(p, e)),
991
1011
  onException: (e) => T(e),
992
- onFailed: (e) => T(rn(u.command, e).messages),
1012
+ onFailed: (e) => T(sn(u.command, e).messages),
993
1013
  onSuccess: () => {
994
1014
  T([]), t.refreshAfterCommand();
995
- let n = Y(e, "navigateToScreen");
996
- n && G(n, {}), r?.();
1015
+ let n = J(e, "navigateToScreen");
1016
+ n && W(n, {}), r?.();
997
1017
  },
998
1018
  children: [
999
- te.map((e) => /* @__PURE__ */ I("p", {
1019
+ te.map((e) => /* @__PURE__ */ F("p", {
1000
1020
  role: "alert",
1001
1021
  className: "stage-form-error",
1002
1022
  children: e
1003
1023
  }, e)),
1004
1024
  w,
1005
- ne.map((e) => /* @__PURE__ */ I("p", {
1025
+ ne.map((e) => /* @__PURE__ */ F("p", {
1006
1026
  role: "alert",
1007
1027
  className: "stage-form-error",
1008
1028
  children: e
1009
1029
  }, e)),
1010
- a ? Ve(/* @__PURE__ */ I("button", {
1030
+ a ? We(/* @__PURE__ */ F("button", {
1011
1031
  type: "button",
1012
1032
  className: "scene-slice-dialog-submit",
1013
1033
  onClick: () => o.current?.querySelector("form")?.requestSubmit(),
1014
1034
  children: h
1015
- }), a) : /* @__PURE__ */ I("button", {
1035
+ }), a) : /* @__PURE__ */ F("button", {
1016
1036
  type: "submit",
1017
1037
  className: "stage-command-form__submit",
1018
1038
  children: h
1019
1039
  })
1020
1040
  ]
1021
1041
  }, v)
1022
- }) : /* @__PURE__ */ L("p", {
1042
+ }) : /* @__PURE__ */ I("p", {
1023
1043
  className: "stage-note",
1024
1044
  children: [
1025
1045
  "The modeled command “",
1026
1046
  u.command,
1027
1047
  "” is not registered by this Stage."
1028
1048
  ]
1029
- }) : /* @__PURE__ */ I("p", {
1049
+ }) : /* @__PURE__ */ F("p", {
1030
1050
  className: "stage-note",
1031
1051
  children: "This form is missing its command metadata."
1032
1052
  });
1033
1053
  }
1034
- function Mn({ form: e, messages: t }) {
1035
- return /* @__PURE__ */ I("section", {
1054
+ function Bn({ form: e, messages: t }) {
1055
+ return /* @__PURE__ */ F("section", {
1036
1056
  className: "stage-command-form",
1037
1057
  "data-command": e.command,
1038
1058
  "data-generation-mode": e.generationMode,
1039
- children: t.map((e) => /* @__PURE__ */ I("p", {
1059
+ children: t.map((e) => /* @__PURE__ */ F("p", {
1040
1060
  role: "alert",
1041
1061
  className: "stage-form-error",
1042
1062
  children: e
1043
1063
  }, e))
1044
1064
  });
1045
1065
  }
1046
- function Nn(e) {
1047
- let t = Y(e, "command");
1066
+ function Vn(e) {
1067
+ let t = J(e, "command");
1048
1068
  if (!t) return;
1049
- let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(X) : [];
1069
+ let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(Y) : [];
1050
1070
  return {
1051
1071
  command: t,
1052
- label: Y(e, "label", t),
1072
+ label: J(e, "label", t),
1053
1073
  fields: n,
1054
- generationMode: tr(e.properties.generationMode),
1055
- layout: nr(e.properties.layout)
1074
+ generationMode: lr(e.properties.generationMode),
1075
+ layout: ur(e.properties.layout)
1056
1076
  };
1057
1077
  }
1058
- function Pn(e, t) {
1078
+ function Hn(e, t) {
1059
1079
  return e.generationMode === f.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
1060
1080
  name: e.name,
1061
- label: q(e.name)
1081
+ label: K(e.name)
1062
1082
  }));
1063
1083
  }
1064
- function Fn(e, t, n) {
1065
- let r = e.layout, i = r ? rr(r, t) : [];
1066
- if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => In(e, n));
1067
- let a = new Map(t.map((e) => [e.name, e])), o = ir(r, i), s = {
1068
- gridTemplateColumns: Array.from({ length: o }, (e, t) => ar(t + 1, r.columns)).join(" "),
1069
- columnGap: J(r.columnGap),
1070
- rowGap: J(r.rowGap)
1084
+ function Un(e, t, n) {
1085
+ let r = e.layout, i = r ? dr(r, t) : [];
1086
+ if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => Wn(e, n));
1087
+ let a = new Map(t.map((e) => [e.name, e])), o = fr(r, i), s = {
1088
+ gridTemplateColumns: Array.from({ length: o }, (e, t) => pr(t + 1, r.columns)).join(" "),
1089
+ columnGap: q(r.columnGap),
1090
+ rowGap: q(r.rowGap)
1071
1091
  }, c = /* @__PURE__ */ new Set();
1072
- return /* @__PURE__ */ L("div", {
1092
+ return /* @__PURE__ */ I("div", {
1073
1093
  className: "stage-command-form__layout",
1074
1094
  style: s,
1075
1095
  children: [i.map((e) => {
1076
1096
  let t = a.get(e.field);
1077
- return t ? (c.add(t.name), In(t, n, e)) : null;
1078
- }), t.filter((e) => !c.has(e.name)).map((e) => In(e, n))]
1097
+ return t ? (c.add(t.name), Wn(t, n, e)) : null;
1098
+ }), t.filter((e) => !c.has(e.name)).map((e) => Wn(e, n))]
1079
1099
  });
1080
1100
  }
1081
- function In(e, t, n) {
1101
+ function Wn(e, t, n) {
1082
1102
  let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = (() => {
1083
1103
  if (i?.options) {
1084
1104
  let e = i.options.map((e) => ({
1085
1105
  value: e,
1086
- label: q(e)
1106
+ label: K(e)
1087
1107
  }));
1088
- return /* @__PURE__ */ I(Xe, {
1108
+ return /* @__PURE__ */ F($e, {
1089
1109
  value: o,
1090
1110
  fieldName: r,
1091
1111
  title: a,
@@ -1095,7 +1115,7 @@ function In(e, t, n) {
1095
1115
  optionLabel: "label"
1096
1116
  });
1097
1117
  }
1098
- if (i?.members || i?.item) return /* @__PURE__ */ I(xn, {
1118
+ if (i?.members || i?.item) return /* @__PURE__ */ F(wn, {
1099
1119
  value: o,
1100
1120
  fieldName: r,
1101
1121
  title: a,
@@ -1103,19 +1123,19 @@ function In(e, t, n) {
1103
1123
  descriptor: i
1104
1124
  });
1105
1125
  switch (i?.type ?? "text") {
1106
- case "number": return /* @__PURE__ */ I(Qe, {
1126
+ case "number": return /* @__PURE__ */ F(tt, {
1107
1127
  value: o,
1108
1128
  fieldName: r,
1109
1129
  title: a,
1110
1130
  required: s
1111
1131
  });
1112
- case "boolean": return /* @__PURE__ */ I(Ye, {
1132
+ case "boolean": return /* @__PURE__ */ F(Qe, {
1113
1133
  value: o,
1114
1134
  fieldName: r,
1115
1135
  label: a,
1116
1136
  required: s
1117
1137
  });
1118
- case "date": return /* @__PURE__ */ I(Ln, {
1138
+ case "date": return /* @__PURE__ */ F(Gn, {
1119
1139
  value: o,
1120
1140
  fieldName: r,
1121
1141
  title: a,
@@ -1123,15 +1143,15 @@ function In(e, t, n) {
1123
1143
  showIcon: !0,
1124
1144
  showTime: i?.withTime
1125
1145
  });
1126
- default: return /* @__PURE__ */ I(Ze, {
1146
+ default: return /* @__PURE__ */ F(et, {
1127
1147
  value: o,
1128
1148
  fieldName: r,
1129
1149
  title: a,
1130
1150
  required: s
1131
1151
  });
1132
1152
  }
1133
- })(), l = or(n);
1134
- return /* @__PURE__ */ I("span", {
1153
+ })(), l = mr(n);
1154
+ return /* @__PURE__ */ F("span", {
1135
1155
  className: "stage-command-form__field",
1136
1156
  "data-field": e.name,
1137
1157
  "data-row": n?.row,
@@ -1141,21 +1161,21 @@ function In(e, t, n) {
1141
1161
  children: c
1142
1162
  }, e.name);
1143
1163
  }
1144
- var Ln = qe((e) => /* @__PURE__ */ I(Je, {
1164
+ var Gn = Xe((e) => /* @__PURE__ */ F(Ze, {
1145
1165
  ...e,
1146
- currentValue: e.showTime ? e.currentValue : Rn(e.currentValue),
1147
- onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? He.fromDate(t) : t)
1166
+ currentValue: e.showTime ? e.currentValue : Kn(e.currentValue),
1167
+ onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Ge.fromDate(t) : t)
1148
1168
  }));
1149
- function Rn(e) {
1150
- if (e instanceof He) return e.toDate();
1169
+ function Kn(e) {
1170
+ if (e instanceof Ge) return e.toDate();
1151
1171
  if (typeof e != "string") return e;
1152
1172
  try {
1153
- return He.parse(e).toDate();
1173
+ return Ge.parse(e).toDate();
1154
1174
  } catch {
1155
1175
  return null;
1156
1176
  }
1157
1177
  }
1158
- function zn(e, t) {
1178
+ function qn(e, t) {
1159
1179
  let n = {};
1160
1180
  for (let r of e) {
1161
1181
  let e = r.sourceProperty ?? r.name, i = t[e];
@@ -1163,35 +1183,35 @@ function zn(e, t) {
1163
1183
  }
1164
1184
  return n;
1165
1185
  }
1166
- function Bn(e, t, n, r = [], i = [], a = !1) {
1186
+ function Jn(e, t, n, r = [], i = [], a = !1) {
1167
1187
  let o = new Set(e.map((e) => e.sourceProperty ?? e.name)), s = t.some((e) => e.identity), c = {};
1168
1188
  for (let e of t) {
1169
1189
  if (!e.identifier || !e.required || o.has(e.name)) continue;
1170
- if (a && Wn(e, i)) {
1171
- let t = n[e.name] || Un(e, r);
1190
+ if (a && Qn(e, i)) {
1191
+ let t = n[e.name] || Zn(e, r);
1172
1192
  t && (c[e.name] = t);
1173
1193
  continue;
1174
1194
  }
1175
- let t = n[e.name] || Un(e, r) || Pt(e.identifier) || (e.identity || !s && !Wn(e, i) ? Ft(e.identifier) : void 0);
1195
+ let t = n[e.name] || Zn(e, r) || Lt(e.identifier) || (e.identity || !s && !Qn(e, i) ? Rt(e.identifier) : void 0);
1176
1196
  t !== void 0 && (c[e.name] = t);
1177
1197
  }
1178
1198
  return c;
1179
1199
  }
1180
- function Vn(e, t) {
1181
- return !e.identifier || !e.required ? !1 : e.identity === !0 || Hn(e, t) !== void 0;
1200
+ function Yn(e, t) {
1201
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || Xn(e, t) !== void 0;
1182
1202
  }
1183
- function Hn(e, t) {
1184
- if (e.identifier) return t[e.name] || Pt(e.identifier);
1203
+ function Xn(e, t) {
1204
+ if (e.identifier) return t[e.name] || Lt(e.identifier);
1185
1205
  }
1186
- function Un(e, t) {
1206
+ function Zn(e, t) {
1187
1207
  if (!e.identifier) return;
1188
1208
  let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
1189
1209
  return n.size === 1 ? [...n][0] : void 0;
1190
1210
  }
1191
- function Wn(e, t) {
1211
+ function Qn(e, t) {
1192
1212
  return t.some((t) => Object.hasOwn(t, e.name));
1193
1213
  }
1194
- function Gn(e, t) {
1214
+ function $n(e, t) {
1195
1215
  let n = e.id;
1196
1216
  if (typeof n != "string" || n === "") return e;
1197
1217
  let r = `${t.alias ?? ""} ${t.name ?? ""}`.match(/[A-Z][a-z0-9]+/g) ?? [], i = Object.fromEntries(r.map((e) => `${e.charAt(0).toLowerCase()}${e.slice(1)}Id`).filter((t) => !Object.hasOwn(e, t)).map((e) => [e, n]));
@@ -1200,96 +1220,96 @@ function Gn(e, t) {
1200
1220
  ...e
1201
1221
  };
1202
1222
  }
1203
- function Kn(e) {
1204
- return Object.values(e).flatMap((e) => e.rows.map((t) => [t, Gn(t, e)]));
1223
+ function er(e) {
1224
+ return Object.values(e).flatMap((e) => e.rows.map((t) => [t, $n(t, e)]));
1205
1225
  }
1206
- function qn(e) {
1207
- return Kn(e).map(([, e]) => e);
1226
+ function tr(e) {
1227
+ return er(e).map(([, e]) => e);
1208
1228
  }
1209
- function Jn(e, t) {
1210
- let n = new Map(Kn(t));
1229
+ function nr(e, t) {
1230
+ let n = new Map(er(t));
1211
1231
  return Object.values(e).filter((e) => e !== void 0).map((e) => n.get(e) ?? e);
1212
1232
  }
1213
- function Yn(e, t, n, r) {
1214
- return e.filter((e) => e.identifier && e.required && Wn(e, r)).filter((e) => !t[e.name] && Un(e, n) === void 0).map((e) => e.name);
1233
+ function rr(e, t, n, r) {
1234
+ return e.filter((e) => e.identifier && e.required && Qn(e, r)).filter((e) => !t[e.name] && Zn(e, n) === void 0).map((e) => e.name);
1215
1235
  }
1216
- function Xn(e) {
1236
+ function ir(e) {
1217
1237
  let t = e.properties.populateSource;
1218
- return X(t) ? t : void 0;
1238
+ return Y(t) ? t : void 0;
1219
1239
  }
1220
- function Zn(e, t, n) {
1221
- let r = Xn(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, Qn(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = V({
1222
- scope: `populate:${Y(e, "command")}`,
1240
+ function ar(e, t, n) {
1241
+ let r = ir(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, or(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = B({
1242
+ scope: `populate:${J(e, "command")}`,
1223
1243
  name: i,
1224
1244
  route: i ? n.routes?.queries?.[i] : void 0,
1225
1245
  arguments: o,
1226
1246
  ready: c,
1227
1247
  publish: !1
1228
- }), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : X(u) ? u : void 0;
1248
+ }), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : Y(u) ? u : void 0;
1229
1249
  return s(() => {
1230
1250
  if (!d) return;
1231
1251
  let e = {};
1232
1252
  for (let n of t) {
1233
1253
  let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
1234
- t != null && (e[n.name] = yn(n, t));
1254
+ t != null && (e[n.name] = Sn(n, t));
1235
1255
  }
1236
1256
  return Object.keys(e).length > 0 ? e : void 0;
1237
1257
  }, [d, t]);
1238
1258
  }
1239
- function Qn(e, t, n, r) {
1259
+ function or(e, t, n, r) {
1240
1260
  let i = r.parameters[t] ?? r.parameters[e];
1241
1261
  if (i) return i;
1242
1262
  let a = n.find((n) => n.name === t || n.name === e)?.identifier;
1243
- if (a) return Ft(a);
1263
+ if (a) return Rt(a);
1244
1264
  let o = r.resolveBinding({ path: t });
1245
1265
  return typeof o == "string" || typeof o == "number" ? o : void 0;
1246
1266
  }
1247
- function $n(e, t, n) {
1248
- let r = s(() => er(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1267
+ function sr(e, t, n) {
1268
+ let r = s(() => cr(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1249
1269
  return s(() => {
1250
1270
  let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
1251
1271
  return Object.keys(e).length > 0 ? e : void 0;
1252
1272
  }, [r, a]);
1253
1273
  }
1254
- function er(e, t) {
1274
+ function cr(e, t) {
1255
1275
  let n = e.properties.arguments;
1256
1276
  if (!Array.isArray(n)) return [];
1257
1277
  let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
1258
1278
  return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
1259
1279
  }
1260
- function tr(e) {
1280
+ function lr(e) {
1261
1281
  return e === f.Manual ? f.Manual : f.Auto;
1262
1282
  }
1263
- function nr(e) {
1264
- if (!X(e)) return;
1283
+ function ur(e) {
1284
+ if (!Y(e)) return;
1265
1285
  let t = e;
1266
1286
  return {
1267
- columns: Array.isArray(t.columns) ? t.columns.filter(fr) : [],
1268
- placements: Array.isArray(t.placements) ? t.placements.filter(pr) : [],
1269
- columnGap: mr(t.columnGap) ? t.columnGap : void 0,
1270
- rowGap: mr(t.rowGap) ? t.rowGap : void 0
1287
+ columns: Array.isArray(t.columns) ? t.columns.filter(br) : [],
1288
+ placements: Array.isArray(t.placements) ? t.placements.filter(xr) : [],
1289
+ columnGap: Sr(t.columnGap) ? t.columnGap : void 0,
1290
+ rowGap: Sr(t.rowGap) ? t.rowGap : void 0
1271
1291
  };
1272
1292
  }
1273
- function rr(e, t) {
1293
+ function dr(e, t) {
1274
1294
  let n = new Map(e.placements.map((e) => [e.field, e]));
1275
- for (let e of t) !n.has(e.name) && pr(e.placement) && n.set(e.name, e.placement);
1295
+ for (let e of t) !n.has(e.name) && xr(e.placement) && n.set(e.name, e.placement);
1276
1296
  return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
1277
1297
  }
1278
- function ir(e, t) {
1298
+ function fr(e, t) {
1279
1299
  return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
1280
1300
  }
1281
- function ar(e, t) {
1282
- let n = t.find((t) => t.index === e), r = J(n?.width), i = J(n?.minWidth), a = J(n?.maxWidth);
1301
+ function pr(e, t) {
1302
+ let n = t.find((t) => t.index === e), r = q(n?.width), i = q(n?.minWidth), a = q(n?.maxWidth);
1283
1303
  return n?.width?.unit === p.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1284
1304
  }
1285
- function or(e) {
1305
+ function mr(e) {
1286
1306
  if (e) return {
1287
1307
  gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
1288
1308
  gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
1289
- width: e.width?.unit === p.Fraction ? void 0 : J(e.width)
1309
+ width: e.width?.unit === p.Fraction ? void 0 : q(e.width)
1290
1310
  };
1291
1311
  }
1292
- function J(e) {
1312
+ function q(e) {
1293
1313
  if (e) switch (e.unit) {
1294
1314
  case p.Fraction: return `${e.value ?? 1}fr`;
1295
1315
  case p.Pixels: return `${e.value ?? 0}px`;
@@ -1297,64 +1317,63 @@ function J(e) {
1297
1317
  case p.Auto: return "auto";
1298
1318
  }
1299
1319
  }
1300
- function sr(e, t) {
1320
+ function hr(e, t) {
1301
1321
  let n = (e, t) => !!e.members?.some((e) => e === t || e.startsWith(`${t}.`)), r = new Set(e.map((e) => t.find((t) => n(t, e.sourceProperty ?? e.name))).filter((e) => e !== void 0));
1302
1322
  return [...new Set(t.filter((e) => !r.has(e)).map((e) => e.message))];
1303
1323
  }
1304
- function cr(e, t, n, r) {
1324
+ function gr(e, t, n, r) {
1305
1325
  let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
1306
- if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? _n(a, r, i?.label ?? n) : void 0;
1326
+ if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? bn(a, r, i?.label ?? n) : void 0;
1307
1327
  }
1308
- function lr(e, t) {
1328
+ function _r(e, t) {
1309
1329
  let n = new Map(t.map((e) => [e.name, e]));
1310
1330
  return e.flatMap((e) => {
1311
1331
  let t = n.get(e.sourceProperty ?? e.name);
1312
1332
  return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
1313
1333
  });
1314
1334
  }
1315
- function ur(e, t) {
1335
+ function vr(e, t) {
1316
1336
  if (!e) return [];
1317
- let n = rr(e, t).filter((e) => e.width?.unit === p.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === p.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
1337
+ let n = dr(e, t).filter((e) => e.width?.unit === p.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === p.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
1318
1338
  return [...n, ...r];
1319
1339
  }
1320
- function dr(e) {
1321
- return K(Y(e, "schema"));
1340
+ function yr(e) {
1341
+ return G(J(e, "schema"));
1322
1342
  }
1323
- function Y(e, t, n = "") {
1343
+ function J(e, t, n = "") {
1324
1344
  let r = e.properties[t];
1325
1345
  return typeof r == "string" ? r : n;
1326
1346
  }
1327
- function fr(e) {
1328
- return X(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1347
+ function br(e) {
1348
+ return Y(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1329
1349
  }
1330
- function pr(e) {
1331
- return X(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1350
+ function xr(e) {
1351
+ return Y(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1332
1352
  }
1333
- function mr(e) {
1334
- return X(e) && Object.values(p).includes(e.unit);
1353
+ function Sr(e) {
1354
+ return Y(e) && Object.values(p).includes(e.unit);
1335
1355
  }
1336
- function X(e) {
1356
+ function Y(e) {
1337
1357
  return typeof e == "object" && !!e && !Array.isArray(e);
1338
1358
  }
1339
- //#endregion
1340
- //#region src/StageGuardedAction.tsx
1341
- function hr(e) {
1359
+ // src/StageGuardedAction.tsx
1360
+ function Cr(e) {
1342
1361
  return typeof e == "object" && !!e && !Array.isArray(e);
1343
1362
  }
1344
- function gr(e, t) {
1363
+ function wr(e, t) {
1345
1364
  let n = e.properties[t];
1346
1365
  return typeof n == "string" ? n : "";
1347
1366
  }
1348
- function _r(e) {
1367
+ function Tr(e) {
1349
1368
  return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
1350
1369
  }
1351
- function vr(e) {
1352
- let t = B(), n = gr(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? gr(e, "itemRoute"), i = hr(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
1370
+ function Er(e) {
1371
+ let t = z(), n = wr(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? wr(e, "itemRoute"), i = Cr(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
1353
1372
  for (let [e, n] of Object.entries(i)) {
1354
- let r = hr(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
1373
+ let r = Cr(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
1355
1374
  a[e] = r, (r == null || r === "") && (o = !1);
1356
1375
  }
1357
- let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = V({
1376
+ let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = B({
1358
1377
  scope: `${e.id}:item`,
1359
1378
  name: n || void 0,
1360
1379
  route: r || void 0,
@@ -1370,23 +1389,23 @@ function vr(e) {
1370
1389
  item: l.rows.length === 1 ? l.rows[0] : void 0
1371
1390
  };
1372
1391
  }
1373
- function yr(e, t) {
1374
- return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Mt(xt(n) ?? "", t)]));
1392
+ function Dr(e, t) {
1393
+ return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Ft(wt(n) ?? "", t)]));
1375
1394
  }
1376
- function br({ element: e, interactions: t }) {
1377
- let n = B(), r = vr(e), i = an(), [a, o] = l([]), [c, u] = l(!1), d = gr(e, "label"), f = s(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = hr(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
1378
- if (!kt(m) || !h || !r.hasSource) {
1379
- let n = r.hasSource ? `${St}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${St}: “${d}” has no data subject to evaluate its guard against.`;
1380
- return /* @__PURE__ */ L("div", {
1395
+ function Or({ element: e, interactions: t }) {
1396
+ let n = z(), r = Er(e), i = cn(), [a, o] = l([]), [c, u] = l(!1), d = wr(e, "label"), f = s(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Cr(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
1397
+ if (!Mt(m) || !h || !r.hasSource) {
1398
+ let n = r.hasSource ? `${Tt}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Tt}: “${d}” has no data subject to evaluate its guard against.`;
1399
+ return /* @__PURE__ */ I("div", {
1381
1400
  className: "stage-guarded-action",
1382
1401
  "data-scene-id": e.id,
1383
- children: [/* @__PURE__ */ I(R, {
1402
+ children: [/* @__PURE__ */ F(L, {
1384
1403
  type: "button",
1385
1404
  disabled: !0,
1386
1405
  title: n,
1387
1406
  ...t,
1388
1407
  children: d
1389
- }), /* @__PURE__ */ I("p", {
1408
+ }), /* @__PURE__ */ F("p", {
1390
1409
  role: "alert",
1391
1410
  className: "stage-form-error",
1392
1411
  children: n
@@ -1394,41 +1413,41 @@ function br({ element: e, interactions: t }) {
1394
1413
  });
1395
1414
  }
1396
1415
  if (!r.item) return null;
1397
- let g = At(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
1416
+ let g = Nt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
1398
1417
  if (!_?.command) return null;
1399
- let v = _.command, y = W(v), b = r.item, x = async () => {
1418
+ let v = _.command, y = U(v), b = r.item, x = async () => {
1400
1419
  if (!y) return;
1401
1420
  u(!0);
1402
- let t = await i(v, yr(_, b));
1421
+ let t = await i(v, Dr(_, b));
1403
1422
  if (u(!1), o(t.messages), !t.isSuccess) return;
1404
1423
  n.refreshAfterCommand();
1405
- let r = gr(e, "navigateToScreen"), a = gr(e, "navigateByParameter"), s = a ? Mt(`item.${a}`, b) : void 0;
1406
- r && G(r, a && s != null ? { [a]: String(s) } : {});
1424
+ let r = wr(e, "navigateToScreen"), a = wr(e, "navigateByParameter"), s = a ? Ft(`item.${a}`, b) : void 0;
1425
+ r && W(r, a && s != null ? { [a]: String(s) } : {});
1407
1426
  };
1408
- return /* @__PURE__ */ L("div", {
1427
+ return /* @__PURE__ */ I("div", {
1409
1428
  className: "stage-guarded-action",
1410
1429
  "data-scene-id": e.id,
1411
1430
  "data-command": v,
1412
- children: [/* @__PURE__ */ I(R, {
1431
+ children: [/* @__PURE__ */ F(L, {
1413
1432
  ...t,
1414
1433
  type: "button",
1415
1434
  disabled: !y || c,
1416
1435
  title: y ? void 0 : "This command is not exposed as an API yet",
1417
1436
  onClick: () => void x(),
1418
1437
  children: d
1419
- }), a.map((e) => /* @__PURE__ */ I("p", {
1438
+ }), a.map((e) => /* @__PURE__ */ F("p", {
1420
1439
  role: "alert",
1421
1440
  className: "stage-form-error",
1422
1441
  children: e
1423
1442
  }, e))]
1424
1443
  });
1425
1444
  }
1426
- function xr(e) {
1427
- let t = pe(), n = c(void 0), i = s(() => C(ce(e.id, e.behaviors), m.DoubleClick), [e.behaviors, e.id]);
1445
+ function kr(e) {
1446
+ let t = me(), n = c(void 0), i = s(() => C(ce(e.id, e.behaviors), m.DoubleClick), [e.behaviors, e.id]);
1428
1447
  a(() => () => clearTimeout(n.current), []);
1429
1448
  let o = r((e) => {
1430
1449
  if (clearTimeout(n.current), n.current = void 0, !t) return;
1431
- let r = (n) => n.path === "$guard" ? jt(n.value, e) : n.path?.startsWith("item.") ? Mt(n.path, e) : t.context.resolve(n);
1450
+ let r = (n) => n.path === "$guard" ? Pt(n.value, e) : n.path?.startsWith("item.") ? Ft(n.path, e) : t.context.resolve(n);
1432
1451
  te(i, t.dispatcher, {
1433
1452
  ...t.context,
1434
1453
  resolve: r
@@ -1438,25 +1457,20 @@ function xr(e) {
1438
1457
  }, [i, t]);
1439
1458
  return {
1440
1459
  click: r((e, t) => {
1441
- if (i.length === 0) {
1442
- t();
1443
- return;
1444
- }
1445
- clearTimeout(n.current), n.current = setTimeout(() => {
1460
+ i.length === 0 ? t() : (clearTimeout(n.current), n.current = setTimeout(() => {
1446
1461
  n.current = void 0, t();
1447
- }, 250);
1462
+ }, 250));
1448
1463
  }, [i.length]),
1449
1464
  doubleClick: i.length > 0 ? o : void 0
1450
1465
  };
1451
1466
  }
1452
- //#endregion
1453
- //#region src/stageDialogScreens.ts
1454
- var Sr = "Stage:confirmDialog", Cr = "ConfirmDialog";
1455
- function wr(e, t) {
1467
+ // src/stageDialogScreens.ts
1468
+ var Ar = "Stage:confirmDialog", jr = "ConfirmDialog";
1469
+ function Mr(e, t) {
1456
1470
  let n = new Set(t.map((e) => e.name));
1457
1471
  return e.map((t) => {
1458
- if (t.screenTemplate !== Cr || n.has(Cr)) return t;
1459
- let r = Tr(t), i = e.find((e) => e.name !== t.name)?.name, a = F(`confirm-dialog-${t.name}`, Sr, {
1472
+ if (t.screenTemplate !== jr || n.has(jr)) return t;
1473
+ let r = Nr(t), i = e.find((e) => e.name !== t.name)?.name, a = N(`confirm-dialog-${t.name}`, Ar, {
1460
1474
  title: t.name,
1461
1475
  decisions: r,
1462
1476
  home: i
@@ -1469,100 +1483,99 @@ function wr(e, t) {
1469
1483
  };
1470
1484
  });
1471
1485
  }
1472
- function Tr(e) {
1486
+ function Nr(e) {
1473
1487
  let t = [];
1474
- for (let n of Er(Object.values(e.slotContent).flat())) {
1475
- let r = Dr(n.properties.command);
1488
+ for (let n of Pr(Object.values(e.slotContent).flat())) {
1489
+ let r = X(n.properties.command);
1476
1490
  r && !t.some((e) => e.command === r) && t.push({
1477
1491
  command: r,
1478
- label: Dr(n.properties.label),
1479
- navigateToScreen: Dr(n.properties.navigateToScreen),
1480
- typeName: Dr(n.properties.typeName),
1481
- route: Dr(n.properties.route),
1492
+ label: X(n.properties.label),
1493
+ navigateToScreen: X(n.properties.navigateToScreen),
1494
+ typeName: X(n.properties.typeName),
1495
+ route: X(n.properties.route),
1482
1496
  form: e.forms.find((e) => e.forCommand === r)
1483
1497
  });
1484
1498
  }
1485
1499
  return t;
1486
1500
  }
1487
- function Er(e) {
1501
+ function Pr(e) {
1488
1502
  return e.flatMap((e) => {
1489
1503
  let t = e;
1490
- return t.componentName === "core:action" ? [t] : Er(Object.values(t.slots ?? {}).flat());
1504
+ return t.componentName === "core:action" ? [t] : Pr(Object.values(t.slots ?? {}).flat());
1491
1505
  });
1492
1506
  }
1493
- function Dr(e) {
1507
+ function X(e) {
1494
1508
  return typeof e == "string" && e !== "" ? e : void 0;
1495
1509
  }
1496
- //#endregion
1497
- //#region src/StageConfirmDialog.tsx
1498
- function Or({ element: e }) {
1499
- let { routes: t, parameters: n, queries: r, selections: i } = B(), [o, s] = l(), u = c(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h = Jn(i, r);
1500
- return a(() => u.current?.focus(), []), /* @__PURE__ */ L("section", {
1510
+ // src/StageConfirmDialog.tsx
1511
+ function Fr({ element: e }) {
1512
+ let { routes: t, parameters: n, queries: r, selections: i } = z(), [o, s] = l(), u = c(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h = nr(i, r);
1513
+ return a(() => u.current?.focus(), []), /* @__PURE__ */ I("section", {
1501
1514
  className: "scene-slice-dialog stage-confirm-dialog",
1502
1515
  role: "dialog",
1503
- "aria-label": q(d),
1504
- "data-stage-component": Sr,
1516
+ "aria-label": K(d),
1517
+ "data-stage-component": Ar,
1505
1518
  children: [
1506
- /* @__PURE__ */ I("header", {
1519
+ /* @__PURE__ */ F("header", {
1507
1520
  className: "scene-slice-dialog-header",
1508
- children: /* @__PURE__ */ I("h2", {
1521
+ children: /* @__PURE__ */ F("h2", {
1509
1522
  className: "scene-slice-dialog-title",
1510
- children: q(d)
1523
+ children: K(d)
1511
1524
  })
1512
1525
  }),
1513
- /* @__PURE__ */ I("div", {
1526
+ /* @__PURE__ */ F("div", {
1514
1527
  className: "stage-confirm-dialog__decisions",
1515
- children: f.map((e, t) => /* @__PURE__ */ I("button", {
1528
+ children: f.map((e, t) => /* @__PURE__ */ F("button", {
1516
1529
  ref: t === 0 ? u : void 0,
1517
1530
  type: "button",
1518
1531
  className: t === 0 ? "scene-slice-dialog-submit stage-confirm-dialog__decision" : "scene-slice-dialog-cancel stage-confirm-dialog__decision",
1519
1532
  "data-emphasis": t === 0 ? "primary" : "secondary",
1520
1533
  "aria-pressed": e.command === o,
1521
1534
  onClick: () => s(e.command),
1522
- children: Ar(e)
1535
+ children: Lr(e)
1523
1536
  }, e.command))
1524
1537
  }),
1525
- m && /* @__PURE__ */ I(jn, { element: Nr(m, t?.commandSchemas?.[m.command] ?? "", n, h) }, m.command),
1526
- /* @__PURE__ */ I("footer", {
1538
+ m && /* @__PURE__ */ F(Fn, { children: /* @__PURE__ */ F(zn, { element: Br(m, t?.commandSchemas?.[m.command] ?? "", n, h) }, m.command) }),
1539
+ /* @__PURE__ */ F("footer", {
1527
1540
  className: "scene-slice-dialog-footer",
1528
- children: /* @__PURE__ */ I("button", {
1541
+ children: /* @__PURE__ */ F("button", {
1529
1542
  type: "button",
1530
1543
  className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
1531
- onClick: () => kr(f, p),
1544
+ onClick: () => Ir(f, p),
1532
1545
  children: "Cancel"
1533
1546
  })
1534
1547
  })
1535
1548
  ]
1536
1549
  });
1537
1550
  }
1538
- function kr(e, t) {
1551
+ function Ir(e, t) {
1539
1552
  let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
1540
- r && G(r, {});
1553
+ r && W(r, {});
1541
1554
  }
1542
- function Ar(e) {
1543
- return e.label ?? q(e.command);
1555
+ function Lr(e) {
1556
+ return e.label ?? K(e.command);
1544
1557
  }
1545
- function jr(e, t, n) {
1546
- return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || Un(e, n) !== void 0;
1558
+ function Rr(e, t, n) {
1559
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || Zn(e, n) !== void 0;
1547
1560
  }
1548
- function Mr(e, t, n, r) {
1561
+ function zr(e, t, n, r) {
1549
1562
  let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
1550
1563
  name: e.name,
1551
1564
  label: e.name
1552
- })), o = new Set(t.filter((e) => jr(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
1565
+ })), o = new Set(t.filter((e) => Rr(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
1553
1566
  return [...s, ...l.map((e) => ({
1554
1567
  name: e.name,
1555
- label: q(e.name)
1568
+ label: K(e.name)
1556
1569
  }))];
1557
1570
  }
1558
- function Nr(e, t, n, r) {
1559
- let i = Mr(e, K(t), n, r);
1571
+ function Br(e, t, n, r) {
1572
+ let i = zr(e, G(t), n, r);
1560
1573
  return {
1561
1574
  id: `confirm-${e.command}`,
1562
- componentName: Sr,
1575
+ componentName: Ar,
1563
1576
  properties: {
1564
1577
  command: e.command,
1565
- label: Ar(e),
1578
+ label: Lr(e),
1566
1579
  submitLabel: "Confirm",
1567
1580
  typeName: e.typeName,
1568
1581
  route: e.route,
@@ -1576,10 +1589,108 @@ function Nr(e, t, n, r) {
1576
1589
  slots: {}
1577
1590
  };
1578
1591
  }
1579
- //#endregion
1580
- //#region src/stageComponents.tsx
1581
- var Pr = "Stage:commandForm";
1582
- function Fr(e, t, n = {}) {
1592
+ function Vr(e) {
1593
+ return typeof e == "object" && !!e && !Array.isArray(e);
1594
+ }
1595
+ function Hr(e, t) {
1596
+ if (!Array.isArray(e) || !Array.isArray(t)) return;
1597
+ let n = new Map(e.filter(Vr).map((e) => [JSON.stringify(e.id), e.column]));
1598
+ for (let e of t.filter(Vr)) {
1599
+ let t = JSON.stringify(e.id);
1600
+ if (n.has(t) && n.get(t) !== e.column) return {
1601
+ item: {
1602
+ id: e.id,
1603
+ column: e.column
1604
+ },
1605
+ previous: n.get(t)
1606
+ };
1607
+ }
1608
+ }
1609
+ function Ur(e, t, n, r) {
1610
+ if (!Array.isArray(e)) return;
1611
+ let i = e.filter(Vr).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
1612
+ if (i !== void 0) return {
1613
+ item: {
1614
+ ...i,
1615
+ [r]: t.item.column
1616
+ },
1617
+ value: t.item.column,
1618
+ previous: t.previous
1619
+ };
1620
+ }
1621
+ function Wr(e, t) {
1622
+ return (n) => n.path === "$guard" ? Pt(n.value, e.item) : n.path === "value" ? e.value : n.path === "previous" ? e.previous : n.path?.startsWith("item.") ? Ft(n.path, e.item) : t(n);
1623
+ }
1624
+ function Gr(e, t) {
1625
+ let n = me(), i = z(), { element: a, rowsProperty: o, idField: u, valueField: d } = e, f = s(() => C(ce(a.id, a.behaviors), m.Change), [a.behaviors, a.id]), p = c(void 0), h = c(!1), [g, _] = l(0), v = c({
1626
+ scope: n,
1627
+ data: i,
1628
+ element: a,
1629
+ bindings: f
1630
+ });
1631
+ v.current = {
1632
+ scope: n,
1633
+ data: i,
1634
+ element: a,
1635
+ bindings: f
1636
+ };
1637
+ let y = r((e, t) => {
1638
+ let { scope: n, data: r, element: i, bindings: a } = v.current, s = Hr(e, t);
1639
+ if (!n || a.length === 0 || s === void 0) return;
1640
+ let c = Ur(i.properties[o], s, u, d);
1641
+ if (c === void 0) return;
1642
+ let l = {
1643
+ ...n.context,
1644
+ resolve: Wr(c, n.context.resolve)
1645
+ }, f = !1, p = !1, m = {
1646
+ ...n.dispatcher,
1647
+ executeCommand: async (e, t) => {
1648
+ let r = await n.dispatcher.executeCommand(e, t);
1649
+ return r?.isSuccess ? f = !0 : p = !0, r;
1650
+ }
1651
+ };
1652
+ te(a, m, l).then((e) => {
1653
+ e.findings.length > 0 && n.onFindings?.(e.findings), r.refreshAfterCommand(), (!f || p) && _((e) => e + 1);
1654
+ });
1655
+ }, [
1656
+ o,
1657
+ u,
1658
+ d
1659
+ ]), b = r(() => {
1660
+ h.current = !0;
1661
+ }, []), x = s(() => t === void 0 ? void 0 : {
1662
+ ...t,
1663
+ setOutput: (e, n) => {
1664
+ if (t.setOutput(e, n), e !== "value") return;
1665
+ let r = p.current;
1666
+ p.current = n, h.current && (h.current = !1, y(r, n));
1667
+ }
1668
+ }, [t, y]);
1669
+ return {
1670
+ declared: f.length > 0,
1671
+ onChange: b,
1672
+ outputs: x,
1673
+ revision: g
1674
+ };
1675
+ }
1676
+ function Kr(e) {
1677
+ let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = Gr({
1678
+ element: t,
1679
+ rowsProperty: "cards",
1680
+ idField: typeof t.properties.cardId == "string" ? t.properties.cardId : "id",
1681
+ valueField: n
1682
+ }, e.bindingOutputs), i = xe;
1683
+ return r.declared ? /* @__PURE__ */ F(i, {
1684
+ ...e,
1685
+ interactions: {
1686
+ ...e.interactions,
1687
+ onChange: r.onChange
1688
+ },
1689
+ bindingOutputs: r.outputs
1690
+ }, r.revision) : /* @__PURE__ */ F(i, { ...e });
1691
+ }
1692
+ var qr = le(Ee, j.KanbanBoard), Jr = "Stage:commandForm";
1693
+ function Yr(e, t, n = {}) {
1583
1694
  return {
1584
1695
  id: e,
1585
1696
  componentName: "",
@@ -1591,19 +1702,19 @@ function Z(e, t, n = "") {
1591
1702
  let r = e.properties[t];
1592
1703
  return typeof r == "string" ? r : n;
1593
1704
  }
1594
- function Ir(e, t, n) {
1705
+ function Xr(e, t, n) {
1595
1706
  let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
1596
- return typeof r == "string" && t?.includes(r) ? q(r) : String(e ?? "");
1707
+ return typeof r == "string" && t?.includes(r) ? K(r) : String(e ?? "");
1597
1708
  }
1598
- function Lr(e, t) {
1709
+ function Zr(e, t) {
1599
1710
  let n = e.properties.queryArguments;
1600
- if (!Vr(n)) return {
1711
+ if (!ti(n)) return {
1601
1712
  values: {},
1602
1713
  ready: !0
1603
1714
  };
1604
1715
  let r = {}, i = !0;
1605
1716
  for (let [e, a] of Object.entries(n)) {
1606
- let n = Br(a) ? t.resolveBinding(a) : a;
1717
+ let n = ei(a) ? t.resolveBinding(a) : a;
1607
1718
  r[e] = n, (n == null || n === "") && (i = !1);
1608
1719
  }
1609
1720
  return {
@@ -1611,7 +1722,7 @@ function Lr(e, t) {
1611
1722
  ready: i
1612
1723
  };
1613
1724
  }
1614
- function Rr(e, t) {
1725
+ function Qr(e, t) {
1615
1726
  let n = (e.slots.columns ?? []).map((e) => {
1616
1727
  let t = e.properties;
1617
1728
  return {
@@ -1629,22 +1740,18 @@ function Rr(e, t) {
1629
1740
  function Q(e, t) {
1630
1741
  return e[t] ?? e.id ?? e.key;
1631
1742
  }
1632
- function zr({ element: e, slots: t }) {
1633
- let n = B(), r = Z(e, "query", Z(e, "typeName", e.id)), i = (Z(e, "query") ? n.routes?.queries?.[Z(e, "query")] : void 0) ?? Z(e, "route"), o = s(() => Lr(e, n), [n, e]), { rows: c, error: l, loading: u } = V({
1743
+ function $r({ element: e, slots: t }) {
1744
+ let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), i = (Z(e, "query") ? n.routes?.queries?.[Z(e, "query")] : void 0) ?? Z(e, "route"), o = s(() => Zr(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
1634
1745
  scope: e.id,
1635
1746
  name: r,
1636
1747
  route: i || void 0,
1637
1748
  arguments: o.values,
1638
1749
  ready: o.ready
1639
- }), d = Rr(e, c), f = Z(e, "navigateOnRowClickToScreen"), p = Z(e, "navigateOnRowClickByParameter"), m = Z(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = xr(e);
1750
+ }), d = Qr(e, c), f = Z(e, "navigateOnRowClickToScreen"), p = Z(e, "navigateOnRowClickByParameter"), m = Z(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = kr(e);
1640
1751
  a(() => {
1641
1752
  if (!h) return;
1642
1753
  let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
1643
- if (r && r !== h) {
1644
- n.selectRow(e.id, r);
1645
- return;
1646
- }
1647
- !r && t !== void 0 && !u && n.clearSelection(e.id);
1754
+ r && r !== h ? n.selectRow(e.id, r) : !r && t !== void 0 && !u && n.clearSelection(e.id);
1648
1755
  }, [
1649
1756
  n,
1650
1757
  m,
@@ -1677,15 +1784,13 @@ function zr({ element: e, slots: t }) {
1677
1784
  ...f && f !== n.screen ? {} : n.parameters,
1678
1785
  [p]: String(r)
1679
1786
  };
1680
- (!f || f === n.screen) && n.selectRow(e.id, t), G(f || n.screen, i);
1681
- return;
1682
- }
1683
- n.selectRow(e.id, t);
1787
+ f && f !== n.screen || n.selectRow(e.id, t), W(f || n.screen, i);
1788
+ } else n.selectRow(e.id, t);
1684
1789
  };
1685
- return !Z(e, "query") && !i && !gt(r) ? /* @__PURE__ */ L("section", {
1790
+ return !Z(e, "query") && !i && !yt(r) ? /* @__PURE__ */ I("section", {
1686
1791
  className: "stage-table",
1687
1792
  "data-scene-id": e.id,
1688
- children: [/* @__PURE__ */ L("p", {
1793
+ children: [/* @__PURE__ */ I("p", {
1689
1794
  className: "stage-note",
1690
1795
  children: [
1691
1796
  "No query is exposed for ",
@@ -1693,34 +1798,34 @@ function zr({ element: e, slots: t }) {
1693
1798
  " yet."
1694
1799
  ]
1695
1800
  }), t.columns]
1696
- }) : /* @__PURE__ */ L("section", {
1801
+ }) : /* @__PURE__ */ I("section", {
1697
1802
  className: "stage-table",
1698
1803
  "data-scene-id": e.id,
1699
1804
  children: [
1700
- u && /* @__PURE__ */ I(Be, {
1805
+ u && /* @__PURE__ */ F(Ue, {
1701
1806
  severity: "info",
1702
1807
  text: "Loading…"
1703
1808
  }),
1704
- l && /* @__PURE__ */ I(Be, {
1809
+ l && /* @__PURE__ */ F(Ue, {
1705
1810
  severity: "error",
1706
1811
  text: l
1707
1812
  }),
1708
- h && /* @__PURE__ */ I(R, {
1813
+ h && /* @__PURE__ */ F(L, {
1709
1814
  type: "button",
1710
1815
  size: "small",
1711
1816
  onClick: () => {
1712
1817
  if (n.clearSelection(e.id), !p || n.parameters[p] === void 0) return;
1713
1818
  let { [p]: t, ...r } = n.parameters;
1714
- G(n.screen, r);
1819
+ W(n.screen, r);
1715
1820
  },
1716
1821
  children: "Clear selection"
1717
1822
  }),
1718
- /* @__PURE__ */ L("table", {
1823
+ /* @__PURE__ */ I("table", {
1719
1824
  "aria-label": Z(e, "label", Z(e, "typeName", "Results")),
1720
- children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ I("tr", { children: d.map((e) => /* @__PURE__ */ I("th", {
1825
+ children: [/* @__PURE__ */ F("thead", { children: /* @__PURE__ */ F("tr", { children: d.map((e) => /* @__PURE__ */ F("th", {
1721
1826
  scope: "col",
1722
1827
  children: e.label
1723
- }, e.property)) }) }), /* @__PURE__ */ L("tbody", { children: [c.map((e, t) => /* @__PURE__ */ I("tr", {
1828
+ }, e.property)) }) }), /* @__PURE__ */ I("tbody", { children: [c.map((e, t) => /* @__PURE__ */ F("tr", {
1724
1829
  "aria-selected": h === e,
1725
1830
  tabIndex: 0,
1726
1831
  onClick: () => _.click(e, () => v(e)),
@@ -1728,8 +1833,8 @@ function zr({ element: e, slots: t }) {
1728
1833
  onKeyDown: (t) => {
1729
1834
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), v(e));
1730
1835
  },
1731
- children: d.map((t) => /* @__PURE__ */ I("td", { children: Ir(e[t.property], t.options, t.optionValues) }, t.property))
1732
- }, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ I("tr", { children: /* @__PURE__ */ I("td", {
1836
+ children: d.map((t) => /* @__PURE__ */ F("td", { children: Xr(e[t.property], t.options, t.optionValues) }, t.property))
1837
+ }, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ F("tr", { children: /* @__PURE__ */ F("td", {
1733
1838
  colSpan: Math.max(d.length, 1),
1734
1839
  children: "No records found"
1735
1840
  }) })] })]
@@ -1737,28 +1842,35 @@ function zr({ element: e, slots: t }) {
1737
1842
  ]
1738
1843
  });
1739
1844
  }
1740
- function Br(e) {
1741
- return Vr(e) && (typeof e.path == "string" || typeof e.kind == "string");
1845
+ function ei(e) {
1846
+ return ti(e) && (typeof e.path == "string" || typeof e.kind == "string");
1742
1847
  }
1743
- function Vr(e) {
1848
+ function ti(e) {
1744
1849
  return typeof e == "object" && !!e && !Array.isArray(e);
1745
1850
  }
1746
- function Hr({ element: e, interactions: t, slots: n }) {
1747
- return _r(e) ? /* @__PURE__ */ I(br, {
1851
+ function ni({ element: e, interactions: t, slots: n }) {
1852
+ return Tr(e) ? /* @__PURE__ */ F(Or, {
1748
1853
  element: e,
1749
1854
  interactions: t
1750
- }) : /* @__PURE__ */ I(Ur, {
1855
+ }) : /* @__PURE__ */ F(ri, {
1751
1856
  element: e,
1752
1857
  interactions: t,
1753
1858
  slots: n
1754
1859
  });
1755
1860
  }
1756
- function Ur({ element: e, interactions: t }) {
1757
- let n = Z(e, "label", Z(e, "command"));
1758
- return W(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ I(Wr, {
1861
+ function ri({ element: e, interactions: t }) {
1862
+ let n = Z(e, "label", Z(e, "command")), r = U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")), i = ii(e);
1863
+ return r ? i.length > 0 ? /* @__PURE__ */ F(L, {
1864
+ type: "button",
1865
+ "data-scene-id": e.id,
1866
+ disabled: !0,
1867
+ title: "Select a row first",
1868
+ ...t,
1869
+ children: n
1870
+ }) : /* @__PURE__ */ F(oi, {
1759
1871
  element: e,
1760
1872
  label: n
1761
- }) : /* @__PURE__ */ I(R, {
1873
+ }) : /* @__PURE__ */ F(L, {
1762
1874
  type: "button",
1763
1875
  "data-scene-id": e.id,
1764
1876
  disabled: !0,
@@ -1767,21 +1879,28 @@ function Ur({ element: e, interactions: t }) {
1767
1879
  children: n
1768
1880
  });
1769
1881
  }
1770
- function Wr({ element: e, label: t }) {
1882
+ function ii(e) {
1883
+ let { parameters: t } = z(), n = Z(e, "schema"), r = e.properties.fields, i = Z(e, "generationMode").toLowerCase(), a = s(() => G(n), [n]), { selectableRows: o, selectedRows: c } = In(), l = Array.isArray(r) ? r : [], u = l.length > 0 || i === "manual" ? new Set(l.map(ai).filter((e) => e !== "")) : void 0;
1884
+ return u ? rr(a.filter((e) => !u.has(e.name)), t, c, o) : [];
1885
+ }
1886
+ function ai(e) {
1887
+ return ti(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
1888
+ }
1889
+ function oi({ element: e, label: t }) {
1771
1890
  let [n, i] = l(0), [a, o] = l(!1), s = r(() => {
1772
1891
  o(!1), i((e) => e + 1);
1773
- }, []), c = /* @__PURE__ */ I(kn.Provider, {
1892
+ }, []), c = /* @__PURE__ */ F(Ln.Provider, {
1774
1893
  value: s,
1775
- children: /* @__PURE__ */ I(jn, { element: e }, n)
1894
+ children: /* @__PURE__ */ F(zn, { element: e }, n)
1776
1895
  });
1777
- return /* @__PURE__ */ L("div", {
1896
+ return /* @__PURE__ */ I("div", {
1778
1897
  className: "stage-action",
1779
1898
  "data-scene-id": e.id,
1780
- children: [/* @__PURE__ */ I(R, {
1899
+ children: [/* @__PURE__ */ F(L, {
1781
1900
  type: "button",
1782
1901
  onClick: () => o(!0),
1783
1902
  children: t
1784
- }), /* @__PURE__ */ I(ze, {
1903
+ }), /* @__PURE__ */ F(He, {
1785
1904
  title: t,
1786
1905
  visible: a,
1787
1906
  onClose: () => o(!1),
@@ -1791,123 +1910,123 @@ function Wr({ element: e, label: t }) {
1791
1910
  })]
1792
1911
  });
1793
1912
  }
1794
- function Gr(e) {
1795
- let t = e.element ?? Fr("slice-dialog", {}), n = me(), { routes: i, parameters: a, queries: o, selections: c } = B(), u = fe(n?.currentDialogParameters), d = Z(t, "command") || u?.command || Z(t, "slice") || "", f = Z(t, "title") || u?.title || d, p = i?.commandSchemas?.[d], m = s(() => K(p ?? ""), [p]), h = s(() => qn(o), [o]), g = s(() => Jn(c, o), [c, o]), _ = r(() => n?.closeDialog(), [n]), [v, y] = l(null), b = (e) => e.identifier && e.required && Wn(e, h) && Un(e, g) !== void 0;
1796
- if (!p || !(m.some((e) => e.options || e.members || e.item) || m.some(b))) return e.element ? /* @__PURE__ */ I(T, {
1913
+ function si(e) {
1914
+ let t = e.element ?? Yr("slice-dialog", {}), n = he(), { routes: i, parameters: a } = z(), o = pe(n?.currentDialogParameters), c = Z(t, "command") || o?.command || Z(t, "slice") || "", u = Z(t, "title") || o?.title || c, d = i?.commandSchemas?.[c], f = s(() => G(d ?? ""), [d]), { selectableRows: p, selectedRows: m } = In(), h = r(() => n?.closeDialog(), [n]), [g, _] = l(null), v = (e) => e.identifier && e.required && Qn(e, p) && Zn(e, m) !== void 0;
1915
+ if (!d || !(f.some((e) => e.options || e.members || e.item) || f.some(v))) return e.element ? /* @__PURE__ */ F(T, {
1797
1916
  element: e.element,
1798
1917
  slots: e.slots ?? {}
1799
- }) : /* @__PURE__ */ I(oe, {});
1800
- let x = m.filter((e) => !Vn(e, a) && !b(e)), S = Fr(`slice-dialog-${d}`, {
1801
- command: d,
1802
- label: f,
1803
- schema: p,
1804
- fields: x.map((e) => ({
1918
+ }) : /* @__PURE__ */ F(oe, {});
1919
+ let y = f.filter((e) => !Yn(e, a) && !v(e)), b = Yr(`slice-dialog-${c}`, {
1920
+ command: c,
1921
+ label: u,
1922
+ schema: d,
1923
+ fields: y.map((e) => ({
1805
1924
  name: e.name,
1806
- label: q(e.name)
1925
+ label: K(e.name)
1807
1926
  })),
1808
1927
  generationMode: "manual"
1809
1928
  });
1810
- return /* @__PURE__ */ L("section", {
1929
+ return /* @__PURE__ */ I("section", {
1811
1930
  className: "scene-slice-dialog",
1812
- "data-scene-slice-dialog": Z(t, "slice") || u?.slice,
1813
- "data-scene-command": d,
1931
+ "data-scene-slice-dialog": Z(t, "slice") || o?.slice,
1932
+ "data-scene-command": c,
1814
1933
  children: [
1815
- /* @__PURE__ */ I("header", {
1934
+ /* @__PURE__ */ F("header", {
1816
1935
  className: "scene-slice-dialog-header",
1817
- children: /* @__PURE__ */ I("h2", {
1936
+ children: /* @__PURE__ */ F("h2", {
1818
1937
  className: "scene-slice-dialog-title",
1819
- children: f
1938
+ children: u
1820
1939
  })
1821
1940
  }),
1822
- /* @__PURE__ */ I(kn.Provider, {
1823
- value: _,
1824
- children: /* @__PURE__ */ I(An.Provider, {
1825
- value: v,
1826
- children: /* @__PURE__ */ I(jn, { element: S })
1941
+ /* @__PURE__ */ F(Ln.Provider, {
1942
+ value: h,
1943
+ children: /* @__PURE__ */ F(Rn.Provider, {
1944
+ value: g,
1945
+ children: /* @__PURE__ */ F(zn, { element: b })
1827
1946
  })
1828
1947
  }),
1829
- /* @__PURE__ */ I("footer", {
1830
- ref: y,
1948
+ /* @__PURE__ */ F("footer", {
1949
+ ref: _,
1831
1950
  className: "scene-slice-dialog-footer",
1832
- children: /* @__PURE__ */ I("button", {
1951
+ children: /* @__PURE__ */ F("button", {
1833
1952
  type: "button",
1834
1953
  className: "scene-slice-dialog-cancel",
1835
- onClick: _,
1954
+ onClick: h,
1836
1955
  children: "Cancel"
1837
1956
  })
1838
1957
  })
1839
1958
  ]
1840
1959
  });
1841
1960
  }
1842
- function Kr(e) {
1961
+ function ci(e) {
1843
1962
  let { element: t } = e;
1844
- return Z(t, "slice") === "" ? Z(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ I(Jr, { ...e }) : /* @__PURE__ */ I(E, { ...e }) : /* @__PURE__ */ I(qr, { ...e });
1963
+ return Z(t, "slice") === "" ? Z(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ F(ui, { ...e }) : /* @__PURE__ */ F(E, { ...e }) : /* @__PURE__ */ F(li, { ...e });
1845
1964
  }
1846
- function qr(e) {
1847
- let { element: t } = e, { routes: n, parameters: r, queries: i, selections: a } = B(), o = Z(t, "slice"), c = Z(t, "command") || o.split(".").at(-1) || "", l = n?.commandSchemas?.[c], u = s(() => K(l ?? ""), [l]), d = s(() => qn(i), [i]);
1848
- if (Yn(u, r, s(() => Jn(a, i), [a, i]), d).length === 0) return /* @__PURE__ */ I(E, { ...e });
1849
- let f = Z(t, "label", Z(t, "name", t.id));
1850
- return /* @__PURE__ */ I("span", {
1965
+ function li(e) {
1966
+ let { element: t } = e, { routes: n, parameters: r } = z(), i = Z(t, "slice"), a = Z(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], c = s(() => G(o ?? ""), [o]), { selectableRows: l, selectedRows: u } = In();
1967
+ if (rr(c, r, u, l).length === 0) return /* @__PURE__ */ F(E, { ...e });
1968
+ let d = Z(t, "label", Z(t, "name", t.id));
1969
+ return /* @__PURE__ */ F("span", {
1851
1970
  className: "stage-toolbar-action",
1852
1971
  "data-scene-toolbar-item": Z(t, "name", t.id),
1853
- children: /* @__PURE__ */ I(R, {
1972
+ children: /* @__PURE__ */ F(L, {
1854
1973
  type: "button",
1855
1974
  "data-scene-id": t.id,
1856
1975
  disabled: !0,
1857
1976
  title: "Select a row first",
1858
1977
  ...e.interactions,
1859
- children: f
1978
+ children: d
1860
1979
  })
1861
1980
  });
1862
1981
  }
1863
- function Jr(e) {
1864
- let { element: t } = e, { routes: n, parameters: r, queries: i, selections: a } = B(), o = Z(t, "name", t.id), c = Z(t, "target"), l = Z(t, "label", o), u = n?.commandSchemas?.[c], d = s(() => K(u ?? ""), [u]), f = s(() => qn(i), [i]), p = Yn(d, r, s(() => Jn(a, i), [a, i]), f), m = d.filter((e) => !Vn(e, r) && !(e.identifier && e.required && Wn(e, f))), h = u ? {
1865
- schema: u,
1866
- fields: m.map((e) => ({
1982
+ function ui(e) {
1983
+ let { element: t } = e, { routes: n, parameters: r } = z(), i = Z(t, "name", t.id), a = Z(t, "target"), o = Z(t, "label", i), c = n?.commandSchemas?.[a], l = s(() => G(c ?? ""), [c]), { selectableRows: u, selectedRows: d } = In(), f = rr(l, r, d, u), p = l.filter((e) => !Yn(e, r) && !(e.identifier && e.required && Qn(e, u))), m = c ? {
1984
+ schema: c,
1985
+ fields: p.map((e) => ({
1867
1986
  name: e.name,
1868
- label: q(e.name)
1987
+ label: K(e.name)
1869
1988
  })),
1870
1989
  generationMode: "manual"
1871
- } : {}, g = {
1990
+ } : {}, h = {
1872
1991
  ...t,
1873
1992
  componentName: "core:action",
1874
1993
  properties: {
1875
- command: c,
1876
- label: l,
1994
+ command: a,
1995
+ label: o,
1877
1996
  rowAction: !0,
1878
- ...h
1997
+ ...m
1879
1998
  }
1880
1999
  };
1881
- return /* @__PURE__ */ I("span", {
2000
+ return /* @__PURE__ */ F("span", {
1882
2001
  className: "stage-toolbar-action",
1883
- "data-scene-toolbar-item": o,
1884
- children: p.length > 0 ? /* @__PURE__ */ I(R, {
2002
+ "data-scene-toolbar-item": i,
2003
+ children: f.length > 0 ? /* @__PURE__ */ F(L, {
1885
2004
  type: "button",
1886
2005
  "data-scene-id": t.id,
1887
2006
  disabled: !0,
1888
2007
  title: "Select a row first",
1889
2008
  ...e.interactions,
1890
- children: l
1891
- }) : /* @__PURE__ */ I(Hr, {
1892
- element: g,
2009
+ children: o
2010
+ }) : /* @__PURE__ */ F(ni, {
2011
+ element: h,
1893
2012
  interactions: e.interactions,
1894
2013
  slots: e.slots
1895
2014
  })
1896
2015
  });
1897
2016
  }
1898
- var Yr = {
1899
- ...le,
1900
- "core:table": zr,
1901
- "core:action": Hr,
1902
- "core:toolbarItem": Kr,
1903
- "core:sliceDialog": Gr,
1904
- [Pr]: jn,
1905
- [Sr]: Or
2017
+ var di = {
2018
+ ...k,
2019
+ "core:table": $r,
2020
+ "core:action": ni,
2021
+ "core:toolbarItem": ci,
2022
+ "core:sliceDialog": si,
2023
+ [Jr]: zn,
2024
+ [Ar]: Fr,
2025
+ [qr]: Kr
1906
2026
  };
1907
- //#endregion
1908
- //#region src/useStrings.ts
1909
- function Xr() {
1910
- let e = ot(), [t, n] = l([]), [r, i] = l(""), [o, s] = l({});
2027
+ // src/useStrings.ts
2028
+ function fi() {
2029
+ let e = lt(), [t, n] = l([]), [r, i] = l(""), [o, s] = l({});
1911
2030
  return a(() => {
1912
2031
  let t = new AbortController();
1913
2032
  return e.locales(t.signal).then((e) => {
@@ -1928,11 +2047,11 @@ function Xr() {
1928
2047
  dictionary: o
1929
2048
  };
1930
2049
  }
1931
- var Zr = /* @__PURE__ */ new Set(["core:table"]);
1932
- function Qr(e) {
1933
- return $r(e, /* @__PURE__ */ new Map(), void 0);
2050
+ var pi = /* @__PURE__ */ new Set(["core:table"]);
2051
+ function mi(e) {
2052
+ return hi(e, /* @__PURE__ */ new Map(), void 0);
1934
2053
  }
1935
- function $r(e, t, n) {
2054
+ function hi(e, t, n) {
1936
2055
  let r = e;
1937
2056
  if (!r.slots) return e;
1938
2057
  let i = !1, a = {};
@@ -1941,7 +2060,7 @@ function $r(e, t, n) {
1941
2060
  a[e] = o.map((e) => {
1942
2061
  let t = e, n = $(t, "typeName");
1943
2062
  t.componentName === "core:data" && n && (r.set(n, t), s = t);
1944
- let a = $r(ti(ei(t, r), s), r, s);
2063
+ let a = hi(_i(gi(t, r), s), r, s);
1945
2064
  return a !== e && (i = !0), a;
1946
2065
  });
1947
2066
  }
@@ -1950,8 +2069,8 @@ function $r(e, t, n) {
1950
2069
  slots: a
1951
2070
  } : e;
1952
2071
  }
1953
- function ei(e, t) {
1954
- if (!Zr.has(e.componentName)) return e;
2072
+ function gi(e, t) {
2073
+ if (!pi.has(e.componentName)) return e;
1955
2074
  let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
1956
2075
  if (!r || e.properties.queryArguments !== void 0) return e;
1957
2076
  let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
@@ -1960,7 +2079,7 @@ function ei(e, t) {
1960
2079
  properties: a
1961
2080
  };
1962
2081
  }
1963
- function ti(e, t) {
2082
+ function _i(e, t) {
1964
2083
  if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
1965
2084
  let n = { ...e.properties };
1966
2085
  if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
@@ -1977,9 +2096,8 @@ function $(e, t) {
1977
2096
  let n = e.properties?.[t];
1978
2097
  return typeof n == "string" && n.length > 0 ? n : void 0;
1979
2098
  }
1980
- //#endregion
1981
- //#region src/stageQueryBindings.tsx
1982
- function ni(e) {
2099
+ // src/stageQueryBindings.tsx
2100
+ function vi(e) {
1983
2101
  let t = /* @__PURE__ */ new Set(), n = (e) => {
1984
2102
  if (Array.isArray(e)) {
1985
2103
  e.forEach(n);
@@ -1987,11 +2105,7 @@ function ni(e) {
1987
2105
  }
1988
2106
  if (typeof e != "object" || !e) return;
1989
2107
  let r = e;
1990
- if (r.kind === "queryResult" && typeof r.query == "string" && r.query.length > 0) {
1991
- t.add(r.query);
1992
- return;
1993
- }
1994
- Object.values(r).forEach(n);
2108
+ r.kind === "queryResult" && typeof r.query == "string" && r.query.length > 0 ? t.add(r.query) : Object.values(r).forEach(n);
1995
2109
  }, r = (e) => {
1996
2110
  let t = e;
1997
2111
  t.properties && Object.values(t.properties).forEach(n);
@@ -1999,7 +2113,7 @@ function ni(e) {
1999
2113
  };
2000
2114
  return r(e), [...t];
2001
2115
  }
2002
- function ri(e) {
2116
+ function yi(e) {
2003
2117
  let t = /* @__PURE__ */ new Map(), n = (e, t) => {
2004
2118
  let n = e.properties?.[t];
2005
2119
  return typeof n == "string" && n.length > 0 ? n : void 0;
@@ -2018,8 +2132,8 @@ function ri(e) {
2018
2132
  };
2019
2133
  return r(e), [...t.values()];
2020
2134
  }
2021
- function ii({ source: e }) {
2022
- let { routes: t, routesReady: n, parameters: r, session: i } = B(), a = e.by ? r[e.by] || i[e.by] : void 0, o = s(() => e.by ? a ? { [e.by]: a } : {} : {
2135
+ function bi({ source: e }) {
2136
+ let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = e.by ? r[e.by] || i[e.by] : void 0, o = s(() => e.by ? a ? { [e.by]: a } : {} : {
2023
2137
  ...i,
2024
2138
  ...r
2025
2139
  }, [
@@ -2028,7 +2142,7 @@ function ii({ source: e }) {
2028
2142
  i,
2029
2143
  e.by
2030
2144
  ]);
2031
- return V({
2145
+ return B({
2032
2146
  scope: `data:${e.typeName}`,
2033
2147
  name: e.query,
2034
2148
  alias: e.typeName,
@@ -2038,12 +2152,12 @@ function ii({ source: e }) {
2038
2152
  list: !0
2039
2153
  }), null;
2040
2154
  }
2041
- function ai({ name: e }) {
2042
- let { routes: t, routesReady: n, parameters: r, session: i } = B(), a = s(() => ({
2155
+ function xi({ name: e }) {
2156
+ let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = s(() => ({
2043
2157
  ...i,
2044
2158
  ...r
2045
2159
  }), [r, i]);
2046
- return V({
2160
+ return B({
2047
2161
  scope: `binding:${e}`,
2048
2162
  name: e,
2049
2163
  route: t?.queries?.[e],
@@ -2052,135 +2166,162 @@ function ai({ name: e }) {
2052
2166
  list: !0
2053
2167
  }), null;
2054
2168
  }
2055
- function oi({ element: e }) {
2056
- let t = s(() => ni(e), [e]), n = s(() => ri(e), [e]);
2057
- return /* @__PURE__ */ L(Re, { children: [t.map((e) => /* @__PURE__ */ I(ai, { name: e }, e)), n.map((e) => /* @__PURE__ */ I(ii, { source: e }, e.typeName))] });
2169
+ function Si({ element: e }) {
2170
+ let t = s(() => vi(e), [e]), n = s(() => yi(e), [e]);
2171
+ return /* @__PURE__ */ I(Ve, { children: [t.map((e) => /* @__PURE__ */ F(xi, { name: e }, e)), n.map((e) => /* @__PURE__ */ F(bi, { source: e }, e.typeName))] });
2058
2172
  }
2059
- function si(e) {
2173
+ function Ci(e) {
2060
2174
  let t = /* @__PURE__ */ new Set(), n = [];
2061
- for (let r of e) for (let e of r.contributions ?? []) {
2062
- if (e.contributionPointName !== "Navigation") continue;
2063
- let r = e.content?.properties ?? {}, i = r.label, a = r.targetScreen;
2064
- if (typeof i != "string" || typeof a != "string") continue;
2065
- let o = Array.isArray(r.hierarchy) ? r.hierarchy.filter((e) => typeof e == "string") : [], s = JSON.stringify([
2066
- o,
2067
- a,
2068
- i
2069
- ]);
2070
- if (t.has(s)) continue;
2071
- t.add(s);
2072
- let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = ui(r.destination) ? r.destination : void 0;
2073
- n.push({
2074
- label: i,
2075
- targetScreen: a,
2076
- hierarchy: o,
2077
- order: c,
2078
- ...typeof r.icon == "string" ? { icon: r.icon } : {},
2079
- ...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
2080
- ...l && di(l) ? { destination: l } : {}
2081
- });
2175
+ for (let r of e.flatMap((e) => e.contributions ?? [])) {
2176
+ let e = Ti(r);
2177
+ if (!e) continue;
2178
+ let i = Ei(e);
2179
+ t.has(i) || (t.add(i), n.push(e));
2082
2180
  }
2083
2181
  return n.map((e, t) => ({
2084
2182
  entry: e,
2085
2183
  index: t
2086
2184
  })).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
2087
2185
  }
2088
- function ci(e) {
2186
+ function wi(e) {
2089
2187
  let t = {
2090
2188
  label: "",
2091
2189
  children: []
2092
2190
  };
2093
2191
  for (let n of e) {
2094
- let e = t;
2095
- for (let t of n.hierarchy) {
2096
- let n = e.children.find((e) => e.screen === void 0 && e.label === t);
2097
- n || (n = {
2098
- label: t,
2099
- children: []
2100
- }, e.children.push(n)), e = n;
2101
- }
2102
- e.children.push({
2103
- label: n.label,
2104
- screen: n.targetScreen,
2105
- ...n.icon ? { icon: n.icon } : {},
2106
- ...n.presentation ? { presentation: n.presentation } : {},
2107
- ...n.destination ? { destination: n.destination } : {},
2108
- children: []
2109
- });
2192
+ let e = n.hierarchy.reduce((e, t) => Di(e, t, !1), t);
2193
+ (n.group ? Di(e, n.group, !0) : e).children.push(Oi(n));
2110
2194
  }
2111
2195
  return t.children;
2112
2196
  }
2113
- function li(e, t) {
2197
+ function Ti(e) {
2198
+ if (e.contributionPointName !== "Navigation") return;
2199
+ let t = e.content?.properties ?? {}, n = t.label, r = t.targetScreen;
2200
+ if (typeof n != "string" || typeof r != "string") return;
2201
+ let i = Array.isArray(t.hierarchy) ? t.hierarchy.filter((e) => typeof e == "string") : [], a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
2202
+ return {
2203
+ label: n,
2204
+ targetScreen: r,
2205
+ hierarchy: i,
2206
+ order: a,
2207
+ ...Ai({
2208
+ id: ki(t.id),
2209
+ group: ki(t.group),
2210
+ icon: ki(t.icon),
2211
+ presentation: ki(t.presentation),
2212
+ destination: Mi(o) && Ni(o) ? o : void 0
2213
+ })
2214
+ };
2215
+ }
2216
+ function Ei(e) {
2217
+ return e.id === void 0 ? JSON.stringify([
2218
+ e.hierarchy,
2219
+ e.targetScreen,
2220
+ e.label
2221
+ ]) : JSON.stringify(["id", e.id]);
2222
+ }
2223
+ function Di(e, t, n) {
2224
+ let r = e.children.find((e) => e.screen === void 0 && e.section === !0 === n && e.label === t);
2225
+ if (r) return r;
2226
+ let i = n ? {
2227
+ label: t,
2228
+ section: !0,
2229
+ children: []
2230
+ } : {
2231
+ label: t,
2232
+ children: []
2233
+ };
2234
+ return e.children.push(i), i;
2235
+ }
2236
+ function Oi(e) {
2237
+ return {
2238
+ label: e.label,
2239
+ ...Ai({ id: e.id || void 0 }),
2240
+ screen: e.targetScreen,
2241
+ ...Ai({
2242
+ icon: e.icon || void 0,
2243
+ presentation: e.presentation || void 0,
2244
+ destination: e.destination
2245
+ }),
2246
+ children: []
2247
+ };
2248
+ }
2249
+ function ki(e) {
2250
+ return typeof e == "string" ? e : void 0;
2251
+ }
2252
+ function Ai(e) {
2253
+ return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
2254
+ }
2255
+ function ji(e, t) {
2114
2256
  for (let n of e) {
2115
2257
  if (n.screen === t) return [n.label];
2116
- let e = li(n.children, t);
2117
- if (e.length > 0) return [n.label, ...e];
2258
+ let e = ji(n.children, t);
2259
+ if (e.length > 0) return n.section ? e : [n.label, ...e];
2118
2260
  }
2119
2261
  return [];
2120
2262
  }
2121
- function ui(e) {
2263
+ function Mi(e) {
2122
2264
  return typeof e == "object" && !!e && !Array.isArray(e);
2123
2265
  }
2124
- function di(e) {
2266
+ function Ni(e) {
2125
2267
  return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
2126
2268
  }
2127
- function fi(e, t, n) {
2269
+ function Pi(e, t, n) {
2128
2270
  return e.filter((e) => !t.has(e.name)).map((e) => ({
2129
2271
  label: e.name,
2130
2272
  targetScreen: e.name,
2131
2273
  hierarchy: e.path && e.path.length > 0 ? [...e.path] : [n]
2132
2274
  }));
2133
2275
  }
2134
- //#endregion
2135
- //#region src/blueprint.ts
2136
- var pi = "Stage:locale", mi = "Stage:themeToggle", hi = "Cratis.Components", gi = "PrimeReact", _i = /* @__PURE__ */ new Map();
2137
- function vi(e) {
2138
- return Ae(e).packages.includes(gi);
2276
+ // src/blueprint.ts
2277
+ var Fi = "Stage:locale", Ii = "Stage:themeToggle", Li = "Cratis.Components", Ri = "PrimeReact", zi = /* @__PURE__ */ new Map();
2278
+ function Bi(e) {
2279
+ return Ne(e).packages.includes(Ri);
2139
2280
  }
2140
- function yi(e, t) {
2141
- _i.set(e, t);
2281
+ function Vi(e, t) {
2282
+ zi.set(e, t);
2142
2283
  }
2143
- function bi(e) {
2144
- let t = Ae(e);
2284
+ function Hi(e) {
2285
+ let t = Ne(e);
2145
2286
  return {
2146
2287
  ...t,
2147
2288
  name: e?.length ? t.name : "Stage",
2148
2289
  packages: x(t.packages, {
2149
- baseline: hi,
2150
- catalog: { [Ce]: g.Blueprint }
2290
+ baseline: Li,
2291
+ catalog: { [Ee]: g.Blueprint }
2151
2292
  })
2152
2293
  };
2153
2294
  }
2154
- var xi = {
2155
- ...be,
2156
- [hi]: et.components
2295
+ var Ui = {
2296
+ ...Ce,
2297
+ [Li]: rt.components
2157
2298
  };
2158
- function Si(e) {
2159
- let t = [..._i.values()].reduce((e, t) => ({
2299
+ function Wi(e) {
2300
+ let t = [...zi.values()].reduce((e, t) => ({
2160
2301
  ...e,
2161
2302
  ...t.components
2162
2303
  }), {});
2163
2304
  return {
2164
- ...le,
2165
- ...$e,
2305
+ ...k,
2306
+ ...nt,
2166
2307
  ...t,
2167
- ...Se,
2168
- ...ke,
2308
+ ...Te,
2309
+ ...Me,
2169
2310
  ...e
2170
2311
  };
2171
2312
  }
2172
- function Ci(e) {
2173
- let t = Object.fromEntries([..._i].map(([e, t]) => [e, t.declared]));
2313
+ function Gi(e) {
2314
+ let t = Object.fromEntries([...zi].map(([e, t]) => [e, t.declared]));
2174
2315
  return {
2175
2316
  ...e,
2176
- ...xi,
2317
+ ...Ui,
2177
2318
  ...t
2178
2319
  };
2179
2320
  }
2180
- var wi = "Stage:navigationTree";
2181
- function Ti(e, t, n) {
2321
+ var Ki = "Stage:navigationTree";
2322
+ function qi(e, t, n) {
2182
2323
  let r = t?.title ?? "Cratis Stage";
2183
- return F(e, M.Logo, {
2324
+ return N(e, j.Logo, {
2184
2325
  label: r,
2185
2326
  initials: r.slice(0, 1).toUpperCase() || "S",
2186
2327
  targetScreen: n,
@@ -2189,40 +2330,40 @@ function Ti(e, t, n) {
2189
2330
  ...t?.showName === void 0 ? {} : { showName: t.showName }
2190
2331
  });
2191
2332
  }
2192
- function Ei(e, t, n, r, i, a = !1, o = !0) {
2193
- let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = si(e), u = fi(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = ci([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => Oe({
2333
+ function Ji(e, t, n, r, i, a = !1, o = !0) {
2334
+ let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = Ci(e), u = Pi(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = wi([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => je({
2194
2335
  label: e.name,
2195
2336
  targetScreen: e.name,
2196
2337
  icon: "pi pi-table",
2197
2338
  group: "Screens",
2198
2339
  order: n
2199
- }, t)), p = li(ci(l), t), m = e.find((e) => e.name === t)?.path?.length ? li(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? F("menu-hierarchy", wi, {
2340
+ }, t)), p = ji(wi(l), t), m = e.find((e) => e.name === t)?.path?.length ? ji(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? N("menu-hierarchy", Ki, {
2200
2341
  nodes: d,
2201
2342
  activeScreen: t
2202
- }) : F("menu-screens", M.Menu, {
2343
+ }) : N("menu-screens", j.Menu, {
2203
2344
  title: "Screens",
2204
2345
  label: "Screens"
2205
2346
  }, { items: f }), _ = [];
2206
- n.length > 1 && _.push(F("topbar-locale", pi, {
2347
+ n.length > 1 && _.push(N("topbar-locale", Fi, {
2207
2348
  locales: n,
2208
2349
  locale: r
2209
- })), _.push(F("topbar-theme", mi, { label: "Theme" }));
2350
+ })), _.push(N("topbar-theme", Ii, {}));
2210
2351
  let v = { regionNavigation: a };
2211
2352
  return {
2212
- [N.Topbar]: [F("topbar", M.Topbar, v, {
2213
- logo: [Ti("topbar-logo", i, s)],
2353
+ [M.Topbar]: [N("topbar", j.Topbar, v, {
2354
+ logo: [qi("topbar-logo", i, s)],
2214
2355
  end: _
2215
2356
  })],
2216
- [N.Sidebar]: [F("sidebar", M.Sidebar, v, { logo: [Ti("sidebar-logo", i, s)] })],
2217
- ...a ? {} : { [N.Menu]: [g] },
2218
- [N.Breadcrumb]: [F("breadcrumb", M.Breadcrumb, {
2357
+ [M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [qi("sidebar-logo", i, s)] })],
2358
+ ...a ? {} : { [M.Menu]: [g] },
2359
+ [M.Breadcrumb]: [N("breadcrumb", j.Breadcrumb, {
2219
2360
  homeTargetScreen: s,
2220
2361
  items: (h.length > 0 ? h : [t]).map((e) => ({ label: e }))
2221
2362
  })],
2222
- ...o ? { [N.Footer]: [F("footer", M.Footer, { text: `${c} · rendered from your model` })] } : {},
2223
- [N.ConfigPanel]: [F(M.ConfigPanel, M.ConfigPanel, {
2363
+ ...o ? { [M.Footer]: [N("footer", j.Footer, { text: `${c} · rendered from your model` })] } : {},
2364
+ [M.ConfigPanel]: [N(j.ConfigPanel, j.ConfigPanel, {
2224
2365
  title: "Settings",
2225
- themes: P.map((e) => ({
2366
+ themes: De.map((e) => ({
2226
2367
  name: e.name,
2227
2368
  label: e.name,
2228
2369
  isDark: e.isDark ?? !1
@@ -2230,56 +2371,61 @@ function Ei(e, t, n, r, i, a = !1, o = !0) {
2230
2371
  })]
2231
2372
  };
2232
2373
  }
2233
- function Di(e) {
2374
+ function Yi(e) {
2234
2375
  return `#/${encodeURIComponent(e)}`;
2235
2376
  }
2236
- //#endregion
2237
- //#region src/StageChrome.tsx
2238
- var Oi = t({
2377
+ // src/externalRouteHref.ts
2378
+ function Xi(e) {
2379
+ try {
2380
+ let t = new URL(e ?? "");
2381
+ return t.protocol === "http:" || t.protocol === "https:" ? e : void 0;
2382
+ } catch {
2383
+ return;
2384
+ }
2385
+ }
2386
+ // src/StageChrome.tsx
2387
+ var Zi = t({
2239
2388
  locales: [],
2240
2389
  locale: "",
2241
2390
  setLocale: () => void 0,
2242
2391
  activity: ""
2243
2392
  });
2244
- function ki({ state: e, children: t }) {
2245
- return /* @__PURE__ */ I(Oi.Provider, {
2393
+ function Qi({ state: e, children: t }) {
2394
+ return /* @__PURE__ */ F(Zi.Provider, {
2246
2395
  value: e,
2247
2396
  children: t
2248
2397
  });
2249
2398
  }
2250
- var Ai = "Stage:activity";
2251
- function ji() {
2252
- let { locales: e, locale: t, setLocale: n } = i(Oi);
2253
- return e.length < 2 ? null : /* @__PURE__ */ I("select", {
2399
+ var $i = "Stage:activity";
2400
+ function ea() {
2401
+ let { locales: e, locale: t, setLocale: n } = i(Zi);
2402
+ return e.length < 2 ? null : /* @__PURE__ */ F("select", {
2254
2403
  className: "stage-locale",
2255
2404
  "aria-label": "Locale",
2256
2405
  value: t,
2257
2406
  onChange: (e) => n(e.target.value),
2258
- children: e.map((e) => /* @__PURE__ */ I("option", {
2407
+ children: e.map((e) => /* @__PURE__ */ F("option", {
2259
2408
  value: e,
2260
2409
  children: e
2261
2410
  }, e))
2262
2411
  });
2263
2412
  }
2264
- function Mi({ element: e }) {
2265
- let { config: t, setThemeName: n, setColorScheme: r } = je(), i = typeof e.properties.label == "string" ? e.properties.label : "Theme", a = P.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === j.Dark, o = P.find((e) => (e.isDark ?? !1) !== a);
2266
- if (!o) return null;
2267
- let s = a ? "Switch to a light theme" : "Switch to a dark theme";
2268
- return /* @__PURE__ */ L("div", {
2413
+ function ta({ element: e }) {
2414
+ let { config: t, setThemeName: n, setColorScheme: r } = Pe(), i = De.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === be.Dark, a = De.find((e) => (e.isDark ?? !1) !== i);
2415
+ if (!a) return null;
2416
+ let o = i ? "Switch to a light theme" : "Switch to a dark theme";
2417
+ return /* @__PURE__ */ F("div", {
2269
2418
  className: "stage-theme-toggle",
2270
2419
  "data-scene-id": e.id,
2271
- children: [/* @__PURE__ */ I("h3", {
2272
- className: "layout-config-section-title",
2273
- children: i
2274
- }), /* @__PURE__ */ I("button", {
2420
+ children: /* @__PURE__ */ F("button", {
2275
2421
  type: "button",
2276
2422
  className: "stage-theme-toggle__button",
2277
- "aria-label": s,
2278
- title: s,
2423
+ "aria-label": o,
2424
+ title: o,
2279
2425
  onClick: () => {
2280
- n(o.name), r(o.isDark ? j.Dark : j.Light);
2426
+ n(a.name), r(a.isDark ? be.Dark : be.Light);
2281
2427
  },
2282
- children: /* @__PURE__ */ I("svg", {
2428
+ children: /* @__PURE__ */ F("svg", {
2283
2429
  width: "18",
2284
2430
  height: "18",
2285
2431
  viewBox: "0 0 24 24",
@@ -2289,43 +2435,43 @@ function Mi({ element: e }) {
2289
2435
  strokeLinecap: "round",
2290
2436
  strokeLinejoin: "round",
2291
2437
  "aria-hidden": "true",
2292
- children: a ? /* @__PURE__ */ L(Re, { children: [/* @__PURE__ */ I("circle", {
2438
+ children: i ? /* @__PURE__ */ I(Ve, { children: [/* @__PURE__ */ F("circle", {
2293
2439
  cx: "12",
2294
2440
  cy: "12",
2295
2441
  r: "4"
2296
- }), /* @__PURE__ */ I("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })] }) : /* @__PURE__ */ I("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
2442
+ }), /* @__PURE__ */ F("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })] }) : /* @__PURE__ */ F("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
2297
2443
  })
2298
- })]
2444
+ })
2299
2445
  });
2300
2446
  }
2301
- function Ni({ element: e }) {
2447
+ function na({ element: e }) {
2302
2448
  let t = e.properties ?? {};
2303
- return /* @__PURE__ */ I("nav", {
2449
+ return /* @__PURE__ */ F("nav", {
2304
2450
  className: "stage-navigation-tree",
2305
2451
  "aria-label": "Navigation",
2306
2452
  "data-scene-id": e.id,
2307
- children: /* @__PURE__ */ I(Pi, {
2453
+ children: /* @__PURE__ */ F(ra, {
2308
2454
  nodes: t.nodes ?? [],
2309
2455
  activeScreen: t.activeScreen
2310
2456
  })
2311
2457
  });
2312
2458
  }
2313
- function Pi({ nodes: e, activeScreen: t }) {
2314
- return /* @__PURE__ */ I("ul", {
2459
+ function ra({ nodes: e, activeScreen: t }) {
2460
+ return /* @__PURE__ */ F("ul", {
2315
2461
  role: "tree",
2316
- children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ L("li", {
2462
+ children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ I("li", {
2317
2463
  role: "treeitem",
2318
2464
  "aria-expanded": "true",
2319
- children: [/* @__PURE__ */ I("span", {
2465
+ children: [/* @__PURE__ */ F("span", {
2320
2466
  className: "stage-navigation-group",
2321
2467
  children: e.label
2322
- }), /* @__PURE__ */ I(Pi, {
2468
+ }), /* @__PURE__ */ F(ra, {
2323
2469
  nodes: e.children,
2324
2470
  activeScreen: t
2325
2471
  })]
2326
- }, e.label) : /* @__PURE__ */ I("li", {
2472
+ }, e.label) : /* @__PURE__ */ F("li", {
2327
2473
  role: "treeitem",
2328
- children: /* @__PURE__ */ I(Fi, {
2474
+ children: /* @__PURE__ */ F(ia, {
2329
2475
  node: e,
2330
2476
  screen: e.screen,
2331
2477
  activeScreen: t
@@ -2333,56 +2479,60 @@ function Pi({ nodes: e, activeScreen: t }) {
2333
2479
  }, `${e.screen}:${e.label}`))
2334
2480
  });
2335
2481
  }
2336
- function Fi({ node: e, screen: t, activeScreen: n }) {
2337
- let r = i(O), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && r && !s && di(o) ? (e) => {
2482
+ function ia({ node: e, screen: t, activeScreen: n }) {
2483
+ let r = i(O), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external", c = o && r && !s && Ni(o) ? (e) => {
2338
2484
  e.preventDefault(), r.navigate(o);
2339
- } : void 0;
2340
- return /* @__PURE__ */ L("a", {
2341
- href: s ? o.route : Di(t),
2342
- rel: s ? "noreferrer" : void 0,
2485
+ } : void 0, l = s ? Xi(o.route) : Yi(t), u = s && l === void 0;
2486
+ return /* @__PURE__ */ I("a", {
2487
+ href: l,
2488
+ rel: s && !u ? "noreferrer" : void 0,
2489
+ "aria-disabled": u ? "true" : void 0,
2343
2490
  "aria-current": t === n ? "page" : void 0,
2344
2491
  "aria-label": a === "icon" ? e.label : void 0,
2345
2492
  "data-presentation": e.presentation,
2346
2493
  "data-icon": e.icon,
2347
2494
  onClick: c,
2348
- children: [a !== "text" && e.icon && /* @__PURE__ */ I("span", {
2495
+ children: [a !== "text" && e.icon && /* @__PURE__ */ F("span", {
2349
2496
  className: "stage-navigation-icon",
2350
2497
  "aria-hidden": "true",
2351
2498
  "data-icon-name": e.icon
2352
2499
  }), a !== "icon" && e.label]
2353
2500
  });
2354
2501
  }
2355
- function Ii({ element: e }) {
2356
- let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(O), r = ge(), a = B(), o = n?.outlets[t], s = o && r ? r.screens[o] : void 0, c = e.properties.closable === !0;
2357
- return /* @__PURE__ */ L("div", {
2502
+ function aa({ element: e }) {
2503
+ let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(O), r = _e(), a = z(), o = n?.outlets[t], s = o && r ? r.screens[o] : void 0, c = e.properties.closable === !0;
2504
+ return /* @__PURE__ */ I("div", {
2358
2505
  "data-scene-outlet": t,
2359
2506
  "data-scene-outlet-screen": o,
2360
- children: [c && o && /* @__PURE__ */ I("div", {
2507
+ children: [c && o && /* @__PURE__ */ F("div", {
2361
2508
  className: "scene-outlet-bar",
2362
- children: /* @__PURE__ */ I("button", {
2509
+ children: /* @__PURE__ */ F("button", {
2363
2510
  type: "button",
2364
2511
  className: "scene-outlet-close",
2365
2512
  "aria-label": "Close",
2366
2513
  onClick: () => n?.closeOutlet(t),
2367
2514
  children: "Close"
2368
2515
  })
2369
- }), s && r && /* @__PURE__ */ I(ie, {
2516
+ }), s && r && /* @__PURE__ */ F(Pn, {
2370
2517
  element: s,
2371
- registry: r.registry,
2372
- resolveBinding: a.resolveBinding
2518
+ children: /* @__PURE__ */ F(D, {
2519
+ element: s,
2520
+ registry: r.registry,
2521
+ resolveBinding: a.resolveBinding
2522
+ })
2373
2523
  })]
2374
2524
  });
2375
2525
  }
2376
- function Li() {
2377
- let { activity: e } = i(Oi);
2378
- return e ? /* @__PURE__ */ I("p", {
2526
+ function oa() {
2527
+ let { activity: e } = i(Zi);
2528
+ return e ? /* @__PURE__ */ F("p", {
2379
2529
  className: "stage-activity",
2380
2530
  role: "status",
2381
2531
  children: e
2382
2532
  }) : null;
2383
2533
  }
2384
- function Ri() {
2385
- let e = _e(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
2534
+ function sa() {
2535
+ let e = ve(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
2386
2536
  return a(() => {
2387
2537
  let r = e?.isDark ? "dark" : "light";
2388
2538
  document.documentElement.setAttribute("data-scene-color-scheme", r), document.body.setAttribute("data-scene-color-scheme", r), document.body.style.backgroundColor = t ?? "", document.body.style.color = n ?? "";
@@ -2392,45 +2542,40 @@ function Ri() {
2392
2542
  n
2393
2543
  ]), null;
2394
2544
  }
2395
- var zi = {
2396
- [pi]: ji,
2397
- [mi]: Mi,
2398
- [wi]: Ni,
2399
- [Ai]: Li,
2400
- "core:outlet": Ii
2401
- }, Bi = [
2545
+ var ca = {
2546
+ [Fi]: ea,
2547
+ [Ii]: ta,
2548
+ [Ki]: na,
2549
+ [$i]: oa,
2550
+ "core:outlet": aa
2551
+ }, la = [
2402
2552
  "navigationMode",
2403
2553
  "menuTheme",
2404
2554
  "showFooter"
2405
- ], Vi = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2406
- function Hi(e, t, n = !1) {
2555
+ ], ua = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2556
+ function da(e, t, n = !1) {
2407
2557
  let r = [], i = t.options ?? {}, a = {
2408
2558
  showFooter: !0,
2409
2559
  followsSystem: !1,
2410
2560
  problems: r
2411
2561
  };
2412
- for (let [e, n] of Object.entries(i)) {
2413
- if (!Bi.includes(e)) {
2414
- r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Bi.join(", ")}.`);
2415
- continue;
2416
- }
2417
- if (e === "navigationMode") {
2418
- let e = Ee.find((e) => e === n);
2419
- e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${Ee.join(", ")}.`);
2420
- } else if (e === "menuTheme") {
2421
- let e = De.find((e) => e === n);
2422
- e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${De.join(", ")}.`);
2423
- } else typeof n == "boolean" ? a.showFooter = n : r.push(`Option 'showFooter' is '${String(n)}'; expected true or false.`);
2424
- }
2562
+ for (let [e, n] of Object.entries(i)) if (!la.includes(e)) r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${la.join(", ")}.`);
2563
+ else if (e === "navigationMode") {
2564
+ let e = ke.find((e) => e === n);
2565
+ e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${ke.join(", ")}.`);
2566
+ } else if (e === "menuTheme") {
2567
+ let e = Ae.find((e) => e === n);
2568
+ e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${Ae.join(", ")}.`);
2569
+ } else typeof n == "boolean" ? a.showFooter = n : r.push(`Option 'showFooter' is '${String(n)}'; expected true or false.`);
2425
2570
  let o = e?.appearance;
2426
2571
  if (o?.colorScheme !== void 0) {
2427
2572
  a.followsSystem = o.colorScheme === u.System;
2428
2573
  let e = a.followsSystem ? n : o.colorScheme === u.Dark;
2429
- a.colorScheme = e ? j.Dark : j.Light, a.themeName = P.find((t) => (t.isDark ?? !1) === e)?.name;
2574
+ a.colorScheme = e ? be.Dark : be.Light, a.themeName = De.find((t) => (t.isDark ?? !1) === e)?.name;
2430
2575
  }
2431
- return o?.accent !== void 0 && (Vi.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
2576
+ return o?.accent !== void 0 && (ua.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
2432
2577
  }
2433
- function Ui(e, t) {
2578
+ function fa(e, t) {
2434
2579
  if (e?.root === void 0) return [];
2435
2580
  let n = /* @__PURE__ */ new Set([
2436
2581
  v.RootTemplateUnknown,
@@ -2442,7 +2587,7 @@ function Ui(e, t) {
2442
2587
  ]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
2443
2588
  return r.length === 0 && t.origin !== y.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
2444
2589
  }
2445
- function Wi(e) {
2590
+ function pa(e) {
2446
2591
  let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
2447
2592
  0,
2448
2593
  2,
@@ -2450,7 +2595,7 @@ function Wi(e) {
2450
2595
  ].map((e) => parseInt(t.slice(e, e + 2), 16));
2451
2596
  return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
2452
2597
  }
2453
- function Gi(e, t) {
2598
+ function ma(e, t) {
2454
2599
  if (t === void 0) return e;
2455
2600
  let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
2456
2601
  0,
@@ -2462,20 +2607,19 @@ function Gi(e, t) {
2462
2607
  tokens: {
2463
2608
  ...e.tokens,
2464
2609
  "primary.color": t,
2465
- "primary.contrastColor": Wi(t),
2610
+ "primary.contrastColor": pa(t),
2466
2611
  "focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
2467
2612
  }
2468
2613
  }));
2469
2614
  }
2470
- //#endregion
2471
- //#region src/StageShellSettings.tsx
2472
- var Ki = "(prefers-color-scheme: dark)";
2473
- function qi() {
2615
+ // src/StageShellSettings.tsx
2616
+ var ha = "(prefers-color-scheme: dark)";
2617
+ function ga() {
2474
2618
  return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
2475
2619
  }
2476
- function Ji({ settings: e, onSystemSchemeChange: t }) {
2477
- let n = c(je());
2478
- n.current = je();
2620
+ function _a({ settings: e, onSystemSchemeChange: t }) {
2621
+ let n = c(Pe());
2622
+ n.current = Pe();
2479
2623
  let { mode: r, menuTheme: i, colorScheme: o, themeName: s } = e;
2480
2624
  return a(() => {
2481
2625
  let { setMode: e, setMenuTheme: t, setColorScheme: a, setThemeName: c } = n.current;
@@ -2487,16 +2631,15 @@ function Ji({ settings: e, onSystemSchemeChange: t }) {
2487
2631
  s
2488
2632
  ]), a(() => {
2489
2633
  if (!e.followsSystem || !globalThis.matchMedia || !t) return;
2490
- let n = globalThis.matchMedia(Ki), r = (e) => t(e.matches);
2634
+ let n = globalThis.matchMedia(ha), r = (e) => t(e.matches);
2491
2635
  return n.addEventListener("change", r), () => n.removeEventListener("change", r);
2492
2636
  }, [e.followsSystem, t]), null;
2493
2637
  }
2494
- //#endregion
2495
- //#region src/stageNavigationModel.ts
2496
- function Yi(e) {
2638
+ // src/stageNavigationModel.ts
2639
+ function va(e) {
2497
2640
  return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
2498
2641
  }
2499
- function Xi(e) {
2642
+ function ya(e) {
2500
2643
  let t = /* @__PURE__ */ new Map();
2501
2644
  for (let n of e) {
2502
2645
  let e = (n.path ?? []).join(".");
@@ -2509,42 +2652,41 @@ function Xi(e) {
2509
2652
  return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
2510
2653
  };
2511
2654
  }
2512
- function Zi(e) {
2655
+ function ba(e) {
2513
2656
  return (t) => e.find((e) => e.name === t)?.path?.[0];
2514
2657
  }
2515
- function Qi(e, t, n) {
2658
+ function xa(e, t, n) {
2516
2659
  let r = e.navigation ?? {
2517
2660
  application: { regions: [] },
2518
2661
  modules: []
2519
2662
  };
2520
2663
  return {
2521
2664
  structure: e.structure ?? { modules: [] },
2522
- navigation: n ? $i(r, n) : r,
2523
- screenFor: Xi(e.screens),
2524
- moduleOf: Zi(e.screens),
2665
+ navigation: n ? Sa(r, n) : r,
2666
+ screenFor: ya(e.screens),
2667
+ moduleOf: ba(e.screens),
2525
2668
  ...t ? { isVisible: t } : {}
2526
2669
  };
2527
2670
  }
2528
- function $i(e, t) {
2529
- return typeof e == "string" ? ee(e, t) : Array.isArray(e) ? e.map((e) => $i(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, $i(n, t)])) : e;
2671
+ function Sa(e, t) {
2672
+ return typeof e == "string" ? ee(e, t) : Array.isArray(e) ? e.map((e) => Sa(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Sa(n, t)])) : e;
2530
2673
  }
2531
- //#endregion
2532
- //#region src/stageSlices.ts
2533
- function ea(e) {
2534
- return (t) => K(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
2674
+ // src/stageSlices.ts
2675
+ function Ca(e) {
2676
+ return (t) => G(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
2535
2677
  name: e.name,
2536
2678
  type: e.type === "text" || e.type === void 0 ? "string" : e.type,
2537
- label: ta(e.name),
2679
+ label: wa(e.name),
2538
2680
  required: e.required
2539
2681
  }));
2540
2682
  }
2541
- function ta(e) {
2683
+ function wa(e) {
2542
2684
  return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
2543
2685
  }
2544
- function na(e, t, n) {
2686
+ function Ta(e, t, n) {
2545
2687
  return { invoke: async (r, i, a) => {
2546
2688
  let o = a ?? r.slice(r.lastIndexOf(".") + 1);
2547
- if (!W(o)) return {
2689
+ if (!U(o)) return {
2548
2690
  succeeded: !1,
2549
2691
  message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
2550
2692
  };
@@ -2560,21 +2702,8 @@ function na(e, t, n) {
2560
2702
  };
2561
2703
  } };
2562
2704
  }
2563
- //#endregion
2564
- //#region src/standaloneScreenTemplates.ts
2565
- function ra(e) {
2566
- let t = new Set(e.map((e) => e.name));
2567
- return e.map((e) => {
2568
- let n = e.fitsSlot, r = n?.includes(".") ? n.slice(0, n.lastIndexOf(".")) : void 0;
2569
- return r !== void 0 && r !== e.name && t.has(r) ? {
2570
- ...e,
2571
- fitsSlot: "content"
2572
- } : e;
2573
- });
2574
- }
2575
- //#endregion
2576
- //#region src/withoutSeededSlots.ts
2577
- function ia(e, t) {
2705
+ // src/withoutSeededSlots.ts
2706
+ function Ea(e, t) {
2578
2707
  let n = /* @__PURE__ */ new Map();
2579
2708
  for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
2580
2709
  return e.map((e) => {
@@ -2590,9 +2719,8 @@ function ia(e, t) {
2590
2719
  };
2591
2720
  });
2592
2721
  }
2593
- //#endregion
2594
- //#region src/stageIcons.ts
2595
- var aa = /* @__PURE__ */ new Map([
2722
+ // src/stageIcons.ts
2723
+ var Da = /* @__PURE__ */ new Map([
2596
2724
  ["chart", "chart-column"],
2597
2725
  ["add", "plus"],
2598
2726
  ["dollar", "dollar-sign"],
@@ -2600,24 +2728,23 @@ var aa = /* @__PURE__ */ new Map([
2600
2728
  ["refresh", "refresh-cw"],
2601
2729
  ["invoice", "receipt-text"],
2602
2730
  ["batch", "layers"]
2603
- ]), oa = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), sa = A([{
2731
+ ]), Oa = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), ka = fe([{
2604
2732
  library: _,
2605
2733
  loadGlyph: async ({ key: e }) => {
2606
- let t = oa(e), n = aa.get(t) ?? t;
2607
- if (Object.hasOwn(tt, n)) return (await tt[n]())?.default;
2734
+ let t = Oa(e), n = Da.get(t) ?? t;
2735
+ if (Object.hasOwn(it, n)) return (await it[n]())?.default;
2608
2736
  }
2609
2737
  }]);
2610
- //#endregion
2611
- //#region src/App.tsx
2612
- function ca(e = {}) {
2613
- return Si({
2738
+ // src/App.tsx
2739
+ function Aa(e = {}) {
2740
+ return Wi({
2614
2741
  ...e,
2615
- ...Yr,
2616
- ...zi
2742
+ ...di,
2743
+ ...ca
2617
2744
  });
2618
2745
  }
2619
- function la(e, t) {
2620
- return F(`form-${e}-${t.name}`, Pr, {
2746
+ function ja(e, t) {
2747
+ return N(`form-${e}-${t.name}`, Jr, {
2621
2748
  command: t.forCommand,
2622
2749
  label: t.name,
2623
2750
  generationMode: t.generationMode,
@@ -2625,35 +2752,36 @@ function la(e, t) {
2625
2752
  fields: t.fields
2626
2753
  });
2627
2754
  }
2628
- function ua(e, t) {
2755
+ function Ma(e, t) {
2629
2756
  let n = e.screens[0];
2630
- return we(e, n, {
2631
- profile: bi(e.uiProfiles),
2632
- blueprintTemplates: ra(t?.length ? [...Te, ...t] : Te)
2757
+ return Oe(e, n, {
2758
+ profile: Hi(e.uiProfiles),
2759
+ blueprintTemplates: t?.length ? [...P, ...t] : P
2633
2760
  });
2634
2761
  }
2635
- function da(e, t, n, r, i, a, o = !0) {
2636
- let s = Yi(e.navigation), c = fa(e);
2762
+ function Na(e, t, n, r, i, a, o = !0) {
2763
+ let s = va(e.navigation), c = Pa(e);
2637
2764
  return {
2638
- profile: bi(e.uiProfiles),
2639
- catalog: Ci(r),
2640
- blueprintTemplates: ra(a?.length ? [...Te, ...a] : Te),
2641
- chrome: (r, i) => i === M.FullPageShell ? { [N.ConfigPanel]: Ei(e.screens, r.name, t, n, c, s, o)[N.ConfigPanel] } : Ei(e.screens, r.name, t, n, c, s, o),
2642
- form: la,
2643
- trailing: [F("activity", Ai)],
2765
+ profile: Hi(e.uiProfiles),
2766
+ catalog: Gi(r),
2767
+ blueprintTemplates: a?.length ? [...P, ...a] : P,
2768
+ namedTemplateOnly: !0,
2769
+ chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: Ji(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : Ji(e.screens, r.name, t, n, c, s, o),
2770
+ form: ja,
2771
+ trailing: [N("activity", $i)],
2644
2772
  decorate: (e) => {
2645
- let t = Qr(e);
2773
+ let t = mi(e);
2646
2774
  return i ? w(t, i) : t;
2647
2775
  }
2648
2776
  };
2649
2777
  }
2650
- function fa(e) {
2778
+ function Pa(e) {
2651
2779
  let t = e.navigation?.application.logo;
2652
2780
  if (t) return {
2653
2781
  title: t.title,
2654
2782
  image: t.image || void 0
2655
2783
  };
2656
- let n = bi(e.uiProfiles).identity;
2784
+ let n = Hi(e.uiProfiles).identity;
2657
2785
  if (!n?.name) return;
2658
2786
  let r = n.logo;
2659
2787
  return {
@@ -2663,22 +2791,22 @@ function fa(e) {
2663
2791
  showName: n.showName
2664
2792
  };
2665
2793
  }
2666
- function pa(e, t, n, r, i, a) {
2667
- let [o] = wr([t], ma(e));
2668
- return xe(e, o, da(e, n, r, i, void 0, a)).element;
2794
+ function Fa(e, t, n, r, i, a) {
2795
+ let [o] = Mr([t], Ia(e));
2796
+ return we(e, o, Na(e, n, r, i, void 0, a)).element;
2669
2797
  }
2670
- function ma(e) {
2798
+ function Ia(e) {
2671
2799
  return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
2672
2800
  }
2673
- function ha() {
2801
+ function La() {
2674
2802
  try {
2675
2803
  return globalThis.localStorage ?? null;
2676
2804
  } catch {
2677
2805
  return null;
2678
2806
  }
2679
2807
  }
2680
- function ga({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: o = "hash" } = {}) {
2681
- let c = ot(), [u, d] = l(), [f, p] = l(""), m = s(() => ca(e), [e, u]), h = st(), g = Xr();
2808
+ function Ra({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: o = "hash" } = {}) {
2809
+ let c = lt(), [u, d] = l(), [f, p] = l(""), m = s(() => Aa(e), [e, u]), h = ut(), g = fi();
2682
2810
  return a(() => {
2683
2811
  let e = new AbortController();
2684
2812
  return c.scene(e.signal).then((e) => d(r?.length ? {
@@ -2687,10 +2815,10 @@ function ga({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
2687
2815
  } : e)).catch((t) => {
2688
2816
  e.signal.aborted || p(t instanceof Error ? t.message : String(t));
2689
2817
  }), () => e.abort();
2690
- }, [c, r]), f ? /* @__PURE__ */ L("main", {
2818
+ }, [c, r]), f ? /* @__PURE__ */ I("main", {
2691
2819
  className: "stage-message",
2692
- children: [/* @__PURE__ */ I("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ I("p", { children: f })]
2693
- }) : u ? /* @__PURE__ */ I(_a, {
2820
+ children: [/* @__PURE__ */ F("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ F("p", { children: f })]
2821
+ }) : u ? /* @__PURE__ */ F(za, {
2694
2822
  scene: u,
2695
2823
  registry: m,
2696
2824
  routing: o,
@@ -2699,25 +2827,25 @@ function ga({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
2699
2827
  packageCatalog: t,
2700
2828
  screenTemplates: n,
2701
2829
  isVisible: i
2702
- }) : /* @__PURE__ */ I("main", {
2830
+ }) : /* @__PURE__ */ F("main", {
2703
2831
  className: "stage-message",
2704
- children: /* @__PURE__ */ I("h1", { children: "Preparing the Stage" })
2832
+ children: /* @__PURE__ */ F("h1", { children: "Preparing the Stage" })
2705
2833
  });
2706
2834
  }
2707
- function _a({ scene: e, registry: t, routing: n, routeState: i, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
2835
+ function za({ scene: e, registry: t, routing: n, routeState: i, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
2708
2836
  let d = s(() => {
2709
- if (cn(n), n === "hash") return de();
2837
+ if (dn(n), n === "hash") return A();
2710
2838
  let e = /^#\/(.+)$/.exec(globalThis.location.hash);
2711
- return e && globalThis.history.replaceState(null, "", `/${e[1]}`), ue(window, "/");
2712
- }, [n]), [f, p] = l(qi), m = e.screens[0]?.name ?? "", h = s(() => bi(e.uiProfiles), [e]), g = s(() => m ? ua(e, c) : void 0, [
2839
+ return e && globalThis.history.replaceState(null, "", `/${e[1]}`), de(window, "/");
2840
+ }, [n]), [f, p] = l(ga), m = e.screens[0]?.name ?? "", h = s(() => Hi(e.uiProfiles), [e]), g = s(() => m ? Ma(e, c) : void 0, [
2713
2841
  e,
2714
2842
  c,
2715
2843
  m
2716
- ]), _ = s(() => g ? Ui(h, g) : [], [h, g]), v = s(() => g ? Hi(h, g, f) : void 0, [
2844
+ ]), _ = s(() => g ? fa(h, g) : [], [h, g]), v = s(() => g ? da(h, g, f) : void 0, [
2717
2845
  h,
2718
2846
  g,
2719
2847
  f
2720
- ]), y = s(() => Gi(P, v?.accent), [v?.accent]), b = v?.showFooter ?? !0, x = s(() => da(e, a.locales, a.locale, o, a.dictionary, c, b), [
2848
+ ]), y = s(() => ma(De, v?.accent), [v?.accent]), b = v?.showFooter ?? !0, x = s(() => Na(e, a.locales, a.locale, o, a.dictionary, c, b), [
2721
2849
  e,
2722
2850
  a.locales,
2723
2851
  a.locale,
@@ -2725,37 +2853,37 @@ function _a({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
2725
2853
  o,
2726
2854
  c,
2727
2855
  b
2728
- ]), S = r((e) => p(e), []), C = s(() => Qi(e, u, a.dictionary), [
2856
+ ]), S = r((e) => p(e), []), C = s(() => xa(e, u, a.dictionary), [
2729
2857
  e,
2730
2858
  u,
2731
2859
  a.dictionary
2732
2860
  ]), w = s(() => ({
2733
2861
  ...e,
2734
- screens: wr(ia(e.screens, [
2862
+ screens: Mr(Ea(e.screens, [
2735
2863
  ...e.screenTemplates,
2736
2864
  ...e.dialogTemplates ?? [],
2737
- ...Te,
2865
+ ...P,
2738
2866
  ...c ?? []
2739
- ]), ma(e))
2867
+ ]), Ia(e))
2740
2868
  }), [e, c]);
2741
- return m ? _.length > 0 ? /* @__PURE__ */ L("main", {
2869
+ return m ? _.length > 0 ? /* @__PURE__ */ I("main", {
2742
2870
  className: "stage-message",
2743
2871
  role: "alert",
2744
2872
  "data-stage-startup-problem": "root-template",
2745
2873
  children: [
2746
- /* @__PURE__ */ I("h1", { children: "Unable to start this Stage" }),
2747
- /* @__PURE__ */ I("p", { children: "The ui profile's root template cannot be the application's shell." }),
2748
- /* @__PURE__ */ I("ul", { children: _.map((e) => /* @__PURE__ */ I("li", { children: e }, e)) })
2874
+ /* @__PURE__ */ F("h1", { children: "Unable to start this Stage" }),
2875
+ /* @__PURE__ */ F("p", { children: "The ui profile's root template cannot be the application's shell." }),
2876
+ /* @__PURE__ */ F("ul", { children: _.map((e) => /* @__PURE__ */ F("li", { children: e }, e)) })
2749
2877
  ]
2750
- }) : /* @__PURE__ */ I(ve, {
2878
+ }) : /* @__PURE__ */ F(ye, {
2751
2879
  application: w,
2752
2880
  composition: x,
2753
2881
  navigationModel: C,
2754
2882
  registry: t,
2755
2883
  initialScreen: m,
2756
2884
  history: d,
2757
- layoutConfigStorage: ha(),
2758
- scope: (t, n) => /* @__PURE__ */ I(va, {
2885
+ layoutConfigStorage: La(),
2886
+ scope: (t, n) => /* @__PURE__ */ F(Ba, {
2759
2887
  scene: e,
2760
2888
  routeState: i,
2761
2889
  strings: a,
@@ -2765,25 +2893,25 @@ function _a({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
2765
2893
  onSystemSchemeChange: S,
2766
2894
  children: n
2767
2895
  }),
2768
- renderScreen: (e, n) => /* @__PURE__ */ I(ba, {
2896
+ renderScreen: (e, n) => /* @__PURE__ */ F(Ha, {
2769
2897
  element: e,
2770
2898
  configuration: n,
2771
2899
  registry: t
2772
2900
  }),
2773
- renderDialog: () => /* @__PURE__ */ I(Gr, {}),
2774
- renderDialogTemplate: (e, n, r) => /* @__PURE__ */ I(xa, {
2901
+ renderDialog: () => /* @__PURE__ */ F(si, {}),
2902
+ renderDialogTemplate: (e, n, r) => /* @__PURE__ */ F(Ua, {
2775
2903
  template: e,
2776
2904
  content: n,
2777
2905
  registry: t,
2778
2906
  strings: a,
2779
2907
  close: () => r.closeDialog()
2780
2908
  })
2781
- }) : /* @__PURE__ */ L("main", {
2909
+ }) : /* @__PURE__ */ I("main", {
2782
2910
  className: "stage-message",
2783
- children: [/* @__PURE__ */ I("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ I("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
2911
+ children: [/* @__PURE__ */ F("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ F("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
2784
2912
  });
2785
2913
  }
2786
- function va({ scene: e, routeState: t, strings: n, navigation: r, themes: i, shellSettings: o, onSystemSchemeChange: s, children: c }) {
2914
+ function Ba({ scene: e, routeState: t, strings: n, navigation: r, themes: i, shellSettings: o, onSystemSchemeChange: s, children: c }) {
2787
2915
  let [u, f] = l(""), { navigate: p } = r;
2788
2916
  return a(() => f(""), [r.currentScreen, r.currentDialog]), a(() => {
2789
2917
  let e = (e) => {
@@ -2800,24 +2928,24 @@ function va({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
2800
2928
  r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? f(`The modeled screen “${r.screen}” is not available.`) : p(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? p(r) : f(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
2801
2929
  };
2802
2930
  return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
2803
- }, [p, e]), /* @__PURE__ */ I(re, {
2804
- registry: sa,
2805
- children: /* @__PURE__ */ L(ye, {
2931
+ }, [p, e]), /* @__PURE__ */ F(re, {
2932
+ registry: ka,
2933
+ children: /* @__PURE__ */ I(Se, {
2806
2934
  themes: i,
2807
2935
  children: [
2808
- o && /* @__PURE__ */ I(Ji, {
2936
+ o && /* @__PURE__ */ F(_a, {
2809
2937
  settings: o,
2810
2938
  onSystemSchemeChange: s
2811
2939
  }),
2812
- /* @__PURE__ */ I(Ri, {}),
2813
- /* @__PURE__ */ I(Vt, {
2940
+ /* @__PURE__ */ F(sa, {}),
2941
+ /* @__PURE__ */ F(Wt, {
2814
2942
  routes: t.routes,
2815
2943
  routesReady: t.ready,
2816
2944
  parameters: r.currentParameters,
2817
2945
  locale: n.locale,
2818
2946
  locales: n.locales,
2819
2947
  screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
2820
- children: /* @__PURE__ */ I(ya, {
2948
+ children: /* @__PURE__ */ F(Va, {
2821
2949
  activity: u,
2822
2950
  routesReady: t.ready,
2823
2951
  scene: e,
@@ -2830,14 +2958,14 @@ function va({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
2830
2958
  })
2831
2959
  });
2832
2960
  }
2833
- function ya({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
2834
- let o = B(), c = he(), l = an(), u = s(() => na(l, t, o.refreshAfterCommand), [
2961
+ function Va({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
2962
+ let o = z(), c = ge(), l = cn(), u = s(() => Ta(l, t, o.refreshAfterCommand), [
2835
2963
  l,
2836
2964
  t,
2837
2965
  o.refreshAfterCommand
2838
- ]), f = s(() => ea(n.commandSchemas), [n.commandSchemas]), p = k({
2966
+ ]), f = s(() => Ca(n.commandSchemas), [n.commandSchemas]), p = ue({
2839
2967
  executeCommand: async (e, n) => {
2840
- let i = W(e);
2968
+ let i = U(e);
2841
2969
  if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
2842
2970
  isSuccess: !1,
2843
2971
  validationErrors: []
@@ -2854,7 +2982,7 @@ function ya({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2854
2982
  };
2855
2983
  },
2856
2984
  navigate: (e, t) => {
2857
- n.screens.some((t) => t.name === e) ? G(e, un(t)) : r(`The modeled screen “${e}” is not available.`);
2985
+ n.screens.some((t) => t.name === e) ? W(e, pn(t)) : r(`The modeled screen “${e}” is not available.`);
2858
2986
  },
2859
2987
  navigateBack: () => globalThis.history?.back(),
2860
2988
  openDialog: async (e) => {
@@ -2871,18 +2999,18 @@ function ya({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2871
2999
  refreshQuery: async (e) => o.refreshQuery(e),
2872
3000
  raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
2873
3001
  });
2874
- return /* @__PURE__ */ I(ki, {
3002
+ return /* @__PURE__ */ F(Qi, {
2875
3003
  state: {
2876
3004
  locales: i.locales,
2877
3005
  locale: i.locale,
2878
3006
  setLocale: i.setLocale,
2879
3007
  activity: e
2880
3008
  },
2881
- children: /* @__PURE__ */ I(se, {
3009
+ children: /* @__PURE__ */ F(se, {
2882
3010
  invoker: u,
2883
- children: /* @__PURE__ */ I(ae, {
3011
+ children: /* @__PURE__ */ F(ae, {
2884
3012
  fieldsFor: f,
2885
- children: /* @__PURE__ */ I(D, {
3013
+ children: /* @__PURE__ */ F(ie, {
2886
3014
  dispatcher: p,
2887
3015
  context: {
2888
3016
  resolve: o.resolveBinding,
@@ -2896,44 +3024,49 @@ function ya({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2896
3024
  })
2897
3025
  });
2898
3026
  }
2899
- function ba({ element: e, configuration: t, registry: n }) {
2900
- let r = B(), i = $t();
2901
- return /* @__PURE__ */ L(Re, { children: [/* @__PURE__ */ I(oi, { element: e }), /* @__PURE__ */ I(ie, {
3027
+ function Ha({ element: e, configuration: t, registry: n }) {
3028
+ let r = z(), i = nn();
3029
+ return /* @__PURE__ */ I(Pn, {
2902
3030
  element: e,
2903
- registry: n,
2904
- resolveBinding: r.resolveBinding,
2905
- queryResults: r.queryResults,
2906
- onComponentOutputsChanged: i,
2907
- configuration: t
2908
- })] });
2909
- }
2910
- function xa({ template: e, content: t, registry: n, strings: r, close: i }) {
2911
- let o = B(), s = $t(), c = w(t, r.dictionary);
3031
+ children: [/* @__PURE__ */ F(Si, { element: e }), /* @__PURE__ */ F(D, {
3032
+ element: e,
3033
+ registry: n,
3034
+ resolveBinding: r.resolveBinding,
3035
+ queryResults: r.queryResults,
3036
+ onComponentOutputsChanged: i,
3037
+ configuration: t
3038
+ })]
3039
+ });
3040
+ }
3041
+ function Ua({ template: e, content: t, registry: n, strings: r, close: i }) {
3042
+ let o = z(), s = nn(), c = w(t, r.dictionary);
2912
3043
  return a(() => {
2913
3044
  let e = (e) => {
2914
3045
  e.key === "Escape" && i();
2915
3046
  };
2916
3047
  return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
2917
- }, [i]), /* @__PURE__ */ I("div", {
3048
+ }, [i]), /* @__PURE__ */ F("div", {
2918
3049
  className: "stage-dialog-backdrop",
2919
- children: /* @__PURE__ */ L("section", {
3050
+ children: /* @__PURE__ */ I("section", {
2920
3051
  role: "dialog",
2921
3052
  "aria-modal": "true",
2922
3053
  "aria-label": e.displayName ?? e.name,
2923
3054
  className: "stage-dialog",
2924
- children: [/* @__PURE__ */ I("button", {
3055
+ children: [/* @__PURE__ */ F("button", {
2925
3056
  type: "button",
2926
3057
  onClick: i,
2927
3058
  children: "Close"
2928
- }), /* @__PURE__ */ I(ie, {
3059
+ }), /* @__PURE__ */ F(Pn, {
2929
3060
  element: c,
2930
- registry: n,
2931
- resolveBinding: o.resolveBinding,
2932
- queryResults: o.queryResults,
2933
- onComponentOutputsChanged: s
3061
+ children: /* @__PURE__ */ F(D, {
3062
+ element: c,
3063
+ registry: n,
3064
+ resolveBinding: o.resolveBinding,
3065
+ queryResults: o.queryResults,
3066
+ onComponentOutputsChanged: s
3067
+ })
2934
3068
  })]
2935
3069
  })
2936
3070
  });
2937
3071
  }
2938
- //#endregion
2939
- export { ga as App, ga as StageApplication, jn as StageCommandForm, Vt as StageDataProvider, br as StageGuardedAction, at as StageSourceProvider, pa as composeStageScreen, na as createStageSliceInvoker, Ht as dataChanged, nn as executeRegisteredCommand, ft as hostedBasePath, vi as listsPrimeReact, yt as performQuery, ht as registerQueryRouteResolver, yi as registerStageLibrary, W as registeredCommand, gt as registeredQuery, ea as sliceFieldsFrom, ca as stageApplicationRegistry, da as stageComposition, e as stageDarkSelector, rt as stageEndpoints, ua as stageShellOf, nt as staticStageSource, bt as subscribeQuery, an as useStageCommandExecutor, B as useStageData, V as useStageQuery, ot as useStageSource };
3072
+ export { Ra as App, Ra as StageApplication, zn as StageCommandForm, Wt as StageDataProvider, Or as StageGuardedAction, ct as StageSourceProvider, Fa as composeStageScreen, Ta as createStageSliceInvoker, Gt as dataChanged, on as executeRegisteredCommand, ht as hostedBasePath, Bi as listsPrimeReact, St as performQuery, vt as registerQueryRouteResolver, Vi as registerStageLibrary, U as registeredCommand, yt as registeredQuery, Ca as sliceFieldsFrom, Aa as stageApplicationRegistry, Na as stageComposition, e as stageDarkSelector, ot as stageEndpoints, Ma as stageShellOf, at as staticStageSource, Ct as subscribeQuery, cn as useStageCommandExecutor, z as useStageData, B as useStageQuery, lt as useStageSource };