@nonoun/native-ui 0.2.9 → 0.3.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.
Files changed (41) hide show
  1. package/dist/{ui-layout-inspector-element.js → components.js} +2279 -386
  2. package/dist/{register-all2.js → core.js} +78 -35
  3. package/dist/custom-elements.json +1999 -1999
  4. package/dist/kernel.js +175 -174
  5. package/dist/native-ui.js +4 -49
  6. package/dist/register-all.js +4 -4
  7. package/dist/traits.js +3 -5
  8. package/dist/ui-icon.js +56 -0
  9. package/package.json +6 -9
  10. package/dist/dialog-controller.js +0 -391
  11. package/dist/inspector/build-inspector.d.ts +0 -8
  12. package/dist/inspector/build-inspector.d.ts.map +0 -1
  13. package/dist/inspector/ds-color-swatch-element.d.ts +0 -15
  14. package/dist/inspector/ds-color-swatch-element.d.ts.map +0 -1
  15. package/dist/inspector/ds-color-swatch.d.ts +0 -3
  16. package/dist/inspector/ds-color-swatch.d.ts.map +0 -1
  17. package/dist/inspector/ds-colors-element.d.ts +0 -14
  18. package/dist/inspector/ds-colors-element.d.ts.map +0 -1
  19. package/dist/inspector/ds-colors.d.ts +0 -4
  20. package/dist/inspector/ds-colors.d.ts.map +0 -1
  21. package/dist/inspector/ds-inspector-element.d.ts +0 -15
  22. package/dist/inspector/ds-inspector-element.d.ts.map +0 -1
  23. package/dist/inspector/ds-inspector.d.ts +0 -3
  24. package/dist/inspector/ds-inspector.d.ts.map +0 -1
  25. package/dist/inspector/ds-themes-element.d.ts +0 -13
  26. package/dist/inspector/ds-themes-element.d.ts.map +0 -1
  27. package/dist/inspector/ds-themes.d.ts +0 -4
  28. package/dist/inspector/ds-themes.d.ts.map +0 -1
  29. package/dist/inspector/ds-variable-element.d.ts +0 -19
  30. package/dist/inspector/ds-variable-element.d.ts.map +0 -1
  31. package/dist/inspector/ds-variable.d.ts +0 -4
  32. package/dist/inspector/ds-variable.d.ts.map +0 -1
  33. package/dist/inspector/index.d.ts +0 -10
  34. package/dist/inspector/index.d.ts.map +0 -1
  35. package/dist/inspector.css +0 -231
  36. package/dist/inspector.d.ts +0 -11
  37. package/dist/inspector.d.ts.map +0 -1
  38. package/dist/inspector.js +0 -610
  39. package/dist/list-navigate-controller.js +0 -457
  40. package/dist/ui-icon-element.js +0 -986
  41. package/dist/uid.js +0 -147
