@cratis/stage.runtime 5.1.1 → 5.2.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
@@ -5,31 +5,32 @@ import { NotesButton as r, NotesProvider as i } from "@cratis/showrunner.notes.r
5
5
  import "@cratis/showrunner.notes.react/styles";
6
6
  import { createContext as a, createElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
7
7
  import { BindingSourceKind as g, ColorScheme as _, DestinationKind as v, FormGenerationMode as y, FormWidthUnit as b, GuardOperator as x, InteractionActionKind as S, InteractionTriggerKind as C, LogoKind as w, Opens as T, OutletItemKind as E, OutletKind as D, PackageKind as O, ScreenFit as k, SlotRole as A, componentIconLibrary as ee } from "@cratis/scene.model";
8
- import { InputSourceKind as te, InteractionStop as j, ShellDiagnosticCode as M, ShellOrigin as N, commandResponseContext as P, createBindingResolver as ne, hostProfilePackages as re, outletChainOf as ie, placementSlotsOf as F, resolveArgumentSource as ae, resolveBehaviors as oe, resolveStringsInElement as se, resolveStringsValue as ce, resolveSubjectReference as le, runActions as ue, runBindings as de, sliceRouteSegment as fe, validateBindingExpression as pe, validateResponseBindings as me } from "@cratis/scene.engine";
9
- import { CoreOutletItems as he, CoreSliceDialog as ge, IconAdapterProvider as _e, InteractionScope as ve, OutletView as ye, SceneElementView as be, SceneNavigationContextInternal as xe, SceneOutletsProvider as Se, SceneRouterProvider as Ce, SceneSlotRouteContext as we, SliceCommandFieldsProvider as Te, SliceDialogView as Ee, SliceInvokerProvider as De, attachmentFor as Oe, componentRegistryKey as ke, coreComponents as Ae, coreSlotShape as je, createBrowserDispatcher as Me, createIconAdapterRegistry as Ne, emptySceneRouteState as Pe, outletOfElement as Fe, parseRoutedSlotPath as Ie, routedSlotPath as Le, sliceDialogParameters as Re, useInteractionScope as ze, useOptionalSceneNavigation as Be, useOptionalSceneRouter as Ve, useSceneNavigation as He, useSceneOutlets as Ue, useSceneQueryParameters as We, useSceneSlots as Ge, useSceneTheme as Ke, withQueryParameter as qe, withSlotClosed as Je, withSlotOpened as Ye, withTabSelected as Xe } from "@cratis/scene.react";
10
- import { ApplicationHost as Ze, ColorScheme as I, ComponentName as L, KanbanBoard as Qe, LayoutThemeProvider as $e, SlotName as R, blueprintPackageCatalog as et, composeApplicationScreen as tt, defaultBlueprintComponents as nt, defaultBlueprintName as rt, defaultBlueprintThemes as it, effectiveShellOf as at, externalComponent as z, galleryScreenTemplates as ot, layoutModes as st, menuThemes as ct, navigationElement as lt, previewComponents as ut, previewProfile as dt, useLayoutConfig as ft } from "@cratis/scene.blueprint.default";
8
+ import { InputSourceKind as te, InteractionStop as ne, ShellDiagnosticCode as j, ShellOrigin as M, commandResponseContext as N, createBindingResolver as re, hostProfilePackages as ie, outletChainOf as ae, placementSlotsOf as P, resolveArgumentSource as oe, resolveBehaviors as se, resolveStringsInElement as ce, resolveStringsValue as le, resolveSubjectReference as ue, runActions as de, runBindings as fe, sliceRouteSegment as pe, validateBindingExpression as me, validateResponseBindings as he } from "@cratis/scene.engine";
9
+ import { CoreOutletItems as ge, CoreSliceDialog as _e, IconAdapterProvider as ve, InteractionScope as ye, OutletView as be, SceneElementView as xe, SceneNavigationContextInternal as Se, SceneOutletsProvider as Ce, SceneRouterProvider as we, SceneSlotRouteContext as Te, SliceCommandFieldsProvider as Ee, SliceDialogView as De, SliceInvokerProvider as Oe, attachmentFor as ke, componentRegistryKey as Ae, coreComponents as je, coreSlotShape as Me, createBrowserDispatcher as Ne, createIconAdapterRegistry as Pe, emptySceneRouteState as Fe, outletOfElement as Ie, parseRoutedSlotPath as Le, routedSlotPath as Re, sliceDialogParameters as ze, useInteractionScope as Be, useOptionalSceneNavigation as Ve, useOptionalSceneRouter as He, useSceneNavigation as Ue, useSceneOutlets as We, useSceneQueryParameters as Ge, useSceneSlots as Ke, useSceneTheme as qe, withQueryParameter as Je, withSlotClosed as Ye, withSlotOpened as Xe, withTabSelected as Ze } from "@cratis/scene.react";
10
+ import { ApplicationHost as Qe, ColorScheme as F, ComponentName as I, KanbanBoard as $e, LayoutThemeProvider as et, SlotName as L, blueprintPackageCatalog as tt, composeApplicationScreen as nt, defaultBlueprintComponents as rt, defaultBlueprintName as it, defaultBlueprintThemes as at, effectiveShellOf as ot, externalComponent as R, galleryScreenTemplates as st, layoutModes as ct, menuThemes as lt, navigationElement as ut, previewComponents as dt, previewProfile as ft, useLayoutConfig as pt } from "@cratis/scene.blueprint.default";
11
11
  import "@cratis/components/tokens";
12
+ import "@cratis/components/Dialogs/styles";
12
13
  import "@cratis/components/CommandForm/styles";
13
14
  import "@cratis/components/Dropdown/styles";
14
15
  import "@cratis/components/Common/styles";
15
16
  import "@cratis/components/Display/styles";
16
17
  import "@cratis/scene.blueprint.default/styles.css";
17
- import { ObservableQueryFor as pt, Paging as mt, QueryFor as ht } from "@cratis/arc/queries";
18
- import { resolveCommand as gt, resolveExactQuery as _t } from "@cratis/scene.components";
19
- import { Command as vt } from "@cratis/arc/commands";
20
- import { DateOnly as yt, Guid as bt } from "@cratis/fundamentals";
21
- import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
22
- import { Button as U } from "@cratis/components/Common";
23
- import { Dialog as xt } from "@cratis/components/Dialogs";
24
- import { Message as St } from "@cratis/components/Display";
25
- import { Slice as Ct } from "@cratis/arc.react/slices";
26
- import { createPortal as wt } from "react-dom";
27
- import { CommandForm as Tt, asCommandFormField as Et, withCommandFormFieldBinding as Dt } from "@cratis/arc.react/commands";
28
- import { CalendarField as Ot, CheckboxField as kt, DropdownField as At, InputTextField as jt, NumberField as Mt } from "@cratis/components/CommandForm";
29
- import { cratisComponents as Nt, cratisComponentsPackageManifest as Pt } from "@cratis/scene.components/runtime";
30
- import { dynamicIconImports as Ft } from "lucide-react/dynamic";
18
+ import { ObservableQueryFor as mt, Paging as ht, QueryFor as gt } from "@cratis/arc/queries";
19
+ import { resolveCommand as _t, resolveExactQuery as vt } from "@cratis/scene.components";
20
+ import { Command as yt } from "@cratis/arc/commands";
21
+ import { DateOnly as bt, Guid as xt } from "@cratis/fundamentals";
22
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
23
+ import { Button as H } from "@cratis/components/Common";
24
+ import { Dialog as St } from "@cratis/components/Dialogs";
25
+ import { Message as Ct } from "@cratis/components/Display";
26
+ import { Slice as wt } from "@cratis/arc.react/slices";
27
+ import { createPortal as Tt } from "react-dom";
28
+ import { CommandForm as Et, asCommandFormField as Dt, withCommandFormFieldBinding as Ot } from "@cratis/arc.react/commands";
29
+ import { CalendarField as kt, CheckboxField as At, DropdownField as jt, InputTextField as Mt, NumberField as Nt } from "@cratis/components/CommandForm";
30
+ import { cratisComponents as Pt, cratisComponentsPackageManifest as Ft } from "@cratis/scene.components/runtime";
31
+ import { dynamicIconImports as It } from "lucide-react/dynamic";
31
32
  // src/stageSource.ts
32
- function It(e) {
33
+ function Lt(e) {
33
34
  return {
34
35
  scene: async () => e.scene,
35
36
  routes: async () => e.routes,
@@ -37,24 +38,25 @@ function It(e) {
37
38
  strings: async (t) => e.strings[t] ?? {}
38
39
  };
39
40
  }
40
- var Lt = {
41
+ var Rt = {
41
42
  scene: "stage/scene",
42
43
  routes: "stage/routes",
43
44
  locales: "stage/locales",
44
45
  modelReferences: "stage/model-references",
46
+ actingUser: "stage/sandbox/acting-user",
45
47
  strings: (e) => `stage/strings/${encodeURIComponent(e)}`
46
- }, Rt = a(void 0);
47
- function zt({ source: e, children: t }) {
48
- return o(Rt.Provider, { value: e }, t);
48
+ }, zt = a(void 0);
49
+ function Bt({ source: e, children: t }) {
50
+ return o(zt.Provider, { value: e }, t);
49
51
  }
50
- function Bt() {
51
- let e = c(Rt);
52
+ function U() {
53
+ let e = c(zt);
52
54
  if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
53
55
  return e;
54
56
  }
55
- Lt.routes;
57
+ Rt.routes;
56
58
  function Vt() {
57
- let e = Bt(), [t, n] = m({
59
+ let e = U(), [t, n] = m({
58
60
  routes: void 0,
59
61
  ready: !1
60
62
  });
@@ -109,14 +111,14 @@ function Yt(e) {
109
111
  Jt = e;
110
112
  }
111
113
  function Xt(e, t) {
112
- let n = _t(e);
113
- return n === "ambiguous" && t && (n = _t(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), Zt(n) ? n : t ? Jt?.(t) : void 0;
114
+ let n = vt(e);
115
+ return n === "ambiguous" && t && (n = vt(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), Zt(n) ? n : t ? Jt?.(t) : void 0;
114
116
  }
115
117
  function Zt(e) {
116
- return typeof e == "function" && (e.prototype instanceof ht || e.prototype instanceof pt);
118
+ return typeof e == "function" && (e.prototype instanceof gt || e.prototype instanceof mt);
117
119
  }
118
120
  function Qt(e, t) {
119
- e.setMicroservice(t.microservice), e.setApiBasePath(qt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = mt.noPaging;
121
+ e.setMicroservice(t.microservice), e.setApiBasePath(qt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = ht.noPaging;
120
122
  }
121
123
  function $t(e, t, n) {
122
124
  let r = new e();
@@ -124,7 +126,7 @@ function $t(e, t, n) {
124
126
  }
125
127
  function en(e, t, n, r) {
126
128
  let i = new e();
127
- if (i instanceof pt) return Qt(i, n), i.subscribe(r, t);
129
+ if (i instanceof mt) return Qt(i, n), i.subscribe(r, t);
128
130
  }
129
131
  // src/stageSession.ts
130
132
  var tn = "stage.session.";
@@ -165,12 +167,12 @@ function on(e, t, n) {
165
167
  e
166
168
  ]) {
167
169
  if (!r) continue;
168
- let t = gt(r);
170
+ let t = _t(r);
169
171
  if (sn(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
170
172
  }
171
173
  }
172
174
  function sn(e) {
173
- return typeof e == "function" && e.prototype instanceof vt;
175
+ return typeof e == "function" && e.prototype instanceof yt;
174
176
  }
175
177
  function cn(e, t) {
176
178
  return e.setApiBasePath(qt(t)), e;
@@ -232,12 +234,12 @@ function gn(e, t = {}) {
232
234
  return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
233
235
  }
234
236
  function _n(e) {
235
- return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof bt)).map(([e, t]) => [e, String(t)]));
237
+ return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof xt)).map(([e, t]) => [e, String(t)]));
236
238
  }
237
239
  // src/screenplayGuard.ts
238
240
  function vn(...[e, t, n]) {
239
241
  let r = n.subject?.() ?? n.resolve({ path: "item" });
240
- return de(e.map((e) => ({
242
+ return fe(e.map((e) => ({
241
243
  ...e,
242
244
  binding: xn(e.binding, r)
243
245
  })), t, n);
@@ -265,19 +267,19 @@ function xn(e, t) {
265
267
  };
266
268
  }
267
269
  function Sn(e, t) {
268
- return Cn(e) && typeof e.subject == "string" ? le({ subject: e.subject }, t) : void 0;
270
+ return Cn(e) && typeof e.subject == "string" ? ue({ subject: e.subject }, t) : void 0;
269
271
  }
270
272
  function Cn(e) {
271
273
  return typeof e == "object" && !!e && !Array.isArray(e);
272
274
  }
273
275
  // src/stageData.tsx
274
- var wn = "cratis.stage.data-changed", Tn = a(() => () => void 0), En = Ae["core:guarded-action"];
276
+ var wn = "cratis.stage.data-changed", Tn = a(() => () => void 0), En = je["core:guarded-action"];
275
277
  function Dn(e) {
276
278
  return e.componentName === "core:guarded-action" || e.componentName === "core:action" && Array.isArray(e.properties.alternatives);
277
279
  }
278
280
  function On(e) {
279
281
  let { dispatcher: t, attachments: n } = kn(), { item: r, refused: i, error: a } = An(e.element);
280
- if (i) return /* @__PURE__ */ H("span", {
282
+ if (i) return /* @__PURE__ */ V("span", {
281
283
  role: "alert",
282
284
  children: ["STAGE-SCENE-ACTION-001: The action's data subject or command scope is unavailable.", a]
283
285
  });
@@ -286,10 +288,10 @@ function On(e) {
286
288
  path: "",
287
289
  value: r
288
290
  };
289
- return /* @__PURE__ */ V(ve, {
291
+ return /* @__PURE__ */ B(ye, {
290
292
  dispatcher: t,
291
293
  attachments: n,
292
- children: /* @__PURE__ */ V(En, {
294
+ children: /* @__PURE__ */ B(En, {
293
295
  ...e,
294
296
  slots: e.slots ?? {},
295
297
  element: {
@@ -304,9 +306,9 @@ function On(e) {
304
306
  });
305
307
  }
306
308
  function kn() {
307
- let e = W(), t = ze(), n = dn();
309
+ let e = W(), t = Be(), n = dn();
308
310
  return {
309
- dispatcher: t?.dispatcher ?? Me({
311
+ dispatcher: t?.dispatcher ?? Ne({
310
312
  executeCommand: async (t, r) => {
311
313
  let i = await n(t, r);
312
314
  return i.isSuccess && e.refreshAfterCommand(), {
@@ -412,12 +414,12 @@ function zn({ routes: e, routesReady: t = !0, parameters: n = Rn, locale: r, loc
412
414
  ...n,
413
415
  [e]: t
414
416
  })), v(t ? e : (t) => t === e ? void 0 : t);
415
- }, []), j = s((e) => {
417
+ }, []), ne = s((e) => {
416
418
  g((t) => ({
417
419
  ...t,
418
420
  [e]: void 0
419
421
  })), v((t) => t === e ? void 0 : t);
420
- }, []), M = s((e, t, n) => {
422
+ }, []), j = s((e, t, n) => {
421
423
  S((r) => {
422
424
  let i = q(r[e]) ? r[e] : {};
423
425
  return {
@@ -425,27 +427,27 @@ function zn({ routes: e, routesReady: t = !0, parameters: n = Rn, locale: r, loc
425
427
  [e]: Jn(i, t.split(".").filter(Boolean), n)
426
428
  };
427
429
  });
428
- }, []), N = s((e) => E((t) => ({
430
+ }, []), M = s((e) => E((t) => ({
429
431
  query: e,
430
432
  version: t.version + 1
431
- })), []), { settling: P, refreshAfterCommand: re, registerAwaitingQuery: ie } = Bn(N, p);
433
+ })), []), { settling: N, refreshAfterCommand: ie, registerAwaitingQuery: ae } = Bn(M, p);
432
434
  l(() => {
433
- let e = () => N(), t = (e) => N(e.detail?.query);
435
+ let e = () => M(), t = (e) => M(e.detail?.query);
434
436
  return globalThis.addEventListener(wn, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
435
437
  globalThis.removeEventListener(wn, e), globalThis.removeEventListener("cratis.scene.refresh", t);
436
438
  };
437
- }, [N]);
438
- let F = _ ? h[_] : void 0, oe = s((e) => {
439
+ }, [M]);
440
+ let P = _ ? h[_] : void 0, se = s((e) => {
439
441
  if (e === void 0) return;
440
- if (typeof e == "string") return Xn(e, F, h, c, y, k, ee, r, i);
441
- let t = Gn(F, c, y, {
442
+ if (typeof e == "string") return Xn(e, P, h, c, y, k, ee, r, i);
443
+ let t = Gn(P, c, y, {
442
444
  ...D,
443
445
  ...x
444
446
  }, h);
445
- if (!e.kind && e.path.startsWith("component.")) return ae(e.path, t);
446
- if (!e.kind) return Xn(e.path, F, h, c, y, k, ee, r, i);
447
- let n = pe(e, t);
448
- return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), ne(t)(e);
447
+ if (!e.kind && e.path.startsWith("component.")) return oe(e.path, t);
448
+ if (!e.kind) return Xn(e.path, P, h, c, y, k, ee, r, i);
449
+ let n = me(e, t);
450
+ return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), re(t)(e);
449
451
  }, [
450
452
  x,
451
453
  r,
@@ -455,9 +457,9 @@ function zn({ routes: e, routesReady: t = !0, parameters: n = Rn, locale: r, loc
455
457
  D,
456
458
  c,
457
459
  ee,
458
- F,
460
+ P,
459
461
  h
460
- ]), se = s((e) => e ? ae(e, Gn(F, c, y, {
462
+ ]), ce = s((e) => e ? oe(e, Gn(P, c, y, {
461
463
  ...D,
462
464
  ...x
463
465
  }, h)) : void 0, [
@@ -465,16 +467,16 @@ function zn({ routes: e, routesReady: t = !0, parameters: n = Rn, locale: r, loc
465
467
  y,
466
468
  D,
467
469
  c,
468
- F,
470
+ P,
469
471
  h
470
- ]), ce = s((e, t) => w((n) => ({
472
+ ]), le = s((e, t) => w((n) => ({
471
473
  ...n,
472
474
  [e]: t
473
- })), []), le = s((e) => w((t) => {
475
+ })), []), ue = s((e) => w((t) => {
474
476
  if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
475
477
  let n = { ...t };
476
478
  return delete n[e], n;
477
- }), []), ue = f(() => Gn(void 0, c, {}, {}, {}).queryResults, [c]), de = f(() => ({
479
+ }), []), de = f(() => Gn(void 0, c, {}, {}, {}).queryResults, [c]), fe = f(() => ({
478
480
  locale: r,
479
481
  locales: i,
480
482
  screen: a,
@@ -483,53 +485,53 @@ function zn({ routes: e, routesReady: t = !0, parameters: n = Rn, locale: r, loc
483
485
  parameters: k,
484
486
  session: A,
485
487
  queries: c,
486
- selected: F,
488
+ selected: P,
487
489
  selections: h,
488
490
  selectRow: te,
489
- clearSelection: j,
491
+ clearSelection: ne,
490
492
  setState: (e, t) => b((n) => Jn(n, e.split(".").filter(Boolean), t)),
491
- setComponentOutput: M,
492
- publishComponentOutputs: ce,
493
- withdrawComponentOutputs: le,
494
- queryResults: ue,
495
- refreshQuery: N,
496
- refreshAfterCommand: re,
497
- settling: P,
498
- resolveBinding: oe,
499
- resolveArgument: se,
493
+ setComponentOutput: j,
494
+ publishComponentOutputs: le,
495
+ withdrawComponentOutputs: ue,
496
+ queryResults: de,
497
+ refreshQuery: M,
498
+ refreshAfterCommand: ie,
499
+ settling: N,
500
+ resolveBinding: se,
501
+ resolveArgument: ce,
500
502
  registerQueryResult: O,
501
503
  refreshVersion: T.version,
502
504
  refreshQueryName: T.query
503
505
  }), [
504
- j,
506
+ ne,
505
507
  r,
506
508
  i,
507
509
  c,
508
- re,
509
- P,
510
+ ie,
510
511
  N,
512
+ M,
511
513
  T.query,
512
514
  T.version,
513
515
  O,
514
- ce,
515
516
  le,
516
517
  ue,
518
+ de,
519
+ ce,
517
520
  se,
518
- oe,
519
521
  e,
520
522
  t,
521
523
  k,
522
524
  A,
523
525
  a,
524
526
  te,
525
- F,
527
+ P,
526
528
  h,
527
- M
529
+ j
528
530
  ]);
529
- return /* @__PURE__ */ V(In.Provider, {
530
- value: de,
531
- children: /* @__PURE__ */ V(Tn.Provider, {
532
- value: ie,
531
+ return /* @__PURE__ */ B(In.Provider, {
532
+ value: fe,
533
+ children: /* @__PURE__ */ B(Tn.Provider, {
534
+ value: ae,
533
535
  children: o
534
536
  })
535
537
  });
@@ -579,7 +581,7 @@ function G(e) {
579
581
  r ? a(Error(r)) : e.isReady !== !1 && (s = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(s) ? Gt(s, e.changeSet) : e.data, _(er(s)), y(""), x(!1));
580
582
  };
581
583
  if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
582
- let l = i.prototype instanceof pt, u = () => Promise.resolve().then(() => $t(i, l ? {
584
+ let l = i.prototype instanceof mt, u = () => Promise.resolve().then(() => $t(i, l ? {
583
585
  ...r,
584
586
  waitForFirstResult: !0
585
587
  } : r, o)).then(c).catch(a);
@@ -802,7 +804,7 @@ function or(e) {
802
804
  }
803
805
  // src/modelReferences.ts
804
806
  async function sr(e, t = fetch) {
805
- let n = await t(Lt.modelReferences, { signal: e });
807
+ let n = await t(Rt.modelReferences, { signal: e });
806
808
  return n.ok ? await n.json() : void 0;
807
809
  }
808
810
  function cr(e, t, n) {
@@ -826,7 +828,7 @@ async function dr(e, t = fetch) {
826
828
  } : ur;
827
829
  }
828
830
  function fr() {
829
- let e = Bt(), [t, n] = m(ur);
831
+ let e = U(), [t, n] = m(ur);
830
832
  return l(() => {
831
833
  if (!e.notes) return;
832
834
  let t = new AbortController();
@@ -894,7 +896,7 @@ function vr(e) {
894
896
  // src/stageStructure.tsx
895
897
  var yr = a({ screens: [] });
896
898
  function br({ structure: e, screens: t, children: n }) {
897
- return /* @__PURE__ */ V(yr.Provider, {
899
+ return /* @__PURE__ */ B(yr.Provider, {
898
900
  value: {
899
901
  structure: e,
900
902
  screens: t
@@ -904,21 +906,21 @@ function br({ structure: e, screens: t, children: n }) {
904
906
  }
905
907
  function xr({ screen: e, children: t }) {
906
908
  let { structure: n, screens: r } = c(yr), i = _r(n, r.find((t) => t.name === e));
907
- return i ? /* @__PURE__ */ V(Ct, {
909
+ return i ? /* @__PURE__ */ B(wt, {
908
910
  module: i.module,
909
911
  feature: i.feature,
910
912
  slice: i.slice,
911
913
  children: t
912
- }) : /* @__PURE__ */ V(B, { children: t });
914
+ }) : /* @__PURE__ */ B(z, { children: t });
913
915
  }
914
916
  function Sr({ slice: e, children: t }) {
915
917
  let { structure: n } = c(yr), r = gr(n, e);
916
- return r ? /* @__PURE__ */ V(Ct, {
918
+ return r ? /* @__PURE__ */ B(wt, {
917
919
  module: r.module,
918
920
  feature: r.feature,
919
921
  slice: r.slice,
920
922
  children: t
921
- }) : /* @__PURE__ */ V(B, { children: t });
923
+ }) : /* @__PURE__ */ B(z, { children: t });
922
924
  }
923
925
  // src/humanize.ts
924
926
  var Cr = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+\d*|\d+/g, wr = /* @__PURE__ */ new Set([
@@ -956,10 +958,14 @@ function kr(e) {
956
958
  return !1;
957
959
  }
958
960
  }
959
- function Y(e) {
961
+ function Y(e, t) {
960
962
  if (!e) return [];
961
963
  try {
962
- return Ar(JSON.parse(e), 0);
964
+ let n = Ar(JSON.parse(e), 0), r = new Set(n.filter((e) => e.identity).map((e) => e.name));
965
+ return t && Ar(JSON.parse(t), 0).filter((e) => e.identity).forEach((e) => r.add(e.name)), r.size > 0 ? n.map((e) => e.identifier && !r.has(e.name) ? {
966
+ ...e,
967
+ otherEntity: !0
968
+ } : e) : n;
963
969
  } catch {
964
970
  return [];
965
971
  }
@@ -1142,7 +1148,7 @@ function ti(e) {
1142
1148
  return typeof e == "object" && !!e && !Array.isArray(e);
1143
1149
  }
1144
1150
  // src/StageValueFields.tsx
1145
- var ni = Et((e) => /* @__PURE__ */ V(ri, {
1151
+ var ni = Dt((e) => /* @__PURE__ */ B(ri, {
1146
1152
  descriptor: e.descriptor,
1147
1153
  label: e.title ?? J(e.descriptor.name),
1148
1154
  value: e.value,
@@ -1151,21 +1157,21 @@ var ni = Et((e) => /* @__PURE__ */ V(ri, {
1151
1157
  invalid: e.invalid
1152
1158
  }), { defaultValue: void 0 });
1153
1159
  function ri({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1154
- return e.members ? /* @__PURE__ */ V(ii, {
1160
+ return e.members ? /* @__PURE__ */ B(ii, {
1155
1161
  descriptor: e,
1156
1162
  label: t,
1157
1163
  value: n,
1158
1164
  onChange: r,
1159
1165
  onBlur: i,
1160
1166
  invalid: a
1161
- }) : e.item ? /* @__PURE__ */ V(ai, {
1167
+ }) : e.item ? /* @__PURE__ */ B(ai, {
1162
1168
  descriptor: e,
1163
1169
  label: t,
1164
1170
  value: n,
1165
1171
  onChange: r,
1166
1172
  onBlur: i,
1167
1173
  invalid: a
1168
- }) : /* @__PURE__ */ V(oi, {
1174
+ }) : /* @__PURE__ */ B(oi, {
1169
1175
  descriptor: e,
1170
1176
  label: t,
1171
1177
  value: n,
@@ -1176,10 +1182,10 @@ function ri({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1176
1182
  }
1177
1183
  function ii({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1178
1184
  let o = li(n) ? n : {};
1179
- return /* @__PURE__ */ H("fieldset", {
1185
+ return /* @__PURE__ */ V("fieldset", {
1180
1186
  className: "stage-record-field",
1181
1187
  "data-invalid": a ? "true" : void 0,
1182
- children: [/* @__PURE__ */ V("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ V(ri, {
1188
+ children: [/* @__PURE__ */ B("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ B(ri, {
1183
1189
  descriptor: e,
1184
1190
  label: J(e.name),
1185
1191
  value: o[e.name],
@@ -1193,31 +1199,31 @@ function ii({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1193
1199
  }
1194
1200
  function ai({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1195
1201
  let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
1196
- return /* @__PURE__ */ H("fieldset", {
1202
+ return /* @__PURE__ */ V("fieldset", {
1197
1203
  className: "stage-list-field",
1198
1204
  "data-invalid": a ? "true" : void 0,
1199
1205
  children: [
1200
- /* @__PURE__ */ V("legend", { children: t }),
1201
- s.length === 0 && /* @__PURE__ */ V("p", {
1206
+ /* @__PURE__ */ B("legend", { children: t }),
1207
+ s.length === 0 && /* @__PURE__ */ B("p", {
1202
1208
  className: "stage-note",
1203
1209
  children: "Nothing added yet."
1204
1210
  }),
1205
- s.map((e, n) => /* @__PURE__ */ H("div", {
1211
+ s.map((e, n) => /* @__PURE__ */ V("div", {
1206
1212
  className: "stage-list-field__row",
1207
- children: [/* @__PURE__ */ V(ri, {
1213
+ children: [/* @__PURE__ */ B(ri, {
1208
1214
  descriptor: o,
1209
1215
  label: `${t} ${n + 1}`,
1210
1216
  value: e,
1211
1217
  onBlur: i,
1212
1218
  onChange: (e) => c(s.map((t, r) => r === n ? e : t))
1213
- }), /* @__PURE__ */ V("button", {
1219
+ }), /* @__PURE__ */ B("button", {
1214
1220
  type: "button",
1215
1221
  "aria-label": `Remove ${t} ${n + 1}`,
1216
1222
  onClick: () => c(s.filter((e, t) => t !== n)),
1217
1223
  children: "Remove"
1218
1224
  })]
1219
1225
  }, n)),
1220
- /* @__PURE__ */ V("button", {
1226
+ /* @__PURE__ */ B("button", {
1221
1227
  type: "button",
1222
1228
  "aria-label": `Add ${t}`,
1223
1229
  onClick: () => c([...s, si(o)]),
@@ -1231,34 +1237,34 @@ function oi({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1231
1237
  "aria-invalid": a ? !0 : void 0,
1232
1238
  onBlur: i
1233
1239
  };
1234
- if (e.options) return /* @__PURE__ */ H("label", {
1240
+ if (e.options) return /* @__PURE__ */ V("label", {
1235
1241
  className: "stage-value-field",
1236
- children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ H("select", {
1242
+ children: [/* @__PURE__ */ B("span", { children: t }), /* @__PURE__ */ V("select", {
1237
1243
  ...o,
1238
1244
  value: typeof n == "string" ? n : "",
1239
1245
  onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
1240
- children: [/* @__PURE__ */ V("option", {
1246
+ children: [/* @__PURE__ */ B("option", {
1241
1247
  value: "",
1242
1248
  children: ""
1243
- }), e.options.map((e) => /* @__PURE__ */ V("option", {
1249
+ }), e.options.map((e) => /* @__PURE__ */ B("option", {
1244
1250
  value: e,
1245
1251
  children: J(e)
1246
1252
  }, e))]
1247
1253
  })]
1248
1254
  });
1249
1255
  switch (e.type) {
1250
- case "boolean": return /* @__PURE__ */ H("label", {
1256
+ case "boolean": return /* @__PURE__ */ V("label", {
1251
1257
  className: "stage-value-field stage-value-field--check",
1252
- children: [/* @__PURE__ */ V("input", {
1258
+ children: [/* @__PURE__ */ B("input", {
1253
1259
  ...o,
1254
1260
  type: "checkbox",
1255
1261
  checked: n === !0,
1256
1262
  onChange: (e) => r(e.target.checked)
1257
- }), /* @__PURE__ */ V("span", { children: t })]
1263
+ }), /* @__PURE__ */ B("span", { children: t })]
1258
1264
  });
1259
- case "number": return /* @__PURE__ */ H("label", {
1265
+ case "number": return /* @__PURE__ */ V("label", {
1260
1266
  className: "stage-value-field",
1261
- children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ V("input", {
1267
+ children: [/* @__PURE__ */ B("span", { children: t }), /* @__PURE__ */ B("input", {
1262
1268
  ...o,
1263
1269
  type: "number",
1264
1270
  step: "any",
@@ -1266,18 +1272,18 @@ function oi({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1266
1272
  onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
1267
1273
  })]
1268
1274
  });
1269
- case "date": return /* @__PURE__ */ H("label", {
1275
+ case "date": return /* @__PURE__ */ V("label", {
1270
1276
  className: "stage-value-field",
1271
- children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ V("input", {
1277
+ children: [/* @__PURE__ */ B("span", { children: t }), /* @__PURE__ */ B("input", {
1272
1278
  ...o,
1273
1279
  type: e.withTime ? "datetime-local" : "date",
1274
1280
  value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
1275
1281
  onChange: (t) => r(t.target.value === "" ? void 0 : ci(t.target.value, e.withTime === !0))
1276
1282
  })]
1277
1283
  });
1278
- default: return /* @__PURE__ */ H("label", {
1284
+ default: return /* @__PURE__ */ V("label", {
1279
1285
  className: "stage-value-field",
1280
- children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ V("input", {
1286
+ children: [/* @__PURE__ */ B("span", { children: t }), /* @__PURE__ */ B("input", {
1281
1287
  ...o,
1282
1288
  type: "text",
1283
1289
  value: typeof n == "string" ? n : "",
@@ -1317,13 +1323,13 @@ function di(e) {
1317
1323
  var fi = a(void 0);
1318
1324
  function pi({ element: e, outputScope: t, children: n }) {
1319
1325
  let r = f(() => new Set(ui(e).flatMap((e) => t ? [e, `${t}:${e}`] : [e])), [e, t]);
1320
- return /* @__PURE__ */ V(fi.Provider, {
1326
+ return /* @__PURE__ */ B(fi.Provider, {
1321
1327
  value: r,
1322
1328
  children: n
1323
1329
  });
1324
1330
  }
1325
1331
  function mi({ children: e }) {
1326
- return /* @__PURE__ */ V(fi.Provider, {
1332
+ return /* @__PURE__ */ B(fi.Provider, {
1327
1333
  value: void 0,
1328
1334
  children: e
1329
1335
  });
@@ -1351,7 +1357,7 @@ function gi(e) {
1351
1357
  ready: a,
1352
1358
  publish: !1
1353
1359
  }), s = typeof e.value == "string" ? e.value : "";
1354
- return !a || o.error ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("input", {
1360
+ return !a || o.error ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("input", {
1355
1361
  id: e.id,
1356
1362
  "aria-label": e.title,
1357
1363
  "aria-invalid": e.invalid,
@@ -1360,10 +1366,10 @@ function gi(e) {
1360
1366
  onBlur: e.onBlur,
1361
1367
  required: e.required,
1362
1368
  disabled: e.disabled
1363
- }), o.error && /* @__PURE__ */ V("span", {
1369
+ }), o.error && /* @__PURE__ */ B("span", {
1364
1370
  role: "alert",
1365
1371
  children: o.error
1366
- })] }) : /* @__PURE__ */ V(vi, {
1372
+ })] }) : /* @__PURE__ */ B(vi, {
1367
1373
  ...e,
1368
1374
  selected: s,
1369
1375
  choices: _i(o.rows, e.reference),
@@ -1381,17 +1387,17 @@ function _i(e, t) {
1381
1387
  }
1382
1388
  function vi({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a, disabled: o, selected: s, choices: c, loading: l }) {
1383
1389
  let [u, d] = m(""), f = c.filter((e) => e.key === s || e.label.toLocaleLowerCase().includes(u.toLocaleLowerCase())), p = s !== "" && !c.some((e) => e.key === s);
1384
- return /* @__PURE__ */ H("div", {
1390
+ return /* @__PURE__ */ V("div", {
1385
1391
  className: "stage-reference-field",
1386
1392
  children: [
1387
- /* @__PURE__ */ V("input", {
1393
+ /* @__PURE__ */ B("input", {
1388
1394
  type: "search",
1389
1395
  "aria-label": `Filter ${i}`,
1390
1396
  value: u,
1391
1397
  onChange: (e) => d(e.target.value),
1392
1398
  disabled: o || l
1393
1399
  }),
1394
- /* @__PURE__ */ H("select", {
1400
+ /* @__PURE__ */ V("select", {
1395
1401
  id: e,
1396
1402
  "aria-label": i,
1397
1403
  "aria-invalid": r,
@@ -1401,21 +1407,21 @@ function vi({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a,
1401
1407
  required: a,
1402
1408
  disabled: o || l,
1403
1409
  children: [
1404
- /* @__PURE__ */ H("option", {
1410
+ /* @__PURE__ */ V("option", {
1405
1411
  value: "",
1406
1412
  children: ["Choose ", i]
1407
1413
  }),
1408
- p && /* @__PURE__ */ V("option", {
1414
+ p && /* @__PURE__ */ B("option", {
1409
1415
  value: s,
1410
1416
  children: s
1411
1417
  }),
1412
- f.map((e) => /* @__PURE__ */ V("option", {
1418
+ f.map((e) => /* @__PURE__ */ B("option", {
1413
1419
  value: e.key,
1414
1420
  children: e.label
1415
1421
  }, e.key))
1416
1422
  ]
1417
1423
  }),
1418
- /* @__PURE__ */ V(yi, {
1424
+ /* @__PURE__ */ B(yi, {
1419
1425
  loading: l,
1420
1426
  empty: c.length === 0
1421
1427
  })
@@ -1423,18 +1429,18 @@ function vi({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a,
1423
1429
  });
1424
1430
  }
1425
1431
  function yi({ loading: e, empty: t }) {
1426
- return e ? /* @__PURE__ */ V("span", {
1432
+ return e ? /* @__PURE__ */ B("span", {
1427
1433
  role: "status",
1428
1434
  children: "Loading choices…"
1429
- }) : t ? /* @__PURE__ */ V("span", { children: "No choices available" }) : null;
1435
+ }) : t ? /* @__PURE__ */ B("span", { children: "No choices available" }) : null;
1430
1436
  }
1431
1437
  function bi(e, t, n) {
1432
- return e?.reference ? /* @__PURE__ */ V(xi, {
1438
+ return e?.reference ? /* @__PURE__ */ B(xi, {
1433
1439
  ...t,
1434
1440
  reference: e.reference
1435
1441
  }) : n;
1436
1442
  }
1437
- var xi = Et(gi, { defaultValue: "" }), Si = {
1443
+ var xi = Dt(gi, { defaultValue: "" }), Si = {
1438
1444
  messages: [],
1439
1445
  complete: async (e, t) => t([], !1)
1440
1446
  };
@@ -1450,14 +1456,14 @@ function Ci(e, t, n) {
1450
1456
  targetType: () => void 0
1451
1457
  };
1452
1458
  return {
1453
- messages: me({
1459
+ messages: he({
1454
1460
  kind: "form",
1455
1461
  command: i,
1456
1462
  onSubmit: r
1457
1463
  }, a).map((e) => e.message),
1458
1464
  complete: async (e, t) => {
1459
- let a = P(n.context, i, e), o = await ue(r, n.dispatcher, a);
1460
- o.findings.length && n.onFindings?.(o.findings), t(o.findings.map((e) => e.detail), o.stop === j.Navigated);
1465
+ let a = N(n.context, i, e), o = await de(r, n.dispatcher, a);
1466
+ o.findings.length && n.onFindings?.(o.findings), t(o.findings.map((e) => e.detail), o.stop === ne.Navigated);
1461
1467
  }
1462
1468
  };
1463
1469
  }
@@ -1473,15 +1479,15 @@ function Ei(e, t, n) {
1473
1479
  } : Kr(e, t);
1474
1480
  }
1475
1481
  function Di(e, t) {
1476
- let n = X(e, "schema") || t?.commandSchemas?.[X(e, "command")];
1482
+ let n = X(e, "schema") || t?.commandSchemas?.[X(e, "command")], r = t?.commandSchemas?.[X(e, "command")];
1477
1483
  return {
1478
1484
  schemaText: n,
1479
- schema: f(() => Y(n ?? ""), [n]),
1485
+ schema: f(() => Y(n ?? "", r), [n, r]),
1480
1486
  hasSchemaMetadata: typeof n == "string"
1481
1487
  };
1482
1488
  }
1483
1489
  function Oi({ element: e, cancellable: n }) {
1484
- let r = W(), i = c(t), a = c(wi), o = c(Ti), s = p(null), l = f(() => Ni(e), [e]), u = Ci(e, l, ze()), { schemaText: d, schema: h, hasSchemaMetadata: g } = Di(e, r.routes), _ = f(() => l ? Pi(l, h) : [], [l, h]), v = l ? on(l.command, X(e, "typeName"), X(e, "route")) : void 0, y = ki(e, l), b = ta(e, _, r.resolveArgument), x = $i(e, h, r), S = JSON.stringify(x ?? null), C = f(() => x, [S]), { selectableRows: w, selectedRows: T, rowAction: E, subjectValues: D } = Ei(e, hi(), d), O = f(() => Vi(h, r.parameters, T, D), [
1490
+ let r = W(), i = c(t), a = c(wi), o = c(Ti), s = p(null), l = f(() => Ni(e), [e]), u = Ci(e, l, Be()), { schemaText: d, schema: h, hasSchemaMetadata: g } = Di(e, r.routes), _ = f(() => l ? Pi(l, h) : [], [l, h]), v = l ? on(l.command, X(e, "typeName"), X(e, "route")) : void 0, y = ki(e, l), b = ta(e, _, r.resolveArgument), x = $i(e, h, r), S = JSON.stringify(x ?? null), C = f(() => x, [S]), { selectableRows: w, selectedRows: T, rowAction: E, subjectValues: D } = Ei(e, hi(), d), O = f(() => Vi(h, r.parameters, T, D), [
1485
1491
  h,
1486
1492
  T,
1487
1493
  r.parameters,
@@ -1513,30 +1519,30 @@ function Oi({ element: e, cancellable: n }) {
1513
1519
  l,
1514
1520
  k,
1515
1521
  h
1516
- ]), j = f(() => l ? fa(_, h) : [], [
1522
+ ]), ne = f(() => l ? fa(_, h) : [], [
1517
1523
  l,
1518
1524
  _,
1519
1525
  h
1520
- ]), M = f(() => l ? pa(l.layout, _) : [], [l, _]), [N, P] = m([]);
1521
- return l ? !v && !r.routesReady ? /* @__PURE__ */ H("p", {
1526
+ ]), j = f(() => l ? pa(l.layout, _) : [], [l, _]), [M, N] = m([]);
1527
+ return l ? !v && !r.routesReady ? /* @__PURE__ */ V("p", {
1522
1528
  className: "stage-note",
1523
1529
  children: [
1524
1530
  "The modeled command “",
1525
1531
  l.command,
1526
1532
  "” is waiting for Stage routes."
1527
1533
  ]
1528
- }) : v ? _.length === 0 && !g && e.properties.parameterless !== !0 ? /* @__PURE__ */ V(Mi, {
1534
+ }) : v ? _.length === 0 && !g && e.properties.parameterless !== !0 ? /* @__PURE__ */ B(Mi, {
1529
1535
  form: l,
1530
1536
  messages: [`The modeled command “${l.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
1531
- }) : j.length + u.messages.length > 0 ? /* @__PURE__ */ V(Mi, {
1537
+ }) : ne.length + u.messages.length > 0 ? /* @__PURE__ */ B(Mi, {
1532
1538
  form: l,
1533
- messages: [...j, ...u.messages]
1534
- }) : /* @__PURE__ */ V("section", {
1539
+ messages: [...ne, ...u.messages]
1540
+ }) : /* @__PURE__ */ B("section", {
1535
1541
  ref: s,
1536
1542
  className: "stage-command-form",
1537
1543
  "data-command": l.command,
1538
1544
  "data-generation-mode": l.generationMode,
1539
- children: /* @__PURE__ */ H(Tt, {
1545
+ children: /* @__PURE__ */ V(Et, {
1540
1546
  command: v,
1541
1547
  initialValues: A,
1542
1548
  currentValues: ee,
@@ -1544,13 +1550,13 @@ function Oi({ element: e, cancellable: n }) {
1544
1550
  validateAllFieldsOnChange: !0,
1545
1551
  onBeforeExecute: (e) => cn(e, i.apiBasePath),
1546
1552
  onFieldValidate: (e, t, n, r) => da(_, h, t, r),
1547
- onValidationFailure: (e) => P(ua(_, e)),
1548
- onException: (e) => P(e),
1549
- onFailed: (e) => P(un(l.command, e).messages),
1553
+ onValidationFailure: (e) => N(ua(_, e)),
1554
+ onException: (e) => N(e),
1555
+ onFailed: (e) => N(un(l.command, e).messages),
1550
1556
  onSuccess: async (t) => {
1551
1557
  r.refreshAfterCommand();
1552
1558
  let n = (t, n) => {
1553
- P(t), t.length || ji(e, n, a);
1559
+ N(t), t.length || ji(e, n, a);
1554
1560
  };
1555
1561
  try {
1556
1562
  await u.complete(t, n);
@@ -1559,36 +1565,36 @@ function Oi({ element: e, cancellable: n }) {
1559
1565
  }
1560
1566
  },
1561
1567
  children: [
1562
- M.map((e) => /* @__PURE__ */ V("p", {
1568
+ j.map((e) => /* @__PURE__ */ B("p", {
1563
1569
  role: "alert",
1564
1570
  className: "stage-form-error",
1565
1571
  children: e
1566
1572
  }, e)),
1567
1573
  te,
1568
- N.map((e) => /* @__PURE__ */ V("p", {
1574
+ M.map((e) => /* @__PURE__ */ B("p", {
1569
1575
  role: "alert",
1570
1576
  className: "stage-form-error",
1571
1577
  children: e
1572
1578
  }, e)),
1573
- o ? wt(/* @__PURE__ */ V(U, {
1579
+ o ? Tt(/* @__PURE__ */ B(H, {
1574
1580
  type: "button",
1575
1581
  className: "scene-slice-dialog-submit",
1576
1582
  onClick: () => s.current?.querySelector("form")?.requestSubmit(),
1577
1583
  children: y
1578
- }), o) : /* @__PURE__ */ V(Ai, {
1584
+ }), o) : /* @__PURE__ */ B(Ai, {
1579
1585
  submitLabel: y,
1580
1586
  cancellable: n
1581
1587
  })
1582
1588
  ]
1583
1589
  }, S)
1584
- }) : /* @__PURE__ */ H("p", {
1590
+ }) : /* @__PURE__ */ V("p", {
1585
1591
  className: "stage-note",
1586
1592
  children: [
1587
1593
  "The modeled command “",
1588
1594
  l.command,
1589
1595
  "” is not registered by this Stage."
1590
1596
  ]
1591
- }) : /* @__PURE__ */ V("p", {
1597
+ }) : /* @__PURE__ */ B("p", {
1592
1598
  className: "stage-note",
1593
1599
  children: "This form is missing its command metadata."
1594
1600
  });
@@ -1598,12 +1604,12 @@ function ki(e, t) {
1598
1604
  }
1599
1605
  function Ai({ submitLabel: e, cancellable: t }) {
1600
1606
  let n = c(wi);
1601
- return /* @__PURE__ */ H("div", {
1607
+ return /* @__PURE__ */ V("div", {
1602
1608
  className: "stage-command-form__actions",
1603
- children: [/* @__PURE__ */ V(U, {
1609
+ children: [/* @__PURE__ */ B(H, {
1604
1610
  type: "submit",
1605
1611
  children: e
1606
- }), t && n && /* @__PURE__ */ V(U, {
1612
+ }), t && n && /* @__PURE__ */ B(H, {
1607
1613
  type: "button",
1608
1614
  variant: "outline",
1609
1615
  onClick: n,
@@ -1616,11 +1622,11 @@ function ji(e, t, n) {
1616
1622
  r && !t && pn(r, {}), n?.();
1617
1623
  }
1618
1624
  function Mi({ form: e, messages: t }) {
1619
- return /* @__PURE__ */ V("section", {
1625
+ return /* @__PURE__ */ B("section", {
1620
1626
  className: "stage-command-form",
1621
1627
  "data-command": e.command,
1622
1628
  "data-generation-mode": e.generationMode,
1623
- children: t.map((e) => /* @__PURE__ */ V("p", {
1629
+ children: t.map((e) => /* @__PURE__ */ B("p", {
1624
1630
  role: "alert",
1625
1631
  className: "stage-form-error",
1626
1632
  children: e
@@ -1653,7 +1659,7 @@ function Fi(e, t, n) {
1653
1659
  columnGap: la(r.columnGap),
1654
1660
  rowGap: la(r.rowGap)
1655
1661
  }, c = /* @__PURE__ */ new Set();
1656
- return /* @__PURE__ */ H("div", {
1662
+ return /* @__PURE__ */ V("div", {
1657
1663
  className: "stage-command-form__layout",
1658
1664
  style: s,
1659
1665
  children: [i.map((e) => {
@@ -1674,7 +1680,7 @@ function Ii(e, t, n) {
1674
1680
  value: e,
1675
1681
  label: J(e)
1676
1682
  }));
1677
- return /* @__PURE__ */ V(At, {
1683
+ return /* @__PURE__ */ B(jt, {
1678
1684
  value: o,
1679
1685
  fieldName: r,
1680
1686
  title: a,
@@ -1684,7 +1690,7 @@ function Ii(e, t, n) {
1684
1690
  optionLabel: "label"
1685
1691
  });
1686
1692
  }
1687
- if (i?.members || i?.item) return /* @__PURE__ */ V(ni, {
1693
+ if (i?.members || i?.item) return /* @__PURE__ */ B(ni, {
1688
1694
  value: o,
1689
1695
  fieldName: r,
1690
1696
  title: a,
@@ -1692,19 +1698,19 @@ function Ii(e, t, n) {
1692
1698
  descriptor: i
1693
1699
  });
1694
1700
  switch (i?.type ?? "text") {
1695
- case "number": return /* @__PURE__ */ V(Mt, {
1701
+ case "number": return /* @__PURE__ */ B(Nt, {
1696
1702
  value: o,
1697
1703
  fieldName: r,
1698
1704
  title: a,
1699
1705
  required: s
1700
1706
  });
1701
- case "boolean": return /* @__PURE__ */ V(kt, {
1707
+ case "boolean": return /* @__PURE__ */ B(At, {
1702
1708
  value: o,
1703
1709
  fieldName: r,
1704
1710
  label: a,
1705
1711
  required: s
1706
1712
  });
1707
- case "date": return /* @__PURE__ */ V(Li, {
1713
+ case "date": return /* @__PURE__ */ B(Li, {
1708
1714
  value: o,
1709
1715
  fieldName: r,
1710
1716
  title: a,
@@ -1713,7 +1719,7 @@ function Ii(e, t, n) {
1713
1719
  isNonModal: !0,
1714
1720
  showTime: i?.withTime
1715
1721
  });
1716
- default: return /* @__PURE__ */ V(jt, {
1722
+ default: return /* @__PURE__ */ B(Mt, {
1717
1723
  value: o,
1718
1724
  fieldName: r,
1719
1725
  title: a,
@@ -1721,7 +1727,7 @@ function Ii(e, t, n) {
1721
1727
  });
1722
1728
  }
1723
1729
  })()), l = ca(n);
1724
- return /* @__PURE__ */ V("span", {
1730
+ return /* @__PURE__ */ B("span", {
1725
1731
  className: "stage-command-form__field",
1726
1732
  "data-field": e.name,
1727
1733
  "data-row": n?.row,
@@ -1731,16 +1737,16 @@ function Ii(e, t, n) {
1731
1737
  children: c
1732
1738
  }, e.name);
1733
1739
  }
1734
- var Li = Dt((e) => /* @__PURE__ */ V(Ot, {
1740
+ var Li = Ot((e) => /* @__PURE__ */ B(kt, {
1735
1741
  ...e,
1736
1742
  currentValue: e.showTime ? e.currentValue : Ri(e.currentValue),
1737
- onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? yt.fromDate(t) : t)
1743
+ onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? bt.fromDate(t) : t)
1738
1744
  }));
1739
1745
  function Ri(e) {
1740
- if (e instanceof yt) return e.toDate();
1746
+ if (e instanceof bt) return e.toDate();
1741
1747
  if (typeof e != "string") return e;
1742
1748
  try {
1743
- return yt.parse(e).toDate();
1749
+ return bt.parse(e).toDate();
1744
1750
  } catch {
1745
1751
  return null;
1746
1752
  }
@@ -1791,7 +1797,7 @@ function Gi(e, t) {
1791
1797
  return n.size === 1 ? [...n][0] : void 0;
1792
1798
  }
1793
1799
  function Ki(e, t) {
1794
- return t.some((t) => Object.hasOwn(t, e.name));
1800
+ return !e.otherEntity && t.some((t) => Object.hasOwn(t, e.name));
1795
1801
  }
1796
1802
  function qi(e, t) {
1797
1803
  let n = e.id;
@@ -1939,25 +1945,37 @@ function Z(e) {
1939
1945
  var _a = /^(\d{4})-(\d{2})-(\d{2})$/, va = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;
1940
1946
  function ya(e) {
1941
1947
  if (typeof e == "boolean") return e ? "Yes" : "No";
1942
- if (typeof e == "string") return ba(e) ?? xa(e);
1948
+ if (Array.isArray(e)) return ba(e);
1949
+ if (typeof e == "string") return Sa(e) ?? Ca(e);
1943
1950
  }
1944
1951
  function ba(e) {
1952
+ if (e.length === 0) return "";
1953
+ let t = e.map(xa);
1954
+ return t.every((e) => e !== void 0) ? t.map((e) => ya(e) ?? String(e)).join(", ") : e.length === 1 ? "1 item" : `${e.length} items`;
1955
+ }
1956
+ function xa(e) {
1957
+ if (typeof e != "object" || !e) return e ?? "";
1958
+ if (Array.isArray(e)) return;
1959
+ let t = Object.values(e);
1960
+ return t.length === 1 && (t[0] === null || typeof t[0] != "object") ? t[0] ?? "" : void 0;
1961
+ }
1962
+ function Sa(e) {
1945
1963
  let t = _a.exec(e);
1946
1964
  if (!t) return;
1947
1965
  let n = new Date(2e3, Number(t[2]) - 1, Number(t[3]));
1948
1966
  return n.setFullYear(Number(t[1])), Number.isNaN(n.getTime()) || n.getMonth() !== Number(t[2]) - 1 ? void 0 : n.toLocaleDateString();
1949
1967
  }
1950
- function xa(e) {
1968
+ function Ca(e) {
1951
1969
  if (!va.test(e)) return;
1952
1970
  let t = new Date(e);
1953
1971
  return Number.isNaN(t.getTime()) ? void 0 : t.toLocaleString();
1954
1972
  }
1955
- function Sa(e) {
1956
- let t = ze(), n = p(void 0), r = f(() => oe(Oe(e.id, e.behaviors), C.DoubleClick), [e.behaviors, e.id]);
1973
+ function wa(e) {
1974
+ let t = Be(), n = p(void 0), r = f(() => se(ke(e.id, e.behaviors), C.DoubleClick), [e.behaviors, e.id]);
1957
1975
  l(() => () => clearTimeout(n.current), []);
1958
1976
  let i = s((e) => {
1959
1977
  if (clearTimeout(n.current), n.current = void 0, !t) return;
1960
- let i = (n) => n.path?.startsWith("item.") ? le({ subject: n.path }, e) : t.context.resolve(n);
1978
+ let i = (n) => n.path?.startsWith("item.") ? ue({ subject: n.path }, e) : t.context.resolve(n);
1961
1979
  vn(r, t.dispatcher, {
1962
1980
  ...t.context,
1963
1981
  subject: () => e,
@@ -1976,7 +1994,7 @@ function Sa(e) {
1976
1994
  };
1977
1995
  }
1978
1996
  // src/stageSceneRouting.ts
1979
- var Ca = {
1997
+ var Ta = {
1980
1998
  routedSlots: {},
1981
1999
  tabSlots: {},
1982
2000
  filters: {},
@@ -1984,7 +2002,7 @@ var Ca = {
1984
2002
  segmentScreens: {},
1985
2003
  slotDefaults: {}
1986
2004
  };
1987
- function wa(e) {
2005
+ function Ea(e) {
1988
2006
  let t = [...(e.layouts ?? []).flatMap((e) => e.slots ?? []), ...(e.screenTemplates ?? []).flatMap((e) => e.slots ?? [])], n = {};
1989
2007
  for (let e of t) e.role !== A.Panel && (e.routed || (e.routedBy?.length ?? 0) > 0) && (n[e.name] = e.routedBy ?? []);
1990
2008
  let r = [
@@ -1998,11 +2016,11 @@ function wa(e) {
1998
2016
  ...(e.outletLevels ?? []).flatMap((e) => [...(e.refinements ?? []).flatMap((e) => e.items ?? []), ...(e.contributions ?? []).flatMap((e) => e.items ?? [])]),
1999
2017
  ...(e.screens ?? []).flatMap((e) => (e.outletContributions ?? []).flatMap((e) => e.items ?? []))
2000
2018
  ], o = {};
2001
- for (let e of Ta(a)) e.kind === E.Filter && (o[e.sets?.parameter ?? e.id] = e.sets?.query);
2019
+ for (let e of Da(a)) e.kind === E.Filter && (o[e.sets?.parameter ?? e.id] = e.sets?.query);
2002
2020
  let s = {}, c = {};
2003
2021
  for (let t of e.screens ?? []) {
2004
- s[fe(t.name)] = t.name;
2005
- for (let e of Object.values(t.slotContent ?? {}).flat().flatMap(Ea)) {
2022
+ s[pe(t.name)] = t.name;
2023
+ for (let e of Object.values(t.slotContent ?? {}).flat().flatMap(Oa)) {
2006
2024
  let t = e.properties ?? {};
2007
2025
  e.componentName === "core:slot" && typeof t.shows == "string" && typeof t.name == "string" && (c[t.name] = t.shows);
2008
2026
  }
@@ -2016,23 +2034,23 @@ function wa(e) {
2016
2034
  slotDefaults: c
2017
2035
  };
2018
2036
  }
2019
- function Ta(e) {
2020
- return e.flatMap((e) => e.kind === E.Group ? [e, ...Ta(e.items ?? [])] : [e]);
2037
+ function Da(e) {
2038
+ return e.flatMap((e) => e.kind === E.Group ? [e, ...Da(e.items ?? [])] : [e]);
2021
2039
  }
2022
- function Ea(e) {
2040
+ function Oa(e) {
2023
2041
  let t = e.slots ?? {};
2024
- return [e, ...Object.values(t).flat().flatMap(Ea)];
2042
+ return [e, ...Object.values(t).flat().flatMap(Oa)];
2025
2043
  }
2026
- var Da = "@";
2027
- function Oa(e, t) {
2028
- let n = e.indexOf("?"), r = n < 0 ? e : e.slice(0, n), i = n < 0 ? "" : e.slice(n + 1), a = r.split("/").filter((e) => e.length > 0), o = a.findIndex((e) => e.startsWith(Da)), s = (o < 0 ? a : a.slice(0, o)).join("/"), c = {}, l = {};
2044
+ var ka = "@";
2045
+ function Aa(e, t) {
2046
+ let n = e.indexOf("?"), r = n < 0 ? e : e.slice(0, n), i = n < 0 ? "" : e.slice(n + 1), a = r.split("/").filter((e) => e.length > 0), o = a.findIndex((e) => e.startsWith(ka)), s = (o < 0 ? a : a.slice(0, o)).join("/"), c = {}, l = {};
2029
2047
  for (let e = o; e >= 0 && e < a.length;) {
2030
2048
  let n = e + 1;
2031
- for (; n < a.length && !a[n].startsWith(Da);) n++;
2049
+ for (; n < a.length && !a[n].startsWith(ka);) n++;
2032
2050
  let r = decodeURIComponent(a[e].slice(1)), i = a.slice(e + 1, n).join("/"), o = r.indexOf(".");
2033
2051
  if (o > 0) i && (l[r.slice(o + 1)] = decodeURIComponent(i));
2034
2052
  else if (t.routedSlots[r]) {
2035
- let e = Ie(i, t.routedSlots[r]), n = (e.segment ? t.segmentScreens[e.segment] : void 0) ?? t.slotDefaults[r];
2053
+ let e = Le(i, t.routedSlots[r]), n = (e.segment ? t.segmentScreens[e.segment] : void 0) ?? t.slotDefaults[r];
2036
2054
  c[r] = n ? {
2037
2055
  ...e,
2038
2056
  screen: n
@@ -2052,14 +2070,14 @@ function Oa(e, t) {
2052
2070
  }
2053
2071
  };
2054
2072
  }
2055
- function ka(e, t, n) {
2056
- let r = e ?? "", i = r.indexOf("?"), a = i < 0 ? r : r.slice(0, i), o = i < 0 ? "" : r.slice(i + 1), s = a.split("/").filter((e) => e.length > 0).map(Aa);
2073
+ function ja(e, t, n) {
2074
+ let r = e ?? "", i = r.indexOf("?"), a = i < 0 ? r : r.slice(0, i), o = i < 0 ? "" : r.slice(i + 1), s = a.split("/").filter((e) => e.length > 0).map(Ma);
2057
2075
  for (let [e, r] of Object.entries(n.routedSlots)) {
2058
2076
  let i = t.slots[e];
2059
- i && s.push(`${Da}${encodeURIComponent(e)}`, ...Le(i, r).split("/").filter((e) => e.length > 0).map(Aa));
2077
+ i && s.push(`${ka}${encodeURIComponent(e)}`, ...Re(i, r).split("/").filter((e) => e.length > 0).map(Ma));
2060
2078
  for (let [r, i] of Object.entries(n.tabSlots)) {
2061
2079
  let n = t.tabs[r];
2062
- i === e && n && s.push(`${Da}${encodeURIComponent(e)}.${encodeURIComponent(r)}`, Aa(encodeURIComponent(n)));
2080
+ i === e && n && s.push(`${ka}${encodeURIComponent(e)}.${encodeURIComponent(r)}`, Ma(encodeURIComponent(n)));
2063
2081
  }
2064
2082
  }
2065
2083
  let c = new URLSearchParams(o);
@@ -2067,20 +2085,20 @@ function ka(e, t, n) {
2067
2085
  let l = c.toString();
2068
2086
  return l ? `${s.join("/")}?${l}` : s.join("/");
2069
2087
  }
2070
- function Aa(e) {
2071
- return e.startsWith(Da) ? `%40${e.slice(1)}` : e;
2088
+ function Ma(e) {
2089
+ return e.startsWith(ka) ? `%40${e.slice(1)}` : e;
2072
2090
  }
2073
- var ja = "sceneNavigation";
2074
- function Ma(e, t, n) {
2075
- let r = () => t === "hash" ? e.location.hash.replace(/^#\/?/, "") : `${e.location.pathname}${e.location.search}`.replace(/^\//, ""), i = (n) => t === "hash" ? `${e.location.pathname}${e.location.search}#/${n}` : `/${n}`, a = () => e.history.state?.[ja], o = (e) => e === void 0 ? void 0 : Oa(e, n).scene, s = Oa(r(), n).route, c, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = () => l.forEach((e) => e()), f = (t, r, a) => {
2076
- let o = a ? { [ja]: a } : e.history.state, c = i(ka(r, s, n));
2091
+ var Na = "sceneNavigation";
2092
+ function Pa(e, t, n) {
2093
+ let r = () => t === "hash" ? e.location.hash.replace(/^#\/?/, "") : `${e.location.pathname}${e.location.search}`.replace(/^\//, ""), i = (n) => t === "hash" ? `${e.location.pathname}${e.location.search}#/${n}` : `/${n}`, a = () => e.history.state?.[Na], o = (e) => e === void 0 ? void 0 : Aa(e, n).scene, s = Aa(r(), n).route, c, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = () => l.forEach((e) => e()), f = (t, r, a) => {
2094
+ let o = a ? { [Na]: a } : e.history.state, c = i(ja(r, s, n));
2077
2095
  t === "push" ? e.history.pushState(o, "", c) : e.history.replaceState(o, "", c);
2078
2096
  }, p = (e, t) => {
2079
2097
  e !== s && (s = e, d(), t && f(t, o(r())));
2080
2098
  }, m = () => {
2081
2099
  c = void 0;
2082
- let e = Oa(r(), n), t = Na(s, e.route, n);
2083
- Pa(t, s) || (s = t, d()), u.forEach((t) => t(e.scene, a()));
2100
+ let e = Aa(r(), n), t = Fa(s, e.route, n);
2101
+ Ia(t, s) || (s = t, d()), u.forEach((t) => t(e.scene, a()));
2084
2102
  }, h = !1, g = () => {
2085
2103
  h || (h = !0, e.addEventListener("popstate", m), t === "hash" && e.addEventListener("hashchange", m));
2086
2104
  }, _ = () => {
@@ -2091,7 +2109,7 @@ function Ma(e, t, n) {
2091
2109
  location: () => o(r()),
2092
2110
  state: a,
2093
2111
  push: (e) => {
2094
- o(e.url) === o(r()) ? (e.dialog && !a()?.dialog && (c = a()), f("replace", e.url, e)) : (c = void 0, s = Pe, d(), f("push", e.url, e));
2112
+ o(e.url) === o(r()) ? (e.dialog && !a()?.dialog && (c = a()), f("replace", e.url, e)) : (c = void 0, s = Fe, d(), f("push", e.url, e));
2095
2113
  },
2096
2114
  replace: (e) => f("replace", e.url, e),
2097
2115
  back: () => {
@@ -2106,16 +2124,16 @@ function Ma(e, t, n) {
2106
2124
  subscribe: (e) => (l.add(e), g(), () => {
2107
2125
  l.delete(e), _();
2108
2126
  }),
2109
- openInSlot: (e, t) => p(Ye(s, e, t), n.routedSlots[e] ? "push" : void 0),
2110
- closeSlot: (e) => p(s.slots[e] ? Je(s, e) : s, n.routedSlots[e] ? "push" : void 0),
2111
- selectTab: (e, t) => p(s.tabs[e] === t ? s : Xe(s, e, t), n.tabSlots[e] ? "push" : void 0),
2112
- setQueryParameter: (e, t) => p((s.query[e] ?? "") === (t ?? "") ? s : qe(s, e, t), n.pageRouted ? "replace" : void 0),
2127
+ openInSlot: (e, t) => p(Xe(s, e, t), n.routedSlots[e] ? "push" : void 0),
2128
+ closeSlot: (e) => p(s.slots[e] ? Ye(s, e) : s, n.routedSlots[e] ? "push" : void 0),
2129
+ selectTab: (e, t) => p(s.tabs[e] === t ? s : Ze(s, e, t), n.tabSlots[e] ? "push" : void 0),
2130
+ setQueryParameter: (e, t) => p((s.query[e] ?? "") === (t ?? "") ? s : Je(s, e, t), n.pageRouted ? "replace" : void 0),
2113
2131
  dispose: () => {
2114
2132
  l.clear(), u.clear(), _();
2115
2133
  }
2116
2134
  };
2117
2135
  }
2118
- function Na(e, t, n) {
2136
+ function Fa(e, t, n) {
2119
2137
  let r = Object.fromEntries(Object.entries(e.slots).filter(([e]) => !n.routedSlots[e])), i = Object.fromEntries(Object.entries(e.tabs).filter(([e]) => !n.tabSlots[e]));
2120
2138
  return {
2121
2139
  slots: {
@@ -2129,10 +2147,10 @@ function Na(e, t, n) {
2129
2147
  query: n.pageRouted ? t.query : e.query
2130
2148
  };
2131
2149
  }
2132
- function Pa(e, t) {
2150
+ function Ia(e, t) {
2133
2151
  return JSON.stringify(e) === JSON.stringify(t);
2134
2152
  }
2135
- function Fa(e) {
2153
+ function La(e) {
2136
2154
  let t = h(e.subscribe, e.getState, e.getState);
2137
2155
  return f(() => ({
2138
2156
  state: t,
@@ -2142,21 +2160,21 @@ function Fa(e) {
2142
2160
  setQueryParameter: e.setQueryParameter
2143
2161
  }), [e, t]);
2144
2162
  }
2145
- var Ia = a(Ca);
2146
- function La(e, t, n) {
2163
+ var Ra = a(Ta);
2164
+ function za(e, t, n) {
2147
2165
  return Object.fromEntries(Object.entries(t).filter(([t, r]) => r !== "" && t in e.filters && (e.filters[t] === void 0 || e.filters[t] === n)));
2148
2166
  }
2149
- function Ra(e) {
2150
- let t = c(Ia), n = We(), r = JSON.stringify(La(t, n, e));
2167
+ function Ba(e) {
2168
+ let t = c(Ra), n = Ge(), r = JSON.stringify(za(t, n, e));
2151
2169
  return f(() => JSON.parse(r), [r]);
2152
2170
  }
2153
2171
  // src/stageDialogScreens.ts
2154
- var za = "Stage:confirmDialog", Ba = "ConfirmDialog";
2155
- function Va(e, t) {
2172
+ var Va = "Stage:confirmDialog", Ha = "ConfirmDialog";
2173
+ function Ua(e, t) {
2156
2174
  let n = new Set(t.map((e) => e.name));
2157
2175
  return e.map((t) => {
2158
- if (t.screenTemplate !== Ba || n.has(Ba)) return t;
2159
- let r = Ha(t), i = e.find((e) => e.name !== t.name)?.name, a = z(`confirm-dialog-${t.name}`, za, {
2176
+ if (t.screenTemplate !== Ha || n.has(Ha)) return t;
2177
+ let r = Wa(t), i = e.find((e) => e.name !== t.name)?.name, a = R(`confirm-dialog-${t.name}`, Va, {
2160
2178
  title: t.name,
2161
2179
  decisions: r,
2162
2180
  home: i
@@ -2169,99 +2187,99 @@ function Va(e, t) {
2169
2187
  };
2170
2188
  });
2171
2189
  }
2172
- function Ha(e) {
2190
+ function Wa(e) {
2173
2191
  let t = [];
2174
- for (let n of Ua(Object.values(e.slotContent).flat())) {
2175
- let r = Wa(n.properties.command);
2192
+ for (let n of Ga(Object.values(e.slotContent).flat())) {
2193
+ let r = Ka(n.properties.command);
2176
2194
  r && !t.some((e) => e.command === r) && t.push({
2177
2195
  command: r,
2178
- label: Wa(n.properties.label),
2179
- navigateToScreen: Wa(n.properties.navigateToScreen),
2180
- typeName: Wa(n.properties.typeName),
2181
- route: Wa(n.properties.route),
2196
+ label: Ka(n.properties.label),
2197
+ navigateToScreen: Ka(n.properties.navigateToScreen),
2198
+ typeName: Ka(n.properties.typeName),
2199
+ route: Ka(n.properties.route),
2182
2200
  form: e.forms.find((e) => e.forCommand === r)
2183
2201
  });
2184
2202
  }
2185
2203
  return t;
2186
2204
  }
2187
- function Ua(e) {
2205
+ function Ga(e) {
2188
2206
  return e.flatMap((e) => {
2189
2207
  let t = e;
2190
- return t.componentName === "core:action" ? [t] : Ua(Object.values(t.slots ?? {}).flat());
2208
+ return t.componentName === "core:action" ? [t] : Ga(Object.values(t.slots ?? {}).flat());
2191
2209
  });
2192
2210
  }
2193
- function Wa(e) {
2211
+ function Ka(e) {
2194
2212
  return typeof e == "string" && e !== "" ? e : void 0;
2195
2213
  }
2196
2214
  // src/StageConfirmDialog.tsx
2197
- function Ga({ element: e }) {
2215
+ function qa({ element: e }) {
2198
2216
  let { routes: t, parameters: n, queries: r, selections: i } = W(), [a, o] = m(), s = p(null), c = typeof e.properties.title == "string" ? e.properties.title : "", u = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], d = typeof e.properties.home == "string" ? e.properties.home : void 0, f = u.find((e) => e.command === a), h = Xi(i, r);
2199
- return l(() => s.current?.focus(), []), /* @__PURE__ */ H("section", {
2217
+ return l(() => s.current?.focus(), []), /* @__PURE__ */ V("section", {
2200
2218
  className: "scene-slice-dialog stage-confirm-dialog",
2201
2219
  role: "dialog",
2202
2220
  "aria-label": J(c),
2203
- "data-stage-component": za,
2221
+ "data-stage-component": Va,
2204
2222
  children: [
2205
- /* @__PURE__ */ V("header", {
2223
+ /* @__PURE__ */ B("header", {
2206
2224
  className: "scene-slice-dialog-header",
2207
- children: /* @__PURE__ */ V("h2", {
2225
+ children: /* @__PURE__ */ B("h2", {
2208
2226
  className: "scene-slice-dialog-title",
2209
2227
  children: J(c)
2210
2228
  })
2211
2229
  }),
2212
- /* @__PURE__ */ V("div", {
2230
+ /* @__PURE__ */ B("div", {
2213
2231
  className: "stage-confirm-dialog__decisions",
2214
- children: u.map((e, t) => /* @__PURE__ */ V("button", {
2232
+ children: u.map((e, t) => /* @__PURE__ */ B("button", {
2215
2233
  ref: t === 0 ? s : void 0,
2216
2234
  type: "button",
2217
2235
  className: t === 0 ? "scene-slice-dialog-submit stage-confirm-dialog__decision" : "scene-slice-dialog-cancel stage-confirm-dialog__decision",
2218
2236
  "data-emphasis": t === 0 ? "primary" : "secondary",
2219
2237
  "aria-pressed": e.command === a,
2220
2238
  onClick: () => o(e.command),
2221
- children: qa(e)
2239
+ children: Ya(e)
2222
2240
  }, e.command))
2223
2241
  }),
2224
- f && /* @__PURE__ */ V(mi, { children: /* @__PURE__ */ V(Oi, { element: Xa(f, t?.commandSchemas?.[f.command] ?? "", n, h) }, f.command) }),
2225
- /* @__PURE__ */ V("footer", {
2242
+ f && /* @__PURE__ */ B(mi, { children: /* @__PURE__ */ B(Oi, { element: Qa(f, t?.commandSchemas?.[f.command] ?? "", n, h) }, f.command) }),
2243
+ /* @__PURE__ */ B("footer", {
2226
2244
  className: "scene-slice-dialog-footer",
2227
- children: /* @__PURE__ */ V("button", {
2245
+ children: /* @__PURE__ */ B("button", {
2228
2246
  type: "button",
2229
2247
  className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
2230
- onClick: () => Ka(u, d),
2248
+ onClick: () => Ja(u, d),
2231
2249
  children: "Cancel"
2232
2250
  })
2233
2251
  })
2234
2252
  ]
2235
2253
  });
2236
2254
  }
2237
- function Ka(e, t) {
2255
+ function Ja(e, t) {
2238
2256
  let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
2239
2257
  r && pn(r, {});
2240
2258
  }
2241
- function qa(e) {
2259
+ function Ya(e) {
2242
2260
  return e.label ?? J(e.command);
2243
2261
  }
2244
- function Ja(e, t, n) {
2262
+ function Xa(e, t, n) {
2245
2263
  return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || Gi(e, n) !== void 0;
2246
2264
  }
2247
- function Ya(e, t, n, r) {
2265
+ function Za(e, t, n, r) {
2248
2266
  let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
2249
2267
  name: e.name,
2250
2268
  label: e.name
2251
- })), o = new Set(t.filter((e) => Ja(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));
2269
+ })), o = new Set(t.filter((e) => Xa(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));
2252
2270
  return [...s, ...l.map((e) => ({
2253
2271
  name: e.name,
2254
2272
  label: J(e.name)
2255
2273
  }))];
2256
2274
  }
2257
- function Xa(e, t, n, r) {
2258
- let i = Ya(e, Y(t), n, r);
2275
+ function Qa(e, t, n, r) {
2276
+ let i = Za(e, Y(t), n, r);
2259
2277
  return {
2260
2278
  id: `confirm-${e.command}`,
2261
- componentName: za,
2279
+ componentName: Va,
2262
2280
  properties: {
2263
2281
  command: e.command,
2264
- label: qa(e),
2282
+ label: Ya(e),
2265
2283
  submitLabel: "Confirm",
2266
2284
  typeName: e.typeName,
2267
2285
  route: e.route,
@@ -2275,13 +2293,13 @@ function Xa(e, t, n, r) {
2275
2293
  slots: {}
2276
2294
  };
2277
2295
  }
2278
- function Za(e) {
2296
+ function $a(e) {
2279
2297
  return typeof e == "object" && !!e && !Array.isArray(e);
2280
2298
  }
2281
- function Qa(e, t) {
2299
+ function eo(e, t) {
2282
2300
  if (!Array.isArray(e) || !Array.isArray(t)) return;
2283
- let n = new Map(e.filter(Za).map((e) => [JSON.stringify(e.id), e.column]));
2284
- for (let e of t.filter(Za)) {
2301
+ let n = new Map(e.filter($a).map((e) => [JSON.stringify(e.id), e.column]));
2302
+ for (let e of t.filter($a)) {
2285
2303
  let t = JSON.stringify(e.id);
2286
2304
  if (n.has(t) && n.get(t) !== e.column) return {
2287
2305
  item: {
@@ -2292,9 +2310,9 @@ function Qa(e, t) {
2292
2310
  };
2293
2311
  }
2294
2312
  }
2295
- function $a(e, t, n, r) {
2313
+ function to(e, t, n, r) {
2296
2314
  if (!Array.isArray(e)) return;
2297
- let i = e.filter(Za).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
2315
+ let i = e.filter($a).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
2298
2316
  if (i !== void 0) return {
2299
2317
  item: {
2300
2318
  ...i,
@@ -2304,12 +2322,12 @@ function $a(e, t, n, r) {
2304
2322
  previous: t.previous
2305
2323
  };
2306
2324
  }
2307
- function eo(e, t) {
2308
- let n = ne({ dataContext: { item: e.item } });
2325
+ function no(e, t) {
2326
+ let n = re({ dataContext: { item: e.item } });
2309
2327
  return (r) => r.path === "value" ? e.value : r.path === "previous" ? e.previous : r.path === "item" || r.path?.startsWith("item.") ? n(r) : t(r);
2310
2328
  }
2311
- function to(e, t) {
2312
- let n = ze(), r = W(), { element: i, rowsProperty: a, idField: o, valueField: c } = e, l = f(() => oe(Oe(i.id, i.behaviors), C.Change), [i.behaviors, i.id]), u = p(void 0), d = p(!1), [h, g] = m(0), _ = p({
2329
+ function ro(e, t) {
2330
+ let n = Be(), r = W(), { element: i, rowsProperty: a, idField: o, valueField: c } = e, l = f(() => se(ke(i.id, i.behaviors), C.Change), [i.behaviors, i.id]), u = p(void 0), d = p(!1), [h, g] = m(0), _ = p({
2313
2331
  scope: n,
2314
2332
  data: r,
2315
2333
  element: i,
@@ -2322,14 +2340,14 @@ function to(e, t) {
2322
2340
  bindings: l
2323
2341
  };
2324
2342
  let v = s((e, t) => {
2325
- let { scope: n, data: r, element: i, bindings: s } = _.current, l = Qa(e, t);
2343
+ let { scope: n, data: r, element: i, bindings: s } = _.current, l = eo(e, t);
2326
2344
  if (!n || s.length === 0 || l === void 0) return;
2327
- let u = $a(i.properties[a], l, o, c);
2345
+ let u = to(i.properties[a], l, o, c);
2328
2346
  if (u === void 0) return;
2329
2347
  let d = {
2330
2348
  ...n.context,
2331
2349
  subject: () => u.item,
2332
- resolve: eo(u, n.context.resolve)
2350
+ resolve: no(u, n.context.resolve)
2333
2351
  }, f = !1, p = !1;
2334
2352
  vn(s, {
2335
2353
  ...n.dispatcher,
@@ -2361,24 +2379,24 @@ function to(e, t) {
2361
2379
  revision: h
2362
2380
  };
2363
2381
  }
2364
- function no(e) {
2365
- let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = to({
2382
+ function io(e) {
2383
+ let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = ro({
2366
2384
  element: t,
2367
2385
  rowsProperty: "cards",
2368
2386
  idField: typeof t.properties.cardId == "string" ? t.properties.cardId : "id",
2369
2387
  valueField: n
2370
- }, e.bindingOutputs), i = Qe;
2371
- return r.declared ? /* @__PURE__ */ V(i, {
2388
+ }, e.bindingOutputs), i = $e;
2389
+ return r.declared ? /* @__PURE__ */ B(i, {
2372
2390
  ...e,
2373
2391
  interactions: {
2374
2392
  ...e.interactions,
2375
2393
  onChange: r.onChange
2376
2394
  },
2377
2395
  bindingOutputs: r.outputs
2378
- }, r.revision) : /* @__PURE__ */ V(i, { ...e });
2396
+ }, r.revision) : /* @__PURE__ */ B(i, { ...e });
2379
2397
  }
2380
- var ro = ke(rt, L.KanbanBoard), io = "Stage:commandForm";
2381
- function ao(e, t, n = {}) {
2398
+ var ao = Ae(it, I.KanbanBoard), oo = "Stage:commandForm";
2399
+ function so(e, t, n = {}) {
2382
2400
  return {
2383
2401
  id: e,
2384
2402
  componentName: "",
@@ -2390,19 +2408,19 @@ function Q(e, t, n = "") {
2390
2408
  let r = e.properties[t];
2391
2409
  return typeof r == "string" ? r : n;
2392
2410
  }
2393
- function oo(e, t, n) {
2411
+ function co(e, t, n) {
2394
2412
  let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
2395
2413
  return typeof r == "string" && t?.includes(r) ? J(r) : ya(e) ?? String(e ?? "");
2396
2414
  }
2397
- function so(e, t) {
2415
+ function lo(e, t) {
2398
2416
  let n = e.properties.queryArguments;
2399
- if (!mo(n)) return {
2417
+ if (!go(n)) return {
2400
2418
  values: {},
2401
2419
  ready: !0
2402
2420
  };
2403
2421
  let r = {}, i = !0;
2404
2422
  for (let [e, a] of Object.entries(n)) {
2405
- let n = po(a) ? t.resolveBinding(a) : a;
2423
+ let n = ho(a) ? t.resolveBinding(a) : a;
2406
2424
  r[e] = n, (n == null || n === "") && (i = !1);
2407
2425
  }
2408
2426
  return {
@@ -2410,7 +2428,7 @@ function so(e, t) {
2410
2428
  ready: i
2411
2429
  };
2412
2430
  }
2413
- function co(e, t) {
2431
+ function uo(e, t) {
2414
2432
  let n = (e.slots.columns ?? []).map((e) => {
2415
2433
  let t = e.properties;
2416
2434
  return {
@@ -2425,12 +2443,12 @@ function co(e, t) {
2425
2443
  }));
2426
2444
  return n.length > 0 ? n : r;
2427
2445
  }
2428
- function lo(e, t) {
2446
+ function fo(e, t) {
2429
2447
  return e[t] ?? e.id ?? e.key;
2430
2448
  }
2431
- function uo({ element: e, slots: t }) {
2432
- let n = W(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), a = Ra(Q(e, "query") || void 0), o = f(() => {
2433
- let t = so(e, n);
2449
+ function po({ element: e, slots: t }) {
2450
+ let n = W(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), a = Ba(Q(e, "query") || void 0), o = f(() => {
2451
+ let t = lo(e, n);
2434
2452
  return {
2435
2453
  ...t,
2436
2454
  values: {
@@ -2448,10 +2466,10 @@ function uo({ element: e, slots: t }) {
2448
2466
  route: i || void 0,
2449
2467
  arguments: o.values,
2450
2468
  ready: o.ready
2451
- }), p = co(e, s), m = Q(e, "navigateOnRowClickToScreen"), h = Q(e, "navigateOnRowClickByParameter"), g = Q(e, "dataKey") || h || "id", _ = n.selections[e.id], v = h ? n.parameters[h] : void 0, y = Sa(e);
2469
+ }), p = uo(e, s), m = Q(e, "navigateOnRowClickToScreen"), h = Q(e, "navigateOnRowClickByParameter"), g = Q(e, "dataKey") || h || "id", _ = n.selections[e.id], v = h ? n.parameters[h] : void 0, y = wa(e);
2452
2470
  l(() => {
2453
2471
  if (!_) return;
2454
- let t = lo(_, g), r = t === void 0 ? void 0 : s.find((e) => lo(e, g) === t);
2472
+ let t = fo(_, g), r = t === void 0 ? void 0 : s.find((e) => fo(e, g) === t);
2455
2473
  r && r !== _ ? n.selectRow(e.id, r) : !r && t !== void 0 && !u && n.clearSelection(e.id);
2456
2474
  }, [
2457
2475
  n,
@@ -2466,8 +2484,8 @@ function uo({ element: e, slots: t }) {
2466
2484
  _ && n.clearSelection(e.id);
2467
2485
  return;
2468
2486
  }
2469
- if (_ && String(lo(_, g)) === v) return;
2470
- let t = s.find((e) => String(lo(e, g)) === v);
2487
+ if (_ && String(fo(_, g)) === v) return;
2488
+ let t = s.find((e) => String(fo(e, g)) === v);
2471
2489
  t && n.selectRow(e.id, t);
2472
2490
  }, [
2473
2491
  n,
@@ -2479,7 +2497,7 @@ function uo({ element: e, slots: t }) {
2479
2497
  _
2480
2498
  ]);
2481
2499
  let b = (t) => {
2482
- let r = lo(t, g);
2500
+ let r = fo(t, g);
2483
2501
  if (h && r != null) {
2484
2502
  let i = {
2485
2503
  ...m && m !== n.screen ? {} : n.parameters,
@@ -2488,10 +2506,10 @@ function uo({ element: e, slots: t }) {
2488
2506
  m && m !== n.screen || n.selectRow(e.id, t), pn(m || n.screen, i);
2489
2507
  } else n.selectRow(e.id, t);
2490
2508
  };
2491
- return !Q(e, "query") && !i && !Xt(r) ? /* @__PURE__ */ H("section", {
2509
+ return !Q(e, "query") && !i && !Xt(r) ? /* @__PURE__ */ V("section", {
2492
2510
  className: "stage-table",
2493
2511
  "data-scene-id": e.id,
2494
- children: [/* @__PURE__ */ H("p", {
2512
+ children: [/* @__PURE__ */ V("p", {
2495
2513
  className: "stage-note",
2496
2514
  children: [
2497
2515
  "No query is exposed for ",
@@ -2499,19 +2517,19 @@ function uo({ element: e, slots: t }) {
2499
2517
  " yet."
2500
2518
  ]
2501
2519
  }), t.columns]
2502
- }) : /* @__PURE__ */ H("section", {
2520
+ }) : /* @__PURE__ */ V("section", {
2503
2521
  className: "stage-table",
2504
2522
  "data-scene-id": e.id,
2505
2523
  children: [
2506
- (u || d) && /* @__PURE__ */ V(St, {
2524
+ (u || d) && /* @__PURE__ */ B(Ct, {
2507
2525
  severity: "info",
2508
2526
  text: "Loading…"
2509
2527
  }),
2510
- c && /* @__PURE__ */ V(St, {
2528
+ c && /* @__PURE__ */ B(Ct, {
2511
2529
  severity: "error",
2512
2530
  text: c
2513
2531
  }),
2514
- _ && /* @__PURE__ */ V(U, {
2532
+ _ && /* @__PURE__ */ B(H, {
2515
2533
  type: "button",
2516
2534
  size: "small",
2517
2535
  onClick: () => {
@@ -2521,12 +2539,12 @@ function uo({ element: e, slots: t }) {
2521
2539
  },
2522
2540
  children: "Clear selection"
2523
2541
  }),
2524
- /* @__PURE__ */ H("table", {
2542
+ /* @__PURE__ */ V("table", {
2525
2543
  "aria-label": Q(e, "label", Q(e, "typeName", "Results")),
2526
- children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ V("tr", { children: p.map((e) => /* @__PURE__ */ V("th", {
2544
+ children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: p.map((e) => /* @__PURE__ */ B("th", {
2527
2545
  scope: "col",
2528
2546
  children: e.label
2529
- }, e.property)) }) }), /* @__PURE__ */ H("tbody", { children: [s.map((e, t) => /* @__PURE__ */ V("tr", {
2547
+ }, e.property)) }) }), /* @__PURE__ */ V("tbody", { children: [s.map((e, t) => /* @__PURE__ */ B("tr", {
2530
2548
  "aria-selected": _ === e,
2531
2549
  tabIndex: 0,
2532
2550
  onClick: () => y.click(e, () => b(e)),
@@ -2534,8 +2552,8 @@ function uo({ element: e, slots: t }) {
2534
2552
  onKeyDown: (t) => {
2535
2553
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), b(e));
2536
2554
  },
2537
- children: p.map((t) => /* @__PURE__ */ V("td", { children: oo(e[t.property], t.options, t.optionValues) }, t.property))
2538
- }, String(lo(e, g) ?? t))), /* @__PURE__ */ V(fo, {
2555
+ children: p.map((t) => /* @__PURE__ */ B("td", { children: co(e[t.property], t.options, t.optionValues) }, t.property))
2556
+ }, String(fo(e, g) ?? t))), /* @__PURE__ */ B(mo, {
2539
2557
  rowCount: s.length,
2540
2558
  columnCount: p.length,
2541
2559
  loading: u,
@@ -2545,72 +2563,72 @@ function uo({ element: e, slots: t }) {
2545
2563
  ]
2546
2564
  });
2547
2565
  }
2548
- function fo({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
2549
- return e !== 0 || n || r ? null : /* @__PURE__ */ V("tr", { children: /* @__PURE__ */ V("td", {
2566
+ function mo({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
2567
+ return e !== 0 || n || r ? null : /* @__PURE__ */ B("tr", { children: /* @__PURE__ */ B("td", {
2550
2568
  colSpan: Math.max(t, 1),
2551
2569
  children: "No records found"
2552
2570
  }) });
2553
2571
  }
2554
- function po(e) {
2555
- return mo(e) && (typeof e.path == "string" || typeof e.kind == "string");
2572
+ function ho(e) {
2573
+ return go(e) && (typeof e.path == "string" || typeof e.kind == "string");
2556
2574
  }
2557
- function mo(e) {
2575
+ function go(e) {
2558
2576
  return typeof e == "object" && !!e && !Array.isArray(e);
2559
2577
  }
2560
- function ho({ element: e, interactions: t, slots: n }) {
2561
- return Dn(e) ? /* @__PURE__ */ V(On, {
2578
+ function _o({ element: e, interactions: t, slots: n }) {
2579
+ return Dn(e) ? /* @__PURE__ */ B(On, {
2562
2580
  element: e,
2563
2581
  interactions: t
2564
- }) : /* @__PURE__ */ V(yo, {
2582
+ }) : /* @__PURE__ */ B(xo, {
2565
2583
  element: e,
2566
2584
  interactions: t,
2567
2585
  slots: n
2568
2586
  });
2569
2587
  }
2570
- function go(e) {
2571
- let { routes: t, parameters: n } = W(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = f(() => Y(r ?? ""), [r]), a = Hr(e), o = Ur(e, r), { selectableRows: s, selectedRows: c } = hi(), l = Q(e, "generationMode").toLowerCase() !== "manual", u = _o(e, a, o, l), d = l ? vo(e, r, i, n, a, o ? [] : s) : {};
2588
+ function vo(e) {
2589
+ let { routes: t, parameters: n } = W(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = t?.commandSchemas?.[Q(e, "command")], a = f(() => Y(r ?? "", i), [r, i]), o = Hr(e), s = Ur(e, r), { selectableRows: c, selectedRows: l } = hi(), u = Q(e, "generationMode").toLowerCase() !== "manual", d = yo(e, o, s, u), p = u ? bo(e, r, a, n, o, s ? [] : c) : {};
2572
2590
  return {
2573
2591
  element: {
2574
2592
  ...e,
2575
2593
  properties: {
2576
2594
  ...e.properties,
2577
- ...d,
2595
+ ...p,
2578
2596
  ...r ? { schema: r } : {},
2579
- createsEntity: o,
2580
- rowAction: u
2597
+ createsEntity: s,
2598
+ rowAction: d
2581
2599
  }
2582
2600
  },
2583
- subject: a,
2584
- properties: i,
2585
- selectedRows: c
2601
+ subject: o,
2602
+ properties: a,
2603
+ selectedRows: l
2586
2604
  };
2587
2605
  }
2588
- function _o(e, t, n, r) {
2606
+ function yo(e, t, n, r) {
2589
2607
  return n || t !== void 0 ? !1 : r || e.properties.rowAction === !0;
2590
2608
  }
2591
- function vo(e, t, n, r, i, a) {
2609
+ function bo(e, t, n, r, i, a) {
2592
2610
  let o = e.properties.fields;
2593
- if (!Array.isArray(o) || o.length === 0) return Io(t, n, r, i, a);
2611
+ if (!Array.isArray(o) || o.length === 0) return Ro(t, n, r, i, a);
2594
2612
  if (a.length === 0 || i === "screen" || i === void 0 && e.properties.rowAction !== !0 && n.filter((e) => e.identifier).length > 1) return {};
2595
- let s = new Set(n.filter((e) => Po(e, i, a)).map((e) => e.name));
2613
+ let s = new Set(n.filter((e) => Io(e, i, a)).map((e) => e.name));
2596
2614
  return {
2597
- fields: o.filter((e) => !s.has(So(e))),
2615
+ fields: o.filter((e) => !s.has(wo(e))),
2598
2616
  generationMode: "manual"
2599
2617
  };
2600
2618
  }
2601
- function yo({ element: e, interactions: t }) {
2602
- let { element: n, subject: r, properties: i, selectedRows: a } = go(e), o = Q(n, "label") || J(Q(n, "command")), s = on(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = bo(n, r), l = Wr(r, a);
2603
- return s ? c.length > 0 || Gr(r, l) ? /* @__PURE__ */ V(U, {
2619
+ function xo({ element: e, interactions: t }) {
2620
+ let { element: n, subject: r, properties: i, selectedRows: a } = vo(e), o = Q(n, "label") || J(Q(n, "command")), s = on(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = So(n, r), l = Wr(r, a);
2621
+ return s ? c.length > 0 || Gr(r, l) ? /* @__PURE__ */ B(H, {
2604
2622
  type: "button",
2605
2623
  "data-scene-id": n.id,
2606
2624
  disabled: !0,
2607
2625
  title: "Select a row first",
2608
2626
  ...t,
2609
2627
  children: o
2610
- }) : /* @__PURE__ */ V(wo, {
2628
+ }) : /* @__PURE__ */ B(Eo, {
2611
2629
  element: l ? Yr(n, i, l) : n,
2612
2630
  label: o
2613
- }) : /* @__PURE__ */ V(U, {
2631
+ }) : /* @__PURE__ */ B(H, {
2614
2632
  type: "button",
2615
2633
  "data-scene-id": n.id,
2616
2634
  disabled: !0,
@@ -2619,42 +2637,42 @@ function yo({ element: e, interactions: t }) {
2619
2637
  children: o
2620
2638
  });
2621
2639
  }
2622
- function bo(e, t) {
2623
- let { parameters: n } = W(), r = Q(e, "schema"), i = e.properties.fields, a = f(() => Y(r), [r]), { selectableRows: o, selectedRows: s } = hi(), c = Array.isArray(i) ? i : [], l = xo(e, c) ? new Set(c.map(So).filter((e) => e !== "")) : void 0;
2624
- return !l || t !== void 0 || Ur(e, r) ? [] : Zi(a.filter((e) => !l.has(e.name)), n, s, o);
2640
+ function So(e, t) {
2641
+ let { parameters: n, routes: r } = W(), i = Q(e, "schema"), a = e.properties.fields, o = r?.commandSchemas?.[Q(e, "command")], s = f(() => Y(i, o), [i, o]), { selectableRows: c, selectedRows: l } = hi(), u = Array.isArray(a) ? a : [], d = Co(e, u) ? new Set(u.map(wo).filter((e) => e !== "")) : void 0;
2642
+ return !d || t !== void 0 || Ur(e, i) ? [] : Zi(s.filter((e) => !d.has(e.name)), n, l, c);
2625
2643
  }
2626
- function xo(e, t) {
2644
+ function Co(e, t) {
2627
2645
  return t.length > 0 || e.properties.rowAction === !0 || Q(e, "generationMode").toLowerCase() === "manual";
2628
2646
  }
2629
- function So(e) {
2630
- return mo(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2647
+ function wo(e) {
2648
+ return go(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2631
2649
  }
2632
- function Co(e) {
2650
+ function To(e) {
2633
2651
  let t = (e?.parentElement?.classList.contains("stage-toolbar-action") ? e.parentElement : e)?.previousElementSibling;
2634
2652
  return t?.classList.contains("stage-action") === !0 || t?.classList.contains("stage-toolbar-action") === !0;
2635
2653
  }
2636
- function wo({ element: e, label: t }) {
2654
+ function Eo({ element: e, label: t }) {
2637
2655
  let [n, r] = m(0), [i, a] = m(!1), [o, c] = m(!1), l = p(null);
2638
- d(() => c(Co(l.current)));
2656
+ d(() => c(To(l.current)));
2639
2657
  let u = s(() => {
2640
2658
  a(!1), r((e) => e + 1);
2641
- }, []), f = /* @__PURE__ */ V(wi.Provider, {
2659
+ }, []), f = /* @__PURE__ */ B(wi.Provider, {
2642
2660
  value: u,
2643
- children: /* @__PURE__ */ V(Oi, {
2661
+ children: /* @__PURE__ */ B(Oi, {
2644
2662
  element: e,
2645
2663
  cancellable: !0
2646
2664
  }, n)
2647
2665
  });
2648
- return /* @__PURE__ */ H("div", {
2666
+ return /* @__PURE__ */ V("div", {
2649
2667
  className: "stage-action",
2650
2668
  "data-scene-id": e.id,
2651
2669
  ref: l,
2652
- children: [/* @__PURE__ */ V(U, {
2670
+ children: [/* @__PURE__ */ B(H, {
2653
2671
  type: "button",
2654
2672
  variant: Dr(Q(e, "emphasis"), o),
2655
2673
  onClick: () => a(!0),
2656
2674
  children: t
2657
- }), /* @__PURE__ */ V(xt, {
2675
+ }), /* @__PURE__ */ B(St, {
2658
2676
  title: t,
2659
2677
  visible: i,
2660
2678
  onClose: () => a(!1),
@@ -2665,20 +2683,20 @@ function wo({ element: e, label: t }) {
2665
2683
  })]
2666
2684
  });
2667
2685
  }
2668
- function To(e) {
2669
- let t = e.element ?? ao("slice-dialog", {}), n = Be(), r = Re(n?.currentDialogParameters);
2670
- return /* @__PURE__ */ V(Sr, {
2686
+ function Do(e) {
2687
+ let t = e.element ?? so("slice-dialog", {}), n = Ve(), r = ze(n?.currentDialogParameters);
2688
+ return /* @__PURE__ */ B(Sr, {
2671
2689
  slice: Q(t, "slice") || r?.slice || Q(t, "command") || r?.command,
2672
- children: /* @__PURE__ */ V(Eo, { ...e })
2690
+ children: /* @__PURE__ */ B(Oo, { ...e })
2673
2691
  });
2674
2692
  }
2675
- function Eo(e) {
2676
- let t = e.element ?? ao("slice-dialog", {}), n = Be(), { routes: r, parameters: i } = W(), a = Re(n?.currentDialogParameters), o = Q(t, "command") || a?.command || Q(t, "slice") || "", c = Q(t, "title") || a?.title || J(o), l = r?.commandSchemas?.[o], u = f(() => Y(l ?? ""), [l]), { selectableRows: d, selectedRows: p } = hi(), h = s(() => n?.closeDialog(), [n]), [g, _] = m(null), v = (e) => e.identifier && e.required && Ki(e, d) && Gi(e, p) !== void 0;
2677
- if (!l || !(u.some((e) => e.options || e.members || e.item) || u.some(v))) return e.element ? /* @__PURE__ */ V(ge, {
2693
+ function Oo(e) {
2694
+ let t = e.element ?? so("slice-dialog", {}), n = Ve(), { routes: r, parameters: i } = W(), a = ze(n?.currentDialogParameters), o = Q(t, "command") || a?.command || Q(t, "slice") || "", c = Q(t, "title") || a?.title || J(o), l = r?.commandSchemas?.[o], u = f(() => Y(l ?? ""), [l]), { selectableRows: d, selectedRows: p } = hi(), h = s(() => n?.closeDialog(), [n]), [g, _] = m(null), v = (e) => e.identifier && e.required && Ki(e, d) && Gi(e, p) !== void 0;
2695
+ if (!l || !(u.some((e) => e.options || e.members || e.item) || u.some(v))) return e.element ? /* @__PURE__ */ B(_e, {
2678
2696
  element: e.element,
2679
2697
  slots: e.slots ?? {}
2680
- }) : /* @__PURE__ */ V(Ee, {});
2681
- let y = u.filter((e) => !Ui(e, i) && !v(e)), b = ao(`slice-dialog-${o}`, {
2698
+ }) : /* @__PURE__ */ B(De, {});
2699
+ let y = u.filter((e) => !Ui(e, i) && !v(e)), b = so(`slice-dialog-${o}`, {
2682
2700
  command: o,
2683
2701
  label: c,
2684
2702
  schema: l,
@@ -2688,29 +2706,29 @@ function Eo(e) {
2688
2706
  })),
2689
2707
  generationMode: "manual"
2690
2708
  });
2691
- return /* @__PURE__ */ H("section", {
2709
+ return /* @__PURE__ */ V("section", {
2692
2710
  className: "scene-slice-dialog",
2693
2711
  "data-scene-slice-dialog": Q(t, "slice") || a?.slice,
2694
2712
  "data-scene-command": o,
2695
2713
  children: [
2696
- /* @__PURE__ */ V("header", {
2714
+ /* @__PURE__ */ B("header", {
2697
2715
  className: "scene-slice-dialog-header",
2698
- children: /* @__PURE__ */ V("h2", {
2716
+ children: /* @__PURE__ */ B("h2", {
2699
2717
  className: "scene-slice-dialog-title",
2700
2718
  children: c
2701
2719
  })
2702
2720
  }),
2703
- /* @__PURE__ */ V(wi.Provider, {
2721
+ /* @__PURE__ */ B(wi.Provider, {
2704
2722
  value: h,
2705
- children: /* @__PURE__ */ V(Ti.Provider, {
2723
+ children: /* @__PURE__ */ B(Ti.Provider, {
2706
2724
  value: g,
2707
- children: /* @__PURE__ */ V(Oi, { element: b })
2725
+ children: /* @__PURE__ */ B(Oi, { element: b })
2708
2726
  })
2709
2727
  }),
2710
- /* @__PURE__ */ V("footer", {
2728
+ /* @__PURE__ */ B("footer", {
2711
2729
  ref: _,
2712
2730
  className: "scene-slice-dialog-footer",
2713
- children: /* @__PURE__ */ V("button", {
2731
+ children: /* @__PURE__ */ B("button", {
2714
2732
  type: "button",
2715
2733
  className: "scene-slice-dialog-cancel",
2716
2734
  onClick: h,
@@ -2720,38 +2738,38 @@ function Eo(e) {
2720
2738
  ]
2721
2739
  });
2722
2740
  }
2723
- var Do = "core:toolbarItem";
2724
- function Oo({ element: e }) {
2741
+ var ko = "core:toolbarItem";
2742
+ function Ao({ element: e }) {
2725
2743
  let t = {
2726
2744
  kind: "button",
2727
2745
  id: Q(e, "name", e.id),
2728
2746
  title: Q(e, "label", Q(e, "name", e.id)),
2729
2747
  ...Q(e, "slice") ? { slice: Q(e, "slice") } : {},
2730
2748
  ...Q(e, "icon") ? { icon: Q(e, "icon") } : {}
2731
- }, n = Fe(e.id, {
2749
+ }, n = Ie(e.id, {
2732
2750
  name: e.id,
2733
2751
  kind: D.Actions,
2734
2752
  items: [t]
2735
2753
  }, void 0);
2736
- return n ? /* @__PURE__ */ V(ye, {
2754
+ return n ? /* @__PURE__ */ B(be, {
2737
2755
  outlet: n,
2738
2756
  elementId: e.id
2739
2757
  }) : null;
2740
2758
  }
2741
- function ko(e) {
2742
- let { element: t } = e, n = Ue(), r = f(() => Fe(t.id, t.properties, n), [
2759
+ function jo(e) {
2760
+ let { element: t } = e, n = We(), r = f(() => Ie(t.id, t.properties, n), [
2743
2761
  n,
2744
2762
  t.id,
2745
2763
  t.properties
2746
2764
  ]);
2747
- return !r || r.kind !== D.Actions || !r.items.some((e) => jo(t.id, e.item)) ? /* @__PURE__ */ V(he, { ...e }) : /* @__PURE__ */ V("div", {
2765
+ return !r || r.kind !== D.Actions || !r.items.some((e) => No(t.id, e.item)) ? /* @__PURE__ */ B(ge, { ...e }) : /* @__PURE__ */ B("div", {
2748
2766
  className: "stage-toolbar",
2749
2767
  role: "toolbar",
2750
2768
  "aria-label": r.name,
2751
2769
  "data-scene-id": t.id,
2752
2770
  "data-scene-outlet": r.name,
2753
- children: Ao(r.items, (e) => jo(t.id, e.item)).map((n) => {
2754
- let i = (e) => /* @__PURE__ */ V(ye, {
2771
+ children: Mo(r.items, (e) => No(t.id, e.item)).map((n) => {
2772
+ let i = (e) => /* @__PURE__ */ B(be, {
2755
2773
  outlet: {
2756
2774
  ...r,
2757
2775
  name: "",
@@ -2760,7 +2778,7 @@ function ko(e) {
2760
2778
  item: t.properties.item,
2761
2779
  elementId: `${t.id}.${e[0].item.id}`
2762
2780
  }, e[0].item.id);
2763
- return n.stage ? /* @__PURE__ */ V(Mo, {
2781
+ return n.stage ? /* @__PURE__ */ B(Po, {
2764
2782
  element: n.stage,
2765
2783
  slots: {},
2766
2784
  interactions: e.interactions,
@@ -2769,7 +2787,7 @@ function ko(e) {
2769
2787
  })
2770
2788
  });
2771
2789
  }
2772
- function Ao(e, t) {
2790
+ function Mo(e, t) {
2773
2791
  let n = [];
2774
2792
  for (let r of e) {
2775
2793
  let e = t(r), i = n.at(-1);
@@ -2780,12 +2798,12 @@ function Ao(e, t) {
2780
2798
  }
2781
2799
  return n;
2782
2800
  }
2783
- function jo(e, t) {
2801
+ function No(e, t) {
2784
2802
  if (t.kind !== "button") return;
2785
2803
  let n = t;
2786
2804
  if (!(n.navigateTo || n.builtIn !== void 0 || !n.slice && !n.command) && n.opens !== T.None && n.opens !== T.Drawer && n.opens !== T.Slot) return {
2787
2805
  id: `${e}.${n.id}`,
2788
- componentName: Do,
2806
+ componentName: ko,
2789
2807
  properties: {
2790
2808
  name: n.id,
2791
2809
  kind: "Action",
@@ -2803,18 +2821,18 @@ function jo(e, t) {
2803
2821
  slots: {}
2804
2822
  };
2805
2823
  }
2806
- function Mo(e) {
2824
+ function Po(e) {
2807
2825
  let { element: t } = e;
2808
- return Q(t, "slice") === "" ? /* @__PURE__ */ V(Fo, { ...e }) : /* @__PURE__ */ V(No, { ...e });
2826
+ return Q(t, "slice") === "" ? /* @__PURE__ */ B(Lo, { ...e }) : /* @__PURE__ */ B(Fo, { ...e });
2809
2827
  }
2810
- function No(e) {
2828
+ function Fo(e) {
2811
2829
  let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "slice"), a = Q(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], s = f(() => Y(o ?? ""), [o]), { selectableRows: c, selectedRows: l } = hi();
2812
- if ((kr(o ?? "") ? [] : Zi(s, r, l, c)).length === 0) return /* @__PURE__ */ V(B, { children: e.fallback ?? /* @__PURE__ */ V(Oo, { element: t }) });
2830
+ if ((kr(o ?? "") ? [] : Zi(s, r, l, c)).length === 0) return /* @__PURE__ */ B(z, { children: e.fallback ?? /* @__PURE__ */ B(Ao, { element: t }) });
2813
2831
  let u = Q(t, "label", Q(t, "name", t.id));
2814
- return /* @__PURE__ */ V("span", {
2832
+ return /* @__PURE__ */ B("span", {
2815
2833
  className: "stage-toolbar-action",
2816
2834
  "data-scene-toolbar-item": Q(t, "name", t.id),
2817
- children: /* @__PURE__ */ V(U, {
2835
+ children: /* @__PURE__ */ B(H, {
2818
2836
  type: "button",
2819
2837
  "data-scene-id": t.id,
2820
2838
  disabled: !0,
@@ -2824,11 +2842,11 @@ function No(e) {
2824
2842
  })
2825
2843
  });
2826
2844
  }
2827
- function Po(e, t, n) {
2845
+ function Io(e, t, n) {
2828
2846
  return t !== "screen" && !!e.identifier && e.required && Ki(e, n);
2829
2847
  }
2830
- function Fo(e) {
2831
- let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), s = n?.commandSchemas?.[a], c = f(() => Y(s ?? ""), [s]), l = Hr(t), u = f(() => l === void 0 && kr(s ?? ""), [s, l]), { selectableRows: d, selectedRows: p } = hi(), m = u ? [] : d, h = l === void 0 && !u ? Zi(c, r, p, m) : [], g = Io(s, c, r, l, m), _ = u ? { createsEntity: !0 } : qr(t, l), v = {
2848
+ function Lo(e) {
2849
+ let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), s = n?.commandSchemas?.[a], c = f(() => Y(s ?? ""), [s]), l = Hr(t), u = f(() => l === void 0 && kr(s ?? ""), [s, l]), { selectableRows: d, selectedRows: p } = hi(), m = u ? [] : d, h = l === void 0 && !u ? Zi(c, r, p, m) : [], g = Ro(s, c, r, l, m), _ = u ? { createsEntity: !0 } : qr(t, l), v = {
2832
2850
  ...t,
2833
2851
  componentName: "core:action",
2834
2852
  properties: {
@@ -2839,48 +2857,48 @@ function Fo(e) {
2839
2857
  ..._
2840
2858
  }
2841
2859
  };
2842
- return /* @__PURE__ */ V("span", {
2860
+ return /* @__PURE__ */ B("span", {
2843
2861
  className: "stage-toolbar-action",
2844
2862
  "data-scene-toolbar-item": i,
2845
- children: h.length > 0 ? /* @__PURE__ */ V(U, {
2863
+ children: h.length > 0 ? /* @__PURE__ */ B(H, {
2846
2864
  type: "button",
2847
2865
  "data-scene-id": t.id,
2848
2866
  disabled: !0,
2849
2867
  title: "Select a row first",
2850
2868
  ...e.interactions,
2851
2869
  children: o
2852
- }) : /* @__PURE__ */ V(ho, {
2870
+ }) : /* @__PURE__ */ B(_o, {
2853
2871
  element: v,
2854
2872
  interactions: e.interactions,
2855
2873
  slots: e.slots
2856
2874
  })
2857
2875
  });
2858
2876
  }
2859
- function Io(e, t, n, r, i) {
2877
+ function Ro(e, t, n, r, i) {
2860
2878
  return e ? {
2861
2879
  schema: e,
2862
- fields: t.filter((e) => !Ui(e, n) && !Po(e, r, i)).map((e) => ({
2880
+ fields: t.filter((e) => !Ui(e, n) && !Io(e, r, i)).map((e) => ({
2863
2881
  name: e.name,
2864
2882
  label: J(e.name)
2865
2883
  })),
2866
2884
  generationMode: "manual"
2867
2885
  } : {};
2868
2886
  }
2869
- var Lo = {
2870
- ...Ae,
2871
- "core:table": uo,
2872
- "core:action": ho,
2887
+ var zo = {
2888
+ ...je,
2889
+ "core:table": po,
2890
+ "core:action": _o,
2873
2891
  "core:guarded-action": On,
2874
- "core:outletItems": ko,
2875
- [Do]: Mo,
2876
- "core:sliceDialog": To,
2877
- [io]: Oi,
2878
- [za]: Ga,
2879
- [ro]: no
2892
+ "core:outletItems": jo,
2893
+ [ko]: Po,
2894
+ "core:sliceDialog": Do,
2895
+ [oo]: Oi,
2896
+ [Va]: qa,
2897
+ [ao]: io
2880
2898
  };
2881
2899
  // src/useStrings.ts
2882
- function Ro() {
2883
- let e = Bt(), [t, n] = m([]), [r, i] = m(""), [a, o] = m({});
2900
+ function Bo() {
2901
+ let e = U(), [t, n] = m([]), [r, i] = m(""), [a, o] = m({});
2884
2902
  return l(() => {
2885
2903
  let t = new AbortController();
2886
2904
  return e.locales(t.signal).then((e) => {
@@ -2901,11 +2919,11 @@ function Ro() {
2901
2919
  dictionary: a
2902
2920
  };
2903
2921
  }
2904
- var zo = /* @__PURE__ */ new Set(["core:table"]);
2905
- function Bo(e) {
2906
- return Vo(e, /* @__PURE__ */ new Map(), void 0);
2922
+ var Vo = /* @__PURE__ */ new Set(["core:table"]);
2923
+ function Ho(e) {
2924
+ return Uo(e, /* @__PURE__ */ new Map(), void 0);
2907
2925
  }
2908
- function Vo(e, t, n) {
2926
+ function Uo(e, t, n) {
2909
2927
  let r = e;
2910
2928
  if (!r.slots) return e;
2911
2929
  let i = !1, a = {};
@@ -2914,7 +2932,7 @@ function Vo(e, t, n) {
2914
2932
  a[e] = o.map((e) => {
2915
2933
  let t = e, n = $(t, "typeName");
2916
2934
  t.componentName === "core:data" && n && (r.set(n, t), s = t);
2917
- let a = Vo(Uo(Ho(t, r), s), r, s);
2935
+ let a = Uo(Go(Wo(t, r), s), r, s);
2918
2936
  return a !== e && (i = !0), a;
2919
2937
  });
2920
2938
  }
@@ -2923,8 +2941,8 @@ function Vo(e, t, n) {
2923
2941
  slots: a
2924
2942
  } : e;
2925
2943
  }
2926
- function Ho(e, t) {
2927
- if (!zo.has(e.componentName)) return e;
2944
+ function Wo(e, t) {
2945
+ if (!Vo.has(e.componentName)) return e;
2928
2946
  let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
2929
2947
  if (!r || e.properties.queryArguments !== void 0) return e;
2930
2948
  let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
@@ -2933,7 +2951,7 @@ function Ho(e, t) {
2933
2951
  properties: a
2934
2952
  };
2935
2953
  }
2936
- function Uo(e, t) {
2954
+ function Go(e, t) {
2937
2955
  if (!["core:guarded-action", "core:action"].includes(e.componentName) || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
2938
2956
  let n = { ...e.properties };
2939
2957
  if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
@@ -2951,7 +2969,7 @@ function $(e, t) {
2951
2969
  return typeof n == "string" && n.length > 0 ? n : void 0;
2952
2970
  }
2953
2971
  // src/stageQueryBindings.tsx
2954
- function Wo(e) {
2972
+ function Ko(e) {
2955
2973
  let t = /* @__PURE__ */ new Set(), n = (e) => {
2956
2974
  if (Array.isArray(e)) {
2957
2975
  e.forEach(n);
@@ -2967,7 +2985,7 @@ function Wo(e) {
2967
2985
  };
2968
2986
  return r(e), [...t];
2969
2987
  }
2970
- function Go(e) {
2988
+ function qo(e) {
2971
2989
  let t = /* @__PURE__ */ new Map(), n = (e, t) => {
2972
2990
  let n = e.properties?.[t];
2973
2991
  return typeof n == "string" && n.length > 0 ? n : void 0;
@@ -2986,8 +3004,8 @@ function Go(e) {
2986
3004
  };
2987
3005
  return r(e), [...t.values()];
2988
3006
  }
2989
- function Ko({ source: e }) {
2990
- let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = e.by ? r[e.by] || i[e.by] : void 0, o = Ra(e.query), s = f(() => ({
3007
+ function Jo({ source: e }) {
3008
+ let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = e.by ? r[e.by] || i[e.by] : void 0, o = Ba(e.query), s = f(() => ({
2991
3009
  ...o,
2992
3010
  ...e.by ? a ? { [e.by]: a } : {} : {
2993
3011
  ...i,
@@ -3010,8 +3028,8 @@ function Ko({ source: e }) {
3010
3028
  list: !0
3011
3029
  }), null;
3012
3030
  }
3013
- function qo({ name: e }) {
3014
- let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = Ra(e), o = f(() => ({
3031
+ function Yo({ name: e }) {
3032
+ let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = Ba(e), o = f(() => ({
3015
3033
  ...a,
3016
3034
  ...i,
3017
3035
  ...r
@@ -3029,59 +3047,59 @@ function qo({ name: e }) {
3029
3047
  list: !0
3030
3048
  }), null;
3031
3049
  }
3032
- function Jo({ element: e }) {
3033
- let t = f(() => Wo(e), [e]), n = f(() => Go(e), [e]);
3034
- return /* @__PURE__ */ H(B, { children: [t.map((e) => /* @__PURE__ */ V(qo, { name: e }, e)), n.map((e) => /* @__PURE__ */ V(Ko, { source: e }, e.typeName))] });
3050
+ function Xo({ element: e }) {
3051
+ let t = f(() => Ko(e), [e]), n = f(() => qo(e), [e]);
3052
+ return /* @__PURE__ */ V(z, { children: [t.map((e) => /* @__PURE__ */ B(Yo, { name: e }, e)), n.map((e) => /* @__PURE__ */ B(Jo, { source: e }, e.typeName))] });
3035
3053
  }
3036
3054
  // src/stageThemeChoice.ts
3037
- var Yo = "cratis.stage.theme";
3038
- function Xo() {
3055
+ var Zo = "cratis.stage.theme";
3056
+ function Qo() {
3039
3057
  try {
3040
3058
  return globalThis.localStorage ?? null;
3041
3059
  } catch {
3042
3060
  return null;
3043
3061
  }
3044
3062
  }
3045
- function Zo() {
3063
+ function $o() {
3046
3064
  try {
3047
- return Xo()?.getItem("cratis.stage.theme") || void 0;
3065
+ return Qo()?.getItem("cratis.stage.theme") || void 0;
3048
3066
  } catch {
3049
3067
  return;
3050
3068
  }
3051
3069
  }
3052
- function Qo(e) {
3070
+ function es(e) {
3053
3071
  try {
3054
- Xo()?.setItem(Yo, e);
3072
+ Qo()?.setItem(Zo, e);
3055
3073
  } catch {}
3056
3074
  }
3057
3075
  // src/screenTitle.ts
3058
- var $o = "core:title", es = ["content", "main"];
3059
- function ts(e) {
3076
+ var ts = "core:title", ns = ["content", "main"];
3077
+ function rs(e) {
3060
3078
  let t = e;
3061
- if (t.componentName !== $o) return;
3079
+ if (t.componentName !== ts) return;
3062
3080
  let n = t.properties?.text;
3063
3081
  return typeof n == "string" && n.trim().length > 0 ? n : void 0;
3064
3082
  }
3065
- function ns(e) {
3083
+ function is(e) {
3066
3084
  for (let t of e ?? []) {
3067
- let e = ts(t);
3085
+ let e = rs(t);
3068
3086
  if (e !== void 0) return e;
3069
3087
  }
3070
3088
  }
3071
- function rs(e) {
3072
- let t = e.slotContent ?? {}, n = [...es, ...Object.keys(t).filter((e) => !es.includes(e))];
3089
+ function as(e) {
3090
+ let t = e.slotContent ?? {}, n = [...ns, ...Object.keys(t).filter((e) => !ns.includes(e))];
3073
3091
  for (let e of n) {
3074
- let n = ns(t[e]);
3092
+ let n = is(t[e]);
3075
3093
  if (n !== void 0) return n;
3076
3094
  }
3077
3095
  return Er(e.name);
3078
3096
  }
3079
- function is(e) {
3097
+ function os(e) {
3080
3098
  let t = /* @__PURE__ */ new Set(), n = [];
3081
3099
  for (let r of e.flatMap((e) => e.contributions ?? [])) {
3082
- let e = os(r);
3100
+ let e = cs(r);
3083
3101
  if (!e) continue;
3084
- let i = cs(e);
3102
+ let i = us(e);
3085
3103
  t.has(i) || (t.add(i), n.push(e));
3086
3104
  }
3087
3105
  return n.map((e, t) => ({
@@ -3089,47 +3107,47 @@ function is(e) {
3089
3107
  index: t
3090
3108
  })).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
3091
3109
  }
3092
- function as(e) {
3110
+ function ss(e) {
3093
3111
  let t = {
3094
3112
  label: "",
3095
3113
  children: []
3096
3114
  };
3097
3115
  for (let n of e) {
3098
- let e = n.hierarchy.reduce((e, t) => ls(e, t, !1), t);
3099
- (n.group ? ls(e, n.group, !0) : e).children.push(us(n));
3116
+ let e = n.hierarchy.reduce((e, t) => ds(e, t, !1), t);
3117
+ (n.group ? ds(e, n.group, !0) : e).children.push(fs(n));
3100
3118
  }
3101
3119
  return t.children;
3102
3120
  }
3103
- function os(e) {
3121
+ function cs(e) {
3104
3122
  if (e.contributionPointName !== "Navigation") return;
3105
3123
  let t = e.content?.properties ?? {}, n = t.label, r = t.targetScreen;
3106
3124
  if (typeof n != "string" || typeof r != "string") return;
3107
- let i = ss(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
3125
+ let i = ls(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
3108
3126
  return {
3109
3127
  label: n,
3110
3128
  targetScreen: r,
3111
3129
  hierarchy: i,
3112
3130
  order: a,
3113
- ...fs({
3114
- id: ds(t.id),
3115
- group: ds(t.group),
3116
- icon: ds(t.icon),
3117
- presentation: ds(t.presentation),
3118
- destination: ms(o) && hs(o) ? o : void 0
3131
+ ...ms({
3132
+ id: ps(t.id),
3133
+ group: ps(t.group),
3134
+ icon: ps(t.icon),
3135
+ presentation: ps(t.presentation),
3136
+ destination: gs(o) && _s(o) ? o : void 0
3119
3137
  })
3120
3138
  };
3121
3139
  }
3122
- function ss(e) {
3140
+ function ls(e) {
3123
3141
  return Array.isArray(e.hierarchy) ? e.hierarchy.filter((e) => typeof e == "string") : [];
3124
3142
  }
3125
- function cs(e) {
3143
+ function us(e) {
3126
3144
  return e.id === void 0 ? JSON.stringify([
3127
3145
  e.hierarchy,
3128
3146
  e.targetScreen,
3129
3147
  e.label
3130
3148
  ]) : JSON.stringify(["id", e.id]);
3131
3149
  }
3132
- function ls(e, t, n) {
3150
+ function ds(e, t, n) {
3133
3151
  let r = e.children.find((e) => e.screen === void 0 && e.section === !0 === n && e.label === t);
3134
3152
  if (r) return r;
3135
3153
  let i = n ? {
@@ -3142,12 +3160,12 @@ function ls(e, t, n) {
3142
3160
  };
3143
3161
  return e.children.push(i), i;
3144
3162
  }
3145
- function us(e) {
3163
+ function fs(e) {
3146
3164
  return {
3147
3165
  label: e.label,
3148
- ...fs({ id: e.id || void 0 }),
3166
+ ...ms({ id: e.id || void 0 }),
3149
3167
  screen: e.targetScreen,
3150
- ...fs({
3168
+ ...ms({
3151
3169
  icon: e.icon || void 0,
3152
3170
  presentation: e.presentation || void 0,
3153
3171
  destination: e.destination
@@ -3155,82 +3173,82 @@ function us(e) {
3155
3173
  children: []
3156
3174
  };
3157
3175
  }
3158
- function ds(e) {
3176
+ function ps(e) {
3159
3177
  return typeof e == "string" ? e : void 0;
3160
3178
  }
3161
- function fs(e) {
3179
+ function ms(e) {
3162
3180
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
3163
3181
  }
3164
- function ps(e, t) {
3182
+ function hs(e, t) {
3165
3183
  for (let n of e) {
3166
3184
  if (n.screen === t) return [n.label];
3167
- let e = ps(n.children, t);
3185
+ let e = hs(n.children, t);
3168
3186
  if (e.length > 0) return n.section ? e : [n.label, ...e];
3169
3187
  }
3170
3188
  return [];
3171
3189
  }
3172
- function ms(e) {
3190
+ function gs(e) {
3173
3191
  return typeof e == "object" && !!e && !Array.isArray(e);
3174
3192
  }
3175
- function hs(e) {
3193
+ function _s(e) {
3176
3194
  return e.slot !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
3177
3195
  }
3178
- function gs(e, t, n) {
3196
+ function vs(e, t, n) {
3179
3197
  return e.filter((e) => !t.has(e.name)).map((e) => ({
3180
- label: rs(e),
3198
+ label: as(e),
3181
3199
  targetScreen: e.name,
3182
3200
  hierarchy: e.path && e.path.length > 0 ? [...e.path] : [n]
3183
3201
  }));
3184
3202
  }
3185
3203
  // src/blueprint.ts
3186
- var _s = "Stage:locale", vs = "Stage:themeToggle", ys = "Stage:notes", bs = "Cratis.Components", xs = "PrimeReact", Ss = /* @__PURE__ */ new Map();
3187
- function Cs(e) {
3188
- return dt(e).packages.includes(xs);
3204
+ var ys = "Stage:locale", bs = "Stage:themeToggle", xs = "Stage:notes", Ss = "Stage:acting-user", Cs = "Cratis.Components", ws = "PrimeReact", Ts = /* @__PURE__ */ new Map();
3205
+ function Es(e) {
3206
+ return ft(e).packages.includes(ws);
3189
3207
  }
3190
- function ws(e, t) {
3191
- Ss.set(e, t);
3208
+ function Ds(e, t) {
3209
+ Ts.set(e, t);
3192
3210
  }
3193
- function Ts(e) {
3194
- let t = dt(e);
3211
+ function Os(e) {
3212
+ let t = ft(e);
3195
3213
  return {
3196
3214
  ...t,
3197
3215
  name: e?.length ? t.name : "Stage",
3198
- packages: re(t.packages, {
3199
- baseline: bs,
3200
- catalog: { [rt]: O.Blueprint }
3216
+ packages: ie(t.packages, {
3217
+ baseline: Cs,
3218
+ catalog: { [it]: O.Blueprint }
3201
3219
  })
3202
3220
  };
3203
3221
  }
3204
- var Es = {
3205
- ...et,
3206
- [bs]: Pt.components
3222
+ var ks = {
3223
+ ...tt,
3224
+ [Cs]: Ft.components
3207
3225
  };
3208
- function Ds(e) {
3209
- let t = [...Ss.values()].reduce((e, t) => ({
3226
+ function As(e) {
3227
+ let t = [...Ts.values()].reduce((e, t) => ({
3210
3228
  ...e,
3211
3229
  ...t.components
3212
3230
  }), {});
3213
3231
  return {
3214
- ...Ae,
3215
- ...Nt,
3232
+ ...je,
3233
+ ...Pt,
3216
3234
  ...t,
3217
- ...nt,
3218
- ...ut,
3235
+ ...rt,
3236
+ ...dt,
3219
3237
  ...e
3220
3238
  };
3221
3239
  }
3222
- function Os(e) {
3223
- let t = Object.fromEntries([...Ss].map(([e, t]) => [e, t.declared]));
3240
+ function js(e) {
3241
+ let t = Object.fromEntries([...Ts].map(([e, t]) => [e, t.declared]));
3224
3242
  return {
3225
3243
  ...e,
3226
- ...Es,
3244
+ ...ks,
3227
3245
  ...t
3228
3246
  };
3229
3247
  }
3230
- var ks = "Stage:navigationTree";
3231
- function As(e, t, n) {
3248
+ var Ms = "Stage:navigationTree";
3249
+ function Ns(e, t, n) {
3232
3250
  let r = t?.title ?? "Cratis Stage";
3233
- return z(e, L.Logo, {
3251
+ return R(e, I.Logo, {
3234
3252
  label: r,
3235
3253
  initials: r.slice(0, 1).toUpperCase() || "S",
3236
3254
  targetScreen: n,
@@ -3239,42 +3257,42 @@ function As(e, t, n) {
3239
3257
  ...t?.showName === void 0 ? {} : { showName: t.showName }
3240
3258
  });
3241
3259
  }
3242
- function js(e, t, n) {
3243
- let r = [];
3244
- return e.length > 1 && r.push(z("topbar-locale", _s, {
3260
+ function Ps(e, t, n, r) {
3261
+ let i = [];
3262
+ return r && i.push(R("topbar-acting-user", Ss, {})), e.length > 1 && i.push(R("topbar-locale", ys, {
3245
3263
  locales: e,
3246
3264
  locale: t
3247
- })), n && r.push(z("topbar-theme", vs, {})), r;
3265
+ })), n && i.push(R("topbar-theme", bs, {})), i;
3248
3266
  }
3249
- function Ms(e, t, n, r, i, a = {}) {
3250
- let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0 } = a, l = e[0]?.name ?? "", u = i?.title ?? "Cratis Stage", d = is(e), f = gs(e, new Set(d.map((e) => e.targetScreen)), "Other screens"), p = as([...d, ...d.length > 0 ? f : []]), m = e.map((e, n) => lt({
3251
- label: rs(e),
3267
+ function Fs(e, t, n, r, i, a = {}) {
3268
+ let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0, showActingUser: l = !1 } = a, u = e[0]?.name ?? "", d = i?.title ?? "Cratis Stage", f = os(e), p = vs(e, new Set(f.map((e) => e.targetScreen)), "Other screens"), m = ss([...f, ...f.length > 0 ? p : []]), h = e.map((e, n) => ut({
3269
+ label: as(e),
3252
3270
  targetScreen: e.name,
3253
3271
  icon: "pi pi-table",
3254
3272
  group: "Screens",
3255
3273
  order: n
3256
- }, t)), h = e.find((e) => e.name === t), g = h ? rs(h) : Er(t), _ = ps(as(d), t), v = e.find((e) => e.name === t)?.path?.length ? ps(p, t) : [], y = _.length > 0 ? _ : v, b = d.length > 0 ? z("menu-hierarchy", ks, {
3257
- nodes: p,
3274
+ }, t)), g = e.find((e) => e.name === t), _ = g ? as(g) : Er(t), v = hs(ss(f), t), y = e.find((e) => e.name === t)?.path?.length ? hs(m, t) : [], b = v.length > 0 ? v : y, x = f.length > 0 ? R("menu-hierarchy", Ms, {
3275
+ nodes: m,
3258
3276
  activeScreen: t
3259
- }) : z("menu-screens", L.Menu, {
3277
+ }) : R("menu-screens", I.Menu, {
3260
3278
  title: "Screens",
3261
3279
  label: "Screens"
3262
- }, { items: m }), x = [z("topbar-notes", ys, {}), ...js(n, r, c)], S = { regionNavigation: o };
3280
+ }, { items: h }), S = [R("topbar-notes", xs, {}), ...Ps(n, r, c, l)], C = { regionNavigation: o };
3263
3281
  return {
3264
- [R.Topbar]: [z("topbar", L.Topbar, S, {
3265
- logo: [As("topbar-logo", i, l)],
3266
- end: x
3282
+ [L.Topbar]: [R("topbar", I.Topbar, C, {
3283
+ logo: [Ns("topbar-logo", i, u)],
3284
+ end: S
3267
3285
  })],
3268
- [R.Sidebar]: [z("sidebar", L.Sidebar, S, { logo: [As("sidebar-logo", i, l)] })],
3269
- ...o ? {} : { [R.Menu]: [b] },
3270
- [R.Breadcrumb]: [z("breadcrumb", L.Breadcrumb, {
3271
- homeTargetScreen: l,
3272
- items: (y.length > 0 ? y : [g]).map((e) => ({ label: e }))
3286
+ [L.Sidebar]: [R("sidebar", I.Sidebar, C, { logo: [Ns("sidebar-logo", i, u)] })],
3287
+ ...o ? {} : { [L.Menu]: [x] },
3288
+ [L.Breadcrumb]: [R("breadcrumb", I.Breadcrumb, {
3289
+ homeTargetScreen: u,
3290
+ items: (b.length > 0 ? b : [_]).map((e) => ({ label: e }))
3273
3291
  })],
3274
- ...s ? { [R.Footer]: [z("footer", L.Footer, { text: u })] } : {},
3275
- [R.ConfigPanel]: [z(L.ConfigPanel, L.ConfigPanel, {
3292
+ ...s ? { [L.Footer]: [R("footer", I.Footer, { text: d })] } : {},
3293
+ [L.ConfigPanel]: [R(I.ConfigPanel, I.ConfigPanel, {
3276
3294
  title: "Settings",
3277
- themes: it.map((e) => ({
3295
+ themes: at.map((e) => ({
3278
3296
  name: e.name,
3279
3297
  label: e.name,
3280
3298
  isDark: e.isDark ?? !1
@@ -3282,11 +3300,11 @@ function Ms(e, t, n, r, i, a = {}) {
3282
3300
  })]
3283
3301
  };
3284
3302
  }
3285
- function Ns(e) {
3303
+ function Is(e) {
3286
3304
  return `#/${encodeURIComponent(e)}`;
3287
3305
  }
3288
3306
  // src/externalRouteHref.ts
3289
- function Ps(e) {
3307
+ function Ls(e) {
3290
3308
  try {
3291
3309
  let t = new URL(e ?? "");
3292
3310
  return t.protocol === "http:" || t.protocol === "https:" ? e : void 0;
@@ -3295,11 +3313,11 @@ function Ps(e) {
3295
3313
  }
3296
3314
  }
3297
3315
  // src/stageSlot.tsx
3298
- function Fs(e) {
3316
+ function Rs(e) {
3299
3317
  return typeof e == "string" && e.length > 0 ? e : void 0;
3300
3318
  }
3301
- function Is({ element: e }) {
3302
- let t = je(e.properties), n = c(xe), r = Ve(), i = Ge(), a = W(), o = Fs(e.properties.shows), s = Fs(e.properties.showsBy), u = Fs(e.properties.showsFromElement) ?? Fs(e.properties.showsFrom), d = t.routed || o ? r?.state.slots[t.name] : void 0, f = u ? a.selections[u] : void 0, p = f && s ? f[s] : void 0, m = p == null || p === "" ? void 0 : String(p);
3319
+ function zs({ element: e }) {
3320
+ let t = Me(e.properties), n = c(Se), r = He(), i = Ke(), a = W(), o = Rs(e.properties.shows), s = Rs(e.properties.showsBy), u = Rs(e.properties.showsFromElement) ?? Rs(e.properties.showsFrom), d = t.routed || o ? r?.state.slots[t.name] : void 0, f = u ? a.selections[u] : void 0, p = f && s ? f[s] : void 0, m = p == null || p === "" ? void 0 : String(p);
3303
3321
  l(() => {
3304
3322
  if (!r || !o || !s || m === void 0) return;
3305
3323
  let e = r.state.slots[t.name];
@@ -3320,56 +3338,56 @@ function Is({ element: e }) {
3320
3338
  "data-scene-slot-screen": h,
3321
3339
  "data-scene-slot-role": t.role,
3322
3340
  "data-scene-slot-routed": t.routed ? "true" : void 0,
3323
- "data-scene-slot-route": d ? Le(d, t.routedBy) : void 0
3324
- }, b = /* @__PURE__ */ H(B, { children: [_ && h && /* @__PURE__ */ V("div", {
3341
+ "data-scene-slot-route": d ? Re(d, t.routedBy) : void 0
3342
+ }, b = /* @__PURE__ */ V(z, { children: [_ && h && /* @__PURE__ */ B("div", {
3325
3343
  className: "scene-slot-bar",
3326
- children: /* @__PURE__ */ V("button", {
3344
+ children: /* @__PURE__ */ B("button", {
3327
3345
  type: "button",
3328
3346
  className: "scene-slot-close",
3329
3347
  "aria-label": "Close",
3330
3348
  onClick: v,
3331
3349
  children: "Close"
3332
3350
  })
3333
- }), g && i && h && (d ? /* @__PURE__ */ V(Ls, {
3351
+ }), g && i && h && (d ? /* @__PURE__ */ B(Bs, {
3334
3352
  name: h,
3335
3353
  screen: g,
3336
3354
  registry: i.registry,
3337
3355
  values: d.parameters
3338
- }) : /* @__PURE__ */ V(xr, {
3356
+ }) : /* @__PURE__ */ B(xr, {
3339
3357
  screen: h,
3340
- children: /* @__PURE__ */ V(pi, {
3358
+ children: /* @__PURE__ */ B(pi, {
3341
3359
  element: g,
3342
- children: /* @__PURE__ */ V(be, {
3360
+ children: /* @__PURE__ */ B(xe, {
3343
3361
  element: g,
3344
3362
  registry: i.registry,
3345
3363
  resolveBinding: a.resolveBinding
3346
3364
  })
3347
3365
  })
3348
3366
  }))] });
3349
- return t.role === A.Panel ? /* @__PURE__ */ V("aside", {
3367
+ return t.role === A.Panel ? /* @__PURE__ */ B("aside", {
3350
3368
  "aria-label": t.name,
3351
3369
  ...y,
3352
3370
  children: b
3353
- }) : /* @__PURE__ */ V("div", {
3371
+ }) : /* @__PURE__ */ B("div", {
3354
3372
  ...y,
3355
3373
  children: b
3356
3374
  });
3357
3375
  }
3358
- function Ls({ name: e, screen: t, registry: n, values: r }) {
3376
+ function Bs({ name: e, screen: t, registry: n, values: r }) {
3359
3377
  let i = W(), a = JSON.stringify({
3360
3378
  ...i.parameters,
3361
3379
  ...r
3362
3380
  }), o = f(() => JSON.parse(a), [a]);
3363
- return /* @__PURE__ */ V(we.Provider, {
3381
+ return /* @__PURE__ */ B(Te.Provider, {
3364
3382
  value: r,
3365
- children: /* @__PURE__ */ V(zn, {
3383
+ children: /* @__PURE__ */ B(zn, {
3366
3384
  routes: i.routes,
3367
3385
  routesReady: i.routesReady,
3368
3386
  parameters: o,
3369
3387
  locale: i.locale,
3370
3388
  locales: i.locales,
3371
3389
  screen: e,
3372
- children: /* @__PURE__ */ V(Rs, {
3390
+ children: /* @__PURE__ */ B(Vs, {
3373
3391
  name: e,
3374
3392
  screen: t,
3375
3393
  registry: n
@@ -3377,13 +3395,13 @@ function Ls({ name: e, screen: t, registry: n, values: r }) {
3377
3395
  })
3378
3396
  });
3379
3397
  }
3380
- function Rs({ name: e, screen: t, registry: n }) {
3398
+ function Vs({ name: e, screen: t, registry: n }) {
3381
3399
  let r = W();
3382
- return /* @__PURE__ */ V(xr, {
3400
+ return /* @__PURE__ */ B(xr, {
3383
3401
  screen: e,
3384
- children: /* @__PURE__ */ H(pi, {
3402
+ children: /* @__PURE__ */ V(pi, {
3385
3403
  element: t,
3386
- children: [/* @__PURE__ */ V(Jo, { element: t }), /* @__PURE__ */ V(be, {
3404
+ children: [/* @__PURE__ */ B(Xo, { element: t }), /* @__PURE__ */ B(xe, {
3387
3405
  element: t,
3388
3406
  registry: n,
3389
3407
  resolveBinding: r.resolveBinding,
@@ -3392,53 +3410,118 @@ function Rs({ name: e, screen: t, registry: n }) {
3392
3410
  })
3393
3411
  });
3394
3412
  }
3413
+ // src/sandboxActingUser.ts
3414
+ async function Hs(e, t = fetch) {
3415
+ let n = await t(Rt.actingUser, {
3416
+ signal: e,
3417
+ credentials: "same-origin"
3418
+ });
3419
+ if (!n.ok) return;
3420
+ let r = await n.json();
3421
+ return r.enabled === !0 && Array.isArray(r.users) && r.users.length > 0 ? r : void 0;
3422
+ }
3423
+ async function Us(e, t = fetch) {
3424
+ let n = await t(Rt.actingUser, {
3425
+ method: "PUT",
3426
+ credentials: "same-origin",
3427
+ headers: { "Content-Type": "application/json" },
3428
+ body: JSON.stringify({ name: e })
3429
+ });
3430
+ if (!n.ok) throw Error(`The sandbox could not change the acting user (${n.status}).`);
3431
+ }
3432
+ async function Ws(e, t, n) {
3433
+ e.selectActingUser && (await e.selectActingUser(t), n());
3434
+ }
3435
+ // src/SandboxActingUser.tsx
3436
+ function Gs() {
3437
+ let e = U(), [t, n] = m(), [r, i] = m(!1), [a, o] = m("");
3438
+ if (l(() => {
3439
+ let t = new AbortController();
3440
+ return e.actingUser && e.selectActingUser && e.actingUser(t.signal).then((e) => {
3441
+ t.signal.aborted || n(e);
3442
+ }).catch(() => {}), () => t.abort();
3443
+ }, [e]), !t?.enabled || t.users.length === 0) return null;
3444
+ let s = async (t) => {
3445
+ i(!0), o("");
3446
+ try {
3447
+ await Ws(e, t || null, () => window.location.reload());
3448
+ } catch {
3449
+ o("The acting user could not be changed. Try again."), i(!1);
3450
+ }
3451
+ };
3452
+ return /* @__PURE__ */ V("label", {
3453
+ className: "stage-acting-user",
3454
+ children: [
3455
+ /* @__PURE__ */ B("span", { children: "Acting as " }),
3456
+ /* @__PURE__ */ V("select", {
3457
+ "aria-label": "Acting as",
3458
+ value: t.current ?? "",
3459
+ disabled: r,
3460
+ onChange: (e) => {
3461
+ s(e.target.value);
3462
+ },
3463
+ children: [/* @__PURE__ */ B("option", {
3464
+ value: "",
3465
+ children: "No acting user"
3466
+ }), t.users.map((e) => /* @__PURE__ */ V("option", {
3467
+ value: e.name,
3468
+ children: [e.displayName || e.name, e.personas.length ? ` (${e.personas.join(", ")})` : ""]
3469
+ }, e.name))]
3470
+ }),
3471
+ a && /* @__PURE__ */ B("span", {
3472
+ role: "alert",
3473
+ children: a
3474
+ })
3475
+ ]
3476
+ });
3477
+ }
3395
3478
  // src/StageChrome.tsx
3396
- var zs = a({
3479
+ var Ks = a({
3397
3480
  locales: [],
3398
3481
  locale: "",
3399
3482
  setLocale: () => void 0,
3400
3483
  activity: ""
3401
3484
  });
3402
- function Bs({ state: e, children: t }) {
3403
- return /* @__PURE__ */ V(zs.Provider, {
3485
+ function qs({ state: e, children: t }) {
3486
+ return /* @__PURE__ */ B(Ks.Provider, {
3404
3487
  value: e,
3405
3488
  children: t
3406
3489
  });
3407
3490
  }
3408
- var Vs = "Stage:activity";
3409
- function Hs() {
3410
- let { notesEnabled: e } = c(zs);
3411
- return e ? /* @__PURE__ */ V(r, { size: "small" }) : null;
3491
+ var Js = "Stage:activity";
3492
+ function Ys() {
3493
+ let { notesEnabled: e } = c(Ks);
3494
+ return e ? /* @__PURE__ */ B(r, { size: "small" }) : null;
3412
3495
  }
3413
- function Us() {
3414
- let { locales: e, locale: t, setLocale: n } = c(zs);
3415
- return e.length < 2 ? null : /* @__PURE__ */ V("select", {
3496
+ function Xs() {
3497
+ let { locales: e, locale: t, setLocale: n } = c(Ks);
3498
+ return e.length < 2 ? null : /* @__PURE__ */ B("select", {
3416
3499
  className: "stage-locale",
3417
3500
  "aria-label": "Locale",
3418
3501
  value: t,
3419
3502
  onChange: (e) => n(e.target.value),
3420
- children: e.map((e) => /* @__PURE__ */ V("option", {
3503
+ children: e.map((e) => /* @__PURE__ */ B("option", {
3421
3504
  value: e,
3422
3505
  children: e
3423
3506
  }, e))
3424
3507
  });
3425
3508
  }
3426
- function Ws({ element: e }) {
3427
- let { config: t, setThemeName: n, setColorScheme: r } = ft(), i = it.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === I.Dark, a = it.find((e) => (e.isDark ?? !1) !== i);
3509
+ function Zs({ element: e }) {
3510
+ let { config: t, setThemeName: n, setColorScheme: r } = pt(), i = at.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === F.Dark, a = at.find((e) => (e.isDark ?? !1) !== i);
3428
3511
  if (!a) return null;
3429
3512
  let o = i ? "Switch to a light theme" : "Switch to a dark theme";
3430
- return /* @__PURE__ */ V("div", {
3513
+ return /* @__PURE__ */ B("div", {
3431
3514
  className: "stage-theme-toggle",
3432
3515
  "data-scene-id": e.id,
3433
- children: /* @__PURE__ */ V("button", {
3516
+ children: /* @__PURE__ */ B("button", {
3434
3517
  type: "button",
3435
3518
  className: "stage-theme-toggle__button",
3436
3519
  "aria-label": o,
3437
3520
  title: o,
3438
3521
  onClick: () => {
3439
- Qo(a.name), n(a.name), r(a.isDark ? I.Dark : I.Light);
3522
+ es(a.name), n(a.name), r(a.isDark ? F.Dark : F.Light);
3440
3523
  },
3441
- children: /* @__PURE__ */ V("svg", {
3524
+ children: /* @__PURE__ */ B("svg", {
3442
3525
  width: "18",
3443
3526
  height: "18",
3444
3527
  viewBox: "0 0 24 24",
@@ -3448,43 +3531,43 @@ function Ws({ element: e }) {
3448
3531
  strokeLinecap: "round",
3449
3532
  strokeLinejoin: "round",
3450
3533
  "aria-hidden": "true",
3451
- children: i ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
3534
+ children: i ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("circle", {
3452
3535
  cx: "12",
3453
3536
  cy: "12",
3454
3537
  r: "4"
3455
- }), /* @__PURE__ */ V("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__ */ V("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
3538
+ }), /* @__PURE__ */ B("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__ */ B("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
3456
3539
  })
3457
3540
  })
3458
3541
  });
3459
3542
  }
3460
- function Gs({ element: e }) {
3543
+ function Qs({ element: e }) {
3461
3544
  let t = e.properties ?? {};
3462
- return /* @__PURE__ */ V("nav", {
3545
+ return /* @__PURE__ */ B("nav", {
3463
3546
  className: "stage-navigation-tree",
3464
3547
  "aria-label": "Navigation",
3465
3548
  "data-scene-id": e.id,
3466
- children: /* @__PURE__ */ V(Ks, {
3549
+ children: /* @__PURE__ */ B($s, {
3467
3550
  nodes: t.nodes ?? [],
3468
3551
  activeScreen: t.activeScreen
3469
3552
  })
3470
3553
  });
3471
3554
  }
3472
- function Ks({ nodes: e, activeScreen: t }) {
3473
- return /* @__PURE__ */ V("ul", {
3555
+ function $s({ nodes: e, activeScreen: t }) {
3556
+ return /* @__PURE__ */ B("ul", {
3474
3557
  role: "tree",
3475
- children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ H("li", {
3558
+ children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ V("li", {
3476
3559
  role: "treeitem",
3477
3560
  "aria-expanded": "true",
3478
- children: [/* @__PURE__ */ V("span", {
3561
+ children: [/* @__PURE__ */ B("span", {
3479
3562
  className: "stage-navigation-group",
3480
3563
  children: e.label
3481
- }), /* @__PURE__ */ V(Ks, {
3564
+ }), /* @__PURE__ */ B($s, {
3482
3565
  nodes: e.children,
3483
3566
  activeScreen: t
3484
3567
  })]
3485
- }, e.label) : /* @__PURE__ */ V("li", {
3568
+ }, e.label) : /* @__PURE__ */ B("li", {
3486
3569
  role: "treeitem",
3487
- children: /* @__PURE__ */ V(qs, {
3570
+ children: /* @__PURE__ */ B(ec, {
3488
3571
  node: e,
3489
3572
  screen: e.screen,
3490
3573
  activeScreen: t
@@ -3492,11 +3575,11 @@ function Ks({ nodes: e, activeScreen: t }) {
3492
3575
  }, `${e.screen}:${e.label}`))
3493
3576
  });
3494
3577
  }
3495
- function qs({ node: e, screen: t, activeScreen: n }) {
3496
- let r = c(xe), i = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", a = e.destination, o = a?.kind === "external", s = a && r && !o && hs(a) ? (e) => {
3578
+ function ec({ node: e, screen: t, activeScreen: n }) {
3579
+ let r = c(Se), i = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", a = e.destination, o = a?.kind === "external", s = a && r && !o && _s(a) ? (e) => {
3497
3580
  e.preventDefault(), r.navigate(a);
3498
- } : void 0, l = o ? Ps(a.route) : Ns(t), u = o && l === void 0;
3499
- return /* @__PURE__ */ H("a", {
3581
+ } : void 0, l = o ? Ls(a.route) : Is(t), u = o && l === void 0;
3582
+ return /* @__PURE__ */ V("a", {
3500
3583
  href: l,
3501
3584
  rel: o && !u ? "noreferrer" : void 0,
3502
3585
  "aria-disabled": u ? "true" : void 0,
@@ -3505,23 +3588,23 @@ function qs({ node: e, screen: t, activeScreen: n }) {
3505
3588
  "data-presentation": e.presentation,
3506
3589
  "data-icon": e.icon,
3507
3590
  onClick: s,
3508
- children: [i !== "text" && e.icon && /* @__PURE__ */ V("span", {
3591
+ children: [i !== "text" && e.icon && /* @__PURE__ */ B("span", {
3509
3592
  className: "stage-navigation-icon",
3510
3593
  "aria-hidden": "true",
3511
3594
  "data-icon-name": e.icon
3512
3595
  }), i !== "icon" && e.label]
3513
3596
  });
3514
3597
  }
3515
- function Js() {
3516
- let { activity: e } = c(zs);
3517
- return e ? /* @__PURE__ */ V("p", {
3598
+ function tc() {
3599
+ let { activity: e } = c(Ks);
3600
+ return e ? /* @__PURE__ */ B("p", {
3518
3601
  className: "stage-activity",
3519
3602
  role: "status",
3520
3603
  children: e
3521
3604
  }) : null;
3522
3605
  }
3523
- function Ys() {
3524
- let e = Ke(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
3606
+ function nc() {
3607
+ let e = qe(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
3525
3608
  return l(() => {
3526
3609
  let r = e?.isDark ? "dark" : "light";
3527
3610
  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 ?? "";
@@ -3531,26 +3614,27 @@ function Ys() {
3531
3614
  n
3532
3615
  ]), null;
3533
3616
  }
3534
- var Xs = {
3535
- [ys]: Hs,
3536
- [_s]: Us,
3537
- [vs]: Ws,
3538
- [ks]: Gs,
3539
- [Vs]: Js,
3540
- "core:slot": Is
3617
+ var rc = {
3618
+ [xs]: Ys,
3619
+ [Ss]: Gs,
3620
+ [ys]: Xs,
3621
+ [bs]: Zs,
3622
+ [Ms]: Qs,
3623
+ [Js]: tc,
3624
+ "core:slot": zs
3541
3625
  };
3542
3626
  // src/stageResponseContracts.ts
3543
- function Zs(e) {
3627
+ function ic(e) {
3544
3628
  return {
3545
3629
  commandResponse: (t) => e?.commands[t] ?? void 0,
3546
- targetType: (t, n) => Qs(e, t, n)
3630
+ targetType: (t, n) => ac(e, t, n)
3547
3631
  };
3548
3632
  }
3549
- function Qs(e, t, n) {
3633
+ function ac(e, t, n) {
3550
3634
  if (n.kind === "message") return { kind: "string" };
3551
- if (n.kind === "argument") return $s(e, t, n.name);
3635
+ if (n.kind === "argument") return oc(e, t, n.name);
3552
3636
  }
3553
- function $s(e, t, n) {
3637
+ function oc(e, t, n) {
3554
3638
  switch (t.kind) {
3555
3639
  case S.ExecuteCommand: return e?.commandInputs[t.command]?.[n] ?? void 0;
3556
3640
  case S.Navigate: return e?.screenInputs[t.screen]?.[n] ?? void 0;
@@ -3558,13 +3642,13 @@ function $s(e, t, n) {
3558
3642
  }
3559
3643
  }
3560
3644
  // src/stageShell.ts
3561
- var ec = [
3645
+ var sc = [
3562
3646
  "navigationMode",
3563
3647
  "menuTheme",
3564
3648
  "showFooter",
3565
3649
  "showThemeSwitcher"
3566
- ], tc = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3567
- function nc(e, t, n = !1) {
3650
+ ], cc = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3651
+ function lc(e, t, n = !1) {
3568
3652
  let r = [], i = {
3569
3653
  showFooter: !0,
3570
3654
  showThemeSwitcher: !0,
@@ -3572,54 +3656,54 @@ function nc(e, t, n = !1) {
3572
3656
  problems: r
3573
3657
  };
3574
3658
  for (let [e, n] of Object.entries(t.options ?? {})) {
3575
- let a = rc(i, t.name, e, n);
3659
+ let a = uc(i, t.name, e, n);
3576
3660
  a && r.push(a);
3577
3661
  }
3578
- return ac(i, e?.appearance, n), i;
3662
+ return fc(i, e?.appearance, n), i;
3579
3663
  }
3580
- function rc(e, t, n, r) {
3581
- if (!ec.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${ec.join(", ")}.`;
3582
- if (n === "navigationMode") return ic(n, r, st, (t) => {
3664
+ function uc(e, t, n, r) {
3665
+ if (!sc.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${sc.join(", ")}.`;
3666
+ if (n === "navigationMode") return dc(n, r, ct, (t) => {
3583
3667
  e.mode = t;
3584
3668
  });
3585
- if (n === "menuTheme") return ic(n, r, ct, (t) => {
3669
+ if (n === "menuTheme") return dc(n, r, lt, (t) => {
3586
3670
  e.menuTheme = t;
3587
3671
  });
3588
3672
  if (typeof r != "boolean") return `Option '${n}' is '${String(r)}'; expected true or false.`;
3589
3673
  n === "showFooter" ? e.showFooter = r : e.showThemeSwitcher = r;
3590
3674
  }
3591
- function ic(e, t, n, r) {
3675
+ function dc(e, t, n, r) {
3592
3676
  let i = n.find((e) => e === t);
3593
3677
  if (!i) return `Option '${e}' is '${String(t)}'; expected one of ${n.join(", ")}.`;
3594
3678
  r(i);
3595
3679
  }
3596
- function ac(e, t, n) {
3680
+ function fc(e, t, n) {
3597
3681
  if (t?.colorScheme !== void 0) {
3598
3682
  e.followsSystem = t.colorScheme === _.System;
3599
3683
  let r = e.followsSystem ? n : t.colorScheme === _.Dark;
3600
- e.colorScheme = r ? I.Dark : I.Light, e.themeName = it.find((e) => (e.isDark ?? !1) === r)?.name, e.followsSystem || (e.showThemeSwitcher = !1);
3684
+ e.colorScheme = r ? F.Dark : F.Light, e.themeName = at.find((e) => (e.isDark ?? !1) === r)?.name, e.followsSystem || (e.showThemeSwitcher = !1);
3601
3685
  }
3602
- t?.accent !== void 0 && (tc.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
3686
+ t?.accent !== void 0 && (cc.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
3603
3687
  }
3604
- function oc(e) {
3688
+ function pc(e) {
3605
3689
  return {
3606
3690
  showFooter: e?.showFooter ?? !0,
3607
3691
  showThemeSwitcher: e?.showThemeSwitcher ?? !0
3608
3692
  };
3609
3693
  }
3610
- function sc(e, t) {
3694
+ function mc(e, t) {
3611
3695
  if (e?.root === void 0) return [];
3612
3696
  let n = /* @__PURE__ */ new Set([
3613
- M.RootTemplateUnknown,
3614
- M.RootTemplateVersionNotSatisfied,
3615
- M.RootTemplateNotApplicable,
3616
- M.RootTemplateMissingContentSlot,
3617
- M.RootTemplateCycle,
3618
- M.RootTemplateBlueprintNotInstalled
3697
+ j.RootTemplateUnknown,
3698
+ j.RootTemplateVersionNotSatisfied,
3699
+ j.RootTemplateNotApplicable,
3700
+ j.RootTemplateMissingContentSlot,
3701
+ j.RootTemplateCycle,
3702
+ j.RootTemplateBlueprintNotInstalled
3619
3703
  ]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
3620
- return r.length === 0 && t.origin !== N.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;
3704
+ return r.length === 0 && t.origin !== M.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;
3621
3705
  }
3622
- function cc(e) {
3706
+ function hc(e) {
3623
3707
  let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
3624
3708
  0,
3625
3709
  2,
@@ -3627,7 +3711,7 @@ function cc(e) {
3627
3711
  ].map((e) => parseInt(t.slice(e, e + 2), 16));
3628
3712
  return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
3629
3713
  }
3630
- function lc(e, t) {
3714
+ function gc(e, t) {
3631
3715
  if (t === void 0) return e;
3632
3716
  let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
3633
3717
  0,
@@ -3639,25 +3723,25 @@ function lc(e, t) {
3639
3723
  tokens: {
3640
3724
  ...e.tokens,
3641
3725
  "primary.color": t,
3642
- "primary.contrastColor": cc(t),
3726
+ "primary.contrastColor": hc(t),
3643
3727
  "focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
3644
3728
  }
3645
3729
  }));
3646
3730
  }
3647
3731
  // src/StageShellSettings.tsx
3648
- var uc = "(prefers-color-scheme: dark)";
3649
- function dc() {
3732
+ var _c = "(prefers-color-scheme: dark)";
3733
+ function vc() {
3650
3734
  return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
3651
3735
  }
3652
- function fc({ settings: e, onSystemSchemeChange: t }) {
3653
- let n = p(ft());
3654
- n.current = ft();
3736
+ function yc({ settings: e, onSystemSchemeChange: t }) {
3737
+ let n = p(pt());
3738
+ n.current = pt();
3655
3739
  let { mode: r, menuTheme: i, colorScheme: a, themeName: o } = e;
3656
3740
  return l(() => {
3657
3741
  let { setMode: e, setMenuTheme: t, setColorScheme: s, setThemeName: c } = n.current;
3658
3742
  r !== void 0 && e(r), i !== void 0 && t(i);
3659
- let l = it.find((e) => e.name === Zo());
3660
- l ? (c(l.name), s(l.isDark ? I.Dark : I.Light)) : (a !== void 0 && s(a), o !== void 0 && c(o));
3743
+ let l = at.find((e) => e.name === $o());
3744
+ l ? (c(l.name), s(l.isDark ? F.Dark : F.Light)) : (a !== void 0 && s(a), o !== void 0 && c(o));
3661
3745
  }, [
3662
3746
  r,
3663
3747
  i,
@@ -3665,16 +3749,16 @@ function fc({ settings: e, onSystemSchemeChange: t }) {
3665
3749
  o
3666
3750
  ]), l(() => {
3667
3751
  if (!e.followsSystem || !globalThis.matchMedia || !t) return;
3668
- let n = globalThis.matchMedia(uc), r = (e) => t(e.matches);
3752
+ let n = globalThis.matchMedia(_c), r = (e) => t(e.matches);
3669
3753
  return n.addEventListener("change", r), () => n.removeEventListener("change", r);
3670
3754
  }, [e.followsSystem, t]), null;
3671
3755
  }
3672
3756
  // src/stageNavigationModel.ts
3673
- function pc(e) {
3757
+ function bc(e) {
3674
3758
  return (e?.application.outlets.some((e) => e.defaults.length > 0) ?? !1) || (e?.modules.length ?? 0) > 0;
3675
3759
  }
3676
- function mc(e) {
3677
- let t = e.filter(hc), n = /* @__PURE__ */ new Map();
3760
+ function xc(e) {
3761
+ let t = e.filter(Sc), n = /* @__PURE__ */ new Map();
3678
3762
  for (let e of t) {
3679
3763
  let t = (e.path ?? []).join(".");
3680
3764
  t.length > 0 && !n.has(t) && n.set(t, e.name);
@@ -3686,41 +3770,41 @@ function mc(e) {
3686
3770
  return n.get(r) ?? i ?? (t.some((e) => e.name === r) ? r : void 0);
3687
3771
  };
3688
3772
  }
3689
- function hc(e) {
3773
+ function Sc(e) {
3690
3774
  return e.fits === void 0 || e.fits.length === 0 || e.fits.includes(k.Page);
3691
3775
  }
3692
- function gc(e) {
3776
+ function Cc(e) {
3693
3777
  return (t) => e.find((e) => e.name === t)?.path?.[0];
3694
3778
  }
3695
- function _c(e, t, n) {
3779
+ function wc(e, t, n) {
3696
3780
  let r = e.navigation ?? {
3697
3781
  application: { outlets: [] },
3698
3782
  modules: []
3699
3783
  };
3700
3784
  return {
3701
3785
  structure: e.structure ?? { modules: [] },
3702
- navigation: n ? vc(r, n) : r,
3703
- screenFor: mc(e.screens),
3704
- moduleOf: gc(e.screens),
3786
+ navigation: n ? Tc(r, n) : r,
3787
+ screenFor: xc(e.screens),
3788
+ moduleOf: Cc(e.screens),
3705
3789
  ...t ? { isVisible: t } : {}
3706
3790
  };
3707
3791
  }
3708
- function vc(e, t) {
3709
- return typeof e == "string" ? ce(e, t) : Array.isArray(e) ? e.map((e) => vc(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, vc(n, t)])) : e;
3792
+ function Tc(e, t) {
3793
+ return typeof e == "string" ? le(e, t) : Array.isArray(e) ? e.map((e) => Tc(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Tc(n, t)])) : e;
3710
3794
  }
3711
3795
  // src/stageSlices.ts
3712
- function yc(e) {
3796
+ function Ec(e) {
3713
3797
  return (t) => Y(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
3714
3798
  name: e.name,
3715
3799
  type: e.type === "text" || e.type === void 0 ? "string" : e.type,
3716
- label: bc(e.name),
3800
+ label: Dc(e.name),
3717
3801
  required: e.required
3718
3802
  }));
3719
3803
  }
3720
- function bc(e) {
3804
+ function Dc(e) {
3721
3805
  return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
3722
3806
  }
3723
- function xc(e, t, n) {
3807
+ function Oc(e, t, n) {
3724
3808
  return { invoke: async (r, i, a) => {
3725
3809
  let o = a ?? r.slice(r.lastIndexOf(".") + 1);
3726
3810
  if (!on(o)) return {
@@ -3740,7 +3824,7 @@ function xc(e, t, n) {
3740
3824
  } };
3741
3825
  }
3742
3826
  // src/withoutSeededSlots.ts
3743
- function Sc(e, t) {
3827
+ function kc(e, t) {
3744
3828
  let n = /* @__PURE__ */ new Map();
3745
3829
  for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
3746
3830
  return e.map((e) => {
@@ -3757,9 +3841,9 @@ function Sc(e, t) {
3757
3841
  });
3758
3842
  }
3759
3843
  // src/stageOutlets.tsx
3760
- function Cc(e) {
3844
+ function Ac(e) {
3761
3845
  let t = new Map(e.screens.map((e) => [e.name, e]));
3762
- return wc(e.structure).map((n) => {
3846
+ return jc(e.structure).map((n) => {
3763
3847
  let r = t.get(n.name), i = n.command ? Y(e.commandSchemas?.[n.command] ?? "").map((e) => e.identity ? {
3764
3848
  name: e.name,
3765
3849
  source: te.DataContext
@@ -3773,36 +3857,36 @@ function Cc(e) {
3773
3857
  };
3774
3858
  });
3775
3859
  }
3776
- function wc(e) {
3860
+ function jc(e) {
3777
3861
  let t = (e) => e.flatMap((e) => [...e.slices, ...t(e.features ?? [])]);
3778
3862
  return (e?.modules ?? []).flatMap((e) => [...e.slices ?? [], ...t(e.features ?? [])]);
3779
3863
  }
3780
- function Tc(e, t) {
3864
+ function Mc(e, t) {
3781
3865
  let n = e.screens.find((e) => e.name === t);
3782
3866
  if (!n) return { chain: [] };
3783
- let { chain: r, contributors: i } = ie({
3867
+ let { chain: r, contributors: i } = ae({
3784
3868
  layouts: e.layouts,
3785
3869
  screenTemplates: e.screenTemplates,
3786
3870
  screens: e.screens,
3787
3871
  navigation: e.navigation,
3788
3872
  levels: e.outletLevels
3789
- }, n.name), a = e.screenTemplates.find((e) => e.name === n.screenTemplate), o = e.layouts.find((e) => e.name === n.layout), s = Object.entries(n.slotContent ?? {}).filter(([, e]) => e.some((e) => e.componentName !== "core:slot")).map(([e]) => e), c = F([...o?.slots ?? [], ...a?.slots ?? []], s);
3873
+ }, n.name), a = e.screenTemplates.find((e) => e.name === n.screenTemplate), o = e.layouts.find((e) => e.name === n.layout), s = Object.entries(n.slotContent ?? {}).filter(([, e]) => e.some((e) => e.componentName !== "core:slot")).map(([e]) => e), c = P([...o?.slots ?? [], ...a?.slots ?? []], s);
3790
3874
  return {
3791
3875
  chain: r,
3792
3876
  contributors: i,
3793
- slices: Cc(e),
3877
+ slices: Ac(e),
3794
3878
  slots: c
3795
3879
  };
3796
3880
  }
3797
- function Ec({ source: e, screen: t, children: n }) {
3798
- let r = f(() => Tc(e, t), [e, t]);
3799
- return /* @__PURE__ */ V(Se, {
3881
+ function Nc({ source: e, screen: t, children: n }) {
3882
+ let r = f(() => Mc(e, t), [e, t]);
3883
+ return /* @__PURE__ */ B(Ce, {
3800
3884
  value: r,
3801
3885
  children: n
3802
3886
  });
3803
3887
  }
3804
3888
  // src/stageIcons.ts
3805
- var Dc = /* @__PURE__ */ new Map([
3889
+ var Pc = /* @__PURE__ */ new Map([
3806
3890
  ["chart", "chart-column"],
3807
3891
  ["add", "plus"],
3808
3892
  ["dollar", "dollar-sign"],
@@ -3810,23 +3894,23 @@ var Dc = /* @__PURE__ */ new Map([
3810
3894
  ["refresh", "refresh-cw"],
3811
3895
  ["invoice", "receipt-text"],
3812
3896
  ["batch", "layers"]
3813
- ]), Oc = (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(), kc = Ne([{
3897
+ ]), Fc = (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(), Ic = Pe([{
3814
3898
  library: ee,
3815
3899
  loadGlyph: async ({ key: e }) => {
3816
- let t = Oc(e), n = Dc.get(t) ?? t;
3817
- if (Object.hasOwn(Ft, n)) return (await Ft[n]())?.default;
3900
+ let t = Fc(e), n = Pc.get(t) ?? t;
3901
+ if (Object.hasOwn(It, n)) return (await It[n]())?.default;
3818
3902
  }
3819
3903
  }]);
3820
3904
  // src/App.tsx
3821
- function Ac(e = {}) {
3822
- return Ds({
3905
+ function Lc(e = {}) {
3906
+ return As({
3823
3907
  ...e,
3824
- ...Lo,
3825
- ...Xs
3908
+ ...zo,
3909
+ ...rc
3826
3910
  });
3827
3911
  }
3828
- function jc(e, t) {
3829
- return z(`form-${e}-${t.name}`, io, {
3912
+ function Rc(e, t) {
3913
+ return R(`form-${e}-${t.name}`, oo, {
3830
3914
  command: t.forCommand,
3831
3915
  label: t.name,
3832
3916
  generationMode: t.generationMode,
@@ -3835,46 +3919,47 @@ function jc(e, t) {
3835
3919
  onSubmit: t.onSubmit
3836
3920
  });
3837
3921
  }
3838
- function Mc(e, t) {
3922
+ function zc(e, t) {
3839
3923
  let n = e.screens[0];
3840
- return at(e, n, {
3841
- profile: Ts(e.uiProfiles),
3842
- blueprintTemplates: t?.length ? [...ot, ...t] : ot
3924
+ return ot(e, n, {
3925
+ profile: Os(e.uiProfiles),
3926
+ blueprintTemplates: t?.length ? [...st, ...t] : st
3843
3927
  });
3844
3928
  }
3845
- function Nc(e, t) {
3929
+ function Bc(e, t) {
3846
3930
  return t ? e.map((e) => ({
3847
3931
  ...e,
3848
- slotContent: Object.fromEntries(Object.entries(e.slotContent ?? {}).map(([e, n]) => [e, n.map((e) => se(e, t))]))
3932
+ slotContent: Object.fromEntries(Object.entries(e.slotContent ?? {}).map(([e, n]) => [e, n.map((e) => ce(e, t))]))
3849
3933
  })) : e;
3850
3934
  }
3851
- function Pc(e, t, n, r, i, a, o = !0, s = !0) {
3852
- let c = {
3853
- regions: pc(e.navigation),
3935
+ function Vc(e, t, n, r, i, a, o = !0, s = !0, c = !1) {
3936
+ let l = {
3937
+ regions: bc(e.navigation),
3854
3938
  showFooter: o,
3855
- showThemeSwitcher: s
3856
- }, l = Nc(e.screens, i), u = Fc(e);
3939
+ showThemeSwitcher: s,
3940
+ showActingUser: c
3941
+ }, u = Bc(e.screens, i), d = Hc(e);
3857
3942
  return {
3858
- profile: Ts(e.uiProfiles),
3859
- catalog: Os(r),
3860
- blueprintTemplates: a?.length ? [...ot, ...a] : ot,
3943
+ profile: Os(e.uiProfiles),
3944
+ catalog: js(r),
3945
+ blueprintTemplates: a?.length ? [...st, ...a] : st,
3861
3946
  namedTemplateOnly: !0,
3862
- chrome: (e, r) => r === L.FullPageShell ? { [R.ConfigPanel]: Ms(l, e.name, t, n, u, c)[R.ConfigPanel] } : Ms(l, e.name, t, n, u, c),
3863
- form: jc,
3864
- trailing: [z("activity", Vs)],
3947
+ chrome: (e, r) => r === I.FullPageShell ? { [L.ConfigPanel]: Fs(u, e.name, t, n, d, l)[L.ConfigPanel] } : Fs(u, e.name, t, n, d, l),
3948
+ form: Rc,
3949
+ trailing: [R("activity", Js)],
3865
3950
  decorate: (e) => {
3866
- let t = Bo(or(e));
3867
- return i ? se(t, i) : t;
3951
+ let t = Ho(or(e));
3952
+ return i ? ce(t, i) : t;
3868
3953
  }
3869
3954
  };
3870
3955
  }
3871
- function Fc(e) {
3956
+ function Hc(e) {
3872
3957
  let t = e.navigation?.application.logo;
3873
3958
  if (t) return {
3874
3959
  title: t.title,
3875
3960
  image: t.image || void 0
3876
3961
  };
3877
- let n = Ts(e.uiProfiles).identity;
3962
+ let n = Os(e.uiProfiles).identity;
3878
3963
  if (!n?.name) return;
3879
3964
  let r = n.logo;
3880
3965
  return {
@@ -3884,22 +3969,22 @@ function Fc(e) {
3884
3969
  showName: n.showName
3885
3970
  };
3886
3971
  }
3887
- function Ic(e, t, n, r, i, a) {
3888
- let [o] = Va([t], Lc(e));
3889
- return tt(e, o, Pc(e, n, r, i, void 0, a)).element;
3972
+ function Uc(e, t, n, r, i, a) {
3973
+ let [o] = Ua([t], Wc(e));
3974
+ return nt(e, o, Vc(e, n, r, i, void 0, a)).element;
3890
3975
  }
3891
- function Lc(e) {
3976
+ function Wc(e) {
3892
3977
  return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
3893
3978
  }
3894
- function Rc() {
3979
+ function Gc() {
3895
3980
  try {
3896
3981
  return globalThis.localStorage ?? null;
3897
3982
  } catch {
3898
3983
  return null;
3899
3984
  }
3900
3985
  }
3901
- function zc({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: a = "hash" } = {}) {
3902
- let o = Bt(), [s, c] = m(), [u, d] = m(""), p = f(() => Ac(e), [e, s]), h = Vt(), g = Ro();
3986
+ function Kc({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: a = "hash" } = {}) {
3987
+ let o = U(), [s, c] = m(), [u, d] = m(""), p = f(() => Lc(e), [e, s]), h = Vt(), g = Bo();
3903
3988
  return l(() => {
3904
3989
  let e = new AbortController();
3905
3990
  return o.scene(e.signal).then((e) => c(r?.length ? {
@@ -3908,10 +3993,10 @@ function zc({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
3908
3993
  } : e)).catch((t) => {
3909
3994
  e.signal.aborted || d(t instanceof Error ? t.message : String(t));
3910
3995
  }), () => e.abort();
3911
- }, [o, r]), u ? /* @__PURE__ */ H("main", {
3996
+ }, [o, r]), u ? /* @__PURE__ */ V("main", {
3912
3997
  className: "stage-message",
3913
- children: [/* @__PURE__ */ V("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ V("p", { children: u })]
3914
- }) : s ? /* @__PURE__ */ V(Bc, {
3998
+ children: [/* @__PURE__ */ B("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ B("p", { children: u })]
3999
+ }) : s ? /* @__PURE__ */ B(qc, {
3915
4000
  scene: s,
3916
4001
  registry: p,
3917
4002
  routing: a,
@@ -3920,29 +4005,29 @@ function zc({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
3920
4005
  packageCatalog: t,
3921
4006
  screenTemplates: n,
3922
4007
  isVisible: i
3923
- }) : /* @__PURE__ */ V("main", {
4008
+ }) : /* @__PURE__ */ B("main", {
3924
4009
  className: "stage-message",
3925
- children: /* @__PURE__ */ V("h1", { children: "Preparing the Stage" })
4010
+ children: /* @__PURE__ */ B("h1", { children: "Preparing the Stage" })
3926
4011
  });
3927
4012
  }
3928
- function Bc({ scene: e, registry: t, routing: n, routeState: r, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
3929
- let d = f(() => wa(e), [e]), p = f(() => {
4013
+ function qc({ scene: e, registry: t, routing: n, routeState: r, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
4014
+ let d = f(() => Ea(e), [e]), p = f(() => {
3930
4015
  if (hn(n), n === "path") {
3931
4016
  let e = /^#\/(.+)$/.exec(globalThis.location.hash);
3932
4017
  e && globalThis.history.replaceState(null, "", `/${e[1]}`);
3933
4018
  }
3934
- return Ma(window, n, d);
4019
+ return Pa(window, n, d);
3935
4020
  }, [n, d]);
3936
4021
  l(() => () => p.dispose(), [p]);
3937
- let h = Fa(p), g = p.history, [_, v] = m(dc), y = fr(), b = e.screens[0]?.name ?? "", x = f(() => Ts(e.uiProfiles), [e]), S = f(() => b ? Mc(e, c) : void 0, [
4022
+ let h = La(p), g = p.history, [_, v] = m(vc), y = fr(), b = e.screens[0]?.name ?? "", x = f(() => Os(e.uiProfiles), [e]), S = f(() => b ? zc(e, c) : void 0, [
3938
4023
  e,
3939
4024
  c,
3940
4025
  b
3941
- ]), C = f(() => S ? sc(x, S) : [], [x, S]), w = f(() => S ? nc(x, S, _) : void 0, [
4026
+ ]), C = f(() => S ? mc(x, S) : [], [x, S]), w = f(() => S ? lc(x, S, _) : void 0, [
3942
4027
  x,
3943
4028
  S,
3944
4029
  _
3945
- ]), T = f(() => lc(it, w?.accent), [w?.accent]), { showFooter: E, showThemeSwitcher: D } = oc(w), O = f(() => Pc(e, a.locales, a.locale, o, a.dictionary, c, E, D), [
4030
+ ]), T = f(() => gc(at, w?.accent), [w?.accent]), { showFooter: E, showThemeSwitcher: D } = pc(w), O = U(), k = !!O.actingUser && !!O.selectActingUser, A = f(() => Vc(e, a.locales, a.locale, o, a.dictionary, c, E, D, k), [
3946
4031
  e,
3947
4032
  a.locales,
3948
4033
  a.locale,
@@ -3950,43 +4035,44 @@ function Bc({ scene: e, registry: t, routing: n, routeState: r, strings: a, pack
3950
4035
  o,
3951
4036
  c,
3952
4037
  E,
3953
- D
3954
- ]), k = s((e) => v(e), []), A = f(() => _c(e, u, a.dictionary), [
4038
+ D,
4039
+ k
4040
+ ]), ee = s((e) => v(e), []), te = f(() => wc(e, u, a.dictionary), [
3955
4041
  e,
3956
4042
  u,
3957
4043
  a.dictionary
3958
- ]), ee = f(() => ({
4044
+ ]), ne = f(() => ({
3959
4045
  ...e,
3960
- screens: Va(Sc(e.screens, [
4046
+ screens: Ua(kc(e.screens, [
3961
4047
  ...e.screenTemplates,
3962
4048
  ...e.dialogTemplates ?? [],
3963
- ...ot,
4049
+ ...st,
3964
4050
  ...c ?? []
3965
- ]), Lc(e))
4051
+ ]), Wc(e))
3966
4052
  }), [e, c]);
3967
- if (!b) return /* @__PURE__ */ H("main", {
4053
+ if (!b) return /* @__PURE__ */ V("main", {
3968
4054
  className: "stage-message",
3969
- children: [/* @__PURE__ */ V("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ V("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
4055
+ children: [/* @__PURE__ */ B("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ B("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
3970
4056
  });
3971
- if (C.length > 0) return /* @__PURE__ */ H("main", {
4057
+ if (C.length > 0) return /* @__PURE__ */ V("main", {
3972
4058
  className: "stage-message",
3973
4059
  role: "alert",
3974
4060
  "data-stage-startup-problem": "root-template",
3975
4061
  children: [
3976
- /* @__PURE__ */ V("h1", { children: "Unable to start this Stage" }),
3977
- /* @__PURE__ */ V("p", { children: "The ui profile's root template cannot be the application's shell." }),
3978
- /* @__PURE__ */ V("ul", { children: C.map((e) => /* @__PURE__ */ V("li", { children: e }, e)) })
4062
+ /* @__PURE__ */ B("h1", { children: "Unable to start this Stage" }),
4063
+ /* @__PURE__ */ B("p", { children: "The ui profile's root template cannot be the application's shell." }),
4064
+ /* @__PURE__ */ B("ul", { children: C.map((e) => /* @__PURE__ */ B("li", { children: e }, e)) })
3979
4065
  ]
3980
4066
  });
3981
- let te = /* @__PURE__ */ V(Ze, {
3982
- application: ee,
3983
- composition: O,
3984
- navigationModel: A,
4067
+ let j = /* @__PURE__ */ B(Qe, {
4068
+ application: ne,
4069
+ composition: A,
4070
+ navigationModel: te,
3985
4071
  registry: t,
3986
4072
  initialScreen: b,
3987
4073
  history: g,
3988
- layoutConfigStorage: Rc(),
3989
- scope: (t, n) => /* @__PURE__ */ V(Vc, {
4074
+ layoutConfigStorage: Gc(),
4075
+ scope: (t, n) => /* @__PURE__ */ B(Jc, {
3990
4076
  scene: e,
3991
4077
  notes: y,
3992
4078
  routeState: r,
@@ -3994,36 +4080,36 @@ function Bc({ scene: e, registry: t, routing: n, routeState: r, strings: a, pack
3994
4080
  navigation: t,
3995
4081
  themes: T,
3996
4082
  shellSettings: w,
3997
- onSystemSchemeChange: k,
4083
+ onSystemSchemeChange: ee,
3998
4084
  children: n
3999
4085
  }),
4000
- renderScreen: (e, n) => /* @__PURE__ */ V(Wc, {
4086
+ renderScreen: (e, n) => /* @__PURE__ */ B(Zc, {
4001
4087
  element: e,
4002
4088
  configuration: n,
4003
4089
  registry: t
4004
4090
  }),
4005
- renderDialog: () => /* @__PURE__ */ V(To, {}),
4006
- renderDialogTemplate: (e, n, r) => /* @__PURE__ */ V(Gc, {
4091
+ renderDialog: () => /* @__PURE__ */ B(Do, {}),
4092
+ renderDialogTemplate: (e, n, r) => /* @__PURE__ */ B(Qc, {
4007
4093
  template: e,
4008
4094
  content: n,
4009
4095
  registry: t,
4010
4096
  strings: a,
4011
4097
  close: () => r.closeDialog()
4012
4098
  })
4013
- }), j = /* @__PURE__ */ V(Ia.Provider, {
4099
+ }), M = /* @__PURE__ */ B(Ra.Provider, {
4014
4100
  value: d,
4015
- children: /* @__PURE__ */ V(Ce, {
4101
+ children: /* @__PURE__ */ B(we, {
4016
4102
  router: h,
4017
- children: te
4103
+ children: j
4018
4104
  })
4019
4105
  });
4020
- return y.enabled ? /* @__PURE__ */ V(i, {
4106
+ return y.enabled ? /* @__PURE__ */ B(i, {
4021
4107
  enabled: !0,
4022
4108
  knownSlices: hr(e.structure),
4023
- children: j
4024
- }) : j;
4109
+ children: M
4110
+ }) : M;
4025
4111
  }
4026
- function Vc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, themes: a, shellSettings: o, onSystemSchemeChange: s, children: c }) {
4112
+ function Jc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, themes: a, shellSettings: o, onSystemSchemeChange: s, children: c }) {
4027
4113
  let [u, d] = m(""), { navigate: f } = i;
4028
4114
  return l(() => d(""), [i.currentScreen, i.currentDialog]), l(() => {
4029
4115
  let e = (e) => {
@@ -4040,39 +4126,39 @@ function Vc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, them
4040
4126
  r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? d(`The modeled screen “${r.screen}” is not available.`) : f(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? f(r) : d(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
4041
4127
  };
4042
4128
  return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
4043
- }, [f, e]), /* @__PURE__ */ V(_e, {
4044
- registry: kc,
4045
- children: /* @__PURE__ */ H($e, {
4129
+ }, [f, e]), /* @__PURE__ */ B(ve, {
4130
+ registry: Ic,
4131
+ children: /* @__PURE__ */ V(et, {
4046
4132
  themes: a,
4047
4133
  children: [
4048
- o && /* @__PURE__ */ V(fc, {
4134
+ o && /* @__PURE__ */ B(yc, {
4049
4135
  settings: o,
4050
4136
  onSystemSchemeChange: s
4051
4137
  }),
4052
- /* @__PURE__ */ V(Ys, {}),
4053
- /* @__PURE__ */ V(Uc, {
4138
+ /* @__PURE__ */ B(nc, {}),
4139
+ /* @__PURE__ */ B(Xc, {
4054
4140
  scene: e,
4055
4141
  screen: i.primaryScreen,
4056
4142
  notes: t
4057
4143
  }),
4058
- /* @__PURE__ */ V(zn, {
4144
+ /* @__PURE__ */ B(zn, {
4059
4145
  routes: n.routes,
4060
4146
  routesReady: n.ready,
4061
4147
  parameters: i.currentParameters,
4062
4148
  locale: r.locale,
4063
4149
  locales: r.locales,
4064
4150
  screen: i.primaryScreen ?? e.screens[0]?.name ?? "",
4065
- children: /* @__PURE__ */ V(Hc, {
4151
+ children: /* @__PURE__ */ B(Yc, {
4066
4152
  activity: u,
4067
4153
  notesEnabled: t.enabled,
4068
4154
  routesReady: n.ready,
4069
4155
  scene: e,
4070
4156
  setActivity: d,
4071
4157
  strings: r,
4072
- children: /* @__PURE__ */ V(br, {
4158
+ children: /* @__PURE__ */ B(br, {
4073
4159
  structure: e.structure,
4074
4160
  screens: e.screens,
4075
- children: /* @__PURE__ */ V(Ec, {
4161
+ children: /* @__PURE__ */ B(Nc, {
4076
4162
  source: e,
4077
4163
  screen: i.primaryScreen,
4078
4164
  children: c
@@ -4084,12 +4170,12 @@ function Vc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, them
4084
4170
  })
4085
4171
  });
4086
4172
  }
4087
- function Hc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivity: i, strings: a, children: o }) {
4088
- let s = W(), c = He(), l = dn(), u = f(() => xc(l, n, s.refreshAfterCommand), [
4173
+ function Yc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivity: i, strings: a, children: o }) {
4174
+ let s = W(), c = Ue(), l = dn(), u = f(() => Oc(l, n, s.refreshAfterCommand), [
4089
4175
  l,
4090
4176
  n,
4091
4177
  s.refreshAfterCommand
4092
- ]), d = f(() => yc(r.commandSchemas), [r.commandSchemas]), p = Me({
4178
+ ]), d = f(() => Ec(r.commandSchemas), [r.commandSchemas]), p = Ne({
4093
4179
  executeCommand: async (e, t) => {
4094
4180
  let r = on(e);
4095
4181
  if (!r && !n) return i(`The modeled command “${e}” is waiting for Stage routes.`), {
@@ -4125,7 +4211,7 @@ function Hc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
4125
4211
  refreshQuery: async (e) => s.refreshQuery(e),
4126
4212
  raise: async (e) => i(`The modeled trigger “${e}” is not available in this Stage runtime.`)
4127
4213
  });
4128
- return /* @__PURE__ */ V(Bs, {
4214
+ return /* @__PURE__ */ B(qs, {
4129
4215
  state: {
4130
4216
  locales: a.locales,
4131
4217
  locale: a.locale,
@@ -4133,16 +4219,16 @@ function Hc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
4133
4219
  activity: e,
4134
4220
  notesEnabled: t
4135
4221
  },
4136
- children: /* @__PURE__ */ V(De, {
4222
+ children: /* @__PURE__ */ B(Oe, {
4137
4223
  invoker: u,
4138
- children: /* @__PURE__ */ V(Te, {
4224
+ children: /* @__PURE__ */ B(Ee, {
4139
4225
  fieldsFor: d,
4140
- children: /* @__PURE__ */ V(ve, {
4226
+ children: /* @__PURE__ */ B(ye, {
4141
4227
  dispatcher: p,
4142
4228
  context: {
4143
4229
  resolve: s.resolveBinding,
4144
4230
  localize: (e) => a.dictionary[e] ?? e,
4145
- responseContracts: Zs(r.responseContracts)
4231
+ responseContracts: ic(r.responseContracts)
4146
4232
  },
4147
4233
  attachments: [],
4148
4234
  onFindings: (e) => i(e.map((e) => e.detail).join(" ")),
@@ -4152,20 +4238,20 @@ function Hc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
4152
4238
  })
4153
4239
  });
4154
4240
  }
4155
- function Uc({ scene: e, screen: t, notes: r }) {
4241
+ function Xc({ scene: e, screen: t, notes: r }) {
4156
4242
  return n({
4157
4243
  screen: vr(e.screens.find((e) => e.name === t)),
4158
4244
  values: { modelReferences: r.modelReferences }
4159
4245
  }), null;
4160
4246
  }
4161
- function Wc({ element: e, configuration: t, registry: n }) {
4162
- let r = W(), i = tr(), a = Be();
4163
- return /* @__PURE__ */ V(xr, {
4247
+ function Zc({ element: e, configuration: t, registry: n }) {
4248
+ let r = W(), i = tr(), a = Ve();
4249
+ return /* @__PURE__ */ B(xr, {
4164
4250
  screen: a?.primaryScreen,
4165
- children: /* @__PURE__ */ H(pi, {
4251
+ children: /* @__PURE__ */ V(pi, {
4166
4252
  element: e,
4167
4253
  outputScope: i.scope,
4168
- children: [/* @__PURE__ */ V(Jo, { element: e }), /* @__PURE__ */ V(be, {
4254
+ children: [/* @__PURE__ */ B(Xo, { element: e }), /* @__PURE__ */ B(xe, {
4169
4255
  element: e,
4170
4256
  registry: n,
4171
4257
  resolveBinding: r.resolveBinding,
@@ -4176,27 +4262,27 @@ function Wc({ element: e, configuration: t, registry: n }) {
4176
4262
  })
4177
4263
  });
4178
4264
  }
4179
- function Gc({ template: e, content: t, registry: n, strings: r, close: i }) {
4180
- let a = W(), o = tr(), s = se(t, r.dictionary);
4265
+ function Qc({ template: e, content: t, registry: n, strings: r, close: i }) {
4266
+ let a = W(), o = tr(), s = ce(t, r.dictionary);
4181
4267
  return l(() => {
4182
4268
  let e = (e) => {
4183
4269
  e.key === "Escape" && i();
4184
4270
  };
4185
4271
  return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
4186
- }, [i]), /* @__PURE__ */ V("div", {
4272
+ }, [i]), /* @__PURE__ */ B("div", {
4187
4273
  className: "stage-dialog-backdrop",
4188
- children: /* @__PURE__ */ H("section", {
4274
+ children: /* @__PURE__ */ V("section", {
4189
4275
  role: "dialog",
4190
4276
  "aria-modal": "true",
4191
4277
  "aria-label": e.displayName ?? e.name,
4192
4278
  className: "stage-dialog",
4193
- children: [/* @__PURE__ */ V("button", {
4279
+ children: [/* @__PURE__ */ B("button", {
4194
4280
  type: "button",
4195
4281
  onClick: i,
4196
4282
  children: "Close"
4197
- }), /* @__PURE__ */ V(pi, {
4283
+ }), /* @__PURE__ */ B(pi, {
4198
4284
  element: s,
4199
- children: /* @__PURE__ */ V(be, {
4285
+ children: /* @__PURE__ */ B(xe, {
4200
4286
  element: s,
4201
4287
  registry: n,
4202
4288
  resolveBinding: a.resolveBinding,
@@ -4207,4 +4293,4 @@ function Gc({ template: e, content: t, registry: n, strings: r, close: i }) {
4207
4293
  })
4208
4294
  });
4209
4295
  }
4210
- export { zc as App, zc as StageApplication, Oi as StageCommandForm, zn as StageDataProvider, On as StageGuardedAction, zt as StageSourceProvider, Ic as composeStageScreen, xc as createStageSliceInvoker, Wn as dataChanged, ln as executeRegisteredCommand, sr as fetchModelReferences, Kt as hostedBasePath, Cs as listsPrimeReact, cr as modelReferenceFor, lr as modelReferenceMap, $t as performQuery, dr as readStageNotes, Yt as registerQueryRouteResolver, ws as registerStageLibrary, on as registeredCommand, Xt as registeredQuery, yc as sliceFieldsFrom, Ac as stageApplicationRegistry, Pc as stageComposition, e as stageDarkSelector, Lt as stageEndpoints, Mc as stageShellOf, It as staticStageSource, en as subscribeQuery, dn as useStageCommandExecutor, W as useStageData, G as useStageQuery, Bt as useStageSource };
4296
+ export { Kc as App, Kc as StageApplication, Oi as StageCommandForm, zn as StageDataProvider, On as StageGuardedAction, Bt as StageSourceProvider, Uc as composeStageScreen, Oc as createStageSliceInvoker, Wn as dataChanged, ln as executeRegisteredCommand, sr as fetchModelReferences, Kt as hostedBasePath, Es as listsPrimeReact, cr as modelReferenceFor, lr as modelReferenceMap, $t as performQuery, Hs as readSandboxActingUser, dr as readStageNotes, Yt as registerQueryRouteResolver, Ds as registerStageLibrary, on as registeredCommand, Xt as registeredQuery, Ec as sliceFieldsFrom, Lc as stageApplicationRegistry, Vc as stageComposition, e as stageDarkSelector, Rt as stageEndpoints, zc as stageShellOf, Lt as staticStageSource, en as subscribeQuery, dn as useStageCommandExecutor, W as useStageData, G as useStageQuery, U as useStageSource, Us as writeSandboxActingUser };