@tachui/core 0.7.1-alpha → 0.8.0-alpha

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 (265) hide show
  1. package/README.md +2 -2
  2. package/dist/bundles/common.d.ts +1 -1
  3. package/dist/bundles/common.d.ts.map +1 -1
  4. package/dist/bundles/minimal.d.ts +2 -16
  5. package/dist/bundles/minimal.d.ts.map +1 -1
  6. package/dist/bundles/production-minimal.d.ts +2 -16
  7. package/dist/bundles/production-minimal.d.ts.map +1 -1
  8. package/dist/common.js +403 -827
  9. package/dist/compiler/advanced-parser.d.ts.map +1 -1
  10. package/dist/compiler/index.js +14 -8
  11. package/dist/component-XAzF1xqs.js +487 -0
  12. package/dist/component-base-x2XmHFjy.js +255 -0
  13. package/dist/components/index.d.ts +4 -38
  14. package/dist/components/index.d.ts.map +1 -1
  15. package/dist/components/index.js +7 -4167
  16. package/dist/components/wrapper.d.ts +5 -152
  17. package/dist/components/wrapper.d.ts.map +1 -1
  18. package/dist/concatenated-component-ByPl3_FF.js +2933 -0
  19. package/dist/constants/index.d.ts +1 -1
  20. package/dist/constants/layout.d.ts +47 -4
  21. package/dist/constants/layout.d.ts.map +1 -1
  22. package/dist/constants/layout.js +84 -0
  23. package/dist/css-classes/index.js +176 -0
  24. package/dist/{dom-bridge-Cx-s6Ihx.js → dom-bridge-CAa1N2zX.js} +28 -28
  25. package/dist/{effect-CytAc9em.js → effect-B9Knft0b.js} +3 -3
  26. package/dist/essential.js +395 -825
  27. package/dist/index-DCPJFUm9.js +1407 -0
  28. package/dist/index-DIvMCJQO.js +268 -0
  29. package/dist/index-vdsiw6gQ.js +777 -0
  30. package/dist/index.d.ts +9 -9
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +395 -825
  33. package/dist/minimal-prod.js +101 -155
  34. package/dist/minimal.js +104 -170
  35. package/dist/modifiers/background.d.ts +41 -11
  36. package/dist/modifiers/background.d.ts.map +1 -1
  37. package/dist/modifiers/base.d.ts +6 -33
  38. package/dist/modifiers/base.d.ts.map +1 -1
  39. package/dist/modifiers/base.js +487 -0
  40. package/dist/modifiers/builder.d.ts +103 -195
  41. package/dist/modifiers/builder.d.ts.map +1 -1
  42. package/dist/modifiers/builder.js +9 -0
  43. package/dist/modifiers/core.d.ts +9 -401
  44. package/dist/modifiers/core.d.ts.map +1 -1
  45. package/dist/modifiers/{utils.d.ts → factories.d.ts} +18 -5
  46. package/dist/modifiers/factories.d.ts.map +1 -0
  47. package/dist/modifiers/index.d.ts +8 -52
  48. package/dist/modifiers/index.d.ts.map +1 -1
  49. package/dist/modifiers/index.js +38 -0
  50. package/dist/modifiers/presets.d.ts +368 -0
  51. package/dist/modifiers/presets.d.ts.map +1 -0
  52. package/dist/modifiers/registry.js +10 -0
  53. package/dist/modifiers/types.d.ts +39 -211
  54. package/dist/modifiers/types.d.ts.map +1 -1
  55. package/dist/modifiers/types.js +4 -0
  56. package/dist/performance-optimizer-stub-CtfXUwl4.js +38 -0
  57. package/dist/plugins/index.d.ts +5 -6
  58. package/dist/plugins/index.d.ts.map +1 -1
  59. package/dist/plugins/index.js +147 -297
  60. package/dist/plugins/simplified-index.d.ts +5 -6
  61. package/dist/plugins/simplified-index.d.ts.map +1 -1
  62. package/dist/production-minimal-BY_gMc-l.js +2532 -0
  63. package/dist/reactive/index.js +96 -95
  64. package/dist/reactive/types.js +4 -0
  65. package/dist/runtime/dom-bridge.js +5 -5
  66. package/dist/runtime/element-override.d.ts.map +1 -1
  67. package/dist/runtime/index.d.ts +0 -7
  68. package/dist/runtime/index.d.ts.map +1 -1
  69. package/dist/runtime/renderer.d.ts.map +1 -1
  70. package/dist/runtime/renderer.js +7 -8
  71. package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
  72. package/dist/runtime/types.js +1 -0
  73. package/dist/{scheduler-7SvC3a21.js → scheduler-BKeqwrYE.js} +130 -130
  74. package/dist/validation/build-time-stub.d.ts +33 -0
  75. package/dist/validation/build-time-stub.d.ts.map +1 -0
  76. package/dist/validation/debug-tools-stub.d.ts +67 -0
  77. package/dist/validation/debug-tools-stub.d.ts.map +1 -0
  78. package/dist/validation/index.d.ts +23 -78
  79. package/dist/validation/index.d.ts.map +1 -1
  80. package/dist/validation/index.js +609 -6470
  81. package/dist/validation/lifecycle-validation.d.ts.map +1 -1
  82. package/dist/validation/performance-optimizer-stub.d.ts +50 -0
  83. package/dist/validation/performance-optimizer-stub.d.ts.map +1 -0
  84. package/dist/validation/plugin-registration.d.ts +5 -1
  85. package/dist/validation/plugin-registration.d.ts.map +1 -1
  86. package/dist/validation/production-bypass-core.d.ts +69 -0
  87. package/dist/validation/production-bypass-core.d.ts.map +1 -0
  88. package/package.json +41 -5
  89. package/dist/ScrollView-h-6wYMAm.js +0 -515
  90. package/dist/Spacer-BbteDQ9I.js +0 -5337
  91. package/dist/binding-CmdpowkI.js +0 -2276
  92. package/dist/components/BasicInput.d.ts +0 -116
  93. package/dist/components/BasicInput.d.ts.map +0 -1
  94. package/dist/components/Button.d.ts +0 -252
  95. package/dist/components/Button.d.ts.map +0 -1
  96. package/dist/components/Divider.d.ts +0 -141
  97. package/dist/components/Divider.d.ts.map +0 -1
  98. package/dist/components/EnhancedLink.d.ts +0 -365
  99. package/dist/components/EnhancedLink.d.ts.map +0 -1
  100. package/dist/components/Form.d.ts +0 -141
  101. package/dist/components/Form.d.ts.map +0 -1
  102. package/dist/components/Grid.d.ts +0 -698
  103. package/dist/components/Grid.d.ts.map +0 -1
  104. package/dist/components/GridResponsive.d.ts +0 -214
  105. package/dist/components/GridResponsive.d.ts.map +0 -1
  106. package/dist/components/Image.d.ts +0 -162
  107. package/dist/components/Image.d.ts.map +0 -1
  108. package/dist/components/List.d.ts +0 -287
  109. package/dist/components/List.d.ts.map +0 -1
  110. package/dist/components/Menu.d.ts +0 -159
  111. package/dist/components/Menu.d.ts.map +0 -1
  112. package/dist/components/Picker.d.ts +0 -153
  113. package/dist/components/Picker.d.ts.map +0 -1
  114. package/dist/components/ScrollView.d.ts +0 -222
  115. package/dist/components/ScrollView.d.ts.map +0 -1
  116. package/dist/components/Section.d.ts +0 -153
  117. package/dist/components/Section.d.ts.map +0 -1
  118. package/dist/components/Show.d.ts +0 -64
  119. package/dist/components/Show.d.ts.map +0 -1
  120. package/dist/components/Spacer.d.ts +0 -35
  121. package/dist/components/Spacer.d.ts.map +0 -1
  122. package/dist/components/Text.d.ts +0 -242
  123. package/dist/components/Text.d.ts.map +0 -1
  124. package/dist/components/Toggle.d.ts +0 -207
  125. package/dist/components/Toggle.d.ts.map +0 -1
  126. package/dist/concatenated-component-DPcl2TEO.js +0 -6779
  127. package/dist/context--zQFIImS.js +0 -283
  128. package/dist/debug/index.d.ts +0 -61
  129. package/dist/debug/index.d.ts.map +0 -1
  130. package/dist/debug.js +0 -178
  131. package/dist/developer-experience/enhanced-errors.d.ts +0 -128
  132. package/dist/developer-experience/enhanced-errors.d.ts.map +0 -1
  133. package/dist/developer-experience/enhanced-types.d.ts +0 -281
  134. package/dist/developer-experience/enhanced-types.d.ts.map +0 -1
  135. package/dist/developer-experience/index.d.ts +0 -44
  136. package/dist/developer-experience/index.d.ts.map +0 -1
  137. package/dist/index-Nfi2SBQh.js +0 -3268
  138. package/dist/modifiers/attributes.d.ts +0 -203
  139. package/dist/modifiers/attributes.d.ts.map +0 -1
  140. package/dist/modifiers/backdrop.d.ts +0 -59
  141. package/dist/modifiers/backdrop.d.ts.map +0 -1
  142. package/dist/modifiers/border.d.ts +0 -217
  143. package/dist/modifiers/border.d.ts.map +0 -1
  144. package/dist/modifiers/effects.d.ts +0 -159
  145. package/dist/modifiers/effects.d.ts.map +0 -1
  146. package/dist/modifiers/elements.d.ts +0 -240
  147. package/dist/modifiers/elements.d.ts.map +0 -1
  148. package/dist/modifiers/filters.d.ts +0 -275
  149. package/dist/modifiers/filters.d.ts.map +0 -1
  150. package/dist/modifiers/flexbox.d.ts +0 -82
  151. package/dist/modifiers/flexbox.d.ts.map +0 -1
  152. package/dist/modifiers/font.d.ts +0 -71
  153. package/dist/modifiers/font.d.ts.map +0 -1
  154. package/dist/modifiers/grid.d.ts +0 -92
  155. package/dist/modifiers/grid.d.ts.map +0 -1
  156. package/dist/modifiers/margin.d.ts +0 -128
  157. package/dist/modifiers/margin.d.ts.map +0 -1
  158. package/dist/modifiers/padding.d.ts +0 -204
  159. package/dist/modifiers/padding.d.ts.map +0 -1
  160. package/dist/modifiers/responsive/advanced-utilities.d.ts +0 -118
  161. package/dist/modifiers/responsive/advanced-utilities.d.ts.map +0 -1
  162. package/dist/modifiers/responsive/breakpoints.d.ts +0 -81
  163. package/dist/modifiers/responsive/breakpoints.d.ts.map +0 -1
  164. package/dist/modifiers/responsive/css-generator.d.ts +0 -100
  165. package/dist/modifiers/responsive/css-generator.d.ts.map +0 -1
  166. package/dist/modifiers/responsive/dev-tools.d.ts +0 -107
  167. package/dist/modifiers/responsive/dev-tools.d.ts.map +0 -1
  168. package/dist/modifiers/responsive/index.d.ts +0 -29
  169. package/dist/modifiers/responsive/index.d.ts.map +0 -1
  170. package/dist/modifiers/responsive/layout-patterns.d.ts +0 -230
  171. package/dist/modifiers/responsive/layout-patterns.d.ts.map +0 -1
  172. package/dist/modifiers/responsive/performance.d.ts +0 -130
  173. package/dist/modifiers/responsive/performance.d.ts.map +0 -1
  174. package/dist/modifiers/responsive/responsive-builder.d.ts +0 -133
  175. package/dist/modifiers/responsive/responsive-builder.d.ts.map +0 -1
  176. package/dist/modifiers/responsive/responsive-modifier.d.ts +0 -123
  177. package/dist/modifiers/responsive/responsive-modifier.d.ts.map +0 -1
  178. package/dist/modifiers/responsive/types.d.ts +0 -183
  179. package/dist/modifiers/responsive/types.d.ts.map +0 -1
  180. package/dist/modifiers/responsive/utilities.d.ts +0 -149
  181. package/dist/modifiers/responsive/utilities.d.ts.map +0 -1
  182. package/dist/modifiers/scroll.d.ts +0 -143
  183. package/dist/modifiers/scroll.d.ts.map +0 -1
  184. package/dist/modifiers/shadows.d.ts +0 -114
  185. package/dist/modifiers/shadows.d.ts.map +0 -1
  186. package/dist/modifiers/size.d.ts +0 -113
  187. package/dist/modifiers/size.d.ts.map +0 -1
  188. package/dist/modifiers/text.d.ts +0 -147
  189. package/dist/modifiers/text.d.ts.map +0 -1
  190. package/dist/modifiers/transformations.d.ts +0 -329
  191. package/dist/modifiers/transformations.d.ts.map +0 -1
  192. package/dist/modifiers/transitions.d.ts +0 -98
  193. package/dist/modifiers/transitions.d.ts.map +0 -1
  194. package/dist/modifiers/typography.d.ts +0 -192
  195. package/dist/modifiers/typography.d.ts.map +0 -1
  196. package/dist/modifiers/utility.d.ts +0 -69
  197. package/dist/modifiers/utility.d.ts.map +0 -1
  198. package/dist/modifiers/utils.d.ts.map +0 -1
  199. package/dist/plugins/simplified-error-handler.d.ts +0 -83
  200. package/dist/plugins/simplified-error-handler.d.ts.map +0 -1
  201. package/dist/runtime/dev-tools.d.ts +0 -240
  202. package/dist/runtime/dev-tools.d.ts.map +0 -1
  203. package/dist/runtime/development-warnings.d.ts +0 -42
  204. package/dist/runtime/development-warnings.d.ts.map +0 -1
  205. package/dist/runtime/error-boundary.d.ts +0 -302
  206. package/dist/runtime/error-boundary.d.ts.map +0 -1
  207. package/dist/runtime/error-recovery.d.ts +0 -267
  208. package/dist/runtime/error-recovery.d.ts.map +0 -1
  209. package/dist/runtime/error-reporting.d.ts +0 -287
  210. package/dist/runtime/error-reporting.d.ts.map +0 -1
  211. package/dist/runtime/error-utils.d.ts +0 -204
  212. package/dist/runtime/error-utils.d.ts.map +0 -1
  213. package/dist/runtime/performance.d.ts +0 -217
  214. package/dist/runtime/performance.d.ts.map +0 -1
  215. package/dist/sui-compat.d.ts +0 -110
  216. package/dist/sui-compat.d.ts.map +0 -1
  217. package/dist/validation/advanced-debugging.d.ts +0 -319
  218. package/dist/validation/advanced-debugging.d.ts.map +0 -1
  219. package/dist/validation/build-time/detection.d.ts +0 -32
  220. package/dist/validation/build-time/detection.d.ts.map +0 -1
  221. package/dist/validation/build-time/index.d.ts +0 -84
  222. package/dist/validation/build-time/index.d.ts.map +0 -1
  223. package/dist/validation/build-time/plugins.d.ts +0 -75
  224. package/dist/validation/build-time/plugins.d.ts.map +0 -1
  225. package/dist/validation/build-time/rules.d.ts +0 -73
  226. package/dist/validation/build-time/rules.d.ts.map +0 -1
  227. package/dist/validation/build-time/transformer.d.ts +0 -23
  228. package/dist/validation/build-time/transformer.d.ts.map +0 -1
  229. package/dist/validation/build-time/types.d.ts +0 -212
  230. package/dist/validation/build-time/types.d.ts.map +0 -1
  231. package/dist/validation/comprehensive.d.ts +0 -160
  232. package/dist/validation/comprehensive.d.ts.map +0 -1
  233. package/dist/validation/debug-tools.d.ts +0 -251
  234. package/dist/validation/debug-tools.d.ts.map +0 -1
  235. package/dist/validation/developer-experience.d.ts +0 -243
  236. package/dist/validation/developer-experience.d.ts.map +0 -1
  237. package/dist/validation/documentation-integration.d.ts +0 -269
  238. package/dist/validation/documentation-integration.d.ts.map +0 -1
  239. package/dist/validation/enhanced-runtime.d.ts +0 -279
  240. package/dist/validation/enhanced-runtime.d.ts.map +0 -1
  241. package/dist/validation/error-reporting.d.ts +0 -186
  242. package/dist/validation/error-reporting.d.ts.map +0 -1
  243. package/dist/validation/ide-integration.d.ts +0 -328
  244. package/dist/validation/ide-integration.d.ts.map +0 -1
  245. package/dist/validation/performance-optimizer.d.ts +0 -218
  246. package/dist/validation/performance-optimizer.d.ts.map +0 -1
  247. package/dist/validation/production-bypass.d.ts +0 -175
  248. package/dist/validation/production-bypass.d.ts.map +0 -1
  249. package/dist/validation/simple.d.ts +0 -111
  250. package/dist/validation/simple.d.ts.map +0 -1
  251. package/dist/viewport/adapters/web-adapter.d.ts +0 -227
  252. package/dist/viewport/adapters/web-adapter.d.ts.map +0 -1
  253. package/dist/viewport/components.d.ts +0 -131
  254. package/dist/viewport/components.d.ts.map +0 -1
  255. package/dist/viewport/environment.d.ts +0 -75
  256. package/dist/viewport/environment.d.ts.map +0 -1
  257. package/dist/viewport/index.d.ts +0 -138
  258. package/dist/viewport/index.d.ts.map +0 -1
  259. package/dist/viewport/index.js +0 -2085
  260. package/dist/viewport/platform-detection.d.ts +0 -59
  261. package/dist/viewport/platform-detection.d.ts.map +0 -1
  262. package/dist/viewport/types.d.ts +0 -301
  263. package/dist/viewport/types.d.ts.map +0 -1
  264. package/dist/viewport/viewport-manager.d.ts +0 -118
  265. package/dist/viewport/viewport-manager.d.ts.map +0 -1
