@cratis/stage.runtime 4.220.0 → 4.221.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -1,32 +1,35 @@
1
1
  import "./app.css";
2
2
  import { t as e } from "../stageDarkSelector-DAwb43-P.js";
3
- import { createContext as t, createElement as n, useCallback as r, useContext as i, useEffect as a, useId as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
4
- import { BindingSourceKind as d, ColorScheme as f, DestinationKind as p, FormGenerationMode as m, FormWidthUnit as h, GuardOperator as g, InteractionActionKind as _, InteractionTriggerKind as v, LogoKind as y, PackageKind as b, componentIconLibrary as x } from "@cratis/scene.model";
5
- import { InteractionStop as S, ShellDiagnosticCode as C, ShellOrigin as w, commandResponseContext as T, createBindingResolver as ee, hostProfilePackages as E, resolveArgumentSource as te, resolveBehaviors as D, resolveStringsInElement as O, resolveStringsValue as k, resolveSubjectReference as A, runActions as ne, runBindings as re, validateBindingExpression as ie, validateResponseBindings as ae } from "@cratis/scene.engine";
6
- import { CoreSliceDialog as oe, CoreToolbarItem as j, IconAdapterProvider as se, InteractionScope as ce, SceneElementView as le, SceneNavigationContextInternal as M, SliceCommandFieldsProvider as ue, SliceDialogView as de, SliceInvokerProvider as fe, attachmentFor as pe, componentRegistryKey as me, coreComponents as he, createBrowserDispatcher as ge, createBrowserSceneHistory as _e, createHashSceneHistory as ve, createIconAdapterRegistry as ye, sliceDialogParameters as be, useInteractionScope as xe, useOptionalSceneNavigation as Se, useSceneNavigation as Ce, useSceneOutlets as we, useSceneTheme as Te } from "@cratis/scene.react";
7
- import { ApplicationHost as Ee, ColorScheme as N, ComponentName as P, KanbanBoard as De, LayoutThemeProvider as Oe, SlotName as F, blueprintPackageCatalog as ke, composeApplicationScreen as Ae, defaultBlueprintComponents as je, defaultBlueprintName as Me, defaultBlueprintThemes as I, effectiveShellOf as Ne, externalComponent as L, galleryScreenTemplates as Pe, layoutModes as Fe, menuThemes as Ie, navigationElement as Le, previewComponents as Re, previewProfile as ze, useLayoutConfig as Be } from "@cratis/scene.blueprint.default";
3
+ import { ArcContext as t, useContributeApplicationContext as n } from "@cratis/arc.react";
4
+ import { NotesButton as r, NotesProvider as i } from "@cratis/showrunner.notes.react";
5
+ import "@cratis/showrunner.notes.react/styles";
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 } from "react";
7
+ import { BindingSourceKind as h, ColorScheme as g, DestinationKind as _, FormGenerationMode as v, FormWidthUnit as y, GuardOperator as b, InteractionActionKind as x, InteractionTriggerKind as S, LogoKind as C, PackageKind as w, componentIconLibrary as T } from "@cratis/scene.model";
8
+ import { InteractionStop as E, ShellDiagnosticCode as D, ShellOrigin as O, commandResponseContext as k, createBindingResolver as ee, hostProfilePackages as A, resolveArgumentSource as te, resolveBehaviors as j, resolveStringsInElement as ne, resolveStringsValue as re, resolveSubjectReference as M, runActions as N, runBindings as ie, validateBindingExpression as ae, validateResponseBindings as oe } from "@cratis/scene.engine";
9
+ import { CoreSliceDialog as se, CoreToolbarItem as P, IconAdapterProvider as ce, InteractionScope as le, SceneElementView as ue, SceneNavigationContextInternal as de, SliceCommandFieldsProvider as fe, SliceDialogView as pe, SliceInvokerProvider as me, attachmentFor as he, componentRegistryKey as ge, coreComponents as _e, createBrowserDispatcher as ve, createBrowserSceneHistory as ye, createHashSceneHistory as be, createIconAdapterRegistry as xe, sliceDialogParameters as Se, useInteractionScope as Ce, useOptionalSceneNavigation as we, useSceneNavigation as Te, useSceneOutlets as Ee, useSceneTheme as De } from "@cratis/scene.react";
10
+ import { ApplicationHost as Oe, ColorScheme as F, ComponentName as I, KanbanBoard as ke, LayoutThemeProvider as Ae, SlotName as L, blueprintPackageCatalog as je, composeApplicationScreen as Me, defaultBlueprintComponents as Ne, defaultBlueprintName as Pe, defaultBlueprintThemes as Fe, effectiveShellOf as Ie, externalComponent as R, galleryScreenTemplates as Le, layoutModes as Re, menuThemes as ze, navigationElement as Be, previewComponents as Ve, previewProfile as He, useLayoutConfig as Ue } from "@cratis/scene.blueprint.default";
8
11
  import "@cratis/components/tokens";
9
12
  import "@cratis/components/CommandForm/styles";
10
13
  import "@cratis/components/Dropdown/styles";
11
14
  import "@cratis/components/Common/styles";
12
15
  import "@cratis/components/Display/styles";
13
16
  import "@cratis/scene.blueprint.default/styles.css";
14
- import { ArcContext as Ve } from "@cratis/arc.react";
15
- import { ObservableQueryFor as He, Paging as Ue, QueryFor as We } from "@cratis/arc/queries";
16
- import { resolveCommand as Ge, resolveExactQuery as Ke } from "@cratis/scene.components";
17
- import { Command as qe } from "@cratis/arc/commands";
18
- import { DateOnly as Je, Guid as Ye } from "@cratis/fundamentals";
19
- import { Fragment as Xe, jsx as R, jsxs as z } from "react/jsx-runtime";
20
- import { Button as B } from "@cratis/components/Common";
21
- import { Dialog as Ze } from "@cratis/components/Dialogs";
22
- import { Message as Qe } from "@cratis/components/Display";
23
- import { createPortal as $e } from "react-dom";
24
- import { CommandForm as et, asCommandFormField as tt, withCommandFormFieldBinding as nt } from "@cratis/arc.react/commands";
25
- import { CalendarField as rt, CheckboxField as it, DropdownField as at, InputTextField as ot, NumberField as st } from "@cratis/components/CommandForm";
26
- import { cratisComponents as ct, cratisComponentsPackageManifest as lt } from "@cratis/scene.components/runtime";
27
- import { dynamicIconImports as ut } from "lucide-react/dynamic";
17
+ import { ObservableQueryFor as We, Paging as Ge, QueryFor as Ke } from "@cratis/arc/queries";
18
+ import { resolveCommand as qe, resolveExactQuery as Je } from "@cratis/scene.components";
19
+ import { Command as Ye } from "@cratis/arc/commands";
20
+ import { DateOnly as Xe, Guid as Ze } from "@cratis/fundamentals";
21
+ import { Fragment as Qe, jsx as z, jsxs as B } from "react/jsx-runtime";
22
+ import { Button as V } from "@cratis/components/Common";
23
+ import { Dialog as $e } from "@cratis/components/Dialogs";
24
+ import { Message as et } from "@cratis/components/Display";
25
+ import { Slice as tt } from "@cratis/arc.react/slices";
26
+ import { createPortal as nt } from "react-dom";
27
+ import { CommandForm as rt, asCommandFormField as it, withCommandFormFieldBinding as at } from "@cratis/arc.react/commands";
28
+ import { CalendarField as ot, CheckboxField as st, DropdownField as ct, InputTextField as lt, NumberField as ut } from "@cratis/components/CommandForm";
29
+ import { cratisComponents as dt, cratisComponentsPackageManifest as ft } from "@cratis/scene.components/runtime";
30
+ import { dynamicIconImports as pt } from "lucide-react/dynamic";
28
31
  // src/stageSource.ts
