mlform 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.
Files changed (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +132 -0
  3. package/dist/FieldStrategy-pPekBtH-.js +2318 -0
  4. package/dist/ModelTypes-B9_veCKB.js +5 -0
  5. package/dist/ReportStrategy-DY3GC_mJ.js +23 -0
  6. package/dist/boolean-field-Cd3uhIPj.js +104 -0
  7. package/dist/category-field-D_Ms1x9u.js +73 -0
  8. package/dist/classifier-prediction-C5QzorTo.js +193 -0
  9. package/dist/custom-element-ttkHUa8w.js +13 -0
  10. package/dist/date-field-Cg_ja679.js +162 -0
  11. package/dist/error-card-BwjPChwf.js +195 -0
  12. package/dist/field-wrapper-DqIQl76d.js +177 -0
  13. package/dist/ml-layout-Dx63KKf7.js +332 -0
  14. package/dist/mlform/extensions.mjs +38 -0
  15. package/dist/mlform/strategies.mjs +292 -0
  16. package/dist/mlform.mjs +709 -0
  17. package/dist/number-field-CC2DrVEb.js +165 -0
  18. package/dist/property-jKFNMQpR.js +561 -0
  19. package/dist/range-field-Cr7LEtsJ.js +98 -0
  20. package/dist/regressor-prediction-C18dHlfK.js +236 -0
  21. package/dist/src/core/app/DescriptorItem.d.ts +6 -0
  22. package/dist/src/core/app/DescriptorRegistry.d.ts +13 -0
  23. package/dist/src/core/app/DescriptorService.d.ts +22 -0
  24. package/dist/src/core/app/DescriptorStrategy.d.ts +11 -0
  25. package/dist/src/core/app/index.d.ts +4 -0
  26. package/dist/src/core/domain/index.d.ts +24 -0
  27. package/dist/src/core/index.d.ts +3 -0
  28. package/dist/src/core/ui/error-card.d.ts +38 -0
  29. package/dist/src/core/ui/field-wrapper.d.ts +23 -0
  30. package/dist/src/core/ui/index.d.ts +3 -0
  31. package/dist/src/core/ui/ml-layout.d.ts +23 -0
  32. package/dist/src/extensions/app/FieldStrategy.d.ts +10 -0
  33. package/dist/src/extensions/app/ReportStrategy.d.ts +9 -0
  34. package/dist/src/extensions/app/index.d.ts +2 -0
  35. package/dist/src/extensions/domain/BaseField.d.ts +7 -0
  36. package/dist/src/extensions/domain/BaseModel.d.ts +6 -0
  37. package/dist/src/extensions/domain/index.d.ts +2 -0
  38. package/dist/src/extensions/index.d.ts +3 -0
  39. package/dist/src/extensions/ui/field-element.d.ts +9 -0
  40. package/dist/src/extensions/ui/index.d.ts +1 -0
  41. package/dist/src/index.d.ts +1 -0
  42. package/dist/src/mlform/index.d.ts +1 -0
  43. package/dist/src/mlform/mlform.d.ts +27 -0
  44. package/dist/src/mlform/mlform.types.d.ts +11 -0
  45. package/dist/src/strategies/app/BooleanStrategy.d.ts +12 -0
  46. package/dist/src/strategies/app/CategoryStrategy.d.ts +13 -0
  47. package/dist/src/strategies/app/ClassifierStrategy.d.ts +15 -0
  48. package/dist/src/strategies/app/DateStrategy.d.ts +15 -0
  49. package/dist/src/strategies/app/NumberStrategy.d.ts +29 -0
  50. package/dist/src/strategies/app/RegressorStrategy.d.ts +15 -0
  51. package/dist/src/strategies/app/TextStrategy.d.ts +16 -0
  52. package/dist/src/strategies/app/index.d.ts +7 -0
  53. package/dist/src/strategies/domain/BooleanField.d.ts +10 -0
  54. package/dist/src/strategies/domain/CategoryField.d.ts +11 -0
  55. package/dist/src/strategies/domain/ClassifierModel.d.ts +11 -0
  56. package/dist/src/strategies/domain/DateField.d.ts +13 -0
  57. package/dist/src/strategies/domain/FieldTypes.d.ts +7 -0
  58. package/dist/src/strategies/domain/ModelTypes.d.ts +4 -0
  59. package/dist/src/strategies/domain/NumberField.d.ts +15 -0
  60. package/dist/src/strategies/domain/RegressorModel.d.ts +11 -0
  61. package/dist/src/strategies/domain/TextField.d.ts +14 -0
  62. package/dist/src/strategies/domain/index.d.ts +9 -0
  63. package/dist/src/strategies/index.d.ts +1 -0
  64. package/dist/src/strategies/ui/boolean-field.d.ts +13 -0
  65. package/dist/src/strategies/ui/category-field.d.ts +14 -0
  66. package/dist/src/strategies/ui/classifier-prediction.d.ts +39 -0
  67. package/dist/src/strategies/ui/date-field.d.ts +18 -0
  68. package/dist/src/strategies/ui/index.d.ts +8 -0
  69. package/dist/src/strategies/ui/number-field.d.ts +19 -0
  70. package/dist/src/strategies/ui/range-field.d.ts +17 -0
  71. package/dist/src/strategies/ui/regressor-prediction.d.ts +29 -0
  72. package/dist/src/strategies/ui/text-field.d.ts +17 -0
  73. package/dist/state-CLlTRyl1.js +12 -0
  74. package/dist/test/_fixtures/DummyField.d.ts +9 -0
  75. package/dist/test/setup.d.ts +1 -0
  76. package/dist/test/unit/DummyField.test.d.ts +1 -0
  77. package/dist/text-field-DwP-Fa1w.js +114 -0
  78. package/package.json +57 -0
@@ -0,0 +1,561 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const x = globalThis, k = x.ShadowRoot && (x.ShadyCSS === void 0 || x.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, j = Symbol(), I = /* @__PURE__ */ new WeakMap();
7
+ let X = class {
8
+ constructor(t, e, s) {
9
+ if (this._$cssResult$ = !0, s !== j) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ this.cssText = t, this.t = e;
11
+ }
12
+ get styleSheet() {
13
+ let t = this.o;
14
+ const e = this.t;
15
+ if (k && t === void 0) {
16
+ const s = e !== void 0 && e.length === 1;
17
+ s && (t = I.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && I.set(e, t));
18
+ }
19
+ return t;
20
+ }
21
+ toString() {
22
+ return this.cssText;
23
+ }
24
+ };
25
+ const it = (r) => new X(typeof r == "string" ? r : r + "", void 0, j), Ut = (r, ...t) => {
26
+ const e = r.length === 1 ? r[0] : t.reduce((s, i, n) => s + ((o) => {
27
+ if (o._$cssResult$ === !0) return o.cssText;
28
+ if (typeof o == "number") return o;
29
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
30
+ })(i) + r[n + 1], r[0]);
31
+ return new X(e, r, j);
32
+ }, rt = (r, t) => {
33
+ if (k) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
34
+ else for (const e of t) {
35
+ const s = document.createElement("style"), i = x.litNonce;
36
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
37
+ }
38
+ }, q = k ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
39
+ let e = "";
40
+ for (const s of t.cssRules) e += s.cssText;
41
+ return it(e);
42
+ })(r) : r;
43
+ /**
44
+ * @license
45
+ * Copyright 2017 Google LLC
46
+ * SPDX-License-Identifier: BSD-3-Clause
47
+ */
48
+ const { is: nt, defineProperty: ot, getOwnPropertyDescriptor: ht, getOwnPropertyNames: at, getOwnPropertySymbols: lt, getPrototypeOf: ct } = Object, T = globalThis, V = T.trustedTypes, dt = V ? V.emptyScript : "", pt = T.reactiveElementPolyfillSupport, S = (r, t) => r, M = { toAttribute(r, t) {
49
+ switch (t) {
50
+ case Boolean:
51
+ r = r ? dt : null;
52
+ break;
53
+ case Object:
54
+ case Array:
55
+ r = r == null ? r : JSON.stringify(r);
56
+ }
57
+ return r;
58
+ }, fromAttribute(r, t) {
59
+ let e = r;
60
+ switch (t) {
61
+ case Boolean:
62
+ e = r !== null;
63
+ break;
64
+ case Number:
65
+ e = r === null ? null : Number(r);
66
+ break;
67
+ case Object:
68
+ case Array:
69
+ try {
70
+ e = JSON.parse(r);
71
+ } catch {
72
+ e = null;
73
+ }
74
+ }
75
+ return e;
76
+ } }, D = (r, t) => !nt(r, t), W = { attribute: !0, type: String, converter: M, reflect: !1, useDefault: !1, hasChanged: D };
77
+ Symbol.metadata ??= Symbol("metadata"), T.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
78
+ let g = class extends HTMLElement {
79
+ static addInitializer(t) {
80
+ this._$Ei(), (this.l ??= []).push(t);
81
+ }
82
+ static get observedAttributes() {
83
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
+ }
85
+ static createProperty(t, e = W) {
86
+ if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
87
+ const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
88
+ i !== void 0 && ot(this.prototype, t, i);
89
+ }
90
+ }
91
+ static getPropertyDescriptor(t, e, s) {
92
+ const { get: i, set: n } = ht(this.prototype, t) ?? { get() {
93
+ return this[e];
94
+ }, set(o) {
95
+ this[e] = o;
96
+ } };
97
+ return { get: i, set(o) {
98
+ const a = i?.call(this);
99
+ n?.call(this, o), this.requestUpdate(t, a, s);
100
+ }, configurable: !0, enumerable: !0 };
101
+ }
102
+ static getPropertyOptions(t) {
103
+ return this.elementProperties.get(t) ?? W;
104
+ }
105
+ static _$Ei() {
106
+ if (this.hasOwnProperty(S("elementProperties"))) return;
107
+ const t = ct(this);
108
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
109
+ }
110
+ static finalize() {
111
+ if (this.hasOwnProperty(S("finalized"))) return;
112
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(S("properties"))) {
113
+ const e = this.properties, s = [...at(e), ...lt(e)];
114
+ for (const i of s) this.createProperty(i, e[i]);
115
+ }
116
+ const t = this[Symbol.metadata];
117
+ if (t !== null) {
118
+ const e = litPropertyMetadata.get(t);
119
+ if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
120
+ }
121
+ this._$Eh = /* @__PURE__ */ new Map();
122
+ for (const [e, s] of this.elementProperties) {
123
+ const i = this._$Eu(e, s);
124
+ i !== void 0 && this._$Eh.set(i, e);
125
+ }
126
+ this.elementStyles = this.finalizeStyles(this.styles);
127
+ }
128
+ static finalizeStyles(t) {
129
+ const e = [];
130
+ if (Array.isArray(t)) {
131
+ const s = new Set(t.flat(1 / 0).reverse());
132
+ for (const i of s) e.unshift(q(i));
133
+ } else t !== void 0 && e.push(q(t));
134
+ return e;
135
+ }
136
+ static _$Eu(t, e) {
137
+ const s = e.attribute;
138
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
139
+ }
140
+ constructor() {
141
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
142
+ }
143
+ _$Ev() {
144
+ this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
145
+ }
146
+ addController(t) {
147
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
148
+ }
149
+ removeController(t) {
150
+ this._$EO?.delete(t);
151
+ }
152
+ _$E_() {
153
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
154
+ for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
155
+ t.size > 0 && (this._$Ep = t);
156
+ }
157
+ createRenderRoot() {
158
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
159
+ return rt(t, this.constructor.elementStyles), t;
160
+ }
161
+ connectedCallback() {
162
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
163
+ }
164
+ enableUpdating(t) {
165
+ }
166
+ disconnectedCallback() {
167
+ this._$EO?.forEach((t) => t.hostDisconnected?.());
168
+ }
169
+ attributeChangedCallback(t, e, s) {
170
+ this._$AK(t, s);
171
+ }
172
+ _$ET(t, e) {
173
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
174
+ if (i !== void 0 && s.reflect === !0) {
175
+ const n = (s.converter?.toAttribute !== void 0 ? s.converter : M).toAttribute(e, s.type);
176
+ this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
177
+ }
178
+ }
179
+ _$AK(t, e) {
180
+ const s = this.constructor, i = s._$Eh.get(t);
181
+ if (i !== void 0 && this._$Em !== i) {
182
+ const n = s.getPropertyOptions(i), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : M;
183
+ this._$Em = i;
184
+ const a = o.fromAttribute(e, n.type);
185
+ this[i] = a ?? this._$Ej?.get(i) ?? a, this._$Em = null;
186
+ }
187
+ }
188
+ requestUpdate(t, e, s) {
189
+ if (t !== void 0) {
190
+ const i = this.constructor, n = this[t];
191
+ if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? D)(n, e) || s.useDefault && s.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
192
+ this.C(t, e, s);
193
+ }
194
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
195
+ }
196
+ C(t, e, { useDefault: s, reflect: i, wrapped: n }, o) {
197
+ s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
198
+ }
199
+ async _$EP() {
200
+ this.isUpdatePending = !0;
201
+ try {
202
+ await this._$ES;
203
+ } catch (e) {
204
+ Promise.reject(e);
205
+ }
206
+ const t = this.scheduleUpdate();
207
+ return t != null && await t, !this.isUpdatePending;
208
+ }
209
+ scheduleUpdate() {
210
+ return this.performUpdate();
211
+ }
212
+ performUpdate() {
213
+ if (!this.isUpdatePending) return;
214
+ if (!this.hasUpdated) {
215
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
216
+ for (const [i, n] of this._$Ep) this[i] = n;
217
+ this._$Ep = void 0;
218
+ }
219
+ const s = this.constructor.elementProperties;
220
+ if (s.size > 0) for (const [i, n] of s) {
221
+ const { wrapped: o } = n, a = this[i];
222
+ o !== !0 || this._$AL.has(i) || a === void 0 || this.C(i, void 0, n, a);
223
+ }
224
+ }
225
+ let t = !1;
226
+ const e = this._$AL;
227
+ try {
228
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(e)) : this._$EM();
229
+ } catch (s) {
230
+ throw t = !1, this._$EM(), s;
231
+ }
232
+ t && this._$AE(e);
233
+ }
234
+ willUpdate(t) {
235
+ }
236
+ _$AE(t) {
237
+ this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
238
+ }
239
+ _$EM() {
240
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
241
+ }
242
+ get updateComplete() {
243
+ return this.getUpdateComplete();
244
+ }
245
+ getUpdateComplete() {
246
+ return this._$ES;
247
+ }
248
+ shouldUpdate(t) {
249
+ return !0;
250
+ }
251
+ update(t) {
252
+ this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM();
253
+ }
254
+ updated(t) {
255
+ }
256
+ firstUpdated(t) {
257
+ }
258
+ };
259
+ g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[S("elementProperties")] = /* @__PURE__ */ new Map(), g[S("finalized")] = /* @__PURE__ */ new Map(), pt?.({ ReactiveElement: g }), (T.reactiveElementVersions ??= []).push("2.1.1");
260
+ /**
261
+ * @license
262
+ * Copyright 2017 Google LLC
263
+ * SPDX-License-Identifier: BSD-3-Clause
264
+ */
265
+ const L = globalThis, H = L.trustedTypes, J = H ? H.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Y = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, tt = "?" + _, ut = `<${tt}>`, y = document, b = () => y.createComment(""), w = (r) => r === null || typeof r != "object" && typeof r != "function", z = Array.isArray, $t = (r) => z(r) || typeof r?.[Symbol.iterator] == "function", R = `[
266
+ \f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, K = /-->/g, Z = />/g, f = RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^
267
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), F = /'/g, G = /"/g, et = /^(?:script|style|textarea|title)$/i, _t = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), Ot = _t(1), m = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), Q = /* @__PURE__ */ new WeakMap(), A = y.createTreeWalker(y, 129);
268
+ function st(r, t) {
269
+ if (!z(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
270
+ return J !== void 0 ? J.createHTML(t) : t;
271
+ }
272
+ const ft = (r, t) => {
273
+ const e = r.length - 1, s = [];
274
+ let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = E;
275
+ for (let a = 0; a < e; a++) {
276
+ const h = r[a];
277
+ let c, p, l = -1, u = 0;
278
+ for (; u < h.length && (o.lastIndex = u, p = o.exec(h), p !== null); ) u = o.lastIndex, o === E ? p[1] === "!--" ? o = K : p[1] !== void 0 ? o = Z : p[2] !== void 0 ? (et.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = f) : p[3] !== void 0 && (o = f) : o === f ? p[0] === ">" ? (o = i ?? E, l = -1) : p[1] === void 0 ? l = -2 : (l = o.lastIndex - p[2].length, c = p[1], o = p[3] === void 0 ? f : p[3] === '"' ? G : F) : o === G || o === F ? o = f : o === K || o === Z ? o = E : (o = f, i = void 0);
279
+ const $ = o === f && r[a + 1].startsWith("/>") ? " " : "";
280
+ n += o === E ? h + ut : l >= 0 ? (s.push(c), h.slice(0, l) + Y + h.slice(l) + _ + $) : h + _ + (l === -2 ? a : $);
281
+ }
282
+ return [st(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
283
+ };
284
+ class C {
285
+ constructor({ strings: t, _$litType$: e }, s) {
286
+ let i;
287
+ this.parts = [];
288
+ let n = 0, o = 0;
289
+ const a = t.length - 1, h = this.parts, [c, p] = ft(t, e);
290
+ if (this.el = C.createElement(c, s), A.currentNode = this.el.content, e === 2 || e === 3) {
291
+ const l = this.el.content.firstChild;
292
+ l.replaceWith(...l.childNodes);
293
+ }
294
+ for (; (i = A.nextNode()) !== null && h.length < a; ) {
295
+ if (i.nodeType === 1) {
296
+ if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(Y)) {
297
+ const u = p[o++], $ = i.getAttribute(l).split(_), U = /([.?@])?(.*)/.exec(u);
298
+ h.push({ type: 1, index: n, name: U[2], strings: $, ctor: U[1] === "." ? yt : U[1] === "?" ? gt : U[1] === "@" ? mt : N }), i.removeAttribute(l);
299
+ } else l.startsWith(_) && (h.push({ type: 6, index: n }), i.removeAttribute(l));
300
+ if (et.test(i.tagName)) {
301
+ const l = i.textContent.split(_), u = l.length - 1;
302
+ if (u > 0) {
303
+ i.textContent = H ? H.emptyScript : "";
304
+ for (let $ = 0; $ < u; $++) i.append(l[$], b()), A.nextNode(), h.push({ type: 2, index: ++n });
305
+ i.append(l[u], b());
306
+ }
307
+ }
308
+ } else if (i.nodeType === 8) if (i.data === tt) h.push({ type: 2, index: n });
309
+ else {
310
+ let l = -1;
311
+ for (; (l = i.data.indexOf(_, l + 1)) !== -1; ) h.push({ type: 7, index: n }), l += _.length - 1;
312
+ }
313
+ n++;
314
+ }
315
+ }
316
+ static createElement(t, e) {
317
+ const s = y.createElement("template");
318
+ return s.innerHTML = t, s;
319
+ }
320
+ }
321
+ function v(r, t, e = r, s) {
322
+ if (t === m) return t;
323
+ let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
324
+ const n = w(t) ? void 0 : t._$litDirective$;
325
+ return i?.constructor !== n && (i?._$AO?.(!1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = v(r, i._$AS(r, t.values), i, s)), t;
326
+ }
327
+ class At {
328
+ constructor(t, e) {
329
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
330
+ }
331
+ get parentNode() {
332
+ return this._$AM.parentNode;
333
+ }
334
+ get _$AU() {
335
+ return this._$AM._$AU;
336
+ }
337
+ u(t) {
338
+ const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? y).importNode(e, !0);
339
+ A.currentNode = i;
340
+ let n = A.nextNode(), o = 0, a = 0, h = s[0];
341
+ for (; h !== void 0; ) {
342
+ if (o === h.index) {
343
+ let c;
344
+ h.type === 2 ? c = new P(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new vt(n, this, t)), this._$AV.push(c), h = s[++a];
345
+ }
346
+ o !== h?.index && (n = A.nextNode(), o++);
347
+ }
348
+ return A.currentNode = y, i;
349
+ }
350
+ p(t) {
351
+ let e = 0;
352
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
353
+ }
354
+ }
355
+ class P {
356
+ get _$AU() {
357
+ return this._$AM?._$AU ?? this._$Cv;
358
+ }
359
+ constructor(t, e, s, i) {
360
+ this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
361
+ }
362
+ get parentNode() {
363
+ let t = this._$AA.parentNode;
364
+ const e = this._$AM;
365
+ return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
366
+ }
367
+ get startNode() {
368
+ return this._$AA;
369
+ }
370
+ get endNode() {
371
+ return this._$AB;
372
+ }
373
+ _$AI(t, e = this) {
374
+ t = v(this, t, e), w(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== m && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : $t(t) ? this.k(t) : this._(t);
375
+ }
376
+ O(t) {
377
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
378
+ }
379
+ T(t) {
380
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
381
+ }
382
+ _(t) {
383
+ this._$AH !== d && w(this._$AH) ? this._$AA.nextSibling.data = t : this.T(y.createTextNode(t)), this._$AH = t;
384
+ }
385
+ $(t) {
386
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = C.createElement(st(s.h, s.h[0]), this.options)), s);
387
+ if (this._$AH?._$AD === i) this._$AH.p(e);
388
+ else {
389
+ const n = new At(i, this), o = n.u(this.options);
390
+ n.p(e), this.T(o), this._$AH = n;
391
+ }
392
+ }
393
+ _$AC(t) {
394
+ let e = Q.get(t.strings);
395
+ return e === void 0 && Q.set(t.strings, e = new C(t)), e;
396
+ }
397
+ k(t) {
398
+ z(this._$AH) || (this._$AH = [], this._$AR());
399
+ const e = this._$AH;
400
+ let s, i = 0;
401
+ for (const n of t) i === e.length ? e.push(s = new P(this.O(b()), this.O(b()), this, this.options)) : s = e[i], s._$AI(n), i++;
402
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
403
+ }
404
+ _$AR(t = this._$AA.nextSibling, e) {
405
+ for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
406
+ const s = t.nextSibling;
407
+ t.remove(), t = s;
408
+ }
409
+ }
410
+ setConnected(t) {
411
+ this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
412
+ }
413
+ }
414
+ class N {
415
+ get tagName() {
416
+ return this.element.tagName;
417
+ }
418
+ get _$AU() {
419
+ return this._$AM._$AU;
420
+ }
421
+ constructor(t, e, s, i, n) {
422
+ this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
423
+ }
424
+ _$AI(t, e = this, s, i) {
425
+ const n = this.strings;
426
+ let o = !1;
427
+ if (n === void 0) t = v(this, t, e, 0), o = !w(t) || t !== this._$AH && t !== m, o && (this._$AH = t);
428
+ else {
429
+ const a = t;
430
+ let h, c;
431
+ for (t = n[0], h = 0; h < n.length - 1; h++) c = v(this, a[s + h], e, h), c === m && (c = this._$AH[h]), o ||= !w(c) || c !== this._$AH[h], c === d ? t = d : t !== d && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
432
+ }
433
+ o && !i && this.j(t);
434
+ }
435
+ j(t) {
436
+ t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
437
+ }
438
+ }
439
+ class yt extends N {
440
+ constructor() {
441
+ super(...arguments), this.type = 3;
442
+ }
443
+ j(t) {
444
+ this.element[this.name] = t === d ? void 0 : t;
445
+ }
446
+ }
447
+ class gt extends N {
448
+ constructor() {
449
+ super(...arguments), this.type = 4;
450
+ }
451
+ j(t) {
452
+ this.element.toggleAttribute(this.name, !!t && t !== d);
453
+ }
454
+ }
455
+ class mt extends N {
456
+ constructor(t, e, s, i, n) {
457
+ super(t, e, s, i, n), this.type = 5;
458
+ }
459
+ _$AI(t, e = this) {
460
+ if ((t = v(this, t, e, 0) ?? d) === m) return;
461
+ const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== d && (s === d || i);
462
+ i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
463
+ }
464
+ handleEvent(t) {
465
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
466
+ }
467
+ }
468
+ class vt {
469
+ constructor(t, e, s) {
470
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
471
+ }
472
+ get _$AU() {
473
+ return this._$AM._$AU;
474
+ }
475
+ _$AI(t) {
476
+ v(this, t);
477
+ }
478
+ }
479
+ const Et = L.litHtmlPolyfillSupport;
480
+ Et?.(C, P), (L.litHtmlVersions ??= []).push("3.3.1");
481
+ const St = (r, t, e) => {
482
+ const s = e?.renderBefore ?? t;
483
+ let i = s._$litPart$;
484
+ if (i === void 0) {
485
+ const n = e?.renderBefore ?? null;
486
+ s._$litPart$ = i = new P(t.insertBefore(b(), n), n, void 0, e ?? {});
487
+ }
488
+ return i._$AI(r), i;
489
+ };
490
+ /**
491
+ * @license
492
+ * Copyright 2017 Google LLC
493
+ * SPDX-License-Identifier: BSD-3-Clause
494
+ */
495
+ const B = globalThis;
496
+ class O extends g {
497
+ constructor() {
498
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
499
+ }
500
+ createRenderRoot() {
501
+ const t = super.createRenderRoot();
502
+ return this.renderOptions.renderBefore ??= t.firstChild, t;
503
+ }
504
+ update(t) {
505
+ const e = this.render();
506
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = St(e, this.renderRoot, this.renderOptions);
507
+ }
508
+ connectedCallback() {
509
+ super.connectedCallback(), this._$Do?.setConnected(!0);
510
+ }
511
+ disconnectedCallback() {
512
+ super.disconnectedCallback(), this._$Do?.setConnected(!1);
513
+ }
514
+ render() {
515
+ return m;
516
+ }
517
+ }
518
+ O._$litElement$ = !0, O.finalized = !0, B.litElementHydrateSupport?.({ LitElement: O });
519
+ const bt = B.litElementPolyfillSupport;
520
+ bt?.({ LitElement: O });
521
+ (B.litElementVersions ??= []).push("4.2.1");
522
+ /**
523
+ * @license
524
+ * Copyright 2017 Google LLC
525
+ * SPDX-License-Identifier: BSD-3-Clause
526
+ */
527
+ const wt = { attribute: !0, type: String, converter: M, reflect: !1, hasChanged: D }, Ct = (r = wt, t, e) => {
528
+ const { kind: s, metadata: i } = e;
529
+ let n = globalThis.litPropertyMetadata.get(i);
530
+ if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), n.set(e.name, r), s === "accessor") {
531
+ const { name: o } = e;
532
+ return { set(a) {
533
+ const h = t.get.call(this);
534
+ t.set.call(this, a), this.requestUpdate(o, h, r);
535
+ }, init(a) {
536
+ return a !== void 0 && this.C(o, void 0, r, a), a;
537
+ } };
538
+ }
539
+ if (s === "setter") {
540
+ const { name: o } = e;
541
+ return function(a) {
542
+ const h = this[o];
543
+ t.call(this, a), this.requestUpdate(o, h, r);
544
+ };
545
+ }
546
+ throw Error("Unsupported decorator location: " + s);
547
+ };
548
+ function Mt(r) {
549
+ return (t, e) => typeof e == "object" ? Ct(r, t, e) : ((s, i, n) => {
550
+ const o = i.hasOwnProperty(n);
551
+ return i.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
552
+ })(r, t, e);
553
+ }
554
+ export {
555
+ St as B,
556
+ Ut as a,
557
+ O as i,
558
+ Mt as n,
559
+ it as r,
560
+ Ot as x
561
+ };
@@ -0,0 +1,98 @@
1
+ import { FieldElement as l } from "./mlform/extensions.mjs";
2
+ import { a as c, n as p, x as b } from "./property-jKFNMQpR.js";
3
+ import { t as h } from "./custom-element-ttkHUa8w.js";
4
+ var d = Object.defineProperty, g = Object.getOwnPropertyDescriptor, m = (e, t, r) => t in e ? d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, i = (e, t, r, o) => {
5
+ for (var n = o > 1 ? void 0 : o ? g(t, r) : t, u = e.length - 1, s; u >= 0; u--)
6
+ (s = e[u]) && (n = (o ? s(t, r, n) : s(n)) || n);
7
+ return o && n && d(t, r, n), n;
8
+ }, f = (e, t, r) => m(e, t + "", r);
9
+ let a = class extends l {
10
+ unit = "";
11
+ step = "1";
12
+ firstUpdated() {
13
+ this.value = Number(this.defaultValue);
14
+ const e = new InputEvent("input", {
15
+ bubbles: !0,
16
+ composed: !0
17
+ });
18
+ Object.defineProperty(e, "target", {
19
+ value: { value: this.defaultValue },
20
+ writable: !1
21
+ }), this.onInput(e);
22
+ }
23
+ render() {
24
+ return b`
25
+ <div class="input-wrapper">
26
+ <input
27
+ type="range"
28
+ @input=${this.onInput}
29
+ .min=${this.min}
30
+ .max=${this.max}
31
+ .step=${this.step}
32
+ .value=${this.value}
33
+ />
34
+ </div>
35
+ `;
36
+ }
37
+ onInput(e) {
38
+ this.value = Number(e.target.value), this.dispatchState(
39
+ "success",
40
+ `Selected Value: ${this.value.toLocaleString("en-US")} ${this.unit}`
41
+ );
42
+ }
43
+ };
44
+ f(a, "styles", [
45
+ l.baseStyles,
46
+ c`
47
+ input[type="range"] {
48
+ width: 99%;
49
+ -webkit-appearance: none;
50
+ appearance: none;
51
+ height: 6px;
52
+ border-radius: 3px;
53
+ background: var(--range-track, #d1d5db);
54
+ outline: none;
55
+ }
56
+ input[type="range"]::-webkit-slider-thumb {
57
+ -webkit-appearance: none;
58
+ appearance: none;
59
+ width: 18px;
60
+ height: 18px;
61
+ border-radius: 50%;
62
+ background: var(--range-thumb, var(--ml-color-accent, #1e40af));
63
+ cursor: pointer;
64
+ border: 2px solid #fff;
65
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
66
+ transition: background 0.2s ease;
67
+ }
68
+ input[type="range"]::-moz-range-thumb {
69
+ width: 18px;
70
+ height: 18px;
71
+ border-radius: 50%;
72
+ background: var(--range-thumb, var(--ml-color-accent, #1e40af));
73
+ cursor: pointer;
74
+ border: 2px solid #fff;
75
+ }
76
+ `
77
+ ]);
78
+ i([
79
+ p({ type: String })
80
+ ], a.prototype, "unit", 2);
81
+ i([
82
+ p({ type: String })
83
+ ], a.prototype, "step", 2);
84
+ i([
85
+ p({ type: String })
86
+ ], a.prototype, "min", 2);
87
+ i([
88
+ p({ type: String })
89
+ ], a.prototype, "max", 2);
90
+ i([
91
+ p({ type: String })
92
+ ], a.prototype, "defaultValue", 2);
93
+ a = i([
94
+ h("range-field")
95
+ ], a);
96
+ export {
97
+ a as RangeField
98
+ };