@@ -0,0 +1,1407 @@
1
+ import { infinity as c } from "./constants/layout.js";
2
+ import { LayoutModifier as d } from "./modifiers/base.js";
3
+ import { C as y, u as U } from "./concatenated-component-ByPl3_FF.js";
4
+ import { a as D, j as R, R as B, L as W, v as H } from "./production-minimal-BY_gMc-l.js";
5
+ import { G as I, W as z } from "./scheduler-BKeqwrYE.js";
6
+ import { c as A } from "./effect-B9Knft0b.js";
7
+ import { d as S, g as L, p as F, c as q } from "./dom-bridge-CAa1N2zX.js";
8
+ import "./component-XAzF1xqs.js";
9
+ import "./index-vdsiw6gQ.js";
10
+ import "./component-base-x2XmHFjy.js";
11
+ import "./plugins/index.js";
12
+ import "./validation/index.js";
13
+ function Pe() {
14
+ return new d({
15
+ frame: {
16
+ maxWidth: c
17
+ }
18
+ });
19
+ }
20
+ function De() {
21
+ return new d({
22
+ frame: {
23
+ maxHeight: c
24
+ }
25
+ });
26
+ }
27
+ function Ie() {
28
+ return new d({
29
+ frame: {
30
+ maxWidth: c,
31
+ maxHeight: c
32
+ }
33
+ });
34
+ }
35
+ function ze() {
36
+ return new d({
37
+ frame: {
38
+ width: c,
39
+ height: c
40
+ }
41
+ });
42
+ }
43
+ function Ae(n) {
44
+ return new d({
45
+ frame: {
46
+ width: n,
47
+ maxHeight: c
48
+ }
49
+ });
50
+ }
51
+ function $e(n) {
52
+ return new d({
53
+ frame: {
54
+ height: n,
55
+ maxWidth: c
56
+ }
57
+ });
58
+ }
59
+ function ke(n, e) {
60
+ return new d({
61
+ frame: {
62
+ width: c,
63
+ height: c,
64
+ maxWidth: n,
65
+ maxHeight: e
66
+ }
67
+ });
68
+ }
69
+ function Ge(n, e, t, r) {
70
+ return new d({
71
+ frame: {
72
+ width: c,
73
+ height: c,
74
+ minWidth: n,
75
+ maxWidth: e,
76
+ minHeight: t,
77
+ maxHeight: r
78
+ }
79
+ });
80
+ }
81
+ function Ue() {
82
+ return new d({
83
+ frame: {
84
+ maxWidth: c,
85
+ maxHeight: c
86
+ }
87
+ });
88
+ }
89
+ function Re() {
90
+ return new d({
91
+ frame: {
92
+ width: "100vw",
93
+ height: "100vh"
94
+ }
95
+ });
96
+ }
97
+ function Be() {
98
+ return new d({
99
+ frame: {
100
+ width: c,
101
+ height: c
102
+ }
103
+ });
104
+ }
105
+ function We() {
106
+ return new d({
107
+ frame: {
108
+ width: c
109
+ }
110
+ });
111
+ }
112
+ const He = Symbol.for("tachui.concat");
113
+ function Le(n) {
114
+ return n && typeof n == "object" && typeof n.isConcatenatable == "function" && n.isConcatenatable();
115
+ }
116
+ function Fe(n) {
117
+ return n && typeof n == "object" && n.constructor.name === "ConcatenatedComponent";
118
+ }
119
+ const qe = Symbol.for("tachui.concat");
120
+ class Ke {
121
+ /**
122
+ * Concatenate this component with another concatenatable component
123
+ */
124
+ concat(e) {
125
+ const t = this.toSegment(), r = e.toSegment();
126
+ return e instanceof y ? new y(
127
+ [t, ...e.segments],
128
+ this.mergeMetadata(e.metadata, e.segments.length + 1)
129
+ ) : new y(
130
+ [t, r],
131
+ this.createMetadata(2)
132
+ );
133
+ }
134
+ /**
135
+ * Check if this component supports concatenation
136
+ */
137
+ isConcatenatable() {
138
+ return !0;
139
+ }
140
+ /**
141
+ * Create metadata for a new concatenated component
142
+ */
143
+ createMetadata(e) {
144
+ return {
145
+ totalSegments: e,
146
+ accessibilityRole: this.determineAccessibilityRole(),
147
+ semanticStructure: this.determineSemanticStructure()
148
+ };
149
+ }
150
+ /**
151
+ * Merge metadata when concatenating with existing concatenated component
152
+ */
153
+ mergeMetadata(e, t) {
154
+ return {
155
+ totalSegments: t,
156
+ accessibilityRole: this.mergeAccessibilityRoles(e.accessibilityRole),
157
+ semanticStructure: this.mergeSemanticStructures(e.semanticStructure)
158
+ };
159
+ }
160
+ /**
161
+ * Determine the accessibility role for this component
162
+ */
163
+ determineAccessibilityRole() {
164
+ const e = this.constructor.name;
165
+ return e === "EnhancedText" ? "text" : e === "EnhancedImage" || e === "EnhancedButton" || e === "EnhancedLink" ? "group" : "composite";
166
+ }
167
+ /**
168
+ * Determine the semantic structure for this component
169
+ */
170
+ determineSemanticStructure() {
171
+ const e = this.constructor.name;
172
+ return e === "EnhancedText" || e === "EnhancedImage" ? "inline" : "mixed";
173
+ }
174
+ /**
175
+ * Merge accessibility roles when combining components
176
+ */
177
+ mergeAccessibilityRoles(e) {
178
+ const t = this.determineAccessibilityRole();
179
+ return t === "text" && e === "text" ? "text" : t === "composite" || e === "composite" ? "composite" : "group";
180
+ }
181
+ /**
182
+ * Merge semantic structures when combining components
183
+ */
184
+ mergeSemanticStructures(e) {
185
+ const t = this.determineSemanticStructure();
186
+ return t === "inline" && e === "inline" ? "inline" : t === "block" && e === "block" ? "block" : "mixed";
187
+ }
188
+ }
189
+ function Je(n) {
190
+ const e = n;
191
+ return e.concat = function(t) {
192
+ const r = {
193
+ id: this.id,
194
+ component: this,
195
+ modifiers: this.modifiers || [],
196
+ render: () => {
197
+ const s = this.render();
198
+ return Array.isArray(s) ? s[0] : s;
199
+ }
200
+ }, i = t.toSegment();
201
+ return t instanceof y ? new y(
202
+ [r, ...t.segments],
203
+ {
204
+ totalSegments: t.segments.length + 1,
205
+ accessibilityRole: "group",
206
+ semanticStructure: "mixed"
207
+ }
208
+ ) : new y(
209
+ [r, i],
210
+ {
211
+ totalSegments: 2,
212
+ accessibilityRole: "group",
213
+ semanticStructure: "mixed"
214
+ }
215
+ );
216
+ }, e.toSegment = function() {
217
+ return {
218
+ id: this.id,
219
+ component: this,
220
+ modifiers: this.modifiers || [],
221
+ render: () => {
222
+ const t = this.render();
223
+ return Array.isArray(t) ? t[0] : t;
224
+ }
225
+ };
226
+ }, e.isConcatenatable = function() {
227
+ return !0;
228
+ }, e;
229
+ }
230
+ const h = /* @__PURE__ */ new Map(), K = 300 * 1e3, T = 100;
231
+ class Xe {
232
+ /**
233
+ * Optimize an array of segments by merging compatible adjacent text segments
234
+ * Enhanced with caching and performance monitoring
235
+ */
236
+ static optimize(e) {
237
+ const t = performance.now();
238
+ if (e.length < 2) return e;
239
+ const r = this.generateCacheKey(e), i = this.getCachedOptimization(r);
240
+ if (i)
241
+ return i.optimizedSegments;
242
+ const s = this.performOptimization(e), a = performance.now() - t, o = {
243
+ ...this.getOptimizationStats(e, s),
244
+ processingTimeMs: a
245
+ };
246
+ return this.cacheOptimization(r, s, o), process.env.NODE_ENV === "development" && a > 5 && console.log(`TachUI Concatenation: Optimization took ${a.toFixed(2)}ms for ${e.length} segments`), s;
247
+ }
248
+ /**
249
+ * Core optimization algorithm separated for clarity
250
+ */
251
+ static performOptimization(e) {
252
+ const t = [];
253
+ for (const r of e) {
254
+ const i = t[t.length - 1];
255
+ i && this.canMergeTextSegments(i, r) ? t[t.length - 1] = this.mergeTextSegments(i, r) : t.push(r);
256
+ }
257
+ return t;
258
+ }
259
+ /**
260
+ * Generate a cache key from segments
261
+ */
262
+ static generateCacheKey(e) {
263
+ return e.map((r) => {
264
+ const i = r.component, s = this.extractTextContent(i), a = this.hashModifiers(r.modifiers);
265
+ return `${i.constructor.name}:${s}:${a}`;
266
+ }).join("|");
267
+ }
268
+ /**
269
+ * Hash modifiers for cache key generation
270
+ */
271
+ static hashModifiers(e) {
272
+ if (e.length === 0) return "none";
273
+ try {
274
+ const t = e.map((i) => ({
275
+ type: i.type,
276
+ props: i.properties
277
+ })), r = JSON.stringify(t);
278
+ return typeof btoa == "function" ? btoa(r).substring(0, 8) : this.simpleHash(r).toString(16).substring(0, 8);
279
+ } catch {
280
+ return "hash-error";
281
+ }
282
+ }
283
+ /**
284
+ * Simple hash function fallback for environments without btoa
285
+ */
286
+ static simpleHash(e) {
287
+ let t = 0;
288
+ for (let r = 0; r < e.length; r++) {
289
+ const i = e.charCodeAt(r);
290
+ t = (t << 5) - t + i, t = t & t;
291
+ }
292
+ return Math.abs(t);
293
+ }
294
+ /**
295
+ * Get cached optimization result
296
+ */
297
+ static getCachedOptimization(e) {
298
+ const t = h.get(e);
299
+ return t ? Date.now() - t.timestamp > K ? (h.delete(e), null) : t : null;
300
+ }
301
+ /**
302
+ * Cache optimization result
303
+ */
304
+ static cacheOptimization(e, t, r) {
305
+ if (h.size >= T) {
306
+ const i = h.keys().next().value;
307
+ i && h.delete(i);
308
+ }
309
+ h.set(e, {
310
+ optimizedSegments: t,
311
+ stats: r,
312
+ timestamp: Date.now()
313
+ });
314
+ }
315
+ /**
316
+ * Clear optimization cache (useful for testing)
317
+ */
318
+ static clearCache() {
319
+ h.clear();
320
+ }
321
+ /**
322
+ * Get cache statistics
323
+ */
324
+ static getCacheStats() {
325
+ return {
326
+ size: h.size,
327
+ maxSize: T,
328
+ hitRate: 0
329
+ // Would need to track hits/misses to calculate this
330
+ };
331
+ }
332
+ /**
333
+ * Check if two segments can be merged
334
+ */
335
+ static canMergeTextSegments(e, t) {
336
+ return e.component.constructor.name !== "EnhancedText" || t.component.constructor.name !== "EnhancedText" ? !1 : this.modifiersCompatible(e.modifiers, t.modifiers);
337
+ }
338
+ /**
339
+ * Check if two modifier arrays are compatible for merging
340
+ */
341
+ static modifiersCompatible(e, t) {
342
+ if (e.length !== t.length) return !1;
343
+ for (let r = 0; r < e.length; r++)
344
+ if (!this.modifierEqual(e[r], t[r]))
345
+ return !1;
346
+ return !0;
347
+ }
348
+ /**
349
+ * Check if two modifiers are equal (simplified comparison)
350
+ */
351
+ static modifierEqual(e, t) {
352
+ if (e.type !== t.type) return !1;
353
+ try {
354
+ return JSON.stringify(e.properties) === JSON.stringify(t.properties);
355
+ } catch {
356
+ return !1;
357
+ }
358
+ }
359
+ /**
360
+ * Merge two text segments into a single segment
361
+ */
362
+ static mergeTextSegments(e, t) {
363
+ const r = e.component, i = t.component, s = this.extractTextContent(r), a = this.extractTextContent(i), o = s + a;
364
+ return {
365
+ id: `merged-${e.id}-${t.id}`,
366
+ component: this.createMergedTextComponent(o, r.props, e.modifiers),
367
+ modifiers: e.modifiers,
368
+ // Use modifiers from first segment (they're identical)
369
+ render: () => this.createMergedTextComponent(o, r.props, e.modifiers).render()[0]
370
+ };
371
+ }
372
+ /**
373
+ * Extract text content from a text component
374
+ */
375
+ static extractTextContent(e) {
376
+ const t = e.props?.content;
377
+ return typeof t == "string" ? t : typeof t == "function" ? t() : t && typeof t == "object" && "peek" in t && t.peek() || "";
378
+ }
379
+ /**
380
+ * Create a new merged text component
381
+ */
382
+ static createMergedTextComponent(e, t, r) {
383
+ const i = {
384
+ ...t,
385
+ content: e
386
+ };
387
+ return {
388
+ type: "Text",
389
+ id: `merged-text-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
390
+ props: i,
391
+ mounted: !1,
392
+ cleanup: [],
393
+ modifiers: r,
394
+ render() {
395
+ const s = globalThis.__tachui_runtime;
396
+ if (s && s.h && s.text) {
397
+ const a = s.text(e);
398
+ return [s.h("span", {}, [a])];
399
+ }
400
+ return [];
401
+ }
402
+ };
403
+ }
404
+ /**
405
+ * Analyze segments and determine if optimization would be beneficial
406
+ */
407
+ static shouldOptimize(e) {
408
+ if (e.length < 2) return !1;
409
+ let t = 0;
410
+ for (let r = 0; r < e.length - 1; r++) {
411
+ const i = e[r], s = e[r + 1];
412
+ i.component.constructor.name === "EnhancedText" && s.component.constructor.name === "EnhancedText" && t++;
413
+ }
414
+ return t > 0;
415
+ }
416
+ /**
417
+ * Get optimization statistics (enhanced for Phase 4.1)
418
+ */
419
+ static getOptimizationStats(e, t) {
420
+ const r = e.length - t.length, i = e.length > 0 ? Math.round(r / e.length * 100) : 0;
421
+ return {
422
+ originalCount: e.length,
423
+ optimizedCount: t.length,
424
+ reductionPercent: i,
425
+ textSegmentsMerged: r
426
+ };
427
+ }
428
+ /**
429
+ * Advanced optimization analysis for performance monitoring
430
+ */
431
+ static analyzeOptimizationOpportunities(e) {
432
+ let t = 0, r = 0, i = 0, s = 0;
433
+ for (let o = 0; o < e.length; o++) {
434
+ const u = e[o];
435
+ switch (u.component.constructor.name) {
436
+ case "EnhancedText":
437
+ if (t++, o < e.length - 1) {
438
+ const b = e[o + 1];
439
+ this.canMergeTextSegments(u, b) && s++;
440
+ }
441
+ break;
442
+ case "EnhancedImage":
443
+ r++;
444
+ break;
445
+ case "EnhancedButton":
446
+ case "EnhancedLinkComponent":
447
+ i++;
448
+ break;
449
+ }
450
+ }
451
+ const a = e.length > 0 ? Math.round(s / e.length * 100) : 0;
452
+ return {
453
+ totalSegments: e.length,
454
+ textSegments: t,
455
+ imageSegments: r,
456
+ interactiveSegments: i,
457
+ optimizableTextPairs: s,
458
+ estimatedReductionPercent: a
459
+ };
460
+ }
461
+ }
462
+ class Ye {
463
+ // Placeholder implementation
464
+ }
465
+ function Ze() {
466
+ }
467
+ function Qe() {
468
+ }
469
+ function et() {
470
+ }
471
+ function tt() {
472
+ }
473
+ class J extends D {
474
+ constructor(e, t) {
475
+ super(e), this.definitions = t;
476
+ }
477
+ resolve() {
478
+ const e = this.getCurrentTheme(), t = this.definitions[e] || this.definitions.light;
479
+ return U(t);
480
+ }
481
+ getCurrentTheme() {
482
+ return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
483
+ }
484
+ }
485
+ function nt(n) {
486
+ return new J("gradient-asset", n);
487
+ }
488
+ var X = Object.defineProperty, Y = (n, e, t) => e in n ? X(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, j = (n, e, t) => Y(n, typeof e != "symbol" ? e + "" : e, t);
489
+ class E extends D {
490
+ constructor(e, t, r) {
491
+ super(e), this.reactiveDefinition = t, j(this, "currentGradient"), j(this, "subscriptions", []), j(this, "updateCallback"), this.updateCallback = r, this.currentGradient = this.resolveStaticGradient(), this.setupSignalSubscriptions();
492
+ }
493
+ /**
494
+ * Resolve current gradient to CSS
495
+ */
496
+ resolve() {
497
+ return this.gradientToCSS(this.currentGradient);
498
+ }
499
+ /**
500
+ * Get current static gradient (resolved from signals)
501
+ */
502
+ getCurrentGradient() {
503
+ return this.currentGradient;
504
+ }
505
+ /**
506
+ * Update the reactive definition and re-subscribe to signals
507
+ */
508
+ updateDefinition(e) {
509
+ this.cleanup(), this.reactiveDefinition = e, this.currentGradient = this.resolveStaticGradient(), this.setupSignalSubscriptions(), this.notifyUpdate();
510
+ }
511
+ /**
512
+ * Clean up signal subscriptions
513
+ */
514
+ cleanup() {
515
+ this.subscriptions.forEach((e) => e()), this.subscriptions = [];
516
+ }
517
+ resolveStaticGradient() {
518
+ const { type: e, options: t } = this.reactiveDefinition;
519
+ switch (e) {
520
+ case "linear":
521
+ return W(this.resolveLinearOptions(t));
522
+ case "radial":
523
+ return B(this.resolveRadialOptions(t));
524
+ case "angular":
525
+ case "conic":
526
+ return R(this.resolveAngularOptions(t));
527
+ default:
528
+ throw new Error(`Unsupported reactive gradient type: ${e}`);
529
+ }
530
+ }
531
+ resolveLinearOptions(e) {
532
+ return {
533
+ colors: e.colors.map((t) => this.resolveValue(t)),
534
+ stops: e.stops?.map((t) => this.resolveValue(t)),
535
+ startPoint: this.resolveValue(e.startPoint),
536
+ endPoint: this.resolveValue(e.endPoint),
537
+ angle: e.angle ? this.resolveValue(e.angle) : void 0
538
+ };
539
+ }
540
+ resolveRadialOptions(e) {
541
+ return {
542
+ colors: e.colors.map((t) => this.resolveValue(t)),
543
+ stops: e.stops?.map((t) => this.resolveValue(t)),
544
+ center: this.resolveValue(e.center),
545
+ startRadius: this.resolveValue(e.startRadius),
546
+ endRadius: this.resolveValue(e.endRadius),
547
+ shape: e.shape ? this.resolveValue(e.shape) : void 0
548
+ };
549
+ }
550
+ resolveAngularOptions(e) {
551
+ return {
552
+ colors: e.colors.map((t) => this.resolveValue(t)),
553
+ stops: e.stops?.map((t) => this.resolveValue(t)),
554
+ center: this.resolveValue(e.center),
555
+ startAngle: this.resolveValue(e.startAngle),
556
+ endAngle: this.resolveValue(e.endAngle)
557
+ };
558
+ }
559
+ resolveValue(e) {
560
+ return this.isSignal(e) ? e.value : e;
561
+ }
562
+ isSignal(e) {
563
+ return e !== null && typeof e == "object" && "value" in e && "subscribe" in e;
564
+ }
565
+ setupSignalSubscriptions() {
566
+ this.subscribeToSignalsInOptions(this.reactiveDefinition.options);
567
+ }
568
+ subscribeToSignalsInOptions(e) {
569
+ for (const [t, r] of Object.entries(e))
570
+ if (Array.isArray(r))
571
+ r.forEach((i) => {
572
+ if (this.isSignal(i)) {
573
+ const s = i.subscribe(() => this.handleSignalChange());
574
+ this.subscriptions.push(s);
575
+ }
576
+ });
577
+ else if (this.isSignal(r)) {
578
+ const i = r.subscribe(() => this.handleSignalChange());
579
+ this.subscriptions.push(i);
580
+ }
581
+ }
582
+ handleSignalChange() {
583
+ this.currentGradient = this.resolveStaticGradient(), this.notifyUpdate();
584
+ }
585
+ notifyUpdate() {
586
+ this.updateCallback && this.updateCallback();
587
+ }
588
+ gradientToCSS(e) {
589
+ const { gradientToCSS: t } = require("./css-generator");
590
+ return t(e);
591
+ }
592
+ }
593
+ class l extends H {
594
+ constructor(e, t, r) {
595
+ const i = l.resolveStateOptions(t);
596
+ super(e, i), this.reactiveStateGradients = t, this.updateCallback = r, j(this, "reactiveSubscriptions", []), this.setupStateSignalSubscriptions();
597
+ }
598
+ /**
599
+ * Update reactive state configuration
600
+ */
601
+ updateReactiveState(e) {
602
+ this.cleanupStateSubscriptions(), this.reactiveStateGradients = e;
603
+ const t = l.resolveStateOptions(e);
604
+ this.updateStateGradients(t), this.setupStateSignalSubscriptions(), this.notifyStateUpdate();
605
+ }
606
+ /**
607
+ * Clean up signal subscriptions
608
+ */
609
+ cleanupStateSubscriptions() {
610
+ this.reactiveSubscriptions.forEach((e) => e()), this.reactiveSubscriptions = [];
611
+ }
612
+ static resolveStateOptions(e) {
613
+ const t = {
614
+ default: l.resolveValue(e.default),
615
+ animation: e.animation
616
+ };
617
+ return e.hover && (t.hover = l.resolveValue(e.hover)), e.active && (t.active = l.resolveValue(e.active)), e.focus && (t.focus = l.resolveValue(e.focus)), e.disabled && (t.disabled = l.resolveValue(e.disabled)), t;
618
+ }
619
+ static resolveValue(e) {
620
+ return e !== null && typeof e == "object" && "value" in e && "subscribe" in e ? e.value : e;
621
+ }
622
+ static isSignal(e) {
623
+ return e !== null && typeof e == "object" && "value" in e && "subscribe" in e;
624
+ }
625
+ setupStateSignalSubscriptions() {
626
+ Object.entries(this.reactiveStateGradients).forEach(([e, t]) => {
627
+ if (e !== "animation" && l.isSignal(t)) {
628
+ const r = t.subscribe(() => this.handleStateSignalChange());
629
+ this.reactiveSubscriptions.push(r);
630
+ }
631
+ });
632
+ }
633
+ handleStateSignalChange() {
634
+ const e = l.resolveStateOptions(this.reactiveStateGradients);
635
+ this.updateStateGradients(e), this.notifyStateUpdate();
636
+ }
637
+ notifyStateUpdate() {
638
+ this.updateCallback && this.updateCallback();
639
+ }
640
+ }
641
+ const V = {
642
+ /**
643
+ * Create a reactive linear gradient
644
+ */
645
+ linear: (n, e) => new E(
646
+ "reactive-linear",
647
+ { type: "linear", options: n, __reactive: !0 },
648
+ e
649
+ ),
650
+ /**
651
+ * Create a reactive radial gradient
652
+ */
653
+ radial: (n, e) => new E(
654
+ "reactive-radial",
655
+ { type: "radial", options: n, __reactive: !0 },
656
+ e
657
+ ),
658
+ /**
659
+ * Create a reactive angular gradient
660
+ */
661
+ angular: (n, e) => new E(
662
+ "reactive-angular",
663
+ { type: "angular", options: n, __reactive: !0 },
664
+ e
665
+ ),
666
+ /**
667
+ * Create a reactive state gradient
668
+ */
669
+ state: (n, e, t) => new l(n, e, t)
670
+ }, rt = {
671
+ /**
672
+ * Create an animated gradient that cycles through colors
673
+ */
674
+ createAnimatedGradient: (n, e = 3e3) => {
675
+ const t = {
676
+ value: n[0],
677
+ subscribe: (r) => () => {
678
+ }
679
+ };
680
+ return V.linear({
681
+ colors: [t, n[1]],
682
+ startPoint: "top",
683
+ endPoint: "bottom"
684
+ });
685
+ },
686
+ /**
687
+ * Create a progress gradient that fills based on a signal
688
+ */
689
+ createProgressGradient: (n, e = "#007AFF") => V.linear({
690
+ colors: [e, "transparent"],
691
+ stops: [n, n],
692
+ // Both stops use the same signal
693
+ startPoint: "leading",
694
+ endPoint: "trailing"
695
+ }),
696
+ /**
697
+ * Create a data-driven gradient that reflects numeric values
698
+ */
699
+ createDataGradient: (n, e, t, r = ["#ff0000", "#ffff00", "#00ff00"]) => V.linear({
700
+ colors: r,
701
+ startPoint: "top",
702
+ endPoint: "bottom"
703
+ })
704
+ }, it = {
705
+ /**
706
+ * Check if a background value is reactive
707
+ */
708
+ isReactiveBackground: (n) => n instanceof E || n instanceof l,
709
+ /**
710
+ * Create a reactive background from a signal
711
+ */
712
+ fromSignal: (n) => V.state("signal-background", {
713
+ default: n
714
+ })
715
+ };
716
+ function M(n, e = {}) {
717
+ const { fallback: t, errorFallback: r, timeout: i = 1e4, preload: s = "never" } = e;
718
+ let a = !1, o = null, u = !1, m = null, b = null;
719
+ const O = async () => {
720
+ a || u || o || b || (a = !0, u = !0, m = null, b = (async () => {
721
+ try {
722
+ const f = await Promise.race([
723
+ n(),
724
+ new Promise(
725
+ (_, x) => setTimeout(() => x(new Error("Component load timeout")), i)
726
+ )
727
+ ]);
728
+ o = "default" in f ? f.default : f;
729
+ } catch (f) {
730
+ const _ = f;
731
+ (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Failed to load lazy component:", _), m = _;
732
+ } finally {
733
+ u = !1, b = null;
734
+ }
735
+ })(), await b);
736
+ };
737
+ return s === "idle" && typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
738
+ O().catch(() => {
739
+ });
740
+ }) : s === "idle" ? setTimeout(() => {
741
+ O().catch(() => {
742
+ });
743
+ }, 100) : s === "immediate" && O().catch(() => {
744
+ }), (f) => {
745
+ if (!a && !u && !o && O().catch(() => {
746
+ }), m)
747
+ return r ? r(m) : N(m);
748
+ if (u || !o)
749
+ return t || Q();
750
+ try {
751
+ return typeof o == "function" ? o(f) : o;
752
+ } catch (_) {
753
+ const x = _;
754
+ return (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Error rendering lazy component:", x), N(x);
755
+ }
756
+ };
757
+ }
758
+ function st(n) {
759
+ return {
760
+ type: "component",
761
+ render: () => ({
762
+ type: "element",
763
+ tag: "div",
764
+ props: { class: "tachui-suspense" },
765
+ children: n.children.map(() => ({
766
+ type: "element",
767
+ tag: "div",
768
+ children: []
769
+ }))
770
+ }),
771
+ props: n,
772
+ id: `suspense-${Math.random().toString(36).substr(2, 9)}`
773
+ };
774
+ }
775
+ function Z(n) {
776
+ return n().then((e) => e && typeof e == "object" && "default" in e ? e.default : e);
777
+ }
778
+ function at(n, e = {}) {
779
+ const t = {};
780
+ for (const [r, i] of Object.entries(n))
781
+ t[r] = M(i, e);
782
+ return t;
783
+ }
784
+ function ot(n) {
785
+ const e = Object.entries(n).map(
786
+ async ([t, r]) => [t, await Z(r)]
787
+ );
788
+ return Promise.all(e).then((t) => {
789
+ const r = {};
790
+ for (const [i, s] of t)
791
+ r[i] = s;
792
+ return r;
793
+ });
794
+ }
795
+ function Q() {
796
+ return {
797
+ type: "element",
798
+ tag: "div",
799
+ props: {
800
+ class: "tachui-lazy-loading",
801
+ style: "padding: 16px; color: #666; text-align: center;"
802
+ },
803
+ children: [
804
+ {
805
+ type: "text",
806
+ text: "Loading component..."
807
+ }
808
+ ]
809
+ };
810
+ }
811
+ function N(n) {
812
+ return {
813
+ type: "element",
814
+ tag: "div",
815
+ props: {
816
+ class: "tachui-lazy-error",
817
+ style: "padding: 16px; color: #d32f2f; border: 1px solid #d32f2f; border-radius: 4px; background: #ffeaea;"
818
+ },
819
+ children: [
820
+ {
821
+ type: "text",
822
+ text: `Failed to load component: ${n.message}`
823
+ }
824
+ ]
825
+ };
826
+ }
827
+ function ct(n, e = {}) {
828
+ const { rootMargin: t = "50px", threshold: r = 0.1, ...i } = e;
829
+ return i.preload === "visible" && typeof IntersectionObserver < "u" ? (s) => {
830
+ const a = M(n, { ...i, preload: "never" });
831
+ return setTimeout(() => {
832
+ a(s);
833
+ }, 100), a(s);
834
+ } : M(n, i);
835
+ }
836
+ var ee = Object.defineProperty, te = (n, e, t) => e in n ? ee(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, g = (n, e, t) => te(n, typeof e != "symbol" ? e + "" : e, t);
837
+ class ne {
838
+ constructor(e) {
839
+ g(this, "_signal"), g(this, "_setter"), g(this, "_subscribers", /* @__PURE__ */ new Set());
840
+ const [t, r] = I(e);
841
+ this._signal = t, this._setter = r;
842
+ }
843
+ get value() {
844
+ return this._signal();
845
+ }
846
+ set value(e) {
847
+ this._setter(e), this.notifySubscribers();
848
+ }
849
+ /**
850
+ * Update a property of the environment object
851
+ */
852
+ updateProperty(e, t) {
853
+ const i = { ...this._signal(), [e]: t };
854
+ this._setter(i), this.notifySubscribers();
855
+ }
856
+ /**
857
+ * Subscribe to changes
858
+ */
859
+ subscribe(e) {
860
+ return this._subscribers.add(e), () => this._subscribers.delete(e);
861
+ }
862
+ notifySubscribers() {
863
+ for (const e of this._subscribers)
864
+ try {
865
+ e();
866
+ } catch (t) {
867
+ console.error("Error in environment object subscriber:", t);
868
+ }
869
+ }
870
+ /**
871
+ * Create a reactive effect that runs when this object changes
872
+ */
873
+ onChange(e) {
874
+ const t = A(() => {
875
+ e(this._signal());
876
+ });
877
+ return () => t.dispose();
878
+ }
879
+ }
880
+ class $ {
881
+ constructor(e, t) {
882
+ g(this, "key"), g(this, "componentContext"), g(this, "_cachedValue"), g(this, "_subscriptionCleanup"), this.key = e, this.componentContext = t, t.onCleanup(() => {
883
+ this._subscriptionCleanup && this._subscriptionCleanup();
884
+ });
885
+ }
886
+ get wrappedValue() {
887
+ if (this._cachedValue === void 0 && (this._cachedValue = q(this.key), this._cachedValue && typeof this._cachedValue == "object" && "subscribe" in this._cachedValue)) {
888
+ const e = this._cachedValue;
889
+ typeof e.subscribe == "function" && (this._subscriptionCleanup = e.subscribe(() => {
890
+ this.componentContext.setState(`_env_${this.key.name}_trigger`, Date.now());
891
+ }));
892
+ }
893
+ return this._cachedValue;
894
+ }
895
+ get projectedValue() {
896
+ return this;
897
+ }
898
+ }
899
+ function re(n) {
900
+ const e = L();
901
+ return new $(n, e);
902
+ }
903
+ function ie(n, e) {
904
+ F(n, e);
905
+ }
906
+ function ut(n, e) {
907
+ return new ne(e);
908
+ }
909
+ function lt(n) {
910
+ return n && typeof n == "object" && "wrappedValue" in n && "key" in n && "componentContext" in n && n instanceof $;
911
+ }
912
+ const dt = {
913
+ /**
914
+ * Application theme
915
+ */
916
+ Theme: S("Theme", {
917
+ mode: "light",
918
+ primaryColor: "#007AFF",
919
+ secondaryColor: "#5856D6"
920
+ }),
921
+ /**
922
+ * Localization service
923
+ */
924
+ Localization: S("Localization"),
925
+ /**
926
+ * Navigation service
927
+ */
928
+ Navigation: S("Navigation"),
929
+ /**
930
+ * Application configuration
931
+ */
932
+ Config: S("Config"),
933
+ /**
934
+ * User authentication
935
+ */
936
+ Auth: S("Auth")
937
+ };
938
+ var se = Object.defineProperty, ae = (n, e, t) => e in n ? se(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, C = (n, e, t) => ae(n, typeof e != "symbol" ? e + "" : e, t);
939
+ class k {
940
+ constructor() {
941
+ C(this, "_objectWillChange"), C(this, "_notifyCount", 0);
942
+ const [e, t] = I(void 0);
943
+ this._objectWillChange = {
944
+ getValue: e,
945
+ peek: e
946
+ }, this._notifySetter = t;
947
+ }
948
+ get objectWillChange() {
949
+ return this._objectWillChange;
950
+ }
951
+ /**
952
+ * Notify observers that the object has changed
953
+ * Call this method whenever properties of the object change
954
+ */
955
+ notifyChange() {
956
+ this._notifyCount++;
957
+ const e = this._notifySetter;
958
+ e && e(void 0);
959
+ }
960
+ /**
961
+ * Get the current notification count (for debugging)
962
+ */
963
+ get notificationCount() {
964
+ return this._notifyCount;
965
+ }
966
+ }
967
+ class oe {
968
+ constructor(e, t, r, i = {}) {
969
+ C(this, "_object"), C(this, "_metadata"), C(this, "_effectCleanup"), this._object = e, this._metadata = {
970
+ type: "ObservedObject",
971
+ propertyName: r,
972
+ componentId: t.id,
973
+ options: i
974
+ }, this.setupObservation();
975
+ const s = z();
976
+ s && s.cleanups.push(() => {
977
+ this.cleanup();
978
+ });
979
+ }
980
+ get wrappedValue() {
981
+ return this._object;
982
+ }
983
+ get projectedValue() {
984
+ return this;
985
+ }
986
+ /**
987
+ * Get property wrapper metadata
988
+ */
989
+ get metadata() {
990
+ return this._metadata;
991
+ }
992
+ /**
993
+ * Set up reactive observation of the object
994
+ */
995
+ setupObservation() {
996
+ const e = A(() => {
997
+ this._object.objectWillChange();
998
+ });
999
+ this._effectCleanup = () => e.dispose();
1000
+ }
1001
+ /**
1002
+ * Cleanup observation
1003
+ */
1004
+ cleanup() {
1005
+ this._effectCleanup && (this._effectCleanup(), this._effectCleanup = void 0);
1006
+ }
1007
+ /**
1008
+ * Replace the observed object (advanced usage)
1009
+ */
1010
+ updateObject(e) {
1011
+ this.cleanup(), this._object = e, this.setupObservation();
1012
+ }
1013
+ }
1014
+ const ce = (n, e = {}) => {
1015
+ const t = le(), r = de() || "observedObject";
1016
+ return new oe(n, t, r, e);
1017
+ };
1018
+ function ue(n, e = {}) {
1019
+ const t = new k();
1020
+ return new Proxy(n, {
1021
+ set(i, s, a) {
1022
+ const o = i[s], u = Reflect.set(i, s, a);
1023
+ return u && o !== a && e.autoNotify !== !1 && t.notifyChange(), u;
1024
+ },
1025
+ get(i, s) {
1026
+ return s === "objectWillChange" ? t.objectWillChange : s === "notifyChange" ? () => t.notifyChange() : s === "notificationCount" ? t.notificationCount : Reflect.get(i, s);
1027
+ }
1028
+ });
1029
+ }
1030
+ function ht(n = {}) {
1031
+ return (e) => class extends e {
1032
+ constructor(...t) {
1033
+ super(...t), C(this, "_observableBase", new k()), n.autoNotify !== !1 && this.setupAutoNotification();
1034
+ }
1035
+ get objectWillChange() {
1036
+ return this._observableBase.objectWillChange;
1037
+ }
1038
+ get notificationCount() {
1039
+ return this._observableBase.notificationCount;
1040
+ }
1041
+ notifyChange() {
1042
+ this._observableBase.notifyChange();
1043
+ }
1044
+ setupAutoNotification() {
1045
+ const t = Object.getOwnPropertyNames(this);
1046
+ for (const r of t) {
1047
+ if (r.startsWith("_") || typeof this[r] == "function")
1048
+ continue;
1049
+ let i = this[r];
1050
+ Object.defineProperty(this, r, {
1051
+ get: () => i,
1052
+ set: (s) => {
1053
+ i !== s && (i = s, this.notifyChange());
1054
+ },
1055
+ enumerable: !0,
1056
+ configurable: !0
1057
+ });
1058
+ }
1059
+ }
1060
+ };
1061
+ }
1062
+ function le() {
1063
+ const n = z();
1064
+ if (!n?.context.has(P))
1065
+ throw new Error("@ObservedObject can only be used within a component context");
1066
+ return n.context.get(P);
1067
+ }
1068
+ function de() {
1069
+ try {
1070
+ const n = new Error().stack;
1071
+ if (n)
1072
+ return n.match(/at (\w+)\./)?.[1] || null;
1073
+ } catch {
1074
+ }
1075
+ return null;
1076
+ }
1077
+ const P = Symbol("TachUI.ComponentContext");
1078
+ function he(n) {
1079
+ return n && typeof n == "object" && "objectWillChange" in n && "notifyChange" in n;
1080
+ }
1081
+ function pt(n) {
1082
+ return n && typeof n == "object" && "wrappedValue" in n && "projectedValue" in n && he(n.wrappedValue);
1083
+ }
1084
+ function ft(n, e = {}) {
1085
+ return ue({ ...n }, e);
1086
+ }
1087
+ const gt = ce;
1088
+ var pe = Object.defineProperty, fe = (n, e, t) => e in n ? pe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, p = (n, e, t) => fe(n, typeof e != "symbol" ? e + "" : e, t);
1089
+ class ge {
1090
+ constructor(e) {
1091
+ this.componentContext = e, p(this, "states", /* @__PURE__ */ new Map()), p(this, "bindings", /* @__PURE__ */ new Map()), p(this, "observedObjects", /* @__PURE__ */ new Map()), p(this, "environmentObjects", /* @__PURE__ */ new Map()), p(this, "registry"), this.registry = new me();
1092
+ }
1093
+ /**
1094
+ * Register a @State property wrapper
1095
+ */
1096
+ registerState(e, t = {}) {
1097
+ const r = e.metadata;
1098
+ if (r) {
1099
+ const i = `${r.componentId}_${r.propertyName}`;
1100
+ this.states.set(i, e), this.registry.register(r), process.env.NODE_ENV === "development" && this.setupStateDebugging(e, r);
1101
+ }
1102
+ }
1103
+ /**
1104
+ * Register a @Binding property wrapper
1105
+ */
1106
+ registerBinding(e, t = {}) {
1107
+ const r = `${this.componentContext.id}_${t.name || "binding"}_${Date.now()}`;
1108
+ this.bindings.set(r, e);
1109
+ const i = {
1110
+ type: "Binding",
1111
+ propertyName: t.name || "binding",
1112
+ componentId: this.componentContext.id,
1113
+ options: t
1114
+ };
1115
+ this.registry.register(i);
1116
+ }
1117
+ /**
1118
+ * Register an @ObservedObject property wrapper
1119
+ */
1120
+ registerObservedObject(e, t = {}) {
1121
+ const r = e.metadata;
1122
+ if (r) {
1123
+ const i = `${r.componentId}_${r.propertyName}`;
1124
+ this.observedObjects.set(i, e), this.registry.register(r), process.env.NODE_ENV === "development" && this.setupObservedObjectDebugging(e, r);
1125
+ }
1126
+ }
1127
+ /**
1128
+ * Register an @EnvironmentObject property wrapper
1129
+ */
1130
+ registerEnvironmentObject(e, t) {
1131
+ const r = e.metadata;
1132
+ if (r) {
1133
+ const i = `${r.componentId}_${r.propertyName}`;
1134
+ this.environmentObjects.set(i, e), this.registry.register(r);
1135
+ }
1136
+ }
1137
+ /**
1138
+ * Clean up all property wrappers for this component
1139
+ */
1140
+ cleanup() {
1141
+ this.states.clear(), this.bindings.clear(), this.observedObjects.clear(), this.environmentObjects.clear(), this.registry.cleanup(this.componentContext.id);
1142
+ }
1143
+ /**
1144
+ * Get all registered states (for debugging)
1145
+ */
1146
+ getStates() {
1147
+ return new Map(this.states);
1148
+ }
1149
+ /**
1150
+ * Get all registered bindings (for debugging)
1151
+ */
1152
+ getBindings() {
1153
+ return new Map(this.bindings);
1154
+ }
1155
+ /**
1156
+ * Get all registered observed objects (for debugging)
1157
+ */
1158
+ getObservedObjects() {
1159
+ return new Map(this.observedObjects);
1160
+ }
1161
+ /**
1162
+ * Get all registered environment objects (for debugging)
1163
+ */
1164
+ getEnvironmentObjects() {
1165
+ return new Map(this.environmentObjects);
1166
+ }
1167
+ /**
1168
+ * Get property wrapper registry
1169
+ */
1170
+ getRegistry() {
1171
+ return this.registry;
1172
+ }
1173
+ /**
1174
+ * Set up debugging for @State property wrappers
1175
+ */
1176
+ setupStateDebugging(e, t) {
1177
+ if (typeof window < "u") {
1178
+ const r = window.__TACHUI_DEBUG__ || {};
1179
+ r.states || (r.states = {}), r.states[`${t.componentId}_${t.propertyName}`] = {
1180
+ state: e,
1181
+ metadata: t,
1182
+ getValue: () => e.wrappedValue,
1183
+ setValue: (i) => {
1184
+ e.projectedValue.set(i);
1185
+ },
1186
+ getBinding: () => e.projectedValue
1187
+ }, window.__TACHUI_DEBUG__ = r;
1188
+ }
1189
+ }
1190
+ /**
1191
+ * Set up debugging for @ObservedObject property wrappers
1192
+ */
1193
+ setupObservedObjectDebugging(e, t) {
1194
+ if (typeof window < "u") {
1195
+ const r = window.__TACHUI_DEBUG__ || {};
1196
+ r.observedObjects || (r.observedObjects = {}), r.observedObjects[`${t.componentId}_${t.propertyName}`] = {
1197
+ observedObject: e,
1198
+ metadata: t,
1199
+ getObject: () => e.wrappedValue,
1200
+ getNotificationCount: () => e.wrappedValue.notificationCount || 0,
1201
+ triggerChange: () => e.wrappedValue.notifyChange()
1202
+ }, window.__TACHUI_DEBUG__ = r;
1203
+ }
1204
+ }
1205
+ }
1206
+ class me {
1207
+ constructor() {
1208
+ p(this, "metadata", /* @__PURE__ */ new Map());
1209
+ }
1210
+ /**
1211
+ * Register property wrapper metadata
1212
+ */
1213
+ register(e) {
1214
+ const t = e.componentId, r = this.metadata.get(t) || [];
1215
+ r.push(e), this.metadata.set(t, r);
1216
+ }
1217
+ /**
1218
+ * Unregister a specific property wrapper
1219
+ */
1220
+ unregister(e, t) {
1221
+ const i = (this.metadata.get(e) || []).filter((s) => s.propertyName !== t);
1222
+ i.length > 0 ? this.metadata.set(e, i) : this.metadata.delete(e);
1223
+ }
1224
+ /**
1225
+ * Clean up all metadata for a component
1226
+ */
1227
+ cleanup(e) {
1228
+ this.metadata.delete(e);
1229
+ }
1230
+ /**
1231
+ * Get all metadata for a component
1232
+ */
1233
+ getMetadata(e) {
1234
+ return this.metadata.get(e) || [];
1235
+ }
1236
+ /**
1237
+ * Get all registered metadata (for debugging)
1238
+ */
1239
+ getAllMetadata() {
1240
+ return new Map(this.metadata);
1241
+ }
1242
+ }
1243
+ function mt(n) {
1244
+ return new ge(n);
1245
+ }
1246
+ const G = class v {
1247
+ constructor() {
1248
+ p(this, "managers", /* @__PURE__ */ new Map());
1249
+ }
1250
+ static getInstance() {
1251
+ return v.instance || (v.instance = new v()), v.instance;
1252
+ }
1253
+ register(e, t) {
1254
+ this.managers.set(e, t);
1255
+ }
1256
+ unregister(e) {
1257
+ this.managers.delete(e);
1258
+ }
1259
+ getManager(e) {
1260
+ return this.managers.get(e);
1261
+ }
1262
+ getAllManagers() {
1263
+ return new Map(this.managers);
1264
+ }
1265
+ /**
1266
+ * Get debugging information for all components
1267
+ */
1268
+ getDebugInfo() {
1269
+ const e = {};
1270
+ for (const [t, r] of this.managers)
1271
+ e[t] = {
1272
+ states: r.getStates().size,
1273
+ bindings: r.getBindings().size,
1274
+ observedObjects: r.getObservedObjects().size,
1275
+ environmentObjects: r.getEnvironmentObjects().size,
1276
+ metadata: r.getRegistry().getMetadata(t)
1277
+ };
1278
+ return e;
1279
+ }
1280
+ };
1281
+ p(G, "instance");
1282
+ let w = G;
1283
+ function bt(n, e) {
1284
+ w.getInstance().register(n, e);
1285
+ }
1286
+ function yt(n) {
1287
+ w.getInstance().unregister(n);
1288
+ }
1289
+ function be(n) {
1290
+ return w.getInstance().getManager(n);
1291
+ }
1292
+ function ye() {
1293
+ return w.getInstance().getAllManagers();
1294
+ }
1295
+ function Ce() {
1296
+ return w.getInstance().getDebugInfo();
1297
+ }
1298
+ function Ct() {
1299
+ if (typeof window < "u" && process.env.NODE_ENV === "development") {
1300
+ const n = window.__TACHUI_DEBUG__ || {};
1301
+ n.stateManagers = {
1302
+ getAll: ye,
1303
+ getDebugInfo: Ce,
1304
+ getManager: be
1305
+ }, window.__TACHUI_DEBUG__ = n, console.log(
1306
+ "TachUI State Management debugging enabled. Use window.__TACHUI_DEBUG__.stateManagers"
1307
+ );
1308
+ }
1309
+ }
1310
+ const _t = ie;
1311
+ function St(n) {
1312
+ return console.warn("useEnvironmentObject is deprecated, use EnvironmentObject instead"), re(n);
1313
+ }
1314
+ const vt = {
1315
+ /**
1316
+ * Check if a value is any kind of property wrapper
1317
+ */
1318
+ isPropertyWrapper(n) {
1319
+ return n && typeof n == "object" && "wrappedValue" in n && "projectedValue" in n;
1320
+ },
1321
+ /**
1322
+ * Extract the wrapped value from any property wrapper
1323
+ */
1324
+ unwrap(n) {
1325
+ return this.isPropertyWrapper(n) ? n.wrappedValue : n;
1326
+ },
1327
+ /**
1328
+ * Create a debug snapshot of all property wrappers in a component
1329
+ */
1330
+ createDebugSnapshot(n) {
1331
+ if (typeof window < "u") {
1332
+ const e = window.__TACHUI_DEBUG__;
1333
+ if (e)
1334
+ return {
1335
+ states: e.states ? Object.keys(e.states).filter((t) => t.startsWith(n)).reduce((t, r) => (t[r] = e.states[r].getValue(), t), {}) : {},
1336
+ observedObjects: e.observedObjects ? Object.keys(e.observedObjects).filter((t) => t.startsWith(n)).reduce((t, r) => (t[r] = {
1337
+ notificationCount: e.observedObjects[r].getNotificationCount(),
1338
+ object: e.observedObjects[r].getObject()
1339
+ }, t), {}) : {}
1340
+ };
1341
+ }
1342
+ return null;
1343
+ }
1344
+ }, wt = "0.1.0";
1345
+ export {
1346
+ mt as $,
1347
+ it as A,
1348
+ Ze as B,
1349
+ He as C,
1350
+ Qe as D,
1351
+ et as E,
1352
+ tt as F,
1353
+ J as G,
1354
+ _t as H,
1355
+ St as I,
1356
+ vt as J,
1357
+ dt as K,
1358
+ Ye as L,
1359
+ ut as M,
1360
+ re as N,
1361
+ lt as O,
1362
+ ie as P,
1363
+ ft as Q,
1364
+ E as R,
1365
+ st as S,
1366
+ Xe as T,
1367
+ he as U,
1368
+ wt as V,
1369
+ pt as W,
1370
+ ue as X,
1371
+ k as Y,
1372
+ gt as Z,
1373
+ ht as _,
1374
+ Fe as a,
1375
+ ye as a0,
1376
+ be as a1,
1377
+ Ce as a2,
1378
+ Ct as a3,
1379
+ bt as a4,
1380
+ ge as a5,
1381
+ yt as a6,
1382
+ Ke as b,
1383
+ qe as c,
1384
+ De as d,
1385
+ Ie as e,
1386
+ Pe as f,
1387
+ ze as g,
1388
+ Ae as h,
1389
+ Le as i,
1390
+ $e as j,
1391
+ ke as k,
1392
+ Ue as l,
1393
+ Je as m,
1394
+ Re as n,
1395
+ Be as o,
1396
+ We as p,
1397
+ at as q,
1398
+ Ge as r,
1399
+ ct as s,
1400
+ M as t,
1401
+ Z as u,
1402
+ ot as v,
1403
+ nt as w,
1404
+ l as x,
1405
+ V as y,
1406
+ rt as z
1407
+ };