@sfxcode/formkit-primevue 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2481 +0,0 @@
1
- import { defineComponent as A, getCurrentInstance as ft, watch as ce, watchEffect as Z, reactive as xt, h as pe, ref as ie, inject as de, computed as At, provide as Et, toRef as Rt, onUnmounted as jt, isRef as je, isReactive as Ze, toRaw as Lt, markRaw as Mt, createTextVNode as Tt, resolveComponent as L, openBlock as O, createBlock as W, unref as l, normalizeClass as F, createElementBlock as H, Fragment as ct, toDisplayString as me, createCommentVNode as G, createVNode as Le, normalizeStyle as Ft } from "vue";
2
- function pt() {
3
- return Math.random().toString(36).substring(2, 15);
4
- }
5
- function Dt(e, n) {
6
- const t = e instanceof Set ? e : new Set(e);
7
- return n && n.forEach((r) => t.add(r)), [...t];
8
- }
9
- function j(e, n) {
10
- return Object.prototype.hasOwnProperty.call(e, n);
11
- }
12
- function Me(e, n, t = !0, r = ["__key"]) {
13
- if (e === n)
14
- return !0;
15
- if (typeof n == "object" && typeof e == "object") {
16
- if (e instanceof Map || e instanceof Set || e instanceof Date || e === null || n === null || Object.keys(e).length !== Object.keys(n).length)
17
- return !1;
18
- for (const i of r)
19
- if ((i in e || i in n) && e[i] !== n[i])
20
- return !1;
21
- for (const i in e)
22
- if (!(i in n) || e[i] !== n[i] && !t || t && !Me(e[i], n[i], t, r))
23
- return !1;
24
- return !0;
25
- }
26
- return !1;
27
- }
28
- function Ve(e) {
29
- return Object.prototype.toString.call(e) === "[object Object]";
30
- }
31
- function Ie(e) {
32
- return Ve(e) || Array.isArray(e);
33
- }
34
- function ye(e) {
35
- if (Ve(e) === !1 || e.__FKNode__ || e.__POJO__ === !1)
36
- return !1;
37
- const n = e.constructor;
38
- if (n === void 0)
39
- return !0;
40
- const t = n.prototype;
41
- return !(Ve(t) === !1 || t.hasOwnProperty("isPrototypeOf") === !1);
42
- }
43
- function Te(e, n, t = !1, r = !1) {
44
- if (n === null)
45
- return null;
46
- const i = {};
47
- if (typeof n == "string")
48
- return n;
49
- for (const s in e)
50
- if (j(n, s) && (n[s] !== void 0 || !r)) {
51
- if (t && Array.isArray(e[s]) && Array.isArray(n[s])) {
52
- i[s] = e[s].concat(n[s]);
53
- continue;
54
- }
55
- if (n[s] === void 0)
56
- continue;
57
- ye(e[s]) && ye(n[s]) ? i[s] = Te(e[s], n[s], t, r) : i[s] = n[s];
58
- } else
59
- i[s] = e[s];
60
- for (const s in n)
61
- !j(i, s) && n[s] !== void 0 && (i[s] = n[s]);
62
- return i;
63
- }
64
- function Wt(e) {
65
- if (e[0] !== '"' && e[0] !== "'" || e[0] !== e[e.length - 1])
66
- return !1;
67
- const n = e[0];
68
- for (let t = 1; t < e.length; t++)
69
- if (e[t] === n && (t === 1 || e[t - 1] !== "\\") && t !== e.length - 1)
70
- return !1;
71
- return !0;
72
- }
73
- function Ut(e) {
74
- if (!e.length)
75
- return "";
76
- let n = "", t = "";
77
- for (let r = 0; r < e.length; r++) {
78
- const i = e.charAt(r);
79
- (i !== "\\" || t === "\\") && (n += i), t = i;
80
- }
81
- return n;
82
- }
83
- function Q(...e) {
84
- return e.reduce((n, t) => {
85
- const { value: r, name: i, modelValue: s, config: o, plugins: a, ...m } = t;
86
- return Object.assign(n, m);
87
- }, {});
88
- }
89
- function Kt(e) {
90
- const n = [];
91
- let t = "", r = 0, i = "", s = "";
92
- for (let o = 0; o < e.length; o++) {
93
- const a = e.charAt(o);
94
- a === i && s !== "\\" ? i = "" : (a === "'" || a === '"') && !i && s !== "\\" ? i = a : a === "(" && !i ? r++ : a === ")" && !i && r--, a === "," && !i && r === 0 ? (n.push(t), t = "") : (a !== " " || i) && (t += a), s = a;
95
- }
96
- return t && n.push(t), n;
97
- }
98
- function Ye(e, n) {
99
- const t = {}, r = n.filter((s) => s instanceof RegExp), i = new Set(n);
100
- for (const s in e)
101
- !i.has(s) && !r.some((o) => o.test(s)) && (t[s] = e[s]);
102
- return t;
103
- }
104
- function Je(e, n) {
105
- const t = {}, r = n.filter((i) => i instanceof RegExp);
106
- return n.forEach((i) => {
107
- i instanceof RegExp || (t[i] = e[i]);
108
- }), Object.keys(e).forEach((i) => {
109
- r.some((s) => s.test(i)) && (t[i] = e[i]);
110
- }), t;
111
- }
112
- function oe(e) {
113
- return e.replace(/-([a-z0-9])/gi, (n, t) => t.toUpperCase());
114
- }
115
- function dt(e) {
116
- return e.replace(/([a-z0-9])([A-Z])/g, (n, t, r) => t + "-" + r.toLowerCase()).replace(" ", "-").toLowerCase();
117
- }
118
- function he(e, n = ["__key", "__init"]) {
119
- if (e === null || e instanceof RegExp || e instanceof Date || e instanceof Map || e instanceof Set || typeof File == "function" && e instanceof File)
120
- return e;
121
- let t;
122
- Array.isArray(e) ? t = e.map((r) => typeof r == "object" ? he(r, n) : r) : t = Object.keys(e).reduce((r, i) => (r[i] = typeof e[i] == "object" ? he(e[i], n) : e[i], r), {});
123
- for (const r of n)
124
- r in e && Object.defineProperty(t, r, {
125
- enumerable: !1,
126
- value: e[r]
127
- });
128
- return t;
129
- }
130
- function J(e) {
131
- return typeof e == "object" ? he(e) : e;
132
- }
133
- function qt(e, n) {
134
- if (!e || typeof e != "object")
135
- return null;
136
- const t = n.split(".");
137
- let r = e;
138
- for (const i in t) {
139
- const s = t[i];
140
- if (j(r, s) && (r = r[s]), +i === t.length - 1)
141
- return r;
142
- if (!r || typeof r != "object")
143
- return null;
144
- }
145
- return null;
146
- }
147
- function Qe(e) {
148
- return e !== void 0 && e !== "false" && e !== !1 ? !0 : void 0;
149
- }
150
- function re(e) {
151
- return Object.isFrozen(e) ? e : Object.defineProperty(e, "__init", {
152
- enumerable: !1,
153
- value: !0
154
- });
155
- }
156
- function mt(e) {
157
- return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]/g, " ").trim().replace(/\s+/g, "-");
158
- }
159
- function Fe() {
160
- const e = [];
161
- let n = 0;
162
- const t = (i) => e.push(i), r = (i) => {
163
- const s = e[n];
164
- return typeof s == "function" ? s(i, (o) => (n++, r(o === void 0 ? i : o))) : (n = 0, i);
165
- };
166
- return t.dispatch = r, t.unshift = (i) => e.unshift(i), t.remove = (i) => {
167
- const s = e.indexOf(i);
168
- s > -1 && e.splice(s, 1);
169
- }, t;
170
- }
171
- function yt() {
172
- const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
173
- let t;
174
- const r = (i, s) => {
175
- if (t) {
176
- t.set(s.name, [i, s]);
177
- return;
178
- }
179
- e.has(s.name) && e.get(s.name).forEach((o) => {
180
- (s.origin === i || o.modifiers.includes("deep")) && o.listener(s);
181
- }), s.bubble && i.bubble(s);
182
- };
183
- return r.on = (i, s) => {
184
- const [o, ...a] = i.split("."), m = s.receipt || pt(), h = {
185
- modifiers: a,
186
- event: o,
187
- listener: s,
188
- receipt: m
189
- };
190
- return e.has(o) ? e.get(o).push(h) : e.set(o, [h]), n.has(m) ? n.get(m).push(o) : n.set(m, [o]), m;
191
- }, r.off = (i) => {
192
- var s;
193
- n.has(i) && ((s = n.get(i)) === null || s === void 0 || s.forEach((o) => {
194
- const a = e.get(o);
195
- Array.isArray(a) && e.set(o, a.filter((m) => m.receipt !== i));
196
- }), n.delete(i));
197
- }, r.pause = (i) => {
198
- t || (t = /* @__PURE__ */ new Map()), i && i.walk((s) => s._e.pause());
199
- }, r.play = (i) => {
200
- if (!t)
201
- return;
202
- const s = t;
203
- t = void 0, s.forEach(([o, a]) => r(o, a)), i && i.walk((o) => o._e.play());
204
- }, r;
205
- }
206
- function Bt(e, n, t, r, i = !0) {
207
- return n._e(e, {
208
- payload: r,
209
- name: t,
210
- bubble: i,
211
- origin: e
212
- }), e;
213
- }
214
- function zt(e, n, t) {
215
- return be(e.parent) && e.parent._e(e.parent, t), e;
216
- }
217
- function Nt(e, n, t, r) {
218
- return n._e.on(t, r);
219
- }
220
- function Ht(e, n, t) {
221
- return n._e.off(t), e;
222
- }
223
- const De = Fe();
224
- De((e, n) => (e.message || (e.message = String(`E${e.code}`)), n(e)));
225
- const We = Fe();
226
- We((e, n) => {
227
- e.message || (e.message = String(`W${e.code}`));
228
- const t = n(e);
229
- return console && typeof console.warn == "function" && console.warn(t.message), t;
230
- });
231
- function ve(e, n = {}) {
232
- We.dispatch({ code: e, data: n });
233
- }
234
- function U(e, n = {}) {
235
- throw Error(De.dispatch({ code: e, data: n }).message);
236
- }
237
- function _e(e, n) {
238
- const t = {
239
- blocking: !1,
240
- key: pt(),
241
- meta: {},
242
- type: "state",
243
- visible: !0,
244
- ...e
245
- };
246
- return n && t.value && t.meta.localize !== !1 && (t.value = n.t(t), t.meta.locale = n.config.locale), t;
247
- }
248
- const Ge = {
249
- apply: Xt,
250
- set: Yt,
251
- remove: ht,
252
- filter: Qt,
253
- reduce: Gt,
254
- release: nn,
255
- touch: Jt
256
- };
257
- function Zt(e = !1) {
258
- const n = {};
259
- let t, r = e, i = [];
260
- const s = /* @__PURE__ */ new Map();
261
- let o;
262
- const a = new Proxy(n, {
263
- get(...m) {
264
- const [h, _] = m;
265
- return _ === "buffer" ? r : _ === "_b" ? i : _ === "_m" ? s : _ === "_r" ? o : j(Ge, _) ? Ge[_].bind(null, n, a, t) : Reflect.get(...m);
266
- },
267
- set(m, h, _) {
268
- return h === "_n" ? (t = _, o === "__n" && _t(t, a), !0) : h === "_b" ? (i = _, !0) : h === "buffer" ? (r = _, !0) : h === "_r" ? (o = _, !0) : (U(101, t), !1);
269
- }
270
- });
271
- return a;
272
- }
273
- function Yt(e, n, t, r) {
274
- if (n.buffer)
275
- return n._b.push([[r]]), n;
276
- if (e[r.key] !== r) {
277
- if (typeof r.value == "string" && r.meta.localize !== !1) {
278
- const s = r.value;
279
- r.value = t.t(r), r.value !== s && (r.meta.locale = t.props.locale);
280
- }
281
- const i = `message-${j(e, r.key) ? "updated" : "added"}`;
282
- e[r.key] = Object.freeze(t.hook.message.dispatch(r)), t.emit(i, r);
283
- }
284
- return n;
285
- }
286
- function Jt(e, n) {
287
- for (const t in e) {
288
- const r = { ...e[t] };
289
- n.set(r);
290
- }
291
- }
292
- function ht(e, n, t, r) {
293
- if (j(e, r)) {
294
- const i = e[r];
295
- delete e[r], t.emit("message-removed", i);
296
- }
297
- return n.buffer === !0 && (n._b = n._b.filter((i) => (i[0] = i[0].filter((s) => s.key !== r), i[1] || i[0].length))), n;
298
- }
299
- function Qt(e, n, t, r, i) {
300
- for (const s in e) {
301
- const o = e[s];
302
- (!i || o.type === i) && !r(o) && ht(e, n, t, s);
303
- }
304
- }
305
- function Gt(e, n, t, r, i) {
306
- for (const s in e) {
307
- const o = e[s];
308
- i = r(i, o);
309
- }
310
- return i;
311
- }
312
- function Xt(e, n, t, r, i) {
313
- if (Array.isArray(r)) {
314
- if (n.buffer) {
315
- n._b.push([r, i]);
316
- return;
317
- }
318
- const s = new Set(r.map((o) => (n.set(o), o.key)));
319
- typeof i == "string" ? n.filter((o) => o.type !== i || s.has(o.key)) : typeof i == "function" && n.filter((o) => !i(o) || s.has(o.key));
320
- } else
321
- for (const s in r) {
322
- const o = t.at(s);
323
- o ? o.store.apply(r[s], i) : tn(t, n, s, r[s], i);
324
- }
325
- }
326
- function en(e, ...n) {
327
- const t = `${e.name}-set`, r = (i) => _e({
328
- key: mt(i),
329
- type: "error",
330
- value: i,
331
- meta: { source: t, autoClear: !0 }
332
- });
333
- return n.filter((i) => !!i).map((i) => {
334
- if (typeof i == "string" && (i = [i]), Array.isArray(i))
335
- return i.map((s) => r(s));
336
- {
337
- const s = {};
338
- for (const o in i)
339
- Array.isArray(i[o]) ? s[o] = i[o].map((a) => r(a)) : s[o] = [r(i[o])];
340
- return s;
341
- }
342
- });
343
- }
344
- function tn(e, n, t, r, i) {
345
- var s;
346
- const o = n._m;
347
- o.has(t) || o.set(t, []), n._r || (n._r = _t(e, n)), (s = o.get(t)) === null || s === void 0 || s.push([r, i]);
348
- }
349
- function _t(e, n) {
350
- return e.on("child.deep", ({ payload: t }) => {
351
- n._m.forEach((r, i) => {
352
- e.at(i) === t && (r.forEach(([s, o]) => {
353
- t.store.apply(s, o);
354
- }), n._m.delete(i));
355
- }), n._m.size === 0 && n._r && (e.off(n._r), n._r = void 0);
356
- });
357
- }
358
- function nn(e, n) {
359
- n.buffer = !1, n._b.forEach(([t, r]) => n.apply(t, r)), n._b = [];
360
- }
361
- function rn() {
362
- const e = {};
363
- let n;
364
- return {
365
- count: (...t) => sn(n, e, ...t),
366
- init(t) {
367
- n = t, t.on("message-added.deep", Xe(e, 1)), t.on("message-removed.deep", Xe(e, -1));
368
- },
369
- merge: (t) => et(n, e, t),
370
- settled(t) {
371
- return j(e, t) ? e[t].promise : Promise.resolve();
372
- },
373
- unmerge: (t) => et(n, e, t, !0),
374
- value(t) {
375
- return j(e, t) ? e[t].count : 0;
376
- }
377
- };
378
- }
379
- function sn(e, n, t, r, i = 0) {
380
- if (r = on(r || t), !j(n, t)) {
381
- const s = {
382
- condition: r,
383
- count: 0,
384
- name: t,
385
- node: e,
386
- promise: Promise.resolve(),
387
- resolve: () => {
388
- }
389
- };
390
- n[t] = s, i = e.store.reduce((o, a) => o + s.condition(a) * 1, i), e.each((o) => {
391
- o.ledger.count(s.name, s.condition), i += o.ledger.value(s.name);
392
- });
393
- }
394
- return gt(n[t], i).promise;
395
- }
396
- function on(e) {
397
- return typeof e == "function" ? e : (n) => n.type === e;
398
- }
399
- function gt(e, n) {
400
- const t = e.count, r = e.count + n;
401
- return e.count = r, t === 0 && r !== 0 ? (e.node.emit(`unsettled:${e.name}`, e.count, !1), e.promise = new Promise((i) => e.resolve = i)) : t !== 0 && r === 0 && (e.node.emit(`settled:${e.name}`, e.count, !1), e.resolve()), e.node.emit(`count:${e.name}`, e.count, !1), e;
402
- }
403
- function Xe(e, n) {
404
- return (t) => {
405
- for (const r in e) {
406
- const i = e[r];
407
- i.condition(t.payload) && gt(i, n);
408
- }
409
- };
410
- }
411
- function et(e, n, t, r = !1) {
412
- for (const i in n) {
413
- const s = n[i].condition;
414
- r || t.ledger.count(i, s);
415
- const o = t.ledger.value(i) * (r ? -1 : 1);
416
- if (!!e)
417
- do
418
- e.ledger.count(i, s, o), e = e.parent;
419
- while (e);
420
- }
421
- }
422
- const Ue = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Map(), Ke = yt(), ln = [];
423
- function an(e) {
424
- e.props.id && (Ue.set(e.props.id, e), le.set(e, e.props.id), Ke(e, {
425
- payload: e,
426
- name: e.props.id,
427
- bubble: !1,
428
- origin: e
429
- }));
430
- }
431
- function un(e) {
432
- if (le.has(e)) {
433
- const n = le.get(e);
434
- le.delete(e), Ue.delete(n), Ke(e, {
435
- payload: null,
436
- name: n,
437
- bubble: !1,
438
- origin: e
439
- });
440
- }
441
- }
442
- function vt(e) {
443
- return Ue.get(e);
444
- }
445
- function fn(e, n) {
446
- ln.push(Ke.on(e, n));
447
- }
448
- function tt(e, n, t) {
449
- let r = !0;
450
- return n in e.config._t ? r = !1 : e.emit(`config:${n}`, t, !1), n in e.props || (e.emit("prop", { prop: n, value: t }), e.emit(`prop:${n}`, t)), r;
451
- }
452
- function cn(e) {
453
- const n = document.getElementById(e);
454
- if (n instanceof HTMLFormElement) {
455
- const t = new Event("submit", { cancelable: !0, bubbles: !0 });
456
- n.dispatchEvent(t);
457
- return;
458
- }
459
- ve(151, e);
460
- }
461
- function pn(e) {
462
- const n = (t) => {
463
- for (const r in t.store) {
464
- const i = t.store[r];
465
- i.type === "error" || i.type === "ui" && r === "incomplete" ? t.store.remove(r) : i.type === "state" && t.store.set({ ...i, value: !1 });
466
- }
467
- };
468
- n(e), e.walk(n);
469
- }
470
- function dn(e, n) {
471
- const t = typeof e == "string" ? vt(e) : e;
472
- if (t) {
473
- const r = (s) => J(s.props.initial) || (s.type === "group" ? {} : s.type === "list" ? [] : void 0);
474
- t._e.pause(t), t.input(J(n) || r(t), !1), t.walk((s) => s.input(r(s), !1));
475
- const i = r(t);
476
- return t.input(typeof i == "object" ? J(n) || re(i) : i, !1), t._e.play(t), pn(t), t.emit("reset", t), t;
477
- }
478
- ve(152, e);
479
- }
480
- const mn = {
481
- delimiter: ".",
482
- delay: 0,
483
- locale: "en",
484
- rootClasses: (e) => ({ [`formkit-${dt(e)}`]: !0 })
485
- }, bt = Symbol("index"), Pe = Symbol("removed"), Oe = Symbol("moved"), $t = Symbol("inserted");
486
- function yn(e) {
487
- return e.type === "list" && Array.isArray(e._value);
488
- }
489
- function be(e) {
490
- return e && typeof e == "object" && e.__FKNode__ === !0;
491
- }
492
- const ae = (e, n, t) => {
493
- U(102, [e, t]);
494
- }, hn = {
495
- _c: C(Tn, ae, !1),
496
- add: C(On),
497
- addProps: C(Pn),
498
- address: C(Dn, ae, !1),
499
- at: C(Wn),
500
- bubble: C(zt),
501
- clearErrors: C(Zn),
502
- calm: C(Cn),
503
- config: C(!1),
504
- define: C(In),
505
- disturb: C(kn),
506
- destroy: C(Vn),
507
- hydrate: C(Sn),
508
- index: C(Mn, Ln, !1),
509
- input: C(St),
510
- each: C(En),
511
- emit: C(Bt),
512
- find: C(Kn),
513
- on: C(Nt),
514
- off: C(Ht),
515
- parent: C(!1, xn),
516
- plugins: C(!1),
517
- remove: C(An),
518
- root: C(Bn, ae, !1),
519
- reset: C(Hn),
520
- resetConfig: C(jn),
521
- setErrors: C(Vt),
522
- submit: C(Nn),
523
- t: C(zn),
524
- use: C(qe),
525
- name: C(Fn, !1, !1),
526
- walk: C(Rn)
527
- };
528
- function _n() {
529
- return new Map(Object.entries(hn));
530
- }
531
- function C(e, n, t = !0) {
532
- return {
533
- get: e ? (r, i) => t ? (...s) => e(r, i, ...s) : e(r, i) : !1,
534
- set: n !== void 0 ? n : ae.bind(null)
535
- };
536
- }
537
- function gn() {
538
- const e = /* @__PURE__ */ new Map();
539
- return new Proxy(e, {
540
- get(n, t) {
541
- return e.has(t) || e.set(t, Fe()), e.get(t);
542
- }
543
- });
544
- }
545
- let vn = 0, bn = 0;
546
- function $n(e) {
547
- var n, t;
548
- return ((n = e.parent) === null || n === void 0 ? void 0 : n.type) === "list" ? bt : e.name || `${((t = e.props) === null || t === void 0 ? void 0 : t.type) || "input"}_${++vn}`;
549
- }
550
- function wt(e) {
551
- return e.type === "group" ? re(e.value && typeof e.value == "object" && !Array.isArray(e.value) ? e.value : {}) : e.type === "list" ? re(Array.isArray(e.value) ? e.value : []) : e.value === null ? "" : e.value;
552
- }
553
- function St(e, n, t, r = !0) {
554
- return n._value = wn(e, e.hook.input.dispatch(t)), e.emit("input", n._value), n.isSettled && e.disturb(), r ? (n._tmo && clearTimeout(n._tmo), n._tmo = setTimeout(ge, e.props.delay, e, n)) : ge(e, n), n.settled;
555
- }
556
- function wn(e, n) {
557
- switch (e.type) {
558
- case "input":
559
- break;
560
- case "group":
561
- (!n || typeof n != "object") && U(107, [e, n]);
562
- break;
563
- case "list":
564
- Array.isArray(n) || U(108, [e, n]);
565
- break;
566
- }
567
- return n;
568
- }
569
- function ge(e, n, t = !0, r = !0) {
570
- n._value = n.value = e.hook.commit.dispatch(n._value), e.type !== "input" && r && e.hydrate(), e.emit("commit", n.value), t && e.calm();
571
- }
572
- function kt(e, { name: n, value: t, from: r }) {
573
- if (!Object.isFrozen(e._value)) {
574
- if (yn(e)) {
575
- const i = t === Pe ? [] : t === Oe && typeof r == "number" ? e._value.splice(r, 1) : [t];
576
- e._value.splice(n, t === Oe || r === $t ? 0 : 1, ...i);
577
- return;
578
- }
579
- t !== Pe ? e._value[n] = t : delete e._value[n];
580
- }
581
- }
582
- function Sn(e, n) {
583
- const t = n._value;
584
- return n.children.forEach((r) => {
585
- if (typeof t == "object")
586
- if (r.name in t) {
587
- const i = r.type !== "input" || t[r.name] && typeof t[r.name] == "object" ? re(t[r.name]) : t[r.name];
588
- r.input(i, !1);
589
- } else
590
- (e.type !== "list" || typeof r.name == "number") && kt(n, { name: r.name, value: r.value }), t.__init || (r.type === "group" ? r.input({}, !1) : r.type === "list" ? r.input([], !1) : r.input(void 0, !1));
591
- }), e;
592
- }
593
- function kn(e, n) {
594
- var t;
595
- return n._d <= 0 && (n.isSettled = !1, e.emit("settled", !1, !1), n.settled = new Promise((r) => {
596
- n._resolve = r;
597
- }), e.parent && ((t = e.parent) === null || t === void 0 || t.disturb())), n._d++, e;
598
- }
599
- function Cn(e, n, t) {
600
- var r;
601
- if (t !== void 0 && e.type !== "input")
602
- return kt(n, t), ge(e, n, !0, !1);
603
- n._d > 0 && n._d--, n._d === 0 && (n.isSettled = !0, e.emit("settled", !0, !1), e.parent && ((r = e.parent) === null || r === void 0 || r.calm({ name: e.name, value: n.value })), n._resolve && n._resolve(n.value));
604
- }
605
- function Vn(e, n) {
606
- e.emit("destroying", e), e.store.filter(() => !1), e.parent && e.parent.remove(e), un(e), n._value = n.value = void 0, e.emit("destroyed", e);
607
- }
608
- function In(e, n, t) {
609
- n.type = t.type, n.props.definition = he(t), n.value = n._value = wt({
610
- type: e.type,
611
- value: n.value
612
- }), t.forceTypeProp && (e.props.type && (e.props.originalType = e.props.type), n.props.type = t.forceTypeProp), t.family && (n.props.family = t.family), t.features && t.features.forEach((r) => r(e)), t.props && e.addProps(t.props), e.emit("defined", t);
613
- }
614
- function Pn(e, n, t) {
615
- var r;
616
- if (e.props.attrs) {
617
- const i = { ...e.props.attrs };
618
- e.props._emit = !1;
619
- for (const o in i) {
620
- const a = oe(o);
621
- t.includes(a) && (e.props[a] = i[o], delete i[o]);
622
- }
623
- const s = J(n._value);
624
- e.props.initial = e.type !== "input" ? re(s) : s, e.props._emit = !0, e.props.attrs = i, e.props.definition && (e.props.definition.props = [
625
- ...((r = e.props.definition) === null || r === void 0 ? void 0 : r.props) || [],
626
- ...t
627
- ]);
628
- }
629
- return e.emit("added-props", t), e;
630
- }
631
- function On(e, n, t, r) {
632
- if (e.type === "input" && U(100, e), t.parent && t.parent !== e && t.parent.remove(t), n.children.includes(t) || (r !== void 0 && e.type === "list" ? (n.children.splice(r, 0, t), Array.isArray(e.value) && e.value.length < n.children.length && e.disturb().calm({
633
- name: r,
634
- value: t.value,
635
- from: $t
636
- })) : n.children.push(t), t.isSettled || e.disturb()), t.parent !== e) {
637
- if (t.parent = e, t.parent !== e)
638
- return e.remove(t), t.parent.add(t), e;
639
- } else
640
- t.use(e.plugins);
641
- return ge(e, n, !1), e.ledger.merge(t), e.emit("child", t), e;
642
- }
643
- function xn(e, n, t, r) {
644
- return be(r) ? (e.parent && e.parent !== r && e.parent.remove(e), n.parent = r, e.resetConfig(), r.children.includes(e) ? e.use(r.plugins) : r.add(e), !0) : r === null ? (n.parent = null, !0) : !1;
645
- }
646
- function An(e, n, t) {
647
- const r = n.children.indexOf(t);
648
- if (r !== -1) {
649
- t.isSettled && e.disturb(), n.children.splice(r, 1);
650
- let i = Qe(t.props.preserve), s = t.parent;
651
- for (; i === void 0 && s; )
652
- i = Qe(s.props.preserve), s = s.parent;
653
- i ? e.calm() : e.calm({
654
- name: e.type === "list" ? r : t.name,
655
- value: Pe
656
- }), t.parent = null, t.config._rmn = t;
657
- }
658
- return e.ledger.unmerge(t), e;
659
- }
660
- function En(e, n, t) {
661
- n.children.forEach((r) => t(r));
662
- }
663
- function Rn(e, n, t, r = !1) {
664
- n.children.forEach((i) => {
665
- (t(i) !== !1 || !r) && i.walk(t);
666
- });
667
- }
668
- function jn(e, n) {
669
- const t = e.parent || void 0;
670
- n.config = Ct(e.config._t, t), e.walk((r) => r.resetConfig());
671
- }
672
- function qe(e, n, t, r = !0, i = !0) {
673
- return Array.isArray(t) || t instanceof Set ? (t.forEach((s) => qe(e, n, s)), e) : (n.plugins.has(t) || (i && typeof t.library == "function" && t.library(e), r && t(e) !== !1 && (n.plugins.add(t), e.children.forEach((s) => s.use(t)))), e);
674
- }
675
- function Ln(e, n, t, r) {
676
- if (be(e.parent)) {
677
- const i = e.parent.children, s = r >= i.length ? i.length - 1 : r < 0 ? 0 : r, o = i.indexOf(e);
678
- return o === -1 ? !1 : (i.splice(o, 1), i.splice(s, 0, e), e.parent.children = i, e.parent.type === "list" && e.parent.disturb().calm({ name: s, value: Oe, from: o }), !0);
679
- }
680
- return !1;
681
- }
682
- function Mn(e) {
683
- if (e.parent) {
684
- const n = [...e.parent.children].indexOf(e);
685
- return n === -1 ? e.parent.children.length : n;
686
- }
687
- return -1;
688
- }
689
- function Tn(e, n) {
690
- return n;
691
- }
692
- function Fn(e, n) {
693
- var t;
694
- return ((t = e.parent) === null || t === void 0 ? void 0 : t.type) === "list" ? e.index : n.name !== bt ? n.name : e.index;
695
- }
696
- function Dn(e, n) {
697
- return n.parent ? n.parent.address.concat([e.name]) : [e.name];
698
- }
699
- function Wn(e, n, t) {
700
- const r = typeof t == "string" ? t.split(e.config.delimiter) : t;
701
- if (!r.length)
702
- return;
703
- const i = r[0];
704
- let s = e.parent;
705
- for (s || (String(r[0]) === String(e.name) && r.shift(), s = e), i === "$parent" && r.shift(); s && r.length; ) {
706
- const o = r.shift();
707
- switch (o) {
708
- case "$root":
709
- s = e.root;
710
- break;
711
- case "$parent":
712
- s = s.parent;
713
- break;
714
- case "$self":
715
- s = e;
716
- break;
717
- default:
718
- s = s.children.find((a) => String(a.name) === String(o)) || Un(s, o);
719
- }
720
- }
721
- return s || void 0;
722
- }
723
- function Un(e, n) {
724
- const t = String(n).match(/^(find)\((.*)\)$/);
725
- if (t) {
726
- const [, r, i] = t, s = i.split(",").map((o) => o.trim());
727
- switch (r) {
728
- case "find":
729
- return e.find(s[0], s[1]);
730
- default:
731
- return;
732
- }
733
- }
734
- }
735
- function Kn(e, n, t, r) {
736
- return qn(e, t, r);
737
- }
738
- function qn(e, n, t = "name") {
739
- const r = typeof t == "string" ? (s) => s[t] == n : t, i = [e];
740
- for (; i.length; ) {
741
- const s = i.shift();
742
- if (r(s, n))
743
- return s;
744
- i.push(...s.children);
745
- }
746
- }
747
- function Bn(e) {
748
- let n = e;
749
- for (; n.parent; )
750
- n = n.parent;
751
- return n;
752
- }
753
- function Ct(e = {}, n) {
754
- let t;
755
- return new Proxy(e, {
756
- get(...r) {
757
- const i = r[1];
758
- if (i === "_t")
759
- return e;
760
- const s = Reflect.get(...r);
761
- if (s !== void 0)
762
- return s;
763
- if (n) {
764
- const o = n.config[i];
765
- if (o !== void 0)
766
- return o;
767
- }
768
- if (e.rootConfig && typeof i == "string") {
769
- const o = e.rootConfig[i];
770
- if (o !== void 0)
771
- return o;
772
- }
773
- return i === "delay" && (t == null ? void 0 : t.type) === "input" ? 20 : mn[i];
774
- },
775
- set(...r) {
776
- const i = r[1], s = r[2];
777
- if (i === "_n")
778
- return t = s, e.rootConfig && e.rootConfig._add(t), !0;
779
- if (i === "_rmn")
780
- return e.rootConfig && e.rootConfig._rm(t), t = void 0, !0;
781
- if (!Me(e[i], s, !1)) {
782
- const o = Reflect.set(...r);
783
- return t && (t.emit(`config:${i}`, s, !1), tt(t, i, s), t.walk((a) => tt(a, i, s), !0)), o;
784
- }
785
- return !0;
786
- }
787
- });
788
- }
789
- function zn(e, n, t, r = "ui") {
790
- const i = typeof t == "string" ? { key: t, value: t, type: r } : t, s = e.hook.text.dispatch(i);
791
- return e.emit("text", s, !1), s.value;
792
- }
793
- function Nn(e) {
794
- const n = e.name;
795
- do {
796
- if (e.props.isForm === !0)
797
- break;
798
- e.parent || U(106, n), e = e.parent;
799
- } while (e);
800
- e.props.id && cn(e.props.id);
801
- }
802
- function Hn(e, n, t) {
803
- return dn(e, t);
804
- }
805
- function Vt(e, n, t, r) {
806
- const i = `${e.name}-set`, s = e.hook.setErrors.dispatch({ localErrors: t, childErrors: r });
807
- return en(e, s.localErrors, s.childErrors).forEach((o) => {
808
- e.store.apply(o, (a) => a.meta.source === i);
809
- }), e;
810
- }
811
- function Zn(e, n, t = !0, r) {
812
- return Vt(e, n, []), t && (r = r || `${e.name}-set`, e.walk((i) => {
813
- i.store.filter((s) => !(s.type === "error" && s.meta && s.meta.source === r));
814
- })), e;
815
- }
816
- function Yn(e) {
817
- return j(e.props, "id") || (e.props.id = `input_${bn++}`), e;
818
- }
819
- function Jn(e) {
820
- const n = {
821
- initial: typeof e == "object" ? J(e) : e
822
- };
823
- let t, r = !0;
824
- return new Proxy(n, {
825
- get(...i) {
826
- const [s, o] = i;
827
- if (j(n, o))
828
- return Reflect.get(...i);
829
- if (t && typeof o == "string" && t.config[o] !== void 0)
830
- return t.config[o];
831
- },
832
- set(i, s, o, a) {
833
- if (s === "_n")
834
- return t = o, !0;
835
- if (s === "_emit")
836
- return r = o, !0;
837
- const { prop: m, value: h } = t.hook.prop.dispatch({
838
- prop: s,
839
- value: o
840
- });
841
- if (!Me(n[m], h, !1) || typeof h == "object") {
842
- const _ = Reflect.set(i, m, h, a);
843
- return r && (t.emit("prop", { prop: m, value: h }), typeof m == "string" && t.emit(`prop:${m}`, h)), _;
844
- }
845
- return !0;
846
- }
847
- });
848
- }
849
- function Qn(e, n) {
850
- if (e.props.definition)
851
- return e.define(e.props.definition);
852
- for (const t of n) {
853
- if (e.props.definition)
854
- return;
855
- typeof t.library == "function" && t.library(e);
856
- }
857
- }
858
- function Gn(e) {
859
- const n = wt(e), t = Ct(e.config || {}, e.parent);
860
- return {
861
- _d: 0,
862
- _e: yt(),
863
- _resolve: !1,
864
- _tmo: !1,
865
- _value: n,
866
- children: Dt(e.children || []),
867
- config: t,
868
- hook: gn(),
869
- isCreated: !1,
870
- isSettled: !0,
871
- ledger: rn(),
872
- name: $n(e),
873
- parent: e.parent || null,
874
- plugins: /* @__PURE__ */ new Set(),
875
- props: Jn(n),
876
- settled: Promise.resolve(n),
877
- store: Zt(!0),
878
- traps: _n(),
879
- type: e.type || "input",
880
- value: n
881
- };
882
- }
883
- function Xn(e, n) {
884
- var t;
885
- if (e.ledger.init(e.store._n = e.props._n = e.config._n = e), e.props._emit = !1, n.props && Object.assign(e.props, n.props), e.props._emit = !0, Qn(e, /* @__PURE__ */ new Set([
886
- ...n.plugins || [],
887
- ...e.parent ? e.parent.plugins : []
888
- ])), n.plugins)
889
- for (const r of n.plugins)
890
- qe(e, e._c, r, !0, !1);
891
- return Yn(e), e.each((r) => e.add(r)), e.parent && e.parent.add(e, n.index), e.type === "input" && e.children.length && U(100, e), St(e, e._c, e._value, !1), e.store.release(), !((t = n.props) === null || t === void 0) && t.id && an(e), e.emit("created", e), e.isCreated = !0, e;
892
- }
893
- function er(e) {
894
- const n = e || {}, t = Gn(n), r = new Proxy(t, {
895
- get(...i) {
896
- const [, s] = i;
897
- if (s === "__FKNode__")
898
- return !0;
899
- const o = t.traps.get(s);
900
- return o && o.get ? o.get(r, t) : Reflect.get(...i);
901
- },
902
- set(...i) {
903
- const [, s, o] = i, a = t.traps.get(s);
904
- return a && a.set ? a.set(r, t, s, o) : Reflect.set(...i);
905
- }
906
- });
907
- return Xn(r, n);
908
- }
909
- function xe(e) {
910
- return typeof e != "string" && j(e, "$el");
911
- }
912
- function Ae(e) {
913
- return typeof e != "string" && j(e, "$cmp");
914
- }
915
- function te(e) {
916
- return !e || typeof e == "string" ? !1 : j(e, "if") && j(e, "then");
917
- }
918
- function tr(e) {
919
- return typeof e != "string" && "$formkit" in e;
920
- }
921
- function nr(e) {
922
- if (typeof e == "string")
923
- return {
924
- $el: "text",
925
- children: e
926
- };
927
- if (tr(e)) {
928
- const { $formkit: n, for: t, if: r, children: i, bind: s, ...o } = e;
929
- return Object.assign({
930
- $cmp: "FormKit",
931
- props: { ...o, type: n }
932
- }, r ? { if: r } : {}, t ? { for: t } : {}, i ? { children: i } : {}, s ? { bind: s } : {});
933
- }
934
- return e;
935
- }
936
- function K(e) {
937
- let n;
938
- const t = /* @__PURE__ */ new Set(), r = function(f, p) {
939
- return typeof f == "function" ? f(p) : f;
940
- }, i = [
941
- {
942
- "&&": (c, f, p) => r(c, p) && r(f, p),
943
- "||": (c, f, p) => r(c, p) || r(f, p)
944
- },
945
- {
946
- "===": (c, f, p) => r(c, p) === r(f, p),
947
- "!==": (c, f, p) => r(c, p) !== r(f, p),
948
- "==": (c, f, p) => r(c, p) == r(f, p),
949
- "!=": (c, f, p) => r(c, p) != r(f, p),
950
- ">=": (c, f, p) => r(c, p) >= r(f, p),
951
- "<=": (c, f, p) => r(c, p) <= r(f, p),
952
- ">": (c, f, p) => r(c, p) > r(f, p),
953
- "<": (c, f, p) => r(c, p) < r(f, p)
954
- },
955
- {
956
- "+": (c, f, p) => r(c, p) + r(f, p),
957
- "-": (c, f, p) => r(c, p) - r(f, p)
958
- },
959
- {
960
- "*": (c, f, p) => r(c, p) * r(f, p),
961
- "/": (c, f, p) => r(c, p) / r(f, p),
962
- "%": (c, f, p) => r(c, p) % r(f, p)
963
- }
964
- ], s = i.reduce((c, f) => c.concat(Object.keys(f)), []), o = new Set(s.map((c) => c.charAt(0)));
965
- function a(c, f, p, v) {
966
- const k = c.filter((u) => u.startsWith(f));
967
- return k.length ? k.find((u) => v.length >= p + u.length && v.substring(p, p + u.length) === u ? u : !1) : !1;
968
- }
969
- function m(c, f, p = 1) {
970
- let v = p ? f.substring(c + 1).trim() : f.substring(0, c).trim();
971
- if (!v.length)
972
- return -1;
973
- if (!p) {
974
- const u = v.split("").reverse(), y = u.findIndex((b) => o.has(b));
975
- v = u.slice(y).join("");
976
- }
977
- const k = v[0];
978
- return i.findIndex((u) => {
979
- const y = Object.keys(u);
980
- return !!a(y, k, 0, v);
981
- });
982
- }
983
- function h(c, f) {
984
- let p = "";
985
- const v = f.length;
986
- let k = 0;
987
- for (let u = c; u < v; u++) {
988
- const y = f.charAt(u);
989
- if (y === "(")
990
- k++;
991
- else if (y === ")")
992
- k--;
993
- else if (k === 0 && y === " ")
994
- continue;
995
- if (k === 0 && a(s, y, u, f))
996
- return [p, u - 1];
997
- p += y;
998
- }
999
- return [p, f.length - 1];
1000
- }
1001
- function _(c, f = 0) {
1002
- const p = i[f], v = c.length, k = Object.keys(p);
1003
- let u = 0, y = !1, b = null, S = "", P = null, I, M = "", V = "", E = "", R = "", B = 0;
1004
- const z = (x, N) => {
1005
- x ? E += N : S += N;
1006
- };
1007
- for (let x = 0; x < v; x++)
1008
- if (M = V, V = c.charAt(x), (V === "'" || V === '"') && M !== "\\" && (u === 0 && !y || u && !R)) {
1009
- u ? R = V : y = V, z(u, V);
1010
- continue;
1011
- } else if (y && (V !== y || M === "\\") || R && (V !== R || M === "\\")) {
1012
- z(u, V);
1013
- continue;
1014
- } else if (y === V) {
1015
- y = !1, z(u, V);
1016
- continue;
1017
- } else if (R === V) {
1018
- R = !1, z(u, V);
1019
- continue;
1020
- } else {
1021
- if (V === " ")
1022
- continue;
1023
- if (V === "(")
1024
- u === 0 ? B = x : E += V, u++;
1025
- else if (V === ")")
1026
- if (u--, u === 0) {
1027
- const N = typeof S == "string" && S.startsWith("$") ? S : void 0, He = N && c.charAt(x + 1) === ".";
1028
- let X = "";
1029
- He && ([X, x] = h(x + 2, c));
1030
- const se = b ? f : m(B, c, 0), ee = m(x, c);
1031
- se === -1 && ee === -1 ? S = d(E, -1, N, X) : b && (se >= ee || ee === -1) && f === se ? (P = b.bind(null, d(E, -1, N, X)), b = null, S = "") : ee > se && f === ee ? S = d(E, -1, N, X) : S += `(${E})${He ? `.${X}` : ""}`, E = "";
1032
- } else
1033
- E += V;
1034
- else if (u === 0 && (I = a(k, V, x, c))) {
1035
- x === 0 && U(103, [I, c]), x += I.length - 1, x === c.length - 1 && U(104, [I, c]), b ? S && (P = b.bind(null, d(S, f)), b = p[I].bind(null, P), S = "") : P ? (b = p[I].bind(null, d(P, f)), P = null) : (b = p[I].bind(null, d(S, f)), S = "");
1036
- continue;
1037
- } else
1038
- z(u, V);
1039
- }
1040
- return S && b && (b = b.bind(null, d(S, f))), b = !b && P ? P : b, !b && S && (b = (x, N) => typeof x == "function" ? x(N) : x, b = b.bind(null, d(S, f))), !b && !S && U(105, c), b;
1041
- }
1042
- function d(c, f, p, v) {
1043
- if (p) {
1044
- const k = d(p, i.length);
1045
- let u, y = v ? K(`$${v}`) : !1;
1046
- if (typeof k == "function") {
1047
- const b = Kt(String(c)).map((S) => d(S, -1));
1048
- return (S) => {
1049
- const P = k(S);
1050
- return typeof P != "function" ? (ve(150, p), P) : (u = P(...b.map((I) => typeof I == "function" ? I(S) : I)), y && (y = y.provide((I) => {
1051
- const M = n(I);
1052
- return I.reduce((E, R) => {
1053
- if (R === v || (v == null ? void 0 : v.startsWith(`${R}(`))) {
1054
- const z = qt(u, R);
1055
- E[R] = () => z;
1056
- } else
1057
- E[R] = M[R];
1058
- return E;
1059
- }, {});
1060
- })), y ? y() : u);
1061
- };
1062
- }
1063
- } else if (typeof c == "string") {
1064
- if (c === "true")
1065
- return !0;
1066
- if (c === "false")
1067
- return !1;
1068
- if (c === "undefined")
1069
- return;
1070
- if (Wt(c))
1071
- return Ut(c.substring(1, c.length - 1));
1072
- if (!isNaN(+c))
1073
- return Number(c);
1074
- if (f < i.length - 1)
1075
- return _(c, f + 1);
1076
- if (c.startsWith("$")) {
1077
- const k = c.substring(1);
1078
- return t.add(k), function(y) {
1079
- return k in y ? y[k]() : void 0;
1080
- };
1081
- }
1082
- return c;
1083
- }
1084
- return c;
1085
- }
1086
- const w = _(e.startsWith("$:") ? e.substring(2) : e), g = Array.from(t);
1087
- function $(c) {
1088
- return n = c, Object.assign(w.bind(null, c(g)), {
1089
- provide: $
1090
- });
1091
- }
1092
- return Object.assign(w, {
1093
- provide: $
1094
- });
1095
- }
1096
- const nt = "1.0.0-beta.10", rr = q("outer", () => ({
1097
- $el: "div",
1098
- attrs: {
1099
- key: "$id",
1100
- "data-family": "$family || undefined",
1101
- "data-type": "$type",
1102
- "data-multiple": '$attrs.multiple || ($type != "select" && $options != undefined) || undefined',
1103
- "data-disabled": "$disabled || undefined",
1104
- "data-complete": "$state.complete || undefined",
1105
- "data-invalid": "$state.valid === false && $state.validationVisible || undefined",
1106
- "data-errors": "$state.errors || undefined",
1107
- "data-submitted": "$state.submitted || undefined",
1108
- "data-prefix-icon": "$_rawPrefixIcon !== undefined || undefined",
1109
- "data-suffix-icon": "$_rawSuffixIcon !== undefined || undefined",
1110
- "data-prefix-icon-click": "$onPrefixIconClick !== undefined || undefined",
1111
- "data-suffix-icon-click": "$onSuffixIconClick !== undefined || undefined"
1112
- }
1113
- }), !0), ir = q("inner", "div"), sr = q("wrapper", "div"), or = q("label", () => ({
1114
- $el: "label",
1115
- if: "$label",
1116
- attrs: {
1117
- for: "$id"
1118
- }
1119
- })), lr = q("messages", () => ({
1120
- $el: "ul",
1121
- if: "$fns.length($messages)"
1122
- })), ar = q("message", () => ({
1123
- $el: "li",
1124
- for: ["message", "$messages"],
1125
- attrs: {
1126
- key: "$message.key",
1127
- id: "$id + '-' + $message.key",
1128
- "data-message-type": "$message.type"
1129
- }
1130
- })), ur = q("prefix", null), fr = q("suffix", null), cr = q("help", () => ({
1131
- $el: "div",
1132
- if: "$help",
1133
- attrs: {
1134
- id: '$: "help-" + $id'
1135
- }
1136
- }));
1137
- function rt(e) {
1138
- return typeof e == "object" && ("$el" in e || "$cmp" in e || "$formkit" in e);
1139
- }
1140
- function pr(e, n = {}) {
1141
- return typeof e == "string" ? rt(n) || typeof n == "string" ? n : e : Array.isArray(e) ? rt(n) ? n : e : Te(e, n);
1142
- }
1143
- function dr(e) {
1144
- return rr(sr(or("$label"), ir(ur(), e(), fr())), cr("$help"), lr(ar("$message.value")));
1145
- }
1146
- function q(e, n, t = !1) {
1147
- return (...r) => {
1148
- const i = (s) => {
1149
- const o = !n || typeof n == "string" ? { $el: n } : n();
1150
- return (xe(o) || Ae(o)) && (o.meta || (o.meta = { section: e }), r.length && !o.children && (o.children = [
1151
- ...r.map((a) => typeof a == "string" ? a : a(s))
1152
- ]), xe(o) && (o.attrs = {
1153
- class: `$classes.${e}`,
1154
- ...o.attrs || {}
1155
- })), {
1156
- if: `$slots.${e}`,
1157
- then: `$slots.${e}`,
1158
- else: e in s ? pr(o, s[e]) : o
1159
- };
1160
- };
1161
- return t ? mr(i) : i;
1162
- };
1163
- }
1164
- function mr(e) {
1165
- return (n) => [e(n)];
1166
- }
1167
- _e({
1168
- type: "state",
1169
- blocking: !0,
1170
- visible: !1,
1171
- value: !0,
1172
- key: "validating"
1173
- });
1174
- let ue;
1175
- const yr = new Promise((e) => {
1176
- }), $e = typeof window < "u" && typeof fetch < "u";
1177
- ue = $e ? getComputedStyle(document.documentElement) : void 0;
1178
- const ne = {}, we = {};
1179
- function Se(e, n) {
1180
- return (t) => {
1181
- if (typeof t == "boolean")
1182
- return;
1183
- if (t.startsWith("<svg"))
1184
- return t;
1185
- if (typeof t != "string")
1186
- return;
1187
- const r = ne[t], i = t.startsWith("default:");
1188
- t = i ? t.split(":")[1] : t;
1189
- let s;
1190
- if (r || t in ne)
1191
- return r;
1192
- if (!we[t]) {
1193
- if (s = hr(t), s = $e && typeof s > "u" ? Promise.resolve(s) : s, s instanceof Promise)
1194
- we[t] = s.then((o) => !o && typeof t == "string" && !i ? s = typeof e == "function" ? e(t) : gr(t, n) : o).then((o) => (typeof t == "string" && (ne[i ? `default:${t}` : t] = o), o));
1195
- else if (typeof s == "string")
1196
- return ne[i ? `default:${t}` : t] = s, s;
1197
- }
1198
- return we[t];
1199
- };
1200
- }
1201
- function hr(e) {
1202
- if (!!$e)
1203
- return yr.then(() => _r(e));
1204
- }
1205
- function _r(e) {
1206
- const n = ue == null ? void 0 : ue.getPropertyValue(`--fk-icon-${e}`);
1207
- if (n) {
1208
- const t = atob(n);
1209
- if (t.startsWith("<svg"))
1210
- return ne[e] = t, t;
1211
- }
1212
- }
1213
- function gr(e, n) {
1214
- const t = nt.startsWith("__") ? "latest" : nt, r = typeof n == "function" ? n(e) : `https://cdn.jsdelivr.net/npm/@formkit/icons@${t}/dist/icons/${e}.svg`;
1215
- if (!!$e)
1216
- return fetch(`${r}`).then(async (i) => {
1217
- const s = await i.text();
1218
- if (s.startsWith("<svg"))
1219
- return s;
1220
- }).catch((i) => {
1221
- console.error(i);
1222
- });
1223
- }
1224
- let Be = !1;
1225
- const it = {
1226
- 100: ({ data: e }) => `Only groups, lists, and forms can have children (${e.name}).`,
1227
- 101: ({ data: e }) => `You cannot directly modify the store (${e.name}). See: https://formkit.com/advanced/core#message-store`,
1228
- 102: ({ data: [e, n] }) => `You cannot directly assign node.${n} (${e.name})`,
1229
- 103: ({ data: [e] }) => `Schema expressions cannot start with an operator (${e})`,
1230
- 104: ({ data: [e, n] }) => `Schema expressions cannot end with an operator (${e} in "${n}")`,
1231
- 105: ({ data: e }) => `Invalid schema expression: ${e}`,
1232
- 106: ({ data: e }) => `Cannot submit because (${e}) is not in a form.`,
1233
- 107: ({ data: [e, n] }) => `Cannot set ${e.name} to non object value: ${n}`,
1234
- 108: ({ data: [e, n] }) => `Cannot set ${e.name} to non array value: ${n}`,
1235
- 600: ({ data: e }) => `Unknown input type${typeof e.props.type == "string" ? ' "' + e.props.type + '"' : ""} ("${e.name}")`,
1236
- 601: ({ data: e }) => `Input definition${typeof e.props.type == "string" ? ' "' + e.props.type + '"' : ""} is missing a schema or component property (${e.name}).`
1237
- }, st = {
1238
- 150: ({ data: e }) => `Schema function "${e}()" is not a valid function.`,
1239
- 151: ({ data: e }) => `No form element with id: ${e}`,
1240
- 152: ({ data: e }) => `No input element with id: ${e}`,
1241
- 350: ({ data: e }) => `Invalid options prop for radio input (${e.name}). See https://formkit.com/inputs/radio`,
1242
- 650: 'Schema "$get()" must use the id of an input to access.',
1243
- 651: ({ data: e }) => `Cannot setErrors() on "${e}" because no such id exists.`,
1244
- 652: ({ data: e }) => `Cannot clearErrors() on "${e}" because no such id exists.`,
1245
- 800: ({ data: e }) => `${e} is deprecated.`
1246
- }, vr = (e, n) => {
1247
- if (e.code in it) {
1248
- const t = it[e.code];
1249
- e.message = typeof t == "function" ? t(e) : t;
1250
- }
1251
- return n(e);
1252
- };
1253
- Be || De(vr);
1254
- const br = (e, n) => {
1255
- if (e.code in st) {
1256
- const t = st[e.code];
1257
- e.message = typeof t == "function" ? t(e) : t;
1258
- }
1259
- return n(e);
1260
- };
1261
- Be || We(br);
1262
- Be = !0;
1263
- const ke = {};
1264
- let D;
1265
- const Y = /* @__PURE__ */ new Map(), $r = "__raw__", wr = /[a-zA-Z0-9\-][cC]lass$/;
1266
- function Sr(e, n) {
1267
- const t = ie(null);
1268
- if (e === "get") {
1269
- const i = {};
1270
- return t.value = kr.bind(null, i), t;
1271
- }
1272
- const r = e.split(".");
1273
- return Z(() => t.value = ze(n, r)), t;
1274
- }
1275
- function ze(e, n) {
1276
- if (Array.isArray(e)) {
1277
- for (const r of e) {
1278
- const i = r !== !1 && ze(r, n);
1279
- if (i !== void 0)
1280
- return i;
1281
- }
1282
- return;
1283
- }
1284
- let t;
1285
- return n.reduce((r, i, s, o) => {
1286
- if (typeof r != "object")
1287
- return t = void 0, o.splice(1);
1288
- const a = r[i];
1289
- return s === n.length - 1 && a !== void 0 && (t = a), r[i];
1290
- }, e), t;
1291
- }
1292
- function kr(e, n) {
1293
- if (typeof n != "string")
1294
- return ve(650);
1295
- if (n in e || (e[n] = ie(void 0)), e[n].value === void 0) {
1296
- e[n].value = null;
1297
- const t = vt(n);
1298
- t && (e[n].value = t.context), fn(n, ({ payload: r }) => {
1299
- e[n].value = be(r) ? r.context : r;
1300
- });
1301
- }
1302
- return e[n].value;
1303
- }
1304
- function ot(e, n) {
1305
- function t(d, w) {
1306
- const g = _(K(w.if), { if: !0 }), $ = m(d, w.then), c = w.else ? m(d, w.else) : null;
1307
- return [g, $, c];
1308
- }
1309
- function r(d, w) {
1310
- var g, $;
1311
- const c = _(K(d.if));
1312
- let f = () => w, p = () => w;
1313
- return typeof d.then == "object" ? p = i(d.then, void 0) : typeof d.then == "string" && ((g = d.then) === null || g === void 0 ? void 0 : g.startsWith("$")) ? p = _(K(d.then)) : p = () => d.then, j(d, "else") && (typeof d.else == "object" ? f = i(d.else) : typeof d.else == "string" && (($ = d.else) === null || $ === void 0 ? void 0 : $.startsWith("$")) ? f = _(K(d.else)) : f = () => d.else), () => c() ? p() : f();
1314
- }
1315
- function i(d, w, g = {}) {
1316
- const $ = new Set(Object.keys(d || {})), c = w ? _(K(w)) : () => ({}), f = [
1317
- (p) => {
1318
- const v = c();
1319
- for (const k in v)
1320
- $.has(k) || (p[k] = v[k]);
1321
- }
1322
- ];
1323
- if (d) {
1324
- if (te(d))
1325
- return r(d, g);
1326
- for (let p in d) {
1327
- const v = d[p];
1328
- let k;
1329
- const u = typeof v == "string";
1330
- p.startsWith($r) ? (p = p.substring(7), k = () => v) : u && v.startsWith("$") && v.length > 1 && !(v.startsWith("$reset") && wr.test(p)) ? k = _(K(v)) : typeof v == "object" && te(v) ? k = r(v, void 0) : typeof v == "object" && ye(v) ? k = i(v) : k = () => v, f.push((y) => {
1331
- y[p] = k();
1332
- });
1333
- }
1334
- }
1335
- return () => {
1336
- const p = Array.isArray(d) ? [] : {};
1337
- return f.forEach((v) => v(p)), p;
1338
- };
1339
- }
1340
- function s(d, w) {
1341
- let g = null, $ = () => null, c = !1, f = null, p = null, v = null, k = !1;
1342
- const u = nr(w);
1343
- if (xe(u) ? (g = u.$el, $ = u.$el !== "text" ? i(u.attrs, u.bind) : () => null) : Ae(u) ? (typeof u.$cmp == "string" ? j(d, u.$cmp) ? g = d[u.$cmp] : (g = u.$cmp, k = !0) : g = u.$cmp, $ = i(u.props, u.bind)) : te(u) && ([c, f, p] = t(d, u)), !te(u) && "if" in u ? c = _(K(u.if)) : !te(u) && g === null && (c = () => !0), "children" in u && u.children)
1344
- if (typeof u.children == "string")
1345
- if (u.children.startsWith("$slots."))
1346
- g = g === "text" ? "slot" : g, f = _(K(u.children));
1347
- else if (u.children.startsWith("$") && u.children.length > 1) {
1348
- const y = _(K(u.children));
1349
- f = () => String(y());
1350
- } else
1351
- f = () => String(u.children);
1352
- else if (Array.isArray(u.children))
1353
- f = m(d, u.children);
1354
- else {
1355
- const [y, b, S] = t(d, u.children);
1356
- f = (P) => y && y() ? b && b(P) : S && S(P);
1357
- }
1358
- if (Ae(u))
1359
- if (f) {
1360
- const y = f;
1361
- f = (b) => ({
1362
- default(S, P) {
1363
- var I, M, V, E;
1364
- const R = D;
1365
- P && (D = P), S && ((I = Y.get(D)) === null || I === void 0 || I.unshift(S)), b && ((M = Y.get(D)) === null || M === void 0 || M.unshift(b));
1366
- const B = y(b);
1367
- return S && ((V = Y.get(D)) === null || V === void 0 || V.shift()), b && ((E = Y.get(D)) === null || E === void 0 || E.shift()), D = R, B;
1368
- }
1369
- }), f.slot = !0;
1370
- } else
1371
- f = () => ({});
1372
- if ("for" in u && u.for) {
1373
- const y = u.for.length === 3 ? u.for[2] : u.for[1];
1374
- v = [
1375
- typeof y == "string" && y.startsWith("$") ? _(K(y)) : () => y,
1376
- u.for[0],
1377
- u.for.length === 3 ? String(u.for[1]) : null
1378
- ];
1379
- }
1380
- return [c, g, $, f, p, v, k];
1381
- }
1382
- function o(d, w) {
1383
- const g = d(w), $ = D;
1384
- return Object.keys(g).reduce((c, f) => {
1385
- const p = g && g[f];
1386
- return c[f] = (v) => p && p(v, $) || null, c;
1387
- }, {});
1388
- }
1389
- function a(d, w) {
1390
- const [g, $, c, f, p, v, k] = s(d, w);
1391
- let u = (y) => {
1392
- if (g && $ === null && f)
1393
- return g() ? f(y) : p && p(y);
1394
- if ($ && (!g || g())) {
1395
- if ($ === "text" && f)
1396
- return Tt(String(f()));
1397
- if ($ === "slot" && f)
1398
- return f(y);
1399
- const b = k ? L($) : $, S = f != null && f.slot ? o(f, y) : null;
1400
- return pe(b, c(), S || (f ? f(y) : []));
1401
- }
1402
- return typeof p == "function" ? p(y) : p;
1403
- };
1404
- if (v) {
1405
- const y = u, [b, S, P] = v;
1406
- u = () => {
1407
- const I = b(), M = isNaN(I) ? I : Array(Number(I)).fill(0).map((R, B) => B), V = [];
1408
- if (typeof M != "object")
1409
- return null;
1410
- const E = Y.get(D) || [];
1411
- for (const R in M) {
1412
- if (Array.isArray(M) && R === "length")
1413
- continue;
1414
- const B = Object.defineProperty({
1415
- ...E.reduce((z, x) => z.__idata ? { ...z, ...x } : x, {}),
1416
- [S]: M[R],
1417
- ...P !== null ? { [P]: R } : {}
1418
- }, "__idata", { enumerable: !1, value: !0 });
1419
- E.unshift(B), V.push(y.bind(null, B)()), E.shift();
1420
- }
1421
- return V;
1422
- };
1423
- }
1424
- return u;
1425
- }
1426
- function m(d, w) {
1427
- if (Array.isArray(w)) {
1428
- const $ = w.map(a.bind(null, d));
1429
- return (c) => $.map((f) => f(c));
1430
- }
1431
- const g = a(d, w);
1432
- return ($) => g($);
1433
- }
1434
- const h = [];
1435
- function _(d, w = {}) {
1436
- const g = {};
1437
- return h.push(($, c) => {
1438
- g[c] = d.provide((f) => $(f, w));
1439
- }), () => g[D]();
1440
- }
1441
- return function(w, g) {
1442
- const $ = JSON.stringify(n), [c, f] = j(ke, $) ? ke[$] : [m(e, n), h];
1443
- return ke[$] = [c, f], f.forEach((p) => {
1444
- p(w, g);
1445
- }), () => (D = g, c());
1446
- };
1447
- }
1448
- function It(e, n) {
1449
- const t = Y.get(D) || [];
1450
- let r;
1451
- return t.length && (r = ze(t, e.split("."))), r === void 0 ? n : r;
1452
- }
1453
- function Cr(e, n) {
1454
- return new Proxy(e, {
1455
- get(...t) {
1456
- let r;
1457
- const i = t[1];
1458
- if (typeof i == "string") {
1459
- const s = D;
1460
- D = n, r = It(i, void 0), D = s;
1461
- }
1462
- return r !== void 0 ? r : Reflect.get(...t);
1463
- }
1464
- });
1465
- }
1466
- function lt(e, n, t) {
1467
- return e((r, i = {}) => r.reduce((s, o) => {
1468
- if (o.startsWith("slots.")) {
1469
- const m = o.substring(6), h = n.slots && j(n.slots, m);
1470
- if (i.if)
1471
- s[o] = () => h;
1472
- else if (n.slots && h) {
1473
- const _ = Cr(n, t);
1474
- return s[o] = () => n.slots[m](_), s;
1475
- }
1476
- }
1477
- const a = Sr(o, n);
1478
- return s[o] = () => It(o, a.value), s;
1479
- }, {}), t);
1480
- }
1481
- let at = 0;
1482
- const Vr = A({
1483
- name: "FormKitSchema",
1484
- props: {
1485
- schema: {
1486
- type: [Array, Object],
1487
- required: !0
1488
- },
1489
- data: {
1490
- type: Object,
1491
- default: () => ({})
1492
- },
1493
- library: {
1494
- type: Object,
1495
- default: () => ({})
1496
- }
1497
- },
1498
- setup(e, n) {
1499
- const t = ft();
1500
- let r = Symbol(String(at++));
1501
- Y.set(r, []);
1502
- let i = ot(e.library, e.schema), s, o;
1503
- return ce(() => e.schema, (a, m) => {
1504
- var h;
1505
- r = Symbol(String(at++)), i = ot(e.library, e.schema), s = lt(i, o, r), a === m && ((h = t == null ? void 0 : t.proxy) === null || h === void 0 ? void 0 : h.$forceUpdate)();
1506
- }, { deep: !0 }), Z(() => {
1507
- o = Object.assign(xt(e.data), {
1508
- slots: n.slots
1509
- }), s = lt(i, o, r);
1510
- }), () => s();
1511
- }
1512
- }), Ir = {
1513
- config: {
1514
- type: Object,
1515
- default: {}
1516
- },
1517
- classes: {
1518
- type: Object,
1519
- required: !1
1520
- },
1521
- delay: {
1522
- type: Number,
1523
- required: !1
1524
- },
1525
- errors: {
1526
- type: Array,
1527
- default: []
1528
- },
1529
- inputErrors: {
1530
- type: Object,
1531
- default: () => ({})
1532
- },
1533
- index: {
1534
- type: Number,
1535
- required: !1
1536
- },
1537
- id: {
1538
- type: String,
1539
- required: !1
1540
- },
1541
- modelValue: {
1542
- required: !1
1543
- },
1544
- name: {
1545
- type: String,
1546
- required: !1
1547
- },
1548
- parent: {
1549
- type: Object,
1550
- required: !1
1551
- },
1552
- plugins: {
1553
- type: Array,
1554
- default: []
1555
- },
1556
- sectionsSchema: {
1557
- type: Object,
1558
- default: {}
1559
- },
1560
- type: {
1561
- type: [String, Object],
1562
- default: "text"
1563
- },
1564
- validation: {
1565
- type: [String, Array],
1566
- required: !1
1567
- },
1568
- validationMessages: {
1569
- type: Object,
1570
- required: !1
1571
- },
1572
- validationRules: {
1573
- type: Object,
1574
- required: !1
1575
- },
1576
- validationLabel: {
1577
- type: [String, Function],
1578
- required: !1
1579
- }
1580
- }, Pr = Ir, Ee = Symbol("FormKitParent");
1581
- A({
1582
- props: Pr,
1583
- emits: {
1584
- input: (e, n) => !0,
1585
- inputRaw: (e, n) => !0,
1586
- "update:modelValue": (e) => !0,
1587
- node: (e) => !!e,
1588
- submit: (e, n) => !0,
1589
- submitRaw: (e, n) => !0,
1590
- submitInvalid: (e) => !0
1591
- },
1592
- inheritAttrs: !1,
1593
- setup(e, n) {
1594
- const t = Rr(e, n);
1595
- if (t.props.definition || U(600, t), t.props.definition.component)
1596
- return () => {
1597
- var o;
1598
- return pe((o = t.props.definition) === null || o === void 0 ? void 0 : o.component, {
1599
- context: t.context
1600
- }, { ...n.slots });
1601
- };
1602
- const r = ie([]), i = () => {
1603
- var o, a;
1604
- const m = (a = (o = t.props) === null || o === void 0 ? void 0 : o.definition) === null || a === void 0 ? void 0 : a.schema;
1605
- m || U(601, t), r.value = typeof m == "function" ? m({ ...e.sectionsSchema }) : m;
1606
- };
1607
- i(), t.on("schema", i), n.emit("node", t);
1608
- const s = t.props.definition.library;
1609
- return n.expose({ node: t }), () => pe(Vr, { schema: r.value, data: t.context, library: s }, { ...n.slots });
1610
- }
1611
- });
1612
- const Pt = Symbol.for("FormKitOptions"), Re = Symbol();
1613
- function Or(e, n) {
1614
- const t = {}, r = (o) => {
1615
- for (const a of o)
1616
- a.__str in t && t[a.__str](), t[a.__str] = ce(Ar.bind(null, e, a), s.bind(null, a), { deep: !1 });
1617
- }, s = xr(e, n, r, (o) => {
1618
- if (!!o.length)
1619
- for (const a in t)
1620
- `${a}`.startsWith(`${o.__str}.`) && (t[a](), delete t[a]);
1621
- });
1622
- r(Ne(e));
1623
- }
1624
- function xr(e, n, t, r) {
1625
- return (i) => {
1626
- const s = Ot(e, i);
1627
- s !== Re && (i.__deep && r(i), typeof s == "object" && t(Ne(s, [i], ...i)), n(i, s, e));
1628
- };
1629
- }
1630
- function Ar(e, n) {
1631
- const t = Ot(e, n);
1632
- return t && typeof t == "object" ? Object.keys(t) : t;
1633
- }
1634
- function Ot(e, n) {
1635
- if (je(e)) {
1636
- if (n.length === 0)
1637
- return e.value;
1638
- e = e.value;
1639
- }
1640
- return n.reduce((t, r) => t === Re ? t : t === null || typeof t != "object" ? Re : t[r], e);
1641
- }
1642
- function Ne(e, n = [], ...t) {
1643
- if (e === null)
1644
- return n;
1645
- if (!t.length) {
1646
- const r = Object.defineProperty([], "__str", {
1647
- value: ""
1648
- });
1649
- if (e = je(e) ? e.value : e, e && typeof e == "object")
1650
- Object.defineProperty(r, "__deep", { value: !0 }), n.push(r);
1651
- else
1652
- return [r];
1653
- }
1654
- if (e === null || typeof e != "object")
1655
- return n;
1656
- for (const r in e) {
1657
- const i = t.concat(r);
1658
- Object.defineProperty(i, "__str", { value: i.join(".") });
1659
- const s = e[r];
1660
- ye(s) || Array.isArray(s) ? (n.push(Object.defineProperty(i, "__deep", { value: !0 })), n = n.concat(Ne(s, [], ...i))) : n.push(i);
1661
- }
1662
- return n;
1663
- }
1664
- function fe(e) {
1665
- return e === null || typeof e != "object" || (Ze(e) ? e = Lt(e) : je(e) && (e = Ze(e.value) ? fe(e.value) : e.value)), e;
1666
- }
1667
- const Ce = [
1668
- "help",
1669
- "label",
1670
- "ignore",
1671
- "disabled",
1672
- "preserve",
1673
- /^preserve(-e|E)rrors/,
1674
- /^[a-z]+(?:-visibility|Visibility)$/,
1675
- /^[a-zA-Z-]+(?:-class|Class)$/,
1676
- "prefixIcon",
1677
- "suffixIcon",
1678
- /^[a-zA-Z-]+(?:-icon|Icon)$/
1679
- ];
1680
- function ut(e, n) {
1681
- n.classes && Object.keys(n.classes).forEach((t) => {
1682
- typeof t == "string" && (e.props[`_${t}Class`] = n.classes[t], Ie(n.classes[t]) && t === "inner" && Object.values(n.classes[t]));
1683
- });
1684
- }
1685
- function Er(e) {
1686
- return e ? ["Submit", "SubmitRaw", "SubmitInvalid"].reduce((t, r) => {
1687
- const i = `on${r}`;
1688
- return i in e && typeof e[i] == "function" && (t[i] = e[i]), t;
1689
- }, {}) : {};
1690
- }
1691
- function Rr(e, n, t = {}) {
1692
- const r = Object.assign({}, de(Pt) || {}, t), i = ft(), s = Er(i == null ? void 0 : i.vnode.props), o = e.modelValue !== void 0, a = e.modelValue !== void 0 ? e.modelValue : J(n.attrs.value);
1693
- function m() {
1694
- const u = {
1695
- ...Q(e),
1696
- ...s
1697
- }, y = Ye(Q(n.attrs), Ce);
1698
- u.attrs = y;
1699
- const b = Je(Q(n.attrs), Ce);
1700
- for (const P in b)
1701
- u[oe(P)] = b[P];
1702
- const S = { props: {} };
1703
- return ut(S, e), Object.assign(u, S.props), typeof u.type != "string" && (u.definition = u.type, delete u.type), u;
1704
- }
1705
- const h = m(), _ = h.ignore ? null : e.parent || de(Ee, null), d = er(Te(r || {}, {
1706
- name: e.name || void 0,
1707
- value: a,
1708
- parent: _,
1709
- plugins: (r.plugins || []).concat(e.plugins),
1710
- config: e.config,
1711
- props: h,
1712
- index: e.index
1713
- }, !1, !0));
1714
- d.props.definition || U(600, d);
1715
- const w = ie(new Set(d.props.definition.props || []));
1716
- d.on("added-props", ({ payload: u }) => {
1717
- Array.isArray(u) && u.forEach((y) => w.value.add(y));
1718
- });
1719
- const g = At(() => Ce.concat([...w.value]).reduce((u, y) => (typeof y == "string" ? (u.push(oe(y)), u.push(dt(y))) : u.push(y), u), []));
1720
- Z(() => ut(d, e));
1721
- const $ = Q(e);
1722
- for (const u in $)
1723
- ce(() => e[u], () => {
1724
- e[u] !== void 0 && (d.props[u] = e[u]);
1725
- });
1726
- const c = /* @__PURE__ */ new Set(), f = Q(n.attrs);
1727
- Z(() => {
1728
- p(Je(f, g.value));
1729
- });
1730
- function p(u) {
1731
- c.forEach((y) => {
1732
- y(), c.delete(y);
1733
- });
1734
- for (const y in u) {
1735
- const b = oe(y);
1736
- c.add(ce(() => n.attrs[y], () => {
1737
- d.props[b] = n.attrs[y];
1738
- }));
1739
- }
1740
- }
1741
- if (Z(() => {
1742
- const u = Ye(Q(n.attrs), g.value);
1743
- d.props.attrs = Object.assign({}, d.props.attrs || {}, u);
1744
- }), Z(() => {
1745
- const u = e.errors.map((y) => _e({
1746
- key: mt(y),
1747
- type: "error",
1748
- value: y,
1749
- meta: { source: "prop" }
1750
- }));
1751
- d.store.apply(u, (y) => y.type === "error" && y.meta.source === "prop");
1752
- }), d.type !== "input") {
1753
- const u = `${d.name}-prop`;
1754
- Z(() => {
1755
- const y = Object.keys(e.inputErrors);
1756
- y.length || d.clearErrors(!0, u);
1757
- const b = y.reduce((S, P) => {
1758
- let I = e.inputErrors[P];
1759
- return typeof I == "string" && (I = [I]), Array.isArray(I) && (S[P] = I.map((M) => _e({
1760
- key: M,
1761
- type: "error",
1762
- value: M,
1763
- meta: { source: u }
1764
- }))), S;
1765
- }, {});
1766
- d.store.apply(b, (S) => S.type === "error" && S.meta.source === u);
1767
- });
1768
- }
1769
- Z(() => Object.assign(d.config, e.config)), d.type !== "input" && Et(Ee, d);
1770
- let v;
1771
- const k = /* @__PURE__ */ new WeakSet();
1772
- return d.on("modelUpdated", () => {
1773
- var u, y;
1774
- if (n.emit("inputRaw", (u = d.context) === null || u === void 0 ? void 0 : u.value, d), clearTimeout(v), v = setTimeout(n.emit, 20, "input", (y = d.context) === null || y === void 0 ? void 0 : y.value, d), o && d.context) {
1775
- const b = fe(d.context.value);
1776
- Ie(b) && fe(e.modelValue) !== b && k.add(b), n.emit("update:modelValue", b);
1777
- }
1778
- }), o && Or(Rt(e, "modelValue"), (u, y) => {
1779
- var b;
1780
- const S = fe(y);
1781
- if (Ie(S) && k.has(S))
1782
- return k.delete(S);
1783
- u.length ? (b = d.at(u)) === null || b === void 0 || b.input(y, !1) : d.input(y, !1);
1784
- }), jt(() => d.destroy()), d;
1785
- }
1786
- let jr = 1;
1787
- function Lr(e) {
1788
- return typeof e == "function" && e.length === 2 || typeof e == "object" && !Array.isArray(e) && !("$el" in e) && !("$cmp" in e) && !("if" in e);
1789
- }
1790
- function T(e, n = {}) {
1791
- const t = {
1792
- type: "input",
1793
- ...n
1794
- };
1795
- let r;
1796
- if (Lr(e)) {
1797
- const i = `SchemaComponent${jr++}`;
1798
- r = q("input", () => ({
1799
- $cmp: i,
1800
- props: {
1801
- context: "$node.context"
1802
- }
1803
- })), t.library = { [i]: Mt(e) };
1804
- } else
1805
- typeof e == "function" ? r = e : r = q("input", () => J(e));
1806
- return t.schema = dr(r || "Schema undefined"), t;
1807
- }
1808
- A({
1809
- name: "FormKitIcon",
1810
- props: {
1811
- icon: {
1812
- type: String,
1813
- default: ""
1814
- },
1815
- iconLoader: {
1816
- type: Function,
1817
- default: null
1818
- },
1819
- iconLoaderUrl: {
1820
- type: Function,
1821
- default: null
1822
- }
1823
- },
1824
- setup(e) {
1825
- var n, t;
1826
- const r = ie(void 0), i = de(Pt, {}), s = de(Ee, null);
1827
- let o;
1828
- if (e.iconLoader && typeof e.iconLoader == "function")
1829
- o = Se(e.iconLoader);
1830
- else if (s && ((n = s.props) === null || n === void 0 ? void 0 : n.iconLoader))
1831
- o = Se(s.props.iconLoader);
1832
- else if (e.iconLoaderUrl && typeof e.iconLoaderUrl == "function")
1833
- o = Se(o, e.iconLoaderUrl);
1834
- else {
1835
- const a = (t = i == null ? void 0 : i.plugins) === null || t === void 0 ? void 0 : t.find((m) => typeof m.iconHandler == "function");
1836
- a && (o = a.iconHandler);
1837
- }
1838
- if (o && typeof o == "function") {
1839
- const a = o(e.icon);
1840
- a instanceof Promise ? a.then((m) => {
1841
- r.value = m;
1842
- }) : r.value = a;
1843
- }
1844
- return () => r.value ? pe("span", {
1845
- class: "formkit-icon",
1846
- innerHTML: r.value
1847
- }) : null;
1848
- }
1849
- });
1850
- const Mr = /* @__PURE__ */ A({
1851
- __name: "PrimeCalendar",
1852
- props: {
1853
- context: Object
1854
- },
1855
- setup(e) {
1856
- const n = e, t = n.context;
1857
- function r(s) {
1858
- t == null || t.node.input(t == null ? void 0 : t._value);
1859
- }
1860
- function i(s) {
1861
- t == null || t.node.input(s);
1862
- }
1863
- return (s, o) => {
1864
- const a = L("Calendar");
1865
- return O(), W(a, {
1866
- modelValue: l(t)._value,
1867
- "onUpdate:modelValue": o[0] || (o[0] = (m) => l(t)._value = m),
1868
- id: n.context.id,
1869
- name: l(t).name,
1870
- class: F(l(t).attrs.class),
1871
- "date-format": l(t).attrs.dateFormat,
1872
- "show-icon": l(t).attrs.showIcon,
1873
- icon: l(t).attrs.icon,
1874
- onDateSelect: i,
1875
- onInput: r
1876
- }, null, 8, ["modelValue", "id", "name", "class", "date-format", "show-icon", "icon"]);
1877
- };
1878
- }
1879
- }), Tr = {
1880
- key: 0,
1881
- class: "formkit-prime-left"
1882
- }, Fr = {
1883
- key: 1,
1884
- class: "formkit-prime-right"
1885
- }, Dr = /* @__PURE__ */ A({
1886
- __name: "PrimeCheckBox",
1887
- props: {
1888
- context: Object
1889
- },
1890
- setup(e) {
1891
- const t = e.context;
1892
- function r(i) {
1893
- t == null || t.node.input(i);
1894
- }
1895
- return (i, s) => {
1896
- const o = L("Checkbox");
1897
- return O(), H(ct, null, [
1898
- l(t).attrs.labelLeft ? (O(), H("span", Tr, me(l(t).attrs.labelLeft), 1)) : G("", !0),
1899
- Le(o, {
1900
- modelValue: l(t)._value,
1901
- "onUpdate:modelValue": s[0] || (s[0] = (a) => l(t)._value = a),
1902
- id: l(t).id,
1903
- name: l(t).name,
1904
- class: F(l(t).attrs.class),
1905
- placeholder: l(t).attrs.placeholder,
1906
- binary: !0,
1907
- onInput: r
1908
- }, null, 8, ["modelValue", "id", "name", "class", "placeholder"]),
1909
- l(t).attrs.labelRight ? (O(), H("span", Fr, me(l(t).attrs.labelRight), 1)) : G("", !0)
1910
- ], 64);
1911
- };
1912
- }
1913
- }), Wr = /* @__PURE__ */ A({
1914
- __name: "PrimeChips",
1915
- props: {
1916
- context: Object
1917
- },
1918
- setup(e) {
1919
- const n = e, t = n.context;
1920
- function r(i) {
1921
- var s;
1922
- t == null || t.node.input((s = n.context) == null ? void 0 : s._value);
1923
- }
1924
- return (i, s) => {
1925
- var a, m, h;
1926
- const o = L("Chips");
1927
- return O(), W(o, {
1928
- modelValue: l(t)._value,
1929
- "onUpdate:modelValue": s[0] || (s[0] = (_) => l(t)._value = _),
1930
- id: l(t).id,
1931
- name: l(t).name,
1932
- class: F(l(t).attrs.class),
1933
- "allow-duplicate": (a = l(t).attrs.allowDuplicate) != null ? a : !0,
1934
- "add-on-blur": (m = l(t).attrs.addOnBlur) != null ? m : !1,
1935
- max: (h = l(t).attrs.max) != null ? h : void 0,
1936
- onAdd: r,
1937
- onRemove: r
1938
- }, null, 8, ["modelValue", "id", "name", "class", "allow-duplicate", "add-on-blur", "max"]);
1939
- };
1940
- }
1941
- }), Ur = /* @__PURE__ */ A({
1942
- __name: "PrimeColorPicker",
1943
- props: {
1944
- context: Object
1945
- },
1946
- setup(e) {
1947
- const n = e, t = n.context;
1948
- function r(i) {
1949
- var s;
1950
- t == null || t.node.input((s = n.context) == null ? void 0 : s._value);
1951
- }
1952
- return (i, s) => {
1953
- const o = L("ColorPicker");
1954
- return O(), W(o, {
1955
- id: l(t).id,
1956
- modelValue: l(t)._value,
1957
- "onUpdate:modelValue": s[0] || (s[0] = (a) => l(t)._value = a),
1958
- name: l(t).name,
1959
- class: F(l(t).attrs.class),
1960
- inline: !1,
1961
- "default-color": l(t).attrs.defaultColor,
1962
- onChange: r
1963
- }, null, 8, ["id", "modelValue", "name", "class", "default-color"]);
1964
- };
1965
- }
1966
- }), Kr = /* @__PURE__ */ A({
1967
- __name: "PrimeDropdown",
1968
- props: {
1969
- context: Object
1970
- },
1971
- setup(e) {
1972
- const t = e.context;
1973
- function r(s) {
1974
- t == null || t.handlers.blur(s.value);
1975
- }
1976
- function i(s) {
1977
- t == null || t.node.input(s.value);
1978
- }
1979
- return (s, o) => {
1980
- var m, h, _, d, w, g, $, c, f, p;
1981
- const a = L("Dropdown");
1982
- return O(), W(a, {
1983
- id: l(t).id,
1984
- modelValue: l(t)._value,
1985
- "onUpdate:modelValue": o[0] || (o[0] = (v) => l(t)._value = v),
1986
- name: l(t).name,
1987
- class: F(l(t).attrs.class),
1988
- options: (h = (m = l(t)) == null ? void 0 : m.attrs) == null ? void 0 : h.options,
1989
- "option-label": (w = (d = (_ = l(t)) == null ? void 0 : _.attrs) == null ? void 0 : d.optionLabel) != null ? w : "label",
1990
- "option-value": (c = ($ = (g = l(t)) == null ? void 0 : g.attrs) == null ? void 0 : $.optionValue) != null ? c : "value",
1991
- placeholder: l(t).attrs.placeholder,
1992
- filter: (f = l(t).attrs.filter) != null ? f : !1,
1993
- "show-clear": (p = l(t).attrs.showClear) != null ? p : !1,
1994
- onChange: i,
1995
- onBlur: r
1996
- }, null, 8, ["id", "modelValue", "name", "class", "options", "option-label", "option-value", "placeholder", "filter", "show-clear"]);
1997
- };
1998
- }
1999
- }), qr = /* @__PURE__ */ A({
2000
- __name: "PrimeEditor",
2001
- props: {
2002
- context: Object
2003
- },
2004
- setup(e) {
2005
- const t = e.context;
2006
- function r(s) {
2007
- t == null || t.node.input(s.htmlValue);
2008
- }
2009
- function i(s) {
2010
- s.range === null && (t == null || t.handlers.blur(s.htmlValue));
2011
- }
2012
- return (s, o) => {
2013
- const a = L("Editor");
2014
- return O(), W(a, {
2015
- modelValue: l(t)._value,
2016
- "onUpdate:modelValue": o[0] || (o[0] = (m) => l(t)._value = m),
2017
- id: l(t).id,
2018
- name: l(t).name,
2019
- class: F(l(t).attrs.class),
2020
- placeholder: l(t).attrs.placeholder,
2021
- onTextChange: r,
2022
- onSelectionChange: i
2023
- }, null, 8, ["modelValue", "id", "name", "class", "placeholder"]);
2024
- };
2025
- }
2026
- }), Br = /* @__PURE__ */ A({
2027
- __name: "PrimeInputMask",
2028
- props: {
2029
- context: Object
2030
- },
2031
- setup(e) {
2032
- const n = e, t = n.context;
2033
- function r(i) {
2034
- var s, o;
2035
- t == null || t.node.input((s = n.context) == null ? void 0 : s._value), t == null || t.handlers.blur((o = n.context) == null ? void 0 : o._value);
2036
- }
2037
- return (i, s) => {
2038
- var a, m, h, _;
2039
- const o = L("InputMask");
2040
- return O(), W(o, {
2041
- modelValue: l(t)._value,
2042
- "onUpdate:modelValue": s[0] || (s[0] = (d) => l(t)._value = d),
2043
- id: l(t).id,
2044
- name: l(t).name,
2045
- class: F(l(t).attrs.class),
2046
- placeholder: l(t).attrs.placeholder,
2047
- mask: (a = l(t).attrs.mask) != null ? a : void 0,
2048
- "slot-char": (m = l(t).attrs.slotChar) != null ? m : "_",
2049
- "auto-clear": (h = l(t).attrs.autoClear) != null ? h : !0,
2050
- unmask: (_ = l(t).attrs.unmask) != null ? _ : !1,
2051
- onBlur: r
2052
- }, null, 8, ["modelValue", "id", "name", "class", "placeholder", "mask", "slot-char", "auto-clear", "unmask"]);
2053
- };
2054
- }
2055
- }), zr = /* @__PURE__ */ A({
2056
- __name: "PrimeInputNumber",
2057
- props: {
2058
- context: Object
2059
- },
2060
- setup(e) {
2061
- const t = e.context;
2062
- function r(s) {
2063
- t == null || t.handlers.blur(s.value);
2064
- }
2065
- function i(s) {
2066
- t == null || t.node.input(s.value);
2067
- }
2068
- return (s, o) => {
2069
- var m, h, _, d, w, g, $, c, f, p, v;
2070
- const a = L("InputNumber");
2071
- return O(), W(a, {
2072
- modelValue: l(t)._value,
2073
- "onUpdate:modelValue": o[0] || (o[0] = (k) => l(t)._value = k),
2074
- id: l(t).id,
2075
- name: l(t).name,
2076
- placeholder: l(t).attrs.placeholder,
2077
- class: F(l(t).attrs.class),
2078
- "use-grouping": (m = l(t).attrs.useGrouping) != null ? m : !0,
2079
- "min-fraction-digits": (h = l(t).attrs.minFractionDigits) != null ? h : void 0,
2080
- "max-fraction-digits": (_ = l(t).attrs.maxFractionDigits) != null ? _ : void 0,
2081
- locale: (d = l(t).attrs.locale) != null ? d : void 0,
2082
- mode: (w = l(t).attrs.mode) != null ? w : void 0,
2083
- currency: (g = l(t).attrs.currency) != null ? g : void 0,
2084
- prefix: ($ = l(t).attrs.prefix) != null ? $ : void 0,
2085
- suffix: (c = l(t).attrs.suffix) != null ? c : void 0,
2086
- "show-buttons": (f = l(t).attrs.showButtons) != null ? f : void 0,
2087
- "button-layout": (p = l(t).attrs.buttonLayout) != null ? p : "stacked",
2088
- step: (v = l(t).attrs.step) != null ? v : void 0,
2089
- onInput: i,
2090
- onBlur: r
2091
- }, null, 8, ["modelValue", "id", "name", "placeholder", "class", "use-grouping", "min-fraction-digits", "max-fraction-digits", "locale", "mode", "currency", "prefix", "suffix", "show-buttons", "button-layout", "step"]);
2092
- };
2093
- }
2094
- }), Nr = {
2095
- key: 0,
2096
- class: "formkit-prime-left"
2097
- }, Hr = {
2098
- key: 1,
2099
- class: "formkit-prime-right"
2100
- }, Zr = /* @__PURE__ */ A({
2101
- __name: "PrimeInputSwitch",
2102
- props: {
2103
- context: Object
2104
- },
2105
- setup(e) {
2106
- const n = e, t = n.context;
2107
- function r(i) {
2108
- var s;
2109
- t == null || t.node.input((s = n.context) == null ? void 0 : s._value);
2110
- }
2111
- return (i, s) => {
2112
- var a, m;
2113
- const o = L("InputSwitch");
2114
- return O(), H(ct, null, [
2115
- l(t).attrs.labelLeft ? (O(), H("span", Nr, me(l(t).attrs.labelLeft), 1)) : G("", !0),
2116
- Le(o, {
2117
- modelValue: l(t)._value,
2118
- "onUpdate:modelValue": s[0] || (s[0] = (h) => l(t)._value = h),
2119
- id: l(t).id,
2120
- name: l(t).name,
2121
- class: F(l(t).attrs.class),
2122
- "true-value": (a = l(t).attrs.trueValue) != null ? a : void 0,
2123
- "false-value": (m = l(t).attrs.falseValue) != null ? m : void 0,
2124
- onInput: r
2125
- }, null, 8, ["modelValue", "id", "name", "class", "true-value", "false-value"]),
2126
- l(t).attrs.labelRight ? (O(), H("span", Hr, me(l(t).attrs.labelRight), 1)) : G("", !0)
2127
- ], 64);
2128
- };
2129
- }
2130
- }), Yr = /* @__PURE__ */ A({
2131
- __name: "PrimeInputText",
2132
- props: {
2133
- context: Object
2134
- },
2135
- setup(e) {
2136
- const t = e.context, r = () => (t == null ? void 0 : t.iconLeft) && (t == null ? void 0 : t.iconLeft.length) > 0, i = () => (t == null ? void 0 : t.iconRight) && (t == null ? void 0 : t.iconRight.length) > 0, s = () => {
2137
- let m = "";
2138
- return r() && (m = `${m}p-input-icon-left `), i() && (m = `${m}p-input-icon-right `), m;
2139
- };
2140
- function o(m) {
2141
- t == null || t.handlers.blur(m.target.value);
2142
- }
2143
- function a(m) {
2144
- t == null || t.node.input(m.target.value);
2145
- }
2146
- return (m, h) => {
2147
- const _ = L("InputText");
2148
- return O(), H("span", {
2149
- class: F(s())
2150
- }, [
2151
- r() ? (O(), H("i", {
2152
- key: 0,
2153
- class: F(l(t).iconLeft)
2154
- }, null, 2)) : G("", !0),
2155
- Le(_, {
2156
- modelValue: l(t)._value,
2157
- "onUpdate:modelValue": h[0] || (h[0] = (d) => l(t)._value = d),
2158
- id: l(t).id,
2159
- name: l(t).name,
2160
- class: F(l(t).attrs.class),
2161
- placeholder: l(t).attrs.placeholder,
2162
- onInput: a,
2163
- onBlur: o
2164
- }, null, 8, ["modelValue", "id", "name", "class", "placeholder"]),
2165
- i ? (O(), H("i", {
2166
- key: 1,
2167
- class: F(l(t).iconRight)
2168
- }, null, 2)) : G("", !0)
2169
- ], 2);
2170
- };
2171
- }
2172
- }), Jr = /* @__PURE__ */ A({
2173
- __name: "PrimeInputTextArea",
2174
- props: {
2175
- context: Object
2176
- },
2177
- setup(e) {
2178
- const t = e.context;
2179
- function r(s) {
2180
- t == null || t.handlers.blur(s.target.value);
2181
- }
2182
- function i(s) {
2183
- t == null || t.node.input(s.target.value);
2184
- }
2185
- return (s, o) => {
2186
- var m;
2187
- const a = L("Textarea");
2188
- return O(), W(a, {
2189
- modelValue: l(t)._value,
2190
- "onUpdate:modelValue": o[0] || (o[0] = (h) => l(t)._value = h),
2191
- id: l(t).id,
2192
- name: l(t).name,
2193
- class: F(l(t).attrs.class),
2194
- placeholder: l(t).attrs.placeholder,
2195
- rows: (m = l(t).rows) != null ? m : 3,
2196
- onInput: i,
2197
- onBlur: r
2198
- }, null, 8, ["modelValue", "id", "name", "class", "placeholder", "rows"]);
2199
- };
2200
- }
2201
- }), Qr = /* @__PURE__ */ A({
2202
- __name: "PrimeKnob",
2203
- props: {
2204
- context: Object
2205
- },
2206
- setup(e) {
2207
- const t = e.context;
2208
- function r(i) {
2209
- t == null || t.node.input(i), t == null || t.handlers.blur(i);
2210
- }
2211
- return (i, s) => {
2212
- var a, m, h, _, d, w, g, $, c, f;
2213
- const o = L("Knob");
2214
- return O(), W(o, {
2215
- modelValue: l(t)._value,
2216
- "onUpdate:modelValue": s[0] || (s[0] = (p) => l(t)._value = p),
2217
- id: l(t).id,
2218
- name: l(t).name,
2219
- min: (a = l(t).attrs.min) != null ? a : 0,
2220
- max: (m = l(t).attrs.max) != null ? m : 100,
2221
- step: (h = l(t).attrs.step) != null ? h : void 0,
2222
- size: (_ = l(t).attrs.max) != null ? _ : 100,
2223
- "stroke-width": (d = l(t).attrs.strokeWidth) != null ? d : 14,
2224
- "show-value": (w = l(t).attrs.showValue) != null ? w : !0,
2225
- "value-color": (g = l(t).attrs.valueColor) != null ? g : void 0,
2226
- "range-color": ($ = l(t).attrs.rangeColor) != null ? $ : void 0,
2227
- "text-color": (c = l(t).attrs.textColor) != null ? c : void 0,
2228
- "value-template": (f = l(t).attrs.valueTemplate) != null ? f : void 0,
2229
- onChange: r
2230
- }, null, 8, ["modelValue", "id", "name", "min", "max", "step", "size", "stroke-width", "show-value", "value-color", "range-color", "text-color", "value-template"]);
2231
- };
2232
- }
2233
- }), Gr = /* @__PURE__ */ A({
2234
- __name: "PrimeMultiSelect",
2235
- props: {
2236
- context: Object
2237
- },
2238
- setup(e) {
2239
- const n = e, t = n.context;
2240
- function r(i) {
2241
- var s;
2242
- t == null || t.node.input((s = n.context) == null ? void 0 : s._value);
2243
- }
2244
- return (i, s) => {
2245
- var a, m, h, _, d, w, g, $, c;
2246
- const o = L("MultiSelect");
2247
- return O(), W(o, {
2248
- id: l(t).id,
2249
- modelValue: l(t)._value,
2250
- "onUpdate:modelValue": s[0] || (s[0] = (f) => l(t)._value = f),
2251
- name: l(t).name,
2252
- class: F(l(t).attrs.class),
2253
- options: (m = (a = l(t)) == null ? void 0 : a.attrs) == null ? void 0 : m.options,
2254
- "option-label": (d = (_ = (h = l(t)) == null ? void 0 : h.attrs) == null ? void 0 : _.optionLabel) != null ? d : "label",
2255
- "option-value": ($ = (g = (w = l(t)) == null ? void 0 : w.attrs) == null ? void 0 : g.optionValue) != null ? $ : "value",
2256
- placeholder: l(t).attrs.placeholder,
2257
- filter: (c = l(t).attrs.filter) != null ? c : !1,
2258
- onChange: r
2259
- }, null, 8, ["id", "modelValue", "name", "class", "options", "option-label", "option-value", "placeholder", "filter"]);
2260
- };
2261
- }
2262
- }), Xr = /* @__PURE__ */ A({
2263
- __name: "PrimeListbox",
2264
- props: {
2265
- context: Object
2266
- },
2267
- setup(e) {
2268
- const n = e, t = n.context;
2269
- function r(i) {
2270
- var s;
2271
- t == null || t.node.input((s = n.context) == null ? void 0 : s._value);
2272
- }
2273
- return (i, s) => {
2274
- var a, m, h, _, d, w, g, $, c, f;
2275
- const o = L("Listbox");
2276
- return O(), W(o, {
2277
- id: l(t).id,
2278
- modelValue: l(t)._value,
2279
- "onUpdate:modelValue": s[0] || (s[0] = (p) => l(t)._value = p),
2280
- name: l(t).name,
2281
- class: F(l(t).attrs.class),
2282
- style: Ft(l(t).attrs.style),
2283
- "list-style": l(t).attrs.listStyle,
2284
- options: (m = (a = l(t)) == null ? void 0 : a.attrs) == null ? void 0 : m.options,
2285
- "option-label": (d = (_ = (h = l(t)) == null ? void 0 : h.attrs) == null ? void 0 : _.optionLabel) != null ? d : "label",
2286
- "option-value": ($ = (g = (w = l(t)) == null ? void 0 : w.attrs) == null ? void 0 : g.optionValue) != null ? $ : "value",
2287
- "filter-placeholder": l(t).attrs.filterPlaceholder,
2288
- filter: (c = l(t).attrs.filter) != null ? c : !1,
2289
- multiple: (f = l(t).attrs.multiple) != null ? f : !1,
2290
- onChange: r
2291
- }, null, 8, ["id", "modelValue", "name", "class", "style", "list-style", "options", "option-label", "option-value", "filter-placeholder", "filter", "multiple"]);
2292
- };
2293
- }
2294
- }), ei = /* @__PURE__ */ A({
2295
- __name: "PrimePassword",
2296
- props: {
2297
- context: Object
2298
- },
2299
- setup(e) {
2300
- const t = e.context;
2301
- function r(s) {
2302
- t == null || t.handlers.blur(s.target.value);
2303
- }
2304
- function i(s) {
2305
- t == null || t.node.input(s.target.value);
2306
- }
2307
- return (s, o) => {
2308
- var m, h, _, d;
2309
- const a = L("Password");
2310
- return O(), W(a, {
2311
- modelValue: l(t)._value,
2312
- "onUpdate:modelValue": o[0] || (o[0] = (w) => l(t)._value = w),
2313
- id: l(t).id,
2314
- name: l(t).name,
2315
- class: F(l(t).attrs.class),
2316
- placeholder: l(t).attrs.placeholder,
2317
- feedback: (h = (m = l(t)) == null ? void 0 : m.feedback) != null ? h : !0,
2318
- "toggle-mask": (d = (_ = l(t)) == null ? void 0 : _.toggleMask) != null ? d : !1,
2319
- onInput: i,
2320
- onBlur: r
2321
- }, null, 8, ["modelValue", "id", "name", "class", "placeholder", "feedback", "toggle-mask"]);
2322
- };
2323
- }
2324
- }), ti = /* @__PURE__ */ A({
2325
- __name: "PrimeRating",
2326
- props: {
2327
- context: Object
2328
- },
2329
- setup(e) {
2330
- const n = e, t = n.context;
2331
- function r(i) {
2332
- var s;
2333
- t == null || t.node.input((s = n.context) == null ? void 0 : s._value);
2334
- }
2335
- return (i, s) => {
2336
- var a, m, h, _;
2337
- const o = L("Rating");
2338
- return O(), W(o, {
2339
- modelValue: l(t)._value,
2340
- "onUpdate:modelValue": s[0] || (s[0] = (d) => l(t)._value = d),
2341
- id: l(t).id,
2342
- name: l(t).name,
2343
- disabled: (a = l(t).attrs.disabled) != null ? a : !1,
2344
- readonly: (m = l(t).attrs.readonly) != null ? m : !1,
2345
- stars: (h = l(t).attrs.stars) != null ? h : 5,
2346
- cancel: (_ = l(t).attrs.cancel) != null ? _ : !1,
2347
- onChange: r
2348
- }, null, 8, ["modelValue", "id", "name", "disabled", "readonly", "stars", "cancel"]);
2349
- };
2350
- }
2351
- }), ni = /* @__PURE__ */ A({
2352
- __name: "PrimeSlider",
2353
- props: {
2354
- context: Object
2355
- },
2356
- setup(e) {
2357
- const t = e.context;
2358
- function r(i) {
2359
- t == null || t.node.input(i), t == null || t.handlers.blur(i);
2360
- }
2361
- return (i, s) => {
2362
- var a, m, h, _;
2363
- const o = L("Slider");
2364
- return O(), W(o, {
2365
- modelValue: l(t)._value,
2366
- "onUpdate:modelValue": s[0] || (s[0] = (d) => l(t)._value = d),
2367
- id: l(t).id,
2368
- name: l(t).name,
2369
- min: (a = l(t).attrs.min) != null ? a : 0,
2370
- max: (m = l(t).attrs.max) != null ? m : 100,
2371
- step: (h = l(t).attrs.step) != null ? h : void 0,
2372
- range: (_ = l(t).attrs.range) != null ? _ : !1,
2373
- onChange: r
2374
- }, null, 8, ["modelValue", "id", "name", "min", "max", "step", "range"]);
2375
- };
2376
- }
2377
- }), ri = /* @__PURE__ */ A({
2378
- __name: "PrimeToggleButton",
2379
- props: {
2380
- context: Object
2381
- },
2382
- setup(e) {
2383
- const n = e, t = n.context;
2384
- function r(i) {
2385
- var s;
2386
- t == null || t.node.input((s = n.context) == null ? void 0 : s._value);
2387
- }
2388
- return (i, s) => {
2389
- var a, m, h, _;
2390
- const o = L("ToggleButton");
2391
- return O(), W(o, {
2392
- id: l(t).id,
2393
- modelValue: l(t)._value,
2394
- "onUpdate:modelValue": s[0] || (s[0] = (d) => l(t)._value = d),
2395
- "input-class": l(t).attrs.inputClass,
2396
- "input-style": l(t).attrs.inputStyle,
2397
- "on-label": (a = l(t).attrs.onLabel) != null ? a : "Yes",
2398
- "off-label": (m = l(t).attrs.offLabel) != null ? m : "No",
2399
- "on-icon": (h = l(t).attrs.onIcon) != null ? h : "pi pi-check",
2400
- "off-icon": (_ = l(t).attrs.offIcon) != null ? _ : "pi pi-times",
2401
- onChange: r
2402
- }, null, 8, ["id", "modelValue", "input-class", "input-style", "on-label", "off-label", "on-icon", "off-icon"]);
2403
- };
2404
- }
2405
- }), ii = T(Yr, {
2406
- props: ["iconRight", "iconLeft"]
2407
- }), si = T(zr, {
2408
- props: ["iconRight", "iconLeft"]
2409
- }), oi = T(Br, {
2410
- props: []
2411
- }), li = T(ei, {
2412
- props: ["feedback", "toggleMask"]
2413
- }), ai = T(Jr, {
2414
- props: ["rows"]
2415
- }), ui = T(Dr, {
2416
- props: []
2417
- }), fi = T(Zr, {
2418
- props: []
2419
- }), ci = T(qr, {
2420
- props: []
2421
- }), pi = T(Kr, {
2422
- props: []
2423
- }), di = T(Gr, {
2424
- props: []
2425
- }), mi = T(Xr, {
2426
- props: []
2427
- }), yi = T(Mr, {
2428
- props: []
2429
- }), hi = T(ni, {
2430
- props: []
2431
- }), _i = T(ti, {
2432
- props: []
2433
- }), gi = T(Wr, {
2434
- props: []
2435
- }), vi = T(Qr, {
2436
- props: []
2437
- }), bi = T(Ur, {
2438
- props: []
2439
- }), $i = T(ri, {
2440
- props: []
2441
- }), Si = {
2442
- primeInputText: ii,
2443
- primeInputNumber: si,
2444
- primeInputMask: oi,
2445
- primePassword: li,
2446
- primeCheckBox: ui,
2447
- primeInputSwitch: fi,
2448
- primeInputTextArea: ai,
2449
- primeEditor: ci,
2450
- primeDropdown: pi,
2451
- primeMultiSelect: di,
2452
- primeCalendar: yi,
2453
- primeSlider: hi,
2454
- primeChips: gi,
2455
- primeKnob: vi,
2456
- primeRating: _i,
2457
- primeColorPicker: bi,
2458
- primeToggleButton: $i,
2459
- primeListbox: mi
2460
- };
2461
- export {
2462
- yi as primeCalendarDefinition,
2463
- ui as primeCheckBoxDefinition,
2464
- gi as primeChipsDefinition,
2465
- bi as primeColorPickerDefinition,
2466
- pi as primeDropdownDefinition,
2467
- ci as primeEditorDefinition,
2468
- oi as primeInputMaskDefinition,
2469
- si as primeInputNumberDefinition,
2470
- fi as primeInputSwitchDefinition,
2471
- ai as primeInputTextAreaDefinition,
2472
- ii as primeInputTextDefinition,
2473
- Si as primeInputs,
2474
- vi as primeKnobDefinition,
2475
- mi as primeListboxDefinition,
2476
- di as primeMultiSelectDefinition,
2477
- li as primePasswordDefinition,
2478
- _i as primeRatingDefinition,
2479
- hi as primeSliderDefinition,
2480
- $i as primeToggleButtonDefinition
2481
- };