package/dist/kernel.js CHANGED
@@ -1,15 +1,16 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./uid.js";
1
+ import { Gt as e, It as t, Kt as n, Wt as r, qt as i } from "./components.js";
2
+ import { G as a } from "./core.js";
2
3
  var o = class {
3
4
  #e = /* @__PURE__ */ new Map();
4
5
  #t = [];
5
6
  #n = [];
6
- #r = r(null);
7
- #i = r(!1);
8
- #a = r(null);
7
+ #r = i(null);
8
+ #i = i(!1);
9
+ #a = i(null);
9
10
  #o = 0;
10
- lastCommand = e(() => this.#r.value);
11
- dispatching = e(() => this.#i.value);
12
- errors = e(() => this.#a.value);
11
+ lastCommand = n(() => this.#r.value);
12
+ dispatching = n(() => this.#i.value);
13
+ errors = n(() => this.#a.value);
13
14
  on(e, t) {
14
15
  if (typeof e == "string") {
15
16
  let n = e, r = this.#e.get(n);
@@ -32,24 +33,24 @@ var o = class {
32
33
  t !== -1 && this.#n.splice(t, 1);
33
34
  };
34
35
  }
35
- dispatch(e, t, n) {
36
- let r = typeof e == "string" ? Object.freeze({
36
+ dispatch(e, n, i) {
37
+ let a = typeof e == "string" ? Object.freeze({
37
38
  type: e,
38
- payload: t ?? null,
39
- id: a("cmd"),
39
+ payload: n ?? null,
40
+ id: t("cmd"),
40
41
  timestamp: Date.now(),
41
42
  source: "human",
42
- ...n ? { meta: Object.freeze(n) } : {}
43
+ ...i ? { meta: Object.freeze(i) } : {}
43
44
  }) : e, o = this.#n, s = 0, c = () => {
44
45
  if (s < o.length) {
45
46
  let e = o[s++];
46
- return e(r, c);
47
+ return e(a, c);
47
48
  }
48
- this.#s(r);
49
+ this.#s(a);
49
50
  };
50
- return c(), i(() => {
51
- this.#r.value = r;
52
- }), r;
51
+ return c(), r(() => {
52
+ this.#r.value = a;
53
+ }), a;
53
54
  }
54
55
  #s(e) {
55
56
  let t = this.#e.get(e.type);
@@ -76,15 +77,15 @@ function s() {
76
77
  return new o();
77
78
  }
78
79
  var c = class {
79
- #e = r([]);
80
- #t = r([]);
80
+ #e = i([]);
81
+ #t = i([]);
81
82
  #n = 100;
82
- undoStack = e(() => this.#e.value);
83
- redoStack = e(() => this.#t.value);
84
- canUndo = e(() => this.#e.value.length > 0);
85
- canRedo = e(() => this.#t.value.length > 0);
83
+ undoStack = n(() => this.#e.value);
84
+ redoStack = n(() => this.#t.value);
85
+ canUndo = n(() => this.#e.value.length > 0);
86
+ canRedo = n(() => this.#t.value.length > 0);
86
87
  push(e) {
87
- e.meta?.undoType && i(() => {
88
+ e.meta?.undoType && r(() => {
88
89
  let t = [...this.#e.value, e];
89
90
  t.length > this.#n && t.shift(), this.#e.value = t, this.#t.value = [];
90
91
  });
@@ -93,7 +94,7 @@ var c = class {
93
94
  let t = this.#e.value;
94
95
  if (t.length === 0) return null;
95
96
  let n = t[t.length - 1];
96
- return i(() => {
97
+ return r(() => {
97
98
  this.#e.value = t.slice(0, -1), this.#t.value = [...this.#t.value, n];
98
99
  }), e.dispatch(n.meta.undoType, n.meta.undoPayload ?? null, { planId: n.meta?.planId }), n;
99
100
  }
@@ -101,16 +102,16 @@ var c = class {
101
102
  let t = this.#t.value;
102
103
  if (t.length === 0) return null;
103
104
  let n = t[t.length - 1];
104
- i(() => {
105
+ r(() => {
105
106
  this.#t.value = t.slice(0, -1);
106
107
  let e = [...this.#e.value, n];
107
108
  e.length > this.#n && e.shift(), this.#e.value = e;
108
109
  });
109
- let r = Object.freeze({
110
+ let i = Object.freeze({
110
111
  ...n,
111
112
  source: "replay"
112
113
  });
113
- return e.dispatch(r), n;
114
+ return e.dispatch(i), n;
114
115
  }
115
116
  getLog() {
116
117
  return this.#e.value;
@@ -121,7 +122,7 @@ var c = class {
121
122
  t.length > e && (this.#e.value = t.slice(t.length - e));
122
123
  }
123
124
  clear() {
124
- i(() => {
125
+ r(() => {
125
126
  this.#e.value = [], this.#t.value = [];
126
127
  });
127
128
  }
@@ -131,27 +132,27 @@ function l(e) {
131
132
  return e !== void 0 && t.setMaxSize(e), t;
132
133
  }
133
134
  var u = 1e3, d = 10, f = class {
134
- #e = r([]);
135
+ #e = i([]);
135
136
  #t = !1;
136
137
  #n = /* @__PURE__ */ new Map();
137
- stack = e(() => this.#e.value);
138
- topOverlay = e(() => {
138
+ stack = n(() => this.#e.value);
139
+ topOverlay = n(() => {
139
140
  let e = this.#e.value;
140
141
  return e.length > 0 ? e[e.length - 1] : null;
141
142
  });
142
143
  open(e) {
143
- let t = a("overlay"), n = this.getNextZIndex(), r = Object.freeze({
144
- id: t,
144
+ let n = t("overlay"), r = this.getNextZIndex(), i = Object.freeze({
145
+ id: n,
145
146
  type: e.type,
146
147
  element: e.element,
147
- zIndex: n,
148
+ zIndex: r,
148
149
  ...e.owner ? { owner: e.owner } : {}
149
- }), i = new Promise((e) => {
150
- this.#n.set(t, e);
150
+ }), a = new Promise((e) => {
151
+ this.#n.set(n, e);
151
152
  });
152
- return this.#e.value = [...this.#e.value, r], this.#i(), {
153
- id: t,
154
- closed: i
153
+ return this.#e.value = [...this.#e.value, i], this.#i(), {
154
+ id: n,
155
+ closed: a
155
156
  };
156
157
  }
157
158
  close(e) {
@@ -213,9 +214,9 @@ function p() {
213
214
  }
214
215
  var m = 0, h = class {
215
216
  #e = [];
216
- #t = r(["global"]);
217
+ #t = i(["global"]);
217
218
  #n = !1;
218
- activeScope = e(() => {
219
+ activeScope = n(() => {
219
220
  let e = this.#t.value;
220
221
  return e[e.length - 1];
221
222
  });
@@ -397,17 +398,17 @@ function se(e) {
397
398
  return new oe(e);
398
399
  }
399
400
  var ce = class {
400
- #e = r([]);
401
+ #e = i([]);
401
402
  #t = 1e3;
402
- entries = e(() => this.#e.value);
403
- size = e(() => this.#e.value.length);
403
+ entries = n(() => this.#e.value);
404
+ size = n(() => this.#e.value.length);
404
405
  log(e) {
405
- let t = Object.freeze({
406
- id: a("log"),
406
+ let n = Object.freeze({
407
+ id: t("log"),
407
408
  timestamp: Date.now(),
408
409
  ...e
409
- }), n = [t, ...this.#e.value];
410
- return n.length > this.#t && (n.length = this.#t), this.#e.value = n, t;
410
+ }), r = [n, ...this.#e.value];
411
+ return r.length > this.#t && (r.length = this.#t), this.#e.value = r, n;
411
412
  }
412
413
  query(e) {
413
414
  let t = this.#e.value;
@@ -462,9 +463,9 @@ function le(e) {
462
463
  return e !== void 0 && t.setMaxSize(e), t;
463
464
  }
464
465
  var v = class {
465
- #e = r([]);
466
+ #e = i([]);
466
467
  #t = 500;
467
- samples = e(() => this.#e.value);
468
+ samples = n(() => this.#e.value);
468
469
  measure(e, t) {
469
470
  let n = performance.now();
470
471
  try {
@@ -521,22 +522,22 @@ function pe(e) {
521
522
  var y = class {
522
523
  #e = /* @__PURE__ */ new Map();
523
524
  #t = /* @__PURE__ */ new Map();
524
- #n = r(!1);
525
- #r = r(null);
525
+ #n = i(!1);
526
+ #r = i(null);
526
527
  #i = 0;
527
- loading = e(() => this.#n.value);
528
- error = e(() => this.#r.value);
529
- query(t) {
530
- let n = pe(t), i = t.cacheTtl ?? 0, a = this.#e.get(n);
531
- if (a && i > 0 && Date.now() - a.entry.timestamp < i) return e(() => a.signal.value);
528
+ loading = n(() => this.#n.value);
529
+ error = n(() => this.#r.value);
530
+ query(e) {
531
+ let t = pe(e), r = e.cacheTtl ?? 0, a = this.#e.get(t);
532
+ if (a && r > 0 && Date.now() - a.entry.timestamp < r) return n(() => a.signal.value);
532
533
  let o = a;
533
534
  return o || (o = {
534
535
  entry: {
535
536
  data: null,
536
537
  timestamp: 0
537
538
  },
538
- signal: r(null)
539
- }, this.#e.set(n, o)), this.#a(t, n), e(() => o.signal.value);
539
+ signal: i(null)
540
+ }, this.#e.set(t, o)), this.#a(e, t), n(() => o.signal.value);
540
541
  }
541
542
  async mutate(e, t) {
542
543
  let n, a;
@@ -545,7 +546,7 @@ var y = class {
545
546
  timestamp: Date.now()
546
547
  });
547
548
  else {
548
- let e = r(t.value);
549
+ let e = i(t.value);
549
550
  a = {
550
551
  entry: Object.freeze({
551
552
  data: t.value,
@@ -556,28 +557,28 @@ var y = class {
556
557
  }
557
558
  try {
558
559
  let n = await this.#s(e), a = pe(e);
559
- return i(() => {
560
+ return r(() => {
560
561
  let e = Object.freeze({
561
562
  data: n,
562
563
  timestamp: Date.now()
563
- }), i = this.#e.get(a);
564
- if (i ? (i.signal.value = n, i.entry = e) : this.#e.set(a, {
564
+ }), r = this.#e.get(a);
565
+ if (r ? (r.signal.value = n, r.entry = e) : this.#e.set(a, {
565
566
  entry: e,
566
- signal: r(n)
567
+ signal: i(n)
567
568
  }), t && t.key !== a) {
568
569
  let r = this.#e.get(t.key);
569
570
  r && (r.signal.value = n, r.entry = e);
570
571
  }
571
572
  }), n;
572
573
  } catch (e) {
573
- t && a && i(() => {
574
+ t && a && r(() => {
574
575
  a.signal.value = n, a.entry = Object.freeze({
575
576
  data: n,
576
577
  timestamp: Date.now()
577
578
  });
578
579
  });
579
- let r = e instanceof Error ? e : Error(String(e));
580
- throw this.#r.value = r, r;
580
+ let i = e instanceof Error ? e : Error(String(e));
581
+ throw this.#r.value = i, i;
581
582
  }
582
583
  }
583
584
  invalidate(e) {
@@ -603,7 +604,7 @@ var y = class {
603
604
  this.#t.clear();
604
605
  }
605
606
  destroy() {
606
- this.abortAll(), this.#e.clear(), i(() => {
607
+ this.abortAll(), this.#e.clear(), r(() => {
607
608
  this.#n.value = !1, this.#r.value = null;
608
609
  }), this.#i = 0;
609
610
  }
@@ -611,14 +612,14 @@ var y = class {
611
612
  this.#c();
612
613
  try {
613
614
  let n = await this.#o(e);
614
- i(() => {
615
+ r(() => {
615
616
  let e = Object.freeze({
616
617
  data: n,
617
618
  timestamp: Date.now()
618
- }), i = this.#e.get(t);
619
- i ? (i.signal.value = n, i.entry = e) : this.#e.set(t, {
619
+ }), r = this.#e.get(t);
620
+ r ? (r.signal.value = n, r.entry = e) : this.#e.set(t, {
620
621
  entry: e,
621
- signal: r(n)
622
+ signal: i(n)
622
623
  }), this.#r.value = null;
623
624
  });
624
625
  } catch (e) {
@@ -691,11 +692,11 @@ var y = class {
691
692
  function me() {
692
693
  return new y();
693
694
  }
694
- function x(e, t) {
695
+ function x(e, n) {
695
696
  return Object.freeze({
696
- id: a("bind"),
697
+ id: t("bind"),
697
698
  source: e,
698
- ...t
699
+ ...n
699
700
  });
700
701
  }
701
702
  var he = new Set(/* @__PURE__ */ "alert.alertdialog.application.article.banner.button.cell.checkbox.columnheader.combobox.complementary.contentinfo.definition.dialog.directory.document.feed.figure.form.grid.gridcell.group.heading.img.link.list.listbox.listitem.log.main.marquee.math.menu.menubar.menuitem.menuitemcheckbox.menuitemradio.meter.navigation.none.note.option.presentation.progressbar.radio.radiogroup.region.row.rowgroup.rowheader.scrollbar.search.searchbox.separator.slider.spinbutton.status.switch.tab.table.tablist.tabpanel.term.textbox.timer.toolbar.tooltip.tree.treegrid.treeitem".split(".")), ge = new Set([
@@ -1065,21 +1066,21 @@ function E(e, t) {
1065
1066
  return !1;
1066
1067
  }
1067
1068
  var D = class {
1068
- #e = r([]);
1069
- #t = r([]);
1069
+ #e = i([]);
1070
+ #t = i([]);
1070
1071
  #n = /* @__PURE__ */ new Map();
1071
- #r = r(null);
1072
- #i = r(0);
1073
- capabilities = e(() => this.#e.value);
1074
- rules = e(() => this.#t.value);
1075
- lastDecision = e(() => this.#r.value);
1076
- deniedCount = e(() => this.#i.value);
1072
+ #r = i(null);
1073
+ #i = i(0);
1074
+ capabilities = n(() => this.#e.value);
1075
+ rules = n(() => this.#t.value);
1076
+ lastDecision = n(() => this.#r.value);
1077
+ deniedCount = n(() => this.#i.value);
1077
1078
  grant(e) {
1078
- let t = a("cap"), n = Object.freeze({
1079
- id: t,
1079
+ let n = t("cap"), r = Object.freeze({
1080
+ id: n,
1080
1081
  ...e
1081
1082
  });
1082
- return this.#e.value = [...this.#e.value, n], t;
1083
+ return this.#e.value = [...this.#e.value, r], n;
1083
1084
  }
1084
1085
  revoke(e) {
1085
1086
  let t = this.#e.value.filter((t) => t.id !== e);
@@ -1093,11 +1094,11 @@ var D = class {
1093
1094
  return this.#e.value.some((n) => n.name === e && (n.expiresAt === void 0 || n.expiresAt > t));
1094
1095
  }
1095
1096
  addRule(e) {
1096
- let t = a("rule"), n = Object.freeze({
1097
- id: t,
1097
+ let n = t("rule"), r = Object.freeze({
1098
+ id: n,
1098
1099
  ...e
1099
1100
  });
1100
- return this.#t.value = [...this.#t.value, n], t;
1101
+ return this.#t.value = [...this.#t.value, r], n;
1101
1102
  }
1102
1103
  removeRule(e) {
1103
1104
  let t = this.#t.value.filter((t) => t.id !== e);
@@ -1126,13 +1127,13 @@ var D = class {
1126
1127
  middleware() {
1127
1128
  return (e, t) => {
1128
1129
  let n = this.evaluate(e);
1129
- if (i(() => {
1130
+ if (r(() => {
1130
1131
  this.#r.value = n, n.allowed || (this.#i.value = this.#i.value + 1);
1131
1132
  }), n.allowed) return t();
1132
1133
  };
1133
1134
  }
1134
1135
  destroy() {
1135
- i(() => {
1136
+ r(() => {
1136
1137
  this.#e.value = [], this.#t.value = [], this.#r.value = null, this.#i.value = 0;
1137
1138
  }), this.#n.clear();
1138
1139
  }
@@ -1716,12 +1717,12 @@ function mt(e) {
1716
1717
  /**
1717
1718
  * Wrap a conversion result as a UIPlan.
1718
1719
  */
1719
- function ht(e, t = "generated") {
1720
+ function ht(e, n = "generated") {
1720
1721
  return Object.freeze({
1721
- id: a("a2ui-plan"),
1722
+ id: t("a2ui-plan"),
1722
1723
  version: 1,
1723
1724
  root: e.root,
1724
- source: t,
1725
+ source: n,
1725
1726
  timestamp: Date.now()
1726
1727
  });
1727
1728
  }
@@ -1758,48 +1759,48 @@ var L = class {
1758
1759
  #t;
1759
1760
  #n;
1760
1761
  #r = /* @__PURE__ */ new Map();
1761
- #i = r(0);
1762
- surfaceCount = e(() => this.#i.value);
1762
+ #i = i(0);
1763
+ surfaceCount = n(() => this.#i.value);
1763
1764
  constructor(e, t, n) {
1764
1765
  this.#e = e, this.#t = t, this.#n = n ?? null;
1765
1766
  }
1766
1767
  handleMessage(e, t) {
1767
1768
  Ye(e) ? this.#a(e, t) : Xe(e) ? this.#o(e, t) : Ze(e) ? this.#l(e) : Qe(e) && this.#u(e);
1768
1769
  }
1769
- #a(e, t) {
1770
- let { surfaceId: n, catalogId: i, theme: o } = e.createSurface, s = this.#r.get(n);
1770
+ #a(e, n) {
1771
+ let { surfaceId: r, catalogId: a, theme: o } = e.createSurface, s = this.#r.get(r);
1771
1772
  if (s) {
1772
- s.catalogId = i, s.theme = o;
1773
+ s.catalogId = a, s.theme = o;
1773
1774
  return;
1774
1775
  }
1775
1776
  let c = {
1776
- surfaceId: n,
1777
- planId: a("a2ui-plan"),
1778
- catalogId: i,
1777
+ surfaceId: r,
1778
+ planId: t("a2ui-plan"),
1779
+ catalogId: a,
1779
1780
  theme: o,
1780
- container: t ?? document.createElement("div"),
1781
+ container: n ?? document.createElement("div"),
1781
1782
  components: [],
1782
- dataModel: r({}),
1783
+ dataModel: i({}),
1783
1784
  bindings: /* @__PURE__ */ new Map(),
1784
1785
  bindingDisposers: [],
1785
1786
  actionDisposer: null,
1786
1787
  rendered: !1
1787
1788
  };
1788
- this.#r.set(n, c), this.#i.value = this.#r.size;
1789
- }
1790
- #o(e, t) {
1791
- let { surfaceId: n, components: i } = e.updateComponents, o = this.#r.get(n);
1792
- o ? t && (o.container = t) : (o = {
1793
- surfaceId: n,
1794
- planId: a("a2ui-plan"),
1795
- container: t ?? document.createElement("div"),
1789
+ this.#r.set(r, c), this.#i.value = this.#r.size;
1790
+ }
1791
+ #o(e, n) {
1792
+ let { surfaceId: r, components: a } = e.updateComponents, o = this.#r.get(r);
1793
+ o ? n && (o.container = n) : (o = {
1794
+ surfaceId: r,
1795
+ planId: t("a2ui-plan"),
1796
+ container: n ?? document.createElement("div"),
1796
1797
  components: [],
1797
- dataModel: r({}),
1798
+ dataModel: i({}),
1798
1799
  bindings: /* @__PURE__ */ new Map(),
1799
1800
  bindingDisposers: [],
1800
1801
  actionDisposer: null,
1801
1802
  rendered: !1
1802
- }, this.#r.set(n, o), this.#i.value = this.#r.size), o.rendered ? (this.#c(o, i), o.components = [...i]) : (o.components = [...i], this.#s(o)), o.rendered && this.#n?.(o.surfaceId, o.container);
1803
+ }, this.#r.set(r, o), this.#i.value = this.#r.size), o.rendered ? (this.#c(o, a), o.components = [...a]) : (o.components = [...a], this.#s(o)), o.rendered && this.#n?.(o.surfaceId, o.container);
1803
1804
  }
1804
1805
  #s(e) {
1805
1806
  let t = P(e.components, { surfaceId: e.surfaceId });
@@ -1841,15 +1842,15 @@ var L = class {
1841
1842
  n.bindingDisposers = [], n.actionDisposer?.(), this.#r.delete(t), this.#i.value = this.#r.size;
1842
1843
  }
1843
1844
  }
1844
- #d(e, n) {
1845
- for (let [r, i] of e.bindings) {
1845
+ #d(t, n) {
1846
+ for (let [r, i] of t.bindings) {
1846
1847
  let a = n.get(r);
1847
1848
  if (a) for (let n of i) {
1848
- let r = t(() => {
1849
- let t = e.dataModel.value, r = I(t, n.path);
1849
+ let r = e(() => {
1850
+ let e = t.dataModel.value, r = I(e, n.path);
1850
1851
  r !== void 0 && (n.property === "textContent" ? a.textContent = String(r) : n.property === "src" || n.property === "alt" || n.property.startsWith("aria-") ? a.setAttribute(n.property, String(r)) : a[n.property] = r);
1851
1852
  });
1852
- e.bindingDisposers.push(r);
1853
+ t.bindingDisposers.push(r);
1853
1854
  }
1854
1855
  }
1855
1856
  }
@@ -2121,10 +2122,10 @@ var Et = class {
2121
2122
  perf;
2122
2123
  data;
2123
2124
  policy;
2124
- #e = r(/* @__PURE__ */ new Map());
2125
+ #e = i(/* @__PURE__ */ new Map());
2125
2126
  #t;
2126
2127
  #n = null;
2127
- registry = e(() => this.#e.value);
2128
+ registry = n(() => this.#e.value);
2128
2129
  /** Lazy-initialized A2UI protocol adapter. Only created on first access. */
2129
2130
  get a2ui() {
2130
2131
  return this.#n ||= new R(this), this.#n;
@@ -2142,8 +2143,8 @@ var Et = class {
2142
2143
  }), i = new Map(this.#e.peek());
2143
2144
  i.set(r.tag, r), this.#e.value = i;
2144
2145
  }
2145
- registerAndDefine(e, t, r) {
2146
- this.register(e, t, r), n(e, t);
2146
+ registerAndDefine(e, t, n) {
2147
+ this.register(e, t, n), a(e, t);
2147
2148
  }
2148
2149
  executePlan(e, t) {
2149
2150
  let n = this.perf.measure("plan:execute", () => this.executor.execute(e, t, this.bus, { allowUnregistered: this.#t.allowUnregistered }));
@@ -2172,7 +2173,7 @@ function Dt(e) {
2172
2173
  function Ot() {
2173
2174
  z &&= (z.destroy(), null);
2174
2175
  }
2175
- var kt = 200, At = class t {
2176
+ var kt = 200, At = class e {
2176
2177
  #e;
2177
2178
  #t;
2178
2179
  #n;
@@ -2185,44 +2186,44 @@ var kt = 200, At = class t {
2185
2186
  context;
2186
2187
  history;
2187
2188
  running;
2188
- constructor(t, n) {
2189
- this.#e = t, this.#t = n, this.#n = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#c(t.states, void 0), this.#i = r(t.initial), this.#a = r(t.context ? Object.freeze({ ...t.context }) : Object.freeze({})), this.#o = r(Object.freeze([])), this.#s = r(!1), this.currentState = e(() => this.#i.value), this.context = e(() => this.#a.value), this.history = e(() => this.#o.value), this.running = e(() => this.#s.value);
2189
+ constructor(e, t) {
2190
+ this.#e = e, this.#t = t, this.#n = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#c(e.states, void 0), this.#i = i(e.initial), this.#a = i(e.context ? Object.freeze({ ...e.context }) : Object.freeze({})), this.#o = i(Object.freeze([])), this.#s = i(!1), this.currentState = n(() => this.#i.value), this.context = n(() => this.#a.value), this.history = n(() => this.#o.value), this.running = n(() => this.#s.value);
2190
2191
  }
2191
2192
  #c(e, t) {
2192
2193
  for (let n of e) this.#n.set(n.id, n), t !== void 0 && this.#r.set(n.id, t), n.children && this.#c(n.children, n.id);
2193
2194
  }
2194
2195
  start() {
2195
- this.#s.peek() || i(() => {
2196
+ this.#s.peek() || r(() => {
2196
2197
  this.#s.value = !0, this.#l(this.#e.initial);
2197
2198
  });
2198
2199
  }
2199
- send(e, t) {
2200
+ send(e, n) {
2200
2201
  if (!this.#s.peek()) return null;
2201
- let n = this.#i.peek(), r = this.#a.peek(), o = this.#p(n, e), s = [], c = [], l = null;
2202
+ let i = this.#i.peek(), a = this.#a.peek(), o = this.#p(i, e), s = [], c = [], l = null;
2202
2203
  for (let e of o) if (e.guard) {
2203
2204
  let t = e.guard.name || `${e.from}->${e.to}`;
2204
- e.guard(r) ? (s.push(t), l ||= e) : c.push(t);
2205
+ e.guard(a) ? (s.push(t), l ||= e) : c.push(t);
2205
2206
  } else l ||= e;
2206
2207
  if (!l) return null;
2207
2208
  let u = Object.freeze({
2208
- id: a("wf"),
2209
+ id: t("wf"),
2209
2210
  timestamp: Date.now(),
2210
2211
  event: e,
2211
- from: n,
2212
+ from: i,
2212
2213
  to: l.to,
2213
2214
  guardsPassed: Object.freeze(s),
2214
2215
  guardsBlocked: Object.freeze(c),
2215
2216
  action: l.action
2216
2217
  });
2217
- return i(() => {
2218
- this.#u(n), l.action && this.#m(l.action, {
2218
+ return r(() => {
2219
+ this.#u(i), l.action && this.#m(l.action, {
2219
2220
  event: e,
2220
- data: t
2221
+ data: n
2221
2222
  }), this.#h(u), this.#i.value = l.to, this.#l(l.to);
2222
2223
  }), u;
2223
2224
  }
2224
2225
  stop() {
2225
- this.#s.peek() && i(() => {
2226
+ this.#s.peek() && r(() => {
2226
2227
  this.#u(this.#i.peek()), this.#s.value = !1;
2227
2228
  });
2228
2229
  }
@@ -2269,14 +2270,14 @@ var kt = 200, At = class t {
2269
2270
  timestamp: Date.now()
2270
2271
  });
2271
2272
  }
2272
- static restore(e, n, r) {
2273
- let a = new t(n, r);
2274
- return i(() => {
2275
- a.#i.value = e.currentState, a.#a.value = Object.freeze({ ...e.context }), a.#o.value = Object.freeze([...e.history]), a.#s.value = !0;
2273
+ static restore(t, n, i) {
2274
+ let a = new e(n, i);
2275
+ return r(() => {
2276
+ a.#i.value = t.currentState, a.#a.value = Object.freeze({ ...t.context }), a.#o.value = Object.freeze([...t.history]), a.#s.value = !0;
2276
2277
  }), a;
2277
2278
  }
2278
2279
  destroy() {
2279
- i(() => {
2280
+ r(() => {
2280
2281
  this.#s.peek() && this.#u(this.#i.peek()), this.#s.value = !1, this.#o.value = Object.freeze([]), this.#n.clear(), this.#r.clear();
2281
2282
  });
2282
2283
  }
@@ -2450,53 +2451,53 @@ function zt(e) {
2450
2451
  }
2451
2452
  var Bt = class {
2452
2453
  #e;
2453
- #t = r([]);
2454
+ #t = i([]);
2454
2455
  #n = /* @__PURE__ */ new Map();
2455
2456
  #r = /* @__PURE__ */ new Map();
2456
- activeBindings = e(() => this.#t.value);
2457
+ activeBindings = n(() => this.#t.value);
2457
2458
  constructor(e) {
2458
2459
  this.#e = e;
2459
2460
  }
2460
- bind(e, n, r, i, o) {
2461
- let s = x(i.source, {
2462
- method: i.method,
2463
- headers: i.headers,
2464
- cacheTtl: i.cacheTtl
2465
- }), c = this.#e.query(s), l = t(() => {
2461
+ bind(n, r, i, a, o) {
2462
+ let s = x(a.source, {
2463
+ method: a.method,
2464
+ headers: a.headers,
2465
+ cacheTtl: a.cacheTtl
2466
+ }), c = this.#e.query(s), l = e(() => {
2466
2467
  let e = c.value;
2467
2468
  if (e === null) return;
2468
- let t = i.transform ? Rt(e, i.transform) : e;
2469
- switch (i.target) {
2469
+ let t = a.transform ? Rt(e, a.transform) : e;
2470
+ switch (a.target) {
2470
2471
  case "textContent":
2471
- r.textContent = String(t ?? "");
2472
+ i.textContent = String(t ?? "");
2472
2473
  break;
2473
2474
  case "attribute":
2474
- i.targetName && t != null && r.setAttribute(i.targetName, String(t));
2475
+ a.targetName && t != null && i.setAttribute(a.targetName, String(t));
2475
2476
  break;
2476
2477
  case "property":
2477
- i.targetName && (r[i.targetName] = t);
2478
+ a.targetName && (i[a.targetName] = t);
2478
2479
  break;
2479
2480
  case "children":
2480
- Array.isArray(t) && this.#o(r, t, o);
2481
+ Array.isArray(t) && this.#o(i, t, o);
2481
2482
  break;
2482
2483
  }
2483
- }), u = a("dbind"), d;
2484
- i.refreshInterval && i.refreshInterval > 0 && (d = setInterval(() => {
2484
+ }), u = t("dbind"), d;
2485
+ a.refreshInterval && a.refreshInterval > 0 && (d = setInterval(() => {
2485
2486
  this.#e.invalidate(zt(s)), this.#e.query(s);
2486
- }, i.refreshInterval)), this.#n.set(u, {
2487
+ }, a.refreshInterval)), this.#n.set(u, {
2487
2488
  effectDispose: l,
2488
2489
  intervalId: d
2489
2490
  });
2490
2491
  let f = Object.freeze({
2491
2492
  id: u,
2492
- planId: e,
2493
- nodeId: n,
2494
- binding: i,
2493
+ planId: n,
2494
+ nodeId: r,
2495
+ binding: a,
2495
2496
  dispose: () => {
2496
- this.#i(u), this.#t.value = this.#t.value.filter((e) => e.id !== u), this.#a(e, u);
2497
+ this.#i(u), this.#t.value = this.#t.value.filter((e) => e.id !== u), this.#a(n, u);
2497
2498
  }
2498
- }), p = this.#r.get(e);
2499
- return p || (p = /* @__PURE__ */ new Set(), this.#r.set(e, p)), p.add(u), this.#t.value = [...this.#t.value, f], f;
2499
+ }), p = this.#r.get(n);
2500
+ return p || (p = /* @__PURE__ */ new Set(), this.#r.set(n, p)), p.add(u), this.#t.value = [...this.#t.value, f], f;
2500
2501
  }
2501
2502
  bindPlan(e, t, n, r) {
2502
2503
  let i = [];
@@ -3557,20 +3558,20 @@ var Tn = class e {
3557
3558
  constructor(e) {
3558
3559
  this.#e = e ?? /* @__PURE__ */ new Map();
3559
3560
  }
3560
- generate(e, t) {
3561
+ generate(e, n) {
3561
3562
  this.#t = 0;
3562
- let n = this.#n(e), r = Cn({
3563
- id: e.id ?? a("plan"),
3563
+ let r = this.#n(e), i = Cn({
3564
+ id: e.id ?? t("plan"),
3564
3565
  version: 1,
3565
- root: n,
3566
- source: t ?? "generated",
3566
+ root: r,
3567
+ source: n ?? "generated",
3567
3568
  timestamp: Date.now()
3568
3569
  });
3569
3570
  return Cn({
3570
- plan: r,
3571
- validation: g(r, this.#e, { allowUnregistered: !0 }),
3572
- accessibility: w(r.root),
3573
- warnings: Object.freeze(this.#c(e, r))
3571
+ plan: i,
3572
+ validation: g(i, this.#e, { allowUnregistered: !0 }),
3573
+ accessibility: w(i.root),
3574
+ warnings: Object.freeze(this.#c(e, i))
3574
3575
  });
3575
3576
  }
3576
3577
  #n(e) {