@cratis/event-models 0.140.0 → 0.141.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.
@@ -1,6 +1,6 @@
1
- import { createElement as It, useCallback as B, useEffect as pe, useId as Qo, useLayoutEffect as tt, useMemo as $, useRef as te, useState as A } from "react";
1
+ import { createElement as It, useCallback as B, useEffect as pe, useId as Qo, useLayoutEffect as tt, useMemo as $, useRef as Z, useState as A } from "react";
2
2
  import { LayoutArrangement as V, PrototypeOverlayFrame as Yo } from "@cratis/scene/ScreenEditor";
3
- import { BindingMode as bh, BindingMode as Xn, BindingNullBehavior as yh, BindingNullBehavior as Bt, BindingSourceKind as wh, BindingSourceKind as E, CollectionOperation as be, DestinationKind as Ch, DestinationKind as De, DiagnosticCode as ve, DiagnosticSeverity as Tr, EditTarget as Nr, EditingScopeKind as Rt, FlowContainerKind as Ut, FormGenerationMode as ce, FormWidthUnit as me, GridUnitType as Pr, HorizontalAlignment as Pn, InteractionActionKind as Ke, InteractionTriggerKind as Zo, Orientation as Qe, PackageKind as Dt, PropertyValueType as x, ProvenanceKind as eo, QueryOriginKind as Ir, QueryResultShape as Rr, SceneEditKind as Z, SceneNodeKind as Dr, TemplateScope as Xo, VerticalAlignment as In, Visibility as Rn, isIconReference as Or, parseIconReference as xr } from "@cratis/scene.model";
3
+ import { BindingMode as bh, BindingMode as Xn, BindingNullBehavior as yh, BindingNullBehavior as Bt, BindingSourceKind as wh, BindingSourceKind as E, CollectionOperation as be, DestinationKind as Ch, DestinationKind as De, DiagnosticCode as ve, DiagnosticSeverity as Tr, EditTarget as Nr, EditingScopeKind as Rt, FlowContainerKind as Ut, FormGenerationMode as ce, FormWidthUnit as me, GridUnitType as Pr, HorizontalAlignment as Pn, InteractionActionKind as Ke, InteractionTriggerKind as Zo, Orientation as Qe, PackageKind as Dt, PropertyValueType as x, ProvenanceKind as eo, QueryOriginKind as Ir, QueryResultShape as Rr, SceneEditKind as X, SceneNodeKind as Dr, TemplateScope as Xo, VerticalAlignment as In, Visibility as Rn, isIconReference as Or, parseIconReference as xr } from "@cratis/scene.model";
4
4
  import { EffectiveIconCatalog as Fr, applyEdit as Dn, baseComponentLibraries as Mr, computeSizeClass as _r, corePackage as On, createDescriptorCatalog as $r, elementNodeId as ie, findLayoutTypeDescriptor as to, inspect as xn, isCanvas as Fe, isDockPanel as Ar, isExternalComponent as st, isGrid as Fn, isPackageSelectionValid as Lr, isPanel as nt, isStackPanel as Mn, isThemeCompatible as Er, isWrapPanel as Br, packagesOfKind as no, resolveComponentName as _n, resolveEffectiveConfiguration as Ur, resolveIconLibraries as jr, resolvePackageDependencies as Vr, resolveTemplateChain as ea, toComponentCatalog as $n, validateBinding as qr } from "@cratis/scene.engine";
5
5
  import { Fragment as se, jsx as i, jsxs as h } from "react/jsx-runtime";
6
6
  import { ErrorBoundary as $t, IconButton as ze, Tabs as Wr, TextArea as zr } from "@cratis/components/Common";
