urit-qf-ui 0.0.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.
package/dist/index.js ADDED
@@ -0,0 +1,2652 @@
1
+ import { computed as m, markRaw as it, defineComponent as Ae, getCurrentInstance as Y, h as k, ref as I, reactive as rt, onMounted as ge, watch as K, onBeforeUpdate as qt, inject as Mt, onBeforeUnmount as he, nextTick as X, onDeactivated as st, onActivated as ut, Transition as ct, toRaw as oe, withDirectives as _t, provide as Ft, openBlock as dt, createBlock as Bt, withModifiers as Vt, withCtx as Ie, createVNode as re, createElementBlock as $t, createElementVNode as te } from "vue";
2
+ const Me = {
3
+ xs: 18,
4
+ sm: 24,
5
+ md: 32,
6
+ lg: 38,
7
+ xl: 46
8
+ }, Te = {
9
+ size: String
10
+ };
11
+ function Pe(e, t = Me) {
12
+ return m(
13
+ () => e.size !== void 0 ? {
14
+ fontSize: e.size in t ? `${t[e.size]}px` : e.size
15
+ } : null
16
+ );
17
+ }
18
+ function Ce(e, t, n, o) {
19
+ return Object.defineProperty(e, t, {
20
+ get: n,
21
+ set: o,
22
+ enumerable: !0
23
+ }), e;
24
+ }
25
+ function de(e) {
26
+ return it(Ae(e));
27
+ }
28
+ function At(e) {
29
+ return it(e);
30
+ }
31
+ function ne(e, t) {
32
+ return e !== void 0 && e() || t;
33
+ }
34
+ function ue(e, t) {
35
+ return e !== void 0 ? t.concat(e()) : t;
36
+ }
37
+ const je = "0 0 24 24", Se = (e) => e, Re = (e) => `ionicons ${e}`, ft = {
38
+ "mdi-": (e) => `mdi ${e}`,
39
+ "icon-": Se,
40
+ // fontawesome equiv
41
+ "bt-": (e) => `bt ${e}`,
42
+ "eva-": (e) => `eva ${e}`,
43
+ "ion-md": Re,
44
+ "ion-ios": Re,
45
+ "ion-logo": Re,
46
+ "iconfont ": Se,
47
+ "ti-": (e) => `themify-icon ${e}`,
48
+ "bi-": (e) => `bootstrap-icons ${e}`,
49
+ "i-": Se
50
+ // UnoCSS pure icons
51
+ }, vt = {
52
+ o_: "-outlined",
53
+ r_: "-round",
54
+ s_: "-sharp"
55
+ }, mt = {
56
+ sym_o_: "-outlined",
57
+ sym_r_: "-rounded",
58
+ sym_s_: "-sharp"
59
+ }, Tt = new RegExp("^(" + Object.keys(ft).join("|") + ")"), Pt = new RegExp("^(" + Object.keys(vt).join("|") + ")"), De = new RegExp("^(" + Object.keys(mt).join("|") + ")"), Ot = /^[Mm]\s?[-+]?\.?\d/, Lt = /^img:/, It = /^svguse:/, jt = /^ion-/, Dt = /^(fa-(classic|sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /, ce = /* @__PURE__ */ de({
60
+ name: "QIcon",
61
+ props: {
62
+ ...Te,
63
+ tag: {
64
+ type: String,
65
+ default: "i"
66
+ },
67
+ name: String,
68
+ color: String,
69
+ left: Boolean,
70
+ right: Boolean
71
+ },
72
+ setup(e, { slots: t }) {
73
+ const {
74
+ proxy: { $q: n }
75
+ } = Y(), o = Pe(e), l = m(
76
+ () => "q-icon" + (e.left ? " on-left" : "") + // TODO Qv3: drop this
77
+ (e.right ? " on-right" : "") + (e.color !== void 0 ? ` text-${e.color}` : "")
78
+ ), i = m(() => {
79
+ let r, c = e.name;
80
+ if (c === "none" || !c)
81
+ return { none: !0 };
82
+ if (n.iconMapFn !== null) {
83
+ const b = n.iconMapFn(c);
84
+ if (b !== void 0)
85
+ if (b.icon !== void 0) {
86
+ if (c = b.icon, c === "none" || !c)
87
+ return { none: !0 };
88
+ } else
89
+ return {
90
+ cls: b.cls,
91
+ content: b.content !== void 0 ? b.content : " "
92
+ };
93
+ }
94
+ if (Ot.test(c)) {
95
+ const [b, x = je] = c.split("|");
96
+ return {
97
+ svg: !0,
98
+ viewBox: x,
99
+ nodes: b.split("&&").map((h) => {
100
+ const [p, C, B] = h.split("@@");
101
+ return k("path", { style: C, d: p, transform: B });
102
+ })
103
+ };
104
+ }
105
+ if (Lt.test(c))
106
+ return {
107
+ img: !0,
108
+ src: c.slice(4)
109
+ };
110
+ if (It.test(c)) {
111
+ const [b, x = je] = c.split("|");
112
+ return {
113
+ svguse: !0,
114
+ src: b.slice(7),
115
+ viewBox: x
116
+ };
117
+ }
118
+ let R = " ";
119
+ const E = c.match(Tt);
120
+ if (E !== null)
121
+ r = ft[E[1]](c);
122
+ else if (Dt.test(c))
123
+ r = c;
124
+ else if (jt.test(c))
125
+ r = `ionicons ion-${n.platform.is.ios ? "ios" : "md"}${c.slice(3)}`;
126
+ else if (De.test(c)) {
127
+ r = "notranslate material-symbols";
128
+ const b = c.match(De);
129
+ b !== null && (c = c.slice(6), r += mt[b[1]]), R = c;
130
+ } else {
131
+ r = "notranslate material-icons";
132
+ const b = c.match(Pt);
133
+ b !== null && (c = c.slice(2), r += vt[b[1]]), R = c;
134
+ }
135
+ return {
136
+ cls: r,
137
+ content: R
138
+ };
139
+ });
140
+ return () => {
141
+ const r = {
142
+ class: l.value,
143
+ style: o.value,
144
+ "aria-hidden": "true"
145
+ };
146
+ return i.value.none ? k(e.tag, r, ne(t.default)) : i.value.img ? k(
147
+ e.tag,
148
+ r,
149
+ ue(t.default, [k("img", { src: i.value.src })])
150
+ ) : i.value.svg ? k(
151
+ e.tag,
152
+ r,
153
+ ue(t.default, [
154
+ k(
155
+ "svg",
156
+ {
157
+ viewBox: i.value.viewBox || "0 0 24 24"
158
+ },
159
+ i.value.nodes
160
+ )
161
+ ])
162
+ ) : i.value.svguse ? k(
163
+ e.tag,
164
+ r,
165
+ ue(t.default, [
166
+ k(
167
+ "svg",
168
+ {
169
+ viewBox: i.value.viewBox
170
+ },
171
+ [k("use", { "xlink:href": i.value.src })]
172
+ )
173
+ ])
174
+ ) : (i.value.cls !== void 0 && (r.class += " " + i.value.cls), k(e.tag, r, ue(t.default, [i.value.content])));
175
+ };
176
+ }
177
+ }), zt = {
178
+ size: {
179
+ type: [String, Number],
180
+ default: "1em"
181
+ },
182
+ color: String
183
+ };
184
+ function Nt(e) {
185
+ return {
186
+ cSize: m(
187
+ () => e.size in Me ? `${Me[e.size]}px` : e.size
188
+ ),
189
+ classes: m(
190
+ () => "q-spinner" + (e.color ? ` text-${e.color}` : "")
191
+ )
192
+ };
193
+ }
194
+ const gt = /* @__PURE__ */ de({
195
+ name: "QSpinner",
196
+ props: {
197
+ ...zt,
198
+ thickness: {
199
+ type: Number,
200
+ default: 5
201
+ }
202
+ },
203
+ setup(e) {
204
+ const { cSize: t, classes: n } = Nt(e);
205
+ return () => k(
206
+ "svg",
207
+ {
208
+ class: n.value + " q-spinner-mat",
209
+ width: t.value,
210
+ height: t.value,
211
+ viewBox: "25 25 50 50"
212
+ },
213
+ [
214
+ k("circle", {
215
+ class: "path",
216
+ cx: "50",
217
+ cy: "50",
218
+ r: "20",
219
+ fill: "none",
220
+ stroke: "currentColor",
221
+ "stroke-width": e.thickness,
222
+ "stroke-miterlimit": "10"
223
+ })
224
+ ]
225
+ );
226
+ }
227
+ });
228
+ function Kt() {
229
+ if (typeof crypto > "u")
230
+ return () => {
231
+ throw new Error(
232
+ "[Quasar uid()] Secure RNG not available. Cannot generate collision-resistant UUID."
233
+ );
234
+ };
235
+ if (crypto.randomUUID) return () => crypto.randomUUID();
236
+ const e = Array.from(
237
+ { length: 256 },
238
+ (o, l) => (l + 256).toString(16).slice(1)
239
+ );
240
+ let t, n;
241
+ return () => {
242
+ (t === void 0 || n + 16 > 4096) && (n = 0, t = new Uint8Array(4096), crypto.getRandomValues(t));
243
+ const o = n;
244
+ return n += 16, t[o + 6] = t[o + 6] & 15 | 64, t[o + 8] = t[o + 8] & 63 | 128, e[t[o]] + e[t[o + 1]] + e[t[o + 2]] + e[t[o + 3]] + "-" + e[t[o + 4]] + e[t[o + 5]] + "-" + e[t[o + 6]] + e[t[o + 7]] + "-" + e[t[o + 8]] + e[t[o + 9]] + "-" + e[t[o + 10]] + e[t[o + 11]] + e[t[o + 12]] + e[t[o + 13]] + e[t[o + 14]] + e[t[o + 15]];
245
+ };
246
+ }
247
+ const _e = /* @__PURE__ */ Kt(), me = I(
248
+ !1
249
+ );
250
+ let Fe;
251
+ const Ut = 512;
252
+ function Ht(e) {
253
+ return typeof e == "string" ? e.slice(0, Ut).toLowerCase() : "";
254
+ }
255
+ const Zt = /(?:^|\s)version\/([\w.]+)/, Qt = /(?:^|\s)applewebkit\/[\w.]+/, Wt = /(?:^|\s)safari\/[\w.]+/;
256
+ function Yt(e) {
257
+ const t = Zt.exec(e);
258
+ return t !== null && Qt.test(e) && Wt.test(e) ? {
259
+ browser: "safari",
260
+ version: t[1]
261
+ } : null;
262
+ }
263
+ const Xt = /(?:^|\s)opera\/([\w.]+)/, Gt = /(?:^|\s)version\/([\w.]+)/;
264
+ function Jt(e) {
265
+ const t = Xt.exec(e);
266
+ if (t === null) return null;
267
+ const n = Gt.exec(e);
268
+ return {
269
+ browser: "opera",
270
+ version: (n == null ? void 0 : n[1]) || t[1]
271
+ };
272
+ }
273
+ const en = /(edg|edge|edga|edgios)\/([\w.]+)/, tn = /(opr)[\/]([\w.]+)/, nn = /(vivaldi)[\/]([\w.]+)/, on = /(chrome|crios)[\/]([\w.]+)/, ln = /(firefox|fxios)[\/]([\w.]+)/, an = /(webkit)[\/]([\w.]+)/;
274
+ function rn(e, t) {
275
+ let n = en.exec(e) || tn.exec(e) || nn.exec(e) || on.exec(e);
276
+ if (n === null) {
277
+ const o = Yt(e);
278
+ if (o !== null)
279
+ return {
280
+ ...o,
281
+ platform: t[0] || ""
282
+ };
283
+ if (n = ln.exec(e) || an.exec(e), n === null) {
284
+ const l = Jt(e);
285
+ if (l !== null)
286
+ return {
287
+ ...l,
288
+ platform: t[0] || ""
289
+ };
290
+ n = [];
291
+ }
292
+ }
293
+ return {
294
+ browser: n[5] || n[3] || n[1] || "",
295
+ version: n[4] || n[2] || "0",
296
+ platform: t[0] || ""
297
+ };
298
+ }
299
+ const sn = /(ipad)/, un = /(ipod)/, cn = /(iphone)/, dn = /(windows phone)/, fn = /(kindle)/, vn = /(silk)/, mn = /(android)/, gn = /(win)/, hn = /(mac)/, bn = /(linux)/, pn = /(cros)/;
300
+ function kn(e) {
301
+ return sn.exec(e) || un.exec(e) || dn.exec(e) || cn.exec(e) || fn.exec(e) || vn.exec(e) || mn.exec(e) || gn.exec(e) || hn.exec(e) || bn.exec(e) || pn.exec(e) || [];
302
+ }
303
+ const ht = "ontouchstart" in window || window.navigator.maxTouchPoints > 0;
304
+ function yn(e) {
305
+ const t = Ht(e), n = kn(t), o = rn(t, n), l = {
306
+ mobile: !1,
307
+ desktop: !1,
308
+ cordova: !1,
309
+ capacitor: !1,
310
+ nativeMobile: !1,
311
+ // nativeMobileWrapper: void 0,
312
+ electron: !1,
313
+ bex: !1,
314
+ linux: !1,
315
+ mac: !1,
316
+ win: !1,
317
+ cros: !1,
318
+ chrome: !1,
319
+ firefox: !1,
320
+ opera: !1,
321
+ safari: !1,
322
+ vivaldi: !1,
323
+ edge: !1,
324
+ edgeChromium: !1,
325
+ ie: !1,
326
+ webkit: !1,
327
+ android: !1,
328
+ ios: !1,
329
+ ipad: !1,
330
+ iphone: !1,
331
+ ipod: !1,
332
+ kindle: !1,
333
+ winphone: !1,
334
+ silk: !1
335
+ };
336
+ o.browser && (l[o.browser] = !0, l.version = o.version, l.versionNumber = Number.parseInt(o.version, 10)), o.platform && (l[o.platform] = !0), l["windows phone"] && (l.winphone = !0, delete l["windows phone"]);
337
+ const i = l.android || l.ios || l.ipad || l.iphone || l.ipod || l.kindle || l.silk || l.winphone;
338
+ if (i === !0 || t.includes("mobile") ? l.mobile = !0 : l.desktop = !0, l.edga || l.edgios || l.edg ? (l.edge = !0, o.browser = "edge") : l.crios ? (l.chrome = !0, o.browser = "chrome") : l.fxios && (l.firefox = !0, o.browser = "firefox"), (l.ipod || l.ipad || l.iphone) && (l.ios = !0), l.vivaldi && (o.browser = "vivaldi", l.vivaldi = !0), // Chrome, Opera 15+, Vivaldi and Safari are webkit based browsers
339
+ (l.chrome || l.opr || l.safari || l.vivaldi || // we expect unknown, non iOS mobile browsers to be webkit based
340
+ l.mobile && !l.ios && !i) && (l.webkit = !0), l.opr && (o.browser = "opera", l.opera = !0), l.safari && (l.android ? (o.browser = "android", l.android = !0) : l.kindle ? (o.browser = "kindle", l.kindle = !0) : l.silk && (o.browser = "silk", l.silk = !0)), l.name = o.browser, l.platform = o.platform, t.includes("electron"))
341
+ l.electron = !0;
342
+ else if (document.location.href.includes("-extension://"))
343
+ l.bex = !0;
344
+ else {
345
+ if (window.Capacitor !== void 0 ? (l.capacitor = !0, l.nativeMobile = !0, l.nativeMobileWrapper = "capacitor") : (window._cordovaNative !== void 0 || window.cordova !== void 0) && (l.cordova = !0, l.nativeMobile = !0, l.nativeMobileWrapper = "cordova"), me.value && (Fe = { is: { ...l } }), ht && l.mac && (l.desktop && l.safari || l.nativeMobile && !l.android && !l.ios && !l.ipad)) {
346
+ delete l.mac, delete l.desktop;
347
+ const r = Math.min(window.innerHeight, window.innerWidth) > 414 ? "ipad" : "iphone";
348
+ Object.assign(l, {
349
+ mobile: !0,
350
+ ios: !0,
351
+ platform: r,
352
+ [r]: !0
353
+ });
354
+ }
355
+ !l.mobile && window.navigator.userAgentData && window.navigator.userAgentData.mobile && (delete l.desktop, l.mobile = !0);
356
+ }
357
+ return l;
358
+ }
359
+ const ze = navigator.userAgent || navigator.vendor || window.opera, wn = {
360
+ has: {
361
+ touch: !1,
362
+ webStorage: !1
363
+ },
364
+ within: { iframe: !1 }
365
+ }, we = {
366
+ userAgent: ze,
367
+ is: yn(ze),
368
+ has: {
369
+ touch: ht
370
+ },
371
+ within: {
372
+ iframe: window.self !== window.top
373
+ }
374
+ }, Ne = {
375
+ install(e) {
376
+ const { $q: t } = e;
377
+ me.value ? (e.onSSRHydrated.push(() => {
378
+ Object.assign(t.platform, we), me.value = !1;
379
+ }), t.platform = rt(this)) : t.platform = this;
380
+ }
381
+ };
382
+ {
383
+ let e;
384
+ Ce(we.has, "webStorage", () => {
385
+ if (e !== void 0)
386
+ return e;
387
+ try {
388
+ if (window.localStorage)
389
+ return e = !0, !0;
390
+ } catch {
391
+ }
392
+ return e = !1, !1;
393
+ }), Object.assign(Ne, we), me.value && (Object.assign(Ne, Fe, wn), Fe = null);
394
+ }
395
+ function xn(e) {
396
+ return e ?? null;
397
+ }
398
+ function Ke(e, t) {
399
+ return e ?? (t ? `f_${_e()}` : null);
400
+ }
401
+ function Cn({ getValue: e, required: t = !0 } = {}) {
402
+ if (me.value) {
403
+ const n = e !== void 0 ? I(xn(e())) : I(null);
404
+ return t && n.value === null && ge(() => {
405
+ n.value = `f_${_e()}`;
406
+ }), e !== void 0 && K(e, (o) => {
407
+ n.value = Ke(o, t);
408
+ }), n;
409
+ }
410
+ return e !== void 0 ? m(() => Ke(e(), t)) : I(`f_${_e()}`);
411
+ }
412
+ const Ue = /^on[A-Z]/;
413
+ function En() {
414
+ const e = Y(), { attrs: t } = e, n = {
415
+ listeners: I({}),
416
+ attributes: I({})
417
+ };
418
+ function o() {
419
+ const l = {}, i = {};
420
+ for (const r in t)
421
+ r !== "class" && r !== "style" && !Ue.test(r) && (l[r] = t[r]);
422
+ for (const r in e.vnode.props)
423
+ Ue.test(r) && (i[r] = e.vnode.props[r]);
424
+ n.attributes.value = l, n.listeners.value = i;
425
+ }
426
+ return qt(o), o(), n;
427
+ }
428
+ const bt = {
429
+ dark: {
430
+ type: Boolean,
431
+ default: null
432
+ }
433
+ };
434
+ function pt(e, t) {
435
+ return m(() => e.dark === null ? t.dark.isActive : e.dark);
436
+ }
437
+ const kt = "_q_fo_";
438
+ function Sn({
439
+ validate: e,
440
+ resetValidation: t,
441
+ requiresQForm: n
442
+ }) {
443
+ const o = Mt(kt, !1);
444
+ if (o !== !1) {
445
+ const { props: l, proxy: i } = Y();
446
+ Object.assign(i, { validate: e, resetValidation: t }), K(
447
+ () => l.disable,
448
+ (r) => {
449
+ r ? (typeof t == "function" && t(), o.unbindComponent(i)) : o.bindComponent(i);
450
+ }
451
+ ), ge(() => {
452
+ l.disable || o.bindComponent(i);
453
+ }), he(() => {
454
+ l.disable || o.unbindComponent(i);
455
+ });
456
+ } else n && console.error("Parent QForm not found on useFormChild()!");
457
+ }
458
+ const He = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/, Ze = /^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/, Qe = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, pe = /^rgb\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5])\)$/, ke = /^rgba\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),(0(\.[\d]+)?|1(\.0+)?)\)$/, Rn = /^-?[\d]+\/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])$/, qn = /^([0-1]?\d|2[0-3]):[0-5]\d$/, Mn = /^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/, _n = /^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/, Fn = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, qe = {
459
+ date: (e) => Rn.test(e),
460
+ time: (e) => qn.test(e),
461
+ fulltime: (e) => Mn.test(e),
462
+ timeOrFulltime: (e) => _n.test(e),
463
+ // -- RFC 5322 --
464
+ // -- Added in v2.6.6 --
465
+ // This is a basic helper validation.
466
+ // For something more complex (like RFC 822) you should write and use your own rule.
467
+ // We won't be accepting PRs to enhance the one below because of the reason above.
468
+ email: (e) => Fn.test(e),
469
+ hexColor: (e) => He.test(e),
470
+ hexaColor: (e) => Ze.test(e),
471
+ hexOrHexaColor: (e) => Qe.test(e),
472
+ rgbColor: (e) => pe.test(e),
473
+ rgbaColor: (e) => ke.test(e),
474
+ rgbOrRgbaColor: (e) => pe.test(e) || ke.test(e),
475
+ hexOrRgbColor: (e) => He.test(e) || pe.test(e),
476
+ hexaOrRgbaColor: (e) => Ze.test(e) || ke.test(e),
477
+ anyColor: (e) => Qe.test(e) || pe.test(e) || ke.test(e)
478
+ };
479
+ function Bn(e, t = 250, n) {
480
+ let o = null;
481
+ function l(...i) {
482
+ const r = () => {
483
+ o = null, e.apply(this, i);
484
+ };
485
+ o !== null && clearTimeout(o), o = setTimeout(r, t);
486
+ }
487
+ return l.cancel = () => {
488
+ o !== null && (clearTimeout(o), o = null);
489
+ }, l;
490
+ }
491
+ const Vn = [!0, !1, "ondemand"], $n = {
492
+ modelValue: {},
493
+ error: {
494
+ type: Boolean,
495
+ default: null
496
+ },
497
+ errorMessage: String,
498
+ noErrorIcon: Boolean,
499
+ rules: Array,
500
+ reactiveRules: Boolean,
501
+ lazyRules: {
502
+ type: [Boolean, String],
503
+ default: !1,
504
+ // statement unneeded but avoids future vue implementation changes
505
+ validator: (e) => Vn.includes(e)
506
+ }
507
+ };
508
+ function An(e, t) {
509
+ const { props: n, proxy: o } = Y(), l = I(!1), i = I(null), r = I(!1);
510
+ Sn({ validate: B, resetValidation: C });
511
+ let c = 0, R;
512
+ const E = m(
513
+ () => n.rules !== void 0 && n.rules !== null && n.rules.length !== 0
514
+ ), b = m(
515
+ () => !n.disable && E.value && // Should not have a validation in progress already;
516
+ // It might mean that focus switched to submit btn and
517
+ // QForm's submit() has been called already (ENTER key)
518
+ !t.value
519
+ ), x = m(() => n.error === !0 || l.value), h = m(
520
+ () => typeof n.errorMessage == "string" && n.errorMessage.length !== 0 ? n.errorMessage : i.value
521
+ );
522
+ K(
523
+ () => n.modelValue,
524
+ () => {
525
+ r.value = !0, b.value && // trigger validation if not using any kind of lazy-rules
526
+ n.lazyRules === !1 && S();
527
+ }
528
+ );
529
+ function p() {
530
+ n.lazyRules !== "ondemand" && b.value && r.value && S();
531
+ }
532
+ K(
533
+ () => n.reactiveRules,
534
+ (V) => {
535
+ V ? R === void 0 && (R = K(() => n.rules, p, {
536
+ immediate: !0,
537
+ deep: !0
538
+ })) : R !== void 0 && (R(), R = void 0);
539
+ },
540
+ { immediate: !0 }
541
+ ), K(() => n.lazyRules, p), K(e, (V) => {
542
+ V ? r.value = !0 : b.value && n.lazyRules !== "ondemand" && S();
543
+ });
544
+ function C() {
545
+ c++, t.value = !1, r.value = !1, l.value = !1, i.value = null, S.cancel();
546
+ }
547
+ function B(V = n.modelValue) {
548
+ if (n.disable || !E.value) return !0;
549
+ const A = ++c, $ = t.value ? () => {
550
+ } : () => {
551
+ r.value = !0;
552
+ }, P = (q, M) => {
553
+ q && $(), l.value = q, i.value = M || null, t.value = !1;
554
+ }, _ = [];
555
+ for (let q = 0; q < n.rules.length; q++) {
556
+ const M = n.rules[q];
557
+ let F;
558
+ if (typeof M == "function" ? F = M(V, qe) : typeof M == "string" && (qe[M] === void 0 ? (console.error(`Unknown validation pattern rule: "${M}"`), F = !1) : F = qe[M](V)), F === !1 || typeof F == "string")
559
+ return P(!0, F), !1;
560
+ F !== !0 && F !== void 0 && _.push(F);
561
+ }
562
+ return _.length === 0 ? (P(!1), !0) : (t.value = !0, Promise.all(_).then(
563
+ (q) => {
564
+ if (q === void 0 || !Array.isArray(q) || q.length === 0)
565
+ return A === c && P(!1), !0;
566
+ const M = q.find((F) => F === !1 || typeof F == "string");
567
+ return A === c && P(M !== void 0, M), M === void 0;
568
+ },
569
+ (q) => (A === c && (console.error(q), P(!0)), !1)
570
+ ));
571
+ }
572
+ const S = Bn(B, 0);
573
+ return he(() => {
574
+ R == null || R(), S.cancel();
575
+ }), Object.assign(o, { resetValidation: C, validate: B }), Ce(o, "hasError", () => x.value), {
576
+ isDirtyModel: r,
577
+ hasRules: E,
578
+ hasError: x,
579
+ errorMessage: h,
580
+ validate: B,
581
+ resetValidation: C
582
+ };
583
+ }
584
+ const Ee = {
585
+ hasPassive: !1,
586
+ passiveCapture: !0,
587
+ notPassiveCapture: !0
588
+ };
589
+ try {
590
+ const e = Object.defineProperty({}, "passive", {
591
+ // oxlint-disable-next-line getter-return
592
+ get() {
593
+ Object.assign(Ee, {
594
+ hasPassive: !0,
595
+ passive: { passive: !0 },
596
+ notPassive: { passive: !1 },
597
+ passiveCapture: { passive: !0, capture: !0 },
598
+ notPassiveCapture: { passive: !1, capture: !0 }
599
+ });
600
+ }
601
+ });
602
+ window.addEventListener("qtest", null, e), window.removeEventListener("qtest", null, e);
603
+ } catch {
604
+ }
605
+ function Tn(e) {
606
+ return e.touches && e.touches[0] ? e = e.touches[0] : e.changedTouches && e.changedTouches[0] ? e = e.changedTouches[0] : e.targetTouches && e.targetTouches[0] && (e = e.targetTouches[0]), {
607
+ top: e.clientY,
608
+ left: e.clientX
609
+ };
610
+ }
611
+ function xe(e) {
612
+ e.stopPropagation();
613
+ }
614
+ function se(e) {
615
+ e.cancelable !== !1 && e.preventDefault();
616
+ }
617
+ function W(e) {
618
+ e.cancelable !== !1 && e.preventDefault(), e.stopPropagation();
619
+ }
620
+ function Pn(e, t, n) {
621
+ const o = `__q_${t}_evt`;
622
+ e[o] = [...e[o] ?? [], ...n], n.forEach((l) => {
623
+ l[0].addEventListener(l[1], e[l[2]], Ee[l[3]]);
624
+ });
625
+ }
626
+ function On(e, t) {
627
+ const n = `__q_${t}_evt`;
628
+ e[n] !== void 0 && (e[n].forEach((o) => {
629
+ o[0].removeEventListener(o[1], e[o[2]], Ee[o[3]]);
630
+ }), e[n] = void 0);
631
+ }
632
+ let Be = [], Ln = [];
633
+ function Oe(e) {
634
+ Ln.length === 0 ? e() : Be.push(e);
635
+ }
636
+ function yt(e) {
637
+ Be = Be.filter((t) => t !== e);
638
+ }
639
+ function Ve(e) {
640
+ return e != null && String(e).length !== 0;
641
+ }
642
+ const In = {
643
+ ...bt,
644
+ ...$n,
645
+ label: String,
646
+ stackLabel: Boolean,
647
+ hint: String,
648
+ hideHint: Boolean,
649
+ prefix: String,
650
+ suffix: String,
651
+ labelColor: String,
652
+ color: String,
653
+ bgColor: String,
654
+ filled: Boolean,
655
+ outlined: Boolean,
656
+ borderless: Boolean,
657
+ standout: [Boolean, String],
658
+ square: Boolean,
659
+ loading: Boolean,
660
+ labelSlot: Boolean,
661
+ bottomSlots: Boolean,
662
+ hideBottomSpace: Boolean,
663
+ rounded: Boolean,
664
+ dense: Boolean,
665
+ itemAligned: Boolean,
666
+ counter: Boolean,
667
+ clearable: Boolean,
668
+ clearIcon: String,
669
+ disable: Boolean,
670
+ readonly: Boolean,
671
+ autofocus: Boolean,
672
+ for: String
673
+ }, jn = {
674
+ ...In,
675
+ maxlength: [Number, String]
676
+ }, Dn = ["update:modelValue", "clear", "focus", "blur"];
677
+ function zn({
678
+ requiredForAttr: e = !0,
679
+ tagProp: t,
680
+ changeEvent: n = !1
681
+ } = {}) {
682
+ const { props: o, proxy: l } = Y(), i = pt(o, l.$q), r = Cn({
683
+ required: e,
684
+ getValue: () => o.for
685
+ });
686
+ return {
687
+ requiredForAttr: e,
688
+ changeEvent: n,
689
+ tag: t ? m(() => o.tag) : { value: "label" },
690
+ isDark: i,
691
+ editable: m(() => !o.disable && !o.readonly),
692
+ innerLoading: I(!1),
693
+ focused: I(!1),
694
+ hasPopupOpen: !1,
695
+ splitAttrs: En(),
696
+ targetUid: r,
697
+ rootRef: I(null),
698
+ targetRef: I(null),
699
+ controlRef: I(null)
700
+ /**
701
+ * user supplied additionals:
702
+
703
+ * innerValue - computed
704
+ * floatingLabel - computed
705
+ * inputRef - computed
706
+
707
+ * fieldClass - computed
708
+ * hasShadow - computed
709
+
710
+ * controlEvents - Object with fn(e)
711
+
712
+ * getControl - fn
713
+ * getInnerAppend - fn
714
+ * getControlChild - fn
715
+ * getShadowControl - fn
716
+ * showPopup - fn
717
+ */
718
+ };
719
+ }
720
+ function ye(e, t) {
721
+ return t === null ? null : k(
722
+ "div",
723
+ {
724
+ key: e,
725
+ class: "q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"
726
+ },
727
+ t
728
+ );
729
+ }
730
+ function Nn(e) {
731
+ const { props: t, emit: n, slots: o, attrs: l, proxy: i } = Y(), { $q: r } = i;
732
+ let c = null;
733
+ e.hasValue === void 0 && (e.hasValue = m(() => Ve(t.modelValue))), e.emitValue === void 0 && (e.emitValue = (u) => {
734
+ n("update:modelValue", u);
735
+ }), e.controlEvents === void 0 && (e.controlEvents = {
736
+ onFocusin: z,
737
+ onFocusout: f
738
+ }), Object.assign(e, {
739
+ clearValue: a,
740
+ onControlFocusin: z,
741
+ onControlFocusout: f,
742
+ focus: M
743
+ }), e.computedCounter === void 0 && (e.computedCounter = m(() => {
744
+ if (t.counter) {
745
+ const u = typeof t.modelValue == "string" || typeof t.modelValue == "number" ? String(t.modelValue).length : Array.isArray(t.modelValue) ? t.modelValue.length : 0, y = t.maxlength !== void 0 ? t.maxlength : t.maxValues;
746
+ return u + (y !== void 0 ? " / " + y : "");
747
+ }
748
+ }));
749
+ const { isDirtyModel: R, hasRules: E, hasError: b, errorMessage: x, resetValidation: h } = An(e.focused, e.innerLoading), p = e.floatingLabel !== void 0 ? m(
750
+ () => t.stackLabel || e.focused.value || e.floatingLabel.value
751
+ ) : m(
752
+ () => t.stackLabel || e.focused.value || e.hasValue.value
753
+ ), C = m(
754
+ () => t.bottomSlots || t.hint !== void 0 || E.value || t.counter || t.error !== null
755
+ ), B = m(() => t.filled ? "filled" : t.outlined ? "outlined" : t.borderless ? "borderless" : t.standout ? "standout" : "standard"), S = m(
756
+ () => `q-field row no-wrap items-start q-field--${B.value}` + (e.fieldClass !== void 0 ? ` ${e.fieldClass.value}` : "") + (t.rounded ? " q-field--rounded" : "") + (t.square ? " q-field--square" : "") + (p.value ? " q-field--float" : "") + (A.value ? " q-field--labeled" : "") + (t.dense ? " q-field--dense" : "") + (t.itemAligned ? " q-field--item-aligned q-item-type" : "") + (e.isDark.value ? " q-field--dark" : "") + (e.getControl === void 0 ? " q-field--auto-height" : "") + (e.focused.value ? " q-field--focused" : "") + (b.value ? " q-field--error" : "") + (b.value || e.focused.value ? " q-field--highlighted" : "") + (!t.hideBottomSpace && C.value ? " q-field--with-bottom" : "") + (t.disable ? " q-field--disabled" : t.readonly ? " q-field--readonly" : "")
757
+ ), V = m(
758
+ () => "q-field__control relative-position row no-wrap" + (t.bgColor !== void 0 ? ` bg-${t.bgColor}` : "") + (b.value ? " text-negative" : typeof t.standout == "string" && t.standout.length !== 0 && e.focused.value ? ` ${t.standout}` : t.color !== void 0 ? ` text-${t.color}` : "")
759
+ ), A = m(() => t.labelSlot || t.label !== void 0), $ = m(
760
+ () => "q-field__label no-pointer-events absolute ellipsis" + (t.labelColor !== void 0 && !b.value ? ` text-${t.labelColor}` : "")
761
+ ), P = m(
762
+ () => (
763
+ // "field" is resolved on access, as the root element is only
764
+ // available after the first render
765
+ Ce(
766
+ {
767
+ id: e.targetUid.value,
768
+ editable: e.editable.value,
769
+ focused: e.focused.value,
770
+ floatingLabel: p.value,
771
+ modelValue: t.modelValue,
772
+ emitValue: e.emitValue
773
+ },
774
+ "field",
775
+ () => e.rootRef.value
776
+ )
777
+ )
778
+ ), _ = m(() => {
779
+ const u = {};
780
+ return e.targetUid.value && (u.for = e.targetUid.value), t.disable && (u["aria-disabled"] = "true"), u;
781
+ });
782
+ function q() {
783
+ var N;
784
+ const u = document.activeElement;
785
+ let y = (N = e.targetRef) == null ? void 0 : N.value;
786
+ y && (u === null || u.id !== e.targetUid.value) && (y.hasAttribute("tabindex") || (y = y.querySelector("[tabindex]")), y !== u && (y == null || y.focus({ preventScroll: !0 })));
787
+ }
788
+ function M() {
789
+ Oe(q);
790
+ }
791
+ function F() {
792
+ yt(q);
793
+ const u = document.activeElement;
794
+ u !== null && e.rootRef.value.contains(u) && u.blur();
795
+ }
796
+ function z(u) {
797
+ c !== null && (clearTimeout(c), c = null), e.editable.value && !e.focused.value && (e.focused.value = !0, n("focus", u));
798
+ }
799
+ function f(u, y) {
800
+ c !== null && clearTimeout(c), c = setTimeout(() => {
801
+ c = null, !(document.hasFocus() && (e.hasPopupOpen || e.controlRef === void 0 || e.controlRef.value === null || e.controlRef.value.contains(document.activeElement))) && (e.focused.value && (e.focused.value = !1, n("blur", u)), y == null || y());
802
+ }, 0);
803
+ }
804
+ function a(u) {
805
+ var y, N;
806
+ W(u), r.platform.is.mobile ? e.rootRef.value.contains(document.activeElement) && document.activeElement.blur() : (((y = e.targetRef) == null ? void 0 : y.value) || e.rootRef.value).focus(), t.type === "file" && (e.inputRef.value.value = null), (N = e.onClear) == null || N.call(e), n("update:modelValue", null), e.changeEvent && n("change", null), n("clear", t.modelValue), X(() => {
807
+ const H = R.value;
808
+ h(), R.value = H;
809
+ });
810
+ }
811
+ function g(u) {
812
+ [13, 32].includes(u.keyCode) && a(u);
813
+ }
814
+ function v() {
815
+ const u = [];
816
+ return o.prepend !== void 0 && u.push(
817
+ k(
818
+ "div",
819
+ {
820
+ class: "q-field__prepend q-field__marginal row no-wrap items-center",
821
+ key: "prepend",
822
+ onClick: se
823
+ },
824
+ o.prepend()
825
+ )
826
+ ), u.push(
827
+ k(
828
+ "div",
829
+ {
830
+ class: "q-field__control-container col relative-position row no-wrap q-anchor--skip"
831
+ },
832
+ d()
833
+ )
834
+ ), b.value && !t.noErrorIcon && u.push(
835
+ ye("error", [
836
+ k(ce, { name: r.iconSet.field.error, color: "negative" })
837
+ ])
838
+ ), t.loading || e.innerLoading.value ? u.push(
839
+ ye(
840
+ "inner-loading-append",
841
+ o.loading !== void 0 ? o.loading() : [k(gt, { color: t.color })]
842
+ )
843
+ ) : t.clearable && e.hasValue.value && e.editable.value && u.push(
844
+ ye("inner-clearable-append", [
845
+ k(ce, {
846
+ class: "q-field__focusable-action",
847
+ name: t.clearIcon || r.iconSet.field.clear,
848
+ tabindex: 0,
849
+ role: "button",
850
+ "aria-hidden": "false",
851
+ "aria-label": r.lang.label.clear,
852
+ onKeyup: g,
853
+ onClick: a
854
+ })
855
+ ])
856
+ ), o.append !== void 0 && u.push(
857
+ k(
858
+ "div",
859
+ {
860
+ class: "q-field__append q-field__marginal row no-wrap items-center",
861
+ key: "append",
862
+ onClick: se
863
+ },
864
+ o.append()
865
+ )
866
+ ), e.getInnerAppend !== void 0 && u.push(ye("inner-append", e.getInnerAppend())), e.getControlChild !== void 0 && u.push(e.getControlChild()), u;
867
+ }
868
+ function d() {
869
+ const u = [];
870
+ return t.prefix !== void 0 && t.prefix !== null && u.push(
871
+ k(
872
+ "div",
873
+ {
874
+ class: "q-field__prefix no-pointer-events row items-center"
875
+ },
876
+ t.prefix
877
+ )
878
+ ), e.getShadowControl !== void 0 && e.hasShadow.value && u.push(e.getShadowControl()), A.value && u.push(
879
+ k(
880
+ "div",
881
+ {
882
+ class: $.value
883
+ },
884
+ ne(o.label, t.label)
885
+ )
886
+ ), e.getControl !== void 0 ? u.push(e.getControl()) : o.rawControl !== void 0 ? u.push(o.rawControl()) : o.control !== void 0 && u.push(
887
+ k(
888
+ "div",
889
+ {
890
+ ref: e.targetRef,
891
+ class: "q-field__native row",
892
+ tabindex: -1,
893
+ ...e.splitAttrs.attributes.value,
894
+ "data-autofocus": t.autofocus || void 0
895
+ },
896
+ o.control(P.value)
897
+ )
898
+ ), t.suffix !== void 0 && t.suffix !== null && u.push(
899
+ k(
900
+ "div",
901
+ {
902
+ class: "q-field__suffix no-pointer-events row items-center"
903
+ },
904
+ t.suffix
905
+ )
906
+ ), u.concat(ne(o.default));
907
+ }
908
+ function w() {
909
+ let u, y;
910
+ b.value ? x.value !== null ? (u = [k("div", { role: "alert" }, x.value)], y = `q--slot-error-${x.value}`) : (u = ne(o.error), y = "q--slot-error") : (!t.hideHint || e.focused.value) && (t.hint !== void 0 ? (u = [k("div", t.hint)], y = `q--slot-hint-${t.hint}`) : (u = ne(o.hint), y = "q--slot-hint"));
911
+ const N = t.counter || o.counter !== void 0;
912
+ if (t.hideBottomSpace && !N && u === void 0)
913
+ return;
914
+ const H = k(
915
+ "div",
916
+ {
917
+ key: y,
918
+ class: "q-field__messages col"
919
+ },
920
+ u
921
+ );
922
+ return k(
923
+ "div",
924
+ {
925
+ class: "q-field__bottom row items-start q-field__bottom--" + (t.hideBottomSpace ? "stale" : "animated"),
926
+ onClick: se
927
+ },
928
+ [
929
+ t.hideBottomSpace ? H : k(ct, { name: "q-transition--field-message" }, () => H),
930
+ N ? k(
931
+ "div",
932
+ {
933
+ class: "q-field__counter"
934
+ },
935
+ o.counter !== void 0 ? o.counter() : e.computedCounter.value
936
+ ) : null
937
+ ]
938
+ );
939
+ }
940
+ let T = !1;
941
+ return st(() => {
942
+ T = !0;
943
+ }), ut(() => {
944
+ T && t.autofocus && i.focus();
945
+ }), t.autofocus && ge(() => {
946
+ i.focus();
947
+ }), he(() => {
948
+ c !== null && clearTimeout(c);
949
+ }), Object.assign(i, { focus: M, blur: F }), function() {
950
+ const y = e.getControl === void 0 && o.control === void 0 ? {
951
+ ...e.splitAttrs.attributes.value,
952
+ "data-autofocus": t.autofocus || void 0,
953
+ ..._.value
954
+ } : _.value;
955
+ return k(
956
+ e.tag.value,
957
+ {
958
+ ref: e.rootRef,
959
+ class: [S.value, l.class],
960
+ style: l.style,
961
+ ...y
962
+ },
963
+ [
964
+ o.before !== void 0 ? k(
965
+ "div",
966
+ {
967
+ class: "q-field__before q-field__marginal row no-wrap items-center",
968
+ onClick: se
969
+ },
970
+ o.before()
971
+ ) : null,
972
+ k(
973
+ "div",
974
+ {
975
+ class: "q-field__inner relative-position col self-stretch"
976
+ },
977
+ [
978
+ k(
979
+ "div",
980
+ {
981
+ ref: e.controlRef,
982
+ class: V.value,
983
+ tabindex: -1,
984
+ ...e.controlEvents
985
+ },
986
+ v()
987
+ ),
988
+ C.value ? w() : null
989
+ ]
990
+ ),
991
+ o.after !== void 0 ? k(
992
+ "div",
993
+ {
994
+ class: "q-field__after q-field__marginal row no-wrap items-center",
995
+ onClick: se
996
+ },
997
+ o.after()
998
+ ) : null
999
+ ]
1000
+ );
1001
+ };
1002
+ }
1003
+ function wt(e) {
1004
+ return e !== Object(e) || e.isComposing || e.qKeyEvent;
1005
+ }
1006
+ function $e(e, t) {
1007
+ return !wt(e) && [t].flat().includes(e.keyCode);
1008
+ }
1009
+ const We = {
1010
+ date: "####/##/##",
1011
+ datetime: "####/##/## ##:##",
1012
+ time: "##:##",
1013
+ fulltime: "##:##:##",
1014
+ phone: "(###) ### - ####",
1015
+ card: "#### #### #### ####"
1016
+ }, { tokenMap: Ye, tokenKeys: Kn } = /* @__PURE__ */ xt({
1017
+ "#": { pattern: "[\\d]", negate: "[^\\d]" },
1018
+ S: { pattern: "[a-zA-Z]", negate: "[^a-zA-Z]" },
1019
+ N: { pattern: "[0-9a-zA-Z]", negate: "[^0-9a-zA-Z]" },
1020
+ A: {
1021
+ pattern: "[a-zA-Z]",
1022
+ negate: "[^a-zA-Z]",
1023
+ transform: (e) => e.toLocaleUpperCase()
1024
+ },
1025
+ a: {
1026
+ pattern: "[a-zA-Z]",
1027
+ negate: "[^a-zA-Z]",
1028
+ transform: (e) => e.toLocaleLowerCase()
1029
+ },
1030
+ X: {
1031
+ pattern: "[0-9a-zA-Z]",
1032
+ negate: "[^0-9a-zA-Z]",
1033
+ transform: (e) => e.toLocaleUpperCase()
1034
+ },
1035
+ x: {
1036
+ pattern: "[0-9a-zA-Z]",
1037
+ negate: "[^0-9a-zA-Z]",
1038
+ transform: (e) => e.toLocaleLowerCase()
1039
+ }
1040
+ });
1041
+ function xt(e) {
1042
+ const t = Object.keys(e), n = {};
1043
+ return t.forEach((o) => {
1044
+ const l = e[o];
1045
+ n[o] = {
1046
+ ...l,
1047
+ regex: new RegExp(l.pattern)
1048
+ };
1049
+ }), { tokenMap: n, tokenKeys: t };
1050
+ }
1051
+ function Ct(e) {
1052
+ return new RegExp(
1053
+ // oxlint-disable-next-line no-template-curly-in-string
1054
+ "\\\\([^.*+?^${}()|([\\]])|([.*+?^${}()|[\\]])|([" + e.join("") + "])|(.)",
1055
+ "g"
1056
+ );
1057
+ }
1058
+ const Xe = /[.*+?^${}()|[\]\\]/g, Un = /* @__PURE__ */ Ct(
1059
+ Kn
1060
+ ), D = String.fromCodePoint(1), Hn = {
1061
+ mask: String,
1062
+ reverseFillMask: Boolean,
1063
+ fillMask: [Boolean, String],
1064
+ unmaskedValue: Boolean,
1065
+ maskTokens: Object
1066
+ };
1067
+ function Zn(e, t, n, o) {
1068
+ let l, i, r, c, R, E;
1069
+ const b = m(() => {
1070
+ if (e.maskTokens === void 0 || e.maskTokens === null)
1071
+ return {
1072
+ tokenMap: Ye,
1073
+ tokenRegexMask: Un
1074
+ };
1075
+ const { tokenMap: f } = xt(e.maskTokens), a = {
1076
+ ...Ye,
1077
+ ...f
1078
+ };
1079
+ return {
1080
+ tokenMap: a,
1081
+ tokenRegexMask: Ct(Object.keys(a))
1082
+ };
1083
+ }), x = I(null), h = I(C());
1084
+ function p() {
1085
+ return e.autogrow || ["textarea", "text", "search", "url", "tel", "password"].includes(
1086
+ e.type
1087
+ );
1088
+ }
1089
+ K(() => e.type + e.autogrow, S), K(
1090
+ () => e.mask,
1091
+ (f) => {
1092
+ if (f !== void 0)
1093
+ V(h.value, !0);
1094
+ else {
1095
+ const a = F(h.value);
1096
+ S(), e.modelValue !== a && t("update:modelValue", a);
1097
+ }
1098
+ }
1099
+ ), K(
1100
+ () => e.fillMask + e.reverseFillMask,
1101
+ () => {
1102
+ x.value && V(h.value, !0);
1103
+ }
1104
+ ), K(
1105
+ () => e.unmaskedValue,
1106
+ () => {
1107
+ x.value && V(h.value);
1108
+ }
1109
+ ), K(
1110
+ () => e.maskTokens,
1111
+ () => {
1112
+ x.value && V(h.value, !0);
1113
+ },
1114
+ { deep: !0 }
1115
+ );
1116
+ function C() {
1117
+ if (S(), x.value) {
1118
+ const f = q(F(e.modelValue));
1119
+ return e.fillMask !== !1 ? z(f) : f;
1120
+ }
1121
+ return e.modelValue;
1122
+ }
1123
+ function B(f) {
1124
+ if (f < l.length)
1125
+ return l.slice(-f);
1126
+ let a = "", g = l;
1127
+ const v = g.indexOf(D);
1128
+ if (v !== -1) {
1129
+ for (let d = f - g.length; d > 0; d--)
1130
+ a += D;
1131
+ g = g.slice(0, v) + a + g.slice(v);
1132
+ }
1133
+ return g;
1134
+ }
1135
+ function S() {
1136
+ if (x.value = e.mask !== void 0 && e.mask.length !== 0 && p(), !x.value) {
1137
+ c = void 0, l = "", i = "";
1138
+ return;
1139
+ }
1140
+ const f = We[e.mask] === void 0 ? e.mask : We[e.mask], a = typeof e.fillMask == "string" && e.fillMask.length !== 0 ? e.fillMask.slice(0, 1) : "_", g = a.replace(Xe, String.raw`\$&`), v = [], d = [], w = [];
1141
+ let T = e.reverseFillMask, u = "", y = "";
1142
+ f.replace(
1143
+ b.value.tokenRegexMask,
1144
+ (L, U, Q, G, J) => {
1145
+ if (G !== void 0) {
1146
+ const s = b.value.tokenMap[G];
1147
+ w.push(s), y = s.negate, T && (d.push(
1148
+ "(?:" + y + "+)?(" + s.pattern + "+)?(?:" + y + "+)?(" + s.pattern + "+)?"
1149
+ ), T = !1), d.push("(?:" + y + "+)?(" + s.pattern + ")?");
1150
+ return;
1151
+ }
1152
+ if (Q !== void 0)
1153
+ u = "\\" + (Q === "\\" ? "" : Q), w.push(Q);
1154
+ else {
1155
+ const s = U !== void 0 ? U : J;
1156
+ u = s === "\\" ? String.raw`\\\\` : s.replace(Xe, String.raw`\\$&`), w.push(s);
1157
+ }
1158
+ v.push("([^" + u + "]+)?" + u + "?");
1159
+ }
1160
+ );
1161
+ const N = new RegExp(
1162
+ "^" + v.join("") + "(" + (u === "" ? "." : "[^" + u + "]") + "+)?" + (u === "" ? "" : "[" + u + "]*") + "$"
1163
+ ), H = d.length - 1, O = d.map((L, U) => U === 0 && e.reverseFillMask ? new RegExp("^" + g + "*" + L) : U === H ? new RegExp(
1164
+ "^" + L + "(" + (y === "" ? "." : y) + "+)?" + (e.reverseFillMask ? "$" : g + "*")
1165
+ ) : new RegExp("^" + L));
1166
+ r = w, c = (L) => {
1167
+ const U = N.exec(
1168
+ e.reverseFillMask ? L : L.slice(0, w.length + 1)
1169
+ );
1170
+ U !== null && (L = U.slice(1).join(""));
1171
+ const Q = [], G = O.length;
1172
+ for (let J = 0, s = L; J < G; J++) {
1173
+ const j = O[J].exec(s);
1174
+ if (j === null)
1175
+ break;
1176
+ s = s.slice(j.shift().length), Q.push(...j);
1177
+ }
1178
+ return Q.length !== 0 ? Q.join("") : L;
1179
+ }, l = w.map((L) => typeof L == "string" ? L : D).join(""), i = l.split(D).join(a);
1180
+ }
1181
+ function V(f, a, g) {
1182
+ const v = o.value, d = (v == null ? void 0 : v.selectionEnd) ?? 0, w = v === null ? 0 : v.value.length - d, T = F(f);
1183
+ a === !0 && S();
1184
+ const u = q(T, a), y = e.fillMask !== !1 ? z(u) : u, N = h.value !== y;
1185
+ v !== null && v.value !== y && (v.value = y), N && (h.value = y), v !== null && document.activeElement === v && X(() => {
1186
+ if (y === i) {
1187
+ const O = e.reverseFillMask ? i.length : 0;
1188
+ v.setSelectionRange(O, O, "forward");
1189
+ return;
1190
+ }
1191
+ if (g === "insertFromPaste" && !e.reverseFillMask) {
1192
+ const O = v.selectionEnd;
1193
+ let L = d - 1;
1194
+ for (let U = R; U <= L && U < O; U++)
1195
+ l[U] !== D && L++;
1196
+ $.right(v, L);
1197
+ return;
1198
+ }
1199
+ if (["deleteContentBackward", "deleteContentForward"].includes(g)) {
1200
+ const O = e.reverseFillMask ? d === 0 ? y.length > u.length ? 1 : 0 : Math.max(
1201
+ 0,
1202
+ y.length - (y === i ? 0 : Math.min(u.length, w) + 1)
1203
+ ) + 1 : d;
1204
+ v.setSelectionRange(O, O, "forward");
1205
+ return;
1206
+ }
1207
+ if (e.reverseFillMask)
1208
+ if (N) {
1209
+ const O = Math.max(
1210
+ 0,
1211
+ y.length - (y === i ? 0 : Math.min(u.length, w + 1))
1212
+ );
1213
+ O === 1 && d === 1 ? v.setSelectionRange(O, O, "forward") : $.rightReverse(v, O);
1214
+ } else {
1215
+ const O = y.length - w;
1216
+ v.setSelectionRange(O, O, "backward");
1217
+ }
1218
+ else if (N) {
1219
+ const O = Math.max(
1220
+ 0,
1221
+ l.indexOf(D),
1222
+ Math.min(u.length, d) - 1
1223
+ );
1224
+ $.right(v, O);
1225
+ } else {
1226
+ const O = d - 1;
1227
+ $.right(v, O);
1228
+ }
1229
+ });
1230
+ const H = e.unmaskedValue ? F(y) : y;
1231
+ String(e.modelValue) !== H && (e.modelValue !== null || H !== "") && n(H, !0);
1232
+ }
1233
+ function A(f, a, g) {
1234
+ const v = q(F(f.value));
1235
+ a = Math.max(
1236
+ 0,
1237
+ l.indexOf(D),
1238
+ Math.min(v.length, a)
1239
+ ), R = a, f.setSelectionRange(a, g, "forward");
1240
+ }
1241
+ const $ = {
1242
+ left(f, a) {
1243
+ const g = !l.slice(a - 1).includes(D);
1244
+ let v = Math.max(0, a - 1);
1245
+ for (; v >= 0; v--)
1246
+ if (l[v] === D) {
1247
+ a = v, g && a++;
1248
+ break;
1249
+ }
1250
+ if (v < 0 && l[a] !== void 0 && l[a] !== D)
1251
+ return $.right(f, 0);
1252
+ a >= 0 && f.setSelectionRange(a, a, "backward");
1253
+ },
1254
+ right(f, a) {
1255
+ const g = f.value.length;
1256
+ let v = Math.min(g, a + 1);
1257
+ for (; v <= g; v++)
1258
+ if (l[v] === D) {
1259
+ a = v;
1260
+ break;
1261
+ } else l[v - 1] === D && (a = v);
1262
+ if (v > g && l[a - 1] !== void 0 && l[a - 1] !== D)
1263
+ return $.left(f, g);
1264
+ f.setSelectionRange(a, a, "forward");
1265
+ },
1266
+ leftReverse(f, a) {
1267
+ const g = B(f.value.length);
1268
+ let v = Math.max(0, a - 1);
1269
+ for (; v >= 0; v--)
1270
+ if (g[v - 1] === D) {
1271
+ a = v;
1272
+ break;
1273
+ } else if (g[v] === D && (a = v, v === 0))
1274
+ break;
1275
+ if (v < 0 && g[a] !== void 0 && g[a] !== D)
1276
+ return $.rightReverse(f, 0);
1277
+ a >= 0 && f.setSelectionRange(a, a, "backward");
1278
+ },
1279
+ rightReverse(f, a) {
1280
+ const g = f.value.length, v = B(g), d = !v.slice(0, a + 1).includes(D);
1281
+ let w = Math.min(g, a + 1);
1282
+ for (; w <= g; w++)
1283
+ if (v[w - 1] === D) {
1284
+ a = w, a > 0 && d && a--;
1285
+ break;
1286
+ }
1287
+ if (w > g && v[a - 1] !== void 0 && v[a - 1] !== D)
1288
+ return $.leftReverse(f, g);
1289
+ f.setSelectionRange(a, a, "forward");
1290
+ }
1291
+ };
1292
+ function P(f) {
1293
+ t("click", f), E = void 0;
1294
+ }
1295
+ function _(f) {
1296
+ if (t("keydown", f), wt(f) || f.altKey)
1297
+ return;
1298
+ const a = o.value, g = a.selectionStart, v = a.selectionEnd;
1299
+ if (f.shiftKey || (E = void 0), f.keyCode === 37 || f.keyCode === 39) {
1300
+ f.shiftKey && E === void 0 && (E = a.selectionDirection === "forward" ? g : v);
1301
+ const d = $[(f.keyCode === 39 ? "right" : "left") + (e.reverseFillMask ? "Reverse" : "")];
1302
+ if (f.preventDefault(), d(a, E === g ? v : g), f.shiftKey) {
1303
+ const w = a.selectionStart;
1304
+ a.setSelectionRange(
1305
+ Math.min(E, w),
1306
+ Math.max(E, w),
1307
+ "forward"
1308
+ );
1309
+ }
1310
+ } else f.keyCode === 8 && // Backspace
1311
+ !e.reverseFillMask && g === v ? ($.left(a, g), a.setSelectionRange(a.selectionStart, v, "backward")) : f.keyCode === 46 && // Delete
1312
+ e.reverseFillMask && g === v && ($.rightReverse(a, v), a.setSelectionRange(g, a.selectionEnd, "forward"));
1313
+ }
1314
+ function q(f, a) {
1315
+ if (f == null || f === "")
1316
+ return "";
1317
+ if (e.reverseFillMask)
1318
+ return M(f, a);
1319
+ const g = r;
1320
+ let v = 0, d = "";
1321
+ for (let w = 0; w < g.length; w++) {
1322
+ const T = f[v], u = g[w];
1323
+ if (typeof u == "string")
1324
+ d += u, a === !0 && T === u && v++;
1325
+ else if (T !== void 0 && u.regex.test(T))
1326
+ d += u.transform !== void 0 ? u.transform(T) : T, v++;
1327
+ else
1328
+ return d;
1329
+ }
1330
+ return d;
1331
+ }
1332
+ function M(f, a) {
1333
+ const g = r, v = l.indexOf(D);
1334
+ let d = f.length - 1, w = "";
1335
+ for (let T = g.length - 1; T >= 0 && d !== -1; T--) {
1336
+ const u = g[T];
1337
+ let y = f[d];
1338
+ if (typeof u == "string")
1339
+ w = u + w, a === !0 && y === u && d--;
1340
+ else if (y !== void 0 && u.regex.test(y))
1341
+ do
1342
+ w = (u.transform !== void 0 ? u.transform(y) : y) + w, d--, y = f[d];
1343
+ while (
1344
+ // oxlint-disable-next-line no-unmodified-loop-condition
1345
+ v === T && y !== void 0 && u.regex.test(y)
1346
+ );
1347
+ else
1348
+ return w;
1349
+ }
1350
+ return w;
1351
+ }
1352
+ function F(f) {
1353
+ return typeof f != "string" || c === void 0 ? typeof f == "number" ? c(String(f)) : f : c(f);
1354
+ }
1355
+ function z(f) {
1356
+ return i.length - f.length <= 0 ? f : e.reverseFillMask && f.length !== 0 ? i.slice(0, -f.length) + f : f + i.slice(f.length);
1357
+ }
1358
+ return {
1359
+ innerValue: h,
1360
+ hasMask: x,
1361
+ moveCursorForPaste: A,
1362
+ updateMaskValue: V,
1363
+ onMaskedKeydown: _,
1364
+ onMaskedClick: P
1365
+ };
1366
+ }
1367
+ const Et = {
1368
+ name: String
1369
+ };
1370
+ function Qn(e = {}) {
1371
+ return (t, n, o) => {
1372
+ t[n](
1373
+ k("input", {
1374
+ class: "hidden" + (o || ""),
1375
+ ...e.value
1376
+ })
1377
+ );
1378
+ };
1379
+ }
1380
+ function Wn(e) {
1381
+ return m(() => e.name || e.for);
1382
+ }
1383
+ function Yn(e, t) {
1384
+ function n() {
1385
+ const o = e.modelValue;
1386
+ try {
1387
+ const l = "DataTransfer" in window ? new DataTransfer() : "ClipboardEvent" in window ? new ClipboardEvent("").clipboardData : void 0;
1388
+ return Object(o) === o && ("length" in o ? [...o] : [o]).forEach((i) => {
1389
+ l.items.add(i);
1390
+ }), {
1391
+ files: l.files
1392
+ };
1393
+ } catch {
1394
+ return {
1395
+ files: void 0
1396
+ };
1397
+ }
1398
+ }
1399
+ return m(() => {
1400
+ if (e.type === "file")
1401
+ return n();
1402
+ });
1403
+ }
1404
+ const Xn = /[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFF9F\u4E00-\u9FAF\u3400-\u4DBF]/, Gn = /[\u4E00-\u9FFF\u3400-\u4DBF\u{20000}-\u{2A6DF}\u{2A700}-\u{2B73F}\u{2B740}-\u{2B81F}\u{2B820}-\u{2CEAF}\uF900-\uFAFF\u3300-\u33FF\uFE30-\uFE4F\uF900-\uFAFF\u{2F800}-\u{2FA1F}]/u, Jn = /[\u3131-\u314E\u314F-\u3163\uAC00-\uD7A3]/, eo = /[a-z0-9_ -]$/i;
1405
+ function to(e) {
1406
+ return function(n) {
1407
+ if (n.type === "compositionend" || n.type === "change") {
1408
+ if (!n.target.qComposing) return;
1409
+ n.target.qComposing = !1, e(n);
1410
+ } else n.type === "compositionupdate" && !n.target.qComposing && typeof n.data == "string" && (we.is.firefox ? !eo.test(n.data) : Xn.test(n.data) || Gn.test(n.data) || Jn.test(n.data)) && (n.target.qComposing = !0);
1411
+ };
1412
+ }
1413
+ const Ge = /* @__PURE__ */ de({
1414
+ name: "QInput",
1415
+ inheritAttrs: !1,
1416
+ props: {
1417
+ ...jn,
1418
+ ...Hn,
1419
+ ...Et,
1420
+ // override of useFieldProps > modelValue
1421
+ modelValue: [String, Number, FileList],
1422
+ modelModifiers: Object,
1423
+ shadowText: String,
1424
+ type: {
1425
+ type: String,
1426
+ default: "text"
1427
+ },
1428
+ debounce: [String, Number],
1429
+ autogrow: Boolean,
1430
+ // makes a textarea
1431
+ inputClass: [Array, String, Object],
1432
+ inputStyle: [Array, String, Object]
1433
+ },
1434
+ emits: [
1435
+ ...Dn,
1436
+ "paste",
1437
+ "change",
1438
+ "keydown",
1439
+ "click",
1440
+ "animationend"
1441
+ ],
1442
+ setup(e, { emit: t, attrs: n }) {
1443
+ const { proxy: o } = Y(), { $q: l } = o, i = {};
1444
+ let r = Number.NaN, c = !1, R = !1, E = null, b;
1445
+ const x = I(null), h = Wn(e), {
1446
+ innerValue: p,
1447
+ hasMask: C,
1448
+ moveCursorForPaste: B,
1449
+ updateMaskValue: S,
1450
+ onMaskedKeydown: V,
1451
+ onMaskedClick: A
1452
+ } = Zn(e, t, N, x), $ = Yn(
1453
+ e
1454
+ ), P = m(() => Ve(p.value)), _ = to(u);
1455
+ function q(s) {
1456
+ if (C.value && s.type === "compositionstart") {
1457
+ s.target.qComposing = !0;
1458
+ return;
1459
+ }
1460
+ _(s);
1461
+ }
1462
+ const M = zn({ changeEvent: !0 }), F = m(
1463
+ () => e.type === "textarea" || e.autogrow
1464
+ ), z = m(
1465
+ () => F.value || ["text", "search", "url", "tel", "password"].includes(e.type)
1466
+ ), f = m(() => {
1467
+ const s = {
1468
+ ...M.splitAttrs.listeners.value,
1469
+ onInput: u,
1470
+ onPaste: T,
1471
+ // Safari < 10.2 & UIWebView doesn't fire compositionend when
1472
+ // switching focus before confirming composition choice
1473
+ // this also fixes the issue where some browsers e.g. iOS Chrome
1474
+ // fires "change" instead of "input" on autocomplete.
1475
+ onChange: U,
1476
+ onBlur: Q,
1477
+ onFocus: xe
1478
+ };
1479
+ return s.onCompositionstart = s.onCompositionupdate = s.onCompositionend = q, C.value && (s.onKeydown = V, s.onClick = A), e.autogrow && (s.onAnimationend = y), s;
1480
+ }), a = m(() => {
1481
+ const s = {
1482
+ tabindex: 0,
1483
+ "data-autofocus": e.autofocus || void 0,
1484
+ rows: e.type === "textarea" ? 6 : void 0,
1485
+ "aria-label": e.label,
1486
+ name: h.value,
1487
+ ...M.splitAttrs.attributes.value,
1488
+ id: M.targetUid.value,
1489
+ maxlength: e.maxlength,
1490
+ disabled: e.disable,
1491
+ readonly: e.readonly
1492
+ };
1493
+ return F.value || (s.type = e.type), e.autogrow && (s.rows = 1), s;
1494
+ });
1495
+ K(
1496
+ () => e.type,
1497
+ () => {
1498
+ x.value && (x.value.value = e.modelValue);
1499
+ }
1500
+ ), K(
1501
+ () => e.modelValue,
1502
+ (s) => {
1503
+ var j;
1504
+ if (E !== null && (H(), c = !1, R = !1, delete i.value), C.value) {
1505
+ if (R && (R = !1, String(s) === r))
1506
+ return;
1507
+ S(s);
1508
+ } else p.value !== s && (p.value = s, e.type === "number" && Object.hasOwn(i, "value") && (c ? c = !1 : delete i.value), ((j = e.modelModifiers) == null ? void 0 : j.trim) === !0 && Object.hasOwn(i, "value") && (typeof i.value != "string" || i.value.trim() !== s) && delete i.value);
1509
+ e.autogrow && X(L);
1510
+ }
1511
+ ), K(
1512
+ () => e.autogrow,
1513
+ (s) => {
1514
+ s ? X(L) : x.value !== null && n.rows > 0 && (x.value.style.height = "auto");
1515
+ }
1516
+ ), K(
1517
+ () => e.dense,
1518
+ () => {
1519
+ e.autogrow && X(L);
1520
+ }
1521
+ );
1522
+ function g() {
1523
+ const s = document.activeElement;
1524
+ x.value !== null && x.value !== s && (s === null || s.id !== M.targetUid.value) && x.value.focus({ preventScroll: !0 });
1525
+ }
1526
+ function v() {
1527
+ Oe(g);
1528
+ }
1529
+ function d() {
1530
+ yt(g);
1531
+ const s = document.activeElement;
1532
+ s !== null && M.rootRef.value.contains(s) && s.blur();
1533
+ }
1534
+ function w() {
1535
+ var s;
1536
+ (s = x.value) == null || s.select();
1537
+ }
1538
+ function T(s) {
1539
+ if (C.value && e.reverseFillMask !== !0) {
1540
+ const j = s.target;
1541
+ B(j, j.selectionStart, j.selectionEnd);
1542
+ }
1543
+ t("paste", s);
1544
+ }
1545
+ function u(s) {
1546
+ var ee;
1547
+ if (!s || !s.target) return;
1548
+ if (e.type === "file") {
1549
+ t("update:modelValue", s.target.files);
1550
+ return;
1551
+ }
1552
+ const j = s.target.value;
1553
+ if (s.target.qComposing) {
1554
+ i.value = j;
1555
+ return;
1556
+ }
1557
+ if (C.value)
1558
+ S(j, !1, s.inputType);
1559
+ else if (((ee = e.modelModifiers) == null ? void 0 : ee.trim) === !0 && (i.value = j), N(j), z.value && s.target === document.activeElement) {
1560
+ const { selectionStart: fe, selectionEnd: be } = s.target;
1561
+ fe !== void 0 && be !== void 0 && X(() => {
1562
+ s.target === document.activeElement && j.indexOf(s.target.value) === 0 && s.target.setSelectionRange(fe, be);
1563
+ });
1564
+ }
1565
+ e.autogrow && L();
1566
+ }
1567
+ function y(s) {
1568
+ t("animationend", s), L();
1569
+ }
1570
+ function N(s, j) {
1571
+ b = () => {
1572
+ var ee;
1573
+ E = null, e.type !== "number" && (((ee = e.modelModifiers) == null ? void 0 : ee.trim) !== !0 || C.value) && Object.hasOwn(i, "value") && delete i.value, e.modelValue !== s && r !== s && (r = s, j === !0 && (R = !0), t("update:modelValue", s), X(() => {
1574
+ r === s && (r = Number.NaN);
1575
+ })), b = void 0;
1576
+ }, e.type === "number" && (c = !0, i.value = s), e.debounce !== void 0 ? (E !== null && clearTimeout(E), i.value = s, E = setTimeout(b, e.debounce)) : b();
1577
+ }
1578
+ function H() {
1579
+ E !== null && (clearTimeout(E), E = null), b = void 0;
1580
+ }
1581
+ function O() {
1582
+ H(), c = !1, R = !1, delete i.value;
1583
+ }
1584
+ function L() {
1585
+ requestAnimationFrame(() => {
1586
+ const s = x.value;
1587
+ if (s !== null) {
1588
+ const j = s.parentNode.style, { scrollTop: ee } = s, { overflowY: fe, maxHeight: be } = l.platform.is.firefox ? {} : window.getComputedStyle(s), Le = fe !== void 0 && fe !== "scroll";
1589
+ Le && (s.style.overflowY = "hidden"), j.marginBottom = s.scrollHeight - 1 + "px", s.style.height = "1px", s.style.height = s.scrollHeight + "px", Le && (s.style.overflowY = Number.parseInt(be, 10) < s.scrollHeight ? "auto" : "hidden"), j.marginBottom = "", s.scrollTop = ee;
1590
+ }
1591
+ });
1592
+ }
1593
+ function U(s) {
1594
+ q(s), E !== null && (clearTimeout(E), E = null), b == null || b(), t("change", s.target.value);
1595
+ }
1596
+ function Q(s) {
1597
+ s !== void 0 && xe(s), E !== null && (clearTimeout(E), E = null), b == null || b(), c = !1, R = !1, delete i.value, e.type !== "file" && setTimeout(() => {
1598
+ x.value !== null && (x.value.value = p.value !== void 0 ? p.value : "");
1599
+ }, 0);
1600
+ }
1601
+ function G() {
1602
+ return Object.hasOwn(i, "value") ? i.value : p.value !== void 0 ? p.value : "";
1603
+ }
1604
+ he(() => {
1605
+ Q();
1606
+ }), ge(() => {
1607
+ e.autogrow && L();
1608
+ }), Object.assign(M, {
1609
+ innerValue: p,
1610
+ fieldClass: m(
1611
+ () => `q-${F.value ? "textarea" : "input"}` + (e.autogrow ? " q-textarea--autogrow" : "")
1612
+ ),
1613
+ hasShadow: m(
1614
+ () => e.type !== "file" && typeof e.shadowText == "string" && e.shadowText.length !== 0
1615
+ ),
1616
+ inputRef: x,
1617
+ emitValue: N,
1618
+ onClear: O,
1619
+ hasValue: P,
1620
+ floatingLabel: m(
1621
+ () => P.value && (e.type !== "number" || Number.isFinite(Number(p.value))) || Ve(e.displayValue)
1622
+ ),
1623
+ getControl: () => k(F.value ? "textarea" : "input", {
1624
+ ref: x,
1625
+ class: ["q-field__native q-placeholder", e.inputClass],
1626
+ style: e.inputStyle,
1627
+ ...a.value,
1628
+ ...f.value,
1629
+ ...e.type !== "file" ? { value: G() } : $.value
1630
+ }),
1631
+ getShadowControl: () => k(
1632
+ "div",
1633
+ {
1634
+ class: "q-field__native q-field__shadow absolute-bottom no-pointer-events" + (F.value ? "" : " text-no-wrap")
1635
+ },
1636
+ [
1637
+ k("span", { class: "invisible" }, G()),
1638
+ k("span", e.shadowText)
1639
+ ]
1640
+ )
1641
+ });
1642
+ const J = Nn(M);
1643
+ return Object.assign(o, {
1644
+ focus: v,
1645
+ blur: d,
1646
+ select: w,
1647
+ getNativeElement: () => x.value
1648
+ // deprecated
1649
+ }), Ce(o, "nativeEl", () => x.value), J;
1650
+ }
1651
+ });
1652
+ function no(e, t) {
1653
+ const n = I(null), o = m(() => e.disable ? null : k("span", {
1654
+ ref: n,
1655
+ class: "no-outline",
1656
+ tabindex: -1
1657
+ }));
1658
+ function l(i) {
1659
+ const r = t.value;
1660
+ (i == null ? void 0 : i.qAvoidFocus) !== !0 && ((i == null ? void 0 : i.type.indexOf("key")) === 0 ? document.activeElement !== r && (r == null ? void 0 : r.contains(document.activeElement)) === !0 && r.focus({ preventScroll: !0 }) : n.value !== null && (i === void 0 || (r == null ? void 0 : r.contains(i.target)) === !0) && n.value.focus({ preventScroll: !0 }));
1661
+ }
1662
+ return {
1663
+ refocusTargetEl: o,
1664
+ refocusTarget: l
1665
+ };
1666
+ }
1667
+ const oo = {
1668
+ xs: 30,
1669
+ sm: 35,
1670
+ md: 40,
1671
+ lg: 50,
1672
+ xl: 60
1673
+ }, lo = {
1674
+ ...bt,
1675
+ ...Te,
1676
+ ...Et,
1677
+ modelValue: {
1678
+ required: !0,
1679
+ default: null
1680
+ },
1681
+ val: {},
1682
+ trueValue: { default: !0 },
1683
+ falseValue: { default: !1 },
1684
+ indeterminateValue: { default: null },
1685
+ checkedIcon: String,
1686
+ uncheckedIcon: String,
1687
+ indeterminateIcon: String,
1688
+ toggleOrder: {
1689
+ type: String,
1690
+ validator: (e) => e === "tf" || e === "ft"
1691
+ },
1692
+ toggleIndeterminate: Boolean,
1693
+ label: String,
1694
+ leftLabel: Boolean,
1695
+ color: String,
1696
+ keepColor: Boolean,
1697
+ dense: Boolean,
1698
+ disable: Boolean,
1699
+ tabindex: [String, Number]
1700
+ }, ao = ["update:modelValue"];
1701
+ function io(e) {
1702
+ (e.keyCode === 13 || e.keyCode === 32) && W(e);
1703
+ }
1704
+ function ro(e, t) {
1705
+ const { props: n, slots: o, emit: l, proxy: i } = Y(), { $q: r } = i, c = pt(n, r), R = I(null), { refocusTargetEl: E, refocusTarget: b } = no(n, R), x = Pe(n, oo), h = m(
1706
+ () => n.val !== void 0 && Array.isArray(n.modelValue)
1707
+ ), p = m(() => {
1708
+ const a = oe(n.val);
1709
+ return h.value ? n.modelValue.findIndex((g) => oe(g) === a) : -1;
1710
+ }), C = m(
1711
+ () => h.value ? p.value !== -1 : oe(n.modelValue) === oe(n.trueValue)
1712
+ ), B = m(
1713
+ () => h.value ? p.value === -1 : oe(n.modelValue) === oe(n.falseValue)
1714
+ ), S = m(() => !C.value && !B.value), V = m(() => n.disable ? -1 : n.tabindex || 0), A = m(
1715
+ () => `q-${e} cursor-pointer no-outline row inline no-wrap items-center` + (n.disable ? " disabled" : "") + (c.value ? ` q-${e}--dark` : "") + (n.dense ? ` q-${e}--dense` : "") + (n.leftLabel ? " reverse" : "")
1716
+ ), $ = m(() => {
1717
+ const a = C.value ? "truthy" : B.value ? "falsy" : "indet", g = n.color !== void 0 && (n.keepColor || !B.value) ? ` text-${n.color}` : "";
1718
+ return `q-${e}__inner relative-position non-selectable q-${e}__inner--${a}${g}`;
1719
+ }), P = m(() => {
1720
+ const a = { type: "checkbox" };
1721
+ return n.name !== void 0 && Object.assign(a, {
1722
+ // see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
1723
+ ".checked": C.value,
1724
+ "^checked": C.value ? "checked" : void 0,
1725
+ name: n.name,
1726
+ value: h.value ? n.val : n.trueValue
1727
+ }), a;
1728
+ }), _ = Qn(P), q = m(() => {
1729
+ const a = {
1730
+ tabindex: V.value,
1731
+ role: "checkbox",
1732
+ "aria-label": n.label,
1733
+ "aria-checked": S.value ? "mixed" : C.value ? "true" : "false"
1734
+ };
1735
+ return n.disable && (a["aria-disabled"] = "true"), a;
1736
+ });
1737
+ function M(a) {
1738
+ a !== void 0 && (W(a), b(a)), n.disable || l("update:modelValue", F(), a);
1739
+ }
1740
+ function F() {
1741
+ if (h.value) {
1742
+ if (C.value) {
1743
+ const a = [...n.modelValue];
1744
+ return a.splice(p.value, 1), a;
1745
+ }
1746
+ return [...n.modelValue, n.val];
1747
+ }
1748
+ if (C.value) {
1749
+ if (n.toggleOrder !== "ft" || !n.toggleIndeterminate)
1750
+ return n.falseValue;
1751
+ } else if (B.value) {
1752
+ if (n.toggleOrder === "ft" || !n.toggleIndeterminate)
1753
+ return n.trueValue;
1754
+ } else
1755
+ return n.toggleOrder !== "ft" ? n.trueValue : n.falseValue;
1756
+ return n.indeterminateValue;
1757
+ }
1758
+ function z(a) {
1759
+ (a.keyCode === 13 || a.keyCode === 32) && M(a);
1760
+ }
1761
+ const f = t(C, S);
1762
+ return Object.assign(i, { toggle: M }), () => {
1763
+ const a = f();
1764
+ n.disable || _(
1765
+ a,
1766
+ "unshift",
1767
+ ` q-${e}__native absolute q-ma-none q-pa-none`
1768
+ );
1769
+ const g = [
1770
+ k(
1771
+ "div",
1772
+ {
1773
+ class: $.value,
1774
+ style: x.value,
1775
+ "aria-hidden": "true"
1776
+ },
1777
+ a
1778
+ )
1779
+ ];
1780
+ E.value !== null && g.push(E.value);
1781
+ const v = n.label !== void 0 ? ue(o.default, [n.label]) : ne(o.default);
1782
+ return v !== void 0 && g.push(
1783
+ k(
1784
+ "div",
1785
+ {
1786
+ class: `q-${e}__label q-anchor--skip`
1787
+ },
1788
+ v
1789
+ )
1790
+ ), k(
1791
+ "div",
1792
+ {
1793
+ ref: R,
1794
+ class: A.value,
1795
+ ...q.value,
1796
+ onClick: M,
1797
+ onKeydown: io,
1798
+ onKeyup: z
1799
+ },
1800
+ g
1801
+ );
1802
+ };
1803
+ }
1804
+ const so = () => k(
1805
+ "div",
1806
+ {
1807
+ key: "svg",
1808
+ class: "q-checkbox__bg absolute"
1809
+ },
1810
+ [
1811
+ k(
1812
+ "svg",
1813
+ {
1814
+ class: "q-checkbox__svg fit absolute-full",
1815
+ viewBox: "0 0 24 24"
1816
+ },
1817
+ [
1818
+ k("path", {
1819
+ class: "q-checkbox__truthy",
1820
+ fill: "none",
1821
+ d: "M1.73,12.91 8.1,19.28 22.79,4.59"
1822
+ }),
1823
+ k("path", {
1824
+ class: "q-checkbox__indet",
1825
+ d: "M4,14H20V10H4"
1826
+ })
1827
+ ]
1828
+ )
1829
+ ]
1830
+ ), uo = /* @__PURE__ */ de({
1831
+ name: "QCheckbox",
1832
+ props: lo,
1833
+ emits: ao,
1834
+ setup(e) {
1835
+ const t = so();
1836
+ function n(o, l) {
1837
+ const i = m(
1838
+ () => (o.value ? e.checkedIcon : l.value ? e.indeterminateIcon : e.uncheckedIcon) || null
1839
+ );
1840
+ return () => i.value !== null ? [
1841
+ k(
1842
+ "div",
1843
+ {
1844
+ key: "icon",
1845
+ class: "q-checkbox__icon-container absolute-full flex flex-center no-wrap"
1846
+ },
1847
+ [
1848
+ k(ce, {
1849
+ class: "q-checkbox__icon",
1850
+ name: i.value
1851
+ })
1852
+ ]
1853
+ )
1854
+ ] : [t];
1855
+ }
1856
+ return ro("checkbox", n);
1857
+ }
1858
+ });
1859
+ function co(e, t) {
1860
+ const n = e.style;
1861
+ for (const o in t)
1862
+ n[o] = t[o];
1863
+ }
1864
+ function fo(e, t = 250) {
1865
+ let n = !1, o;
1866
+ return function(...i) {
1867
+ return n || (n = !0, setTimeout(() => {
1868
+ n = !1;
1869
+ }, t), o = e.apply(this, i)), o;
1870
+ };
1871
+ }
1872
+ function Je(e, t, n, o) {
1873
+ n.modifiers.stop && xe(e);
1874
+ const l = n.modifiers.color, i = n.modifiers.center || o === !0, r = document.createElement("span"), c = document.createElement("span"), R = Tn(e), { left: E, top: b, width: x, height: h } = t.getBoundingClientRect(), p = Math.hypot(x, h), C = p / 2, B = `${(x - p) / 2}px`, S = i ? B : `${R.left - E - C}px`, V = `${(h - p) / 2}px`, A = i ? V : `${R.top - b - C}px`;
1875
+ c.className = "q-ripple__inner", co(c, {
1876
+ height: `${p}px`,
1877
+ width: `${p}px`,
1878
+ transform: `translate3d(${S},${A},0) scale3d(.2,.2,1)`,
1879
+ opacity: 0
1880
+ }), r.className = `q-ripple${l ? " text-" + l : ""}`, r.setAttribute("dir", "ltr"), r.append(c), t.append(r);
1881
+ const $ = () => {
1882
+ r.remove(), clearTimeout(P);
1883
+ };
1884
+ n.abort.push($);
1885
+ let P = setTimeout(() => {
1886
+ c.classList.add("q-ripple__inner--enter"), c.style.transform = `translate3d(${B},${V},0) scale3d(1,1,1)`, c.style.opacity = 0.2, P = setTimeout(() => {
1887
+ c.classList.remove("q-ripple__inner--enter"), c.classList.add("q-ripple__inner--leave"), c.style.opacity = 0, P = setTimeout(() => {
1888
+ r.remove(), n.abort.splice(n.abort.indexOf($), 1);
1889
+ }, 275);
1890
+ }, 250);
1891
+ }, 50);
1892
+ }
1893
+ function et(e, { modifiers: t, value: n, arg: o }) {
1894
+ const l = { ...e.cfg.ripple, ...t, ...n };
1895
+ e.modifiers = {
1896
+ early: l.early === !0,
1897
+ stop: l.stop === !0,
1898
+ center: l.center === !0,
1899
+ color: l.color || o,
1900
+ keyCodes: [l.keyCodes || 13].flat()
1901
+ };
1902
+ }
1903
+ const vo = /* @__PURE__ */ At(
1904
+ {
1905
+ name: "ripple",
1906
+ beforeMount(e, t) {
1907
+ const n = t.instance.$.appContext.config.globalProperties.$q.config || {};
1908
+ if (n.ripple === !1) return;
1909
+ const o = {
1910
+ cfg: n,
1911
+ enabled: t.value !== !1,
1912
+ modifiers: {},
1913
+ abort: [],
1914
+ start(l) {
1915
+ o.enabled && !l.qSkipRipple && l.type === (o.modifiers.early ? "pointerdown" : "click") && Je(l, e, o, l.qKeyEvent === !0);
1916
+ },
1917
+ keystart: fo((l) => {
1918
+ o.enabled && !l.qSkipRipple && $e(l, o.modifiers.keyCodes) && l.type === `key${o.modifiers.early ? "down" : "up"}` && Je(l, e, o, !0);
1919
+ }, 300)
1920
+ };
1921
+ et(o, t), e.__qripple = o, Pn(o, "main", [
1922
+ [e, "pointerdown", "start", "passive"],
1923
+ [e, "click", "start", "passive"],
1924
+ [e, "keydown", "keystart", "passive"],
1925
+ [e, "keyup", "keystart", "passive"]
1926
+ ]);
1927
+ },
1928
+ updated(e, t) {
1929
+ if (t.oldValue !== t.value) {
1930
+ const n = e.__qripple;
1931
+ n !== void 0 && (n.enabled = t.value !== !1, n.enabled && Object(t.value) === t.value && et(n, t));
1932
+ }
1933
+ },
1934
+ beforeUnmount(e) {
1935
+ const t = e.__qripple;
1936
+ t !== void 0 && (t.abort.forEach((n) => {
1937
+ n();
1938
+ }), On(t, "main"), delete e.__qripple);
1939
+ }
1940
+ }
1941
+ ), St = {
1942
+ left: "start",
1943
+ center: "center",
1944
+ right: "end",
1945
+ between: "between",
1946
+ around: "around",
1947
+ evenly: "evenly",
1948
+ stretch: "stretch"
1949
+ }, mo = Object.keys(St), go = {
1950
+ align: {
1951
+ type: String,
1952
+ validator: (e) => mo.includes(e)
1953
+ }
1954
+ };
1955
+ function ho(e) {
1956
+ return m(() => {
1957
+ const t = e.align === void 0 ? e.vertical ? "stretch" : "left" : e.align;
1958
+ return `${e.vertical ? "items" : "justify"}-${St[t]}`;
1959
+ });
1960
+ }
1961
+ function bo(e) {
1962
+ return e.appContext.config.globalProperties.$router !== void 0;
1963
+ }
1964
+ function po(e) {
1965
+ return e.isUnmounted === !0 || e.isDeactivated === !0;
1966
+ }
1967
+ function tt(e) {
1968
+ return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
1969
+ }
1970
+ function nt(e, t) {
1971
+ return (e.aliasOf || e) === (t.aliasOf || t);
1972
+ }
1973
+ function ko(e, t) {
1974
+ for (const n in t) {
1975
+ const o = t[n], l = e[n];
1976
+ if (typeof o == "string") {
1977
+ if (o !== l) return !1;
1978
+ } else if (!Array.isArray(l) || l.length !== o.length || o.some((i, r) => i !== l[r]))
1979
+ return !1;
1980
+ }
1981
+ return !0;
1982
+ }
1983
+ function ot(e, t) {
1984
+ return Array.isArray(t) ? e.length === t.length && e.every((n, o) => n === t[o]) : e.length === 1 && e[0] === t;
1985
+ }
1986
+ function yo(e, t) {
1987
+ return Array.isArray(e) ? ot(e, t) : Array.isArray(t) ? ot(t, e) : e === t;
1988
+ }
1989
+ function wo(e, t) {
1990
+ if (Object.keys(e).length !== Object.keys(t).length)
1991
+ return !1;
1992
+ for (const n in e)
1993
+ if (!yo(e[n], t[n]))
1994
+ return !1;
1995
+ return !0;
1996
+ }
1997
+ const xo = {
1998
+ // router-link
1999
+ to: [String, Object],
2000
+ replace: Boolean,
2001
+ // regular <a> link
2002
+ href: String,
2003
+ target: String,
2004
+ // state
2005
+ disable: Boolean
2006
+ };
2007
+ function Co({
2008
+ fallbackTag: e,
2009
+ useDisableForRouterLinkProps: t = !0
2010
+ } = {}) {
2011
+ const n = Y(), { props: o, proxy: l, emit: i } = n, r = bo(n), c = m(() => !o.disable && o.href !== void 0), R = t ? m(
2012
+ () => r && !o.disable && !c.value && o.to !== void 0 && o.to !== null && o.to !== ""
2013
+ ) : m(
2014
+ () => r && !c.value && o.to !== void 0 && o.to !== null && o.to !== ""
2015
+ ), E = m(
2016
+ () => R.value ? A(o.to) : null
2017
+ ), b = m(() => E.value !== null), x = m(() => c.value || b.value), h = m(
2018
+ () => o.type === "a" || x.value ? "a" : o.tag || e || "div"
2019
+ ), p = m(
2020
+ () => c.value ? {
2021
+ href: o.href,
2022
+ target: o.target
2023
+ } : b.value ? {
2024
+ href: E.value.href,
2025
+ target: o.target
2026
+ } : {}
2027
+ ), C = m(() => {
2028
+ if (!b.value) return -1;
2029
+ const { matched: _ } = E.value, { length: q } = _, M = _[q - 1];
2030
+ if (M === void 0)
2031
+ return -1;
2032
+ const F = l.$route.matched;
2033
+ if (F.length === 0)
2034
+ return -1;
2035
+ const z = F.findIndex(
2036
+ nt.bind(null, M)
2037
+ );
2038
+ if (z !== -1) return z;
2039
+ const f = tt(_[q - 2]);
2040
+ return (
2041
+ // we are dealing with nested routes
2042
+ q > 1 && // if the parent and matched route have the same path, this link is
2043
+ // referring to the empty child. Or we currently are on a different
2044
+ // child of the same parent
2045
+ tt(M) === f && // avoid comparing the child with its parent
2046
+ F.at(-1).path !== f ? F.findIndex(
2047
+ nt.bind(null, _[q - 2])
2048
+ ) : z
2049
+ );
2050
+ }), B = m(
2051
+ () => b.value && C.value !== -1 && ko(l.$route.params, E.value.params)
2052
+ ), S = m(
2053
+ () => B.value && C.value === l.$route.matched.length - 1 && wo(l.$route.params, E.value.params)
2054
+ ), V = m(
2055
+ () => b.value ? S.value ? ` ${o.exactActiveClass} ${o.activeClass}` : o.exact ? "" : B.value ? ` ${o.activeClass}` : "" : ""
2056
+ );
2057
+ function A(_) {
2058
+ try {
2059
+ return l.$router.resolve(_);
2060
+ } catch {
2061
+ }
2062
+ return null;
2063
+ }
2064
+ function $(_, { returnRouterError: q, to: M = o.to, replace: F = o.replace } = {}) {
2065
+ if (o.disable)
2066
+ return _.preventDefault(), Promise.resolve(!1);
2067
+ if (
2068
+ // don't redirect with control keys;
2069
+ // should match RouterLink from Vue Router
2070
+ _.metaKey || _.altKey || _.ctrlKey || _.shiftKey || // don't redirect on right click
2071
+ _.button !== void 0 && _.button !== 0 || // don't redirect if it should open in a new window
2072
+ o.target === "_blank"
2073
+ )
2074
+ return Promise.resolve(!1);
2075
+ _.preventDefault();
2076
+ const z = l.$router[F ? "replace" : "push"](M);
2077
+ return q ? z : (
2078
+ // else catching hard errors and also "soft" ones - then(err => ...)
2079
+ z.then(() => {
2080
+ }).catch(() => {
2081
+ })
2082
+ );
2083
+ }
2084
+ function P(_) {
2085
+ if (b.value) {
2086
+ const q = (M) => $(_, M);
2087
+ i("click", _, q), _.defaultPrevented || q();
2088
+ } else
2089
+ i("click", _);
2090
+ }
2091
+ return {
2092
+ hasRouterLink: b,
2093
+ hasHrefLink: c,
2094
+ hasLink: x,
2095
+ linkTag: h,
2096
+ resolvedLink: E,
2097
+ linkIsActive: B,
2098
+ linkIsExactActive: S,
2099
+ linkClass: V,
2100
+ linkAttrs: p,
2101
+ getLink: A,
2102
+ navigateToRouterLink: $,
2103
+ navigateOnClick: P
2104
+ };
2105
+ }
2106
+ const lt = {
2107
+ none: 0,
2108
+ xs: 4,
2109
+ sm: 8,
2110
+ md: 16,
2111
+ lg: 24,
2112
+ xl: 32
2113
+ }, Eo = {
2114
+ xs: 8,
2115
+ sm: 10,
2116
+ md: 14,
2117
+ lg: 20,
2118
+ xl: 24
2119
+ }, So = ["button", "submit", "reset"], Ro = /[^\s]\/[^\s]/, qo = ["flat", "outline", "push", "unelevated"];
2120
+ function Mo(e, t) {
2121
+ return e.flat ? "flat" : e.outline ? "outline" : e.push ? "push" : e.unelevated ? "unelevated" : t;
2122
+ }
2123
+ const _o = {
2124
+ ...Te,
2125
+ ...xo,
2126
+ type: {
2127
+ type: String,
2128
+ default: "button"
2129
+ },
2130
+ label: [Number, String],
2131
+ icon: String,
2132
+ iconRight: String,
2133
+ ...qo.reduce((e, t) => (e[t] = Boolean) && e, {}),
2134
+ square: Boolean,
2135
+ rounded: Boolean,
2136
+ glossy: Boolean,
2137
+ size: String,
2138
+ fab: Boolean,
2139
+ fabMini: Boolean,
2140
+ padding: String,
2141
+ color: String,
2142
+ textColor: String,
2143
+ noCaps: Boolean,
2144
+ noWrap: Boolean,
2145
+ dense: Boolean,
2146
+ tabindex: [Number, String],
2147
+ ripple: {
2148
+ type: [Boolean, Object],
2149
+ default: !0
2150
+ },
2151
+ align: {
2152
+ ...go.align,
2153
+ default: "center"
2154
+ },
2155
+ stack: Boolean,
2156
+ stretch: Boolean,
2157
+ loading: {
2158
+ type: Boolean,
2159
+ default: null
2160
+ },
2161
+ disable: Boolean
2162
+ }, Fo = {
2163
+ ..._o,
2164
+ round: Boolean
2165
+ };
2166
+ function Bo(e) {
2167
+ const t = Pe(e, Eo), n = ho(e), { hasRouterLink: o, hasLink: l, linkTag: i, linkAttrs: r, navigateOnClick: c } = Co({
2168
+ fallbackTag: "button"
2169
+ }), R = m(() => {
2170
+ const S = e.fab || e.fabMini ? {} : t.value;
2171
+ return e.padding !== void 0 ? {
2172
+ ...S,
2173
+ padding: e.padding.split(/\s+/).map((V) => V in lt ? lt[V] + "px" : V).join(" "),
2174
+ minWidth: "0",
2175
+ minHeight: "0"
2176
+ } : S;
2177
+ }), E = m(() => e.rounded || e.fab || e.fabMini), b = m(() => !e.disable && !e.loading), x = m(
2178
+ () => b.value ? e.tabindex || 0 : -1
2179
+ ), h = m(() => Mo(e, "standard")), p = m(() => {
2180
+ const S = { tabindex: x.value };
2181
+ return l.value ? Object.assign(S, r.value) : So.includes(e.type) && (S.type = e.type), i.value === "a" ? (e.disable ? S["aria-disabled"] = "true" : S.href === void 0 && (S.role = "button"), !o.value && Ro.test(e.type) && (S.type = e.type)) : e.disable && (S.disabled = "", S["aria-disabled"] = "true"), e.loading && e.percentage !== void 0 && Object.assign(S, {
2182
+ role: "progressbar",
2183
+ "aria-valuemin": 0,
2184
+ "aria-valuemax": 100,
2185
+ "aria-valuenow": e.percentage
2186
+ }), S;
2187
+ }), C = m(() => {
2188
+ let S;
2189
+ e.color !== void 0 ? S = e.flat || e.outline ? `text-${e.textColor || e.color}` : `bg-${e.color} text-${e.textColor || "white"}` : e.textColor && (S = `text-${e.textColor}`);
2190
+ const V = e.round ? "round" : `rectangle${E.value ? " q-btn--rounded" : e.square ? " q-btn--square" : ""}`;
2191
+ return `q-btn--${h.value} q-btn--${V}` + (S !== void 0 ? " " + S : "") + (b.value ? " q-btn--actionable q-focusable q-hoverable" : e.disable ? " disabled" : "") + (e.fab ? " q-btn--fab" : e.fabMini ? " q-btn--fab-mini" : "") + (e.noCaps ? " q-btn--no-uppercase" : "") + (e.dense ? " q-btn--dense" : "") + (e.stretch ? " no-border-radius self-stretch" : "") + (e.glossy ? " glossy" : "") + (e.square ? " q-btn--square" : "");
2192
+ }), B = m(
2193
+ () => n.value + (e.stack ? " column" : " row") + (e.noWrap ? " no-wrap text-no-wrap" : "") + (e.loading ? " q-btn__content--hidden" : "")
2194
+ );
2195
+ return {
2196
+ classes: C,
2197
+ style: R,
2198
+ innerClasses: B,
2199
+ attributes: p,
2200
+ hasLink: l,
2201
+ linkTag: i,
2202
+ navigateOnClick: c,
2203
+ isActionable: b
2204
+ };
2205
+ }
2206
+ const { passiveCapture: Z } = Ee;
2207
+ let le = null, ae = null, ie = null;
2208
+ function ve(e) {
2209
+ W(e), e.qSkipRipple = !0;
2210
+ }
2211
+ const Rt = /* @__PURE__ */ de({
2212
+ name: "QBtn",
2213
+ props: {
2214
+ ...Fo,
2215
+ percentage: Number,
2216
+ darkPercentage: Boolean,
2217
+ onTouchstart: [Function, Array]
2218
+ },
2219
+ emits: ["click", "keydown", "mousedown", "keyup"],
2220
+ setup(e, { slots: t, emit: n }) {
2221
+ const { proxy: o } = Y(), {
2222
+ classes: l,
2223
+ style: i,
2224
+ innerClasses: r,
2225
+ attributes: c,
2226
+ hasLink: R,
2227
+ linkTag: E,
2228
+ navigateOnClick: b,
2229
+ isActionable: x
2230
+ } = Bo(e), h = I(null), p = I(null);
2231
+ let C = null, B, S = null, V = null;
2232
+ const A = m(
2233
+ () => e.label !== void 0 && e.label !== null && e.label !== ""
2234
+ ), $ = m(
2235
+ () => e.disable || e.ripple === !1 ? !1 : {
2236
+ keyCodes: R.value ? [13, 32] : [13],
2237
+ ...e.ripple === !0 ? {} : e.ripple
2238
+ }
2239
+ ), P = m(() => ({ center: e.round })), _ = m(() => {
2240
+ const d = Math.max(0, Math.min(100, e.percentage));
2241
+ return d > 0 ? {
2242
+ transition: "transform 0.6s",
2243
+ transform: `translateX(${d - 100}%)`
2244
+ } : {};
2245
+ }), q = m(() => {
2246
+ if (e.loading)
2247
+ return {
2248
+ onMousedown: ve,
2249
+ onTouchstart: ve,
2250
+ onClick: ve,
2251
+ onKeydown: ve,
2252
+ onKeyup: ve
2253
+ };
2254
+ if (x.value) {
2255
+ const d = {
2256
+ onClick: F,
2257
+ onKeydown: z,
2258
+ onMousedown: a
2259
+ };
2260
+ if (o.$q.platform.has.touch) {
2261
+ const w = e.onTouchstart !== void 0 ? "" : "Passive";
2262
+ d[`onTouchstart${w}`] = f;
2263
+ }
2264
+ return d;
2265
+ }
2266
+ return {
2267
+ // needed; especially for disabled <a> tags
2268
+ onClick: W
2269
+ };
2270
+ }), M = m(() => ({
2271
+ ref: h,
2272
+ class: "q-btn q-btn-item non-selectable no-outline " + l.value,
2273
+ style: i.value,
2274
+ ...c.value,
2275
+ ...q.value
2276
+ }));
2277
+ function F(d) {
2278
+ if (h.value !== null) {
2279
+ if (d !== void 0) {
2280
+ if (d.defaultPrevented) return;
2281
+ const w = document.activeElement;
2282
+ if (e.type === "submit" && w !== document.body && !h.value.contains(w) && // required for iOS and desktop Safari
2283
+ !w.contains(h.value)) {
2284
+ d.qAvoidFocus || h.value.focus();
2285
+ const T = () => {
2286
+ var u;
2287
+ V = null, document.removeEventListener("keydown", W, !0), document.removeEventListener(
2288
+ "keyup",
2289
+ T,
2290
+ Z
2291
+ ), (u = h.value) == null || u.removeEventListener(
2292
+ "blur",
2293
+ T,
2294
+ Z
2295
+ );
2296
+ };
2297
+ V = T, document.addEventListener("keydown", W, !0), document.addEventListener("keyup", T, Z), h.value.addEventListener("blur", T, Z);
2298
+ }
2299
+ }
2300
+ b(d);
2301
+ }
2302
+ }
2303
+ function z(d) {
2304
+ h.value !== null && (n("keydown", d), $e(d, [13, 32]) && ae !== h.value && (ae !== null && v(), d.defaultPrevented || (d.qAvoidFocus || h.value.focus(), ae = h.value, h.value.classList.add("q-btn--active"), document.addEventListener("keyup", g, !0), h.value.addEventListener("blur", g, Z)), W(d)));
2305
+ }
2306
+ function f(d) {
2307
+ h.value !== null && (n("touchstart", d), !d.defaultPrevented && (le !== h.value && (le !== null && v(), le = h.value, C = d.target, C.addEventListener(
2308
+ "touchcancel",
2309
+ g,
2310
+ Z
2311
+ ), C.addEventListener(
2312
+ "touchend",
2313
+ g,
2314
+ Z
2315
+ )), B = !0, S !== null && clearTimeout(S), S = setTimeout(() => {
2316
+ S = null, B = !1;
2317
+ }, 200)));
2318
+ }
2319
+ function a(d) {
2320
+ h.value !== null && (d.qSkipRipple = B === !0, n("mousedown", d), !d.defaultPrevented && ie !== h.value && (ie !== null && v(), ie = h.value, h.value.classList.add("q-btn--active"), document.addEventListener("mouseup", g, Z)));
2321
+ }
2322
+ function g(d) {
2323
+ if (h.value !== null && !((d == null ? void 0 : d.type) === "blur" && document.activeElement === h.value)) {
2324
+ if ((d == null ? void 0 : d.type) === "keyup") {
2325
+ if (ae === h.value && $e(d, [13, 32])) {
2326
+ const w = new MouseEvent("click", d);
2327
+ w.qKeyEvent = !0, d.defaultPrevented && se(w), d.cancelBubble && xe(w), h.value.dispatchEvent(w), W(d), d.qKeyEvent = !0;
2328
+ }
2329
+ n("keyup", d);
2330
+ }
2331
+ v();
2332
+ }
2333
+ }
2334
+ function v(d) {
2335
+ var T, u;
2336
+ V == null || V();
2337
+ const w = p.value;
2338
+ !d && (le === h.value || ie === h.value) && w !== null && w !== document.activeElement && (w.setAttribute("tabindex", -1), w.focus({ preventScroll: !0 })), le === h.value && (C !== null && (C.removeEventListener(
2339
+ "touchcancel",
2340
+ g,
2341
+ Z
2342
+ ), C.removeEventListener(
2343
+ "touchend",
2344
+ g,
2345
+ Z
2346
+ )), le = C = null), ie === h.value && (document.removeEventListener("mouseup", g, Z), ie = null), ae === h.value && (document.removeEventListener("keyup", g, !0), (T = h.value) == null || T.removeEventListener("blur", g, Z), ae = null), (u = h.value) == null || u.classList.remove("q-btn--active");
2347
+ }
2348
+ return he(() => {
2349
+ v(!0);
2350
+ }), Object.assign(o, {
2351
+ click: (d) => {
2352
+ x.value && F(d);
2353
+ }
2354
+ }), () => {
2355
+ let d = [];
2356
+ e.icon !== void 0 && d.push(
2357
+ k(ce, {
2358
+ name: e.icon,
2359
+ left: !e.stack && A.value,
2360
+ role: "img"
2361
+ })
2362
+ ), A.value && d.push(k("span", { class: "block" }, [e.label])), d = ue(t.default, d), e.iconRight !== void 0 && !e.round && d.push(
2363
+ k(ce, {
2364
+ name: e.iconRight,
2365
+ right: !e.stack && A.value,
2366
+ role: "img"
2367
+ })
2368
+ );
2369
+ const w = [
2370
+ k("span", {
2371
+ class: "q-focus-helper",
2372
+ ref: p
2373
+ })
2374
+ ];
2375
+ return e.loading && e.percentage !== void 0 && w.push(
2376
+ k(
2377
+ "span",
2378
+ {
2379
+ class: "q-btn__progress absolute-full overflow-hidden" + (e.darkPercentage ? " q-btn__progress--dark" : "")
2380
+ },
2381
+ [
2382
+ k("span", {
2383
+ class: "q-btn__progress-indicator fit block",
2384
+ style: _.value
2385
+ })
2386
+ ]
2387
+ )
2388
+ ), w.push(
2389
+ k(
2390
+ "span",
2391
+ {
2392
+ class: "q-btn__content text-center col items-center q-anchor--skip " + r.value
2393
+ },
2394
+ d
2395
+ )
2396
+ ), e.loading !== null && w.push(
2397
+ k(
2398
+ ct,
2399
+ {
2400
+ name: "q-transition--fade"
2401
+ },
2402
+ () => e.loading ? [
2403
+ k(
2404
+ "span",
2405
+ {
2406
+ key: "loading",
2407
+ class: "absolute-full flex flex-center"
2408
+ },
2409
+ t.loading !== void 0 ? t.loading() : [k(gt)]
2410
+ )
2411
+ ] : null
2412
+ )
2413
+ ), _t(k(E.value, M.value, w), [
2414
+ [vo, $.value, void 0, P.value]
2415
+ ]);
2416
+ };
2417
+ }
2418
+ });
2419
+ function at(e) {
2420
+ const t = e.validate();
2421
+ return typeof t.then == "function" ? t.then(
2422
+ (n) => ({ valid: n, comp: e }),
2423
+ (n) => ({ valid: !1, comp: e, err: n })
2424
+ ) : Promise.resolve({ valid: t, comp: e });
2425
+ }
2426
+ const Vo = /* @__PURE__ */ de({
2427
+ name: "QForm",
2428
+ props: {
2429
+ autofocus: Boolean,
2430
+ noErrorFocus: Boolean,
2431
+ noResetFocus: Boolean,
2432
+ greedy: Boolean,
2433
+ onSubmit: Function
2434
+ },
2435
+ emits: ["reset", "validationSuccess", "validationError"],
2436
+ setup(e, { slots: t, emit: n }) {
2437
+ const o = Y(), l = I(null);
2438
+ let i = 0;
2439
+ const r = [];
2440
+ function c(p) {
2441
+ const C = typeof p == "boolean" ? p : !e.noErrorFocus, B = ++i, S = (A, $) => {
2442
+ n(`validation${A ? "Success" : "Error"}`, $);
2443
+ };
2444
+ return (e.greedy ? Promise.all(r.map(at)).then(
2445
+ (A) => A.filter(($) => !$.valid)
2446
+ ) : r.reduce(
2447
+ (A, $) => A.then(() => at($)).then((P) => {
2448
+ if (!P.valid) throw P;
2449
+ }),
2450
+ Promise.resolve()
2451
+ ).catch((A) => [A])).then((A) => {
2452
+ if (A === void 0 || A.length === 0)
2453
+ return B === i && S(!0), !0;
2454
+ if (B === i) {
2455
+ const { comp: $, err: P } = A[0];
2456
+ if (P !== void 0 && console.error(P), S(!1, $), C) {
2457
+ const _ = A.find(
2458
+ ({ comp: q }) => typeof q.focus == "function" && !po(q.$)
2459
+ );
2460
+ _ !== void 0 && _.comp.focus();
2461
+ }
2462
+ }
2463
+ return !1;
2464
+ });
2465
+ }
2466
+ function R() {
2467
+ i++, r.forEach((p) => {
2468
+ typeof p.resetValidation == "function" && p.resetValidation();
2469
+ });
2470
+ }
2471
+ function E(p) {
2472
+ p !== void 0 && W(p);
2473
+ const C = i + 1;
2474
+ c().then((B) => {
2475
+ C === i && B && (e.onSubmit !== void 0 ? n("submit", p) : (p == null ? void 0 : p.target) !== void 0 && typeof p.target.submit == "function" && p.target.submit());
2476
+ });
2477
+ }
2478
+ function b(p) {
2479
+ p !== void 0 && W(p), n("reset"), X(() => {
2480
+ R(), e.autofocus && !e.noResetFocus && x();
2481
+ });
2482
+ }
2483
+ function x() {
2484
+ Oe(() => {
2485
+ if (l.value === null) return;
2486
+ const p = l.value.querySelector(
2487
+ "[autofocus][tabindex], [data-autofocus][tabindex]"
2488
+ ) || l.value.querySelector(
2489
+ "[autofocus] [tabindex], [data-autofocus] [tabindex]"
2490
+ ) || l.value.querySelector("[autofocus], [data-autofocus]") || Array.prototype.find.call(
2491
+ l.value.querySelectorAll("[tabindex]"),
2492
+ (C) => C.tabIndex !== -1
2493
+ );
2494
+ p == null || p.focus({ preventScroll: !0 });
2495
+ });
2496
+ }
2497
+ Ft(kt, {
2498
+ bindComponent(p) {
2499
+ r.push(p);
2500
+ },
2501
+ unbindComponent(p) {
2502
+ const C = r.indexOf(p);
2503
+ C !== -1 && r.splice(C, 1);
2504
+ }
2505
+ });
2506
+ let h = !1;
2507
+ return st(() => {
2508
+ h = !0;
2509
+ }), ut(() => {
2510
+ h && e.autofocus && x();
2511
+ }), ge(() => {
2512
+ e.autofocus && x();
2513
+ }), Object.assign(o.proxy, {
2514
+ validate: c,
2515
+ resetValidation: R,
2516
+ submit: E,
2517
+ reset: b,
2518
+ focus: x,
2519
+ getValidationComponents: () => r
2520
+ }), () => k(
2521
+ "form",
2522
+ {
2523
+ class: "q-form",
2524
+ ref: l,
2525
+ onSubmit: E,
2526
+ onReset: b
2527
+ },
2528
+ ne(t.default)
2529
+ );
2530
+ }
2531
+ }), $o = /* @__PURE__ */ Ae({
2532
+ __name: "LoginForm",
2533
+ props: {
2534
+ loading: { type: Boolean, default: !1 },
2535
+ error: { default: "" },
2536
+ usernameLabel: { default: "用户名" },
2537
+ passwordLabel: { default: "密码" },
2538
+ rememberLabel: { default: "记住我" },
2539
+ submitLabel: { default: "登录" },
2540
+ usernameRules: { default: () => [(e) => !!e || "请输入用户名"] },
2541
+ passwordRules: { default: () => [(e) => !!e || "请输入密码"] }
2542
+ },
2543
+ emits: ["submit"],
2544
+ setup(e, { emit: t }) {
2545
+ const n = rt({
2546
+ username: "",
2547
+ password: "",
2548
+ remember: !1,
2549
+ showPassword: !1
2550
+ }), o = {
2551
+ handleSubmit() {
2552
+ l("submit", {
2553
+ username: n.username,
2554
+ password: n.password,
2555
+ remember: n.remember
2556
+ });
2557
+ }
2558
+ }, l = t;
2559
+ return (i, r) => (dt(), Bt(Vo, {
2560
+ class: "login-form",
2561
+ onSubmit: Vt(o.handleSubmit, ["prevent"])
2562
+ }, {
2563
+ default: Ie(() => [
2564
+ re(Ge, {
2565
+ modelValue: n.username,
2566
+ "onUpdate:modelValue": r[0] || (r[0] = (c) => n.username = c),
2567
+ label: e.usernameLabel,
2568
+ rules: e.usernameRules,
2569
+ "lazy-rules": "",
2570
+ "prepend-icon": "person",
2571
+ outlined: ""
2572
+ }, null, 8, ["modelValue", "label", "rules"]),
2573
+ re(Ge, {
2574
+ modelValue: n.password,
2575
+ "onUpdate:modelValue": r[2] || (r[2] = (c) => n.password = c),
2576
+ label: e.passwordLabel,
2577
+ type: n.showPassword ? "text" : "password",
2578
+ rules: e.passwordRules,
2579
+ "lazy-rules": "",
2580
+ "prepend-icon": "lock",
2581
+ outlined: ""
2582
+ }, {
2583
+ append: Ie(() => [
2584
+ re(ce, {
2585
+ name: n.showPassword ? "visibility_off" : "visibility",
2586
+ class: "cursor-pointer",
2587
+ onClick: r[1] || (r[1] = (c) => n.showPassword = !n.showPassword)
2588
+ }, null, 8, ["name"])
2589
+ ]),
2590
+ _: 1
2591
+ }, 8, ["modelValue", "label", "type", "rules"]),
2592
+ re(uo, {
2593
+ modelValue: n.remember,
2594
+ "onUpdate:modelValue": r[3] || (r[3] = (c) => n.remember = c),
2595
+ label: e.rememberLabel,
2596
+ "left-label": ""
2597
+ }, null, 8, ["modelValue", "label"]),
2598
+ re(Rt, {
2599
+ type: "submit",
2600
+ label: e.submitLabel,
2601
+ loading: e.loading,
2602
+ color: "primary",
2603
+ "text-color": "white",
2604
+ "full-width": "",
2605
+ unelevated: ""
2606
+ }, null, 8, ["label", "loading"])
2607
+ ]),
2608
+ _: 1
2609
+ }, 8, ["onSubmit"]));
2610
+ }
2611
+ }), Ao = (e, t) => {
2612
+ const n = e.__vccOpts || e;
2613
+ for (const [o, l] of t)
2614
+ n[o] = l;
2615
+ return n;
2616
+ }, jo = /* @__PURE__ */ Ao($o, [["__scopeId", "data-v-4c9f630c"]]), To = { class: "fullscreen q-ma-sm" }, Po = { class: "row full-height" }, Oo = { class: "col bg-blue-1 column" }, Lo = {
2617
+ class: "bg-green-2 row justify-end items-center",
2618
+ style: { height: "50px" }
2619
+ }, Do = /* @__PURE__ */ Ae({
2620
+ __name: "LayoutOne",
2621
+ setup(e) {
2622
+ const t = {
2623
+ goBack: () => history.back()
2624
+ };
2625
+ return (n, o) => (dt(), $t("div", To, [
2626
+ te("div", Po, [
2627
+ o[1] || (o[1] = te("div", {
2628
+ class: "bg-orange-1 text-center",
2629
+ style: { width: "300px" }
2630
+ }, " 左边菜单宽度固定(水平居中) ", -1)),
2631
+ te("div", Oo, [
2632
+ o[0] || (o[0] = te("div", { class: "col q-pa-md" }, [
2633
+ te("div", { class: "q-pa-md bg-yellow-2 flex flex-center" }, " 文本水平、垂直居中 "),
2634
+ te("div", { class: "q-mt-md" }, " 主内容区 ")
2635
+ ], -1)),
2636
+ te("div", Lo, [
2637
+ re(Rt, {
2638
+ class: "q-mr-md",
2639
+ color: "primary",
2640
+ label: "返回",
2641
+ onClick: t.goBack
2642
+ }, null, 8, ["onClick"])
2643
+ ])
2644
+ ])
2645
+ ])
2646
+ ]));
2647
+ }
2648
+ });
2649
+ export {
2650
+ Do as LayoutOne,
2651
+ jo as LoginForm
2652
+ };