@archduck/gst-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Alan Aydelott
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,344 @@
1
+ # gst-core
2
+
3
+ Config-driven rendering engine. Describe UI as plain objects -- in JavaScript, JSON, or both -- and get reactive DOM with automatic updates, dynamic properties, scoped styles, and layered configuration loading.
4
+
5
+ **gst** stands for **Grand Schema Things** -- a play on "grand scheme of things." Forms, pages, and UIs are defined as schemas (JSON configurations) rather than code. The name captures the idea that these config-driven "things" participate in a larger system of data, interaction, and workflow.
6
+
7
+ Generic by design. No opinions about forms, pages, or any domain. Domain behavior is injected through options; `gst-forms` is one such plugin.
8
+
9
+ Built on `@vue/reactivity` and `gst-compose`.
10
+
11
+ ```
12
+ npm install @archduck/gst-core
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Quick start
18
+
19
+ ```js
20
+ import { mount } from '@archduck/gst-core'
21
+
22
+ mount(document.getElementById('root'), {
23
+ layout: [
24
+ { component: 'h1', innerText: 'Hello' },
25
+ { component: 'input', name: 'email', type: 'email' },
26
+ { component: 'p', innerText: '{{greeting}}' },
27
+ ],
28
+ registries: {
29
+ functions: {
30
+ greeting(context) {
31
+ return context.record.data.email
32
+ ? `You entered: ${context.record.data.email}`
33
+ : 'Type an email above'
34
+ }
35
+ }
36
+ }
37
+ }, {
38
+ record: { key: null, data: { email: '' } }
39
+ })
40
+ ```
41
+
42
+ That's a reactive UI from a plain object. The `<input>` is two-way bound to `record.data.email`. The paragraph re-renders whenever the email changes, because `greeting` reads from the reactive record. No JSX, no templates, no build step required for the config itself.
43
+
44
+ ---
45
+
46
+ ## The config object
47
+
48
+ Everything converges to a single shape before rendering:
49
+
50
+ ```js
51
+ {
52
+ meta: {},
53
+ layout: [],
54
+ registries: { fields, buttons, components, functions, optionSets },
55
+ styles: null,
56
+ actions: {}
57
+ }
58
+ ```
59
+
60
+ How you build this object is up to you.
61
+
62
+ **Write it directly in JS** when you want full control and type checking:
63
+
64
+ ```js
65
+ const form = {
66
+ layout: [
67
+ { component: 'h1', innerText: 'Hello' },
68
+ { component: 'input', name: 'email' },
69
+ ],
70
+ registries: {
71
+ fields: {
72
+ email: { component: 'input', type: 'email', label: 'Email' }
73
+ },
74
+ functions: {
75
+ greeting(context) { return `Hi, ${context.record.data.email}` }
76
+ }
77
+ }
78
+ }
79
+
80
+ mount(document.getElementById('root'), form)
81
+ ```
82
+
83
+ **Load it from JSON files** when the config needs to live outside code:
84
+
85
+ ```js
86
+ import { loadJsonConfig } from '@archduck/gst-core'
87
+
88
+ const form = await loadJsonConfig('./UserView', ['uchealth'], { schema })
89
+ mount(document.getElementById('root'), form)
90
+ ```
91
+
92
+ **Mix both** -- load structure from JSON, define functions in JS:
93
+
94
+ ```js
95
+ const form = await loadJsonConfig('./UserView', [], { schema })
96
+ form.registries.functions = {
97
+ ...form.registries.functions,
98
+ customValidation(context) { /* ... */ }
99
+ }
100
+ mount(document.getElementById('root'), form)
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Dynamic properties
106
+
107
+ Any property can be a static value or a `{{functionName}}` reference. Functions receive `(context, event)` with `this` bound to an element-specific stage object. They re-evaluate automatically when reactive dependencies change.
108
+
109
+ ```js
110
+ {
111
+ show: '{{isAdmin}}',
112
+ label: '{{getLabel}}',
113
+ disabled: '{{isLocked}}',
114
+ innerText: '{{summary}}'
115
+ }
116
+ ```
117
+
118
+ There's no special list of "properties that can be dynamic." If you can set it statically, you can compute it with a function.
119
+
120
+ `show` conditionally renders an element. This works on fields, groups, buttons -- anything in the layout.
121
+
122
+ Pass arguments with `{{functionName:arg}}`:
123
+
124
+ ```js
125
+ {
126
+ show: '{{hasRole:editor}}',
127
+ className: '{{getStepClass:3}}'
128
+ }
129
+ ```
130
+
131
+ The arg is always a string. Parse it in the function if you need another type.
132
+
133
+ ---
134
+
135
+ ## Layout
136
+
137
+ Layout is an array of groups. Groups contain rows; rows contain field names (looked up in `registries.fields`) or inline element definitions:
138
+
139
+ ```js
140
+ layout: [
141
+ {
142
+ title: 'Contact Info',
143
+ rows: [
144
+ ['firstName', 'lastName'], // side by side
145
+ ['email'], // full width
146
+ ]
147
+ },
148
+ {
149
+ title: 'Preferences',
150
+ show: '{{hasAccount}}',
151
+ rows: [['theme', 'language']]
152
+ }
153
+ ]
154
+ ```
155
+
156
+ Bare arrays are sugar for `{ rows: [...] }`. String items in rows are registry lookups; object items render inline.
157
+
158
+ ---
159
+
160
+ ## Registries and spread
161
+
162
+ Registries are named definition collections. Definitions inherit from each other using `gst-compose` spread syntax:
163
+
164
+ ```js
165
+ registries: {
166
+ fields: {
167
+ email: { component: 'input', type: 'email', placeholder: 'Email' },
168
+ workEmail: { '...': 'email', placeholder: 'Work email' },
169
+ personalEmail: { '...': 'email', placeholder: 'Personal email' },
170
+ }
171
+ }
172
+ ```
173
+
174
+ `workEmail` spreads everything from `email`, then overrides `placeholder`. Cross-registry references work too: `"...": "fields.email"` from inside a different registry.
175
+
176
+ ---
177
+
178
+ ## Config loading
179
+
180
+ Load config from a directory of JSON/JS files. Files are discovered by naming convention and merged using `gst-compose`:
181
+
182
+ ```js
183
+ const form = await loadJsonConfig('./UserView', [], { schema })
184
+
185
+ // With variant overlays (each variant stacks on top)
186
+ const form = await loadJsonConfig('./UserView', ['uchealth', 'admin'], { schema })
187
+ ```
188
+
189
+ File naming: `property[-variant].{json|js}`. A form directory might contain:
190
+
191
+ ```
192
+ UserView/
193
+ fields.json # base field definitions
194
+ fields-uchealth.json # uchealth variant (merges with base)
195
+ layout.json # layout structure
196
+ functions.js # custom functions (JS, not JSON)
197
+ styles.json # scoped styles
198
+ ```
199
+
200
+ The loader finds all files, resolves variants in order, applies `gst-compose` spread semantics, and returns the unified config object.
201
+
202
+ ---
203
+
204
+ ## LiveConfig
205
+
206
+ Patch configuration at runtime without reloading:
207
+
208
+ ```js
209
+ import { LiveConfig } from '@archduck/gst-core'
210
+
211
+ const liveConfig = new LiveConfig({ schema })
212
+ await liveConfig.load('./UserView')
213
+
214
+ liveConfig.patch('fields', { email: { required: true } })
215
+ const form = liveConfig.get()
216
+ ```
217
+
218
+ Patches cascade through dependencies. If `workEmail` spreads from `email`, patching `email` re-resolves `workEmail` too.
219
+
220
+ ---
221
+
222
+ ## Scoped styles
223
+
224
+ ```js
225
+ styles: {
226
+ scoped: true,
227
+ rules: {
228
+ '&': { maxWidth: '48em', marginInline: 'auto' },
229
+ '& input': { padding: '0.5em', border: '1px solid #ccc' },
230
+ }
231
+ }
232
+ ```
233
+
234
+ `&` refers to the mount container. Styles are written in JS object syntax (camelCase properties), injected as a `<style>` element, and cleaned up on unmount. Multiple mount instances on the same page don't collide.
235
+
236
+ ---
237
+
238
+ ## Extending gst-core
239
+
240
+ ### Custom components
241
+
242
+ Register renderers in the component registry:
243
+
244
+ ```js
245
+ registries: {
246
+ components: {
247
+ StarRating: {
248
+ _adapter: {
249
+ mount(container, { def, store }) {
250
+ // create DOM, wire events, return { unmount() {} }
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+ ```
257
+
258
+ Components are referenced by name in definitions: `{ component: 'StarRating', max: 5 }`.
259
+
260
+ ### Define your own domain vocabulary
261
+
262
+ `createTLPSchema` lets you declare what top-level properties exist, which are registries, and how they depend on each other:
263
+
264
+ ```js
265
+ import { createTLPSchema } from '@archduck/gst-core'
266
+
267
+ const schema = createTLPSchema({
268
+ functions: { registry: true, dependencies: [] },
269
+ widgets: { registry: true, dependencies: ['functions'] },
270
+ dataSources: { registry: true, dependencies: [] },
271
+ layout: { dependencies: ['widgets', 'dataSources'], default: [] },
272
+ settings: { dependencies: [] },
273
+ })
274
+ ```
275
+
276
+ The `dependencies` array drives resolution order via topological sort. Config loading, variant layering, spread syntax, and cross-references all work with your vocabulary. `gst-forms` defines its own schema (fields, buttons, actions, hooks); you could define one for a dashboard engine, page builder, or anything else.
277
+
278
+ ### Inject domain behavior
279
+
280
+ `mount()` is a generic renderer. It turns config into reactive DOM but has no opinion about what that DOM means. Domain-specific behavior goes through options:
281
+
282
+ ```js
283
+ mount(container, config, {
284
+ record: { key: null, data: {} },
285
+ components: {},
286
+ initialState: {},
287
+ effects: [(store) => effect(() => { /* ... */ })],
288
+ setupActions: (store, options) => { /* ... */ },
289
+ onMount: (store, controller) => {},
290
+ onUnmount: (store) => {},
291
+ onHide: (def, store) => {},
292
+ })
293
+ ```
294
+
295
+ `gst-forms` injects dirty tracking, field errors, action hooks, and confirmation dialogs through this interface. A different plugin could inject drag-and-drop, real-time collaboration, or analytics.
296
+
297
+ ---
298
+
299
+ ## API reference
300
+
301
+ ### `mount(container, config, options?) -> controller`
302
+
303
+ Render config into a DOM container. Returns a controller:
304
+
305
+ - `controller.update(record)` -- update record data reactively
306
+ - `controller.executeAction(name, extra)` -- trigger an action
307
+ - `controller.unmount()` -- clean up and remove from DOM
308
+ - `controller.store` -- the reactive store (read-only access)
309
+
310
+ ### `createTLPSchema(declarations) -> schema`
311
+
312
+ Build a schema from top-level property declarations. Returns an object with `resolutionOrder`, `dependencies`, `registryMapping`, `validRegistries`, and `getDefault(property)`.
313
+
314
+ ### `loadJsonConfig(path, variants?, options?) -> Promise<config>`
315
+
316
+ Load and merge config files from a namespace directory. Options include `schema` (required), `scope`, `registries`, `functions`.
317
+
318
+ ### `LiveConfig`
319
+
320
+ Stateful config manager with runtime patching.
321
+
322
+ - `new LiveConfig({ schema })`
323
+ - `liveConfig.load(path, variants?, options?)` -- load from files
324
+ - `liveConfig.from(config, options?)` -- initialize from existing config
325
+ - `liveConfig.get()` -- get resolved config (cached)
326
+ - `liveConfig.patch(property, patch)` -- merge patch, re-resolve dependents
327
+ - `liveConfig.set(property, value)` -- replace property, re-resolve dependents
328
+
329
+ ### Config merging utilities
330
+
331
+ - `mergeConfigs(...configs)` -- deep merge with array spread support
332
+ - `mergeRegistries(...registries)` -- merge registry objects
333
+ - `applyMap(config, map)` -- apply string replacement map (i18n)
334
+ - `mergeMaps(...maps)` -- merge translation maps
335
+
336
+ ### Reactivity (re-exported from @vue/reactivity)
337
+
338
+ `reactive`, `effect`, `computed`, `ref`, `toRaw`, `stop`, `pauseTracking`, `enableTracking`
339
+
340
+ ### Style processing
341
+
342
+ - `processStyles(styles, scopeId)` -- convert JS style objects to scoped CSS
343
+ - `injectStyles(css, id)` / `removeStyles(id)` -- manage `<style>` elements
344
+ - `generateScopeId()` -- generate unique scope ID
@@ -0,0 +1,35 @@
1
+ "use strict";const f=require("./mergeConfigs-Dgwcseh2.js");/**
2
+ * @vue/shared v3.5.32
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function Re(t){const n=Object.create(null);for(const e of t.split(","))n[e]=1;return e=>e in n}process.env.NODE_ENV!=="production"&&Object.freeze({});process.env.NODE_ENV!=="production"&&Object.freeze([]);const lt=Object.assign,xe=Object.prototype.hasOwnProperty,Tt=(t,n)=>xe.call(t,n),ut=Array.isArray,it=t=>se(t)==="[object Map]",Te=t=>typeof t=="function",Ne=t=>typeof t=="string",vt=t=>typeof t=="symbol",ft=t=>t!==null&&typeof t=="object",Ie=Object.prototype.toString,se=t=>Ie.call(t),oe=t=>se(t).slice(8,-1),qt=t=>Ne(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ve=t=>{const n=Object.create(null);return(e=>n[e]||(n[e]=t(e)))},Fe=Ve(t=>t.charAt(0).toUpperCase()+t.slice(1)),K=(t,n)=>!Object.is(t,n);/**
6
+ * @vue/reactivity v3.5.32
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/function q(t,...n){console.warn(`[Vue warn] ${t}`,...n)}let w;const jt=new WeakSet;class te{constructor(n){this.fn=n,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,jt.has(this)&&(jt.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ce(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ee(this),le(this);const n=w,e=T;w=this,T=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&w!==this&&q("Active effect was not restored correctly - this is likely a Vue internal bug."),ue(this),w=n,T=e,this.flags&=-3}}stop(){if(this.flags&1){for(let n=this.deps;n;n=n.nextDep)Gt(n);this.deps=this.depsTail=void 0,ee(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?jt.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Nt(this)&&this.run()}get dirty(){return Nt(this)}}let ae=0,st,ot;function ce(t,n=!1){if(t.flags|=8,n){t.next=ot,ot=t;return}t.next=st,st=t}function Ht(){ae++}function zt(){if(--ae>0)return;if(ot){let n=ot;for(ot=void 0;n;){const e=n.next;n.next=void 0,n.flags&=-9,n=e}}let t;for(;st;){let n=st;for(st=void 0;n;){const e=n.next;if(n.next=void 0,n.flags&=-9,n.flags&1)try{n.trigger()}catch(r){t||(t=r)}n=e}}if(t)throw t}function le(t){for(let n=t.deps;n;n=n.nextDep)n.version=-1,n.prevActiveLink=n.dep.activeLink,n.dep.activeLink=n}function ue(t){let n,e=t.depsTail,r=e;for(;r;){const i=r.prevDep;r.version===-1?(r===e&&(e=i),Gt(r),ke(r)):n=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}t.deps=n,t.depsTail=e}function Nt(t){for(let n=t.deps;n;n=n.nextDep)if(n.dep.version!==n.version||n.dep.computed&&(fe(n.dep.computed)||n.dep.version!==n.version))return!0;return!!t._dirty}function fe(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===dt)||(t.globalVersion=dt,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Nt(t))))return;t.flags|=2;const n=t.dep,e=w,r=T;w=t,T=!0;try{le(t);const i=t.fn(t._value);(n.version===0||K(i,t._value))&&(t.flags|=128,t._value=i,n.version++)}catch(i){throw n.version++,i}finally{w=e,T=r,ue(t),t.flags&=-3}}function Gt(t,n=!1){const{dep:e,prevSub:r,nextSub:i}=t;if(r&&(r.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=r,t.nextSub=void 0),process.env.NODE_ENV!=="production"&&e.subsHead===t&&(e.subsHead=i),e.subs===t&&(e.subs=r,!r&&e.computed)){e.computed.flags&=-5;for(let s=e.computed.deps;s;s=s.nextDep)Gt(s,!0)}!n&&!--e.sc&&e.map&&e.map.delete(e.key)}function ke(t){const{prevDep:n,nextDep:e}=t;n&&(n.nextDep=e,t.prevDep=void 0),e&&(e.prevDep=n,t.nextDep=void 0)}function B(t,n){t.effect instanceof te&&(t=t.effect.fn);const e=new te(t);n&&lt(e,n);try{e.run()}catch(i){throw e.stop(),i}const r=e.run.bind(e);return r.effect=e,r}function L(t){t.effect.stop()}let T=!0;const Ut=[];function de(){Ut.push(T),T=!1}function Le(){Ut.push(T),T=!0}function Me(){const t=Ut.pop();T=t===void 0?!0:t}function ee(t){const{cleanup:n}=t;if(t.cleanup=void 0,n){const e=w;w=void 0;try{n()}finally{w=e}}}let dt=0;class Pe{constructor(n,e){this.sub=n,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Yt{constructor(n){this.computed=n,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(n){if(!w||!T||w===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==w)e=this.activeLink=new Pe(w,this),w.deps?(e.prevDep=w.depsTail,w.depsTail.nextDep=e,w.depsTail=e):w.deps=w.depsTail=e,pe(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){const r=e.nextDep;r.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=r),e.prevDep=w.depsTail,e.nextDep=void 0,w.depsTail.nextDep=e,w.depsTail=e,w.deps===e&&(w.deps=r)}return process.env.NODE_ENV!=="production"&&w.onTrack&&w.onTrack(lt({effect:w},n)),e}trigger(n){this.version++,dt++,this.notify(n)}notify(n){Ht();try{if(process.env.NODE_ENV!=="production")for(let e=this.subsHead;e;e=e.nextSub)e.sub.onTrigger&&!(e.sub.flags&8)&&e.sub.onTrigger(lt({effect:e.sub},n));for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{zt()}}}function pe(t){if(t.dep.sc++,t.sub.flags&4){const n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let r=n.deps;r;r=r.nextDep)pe(r)}const e=t.dep.subs;e!==t&&(t.prevSub=e,e&&(e.nextSub=t)),process.env.NODE_ENV!=="production"&&t.dep.subsHead===void 0&&(t.dep.subsHead=t),t.dep.subs=t}}const It=new WeakMap,Y=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Vt=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),pt=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function x(t,n,e){if(T&&w){let r=It.get(t);r||It.set(t,r=new Map);let i=r.get(e);i||(r.set(e,i=new Yt),i.map=r,i.key=e),process.env.NODE_ENV!=="production"?i.track({target:t,type:n,key:e}):i.track()}}function W(t,n,e,r,i,s){const a=It.get(t);if(!a){dt++;return}const o=c=>{c&&(process.env.NODE_ENV!=="production"?c.trigger({target:t,type:n,key:e,newValue:r,oldValue:i,oldTarget:s}):c.trigger())};if(Ht(),n==="clear")a.forEach(o);else{const c=ut(t),p=c&&qt(e);if(c&&e==="length"){const v=Number(r);a.forEach((l,u)=>{(u==="length"||u===pt||!vt(u)&&u>=v)&&o(l)})}else switch((e!==void 0||a.has(void 0))&&o(a.get(e)),p&&o(a.get(pt)),n){case"add":c?p&&o(a.get("length")):(o(a.get(Y)),it(t)&&o(a.get(Vt)));break;case"delete":c||(o(a.get(Y)),it(t)&&o(a.get(Vt)));break;case"set":it(t)&&o(a.get(Y));break}}zt()}function J(t){const n=O(t);return n===t?n:(x(n,"iterate",pt),z(t)?n:n.map(M))}function Qt(t){return x(t=O(t),"iterate",pt),t}function F(t,n){return H(t)?ht(Ee(t)?M(n):n):M(n)}const Ke={__proto__:null,[Symbol.iterator](){return Rt(this,Symbol.iterator,t=>F(this,t))},concat(...t){return J(this).concat(...t.map(n=>ut(n)?J(n):n))},entries(){return Rt(this,"entries",t=>(t[1]=F(this,t[1]),t))},every(t,n){return k(this,"every",t,n,void 0,arguments)},filter(t,n){return k(this,"filter",t,n,e=>e.map(r=>F(this,r)),arguments)},find(t,n){return k(this,"find",t,n,e=>F(this,e),arguments)},findIndex(t,n){return k(this,"findIndex",t,n,void 0,arguments)},findLast(t,n){return k(this,"findLast",t,n,e=>F(this,e),arguments)},findLastIndex(t,n){return k(this,"findLastIndex",t,n,void 0,arguments)},forEach(t,n){return k(this,"forEach",t,n,void 0,arguments)},includes(...t){return xt(this,"includes",t)},indexOf(...t){return xt(this,"indexOf",t)},join(t){return J(this).join(t)},lastIndexOf(...t){return xt(this,"lastIndexOf",t)},map(t,n){return k(this,"map",t,n,void 0,arguments)},pop(){return nt(this,"pop")},push(...t){return nt(this,"push",t)},reduce(t,...n){return ne(this,"reduce",t,n)},reduceRight(t,...n){return ne(this,"reduceRight",t,n)},shift(){return nt(this,"shift")},some(t,n){return k(this,"some",t,n,void 0,arguments)},splice(...t){return nt(this,"splice",t)},toReversed(){return J(this).toReversed()},toSorted(t){return J(this).toSorted(t)},toSpliced(...t){return J(this).toSpliced(...t)},unshift(...t){return nt(this,"unshift",t)},values(){return Rt(this,"values",t=>F(this,t))}};function Rt(t,n,e){const r=Qt(t),i=r[n]();return r!==t&&!z(t)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=e(s.value)),s}),i}const We=Array.prototype;function k(t,n,e,r,i,s){const a=Qt(t),o=a!==t&&!z(t),c=a[n];if(c!==We[n]){const l=c.apply(t,s);return o?M(l):l}let p=e;a!==t&&(o?p=function(l,u){return e.call(this,F(t,l),u,t)}:e.length>2&&(p=function(l,u){return e.call(this,l,u,t)}));const v=c.call(a,p,r);return o&&i?i(v):v}function ne(t,n,e,r){const i=Qt(t),s=i!==t&&!z(t);let a=e,o=!1;i!==t&&(s?(o=r.length===0,a=function(p,v,l){return o&&(o=!1,p=F(t,p)),e.call(this,p,F(t,v),l,t)}):e.length>3&&(a=function(p,v,l){return e.call(this,p,v,l,t)}));const c=i[n](a,...r);return o?F(t,c):c}function xt(t,n,e){const r=O(t);x(r,"iterate",pt);const i=r[n](...e);return(i===-1||i===!1)&&nn(e[0])?(e[0]=O(e[0]),r[n](...e)):i}function nt(t,n,e=[]){de(),Ht();const r=O(t)[n].apply(t,e);return zt(),Me(),r}const Be=Re("__proto__,__v_isRef,__isVue"),he=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(vt));function qe(t){vt(t)||(t=String(t));const n=O(this);return x(n,"has",t),n.hasOwnProperty(t)}class ye{constructor(n=!1,e=!1){this._isReadonly=n,this._isShallow=e}get(n,e,r){if(e==="__v_skip")return n.__v_skip;const i=this._isReadonly,s=this._isShallow;if(e==="__v_isReactive")return!i;if(e==="__v_isReadonly")return i;if(e==="__v_isShallow")return s;if(e==="__v_raw")return r===(i?s?De:ge:s?Xe:be).get(n)||Object.getPrototypeOf(n)===Object.getPrototypeOf(r)?n:void 0;const a=ut(n);if(!i){let c;if(a&&(c=Ke[e]))return c;if(e==="hasOwnProperty")return qe}const o=Reflect.get(n,e,X(n)?n:r);if((vt(e)?he.has(e):Be(e))||(i||x(n,"get",e),s))return o;if(X(o)){const c=a&&qt(e)?o:o.value;return i&&ft(c)?kt(c):c}return ft(o)?i?kt(o):Ct(o):o}}class He extends ye{constructor(n=!1){super(!1,n)}set(n,e,r,i){let s=n[e];const a=ut(n)&&qt(e);if(!this._isShallow){const p=H(s);if(!z(r)&&!H(r)&&(s=O(s),r=O(r)),!a&&X(s)&&!X(r))return p?(process.env.NODE_ENV!=="production"&&q(`Set operation on key "${String(e)}" failed: target is readonly.`,n[e]),!0):(s.value=r,!0)}const o=a?Number(e)<n.length:Tt(n,e),c=Reflect.set(n,e,r,X(n)?n:i);return n===O(i)&&(o?K(r,s)&&W(n,"set",e,r,s):W(n,"add",e,r)),c}deleteProperty(n,e){const r=Tt(n,e),i=n[e],s=Reflect.deleteProperty(n,e);return s&&r&&W(n,"delete",e,void 0,i),s}has(n,e){const r=Reflect.has(n,e);return(!vt(e)||!he.has(e))&&x(n,"has",e),r}ownKeys(n){return x(n,"iterate",ut(n)?"length":Y),Reflect.ownKeys(n)}}class ze extends ye{constructor(n=!1){super(!0,n)}set(n,e){return process.env.NODE_ENV!=="production"&&q(`Set operation on key "${String(e)}" failed: target is readonly.`,n),!0}deleteProperty(n,e){return process.env.NODE_ENV!=="production"&&q(`Delete operation on key "${String(e)}" failed: target is readonly.`,n),!0}}const Ge=new He,Ue=new ze,Ft=t=>t,Et=t=>Reflect.getPrototypeOf(t);function Ye(t,n,e){return function(...r){const i=this.__v_raw,s=O(i),a=it(s),o=t==="entries"||t===Symbol.iterator&&a,c=t==="keys"&&a,p=i[t](...r),v=e?Ft:n?ht:M;return!n&&x(s,"iterate",c?Vt:Y),lt(Object.create(p),{next(){const{value:l,done:u}=p.next();return u?{value:l,done:u}:{value:o?[v(l[0]),v(l[1])]:v(l),done:u}}})}}function mt(t){return function(...n){if(process.env.NODE_ENV!=="production"){const e=n[0]?`on key "${n[0]}" `:"";q(`${Fe(t)} operation ${e}failed: target is readonly.`,O(this))}return t==="delete"?!1:t==="clear"?void 0:this}}function Qe(t,n){const e={get(i){const s=this.__v_raw,a=O(s),o=O(i);t||(K(i,o)&&x(a,"get",i),x(a,"get",o));const{has:c}=Et(a),p=n?Ft:t?ht:M;if(c.call(a,i))return p(s.get(i));if(c.call(a,o))return p(s.get(o));s!==a&&s.get(i)},get size(){const i=this.__v_raw;return!t&&x(O(i),"iterate",Y),i.size},has(i){const s=this.__v_raw,a=O(s),o=O(i);return t||(K(i,o)&&x(a,"has",i),x(a,"has",o)),i===o?s.has(i):s.has(i)||s.has(o)},forEach(i,s){const a=this,o=a.__v_raw,c=O(o),p=n?Ft:t?ht:M;return!t&&x(c,"iterate",Y),o.forEach((v,l)=>i.call(s,p(v),p(l),a))}};return lt(e,t?{add:mt("add"),set:mt("set"),delete:mt("delete"),clear:mt("clear")}:{add(i){const s=O(this),a=Et(s),o=O(i),c=!n&&!z(i)&&!H(i)?o:i;return a.has.call(s,c)||K(i,c)&&a.has.call(s,i)||K(o,c)&&a.has.call(s,o)||(s.add(c),W(s,"add",c,c)),this},set(i,s){!n&&!z(s)&&!H(s)&&(s=O(s));const a=O(this),{has:o,get:c}=Et(a);let p=o.call(a,i);p?process.env.NODE_ENV!=="production"&&re(a,o,i):(i=O(i),p=o.call(a,i));const v=c.call(a,i);return a.set(i,s),p?K(s,v)&&W(a,"set",i,s,v):W(a,"add",i,s),this},delete(i){const s=O(this),{has:a,get:o}=Et(s);let c=a.call(s,i);c?process.env.NODE_ENV!=="production"&&re(s,a,i):(i=O(i),c=a.call(s,i));const p=o?o.call(s,i):void 0,v=s.delete(i);return c&&W(s,"delete",i,void 0,p),v},clear(){const i=O(this),s=i.size!==0,a=process.env.NODE_ENV!=="production"?it(i)?new Map(i):new Set(i):void 0,o=i.clear();return s&&W(i,"clear",void 0,void 0,a),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Ye(i,t,n)}),e}function ve(t,n){const e=Qe(t,n);return(r,i,s)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(Tt(e,i)&&i in r?e:r,i,s)}const Ze={get:ve(!1,!1)},Je={get:ve(!0,!1)};function re(t,n,e){const r=O(e);if(r!==e&&n.call(t,r)){const i=oe(t);q(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const be=new WeakMap,Xe=new WeakMap,ge=new WeakMap,De=new WeakMap;function tn(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function en(t){return t.__v_skip||!Object.isExtensible(t)?0:tn(oe(t))}function Ct(t){return H(t)?t:_e(t,!1,Ge,Ze,be)}function kt(t){return _e(t,!0,Ue,Je,ge)}function _e(t,n,e,r,i){if(!ft(t))return process.env.NODE_ENV!=="production"&&q(`value cannot be made ${n?"readonly":"reactive"}: ${String(t)}`),t;if(t.__v_raw&&!(n&&t.__v_isReactive))return t;const s=en(t);if(s===0)return t;const a=i.get(t);if(a)return a;const o=new Proxy(t,s===2?r:e);return i.set(t,o),o}function Ee(t){return H(t)?Ee(t.__v_raw):!!(t&&t.__v_isReactive)}function H(t){return!!(t&&t.__v_isReadonly)}function z(t){return!!(t&&t.__v_isShallow)}function nn(t){return t?!!t.__v_raw:!1}function O(t){const n=t&&t.__v_raw;return n?O(n):t}const M=t=>ft(t)?Ct(t):t,ht=t=>ft(t)?kt(t):t;function X(t){return t?t.__v_isRef===!0:!1}function rn(t){return sn(t,!1)}function sn(t,n){return X(t)?t:new on(t,n)}class on{constructor(n,e){this.dep=new Yt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?n:O(n),this._value=e?n:M(n),this.__v_isShallow=e}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(n){const e=this._rawValue,r=this.__v_isShallow||z(n)||H(n);n=r?n:O(n),K(n,e)&&(this._rawValue=n,this._value=r?n:M(n),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:n,oldValue:e}):this.dep.trigger())}}class an{constructor(n,e,r){this.fn=n,this.setter=e,this._value=void 0,this.dep=new Yt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=dt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&w!==this)return ce(this,!0),!0;process.env.NODE_ENV}get value(){const n=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return fe(this),n&&(n.version=this.dep.version),this._value}set value(n){this.setter?this.setter(n):process.env.NODE_ENV!=="production"&&q("Write operation failed: computed value is readonly")}}function cn(t,n,e=!1){let r,i;Te(t)?r=t:(r=t.get,i=t.set);const s=new an(r,i,e);return process.env.NODE_ENV!=="production"&&n&&!e&&(s.onTrack=n.onTrack,s.onTrigger=n.onTrigger),s}let at=!1,rt=new Set;function me(){at=!0}function Se(){at=!1,rt.clear()}function St(t,n,e,r=null,i={}){var v;if(!t)return f.logger.warn("createStage called with null/undefined def"),Object.freeze({});const s=t.name||e,a=typeof n=="function"?n:()=>n,o=a();o||f.logger.warn(`createStage: context is null for element "${s||e}"`);const c=s&&((v=o==null?void 0:o.form)!=null&&v.getInitialValue)?o.form.getInitialValue(s):void 0,p={get def(){return t},get path(){return e||s},get name(){return s},get element(){return r||(s?document.querySelector(`[name="${s}"]`):null)}};return t.component||t.type!=="button"?Object.freeze({...p,get value(){var l,u;return(u=(l=a())==null?void 0:l.form)==null?void 0:u.getValue(s)},get currentValue(){var u,y;const l=this.element;return l?l.type==="checkbox"?l.checked:l.value:(y=(u=a())==null?void 0:u.form)==null?void 0:y.getValue(s)},get initialValue(){return c},get isDirty(){return this.currentValue!==c},get errors(){var l,u;return((u=(l=a())==null?void 0:l.form)==null?void 0:u.getFieldErrors(s))||[]},get isValid(){var l,u;return(((u=(l=a())==null?void 0:l.form)==null?void 0:u.getFieldErrors(s))||[]).length===0},get isRequired(){var l,u;return((u=(l=a())==null?void 0:l.form)==null?void 0:u.isRequired(s))||!1},get isReadonly(){var l,u;return((u=(l=a())==null?void 0:l.form)==null?void 0:u.isReadonly(s))||!1},get isSystemField(){var l,u;return((u=(l=a())==null?void 0:l.form)==null?void 0:u.isSystemField(s))||!1},setValue(l){var y;if(!s)return;if(at||i.readOnly){rt.has(s)||(rt.add(s),f.logger.error(`[INFINITE LOOP PREVENTED] setValue("${s}") called during render phase. Formatters must RETURN the formatted value, not call setValue(). Check your formatter function for field "${s}".`));return}const u=a();if(!((y=u==null?void 0:u.form)!=null&&y.setValue)){f.logger.warn(`setValue: form context not available for "${s}"`);return}u.form.setValue(s,l)},setError(l){var h;if(!s)return;if(at||i.readOnly){rt.has(`${s}:error`)||(rt.add(`${s}:error`),f.logger.error(`[INFINITE LOOP PREVENTED] setError("${s}") called during render phase. Validators should be used with onBlur/onChange, not during render. Check your validator function for field "${s}".`));return}const u=a();if(!((h=u==null?void 0:u.form)!=null&&h.setFieldErrors)){f.logger.warn(`setError: form context not available for "${s}"`);return}const y=Array.isArray(l)?l:[l];u.form.setFieldErrors(s,y)},clearErrors(){var u;if(!s||at||i.readOnly)return;const l=a();if(!((u=l==null?void 0:l.form)!=null&&u.setFieldErrors)){f.logger.warn(`clearErrors: form context not available for "${s}"`);return}l.form.setFieldErrors(s,[])},focus(){var l;(l=this.element)==null||l.focus()},blur(){var l;(l=this.element)==null||l.blur()},select(){var l,u;(u=(l=this.element)==null?void 0:l.select)==null||u.call(l)}}):Object.freeze({...p,get isLoading(){var l,u,y;return((y=(u=(l=a())==null?void 0:l.form)==null?void 0:u.isLoading)==null?void 0:y.call(u,s))||!1},executeAction(l){var y;const u=a();return(y=u==null?void 0:u.form)!=null&&y.executeAction?u.form.executeAction(s,l):(f.logger.warn(`executeAction: form context not available for button "${s}"`),Promise.reject(new Error("Form context not available")))}})}function $e(t){if(t.startsWith("_")||t==="...")return t;const n=t.toLowerCase();return n.startsWith("data-")||n.startsWith("aria-")||n==="accept-charset"||n==="http-equiv"?n:n.replace(/-([a-z])/g,(e,r)=>r.toUpperCase())}function Ae(t){if(!t||typeof t!="object"||Array.isArray(t))return t;const n={};for(const e of Object.keys(t))n[$e(e)]=t[e];return n}const ln=new Set(["abort","auxclick","beforeinput","blur","cancel","change","click","close","compositionend","compositionstart","compositionupdate","contextmenu","copy","cut","dblclick","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","error","focus","focusin","focusout","input","invalid","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","paste","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup","reset","resize","scroll","scrollend","select","submit","touchcancel","touchend","touchmove","touchstart","transitionend","wheel"]);function D(t){return t.length<=2||t[0]!=="o"||t[1]!=="n"?!1:t[2]>="A"&&t[2]<="Z"?!0:ln.has(t.slice(2))}function $t(t,n,e={}){const{path:r,available:i=[]}=e,s=[`⚠️ ${t} "${n}" not found`];return r&&s.push(`
10
+ Path: ${r}`),i.length>0&&s.push(`
11
+ Available: ${i.join(", ")}`),s.push(`
12
+ 💡 Check spelling or add "${n}" to your ${t.toLowerCase()} registry`),s.join("")}function Lt(t,n){if(typeof t!="string")return null;const e=t.indexOf(".");if(e<=0)return null;const r=t.slice(0,e),i=t.slice(e+1);return n&&!n.has(r)||!i?null:{registry:r,key:i}}const bt=(t,n={},e="registry",r="",i={})=>{var p;const{allRegistries:s=null,fallbackRegistry:a=null,validRegistries:o=null,_visited:c=new Set}=i;if(typeof t=="string"){t==="^"&&(t=r);const v=Lt(t,o);let l,u=e,y=t;if(v&&s?(u=v.registry,y=v.key,l=(p=s[v.registry])==null?void 0:p[v.key]):l=n[t],typeof l=="string"&&(l=null),!l){const h=Object.keys(v&&s?s[v.registry]||{}:n);return f.logger.warn($t(u,y,{path:r?`${e}.${r}`:e,available:h})),f.isDebugActive()&&f.trace("registry",`resolve-spread "${r||y}"`,`MISSING string ref "${y}" in ${u}`,{lookupKey:y,lookupRegistry:u,available:h}),null}return f.isDebugEnabled()&&r&&f.logRegistry(e,r,"REFERENCE",`reference to ${t}`),{...l}}if(t&&typeof t=="object"&&t["..."]){const v=t["..."],{"...":l,...u}=t,y=Lt(v,o);let h=n,d=e,g=v;y&&s&&(h=s[y.registry]||{},d=y.registry,g=y.key);const E=`${d}.${g}`;if(c.has(E))return a!=null&&a[g]?(f.isDebugActive()&&f.trace("registry",`resolve-spread "${r}"`,`circular ref "${E}" resolved via fallback`,{refKey:E,itemName:r}),{...a[g],...u}):(f.logger.error(`Circular reference detected: ${E} references itself through spread chain. Breaking circular dependency.`),f.isDebugActive()&&f.trace("registry",`resolve-spread "${r}"`,`CIRCULAR ref "${E}" (breaking chain)`,{refKey:E,visited:[...c],itemName:r}),u);const C=new Set(c);C.add(E);let b=h[g];if(b&&typeof b=="object"&&b["..."]===g&&(a!=null&&a[g])&&(b=a[g]),!b)return f.logger.warn($t(`${d} spread`,g,{path:r?`${e}.${r}`:e,available:Object.keys(h)})),f.isDebugActive()&&f.trace("registry",`resolve-spread "${r}"`,`MISSING base "${g}" in ${d} (using overrides only)`,{itemName:r,lookupKey:g,targetRegistryName:d,available:Object.keys(h),overrideKeys:Object.keys(u)}),u;if(f.isDebugEnabled()&&r){const _=Object.keys(u).length;f.logRegistry(e,r,"SPREAD",`spread from ${v}, overrides=${_}`)}const S=bt(b,h,d,g,{allRegistries:s,fallbackRegistry:a,validRegistries:o,_visited:C});return!S||typeof S!="object"?(f.logger.warn(`Base definition "${v}" resolved to non-object type ${typeof S}`),u):{...S,...u}}return t},Mt=(t,n={},e={},r)=>{if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(c=>Mt(c,n,e,r));const i={...t},s=t.name||"unknown";if(typeof i.options=="string"&&i.options.startsWith("@")){const c=i.options.slice(1),p=e[c];p&&(i.options=p)}const a=D,o=new Set(["validator","formatter","parser","format","parse","validate"]);for(const[c,p]of Object.entries(i))if(!c.startsWith("__")&&p!=null&&typeof p=="string"&&p.startsWith("{{")&&p.endsWith("}}")){const v=p.replace(/^{{|}}$/g,""),l=n[v];if(!l){a(c)&&f.logger.warn($t("Function",v,{path:`${s}.${c}`,available:Object.keys(n)})),f.isDebugActive()&&f.trace("prop",`bind-function "${s}.${c}"`,`"${v}" not found (preserved for late resolution)`,{field:s,property:c,functionName:v,isEventHandler:a(c),availableFunctions:Object.keys(n)}),i[c]=p;continue}if(typeof l!="function"){f.logger.error(`Security: Expected function but got ${typeof l} for "${v}" at ${s}.${c}. This could indicate a configuration error or attempted code injection.`);continue}a(c)?i[c]=u=>{try{const y=r();if(!y)return;const h=St(i,()=>y,s);return l.call(h,y,u)}catch(y){return f.logger.error(`Error in event handler "${c}" for "${s}":`,{error:y,function:v,element:s}),!1}}:o.has(c)?i[c]=(u,y)=>{me();try{const h=St(i,()=>u,s);return l.call(h,u,y)}catch(h){f.logger.error(`Error in transform function "${c}" for "${s}":`,{error:h,function:v,element:s});return}finally{Se()}}:i[c]=p}if(typeof t.action=="string"&&t.action.startsWith("{{")&&(i.action=t.action.replace(/^{{|}}$/g,"")),i.fields&&typeof i.fields=="object"&&!Array.isArray(i.fields)){const c={};for(const[p,v]of Object.entries(i.fields))c[p]=Mt(v,n,e,r);i.fields=c}return i},un=new Set(["__proto__","constructor","prototype"]),Pt=(t,n={},e)=>{if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(i=>Pt(i,n,e));const r={};for(const[i,s]of Object.entries(t)){if(i.startsWith("__")){r[i]=s;continue}if(un.has(i)){f.logger.error(`Security: Blocked potential prototype pollution attempt with key "${i}" in record data. This key is not allowed in record objects.`);continue}if(s&&typeof s=="object"){r[i]=Pt(s,n,e);continue}if(typeof s=="string"&&s.startsWith("{{")&&s.endsWith("}}")){const a=s.replace(/^{{|}}$/g,""),o=n[a];if(!o){f.logger.warn($t("Function",a,{path:`record.data.${i}`,available:Object.keys(n)})),r[i]=s;continue}if(typeof o!="function"){f.logger.error(`Expected function but got ${typeof o} for "${a}" in record.data.${i}`),r[i]=s;continue}try{const c=e();r[i]=o(c,{type:"recordInit",key:i})}catch(c){f.logger.error(`Error evaluating function "${a}" for record.data.${i}:`,c),r[i]=void 0}}else r[i]=s}return r};function At(t,n){const e=n.split(".");let r=t;for(const i of e){if(r==null)return;r=r[i]}return r}function wt(t,n,e){const r=n.split(".");let i=t;for(let s=0;s<r.length-1;s++)i[r[s]]==null&&(i[r[s]]={}),i=i[r[s]];i[r[r.length-1]]=e}function ct(t,n,e){var r,i,s;if(e!=null&&e.bind)return At(t,e.bind);if(e!=null&&e.path)return At((r=t.record)==null?void 0:r.data,e.path);if(n)return(s=(i=t.record)==null?void 0:i.data)==null?void 0:s[n]}function yt(t,n,e,r){var i,s;if(e!=null&&e.bind){wt(t,e.bind,r);return}if(e!=null&&e.path){(i=t.record)!=null&&i.data&&wt(t.record.data,e.path,r);return}n&&(s=t.record)!=null&&s.data&&(t.record.data[n]=r)}function fn(t,n){return n!=null&&n.bind?null:n!=null&&n.path?n.path:t||null}function dn(t,n,e){var r,i;if(!(e!=null&&e.bind)){if(e!=null&&e.path){(r=t.record)!=null&&r.data&&wt(t.record.data,e.path,void 0);return}n&&(i=t.record)!=null&&i.data&&(t.record.data[n]=void 0)}}function Kt(t){var n;return t?{record:t.record,meta:t.meta,state:t.state||{},registries:t.registries,functions:((n=t.registries)==null?void 0:n.functions)||{},form:pn(t),props:t.callbacks||{}}:{}}function pn(t){return{getValue:n=>{var e,r;return t._getFieldValue?t._getFieldValue(n):(r=(e=t.record)==null?void 0:e.data)==null?void 0:r[n]},setValue:(n,e)=>{var r;if(t._setFieldValue)return t._setFieldValue(n,e);(r=t.record)!=null&&r.data&&(t.record.data[n]=e)},getState:n=>{var e;return(e=t.state)==null?void 0:e[n]},setState:(n,e)=>{t.state&&(t.state[n]=e)},get isDirty(){return t.isDirty},get isSubmitting(){return t.isSubmitting},get isDeleted(){return t.isDeleted},getFieldErrors:n=>{var e;return((e=t.fieldErrors)==null?void 0:e[n])||[]},setFieldErrors:(n,e)=>{t.fieldErrors&&(t.fieldErrors[n]=e)},setFieldError:(n,e)=>{t.fieldErrors&&(t.fieldErrors[n]=Array.isArray(e)?e:[e])},clearFieldError:n=>{t.fieldErrors&&(t.fieldErrors[n]=[])},executeAction:t.executeAction,isRequired:n=>{var e,r,i;return!!((i=(r=(e=t.registries)==null?void 0:e.fields)==null?void 0:r[n])!=null&&i.required)},isReadonly:n=>{var e,r;return((r=(e=t.meta)==null?void 0:e.readonly)==null?void 0:r.includes(n))||!1},isSystemField:n=>{var e,r;return((r=(e=t.meta)==null?void 0:e.systemFields)==null?void 0:r.includes(n))||!1},getInitialValue:n=>{var i,s,a,o,c;const e=(s=(i=t.registries)==null?void 0:i.fields)==null?void 0:s[n],r=e==null?void 0:e.path;return r?At((a=t.initialRecord)==null?void 0:a.data,r):(c=(o=t.initialRecord)==null?void 0:o.data)==null?void 0:c[n]},addGuard:n=>{var e;return(e=t.addGuard)==null?void 0:e.call(t,n)},removeGuard:n=>{var e;return(e=t.removeGuard)==null?void 0:e.call(t,n)},setMap:n=>{var r;const e=(r=t.callbacks)==null?void 0:r.onMapChange;e&&e(n||null)}}}const hn=new Set(["script","iframe","object","embed","applet","link","base","meta","form","frame","frameset","param"]),yn=t=>typeof t!="string"||t[0]===t[0].toUpperCase()?!1:hn.has(t)?(f.isDebugActive()&&f.trace("render",`blocked-element "${t}"`,"BLOCKED for security",{component:t}),!1):!0;function vn(t,n,e=null){if(!t||!n)return f.isDebugActive()&&f.trace("component","resolve-component-def","null (no name or no registry)",{componentName:t,hasRegistry:!!n}),null;const r=n[t];if(!r)return f.isDebugActive()&&f.trace("component","resolve-component-def",`null ("${t}" not in components registry)`,{componentName:t,availableComponents:Object.keys(n)}),null;const i=bt(r,n,"components",t,{allRegistries:e});return f.isDebugActive()&&f.trace("component","resolve-component-def",`found "${t}"`,{componentName:t,hasAdapter:!!(i!=null&&i._adapter),resolvedKeys:i?Object.keys(i):null}),i}function bn(t){return t&&t._adapter||null}function m(t,n,e,r){var l,u,y;if(n==null||typeof n=="function")return n;if(Array.isArray(n)){const h=n.map(d=>m(t,d,e,r)).filter(Boolean);return h.length===0?void 0:h.length===1?h[0]:D(t)?d=>{let g;for(const E of h)g=typeof E=="function"?E(d):E;return g}:h[h.length-1]}if(typeof n!="string"||!n.startsWith("{{"))return n;const i=n.slice(2,-2).trim(),s=i.indexOf(":"),a=s===-1?i:i.slice(0,s),o=s===-1?void 0:i.slice(s+1),c=(u=(l=e.registries)==null?void 0:l.functions)==null?void 0:u[a];if(!c){f.logger.warn(`Function "${a}" not found for property "${t}"`),f.isDebugActive()&&f.trace("prop",`resolve-dynamic-prop "${(r==null?void 0:r.name)||"?"}.${t}"`,`MISSING function "${a}"`,{field:r==null?void 0:r.name,property:t,functionName:a,availableFunctions:Object.keys(((y=e.registries)==null?void 0:y.functions)||{})});return}const p=Kt(e),v=St(r,()=>p,r==null?void 0:r.name);if(D(t))return f.isDebugActive()&&f.trace("prop",`resolve-dynamic-prop "${(r==null?void 0:r.name)||"?"}.${t}"`,`wrapped event handler "${a}"`,{field:r==null?void 0:r.name,property:t,functionName:a}),h=>{try{return c.call(v,Kt(e),h,o)}catch(d){f.logger.error(`Error in event handler ${t} with function ${a}:`,d);return}};try{const h=c.call(v,p,null,o);return f.isDebugActive()&&f.trace("prop",`resolve-dynamic-prop "${(r==null?void 0:r.name)||"?"}.${t}"`,`${a}() -> ${JSON.stringify(h)}`,{field:r==null?void 0:r.name,property:t,functionName:a,result:h}),h}catch(h){f.logger.error(`Error resolving ${t} with function ${a}:`,h),f.isDebugActive()&&f.trace("prop",`resolve-dynamic-prop "${(r==null?void 0:r.name)||"?"}.${t}"`,`ERROR in ${a}(): ${h.message}`,{field:r==null?void 0:r.name,property:t,functionName:a,error:h.message});return}}function ie(t,n){let e=null;for(const r of Object.keys(t))if(D(r)){const i=t[r];if(typeof i=="string"||Array.isArray(i)){const s=m(r,i,n,t);s!==i&&(e||(e={...t}),e[r]=s)}}return e||t}function gn(t,n){if(!t)return!0;if(t.show!==void 0){const e=!!m("show",t.show,n,t);return f.isDebugActive()&&f.trace("visibility",`resolve-visibility "${t.name||"?"}"`,e?"visible":"hidden",{field:t.name,showValue:t.show,resolved:e}),e}return!0}function _n(t,n,e,r,i){if(typeof t!="string")return t;let s=n[t];const a=!!s;if(s?s=bt(s,e,"fields",t,{allRegistries:i}):s=e[t],!s)return f.logger.warn(`Field "${t}" not found in registry`),f.isDebugActive()&&f.trace("layout",`resolve-item "${t}"`,"NOT FOUND (creating empty stub)",{item:t,searchedLocal:Object.keys(n),searchedRegistry:Object.keys(e),parentName:r}),{name:t};const o=a&&r?`${r}.${t}`:t;return f.isDebugActive()&&f.trace("layout",`resolve-item "${t}"`,`found (${a?"local":"registry"})`,{item:t,resolvedName:o,component:s.component,isLocal:a}),{...s,name:o}}function En(t,n,e,r,i,s,a=[]){var u,y,h;const o=document.createElement(n),c=e.name;e._componentName&&o.setAttribute("data-gst-component",e._componentName);const p=B(()=>{var C,b,S;if(i){const _=m("class",e.class,r,e);_?o.setAttribute("class",_):o.removeAttribute("class")}const d=m("id",e.id,r,e);d&&(o.id=d);const g=m("style",e.style,r,e);g&&typeof g=="object"&&(o.removeAttribute("style"),Object.assign(o.style,g));const E=m("title",e.title,r,e);if(E&&(o.title=E),n==="a"){const _=m("href",e.href,r,e);_&&(o.href=_);const $=m("target",e.target,r,e);$&&(o.target=$)}if(n==="img"){const _=m("src",e.src,r,e);_&&(o.src=_);const $=m("alt",e.alt,r,e);$!==void 0&&(o.alt=$)}if(n==="label"){const _=m("for",e.for,r,e);_&&(o.htmlFor=_)}if(n==="input"){e.type&&(o.type=e.type),c&&(o.name=c);const _=m("placeholder",e.placeholder,r,e);_&&(o.placeholder=_);const $=!!m("required",e.required,r,e);o.disabled=!!m("disabled",e.disabled,r,e),o.readOnly=!!m("readonly",e.readonly,r,e),o.required=$,$&&o.setAttribute("aria-required","true");const R=m("autocomplete",e.autocomplete,r,e);if(R&&(o.autocomplete=R),(c?((C=r.fieldErrors)==null?void 0:C[c])||[]:[]).length?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid"),c||e.bind){const I=ct(r,c,e);e.type==="checkbox"?o.checked=!!I:o.value=I??""}}if(n==="textarea"){c&&(o.name=c);const _=m("placeholder",e.placeholder,r,e);_&&(o.placeholder=_);const $=!!m("required",e.required,r,e);o.disabled=!!m("disabled",e.disabled,r,e),o.readOnly=!!m("readonly",e.readonly,r,e),o.required=$,$&&o.setAttribute("aria-required","true"),typeof e.rows=="number"&&(o.rows=e.rows),(c||e.bind)&&(o.value=ct(r,c,e)??""),(c?((b=r.fieldErrors)==null?void 0:b[c])||[]:[]).length?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid")}if(n==="select"){c&&(o.name=c);const _=!!m("required",e.required,r,e);o.disabled=!!m("disabled",e.disabled,r,e),o.required=_,_&&o.setAttribute("aria-required","true");const $=m("autocomplete",e.autocomplete,r,e);$&&(o.autocomplete=$),(c||e.bind)&&(o.value=ct(r,c,e)??""),(c?((S=r.fieldErrors)==null?void 0:S[c])||[]:[]).length?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid")}if(n==="button"){o.type=e.type||"button";const _=!!m("disabled",e.disabled,r,e);o.disabled=_,_&&o.setAttribute("aria-disabled","true"),r.isSubmitting&&o.setAttribute("aria-busy","true"),e.variant&&o.setAttribute("class",["btn",`btn-${e.variant}`].filter(Boolean).join(" "))}});if(s.push(()=>L(p)),(c||e.bind)&&(n==="input"||n==="textarea"||n==="select")){const d=g=>{const E=e.type==="checkbox"?g.target.checked:g.target.value;yt(r,c,e,E)};o.addEventListener(n==="select"?"change":"input",d)}if(n==="button"&&e.action){const d=Array.isArray(e.action)?e.action:[e.action];o.addEventListener("click",async()=>{if(r.executeAction)for(const g of d)await r.executeAction(g,{buttonName:c})})}for(const d of Object.keys(e))if(D(d)){const g=m(d,e[d],r,e);if(typeof g=="function"){const E=d.slice(2).toLowerCase();o.addEventListener(E,g)}}if(e.innerhtml&&f.logger.warn(`Security: innerHTML not allowed. Use innertext or children. Element: ${c||"unnamed"}`),a.length>0)for(const d of a)o.appendChild(d);const v=a.length===0&&e.innertext!==void 0,l=n==="button"&&e.label;if(v||l){const d=B(()=>{if(v){const g=m("innertext",e.innertext,r,e);g!==void 0&&(o.textContent=g)}else l&&!o.textContent&&(o.textContent=m("label",e.label,r,e))});s.push(()=>L(d))}if(n==="select"&&e.options){let d=e.options;if(typeof d=="string"){const E=d;d=((y=(u=r.registries)==null?void 0:u.optionSets)==null?void 0:y[d])||[],f.isDebugActive()&&f.trace("registry",`resolve-option-set "${c||"?"}"`,d.length>0?`found "${E}" (${d.length} items)`:`MISSING "${E}" (empty)`,{field:c,optionSetName:E,availableOptionSets:Object.keys(((h=r.registries)==null?void 0:h.optionSets)||{}),itemCount:d.length})}const g=m("placeholder",e.placeholder,r,e);if(g){const E=document.createElement("option");E.value="",E.textContent=g,o.appendChild(E)}if(Array.isArray(d))for(const E of d){const C=document.createElement("option");C.value=typeof E=="object"?E.value:E,C.textContent=typeof E=="object"?E.label||E.value:E,o.appendChild(C)}}return t.appendChild(o),o}function mn(t,n,e,r,i){var v;const s=document.createElement("div"),a=B(()=>{const l=m("class",n.class,e,n),u=Array.isArray(n.rows)||Array.isArray(n.layout),y=m("title",n.title,e,n),h=m("description",n.description,e,n),g=u||y||h?[l,"group"].filter(Boolean).join(" "):l;g?s.setAttribute("class",g):s.removeAttribute("class");const E=m("id",n.id,e,n);E&&(s.id=E);const C=m("style",n.style,e,n);C&&typeof C=="object"&&(s.removeAttribute("style"),Object.assign(s.style,C))});i.push(()=>L(a));const o=m("title",n.title,e,n),c=m("description",n.description,e,n);if(o||c){const l=document.createElement("div");if(l.className="group-header",o){const u=n.name?`gst-group-${n.name}-title`:void 0,y=document.createElement("h3");if(y.className="group-title",u&&(y.id=u),y.textContent=o,m("required",n.required,e,n)){const d=document.createElement("span");d.className="required-indicator",d.setAttribute("aria-hidden","true"),d.textContent=" *",y.appendChild(d)}l.appendChild(y),s.setAttribute("role","group"),u&&s.setAttribute("aria-labelledby",u)}if(c){const u=document.createElement("p");u.className="group-description",u.textContent=c,l.appendChild(u)}s.appendChild(l)}for(const l of r)s.appendChild(l);const p=n.buttonset||n.buttonSet;if(Array.isArray(p)&&p.length>0){const l=document.createElement("div");l.className="group-buttons";const u=((v=e.registries)==null?void 0:v.buttons)||{};for(const y of p){let h=typeof y=="string"?{...u[y]||{},name:y}:y;h["..."]&&(h=bt(h,u,"buttons",h.name,{allRegistries:e.registries})),tt(l,{component:"button",...h},e,i)}s.appendChild(l)}return t.appendChild(s),s}function tt(t,n,e,r=[],i={}){var g,E,C,b,S;const{isChild:s=!1}=i,a=n.name&&!n.fields&&!n.layout&&!Array.isArray(n.rows)&&!Array.isArray(n.children);let o=n.component||(a?(g=e.meta)==null?void 0:g.defaultComponent:void 0);if(f.isDebugActive()&&n.name){const _=n.component?"explicit":a&&((E=e.meta)!=null&&E.defaultComponent)?"meta.defaultComponent":"none";f.trace("component",`resolve-component "${n.name}"`,o||"(none)",{field:n.name,source:_,isLeafField:a,explicitComponent:n.component,defaultComponent:(C=e.meta)==null?void 0:C.defaultComponent})}const c=((b=e.registries)==null?void 0:b.components)||{},p=((S=e.registries)==null?void 0:S.fields)||{};let v=null,l=n;o&&(v=vn(o,c,e.registries),v&&(l={...v,...n,_component:void 0,_adapter:void 0,_componentName:o})),l=Ae(l);const u=document.createComment(`gst:${l.name||"element"}`);t.appendChild(u);let y=null,h=[];const d=B(()=>{if(!gn(l,e)){if(y){l.show!==void 0&&e._onHide&&e._onHide(l,e),y.remove(),y=null;for(const I of h)I();h=[]}return}if(y)return;h=[];const $=document.createDocumentFragment(),R=Sn($,o,l,v,e,p,s,h);R&&(u.parentNode.insertBefore(R,u.nextSibling),y=R)});return r.push(()=>{L(d);for(const _ of h)_()}),y}function Sn(t,n,e,r,i,s,a,o){var E,C;const c=e.fields||{},p=e.name,v=e.rows||e.layout;let l=[];if(Array.isArray(v))for(const b of v){const S=document.createElement("div");if(S.className=e.rowclassname||"row",Array.isArray(b))for(const _ of b){const $=_n(_,c,s,p,i.registries);tt(S,$,i,o)}l.push(S)}else if(Array.isArray(e.children))for(const b of e.children)if(typeof b=="string")l.push(document.createTextNode(b));else{const S=document.createDocumentFragment();tt(S,b,i,o,{isChild:!0}),l.push(S)}const u=l.length>0,y=e.fields||e.layout||Array.isArray(e.rows),h=n?bn(r):null;if(h){f.isDebugActive()&&f.trace("render",`render-branch "${e.name||n||"?"}"`,"adapter (registered component)",{component:n,name:e.name,isContainer:y,hasContent:u,adapterType:typeof h.mount});const b=ie(e,i);if(!y&&!u){const $=document.createElement("div"),R=typeof b.type=="string"?b.type.toLowerCase():null,N=n==null?void 0:n.toLowerCase(),I=R?`type-${R}`:null,Z=N?`component-${N}`:null,G=m("class",b.class,i,b);$.className=["field",I,Z,G].filter(Boolean).join(" "),b.name&&$.setAttribute("data-field",b.name),R&&$.setAttribute("data-type",R);const U=h.mount($,{def:b,store:i});if(o.push(()=>{U!=null&&U.unmount&&U.unmount()}),b.value&&(b.name||b.bind)){const gt=B(()=>{const et=m("value",b.value,i,b);et!==void 0&&yt(i,b.name,b,et)});o.push(()=>L(gt))}return t.appendChild($),$}const S=document.createElement("div"),_=h.mount(S,{def:b,store:i,children:l});return o.push(()=>{_!=null&&_.unmount&&_.unmount()}),t.appendChild(S),S}const d=n?(E=i.components)==null?void 0:E[n]:null;if(d){f.isDebugActive()&&f.trace("render",`render-branch "${e.name||n||"?"}"`,"builtin (vanilla component)",{component:n,name:e.name});const b=ie(e,i),S=document.createElement("div"),_=typeof b.type=="string"?b.type.toLowerCase():null,$=n==null?void 0:n.toLowerCase(),R=_?`type-${_}`:null,N=$?`component-${$}`:null,I=m("class",b.class,i,b);if(S.className=["field",R,N,I].filter(Boolean).join(" "),b.name&&S.setAttribute("data-field",b.name),_&&S.setAttribute("data-type",_),d(S,b,i,o),b.value&&(b.name||b.bind)){const Z=B(()=>{const G=m("value",b.value,i,b);G!==void 0&&yt(i,b.name,b,G)});o.push(()=>L(Z))}return t.appendChild(S),S}if(n==="html"){const b=document.createElement("div");e.name&&b.setAttribute("data-field",e.name),e.class&&(b.className=e.class),e.style&&typeof e.style=="object"&&Object.assign(b.style,e.style);const S=B(()=>{const _=m("content",e.content,i,e)||m("innerhtml",e.innerhtml,i,e)||"";b.innerHTML=_});return o.push(()=>L(S)),t.appendChild(b),b}if(n&&yn(n))return f.isDebugActive()&&f.trace("render",`render-branch "${e.name||n||"?"}"`,`html-element <${n}>`,{component:n,name:e.name}),En(t,n,e,i,a,o,l);if(n&&!u)return f.logger.warn(`Unknown component: ${n}. Make sure it's registered.`),f.isDebugActive()&&f.trace("render",`render-branch "${e.name||n||"?"}"`,`UNKNOWN component "${n}" (returning null)`,{component:n,name:e.name,availableComponents:Object.keys(((C=i.registries)==null?void 0:C.components)||{}),availableBuiltins:Object.keys(i.components||{})}),null;if(u){f.isDebugActive()&&f.trace("render",`render-branch "${e.name||"?"}"`,"group/fragment (has content, no component)",{name:e.name,hasTitle:!!e.title,hasRows:Array.isArray(e.rows)||Array.isArray(e.layout),childCount:l.length});const b=m("title",e.title,i,e),S=m("description",e.description,i,e),$=Array.isArray(e.rows)||Array.isArray(e.layout)||b||S;if(e.class||e.style||e.id||$||e.name)return mn(t,e,i,l,o);for(const N of l)t.appendChild(N);return t.lastElementChild}f.isDebugActive()&&f.trace("render",`render-branch "${e.name||"?"}"`,"EMPTY (no component, no content -> empty div)",{name:e.name,def:e});const g=document.createElement("div");return t.appendChild(g),g}function $n(t,n,e,r=[]){if(n==null)return r;const i=Array.isArray(n)?n:[n];for(const s of i)typeof s=="string"?t.appendChild(document.createTextNode(s)):typeof s=="object"&&tt(t,s,e,r,{isChild:!0});return r}function Zt(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function An(t){return Object.entries(t).filter(([n])=>!n.startsWith("@")).map(([n,e])=>` ${Zt(n)}: ${e};`).join(`
13
+ `)}function we(t,n=":root"){if(!t||Object.keys(t).length===0)return"";const e=Object.entries(t).map(([r,i])=>` ${r.startsWith("--")?r:`--${Zt(r)}`}: ${i};`).join(`
14
+ `);return`${n} {
15
+ ${e}
16
+ }`}function Ot(t,n=null){if(!t||Object.keys(t).length===0)return"";const e=[],r={};for(const[i,s]of Object.entries(t))if(i.startsWith("@media")){const a=Ot(s,n);a&&(r[i]=a)}else if(i.startsWith("@")){const a=typeof s=="object"?Ot(s,null):s;e.push(`${i} {
17
+ ${a}
18
+ }`)}else{const a=n?i.split(",").map(c=>{const p=c.trim();return p.startsWith("&")?`${n}${p.slice(1)}`:`${n} ${p}`}).join(", "):i,o=An(s);o&&e.push(`${a} {
19
+ ${o}
20
+ }`)}for(const[i,s]of Object.entries(r))e.push(`${i} {
21
+ ${s}
22
+ }`);return e.join(`
23
+
24
+ `)}function Oe(){return"gst-"+Math.random().toString(36).substring(2,9)}function Ce(t,n){if(!t)return"";const{scoped:e=!0,vars:r,rules:i}=t,s=[],a=e&&n?`[data-gst-scope="${n}"]`:".gst";if(r){const c=we(r,a||":root");c&&s.push(c)}if(i){const o=Ot(i,a);o&&s.push(o)}return s.join(`
25
+
26
+ `)}function je(t,n){if(!t||!n)return"";const e=[];for(const[r,i]of Object.entries(t)){const s=n[r];if(s==null||s==="")continue;const a=String(s).toLowerCase().replace(/[^a-z0-9-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");a&&(i===!0?e.push(`${Zt(r)}-${a}`):typeof i=="string"&&e.push(`${i}-${a}`))}return e.join(" ")}function wn(t,n,e){if(!t||n===void 0||n===null||n===""||!e)return"";let r;if(e===!0)r={[t]:!0};else if(typeof e=="string")r={[t]:e};else if(typeof e=="object")r=e;else return"";return je(r,{[t]:n})}function On(t){let n=0;for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);n=(n<<5)-n+r,n=n&n}return Math.abs(n).toString(36)}function Wt(t,n){if(typeof document>"u")return null;const e=document.getElementById(n);e&&e.remove();const r=`@layer gst-form {
27
+ ${t}
28
+ }`,i=document.createElement("style");return i.id=n,i.textContent=r,document.head.appendChild(i),i}function Bt(t){if(typeof document>"u")return;const n=document.getElementById(t);n&&n.remove()}function Cn(t){if(typeof document>"u")return{id:null,styleEl:null};const e=`gst-styles-${On(t)}`,r=document.getElementById(e);if(r){const a=parseInt(r.dataset.gstRefCount||"1",10);return r.dataset.gstRefCount=String(a+1),{id:e,styleEl:r}}const i=`@layer gst-form {
29
+ ${t}
30
+ }`,s=document.createElement("style");return s.id=e,s.dataset.gstRefCount="1",s.textContent=i,document.head.appendChild(s),{id:e,styleEl:s}}function jn(t){if(typeof document>"u"||!t)return;const n=document.getElementById(t);if(!n)return;const e=parseInt(n.dataset.gstRefCount||"1",10);e<=1?n.remove():n.dataset.gstRefCount=String(e-1)}function Q(t,n,e){if(!t||!n||!e)return"";const r=[];for(const[i,s]of Object.entries(t)){if(!s||typeof s!="object"||!s.styles)continue;const{styles:a}=s;if(typeof a!="object")continue;const{scoped:o=!0,vars:c,dynamicClasses:p,__source:v,...l}=a,u=a.rules||l,y=o?`[data-gst-scope="${n}"] [data-${e}="${i}"]`:`.gst [data-${e}="${i}"]`;if(c&&Object.keys(c).length>0){const d=we(c,y||":root");d&&r.push(d)}if(u&&Object.keys(u).length>0){const h=Ot(u,y);h&&r.push(h)}}return r.join(`
31
+
32
+ `)}function Rn(t,n){return Q(t,n,"gst-component")}function xn(t,n){return Q(t,n,"field")}function Tn(t,n){return Q(t,n,"button")}const Nn={key:null,data:{}};function In(t,n,e={}){var I,Z,G,U,gt,et,Jt,Xt,Dt;const{record:r={...Nn},components:i={},onAction:s,onChange:a,onMapChange:o,initialState:c={},effects:p=[],setupActions:v,onMount:l,onUnmount:u,onHide:y}=e,h=Oe();f.initLogger(n.meta);const d=Ct({meta:n.meta||{},registries:n.registries||{},actions:n.actions||{},components:i,record:r,state:n.state||{},callbacks:{onAction:s,onChange:a,onMapChange:o},...c}),g=[];d.addGuard=A=>(g.push(A),()=>{const j=g.indexOf(A);j!==-1&&g.splice(j,1)}),d.removeGuard=A=>{const j=g.indexOf(A);j!==-1&&g.splice(j,1)},d._guards=g,d._getFieldValue=A=>{var P,V;const j=(V=(P=d.registries)==null?void 0:P.fields)==null?void 0:V[A];return ct(d,A,j)},d._setFieldValue=(A,j)=>{var V,_t;const P=(_t=(V=d.registries)==null?void 0:V.fields)==null?void 0:_t[A];yt(d,A,P,j)},d._scopeId=h,y&&(d._onHide=y),v?v(d,e):s&&(d.executeAction=async(A,j={})=>{await s({action:A,record:d.record,meta:d.meta,registries:d.registries,...j})}),t.setAttribute("data-gst-scope",h),t.classList.contains("gst")||t.classList.add("gst"),t.setAttribute("role","form");const E=(I=n.meta)==null?void 0:I.title;E&&t.setAttribute("aria-label",E);let C=null;if(n.styles){const A=Ce(n.styles,h);A&&(C=`gst-styles-${h}`,Wt(A,C))}let b=null;const S=[Q(((Z=n.registries)==null?void 0:Z.components)||{},h,"gst-component"),Q(((G=n.registries)==null?void 0:G.fields)||{},h,"field"),Q(((U=n.registries)==null?void 0:U.buttons)||{},h,"button")].filter(Boolean).join(`
33
+
34
+ `);S&&(b=`gst-registry-styles-${h}`,Wt(S,b));const _=[],$=n.layout||[];f.isDebugActive()&&f.trace("mount","mount-begin",`${$.length} layout items`,{title:(gt=n.meta)==null?void 0:gt.title,fieldCount:Object.keys(((et=n.registries)==null?void 0:et.fields)||{}).length,componentCount:Object.keys(((Jt=n.registries)==null?void 0:Jt.components)||{}).length,functionCount:Object.keys(((Xt=n.registries)==null?void 0:Xt.functions)||{}).length,hasStyles:!!n.styles,debugLevel:(Dt=n.meta)==null?void 0:Dt.debug});for(const A of $){const j=Array.isArray(A)?{rows:[A]}:A;tt(t,j,d,_)}const R=p.map(A=>A(d,e)),N={update(A){d.record.key=A.key??null;const j=A.data||{},P=d.record.data;for(const V of Object.keys(P))V in j||delete P[V];for(const[V,_t]of Object.entries(j))P[V]=_t},async executeAction(A,j={}){if(d.executeAction)return d.executeAction(A,j)},checkGuards(){for(const A of g){const j=A();if(j===!1||typeof j=="string")return j}return!0},unmount(){u&&u(d),g.length=0;for(const A of _)A();for(const A of R)A&&L(A);C&&Bt(C),b&&Bt(b),t.innerHTML="",t.removeAttribute("data-gst-scope"),t.removeAttribute("role"),t.removeAttribute("aria-label"),t.classList.remove("gst")},store:d};return l&&l(d,N),N}exports.bindFunctions=Mt;exports.buildContext=Kt;exports.clearFieldValue=dn;exports.computed=cn;exports.createStage=St;exports.effect=B;exports.enableTracking=Le;exports.enterRenderPhase=me;exports.exitRenderPhase=Se;exports.generateDynamicClasses=je;exports.generateFieldDynamicClass=wn;exports.generateScopeId=Oe;exports.getByPath=At;exports.getFieldValue=ct;exports.getRecordPath=fn;exports.injectStyles=Wt;exports.injectStylesOnce=Cn;exports.isEventKey=D;exports.mount=In;exports.normalizeDef=Ae;exports.normalizeKey=$e;exports.parseDotNotation=Lt;exports.pauseTracking=de;exports.processButtonStyles=Tn;exports.processComponentStyles=Rn;exports.processFieldStyles=xn;exports.processRegistryStyles=Q;exports.processStyles=Ce;exports.reactive=Ct;exports.ref=rn;exports.removeStyles=Bt;exports.removeStylesOnce=jn;exports.renderElement=tt;exports.renderSlot=$n;exports.resolveRecordData=Pt;exports.resolveSpread=bt;exports.setByPath=wt;exports.setFieldValue=yt;exports.stop=L;exports.toRaw=O;
35
+ //# sourceMappingURL=core-Wpl1tnO4.js.map