29
- function dt(e) {
32
+ function mt(e) {
30
33
  return {
31
34
  scene: async () => e.scene,
32
35
  routes: async () => e.routes,
@@ -34,27 +37,28 @@ function dt(e) {
34
37
  strings: async (t) => e.strings[t] ?? {}
35
38
  };
36
39
  }
37
- var ft = {
40
+ var ht = {
38
41
  scene: "stage/scene",
39
42
  routes: "stage/routes",
40
43
  locales: "stage/locales",
44
+ modelReferences: "stage/model-references",
41
45
  strings: (e) => `stage/strings/${encodeURIComponent(e)}`
42
- }, pt = t(void 0);
43
- function mt({ source: e, children: t }) {
44
- return n(pt.Provider, { value: e }, t);
46
+ }, gt = a(void 0);
47
+ function _t({ source: e, children: t }) {
48
+ return o(gt.Provider, { value: e }, t);
45
49
  }
46
- function ht() {
47
- let e = i(pt);
50
+ function vt() {
51
+ let e = c(gt);
48
52
  if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
49
53
  return e;
50
54
  }
51
- ft.routes;
52
- function gt() {
53
- let e = ht(), [t, n] = u({
55
+ ht.routes;
56
+ function yt() {
57
+ let e = vt(), [t, n] = m({
54
58
  routes: void 0,
55
59
  ready: !1
56
60
  });
57
- return a(() => {
61
+ return l(() => {
58
62
  let t = new AbortController();
59
63
  return e.routes(t.signal).then((e) => {
60
64
  t.signal.aborted || n({
@@ -70,24 +74,24 @@ function gt() {
70
74
  }, [e]), t;
71
75
  }
72
76
  // src/applyQueryChangeSet.ts
73
- function _t(e) {
77
+ function bt(e) {
74
78
  return typeof e == "object" && e && "id" in e ? e.id : void 0;
75
79
  }
76
- function vt(e) {
80
+ function xt(e) {
77
81
  if (typeof e != "object" || !e) return e;
78
82
  let t = e.toString();
79
83
  return t === "[object Object]" ? JSON.stringify(e) : t;
80
84
  }
81
- function yt(e, t) {
82
- return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : vt(e) === vt(t);
85
+ function St(e, t) {
86
+ return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : xt(e) === xt(t);
83
87
  }
84
- function bt(e, t) {
85
- if (t.removed.length > 0 ? _t(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => yt(_t(e), _t(t)))).map((e) => t.replaced.find((t) => yt(_t(t), _t(e))) ?? e), ...t.added];
88
+ function Ct(e, t) {
89
+ if (t.removed.length > 0 ? bt(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => St(bt(e), bt(t)))).map((e) => t.replaced.find((t) => St(bt(t), bt(e))) ?? e), ...t.added];
86
90
  let n = new Set(t.removed.map((e) => JSON.stringify(e)));
87
91
  return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
88
92
  }
89
93
  // src/hostedBasePath.ts
90
- function xt() {
94
+ function wt() {
91
95
  let e = globalThis.document?.baseURI ?? globalThis.location?.href;
92
96
  if (!e) return "";
93
97
  try {
@@ -96,51 +100,51 @@ function xt() {
96
100
  return "";
97
101
  }
98
102
  }
99
- function St(e) {
100
- return e || xt();
103
+ function Tt(e) {
104
+ return e || wt();
101
105
  }
102
106
  // src/queryExecutor.ts
103
- var Ct;
104
- function wt(e) {
105
- Ct = e;
107
+ var Et;
108
+ function Dt(e) {
109
+ Et = e;
106
110
  }
107
- function Tt(e, t) {
108
- let n = Ke(e);
109
- return n === "ambiguous" && t && (n = Ke(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), Et(n) ? n : t ? Ct?.(t) : void 0;
111
+ function Ot(e, t) {
112
+ let n = Je(e);
113
+ return n === "ambiguous" && t && (n = Je(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), kt(n) ? n : t ? Et?.(t) : void 0;
110
114
  }
111
- function Et(e) {
112
- return typeof e == "function" && (e.prototype instanceof We || e.prototype instanceof He);
115
+ function kt(e) {
116
+ return typeof e == "function" && (e.prototype instanceof Ke || e.prototype instanceof We);
113
117
  }
114
- function Dt(e, t) {
115
- e.setMicroservice(t.microservice), e.setApiBasePath(St(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Ue.noPaging;
118
+ function At(e, t) {
119
+ e.setMicroservice(t.microservice), e.setApiBasePath(Tt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Ge.noPaging;
116
120
  }
117
- function Ot(e, t, n) {
121
+ function jt(e, t, n) {
118
122
  let r = new e();
119
- return Dt(r, n), r.perform(t);
123
+ return At(r, n), r.perform(t);
120
124
  }
121
- function kt(e, t, n, r) {
125
+ function Mt(e, t, n, r) {
122
126
  let i = new e();
123
- if (i instanceof He) return Dt(i, n), i.subscribe(r, t);
127
+ if (i instanceof We) return At(i, n), i.subscribe(r, t);
124
128
  }
125
129
  // src/stageSession.ts
126
- var At = "stage.session.";
127
- function jt(e) {
130
+ var Nt = "stage.session.";
131
+ function Pt(e) {
128
132
  try {
129
133
  return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
130
134
  } catch {
131
135
  return;
132
136
  }
133
137
  }
134
- function Mt(e) {
135
- let t = jt(e);
138
+ function Ft(e) {
139
+ let t = Pt(e);
136
140
  if (t) return t;
137
141
  let n = globalThis.crypto.randomUUID();
138
142
  try {
139
- globalThis.localStorage?.setItem(`${At}${e}`, n);
143
+ globalThis.localStorage?.setItem(`${Nt}${e}`, n);
140
144
  } catch {}
141
145
  return n;
142
146
  }
143
- function Nt() {
147
+ function It() {
144
148
  let e = {};
145
149
  try {
146
150
  let t = globalThis.localStorage;
@@ -154,36 +158,36 @@ function Nt() {
154
158
  return e;
155
159
  }
156
160
  // src/commandExecutor.ts
157
- function V(e, t, n) {
161
+ function H(e, t, n) {
158
162
  for (let r of [
159
163
  t,
160
164
  n?.replace(/^\//, ""),
161
165
  e
162
166
  ]) {
163
167
  if (!r) continue;
164
- let t = Ge(r);
165
- if (Pt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
168
+ let t = qe(r);
169
+ if (Lt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
166
170
  }
167
171
  }
168
- function Pt(e) {
169
- return typeof e == "function" && e.prototype instanceof qe;
172
+ function Lt(e) {
173
+ return typeof e == "function" && e.prototype instanceof Ye;
170
174
  }
171
- function Ft(e, t) {
172
- return e.setApiBasePath(St(t)), e;
175
+ function Rt(e, t) {
176
+ return e.setApiBasePath(Tt(t)), e;
173
177
  }
174
- async function It(e, t, n) {
175
- let r = V(e);
178
+ async function zt(e, t, n) {
179
+ let r = H(e);
176
180
  if (!r) return {
177
181
  isSuccess: !1,
178
182
  validationErrors: [],
179
183
  messages: [`The modeled command “${e}” is not registered by this Stage.`]
180
184
  };
181
185
  let i = new r();
182
- i.setMicroservice(n.microservice), i.setApiBasePath(St(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
186
+ i.setMicroservice(n.microservice), i.setApiBasePath(Tt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
183
187
  for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
184
- return Lt(e, await i.execute());
188
+ return Bt(e, await i.execute());
185
189
  }
186
- function Lt(e, t) {
190
+ function Bt(e, t) {
187
191
  let n = t.isSuccess && t.isAuthorized && t.isValid && !t.hasExceptions, r = t.isValid ? [] : t.validationResults.flatMap((e) => (e.members.length > 0 ? e.members : [""]).map((t) => ({
188
192
  member: t,
189
193
  message: e.message
@@ -199,93 +203,93 @@ function Lt(e, t) {
199
203
  messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
200
204
  };
201
205
  }
202
- function Rt() {
203
- let e = i(Ve);
204
- return r((t, n) => It(t, n, e), [e]);
206
+ function Vt() {
207
+ let e = c(t);
208
+ return s((t, n) => zt(t, n, e), [e]);
205
209
  }
206
210
  // src/stageNavigation.ts
207
- function zt(e, t = {}) {
211
+ function Ht(e, t = {}) {
208
212
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
209
213
  return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
210
214
  }
211
- function H(e, t = {}) {
215
+ function U(e, t = {}) {
212
216
  if (!globalThis.location) return;
213
- if (Bt === "path") {
214
- let n = Ht(e, t);
217
+ if (Ut === "path") {
218
+ let n = Gt(e, t);
215
219
  if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
216
220
  globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
217
221
  return;
218
222
  }
219
- let n = zt(e, t);
223
+ let n = Ht(e, t);
220
224
  globalThis.location.hash !== n && (globalThis.location.hash = n);
221
225
  }
222
- var Bt = "hash";
223
- function Vt(e) {
224
- Bt = e;
226
+ var Ut = "hash";
227
+ function Wt(e) {
228
+ Ut = e;
225
229
  }
226
- function Ht(e, t = {}) {
230
+ function Gt(e, t = {}) {
227
231
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
228
232
  return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
229
233
  }
230
- function Ut(e) {
231
- return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ye)).map(([e, t]) => [e, String(t)]));
234
+ function Kt(e) {
235
+ return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ze)).map(([e, t]) => [e, String(t)]));
232
236
  }
233
237
  // src/screenplayGuard.ts
234
- function Wt(...[e, t, n]) {
238
+ function qt(...[e, t, n]) {
235
239
  let r = n.subject?.() ?? n.resolve({ path: "item" });
236
- return re(e.map((e) => ({
240
+ return ie(e.map((e) => ({
237
241
  ...e,
238
- binding: qt(e.binding, r)
242
+ binding: Xt(e.binding, r)
239
243
  })), t, n);
240
244
  }
241
- function Gt(e, t) {
242
- return Yt(e) ? e.kind === "logical" ? {
245
+ function Jt(e, t) {
246
+ return Qt(e) ? e.kind === "logical" ? {
243
247
  ...e,
244
- left: Gt(e.left, t),
245
- right: Gt(e.right, t)
246
- } : e.kind !== "comparison" || e.operator !== g.Contains || typeof Jt(e.left, t) == "string" && typeof e.right == "string" ? e : {
248
+ left: Jt(e.left, t),
249
+ right: Jt(e.right, t)
250
+ } : e.kind !== "comparison" || e.operator !== b.Contains || typeof Zt(e.left, t) == "string" && typeof e.right == "string" ? e : {
247
251
  ...e,
248
252
  left: { subject: "" }
249
253
  } : e;
250
254
  }
251
- function Kt(e, t) {
252
- return Array.isArray(e) ? e.map((e) => Yt(e) ? {
255
+ function Yt(e, t) {
256
+ return Array.isArray(e) ? e.map((e) => Qt(e) ? {
253
257
  ...e,
254
- condition: Gt(e.condition, t)
258
+ condition: Jt(e.condition, t)
255
259
  } : e) : e;
256
260
  }
257
- function qt(e, t) {
261
+ function Xt(e, t) {
258
262
  return {
259
263
  ...e,
260
- alternatives: Kt(e.alternatives, t)
264
+ alternatives: Yt(e.alternatives, t)
261
265
  };
262
266
  }
263
- function Jt(e, t) {
264
- return Yt(e) && typeof e.subject == "string" ? A({ subject: e.subject }, t) : void 0;
267
+ function Zt(e, t) {
268
+ return Qt(e) && typeof e.subject == "string" ? M({ subject: e.subject }, t) : void 0;
265
269
  }
266
- function Yt(e) {
270
+ function Qt(e) {
267
271
  return typeof e == "object" && !!e && !Array.isArray(e);
268
272
  }
269
273
  // src/stageData.tsx
270
- var Xt = "cratis.stage.data-changed", Zt = t(() => () => void 0), Qt = he["core:guarded-action"];
271
- function $t(e) {
274
+ var $t = "cratis.stage.data-changed", en = a(() => () => void 0), tn = _e["core:guarded-action"];
275
+ function nn(e) {
272
276
  return e.componentName === "core:guarded-action" || e.componentName === "core:action" && Array.isArray(e.properties.alternatives);
273
277
  }
274
- function en(e) {
275
- let { dispatcher: t, attachments: n } = tn(), { item: r, refused: i, error: a } = nn(e.element);
276
- if (i) return /* @__PURE__ */ z("span", {
278
+ function rn(e) {
279
+ let { dispatcher: t, attachments: n } = an(), { item: r, refused: i, error: a } = on(e.element);
280
+ if (i) return /* @__PURE__ */ B("span", {
277
281
  role: "alert",
278
282
  children: ["STAGE-SCENE-ACTION-001: The action's data subject or command scope is unavailable.", a]
279
283
  });
280
284
  let o = {
281
- kind: d.Literal,
285
+ kind: h.Literal,
282
286
  path: "",
283
287
  value: r
284
288
  };
285
- return /* @__PURE__ */ R(ce, {
289
+ return /* @__PURE__ */ z(le, {
286
290
  dispatcher: t,
287
291
  attachments: n,
288
- children: /* @__PURE__ */ R(Qt, {
292
+ children: /* @__PURE__ */ z(tn, {
289
293
  ...e,
290
294
  slots: e.slots ?? {},
291
295
  element: {
@@ -293,16 +297,16 @@ function en(e) {
293
297
  properties: {
294
298
  ...e.element.properties,
295
299
  item: o,
296
- alternatives: qt({ alternatives: e.element.properties.alternatives }, r).alternatives
300
+ alternatives: Xt({ alternatives: e.element.properties.alternatives }, r).alternatives
297
301
  }
298
302
  }
299
303
  })
300
304
  });
301
305
  }
302
- function tn() {
303
- let e = U(), t = xe(), n = Rt();
306
+ function an() {
307
+ let e = W(), t = Ce(), n = Vt();
304
308
  return {
305
- dispatcher: t?.dispatcher ?? ge({
309
+ dispatcher: t?.dispatcher ?? ve({
306
310
  executeCommand: async (t, r) => {
307
311
  let i = await n(t, r);
308
312
  return i.isSuccess && e.refreshAfterCommand(), {
@@ -312,43 +316,43 @@ function tn() {
312
316
  exceptionMessages: i.messages
313
317
  };
314
318
  },
315
- navigate: (e, t) => H(e, Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)])))
319
+ navigate: (e, t) => U(e, Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)])))
316
320
  }),
317
321
  attachments: t?.attachments ?? []
318
322
  };
319
323
  }
320
- function nn(e) {
321
- let t = U(), n = rn(e, t), r = W(n), i = e.properties.itemSelection === !0, a = i ? Object.values(t.selections).filter((e) => e !== void 0) : r.rows;
324
+ function on(e) {
325
+ let t = W(), n = sn(e, t), r = G(n), i = e.properties.itemSelection === !0, a = i ? Object.values(t.selections).filter((e) => e !== void 0) : r.rows;
322
326
  return {
323
327
  item: a.length === 1 ? a[0] : void 0,
324
- refused: !cn(n) && !i || !!r.error,
328
+ refused: !dn(n) && !i || !!r.error,
325
329
  error: r.error
326
330
  };
327
331
  }
328
- function rn(e, t) {
329
- let n = e.properties, r = an(n.itemQuery), i = t.routes?.queries?.[r ?? ""] ?? an(n.itemRoute), a = K(n.itemArguments) ? n.itemArguments : {}, o = Object.fromEntries(Object.entries(a).map(([e, n]) => [e, on(n, t.resolveBinding)]));
332
+ function sn(e, t) {
333
+ let n = e.properties, r = cn(n.itemQuery), i = t.routes?.queries?.[r ?? ""] ?? cn(n.itemRoute), a = q(n.itemArguments) ? n.itemArguments : {}, o = Object.fromEntries(Object.entries(a).map(([e, n]) => [e, ln(n, t.resolveBinding)]));
330
334
  return {
331
335
  scope: `${e.id}:item`,
332
336
  name: r,
333
337
  route: i,
334
338
  arguments: o,
335
- ready: n.itemSelection !== !0 && Object.values(o).every(sn),
339
+ ready: n.itemSelection !== !0 && Object.values(o).every(un),
336
340
  publish: !1
337
341
  };
338
342
  }
339
- function an(e) {
343
+ function cn(e) {
340
344
  return typeof e == "string" ? e : void 0;
341
345
  }
342
- function on(e, t) {
343
- return K(e) && typeof e.path == "string" ? t({ path: e.path }) : e;
346
+ function ln(e, t) {
347
+ return q(e) && typeof e.path == "string" ? t({ path: e.path }) : e;
344
348
  }
345
- function sn(e) {
349
+ function un(e) {
346
350
  return e != null && e !== "";
347
351
  }
348
- function cn(e) {
352
+ function dn(e) {
349
353
  return !!(e.name || e.route);
350
354
  }
351
- var ln = t({
355
+ var fn = a({
352
356
  locale: "",
353
357
  locales: [],
354
358
  screen: "",
@@ -373,17 +377,17 @@ var ln = t({
373
377
  resolveArgument: () => void 0,
374
378
  registerQueryResult: () => void 0,
375
379
  refreshVersion: 0
376
- }), un = [
380
+ }), pn = [
377
381
  500,
378
382
  1500,
379
383
  3e3,
380
384
  6e3,
381
385
  1e4,
382
386
  15e3
383
- ], dn = {};
384
- function fn({ routes: e, routesReady: t = !0, parameters: n = dn, locale: i, locales: o, screen: s, children: l }) {
385
- let [d, f] = u({}), [p, m] = u(0), [h, g] = u({}), [_, v] = u(), [y, b] = u({}), [x, S] = u({}), [C, w] = u({}), [T, E] = u({ version: 0 }), D = c(() => Sn(C), [C]), O = r((e, t) => {
386
- f((n) => {
387
+ ], mn = {};
388
+ function hn({ routes: e, routesReady: t = !0, parameters: n = mn, locale: r, locales: i, screen: a, children: o }) {
389
+ let [c, u] = m({}), [d, p] = m(0), [h, g] = m({}), [_, v] = m(), [y, b] = m({}), [x, S] = m({}), [C, w] = m({}), [T, E] = m({ version: 0 }), D = f(() => Tn(C), [C]), O = s((e, t) => {
390
+ u((n) => {
387
391
  if (!t) {
388
392
  let { [e]: t, ...r } = n;
389
393
  return r;
@@ -393,290 +397,290 @@ function fn({ routes: e, routesReady: t = !0, parameters: n = dn, locale: i, loc
393
397
  [e]: t
394
398
  };
395
399
  });
396
- }, []), k = n, A = c(() => Nt(), [p]), ne = c(() => ({
397
- name: s,
400
+ }, []), k = n, A = f(() => It(), [d]), j = f(() => ({
401
+ name: a,
398
402
  keys: {
399
403
  ...A,
400
404
  ...n
401
405
  }
402
406
  }), [
403
407
  n,
404
- s,
408
+ a,
405
409
  A
406
- ]), re = r((e, t) => {
410
+ ]), ne = s((e, t) => {
407
411
  g((n) => ({
408
412
  ...n,
409
413
  [e]: t
410
414
  })), v(t ? e : (t) => t === e ? void 0 : t);
411
- }, []), ae = r((e) => {
415
+ }, []), re = s((e) => {
412
416
  g((t) => ({
413
417
  ...t,
414
418
  [e]: void 0
415
419
  })), v((t) => t === e ? void 0 : t);
416
- }, []), oe = r((e, t, n) => {
420
+ }, []), M = s((e, t, n) => {
417
421
  S((r) => {
418
- let i = K(r[e]) ? r[e] : {};
422
+ let i = q(r[e]) ? r[e] : {};
419
423
  return {
420
424
  ...r,
421
- [e]: xn(i, t.split(".").filter(Boolean), n)
425
+ [e]: wn(i, t.split(".").filter(Boolean), n)
422
426
  };
423
427
  });
424
- }, []), j = r((e) => E((t) => ({
428
+ }, []), N = s((e) => E((t) => ({
425
429
  query: e,
426
430
  version: t.version + 1
427
- })), []), { settling: se, refreshAfterCommand: ce, registerAwaitingQuery: le } = pn(j, m);
428
- a(() => {
429
- let e = () => j(), t = (e) => j(e.detail?.query);
430
- return globalThis.addEventListener(Xt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
431
- globalThis.removeEventListener(Xt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
431
+ })), []), { settling: ie, refreshAfterCommand: oe, registerAwaitingQuery: se } = gn(N, p);
432
+ l(() => {
433
+ let e = () => N(), t = (e) => N(e.detail?.query);
434
+ return globalThis.addEventListener($t, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
435
+ globalThis.removeEventListener($t, e), globalThis.removeEventListener("cratis.scene.refresh", t);
432
436
  };
433
- }, [j]);
434
- let M = _ ? h[_] : void 0, ue = r((e) => {
437
+ }, [N]);
438
+ let P = _ ? h[_] : void 0, ce = s((e) => {
435
439
  if (e === void 0) return;
436
- if (typeof e == "string") return Cn(e, M, h, d, y, k, ne, i, o);
437
- let t = vn(M, d, y, {
440
+ if (typeof e == "string") return En(e, P, h, c, y, k, j, r, i);
441
+ let t = xn(P, c, y, {
438
442
  ...D,
439
443
  ...x
440
444
  }, h);
441
445
  if (!e.kind && e.path.startsWith("component.")) return te(e.path, t);
442
- if (!e.kind) return Cn(e.path, M, h, d, y, k, ne, i, o);
443
- let n = ie(e, t);
446
+ if (!e.kind) return En(e.path, P, h, c, y, k, j, r, i);
447
+ let n = ae(e, t);
444
448
  return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), ee(t)(e);
445
449
  }, [
446
450
  x,
451
+ r,
447
452
  i,
448
- o,
449
453
  y,
450
454
  k,
451
455
  D,
452
- d,
453
- ne,
454
- M,
456
+ c,
457
+ j,
458
+ P,
455
459
  h
456
- ]), de = r((e) => e ? te(e, vn(M, d, y, {
460
+ ]), le = s((e) => e ? te(e, xn(P, c, y, {
457
461
  ...D,
458
462
  ...x
459
463
  }, h)) : void 0, [
460
464
  x,
461
465
  y,
462
466
  D,
463
- d,
464
- M,
467
+ c,
468
+ P,
465
469
  h
466
- ]), fe = r((e, t) => w((n) => ({
470
+ ]), ue = s((e, t) => w((n) => ({
467
471
  ...n,
468
472
  [e]: t
469
- })), []), pe = r((e) => w((t) => {
473
+ })), []), de = s((e) => w((t) => {
470
474
  if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
471
475
  let n = { ...t };
472
476
  return delete n[e], n;
473
- }), []), me = c(() => vn(void 0, d, {}, {}, {}).queryResults, [d]), he = c(() => ({
474
- locale: i,
475
- locales: o,
476
- screen: s,
477
+ }), []), fe = f(() => xn(void 0, c, {}, {}, {}).queryResults, [c]), pe = f(() => ({
478
+ locale: r,
479
+ locales: i,
480
+ screen: a,
477
481
  routes: e,
478
482
  routesReady: t,
479
483
  parameters: k,
480
484
  session: A,
481
- queries: d,
482
- selected: M,
485
+ queries: c,
486
+ selected: P,
483
487
  selections: h,
484
- selectRow: re,
485
- clearSelection: ae,
486
- setState: (e, t) => b((n) => xn(n, e.split(".").filter(Boolean), t)),
487
- setComponentOutput: oe,
488
- publishComponentOutputs: fe,
489
- withdrawComponentOutputs: pe,
490
- queryResults: me,
491
- refreshQuery: j,
492
- refreshAfterCommand: ce,
493
- settling: se,
494
- resolveBinding: ue,
495
- resolveArgument: de,
488
+ selectRow: ne,
489
+ clearSelection: re,
490
+ setState: (e, t) => b((n) => wn(n, e.split(".").filter(Boolean), t)),
491
+ setComponentOutput: M,
492
+ publishComponentOutputs: ue,
493
+ withdrawComponentOutputs: de,
494
+ queryResults: fe,
495
+ refreshQuery: N,
496
+ refreshAfterCommand: oe,
497
+ settling: ie,
498
+ resolveBinding: ce,
499
+ resolveArgument: le,
496
500
  registerQueryResult: O,
497
501
  refreshVersion: T.version,
498
502
  refreshQueryName: T.query
499
503
  }), [
500
- ae,
504
+ re,
505
+ r,
501
506
  i,
502
- o,
503
- d,
504
- ce,
505
- se,
506
- j,
507
+ c,
508
+ oe,
509
+ ie,
510
+ N,
507
511
  T.query,
508
512
  T.version,
509
513
  O,
510
- fe,
511
- pe,
512
- me,
513
- de,
514
514
  ue,
515
+ de,
516
+ fe,
517
+ le,
518
+ ce,
515
519
  e,
516
520
  t,
517
521
  k,
518
522
  A,
519
- s,
520
- re,
521
- M,
523
+ a,
524
+ ne,
525
+ P,
522
526
  h,
523
- oe
527
+ M
524
528
  ]);
525
- return /* @__PURE__ */ R(ln.Provider, {
526
- value: he,
527
- children: /* @__PURE__ */ R(Zt.Provider, {
528
- value: le,
529
- children: l
529
+ return /* @__PURE__ */ z(fn.Provider, {
530
+ value: pe,
531
+ children: /* @__PURE__ */ z(en.Provider, {
532
+ value: se,
533
+ children: o
530
534
  })
531
535
  });
532
536
  }
533
- function pn(e, t) {
534
- let n = l([]), i = l(0), o = l(0), s = l(/* @__PURE__ */ new Set()), [c, d] = u(!1), f = r(() => (o.current += 1, () => {
535
- --o.current, o.current === 0 && s.current.forEach((e) => e());
536
- }), []), p = r(() => {
537
- t((e) => e + 1), e(), i.current += 1, d(!0), n.current.push(...mn(e, s.current, () => {
538
- --i.current, i.current === 0 && d(!1);
539
- }, () => o.current > 0));
537
+ function gn(e, t) {
538
+ let n = p([]), r = p(0), i = p(0), a = p(/* @__PURE__ */ new Set()), [o, c] = m(!1), u = s(() => (i.current += 1, () => {
539
+ --i.current, i.current === 0 && a.current.forEach((e) => e());
540
+ }), []), d = s(() => {
541
+ t((e) => e + 1), e(), r.current += 1, c(!0), n.current.push(..._n(e, a.current, () => {
542
+ --r.current, r.current === 0 && c(!1);
543
+ }, () => i.current > 0));
540
544
  }, [e, t]);
541
- return a(() => () => n.current.forEach(clearTimeout), []), {
542
- settling: c,
543
- refreshAfterCommand: p,
544
- registerAwaitingQuery: f
545
+ return l(() => () => n.current.forEach(clearTimeout), []), {
546
+ settling: o,
547
+ refreshAfterCommand: d,
548
+ registerAwaitingQuery: u
545
549
  };
546
550
  }
547
- function mn(e, t, n, r) {
551
+ function _n(e, t, n, r) {
548
552
  let i = [], a = () => {
549
553
  i.forEach(clearTimeout), t.delete(a), n();
550
- }, o = un[un.length - 1];
551
- for (let n of un) i.push(setTimeout(() => {
554
+ }, o = pn[pn.length - 1];
555
+ for (let n of pn) i.push(setTimeout(() => {
552
556
  e(), n === 3e3 && (t.add(a), r() || a()), n === o && a();
553
557
  }, n));
554
558
  return i;
555
559
  }
556
- var U = () => i(ln);
557
- function W(e) {
558
- let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o, settling: s } = U(), c = i(Ve), d = e.publish !== !1, f = r((e, t) => {
559
- d && o(e, t);
560
- }, [d, o]), p = e.ready ?? !0, m = cn(e) && p, [h, g] = u([]), [_, v] = u(""), [y, b] = u(m), [x, S] = u(0), C = l(0), w = l(!1), T = JSON.stringify(e.arguments ?? {});
561
- return a(() => {
562
- if (!m) {
563
- C.current += 1, g([]), v(""), b(!1), f(e.scope, void 0);
560
+ var W = () => c(fn);
561
+ function G(e) {
562
+ let { refreshQueryName: n, refreshVersion: r, registerQueryResult: i, settling: a } = W(), o = c(t), u = e.publish !== !1, d = s((e, t) => {
563
+ u && i(e, t);
564
+ }, [u, i]), f = e.ready ?? !0, h = dn(e) && f, [g, _] = m([]), [v, y] = m(""), [b, x] = m(h), [S, C] = m(0), w = p(0), T = p(!1), E = JSON.stringify(e.arguments ?? {});
565
+ return l(() => {
566
+ if (!h) {
567
+ w.current += 1, _([]), y(""), x(!1), d(e.scope, void 0);
564
568
  return;
565
569
  }
566
- let t = C.current + 1;
567
- C.current = t;
568
- let n = new AbortController(), r = JSON.parse(T), i = Tt(e.name ?? "", e.route);
569
- b(!0), v("");
570
+ let t = w.current + 1;
571
+ w.current = t;
572
+ let n = new AbortController(), r = JSON.parse(E), i = Ot(e.name ?? "", e.route);
573
+ x(!0), y("");
570
574
  let a = (e) => {
571
- C.current !== t || n.signal.aborted || (w.current = !1, g([]), v(e instanceof Error ? e.message : String(e)), b(!1));
572
- }, o = [], s = (e) => {
573
- if (C.current !== t || n.signal.aborted) return;
574
- let r = En(e);
575
- r ? a(Error(r)) : e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? bt(o, e.changeSet) : e.data, g(Dn(o)), v(""), b(!1));
575
+ w.current !== t || n.signal.aborted || (T.current = !1, _([]), y(e instanceof Error ? e.message : String(e)), x(!1));
576
+ }, s = [], c = (e) => {
577
+ if (w.current !== t || n.signal.aborted) return;
578
+ let r = kn(e);
579
+ r ? a(Error(r)) : e.isReady !== !1 && (s = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(s) ? Ct(s, e.changeSet) : e.data, _(An(s)), y(""), x(!1));
576
580
  };
577
581
  if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
578
- let l = i.prototype instanceof He, u = () => Promise.resolve().then(() => Ot(i, l ? {
582
+ let l = i.prototype instanceof We, u = () => Promise.resolve().then(() => jt(i, l ? {
579
583
  ...r,
580
584
  waitForFirstResult: !0
581
- } : r, c)).then(s).catch(a);
585
+ } : r, o)).then(c).catch(a);
582
586
  if (!l) return u(), () => n.abort();
583
- w.current = !0;
584
- let d, p = globalThis.setTimeout(() => {
585
- C.current !== t || n.signal.aborted || (w.current = !1, d?.unsubscribe(), d = void 0, u());
587
+ T.current = !0;
588
+ let f, p = globalThis.setTimeout(() => {
589
+ w.current !== t || n.signal.aborted || (T.current = !1, f?.unsubscribe(), f = void 0, u());
586
590
  }, 15e3);
587
591
  try {
588
- d = kt(i, r, c, (e) => {
589
- e.isReady !== !1 && globalThis.clearTimeout(p), s(e);
592
+ f = Mt(i, r, o, (e) => {
593
+ e.isReady !== !1 && globalThis.clearTimeout(p), c(e);
590
594
  });
591
595
  } catch {
592
- globalThis.clearTimeout(p), w.current = !1, u();
596
+ globalThis.clearTimeout(p), T.current = !1, u();
593
597
  }
594
598
  return () => {
595
- n.abort(), globalThis.clearTimeout(p), w.current = !1, d?.unsubscribe();
599
+ n.abort(), globalThis.clearTimeout(p), T.current = !1, f?.unsubscribe();
596
600
  };
597
601
  }, [
598
- m,
599
- c,
600
- T,
601
- x,
602
- f,
602
+ h,
603
+ o,
604
+ E,
605
+ S,
606
+ d,
603
607
  e.name,
604
608
  e.route,
605
609
  e.scope
606
- ]), a(() => {
607
- n !== 0 && (t && t !== e.name && t !== e.scope || w.current || S((e) => e + 1));
610
+ ]), l(() => {
611
+ r !== 0 && (n && n !== e.name && n !== e.scope || T.current || C((e) => e + 1));
608
612
  }, [
609
- t,
610
613
  n,
614
+ r,
611
615
  e.name,
612
616
  e.scope
613
- ]), a(() => {
614
- m ? f(e.scope, {
617
+ ]), l(() => {
618
+ h ? d(e.scope, {
615
619
  name: e.name,
616
620
  list: e.list,
617
621
  alias: e.alias,
618
622
  route: e.route ?? "",
619
- rows: h,
620
- loading: y,
621
- error: _,
622
- arguments: JSON.parse(T)
623
- }) : f(e.scope, void 0);
623
+ rows: g,
624
+ loading: b,
625
+ error: v,
626
+ arguments: JSON.parse(E)
627
+ }) : d(e.scope, void 0);
624
628
  }, [
625
- m,
626
- T,
627
- _,
628
- y,
629
- f,
629
+ h,
630
+ E,
631
+ v,
632
+ b,
633
+ d,
630
634
  e.alias,
631
635
  e.list,
632
636
  e.name,
633
637
  e.route,
634
638
  e.scope,
635
- h
639
+ g
636
640
  ]), {
637
- rows: h,
638
- loading: y,
639
- awaitingCommand: hn(m, h, _, s),
640
- error: _,
641
+ rows: g,
642
+ loading: b,
643
+ awaitingCommand: vn(h, g, v, a),
644
+ error: v,
641
645
  refresh: () => {
642
- w.current || S((e) => e + 1);
646
+ T.current || C((e) => e + 1);
643
647
  }
644
648
  };
645
649
  }
646
- function hn(e, t, n, r) {
647
- let o = l(!1);
648
- t.length > 0 && (o.current = !0);
649
- let s = i(Zt), c = gn(e, t, n, r) && !o.current;
650
- return a(() => {
651
- if (c) return s();
652
- }, [c, s]), c;
650
+ function vn(e, t, n, r) {
651
+ let i = p(!1);
652
+ t.length > 0 && (i.current = !0);
653
+ let a = c(en), o = yn(e, t, n, r) && !i.current;
654
+ return l(() => {
655
+ if (o) return a();
656
+ }, [o, a]), o;
653
657
  }
654
- function gn(e, t, n, r) {
658
+ function yn(e, t, n, r) {
655
659
  return !(!e || !r || n || t.length !== 0);
656
660
  }
657
- function _n() {
658
- globalThis.dispatchEvent(new CustomEvent(Xt));
661
+ function bn() {
662
+ globalThis.dispatchEvent(new CustomEvent($t));
659
663
  }
660
- function vn(e, t, n, r, i) {
664
+ function xn(e, t, n, r, i) {
661
665
  let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
662
666
  return {
663
667
  dataContext: e,
664
668
  queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
665
- let n = t.list ? t.rows : yn(t.rows);
669
+ let n = t.list ? t.rows : Sn(t.rows);
666
670
  return [
667
671
  [e, n],
668
672
  ...t.name ? [[t.name, n]] : [],
669
673
  ...t.alias ? [[t.alias, n]] : []
670
674
  ];
671
675
  })),
672
- componentOutputs: bn(r, i),
676
+ componentOutputs: Cn(r, i),
673
677
  state: n
674
678
  };
675
679
  }
676
- function yn(e) {
680
+ function Sn(e) {
677
681
  return e.length === 1 ? e[0] : e;
678
682
  }
679
- function bn(e, t) {
683
+ function Cn(e, t) {
680
684
  let n = { ...e };
681
685
  for (let [e, r] of Object.entries(t)) r && (n[e] = {
682
686
  ...r,
@@ -684,17 +688,17 @@ function bn(e, t) {
684
688
  });
685
689
  return n;
686
690
  }
687
- function xn(e, t, n) {
691
+ function wn(e, t, n) {
688
692
  let [r, ...i] = t;
689
693
  return r ? i.length === 0 ? {
690
694
  ...e,
691
695
  [r]: n
692
696
  } : {
693
697
  ...e,
694
- [r]: xn(K(e[r]) ? e[r] : {}, i, n)
698
+ [r]: wn(q(e[r]) ? e[r] : {}, i, n)
695
699
  } : e;
696
700
  }
697
- function Sn(e) {
701
+ function Tn(e) {
698
702
  let t = {};
699
703
  for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
700
704
  ...t[e],
@@ -702,30 +706,30 @@ function Sn(e) {
702
706
  };
703
707
  return t;
704
708
  }
705
- function Cn(e, t, n, r, i, a, o, s, c) {
709
+ function En(e, t, n, r, i, a, o, s, c) {
706
710
  if (!e) return;
707
711
  let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
708
712
  if (l.length !== 0) {
709
713
  if (l[0] === "screen") {
710
714
  if (l.length === 1) return { name: o.name };
711
- let e = G(o, l.slice(1));
712
- return e === void 0 && l[1] === "keys" && l.length === 3 ? G(t, [l[2]]) : e;
715
+ let e = K(o, l.slice(1));
716
+ return e === void 0 && l[1] === "keys" && l.length === 3 ? K(t, [l[2]]) : e;
713
717
  }
714
- return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Tn(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? wn(l.slice(1).join("."), t, n) : l[0] === "state" ? G(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : G(t, l) ?? Tn(r, void 0, l.join(".")) ?? G(i, l);
718
+ return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? On(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Dn(l.slice(1).join("."), t, n) : l[0] === "state" ? K(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : K(t, l) ?? On(r, void 0, l.join(".")) ?? K(i, l);
715
719
  }
716
720
  }
717
- function wn(e, t, n) {
721
+ function Dn(e, t, n) {
718
722
  let r = e?.split(".").filter(Boolean) ?? [];
719
- return r.length > 0 && Object.hasOwn(n, r[0]) ? G(n[r[0]], r.slice(1)) : r.length === 0 ? t : G(t, r);
723
+ return r.length > 0 && Object.hasOwn(n, r[0]) ? K(n[r[0]], r.slice(1)) : r.length === 0 ? t : K(t, r);
720
724
  }
721
- function Tn(e, t, n) {
725
+ function On(e, t, n) {
722
726
  let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
723
727
  if (r.length === 0) return;
724
728
  let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
725
- return a.length === 0 ? i : i.length === 1 ? G(i[0], a) : i.map((e) => G(e, a));
729
+ return a.length === 0 ? i : i.length === 1 ? K(i[0], a) : i.map((e) => K(e, a));
726
730
  }
727
- function En(e) {
728
- if (!K(e)) return "";
731
+ function kn(e) {
732
+ if (!q(e)) return "";
729
733
  if (e.isAuthorized === !1) return "The query answered 403.";
730
734
  if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
731
735
  let t = Array.isArray(e.exceptionMessages) ? e.exceptionMessages.filter((e) => typeof e == "string") : [];
@@ -733,60 +737,60 @@ function En(e) {
733
737
  }
734
738
  return "";
735
739
  }
736
- function Dn(e) {
737
- return Array.isArray(e) ? e.filter(K) : K(e) ? [e] : [];
740
+ function An(e) {
741
+ return Array.isArray(e) ? e.filter(q) : q(e) ? [e] : [];
738
742
  }
739
- function G(e, t) {
743
+ function K(e, t) {
740
744
  let n = e;
741
745
  for (let e of t) {
742
- if (!K(n)) return;
746
+ if (!q(n)) return;
743
747
  n = n[e];
744
748
  }
745
749
  return n;
746
750
  }
747
- function K(e) {
751
+ function q(e) {
748
752
  return typeof e == "object" && !!e && !Array.isArray(e);
749
753
  }
750
754
  // src/stageComponentOutputs.ts
751
- function On() {
752
- let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n, selectRow: i, clearSelection: s } = U(), c = l({});
753
- a(() => () => {
754
- n(e), Object.keys(c.current).forEach((t) => s(`${e}:${t}`));
755
+ function jn() {
756
+ let e = u(), { publishComponentOutputs: t, withdrawComponentOutputs: n, selectRow: r, clearSelection: i } = W(), a = p({});
757
+ l(() => () => {
758
+ n(e), Object.keys(a.current).forEach((t) => i(`${e}:${t}`));
755
759
  }, [
756
- s,
760
+ i,
757
761
  e,
758
762
  n
759
763
  ]);
760
- let u = r((n) => {
764
+ let o = s((n) => {
761
765
  t(e, n);
762
- let r = kn(n), a = /* @__PURE__ */ new Set([...Object.keys(c.current), ...Object.keys(r)]);
763
- for (let t of a) c.current[t] !== r[t] && i(`${e}:${t}`, r[t]);
764
- c.current = r;
766
+ let i = Mn(n), o = /* @__PURE__ */ new Set([...Object.keys(a.current), ...Object.keys(i)]);
767
+ for (let t of o) a.current[t] !== i[t] && r(`${e}:${t}`, i[t]);
768
+ a.current = i;
765
769
  }, [
766
770
  t,
767
771
  e,
768
- i
772
+ r
769
773
  ]);
770
- return Object.assign(u, { scope: e });
774
+ return Object.assign(o, { scope: e });
771
775
  }
772
- function kn(e) {
776
+ function Mn(e) {
773
777
  let t = {};
774
778
  for (let [n, r] of Object.entries(e)) {
775
779
  let e = r.selectedItem;
776
- An(e) && (t[n] = e);
780
+ Nn(e) && (t[n] = e);
777
781
  }
778
782
  return t;
779
783
  }
780
- function An(e) {
784
+ function Nn(e) {
781
785
  return typeof e == "object" && !!e && !Array.isArray(e);
782
786
  }
783
787
  // src/stageBoardSelection.ts
784
- var jn = /* @__PURE__ */ new Set(["kanbanBoard", "Cratis.Blueprint.Default:kanbanBoard"]);
785
- function Mn(e) {
786
- return jn.has(e);
788
+ var Pn = /* @__PURE__ */ new Set(["kanbanBoard", "Cratis.Blueprint.Default:kanbanBoard"]);
789
+ function Fn(e) {
790
+ return Pn.has(e);
787
791
  }
788
- function Nn(e) {
789
- let t = e, n = Object.fromEntries(Object.entries(t.slots ?? {}).map(([e, t]) => [e, t.map(Nn)])), r = Mn(t.componentName) ? {
792
+ function In(e) {
793
+ let t = e, n = Object.fromEntries(Object.entries(t.slots ?? {}).map(([e, t]) => [e, t.map(In)])), r = Fn(t.componentName) ? {
790
794
  ...t.properties,
791
795
  selectionMode: "single"
792
796
  } : t.properties;
@@ -796,24 +800,144 @@ function Nn(e) {
796
800
  slots: n
797
801
  };
798
802
  }
803
+ // src/modelReferences.ts
804
+ async function Ln(e, t = fetch) {
805
+ let n = await t(ht.modelReferences, { signal: e });
806
+ return n.ok ? await n.json() : void 0;
807
+ }
808
+ function Rn(e, t, n) {
809
+ return e?.references.find((e) => e.kind === t && e.name === n)?.id;
810
+ }
811
+ function zn(e) {
812
+ let t = {};
813
+ for (let n of e?.references ?? []) n.name in t || (t[n.name] = n.id);
814
+ return t;
815
+ }
816
+ // src/stageNotes.ts
817
+ var Bn = {
818
+ enabled: !1,
819
+ modelReferences: {}
820
+ };
821
+ async function Vn(e, t = fetch) {
822
+ let n = await Ln(e, t).catch(() => void 0);
823
+ return n ? {
824
+ enabled: n.notesEnabled === !0,
825
+ modelReferences: zn(n)
826
+ } : Bn;
827
+ }
828
+ function Hn() {
829
+ let e = vt(), [t, n] = m(Bn);
830
+ return l(() => {
831
+ if (!e.notes) return;
832
+ let t = new AbortController();
833
+ return e.notes(t.signal).then(n).catch(() => void 0), () => t.abort();
834
+ }, [e]), t;
835
+ }
836
+ function* Un(e, t, n) {
837
+ for (let r of t) {
838
+ let t = [...n, r.name];
839
+ for (let n of r.slices) yield {
840
+ module: e,
841
+ feature: t.join("."),
842
+ slice: n.name,
843
+ command: n.command,
844
+ qualified: [
845
+ e,
846
+ ...t,
847
+ n.name
848
+ ].join(".")
849
+ };
850
+ yield* Un(e, r.features, t);
851
+ }
852
+ }
853
+ function Wn(e) {
854
+ return (e?.modules ?? []).flatMap((e) => [...(e.slices ?? []).map((t) => ({
855
+ module: e.name,
856
+ feature: "",
857
+ slice: t.name,
858
+ command: t.command,
859
+ qualified: `${e.name}.${t.name}`
860
+ })), ...Un(e.name, e.features, [])]);
861
+ }
862
+ function Gn(e) {
863
+ return Wn(e).map(({ module: e, feature: t, slice: n }) => ({
864
+ module: e,
865
+ feature: t,
866
+ slice: n
867
+ }));
868
+ }
869
+ function Kn(e, t) {
870
+ if (!t) return;
871
+ let n = Wn(e).find((e) => e.qualified === t) ?? Wn(e).find((e) => e.command === t);
872
+ return n ? {
873
+ module: n.module,
874
+ feature: n.feature,
875
+ slice: n.slice
876
+ } : void 0;
877
+ }
878
+ function qn(e, t) {
879
+ if (!t) return;
880
+ let [n = "", ...r] = t.path ?? [], i = r.join(".");
881
+ return {
882
+ module: n,
883
+ feature: i,
884
+ slice: Wn(e).find((e) => e.module === n && e.feature === i && e.slice === t.name)?.slice ?? t.name
885
+ };
886
+ }
887
+ function Jn(e) {
888
+ return e ? {
889
+ id: e.name,
890
+ name: e.name,
891
+ path: (e.path ?? []).join("/")
892
+ } : void 0;
893
+ }
894
+ // src/stageStructure.tsx
895
+ var Yn = a({ screens: [] });
896
+ function Xn({ structure: e, screens: t, children: n }) {
897
+ return /* @__PURE__ */ z(Yn.Provider, {
898
+ value: {
899
+ structure: e,
900
+ screens: t
901
+ },
902
+ children: n
903
+ });
904
+ }
905
+ function Zn({ screen: e, children: t }) {
906
+ let { structure: n, screens: r } = c(Yn), i = qn(n, r.find((t) => t.name === e));
907
+ return i ? /* @__PURE__ */ z(tt, {
908
+ module: i.module,
909
+ feature: i.feature,
910
+ slice: i.slice,
911
+ children: t
912
+ }) : /* @__PURE__ */ z(Qe, { children: t });
913
+ }
914
+ function Qn({ slice: e, children: t }) {
915
+ let { structure: n } = c(Yn), r = Kn(n, e);
916
+ return r ? /* @__PURE__ */ z(tt, {
917
+ module: r.module,
918
+ feature: r.feature,
919
+ slice: r.slice,
920
+ children: t
921
+ }) : /* @__PURE__ */ z(Qe, { children: t });
922
+ }
799
923
  // src/humanize.ts
800
- var Pn = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+\d*|\d+/g, Fn = /* @__PURE__ */ new Set([
924
+ var $n = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+\d*|\d+/g, er = /* @__PURE__ */ new Set([
801
925
  "Screen",
802
926
  "Page",
803
927
  "Dialog"
804
928
  ]);
805
- function In(e) {
929
+ function tr(e) {
806
930
  return e.map((e, t) => e.length > 1 && e === e.toUpperCase() && /[A-Z]/.test(e) ? e : t === 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e.toLowerCase()).join(" ");
807
931
  }
808
- function q(e) {
809
- let t = e.match(Pn);
810
- return t ? In(t) : e;
932
+ function J(e) {
933
+ let t = e.match($n);
934
+ return t ? tr(t) : e;
811
935
  }
812
- function Ln(e) {
813
- let t = e.match(Pn);
814
- return t ? In(t.length > 1 && Fn.has(t[t.length - 1]) ? t.slice(0, -1) : t) : e;
936
+ function nr(e) {
937
+ let t = e.match($n);
938
+ return t ? tr(t.length > 1 && er.has(t[t.length - 1]) ? t.slice(0, -1) : t) : e;
815
939
  }
816
- function Rn(e, t) {
940
+ function rr(e, t) {
817
941
  switch (e.toLowerCase()) {
818
942
  case "primary": return "solid";
819
943
  case "secondary": return "outline";
@@ -822,41 +946,41 @@ function Rn(e, t) {
822
946
  }
823
947
  }
824
948
  // src/stageFormSchema.ts
825
- var zn = 8;
826
- function Bn(e) {
949
+ var ir = 8;
950
+ function ar(e) {
827
951
  if (!e) return !1;
828
952
  try {
829
953
  let t = JSON.parse(e);
830
- return Y(t) && t["x-creates"] === !0;
954
+ return hr(t) && t["x-creates"] === !0;
831
955
  } catch {
832
956
  return !1;
833
957
  }
834
958
  }
835
- function J(e) {
959
+ function Y(e) {
836
960
  if (!e) return [];
837
961
  try {
838
- return Vn(JSON.parse(e), 0);
962
+ return or(JSON.parse(e), 0);
839
963
  } catch {
840
964
  return [];
841
965
  }
842
966
  }
843
- function Vn(e, t) {
844
- let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = Y(e.properties) ? e.properties : {};
845
- return Object.entries(i).map(([e, i]) => Hn(e, i, !n || r.has(e), t));
967
+ function or(e, t) {
968
+ let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = hr(e.properties) ? e.properties : {};
969
+ return Object.entries(i).map(([e, i]) => sr(e, i, !n || r.has(e), t));
846
970
  }
847
- function Hn(e, t, n, r) {
848
- let i = Un(t?.["x-reference"]);
971
+ function sr(e, t, n, r) {
972
+ let i = cr(t?.["x-reference"]);
849
973
  return {
850
974
  name: e,
851
975
  identifier: (t?.format === "uuid" || i) && typeof t?.["x-concept"] == "string" ? t["x-concept"] : void 0,
852
976
  ...i ? { reference: i } : {},
853
977
  ...t?.["x-identity"] === !0 ? { identity: !0 } : {},
854
978
  required: n,
855
- ...Wn(t, r)
979
+ ...lr(t, r)
856
980
  };
857
981
  }
858
- function Un(e) {
859
- if (!Y(e)) return;
982
+ function cr(e) {
983
+ if (!hr(e)) return;
860
984
  let { query: t, value: n, label: r } = e;
861
985
  return typeof t == "string" && t.length > 0 && typeof n == "string" && n.length > 0 && typeof r == "string" && r.length > 0 ? {
862
986
  query: t,
@@ -864,11 +988,11 @@ function Un(e) {
864
988
  label: r
865
989
  } : void 0;
866
990
  }
867
- function Wn(e, t) {
991
+ function lr(e, t) {
868
992
  let n = e?.type;
869
993
  if (Array.isArray(n)) {
870
994
  let r = n.filter((e) => e !== "null");
871
- return r.length === 1 ? Wn({
995
+ return r.length === 1 ? lr({
872
996
  ...e,
873
997
  type: r[0]
874
998
  }, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
@@ -879,8 +1003,8 @@ function Wn(e, t) {
879
1003
  type: "date",
880
1004
  withTime: e.format === "date-time"
881
1005
  };
882
- if (n === "array") return Gn(e, t);
883
- if (n === "object") return Kn(e, t);
1006
+ if (n === "array") return ur(e, t);
1007
+ if (n === "object") return dr(e, t);
884
1008
  if (n === void 0 || n === "string") {
885
1009
  let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
886
1010
  return t.length > 0 ? {
@@ -890,78 +1014,78 @@ function Wn(e, t) {
890
1014
  }
891
1015
  return { unsupportedReason: `type ${String(n)}` };
892
1016
  }
893
- function Gn(e, t) {
1017
+ function ur(e, t) {
894
1018
  let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
895
- if (t >= zn || e?.items === void 0) return n;
896
- let r = Hn("", e.items, !0, t + 1);
1019
+ if (t >= ir || e?.items === void 0) return n;
1020
+ let r = sr("", e.items, !0, t + 1);
897
1021
  return r.unsupportedReason || r.item ? n : { item: r };
898
1022
  }
899
- function Kn(e, t) {
1023
+ function dr(e, t) {
900
1024
  let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
901
- if (t >= zn || !Y(e?.properties) || Object.keys(e.properties).length === 0) return n;
902
- let r = Vn(e, t + 1), i = r.find((e) => e.unsupportedReason);
1025
+ if (t >= ir || !hr(e?.properties) || Object.keys(e.properties).length === 0) return n;
1026
+ let r = or(e, t + 1), i = r.find((e) => e.unsupportedReason);
903
1027
  return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
904
1028
  }
905
- function qn(e, t, n) {
1029
+ function fr(e, t, n) {
906
1030
  if (t != null) {
907
- if (e.members && Y(t)) for (let r of e.members) {
908
- let e = t[r.name], i = q(r.name);
909
- if (Jn(e)) {
1031
+ if (e.members && hr(t)) for (let r of e.members) {
1032
+ let e = t[r.name], i = J(r.name);
1033
+ if (pr(e)) {
910
1034
  if (r.required) return `${n}: ${i} is required`;
911
1035
  continue;
912
1036
  }
913
- let a = qn(r, e, `${n} ${i.toLowerCase()}`);
1037
+ let a = fr(r, e, `${n} ${i.toLowerCase()}`);
914
1038
  if (a) return a;
915
1039
  }
916
1040
  if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
917
- let t = Jn(i) ? `${n} ${r + 1} is required` : qn(e.item, i, `${n} ${r + 1}`);
1041
+ let t = pr(i) ? `${n} ${r + 1} is required` : fr(e.item, i, `${n} ${r + 1}`);
918
1042
  if (t) return t;
919
1043
  }
920
1044
  }
921
1045
  }
922
- function Jn(e) {
1046
+ function pr(e) {
923
1047
  return e == null || e === "";
924
1048
  }
925
- function Yn(e, t) {
926
- return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && Y(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
1049
+ function mr(e, t) {
1050
+ return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && hr(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
927
1051
  let r = e.members?.find((e) => e.name === t);
928
- return [t, r ? Yn(r, n) : n];
929
- })) : e.item && Array.isArray(t) ? t.map((t) => Yn(e.item, t)) : t;
1052
+ return [t, r ? mr(r, n) : n];
1053
+ })) : e.item && Array.isArray(t) ? t.map((t) => mr(e.item, t)) : t;
930
1054
  }
931
- function Y(e) {
1055
+ function hr(e) {
932
1056
  return typeof e == "object" && !!e && !Array.isArray(e);
933
1057
  }
934
1058
  // src/stageActionSubject.ts
935
- var Xn = /^item\.(.+)$/, Zn = [
1059
+ var gr = /^item\.(.+)$/, _r = [
936
1060
  void 0,
937
1061
  null,
938
1062
  ""
939
1063
  ];
940
- function Qn(e) {
1064
+ function vr(e) {
941
1065
  let t = e.properties.actionSubject;
942
1066
  return t === "item" || t === "screen" ? t : void 0;
943
1067
  }
944
- function $n(e, t) {
945
- return Qn(e) === void 0 && (t ? Bn(t) : e.properties.createsEntity === !0);
1068
+ function yr(e, t) {
1069
+ return vr(e) === void 0 && (t ? ar(t) : e.properties.createsEntity === !0);
946
1070
  }
947
- function er(e, t) {
1071
+ function br(e, t) {
948
1072
  return e === "item" && t.length === 1 ? t[0] : void 0;
949
1073
  }
950
- function tr(e, t) {
1074
+ function xr(e, t) {
951
1075
  return e === "item" && !t;
952
1076
  }
953
- function nr(e, t) {
954
- let n = Qn(e), r = e.properties.subjectValues;
1077
+ function Sr(e, t) {
1078
+ let n = vr(e), r = e.properties.subjectValues;
955
1079
  return {
956
1080
  ...n === "screen" ? {
957
1081
  selectableRows: [],
958
1082
  selectedRows: []
959
1083
  } : t,
960
1084
  rowAction: e.properties.rowAction === !0 || n === "item",
961
- subjectValues: dr(r) ? r : {}
1085
+ subjectValues: jr(r) ? r : {}
962
1086
  };
963
1087
  }
964
- function rr(e, t) {
1088
+ function Cr(e, t) {
965
1089
  return {
966
1090
  ...t === "screen" ? {} : { rowAction: !0 },
967
1091
  ...t === void 0 ? {} : {
@@ -970,12 +1094,12 @@ function rr(e, t) {
970
1094
  }
971
1095
  };
972
1096
  }
973
- function ir(e, t) {
974
- let n = Object.entries(cr(e)).map(([e, n]) => [e, ur(t, n)]);
975
- return Object.fromEntries(n.filter(([, e]) => !Zn.includes(e)));
1097
+ function wr(e, t) {
1098
+ let n = Object.entries(Or(e)).map(([e, n]) => [e, Ar(t, n)]);
1099
+ return Object.fromEntries(n.filter(([, e]) => !_r.includes(e)));
976
1100
  }
977
- function ar(e, t, n) {
978
- let r = new Set(Object.keys(cr(e))), i = t.filter((e) => e.identifier !== void 0 && e.required && Object.hasOwn(n, e.name)).map((e) => e.name), a = /* @__PURE__ */ new Set([...r, ...i]), o = or(e, t).filter((e) => !a.has(sr(e))), s = t.length > 0 || Array.isArray(e.properties.fields) ? {
1101
+ function Tr(e, t, n) {
1102
+ let r = new Set(Object.keys(Or(e))), i = t.filter((e) => e.identifier !== void 0 && e.required && Object.hasOwn(n, e.name)).map((e) => e.name), a = /* @__PURE__ */ new Set([...r, ...i]), o = Er(e, t).filter((e) => !a.has(Dr(e))), s = t.length > 0 || Array.isArray(e.properties.fields) ? {
979
1103
  fields: o,
980
1104
  generationMode: "manual"
981
1105
  } : {}, c = Object.fromEntries(i.map((e) => [e, n[e]]));
@@ -986,62 +1110,62 @@ function ar(e, t, n) {
986
1110
  rowAction: !0,
987
1111
  subjectValues: {
988
1112
  ...c,
989
- ...ir(e, n)
1113
+ ...wr(e, n)
990
1114
  },
991
1115
  ...s
992
1116
  }
993
1117
  };
994
1118
  }
995
- function or(e, t) {
1119
+ function Er(e, t) {
996
1120
  let n = e.properties.fields;
997
1121
  return Array.isArray(n) ? n : t.map((e) => ({
998
1122
  name: e.name,
999
- label: q(e.name)
1123
+ label: J(e.name)
1000
1124
  }));
1001
1125
  }
1002
- function sr(e) {
1126
+ function Dr(e) {
1003
1127
  let t = e.sourceProperty || e.name;
1004
1128
  return typeof t == "string" ? t : "";
1005
1129
  }
1006
- function cr(e) {
1007
- let t = e.properties.subjectInputs, n = (dr(t) ? Object.entries(t) : []).map(([e, t]) => [e, lr(t)]);
1130
+ function Or(e) {
1131
+ let t = e.properties.subjectInputs, n = (jr(t) ? Object.entries(t) : []).map(([e, t]) => [e, kr(t)]);
1008
1132
  return Object.fromEntries(n.filter((e) => e[1] !== void 0));
1009
1133
  }
1010
- function lr(e) {
1011
- let t = dr(e) ? e.subject : void 0;
1012
- return typeof t == "string" ? Xn.exec(t)?.[1] : void 0;
1134
+ function kr(e) {
1135
+ let t = jr(e) ? e.subject : void 0;
1136
+ return typeof t == "string" ? gr.exec(t)?.[1] : void 0;
1013
1137
  }
1014
- function ur(e, t) {
1015
- return t.split(".").reduce((e, t) => dr(e) ? e[t] : void 0, e);
1138
+ function Ar(e, t) {
1139
+ return t.split(".").reduce((e, t) => jr(e) ? e[t] : void 0, e);
1016
1140
  }
1017
- function dr(e) {
1141
+ function jr(e) {
1018
1142
  return typeof e == "object" && !!e && !Array.isArray(e);
1019
1143
  }
1020
1144
  // src/StageValueFields.tsx
1021
- var fr = tt((e) => /* @__PURE__ */ R(pr, {
1145
+ var Mr = it((e) => /* @__PURE__ */ z(Nr, {
1022
1146
  descriptor: e.descriptor,
1023
- label: e.title ?? q(e.descriptor.name),
1147
+ label: e.title ?? J(e.descriptor.name),
1024
1148
  value: e.value,
1025
1149
  onChange: e.onChange,
1026
1150
  onBlur: e.onBlur,
1027
1151
  invalid: e.invalid
1028
1152
  }), { defaultValue: void 0 });
1029
- function pr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1030
- return e.members ? /* @__PURE__ */ R(mr, {
1153
+ function Nr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1154
+ return e.members ? /* @__PURE__ */ z(Pr, {
1031
1155
  descriptor: e,
1032
1156
  label: t,
1033
1157
  value: n,
1034
1158
  onChange: r,
1035
1159
  onBlur: i,
1036
1160
  invalid: a
1037
- }) : e.item ? /* @__PURE__ */ R(hr, {
1161
+ }) : e.item ? /* @__PURE__ */ z(Fr, {
1038
1162
  descriptor: e,
1039
1163
  label: t,
1040
1164
  value: n,
1041
1165
  onChange: r,
1042
1166
  onBlur: i,
1043
1167
  invalid: a
1044
- }) : /* @__PURE__ */ R(gr, {
1168
+ }) : /* @__PURE__ */ z(Ir, {
1045
1169
  descriptor: e,
1046
1170
  label: t,
1047
1171
  value: n,
@@ -1050,14 +1174,14 @@ function pr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1050
1174
  invalid: a
1051
1175
  });
1052
1176
  }
1053
- function mr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1054
- let o = yr(n) ? n : {};
1055
- return /* @__PURE__ */ z("fieldset", {
1177
+ function Pr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1178
+ let o = zr(n) ? n : {};
1179
+ return /* @__PURE__ */ B("fieldset", {
1056
1180
  className: "stage-record-field",
1057
1181
  "data-invalid": a ? "true" : void 0,
1058
- children: [/* @__PURE__ */ R("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ R(pr, {
1182
+ children: [/* @__PURE__ */ z("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ z(Nr, {
1059
1183
  descriptor: e,
1060
- label: q(e.name),
1184
+ label: J(e.name),
1061
1185
  value: o[e.name],
1062
1186
  onBlur: i,
1063
1187
  onChange: (t) => r({
@@ -1067,74 +1191,74 @@ function mr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1067
1191
  }, e.name))]
1068
1192
  });
1069
1193
  }
1070
- function hr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1194
+ function Fr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1071
1195
  let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
1072
- return /* @__PURE__ */ z("fieldset", {
1196
+ return /* @__PURE__ */ B("fieldset", {
1073
1197
  className: "stage-list-field",
1074
1198
  "data-invalid": a ? "true" : void 0,
1075
1199
  children: [
1076
- /* @__PURE__ */ R("legend", { children: t }),
1077
- s.length === 0 && /* @__PURE__ */ R("p", {
1200
+ /* @__PURE__ */ z("legend", { children: t }),
1201
+ s.length === 0 && /* @__PURE__ */ z("p", {
1078
1202
  className: "stage-note",
1079
1203
  children: "Nothing added yet."
1080
1204
  }),
1081
- s.map((e, n) => /* @__PURE__ */ z("div", {
1205
+ s.map((e, n) => /* @__PURE__ */ B("div", {
1082
1206
  className: "stage-list-field__row",
1083
- children: [/* @__PURE__ */ R(pr, {
1207
+ children: [/* @__PURE__ */ z(Nr, {
1084
1208
  descriptor: o,
1085
1209
  label: `${t} ${n + 1}`,
1086
1210
  value: e,
1087
1211
  onBlur: i,
1088
1212
  onChange: (e) => c(s.map((t, r) => r === n ? e : t))
1089
- }), /* @__PURE__ */ R("button", {
1213
+ }), /* @__PURE__ */ z("button", {
1090
1214
  type: "button",
1091
1215
  "aria-label": `Remove ${t} ${n + 1}`,
1092
1216
  onClick: () => c(s.filter((e, t) => t !== n)),
1093
1217
  children: "Remove"
1094
1218
  })]
1095
1219
  }, n)),
1096
- /* @__PURE__ */ R("button", {
1220
+ /* @__PURE__ */ z("button", {
1097
1221
  type: "button",
1098
1222
  "aria-label": `Add ${t}`,
1099
- onClick: () => c([...s, _r(o)]),
1223
+ onClick: () => c([...s, Lr(o)]),
1100
1224
  children: "Add"
1101
1225
  })
1102
1226
  ]
1103
1227
  });
1104
1228
  }
1105
- function gr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1229
+ function Ir({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1106
1230
  let o = {
1107
1231
  "aria-invalid": a ? !0 : void 0,
1108
1232
  onBlur: i
1109
1233
  };
1110
- if (e.options) return /* @__PURE__ */ z("label", {
1234
+ if (e.options) return /* @__PURE__ */ B("label", {
1111
1235
  className: "stage-value-field",
1112
- children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ z("select", {
1236
+ children: [/* @__PURE__ */ z("span", { children: t }), /* @__PURE__ */ B("select", {
1113
1237
  ...o,
1114
1238
  value: typeof n == "string" ? n : "",
1115
1239
  onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
1116
- children: [/* @__PURE__ */ R("option", {
1240
+ children: [/* @__PURE__ */ z("option", {
1117
1241
  value: "",
1118
1242
  children: ""
1119
- }), e.options.map((e) => /* @__PURE__ */ R("option", {
1243
+ }), e.options.map((e) => /* @__PURE__ */ z("option", {
1120
1244
  value: e,
1121
- children: q(e)
1245
+ children: J(e)
1122
1246
  }, e))]
1123
1247
  })]
1124
1248
  });
1125
1249
  switch (e.type) {
1126
- case "boolean": return /* @__PURE__ */ z("label", {
1250
+ case "boolean": return /* @__PURE__ */ B("label", {
1127
1251
  className: "stage-value-field stage-value-field--check",
1128
- children: [/* @__PURE__ */ R("input", {
1252
+ children: [/* @__PURE__ */ z("input", {
1129
1253
  ...o,
1130
1254
  type: "checkbox",
1131
1255
  checked: n === !0,
1132
1256
  onChange: (e) => r(e.target.checked)
1133
- }), /* @__PURE__ */ R("span", { children: t })]
1257
+ }), /* @__PURE__ */ z("span", { children: t })]
1134
1258
  });
1135
- case "number": return /* @__PURE__ */ z("label", {
1259
+ case "number": return /* @__PURE__ */ B("label", {
1136
1260
  className: "stage-value-field",
1137
- children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
1261
+ children: [/* @__PURE__ */ z("span", { children: t }), /* @__PURE__ */ z("input", {
1138
1262
  ...o,
1139
1263
  type: "number",
1140
1264
  step: "any",
@@ -1142,18 +1266,18 @@ function gr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1142
1266
  onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
1143
1267
  })]
1144
1268
  });
1145
- case "date": return /* @__PURE__ */ z("label", {
1269
+ case "date": return /* @__PURE__ */ B("label", {
1146
1270
  className: "stage-value-field",
1147
- children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
1271
+ children: [/* @__PURE__ */ z("span", { children: t }), /* @__PURE__ */ z("input", {
1148
1272
  ...o,
1149
1273
  type: e.withTime ? "datetime-local" : "date",
1150
1274
  value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
1151
- onChange: (t) => r(t.target.value === "" ? void 0 : vr(t.target.value, e.withTime === !0))
1275
+ onChange: (t) => r(t.target.value === "" ? void 0 : Rr(t.target.value, e.withTime === !0))
1152
1276
  })]
1153
1277
  });
1154
- default: return /* @__PURE__ */ z("label", {
1278
+ default: return /* @__PURE__ */ B("label", {
1155
1279
  className: "stage-value-field",
1156
- children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
1280
+ children: [/* @__PURE__ */ z("span", { children: t }), /* @__PURE__ */ z("input", {
1157
1281
  ...o,
1158
1282
  type: "text",
1159
1283
  value: typeof n == "string" ? n : "",
@@ -1162,55 +1286,55 @@ function gr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1162
1286
  });
1163
1287
  }
1164
1288
  }
1165
- function _r(e) {
1289
+ function Lr(e) {
1166
1290
  return e.members ? {} : void 0;
1167
1291
  }
1168
- function vr(e, t) {
1292
+ function Rr(e, t) {
1169
1293
  if (!t) return e;
1170
1294
  let n = new Date(e);
1171
1295
  return Number.isNaN(n.getTime()) ? e : n.toISOString();
1172
1296
  }
1173
- function yr(e) {
1297
+ function zr(e) {
1174
1298
  return typeof e == "object" && !!e && !Array.isArray(e);
1175
1299
  }
1176
1300
  // src/stageScreenTables.tsx
1177
- function br(e) {
1301
+ function Br(e) {
1178
1302
  let t = /* @__PURE__ */ new Set(), n = (e) => {
1179
1303
  let r = e;
1180
1304
  if (r.componentName !== "core:outlet") {
1181
- xr(r).forEach((e) => t.add(e));
1305
+ Vr(r).forEach((e) => t.add(e));
1182
1306
  for (let e of Object.values(r.slots ?? {})) e.forEach(n);
1183
1307
  }
1184
1308
  };
1185
1309
  return n(e), [...t];
1186
1310
  }
1187
- function xr(e) {
1311
+ function Vr(e) {
1188
1312
  if (e.componentName === "core:table") return [e.id];
1189
- if (!Mn(e.componentName)) return [];
1313
+ if (!Fn(e.componentName)) return [];
1190
1314
  let t = e.properties.cards, n = t?.kind === "queryResult" && typeof t.query == "string" ? [`binding:${t.query}`] : [];
1191
1315
  return [e.id, ...n];
1192
1316
  }
1193
- var Sr = t(void 0);
1194
- function Cr({ element: e, outputScope: t, children: n }) {
1195
- let r = c(() => new Set(br(e).flatMap((e) => t ? [e, `${t}:${e}`] : [e])), [e, t]);
1196
- return /* @__PURE__ */ R(Sr.Provider, {
1317
+ var Hr = a(void 0);
1318
+ function Ur({ element: e, outputScope: t, children: n }) {
1319
+ let r = f(() => new Set(Br(e).flatMap((e) => t ? [e, `${t}:${e}`] : [e])), [e, t]);
1320
+ return /* @__PURE__ */ z(Hr.Provider, {
1197
1321
  value: r,
1198
1322
  children: n
1199
1323
  });
1200
1324
  }
1201
- function wr({ children: e }) {
1202
- return /* @__PURE__ */ R(Sr.Provider, {
1325
+ function Wr({ children: e }) {
1326
+ return /* @__PURE__ */ z(Hr.Provider, {
1203
1327
  value: void 0,
1204
1328
  children: e
1205
1329
  });
1206
1330
  }
1207
- function Tr() {
1208
- let e = i(Sr), { queries: t, selections: n } = U();
1209
- return c(() => {
1331
+ function Gr() {
1332
+ let e = c(Hr), { queries: t, selections: n } = W();
1333
+ return f(() => {
1210
1334
  let r = e ? Object.fromEntries(Object.entries(t).filter(([t]) => e.has(t))) : t, i = e ? Object.fromEntries(Object.entries(n).filter(([t]) => e.has(t))) : n;
1211
1335
  return {
1212
- selectableRows: ai(r),
1213
- selectedRows: oi(i, r)
1336
+ selectableRows: Ti(r),
1337
+ selectedRows: Ei(i, r)
1214
1338
  };
1215
1339
  }, [
1216
1340
  t,
@@ -1219,34 +1343,34 @@ function Tr() {
1219
1343
  ]);
1220
1344
  }
1221
1345
  // src/StageReferenceField.tsx
1222
- function Er(e) {
1223
- let t = o(), { routes: n, routesReady: r } = U(), i = n?.queries?.[e.reference.query], a = r && !!i, s = W({
1346
+ function Kr(e) {
1347
+ let t = u(), { routes: n, routesReady: r } = W(), i = n?.queries?.[e.reference.query], a = r && !!i, o = G({
1224
1348
  scope: t,
1225
1349
  name: e.reference.query,
1226
1350
  route: i,
1227
1351
  ready: a,
1228
1352
  publish: !1
1229
- }), c = typeof e.value == "string" ? e.value : "";
1230
- return !a || s.error ? /* @__PURE__ */ z(Xe, { children: [/* @__PURE__ */ R("input", {
1353
+ }), s = typeof e.value == "string" ? e.value : "";
1354
+ return !a || o.error ? /* @__PURE__ */ B(Qe, { children: [/* @__PURE__ */ z("input", {
1231
1355
  id: e.id,
1232
1356
  "aria-label": e.title,
1233
1357
  "aria-invalid": e.invalid,
1234
- value: c,
1358
+ value: s,
1235
1359
  onChange: (t) => e.onChange(t.target.value),
1236
1360
  onBlur: e.onBlur,
1237
1361
  required: e.required,
1238
1362
  disabled: e.disabled
1239
- }), s.error && /* @__PURE__ */ R("span", {
1363
+ }), o.error && /* @__PURE__ */ z("span", {
1240
1364
  role: "alert",
1241
- children: s.error
1242
- })] }) : /* @__PURE__ */ R(Or, {
1365
+ children: o.error
1366
+ })] }) : /* @__PURE__ */ z(Jr, {
1243
1367
  ...e,
1244
- selected: c,
1245
- choices: Dr(s.rows, e.reference),
1246
- loading: s.loading
1368
+ selected: s,
1369
+ choices: qr(o.rows, e.reference),
1370
+ loading: o.loading
1247
1371
  });
1248
1372
  }
1249
- function Dr(e, t) {
1373
+ function qr(e, t) {
1250
1374
  return e.flatMap((e) => {
1251
1375
  let n = e[t.value];
1252
1376
  return typeof n == "string" ? [{
@@ -1255,19 +1379,19 @@ function Dr(e, t) {
1255
1379
  }] : [];
1256
1380
  });
1257
1381
  }
1258
- function Or({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a, disabled: o, selected: s, choices: c, loading: l }) {
1259
- let [d, f] = u(""), p = c.filter((e) => e.key === s || e.label.toLocaleLowerCase().includes(d.toLocaleLowerCase())), m = s !== "" && !c.some((e) => e.key === s);
1260
- return /* @__PURE__ */ z("div", {
1382
+ function Jr({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a, disabled: o, selected: s, choices: c, loading: l }) {
1383
+ 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__ */ B("div", {
1261
1385
  className: "stage-reference-field",
1262
1386
  children: [
1263
- /* @__PURE__ */ R("input", {
1387
+ /* @__PURE__ */ z("input", {
1264
1388
  type: "search",
1265
1389
  "aria-label": `Filter ${i}`,
1266
- value: d,
1267
- onChange: (e) => f(e.target.value),
1390
+ value: u,
1391
+ onChange: (e) => d(e.target.value),
1268
1392
  disabled: o || l
1269
1393
  }),
1270
- /* @__PURE__ */ z("select", {
1394
+ /* @__PURE__ */ B("select", {
1271
1395
  id: e,
1272
1396
  "aria-label": i,
1273
1397
  "aria-invalid": r,
@@ -1277,48 +1401,48 @@ function Or({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a,
1277
1401
  required: a,
1278
1402
  disabled: o || l,
1279
1403
  children: [
1280
- /* @__PURE__ */ z("option", {
1404
+ /* @__PURE__ */ B("option", {
1281
1405
  value: "",
1282
1406
  children: ["Choose ", i]
1283
1407
  }),
1284
- m && /* @__PURE__ */ R("option", {
1408
+ p && /* @__PURE__ */ z("option", {
1285
1409
  value: s,
1286
1410
  children: s
1287
1411
  }),
1288
- p.map((e) => /* @__PURE__ */ R("option", {
1412
+ f.map((e) => /* @__PURE__ */ z("option", {
1289
1413
  value: e.key,
1290
1414
  children: e.label
1291
1415
  }, e.key))
1292
1416
  ]
1293
1417
  }),
1294
- /* @__PURE__ */ R(kr, {
1418
+ /* @__PURE__ */ z(Yr, {
1295
1419
  loading: l,
1296
1420
  empty: c.length === 0
1297
1421
  })
1298
1422
  ]
1299
1423
  });
1300
1424
  }
1301
- function kr({ loading: e, empty: t }) {
1302
- return e ? /* @__PURE__ */ R("span", {
1425
+ function Yr({ loading: e, empty: t }) {
1426
+ return e ? /* @__PURE__ */ z("span", {
1303
1427
  role: "status",
1304
1428
  children: "Loading choices…"
1305
- }) : t ? /* @__PURE__ */ R("span", { children: "No choices available" }) : null;
1429
+ }) : t ? /* @__PURE__ */ z("span", { children: "No choices available" }) : null;
1306
1430
  }
1307
- function Ar(e, t, n) {
1308
- return e?.reference ? /* @__PURE__ */ R(jr, {
1431
+ function Xr(e, t, n) {
1432
+ return e?.reference ? /* @__PURE__ */ z(Zr, {
1309
1433
  ...t,
1310
1434
  reference: e.reference
1311
1435
  }) : n;
1312
1436
  }
1313
- var jr = tt(Er, { defaultValue: "" }), Mr = {
1437
+ var Zr = it(Kr, { defaultValue: "" }), Qr = {
1314
1438
  messages: [],
1315
1439
  complete: async (e, t) => t([], !1)
1316
1440
  };
1317
- function Nr(e, t, n) {
1441
+ function $r(e, t, n) {
1318
1442
  let r = e.properties.onSubmit;
1319
- if (!r?.length) return Mr;
1443
+ if (!r?.length) return Qr;
1320
1444
  if (!n) return {
1321
- ...Mr,
1445
+ ...Qr,
1322
1446
  messages: ["The form submit continuation requires an interaction scope."]
1323
1447
  };
1324
1448
  let i = t?.command ?? "", a = n.context.responseContracts ?? {
@@ -1326,160 +1450,160 @@ function Nr(e, t, n) {
1326
1450
  targetType: () => void 0
1327
1451
  };
1328
1452
  return {
1329
- messages: ae({
1453
+ messages: oe({
1330
1454
  kind: "form",
1331
1455
  command: i,
1332
1456
  onSubmit: r
1333
1457
  }, a).map((e) => e.message),
1334
1458
  complete: async (e, t) => {
1335
- let a = T(n.context, i, e), o = await ne(r, n.dispatcher, a);
1336
- o.findings.length && n.onFindings?.(o.findings), t(o.findings.map((e) => e.detail), o.stop === S.Navigated);
1459
+ let a = k(n.context, i, e), o = await N(r, n.dispatcher, a);
1460
+ o.findings.length && n.onFindings?.(o.findings), t(o.findings.map((e) => e.detail), o.stop === E.Navigated);
1337
1461
  }
1338
1462
  };
1339
1463
  }
1340
1464
  // src/StageCommandForm.tsx
1341
- var Pr = t(void 0), Fr = t(null);
1342
- function Ir(e, t, n) {
1343
- return $n(e, n) ? {
1344
- ...nr(e, {
1465
+ var ei = a(void 0), ti = a(null);
1466
+ function ni(e, t, n) {
1467
+ return yr(e, n) ? {
1468
+ ...Sr(e, {
1345
1469
  selectableRows: [],
1346
1470
  selectedRows: []
1347
1471
  }),
1348
1472
  rowAction: !1
1349
- } : nr(e, t);
1473
+ } : Sr(e, t);
1350
1474
  }
1351
- function Lr(e, t) {
1475
+ function ri(e, t) {
1352
1476
  let n = X(e, "schema") || t?.commandSchemas?.[X(e, "command")];
1353
1477
  return {
1354
1478
  schemaText: n,
1355
- schema: c(() => J(n ?? ""), [n]),
1479
+ schema: f(() => Y(n ?? ""), [n]),
1356
1480
  hasSchemaMetadata: typeof n == "string"
1357
1481
  };
1358
1482
  }
1359
- function Rr({ element: e, cancellable: t }) {
1360
- let n = U(), r = i(Ve), a = i(Pr), o = i(Fr), s = l(null), d = c(() => Ur(e), [e]), f = Nr(e, d, xe()), { schemaText: p, schema: m, hasSchemaMetadata: h } = Lr(e, n.routes), g = c(() => d ? Wr(d, m) : [], [d, m]), _ = d ? V(d.command, X(e, "typeName"), X(e, "route")) : void 0, v = zr(e, d), y = di(e, g, n.resolveArgument), b = li(e, m, n), x = JSON.stringify(b ?? null), S = c(() => b, [x]), { selectableRows: C, selectedRows: w, rowAction: T, subjectValues: ee } = Ir(e, Tr(), p), E = c(() => Zr(m, n.parameters, w, ee), [
1361
- m,
1362
- w,
1363
- n.parameters,
1364
- ee
1365
- ]), te = c(() => Qr(g, E), [g, E]), D = c(() => ({
1366
- ...S,
1367
- ...Xr(g, m, n.parameters, w, C, T),
1368
- ...E,
1369
- ...ee,
1370
- ...Yr(g, n.parameters)
1483
+ function ii({ element: e, cancellable: n }) {
1484
+ let r = W(), i = c(t), a = c(ei), o = c(ti), s = p(null), l = f(() => li(e), [e]), u = $r(e, l, Ce()), { schemaText: d, schema: h, hasSchemaMetadata: g } = ri(e, r.routes), _ = f(() => l ? ui(l, h) : [], [l, h]), v = l ? H(l.command, X(e, "typeName"), X(e, "route")) : void 0, y = ai(e, l), b = ji(e, _, r.resolveArgument), x = ki(e, h, r), S = JSON.stringify(x ?? null), C = f(() => x, [S]), { selectableRows: w, selectedRows: T, rowAction: E, subjectValues: D } = ni(e, Gr(), d), O = f(() => _i(h, r.parameters, T, D), [
1485
+ h,
1486
+ T,
1487
+ r.parameters,
1488
+ D
1489
+ ]), k = f(() => vi(_, O), [_, O]), ee = f(() => ({
1490
+ ...C,
1491
+ ...gi(_, h, r.parameters, T, w, E),
1492
+ ...O,
1493
+ ...D,
1494
+ ...hi(_, r.parameters)
1371
1495
  }), [
1372
- S,
1373
- g,
1374
- m,
1375
- n.parameters,
1376
- w,
1377
1496
  C,
1497
+ _,
1498
+ h,
1499
+ r.parameters,
1378
1500
  T,
1501
+ w,
1379
1502
  E,
1380
- ee
1381
- ]), O = c(() => ({
1382
- ...Object.fromEntries(Object.keys(E).map((e) => [e, D[e]])),
1383
- ...y
1503
+ O,
1504
+ D
1505
+ ]), A = f(() => ({
1506
+ ...Object.fromEntries(Object.keys(O).map((e) => [e, ee[e]])),
1507
+ ...b
1384
1508
  }), [
1385
- E,
1386
- D,
1387
- y
1388
- ]), k = c(() => d ? Gr(d, te, m) : void 0, [
1389
- d,
1390
- te,
1391
- m
1392
- ]), A = c(() => d ? Si(g, m) : [], [
1393
- d,
1394
- g,
1395
- m
1396
- ]), ne = c(() => d ? Ci(d.layout, g) : [], [d, g]), [re, ie] = u([]);
1397
- return d ? !_ && !n.routesReady ? /* @__PURE__ */ z("p", {
1509
+ O,
1510
+ ee,
1511
+ b
1512
+ ]), te = f(() => l ? di(l, k, h) : void 0, [
1513
+ l,
1514
+ k,
1515
+ h
1516
+ ]), j = f(() => l ? Hi(_, h) : [], [
1517
+ l,
1518
+ _,
1519
+ h
1520
+ ]), ne = f(() => l ? Ui(l.layout, _) : [], [l, _]), [re, M] = m([]);
1521
+ return l ? !v && !r.routesReady ? /* @__PURE__ */ B("p", {
1398
1522
  className: "stage-note",
1399
1523
  children: [
1400
1524
  "The modeled command “",
1401
- d.command,
1525
+ l.command,
1402
1526
  "” is waiting for Stage routes."
1403
1527
  ]
1404
- }) : _ ? g.length === 0 && !h && e.properties.parameterless !== !0 ? /* @__PURE__ */ R(Hr, {
1405
- form: d,
1406
- messages: [`The modeled command “${d.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
1407
- }) : A.length + f.messages.length > 0 ? /* @__PURE__ */ R(Hr, {
1408
- form: d,
1409
- messages: [...A, ...f.messages]
1410
- }) : /* @__PURE__ */ R("section", {
1528
+ }) : v ? _.length === 0 && !g && e.properties.parameterless !== !0 ? /* @__PURE__ */ z(ci, {
1529
+ form: l,
1530
+ 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__ */ z(ci, {
1532
+ form: l,
1533
+ messages: [...j, ...u.messages]
1534
+ }) : /* @__PURE__ */ z("section", {
1411
1535
  ref: s,
1412
1536
  className: "stage-command-form",
1413
- "data-command": d.command,
1414
- "data-generation-mode": d.generationMode,
1415
- children: /* @__PURE__ */ z(et, {
1416
- command: _,
1417
- initialValues: D,
1418
- currentValues: O,
1537
+ "data-command": l.command,
1538
+ "data-generation-mode": l.generationMode,
1539
+ children: /* @__PURE__ */ B(rt, {
1540
+ command: v,
1541
+ initialValues: ee,
1542
+ currentValues: A,
1419
1543
  validateOn: "both",
1420
1544
  validateAllFieldsOnChange: !0,
1421
- onBeforeExecute: (e) => Ft(e, r.apiBasePath),
1422
- onFieldValidate: (e, t, n, r) => xi(g, m, t, r),
1423
- onValidationFailure: (e) => ie(bi(g, e)),
1424
- onException: (e) => ie(e),
1425
- onFailed: (e) => ie(Lt(d.command, e).messages),
1545
+ onBeforeExecute: (e) => Rt(e, i.apiBasePath),
1546
+ onFieldValidate: (e, t, n, r) => Vi(_, h, t, r),
1547
+ onValidationFailure: (e) => M(Bi(_, e)),
1548
+ onException: (e) => M(e),
1549
+ onFailed: (e) => M(Bt(l.command, e).messages),
1426
1550
  onSuccess: async (t) => {
1427
- n.refreshAfterCommand();
1428
- let r = (t, n) => {
1429
- ie(t), t.length || Vr(e, n, a);
1551
+ r.refreshAfterCommand();
1552
+ let n = (t, n) => {
1553
+ M(t), t.length || si(e, n, a);
1430
1554
  };
1431
1555
  try {
1432
- await f.complete(t, r);
1556
+ await u.complete(t, n);
1433
1557
  } catch (e) {
1434
- r([e instanceof Error ? e.message : String(e)], !1);
1558
+ n([e instanceof Error ? e.message : String(e)], !1);
1435
1559
  }
1436
1560
  },
1437
1561
  children: [
1438
- ne.map((e) => /* @__PURE__ */ R("p", {
1562
+ ne.map((e) => /* @__PURE__ */ z("p", {
1439
1563
  role: "alert",
1440
1564
  className: "stage-form-error",
1441
1565
  children: e
1442
1566
  }, e)),
1443
- k,
1444
- re.map((e) => /* @__PURE__ */ R("p", {
1567
+ te,
1568
+ re.map((e) => /* @__PURE__ */ z("p", {
1445
1569
  role: "alert",
1446
1570
  className: "stage-form-error",
1447
1571
  children: e
1448
1572
  }, e)),
1449
- o ? $e(/* @__PURE__ */ R(B, {
1573
+ o ? nt(/* @__PURE__ */ z(V, {
1450
1574
  type: "button",
1451
1575
  className: "scene-slice-dialog-submit",
1452
1576
  onClick: () => s.current?.querySelector("form")?.requestSubmit(),
1453
- children: v
1454
- }), o) : /* @__PURE__ */ R(Br, {
1455
- submitLabel: v,
1456
- cancellable: t
1577
+ children: y
1578
+ }), o) : /* @__PURE__ */ z(oi, {
1579
+ submitLabel: y,
1580
+ cancellable: n
1457
1581
  })
1458
1582
  ]
1459
- }, x)
1460
- }) : /* @__PURE__ */ z("p", {
1583
+ }, S)
1584
+ }) : /* @__PURE__ */ B("p", {
1461
1585
  className: "stage-note",
1462
1586
  children: [
1463
1587
  "The modeled command “",
1464
- d.command,
1588
+ l.command,
1465
1589
  "” is not registered by this Stage."
1466
1590
  ]
1467
- }) : /* @__PURE__ */ R("p", {
1591
+ }) : /* @__PURE__ */ z("p", {
1468
1592
  className: "stage-note",
1469
1593
  children: "This form is missing its command metadata."
1470
1594
  });
1471
1595
  }
1472
- function zr(e, t) {
1596
+ function ai(e, t) {
1473
1597
  return X(e, "submitLabel") || t?.label || "Submit";
1474
1598
  }
1475
- function Br({ submitLabel: e, cancellable: t }) {
1476
- let n = i(Pr);
1477
- return /* @__PURE__ */ z("div", {
1599
+ function oi({ submitLabel: e, cancellable: t }) {
1600
+ let n = c(ei);
1601
+ return /* @__PURE__ */ B("div", {
1478
1602
  className: "stage-command-form__actions",
1479
- children: [/* @__PURE__ */ R(B, {
1603
+ children: [/* @__PURE__ */ z(V, {
1480
1604
  type: "submit",
1481
1605
  children: e
1482
- }), t && n && /* @__PURE__ */ R(B, {
1606
+ }), t && n && /* @__PURE__ */ z(V, {
1483
1607
  type: "button",
1484
1608
  variant: "outline",
1485
1609
  onClick: n,
@@ -1487,59 +1611,59 @@ function Br({ submitLabel: e, cancellable: t }) {
1487
1611
  })]
1488
1612
  });
1489
1613
  }
1490
- function Vr(e, t, n) {
1614
+ function si(e, t, n) {
1491
1615
  let r = X(e, "navigateToScreen");
1492
- r && !t && H(r, {}), n?.();
1616
+ r && !t && U(r, {}), n?.();
1493
1617
  }
1494
- function Hr({ form: e, messages: t }) {
1495
- return /* @__PURE__ */ R("section", {
1618
+ function ci({ form: e, messages: t }) {
1619
+ return /* @__PURE__ */ z("section", {
1496
1620
  className: "stage-command-form",
1497
1621
  "data-command": e.command,
1498
1622
  "data-generation-mode": e.generationMode,
1499
- children: t.map((e) => /* @__PURE__ */ R("p", {
1623
+ children: t.map((e) => /* @__PURE__ */ z("p", {
1500
1624
  role: "alert",
1501
1625
  className: "stage-form-error",
1502
1626
  children: e
1503
1627
  }, e))
1504
1628
  });
1505
1629
  }
1506
- function Ur(e) {
1630
+ function li(e) {
1507
1631
  let t = X(e, "command");
1508
1632
  if (!t) return;
1509
1633
  let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(Z) : [];
1510
1634
  return {
1511
1635
  command: t,
1512
- label: X(e, "label") || q(t),
1636
+ label: X(e, "label") || J(t),
1513
1637
  fields: n,
1514
- generationMode: pi(e.properties.generationMode),
1515
- layout: mi(e.properties.layout)
1638
+ generationMode: Ni(e.properties.generationMode),
1639
+ layout: Pi(e.properties.layout)
1516
1640
  };
1517
1641
  }
1518
- function Wr(e, t) {
1519
- return e.generationMode === m.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
1642
+ function ui(e, t) {
1643
+ return e.generationMode === v.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
1520
1644
  name: e.name,
1521
- label: q(e.name)
1645
+ label: J(e.name)
1522
1646
  }));
1523
1647
  }
1524
- function Gr(e, t, n) {
1525
- let r = e.layout, i = r ? hi(r, t) : [];
1526
- if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => Kr(e, n));
1527
- let a = new Map(t.map((e) => [e.name, e])), o = gi(r, i), s = {
1528
- gridTemplateColumns: Array.from({ length: o }, (e, t) => _i(t + 1, r.columns)).join(" "),
1529
- columnGap: yi(r.columnGap),
1530
- rowGap: yi(r.rowGap)
1648
+ function di(e, t, n) {
1649
+ let r = e.layout, i = r ? Fi(r, t) : [];
1650
+ if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => fi(e, n));
1651
+ let a = new Map(t.map((e) => [e.name, e])), o = Ii(r, i), s = {
1652
+ gridTemplateColumns: Array.from({ length: o }, (e, t) => Li(t + 1, r.columns)).join(" "),
1653
+ columnGap: zi(r.columnGap),
1654
+ rowGap: zi(r.rowGap)
1531
1655
  }, c = /* @__PURE__ */ new Set();
1532
- return /* @__PURE__ */ z("div", {
1656
+ return /* @__PURE__ */ B("div", {
1533
1657
  className: "stage-command-form__layout",
1534
1658
  style: s,
1535
1659
  children: [i.map((e) => {
1536
1660
  let t = a.get(e.field);
1537
- return t ? (c.add(t.name), Kr(t, n, e)) : null;
1538
- }), t.filter((e) => !c.has(e.name)).map((e) => Kr(e, n))]
1661
+ return t ? (c.add(t.name), fi(t, n, e)) : null;
1662
+ }), t.filter((e) => !c.has(e.name)).map((e) => fi(e, n))]
1539
1663
  });
1540
1664
  }
1541
- function Kr(e, t, n) {
1542
- let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = Ar(i, {
1665
+ function fi(e, t, n) {
1666
+ let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = Xr(i, {
1543
1667
  value: o,
1544
1668
  fieldName: r,
1545
1669
  title: a,
@@ -1548,9 +1672,9 @@ function Kr(e, t, n) {
1548
1672
  if (i?.options) {
1549
1673
  let e = i.options.map((e) => ({
1550
1674
  value: e,
1551
- label: q(e)
1675
+ label: J(e)
1552
1676
  }));
1553
- return /* @__PURE__ */ R(at, {
1677
+ return /* @__PURE__ */ z(ct, {
1554
1678
  value: o,
1555
1679
  fieldName: r,
1556
1680
  title: a,
@@ -1560,7 +1684,7 @@ function Kr(e, t, n) {
1560
1684
  optionLabel: "label"
1561
1685
  });
1562
1686
  }
1563
- if (i?.members || i?.item) return /* @__PURE__ */ R(fr, {
1687
+ if (i?.members || i?.item) return /* @__PURE__ */ z(Mr, {
1564
1688
  value: o,
1565
1689
  fieldName: r,
1566
1690
  title: a,
@@ -1568,19 +1692,19 @@ function Kr(e, t, n) {
1568
1692
  descriptor: i
1569
1693
  });
1570
1694
  switch (i?.type ?? "text") {
1571
- case "number": return /* @__PURE__ */ R(st, {
1695
+ case "number": return /* @__PURE__ */ z(ut, {
1572
1696
  value: o,
1573
1697
  fieldName: r,
1574
1698
  title: a,
1575
1699
  required: s
1576
1700
  });
1577
- case "boolean": return /* @__PURE__ */ R(it, {
1701
+ case "boolean": return /* @__PURE__ */ z(st, {
1578
1702
  value: o,
1579
1703
  fieldName: r,
1580
1704
  label: a,
1581
1705
  required: s
1582
1706
  });
1583
- case "date": return /* @__PURE__ */ R(qr, {
1707
+ case "date": return /* @__PURE__ */ z(pi, {
1584
1708
  value: o,
1585
1709
  fieldName: r,
1586
1710
  title: a,
@@ -1589,15 +1713,15 @@ function Kr(e, t, n) {
1589
1713
  isNonModal: !0,
1590
1714
  showTime: i?.withTime
1591
1715
  });
1592
- default: return /* @__PURE__ */ R(ot, {
1716
+ default: return /* @__PURE__ */ z(lt, {
1593
1717
  value: o,
1594
1718
  fieldName: r,
1595
1719
  title: a,
1596
1720
  required: s
1597
1721
  });
1598
1722
  }
1599
- })()), l = vi(n);
1600
- return /* @__PURE__ */ R("span", {
1723
+ })()), l = Ri(n);
1724
+ return /* @__PURE__ */ z("span", {
1601
1725
  className: "stage-command-form__field",
1602
1726
  "data-field": e.name,
1603
1727
  "data-row": n?.row,
@@ -1607,21 +1731,21 @@ function Kr(e, t, n) {
1607
1731
  children: c
1608
1732
  }, e.name);
1609
1733
  }
1610
- var qr = nt((e) => /* @__PURE__ */ R(rt, {
1734
+ var pi = at((e) => /* @__PURE__ */ z(ot, {
1611
1735
  ...e,
1612
- currentValue: e.showTime ? e.currentValue : Jr(e.currentValue),
1613
- onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Je.fromDate(t) : t)
1736
+ currentValue: e.showTime ? e.currentValue : mi(e.currentValue),
1737
+ onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Xe.fromDate(t) : t)
1614
1738
  }));
1615
- function Jr(e) {
1616
- if (e instanceof Je) return e.toDate();
1739
+ function mi(e) {
1740
+ if (e instanceof Xe) return e.toDate();
1617
1741
  if (typeof e != "string") return e;
1618
1742
  try {
1619
- return Je.parse(e).toDate();
1743
+ return Xe.parse(e).toDate();
1620
1744
  } catch {
1621
1745
  return null;
1622
1746
  }
1623
1747
  }
1624
- function Yr(e, t) {
1748
+ function hi(e, t) {
1625
1749
  let n = {};
1626
1750
  for (let r of e) {
1627
1751
  let e = r.sourceProperty ?? r.name, i = t[e];
@@ -1629,47 +1753,47 @@ function Yr(e, t) {
1629
1753
  }
1630
1754
  return n;
1631
1755
  }
1632
- function Xr(e, t, n, r = [], i = [], a = !1) {
1756
+ function gi(e, t, n, r = [], i = [], a = !1) {
1633
1757
  let o = new Set(e.map((e) => e.sourceProperty ?? e.name)), s = t.some((e) => e.identity), c = {};
1634
1758
  for (let e of t) {
1635
1759
  if (!e.identifier || !e.required || o.has(e.name)) continue;
1636
- if (a && ni(e, i)) {
1637
- let t = n[e.name] || ti(e, r);
1760
+ if (a && Si(e, i)) {
1761
+ let t = n[e.name] || xi(e, r);
1638
1762
  t && (c[e.name] = t);
1639
1763
  continue;
1640
1764
  }
1641
- let t = n[e.name] || ti(e, r) || jt(e.identifier) || (e.identity || !s && !ni(e, i) ? Mt(e.identifier) : void 0);
1765
+ let t = n[e.name] || xi(e, r) || Pt(e.identifier) || (e.identity || !s && !Si(e, i) ? Ft(e.identifier) : void 0);
1642
1766
  t !== void 0 && (c[e.name] = t);
1643
1767
  }
1644
1768
  return c;
1645
1769
  }
1646
- function Zr(e, t, n, r) {
1770
+ function _i(e, t, n, r) {
1647
1771
  return Object.fromEntries(e.filter((e) => e.reference).flatMap((e) => {
1648
- let i = t[e.name] || r[e.name] || ti(e, n) || ($r({
1772
+ let i = t[e.name] || r[e.name] || xi(e, n) || (yi({
1649
1773
  ...e,
1650
1774
  required: !0
1651
- }, t) ? ei(e, t) : void 0);
1775
+ }, t) ? bi(e, t) : void 0);
1652
1776
  return i === void 0 ? [] : [[e.name, i]];
1653
1777
  }));
1654
1778
  }
1655
- function Qr(e, t) {
1779
+ function vi(e, t) {
1656
1780
  return e.filter((e) => !Object.hasOwn(t, e.sourceProperty ?? e.name));
1657
1781
  }
1658
- function $r(e, t) {
1659
- return !e.identifier || !e.required ? !1 : e.identity === !0 || ei(e, t) !== void 0;
1782
+ function yi(e, t) {
1783
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || bi(e, t) !== void 0;
1660
1784
  }
1661
- function ei(e, t) {
1662
- if (e.identifier) return t[e.name] || jt(e.identifier);
1785
+ function bi(e, t) {
1786
+ if (e.identifier) return t[e.name] || Pt(e.identifier);
1663
1787
  }
1664
- function ti(e, t) {
1788
+ function xi(e, t) {
1665
1789
  if (!e.identifier) return;
1666
1790
  let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
1667
1791
  return n.size === 1 ? [...n][0] : void 0;
1668
1792
  }
1669
- function ni(e, t) {
1793
+ function Si(e, t) {
1670
1794
  return t.some((t) => Object.hasOwn(t, e.name));
1671
1795
  }
1672
- function ri(e, t) {
1796
+ function Ci(e, t) {
1673
1797
  let n = e.id;
1674
1798
  if (typeof n != "string" || n === "") return e;
1675
1799
  let r = `${t.alias ?? ""} ${t.name ?? ""}`.match(/[A-Z][a-z0-9]+/g) ?? [], i = Object.fromEntries(r.map((e) => `${e.charAt(0).toLowerCase()}${e.slice(1)}Id`).filter((t) => !Object.hasOwn(e, t)).map((e) => [e, n]));
@@ -1678,186 +1802,186 @@ function ri(e, t) {
1678
1802
  ...e
1679
1803
  };
1680
1804
  }
1681
- function ii(e) {
1682
- return Object.values(e).flatMap((e) => e.rows.map((t) => [t, ri(t, e)]));
1805
+ function wi(e) {
1806
+ return Object.values(e).flatMap((e) => e.rows.map((t) => [t, Ci(t, e)]));
1683
1807
  }
1684
- function ai(e) {
1685
- return ii(e).map(([, e]) => e);
1808
+ function Ti(e) {
1809
+ return wi(e).map(([, e]) => e);
1686
1810
  }
1687
- function oi(e, t) {
1688
- let n = new Map(ii(t));
1811
+ function Ei(e, t) {
1812
+ let n = new Map(wi(t));
1689
1813
  return Object.values(e).filter((e) => e !== void 0).map((e) => n.get(e) ?? e);
1690
1814
  }
1691
- function si(e, t, n, r) {
1692
- return e.filter((e) => e.identifier && e.required && ni(e, r)).filter((e) => !t[e.name] && ti(e, n) === void 0).map((e) => e.name);
1815
+ function Di(e, t, n, r) {
1816
+ return e.filter((e) => e.identifier && e.required && Si(e, r)).filter((e) => !t[e.name] && xi(e, n) === void 0).map((e) => e.name);
1693
1817
  }
1694
- function ci(e) {
1818
+ function Oi(e) {
1695
1819
  let t = e.properties.populateSource;
1696
1820
  return Z(t) ? t : void 0;
1697
1821
  }
1698
- function li(e, t, n) {
1699
- let r = ci(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, ui(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), s = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = W({
1822
+ function ki(e, t, n) {
1823
+ let r = Oi(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, Ai(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), s = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), c = G({
1700
1824
  scope: `populate:${X(e, "command")}`,
1701
1825
  name: i,
1702
1826
  route: i ? n.routes?.queries?.[i] : void 0,
1703
1827
  arguments: o,
1704
1828
  ready: s,
1705
1829
  publish: !1
1706
- }), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : Z(u) ? u : void 0;
1707
- return c(() => {
1708
- if (!d) return;
1830
+ }), l = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, u = i ? c.rows[0] : Z(l) ? l : void 0;
1831
+ return f(() => {
1832
+ if (!u) return;
1709
1833
  let e = {};
1710
1834
  for (let n of t) {
1711
- let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
1712
- t != null && (e[n.name] = Yn(n, t));
1835
+ let t = u[n.name] ?? u[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
1836
+ t != null && (e[n.name] = mr(n, t));
1713
1837
  }
1714
1838
  return Object.keys(e).length > 0 ? e : void 0;
1715
- }, [d, t]);
1839
+ }, [u, t]);
1716
1840
  }
1717
- function ui(e, t, n, r) {
1841
+ function Ai(e, t, n, r) {
1718
1842
  let i = r.parameters[t] ?? r.parameters[e];
1719
1843
  if (i) return i;
1720
1844
  let a = n.find((n) => n.name === t || n.name === e)?.identifier;
1721
- if (a) return Mt(a);
1845
+ if (a) return Ft(a);
1722
1846
  let o = r.resolveBinding({ path: t });
1723
1847
  return typeof o == "string" || typeof o == "number" ? o : void 0;
1724
1848
  }
1725
- function di(e, t, n) {
1726
- let r = c(() => fi(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1727
- return c(() => {
1849
+ function ji(e, t, n) {
1850
+ let r = f(() => Mi(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1851
+ return f(() => {
1728
1852
  let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
1729
1853
  return Object.keys(e).length > 0 ? e : void 0;
1730
1854
  }, [r, a]);
1731
1855
  }
1732
- function fi(e, t) {
1856
+ function Mi(e, t) {
1733
1857
  let n = e.properties.arguments;
1734
1858
  if (!Array.isArray(n)) return [];
1735
1859
  let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
1736
1860
  return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
1737
1861
  }
1738
- function pi(e) {
1739
- return e === m.Manual ? m.Manual : m.Auto;
1862
+ function Ni(e) {
1863
+ return e === v.Manual ? v.Manual : v.Auto;
1740
1864
  }
1741
- function mi(e) {
1865
+ function Pi(e) {
1742
1866
  if (!Z(e)) return;
1743
1867
  let t = e;
1744
1868
  return {
1745
- columns: Array.isArray(t.columns) ? t.columns.filter(wi) : [],
1746
- placements: Array.isArray(t.placements) ? t.placements.filter(Ti) : [],
1747
- columnGap: Ei(t.columnGap) ? t.columnGap : void 0,
1748
- rowGap: Ei(t.rowGap) ? t.rowGap : void 0
1869
+ columns: Array.isArray(t.columns) ? t.columns.filter(Wi) : [],
1870
+ placements: Array.isArray(t.placements) ? t.placements.filter(Gi) : [],
1871
+ columnGap: Ki(t.columnGap) ? t.columnGap : void 0,
1872
+ rowGap: Ki(t.rowGap) ? t.rowGap : void 0
1749
1873
  };
1750
1874
  }
1751
- function hi(e, t) {
1875
+ function Fi(e, t) {
1752
1876
  let n = new Map(e.placements.map((e) => [e.field, e]));
1753
- for (let e of t) !n.has(e.name) && Ti(e.placement) && n.set(e.name, e.placement);
1877
+ for (let e of t) !n.has(e.name) && Gi(e.placement) && n.set(e.name, e.placement);
1754
1878
  return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
1755
1879
  }
1756
- function gi(e, t) {
1880
+ function Ii(e, t) {
1757
1881
  return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
1758
1882
  }
1759
- function _i(e, t) {
1760
- let n = t.find((t) => t.index === e), r = yi(n?.width), i = yi(n?.minWidth), a = yi(n?.maxWidth);
1761
- return n?.width?.unit === h.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1883
+ function Li(e, t) {
1884
+ let n = t.find((t) => t.index === e), r = zi(n?.width), i = zi(n?.minWidth), a = zi(n?.maxWidth);
1885
+ return n?.width?.unit === y.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1762
1886
  }
1763
- function vi(e) {
1887
+ function Ri(e) {
1764
1888
  if (e) return {
1765
1889
  gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
1766
1890
  gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
1767
- width: e.width?.unit === h.Fraction ? void 0 : yi(e.width)
1891
+ width: e.width?.unit === y.Fraction ? void 0 : zi(e.width)
1768
1892
  };
1769
1893
  }
1770
- function yi(e) {
1894
+ function zi(e) {
1771
1895
  if (e) switch (e.unit) {
1772
- case h.Fraction: return `${e.value ?? 1}fr`;
1773
- case h.Pixels: return `${e.value ?? 0}px`;
1774
- case h.Percent: return `${e.value ?? 100}%`;
1775
- case h.Auto: return "auto";
1896
+ case y.Fraction: return `${e.value ?? 1}fr`;
1897
+ case y.Pixels: return `${e.value ?? 0}px`;
1898
+ case y.Percent: return `${e.value ?? 100}%`;
1899
+ case y.Auto: return "auto";
1776
1900
  }
1777
1901
  }
1778
- function bi(e, t) {
1902
+ function Bi(e, t) {
1779
1903
  let n = (e, t) => !!e.members?.some((e) => e === t || e.startsWith(`${t}.`)), r = new Set(e.map((e) => t.find((t) => n(t, e.sourceProperty ?? e.name))).filter((e) => e !== void 0));
1780
1904
  return [...new Set(t.filter((e) => !r.has(e)).map((e) => e.message))];
1781
1905
  }
1782
- function xi(e, t, n, r) {
1906
+ function Vi(e, t, n, r) {
1783
1907
  let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
1784
- if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? qn(a, r, i?.label ?? n) : void 0;
1908
+ if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? fr(a, r, i?.label ?? n) : void 0;
1785
1909
  }
1786
- function Si(e, t) {
1910
+ function Hi(e, t) {
1787
1911
  let n = new Map(t.map((e) => [e.name, e]));
1788
1912
  return e.flatMap((e) => {
1789
1913
  let t = n.get(e.sourceProperty ?? e.name);
1790
1914
  return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
1791
1915
  });
1792
1916
  }
1793
- function Ci(e, t) {
1917
+ function Ui(e, t) {
1794
1918
  if (!e) return [];
1795
- let n = hi(e, t).filter((e) => e.width?.unit === h.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === h.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
1919
+ let n = Fi(e, t).filter((e) => e.width?.unit === y.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === y.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
1796
1920
  return [...n, ...r];
1797
1921
  }
1798
1922
  function X(e, t, n = "") {
1799
1923
  let r = e.properties[t];
1800
1924
  return typeof r == "string" ? r : n;
1801
1925
  }
1802
- function wi(e) {
1926
+ function Wi(e) {
1803
1927
  return Z(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1804
1928
  }
1805
- function Ti(e) {
1929
+ function Gi(e) {
1806
1930
  return Z(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1807
1931
  }
1808
- function Ei(e) {
1809
- return Z(e) && Object.values(h).includes(e.unit);
1932
+ function Ki(e) {
1933
+ return Z(e) && Object.values(y).includes(e.unit);
1810
1934
  }
1811
1935
  function Z(e) {
1812
1936
  return typeof e == "object" && !!e && !Array.isArray(e);
1813
1937
  }
1814
1938
  // src/readableValue.ts
1815
- var Di = /^(\d{4})-(\d{2})-(\d{2})$/, Oi = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;
1816
- function ki(e) {
1939
+ var qi = /^(\d{4})-(\d{2})-(\d{2})$/, Ji = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;
1940
+ function Yi(e) {
1817
1941
  if (typeof e == "boolean") return e ? "Yes" : "No";
1818
- if (typeof e == "string") return Ai(e) ?? ji(e);
1942
+ if (typeof e == "string") return Xi(e) ?? Zi(e);
1819
1943
  }
1820
- function Ai(e) {
1821
- let t = Di.exec(e);
1944
+ function Xi(e) {
1945
+ let t = qi.exec(e);
1822
1946
  if (!t) return;
1823
1947
  let n = new Date(2e3, Number(t[2]) - 1, Number(t[3]));
1824
1948
  return n.setFullYear(Number(t[1])), Number.isNaN(n.getTime()) || n.getMonth() !== Number(t[2]) - 1 ? void 0 : n.toLocaleDateString();
1825
1949
  }
1826
- function ji(e) {
1827
- if (!Oi.test(e)) return;
1950
+ function Zi(e) {
1951
+ if (!Ji.test(e)) return;
1828
1952
  let t = new Date(e);
1829
1953
  return Number.isNaN(t.getTime()) ? void 0 : t.toLocaleString();
1830
1954
  }
1831
- function Mi(e) {
1832
- let t = xe(), n = l(void 0), i = c(() => D(pe(e.id, e.behaviors), v.DoubleClick), [e.behaviors, e.id]);
1833
- a(() => () => clearTimeout(n.current), []);
1834
- let o = r((e) => {
1955
+ function Qi(e) {
1956
+ let t = Ce(), n = p(void 0), r = f(() => j(he(e.id, e.behaviors), S.DoubleClick), [e.behaviors, e.id]);
1957
+ l(() => () => clearTimeout(n.current), []);
1958
+ let i = s((e) => {
1835
1959
  if (clearTimeout(n.current), n.current = void 0, !t) return;
1836
- let r = (n) => n.path?.startsWith("item.") ? A({ subject: n.path }, e) : t.context.resolve(n);
1837
- Wt(i, t.dispatcher, {
1960
+ let i = (n) => n.path?.startsWith("item.") ? M({ subject: n.path }, e) : t.context.resolve(n);
1961
+ qt(r, t.dispatcher, {
1838
1962
  ...t.context,
1839
1963
  subject: () => e,
1840
- resolve: r
1964
+ resolve: i
1841
1965
  }).then((e) => {
1842
1966
  e.findings.length > 0 && t.onFindings?.(e.findings);
1843
1967
  });
1844
- }, [i, t]);
1968
+ }, [r, t]);
1845
1969
  return {
1846
- click: r((e, t) => {
1847
- i.length === 0 ? t() : (clearTimeout(n.current), n.current = setTimeout(() => {
1970
+ click: s((e, t) => {
1971
+ r.length === 0 ? t() : (clearTimeout(n.current), n.current = setTimeout(() => {
1848
1972
  n.current = void 0, t();
1849
1973
  }, 250));
1850
- }, [i.length]),
1851
- doubleClick: i.length > 0 ? o : void 0
1974
+ }, [r.length]),
1975
+ doubleClick: r.length > 0 ? i : void 0
1852
1976
  };
1853
1977
  }
1854
1978
  // src/stageDialogScreens.ts
1855
- var Ni = "Stage:confirmDialog", Pi = "ConfirmDialog";
1856
- function Fi(e, t) {
1979
+ var $i = "Stage:confirmDialog", ea = "ConfirmDialog";
1980
+ function ta(e, t) {
1857
1981
  let n = new Set(t.map((e) => e.name));
1858
1982
  return e.map((t) => {
1859
- if (t.screenTemplate !== Pi || n.has(Pi)) return t;
1860
- let r = Ii(t), i = e.find((e) => e.name !== t.name)?.name, a = L(`confirm-dialog-${t.name}`, Ni, {
1983
+ if (t.screenTemplate !== ea || n.has(ea)) return t;
1984
+ let r = na(t), i = e.find((e) => e.name !== t.name)?.name, a = R(`confirm-dialog-${t.name}`, $i, {
1861
1985
  title: t.name,
1862
1986
  decisions: r,
1863
1987
  home: i
@@ -1870,105 +1994,105 @@ function Fi(e, t) {
1870
1994
  };
1871
1995
  });
1872
1996
  }
1873
- function Ii(e) {
1997
+ function na(e) {
1874
1998
  let t = [];
1875
- for (let n of Li(Object.values(e.slotContent).flat())) {
1876
- let r = Ri(n.properties.command);
1999
+ for (let n of ra(Object.values(e.slotContent).flat())) {
2000
+ let r = ia(n.properties.command);
1877
2001
  r && !t.some((e) => e.command === r) && t.push({
1878
2002
  command: r,
1879
- label: Ri(n.properties.label),
1880
- navigateToScreen: Ri(n.properties.navigateToScreen),
1881
- typeName: Ri(n.properties.typeName),
1882
- route: Ri(n.properties.route),
2003
+ label: ia(n.properties.label),
2004
+ navigateToScreen: ia(n.properties.navigateToScreen),
2005
+ typeName: ia(n.properties.typeName),
2006
+ route: ia(n.properties.route),
1883
2007
  form: e.forms.find((e) => e.forCommand === r)
1884
2008
  });
1885
2009
  }
1886
2010
  return t;
1887
2011
  }
1888
- function Li(e) {
2012
+ function ra(e) {
1889
2013
  return e.flatMap((e) => {
1890
2014
  let t = e;
1891
- return t.componentName === "core:action" ? [t] : Li(Object.values(t.slots ?? {}).flat());
2015
+ return t.componentName === "core:action" ? [t] : ra(Object.values(t.slots ?? {}).flat());
1892
2016
  });
1893
2017
  }
1894
- function Ri(e) {
2018
+ function ia(e) {
1895
2019
  return typeof e == "string" && e !== "" ? e : void 0;
1896
2020
  }
1897
2021
  // src/StageConfirmDialog.tsx
1898
- function zi({ element: e }) {
1899
- let { routes: t, parameters: n, queries: r, selections: i } = U(), [o, s] = u(), c = l(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h = oi(i, r);
1900
- return a(() => c.current?.focus(), []), /* @__PURE__ */ z("section", {
2022
+ function aa({ element: e }) {
2023
+ 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 = Ei(i, r);
2024
+ return l(() => s.current?.focus(), []), /* @__PURE__ */ B("section", {
1901
2025
  className: "scene-slice-dialog stage-confirm-dialog",
1902
2026
  role: "dialog",
1903
- "aria-label": q(d),
1904
- "data-stage-component": Ni,
2027
+ "aria-label": J(c),
2028
+ "data-stage-component": $i,
1905
2029
  children: [
1906
- /* @__PURE__ */ R("header", {
2030
+ /* @__PURE__ */ z("header", {
1907
2031
  className: "scene-slice-dialog-header",
1908
- children: /* @__PURE__ */ R("h2", {
2032
+ children: /* @__PURE__ */ z("h2", {
1909
2033
  className: "scene-slice-dialog-title",
1910
- children: q(d)
2034
+ children: J(c)
1911
2035
  })
1912
2036
  }),
1913
- /* @__PURE__ */ R("div", {
2037
+ /* @__PURE__ */ z("div", {
1914
2038
  className: "stage-confirm-dialog__decisions",
1915
- children: f.map((e, t) => /* @__PURE__ */ R("button", {
1916
- ref: t === 0 ? c : void 0,
2039
+ children: u.map((e, t) => /* @__PURE__ */ z("button", {
2040
+ ref: t === 0 ? s : void 0,
1917
2041
  type: "button",
1918
2042
  className: t === 0 ? "scene-slice-dialog-submit stage-confirm-dialog__decision" : "scene-slice-dialog-cancel stage-confirm-dialog__decision",
1919
2043
  "data-emphasis": t === 0 ? "primary" : "secondary",
1920
- "aria-pressed": e.command === o,
1921
- onClick: () => s(e.command),
1922
- children: Vi(e)
2044
+ "aria-pressed": e.command === a,
2045
+ onClick: () => o(e.command),
2046
+ children: sa(e)
1923
2047
  }, e.command))
1924
2048
  }),
1925
- m && /* @__PURE__ */ R(wr, { children: /* @__PURE__ */ R(Rr, { element: Wi(m, t?.commandSchemas?.[m.command] ?? "", n, h) }, m.command) }),
1926
- /* @__PURE__ */ R("footer", {
2049
+ f && /* @__PURE__ */ z(Wr, { children: /* @__PURE__ */ z(ii, { element: ua(f, t?.commandSchemas?.[f.command] ?? "", n, h) }, f.command) }),
2050
+ /* @__PURE__ */ z("footer", {
1927
2051
  className: "scene-slice-dialog-footer",
1928
- children: /* @__PURE__ */ R("button", {
2052
+ children: /* @__PURE__ */ z("button", {
1929
2053
  type: "button",
1930
2054
  className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
1931
- onClick: () => Bi(f, p),
2055
+ onClick: () => oa(u, d),
1932
2056
  children: "Cancel"
1933
2057
  })
1934
2058
  })
1935
2059
  ]
1936
2060
  });
1937
2061
  }
1938
- function Bi(e, t) {
2062
+ function oa(e, t) {
1939
2063
  let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
1940
- r && H(r, {});
2064
+ r && U(r, {});
1941
2065
  }
1942
- function Vi(e) {
1943
- return e.label ?? q(e.command);
2066
+ function sa(e) {
2067
+ return e.label ?? J(e.command);
1944
2068
  }
1945
- function Hi(e, t, n) {
1946
- return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || ti(e, n) !== void 0;
2069
+ function ca(e, t, n) {
2070
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || xi(e, n) !== void 0;
1947
2071
  }
1948
- function Ui(e, t, n, r) {
2072
+ function la(e, t, n, r) {
1949
2073
  let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
1950
2074
  name: e.name,
1951
2075
  label: e.name
1952
- })), o = new Set(t.filter((e) => Hi(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));
2076
+ })), o = new Set(t.filter((e) => ca(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));
1953
2077
  return [...s, ...l.map((e) => ({
1954
2078
  name: e.name,
1955
- label: q(e.name)
2079
+ label: J(e.name)
1956
2080
  }))];
1957
2081
  }
1958
- function Wi(e, t, n, r) {
1959
- let i = Ui(e, J(t), n, r);
2082
+ function ua(e, t, n, r) {
2083
+ let i = la(e, Y(t), n, r);
1960
2084
  return {
1961
2085
  id: `confirm-${e.command}`,
1962
- componentName: Ni,
2086
+ componentName: $i,
1963
2087
  properties: {
1964
2088
  command: e.command,
1965
- label: Vi(e),
2089
+ label: sa(e),
1966
2090
  submitLabel: "Confirm",
1967
2091
  typeName: e.typeName,
1968
2092
  route: e.route,
1969
2093
  navigateToScreen: e.navigateToScreen,
1970
2094
  schema: t || void 0,
1971
- generationMode: i.length === 0 ? m.Manual : e.form?.generationMode,
2095
+ generationMode: i.length === 0 ? v.Manual : e.form?.generationMode,
1972
2096
  layout: e.form?.layout,
1973
2097
  populateSource: e.form?.populateSource,
1974
2098
  fields: i
@@ -1976,13 +2100,13 @@ function Wi(e, t, n, r) {
1976
2100
  slots: {}
1977
2101
  };
1978
2102
  }
1979
- function Gi(e) {
2103
+ function da(e) {
1980
2104
  return typeof e == "object" && !!e && !Array.isArray(e);
1981
2105
  }
1982
- function Ki(e, t) {
2106
+ function fa(e, t) {
1983
2107
  if (!Array.isArray(e) || !Array.isArray(t)) return;
1984
- let n = new Map(e.filter(Gi).map((e) => [JSON.stringify(e.id), e.column]));
1985
- for (let e of t.filter(Gi)) {
2108
+ let n = new Map(e.filter(da).map((e) => [JSON.stringify(e.id), e.column]));
2109
+ for (let e of t.filter(da)) {
1986
2110
  let t = JSON.stringify(e.id);
1987
2111
  if (n.has(t) && n.get(t) !== e.column) return {
1988
2112
  item: {
@@ -1993,9 +2117,9 @@ function Ki(e, t) {
1993
2117
  };
1994
2118
  }
1995
2119
  }
1996
- function qi(e, t, n, r) {
2120
+ function pa(e, t, n, r) {
1997
2121
  if (!Array.isArray(e)) return;
1998
- let i = e.filter(Gi).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
2122
+ let i = e.filter(da).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
1999
2123
  if (i !== void 0) return {
2000
2124
  item: {
2001
2125
  ...i,
@@ -2005,81 +2129,81 @@ function qi(e, t, n, r) {
2005
2129
  previous: t.previous
2006
2130
  };
2007
2131
  }
2008
- function Ji(e, t) {
2132
+ function ma(e, t) {
2009
2133
  let n = ee({ dataContext: { item: e.item } });
2010
2134
  return (r) => r.path === "value" ? e.value : r.path === "previous" ? e.previous : r.path === "item" || r.path?.startsWith("item.") ? n(r) : t(r);
2011
2135
  }
2012
- function Yi(e, t) {
2013
- let n = xe(), i = U(), { element: a, rowsProperty: o, idField: s, valueField: d } = e, f = c(() => D(pe(a.id, a.behaviors), v.Change), [a.behaviors, a.id]), p = l(void 0), m = l(!1), [h, g] = u(0), _ = l({
2136
+ function ha(e, t) {
2137
+ let n = Ce(), r = W(), { element: i, rowsProperty: a, idField: o, valueField: c } = e, l = f(() => j(he(i.id, i.behaviors), S.Change), [i.behaviors, i.id]), u = p(void 0), d = p(!1), [h, g] = m(0), _ = p({
2014
2138
  scope: n,
2015
- data: i,
2016
- element: a,
2017
- bindings: f
2139
+ data: r,
2140
+ element: i,
2141
+ bindings: l
2018
2142
  });
2019
2143
  _.current = {
2020
2144
  scope: n,
2021
- data: i,
2022
- element: a,
2023
- bindings: f
2024
- };
2025
- let y = r((e, t) => {
2026
- let { scope: n, data: r, element: i, bindings: a } = _.current, c = Ki(e, t);
2027
- if (!n || a.length === 0 || c === void 0) return;
2028
- let l = qi(i.properties[o], c, s, d);
2029
- if (l === void 0) return;
2030
- let u = {
2145
+ data: r,
2146
+ element: i,
2147
+ bindings: l
2148
+ };
2149
+ let v = s((e, t) => {
2150
+ let { scope: n, data: r, element: i, bindings: s } = _.current, l = fa(e, t);
2151
+ if (!n || s.length === 0 || l === void 0) return;
2152
+ let u = pa(i.properties[a], l, o, c);
2153
+ if (u === void 0) return;
2154
+ let d = {
2031
2155
  ...n.context,
2032
- subject: () => l.item,
2033
- resolve: Ji(l, n.context.resolve)
2156
+ subject: () => u.item,
2157
+ resolve: ma(u, n.context.resolve)
2034
2158
  }, f = !1, p = !1;
2035
- Wt(a, {
2159
+ qt(s, {
2036
2160
  ...n.dispatcher,
2037
2161
  executeCommand: async (e, t) => {
2038
2162
  let r = await n.dispatcher.executeCommand(e, t);
2039
2163
  return r?.isSuccess ? f = !0 : p = !0, r;
2040
2164
  }
2041
- }, u).then((e) => {
2165
+ }, d).then((e) => {
2042
2166
  e.findings.length > 0 && n.onFindings?.(e.findings), r.refreshAfterCommand(), (!f || p) && g((e) => e + 1);
2043
2167
  });
2044
2168
  }, [
2169
+ a,
2045
2170
  o,
2046
- s,
2047
- d
2048
- ]), b = r(() => {
2049
- m.current = !0;
2050
- }, []), x = c(() => t === void 0 ? void 0 : {
2171
+ c
2172
+ ]), y = s(() => {
2173
+ d.current = !0;
2174
+ }, []), b = f(() => t === void 0 ? void 0 : {
2051
2175
  ...t,
2052
2176
  setOutput: (e, n) => {
2053
2177
  if (t.setOutput(e, n), e !== "value") return;
2054
- let r = p.current;
2055
- p.current = n, m.current && (m.current = !1, y(r, n));
2178
+ let r = u.current;
2179
+ u.current = n, d.current && (d.current = !1, v(r, n));
2056
2180
  }
2057
- }, [t, y]);
2181
+ }, [t, v]);
2058
2182
  return {
2059
- declared: f.length > 0,
2060
- onChange: b,
2061
- outputs: x,
2183
+ declared: l.length > 0,
2184
+ onChange: y,
2185
+ outputs: b,
2062
2186
  revision: h
2063
2187
  };
2064
2188
  }
2065
- function Xi(e) {
2066
- let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = Yi({
2189
+ function ga(e) {
2190
+ let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = ha({
2067
2191
  element: t,
2068
2192
  rowsProperty: "cards",
2069
2193
  idField: typeof t.properties.cardId == "string" ? t.properties.cardId : "id",
2070
2194
  valueField: n
2071
- }, e.bindingOutputs), i = De;
2072
- return r.declared ? /* @__PURE__ */ R(i, {
2195
+ }, e.bindingOutputs), i = ke;
2196
+ return r.declared ? /* @__PURE__ */ z(i, {
2073
2197
  ...e,
2074
2198
  interactions: {
2075
2199
  ...e.interactions,
2076
2200
  onChange: r.onChange
2077
2201
  },
2078
2202
  bindingOutputs: r.outputs
2079
- }, r.revision) : /* @__PURE__ */ R(i, { ...e });
2203
+ }, r.revision) : /* @__PURE__ */ z(i, { ...e });
2080
2204
  }
2081
- var Zi = me(Me, P.KanbanBoard), Qi = "Stage:commandForm";
2082
- function $i(e, t, n = {}) {
2205
+ var _a = ge(Pe, I.KanbanBoard), va = "Stage:commandForm";
2206
+ function ya(e, t, n = {}) {
2083
2207
  return {
2084
2208
  id: e,
2085
2209
  componentName: "",
@@ -2091,19 +2215,19 @@ function Q(e, t, n = "") {
2091
2215
  let r = e.properties[t];
2092
2216
  return typeof r == "string" ? r : n;
2093
2217
  }
2094
- function ea(e, t, n) {
2218
+ function ba(e, t, n) {
2095
2219
  let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
2096
- return typeof r == "string" && t?.includes(r) ? q(r) : ki(e) ?? String(e ?? "");
2220
+ return typeof r == "string" && t?.includes(r) ? J(r) : Yi(e) ?? String(e ?? "");
2097
2221
  }
2098
- function ta(e, t) {
2222
+ function xa(e, t) {
2099
2223
  let n = e.properties.queryArguments;
2100
- if (!sa(n)) return {
2224
+ if (!Da(n)) return {
2101
2225
  values: {},
2102
2226
  ready: !0
2103
2227
  };
2104
2228
  let r = {}, i = !0;
2105
2229
  for (let [e, a] of Object.entries(n)) {
2106
- let n = oa(a) ? t.resolveBinding(a) : a;
2230
+ let n = Ea(a) ? t.resolveBinding(a) : a;
2107
2231
  r[e] = n, (n == null || n === "") && (i = !1);
2108
2232
  }
2109
2233
  return {
@@ -2111,7 +2235,7 @@ function ta(e, t) {
2111
2235
  ready: i
2112
2236
  };
2113
2237
  }
2114
- function na(e, t) {
2238
+ function Sa(e, t) {
2115
2239
  let n = (e.slots.columns ?? []).map((e) => {
2116
2240
  let t = e.properties;
2117
2241
  return {
@@ -2126,36 +2250,36 @@ function na(e, t) {
2126
2250
  }));
2127
2251
  return n.length > 0 ? n : r;
2128
2252
  }
2129
- function ra(e, t) {
2253
+ function Ca(e, t) {
2130
2254
  return e[t] ?? e.id ?? e.key;
2131
2255
  }
2132
- function ia({ element: e, slots: t }) {
2133
- let n = U(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), o = c(() => ta(e, n), [n, e]), { rows: s, error: l, loading: u, awaitingCommand: d } = W({
2256
+ function wa({ element: e, slots: t }) {
2257
+ 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 = f(() => xa(e, n), [n, e]), { rows: o, error: s, loading: c, awaitingCommand: u } = G({
2134
2258
  scope: e.id,
2135
2259
  name: r,
2136
2260
  route: i || void 0,
2137
- arguments: o.values,
2138
- ready: o.ready
2139
- }), f = na(e, s), p = Q(e, "navigateOnRowClickToScreen"), m = Q(e, "navigateOnRowClickByParameter"), h = Q(e, "dataKey") || m || "id", g = n.selections[e.id], _ = m ? n.parameters[m] : void 0, v = Mi(e);
2140
- a(() => {
2261
+ arguments: a.values,
2262
+ ready: a.ready
2263
+ }), d = Sa(e, o), p = Q(e, "navigateOnRowClickToScreen"), m = Q(e, "navigateOnRowClickByParameter"), h = Q(e, "dataKey") || m || "id", g = n.selections[e.id], _ = m ? n.parameters[m] : void 0, v = Qi(e);
2264
+ l(() => {
2141
2265
  if (!g) return;
2142
- let t = ra(g, h), r = t === void 0 ? void 0 : s.find((e) => ra(e, h) === t);
2143
- r && r !== g ? n.selectRow(e.id, r) : !r && t !== void 0 && !u && n.clearSelection(e.id);
2266
+ let t = Ca(g, h), r = t === void 0 ? void 0 : o.find((e) => Ca(e, h) === t);
2267
+ r && r !== g ? n.selectRow(e.id, r) : !r && t !== void 0 && !c && n.clearSelection(e.id);
2144
2268
  }, [
2145
2269
  n,
2146
2270
  h,
2147
2271
  e.id,
2148
- u,
2149
- s,
2272
+ c,
2273
+ o,
2150
2274
  g
2151
- ]), a(() => {
2275
+ ]), l(() => {
2152
2276
  if (!m) return;
2153
2277
  if (_ === void 0) {
2154
2278
  g && n.clearSelection(e.id);
2155
2279
  return;
2156
2280
  }
2157
- if (g && String(ra(g, h)) === _) return;
2158
- let t = s.find((e) => String(ra(e, h)) === _);
2281
+ if (g && String(Ca(g, h)) === _) return;
2282
+ let t = o.find((e) => String(Ca(e, h)) === _);
2159
2283
  t && n.selectRow(e.id, t);
2160
2284
  }, [
2161
2285
  n,
@@ -2163,23 +2287,23 @@ function ia({ element: e, slots: t }) {
2163
2287
  e.id,
2164
2288
  _,
2165
2289
  m,
2166
- s,
2290
+ o,
2167
2291
  g
2168
2292
  ]);
2169
2293
  let y = (t) => {
2170
- let r = ra(t, h);
2294
+ let r = Ca(t, h);
2171
2295
  if (m && r != null) {
2172
2296
  let i = {
2173
2297
  ...p && p !== n.screen ? {} : n.parameters,
2174
2298
  [m]: String(r)
2175
2299
  };
2176
- p && p !== n.screen || n.selectRow(e.id, t), H(p || n.screen, i);
2300
+ p && p !== n.screen || n.selectRow(e.id, t), U(p || n.screen, i);
2177
2301
  } else n.selectRow(e.id, t);
2178
2302
  };
2179
- return !Q(e, "query") && !i && !Tt(r) ? /* @__PURE__ */ z("section", {
2303
+ return !Q(e, "query") && !i && !Ot(r) ? /* @__PURE__ */ B("section", {
2180
2304
  className: "stage-table",
2181
2305
  "data-scene-id": e.id,
2182
- children: [/* @__PURE__ */ z("p", {
2306
+ children: [/* @__PURE__ */ B("p", {
2183
2307
  className: "stage-note",
2184
2308
  children: [
2185
2309
  "No query is exposed for ",
@@ -2187,34 +2311,34 @@ function ia({ element: e, slots: t }) {
2187
2311
  " yet."
2188
2312
  ]
2189
2313
  }), t.columns]
2190
- }) : /* @__PURE__ */ z("section", {
2314
+ }) : /* @__PURE__ */ B("section", {
2191
2315
  className: "stage-table",
2192
2316
  "data-scene-id": e.id,
2193
2317
  children: [
2194
- (u || d) && /* @__PURE__ */ R(Qe, {
2318
+ (c || u) && /* @__PURE__ */ z(et, {
2195
2319
  severity: "info",
2196
2320
  text: "Loading…"
2197
2321
  }),
2198
- l && /* @__PURE__ */ R(Qe, {
2322
+ s && /* @__PURE__ */ z(et, {
2199
2323
  severity: "error",
2200
- text: l
2324
+ text: s
2201
2325
  }),
2202
- g && /* @__PURE__ */ R(B, {
2326
+ g && /* @__PURE__ */ z(V, {
2203
2327
  type: "button",
2204
2328
  size: "small",
2205
2329
  onClick: () => {
2206
2330
  if (n.clearSelection(e.id), !m || n.parameters[m] === void 0) return;
2207
2331
  let { [m]: t, ...r } = n.parameters;
2208
- H(n.screen, r);
2332
+ U(n.screen, r);
2209
2333
  },
2210
2334
  children: "Clear selection"
2211
2335
  }),
2212
- /* @__PURE__ */ z("table", {
2336
+ /* @__PURE__ */ B("table", {
2213
2337
  "aria-label": Q(e, "label", Q(e, "typeName", "Results")),
2214
- children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ R("tr", { children: f.map((e) => /* @__PURE__ */ R("th", {
2338
+ children: [/* @__PURE__ */ z("thead", { children: /* @__PURE__ */ z("tr", { children: d.map((e) => /* @__PURE__ */ z("th", {
2215
2339
  scope: "col",
2216
2340
  children: e.label
2217
- }, e.property)) }) }), /* @__PURE__ */ z("tbody", { children: [s.map((e, t) => /* @__PURE__ */ R("tr", {
2341
+ }, e.property)) }) }), /* @__PURE__ */ B("tbody", { children: [o.map((e, t) => /* @__PURE__ */ z("tr", {
2218
2342
  "aria-selected": g === e,
2219
2343
  tabIndex: 0,
2220
2344
  onClick: () => v.click(e, () => y(e)),
@@ -2222,83 +2346,83 @@ function ia({ element: e, slots: t }) {
2222
2346
  onKeyDown: (t) => {
2223
2347
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), y(e));
2224
2348
  },
2225
- children: f.map((t) => /* @__PURE__ */ R("td", { children: ea(e[t.property], t.options, t.optionValues) }, t.property))
2226
- }, String(ra(e, h) ?? t))), /* @__PURE__ */ R(aa, {
2227
- rowCount: s.length,
2228
- columnCount: f.length,
2229
- loading: u,
2230
- awaitingCommand: d
2349
+ children: d.map((t) => /* @__PURE__ */ z("td", { children: ba(e[t.property], t.options, t.optionValues) }, t.property))
2350
+ }, String(Ca(e, h) ?? t))), /* @__PURE__ */ z(Ta, {
2351
+ rowCount: o.length,
2352
+ columnCount: d.length,
2353
+ loading: c,
2354
+ awaitingCommand: u
2231
2355
  })] })]
2232
2356
  })
2233
2357
  ]
2234
2358
  });
2235
2359
  }
2236
- function aa({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
2237
- return e !== 0 || n || r ? null : /* @__PURE__ */ R("tr", { children: /* @__PURE__ */ R("td", {
2360
+ function Ta({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
2361
+ return e !== 0 || n || r ? null : /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", {
2238
2362
  colSpan: Math.max(t, 1),
2239
2363
  children: "No records found"
2240
2364
  }) });
2241
2365
  }
2242
- function oa(e) {
2243
- return sa(e) && (typeof e.path == "string" || typeof e.kind == "string");
2366
+ function Ea(e) {
2367
+ return Da(e) && (typeof e.path == "string" || typeof e.kind == "string");
2244
2368
  }
2245
- function sa(e) {
2369
+ function Da(e) {
2246
2370
  return typeof e == "object" && !!e && !Array.isArray(e);
2247
2371
  }
2248
- function ca({ element: e, interactions: t, slots: n }) {
2249
- return $t(e) ? /* @__PURE__ */ R(en, {
2372
+ function Oa({ element: e, interactions: t, slots: n }) {
2373
+ return nn(e) ? /* @__PURE__ */ z(rn, {
2250
2374
  element: e,
2251
2375
  interactions: t
2252
- }) : /* @__PURE__ */ R(fa, {
2376
+ }) : /* @__PURE__ */ z(Ma, {
2253
2377
  element: e,
2254
2378
  interactions: t,
2255
2379
  slots: n
2256
2380
  });
2257
2381
  }
2258
- function la(e) {
2259
- let { routes: t, parameters: n } = U(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = c(() => J(r ?? ""), [r]), a = Qn(e), o = $n(e, r), { selectableRows: s, selectedRows: l } = Tr(), u = Q(e, "generationMode").toLowerCase() !== "manual", d = ua(e, a, o, u), f = u ? da(e, r, i, n, a, o ? [] : s) : {};
2382
+ function ka(e) {
2383
+ let { routes: t, parameters: n } = W(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = f(() => Y(r ?? ""), [r]), a = vr(e), o = yr(e, r), { selectableRows: s, selectedRows: c } = Gr(), l = Q(e, "generationMode").toLowerCase() !== "manual", u = Aa(e, a, o, l), d = l ? ja(e, r, i, n, a, o ? [] : s) : {};
2260
2384
  return {
2261
2385
  element: {
2262
2386
  ...e,
2263
2387
  properties: {
2264
2388
  ...e.properties,
2265
- ...f,
2389
+ ...d,
2266
2390
  ...r ? { schema: r } : {},
2267
2391
  createsEntity: o,
2268
- rowAction: d
2392
+ rowAction: u
2269
2393
  }
2270
2394
  },
2271
2395
  subject: a,
2272
2396
  properties: i,
2273
- selectedRows: l
2397
+ selectedRows: c
2274
2398
  };
2275
2399
  }
2276
- function ua(e, t, n, r) {
2400
+ function Aa(e, t, n, r) {
2277
2401
  return n || t !== void 0 ? !1 : r || e.properties.rowAction === !0;
2278
2402
  }
2279
- function da(e, t, n, r, i, a) {
2403
+ function ja(e, t, n, r, i, a) {
2280
2404
  let o = e.properties.fields;
2281
- if (!Array.isArray(o) || o.length === 0) return Ca(t, n, r, i, a);
2405
+ if (!Array.isArray(o) || o.length === 0) return Wa(t, n, r, i, a);
2282
2406
  if (a.length === 0 || i === "screen" || i === void 0 && e.properties.rowAction !== !0 && n.filter((e) => e.identifier).length > 1) return {};
2283
- let s = new Set(n.filter((e) => xa(e, i, a)).map((e) => e.name));
2407
+ let s = new Set(n.filter((e) => Ha(e, i, a)).map((e) => e.name));
2284
2408
  return {
2285
- fields: o.filter((e) => !s.has(ha(e))),
2409
+ fields: o.filter((e) => !s.has(Fa(e))),
2286
2410
  generationMode: "manual"
2287
2411
  };
2288
2412
  }
2289
- function fa({ element: e, interactions: t }) {
2290
- let { element: n, subject: r, properties: i, selectedRows: a } = la(e), o = Q(n, "label") || q(Q(n, "command")), s = V(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = pa(n, r), l = er(r, a);
2291
- return s ? c.length > 0 || tr(r, l) ? /* @__PURE__ */ R(B, {
2413
+ function Ma({ element: e, interactions: t }) {
2414
+ let { element: n, subject: r, properties: i, selectedRows: a } = ka(e), o = Q(n, "label") || J(Q(n, "command")), s = H(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = Na(n, r), l = br(r, a);
2415
+ return s ? c.length > 0 || xr(r, l) ? /* @__PURE__ */ z(V, {
2292
2416
  type: "button",
2293
2417
  "data-scene-id": n.id,
2294
2418
  disabled: !0,
2295
2419
  title: "Select a row first",
2296
2420
  ...t,
2297
2421
  children: o
2298
- }) : /* @__PURE__ */ R(_a, {
2299
- element: l ? ar(n, i, l) : n,
2422
+ }) : /* @__PURE__ */ z(La, {
2423
+ element: l ? Tr(n, i, l) : n,
2300
2424
  label: o
2301
- }) : /* @__PURE__ */ R(B, {
2425
+ }) : /* @__PURE__ */ z(V, {
2302
2426
  type: "button",
2303
2427
  "data-scene-id": n.id,
2304
2428
  disabled: !0,
@@ -2307,91 +2431,98 @@ function fa({ element: e, interactions: t }) {
2307
2431
  children: o
2308
2432
  });
2309
2433
  }
2310
- function pa(e, t) {
2311
- let { parameters: n } = U(), r = Q(e, "schema"), i = e.properties.fields, a = c(() => J(r), [r]), { selectableRows: o, selectedRows: s } = Tr(), l = Array.isArray(i) ? i : [], u = ma(e, l) ? new Set(l.map(ha).filter((e) => e !== "")) : void 0;
2312
- return !u || t !== void 0 || $n(e, r) ? [] : si(a.filter((e) => !u.has(e.name)), n, s, o);
2434
+ function Na(e, t) {
2435
+ let { parameters: n } = W(), r = Q(e, "schema"), i = e.properties.fields, a = f(() => Y(r), [r]), { selectableRows: o, selectedRows: s } = Gr(), c = Array.isArray(i) ? i : [], l = Pa(e, c) ? new Set(c.map(Fa).filter((e) => e !== "")) : void 0;
2436
+ return !l || t !== void 0 || yr(e, r) ? [] : Di(a.filter((e) => !l.has(e.name)), n, s, o);
2313
2437
  }
2314
- function ma(e, t) {
2438
+ function Pa(e, t) {
2315
2439
  return t.length > 0 || e.properties.rowAction === !0 || Q(e, "generationMode").toLowerCase() === "manual";
2316
2440
  }
2317
- function ha(e) {
2318
- return sa(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2441
+ function Fa(e) {
2442
+ return Da(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2319
2443
  }
2320
- function ga(e) {
2444
+ function Ia(e) {
2321
2445
  let t = (e?.parentElement?.classList.contains("stage-toolbar-action") ? e.parentElement : e)?.previousElementSibling;
2322
2446
  return t?.classList.contains("stage-action") === !0 || t?.classList.contains("stage-toolbar-action") === !0;
2323
2447
  }
2324
- function _a({ element: e, label: t }) {
2325
- let [n, i] = u(0), [a, o] = u(!1), [c, d] = u(!1), f = l(null);
2326
- s(() => d(ga(f.current)));
2327
- let p = r(() => {
2328
- o(!1), i((e) => e + 1);
2329
- }, []), m = /* @__PURE__ */ R(Pr.Provider, {
2330
- value: p,
2331
- children: /* @__PURE__ */ R(Rr, {
2448
+ function La({ element: e, label: t }) {
2449
+ let [n, r] = m(0), [i, a] = m(!1), [o, c] = m(!1), l = p(null);
2450
+ d(() => c(Ia(l.current)));
2451
+ let u = s(() => {
2452
+ a(!1), r((e) => e + 1);
2453
+ }, []), f = /* @__PURE__ */ z(ei.Provider, {
2454
+ value: u,
2455
+ children: /* @__PURE__ */ z(ii, {
2332
2456
  element: e,
2333
2457
  cancellable: !0
2334
2458
  }, n)
2335
2459
  });
2336
- return /* @__PURE__ */ z("div", {
2460
+ return /* @__PURE__ */ B("div", {
2337
2461
  className: "stage-action",
2338
2462
  "data-scene-id": e.id,
2339
- ref: f,
2340
- children: [/* @__PURE__ */ R(B, {
2463
+ ref: l,
2464
+ children: [/* @__PURE__ */ z(V, {
2341
2465
  type: "button",
2342
- variant: Rn(Q(e, "emphasis"), c),
2343
- onClick: () => o(!0),
2466
+ variant: rr(Q(e, "emphasis"), o),
2467
+ onClick: () => a(!0),
2344
2468
  children: t
2345
- }), /* @__PURE__ */ R(Ze, {
2469
+ }), /* @__PURE__ */ z($e, {
2346
2470
  title: t,
2347
- visible: a,
2348
- onClose: () => o(!1),
2471
+ visible: i,
2472
+ onClose: () => a(!1),
2349
2473
  buttons: null,
2350
2474
  dismissable: !0,
2351
2475
  dismissOnOutsideClick: !1,
2352
- children: m
2476
+ children: f
2353
2477
  })]
2354
2478
  });
2355
2479
  }
2356
- function va(e) {
2357
- let t = e.element ?? $i("slice-dialog", {}), n = Se(), { routes: i, parameters: a } = U(), o = be(n?.currentDialogParameters), s = Q(t, "command") || o?.command || Q(t, "slice") || "", l = Q(t, "title") || o?.title || q(s), d = i?.commandSchemas?.[s], f = c(() => J(d ?? ""), [d]), { selectableRows: p, selectedRows: m } = Tr(), h = r(() => n?.closeDialog(), [n]), [g, _] = u(null), v = (e) => e.identifier && e.required && ni(e, p) && ti(e, m) !== void 0;
2358
- if (!d || !(f.some((e) => e.options || e.members || e.item) || f.some(v))) return e.element ? /* @__PURE__ */ R(oe, {
2480
+ function Ra(e) {
2481
+ let t = e.element ?? ya("slice-dialog", {}), n = we(), r = Se(n?.currentDialogParameters);
2482
+ return /* @__PURE__ */ z(Qn, {
2483
+ slice: Q(t, "slice") || r?.slice || Q(t, "command") || r?.command,
2484
+ children: /* @__PURE__ */ z(za, { ...e })
2485
+ });
2486
+ }
2487
+ function za(e) {
2488
+ let t = e.element ?? ya("slice-dialog", {}), n = we(), { routes: r, parameters: i } = W(), a = Se(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 } = Gr(), h = s(() => n?.closeDialog(), [n]), [g, _] = m(null), v = (e) => e.identifier && e.required && Si(e, d) && xi(e, p) !== void 0;
2489
+ if (!l || !(u.some((e) => e.options || e.members || e.item) || u.some(v))) return e.element ? /* @__PURE__ */ z(se, {
2359
2490
  element: e.element,
2360
2491
  slots: e.slots ?? {}
2361
- }) : /* @__PURE__ */ R(de, {});
2362
- let y = f.filter((e) => !$r(e, a) && !v(e)), b = $i(`slice-dialog-${s}`, {
2363
- command: s,
2364
- label: l,
2365
- schema: d,
2492
+ }) : /* @__PURE__ */ z(pe, {});
2493
+ let y = u.filter((e) => !yi(e, i) && !v(e)), b = ya(`slice-dialog-${o}`, {
2494
+ command: o,
2495
+ label: c,
2496
+ schema: l,
2366
2497
  fields: y.map((e) => ({
2367
2498
  name: e.name,
2368
- label: q(e.name)
2499
+ label: J(e.name)
2369
2500
  })),
2370
2501
  generationMode: "manual"
2371
2502
  });
2372
- return /* @__PURE__ */ z("section", {
2503
+ return /* @__PURE__ */ B("section", {
2373
2504
  className: "scene-slice-dialog",
2374
- "data-scene-slice-dialog": Q(t, "slice") || o?.slice,
2375
- "data-scene-command": s,
2505
+ "data-scene-slice-dialog": Q(t, "slice") || a?.slice,
2506
+ "data-scene-command": o,
2376
2507
  children: [
2377
- /* @__PURE__ */ R("header", {
2508
+ /* @__PURE__ */ z("header", {
2378
2509
  className: "scene-slice-dialog-header",
2379
- children: /* @__PURE__ */ R("h2", {
2510
+ children: /* @__PURE__ */ z("h2", {
2380
2511
  className: "scene-slice-dialog-title",
2381
- children: l
2512
+ children: c
2382
2513
  })
2383
2514
  }),
2384
- /* @__PURE__ */ R(Pr.Provider, {
2515
+ /* @__PURE__ */ z(ei.Provider, {
2385
2516
  value: h,
2386
- children: /* @__PURE__ */ R(Fr.Provider, {
2517
+ children: /* @__PURE__ */ z(ti.Provider, {
2387
2518
  value: g,
2388
- children: /* @__PURE__ */ R(Rr, { element: b })
2519
+ children: /* @__PURE__ */ z(ii, { element: b })
2389
2520
  })
2390
2521
  }),
2391
- /* @__PURE__ */ R("footer", {
2522
+ /* @__PURE__ */ z("footer", {
2392
2523
  ref: _,
2393
2524
  className: "scene-slice-dialog-footer",
2394
- children: /* @__PURE__ */ R("button", {
2525
+ children: /* @__PURE__ */ z("button", {
2395
2526
  type: "button",
2396
2527
  className: "scene-slice-dialog-cancel",
2397
2528
  onClick: h,
@@ -2401,32 +2532,32 @@ function va(e) {
2401
2532
  ]
2402
2533
  });
2403
2534
  }
2404
- function ya(e) {
2535
+ function Ba(e) {
2405
2536
  let { element: t } = e;
2406
- return Q(t, "slice") === "" ? Q(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ R(Sa, { ...e }) : /* @__PURE__ */ R(j, { ...e }) : /* @__PURE__ */ R(ba, { ...e });
2537
+ return Q(t, "slice") === "" ? Q(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ z(Ua, { ...e }) : /* @__PURE__ */ z(P, { ...e }) : /* @__PURE__ */ z(Va, { ...e });
2407
2538
  }
2408
- function ba(e) {
2409
- let { element: t } = e, { routes: n, parameters: r } = U(), i = Q(t, "slice"), a = Q(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], s = c(() => J(o ?? ""), [o]), { selectableRows: l, selectedRows: u } = Tr();
2410
- if ((Bn(o ?? "") ? [] : si(s, r, u, l)).length === 0) return /* @__PURE__ */ R(j, { ...e });
2411
- let d = Q(t, "label", Q(t, "name", t.id));
2412
- return /* @__PURE__ */ R("span", {
2539
+ function Va(e) {
2540
+ 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 } = Gr();
2541
+ if ((ar(o ?? "") ? [] : Di(s, r, l, c)).length === 0) return /* @__PURE__ */ z(P, { ...e });
2542
+ let u = Q(t, "label", Q(t, "name", t.id));
2543
+ return /* @__PURE__ */ z("span", {
2413
2544
  className: "stage-toolbar-action",
2414
2545
  "data-scene-toolbar-item": Q(t, "name", t.id),
2415
- children: /* @__PURE__ */ R(B, {
2546
+ children: /* @__PURE__ */ z(V, {
2416
2547
  type: "button",
2417
2548
  "data-scene-id": t.id,
2418
2549
  disabled: !0,
2419
2550
  title: "Select a row first",
2420
2551
  ...e.interactions,
2421
- children: d
2552
+ children: u
2422
2553
  })
2423
2554
  });
2424
2555
  }
2425
- function xa(e, t, n) {
2426
- return t !== "screen" && !!e.identifier && e.required && ni(e, n);
2556
+ function Ha(e, t, n) {
2557
+ return t !== "screen" && !!e.identifier && e.required && Si(e, n);
2427
2558
  }
2428
- function Sa(e) {
2429
- let { element: t } = e, { routes: n, parameters: r } = U(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), s = n?.commandSchemas?.[a], l = c(() => J(s ?? ""), [s]), u = Qn(t), d = c(() => u === void 0 && Bn(s ?? ""), [s, u]), { selectableRows: f, selectedRows: p } = Tr(), m = d ? [] : f, h = u === void 0 && !d ? si(l, r, p, m) : [], g = Ca(s, l, r, u, m), _ = d ? { createsEntity: !0 } : rr(t, u), v = {
2559
+ function Ua(e) {
2560
+ 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 = vr(t), u = f(() => l === void 0 && ar(s ?? ""), [s, l]), { selectableRows: d, selectedRows: p } = Gr(), m = u ? [] : d, h = l === void 0 && !u ? Di(c, r, p, m) : [], g = Wa(s, c, r, l, m), _ = u ? { createsEntity: !0 } : Cr(t, l), v = {
2430
2561
  ...t,
2431
2562
  componentName: "core:action",
2432
2563
  properties: {
@@ -2437,72 +2568,72 @@ function Sa(e) {
2437
2568
  ..._
2438
2569
  }
2439
2570
  };
2440
- return /* @__PURE__ */ R("span", {
2571
+ return /* @__PURE__ */ z("span", {
2441
2572
  className: "stage-toolbar-action",
2442
2573
  "data-scene-toolbar-item": i,
2443
- children: h.length > 0 ? /* @__PURE__ */ R(B, {
2574
+ children: h.length > 0 ? /* @__PURE__ */ z(V, {
2444
2575
  type: "button",
2445
2576
  "data-scene-id": t.id,
2446
2577
  disabled: !0,
2447
2578
  title: "Select a row first",
2448
2579
  ...e.interactions,
2449
2580
  children: o
2450
- }) : /* @__PURE__ */ R(ca, {
2581
+ }) : /* @__PURE__ */ z(Oa, {
2451
2582
  element: v,
2452
2583
  interactions: e.interactions,
2453
2584
  slots: e.slots
2454
2585
  })
2455
2586
  });
2456
2587
  }
2457
- function Ca(e, t, n, r, i) {
2588
+ function Wa(e, t, n, r, i) {
2458
2589
  return e ? {
2459
2590
  schema: e,
2460
- fields: t.filter((e) => !$r(e, n) && !xa(e, r, i)).map((e) => ({
2591
+ fields: t.filter((e) => !yi(e, n) && !Ha(e, r, i)).map((e) => ({
2461
2592
  name: e.name,
2462
- label: q(e.name)
2593
+ label: J(e.name)
2463
2594
  })),
2464
2595
  generationMode: "manual"
2465
2596
  } : {};
2466
2597
  }
2467
- var wa = {
2468
- ...he,
2469
- "core:table": ia,
2470
- "core:action": ca,
2471
- "core:guarded-action": en,
2472
- "core:toolbarItem": ya,
2473
- "core:sliceDialog": va,
2474
- [Qi]: Rr,
2475
- [Ni]: zi,
2476
- [Zi]: Xi
2598
+ var Ga = {
2599
+ ..._e,
2600
+ "core:table": wa,
2601
+ "core:action": Oa,
2602
+ "core:guarded-action": rn,
2603
+ "core:toolbarItem": Ba,
2604
+ "core:sliceDialog": Ra,
2605
+ [va]: ii,
2606
+ [$i]: aa,
2607
+ [_a]: ga
2477
2608
  };
2478
2609
  // src/useStrings.ts
2479
- function Ta() {
2480
- let e = ht(), [t, n] = u([]), [r, i] = u(""), [o, s] = u({});
2481
- return a(() => {
2610
+ function Ka() {
2611
+ let e = vt(), [t, n] = m([]), [r, i] = m(""), [a, o] = m({});
2612
+ return l(() => {
2482
2613
  let t = new AbortController();
2483
2614
  return e.locales(t.signal).then((e) => {
2484
2615
  t.signal.aborted || (n(e), i((t) => t || e[0] || ""));
2485
2616
  }).catch(() => {}), () => t.abort();
2486
- }, [e]), a(() => {
2617
+ }, [e]), l(() => {
2487
2618
  if (!r) return;
2488
2619
  let t = new AbortController();
2489
2620
  return e.strings(r, t.signal).then((e) => {
2490
- t.signal.aborted || s(e);
2621
+ t.signal.aborted || o(e);
2491
2622
  }).catch(() => {
2492
- t.signal.aborted || s({});
2623
+ t.signal.aborted || o({});
2493
2624
  }), () => t.abort();
2494
2625
  }, [r, e]), {
2495
2626
  locales: t,
2496
2627
  locale: r,
2497
2628
  setLocale: i,
2498
- dictionary: o
2629
+ dictionary: a
2499
2630
  };
2500
2631
  }
2501
- var Ea = /* @__PURE__ */ new Set(["core:table"]);
2502
- function Da(e) {
2503
- return Oa(e, /* @__PURE__ */ new Map(), void 0);
2632
+ var qa = /* @__PURE__ */ new Set(["core:table"]);
2633
+ function Ja(e) {
2634
+ return Ya(e, /* @__PURE__ */ new Map(), void 0);
2504
2635
  }
2505
- function Oa(e, t, n) {
2636
+ function Ya(e, t, n) {
2506
2637
  let r = e;
2507
2638
  if (!r.slots) return e;
2508
2639
  let i = !1, a = {};
@@ -2511,7 +2642,7 @@ function Oa(e, t, n) {
2511
2642
  a[e] = o.map((e) => {
2512
2643
  let t = e, n = $(t, "typeName");
2513
2644
  t.componentName === "core:data" && n && (r.set(n, t), s = t);
2514
- let a = Oa(Aa(ka(t, r), s), r, s);
2645
+ let a = Ya(Za(Xa(t, r), s), r, s);
2515
2646
  return a !== e && (i = !0), a;
2516
2647
  });
2517
2648
  }
@@ -2520,8 +2651,8 @@ function Oa(e, t, n) {
2520
2651
  slots: a
2521
2652
  } : e;
2522
2653
  }
2523
- function ka(e, t) {
2524
- if (!Ea.has(e.componentName)) return e;
2654
+ function Xa(e, t) {
2655
+ if (!qa.has(e.componentName)) return e;
2525
2656
  let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
2526
2657
  if (!r || e.properties.queryArguments !== void 0) return e;
2527
2658
  let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
@@ -2530,7 +2661,7 @@ function ka(e, t) {
2530
2661
  properties: a
2531
2662
  };
2532
2663
  }
2533
- function Aa(e, t) {
2664
+ function Za(e, t) {
2534
2665
  if (!["core:guarded-action", "core:action"].includes(e.componentName) || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
2535
2666
  let n = { ...e.properties };
2536
2667
  if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
@@ -2548,7 +2679,7 @@ function $(e, t) {
2548
2679
  return typeof n == "string" && n.length > 0 ? n : void 0;
2549
2680
  }
2550
2681
  // src/stageQueryBindings.tsx
2551
- function ja(e) {
2682
+ function Qa(e) {
2552
2683
  let t = /* @__PURE__ */ new Set(), n = (e) => {
2553
2684
  if (Array.isArray(e)) {
2554
2685
  e.forEach(n);
@@ -2564,7 +2695,7 @@ function ja(e) {
2564
2695
  };
2565
2696
  return r(e), [...t];
2566
2697
  }
2567
- function Ma(e) {
2698
+ function $a(e) {
2568
2699
  let t = /* @__PURE__ */ new Map(), n = (e, t) => {
2569
2700
  let n = e.properties?.[t];
2570
2701
  return typeof n == "string" && n.length > 0 ? n : void 0;
@@ -2583,8 +2714,8 @@ function Ma(e) {
2583
2714
  };
2584
2715
  return r(e), [...t.values()];
2585
2716
  }
2586
- function Na({ source: e }) {
2587
- let { routes: t, routesReady: n, parameters: r, session: i } = U(), a = e.by ? r[e.by] || i[e.by] : void 0, o = c(() => e.by ? a ? { [e.by]: a } : {} : {
2717
+ function eo({ source: e }) {
2718
+ let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = e.by ? r[e.by] || i[e.by] : void 0, o = f(() => e.by ? a ? { [e.by]: a } : {} : {
2588
2719
  ...i,
2589
2720
  ...r
2590
2721
  }, [
@@ -2593,7 +2724,7 @@ function Na({ source: e }) {
2593
2724
  i,
2594
2725
  e.by
2595
2726
  ]);
2596
- return W({
2727
+ return G({
2597
2728
  scope: `data:${e.typeName}`,
2598
2729
  name: e.query,
2599
2730
  alias: e.typeName,
@@ -2603,12 +2734,12 @@ function Na({ source: e }) {
2603
2734
  list: !0
2604
2735
  }), null;
2605
2736
  }
2606
- function Pa({ name: e }) {
2607
- let { routes: t, routesReady: n, parameters: r, session: i } = U(), a = c(() => ({
2737
+ function to({ name: e }) {
2738
+ let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = f(() => ({
2608
2739
  ...i,
2609
2740
  ...r
2610
2741
  }), [r, i]);
2611
- return W({
2742
+ return G({
2612
2743
  scope: `binding:${e}`,
2613
2744
  name: e,
2614
2745
  route: t?.queries?.[e],
@@ -2617,59 +2748,59 @@ function Pa({ name: e }) {
2617
2748
  list: !0
2618
2749
  }), null;
2619
2750
  }
2620
- function Fa({ element: e }) {
2621
- let t = c(() => ja(e), [e]), n = c(() => Ma(e), [e]);
2622
- return /* @__PURE__ */ z(Xe, { children: [t.map((e) => /* @__PURE__ */ R(Pa, { name: e }, e)), n.map((e) => /* @__PURE__ */ R(Na, { source: e }, e.typeName))] });
2751
+ function no({ element: e }) {
2752
+ let t = f(() => Qa(e), [e]), n = f(() => $a(e), [e]);
2753
+ return /* @__PURE__ */ B(Qe, { children: [t.map((e) => /* @__PURE__ */ z(to, { name: e }, e)), n.map((e) => /* @__PURE__ */ z(eo, { source: e }, e.typeName))] });
2623
2754
  }
2624
2755
  // src/stageThemeChoice.ts
2625
- var Ia = "cratis.stage.theme";
2626
- function La() {
2756
+ var ro = "cratis.stage.theme";
2757
+ function io() {
2627
2758
  try {
2628
2759
  return globalThis.localStorage ?? null;
2629
2760
  } catch {
2630
2761
  return null;
2631
2762
  }
2632
2763
  }
2633
- function Ra() {
2764
+ function ao() {
2634
2765
  try {
2635
- return La()?.getItem("cratis.stage.theme") || void 0;
2766
+ return io()?.getItem("cratis.stage.theme") || void 0;
2636
2767
  } catch {
2637
2768
  return;
2638
2769
  }
2639
2770
  }
2640
- function za(e) {
2771
+ function oo(e) {
2641
2772
  try {
2642
- La()?.setItem(Ia, e);
2773
+ io()?.setItem(ro, e);
2643
2774
  } catch {}
2644
2775
  }
2645
2776
  // src/screenTitle.ts
2646
- var Ba = "core:title", Va = ["content", "main"];
2647
- function Ha(e) {
2777
+ var so = "core:title", co = ["content", "main"];
2778
+ function lo(e) {
2648
2779
  let t = e;
2649
- if (t.componentName !== Ba) return;
2780
+ if (t.componentName !== so) return;
2650
2781
  let n = t.properties?.text;
2651
2782
  return typeof n == "string" && n.trim().length > 0 ? n : void 0;
2652
2783
  }
2653
- function Ua(e) {
2784
+ function uo(e) {
2654
2785
  for (let t of e ?? []) {
2655
- let e = Ha(t);
2786
+ let e = lo(t);
2656
2787
  if (e !== void 0) return e;
2657
2788
  }
2658
2789
  }
2659
- function Wa(e) {
2660
- let t = e.slotContent ?? {}, n = [...Va, ...Object.keys(t).filter((e) => !Va.includes(e))];
2790
+ function fo(e) {
2791
+ let t = e.slotContent ?? {}, n = [...co, ...Object.keys(t).filter((e) => !co.includes(e))];
2661
2792
  for (let e of n) {
2662
- let n = Ua(t[e]);
2793
+ let n = uo(t[e]);
2663
2794
  if (n !== void 0) return n;
2664
2795
  }
2665
- return Ln(e.name);
2796
+ return nr(e.name);
2666
2797
  }
2667
- function Ga(e) {
2798
+ function po(e) {
2668
2799
  let t = /* @__PURE__ */ new Set(), n = [];
2669
2800
  for (let r of e.flatMap((e) => e.contributions ?? [])) {
2670
- let e = qa(r);
2801
+ let e = ho(r);
2671
2802
  if (!e) continue;
2672
- let i = Ya(e);
2803
+ let i = _o(e);
2673
2804
  t.has(i) || (t.add(i), n.push(e));
2674
2805
  }
2675
2806
  return n.map((e, t) => ({
@@ -2677,47 +2808,47 @@ function Ga(e) {
2677
2808
  index: t
2678
2809
  })).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
2679
2810
  }
2680
- function Ka(e) {
2811
+ function mo(e) {
2681
2812
  let t = {
2682
2813
  label: "",
2683
2814
  children: []
2684
2815
  };
2685
2816
  for (let n of e) {
2686
- let e = n.hierarchy.reduce((e, t) => Xa(e, t, !1), t);
2687
- (n.group ? Xa(e, n.group, !0) : e).children.push(Za(n));
2817
+ let e = n.hierarchy.reduce((e, t) => vo(e, t, !1), t);
2818
+ (n.group ? vo(e, n.group, !0) : e).children.push(yo(n));
2688
2819
  }
2689
2820
  return t.children;
2690
2821
  }
2691
- function qa(e) {
2822
+ function ho(e) {
2692
2823
  if (e.contributionPointName !== "Navigation") return;
2693
2824
  let t = e.content?.properties ?? {}, n = t.label, r = t.targetScreen;
2694
2825
  if (typeof n != "string" || typeof r != "string") return;
2695
- let i = Ja(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
2826
+ let i = go(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
2696
2827
  return {
2697
2828
  label: n,
2698
2829
  targetScreen: r,
2699
2830
  hierarchy: i,
2700
2831
  order: a,
2701
- ...$a({
2702
- id: Qa(t.id),
2703
- group: Qa(t.group),
2704
- icon: Qa(t.icon),
2705
- presentation: Qa(t.presentation),
2706
- destination: to(o) && no(o) ? o : void 0
2832
+ ...xo({
2833
+ id: bo(t.id),
2834
+ group: bo(t.group),
2835
+ icon: bo(t.icon),
2836
+ presentation: bo(t.presentation),
2837
+ destination: Co(o) && wo(o) ? o : void 0
2707
2838
  })
2708
2839
  };
2709
2840
  }
2710
- function Ja(e) {
2841
+ function go(e) {
2711
2842
  return Array.isArray(e.hierarchy) ? e.hierarchy.filter((e) => typeof e == "string") : [];
2712
2843
  }
2713
- function Ya(e) {
2844
+ function _o(e) {
2714
2845
  return e.id === void 0 ? JSON.stringify([
2715
2846
  e.hierarchy,
2716
2847
  e.targetScreen,
2717
2848
  e.label
2718
2849
  ]) : JSON.stringify(["id", e.id]);
2719
2850
  }
2720
- function Xa(e, t, n) {
2851
+ function vo(e, t, n) {
2721
2852
  let r = e.children.find((e) => e.screen === void 0 && e.section === !0 === n && e.label === t);
2722
2853
  if (r) return r;
2723
2854
  let i = n ? {
@@ -2730,12 +2861,12 @@ function Xa(e, t, n) {
2730
2861
  };
2731
2862
  return e.children.push(i), i;
2732
2863
  }
2733
- function Za(e) {
2864
+ function yo(e) {
2734
2865
  return {
2735
2866
  label: e.label,
2736
- ...$a({ id: e.id || void 0 }),
2867
+ ...xo({ id: e.id || void 0 }),
2737
2868
  screen: e.targetScreen,
2738
- ...$a({
2869
+ ...xo({
2739
2870
  icon: e.icon || void 0,
2740
2871
  presentation: e.presentation || void 0,
2741
2872
  destination: e.destination
@@ -2743,82 +2874,82 @@ function Za(e) {
2743
2874
  children: []
2744
2875
  };
2745
2876
  }
2746
- function Qa(e) {
2877
+ function bo(e) {
2747
2878
  return typeof e == "string" ? e : void 0;
2748
2879
  }
2749
- function $a(e) {
2880
+ function xo(e) {
2750
2881
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
2751
2882
  }
2752
- function eo(e, t) {
2883
+ function So(e, t) {
2753
2884
  for (let n of e) {
2754
2885
  if (n.screen === t) return [n.label];
2755
- let e = eo(n.children, t);
2886
+ let e = So(n.children, t);
2756
2887
  if (e.length > 0) return n.section ? e : [n.label, ...e];
2757
2888
  }
2758
2889
  return [];
2759
2890
  }
2760
- function to(e) {
2891
+ function Co(e) {
2761
2892
  return typeof e == "object" && !!e && !Array.isArray(e);
2762
2893
  }
2763
- function no(e) {
2894
+ function wo(e) {
2764
2895
  return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
2765
2896
  }
2766
- function ro(e, t, n) {
2897
+ function To(e, t, n) {
2767
2898
  return e.filter((e) => !t.has(e.name)).map((e) => ({
2768
- label: Wa(e),
2899
+ label: fo(e),
2769
2900
  targetScreen: e.name,
2770
2901
  hierarchy: e.path && e.path.length > 0 ? [...e.path] : [n]
2771
2902
  }));
2772
2903
  }
2773
2904
  // src/blueprint.ts
2774
- var io = "Stage:locale", ao = "Stage:themeToggle", oo = "Cratis.Components", so = "PrimeReact", co = /* @__PURE__ */ new Map();
2775
- function lo(e) {
2776
- return ze(e).packages.includes(so);
2905
+ var Eo = "Stage:locale", Do = "Stage:themeToggle", Oo = "Stage:notes", ko = "Cratis.Components", Ao = "PrimeReact", jo = /* @__PURE__ */ new Map();
2906
+ function Mo(e) {
2907
+ return He(e).packages.includes(Ao);
2777
2908
  }
2778
- function uo(e, t) {
2779
- co.set(e, t);
2909
+ function No(e, t) {
2910
+ jo.set(e, t);
2780
2911
  }
2781
- function fo(e) {
2782
- let t = ze(e);
2912
+ function Po(e) {
2913
+ let t = He(e);
2783
2914
  return {
2784
2915
  ...t,
2785
2916
  name: e?.length ? t.name : "Stage",
2786
- packages: E(t.packages, {
2787
- baseline: oo,
2788
- catalog: { [Me]: b.Blueprint }
2917
+ packages: A(t.packages, {
2918
+ baseline: ko,
2919
+ catalog: { [Pe]: w.Blueprint }
2789
2920
  })
2790
2921
  };
2791
2922
  }
2792
- var po = {
2793
- ...ke,
2794
- [oo]: lt.components
2923
+ var Fo = {
2924
+ ...je,
2925
+ [ko]: ft.components
2795
2926
  };
2796
- function mo(e) {
2797
- let t = [...co.values()].reduce((e, t) => ({
2927
+ function Io(e) {
2928
+ let t = [...jo.values()].reduce((e, t) => ({
2798
2929
  ...e,
2799
2930
  ...t.components
2800
2931
  }), {});
2801
2932
  return {
2802
- ...he,
2803
- ...ct,
2933
+ ..._e,
2934
+ ...dt,
2804
2935
  ...t,
2805
- ...je,
2806
- ...Re,
2936
+ ...Ne,
2937
+ ...Ve,
2807
2938
  ...e
2808
2939
  };
2809
2940
  }
2810
- function ho(e) {
2811
- let t = Object.fromEntries([...co].map(([e, t]) => [e, t.declared]));
2941
+ function Lo(e) {
2942
+ let t = Object.fromEntries([...jo].map(([e, t]) => [e, t.declared]));
2812
2943
  return {
2813
2944
  ...e,
2814
- ...po,
2945
+ ...Fo,
2815
2946
  ...t
2816
2947
  };
2817
2948
  }
2818
- var go = "Stage:navigationTree";
2819
- function _o(e, t, n) {
2949
+ var Ro = "Stage:navigationTree";
2950
+ function zo(e, t, n) {
2820
2951
  let r = t?.title ?? "Cratis Stage";
2821
- return L(e, P.Logo, {
2952
+ return R(e, I.Logo, {
2822
2953
  label: r,
2823
2954
  initials: r.slice(0, 1).toUpperCase() || "S",
2824
2955
  targetScreen: n,
@@ -2827,42 +2958,42 @@ function _o(e, t, n) {
2827
2958
  ...t?.showName === void 0 ? {} : { showName: t.showName }
2828
2959
  });
2829
2960
  }
2830
- function vo(e, t, n) {
2961
+ function Bo(e, t, n) {
2831
2962
  let r = [];
2832
- return e.length > 1 && r.push(L("topbar-locale", io, {
2963
+ return e.length > 1 && r.push(R("topbar-locale", Eo, {
2833
2964
  locales: e,
2834
2965
  locale: t
2835
- })), n && r.push(L("topbar-theme", ao, {})), r;
2966
+ })), n && r.push(R("topbar-theme", Do, {})), r;
2836
2967
  }
2837
- function yo(e, t, n, r, i, a = {}) {
2838
- let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0 } = a, l = e[0]?.name ?? "", u = i?.title ?? "Cratis Stage", d = Ga(e), f = ro(e, new Set(d.map((e) => e.targetScreen)), "Other screens"), p = Ka([...d, ...d.length > 0 ? f : []]), m = e.map((e, n) => Le({
2839
- label: Wa(e),
2968
+ function Vo(e, t, n, r, i, a = {}) {
2969
+ let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0 } = a, l = e[0]?.name ?? "", u = i?.title ?? "Cratis Stage", d = po(e), f = To(e, new Set(d.map((e) => e.targetScreen)), "Other screens"), p = mo([...d, ...d.length > 0 ? f : []]), m = e.map((e, n) => Be({
2970
+ label: fo(e),
2840
2971
  targetScreen: e.name,
2841
2972
  icon: "pi pi-table",
2842
2973
  group: "Screens",
2843
2974
  order: n
2844
- }, t)), h = e.find((e) => e.name === t), g = h ? Wa(h) : Ln(t), _ = eo(Ka(d), t), v = e.find((e) => e.name === t)?.path?.length ? eo(p, t) : [], y = _.length > 0 ? _ : v, b = d.length > 0 ? L("menu-hierarchy", go, {
2975
+ }, t)), h = e.find((e) => e.name === t), g = h ? fo(h) : nr(t), _ = So(mo(d), t), v = e.find((e) => e.name === t)?.path?.length ? So(p, t) : [], y = _.length > 0 ? _ : v, b = d.length > 0 ? R("menu-hierarchy", Ro, {
2845
2976
  nodes: p,
2846
2977
  activeScreen: t
2847
- }) : L("menu-screens", P.Menu, {
2978
+ }) : R("menu-screens", I.Menu, {
2848
2979
  title: "Screens",
2849
2980
  label: "Screens"
2850
- }, { items: m }), x = vo(n, r, c), S = { regionNavigation: o };
2981
+ }, { items: m }), x = [R("topbar-notes", Oo, {}), ...Bo(n, r, c)], S = { regionNavigation: o };
2851
2982
  return {
2852
- [F.Topbar]: [L("topbar", P.Topbar, S, {
2853
- logo: [_o("topbar-logo", i, l)],
2983
+ [L.Topbar]: [R("topbar", I.Topbar, S, {
2984
+ logo: [zo("topbar-logo", i, l)],
2854
2985
  end: x
2855
2986
  })],
2856
- [F.Sidebar]: [L("sidebar", P.Sidebar, S, { logo: [_o("sidebar-logo", i, l)] })],
2857
- ...o ? {} : { [F.Menu]: [b] },
2858
- [F.Breadcrumb]: [L("breadcrumb", P.Breadcrumb, {
2987
+ [L.Sidebar]: [R("sidebar", I.Sidebar, S, { logo: [zo("sidebar-logo", i, l)] })],
2988
+ ...o ? {} : { [L.Menu]: [b] },
2989
+ [L.Breadcrumb]: [R("breadcrumb", I.Breadcrumb, {
2859
2990
  homeTargetScreen: l,
2860
2991
  items: (y.length > 0 ? y : [g]).map((e) => ({ label: e }))
2861
2992
  })],
2862
- ...s ? { [F.Footer]: [L("footer", P.Footer, { text: u })] } : {},
2863
- [F.ConfigPanel]: [L(P.ConfigPanel, P.ConfigPanel, {
2993
+ ...s ? { [L.Footer]: [R("footer", I.Footer, { text: u })] } : {},
2994
+ [L.ConfigPanel]: [R(I.ConfigPanel, I.ConfigPanel, {
2864
2995
  title: "Settings",
2865
- themes: I.map((e) => ({
2996
+ themes: Fe.map((e) => ({
2866
2997
  name: e.name,
2867
2998
  label: e.name,
2868
2999
  isDark: e.isDark ?? !1
@@ -2870,11 +3001,11 @@ function yo(e, t, n, r, i, a = {}) {
2870
3001
  })]
2871
3002
  };
2872
3003
  }
2873
- function bo(e) {
3004
+ function Ho(e) {
2874
3005
  return `#/${encodeURIComponent(e)}`;
2875
3006
  }
2876
3007
  // src/externalRouteHref.ts
2877
- function xo(e) {
3008
+ function Uo(e) {
2878
3009
  try {
2879
3010
  let t = new URL(e ?? "");
2880
3011
  return t.protocol === "http:" || t.protocol === "https:" ? e : void 0;
@@ -2883,48 +3014,52 @@ function xo(e) {
2883
3014
  }
2884
3015
  }
2885
3016
  // src/StageChrome.tsx
2886
- var So = t({
3017
+ var Wo = a({
2887
3018
  locales: [],
2888
3019
  locale: "",
2889
3020
  setLocale: () => void 0,
2890
3021
  activity: ""
2891
3022
  });
2892
- function Co({ state: e, children: t }) {
2893
- return /* @__PURE__ */ R(So.Provider, {
3023
+ function Go({ state: e, children: t }) {
3024
+ return /* @__PURE__ */ z(Wo.Provider, {
2894
3025
  value: e,
2895
3026
  children: t
2896
3027
  });
2897
3028
  }
2898
- var wo = "Stage:activity";
2899
- function To() {
2900
- let { locales: e, locale: t, setLocale: n } = i(So);
2901
- return e.length < 2 ? null : /* @__PURE__ */ R("select", {
3029
+ var Ko = "Stage:activity";
3030
+ function qo() {
3031
+ let { notesEnabled: e } = c(Wo);
3032
+ return e ? /* @__PURE__ */ z(r, { size: "small" }) : null;
3033
+ }
3034
+ function Jo() {
3035
+ let { locales: e, locale: t, setLocale: n } = c(Wo);
3036
+ return e.length < 2 ? null : /* @__PURE__ */ z("select", {
2902
3037
  className: "stage-locale",
2903
3038
  "aria-label": "Locale",
2904
3039
  value: t,
2905
3040
  onChange: (e) => n(e.target.value),
2906
- children: e.map((e) => /* @__PURE__ */ R("option", {
3041
+ children: e.map((e) => /* @__PURE__ */ z("option", {
2907
3042
  value: e,
2908
3043
  children: e
2909
3044
  }, e))
2910
3045
  });
2911
3046
  }
2912
- function Eo({ element: e }) {
2913
- let { config: t, setThemeName: n, setColorScheme: r } = Be(), i = I.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === N.Dark, a = I.find((e) => (e.isDark ?? !1) !== i);
3047
+ function Yo({ element: e }) {
3048
+ let { config: t, setThemeName: n, setColorScheme: r } = Ue(), i = Fe.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === F.Dark, a = Fe.find((e) => (e.isDark ?? !1) !== i);
2914
3049
  if (!a) return null;
2915
3050
  let o = i ? "Switch to a light theme" : "Switch to a dark theme";
2916
- return /* @__PURE__ */ R("div", {
3051
+ return /* @__PURE__ */ z("div", {
2917
3052
  className: "stage-theme-toggle",
2918
3053
  "data-scene-id": e.id,
2919
- children: /* @__PURE__ */ R("button", {
3054
+ children: /* @__PURE__ */ z("button", {
2920
3055
  type: "button",
2921
3056
  className: "stage-theme-toggle__button",
2922
3057
  "aria-label": o,
2923
3058
  title: o,
2924
3059
  onClick: () => {
2925
- za(a.name), n(a.name), r(a.isDark ? N.Dark : N.Light);
3060
+ oo(a.name), n(a.name), r(a.isDark ? F.Dark : F.Light);
2926
3061
  },
2927
- children: /* @__PURE__ */ R("svg", {
3062
+ children: /* @__PURE__ */ z("svg", {
2928
3063
  width: "18",
2929
3064
  height: "18",
2930
3065
  viewBox: "0 0 24 24",
@@ -2934,43 +3069,43 @@ function Eo({ element: e }) {
2934
3069
  strokeLinecap: "round",
2935
3070
  strokeLinejoin: "round",
2936
3071
  "aria-hidden": "true",
2937
- children: i ? /* @__PURE__ */ z(Xe, { children: [/* @__PURE__ */ R("circle", {
3072
+ children: i ? /* @__PURE__ */ B(Qe, { children: [/* @__PURE__ */ z("circle", {
2938
3073
  cx: "12",
2939
3074
  cy: "12",
2940
3075
  r: "4"
2941
- }), /* @__PURE__ */ R("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__ */ R("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
3076
+ }), /* @__PURE__ */ z("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__ */ z("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
2942
3077
  })
2943
3078
  })
2944
3079
  });
2945
3080
  }
2946
- function Do({ element: e }) {
3081
+ function Xo({ element: e }) {
2947
3082
  let t = e.properties ?? {};
2948
- return /* @__PURE__ */ R("nav", {
3083
+ return /* @__PURE__ */ z("nav", {
2949
3084
  className: "stage-navigation-tree",
2950
3085
  "aria-label": "Navigation",
2951
3086
  "data-scene-id": e.id,
2952
- children: /* @__PURE__ */ R(Oo, {
3087
+ children: /* @__PURE__ */ z(Zo, {
2953
3088
  nodes: t.nodes ?? [],
2954
3089
  activeScreen: t.activeScreen
2955
3090
  })
2956
3091
  });
2957
3092
  }
2958
- function Oo({ nodes: e, activeScreen: t }) {
2959
- return /* @__PURE__ */ R("ul", {
3093
+ function Zo({ nodes: e, activeScreen: t }) {
3094
+ return /* @__PURE__ */ z("ul", {
2960
3095
  role: "tree",
2961
- children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ z("li", {
3096
+ children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ B("li", {
2962
3097
  role: "treeitem",
2963
3098
  "aria-expanded": "true",
2964
- children: [/* @__PURE__ */ R("span", {
3099
+ children: [/* @__PURE__ */ z("span", {
2965
3100
  className: "stage-navigation-group",
2966
3101
  children: e.label
2967
- }), /* @__PURE__ */ R(Oo, {
3102
+ }), /* @__PURE__ */ z(Zo, {
2968
3103
  nodes: e.children,
2969
3104
  activeScreen: t
2970
3105
  })]
2971
- }, e.label) : /* @__PURE__ */ R("li", {
3106
+ }, e.label) : /* @__PURE__ */ z("li", {
2972
3107
  role: "treeitem",
2973
- children: /* @__PURE__ */ R(ko, {
3108
+ children: /* @__PURE__ */ z(Qo, {
2974
3109
  node: e,
2975
3110
  screen: e.screen,
2976
3111
  activeScreen: t
@@ -2978,61 +3113,64 @@ function Oo({ nodes: e, activeScreen: t }) {
2978
3113
  }, `${e.screen}:${e.label}`))
2979
3114
  });
2980
3115
  }
2981
- function ko({ node: e, screen: t, activeScreen: n }) {
2982
- let r = i(M), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external", c = o && r && !s && no(o) ? (e) => {
2983
- e.preventDefault(), r.navigate(o);
2984
- } : void 0, l = s ? xo(o.route) : bo(t), u = s && l === void 0;
2985
- return /* @__PURE__ */ z("a", {
3116
+ function Qo({ node: e, screen: t, activeScreen: n }) {
3117
+ let r = c(de), i = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", a = e.destination, o = a?.kind === "external", s = a && r && !o && wo(a) ? (e) => {
3118
+ e.preventDefault(), r.navigate(a);
3119
+ } : void 0, l = o ? Uo(a.route) : Ho(t), u = o && l === void 0;
3120
+ return /* @__PURE__ */ B("a", {
2986
3121
  href: l,
2987
- rel: s && !u ? "noreferrer" : void 0,
3122
+ rel: o && !u ? "noreferrer" : void 0,
2988
3123
  "aria-disabled": u ? "true" : void 0,
2989
3124
  "aria-current": t === n ? "page" : void 0,
2990
- "aria-label": a === "icon" ? e.label : void 0,
3125
+ "aria-label": i === "icon" ? e.label : void 0,
2991
3126
  "data-presentation": e.presentation,
2992
3127
  "data-icon": e.icon,
2993
- onClick: c,
2994
- children: [a !== "text" && e.icon && /* @__PURE__ */ R("span", {
3128
+ onClick: s,
3129
+ children: [i !== "text" && e.icon && /* @__PURE__ */ z("span", {
2995
3130
  className: "stage-navigation-icon",
2996
3131
  "aria-hidden": "true",
2997
3132
  "data-icon-name": e.icon
2998
- }), a !== "icon" && e.label]
3133
+ }), i !== "icon" && e.label]
2999
3134
  });
3000
3135
  }
3001
- function Ao({ element: e }) {
3002
- let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(M), r = we(), a = U(), o = n?.outlets[t], s = o && r ? r.screens[o] : void 0, c = e.properties.closable === !0;
3003
- return /* @__PURE__ */ z("div", {
3136
+ function $o({ element: e }) {
3137
+ let t = typeof e.properties.name == "string" ? e.properties.name : "", n = c(de), r = Ee(), i = W(), a = n?.outlets[t], o = a && r ? r.screens[a] : void 0, s = e.properties.closable === !0;
3138
+ return /* @__PURE__ */ B("div", {
3004
3139
  "data-scene-outlet": t,
3005
- "data-scene-outlet-screen": o,
3006
- children: [c && o && /* @__PURE__ */ R("div", {
3140
+ "data-scene-outlet-screen": a,
3141
+ children: [s && a && /* @__PURE__ */ z("div", {
3007
3142
  className: "scene-outlet-bar",
3008
- children: /* @__PURE__ */ R("button", {
3143
+ children: /* @__PURE__ */ z("button", {
3009
3144
  type: "button",
3010
3145
  className: "scene-outlet-close",
3011
3146
  "aria-label": "Close",
3012
3147
  onClick: () => n?.closeOutlet(t),
3013
3148
  children: "Close"
3014
3149
  })
3015
- }), s && r && /* @__PURE__ */ R(Cr, {
3016
- element: s,
3017
- children: /* @__PURE__ */ R(le, {
3018
- element: s,
3019
- registry: r.registry,
3020
- resolveBinding: a.resolveBinding
3150
+ }), o && r && /* @__PURE__ */ z(Zn, {
3151
+ screen: a,
3152
+ children: /* @__PURE__ */ z(Ur, {
3153
+ element: o,
3154
+ children: /* @__PURE__ */ z(ue, {
3155
+ element: o,
3156
+ registry: r.registry,
3157
+ resolveBinding: i.resolveBinding
3158
+ })
3021
3159
  })
3022
3160
  })]
3023
3161
  });
3024
3162
  }
3025
- function jo() {
3026
- let { activity: e } = i(So);
3027
- return e ? /* @__PURE__ */ R("p", {
3163
+ function es() {
3164
+ let { activity: e } = c(Wo);
3165
+ return e ? /* @__PURE__ */ z("p", {
3028
3166
  className: "stage-activity",
3029
3167
  role: "status",
3030
3168
  children: e
3031
3169
  }) : null;
3032
3170
  }
3033
- function Mo() {
3034
- let e = Te(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
3035
- return a(() => {
3171
+ function ts() {
3172
+ let e = De(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
3173
+ return l(() => {
3036
3174
  let r = e?.isDark ? "dark" : "light";
3037
3175
  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 ?? "";
3038
3176
  }, [
@@ -3041,39 +3179,40 @@ function Mo() {
3041
3179
  n
3042
3180
  ]), null;
3043
3181
  }
3044
- var No = {
3045
- [io]: To,
3046
- [ao]: Eo,
3047
- [go]: Do,
3048
- [wo]: jo,
3049
- "core:outlet": Ao
3182
+ var ns = {
3183
+ [Oo]: qo,
3184
+ [Eo]: Jo,
3185
+ [Do]: Yo,
3186
+ [Ro]: Xo,
3187
+ [Ko]: es,
3188
+ "core:outlet": $o
3050
3189
  };
3051
3190
  // src/stageResponseContracts.ts
3052
- function Po(e) {
3191
+ function rs(e) {
3053
3192
  return {
3054
3193
  commandResponse: (t) => e?.commands[t] ?? void 0,
3055
- targetType: (t, n) => Fo(e, t, n)
3194
+ targetType: (t, n) => is(e, t, n)
3056
3195
  };
3057
3196
  }
3058
- function Fo(e, t, n) {
3197
+ function is(e, t, n) {
3059
3198
  if (n.kind === "message") return { kind: "string" };
3060
- if (n.kind === "argument") return Io(e, t, n.name);
3199
+ if (n.kind === "argument") return as(e, t, n.name);
3061
3200
  }
3062
- function Io(e, t, n) {
3201
+ function as(e, t, n) {
3063
3202
  switch (t.kind) {
3064
- case _.ExecuteCommand: return e?.commandInputs[t.command]?.[n] ?? void 0;
3065
- case _.Navigate: return e?.screenInputs[t.screen]?.[n] ?? void 0;
3203
+ case x.ExecuteCommand: return e?.commandInputs[t.command]?.[n] ?? void 0;
3204
+ case x.Navigate: return e?.screenInputs[t.screen]?.[n] ?? void 0;
3066
3205
  default: return;
3067
3206
  }
3068
3207
  }
3069
3208
  // src/stageShell.ts
3070
- var Lo = [
3209
+ var os = [
3071
3210
  "navigationMode",
3072
3211
  "menuTheme",
3073
3212
  "showFooter",
3074
3213
  "showThemeSwitcher"
3075
- ], Ro = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3076
- function zo(e, t, n = !1) {
3214
+ ], ss = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3215
+ function cs(e, t, n = !1) {
3077
3216
  let r = [], i = {
3078
3217
  showFooter: !0,
3079
3218
  showThemeSwitcher: !0,
@@ -3081,54 +3220,54 @@ function zo(e, t, n = !1) {
3081
3220
  problems: r
3082
3221
  };
3083
3222
  for (let [e, n] of Object.entries(t.options ?? {})) {
3084
- let a = Bo(i, t.name, e, n);
3223
+ let a = ls(i, t.name, e, n);
3085
3224
  a && r.push(a);
3086
3225
  }
3087
- return Ho(i, e?.appearance, n), i;
3226
+ return ds(i, e?.appearance, n), i;
3088
3227
  }
3089
- function Bo(e, t, n, r) {
3090
- if (!Lo.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${Lo.join(", ")}.`;
3091
- if (n === "navigationMode") return Vo(n, r, Fe, (t) => {
3228
+ function ls(e, t, n, r) {
3229
+ if (!os.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${os.join(", ")}.`;
3230
+ if (n === "navigationMode") return us(n, r, Re, (t) => {
3092
3231
  e.mode = t;
3093
3232
  });
3094
- if (n === "menuTheme") return Vo(n, r, Ie, (t) => {
3233
+ if (n === "menuTheme") return us(n, r, ze, (t) => {
3095
3234
  e.menuTheme = t;
3096
3235
  });
3097
3236
  if (typeof r != "boolean") return `Option '${n}' is '${String(r)}'; expected true or false.`;
3098
3237
  n === "showFooter" ? e.showFooter = r : e.showThemeSwitcher = r;
3099
3238
  }
3100
- function Vo(e, t, n, r) {
3239
+ function us(e, t, n, r) {
3101
3240
  let i = n.find((e) => e === t);
3102
3241
  if (!i) return `Option '${e}' is '${String(t)}'; expected one of ${n.join(", ")}.`;
3103
3242
  r(i);
3104
3243
  }
3105
- function Ho(e, t, n) {
3244
+ function ds(e, t, n) {
3106
3245
  if (t?.colorScheme !== void 0) {
3107
- e.followsSystem = t.colorScheme === f.System;
3108
- let r = e.followsSystem ? n : t.colorScheme === f.Dark;
3109
- e.colorScheme = r ? N.Dark : N.Light, e.themeName = I.find((e) => (e.isDark ?? !1) === r)?.name, e.followsSystem || (e.showThemeSwitcher = !1);
3246
+ e.followsSystem = t.colorScheme === g.System;
3247
+ let r = e.followsSystem ? n : t.colorScheme === g.Dark;
3248
+ e.colorScheme = r ? F.Dark : F.Light, e.themeName = Fe.find((e) => (e.isDark ?? !1) === r)?.name, e.followsSystem || (e.showThemeSwitcher = !1);
3110
3249
  }
3111
- t?.accent !== void 0 && (Ro.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
3250
+ t?.accent !== void 0 && (ss.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
3112
3251
  }
3113
- function Uo(e) {
3252
+ function fs(e) {
3114
3253
  return {
3115
3254
  showFooter: e?.showFooter ?? !0,
3116
3255
  showThemeSwitcher: e?.showThemeSwitcher ?? !0
3117
3256
  };
3118
3257
  }
3119
- function Wo(e, t) {
3258
+ function ps(e, t) {
3120
3259
  if (e?.root === void 0) return [];
3121
3260
  let n = /* @__PURE__ */ new Set([
3122
- C.RootTemplateUnknown,
3123
- C.RootTemplateVersionNotSatisfied,
3124
- C.RootTemplateNotApplicable,
3125
- C.RootTemplateMissingContentSlot,
3126
- C.RootTemplateCycle,
3127
- C.RootTemplateBlueprintNotInstalled
3261
+ D.RootTemplateUnknown,
3262
+ D.RootTemplateVersionNotSatisfied,
3263
+ D.RootTemplateNotApplicable,
3264
+ D.RootTemplateMissingContentSlot,
3265
+ D.RootTemplateCycle,
3266
+ D.RootTemplateBlueprintNotInstalled
3128
3267
  ]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
3129
- return r.length === 0 && t.origin !== w.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;
3268
+ return r.length === 0 && t.origin !== O.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;
3130
3269
  }
3131
- function Go(e) {
3270
+ function ms(e) {
3132
3271
  let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
3133
3272
  0,
3134
3273
  2,
@@ -3136,7 +3275,7 @@ function Go(e) {
3136
3275
  ].map((e) => parseInt(t.slice(e, e + 2), 16));
3137
3276
  return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
3138
3277
  }
3139
- function Ko(e, t) {
3278
+ function hs(e, t) {
3140
3279
  if (t === void 0) return e;
3141
3280
  let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
3142
3281
  0,
@@ -3148,41 +3287,41 @@ function Ko(e, t) {
3148
3287
  tokens: {
3149
3288
  ...e.tokens,
3150
3289
  "primary.color": t,
3151
- "primary.contrastColor": Go(t),
3290
+ "primary.contrastColor": ms(t),
3152
3291
  "focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
3153
3292
  }
3154
3293
  }));
3155
3294
  }
3156
3295
  // src/StageShellSettings.tsx
3157
- var qo = "(prefers-color-scheme: dark)";
3158
- function Jo() {
3296
+ var gs = "(prefers-color-scheme: dark)";
3297
+ function _s() {
3159
3298
  return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
3160
3299
  }
3161
- function Yo({ settings: e, onSystemSchemeChange: t }) {
3162
- let n = l(Be());
3163
- n.current = Be();
3164
- let { mode: r, menuTheme: i, colorScheme: o, themeName: s } = e;
3165
- return a(() => {
3166
- let { setMode: e, setMenuTheme: t, setColorScheme: a, setThemeName: c } = n.current;
3300
+ function vs({ settings: e, onSystemSchemeChange: t }) {
3301
+ let n = p(Ue());
3302
+ n.current = Ue();
3303
+ let { mode: r, menuTheme: i, colorScheme: a, themeName: o } = e;
3304
+ return l(() => {
3305
+ let { setMode: e, setMenuTheme: t, setColorScheme: s, setThemeName: c } = n.current;
3167
3306
  r !== void 0 && e(r), i !== void 0 && t(i);
3168
- let l = I.find((e) => e.name === Ra());
3169
- l ? (c(l.name), a(l.isDark ? N.Dark : N.Light)) : (o !== void 0 && a(o), s !== void 0 && c(s));
3307
+ let l = Fe.find((e) => e.name === ao());
3308
+ l ? (c(l.name), s(l.isDark ? F.Dark : F.Light)) : (a !== void 0 && s(a), o !== void 0 && c(o));
3170
3309
  }, [
3171
3310
  r,
3172
3311
  i,
3173
- o,
3174
- s
3175
- ]), a(() => {
3312
+ a,
3313
+ o
3314
+ ]), l(() => {
3176
3315
  if (!e.followsSystem || !globalThis.matchMedia || !t) return;
3177
- let n = globalThis.matchMedia(qo), r = (e) => t(e.matches);
3316
+ let n = globalThis.matchMedia(gs), r = (e) => t(e.matches);
3178
3317
  return n.addEventListener("change", r), () => n.removeEventListener("change", r);
3179
3318
  }, [e.followsSystem, t]), null;
3180
3319
  }
3181
3320
  // src/stageNavigationModel.ts
3182
- function Xo(e) {
3321
+ function ys(e) {
3183
3322
  return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
3184
3323
  }
3185
- function Zo(e) {
3324
+ function bs(e) {
3186
3325
  let t = /* @__PURE__ */ new Map();
3187
3326
  for (let n of e) {
3188
3327
  let e = (n.path ?? []).join(".");
@@ -3195,41 +3334,41 @@ function Zo(e) {
3195
3334
  return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
3196
3335
  };
3197
3336
  }
3198
- function Qo(e) {
3337
+ function xs(e) {
3199
3338
  return (t) => e.find((e) => e.name === t)?.path?.[0];
3200
3339
  }
3201
- function $o(e, t, n) {
3340
+ function Ss(e, t, n) {
3202
3341
  let r = e.navigation ?? {
3203
3342
  application: { regions: [] },
3204
3343
  modules: []
3205
3344
  };
3206
3345
  return {
3207
3346
  structure: e.structure ?? { modules: [] },
3208
- navigation: n ? es(r, n) : r,
3209
- screenFor: Zo(e.screens),
3210
- moduleOf: Qo(e.screens),
3347
+ navigation: n ? Cs(r, n) : r,
3348
+ screenFor: bs(e.screens),
3349
+ moduleOf: xs(e.screens),
3211
3350
  ...t ? { isVisible: t } : {}
3212
3351
  };
3213
3352
  }
3214
- function es(e, t) {
3215
- return typeof e == "string" ? k(e, t) : Array.isArray(e) ? e.map((e) => es(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, es(n, t)])) : e;
3353
+ function Cs(e, t) {
3354
+ return typeof e == "string" ? re(e, t) : Array.isArray(e) ? e.map((e) => Cs(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Cs(n, t)])) : e;
3216
3355
  }
3217
3356
  // src/stageSlices.ts
3218
- function ts(e) {
3219
- return (t) => J(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
3357
+ function ws(e) {
3358
+ return (t) => Y(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
3220
3359
  name: e.name,
3221
3360
  type: e.type === "text" || e.type === void 0 ? "string" : e.type,
3222
- label: ns(e.name),
3361
+ label: Ts(e.name),
3223
3362
  required: e.required
3224
3363
  }));
3225
3364
  }
3226
- function ns(e) {
3365
+ function Ts(e) {
3227
3366
  return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
3228
3367
  }
3229
- function rs(e, t, n) {
3368
+ function Es(e, t, n) {
3230
3369
  return { invoke: async (r, i, a) => {
3231
3370
  let o = a ?? r.slice(r.lastIndexOf(".") + 1);
3232
- if (!V(o)) return {
3371
+ if (!H(o)) return {
3233
3372
  succeeded: !1,
3234
3373
  message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
3235
3374
  };
@@ -3246,7 +3385,7 @@ function rs(e, t, n) {
3246
3385
  } };
3247
3386
  }
3248
3387
  // src/withoutSeededSlots.ts
3249
- function is(e, t) {
3388
+ function Ds(e, t) {
3250
3389
  let n = /* @__PURE__ */ new Map();
3251
3390
  for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
3252
3391
  return e.map((e) => {
@@ -3263,7 +3402,7 @@ function is(e, t) {
3263
3402
  });
3264
3403
  }
3265
3404
  // src/stageIcons.ts
3266
- var as = /* @__PURE__ */ new Map([
3405
+ var Os = /* @__PURE__ */ new Map([
3267
3406
  ["chart", "chart-column"],
3268
3407
  ["add", "plus"],
3269
3408
  ["dollar", "dollar-sign"],
@@ -3271,23 +3410,23 @@ var as = /* @__PURE__ */ new Map([
3271
3410
  ["refresh", "refresh-cw"],
3272
3411
  ["invoice", "receipt-text"],
3273
3412
  ["batch", "layers"]
3274
- ]), os = (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(), ss = ye([{
3275
- library: x,
3413
+ ]), ks = (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(), As = xe([{
3414
+ library: T,
3276
3415
  loadGlyph: async ({ key: e }) => {
3277
- let t = os(e), n = as.get(t) ?? t;
3278
- if (Object.hasOwn(ut, n)) return (await ut[n]())?.default;
3416
+ let t = ks(e), n = Os.get(t) ?? t;
3417
+ if (Object.hasOwn(pt, n)) return (await pt[n]())?.default;
3279
3418
  }
3280
3419
  }]);
3281
3420
  // src/App.tsx
3282
- function cs(e = {}) {
3283
- return mo({
3421
+ function js(e = {}) {
3422
+ return Io({
3284
3423
  ...e,
3285
- ...wa,
3286
- ...No
3424
+ ...Ga,
3425
+ ...ns
3287
3426
  });
3288
3427
  }
3289
- function ls(e, t) {
3290
- return L(`form-${e}-${t.name}`, Qi, {
3428
+ function Ms(e, t) {
3429
+ return R(`form-${e}-${t.name}`, va, {
3291
3430
  command: t.forCommand,
3292
3431
  label: t.name,
3293
3432
  generationMode: t.generationMode,
@@ -3296,334 +3435,362 @@ function ls(e, t) {
3296
3435
  onSubmit: t.onSubmit
3297
3436
  });
3298
3437
  }
3299
- function us(e, t) {
3438
+ function Ns(e, t) {
3300
3439
  let n = e.screens[0];
3301
- return Ne(e, n, {
3302
- profile: fo(e.uiProfiles),
3303
- blueprintTemplates: t?.length ? [...Pe, ...t] : Pe
3440
+ return Ie(e, n, {
3441
+ profile: Po(e.uiProfiles),
3442
+ blueprintTemplates: t?.length ? [...Le, ...t] : Le
3304
3443
  });
3305
3444
  }
3306
- function ds(e, t) {
3445
+ function Ps(e, t) {
3307
3446
  return t ? e.map((e) => ({
3308
3447
  ...e,
3309
- slotContent: Object.fromEntries(Object.entries(e.slotContent ?? {}).map(([e, n]) => [e, n.map((e) => O(e, t))]))
3448
+ slotContent: Object.fromEntries(Object.entries(e.slotContent ?? {}).map(([e, n]) => [e, n.map((e) => ne(e, t))]))
3310
3449
  })) : e;
3311
3450
  }
3312
- function fs(e, t, n, r, i, a, o = !0, s = !0) {
3451
+ function Fs(e, t, n, r, i, a, o = !0, s = !0) {
3313
3452
  let c = {
3314
- regions: Xo(e.navigation),
3453
+ regions: ys(e.navigation),
3315
3454
  showFooter: o,
3316
3455
  showThemeSwitcher: s
3317
- }, l = ds(e.screens, i), u = ps(e);
3456
+ }, l = Ps(e.screens, i), u = Is(e);
3318
3457
  return {
3319
- profile: fo(e.uiProfiles),
3320
- catalog: ho(r),
3321
- blueprintTemplates: a?.length ? [...Pe, ...a] : Pe,
3458
+ profile: Po(e.uiProfiles),
3459
+ catalog: Lo(r),
3460
+ blueprintTemplates: a?.length ? [...Le, ...a] : Le,
3322
3461
  namedTemplateOnly: !0,
3323
- chrome: (e, r) => r === P.FullPageShell ? { [F.ConfigPanel]: yo(l, e.name, t, n, u, c)[F.ConfigPanel] } : yo(l, e.name, t, n, u, c),
3324
- form: ls,
3325
- trailing: [L("activity", wo)],
3462
+ chrome: (e, r) => r === I.FullPageShell ? { [L.ConfigPanel]: Vo(l, e.name, t, n, u, c)[L.ConfigPanel] } : Vo(l, e.name, t, n, u, c),
3463
+ form: Ms,
3464
+ trailing: [R("activity", Ko)],
3326
3465
  decorate: (e) => {
3327
- let t = Da(Nn(e));
3328
- return i ? O(t, i) : t;
3466
+ let t = Ja(In(e));
3467
+ return i ? ne(t, i) : t;
3329
3468
  }
3330
3469
  };
3331
3470
  }
3332
- function ps(e) {
3471
+ function Is(e) {
3333
3472
  let t = e.navigation?.application.logo;
3334
3473
  if (t) return {
3335
3474
  title: t.title,
3336
3475
  image: t.image || void 0
3337
3476
  };
3338
- let n = fo(e.uiProfiles).identity;
3477
+ let n = Po(e.uiProfiles).identity;
3339
3478
  if (!n?.name) return;
3340
3479
  let r = n.logo;
3341
3480
  return {
3342
3481
  title: n.name,
3343
- image: r?.kind === y.Image && r.image || void 0,
3344
- icon: r?.kind === y.Icon ? r.icon : void 0,
3482
+ image: r?.kind === C.Image && r.image || void 0,
3483
+ icon: r?.kind === C.Icon ? r.icon : void 0,
3345
3484
  showName: n.showName
3346
3485
  };
3347
3486
  }
3348
- function ms(e, t, n, r, i, a) {
3349
- let [o] = Fi([t], hs(e));
3350
- return Ae(e, o, fs(e, n, r, i, void 0, a)).element;
3487
+ function Ls(e, t, n, r, i, a) {
3488
+ let [o] = ta([t], Rs(e));
3489
+ return Me(e, o, Fs(e, n, r, i, void 0, a)).element;
3351
3490
  }
3352
- function hs(e) {
3491
+ function Rs(e) {
3353
3492
  return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
3354
3493
  }
3355
- function gs() {
3494
+ function zs() {
3356
3495
  try {
3357
3496
  return globalThis.localStorage ?? null;
3358
3497
  } catch {
3359
3498
  return null;
3360
3499
  }
3361
3500
  }
3362
- function _s({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: o = "hash" } = {}) {
3363
- let s = ht(), [l, d] = u(), [f, p] = u(""), m = c(() => cs(e), [e, l]), h = gt(), g = Ta();
3364
- return a(() => {
3501
+ function Bs({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: a = "hash" } = {}) {
3502
+ let o = vt(), [s, c] = m(), [u, d] = m(""), p = f(() => js(e), [e, s]), h = yt(), g = Ka();
3503
+ return l(() => {
3365
3504
  let e = new AbortController();
3366
- return s.scene(e.signal).then((e) => d(r?.length ? {
3505
+ return o.scene(e.signal).then((e) => c(r?.length ? {
3367
3506
  ...e,
3368
3507
  dialogTemplates: [...e.dialogTemplates ?? [], ...r.filter((t) => !e.dialogTemplates?.some((e) => e.name === t.name))]
3369
3508
  } : e)).catch((t) => {
3370
- e.signal.aborted || p(t instanceof Error ? t.message : String(t));
3509
+ e.signal.aborted || d(t instanceof Error ? t.message : String(t));
3371
3510
  }), () => e.abort();
3372
- }, [s, r]), f ? /* @__PURE__ */ z("main", {
3511
+ }, [o, r]), u ? /* @__PURE__ */ B("main", {
3373
3512
  className: "stage-message",
3374
- children: [/* @__PURE__ */ R("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ R("p", { children: f })]
3375
- }) : l ? /* @__PURE__ */ R(vs, {
3376
- scene: l,
3377
- registry: m,
3378
- routing: o,
3513
+ children: [/* @__PURE__ */ z("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ z("p", { children: u })]
3514
+ }) : s ? /* @__PURE__ */ z(Vs, {
3515
+ scene: s,
3516
+ registry: p,
3517
+ routing: a,
3379
3518
  routeState: h,
3380
3519
  strings: g,
3381
3520
  packageCatalog: t,
3382
3521
  screenTemplates: n,
3383
3522
  isVisible: i
3384
- }) : /* @__PURE__ */ R("main", {
3523
+ }) : /* @__PURE__ */ z("main", {
3385
3524
  className: "stage-message",
3386
- children: /* @__PURE__ */ R("h1", { children: "Preparing the Stage" })
3525
+ children: /* @__PURE__ */ z("h1", { children: "Preparing the Stage" })
3387
3526
  });
3388
3527
  }
3389
- function vs({ scene: e, registry: t, routing: n, routeState: i, strings: a, packageCatalog: o, screenTemplates: s, isVisible: l }) {
3390
- let d = c(() => {
3391
- if (Vt(n), n === "hash") return ve();
3528
+ function Vs({ scene: e, registry: t, routing: n, routeState: r, strings: a, packageCatalog: o, screenTemplates: c, isVisible: l }) {
3529
+ let u = f(() => {
3530
+ if (Wt(n), n === "hash") return be();
3392
3531
  let e = /^#\/(.+)$/.exec(globalThis.location.hash);
3393
- return e && globalThis.history.replaceState(null, "", `/${e[1]}`), _e(window, "/");
3394
- }, [n]), [f, p] = u(Jo), m = e.screens[0]?.name ?? "", h = c(() => fo(e.uiProfiles), [e]), g = c(() => m ? us(e, s) : void 0, [
3532
+ return e && globalThis.history.replaceState(null, "", `/${e[1]}`), ye(window, "/");
3533
+ }, [n]), [d, p] = m(_s), h = Hn(), g = e.screens[0]?.name ?? "", _ = f(() => Po(e.uiProfiles), [e]), v = f(() => g ? Ns(e, c) : void 0, [
3395
3534
  e,
3396
- s,
3397
- m
3398
- ]), _ = c(() => g ? Wo(h, g) : [], [h, g]), v = c(() => g ? zo(h, g, f) : void 0, [
3399
- h,
3400
- g,
3401
- f
3402
- ]), y = c(() => Ko(I, v?.accent), [v?.accent]), { showFooter: b, showThemeSwitcher: x } = Uo(v), S = c(() => fs(e, a.locales, a.locale, o, a.dictionary, s, b, x), [
3535
+ c,
3536
+ g
3537
+ ]), y = f(() => v ? ps(_, v) : [], [_, v]), b = f(() => v ? cs(_, v, d) : void 0, [
3538
+ _,
3539
+ v,
3540
+ d
3541
+ ]), x = f(() => hs(Fe, b?.accent), [b?.accent]), { showFooter: S, showThemeSwitcher: C } = fs(b), w = f(() => Fs(e, a.locales, a.locale, o, a.dictionary, c, S, C), [
3403
3542
  e,
3404
3543
  a.locales,
3405
3544
  a.locale,
3406
3545
  a.dictionary,
3407
3546
  o,
3408
- s,
3409
- b,
3410
- x
3411
- ]), C = r((e) => p(e), []), w = c(() => $o(e, l, a.dictionary), [
3547
+ c,
3548
+ S,
3549
+ C
3550
+ ]), T = s((e) => p(e), []), E = f(() => Ss(e, l, a.dictionary), [
3412
3551
  e,
3413
3552
  l,
3414
3553
  a.dictionary
3415
- ]), T = c(() => ({
3554
+ ]), D = f(() => ({
3416
3555
  ...e,
3417
- screens: Fi(is(e.screens, [
3556
+ screens: ta(Ds(e.screens, [
3418
3557
  ...e.screenTemplates,
3419
3558
  ...e.dialogTemplates ?? [],
3420
- ...Pe,
3421
- ...s ?? []
3422
- ]), hs(e))
3423
- }), [e, s]);
3424
- return m ? _.length > 0 ? /* @__PURE__ */ z("main", {
3559
+ ...Le,
3560
+ ...c ?? []
3561
+ ]), Rs(e))
3562
+ }), [e, c]);
3563
+ if (!g) return /* @__PURE__ */ B("main", {
3564
+ className: "stage-message",
3565
+ children: [/* @__PURE__ */ z("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ z("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
3566
+ });
3567
+ if (y.length > 0) return /* @__PURE__ */ B("main", {
3425
3568
  className: "stage-message",
3426
3569
  role: "alert",
3427
3570
  "data-stage-startup-problem": "root-template",
3428
3571
  children: [
3429
- /* @__PURE__ */ R("h1", { children: "Unable to start this Stage" }),
3430
- /* @__PURE__ */ R("p", { children: "The ui profile's root template cannot be the application's shell." }),
3431
- /* @__PURE__ */ R("ul", { children: _.map((e) => /* @__PURE__ */ R("li", { children: e }, e)) })
3572
+ /* @__PURE__ */ z("h1", { children: "Unable to start this Stage" }),
3573
+ /* @__PURE__ */ z("p", { children: "The ui profile's root template cannot be the application's shell." }),
3574
+ /* @__PURE__ */ z("ul", { children: y.map((e) => /* @__PURE__ */ z("li", { children: e }, e)) })
3432
3575
  ]
3433
- }) : /* @__PURE__ */ R(Ee, {
3434
- application: T,
3435
- composition: S,
3436
- navigationModel: w,
3576
+ });
3577
+ let O = /* @__PURE__ */ z(Oe, {
3578
+ application: D,
3579
+ composition: w,
3580
+ navigationModel: E,
3437
3581
  registry: t,
3438
- initialScreen: m,
3439
- history: d,
3440
- layoutConfigStorage: gs(),
3441
- scope: (t, n) => /* @__PURE__ */ R(ys, {
3582
+ initialScreen: g,
3583
+ history: u,
3584
+ layoutConfigStorage: zs(),
3585
+ scope: (t, n) => /* @__PURE__ */ z(Hs, {
3442
3586
  scene: e,
3443
- routeState: i,
3587
+ notes: h,
3588
+ routeState: r,
3444
3589
  strings: a,
3445
3590
  navigation: t,
3446
- themes: y,
3447
- shellSettings: v,
3448
- onSystemSchemeChange: C,
3591
+ themes: x,
3592
+ shellSettings: b,
3593
+ onSystemSchemeChange: T,
3449
3594
  children: n
3450
3595
  }),
3451
- renderScreen: (e, n) => /* @__PURE__ */ R(xs, {
3596
+ renderScreen: (e, n) => /* @__PURE__ */ z(Gs, {
3452
3597
  element: e,
3453
3598
  configuration: n,
3454
3599
  registry: t
3455
3600
  }),
3456
- renderDialog: () => /* @__PURE__ */ R(va, {}),
3457
- renderDialogTemplate: (e, n, r) => /* @__PURE__ */ R(Ss, {
3601
+ renderDialog: () => /* @__PURE__ */ z(Ra, {}),
3602
+ renderDialogTemplate: (e, n, r) => /* @__PURE__ */ z(Ks, {
3458
3603
  template: e,
3459
3604
  content: n,
3460
3605
  registry: t,
3461
3606
  strings: a,
3462
3607
  close: () => r.closeDialog()
3463
3608
  })
3464
- }) : /* @__PURE__ */ z("main", {
3465
- className: "stage-message",
3466
- children: [/* @__PURE__ */ R("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ R("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
3467
3609
  });
3468
- }
3469
- function ys({ scene: e, routeState: t, strings: n, navigation: r, themes: i, shellSettings: o, onSystemSchemeChange: s, children: c }) {
3470
- let [l, d] = u(""), { navigate: f } = r;
3471
- return a(() => d(""), [r.currentScreen, r.currentDialog]), a(() => {
3610
+ return h.enabled ? /* @__PURE__ */ z(i, {
3611
+ enabled: !0,
3612
+ knownSlices: Gn(e.structure),
3613
+ children: O
3614
+ }) : O;
3615
+ }
3616
+ function Hs({ scene: e, notes: t, routeState: n, strings: r, navigation: i, themes: a, shellSettings: o, onSystemSchemeChange: s, children: c }) {
3617
+ let [u, d] = m(""), { navigate: f } = i;
3618
+ return l(() => d(""), [i.currentScreen, i.currentDialog]), l(() => {
3472
3619
  let e = (e) => {
3473
3620
  let t = e.detail;
3474
3621
  d(`The modeled command “${t.command}” is ready for input.`);
3475
3622
  };
3476
3623
  return globalThis.addEventListener("cratis.scene.command", e), () => globalThis.removeEventListener("cratis.scene.command", e);
3477
- }, []), a(() => {
3624
+ }, []), l(() => {
3478
3625
  let t = (t) => {
3479
3626
  let n = t.detail, r = n.destination ?? (n.dialog ? {
3480
- kind: p.Dialog,
3627
+ kind: _.Dialog,
3481
3628
  dialog: n.dialog
3482
3629
  } : n.targetScreen ? { screen: n.targetScreen } : void 0);
3483
3630
  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.`));
3484
3631
  };
3485
3632
  return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
3486
- }, [f, e]), /* @__PURE__ */ R(se, {
3487
- registry: ss,
3488
- children: /* @__PURE__ */ z(Oe, {
3489
- themes: i,
3633
+ }, [f, e]), /* @__PURE__ */ z(ce, {
3634
+ registry: As,
3635
+ children: /* @__PURE__ */ B(Ae, {
3636
+ themes: a,
3490
3637
  children: [
3491
- o && /* @__PURE__ */ R(Yo, {
3638
+ o && /* @__PURE__ */ z(vs, {
3492
3639
  settings: o,
3493
3640
  onSystemSchemeChange: s
3494
3641
  }),
3495
- /* @__PURE__ */ R(Mo, {}),
3496
- /* @__PURE__ */ R(fn, {
3497
- routes: t.routes,
3498
- routesReady: t.ready,
3499
- parameters: r.currentParameters,
3500
- locale: n.locale,
3501
- locales: n.locales,
3502
- screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
3503
- children: /* @__PURE__ */ R(bs, {
3504
- activity: l,
3505
- routesReady: t.ready,
3642
+ /* @__PURE__ */ z(ts, {}),
3643
+ /* @__PURE__ */ z(Ws, {
3644
+ scene: e,
3645
+ screen: i.primaryScreen,
3646
+ notes: t
3647
+ }),
3648
+ /* @__PURE__ */ z(hn, {
3649
+ routes: n.routes,
3650
+ routesReady: n.ready,
3651
+ parameters: i.currentParameters,
3652
+ locale: r.locale,
3653
+ locales: r.locales,
3654
+ screen: i.primaryScreen ?? e.screens[0]?.name ?? "",
3655
+ children: /* @__PURE__ */ z(Us, {
3656
+ activity: u,
3657
+ notesEnabled: t.enabled,
3658
+ routesReady: n.ready,
3506
3659
  scene: e,
3507
3660
  setActivity: d,
3508
- strings: n,
3509
- children: c
3661
+ strings: r,
3662
+ children: /* @__PURE__ */ z(Xn, {
3663
+ structure: e.structure,
3664
+ screens: e.screens,
3665
+ children: c
3666
+ })
3510
3667
  })
3511
3668
  })
3512
3669
  ]
3513
3670
  })
3514
3671
  });
3515
3672
  }
3516
- function bs({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
3517
- let o = U(), s = Ce(), l = Rt(), u = c(() => rs(l, t, o.refreshAfterCommand), [
3673
+ function Us({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivity: i, strings: a, children: o }) {
3674
+ let s = W(), c = Te(), l = Vt(), u = f(() => Es(l, n, s.refreshAfterCommand), [
3518
3675
  l,
3519
- t,
3520
- o.refreshAfterCommand
3521
- ]), d = c(() => ts(n.commandSchemas), [n.commandSchemas]), f = ge({
3522
- executeCommand: async (e, n) => {
3523
- let i = V(e);
3524
- if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
3676
+ n,
3677
+ s.refreshAfterCommand
3678
+ ]), d = f(() => ws(r.commandSchemas), [r.commandSchemas]), p = ve({
3679
+ executeCommand: async (e, t) => {
3680
+ let r = H(e);
3681
+ if (!r && !n) return i(`The modeled command “${e}” is waiting for Stage routes.`), {
3525
3682
  isSuccess: !1,
3526
3683
  validationErrors: []
3527
3684
  };
3528
- if (!i) return r(`The modeled command “${e}” is not registered by this Stage.`), {
3685
+ if (!r) return i(`The modeled command “${e}” is not registered by this Stage.`), {
3529
3686
  isSuccess: !1,
3530
3687
  validationErrors: []
3531
3688
  };
3532
- let a = await l(e, n);
3533
- return a.messages.length > 0 && r(a.messages.join(" ")), a.isSuccess && o.refreshAfterCommand(), {
3689
+ let a = await l(e, t);
3690
+ return a.messages.length > 0 && i(a.messages.join(" ")), a.isSuccess && s.refreshAfterCommand(), {
3534
3691
  isSuccess: a.isSuccess,
3535
3692
  validationErrors: a.validationErrors,
3536
3693
  response: a.response
3537
3694
  };
3538
3695
  },
3539
3696
  navigate: (e, t) => {
3540
- n.screens.some((t) => t.name === e) ? H(e, Ut(t)) : r(`The modeled screen “${e}” is not available.`);
3697
+ r.screens.some((t) => t.name === e) ? U(e, Kt(t)) : i(`The modeled screen “${e}” is not available.`);
3541
3698
  },
3542
3699
  navigateBack: () => globalThis.history?.back(),
3543
3700
  openDialog: async (e) => {
3544
- let t = n.dialogTemplates?.find((t) => t.name === e);
3545
- return t ? (s.navigate({
3546
- kind: p.Dialog,
3701
+ let t = r.dialogTemplates?.find((t) => t.name === e);
3702
+ return t ? (c.navigate({
3703
+ kind: _.Dialog,
3547
3704
  dialog: t.name
3548
- }), { isConfirmed: !0 }) : (r(`The modeled dialog “${e}” is not available in this Stage runtime.`), { isConfirmed: !1 });
3705
+ }), { isConfirmed: !0 }) : (i(`The modeled dialog “${e}” is not available in this Stage runtime.`), { isConfirmed: !1 });
3549
3706
  },
3550
- closeDialog: () => s.closeDialog(),
3707
+ closeDialog: () => c.closeDialog(),
3551
3708
  confirm: async (e) => globalThis.confirm(e),
3552
- setState: (e, t) => o.setState(e, t),
3553
- notify: (e, t) => r(`${e}: ${t}`),
3554
- refreshQuery: async (e) => o.refreshQuery(e),
3555
- raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
3709
+ setState: (e, t) => s.setState(e, t),
3710
+ notify: (e, t) => i(`${e}: ${t}`),
3711
+ refreshQuery: async (e) => s.refreshQuery(e),
3712
+ raise: async (e) => i(`The modeled trigger “${e}” is not available in this Stage runtime.`)
3556
3713
  });
3557
- return /* @__PURE__ */ R(Co, {
3714
+ return /* @__PURE__ */ z(Go, {
3558
3715
  state: {
3559
- locales: i.locales,
3560
- locale: i.locale,
3561
- setLocale: i.setLocale,
3562
- activity: e
3716
+ locales: a.locales,
3717
+ locale: a.locale,
3718
+ setLocale: a.setLocale,
3719
+ activity: e,
3720
+ notesEnabled: t
3563
3721
  },
3564
- children: /* @__PURE__ */ R(fe, {
3722
+ children: /* @__PURE__ */ z(me, {
3565
3723
  invoker: u,
3566
- children: /* @__PURE__ */ R(ue, {
3724
+ children: /* @__PURE__ */ z(fe, {
3567
3725
  fieldsFor: d,
3568
- children: /* @__PURE__ */ R(ce, {
3569
- dispatcher: f,
3726
+ children: /* @__PURE__ */ z(le, {
3727
+ dispatcher: p,
3570
3728
  context: {
3571
- resolve: o.resolveBinding,
3572
- localize: (e) => i.dictionary[e] ?? e,
3573
- responseContracts: Po(n.responseContracts)
3729
+ resolve: s.resolveBinding,
3730
+ localize: (e) => a.dictionary[e] ?? e,
3731
+ responseContracts: rs(r.responseContracts)
3574
3732
  },
3575
3733
  attachments: [],
3576
- onFindings: (e) => r(e.map((e) => e.detail).join(" ")),
3577
- children: a
3734
+ onFindings: (e) => i(e.map((e) => e.detail).join(" ")),
3735
+ children: o
3578
3736
  })
3579
3737
  })
3580
3738
  })
3581
3739
  });
3582
3740
  }
3583
- function xs({ element: e, configuration: t, registry: n }) {
3584
- let r = U(), i = On();
3585
- return /* @__PURE__ */ z(Cr, {
3586
- element: e,
3587
- outputScope: i.scope,
3588
- children: [/* @__PURE__ */ R(Fa, { element: e }), /* @__PURE__ */ R(le, {
3741
+ function Ws({ scene: e, screen: t, notes: r }) {
3742
+ return n({
3743
+ screen: Jn(e.screens.find((e) => e.name === t)),
3744
+ values: { modelReferences: r.modelReferences }
3745
+ }), null;
3746
+ }
3747
+ function Gs({ element: e, configuration: t, registry: n }) {
3748
+ let r = W(), i = jn(), a = we();
3749
+ return /* @__PURE__ */ z(Zn, {
3750
+ screen: a?.primaryScreen,
3751
+ children: /* @__PURE__ */ B(Ur, {
3589
3752
  element: e,
3590
- registry: n,
3591
- resolveBinding: r.resolveBinding,
3592
- queryResults: r.queryResults,
3593
- onComponentOutputsChanged: i,
3594
- configuration: t
3595
- })]
3753
+ outputScope: i.scope,
3754
+ children: [/* @__PURE__ */ z(no, { element: e }), /* @__PURE__ */ z(ue, {
3755
+ element: e,
3756
+ registry: n,
3757
+ resolveBinding: r.resolveBinding,
3758
+ queryResults: r.queryResults,
3759
+ onComponentOutputsChanged: i,
3760
+ configuration: t
3761
+ })]
3762
+ })
3596
3763
  });
3597
3764
  }
3598
- function Ss({ template: e, content: t, registry: n, strings: r, close: i }) {
3599
- let o = U(), s = On(), c = O(t, r.dictionary);
3600
- return a(() => {
3765
+ function Ks({ template: e, content: t, registry: n, strings: r, close: i }) {
3766
+ let a = W(), o = jn(), s = ne(t, r.dictionary);
3767
+ return l(() => {
3601
3768
  let e = (e) => {
3602
3769
  e.key === "Escape" && i();
3603
3770
  };
3604
3771
  return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
3605
- }, [i]), /* @__PURE__ */ R("div", {
3772
+ }, [i]), /* @__PURE__ */ z("div", {
3606
3773
  className: "stage-dialog-backdrop",
3607
- children: /* @__PURE__ */ z("section", {
3774
+ children: /* @__PURE__ */ B("section", {
3608
3775
  role: "dialog",
3609
3776
  "aria-modal": "true",
3610
3777
  "aria-label": e.displayName ?? e.name,
3611
3778
  className: "stage-dialog",
3612
- children: [/* @__PURE__ */ R("button", {
3779
+ children: [/* @__PURE__ */ z("button", {
3613
3780
  type: "button",
3614
3781
  onClick: i,
3615
3782
  children: "Close"
3616
- }), /* @__PURE__ */ R(Cr, {
3617
- element: c,
3618
- children: /* @__PURE__ */ R(le, {
3619
- element: c,
3783
+ }), /* @__PURE__ */ z(Ur, {
3784
+ element: s,
3785
+ children: /* @__PURE__ */ z(ue, {
3786
+ element: s,
3620
3787
  registry: n,
3621
- resolveBinding: o.resolveBinding,
3622
- queryResults: o.queryResults,
3623
- onComponentOutputsChanged: s
3788
+ resolveBinding: a.resolveBinding,
3789
+ queryResults: a.queryResults,
3790
+ onComponentOutputsChanged: o
3624
3791
  })
3625
3792
  })]
3626
3793
  })
3627
3794
  });
3628
3795
  }
3629
- export { _s as App, _s as StageApplication, Rr as StageCommandForm, fn as StageDataProvider, en as StageGuardedAction, mt as StageSourceProvider, ms as composeStageScreen, rs as createStageSliceInvoker, _n as dataChanged, It as executeRegisteredCommand, xt as hostedBasePath, lo as listsPrimeReact, Ot as performQuery, wt as registerQueryRouteResolver, uo as registerStageLibrary, V as registeredCommand, Tt as registeredQuery, ts as sliceFieldsFrom, cs as stageApplicationRegistry, fs as stageComposition, e as stageDarkSelector, ft as stageEndpoints, us as stageShellOf, dt as staticStageSource, kt as subscribeQuery, Rt as useStageCommandExecutor, U as useStageData, W as useStageQuery, ht as useStageSource };
3796
+ export { Bs as App, Bs as StageApplication, ii as StageCommandForm, hn as StageDataProvider, rn as StageGuardedAction, _t as StageSourceProvider, Ls as composeStageScreen, Es as createStageSliceInvoker, bn as dataChanged, zt as executeRegisteredCommand, Ln as fetchModelReferences, wt as hostedBasePath, Mo as listsPrimeReact, Rn as modelReferenceFor, zn as modelReferenceMap, jt as performQuery, Vn as readStageNotes, Dt as registerQueryRouteResolver, No as registerStageLibrary, H as registeredCommand, Ot as registeredQuery, ws as sliceFieldsFrom, js as stageApplicationRegistry, Fs as stageComposition, e as stageDarkSelector, ht as stageEndpoints, Ns as stageShellOf, mt as staticStageSource, Mt as subscribeQuery, Vt as useStageCommandExecutor, W as useStageData, G as useStageQuery, vt as useStageSource };