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