@@ -245,16 +245,16 @@ var le = (e, t) => typeof e == "number" ? e : t;
245
245
  function Pa(e, t) {
246
246
  const n = e, o = { ...n.properties ?? {} }, a = Ze(e).map((q) => Pa(q, t)), r = o[_l];
247
247
  if (r != null && typeof r == "object") return Bl(r, n, o, a);
248
- const s = o[wo], c = typeof o.legacyType == "string" && o.legacyType !== "" ? o[yo] : void 0, u = c ?? (nt(e) ? Ml(Na(e)) : t(st(e) ? e.componentName : "")), d = st(e) ? e.componentName : "", { [yo]: l, [wo]: m, [_e]: g, [$e]: b, ...f } = o, p = {};
248
+ const s = o[wo], d = typeof o.legacyType == "string" && o.legacyType !== "" ? o[yo] : void 0, u = d ?? (nt(e) ? Ml(Na(e)) : t(st(e) ? e.componentName : "")), c = st(e) ? e.componentName : "", { [yo]: l, [wo]: m, [_e]: g, [$e]: b, ...f } = o, p = {};
249
249
  for (const q of s?.topKeys ?? []) q in f && (p[q] = f[q], delete f[q]);
250
- const v = le(g, s?.position.x ?? 0), k = le(b, s?.position.y ?? 0), j = n.name ?? "", _ = s?.emptyName === !0 && j === (c ?? "");
250
+ const v = le(g, s?.position.x ?? 0), k = le(b, s?.position.y ?? 0), j = n.name ?? "", _ = s?.emptyName === !0 && j === (d ?? "");
251
251
  return {
252
252
  ...El(n, s),
253
253
  ...p,
254
254
  _derivedTypeId: u ?? "externalComponent",
255
255
  id: n.id,
256
256
  ..._ ? {} : { name: j },
257
- componentName: u ? u.slice(u.lastIndexOf(".") + 1) : Ta(d),
257
+ componentName: u ? u.slice(u.lastIndexOf(".") + 1) : Ta(c),
258
258
  properties: {
259
259
  ...f,
260
260
  canvas: {
@@ -278,22 +278,22 @@ function El(e, t) {
278
278
  return r;
279
279
  }
280
280
  function Bl(e, t, n, o) {
281
- const a = { ...e }, r = e.properties ?? {}, s = r.canvas ?? {}, c = n[_e], u = n[$e];
282
- (typeof c == "number" || typeof u == "number") && (e.position && typeof e.position == "object" ? a.position = {
281
+ const a = { ...e }, r = e.properties ?? {}, s = r.canvas ?? {}, d = n[_e], u = n[$e];
282
+ (typeof d == "number" || typeof u == "number") && (e.position && typeof e.position == "object" ? a.position = {
283
283
  ...e.position,
284
- x: le(c, le(s.x, 0)),
284
+ x: le(d, le(s.x, 0)),
285
285
  y: le(u, le(s.y, 0))
286
286
  } : a.properties = {
287
287
  ...r,
288
288
  canvas: {
289
289
  ...s,
290
- x: le(c, le(s.x, 0)),
290
+ x: le(d, le(s.x, 0)),
291
291
  y: le(u, le(s.y, 0))
292
292
  }
293
293
  }), t.size?.width !== void 0 && (a.width = t.size.width), t.size?.height !== void 0 && (a.height = t.size.height), t.name !== void 0 && t.name !== "" && t.name !== e.componentName && t.name !== e._derivedTypeId && (a.name = t.name), t.zIndex !== void 0 && "ZIndex" in e && (a.ZIndex = t.zIndex);
294
- const d = e.slots ?? {};
295
- return (o.length > 0 || "children" in d) && (a.slots = {
296
- ...d,
294
+ const c = e.slots ?? {};
295
+ return (o.length > 0 || "children" in c) && (a.slots = {
296
+ ...c,
297
297
  children: o
298
298
  }), a;
299
299
  }
@@ -360,15 +360,15 @@ function Da(e, t, n) {
360
360
  }
361
361
  function Oa(e, t, n, o = 0, a = null) {
362
362
  return e.flatMap((r) => {
363
- const s = n.idOf(r), c = n.childrenOf(r), u = c.length > 0 && t.has(s), d = {
363
+ const s = n.idOf(r), d = n.childrenOf(r), u = d.length > 0 && t.has(s), c = {
364
364
  node: r,
365
365
  id: s,
366
366
  depth: o,
367
367
  parentId: a,
368
- hasChildren: c.length > 0,
368
+ hasChildren: d.length > 0,
369
369
  isExpanded: u
370
370
  };
371
- return u ? [d, ...Oa(c, t, n, o + 1, s)] : [d];
371
+ return u ? [c, ...Oa(d, t, n, o + 1, s)] : [c];
372
372
  });
373
373
  }
374
374
  var ye = /* @__PURE__ */ (function(e) {
@@ -419,9 +419,9 @@ function Vl(e, t, n, o, a) {
419
419
  if (o === Re.Inside) return {
420
420
  nodeId: t,
421
421
  targetParentId: n,
422
- index: a.childrenOf(r.node).filter((c) => a.idOf(c) !== t).length
422
+ index: a.childrenOf(r.node).filter((d) => a.idOf(d) !== t).length
423
423
  };
424
- const s = r.siblings.filter((c) => a.idOf(c) !== t).findIndex((c) => a.idOf(c) === n);
424
+ const s = r.siblings.filter((d) => a.idOf(d) !== t).findIndex((d) => a.idOf(d) === n);
425
425
  return {
426
426
  nodeId: t,
427
427
  targetParentId: r.parent === null ? null : a.idOf(r.parent),
@@ -438,7 +438,7 @@ var xa = ({ ownership: e, label: t }) => e === Q.Local ? null : /* @__PURE__ */
438
438
  "data-ownership": e,
439
439
  children: t
440
440
  });
441
- function Wl({ row: e, adapter: t, strings: n, isSelected: o, isFocusable: a, dropZone: r, onSelect: s, onToggle: c, onKeyDown: u, onDragStart: d, onDragOver: l, onDrop: m, onDragEnd: g }) {
441
+ function Wl({ row: e, adapter: t, strings: n, isSelected: o, isFocusable: a, dropZone: r, onSelect: s, onToggle: d, onKeyDown: u, onDragStart: c, onDragOver: l, onDrop: m, onDragEnd: g }) {
442
442
  const b = t.ownershipOf(e.node), f = lt(b, Te.Move);
443
443
  return /* @__PURE__ */ h("li", {
444
444
  role: "treeitem",
@@ -454,7 +454,7 @@ function Wl({ row: e, adapter: t, strings: n, isSelected: o, isFocusable: a, dro
454
454
  draggable: f,
455
455
  onClick: () => s(e.id),
456
456
  onKeyDown: (p) => u(p, e.id),
457
- onDragStart: () => d(e.id),
457
+ onDragStart: () => c(e.id),
458
458
  onDragOver: (p) => l(p, e.id),
459
459
  onDrop: (p) => m(p, e.id),
460
460
  onDragEnd: g,
@@ -466,7 +466,7 @@ function Wl({ row: e, adapter: t, strings: n, isSelected: o, isFocusable: a, dro
466
466
  "aria-hidden": !e.hasChildren,
467
467
  disabled: !e.hasChildren,
468
468
  onClick: (p) => {
469
- p.stopPropagation(), c(e.id);
469
+ p.stopPropagation(), d(e.id);
470
470
  },
471
471
  children: e.hasChildren ? e.isExpanded ? "▾" : "▸" : ""
472
472
  }),
@@ -488,11 +488,11 @@ var Co = {
488
488
  ArrowRight: ye.Indent
489
489
  };
490
490
  function Fa({ roots: e, adapter: t, strings: n, selectedId: o, onSelect: a, onEdit: r, onRemove: s }) {
491
- const [c, u] = A(() => new Set(e.flatMap((S) => [t.idOf(S), ...t.childrenOf(S).map((I) => t.idOf(I))]))), [d, l] = A(o), [m, g] = A(), [b, f] = A(), [p, v] = A(""), k = $(() => Oa(e, c, t), [
491
+ const [d, u] = A(() => new Set(e.flatMap((S) => [t.idOf(S), ...t.childrenOf(S).map((I) => t.idOf(I))]))), [c, l] = A(o), [m, g] = A(), [b, f] = A(), [p, v] = A(""), k = $(() => Oa(e, d, t), [
492
492
  e,
493
- c,
493
+ d,
494
494
  t
495
- ]), j = k.some((S) => S.id === d) ? d : k[0]?.id, _ = B((S) => u((I) => {
495
+ ]), j = k.some((S) => S.id === c) ? c : k[0]?.id, _ = B((S) => u((I) => {
496
496
  const L = new Set(I);
497
497
  return L.delete(S) || L.add(S), L;
498
498
  }), []), q = B((S) => {
@@ -655,26 +655,26 @@ function tc(e, t) {
655
655
  const [n, o] = A(), [a, r] = A(0);
656
656
  return pe(() => {
657
657
  let s = !0;
658
- return e.search().then((c) => {
658
+ return e.search().then((d) => {
659
659
  s && (o({
660
660
  source: e,
661
- entries: c.entries,
662
- diagnostics: [...e.diagnostics, ...c.diagnostics]
661
+ entries: d.entries,
662
+ diagnostics: [...e.diagnostics, ...d.diagnostics]
663
663
  }), r((u) => u + 1));
664
- }).catch((c) => {
664
+ }).catch((d) => {
665
665
  s && (o({
666
666
  source: e,
667
667
  entries: [],
668
668
  diagnostics: e.diagnostics,
669
- error: c instanceof Error ? c.message : String(c)
669
+ error: d instanceof Error ? d.message : String(d)
670
670
  }), r((u) => u + 1));
671
671
  }), () => {
672
672
  s = !1;
673
673
  };
674
674
  }, [e]), $(() => {
675
- const s = n?.source === e ? n : void 0, c = s ? ec(s) : { status: "loading" };
675
+ const s = n?.source === e ? n : void 0, d = s ? ec(s) : { status: "loading" };
676
676
  return {
677
- catalog: Xl(e, s?.entries ?? [], t, c),
677
+ catalog: Xl(e, s?.entries ?? [], t, d),
678
678
  diagnostics: s?.diagnostics ?? e.diagnostics,
679
679
  loadedVersion: a
680
680
  };
@@ -685,8 +685,8 @@ function tc(e, t) {
685
685
  a
686
686
  ]);
687
687
  }
688
- function Ma({ value: e, onChange: t, catalog: n, adapters: o, allowed: a, readOnly: r, disabled: s, validationMessage: c, showMessage: u = !0, invalid: d, strings: l, pickerLabels: m, placement: g, id: b, ...f }) {
689
- const { catalog: p, loadedVersion: v } = tc(n, o), k = v > 0 ? Kl(n, p, e, a) : void 0, j = c ?? (k ? Jl(k, l) : void 0);
688
+ function Ma({ value: e, onChange: t, catalog: n, adapters: o, allowed: a, readOnly: r, disabled: s, validationMessage: d, showMessage: u = !0, invalid: c, strings: l, pickerLabels: m, placement: g, id: b, ...f }) {
689
+ const { catalog: p, loadedVersion: v } = tc(n, o), k = v > 0 ? Kl(n, p, e, a) : void 0, j = d ?? (k ? Jl(k, l) : void 0);
690
690
  return /* @__PURE__ */ i(Jr, {
691
691
  id: b,
692
692
  value: e,
@@ -699,7 +699,7 @@ function Ma({ value: e, onChange: t, catalog: n, adapters: o, allowed: a, readOn
699
699
  allowed: a,
700
700
  readOnly: r,
701
701
  disabled: s,
702
- invalid: j !== void 0 || d === !0,
702
+ invalid: j !== void 0 || c === !0,
703
703
  validationMessage: u ? j : void 0,
704
704
  placement: g,
705
705
  labels: {
@@ -756,7 +756,7 @@ function rc(e, t, n) {
756
756
  switch (n.kind) {
757
757
  case "add":
758
758
  return [{
759
- kind: Z.AddCollectionItem,
759
+ kind: X.AddCollectionItem,
760
760
  ...o,
761
761
  item: {
762
762
  id: n.item.id,
@@ -766,20 +766,20 @@ function rc(e, t, n) {
766
766
  }];
767
767
  case "remove":
768
768
  return [{
769
- kind: Z.RemoveCollectionItem,
769
+ kind: X.RemoveCollectionItem,
770
770
  ...o,
771
771
  itemId: n.item.id
772
772
  }];
773
773
  case "move":
774
774
  return [{
775
- kind: Z.ReorderCollectionItem,
775
+ kind: X.ReorderCollectionItem,
776
776
  ...o,
777
777
  itemId: n.item.id,
778
778
  index: n.toIndex
779
779
  }];
780
780
  case "update":
781
781
  return [{
782
- kind: Z.EditCollectionItem,
782
+ kind: X.EditCollectionItem,
783
783
  ...o,
784
784
  itemId: n.item.id,
785
785
  field: n.field,
@@ -819,11 +819,11 @@ function cc(e) {
819
819
  function dc(e, t, n, o, a) {
820
820
  const r = Bn(t).map((s) => uc(e, s, n)).filter((s) => !!s && s.outputs.length > 0);
821
821
  return {
822
- dataContextPaths: Object.keys(o).sort((s, c) => s.localeCompare(c)),
822
+ dataContextPaths: Object.keys(o).sort((s, d) => s.localeCompare(d)),
823
823
  queryResults: a.map((s) => ({
824
824
  id: s.id,
825
825
  name: s.name,
826
- fields: s.resultFields.map((c) => c.name)
826
+ fields: s.resultFields.map((d) => d.name)
827
827
  })),
828
828
  componentOutputs: r
829
829
  };
@@ -957,20 +957,20 @@ var Tc = (e, t) => e.descriptor.valueType === "number" && typeof t == "string" ?
957
957
  function gn(e, t, n) {
958
958
  const o = Tc(t, n);
959
959
  return t.editTarget === Nr.Instance ? o === void 0 ? {
960
- kind: Z.ResetInstanceValue,
960
+ kind: X.ResetInstanceValue,
961
961
  component: e,
962
962
  path: t.descriptor.path
963
963
  } : {
964
- kind: Z.SetInstanceValue,
964
+ kind: X.SetInstanceValue,
965
965
  component: e,
966
966
  path: t.descriptor.path,
967
967
  value: o
968
968
  } : o === void 0 ? {
969
- kind: Z.ResetProperty,
969
+ kind: X.ResetProperty,
970
970
  nodeId: ie(e),
971
971
  path: t.descriptor.path
972
972
  } : {
973
- kind: Z.SetProperty,
973
+ kind: X.SetProperty,
974
974
  nodeId: ie(e),
975
975
  path: t.descriptor.path,
976
976
  value: o
@@ -1032,13 +1032,13 @@ var Ic = (e, t) => {
1032
1032
  return t.unknownSource(n);
1033
1033
  }
1034
1034
  }, Rc = ({ action: e, slices: t, sources: n, strings: o, disabled: a, suggestSource: r, onChange: s }) => {
1035
- const c = o.properties.action, u = e ? t.find((l) => l.id === e.sliceId) : void 0, d = e ? Nc(e, t, new Set(n)) : [];
1035
+ const d = o.properties.action, u = e ? t.find((l) => l.id === e.sliceId) : void 0, c = e ? Nc(e, t, new Set(n)) : [];
1036
1036
  return /* @__PURE__ */ h("fieldset", {
1037
1037
  className: "studio-editor-query",
1038
1038
  disabled: a,
1039
1039
  children: [
1040
- /* @__PURE__ */ i("legend", { children: c.label }),
1041
- /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: c.slice }), /* @__PURE__ */ h("select", {
1040
+ /* @__PURE__ */ i("legend", { children: d.label }),
1041
+ /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: d.slice }), /* @__PURE__ */ h("select", {
1042
1042
  value: e?.sliceId ?? "",
1043
1043
  onChange: (l) => {
1044
1044
  const m = t.find((g) => g.id === l.target.value);
@@ -1052,7 +1052,7 @@ var Ic = (e, t) => {
1052
1052
  children: [
1053
1053
  /* @__PURE__ */ i("option", {
1054
1054
  value: "",
1055
- children: c.none
1055
+ children: d.none
1056
1056
  }),
1057
1057
  e && !u && /* @__PURE__ */ i("option", {
1058
1058
  value: e.sliceId,
@@ -1066,7 +1066,7 @@ var Ic = (e, t) => {
1066
1066
  })] }),
1067
1067
  e && u && /* @__PURE__ */ h(se, { children: [/* @__PURE__ */ h("div", {
1068
1068
  className: "studio-editor-query__group",
1069
- children: [/* @__PURE__ */ i("strong", { children: c.inputs }), u.inputs.map((l) => /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ h("span", { children: [c.sourceFor(l.name), l.required ? " *" : ""] }), /* @__PURE__ */ h("select", {
1069
+ children: [/* @__PURE__ */ i("strong", { children: d.inputs }), u.inputs.map((l) => /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ h("span", { children: [d.sourceFor(l.name), l.required ? " *" : ""] }), /* @__PURE__ */ h("select", {
1070
1070
  value: e.inputs[l.name] ?? "",
1071
1071
  onChange: (m) => s({
1072
1072
  ...e,
@@ -1083,7 +1083,7 @@ var Ic = (e, t) => {
1083
1083
  children: m
1084
1084
  }, m))]
1085
1085
  })] }, l.name))]
1086
- }), /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: c.presentation }), /* @__PURE__ */ h("select", {
1086
+ }), /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: d.presentation }), /* @__PURE__ */ h("select", {
1087
1087
  value: e.presentation,
1088
1088
  onChange: (l) => s({
1089
1089
  ...e,
@@ -1092,25 +1092,25 @@ var Ic = (e, t) => {
1092
1092
  children: [
1093
1093
  /* @__PURE__ */ i("option", {
1094
1094
  value: de.None,
1095
- children: c.presentations.none
1095
+ children: d.presentations.none
1096
1096
  }),
1097
1097
  /* @__PURE__ */ i("option", {
1098
1098
  value: de.Modal,
1099
- children: c.presentations.modal
1099
+ children: d.presentations.modal
1100
1100
  }),
1101
1101
  /* @__PURE__ */ i("option", {
1102
1102
  value: de.Drawer,
1103
- children: c.presentations.drawer
1103
+ children: d.presentations.drawer
1104
1104
  })
1105
1105
  ]
1106
1106
  })] })] }),
1107
- d.length > 0 && /* @__PURE__ */ i("ul", {
1107
+ c.length > 0 && /* @__PURE__ */ i("ul", {
1108
1108
  className: "studio-editor-diagnostics",
1109
1109
  role: "alert",
1110
1110
  "aria-label": o.properties.diagnostics,
1111
- children: d.map((l, m) => /* @__PURE__ */ i("li", {
1111
+ children: c.map((l, m) => /* @__PURE__ */ i("li", {
1112
1112
  "data-severity": "error",
1113
- children: Ic(l, c.problems)
1113
+ children: Ic(l, d.problems)
1114
1114
  }, m))
1115
1115
  })
1116
1116
  ]
@@ -1190,13 +1190,13 @@ function La(e, t, n, o, a) {
1190
1190
  };
1191
1191
  }
1192
1192
  var xc = ({ component: e, descriptor: t, controller: n, environment: o, strings: a, disabled: r }) => {
1193
- const s = $(() => Fc(o, t), [o, t]), [c, u] = A([]);
1193
+ const s = $(() => Fc(o, t), [o, t]), [d, u] = A([]);
1194
1194
  return s.length === 0 ? null : /* @__PURE__ */ h("section", {
1195
1195
  className: "studio-editor-properties__actions",
1196
1196
  children: [
1197
1197
  /* @__PURE__ */ i("strong", { children: a.properties.designTimeActions }),
1198
- s.map(({ id: d, action: l }) => {
1199
- const m = La(e, t, n, o, l?.descriptor.label ?? d);
1198
+ s.map(({ id: c, action: l }) => {
1199
+ const m = La(e, t, n, o, l?.descriptor.label ?? c);
1200
1200
  if (!(!l || So(() => l.isVisible(m), !0))) return null;
1201
1201
  const g = !r && (l ? So(() => l.isEnabled(m), !1) : !1);
1202
1202
  return /* @__PURE__ */ i("button", {
@@ -1212,12 +1212,12 @@ var xc = ({ component: e, descriptor: t, controller: n, environment: o, strings:
1212
1212
  });
1213
1213
  u(b.diagnostics.map((f) => typeof f == "string" ? f : f.message)), b.applied && n.applyAll(b.edits, l.descriptor.label);
1214
1214
  },
1215
- children: l?.descriptor.label ?? d
1216
- }, d);
1215
+ children: l?.descriptor.label ?? c
1216
+ }, c);
1217
1217
  }),
1218
- c.length > 0 && /* @__PURE__ */ i("ul", {
1218
+ d.length > 0 && /* @__PURE__ */ i("ul", {
1219
1219
  className: "studio-editor-properties__action-messages",
1220
- children: c.map((d) => /* @__PURE__ */ i("li", { children: d }, d))
1220
+ children: d.map((c) => /* @__PURE__ */ i("li", { children: c }, c))
1221
1221
  })
1222
1222
  ]
1223
1223
  });
@@ -1248,14 +1248,14 @@ var Mc = ({ component: e, descriptor: t, controller: n, environment: o, strings:
1248
1248
  const s = La(e, t, n, o, a.properties.designTimeDesigners);
1249
1249
  return /* @__PURE__ */ h("section", {
1250
1250
  className: "studio-editor-properties__designers",
1251
- children: [/* @__PURE__ */ i("strong", { children: a.properties.designTimeDesigners }), r.map(({ id: c, Designer: u }) => /* @__PURE__ */ i($t, {
1251
+ children: [/* @__PURE__ */ i("strong", { children: a.properties.designTimeDesigners }), r.map(({ id: d, Designer: u }) => /* @__PURE__ */ i($t, {
1252
1252
  fallback: /* @__PURE__ */ i("p", {
1253
1253
  className: "studio-editor-binding__missing",
1254
1254
  role: "alert",
1255
- children: a.properties.designerFailed(c)
1255
+ children: a.properties.designerFailed(d)
1256
1256
  }),
1257
1257
  children: /* @__PURE__ */ i(u, { context: s })
1258
- }, c))]
1258
+ }, d))]
1259
1259
  });
1260
1260
  };
1261
1261
  function _c(e, t, n) {
@@ -1483,11 +1483,11 @@ var Hc = ({ form: e, strings: t, onChange: n }) => {
1483
1483
  })
1484
1484
  ] }),
1485
1485
  /* @__PURE__ */ h("fieldset", { children: [/* @__PURE__ */ i("legend", { children: t.placements }), o.fields.map((r) => {
1486
- const s = a.placements.find((c) => c.field === r.name) ?? r.placement;
1486
+ const s = a.placements.find((d) => d.field === r.name) ?? r.placement;
1487
1487
  return /* @__PURE__ */ h("fieldset", { children: [/* @__PURE__ */ i("legend", { children: r.label || r.name }), /* @__PURE__ */ i(Jc, {
1488
1488
  placement: s,
1489
1489
  strings: t,
1490
- onChange: (c) => n(Wc(o, r.name, () => c))
1490
+ onChange: (d) => n(Wc(o, r.name, () => d))
1491
1491
  })] }, r.name);
1492
1492
  })] })
1493
1493
  ]
@@ -1570,9 +1570,9 @@ function To(e, t) {
1570
1570
  };
1571
1571
  }
1572
1572
  var Kc = ({ controller: e, slices: t, strings: n, disabled: o }) => {
1573
- const a = e.document.screens.find((d) => d.name === ge);
1573
+ const a = e.document.screens.find((c) => c.name === ge);
1574
1574
  if (!a) return null;
1575
- const r = a.forms ?? [], s = n.properties.forms, c = (d, l = s.label) => e.setScreenForms(d, l), u = (d, l) => c(r.map((m, g) => g === d ? l : m));
1575
+ const r = a.forms ?? [], s = n.properties.forms, d = (c, l = s.label) => e.setScreenForms(c, l), u = (c, l) => d(r.map((m, g) => g === c ? l : m));
1576
1576
  return /* @__PURE__ */ h("section", {
1577
1577
  className: "studio-editor-properties__forms",
1578
1578
  children: [
@@ -1580,28 +1580,28 @@ var Kc = ({ controller: e, slices: t, strings: n, disabled: o }) => {
1580
1580
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: s.add }), /* @__PURE__ */ h("select", {
1581
1581
  value: "",
1582
1582
  disabled: o || t.length === 0,
1583
- onChange: (d) => {
1584
- const l = t.find((m) => m.id === d.target.value);
1585
- l && c([...r, No(l)], s.add);
1583
+ onChange: (c) => {
1584
+ const l = t.find((m) => m.id === c.target.value);
1585
+ l && d([...r, No(l)], s.add);
1586
1586
  },
1587
1587
  children: [/* @__PURE__ */ i("option", {
1588
1588
  value: "",
1589
1589
  children: s.chooseCommand
1590
- }), t.map((d) => /* @__PURE__ */ i("option", {
1591
- value: d.id,
1592
- children: d.name
1593
- }, d.id))]
1590
+ }), t.map((c) => /* @__PURE__ */ i("option", {
1591
+ value: c.id,
1592
+ children: c.name
1593
+ }, c.id))]
1594
1594
  })] }),
1595
- r.map((d, l) => {
1596
- const m = t.find((f) => f.name === d.forCommand), g = m?.inputs.map((f) => f.name) ?? d.fields.map((f) => f.sourceProperty ?? f.name), b = Zc(d, m) === ce.Auto;
1595
+ r.map((c, l) => {
1596
+ const m = t.find((f) => f.name === c.forCommand), g = m?.inputs.map((f) => f.name) ?? c.fields.map((f) => f.sourceProperty ?? f.name), b = Zc(c, m) === ce.Auto;
1597
1597
  return /* @__PURE__ */ h("fieldset", {
1598
1598
  className: "studio-editor-properties__form",
1599
1599
  disabled: o,
1600
1600
  children: [
1601
- /* @__PURE__ */ i("legend", { children: d.name }),
1601
+ /* @__PURE__ */ i("legend", { children: c.name }),
1602
1602
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: s.mode }), /* @__PURE__ */ h("select", {
1603
1603
  value: b ? ce.Auto : ce.Manual,
1604
- onChange: (f) => m && u(l, f.target.value === ce.Auto ? No(m) : Qc(d, m)),
1604
+ onChange: (f) => m && u(l, f.target.value === ce.Auto ? No(m) : Qc(c, m)),
1605
1605
  children: [/* @__PURE__ */ i("option", {
1606
1606
  value: ce.Auto,
1607
1607
  children: s.auto
@@ -1611,16 +1611,16 @@ var Kc = ({ controller: e, slices: t, strings: n, disabled: o }) => {
1611
1611
  })]
1612
1612
  })] }),
1613
1613
  /* @__PURE__ */ i(Vc, {
1614
- form: d,
1614
+ form: c,
1615
1615
  commandProperties: g
1616
1616
  }),
1617
1617
  /* @__PURE__ */ h("div", {
1618
1618
  className: "studio-editor-properties__form-fields",
1619
- children: [d.fields.map((f, p) => /* @__PURE__ */ h("fieldset", { children: [
1619
+ children: [c.fields.map((f, p) => /* @__PURE__ */ h("fieldset", { children: [
1620
1620
  /* @__PURE__ */ i("legend", { children: f.name }),
1621
1621
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: s.fieldLabel }), /* @__PURE__ */ i("input", {
1622
1622
  value: f.label ?? "",
1623
- onChange: (v) => u(l, Po(d, p, {
1623
+ onChange: (v) => u(l, Po(c, p, {
1624
1624
  ...f,
1625
1625
  label: v.target.value || void 0
1626
1626
  }))
@@ -1628,7 +1628,7 @@ var Kc = ({ controller: e, slices: t, strings: n, disabled: o }) => {
1628
1628
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: s.sourceProperty }), /* @__PURE__ */ i("input", {
1629
1629
  list: `form-${l}-sources`,
1630
1630
  value: f.sourceProperty ?? "",
1631
- onChange: (v) => u(l, Po(d, p, {
1631
+ onChange: (v) => u(l, Po(c, p, {
1632
1632
  ...f,
1633
1633
  sourceProperty: v.target.value || void 0
1634
1634
  }))
@@ -1639,17 +1639,17 @@ var Kc = ({ controller: e, slices: t, strings: n, disabled: o }) => {
1639
1639
  })]
1640
1640
  }),
1641
1641
  !b && /* @__PURE__ */ i(Hc, {
1642
- form: d,
1642
+ form: c,
1643
1643
  strings: s,
1644
1644
  onChange: (f) => u(l, f)
1645
1645
  }),
1646
1646
  /* @__PURE__ */ i("button", {
1647
1647
  type: "button",
1648
- onClick: () => c(r.filter((f, p) => p !== l), s.remove),
1648
+ onClick: () => d(r.filter((f, p) => p !== l), s.remove),
1649
1649
  children: s.remove
1650
1650
  })
1651
1651
  ]
1652
- }, `${d.name}:${l}`);
1652
+ }, `${c.name}:${l}`);
1653
1653
  })
1654
1654
  ]
1655
1655
  });
@@ -1688,11 +1688,11 @@ function Po(e, t, n) {
1688
1688
  var U = /* @__PURE__ */ (function(e) {
1689
1689
  return e.String = "string", e.Number = "number", e.Boolean = "boolean", e.Null = "null", e.Json = "json", e;
1690
1690
  })(U || {}), Xc = ({ property: e, sources: t, strings: n, disabled: o, onChange: a }) => {
1691
- const r = n.properties.binding, s = _a(e.effectiveValue) ? e.effectiveValue : void 0, c = s ? void 0 : nd(e.effectiveValue), u = fc(e), d = s ?? u, l = td(d, e.descriptor.acceptedBindingKinds?.length ? e.descriptor.acceptedBindingKinds : jn, t, r), m = d.query ? t.queryResults.find((p) => p.id === d.query || p.name === d.query) : void 0, g = d.componentId ? t.componentOutputs.find((p) => p.componentId === d.componentId) : void 0, b = (p) => a(od({
1692
- ...d,
1691
+ const r = n.properties.binding, s = _a(e.effectiveValue) ? e.effectiveValue : void 0, d = s ? void 0 : nd(e.effectiveValue), u = fc(e), c = s ?? u, l = td(c, e.descriptor.acceptedBindingKinds?.length ? e.descriptor.acceptedBindingKinds : jn, t, r), m = c.query ? t.queryResults.find((p) => p.id === c.query || p.name === c.query) : void 0, g = c.componentId ? t.componentOutputs.find((p) => p.componentId === c.componentId) : void 0, b = (p) => a(od({
1692
+ ...c,
1693
1693
  ...p
1694
1694
  })), f = () => a(void 0);
1695
- return c !== void 0 ? /* @__PURE__ */ h("fieldset", {
1695
+ return d !== void 0 ? /* @__PURE__ */ h("fieldset", {
1696
1696
  className: "studio-editor-binding",
1697
1697
  disabled: o,
1698
1698
  children: [
@@ -1700,7 +1700,7 @@ var U = /* @__PURE__ */ (function(e) {
1700
1700
  /* @__PURE__ */ h("div", {
1701
1701
  className: "studio-editor-binding__missing",
1702
1702
  role: "alert",
1703
- children: [/* @__PURE__ */ i("p", { children: r.unsupportedValue }), /* @__PURE__ */ i("pre", { children: JSON.stringify(c, void 0, 2) ?? "" })]
1703
+ children: [/* @__PURE__ */ i("p", { children: r.unsupportedValue }), /* @__PURE__ */ i("pre", { children: JSON.stringify(d, void 0, 2) ?? "" })]
1704
1704
  }),
1705
1705
  /* @__PURE__ */ h("div", {
1706
1706
  className: "studio-editor-binding__row",
@@ -1724,8 +1724,8 @@ var U = /* @__PURE__ */ (function(e) {
1724
1724
  className: "studio-editor-binding__row",
1725
1725
  children: [
1726
1726
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: r.source }), /* @__PURE__ */ i("select", {
1727
- value: d.kind ?? E.DataContext,
1728
- onChange: (p) => b(ad(p.target.value, d)),
1727
+ value: c.kind ?? E.DataContext,
1728
+ onChange: (p) => b(ad(p.target.value, c)),
1729
1729
  children: l.map((p) => /* @__PURE__ */ i("option", {
1730
1730
  value: p.kind,
1731
1731
  disabled: p.disabled,
@@ -1733,7 +1733,7 @@ var U = /* @__PURE__ */ (function(e) {
1733
1733
  }, p.kind))
1734
1734
  })] }),
1735
1735
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: r.mode }), /* @__PURE__ */ h("select", {
1736
- value: d.mode ?? "",
1736
+ value: c.mode ?? "",
1737
1737
  onChange: (p) => b({ mode: p.target.value === "" ? void 0 : p.target.value }),
1738
1738
  children: [/* @__PURE__ */ i("option", {
1739
1739
  value: "",
@@ -1744,7 +1744,7 @@ var U = /* @__PURE__ */ (function(e) {
1744
1744
  }, p))]
1745
1745
  })] }),
1746
1746
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: r.nullBehavior }), /* @__PURE__ */ h("select", {
1747
- value: d.nullBehavior ?? "",
1747
+ value: c.nullBehavior ?? "",
1748
1748
  onChange: (p) => b({ nullBehavior: p.target.value === "" ? void 0 : p.target.value }),
1749
1749
  children: [/* @__PURE__ */ i("option", {
1750
1750
  value: "",
@@ -1755,7 +1755,7 @@ var U = /* @__PURE__ */ (function(e) {
1755
1755
  }, p))]
1756
1756
  })] }),
1757
1757
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: r.expectedType }), /* @__PURE__ */ h("select", {
1758
- value: d.expectedValueType ?? "",
1758
+ value: c.expectedValueType ?? "",
1759
1759
  onChange: (p) => b({ expectedValueType: p.target.value === "" ? void 0 : p.target.value }),
1760
1760
  children: [/* @__PURE__ */ i("option", {
1761
1761
  value: "",
@@ -1775,16 +1775,16 @@ var U = /* @__PURE__ */ (function(e) {
1775
1775
  p.reason
1776
1776
  ]
1777
1777
  }, `${p.kind}:reason`)),
1778
- He(d) === E.DataContext && /* @__PURE__ */ i(Xt, {
1778
+ He(c) === E.DataContext && /* @__PURE__ */ i(Xt, {
1779
1779
  id: `${e.descriptor.path}-data-context-paths`,
1780
1780
  label: r.path,
1781
- value: d.path,
1781
+ value: c.path,
1782
1782
  options: t.dataContextPaths,
1783
1783
  onChange: (p) => b({ path: p })
1784
1784
  }),
1785
- He(d) === E.QueryResult && /* @__PURE__ */ h(se, { children: [
1785
+ He(c) === E.QueryResult && /* @__PURE__ */ h(se, { children: [
1786
1786
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: r.query }), /* @__PURE__ */ h("select", {
1787
- value: d.query ?? "",
1787
+ value: c.query ?? "",
1788
1788
  onChange: (p) => b({
1789
1789
  query: p.target.value,
1790
1790
  path: ""
@@ -1794,9 +1794,9 @@ var U = /* @__PURE__ */ (function(e) {
1794
1794
  value: "",
1795
1795
  children: r.noSource
1796
1796
  }),
1797
- d.query && !m && /* @__PURE__ */ i("option", {
1798
- value: d.query,
1799
- children: r.missingQuery(d.query)
1797
+ c.query && !m && /* @__PURE__ */ i("option", {
1798
+ value: c.query,
1799
+ children: r.missingQuery(c.query)
1800
1800
  }),
1801
1801
  t.queryResults.map((p) => /* @__PURE__ */ i("option", {
1802
1802
  value: p.id,
@@ -1807,19 +1807,19 @@ var U = /* @__PURE__ */ (function(e) {
1807
1807
  /* @__PURE__ */ i(Xt, {
1808
1808
  id: `${e.descriptor.path}-query-paths`,
1809
1809
  label: r.path,
1810
- value: d.path,
1810
+ value: c.path,
1811
1811
  options: m?.fields ?? [],
1812
1812
  onChange: (p) => b({ path: p })
1813
1813
  }),
1814
- d.query && !m && /* @__PURE__ */ i("p", {
1814
+ c.query && !m && /* @__PURE__ */ i("p", {
1815
1815
  className: "studio-editor-binding__missing",
1816
1816
  role: "alert",
1817
- children: r.missingQuery(d.query)
1817
+ children: r.missingQuery(c.query)
1818
1818
  })
1819
1819
  ] }),
1820
- He(d) === E.ComponentProperty && /* @__PURE__ */ h(se, { children: [
1820
+ He(c) === E.ComponentProperty && /* @__PURE__ */ h(se, { children: [
1821
1821
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: r.component }), /* @__PURE__ */ h("select", {
1822
- value: d.componentId ?? "",
1822
+ value: c.componentId ?? "",
1823
1823
  onChange: (p) => b({
1824
1824
  componentId: p.target.value,
1825
1825
  componentPropertyPath: "",
@@ -1830,9 +1830,9 @@ var U = /* @__PURE__ */ (function(e) {
1830
1830
  value: "",
1831
1831
  children: r.noSource
1832
1832
  }),
1833
- d.componentId && !g && /* @__PURE__ */ i("option", {
1834
- value: d.componentId,
1835
- children: r.missingComponent(d.componentId)
1833
+ c.componentId && !g && /* @__PURE__ */ i("option", {
1834
+ value: c.componentId,
1835
+ children: r.missingComponent(c.componentId)
1836
1836
  }),
1837
1837
  t.componentOutputs.map((p) => /* @__PURE__ */ h("option", {
1838
1838
  value: p.componentId,
@@ -1848,28 +1848,28 @@ var U = /* @__PURE__ */ (function(e) {
1848
1848
  /* @__PURE__ */ i(Xt, {
1849
1849
  id: `${e.descriptor.path}-component-paths`,
1850
1850
  label: r.componentProperty,
1851
- value: d.componentPropertyPath ?? d.path,
1851
+ value: c.componentPropertyPath ?? c.path,
1852
1852
  options: g?.outputs.map((p) => p.path) ?? [],
1853
1853
  onChange: (p) => b({
1854
1854
  componentPropertyPath: p,
1855
1855
  path: p
1856
1856
  })
1857
1857
  }),
1858
- d.componentId && !g && /* @__PURE__ */ i("p", {
1858
+ c.componentId && !g && /* @__PURE__ */ i("p", {
1859
1859
  className: "studio-editor-binding__missing",
1860
1860
  role: "alert",
1861
- children: r.missingComponent(d.componentId)
1861
+ children: r.missingComponent(c.componentId)
1862
1862
  })
1863
1863
  ] }),
1864
- He(d) === E.Literal && /* @__PURE__ */ i(ed, {
1865
- value: d.value,
1866
- targetType: d.expectedValueType ?? e.descriptor.valueType,
1864
+ He(c) === E.Literal && /* @__PURE__ */ i(ed, {
1865
+ value: c.value,
1866
+ targetType: c.expectedValueType ?? e.descriptor.valueType,
1867
1867
  strings: r,
1868
1868
  onChange: (p) => b({
1869
1869
  value: p,
1870
1870
  path: ""
1871
1871
  })
1872
- }, et(d.value, d.expectedValueType ?? e.descriptor.valueType)),
1872
+ }, et(c.value, c.expectedValueType ?? e.descriptor.valueType)),
1873
1873
  s && /* @__PURE__ */ i("button", {
1874
1874
  type: "button",
1875
1875
  onClick: f,
@@ -1889,7 +1889,7 @@ var U = /* @__PURE__ */ (function(e) {
1889
1889
  children: o.map((r) => /* @__PURE__ */ i("option", { value: r }, r))
1890
1890
  })
1891
1891
  ] }), ed = ({ value: e, targetType: t, strings: n, onChange: o }) => {
1892
- const a = vn(e, t), r = et(e, t), s = te(r), [c, u] = A(a), [d, l] = A(() => en(e, a)), [m, g] = A();
1892
+ const a = vn(e, t), r = et(e, t), s = Z(r), [d, u] = A(a), [c, l] = A(() => en(e, a)), [m, g] = A();
1893
1893
  pe(() => {
1894
1894
  const f = et(e, t);
1895
1895
  if (f === s.current) return;
@@ -1905,7 +1905,7 @@ var U = /* @__PURE__ */ (function(e) {
1905
1905
  className: "studio-editor-binding__literal",
1906
1906
  children: [
1907
1907
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalType }), /* @__PURE__ */ h("select", {
1908
- value: c,
1908
+ value: d,
1909
1909
  onChange: (f) => b(f.target.value),
1910
1910
  children: [
1911
1911
  /* @__PURE__ */ i("option", {
@@ -1930,16 +1930,16 @@ var U = /* @__PURE__ */ (function(e) {
1930
1930
  })
1931
1931
  ]
1932
1932
  })] }),
1933
- c === U.String && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalValue }), /* @__PURE__ */ i("input", {
1933
+ d === U.String && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalValue }), /* @__PURE__ */ i("input", {
1934
1934
  value: typeof e == "string" ? e : "",
1935
1935
  onChange: (f) => o(f.target.value)
1936
1936
  })] }),
1937
- c === U.Number && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalValue }), /* @__PURE__ */ i("input", {
1937
+ d === U.Number && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalValue }), /* @__PURE__ */ i("input", {
1938
1938
  type: "number",
1939
1939
  value: typeof e == "number" ? String(e) : "",
1940
1940
  onChange: (f) => o(f.target.value === "" ? void 0 : Number(f.target.value))
1941
1941
  })] }),
1942
- c === U.Boolean && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalValue }), /* @__PURE__ */ h("select", {
1942
+ d === U.Boolean && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalValue }), /* @__PURE__ */ h("select", {
1943
1943
  value: e === !0 ? "true" : "false",
1944
1944
  onChange: (f) => o(f.target.value === "true"),
1945
1945
  children: [/* @__PURE__ */ i("option", {
@@ -1950,9 +1950,9 @@ var U = /* @__PURE__ */ (function(e) {
1950
1950
  children: "false"
1951
1951
  })]
1952
1952
  })] }),
1953
- c === U.Null && /* @__PURE__ */ i("p", { children: n.literalNull }),
1954
- c === U.Json && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalValue }), /* @__PURE__ */ i("textarea", {
1955
- value: d,
1953
+ d === U.Null && /* @__PURE__ */ i("p", { children: n.literalNull }),
1954
+ d === U.Json && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.literalValue }), /* @__PURE__ */ i("textarea", {
1955
+ value: c,
1956
1956
  onChange: (f) => {
1957
1957
  const p = f.target.value;
1958
1958
  l(p);
@@ -1975,12 +1975,12 @@ var U = /* @__PURE__ */ (function(e) {
1975
1975
  function td(e, t, n, o) {
1976
1976
  const a = He(e);
1977
1977
  return jn.map((r) => {
1978
- const s = t.includes(r), c = r === E.QueryResult && n.queryResults.length === 0 || r === E.ComponentProperty && n.componentOutputs.length === 0;
1978
+ const s = t.includes(r), d = r === E.QueryResult && n.queryResults.length === 0 || r === E.ComponentProperty && n.componentOutputs.length === 0;
1979
1979
  return {
1980
1980
  kind: r,
1981
1981
  label: id(r, o.sources),
1982
- disabled: r !== a && (!s || c),
1983
- reason: s ? c ? o.unavailableSource : void 0 : o.incompatibleSource
1982
+ disabled: r !== a && (!s || d),
1983
+ reason: s ? d ? o.unavailableSource : void 0 : o.incompatibleSource
1984
1984
  };
1985
1985
  });
1986
1986
  }
@@ -2149,7 +2149,7 @@ function Io(e, t, n, o) {
2149
2149
  };
2150
2150
  }
2151
2151
  var fd = (e) => e.origin.map((t) => t.name).join(" / "), gd = ({ property: e, candidates: t, scope: n, strings: o, disabled: a, onChange: r }) => {
2152
- const s = o.properties.query, [c, u] = A(), d = ld(e.effectiveValue) ? e.effectiveValue : void 0, l = c ?? d, m = l ? t.find((v) => v.id === l.queryId) : void 0, g = l ? Io(e.descriptor, m, l, n).diagnostics : [], b = (v) => {
2152
+ const s = o.properties.query, [d, u] = A(), c = ld(e.effectiveValue) ? e.effectiveValue : void 0, l = d ?? c, m = l ? t.find((v) => v.id === l.queryId) : void 0, g = l ? Io(e.descriptor, m, l, n).diagnostics : [], b = (v) => {
2153
2153
  if (!v) {
2154
2154
  u(void 0), r(void 0);
2155
2155
  return;
@@ -2250,26 +2250,26 @@ function vd(e, t) {
2250
2250
  }
2251
2251
  }
2252
2252
  var bd = ({ outlets: e, disabled: t, strings: n, onChange: o }) => {
2253
- const a = (u, d) => o(e.map((l, m) => m === u ? yd(d) : l)), r = (u) => o(e.filter((d, l) => l !== u)), s = (u, d) => o(wd(e, u, d)), c = () => o([...e, { name: Cd(e, n.newOutletName) }]);
2253
+ const a = (u, c) => o(e.map((l, m) => m === u ? yd(c) : l)), r = (u) => o(e.filter((c, l) => l !== u)), s = (u, c) => o(wd(e, u, c)), d = () => o([...e, { name: Cd(e, n.newOutletName) }]);
2254
2254
  return /* @__PURE__ */ h("section", {
2255
2255
  className: "studio-editor-outlets",
2256
2256
  children: [
2257
2257
  /* @__PURE__ */ i("strong", { children: n.label }),
2258
- e.map((u, d) => /* @__PURE__ */ h("fieldset", {
2258
+ e.map((u, c) => /* @__PURE__ */ h("fieldset", {
2259
2259
  className: "studio-editor-outlets__item",
2260
2260
  disabled: t,
2261
2261
  children: [
2262
2262
  /* @__PURE__ */ i("legend", { children: u.name || n.unnamed }),
2263
2263
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.name }), /* @__PURE__ */ i("input", {
2264
2264
  value: u.name,
2265
- onChange: (l) => a(d, {
2265
+ onChange: (l) => a(c, {
2266
2266
  ...u,
2267
2267
  name: l.target.value
2268
2268
  })
2269
2269
  })] }),
2270
2270
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: n.description }), /* @__PURE__ */ i("input", {
2271
2271
  value: u.description ?? "",
2272
- onChange: (l) => a(d, {
2272
+ onChange: (l) => a(c, {
2273
2273
  ...u,
2274
2274
  description: l.target.value || void 0
2275
2275
  })
@@ -2279,29 +2279,29 @@ var bd = ({ outlets: e, disabled: t, strings: n, onChange: o }) => {
2279
2279
  children: [
2280
2280
  /* @__PURE__ */ i("button", {
2281
2281
  type: "button",
2282
- disabled: d === 0,
2283
- onClick: () => s(d, d - 1),
2282
+ disabled: c === 0,
2283
+ onClick: () => s(c, c - 1),
2284
2284
  children: n.moveUp
2285
2285
  }),
2286
2286
  /* @__PURE__ */ i("button", {
2287
2287
  type: "button",
2288
- disabled: d === e.length - 1,
2289
- onClick: () => s(d, d + 1),
2288
+ disabled: c === e.length - 1,
2289
+ onClick: () => s(c, c + 1),
2290
2290
  children: n.moveDown
2291
2291
  }),
2292
2292
  /* @__PURE__ */ i("button", {
2293
2293
  type: "button",
2294
- onClick: () => r(d),
2294
+ onClick: () => r(c),
2295
2295
  children: n.remove
2296
2296
  })
2297
2297
  ]
2298
2298
  })
2299
2299
  ]
2300
- }, `${u.name}:${d}`)),
2300
+ }, `${u.name}:${c}`)),
2301
2301
  /* @__PURE__ */ i("button", {
2302
2302
  type: "button",
2303
2303
  disabled: t,
2304
- onClick: c,
2304
+ onClick: d,
2305
2305
  children: n.add
2306
2306
  })
2307
2307
  ]
@@ -2330,21 +2330,21 @@ var xt = /* @__PURE__ */ (function(e) {
2330
2330
  })({});
2331
2331
  function Sd(e, t, n) {
2332
2332
  const o = n.trim().toLocaleLowerCase(), a = /* @__PURE__ */ new Map();
2333
- for (const s of e) for (const c of s.screenTemplates ?? []) a.set(c.name, {
2334
- template: c,
2333
+ for (const s of e) for (const d of s.screenTemplates ?? []) a.set(d.name, {
2334
+ template: d,
2335
2335
  packageName: s.manifest.name,
2336
- label: c.displayName ?? c.name,
2337
- ...Td(c, t)
2336
+ label: d.displayName ?? d.name,
2337
+ ...Td(d, t)
2338
2338
  });
2339
2339
  const r = /* @__PURE__ */ new Map();
2340
2340
  for (const s of a.values()) {
2341
2341
  if (o && !Nd(s, o)) continue;
2342
- const c = s.template.metadata?.category ?? "";
2343
- r.set(c, [...r.get(c) ?? [], s]);
2342
+ const d = s.template.metadata?.category ?? "";
2343
+ r.set(d, [...r.get(d) ?? [], s]);
2344
2344
  }
2345
- return [...r.entries()].map(([s, c]) => ({
2345
+ return [...r.entries()].map(([s, d]) => ({
2346
2346
  name: s,
2347
- entries: c.sort((u, d) => u.label.localeCompare(d.label))
2347
+ entries: d.sort((u, c) => u.label.localeCompare(c.label))
2348
2348
  })).sort(Pd);
2349
2349
  }
2350
2350
  function kd(e, t) {
@@ -2372,11 +2372,11 @@ function Pd(e, t) {
2372
2372
  return e.name === "" ? t.name === "" ? 0 : 1 : t.name === "" ? -1 : e.name.localeCompare(t.name);
2373
2373
  }
2374
2374
  var Id = ({ packages: e, scope: t, selected: n, disabled: o, strings: a, onSelect: r }) => {
2375
- const [s, c] = A(""), u = Qo(), d = $(() => Sd(e, t, s), [
2375
+ const [s, d] = A(""), u = Qo(), c = $(() => Sd(e, t, s), [
2376
2376
  e,
2377
2377
  t,
2378
2378
  s
2379
- ]), l = d.some((m) => m.entries.some((g) => g.template.name === n));
2379
+ ]), l = c.some((m) => m.entries.some((g) => g.template.name === n));
2380
2380
  return /* @__PURE__ */ h("fieldset", {
2381
2381
  className: "studio-editor-template-browser",
2382
2382
  disabled: o,
@@ -2388,7 +2388,7 @@ var Id = ({ packages: e, scope: t, selected: n, disabled: o, strings: a, onSelec
2388
2388
  "aria-label": a.search,
2389
2389
  placeholder: a.search,
2390
2390
  value: s,
2391
- onChange: (m) => c(m.target.value)
2391
+ onChange: (m) => d(m.target.value)
2392
2392
  }),
2393
2393
  /* @__PURE__ */ h("label", {
2394
2394
  className: "studio-editor-template-browser__entry",
@@ -2406,11 +2406,11 @@ var Id = ({ packages: e, scope: t, selected: n, disabled: o, strings: a, onSelec
2406
2406
  className: "studio-editor-binding__missing",
2407
2407
  children: a.missing(n)
2408
2408
  }),
2409
- d.length === 0 && /* @__PURE__ */ i("p", {
2409
+ c.length === 0 && /* @__PURE__ */ i("p", {
2410
2410
  className: "studio-editor-template-browser__empty",
2411
2411
  children: a.noMatches
2412
2412
  }),
2413
- d.map((m) => /* @__PURE__ */ h("div", {
2413
+ c.map((m) => /* @__PURE__ */ h("div", {
2414
2414
  className: "studio-editor-template-browser__category",
2415
2415
  role: "group",
2416
2416
  "aria-label": m.name || a.uncategorized,
@@ -2444,9 +2444,9 @@ var Id = ({ packages: e, scope: t, selected: n, disabled: o, strings: a, onSelec
2444
2444
  }, Rd = ({ controller: e, environment: t, strings: n, disabled: o, authoringTemplate: a }) => {
2445
2445
  const r = n.properties.templates;
2446
2446
  if (a) {
2447
- const c = e.document.screenTemplates.find((d) => d.name === a);
2448
- if (!c) return null;
2449
- const u = c.metadata ?? {};
2447
+ const d = e.document.screenTemplates.find((c) => c.name === a);
2448
+ if (!d) return null;
2449
+ const u = d.metadata ?? {};
2450
2450
  return /* @__PURE__ */ h("section", {
2451
2451
  className: "studio-editor-properties__templates",
2452
2452
  children: [
@@ -2454,36 +2454,36 @@ var Id = ({ packages: e, scope: t, selected: n, disabled: o, strings: a, onSelec
2454
2454
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: r.category }), /* @__PURE__ */ i("input", {
2455
2455
  value: u.category ?? "",
2456
2456
  disabled: o,
2457
- onChange: (d) => e.setScreenTemplateMetadata(a, Ro({
2457
+ onChange: (c) => e.setScreenTemplateMetadata(a, Ro({
2458
2458
  ...u,
2459
- category: d.target.value || void 0
2459
+ category: c.target.value || void 0
2460
2460
  }), r.category)
2461
2461
  })] }),
2462
2462
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: r.scope }), /* @__PURE__ */ h("select", {
2463
2463
  value: u.scopes?.[0] ?? "",
2464
2464
  disabled: o,
2465
- onChange: (d) => e.setScreenTemplateMetadata(a, Ro({
2465
+ onChange: (c) => e.setScreenTemplateMetadata(a, Ro({
2466
2466
  ...u,
2467
- scopes: d.target.value ? [d.target.value] : void 0
2467
+ scopes: c.target.value ? [c.target.value] : void 0
2468
2468
  }), r.scope),
2469
2469
  children: [/* @__PURE__ */ i("option", {
2470
2470
  value: "",
2471
2471
  children: r.anyScope
2472
- }), Object.values(Xo).map((d) => /* @__PURE__ */ i("option", {
2473
- value: d,
2474
- children: d
2475
- }, d))]
2472
+ }), Object.values(Xo).map((c) => /* @__PURE__ */ i("option", {
2473
+ value: c,
2474
+ children: c
2475
+ }, c))]
2476
2476
  })] }),
2477
2477
  /* @__PURE__ */ i(bd, {
2478
- outlets: c.outlets ?? [],
2478
+ outlets: d.outlets ?? [],
2479
2479
  disabled: o,
2480
2480
  strings: n.properties.outlets,
2481
- onChange: (d) => e.setScreenTemplateOutlets(a, d, n.properties.outlets.label)
2481
+ onChange: (c) => e.setScreenTemplateOutlets(a, c, n.properties.outlets.label)
2482
2482
  })
2483
2483
  ]
2484
2484
  });
2485
2485
  }
2486
- const s = e.document.screens.find((c) => c.name === ge);
2486
+ const s = e.document.screens.find((d) => d.name === ge);
2487
2487
  return s ? /* @__PURE__ */ h("section", {
2488
2488
  className: "studio-editor-properties__templates",
2489
2489
  children: [/* @__PURE__ */ i("strong", { children: r.label }), /* @__PURE__ */ i(Id, {
@@ -2492,7 +2492,7 @@ var Id = ({ packages: e, scope: t, selected: n, disabled: o, strings: a, onSelec
2492
2492
  selected: s.screenTemplate,
2493
2493
  disabled: o,
2494
2494
  strings: r,
2495
- onSelect: (c) => e.setScreenTemplate(t.runtime.bundles.flatMap((u) => u.screenTemplates ?? []).find((u) => u.name === c), r.choose)
2495
+ onSelect: (d) => e.setScreenTemplate(t.runtime.bundles.flatMap((u) => u.screenTemplates ?? []).find((u) => u.name === d), r.choose)
2496
2496
  })]
2497
2497
  }) : null;
2498
2498
  };
@@ -2501,36 +2501,36 @@ function Ro(e) {
2501
2501
  return Object.keys(t).length > 0 ? t : void 0;
2502
2502
  }
2503
2503
  var Dd = ({ templates: e, referencedTemplates: t, disabled: n, strings: o, onChange: a }) => {
2504
- const r = (d, l) => a(e.map((m, g) => g === d ? xd(l) : m)), s = (d) => a(e.filter((l, m) => m !== d)), c = (d, l) => a(Fd(e, d, l)), u = () => a([...e, Od(Md(e, o.newTemplateName))]);
2504
+ const r = (c, l) => a(e.map((m, g) => g === c ? xd(l) : m)), s = (c) => a(e.filter((l, m) => m !== c)), d = (c, l) => a(Fd(e, c, l)), u = () => a([...e, Od(Md(e, o.newTemplateName))]);
2505
2505
  return /* @__PURE__ */ h("section", {
2506
2506
  className: "studio-editor-dialog-templates",
2507
2507
  children: [
2508
2508
  /* @__PURE__ */ i("strong", { children: o.label }),
2509
- e.map((d, l) => {
2510
- const m = t.has(d.name);
2509
+ e.map((c, l) => {
2510
+ const m = t.has(c.name);
2511
2511
  return /* @__PURE__ */ h("fieldset", {
2512
2512
  className: "studio-editor-dialog-templates__item",
2513
2513
  disabled: n,
2514
2514
  children: [
2515
- /* @__PURE__ */ i("legend", { children: d.displayName || d.name || o.unnamed }),
2515
+ /* @__PURE__ */ i("legend", { children: c.displayName || c.name || o.unnamed }),
2516
2516
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: o.name }), /* @__PURE__ */ i("input", {
2517
- value: d.name,
2517
+ value: c.name,
2518
2518
  onChange: (g) => r(l, {
2519
- ...d,
2519
+ ...c,
2520
2520
  name: g.target.value
2521
2521
  })
2522
2522
  })] }),
2523
2523
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: o.displayName }), /* @__PURE__ */ i("input", {
2524
- value: d.displayName ?? "",
2524
+ value: c.displayName ?? "",
2525
2525
  onChange: (g) => r(l, {
2526
- ...d,
2526
+ ...c,
2527
2527
  displayName: g.target.value || void 0
2528
2528
  })
2529
2529
  })] }),
2530
2530
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: o.description }), /* @__PURE__ */ i("input", {
2531
- value: d.description ?? "",
2531
+ value: c.description ?? "",
2532
2532
  onChange: (g) => r(l, {
2533
- ...d,
2533
+ ...c,
2534
2534
  description: g.target.value || void 0
2535
2535
  })
2536
2536
  })] }),
@@ -2540,13 +2540,13 @@ var Dd = ({ templates: e, referencedTemplates: t, disabled: n, strings: o, onCha
2540
2540
  /* @__PURE__ */ i("button", {
2541
2541
  type: "button",
2542
2542
  disabled: l === 0,
2543
- onClick: () => c(l, l - 1),
2543
+ onClick: () => d(l, l - 1),
2544
2544
  children: o.moveUp
2545
2545
  }),
2546
2546
  /* @__PURE__ */ i("button", {
2547
2547
  type: "button",
2548
2548
  disabled: l === e.length - 1,
2549
- onClick: () => c(l, l + 1),
2549
+ onClick: () => d(l, l + 1),
2550
2550
  children: o.moveDown
2551
2551
  }),
2552
2552
  /* @__PURE__ */ i("button", {
@@ -2559,7 +2559,7 @@ var Dd = ({ templates: e, referencedTemplates: t, disabled: n, strings: o, onCha
2559
2559
  ]
2560
2560
  })
2561
2561
  ]
2562
- }, `${d.name}:${l}`);
2562
+ }, `${c.name}:${l}`);
2563
2563
  }),
2564
2564
  /* @__PURE__ */ i("button", {
2565
2565
  type: "button",
@@ -2623,7 +2623,7 @@ function rt(e, t) {
2623
2623
  for (const o of Object.values(n)) rt(o, t);
2624
2624
  }
2625
2625
  var Ad = (e, t, n = !1) => ({
2626
- kind: Z.ChangeLayoutType,
2626
+ kind: X.ChangeLayoutType,
2627
2627
  nodeId: e,
2628
2628
  to: t,
2629
2629
  ...n ? { acceptLoss: !0 } : {}
@@ -2644,9 +2644,9 @@ function Ld(e, t, n) {
2644
2644
  };
2645
2645
  }
2646
2646
  var Ed = ({ inspection: e, controller: t, strings: n, disabled: o }) => {
2647
- const a = n.properties, [r, s] = A(), c = to(t.context.catalog, e.typeId), u = c?.capabilities.convertibleTo ?? [];
2648
- if (!c || u.length === 0) return null;
2649
- const d = (l) => {
2647
+ const a = n.properties, [r, s] = A(), d = to(t.context.catalog, e.typeId), u = d?.capabilities.convertibleTo ?? [];
2648
+ if (!d || u.length === 0) return null;
2649
+ const c = (l) => {
2650
2650
  const m = t.tryApply(l, a.changeLayout), g = Ld(l, m.applied, m.diagnostics);
2651
2651
  s(g.kind === "confirm" ? {
2652
2652
  lost: g.lost,
@@ -2658,10 +2658,10 @@ var Ed = ({ inspection: e, controller: t, strings: n, disabled: o }) => {
2658
2658
  children: [/* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: a.layoutType }), /* @__PURE__ */ h("select", {
2659
2659
  value: e.typeId,
2660
2660
  disabled: o,
2661
- onChange: (l) => d(Ad(e.nodeId, l.target.value)),
2661
+ onChange: (l) => c(Ad(e.nodeId, l.target.value)),
2662
2662
  children: [/* @__PURE__ */ i("option", {
2663
2663
  value: e.typeId,
2664
- children: c.label
2664
+ children: d.label
2665
2665
  }), u.map((l) => /* @__PURE__ */ i("option", {
2666
2666
  value: l,
2667
2667
  children: to(t.context.catalog, l)?.label ?? l
@@ -2698,14 +2698,14 @@ function Bd(e, t, n, o = {}) {
2698
2698
  ...o.editableFields && o.editableFields.length > 0 ? { editableFields: o.editableFields } : {}
2699
2699
  };
2700
2700
  return {
2701
- kind: Z.ExposeProperty,
2701
+ kind: X.ExposeProperty,
2702
2702
  owner: e,
2703
2703
  property: a
2704
2704
  };
2705
2705
  }
2706
2706
  function Ud(e, t, n) {
2707
2707
  return {
2708
- kind: Z.UnexposeProperty,
2708
+ kind: X.UnexposeProperty,
2709
2709
  owner: e,
2710
2710
  component: t,
2711
2711
  path: n
@@ -2719,19 +2719,19 @@ var jd = (e, t, n, o) => e.exposures.some((a) => a.owner === t && a.properties.s
2719
2719
  ], qd = ({ inspection: e, componentId: t, controller: n, strings: o, authoringTemplate: a }) => {
2720
2720
  const r = o.properties;
2721
2721
  if (a === void 0) return null;
2722
- const s = e.properties.filter((c) => c.descriptor.valueType !== x.Object && c.descriptor.group !== "Placement");
2722
+ const s = e.properties.filter((d) => d.descriptor.valueType !== x.Object && d.descriptor.group !== "Placement");
2723
2723
  return s.length === 0 ? null : /* @__PURE__ */ h("section", {
2724
2724
  className: "studio-editor-properties__exposure",
2725
- children: [/* @__PURE__ */ i("strong", { children: r.exposure }), /* @__PURE__ */ i("ul", { children: s.map((c) => {
2726
- const u = c.descriptor.path, d = jd(n.document, a, t, u), l = c.descriptor.valueType === x.Collection;
2725
+ children: [/* @__PURE__ */ i("strong", { children: r.exposure }), /* @__PURE__ */ i("ul", { children: s.map((d) => {
2726
+ const u = d.descriptor.path, c = jd(n.document, a, t, u), l = d.descriptor.valueType === x.Collection;
2727
2727
  return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ h("label", { children: [
2728
2728
  /* @__PURE__ */ i("input", {
2729
2729
  type: "checkbox",
2730
- checked: d,
2731
- onChange: (m) => n.apply(m.target.checked ? Bd(a, t, u, l ? { operations: Vd } : {}) : Ud(a, t, u), d ? r.unexposeProperty : r.exposeProperty)
2730
+ checked: c,
2731
+ onChange: (m) => n.apply(m.target.checked ? Bd(a, t, u, l ? { operations: Vd } : {}) : Ud(a, t, u), c ? r.unexposeProperty : r.exposeProperty)
2732
2732
  }),
2733
- /* @__PURE__ */ i("span", { children: c.descriptor.label }),
2734
- d && /* @__PURE__ */ i("em", { children: r.exposedToScopes })
2733
+ /* @__PURE__ */ i("span", { children: d.descriptor.label }),
2734
+ c && /* @__PURE__ */ i("em", { children: r.exposedToScopes })
2735
2735
  ] }) }, u);
2736
2736
  }) })]
2737
2737
  });
@@ -2767,31 +2767,31 @@ var Jd = ({ properties: e, controller: t, catalog: n, adapters: o, diagnostics:
2767
2767
  const s = r.properties;
2768
2768
  return /* @__PURE__ */ i("section", {
2769
2769
  className: "studio-editor-properties__icons",
2770
- children: e.map((c) => {
2771
- const { path: u, label: d } = c.descriptor, l = Or(c.effectiveValue) ? c.effectiveValue : void 0, m = `studio-editor-icon-${u}`;
2770
+ children: e.map((d) => {
2771
+ const { path: u, label: c } = d.descriptor, l = Or(d.effectiveValue) ? d.effectiveValue : void 0, m = `studio-editor-icon-${u}`;
2772
2772
  return /* @__PURE__ */ h("div", {
2773
2773
  className: "studio-editor-properties__icon",
2774
2774
  children: [
2775
2775
  /* @__PURE__ */ i("span", {
2776
2776
  id: m,
2777
2777
  className: "studio-editor-properties__icon-label",
2778
- children: d
2778
+ children: c
2779
2779
  }),
2780
2780
  /* @__PURE__ */ i(Ma, {
2781
2781
  value: l,
2782
- onChange: (g) => t.setProperty(c, g),
2782
+ onChange: (g) => t.setProperty(d, g),
2783
2783
  catalog: n,
2784
2784
  adapters: o,
2785
- allowed: Ba(c.descriptor.choices),
2786
- readOnly: !c.editable,
2785
+ allowed: Ba(d.descriptor.choices),
2786
+ readOnly: !d.editable,
2787
2787
  validationMessage: ja(a, u),
2788
2788
  strings: s.icon,
2789
2789
  pickerLabels: s.iconPickerLabels,
2790
2790
  "aria-labelledby": m
2791
2791
  }),
2792
- !c.editable && c.reason && /* @__PURE__ */ i("p", {
2792
+ !d.editable && d.reason && /* @__PURE__ */ i("p", {
2793
2793
  className: "studio-editor-properties__hint",
2794
- children: c.reason
2794
+ children: d.reason
2795
2795
  })
2796
2796
  ]
2797
2797
  }, u);
@@ -2934,8 +2934,8 @@ function au(e, t, n) {
2934
2934
  }
2935
2935
  };
2936
2936
  }
2937
- var ru = (e) => e.key === "Enter" && (e.ctrlKey || e.metaKey), iu = ({ label: e, description: t, value: n, onApply: o, readOnly: a = !1, reason: r, required: s = !1, strings: c, rows: u = 6 }) => {
2938
- const d = au(n, s, o), l = Qo(), m = d.outcome.kind === ae.Invalid ? Kd(d.outcome.problem, c) : void 0, g = [
2937
+ var ru = (e) => e.key === "Enter" && (e.ctrlKey || e.metaKey), iu = ({ label: e, description: t, value: n, onApply: o, readOnly: a = !1, reason: r, required: s = !1, strings: d, rows: u = 6 }) => {
2938
+ const c = au(n, s, o), l = Qo(), m = c.outcome.kind === ae.Invalid ? Kd(c.outcome.problem, d) : void 0, g = [
2939
2939
  t && `${l}-description`,
2940
2940
  m && `${l}-problem`,
2941
2941
  r && `${l}-reason`
@@ -2956,17 +2956,17 @@ var ru = (e) => e.key === "Enter" && (e.ctrlKey || e.metaKey), iu = ({ label: e,
2956
2956
  /* @__PURE__ */ i(zr, {
2957
2957
  id: l,
2958
2958
  className: "studio-editor-json__text",
2959
- value: d.text,
2959
+ value: c.text,
2960
2960
  rows: u,
2961
2961
  readOnly: a,
2962
2962
  invalid: m !== void 0,
2963
- placeholder: a ? void 0 : c.placeholder,
2963
+ placeholder: a ? void 0 : d.placeholder,
2964
2964
  spellCheck: !1,
2965
2965
  "aria-describedby": g,
2966
- onChange: d.edit,
2967
- onBlur: a ? void 0 : d.commit,
2966
+ onChange: c.edit,
2967
+ onBlur: a ? void 0 : c.commit,
2968
2968
  onKeyDown: (b) => {
2969
- a || (ru(b) && d.commit(), b.key === "Escape" && d.revert());
2969
+ a || (ru(b) && c.commit(), b.key === "Escape" && c.revert());
2970
2970
  }
2971
2971
  }),
2972
2972
  m && /* @__PURE__ */ i("p", {
@@ -2994,14 +2994,14 @@ var ru = (e) => e.key === "Enter" && (e.ctrlKey || e.metaKey), iu = ({ label: e,
2994
2994
  strings: o,
2995
2995
  onApply: (r) => n(a, r)
2996
2996
  }, `${t}:${a.descriptor.path}`))
2997
- }), lu = ({ id: e, label: t, value: n, destinations: o, outlets: a, dialogTemplates: r, problems: s = [], disabled: c, strings: u, onChange: d }) => {
2998
- const l = n ?? {}, m = (p) => d(uu({
2997
+ }), lu = ({ id: e, label: t, value: n, destinations: o, outlets: a, dialogTemplates: r, problems: s = [], disabled: d, strings: u, onChange: c }) => {
2998
+ const l = n ?? {}, m = (p) => c(uu({
2999
2999
  ...l,
3000
3000
  ...p
3001
- })), g = () => d(void 0), b = `${e}-outlets`, f = `${e}-dialogs`;
3001
+ })), g = () => c(void 0), b = `${e}-outlets`, f = `${e}-dialogs`;
3002
3002
  return /* @__PURE__ */ h("fieldset", {
3003
3003
  className: "studio-editor-destination",
3004
- disabled: c,
3004
+ disabled: d,
3005
3005
  children: [
3006
3006
  /* @__PURE__ */ i("legend", { children: t || u.label }),
3007
3007
  /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ i("span", { children: u.screen }), /* @__PURE__ */ h("select", {
@@ -3180,16 +3180,16 @@ function fu(e) {
3180
3180
  return e?.kind === Zo.Click;
3181
3181
  }
3182
3182
  var gu = ({ behaviors: e, targets: t, destinations: n, slices: o, strings: a, disabled: r, onChange: s }) => {
3183
- const c = pu(e), [u, d] = A(z.None), l = c.kind === z.None ? {
3183
+ const d = pu(e), [u, c] = A(z.None), l = d.kind === z.None ? {
3184
3184
  kind: u,
3185
3185
  target: ""
3186
- } : c, m = vu(l.kind, t, n, o), g = l.target !== "" && !m.some((p) => p.value === l.target), b = (p) => {
3187
- d(p), c.kind !== z.None && s(Oo(e, {
3186
+ } : d, m = vu(l.kind, t, n, o), g = l.target !== "" && !m.some((p) => p.value === l.target), b = (p) => {
3187
+ c(p), d.kind !== z.None && s(Oo(e, {
3188
3188
  kind: z.None,
3189
3189
  target: ""
3190
3190
  }));
3191
3191
  }, f = (p) => {
3192
- p === "" && c.kind === z.None || (p === "" && d(l.kind), s(Oo(e, {
3192
+ p === "" && d.kind === z.None || (p === "" && c(l.kind), s(Oo(e, {
3193
3193
  kind: l.kind,
3194
3194
  target: p
3195
3195
  })));
@@ -3336,25 +3336,25 @@ function Iu(e) {
3336
3336
  function Ru(e, t) {
3337
3337
  const n = ie(e);
3338
3338
  return Object.entries(Iu(t)).map(([o, a]) => ({
3339
- kind: Z.SetProperty,
3339
+ kind: X.SetProperty,
3340
3340
  nodeId: n,
3341
3341
  path: o,
3342
3342
  value: a
3343
3343
  }));
3344
3344
  }
3345
3345
  var Du = (e) => e.descriptor.valueType === x.QueryReference, Ou = (e, t) => e.find((n) => n.component === t), xu = /* @__PURE__ */ new Set([zn]), Fu = (e) => e.descriptor.valueType === x.Collection && !!e.descriptor.item && !xu.has(e.descriptor.path), Mu = ({ controller: e, environment: t, strings: n, ownership: o, authoringTemplate: a }) => {
3346
- const { inspection: r, selectedId: s, selection: c } = e, u = n.properties, d = $(() => cc(t.availableSources), [t.availableSources]), l = $(() => dc(e.document, e.composition.roots, e.context, t.availableSources, t.queryCandidates), [
3346
+ const { inspection: r, selectedId: s, selection: d } = e, u = n.properties, c = $(() => cc(t.availableSources), [t.availableSources]), l = $(() => dc(e.document, e.composition.roots, e.context, t.availableSources, t.queryCandidates), [
3347
3347
  e.document,
3348
3348
  e.composition.roots,
3349
3349
  e.context,
3350
3350
  t.availableSources,
3351
3351
  t.queryCandidates
3352
3352
  ]);
3353
- if (!s || !c || !r) return /* @__PURE__ */ i("p", {
3353
+ if (!s || !d || !r) return /* @__PURE__ */ i("p", {
3354
3354
  className: "studio-editor-properties-empty",
3355
3355
  children: n.noSelection
3356
3356
  });
3357
- const m = Ll(e.composition.roots, s), g = Gl(r.properties, m, c.properties), b = kc(g, r.typeId), f = new Map(r.properties.map((y) => [y.descriptor.path, y])), p = r.properties.filter(Du), v = r.properties.filter($a), k = r.properties.filter(Fu), j = r.properties.filter((y) => y.descriptor.valueType === x.Icon), _ = r.properties.filter(Tu), q = [...r.diagnostics, ...e.diagnostics], { runtime: C } = t, M = r.typeId.endsWith("action"), D = r.typeId.endsWith("toolbarButton"), W = o !== void 0 && o !== "local", S = c.properties, I = Ou(e.context.catalog.components, r.typeId), L = (y) => {
3357
+ const m = Ll(e.composition.roots, s), g = Gl(r.properties, m, d.properties), b = kc(g, r.typeId), f = new Map(r.properties.map((y) => [y.descriptor.path, y])), p = r.properties.filter(Du), v = r.properties.filter($a), k = r.properties.filter(Fu), j = r.properties.filter((y) => y.descriptor.valueType === x.Icon), _ = r.properties.filter(Tu), q = [...r.diagnostics, ...e.diagnostics], { runtime: C } = t, M = r.typeId.endsWith("action"), D = r.typeId.endsWith("toolbarButton"), W = o !== void 0 && o !== "local", S = d.properties, I = Ou(e.context.catalog.components, r.typeId), L = (y) => {
3358
3358
  const F = f.get(y.name);
3359
3359
  if (!F) return;
3360
3360
  if (F.descriptor.valueType !== x.Enum) return e.setProperty(F, y.value);
@@ -3407,14 +3407,14 @@ var Du = (e) => e.descriptor.valueType === x.QueryReference, Ou = (e, t) => e.fi
3407
3407
  strings: n,
3408
3408
  disabled: o !== void 0 && o !== "local"
3409
3409
  }),
3410
- I && st(c) && /* @__PURE__ */ h(se, { children: [/* @__PURE__ */ i(Mc, {
3411
- component: c,
3410
+ I && st(d) && /* @__PURE__ */ h(se, { children: [/* @__PURE__ */ i(Mc, {
3411
+ component: d,
3412
3412
  descriptor: I,
3413
3413
  controller: e,
3414
3414
  environment: t,
3415
3415
  strings: n
3416
3416
  }), /* @__PURE__ */ i(xc, {
3417
- component: c,
3417
+ component: d,
3418
3418
  descriptor: I,
3419
3419
  controller: e,
3420
3420
  environment: t,
@@ -3467,7 +3467,7 @@ var Du = (e) => e.descriptor.valueType === x.QueryReference, Ou = (e, t) => e.fi
3467
3467
  p.map((y) => /* @__PURE__ */ i(gd, {
3468
3468
  property: y,
3469
3469
  candidates: t.queryCandidates,
3470
- scope: d,
3470
+ scope: c,
3471
3471
  strings: n,
3472
3472
  disabled: !y.editable,
3473
3473
  onChange: (F) => G(y, F)
@@ -3482,7 +3482,7 @@ var Du = (e) => e.descriptor.valueType === x.QueryReference, Ou = (e, t) => e.fi
3482
3482
  onChange: (y) => y && e.applyAll(Ru(s, y), n.properties.action.label)
3483
3483
  }),
3484
3484
  D && /* @__PURE__ */ i(gu, {
3485
- behaviors: c.behaviors,
3485
+ behaviors: d.behaviors,
3486
3486
  targets: Ha(t, e.document),
3487
3487
  destinations: t.destinations,
3488
3488
  slices: t.stateChangeSlices,
@@ -3500,17 +3500,17 @@ var Du = (e) => e.descriptor.valueType === x.QueryReference, Ou = (e, t) => e.fi
3500
3500
  ]
3501
3501
  });
3502
3502
  }, _u = ({ property: e, componentId: t, controller: n, strings: o, destinations: a, environment: r, icons: s }) => {
3503
- const { items: c, fixed: u } = oc(e), d = Hd(s.diagnostics, e.descriptor.path), l = ac(e), m = l.fields.destination !== "readonly" || e.editable, g = [...u, ...c].filter((v) => v.destination !== void 0 || v.destinationReference !== void 0 || m), b = Ha(r, n.document), f = $u(b, e), p = (v, k) => {
3503
+ const { items: d, fixed: u } = oc(e), c = Hd(s.diagnostics, e.descriptor.path), l = ac(e), m = l.fields.destination !== "readonly" || e.editable, g = [...u, ...d].filter((v) => v.destination !== void 0 || v.destinationReference !== void 0 || m), b = Ha(r, n.document), f = $u(b, e), p = (v, k) => {
3504
3504
  n.setCollectionItemDestination(t, e.descriptor.path, v.id, k, o.properties.destination.label);
3505
3505
  };
3506
3506
  return /* @__PURE__ */ h("section", {
3507
3507
  className: "studio-editor-properties__collection",
3508
3508
  children: [/* @__PURE__ */ i(Gr, {
3509
- items: c,
3509
+ items: d,
3510
3510
  fixedItems: u,
3511
3511
  capabilities: l,
3512
3512
  destinations: a,
3513
- validation: d,
3513
+ validation: c,
3514
3514
  renderIconField: (v) => /* @__PURE__ */ i(Ma, {
3515
3515
  value: v.value,
3516
3516
  onChange: v.onChange,
@@ -3563,7 +3563,7 @@ function Fo(e) {
3563
3563
  return !!e && typeof e == "object" && !Array.isArray(e);
3564
3564
  }
3565
3565
  var Ja = ({ strings: e, controller: t, environment: n, authoringTemplate: o, structure: a, onClose: r }) => {
3566
- const [s, c] = A(Zt.Properties), u = t.selectedId ? t.ownershipOf(t.selectedId) : void 0;
3566
+ const [s, d] = A(Zt.Properties), u = t.selectedId ? t.ownershipOf(t.selectedId) : void 0;
3567
3567
  return /* @__PURE__ */ h("section", {
3568
3568
  className: "studio-editor-inspector",
3569
3569
  "aria-label": e.inspectorTitle,
@@ -3584,7 +3584,7 @@ var Ja = ({ strings: e, controller: t, environment: n, authoringTemplate: o, str
3584
3584
  className: "studio-editor-inspector__tabs",
3585
3585
  "aria-label": e.inspectorTitle,
3586
3586
  value: s,
3587
- onChange: c,
3587
+ onChange: d,
3588
3588
  tabs: [{
3589
3589
  id: Zt.Properties,
3590
3590
  label: e.propertiesTab,
@@ -3991,8 +3991,8 @@ function op(e) {
3991
3991
  return _r(t.width, t.height);
3992
3992
  }
3993
3993
  var ap = ({ windowSize: e, available: t, strings: n, onResize: o }) => {
3994
- const a = np(e, t), r = ir(e), s = op(e), c = (u, d, l) => /* @__PURE__ */ i(ze, {
3995
- icon: d,
3994
+ const a = np(e, t), r = ir(e), s = op(e), d = (u, c, l) => /* @__PURE__ */ i(ze, {
3995
+ icon: c,
3996
3996
  "aria-label": l,
3997
3997
  "aria-pressed": a === u,
3998
3998
  title: l,
@@ -4005,8 +4005,8 @@ var ap = ({ windowSize: e, available: t, strings: n, onResize: o }) => {
4005
4005
  role: "group",
4006
4006
  "aria-label": n.sizeClass(s.width, s.height),
4007
4007
  children: [
4008
- c(Me.Desktop, /* @__PURE__ */ i(sn, { "aria-hidden": "true" }), n.desktopPreview),
4009
- c(Me.Mobile, /* @__PURE__ */ i(Oi, { "aria-hidden": "true" }), n.mobilePreview),
4008
+ d(Me.Desktop, /* @__PURE__ */ i(sn, { "aria-hidden": "true" }), n.desktopPreview),
4009
+ d(Me.Mobile, /* @__PURE__ */ i(Oi, { "aria-hidden": "true" }), n.mobilePreview),
4010
4010
  /* @__PURE__ */ h("span", {
4011
4011
  className: "studio-editor-viewport-controls__size",
4012
4012
  role: "status",
@@ -4035,20 +4035,20 @@ var Cn = ({ elementId: e, tone: t, text: n }) => /* @__PURE__ */ i("div", {
4035
4035
  children: n
4036
4036
  }), Pt = /* @__PURE__ */ (function(e) {
4037
4037
  return e.Empty = "empty", e.Failed = "failed", e.Declaration = "declaration", e;
4038
- })({}), ee = /* @__PURE__ */ (function(e) {
4038
+ })({}), te = /* @__PURE__ */ (function(e) {
4039
4039
  return e.Window = "window", e.Toast = "toast", e.Tooltip = "tooltip", e.Mask = "mask", e.Busy = "busy", e;
4040
4040
  })({}), cr = {
4041
- dialog: ee.Window,
4042
- confirmDialog: ee.Window,
4043
- confirmationDialog: ee.Window,
4044
- commandDialog: ee.Window,
4045
- stepperCommandDialog: ee.Window,
4046
- overlayPanel: ee.Window,
4047
- sidebar: ee.Window,
4048
- toast: ee.Toast,
4049
- tooltip: ee.Tooltip,
4050
- blockUI: ee.Mask,
4051
- busyIndicatorDialog: ee.Busy
4041
+ dialog: te.Window,
4042
+ confirmDialog: te.Window,
4043
+ confirmationDialog: te.Window,
4044
+ commandDialog: te.Window,
4045
+ stepperCommandDialog: te.Window,
4046
+ overlayPanel: te.Window,
4047
+ sidebar: te.Window,
4048
+ toast: te.Toast,
4049
+ tooltip: te.Tooltip,
4050
+ blockUI: te.Mask,
4051
+ busyIndicatorDialog: te.Busy
4052
4052
  }, Be = (e, ...t) => {
4053
4053
  for (const n of t) {
4054
4054
  const o = e.properties?.[n];
@@ -4056,9 +4056,9 @@ var Cn = ({ elementId: e, tone: t, text: n }) => /* @__PURE__ */ i("div", {
4056
4056
  }
4057
4057
  };
4058
4058
  function rp({ kind: e, tag: t, element: n, slots: o, message: a }) {
4059
- const r = o.content ?? [], s = Be(n, "header", "title", "summary") ?? n.name ?? n.componentName, c = Be(n, "message", "detail", "text", "label"), u = () => {
4059
+ const r = o.content ?? [], s = Be(n, "header", "title", "summary") ?? n.name ?? n.componentName, d = Be(n, "message", "detail", "text", "label"), u = () => {
4060
4060
  switch (e) {
4061
- case ee.Toast:
4061
+ case te.Toast:
4062
4062
  return a ? It(a, {
4063
4063
  element: {
4064
4064
  ...n,
@@ -4073,7 +4073,7 @@ function rp({ kind: e, tag: t, element: n, slots: o, message: a }) {
4073
4073
  className: "studio-overlay-preview__body",
4074
4074
  children: s
4075
4075
  });
4076
- case ee.Tooltip:
4076
+ case te.Tooltip:
4077
4077
  return /* @__PURE__ */ h("div", {
4078
4078
  className: "studio-overlay-preview__tooltip",
4079
4079
  children: [/* @__PURE__ */ i("span", {
@@ -4085,7 +4085,7 @@ function rp({ kind: e, tag: t, element: n, slots: o, message: a }) {
4085
4085
  children: Be(n, "text") ?? s
4086
4086
  })]
4087
4087
  });
4088
- case ee.Mask:
4088
+ case te.Mask:
4089
4089
  return /* @__PURE__ */ h("div", {
4090
4090
  className: "studio-overlay-preview__masked",
4091
4091
  children: [/* @__PURE__ */ i("div", {
@@ -4099,13 +4099,13 @@ function rp({ kind: e, tag: t, element: n, slots: o, message: a }) {
4099
4099
  })
4100
4100
  })]
4101
4101
  });
4102
- case ee.Busy:
4102
+ case te.Busy:
4103
4103
  return /* @__PURE__ */ h("div", {
4104
4104
  className: "studio-overlay-preview__busy",
4105
4105
  children: [/* @__PURE__ */ i("i", {
4106
4106
  className: "pi pi-spin pi-spinner",
4107
4107
  "aria-hidden": "true"
4108
- }), /* @__PURE__ */ i("span", { children: c ?? s })]
4108
+ }), /* @__PURE__ */ i("span", { children: d ?? s })]
4109
4109
  });
4110
4110
  default:
4111
4111
  return /* @__PURE__ */ h("div", {
@@ -4118,7 +4118,7 @@ function rp({ kind: e, tag: t, element: n, slots: o, message: a }) {
4118
4118
  })]
4119
4119
  }), /* @__PURE__ */ i("div", {
4120
4120
  className: "studio-overlay-preview__body",
4121
- children: r.length > 0 ? r : c
4121
+ children: r.length > 0 ? r : d
4122
4122
  })]
4123
4123
  });
4124
4124
  }
@@ -4627,7 +4627,7 @@ function ur(e, t, n) {
4627
4627
  const o = Yn(e, t), a = n ?? {};
4628
4628
  if (!o) return { ...a };
4629
4629
  const r = { ...o };
4630
- for (const [s, c] of Object.entries(a)) c !== void 0 && (r[s] = c);
4630
+ for (const [s, d] of Object.entries(a)) d !== void 0 && (r[s] = d);
4631
4631
  return r;
4632
4632
  }
4633
4633
  function sp(e, t, n) {
@@ -4639,33 +4639,36 @@ var lp = (e) => {
4639
4639
  return t > 0 && n > 0;
4640
4640
  }, Sn = (e) => Array.from(e.children).filter((t) => !t.hasAttribute("data-studio-placeholder-for")).some((t) => lp(t) || getComputedStyle(t).display === "contents" && Sn(t)), cp = 150;
4641
4641
  function dp(e, t) {
4642
- const [n, o] = A(!0);
4642
+ const [n, o] = A(!0), a = Z(!0);
4643
4643
  return tt(() => {
4644
- const a = e.current;
4645
- if (!a) return;
4646
- let r;
4647
- const s = () => {
4648
- clearTimeout(r), Sn(a) ? o(!0) : r = setTimeout(() => o(Sn(a)), cp);
4649
- }, c = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(s), u = () => {
4650
- c?.disconnect(), Array.from(a.children).forEach((l) => c?.observe(l));
4651
- }, d = new MutationObserver(() => {
4652
- u(), s();
4644
+ const r = e.current;
4645
+ if (!r) return;
4646
+ const s = (g) => {
4647
+ a.current !== g && (a.current = g, o(g));
4648
+ };
4649
+ let d;
4650
+ const u = () => {
4651
+ clearTimeout(d), Sn(r) ? s(!0) : d = setTimeout(() => s(Sn(r)), cp);
4652
+ }, c = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(u), l = () => {
4653
+ c?.disconnect(), Array.from(r.children).forEach((g) => c?.observe(g));
4654
+ }, m = new MutationObserver(() => {
4655
+ l(), u();
4653
4656
  });
4654
- return s(), u(), d.observe(a, { childList: !0 }), () => {
4655
- clearTimeout(r), c?.disconnect(), d.disconnect();
4657
+ return u(), l(), m.observe(r, { childList: !0 }), () => {
4658
+ clearTimeout(d), c?.disconnect(), m.disconnect();
4656
4659
  };
4657
4660
  }, [e, t]), n;
4658
4661
  }
4659
- var up = ({ element: e }) => e.name || e.componentName, pp = (e) => {
4660
- const t = te(e), n = te(0);
4661
- return t.current !== e && (t.current = e, n.current += 1), n.current;
4662
+ var up = ({ element: e }) => e.name || e.componentName, pp = (e, t) => {
4663
+ const n = Z(e), o = Z(0);
4664
+ return n.current !== e && (n.current = e, t && (o.current += 1)), o.current;
4662
4665
  };
4663
4666
  function mp(e, t, n, o) {
4664
4667
  const a = (r) => {
4665
- const s = te(null), c = $(() => ({
4668
+ const s = Z(null), d = $(() => ({
4666
4669
  ...r.element,
4667
4670
  properties: ur(e, r.element.componentName, r.element.properties)
4668
- }), [r.element]), u = $(() => sp(e, r.element.componentName, r.element.properties), [r.element]), d = dr.has(_t(r.element.componentName)), l = cr[_t(r.element.componentName)], [m, g] = A(), b = dp(s, r.element), f = up(r), p = pp(r.element);
4671
+ }), [r.element]), u = $(() => sp(e, r.element.componentName, r.element.properties), [r.element]), c = dr.has(_t(r.element.componentName)), l = cr[_t(r.element.componentName)], [m, g] = A(), b = dp(s, r.element), f = up(r), p = pp(r.element, m !== void 0);
4669
4672
  return /* @__PURE__ */ h("span", {
4670
4673
  ref: s,
4671
4674
  "data-studio-element": r.element.id,
@@ -4682,17 +4685,17 @@ function mp(e, t, n, o) {
4682
4685
  children: l ? /* @__PURE__ */ i(rp, {
4683
4686
  kind: l,
4684
4687
  tag: n.overlay(f),
4685
- element: c,
4688
+ element: d,
4686
4689
  slots: r.slots,
4687
4690
  message: o
4688
4691
  }) : It(t, {
4689
4692
  ...r,
4690
- element: c
4693
+ element: d
4691
4694
  })
4692
4695
  }, p), !b && /* @__PURE__ */ i(Cn, {
4693
4696
  elementId: r.element.id,
4694
- tone: d ? Pt.Declaration : Pt.Empty,
4695
- text: d ? n.declaration(f) : n.nothingToShow(f)
4697
+ tone: c ? Pt.Declaration : Pt.Empty,
4698
+ text: c ? n.declaration(f) : n.nothingToShow(f)
4696
4699
  })]
4697
4700
  });
4698
4701
  };
@@ -4750,39 +4753,39 @@ var xe = /* @__PURE__ */ (function(e) {
4750
4753
  return t - e.left < a || e.left + e.width - t < a || n - e.top < r || e.top + e.height - n < r;
4751
4754
  }, Eo = ({ region: e, rect: t }, n, o) => e.axis === xe.Vertical ? Math.abs(n - (t.left + t.width / 2)) : Math.abs(o - (t.top + t.height / 2));
4752
4755
  function wp(e, t, n, o = 6) {
4753
- const a = e.filter((d) => d.region.kind === fe.Container);
4756
+ const a = e.filter((c) => c.region.kind === fe.Container);
4754
4757
  if (a.length === 0) return;
4755
- const r = a.map((d, l) => ({
4756
- placed: d,
4758
+ const r = a.map((c, l) => ({
4759
+ placed: c,
4757
4760
  order: l
4758
- })).filter(({ placed: d }) => bp(d.rect, t, n)).sort((d, l) => vt(d.placed.rect) - vt(l.placed.rect) || l.order - d.order).map(({ placed: d }) => d), s = r[0], c = s && r.length > 1 && yp(s.rect, t, n, o) ? r[1] : s ?? [...a].sort((d, l) => vt(l.rect) - vt(d.rect))[0], u = e.filter((d) => d.region.kind === fe.Between && d.region.containerId === c.region.containerId);
4759
- return c.region.isEmptyContainer || u.length === 0 ? {
4760
- target: c,
4761
- container: c.rect
4761
+ })).filter(({ placed: c }) => bp(c.rect, t, n)).sort((c, l) => vt(c.placed.rect) - vt(l.placed.rect) || l.order - c.order).map(({ placed: c }) => c), s = r[0], d = s && r.length > 1 && yp(s.rect, t, n, o) ? r[1] : s ?? [...a].sort((c, l) => vt(l.rect) - vt(c.rect))[0], u = e.filter((c) => c.region.kind === fe.Between && c.region.containerId === d.region.containerId);
4762
+ return d.region.isEmptyContainer || u.length === 0 ? {
4763
+ target: d,
4764
+ container: d.rect
4762
4765
  } : {
4763
- target: u.reduce((d, l) => Eo(l, t, n) < Eo(d, t, n) ? l : d),
4764
- container: c.rect
4766
+ target: u.reduce((c, l) => Eo(l, t, n) < Eo(c, t, n) ? l : c),
4767
+ container: d.rect
4765
4768
  };
4766
4769
  }
4767
4770
  var Cp = (e, t) => e?.top === t?.top && e?.left === t?.left && e?.width === t?.width && e?.height === t?.height, Sp = (e, t) => !!e && e.denied === t.denied && e.drop?.target.region.id === t.drop?.target.region.id && Cp(e.drop?.target.rect, t.drop?.target.rect);
4768
4771
  function kp(e, t, n) {
4769
- const [o, a] = A(), r = te(void 0);
4772
+ const [o, a] = A(), r = Z(void 0);
4770
4773
  r.current = o;
4771
- const [s, c] = A(), u = te(0), d = te(void 0), l = B(() => {
4772
- u.current = 0, d.current = void 0, c(void 0), a(void 0);
4773
- }, []), m = te(!1);
4774
+ const [s, d] = A(), u = Z(0), c = Z(void 0), l = B(() => {
4775
+ u.current = 0, c.current = void 0, d(void 0), a(void 0);
4776
+ }, []), m = Z(!1);
4774
4777
  pe(() => {
4775
4778
  const C = (M) => {
4776
- M.key !== "Escape" || !d.current && !u.current && !r.current || (m.current = !0, l());
4779
+ M.key !== "Escape" || !c.current && !u.current && !r.current || (m.current = !0, l());
4777
4780
  };
4778
4781
  return window.addEventListener("keydown", C, !0), () => window.removeEventListener("keydown", C, !0);
4779
4782
  }, [l]), pe(() => (window.addEventListener("dragend", l), window.addEventListener("drop", l), () => {
4780
4783
  window.removeEventListener("dragend", l), window.removeEventListener("drop", l);
4781
4784
  }), [l]);
4782
4785
  const g = B((C) => {
4783
- d.current = C, c(C);
4786
+ c.current = C, d(C);
4784
4787
  }, []), b = (C) => {
4785
- const M = d.current, { region: D } = C.target;
4788
+ const M = c.current, { region: D } = C.target;
4786
4789
  if (!M || !D.containerId) return;
4787
4790
  const W = D.kind === fe.Container ? f(D.containerId) : D.index;
4788
4791
  return vp(n.composition.roots, n.adapter, M, D.containerId, W);
@@ -4854,11 +4857,11 @@ function kn(e, t, n) {
4854
4857
  for (const r of a) {
4855
4858
  const s = pr(r);
4856
4859
  if (s.length === 0) continue;
4857
- const c = Math.min(...s.map((m) => m.left)), u = Math.min(...s.map((m) => m.top)), d = Math.max(...s.map((m) => m.right)), l = Math.max(...s.map((m) => m.bottom));
4860
+ const d = Math.min(...s.map((m) => m.left)), u = Math.min(...s.map((m) => m.top)), c = Math.max(...s.map((m) => m.right)), l = Math.max(...s.map((m) => m.bottom));
4858
4861
  return {
4859
- left: c - n.left,
4862
+ left: d - n.left,
4860
4863
  top: u - n.top,
4861
- width: d - c,
4864
+ width: c - d,
4862
4865
  height: l - u
4863
4866
  };
4864
4867
  }
@@ -4887,7 +4890,7 @@ function Np(e, t, n) {
4887
4890
  }
4888
4891
  var mr = (e, t) => e === t || !!e && !!t && e.left === t.left && e.top === t.top && e.width === t.width && e.height === t.height, Pp = (e, t) => e.length === t.length && e.every((n, o) => n.region.id === t[o].region.id && mr(n.rect, t[o].rect)), Ip = mr;
4889
4892
  function Rp(e, t, n) {
4890
- const [o, a] = A([]), [r, s] = A(), c = te([]), u = B(() => {
4893
+ const [o, a] = A([]), [r, s] = A(), d = Z([]), u = B(() => {
4891
4894
  const l = e.current;
4892
4895
  if (!l) return [];
4893
4896
  const m = l.getBoundingClientRect(), g = (f) => kn(l, f, m), b = {
@@ -4903,11 +4906,11 @@ function Rp(e, t, n) {
4903
4906
  rect: p
4904
4907
  }] : [];
4905
4908
  });
4906
- }, [e, t]), d = B(() => {
4909
+ }, [e, t]), c = B(() => {
4907
4910
  const l = e.current;
4908
4911
  if (!l) return;
4909
4912
  const m = u();
4910
- c.current = m, a((b) => Pp(b, m) ? b : m);
4913
+ d.current = m, a((b) => Pp(b, m) ? b : m);
4911
4914
  const g = n ? kn(l, n, l.getBoundingClientRect()) : void 0;
4912
4915
  s((b) => Ip(b, g) ? b : g);
4913
4916
  }, [
@@ -4916,19 +4919,19 @@ function Rp(e, t, n) {
4916
4919
  n
4917
4920
  ]);
4918
4921
  return tt(() => {
4919
- d();
4922
+ c();
4920
4923
  }), tt(() => {
4921
4924
  const l = e.current;
4922
4925
  if (!l || typeof ResizeObserver > "u") return;
4923
- const m = new ResizeObserver(d);
4926
+ const m = new ResizeObserver(c);
4924
4927
  return m.observe(l), () => m.disconnect();
4925
- }, [e, d]), tt(() => {
4928
+ }, [e, c]), tt(() => {
4926
4929
  const l = e.current;
4927
4930
  if (!l || typeof MutationObserver > "u") return;
4928
4931
  let m = 0;
4929
4932
  const g = new MutationObserver(() => {
4930
4933
  m === 0 && (m = requestAnimationFrame(() => {
4931
- m = 0, d();
4934
+ m = 0, c();
4932
4935
  }));
4933
4936
  });
4934
4937
  return g.observe(l, {
@@ -4937,7 +4940,7 @@ function Rp(e, t, n) {
4937
4940
  }), () => {
4938
4941
  g.disconnect(), m !== 0 && cancelAnimationFrame(m);
4939
4942
  };
4940
- }, [e, d]), {
4943
+ }, [e, c]), {
4941
4944
  placed: o,
4942
4945
  selectionRect: r,
4943
4946
  measureNow: u
@@ -4964,15 +4967,15 @@ function xp(e) {
4964
4967
  return n?.dataset.sceneId ?? n?.dataset.studioElement ?? n?.dataset.studioPlaceholderFor;
4965
4968
  }
4966
4969
  function Fp(e, t) {
4967
- const n = te(t);
4970
+ const n = Z(t);
4968
4971
  n.current = t, pe(() => {
4969
4972
  const o = e.current;
4970
4973
  if (!o) return;
4971
4974
  const a = (r) => {
4972
4975
  const s = r.target;
4973
4976
  if (s?.closest?.(".studio-screen-surface__chrome")) return;
4974
- const c = Op(r.type, s, r.button);
4975
- c.select && (Un(s) || o.focus({ preventScroll: !0 }), n.current(xp(s))), c.cancelDefault && r.preventDefault(), c.swallow && r.stopPropagation();
4977
+ const d = Op(r.type, s, r.button);
4978
+ d.select && (Un(s) || o.focus({ preventScroll: !0 }), n.current(xp(s))), d.cancelDefault && r.preventDefault(), d.swallow && r.stopPropagation();
4976
4979
  };
4977
4980
  for (const r of Bo) o.addEventListener(r, a, !0);
4978
4981
  return () => {
@@ -4982,7 +4985,7 @@ function Fp(e, t) {
4982
4985
  }
4983
4986
  var Mp = () => {
4984
4987
  }, _p = ({ controller: e, environment: t, resolveBinding: n = Mp, configuration: o, strings: a, viewportHeight: r }) => {
4985
- const s = te(null), { composition: c, dropRegions: u, selectedId: d } = e, { selectionRect: l, measureNow: m } = Rp(s, u, d), { feedback: g, draggedId: b, startMoving: f, endMoving: p, handlers: v } = kp(s, m, e), [k, j] = A();
4988
+ const s = Z(null), { composition: d, dropRegions: u, selectedId: c } = e, { selectionRect: l, measureNow: m } = Rp(s, u, c), { feedback: g, draggedId: b, startMoving: f, endMoving: p, handlers: v } = kp(s, m, e), [k, j] = A();
4986
4989
  tt(() => {
4987
4990
  const y = s.current?.closest("[data-studio-viewport]") ?? s.current?.parentElement;
4988
4991
  if (r !== void 0 || !y || typeof ResizeObserver > "u") return;
@@ -5012,8 +5015,8 @@ var Mp = () => {
5012
5015
  height: Ne.height
5013
5016
  };
5014
5017
  }), () => M(void 0)), [M]);
5015
- const D = $(() => ya(c.element, t.runtime.profile, t.runtime.packages), [
5016
- c,
5018
+ const D = $(() => ya(d.element, t.runtime.profile, t.runtime.packages), [
5019
+ d,
5017
5020
  t.runtime.profile,
5018
5021
  t.runtime.packages
5019
5022
  ]), W = $(() => hp(t.runtime.registry, a), [t.runtime.registry, a]), S = $(() => Qn(t.runtime), [t.runtime]), I = $(() => /* @__PURE__ */ i(ta, {
@@ -5085,8 +5088,8 @@ var Mp = () => {
5085
5088
  })]
5086
5089
  })
5087
5090
  });
5088
- }, Uo = 40, hr = ({ controller: e, environment: t, strings: n, window: o, deviceFrame: a = !1, saveFailure: r, onSave: s, isSaving: c = !1 }) => {
5089
- const u = !!e.selectedId && e.canRemove(e.selectedId), d = /* @__PURE__ */ h(se, { children: [
5091
+ }, Uo = 40, hr = ({ controller: e, environment: t, strings: n, window: o, deviceFrame: a = !1, saveFailure: r, onSave: s, isSaving: d = !1 }) => {
5092
+ const u = !!e.selectedId && e.canRemove(e.selectedId), c = /* @__PURE__ */ h(se, { children: [
5090
5093
  /* @__PURE__ */ i("span", {
5091
5094
  className: "studio-screen-editor-window__state",
5092
5095
  role: "status",
@@ -5105,7 +5108,7 @@ var Mp = () => {
5105
5108
  title: n.save,
5106
5109
  variant: "ghost",
5107
5110
  size: "small",
5108
- disabled: !e.isDirty || c,
5111
+ disabled: !e.isDirty || d,
5109
5112
  onClick: s
5110
5113
  }),
5111
5114
  /* @__PURE__ */ i(ze, {
@@ -5150,7 +5153,7 @@ var Mp = () => {
5150
5153
  role: "group",
5151
5154
  "aria-label": n.windowLabel,
5152
5155
  children: [
5153
- /* @__PURE__ */ i(tp, { controls: d }),
5156
+ /* @__PURE__ */ i(tp, { controls: c }),
5154
5157
  r && /* @__PURE__ */ h("p", {
5155
5158
  className: "studio-screen-editor-window__notice",
5156
5159
  role: "alert",
@@ -5183,18 +5186,18 @@ var Mp = () => {
5183
5186
  });
5184
5187
  };
5185
5188
  function $p(e, t, n) {
5186
- const o = e.screens.find((c) => c.name === ge);
5189
+ const o = e.screens.find((d) => d.name === ge);
5187
5190
  if (!o || o.screenTemplate === t?.name) return e;
5188
- const a = o.screenTemplate, r = e.screens.map((c) => {
5189
- if (c !== o) return c;
5190
- const { screenTemplate: u, ...d } = c;
5191
+ const a = o.screenTemplate, r = e.screens.map((d) => {
5192
+ if (d !== o) return d;
5193
+ const { screenTemplate: u, ...c } = d;
5191
5194
  return t ? {
5192
- ...d,
5195
+ ...c,
5193
5196
  screenTemplate: t.name
5194
- } : d;
5197
+ } : c;
5195
5198
  });
5196
- let s = e.screenTemplates.filter((c) => !Ap(c, a, r, n));
5197
- return t && !s.some((c) => c.name === t.name) && (s = [...s, globalThis.structuredClone(t)]), {
5199
+ let s = e.screenTemplates.filter((d) => !Ap(d, a, r, n));
5200
+ return t && !s.some((d) => d.name === t.name) && (s = [...s, globalThis.structuredClone(t)]), {
5198
5201
  ...e,
5199
5202
  screens: r,
5200
5203
  screenTemplates: s
@@ -5254,7 +5257,7 @@ function Ep(e) {
5254
5257
  function Bp(e) {
5255
5258
  if (e.targetParentId !== null)
5256
5259
  return {
5257
- kind: Z.MoveNode,
5260
+ kind: X.MoveNode,
5258
5261
  nodeId: ie(e.nodeId),
5259
5262
  target: ie(e.targetParentId),
5260
5263
  index: e.index
@@ -5262,7 +5265,7 @@ function Bp(e) {
5262
5265
  }
5263
5266
  function br(e, t, n) {
5264
5267
  return {
5265
- kind: Z.InsertNode,
5268
+ kind: X.InsertNode,
5266
5269
  target: ie(e),
5267
5270
  index: t,
5268
5271
  element: n
@@ -5270,7 +5273,7 @@ function br(e, t, n) {
5270
5273
  }
5271
5274
  function Up(e) {
5272
5275
  return {
5273
- kind: Z.RemoveNode,
5276
+ kind: X.RemoveNode,
5274
5277
  nodeId: ie(e)
5275
5278
  };
5276
5279
  }
@@ -5285,11 +5288,11 @@ var yr = (e, t) => (e?.children ?? []).map((n) => {
5285
5288
  function jp(e, t, n, o) {
5286
5289
  const a = Ye(e, t.nodeId);
5287
5290
  if (!a || t.targetParentId === null) return;
5288
- const r = At(e, t.nodeId), s = Ye(e, t.targetParentId), c = !!r && Fe(r), u = !!s && Fe(s);
5289
- if (!c && !u) return;
5290
- const d = c && u && r.id === t.targetParentId, l = d ? r.children.findIndex((g) => g.id === t.nodeId) : t.index, m = u ? gr(a, n ?? (d ? vr(a) : void 0) ?? fr(yr(s, o))) : Ep(a);
5291
+ const r = At(e, t.nodeId), s = Ye(e, t.targetParentId), d = !!r && Fe(r), u = !!s && Fe(s);
5292
+ if (!d && !u) return;
5293
+ const c = d && u && r.id === t.targetParentId, l = c ? r.children.findIndex((g) => g.id === t.nodeId) : t.index, m = u ? gr(a, n ?? (c ? vr(a) : void 0) ?? fr(yr(s, o))) : Ep(a);
5291
5294
  return [{
5292
- kind: Z.RemoveNode,
5295
+ kind: X.RemoveNode,
5293
5296
  nodeId: ie(t.nodeId)
5294
5297
  }, br(t.targetParentId, l, m)];
5295
5298
  }
@@ -5316,7 +5319,7 @@ function jo(e, t, n, o) {
5316
5319
  axis: r,
5317
5320
  isEmptyContainer: t.length === 0
5318
5321
  };
5319
- return r === xe.None || t.length === 0 ? [s] : [s, ...Array.from({ length: t.length + 1 }, (c, u) => ({
5322
+ return r === xe.None || t.length === 0 ? [s] : [s, ...Array.from({ length: t.length + 1 }, (d, u) => ({
5320
5323
  id: `${a}:between:${u}`,
5321
5324
  kind: fe.Between,
5322
5325
  containerId: e,
@@ -5392,12 +5395,12 @@ function Hp(e, t, n, o) {
5392
5395
  let a = e.document;
5393
5396
  const r = [];
5394
5397
  for (const s of t) {
5395
- const c = Dn(a, s, n);
5396
- if (r.push(...c.diagnostics), !c.applied) return {
5398
+ const d = Dn(a, s, n);
5399
+ if (r.push(...d.diagnostics), !d.applied) return {
5397
5400
  ...e,
5398
5401
  diagnostics: r
5399
5402
  };
5400
- a = c.model;
5403
+ a = d.model;
5401
5404
  }
5402
5405
  return {
5403
5406
  ...e,
@@ -5524,9 +5527,9 @@ var am = "composition";
5524
5527
  function Nn(e, t) {
5525
5528
  const n = e.screens.find((s) => s.name === ge), o = t !== void 0 ? un(t, !0) : un(void 0), a = ea(e, o).levels.filter((s) => s.kind === Dr.ScreenTemplate).map((s) => s.owner), r = [];
5526
5529
  for (const s of a) {
5527
- const c = e.screenTemplates.find((u) => u.name === s);
5528
- if (c)
5529
- for (const u of c.slots) r.push(...c.content?.[u.name] ?? []);
5530
+ const d = e.screenTemplates.find((u) => u.name === s);
5531
+ if (d)
5532
+ for (const u of d.slots) r.push(...d.content?.[u.name] ?? []);
5530
5533
  }
5531
5534
  return (t === void 0 || o.kind === Rt.Screen) && r.push(...n?.slotContent.content ?? []), {
5532
5535
  element: Mt(N.Stack, am, "Composition", r),
@@ -5573,16 +5576,16 @@ function sm(e) {
5573
5576
  }
5574
5577
  var lm = (e, t) => At(e, t)?.id;
5575
5578
  function wr(e, t, n) {
5576
- const [o, a] = A(() => zp(e.document)), r = te(void 0);
5579
+ const [o, a] = A(() => zp(e.document)), r = Z(void 0);
5577
5580
  r.current ??= new Wp(o, a);
5578
- const s = B((T) => r.current.commit(T), []), [c, u] = A(), d = te(void 0), l = B((T, O) => {
5579
- const P = d.current?.(T), R = d.current?.(O);
5581
+ const s = B((T) => r.current.commit(T), []), [d, u] = A(), c = Z(void 0), l = B((T, O) => {
5582
+ const P = c.current?.(T), R = c.current?.(O);
5580
5583
  return P && R ? {
5581
5584
  height: P.height,
5582
5585
  bottom: P.top + P.height - R.top
5583
5586
  } : void 0;
5584
5587
  }, []), m = B((T) => {
5585
- d.current = T;
5588
+ c.current = T;
5586
5589
  }, []), g = sm(n.runtime.icons), b = $(() => ({
5587
5590
  catalog: n.runtime.catalog,
5588
5591
  scope: un(t, t !== void 0),
@@ -5600,9 +5603,9 @@ function wr(e, t, n) {
5600
5603
  f,
5601
5604
  k,
5602
5605
  v
5603
- ]), _ = c ? Ye(f.roots, c) : void 0, q = $(() => c ? xn(o.document, ie(c), b) : void 0, [
5606
+ ]), _ = d ? Ye(f.roots, d) : void 0, q = $(() => d ? xn(o.document, ie(d), b) : void 0, [
5604
5607
  o.document,
5605
- c,
5608
+ d,
5606
5609
  b
5607
5610
  ]), C = B((T, O) => {
5608
5611
  const P = r.current.current, R = s((H) => Gp(H, T, b, O));
@@ -5625,10 +5628,10 @@ function wr(e, t, n) {
5625
5628
  index: O ?? R.length
5626
5629
  };
5627
5630
  }, [k, f]), S = B((T, O, P, R, H) => {
5628
- const X = W(O, P);
5629
- if (!X.parent) return;
5630
- const Ae = Ye(Nn(r.current.current.document, t).roots, X.parent), ut = Ae && Fe(Ae) ? gr(T, H ?? fr(yr(Ae, l))) : T;
5631
- C(br(X.parent, X.index, ut), R).applied && u(T.id);
5631
+ const ee = W(O, P);
5632
+ if (!ee.parent) return;
5633
+ const Ae = Ye(Nn(r.current.current.document, t).roots, ee.parent), ut = Ae && Fe(Ae) ? gr(T, H ?? fr(yr(Ae, l))) : T;
5634
+ C(br(ee.parent, ee.index, ut), R).applied && u(T.id);
5632
5635
  }, [
5633
5636
  C,
5634
5637
  W,
@@ -5658,10 +5661,10 @@ function wr(e, t, n) {
5658
5661
  });
5659
5662
  }, [s]), G = B((T, O, P) => {
5660
5663
  s((R) => {
5661
- const H = R.document.screenTemplates.map((X) => X.name === T ? {
5662
- ...X,
5664
+ const H = R.document.screenTemplates.map((ee) => ee.name === T ? {
5665
+ ...ee,
5663
5666
  outlets: O
5664
- } : X);
5667
+ } : ee);
5665
5668
  return Ie(R, {
5666
5669
  ...R.document,
5667
5670
  screenTemplates: H
@@ -5669,9 +5672,9 @@ function wr(e, t, n) {
5669
5672
  });
5670
5673
  }, [s]), y = B((T, O, P) => {
5671
5674
  s((R) => {
5672
- const H = R.document.screenTemplates.map((X) => {
5673
- if (X.name !== T) return X;
5674
- const { metadata: Ae, ...ut } = X;
5675
+ const H = R.document.screenTemplates.map((ee) => {
5676
+ if (ee.name !== T) return ee;
5677
+ const { metadata: Ae, ...ut } = ee;
5675
5678
  return O ? {
5676
5679
  ...ut,
5677
5680
  metadata: O
@@ -5688,7 +5691,7 @@ function wr(e, t, n) {
5688
5691
  dialogTemplates: T
5689
5692
  }, O));
5690
5693
  }, [s]), Y = B((T, O, P, R, H) => {
5691
- s((X) => Ie(X, Vo(X.document, T, (Ae) => cm(Ae, O, P, R)), H));
5694
+ s((ee) => Ie(ee, Vo(ee.document, T, (Ae) => cm(Ae, O, P, R)), H));
5692
5695
  }, [s]), ne = B((T, O) => {
5693
5696
  const P = n.runtime.bundles.flatMap((R) => R.screenTemplates ?? []);
5694
5697
  s((R) => Ie(R, $p(R.document, T, P), O));
@@ -5701,7 +5704,7 @@ function wr(e, t, n) {
5701
5704
  document: o.document,
5702
5705
  composition: f,
5703
5706
  context: b,
5704
- selectedId: c,
5707
+ selectedId: d,
5705
5708
  selection: _,
5706
5709
  inspection: q,
5707
5710
  diagnostics: o.diagnostics,
@@ -5723,7 +5726,7 @@ function wr(e, t, n) {
5723
5726
  C(Up(T), "Remove").applied && u((P) => P === T || P === void 0 ? O : P);
5724
5727
  },
5725
5728
  canRemove: (T) => hn(f.roots, T, v),
5726
- setProperty: (T, O) => c && M(gn(c, T, O), "Change"),
5729
+ setProperty: (T, O) => d && M(gn(d, T, O), "Change"),
5727
5730
  setScreenForms: L,
5728
5731
  setScreenTemplateOutlets: G,
5729
5732
  setScreenTemplateMetadata: y,
@@ -5786,15 +5789,15 @@ var zo = () => ({
5786
5789
  onClose: () => n.close()
5787
5790
  })
5788
5791
  });
5789
- }, pm = ({ subject: e, environment: t, strings: n, layoutLabels: o, icons: a, paletteSources: r, sourceRect: s, initialSize: c, rememberWindowAs: u, windowMemory: d, centerOffsetX: l, renderPaletteHost: m, onClose: g, onBeforeClose: b, opened: f }) => {
5792
+ }, pm = ({ subject: e, environment: t, strings: n, layoutLabels: o, icons: a, paletteSources: r, sourceRect: s, initialSize: d, rememberWindowAs: u, windowMemory: c, centerOffsetX: l, renderPaletteHost: m, onClose: g, onBeforeClose: b, opened: f }) => {
5790
5793
  const p = wr(f, e.authoringTemplate, t), v = $(() => Xa(n.layoutDrawer, o, a, r, n.packageTitles), [
5791
5794
  n,
5792
5795
  o,
5793
5796
  a,
5794
5797
  r
5795
- ]), k = $(() => d ?? Qu(), [d]), j = $(() => Xu({
5798
+ ]), k = $(() => c ?? Qu(), [c]), j = $(() => Xu({
5796
5799
  remembered: u ? k.read(u) : void 0,
5797
- saved: c,
5800
+ saved: d,
5798
5801
  lastUsed: k.readLastUsed()
5799
5802
  }, zo()), []), _ = B((y) => {
5800
5803
  u && k.write(u, y);
@@ -6036,14 +6039,14 @@ var qe = "p-anchored-overlay", bt = "p-collapsible", an = "p-overlay-mask", w =
6036
6039
  problem: t.problem,
6037
6040
  strings: e.strings
6038
6041
  });
6039
- }, bm = ({ subject: e, environment: t, strings: n, layoutLabels: o, icons: a, paletteSources: r, initialSize: s, onChange: c, renderPaletteHost: u, opened: d }) => {
6040
- const l = wr(d, e.authoringTemplate, t), [m, g] = A(s ?? Et[Me.Desktop]), [b, f] = A(!0), p = $(() => Xa(n.layoutDrawer, o, a, r, n.packageTitles), [
6042
+ }, bm = ({ subject: e, environment: t, strings: n, layoutLabels: o, icons: a, paletteSources: r, initialSize: s, onChange: d, renderPaletteHost: u, opened: c }) => {
6043
+ const l = wr(c, e.authoringTemplate, t), [m, g] = A(s ?? Et[Me.Desktop]), [b, f] = A(!0), p = $(() => Xa(n.layoutDrawer, o, a, r, n.packageTitles), [
6041
6044
  n,
6042
6045
  o,
6043
6046
  a,
6044
6047
  r
6045
- ]), v = te(c);
6046
- v.current = c, pe(() => {
6048
+ ]), v = Z(d);
6049
+ v.current = d, pe(() => {
6047
6050
  const _ = ot(l.document, e.authoringTemplate);
6048
6051
  v.current?.({
6049
6052
  document: l.document,
@@ -6326,7 +6329,7 @@ function Lm(e, t, n) {
6326
6329
  component: aa(l.manifest.name, m),
6327
6330
  displayName: m,
6328
6331
  properties: []
6329
- }))).filter((l) => !r.has(l.component)), c = [...a, ...s].map(Dm).map(Mm).map($m), u = [...c, ...Em(c, o, t)], d = new Set(Object.values(o).flat());
6332
+ }))).filter((l) => !r.has(l.component)), d = [...a, ...s].map(Dm).map(Mm).map($m), u = [...d, ...Em(d, o, t)], c = new Set(Object.values(o).flat());
6330
6333
  return {
6331
6334
  id: Am++,
6332
6335
  bundles: e,
@@ -6338,7 +6341,7 @@ function Lm(e, t, n) {
6338
6341
  ...n ? { appearance: n } : {},
6339
6342
  icons: Tm(t.packages, e),
6340
6343
  iconAdapters: Zr(e),
6341
- isKnownComponent: (l) => d.has(l),
6344
+ isKnownComponent: (l) => c.has(l),
6342
6345
  legacyTypeOf: (l) => {
6343
6346
  const m = _n(l, t, o), g = m?.package === Ho ? `${Ho}.${Ta(m.name)}` : void 0;
6344
6347
  return g !== void 0 && Im.has(g) ? g : void 0;
@@ -6348,7 +6351,7 @@ function Lm(e, t, n) {
6348
6351
  function Em(e, t, n) {
6349
6352
  const o = [];
6350
6353
  for (const a of new Set(Object.values(t).flat())) {
6351
- const r = _n(a, n, t), s = r && e.find((c) => c.component === aa(r.package, r.name));
6354
+ const r = _n(a, n, t), s = r && e.find((d) => d.component === aa(r.package, r.name));
6352
6355
  s && o.push({
6353
6356
  ...s,
6354
6357
  component: a
@@ -6437,19 +6440,19 @@ function kr(e, t) {
6437
6440
  packages: a.packages,
6438
6441
  layout: r.length > 0 ? r : void 0,
6439
6442
  theme: e.theme.length > 0 ? e.theme : void 0
6440
- }, c = new Set(o);
6443
+ }, d = new Set(o);
6441
6444
  return {
6442
6445
  selection: a,
6443
6446
  profile: s,
6444
6447
  entries: a.packages.flatMap((u) => {
6445
- const d = n.find((l) => l.name === u);
6446
- return d ? [{
6448
+ const c = n.find((l) => l.name === u);
6449
+ return c ? [{
6447
6450
  name: u,
6448
- displayName: d.displayName ?? d.name,
6449
- description: d.description,
6450
- version: d.version,
6451
- kind: d.kind,
6452
- inclusion: u === On ? rn.Fallback : c.has(u) ? rn.Explicit : rn.Automatic,
6451
+ displayName: c.displayName ?? c.name,
6452
+ description: c.description,
6453
+ version: c.version,
6454
+ kind: c.kind,
6455
+ inclusion: u === On ? rn.Fallback : d.has(u) ? rn.Explicit : rn.Automatic,
6453
6456
  requiredBy: n.filter((l) => a.packages.includes(l.name) && l.dependencies.some((m) => m.name === u)).map((l) => l.name)
6454
6457
  }] : [];
6455
6458
  }),
@@ -6460,7 +6463,7 @@ function kr(e, t) {
6460
6463
  };
6461
6464
  }
6462
6465
  function Qm(e) {
6463
- const t = e.map((s) => s.manifest), n = zm(t), o = n.find((s) => t.find((c) => c.name === s)?.kind === Dt.Blueprint) ?? "", a = {
6466
+ const t = e.map((s) => s.manifest), n = zm(t), o = n.find((s) => t.find((d) => d.name === s)?.kind === Dt.Blueprint) ?? "", a = {
6464
6467
  packages: n.filter((s) => s !== o && s !== On),
6465
6468
  shell: o,
6466
6469
  templatePacks: [],
@@ -6503,10 +6506,10 @@ var Xm = ({ document: e, runtime: t, resolveBinding: n, registry: o = t.registry
6503
6506
  a,
6504
6507
  t.profile,
6505
6508
  t.packages
6506
- ]), c = $(() => Qn(t), [t]);
6509
+ ]), d = $(() => Qn(t), [t]);
6507
6510
  return /* @__PURE__ */ i(oa, {
6508
- theme: c,
6509
- className: `studio-profile-theme ${Kn(c)}`,
6511
+ theme: d,
6512
+ className: `studio-profile-theme ${Kn(d)}`,
6510
6513
  children: /* @__PURE__ */ i(ta, {
6511
6514
  registry: t.iconAdapters,
6512
6515
  children: /* @__PURE__ */ i(va, {
@@ -6561,7 +6564,7 @@ function ah(e, t = 240) {
6561
6564
  return pe(() => {
6562
6565
  const r = e.current;
6563
6566
  if (!r || !n) return;
6564
- const s = new IntersectionObserver((c) => a(c.some((u) => u.isIntersecting)), { rootMargin: `${t}px` });
6567
+ const s = new IntersectionObserver((d) => a(d.some((u) => u.isIntersecting)), { rootMargin: `${t}px` });
6565
6568
  return s.observe(r), () => s.disconnect();
6566
6569
  }, [
6567
6570
  e,
@@ -6574,8 +6577,8 @@ var rh = [
6574
6577
  "#fa0",
6575
6578
  "#3c3"
6576
6579
  ], ih = () => {
6577
- }, Jo = 16, yg = ({ document: e, runtime: t, windowSize: n, width: o, title: a, openTitle: r, onClick: s, placeholder: c }) => {
6578
- const u = te(null), d = ah(u), l = $(() => oh(n, o ?? 240, o === void 0 ? 112 : void 0), [
6580
+ }, Jo = 16, yg = ({ document: e, runtime: t, windowSize: n, width: o, title: a, openTitle: r, onClick: s, placeholder: d }) => {
6581
+ const u = Z(null), c = ah(u), l = $(() => oh(n, o ?? 240, o === void 0 ? 112 : void 0), [
6579
6582
  n?.width,
6580
6583
  n?.height,
6581
6584
  o
@@ -6596,7 +6599,7 @@ var rh = [
6596
6599
  className: `screen-thumbnail__body ${Kn(m)}`,
6597
6600
  "data-screen-thumbnail-body": "",
6598
6601
  inert: !0,
6599
- children: d ? /* @__PURE__ */ i("div", {
6602
+ children: c ? /* @__PURE__ */ i("div", {
6600
6603
  className: "screen-thumbnail__canvas",
6601
6604
  style: {
6602
6605
  width: l.canvasWidth,
@@ -6611,7 +6614,7 @@ var rh = [
6611
6614
  resolveBinding: ih,
6612
6615
  registry: g
6613
6616
  })
6614
- }) : c
6617
+ }) : d
6615
6618
  })] });
6616
6619
  return s ? /* @__PURE__ */ i("div", {
6617
6620
  ref: u,