@cratis/stage.runtime 4.190.1 → 4.190.3

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