@cratis/stage.runtime 4.202.1 → 4.204.0

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