@validol4ik/uikit 0.3.2 → 0.3.4

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.
@@ -0,0 +1,3326 @@
1
+ import { computed as f, ref as T, h, getCurrentInstance as le, toRaw as $e, onMounted as tt, watch as K, onBeforeUpdate as Ml, inject as _n, onBeforeUnmount as ce, nextTick as ue, onDeactivated as Ct, onActivated as Ll, Transition as bt, onUnmounted as En, Teleport as Bn, onBeforeMount as An, onUpdated as Tn, defineComponent as Rn, openBlock as de, createElementBlock as ye, normalizeClass as st, toDisplayString as Ue, createCommentVNode as Pe, createVNode as Xe, unref as zn, withCtx as xe, mergeProps as Fn, createBlock as al, createElementVNode as At, createTextVNode as Tt, Fragment as ct, withModifiers as Mn } from "vue";
2
+ import { u as Ol, s as ae, h as Il, a as Se, b as Hl, c as be, Q as Ae, d as Ln, i as kt, e as On, f as In, p as pe, g as Hn, j as $n, R as Pn, k as Dn, l as rl, m as Wn, n as ge, v as jn, o as Rt, q as $l, r as Nn, t as sl, w as Kn, x as Pl, y as Qn, z as Un, B as De, D as Xn, S as Yn, _ as Gn } from "./index-DF6N-CK6.js";
3
+ import { i as Zn, b as Dl, P as Jn, c as we, r as Pt, a as Wl } from "./focusout-DjvPXP_b.js";
4
+ const lt = {
5
+ dark: {
6
+ type: Boolean,
7
+ default: null
8
+ }
9
+ };
10
+ function nt(e, t) {
11
+ return f(() => e.dark === null ? t.dark.isActive : e.dark);
12
+ }
13
+ function eo(e, t) {
14
+ const l = T(null), n = f(() => e.disable === !0 ? null : h("span", {
15
+ ref: l,
16
+ class: "no-outline",
17
+ tabindex: -1
18
+ }));
19
+ function a(i) {
20
+ const u = t.value;
21
+ i !== void 0 && i.type.indexOf("key") === 0 ? u !== null && document.activeElement !== u && u.contains(document.activeElement) === !0 && u.focus() : l.value !== null && (i === void 0 || u !== null && u.contains(i.target) === !0) && l.value.focus();
22
+ }
23
+ return {
24
+ refocusTargetEl: n,
25
+ refocusTarget: a
26
+ };
27
+ }
28
+ const jl = {
29
+ name: String
30
+ };
31
+ function to(e = {}) {
32
+ return (t, l, n) => {
33
+ t[l](
34
+ h("input", {
35
+ class: "hidden" + (n || ""),
36
+ ...e.value
37
+ })
38
+ );
39
+ };
40
+ }
41
+ function lo(e) {
42
+ return f(() => e.name || e.for);
43
+ }
44
+ const no = {
45
+ xs: 30,
46
+ sm: 35,
47
+ md: 40,
48
+ lg: 50,
49
+ xl: 60
50
+ }, oo = {
51
+ ...lt,
52
+ ...Hl,
53
+ ...jl,
54
+ modelValue: {
55
+ required: !0,
56
+ default: null
57
+ },
58
+ val: {},
59
+ trueValue: { default: !0 },
60
+ falseValue: { default: !1 },
61
+ indeterminateValue: { default: null },
62
+ checkedIcon: String,
63
+ uncheckedIcon: String,
64
+ indeterminateIcon: String,
65
+ toggleOrder: {
66
+ type: String,
67
+ validator: (e) => e === "tf" || e === "ft"
68
+ },
69
+ toggleIndeterminate: Boolean,
70
+ label: String,
71
+ leftLabel: Boolean,
72
+ color: String,
73
+ keepColor: Boolean,
74
+ dense: Boolean,
75
+ disable: Boolean,
76
+ tabindex: [String, Number]
77
+ }, io = ["update:modelValue"];
78
+ function uo(e, t) {
79
+ const { props: l, slots: n, emit: a, proxy: i } = le(), { $q: u } = i, d = nt(l, u), v = T(null), { refocusTargetEl: g, refocusTarget: c } = eo(l, v), y = Ol(l, no), C = f(
80
+ () => l.val !== void 0 && Array.isArray(l.modelValue)
81
+ ), r = f(() => {
82
+ const A = $e(l.val);
83
+ return C.value === !0 ? l.modelValue.findIndex((U) => $e(U) === A) : -1;
84
+ }), m = f(() => C.value === !0 ? r.value !== -1 : $e(l.modelValue) === $e(l.trueValue)), _ = f(() => C.value === !0 ? r.value === -1 : $e(l.modelValue) === $e(l.falseValue)), S = f(
85
+ () => m.value === !1 && _.value === !1
86
+ ), P = f(() => l.disable === !0 ? -1 : l.tabindex || 0), E = f(
87
+ () => `q-${e} cursor-pointer no-outline row inline no-wrap items-center` + (l.disable === !0 ? " disabled" : "") + (d.value === !0 ? ` q-${e}--dark` : "") + (l.dense === !0 ? ` q-${e}--dense` : "") + (l.leftLabel === !0 ? " reverse" : "")
88
+ ), q = f(() => {
89
+ const A = m.value === !0 ? "truthy" : _.value === !0 ? "falsy" : "indet", U = l.color !== void 0 && (l.keepColor === !0 || _.value !== !0) ? ` text-${l.color}` : "";
90
+ return `q-${e}__inner relative-position non-selectable q-${e}__inner--${A}${U}`;
91
+ }), R = f(() => {
92
+ const A = { type: "checkbox" };
93
+ return l.name !== void 0 && Object.assign(A, {
94
+ // see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
95
+ ".checked": m.value,
96
+ "^checked": m.value === !0 ? "checked" : void 0,
97
+ name: l.name,
98
+ value: C.value === !0 ? l.val : l.trueValue
99
+ }), A;
100
+ }), D = to(R), B = f(() => {
101
+ const A = {
102
+ tabindex: P.value,
103
+ role: "checkbox",
104
+ "aria-label": l.label,
105
+ "aria-checked": S.value === !0 ? "mixed" : m.value === !0 ? "true" : "false"
106
+ };
107
+ return l.disable === !0 && (A["aria-disabled"] = "true"), A;
108
+ });
109
+ function L(A) {
110
+ A !== void 0 && (ae(A), c(A)), l.disable !== !0 && a("update:modelValue", H(), A);
111
+ }
112
+ function H() {
113
+ if (C.value === !0) {
114
+ if (m.value === !0) {
115
+ const A = l.modelValue.slice();
116
+ return A.splice(r.value, 1), A;
117
+ }
118
+ return l.modelValue.concat([l.val]);
119
+ }
120
+ if (m.value === !0) {
121
+ if (l.toggleOrder !== "ft" || l.toggleIndeterminate === !1)
122
+ return l.falseValue;
123
+ } else if (_.value === !0) {
124
+ if (l.toggleOrder === "ft" || l.toggleIndeterminate === !1)
125
+ return l.trueValue;
126
+ } else
127
+ return l.toggleOrder !== "ft" ? l.trueValue : l.falseValue;
128
+ return l.indeterminateValue;
129
+ }
130
+ function Q(A) {
131
+ (A.keyCode === 13 || A.keyCode === 32) && ae(A);
132
+ }
133
+ function G(A) {
134
+ (A.keyCode === 13 || A.keyCode === 32) && L(A);
135
+ }
136
+ const ne = t(m, S);
137
+ return Object.assign(i, { toggle: L }), () => {
138
+ const A = ne();
139
+ l.disable !== !0 && D(
140
+ A,
141
+ "unshift",
142
+ ` q-${e}__native absolute q-ma-none q-pa-none`
143
+ );
144
+ const U = [
145
+ h("div", {
146
+ class: q.value,
147
+ style: y.value,
148
+ "aria-hidden": "true"
149
+ }, A)
150
+ ];
151
+ g.value !== null && U.push(g.value);
152
+ const oe = l.label !== void 0 ? Il(n.default, [l.label]) : Se(n.default);
153
+ return oe !== void 0 && U.push(
154
+ h("div", {
155
+ class: `q-${e}__label q-anchor--skip`
156
+ }, oe)
157
+ ), h("div", {
158
+ ref: v,
159
+ class: E.value,
160
+ ...B.value,
161
+ onClick: L,
162
+ onKeydown: Q,
163
+ onKeyup: G
164
+ }, U);
165
+ };
166
+ }
167
+ const ao = () => h("div", {
168
+ key: "svg",
169
+ class: "q-checkbox__bg absolute"
170
+ }, [
171
+ h("svg", {
172
+ class: "q-checkbox__svg fit absolute-full",
173
+ viewBox: "0 0 24 24"
174
+ }, [
175
+ h("path", {
176
+ class: "q-checkbox__truthy",
177
+ fill: "none",
178
+ d: "M1.73,12.91 8.1,19.28 22.79,4.59"
179
+ }),
180
+ h("path", {
181
+ class: "q-checkbox__indet",
182
+ d: "M4,14H20V10H4"
183
+ })
184
+ ])
185
+ ]), ro = be({
186
+ name: "QCheckbox",
187
+ props: oo,
188
+ emits: io,
189
+ setup(e) {
190
+ const t = ao();
191
+ function l(n, a) {
192
+ const i = f(
193
+ () => (n.value === !0 ? e.checkedIcon : a.value === !0 ? e.indeterminateIcon : e.uncheckedIcon) || null
194
+ );
195
+ return () => i.value !== null ? [
196
+ h("div", {
197
+ key: "icon",
198
+ class: "q-checkbox__icon-container absolute-full flex flex-center no-wrap"
199
+ }, [
200
+ h(Ae, {
201
+ class: "q-checkbox__icon",
202
+ name: i.value
203
+ })
204
+ ])
205
+ ] : [t];
206
+ }
207
+ return uo("checkbox", l);
208
+ }
209
+ }), pt = be({
210
+ name: "QItemSection",
211
+ props: {
212
+ avatar: Boolean,
213
+ thumbnail: Boolean,
214
+ side: Boolean,
215
+ top: Boolean,
216
+ noWrap: Boolean
217
+ },
218
+ setup(e, { slots: t }) {
219
+ const l = f(
220
+ () => `q-item__section column q-item__section--${e.avatar === !0 || e.side === !0 || e.thumbnail === !0 ? "side" : "main"}` + (e.top === !0 ? " q-item__section--top justify-start" : " justify-center") + (e.avatar === !0 ? " q-item__section--avatar" : "") + (e.thumbnail === !0 ? " q-item__section--thumbnail" : "") + (e.noWrap === !0 ? " q-item__section--nowrap" : "")
221
+ );
222
+ return () => h("div", { class: l.value }, Se(t.default));
223
+ }
224
+ }), Nl = be({
225
+ name: "QItemLabel",
226
+ props: {
227
+ overline: Boolean,
228
+ caption: Boolean,
229
+ header: Boolean,
230
+ lines: [Number, String]
231
+ },
232
+ setup(e, { slots: t }) {
233
+ const l = f(() => parseInt(e.lines, 10)), n = f(
234
+ () => "q-item__label" + (e.overline === !0 ? " q-item__label--overline text-overline" : "") + (e.caption === !0 ? " q-item__label--caption text-caption" : "") + (e.header === !0 ? " q-item__label--header" : "") + (l.value === 1 ? " ellipsis" : "")
235
+ ), a = f(() => e.lines !== void 0 && l.value > 1 ? {
236
+ overflow: "hidden",
237
+ display: "-webkit-box",
238
+ "-webkit-box-orient": "vertical",
239
+ "-webkit-line-clamp": l.value
240
+ } : null);
241
+ return () => h("div", {
242
+ style: a.value,
243
+ class: n.value
244
+ }, Se(t.default));
245
+ }
246
+ }), Kl = be({
247
+ name: "QItem",
248
+ props: {
249
+ ...lt,
250
+ ...In,
251
+ tag: {
252
+ type: String,
253
+ default: "div"
254
+ },
255
+ active: {
256
+ type: Boolean,
257
+ default: null
258
+ },
259
+ clickable: Boolean,
260
+ dense: Boolean,
261
+ insetLevel: Number,
262
+ tabindex: [String, Number],
263
+ focused: Boolean,
264
+ manualFocus: Boolean
265
+ },
266
+ emits: ["click", "keyup"],
267
+ setup(e, { slots: t, emit: l }) {
268
+ const { proxy: { $q: n } } = le(), a = nt(e, n), { hasLink: i, linkAttrs: u, linkClass: d, linkTag: v, navigateOnClick: g } = Ln(), c = T(null), y = T(null), C = f(
269
+ () => e.clickable === !0 || i.value === !0 || e.tag === "label"
270
+ ), r = f(
271
+ () => e.disable !== !0 && C.value === !0
272
+ ), m = f(
273
+ () => "q-item q-item-type row no-wrap" + (e.dense === !0 ? " q-item--dense" : "") + (a.value === !0 ? " q-item--dark" : "") + (i.value === !0 && e.active === null ? d.value : e.active === !0 ? ` q-item--active${e.activeClass !== void 0 ? ` ${e.activeClass}` : ""}` : "") + (e.disable === !0 ? " disabled" : "") + (r.value === !0 ? " q-item--clickable q-link cursor-pointer " + (e.manualFocus === !0 ? "q-manual-focusable" : "q-focusable q-hoverable") + (e.focused === !0 ? " q-manual-focusable--focused" : "") : "")
274
+ ), _ = f(() => e.insetLevel === void 0 ? null : {
275
+ ["padding" + (n.lang.rtl === !0 ? "Right" : "Left")]: 16 + e.insetLevel * 56 + "px"
276
+ });
277
+ function S(q) {
278
+ r.value === !0 && (y.value !== null && (q.qKeyEvent !== !0 && document.activeElement === c.value ? y.value.focus() : document.activeElement === y.value && c.value.focus()), g(q));
279
+ }
280
+ function P(q) {
281
+ if (r.value === !0 && kt(q, [13, 32]) === !0) {
282
+ ae(q), q.qKeyEvent = !0;
283
+ const R = new MouseEvent("click", q);
284
+ R.qKeyEvent = !0, c.value.dispatchEvent(R);
285
+ }
286
+ l("keyup", q);
287
+ }
288
+ function E() {
289
+ const q = On(t.default, []);
290
+ return r.value === !0 && q.unshift(
291
+ h("div", { class: "q-focus-helper", tabindex: -1, ref: y })
292
+ ), q;
293
+ }
294
+ return () => {
295
+ const q = {
296
+ ref: c,
297
+ class: m.value,
298
+ style: _.value,
299
+ role: "listitem",
300
+ onClick: S,
301
+ onKeyup: P
302
+ };
303
+ return r.value === !0 ? (q.tabindex = e.tabindex || "0", Object.assign(q, u.value)) : C.value === !0 && (q["aria-disabled"] = "true"), h(
304
+ v.value,
305
+ q,
306
+ E()
307
+ );
308
+ };
309
+ }
310
+ }), cl = (e) => e ? !0 : "Обовʼязкове поле";
311
+ let zt, dt = 0;
312
+ const ee = new Array(256);
313
+ for (let e = 0; e < 256; e++)
314
+ ee[e] = (e + 256).toString(16).substring(1);
315
+ const so = (() => {
316
+ const e = typeof crypto < "u" ? crypto : typeof window < "u" ? window.crypto || window.msCrypto : void 0;
317
+ if (e !== void 0) {
318
+ if (e.randomBytes !== void 0)
319
+ return e.randomBytes;
320
+ if (e.getRandomValues !== void 0)
321
+ return (t) => {
322
+ const l = new Uint8Array(t);
323
+ return e.getRandomValues(l), l;
324
+ };
325
+ }
326
+ return (t) => {
327
+ const l = [];
328
+ for (let n = t; n > 0; n--)
329
+ l.push(Math.floor(Math.random() * 256));
330
+ return l;
331
+ };
332
+ })(), dl = 4096;
333
+ function Dt() {
334
+ (zt === void 0 || dt + 16 > dl) && (dt = 0, zt = so(dl));
335
+ const e = Array.prototype.slice.call(zt, dt, dt += 16);
336
+ return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, ee[e[0]] + ee[e[1]] + ee[e[2]] + ee[e[3]] + "-" + ee[e[4]] + ee[e[5]] + "-" + ee[e[6]] + ee[e[7]] + "-" + ee[e[8]] + ee[e[9]] + "-" + ee[e[10]] + ee[e[11]] + ee[e[12]] + ee[e[13]] + ee[e[14]] + ee[e[15]];
337
+ }
338
+ function co(e) {
339
+ return e ?? null;
340
+ }
341
+ function fl(e, t) {
342
+ return e ?? (t === !0 ? `f_${Dt()}` : null);
343
+ }
344
+ function fo({ getValue: e, required: t = !0 } = {}) {
345
+ if (Zn.value === !0) {
346
+ const l = e !== void 0 ? T(co(e())) : T(null);
347
+ return t === !0 && l.value === null && tt(() => {
348
+ l.value = `f_${Dt()}`;
349
+ }), e !== void 0 && K(e, (n) => {
350
+ l.value = fl(n, t);
351
+ }), l;
352
+ }
353
+ return e !== void 0 ? f(() => fl(e(), t)) : T(`f_${Dt()}`);
354
+ }
355
+ const vl = /^on[A-Z]/;
356
+ function vo() {
357
+ const { attrs: e, vnode: t } = le(), l = {
358
+ listeners: T({}),
359
+ attributes: T({})
360
+ };
361
+ function n() {
362
+ const a = {}, i = {};
363
+ for (const u in e)
364
+ u !== "class" && u !== "style" && vl.test(u) === !1 && (a[u] = e[u]);
365
+ for (const u in t.props)
366
+ vl.test(u) === !0 && (i[u] = t.props[u]);
367
+ l.attributes.value = a, l.listeners.value = i;
368
+ }
369
+ return Ml(n), n(), l;
370
+ }
371
+ const mo = "_q_fo_";
372
+ function ho({ validate: e, resetValidation: t, requiresQForm: l }) {
373
+ const n = _n(mo, !1);
374
+ if (n !== !1) {
375
+ const { props: a, proxy: i } = le();
376
+ Object.assign(i, { validate: e, resetValidation: t }), K(() => a.disable, (u) => {
377
+ u === !0 ? (typeof t == "function" && t(), n.unbindComponent(i)) : n.bindComponent(i);
378
+ }), tt(() => {
379
+ a.disable !== !0 && n.bindComponent(i);
380
+ }), ce(() => {
381
+ a.disable !== !0 && n.unbindComponent(i);
382
+ });
383
+ } else l === !0 && console.error("Parent QForm not found on useFormChild()!");
384
+ }
385
+ const ml = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/, hl = /^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/, gl = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, ft = /^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])\)$/, vt = /^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|0\.[0-9]+[1-9]|0\.[1-9]+|1)\)$/, Ft = {
386
+ date: (e) => /^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(e),
387
+ time: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e),
388
+ fulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(e),
389
+ timeOrFulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(e),
390
+ // -- RFC 5322 --
391
+ // -- Added in v2.6.6 --
392
+ // This is a basic helper validation.
393
+ // For something more complex (like RFC 822) you should write and use your own rule.
394
+ // We won't be accepting PRs to enhance the one below because of the reason above.
395
+ // eslint-disable-next-line
396
+ email: (e) => /^(([^<>()\[\]\\.,;:\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,}))$/.test(e),
397
+ hexColor: (e) => ml.test(e),
398
+ hexaColor: (e) => hl.test(e),
399
+ hexOrHexaColor: (e) => gl.test(e),
400
+ rgbColor: (e) => ft.test(e),
401
+ rgbaColor: (e) => vt.test(e),
402
+ rgbOrRgbaColor: (e) => ft.test(e) || vt.test(e),
403
+ hexOrRgbColor: (e) => ml.test(e) || ft.test(e),
404
+ hexaOrRgbaColor: (e) => hl.test(e) || vt.test(e),
405
+ anyColor: (e) => gl.test(e) || ft.test(e) || vt.test(e)
406
+ };
407
+ function Ql(e, t = 250, l) {
408
+ let n = null;
409
+ function a() {
410
+ const i = arguments, u = () => {
411
+ n = null, l !== !0 && e.apply(this, i);
412
+ };
413
+ n !== null ? clearTimeout(n) : l === !0 && e.apply(this, i), n = setTimeout(u, t);
414
+ }
415
+ return a.cancel = () => {
416
+ n !== null && clearTimeout(n);
417
+ }, a;
418
+ }
419
+ const go = [!0, !1, "ondemand"], po = {
420
+ modelValue: {},
421
+ error: {
422
+ type: Boolean,
423
+ default: null
424
+ },
425
+ errorMessage: String,
426
+ noErrorIcon: Boolean,
427
+ rules: Array,
428
+ reactiveRules: Boolean,
429
+ lazyRules: {
430
+ type: [Boolean, String],
431
+ default: !1,
432
+ // statement unneeded but avoids future vue implementation changes
433
+ validator: (e) => go.includes(e)
434
+ }
435
+ };
436
+ function bo(e, t) {
437
+ const { props: l, proxy: n } = le(), a = T(!1), i = T(null), u = T(!1);
438
+ ho({ validate: _, resetValidation: m });
439
+ let d = 0, v;
440
+ const g = f(
441
+ () => l.rules !== void 0 && l.rules !== null && l.rules.length !== 0
442
+ ), c = f(() => l.disable !== !0 && g.value === !0 && t.value === !1), y = f(
443
+ () => l.error === !0 || a.value === !0
444
+ ), C = f(() => typeof l.errorMessage == "string" && l.errorMessage.length !== 0 ? l.errorMessage : i.value);
445
+ K(() => l.modelValue, () => {
446
+ u.value = !0, c.value === !0 && l.lazyRules === !1 && S();
447
+ });
448
+ function r() {
449
+ l.lazyRules !== "ondemand" && c.value === !0 && u.value === !0 && S();
450
+ }
451
+ K(() => l.reactiveRules, (P) => {
452
+ P === !0 ? v === void 0 && (v = K(() => l.rules, r, { immediate: !0, deep: !0 })) : v !== void 0 && (v(), v = void 0);
453
+ }, { immediate: !0 }), K(() => l.lazyRules, r), K(e, (P) => {
454
+ P === !0 ? u.value = !0 : c.value === !0 && l.lazyRules !== "ondemand" && S();
455
+ });
456
+ function m() {
457
+ d++, t.value = !1, u.value = !1, a.value = !1, i.value = null, S.cancel();
458
+ }
459
+ function _(P = l.modelValue) {
460
+ if (l.disable === !0 || g.value === !1)
461
+ return !0;
462
+ const E = ++d, q = t.value !== !0 ? () => {
463
+ u.value = !0;
464
+ } : () => {
465
+ }, R = (B, L) => {
466
+ B === !0 && q(), a.value = B, i.value = L || null, t.value = !1;
467
+ }, D = [];
468
+ for (let B = 0; B < l.rules.length; B++) {
469
+ const L = l.rules[B];
470
+ let H;
471
+ if (typeof L == "function" ? H = L(P, Ft) : typeof L == "string" && Ft[L] !== void 0 && (H = Ft[L](P)), H === !1 || typeof H == "string")
472
+ return R(!0, H), !1;
473
+ H !== !0 && H !== void 0 && D.push(H);
474
+ }
475
+ return D.length === 0 ? (R(!1), !0) : (t.value = !0, Promise.all(D).then(
476
+ (B) => {
477
+ if (B === void 0 || Array.isArray(B) === !1 || B.length === 0)
478
+ return E === d && R(!1), !0;
479
+ const L = B.find((H) => H === !1 || typeof H == "string");
480
+ return E === d && R(L !== void 0, L), L === void 0;
481
+ },
482
+ (B) => (E === d && (console.error(B), R(!0)), !1)
483
+ ));
484
+ }
485
+ const S = Ql(_, 0);
486
+ return ce(() => {
487
+ v !== void 0 && v(), S.cancel();
488
+ }), Object.assign(n, { resetValidation: m, validate: _ }), Dl(n, "hasError", () => y.value), {
489
+ isDirtyModel: u,
490
+ hasRules: g,
491
+ hasError: y,
492
+ errorMessage: C,
493
+ validate: _,
494
+ resetValidation: m
495
+ };
496
+ }
497
+ let Be = [], et = [];
498
+ function Ul(e) {
499
+ et = et.filter((t) => t !== e);
500
+ }
501
+ function yo(e) {
502
+ Ul(e), et.push(e);
503
+ }
504
+ function pl(e) {
505
+ Ul(e), et.length === 0 && Be.length !== 0 && (Be[Be.length - 1](), Be = []);
506
+ }
507
+ function Nt(e) {
508
+ et.length === 0 ? e() : Be.push(e);
509
+ }
510
+ function So(e) {
511
+ Be = Be.filter((t) => t !== e);
512
+ }
513
+ function Wt(e) {
514
+ return e != null && ("" + e).length !== 0;
515
+ }
516
+ const wo = {
517
+ ...lt,
518
+ ...po,
519
+ label: String,
520
+ stackLabel: Boolean,
521
+ hint: String,
522
+ hideHint: Boolean,
523
+ prefix: String,
524
+ suffix: String,
525
+ labelColor: String,
526
+ color: String,
527
+ bgColor: String,
528
+ filled: Boolean,
529
+ outlined: Boolean,
530
+ borderless: Boolean,
531
+ standout: [Boolean, String],
532
+ square: Boolean,
533
+ loading: Boolean,
534
+ labelSlot: Boolean,
535
+ bottomSlots: Boolean,
536
+ hideBottomSpace: Boolean,
537
+ rounded: Boolean,
538
+ dense: Boolean,
539
+ itemAligned: Boolean,
540
+ counter: Boolean,
541
+ clearable: Boolean,
542
+ clearIcon: String,
543
+ disable: Boolean,
544
+ readonly: Boolean,
545
+ autofocus: Boolean,
546
+ for: String
547
+ }, Kt = {
548
+ ...wo,
549
+ maxlength: [Number, String]
550
+ }, Xl = ["update:modelValue", "clear", "focus", "blur"];
551
+ function Yl({ requiredForAttr: e = !0, tagProp: t, changeEvent: l = !1 } = {}) {
552
+ const { props: n, proxy: a } = le(), i = nt(n, a.$q), u = fo({
553
+ required: e,
554
+ getValue: () => n.for
555
+ });
556
+ return {
557
+ requiredForAttr: e,
558
+ changeEvent: l,
559
+ tag: t === !0 ? f(() => n.tag) : { value: "label" },
560
+ isDark: i,
561
+ editable: f(
562
+ () => n.disable !== !0 && n.readonly !== !0
563
+ ),
564
+ innerLoading: T(!1),
565
+ focused: T(!1),
566
+ hasPopupOpen: !1,
567
+ splitAttrs: vo(),
568
+ targetUid: u,
569
+ rootRef: T(null),
570
+ targetRef: T(null),
571
+ controlRef: T(null)
572
+ /**
573
+ * user supplied additionals:
574
+
575
+ * innerValue - computed
576
+ * floatingLabel - computed
577
+ * inputRef - computed
578
+
579
+ * fieldClass - computed
580
+ * hasShadow - computed
581
+
582
+ * controlEvents - Object with fn(e)
583
+
584
+ * getControl - fn
585
+ * getInnerAppend - fn
586
+ * getControlChild - fn
587
+ * getShadowControl - fn
588
+ * showPopup - fn
589
+ */
590
+ };
591
+ }
592
+ function Gl(e) {
593
+ const { props: t, emit: l, slots: n, attrs: a, proxy: i } = le(), { $q: u } = i;
594
+ let d = null;
595
+ e.hasValue === void 0 && (e.hasValue = f(() => Wt(t.modelValue))), e.emitValue === void 0 && (e.emitValue = (k) => {
596
+ l("update:modelValue", k);
597
+ }), e.controlEvents === void 0 && (e.controlEvents = {
598
+ onFocusin: Q,
599
+ onFocusout: G
600
+ }), Object.assign(e, {
601
+ clearValue: ne,
602
+ onControlFocusin: Q,
603
+ onControlFocusout: G,
604
+ focus: L
605
+ }), e.computedCounter === void 0 && (e.computedCounter = f(() => {
606
+ if (t.counter !== !1) {
607
+ const k = typeof t.modelValue == "string" || typeof t.modelValue == "number" ? ("" + t.modelValue).length : Array.isArray(t.modelValue) === !0 ? t.modelValue.length : 0, M = t.maxlength !== void 0 ? t.maxlength : t.maxValues;
608
+ return k + (M !== void 0 ? " / " + M : "");
609
+ }
610
+ }));
611
+ const {
612
+ isDirtyModel: v,
613
+ hasRules: g,
614
+ hasError: c,
615
+ errorMessage: y,
616
+ resetValidation: C
617
+ } = bo(e.focused, e.innerLoading), r = e.floatingLabel !== void 0 ? f(() => t.stackLabel === !0 || e.focused.value === !0 || e.floatingLabel.value === !0) : f(() => t.stackLabel === !0 || e.focused.value === !0 || e.hasValue.value === !0), m = f(
618
+ () => t.bottomSlots === !0 || t.hint !== void 0 || g.value === !0 || t.counter === !0 || t.error !== null
619
+ ), _ = f(() => t.filled === !0 ? "filled" : t.outlined === !0 ? "outlined" : t.borderless === !0 ? "borderless" : t.standout ? "standout" : "standard"), S = f(
620
+ () => `q-field row no-wrap items-start q-field--${_.value}` + (e.fieldClass !== void 0 ? ` ${e.fieldClass.value}` : "") + (t.rounded === !0 ? " q-field--rounded" : "") + (t.square === !0 ? " q-field--square" : "") + (r.value === !0 ? " q-field--float" : "") + (E.value === !0 ? " q-field--labeled" : "") + (t.dense === !0 ? " q-field--dense" : "") + (t.itemAligned === !0 ? " q-field--item-aligned q-item-type" : "") + (e.isDark.value === !0 ? " q-field--dark" : "") + (e.getControl === void 0 ? " q-field--auto-height" : "") + (e.focused.value === !0 ? " q-field--focused" : "") + (c.value === !0 ? " q-field--error" : "") + (c.value === !0 || e.focused.value === !0 ? " q-field--highlighted" : "") + (t.hideBottomSpace !== !0 && m.value === !0 ? " q-field--with-bottom" : "") + (t.disable === !0 ? " q-field--disabled" : t.readonly === !0 ? " q-field--readonly" : "")
621
+ ), P = f(
622
+ () => "q-field__control relative-position row no-wrap" + (t.bgColor !== void 0 ? ` bg-${t.bgColor}` : "") + (c.value === !0 ? " text-negative" : typeof t.standout == "string" && t.standout.length !== 0 && e.focused.value === !0 ? ` ${t.standout}` : t.color !== void 0 ? ` text-${t.color}` : "")
623
+ ), E = f(
624
+ () => t.labelSlot === !0 || t.label !== void 0
625
+ ), q = f(
626
+ () => "q-field__label no-pointer-events absolute ellipsis" + (t.labelColor !== void 0 && c.value !== !0 ? ` text-${t.labelColor}` : "")
627
+ ), R = f(() => ({
628
+ id: e.targetUid.value,
629
+ editable: e.editable.value,
630
+ focused: e.focused.value,
631
+ floatingLabel: r.value,
632
+ modelValue: t.modelValue,
633
+ emitValue: e.emitValue
634
+ })), D = f(() => {
635
+ const k = {};
636
+ return e.targetUid.value && (k.for = e.targetUid.value), t.disable === !0 && (k["aria-disabled"] = "true"), k;
637
+ });
638
+ function B() {
639
+ const k = document.activeElement;
640
+ let M = e.targetRef !== void 0 && e.targetRef.value;
641
+ M && (k === null || k.id !== e.targetUid.value) && (M.hasAttribute("tabindex") === !0 || (M = M.querySelector("[tabindex]")), M && M !== k && M.focus({ preventScroll: !0 }));
642
+ }
643
+ function L() {
644
+ Nt(B);
645
+ }
646
+ function H() {
647
+ So(B);
648
+ const k = document.activeElement;
649
+ k !== null && e.rootRef.value.contains(k) && k.blur();
650
+ }
651
+ function Q(k) {
652
+ d !== null && (clearTimeout(d), d = null), e.editable.value === !0 && e.focused.value === !1 && (e.focused.value = !0, l("focus", k));
653
+ }
654
+ function G(k, M) {
655
+ d !== null && clearTimeout(d), d = setTimeout(() => {
656
+ d = null, !(document.hasFocus() === !0 && (e.hasPopupOpen === !0 || e.controlRef === void 0 || e.controlRef.value === null || e.controlRef.value.contains(document.activeElement) !== !1)) && (e.focused.value === !0 && (e.focused.value = !1, l("blur", k)), M !== void 0 && M());
657
+ });
658
+ }
659
+ function ne(k) {
660
+ ae(k), u.platform.is.mobile !== !0 ? (e.targetRef !== void 0 && e.targetRef.value || e.rootRef.value).focus() : e.rootRef.value.contains(document.activeElement) === !0 && document.activeElement.blur(), t.type === "file" && (e.inputRef.value.value = null), l("update:modelValue", null), e.changeEvent === !0 && l("change", null), l("clear", t.modelValue), ue(() => {
661
+ const M = v.value;
662
+ C(), v.value = M;
663
+ });
664
+ }
665
+ function A(k) {
666
+ [13, 32].includes(k.keyCode) && ne(k);
667
+ }
668
+ function U() {
669
+ const k = [];
670
+ return n.prepend !== void 0 && k.push(
671
+ h("div", {
672
+ class: "q-field__prepend q-field__marginal row no-wrap items-center",
673
+ key: "prepend",
674
+ onClick: pe
675
+ }, n.prepend())
676
+ ), k.push(
677
+ h("div", {
678
+ class: "q-field__control-container col relative-position row no-wrap q-anchor--skip"
679
+ }, oe())
680
+ ), c.value === !0 && t.noErrorIcon === !1 && k.push(
681
+ X("error", [
682
+ h(Ae, { name: u.iconSet.field.error, color: "negative" })
683
+ ])
684
+ ), t.loading === !0 || e.innerLoading.value === !0 ? k.push(
685
+ X(
686
+ "inner-loading-append",
687
+ n.loading !== void 0 ? n.loading() : [h(Hn, { color: t.color })]
688
+ )
689
+ ) : t.clearable === !0 && e.hasValue.value === !0 && e.editable.value === !0 && k.push(
690
+ X("inner-clearable-append", [
691
+ h(Ae, {
692
+ class: "q-field__focusable-action",
693
+ name: t.clearIcon || u.iconSet.field.clear,
694
+ tabindex: 0,
695
+ role: "button",
696
+ "aria-hidden": "false",
697
+ "aria-label": u.lang.label.clear,
698
+ onKeyup: A,
699
+ onClick: ne
700
+ })
701
+ ])
702
+ ), n.append !== void 0 && k.push(
703
+ h("div", {
704
+ class: "q-field__append q-field__marginal row no-wrap items-center",
705
+ key: "append",
706
+ onClick: pe
707
+ }, n.append())
708
+ ), e.getInnerAppend !== void 0 && k.push(
709
+ X("inner-append", e.getInnerAppend())
710
+ ), e.getControlChild !== void 0 && k.push(
711
+ e.getControlChild()
712
+ ), k;
713
+ }
714
+ function oe() {
715
+ const k = [];
716
+ return t.prefix !== void 0 && t.prefix !== null && k.push(
717
+ h("div", {
718
+ class: "q-field__prefix no-pointer-events row items-center"
719
+ }, t.prefix)
720
+ ), e.getShadowControl !== void 0 && e.hasShadow.value === !0 && k.push(
721
+ e.getShadowControl()
722
+ ), e.getControl !== void 0 ? k.push(e.getControl()) : n.rawControl !== void 0 ? k.push(n.rawControl()) : n.control !== void 0 && k.push(
723
+ h("div", {
724
+ ref: e.targetRef,
725
+ class: "q-field__native row",
726
+ tabindex: -1,
727
+ ...e.splitAttrs.attributes.value,
728
+ "data-autofocus": t.autofocus === !0 || void 0
729
+ }, n.control(R.value))
730
+ ), E.value === !0 && k.push(
731
+ h("div", {
732
+ class: q.value
733
+ }, Se(n.label, t.label))
734
+ ), t.suffix !== void 0 && t.suffix !== null && k.push(
735
+ h("div", {
736
+ class: "q-field__suffix no-pointer-events row items-center"
737
+ }, t.suffix)
738
+ ), k.concat(Se(n.default));
739
+ }
740
+ function te() {
741
+ let k, M;
742
+ c.value === !0 ? y.value !== null ? (k = [h("div", { role: "alert" }, y.value)], M = `q--slot-error-${y.value}`) : (k = Se(n.error), M = "q--slot-error") : (t.hideHint !== !0 || e.focused.value === !0) && (t.hint !== void 0 ? (k = [h("div", t.hint)], M = `q--slot-hint-${t.hint}`) : (k = Se(n.hint), M = "q--slot-hint"));
743
+ const se = t.counter === !0 || n.counter !== void 0;
744
+ if (t.hideBottomSpace === !0 && se === !1 && k === void 0)
745
+ return;
746
+ const s = h("div", {
747
+ key: M,
748
+ class: "q-field__messages col"
749
+ }, k);
750
+ return h("div", {
751
+ class: "q-field__bottom row items-start q-field__bottom--" + (t.hideBottomSpace !== !0 ? "animated" : "stale"),
752
+ onClick: pe
753
+ }, [
754
+ t.hideBottomSpace === !0 ? s : h(bt, { name: "q-transition--field-message" }, () => s),
755
+ se === !0 ? h("div", {
756
+ class: "q-field__counter"
757
+ }, n.counter !== void 0 ? n.counter() : e.computedCounter.value) : null
758
+ ]);
759
+ }
760
+ function X(k, M) {
761
+ return M === null ? null : h("div", {
762
+ key: k,
763
+ class: "q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"
764
+ }, M);
765
+ }
766
+ let re = !1;
767
+ return Ct(() => {
768
+ re = !0;
769
+ }), Ll(() => {
770
+ re === !0 && t.autofocus === !0 && i.focus();
771
+ }), t.autofocus === !0 && tt(() => {
772
+ i.focus();
773
+ }), ce(() => {
774
+ d !== null && clearTimeout(d);
775
+ }), Object.assign(i, { focus: L, blur: H }), function() {
776
+ const M = e.getControl === void 0 && n.control === void 0 ? {
777
+ ...e.splitAttrs.attributes.value,
778
+ "data-autofocus": t.autofocus === !0 || void 0,
779
+ ...D.value
780
+ } : D.value;
781
+ return h(e.tag.value, {
782
+ ref: e.rootRef,
783
+ class: [
784
+ S.value,
785
+ a.class
786
+ ],
787
+ style: a.style,
788
+ ...M
789
+ }, [
790
+ n.before !== void 0 ? h("div", {
791
+ class: "q-field__before q-field__marginal row no-wrap items-center",
792
+ onClick: pe
793
+ }, n.before()) : null,
794
+ h("div", {
795
+ class: "q-field__inner relative-position col self-stretch"
796
+ }, [
797
+ h("div", {
798
+ ref: e.controlRef,
799
+ class: P.value,
800
+ tabindex: -1,
801
+ ...e.controlEvents
802
+ }, U()),
803
+ m.value === !0 ? te() : null
804
+ ]),
805
+ n.after !== void 0 ? h("div", {
806
+ class: "q-field__after q-field__marginal row no-wrap items-center",
807
+ onClick: pe
808
+ }, n.after()) : null
809
+ ]);
810
+ };
811
+ }
812
+ const xo = be({
813
+ name: "QField",
814
+ inheritAttrs: !1,
815
+ props: {
816
+ ...Kt,
817
+ tag: {
818
+ type: String,
819
+ default: "label"
820
+ }
821
+ },
822
+ emits: Xl,
823
+ setup() {
824
+ return Gl(
825
+ Yl({ tagProp: !0 })
826
+ );
827
+ }
828
+ }), Co = {
829
+ xs: 8,
830
+ sm: 10,
831
+ md: 14,
832
+ lg: 20,
833
+ xl: 24
834
+ }, ko = be({
835
+ name: "QChip",
836
+ props: {
837
+ ...lt,
838
+ ...Hl,
839
+ dense: Boolean,
840
+ icon: String,
841
+ iconRight: String,
842
+ iconRemove: String,
843
+ iconSelected: String,
844
+ label: [String, Number],
845
+ color: String,
846
+ textColor: String,
847
+ modelValue: {
848
+ type: Boolean,
849
+ default: !0
850
+ },
851
+ selected: {
852
+ type: Boolean,
853
+ default: null
854
+ },
855
+ square: Boolean,
856
+ outline: Boolean,
857
+ clickable: Boolean,
858
+ removable: Boolean,
859
+ removeAriaLabel: String,
860
+ tabindex: [String, Number],
861
+ disable: Boolean,
862
+ ripple: {
863
+ type: [Boolean, Object],
864
+ default: !0
865
+ }
866
+ },
867
+ emits: ["update:modelValue", "update:selected", "remove", "click"],
868
+ setup(e, { slots: t, emit: l }) {
869
+ const { proxy: { $q: n } } = le(), a = nt(e, n), i = Ol(e, Co), u = f(() => e.selected === !0 || e.icon !== void 0), d = f(() => e.selected === !0 ? e.iconSelected || n.iconSet.chip.selected : e.icon), v = f(() => e.iconRemove || n.iconSet.chip.remove), g = f(
870
+ () => e.disable === !1 && (e.clickable === !0 || e.selected !== null)
871
+ ), c = f(() => {
872
+ const S = e.outline === !0 && e.color || e.textColor;
873
+ return "q-chip row inline no-wrap items-center" + (e.outline === !1 && e.color !== void 0 ? ` bg-${e.color}` : "") + (S ? ` text-${S} q-chip--colored` : "") + (e.disable === !0 ? " disabled" : "") + (e.dense === !0 ? " q-chip--dense" : "") + (e.outline === !0 ? " q-chip--outline" : "") + (e.selected === !0 ? " q-chip--selected" : "") + (g.value === !0 ? " q-chip--clickable cursor-pointer non-selectable q-hoverable" : "") + (e.square === !0 ? " q-chip--square" : "") + (a.value === !0 ? " q-chip--dark q-dark" : "");
874
+ }), y = f(() => {
875
+ const S = e.disable === !0 ? { tabindex: -1, "aria-disabled": "true" } : { tabindex: e.tabindex || 0 }, P = {
876
+ ...S,
877
+ role: "button",
878
+ "aria-hidden": "false",
879
+ "aria-label": e.removeAriaLabel || n.lang.label.remove
880
+ };
881
+ return { chip: S, remove: P };
882
+ });
883
+ function C(S) {
884
+ S.keyCode === 13 && r(S);
885
+ }
886
+ function r(S) {
887
+ e.disable || (l("update:selected", !e.selected), l("click", S));
888
+ }
889
+ function m(S) {
890
+ (S.keyCode === void 0 || S.keyCode === 13) && (ae(S), e.disable === !1 && (l("update:modelValue", !1), l("remove")));
891
+ }
892
+ function _() {
893
+ const S = [];
894
+ g.value === !0 && S.push(
895
+ h("div", { class: "q-focus-helper" })
896
+ ), u.value === !0 && S.push(
897
+ h(Ae, {
898
+ class: "q-chip__icon q-chip__icon--left",
899
+ name: d.value
900
+ })
901
+ );
902
+ const P = e.label !== void 0 ? [h("div", { class: "ellipsis" }, [e.label])] : void 0;
903
+ return S.push(
904
+ h("div", {
905
+ class: "q-chip__content col row no-wrap items-center q-anchor--skip"
906
+ }, Dn(t.default, P))
907
+ ), e.iconRight && S.push(
908
+ h(Ae, {
909
+ class: "q-chip__icon q-chip__icon--right",
910
+ name: e.iconRight
911
+ })
912
+ ), e.removable === !0 && S.push(
913
+ h(Ae, {
914
+ class: "q-chip__icon q-chip__icon--remove cursor-pointer",
915
+ name: v.value,
916
+ ...y.value.remove,
917
+ onClick: m,
918
+ onKeyup: m
919
+ })
920
+ ), S;
921
+ }
922
+ return () => {
923
+ if (e.modelValue === !1) return;
924
+ const S = {
925
+ class: c.value,
926
+ style: i.value
927
+ };
928
+ return g.value === !0 && Object.assign(
929
+ S,
930
+ y.value.chip,
931
+ { onClick: r, onKeyup: C }
932
+ ), $n(
933
+ "div",
934
+ S,
935
+ _(),
936
+ "ripple",
937
+ e.ripple !== !1 && e.disable !== !0,
938
+ () => [[Pn, e.ripple]]
939
+ );
940
+ };
941
+ }
942
+ });
943
+ function qo() {
944
+ if (window.getSelection !== void 0) {
945
+ const e = window.getSelection();
946
+ e.empty !== void 0 ? e.empty() : e.removeAllRanges !== void 0 && (e.removeAllRanges(), Jn.is.mobile !== !0 && e.addRange(document.createRange()));
947
+ } else document.selection !== void 0 && document.selection.empty();
948
+ }
949
+ const Vo = {
950
+ /* SSR does not know about Element */
951
+ target: {
952
+ type: [Boolean, String, Element],
953
+ default: !0
954
+ },
955
+ noParentEvent: Boolean
956
+ }, _o = {
957
+ ...Vo,
958
+ contextMenu: Boolean
959
+ };
960
+ function Eo({
961
+ showing: e,
962
+ avoidEmit: t,
963
+ // required for QPopupProxy (true)
964
+ configureAnchorEl: l
965
+ // optional
966
+ }) {
967
+ const { props: n, proxy: a, emit: i } = le(), u = T(null);
968
+ let d = null;
969
+ function v(r) {
970
+ return u.value === null ? !1 : r === void 0 || r.touches === void 0 || r.touches.length <= 1;
971
+ }
972
+ const g = {};
973
+ l === void 0 && (Object.assign(g, {
974
+ hide(r) {
975
+ a.hide(r);
976
+ },
977
+ toggle(r) {
978
+ a.toggle(r), r.qAnchorHandled = !0;
979
+ },
980
+ toggleKey(r) {
981
+ kt(r, 13) === !0 && g.toggle(r);
982
+ },
983
+ contextClick(r) {
984
+ a.hide(r), pe(r), ue(() => {
985
+ a.show(r), r.qAnchorHandled = !0;
986
+ });
987
+ },
988
+ prevent: pe,
989
+ mobileTouch(r) {
990
+ if (g.mobileCleanup(r), v(r) !== !0)
991
+ return;
992
+ a.hide(r), u.value.classList.add("non-selectable");
993
+ const m = r.target;
994
+ rl(g, "anchor", [
995
+ [m, "touchmove", "mobileCleanup", "passive"],
996
+ [m, "touchend", "mobileCleanup", "passive"],
997
+ [m, "touchcancel", "mobileCleanup", "passive"],
998
+ [u.value, "contextmenu", "prevent", "notPassive"]
999
+ ]), d = setTimeout(() => {
1000
+ d = null, a.show(r), r.qAnchorHandled = !0;
1001
+ }, 300);
1002
+ },
1003
+ mobileCleanup(r) {
1004
+ u.value.classList.remove("non-selectable"), d !== null && (clearTimeout(d), d = null), e.value === !0 && r !== void 0 && qo();
1005
+ }
1006
+ }), l = function(r = n.contextMenu) {
1007
+ if (n.noParentEvent === !0 || u.value === null) return;
1008
+ let m;
1009
+ r === !0 ? a.$q.platform.is.mobile === !0 ? m = [
1010
+ [u.value, "touchstart", "mobileTouch", "passive"]
1011
+ ] : m = [
1012
+ [u.value, "mousedown", "hide", "passive"],
1013
+ [u.value, "contextmenu", "contextClick", "notPassive"]
1014
+ ] : m = [
1015
+ [u.value, "click", "toggle", "passive"],
1016
+ [u.value, "keyup", "toggleKey", "passive"]
1017
+ ], rl(g, "anchor", m);
1018
+ });
1019
+ function c() {
1020
+ Wn(g, "anchor");
1021
+ }
1022
+ function y(r) {
1023
+ for (u.value = r; u.value.classList.contains("q-anchor--skip"); )
1024
+ u.value = u.value.parentNode;
1025
+ l();
1026
+ }
1027
+ function C() {
1028
+ if (n.target === !1 || n.target === "" || a.$el.parentNode === null)
1029
+ u.value = null;
1030
+ else if (n.target === !0)
1031
+ y(a.$el.parentNode);
1032
+ else {
1033
+ let r = n.target;
1034
+ if (typeof n.target == "string")
1035
+ try {
1036
+ r = document.querySelector(n.target);
1037
+ } catch {
1038
+ r = void 0;
1039
+ }
1040
+ r != null ? (u.value = r.$el || r, l()) : (u.value = null, console.error(`Anchor: target "${n.target}" not found`));
1041
+ }
1042
+ }
1043
+ return K(() => n.contextMenu, (r) => {
1044
+ u.value !== null && (c(), l(r));
1045
+ }), K(() => n.target, () => {
1046
+ u.value !== null && c(), C();
1047
+ }), K(() => n.noParentEvent, (r) => {
1048
+ u.value !== null && (r === !0 ? c() : l());
1049
+ }), tt(() => {
1050
+ C(), t !== !0 && n.modelValue === !0 && u.value === null && i("update:modelValue", !1);
1051
+ }), ce(() => {
1052
+ d !== null && clearTimeout(d), c();
1053
+ }), {
1054
+ anchorEl: u,
1055
+ canShow: v,
1056
+ anchorEvents: g
1057
+ };
1058
+ }
1059
+ function Bo(e, t) {
1060
+ const l = T(null);
1061
+ let n;
1062
+ function a(d, v) {
1063
+ const g = `${v !== void 0 ? "add" : "remove"}EventListener`, c = v !== void 0 ? v : n;
1064
+ d !== window && d[g]("scroll", c, ge.passive), window[g]("scroll", c, ge.passive), n = v;
1065
+ }
1066
+ function i() {
1067
+ l.value !== null && (a(l.value), l.value = null);
1068
+ }
1069
+ const u = K(() => e.noParentEvent, () => {
1070
+ l.value !== null && (i(), t());
1071
+ });
1072
+ return ce(u), {
1073
+ localScrollTarget: l,
1074
+ unconfigureScrollTarget: i,
1075
+ changeScrollEvent: a
1076
+ };
1077
+ }
1078
+ const Zl = {
1079
+ modelValue: {
1080
+ type: Boolean,
1081
+ default: null
1082
+ },
1083
+ "onUpdate:modelValue": [Function, Array]
1084
+ }, Jl = [
1085
+ "beforeShow",
1086
+ "show",
1087
+ "beforeHide",
1088
+ "hide"
1089
+ ];
1090
+ function en({
1091
+ showing: e,
1092
+ canShow: t,
1093
+ // optional
1094
+ hideOnRouteChange: l,
1095
+ // optional
1096
+ handleShow: n,
1097
+ // optional
1098
+ handleHide: a,
1099
+ // optional
1100
+ processOnMount: i
1101
+ // optional
1102
+ }) {
1103
+ const u = le(), { props: d, emit: v, proxy: g } = u;
1104
+ let c;
1105
+ function y(E) {
1106
+ e.value === !0 ? m(E) : C(E);
1107
+ }
1108
+ function C(E) {
1109
+ if (d.disable === !0 || E !== void 0 && E.qAnchorHandled === !0 || t !== void 0 && t(E) !== !0)
1110
+ return;
1111
+ const q = d["onUpdate:modelValue"] !== void 0;
1112
+ q === !0 && (v("update:modelValue", !0), c = E, ue(() => {
1113
+ c === E && (c = void 0);
1114
+ })), (d.modelValue === null || q === !1) && r(E);
1115
+ }
1116
+ function r(E) {
1117
+ e.value !== !0 && (e.value = !0, v("beforeShow", E), n !== void 0 ? n(E) : v("show", E));
1118
+ }
1119
+ function m(E) {
1120
+ if (d.disable === !0)
1121
+ return;
1122
+ const q = d["onUpdate:modelValue"] !== void 0;
1123
+ q === !0 && (v("update:modelValue", !1), c = E, ue(() => {
1124
+ c === E && (c = void 0);
1125
+ })), (d.modelValue === null || q === !1) && _(E);
1126
+ }
1127
+ function _(E) {
1128
+ e.value !== !1 && (e.value = !1, v("beforeHide", E), a !== void 0 ? a(E) : v("hide", E));
1129
+ }
1130
+ function S(E) {
1131
+ d.disable === !0 && E === !0 ? d["onUpdate:modelValue"] !== void 0 && v("update:modelValue", !1) : E === !0 !== e.value && (E === !0 ? r : _)(c);
1132
+ }
1133
+ K(() => d.modelValue, S), l !== void 0 && jn(u) === !0 && K(() => g.$route.fullPath, () => {
1134
+ l.value === !0 && e.value === !0 && m();
1135
+ }), tt(() => {
1136
+ S(d.modelValue);
1137
+ });
1138
+ const P = { show: C, hide: m, toggle: y };
1139
+ return Object.assign(g, P), P;
1140
+ }
1141
+ const bl = {};
1142
+ let Ao = 1, To = document.body;
1143
+ function Ro(e, t) {
1144
+ const l = document.createElement("div");
1145
+ if (l.id = t !== void 0 ? `q-portal--${t}--${Ao++}` : e, bl.globalNodes !== void 0) {
1146
+ const n = bl.globalNodes.class;
1147
+ n !== void 0 && (l.className = n);
1148
+ }
1149
+ return To.appendChild(l), l;
1150
+ }
1151
+ function zo(e) {
1152
+ e.remove();
1153
+ }
1154
+ const Je = [];
1155
+ function Fo(e, t) {
1156
+ do {
1157
+ if (e.$options.name === "QMenu") {
1158
+ if (e.hide(t), e.$props.separateClosePopup === !0)
1159
+ return Rt(e);
1160
+ } else if (e.__qPortal === !0) {
1161
+ const l = Rt(e);
1162
+ return l !== void 0 && l.$options.name === "QPopupProxy" ? (e.hide(t), l) : e;
1163
+ }
1164
+ e = Rt(e);
1165
+ } while (e != null);
1166
+ }
1167
+ const Mo = be({
1168
+ name: "QPortal",
1169
+ setup(e, { slots: t }) {
1170
+ return () => t.default();
1171
+ }
1172
+ });
1173
+ function Lo(e) {
1174
+ for (e = e.parent; e != null; ) {
1175
+ if (e.type.name === "QGlobalDialog")
1176
+ return !0;
1177
+ if (e.type.name === "QDialog" || e.type.name === "QMenu")
1178
+ return !1;
1179
+ e = e.parent;
1180
+ }
1181
+ return !1;
1182
+ }
1183
+ function tn(e, t, l, n) {
1184
+ const a = T(!1), i = T(!1);
1185
+ let u = null;
1186
+ const d = {}, v = n === "dialog" && Lo(e);
1187
+ function g(y) {
1188
+ if (y === !0) {
1189
+ pl(d), i.value = !0;
1190
+ return;
1191
+ }
1192
+ i.value = !1, a.value === !1 && (v === !1 && u === null && (u = Ro(!1, n)), a.value = !0, Je.push(e.proxy), yo(d));
1193
+ }
1194
+ function c(y) {
1195
+ if (i.value = !1, y !== !0) return;
1196
+ pl(d), a.value = !1;
1197
+ const C = Je.indexOf(e.proxy);
1198
+ C !== -1 && Je.splice(C, 1), u !== null && (zo(u), u = null);
1199
+ }
1200
+ return En(() => {
1201
+ c(!0);
1202
+ }), e.proxy.__qPortal = !0, Dl(e.proxy, "contentEl", () => t.value), {
1203
+ showPortal: g,
1204
+ hidePortal: c,
1205
+ portalIsActive: a,
1206
+ portalIsAccessible: i,
1207
+ renderPortal: () => v === !0 ? l() : a.value === !0 ? [h(Bn, { to: u }, h(Mo, l))] : void 0
1208
+ };
1209
+ }
1210
+ const ln = {
1211
+ transitionShow: {
1212
+ type: String,
1213
+ default: "fade"
1214
+ },
1215
+ transitionHide: {
1216
+ type: String,
1217
+ default: "fade"
1218
+ },
1219
+ transitionDuration: {
1220
+ type: [String, Number],
1221
+ default: 300
1222
+ }
1223
+ };
1224
+ function nn(e, t = () => {
1225
+ }, l = () => {
1226
+ }) {
1227
+ return {
1228
+ transitionProps: f(() => {
1229
+ const n = `q-transition--${e.transitionShow || t()}`, a = `q-transition--${e.transitionHide || l()}`;
1230
+ return {
1231
+ appear: !0,
1232
+ enterFromClass: `${n}-enter-from`,
1233
+ enterActiveClass: `${n}-enter-active`,
1234
+ enterToClass: `${n}-enter-to`,
1235
+ leaveFromClass: `${a}-leave-from`,
1236
+ leaveActiveClass: `${a}-leave-active`,
1237
+ leaveToClass: `${a}-leave-to`
1238
+ };
1239
+ }),
1240
+ transitionStyle: f(() => `--q-transition-duration: ${e.transitionDuration}ms`)
1241
+ };
1242
+ }
1243
+ function on() {
1244
+ let e;
1245
+ const t = le();
1246
+ function l() {
1247
+ e = void 0;
1248
+ }
1249
+ return Ct(l), ce(l), {
1250
+ removeTick: l,
1251
+ registerTick(n) {
1252
+ e = n, ue(() => {
1253
+ e === n && ($l(t) === !1 && e(), e = void 0);
1254
+ });
1255
+ }
1256
+ };
1257
+ }
1258
+ function un() {
1259
+ let e = null;
1260
+ const t = le();
1261
+ function l() {
1262
+ e !== null && (clearTimeout(e), e = null);
1263
+ }
1264
+ return Ct(l), ce(l), {
1265
+ removeTimeout: l,
1266
+ registerTimeout(n, a) {
1267
+ l(), $l(t) === !1 && (e = setTimeout(() => {
1268
+ e = null, n();
1269
+ }, a));
1270
+ }
1271
+ };
1272
+ }
1273
+ const Oo = [Element, String], Io = [null, document, document.body, document.scrollingElement, document.documentElement];
1274
+ function Ho(e, t) {
1275
+ let l = Nn(t);
1276
+ if (l === void 0) {
1277
+ if (e == null)
1278
+ return window;
1279
+ l = e.closest(".scroll,.scroll-y,.overflow-auto");
1280
+ }
1281
+ return Io.includes(l) ? window : l;
1282
+ }
1283
+ function $o(e) {
1284
+ return e === window ? window.pageYOffset || window.scrollY || document.body.scrollTop || 0 : e.scrollTop;
1285
+ }
1286
+ function Po(e) {
1287
+ return e === window ? window.pageXOffset || window.scrollX || document.body.scrollLeft || 0 : e.scrollLeft;
1288
+ }
1289
+ let mt;
1290
+ function Do() {
1291
+ if (mt !== void 0)
1292
+ return mt;
1293
+ const e = document.createElement("p"), t = document.createElement("div");
1294
+ sl(e, {
1295
+ width: "100%",
1296
+ height: "200px"
1297
+ }), sl(t, {
1298
+ position: "absolute",
1299
+ top: "0px",
1300
+ left: "0px",
1301
+ visibility: "hidden",
1302
+ width: "200px",
1303
+ height: "150px",
1304
+ overflow: "hidden"
1305
+ }), t.appendChild(e), document.body.appendChild(t);
1306
+ const l = e.offsetWidth;
1307
+ t.style.overflow = "scroll";
1308
+ let n = e.offsetWidth;
1309
+ return l === n && (n = t.clientWidth), t.remove(), mt = l - n, mt;
1310
+ }
1311
+ function Wo(e, t = !0) {
1312
+ return !e || e.nodeType !== Node.ELEMENT_NODE ? !1 : t ? e.scrollHeight > e.clientHeight && (e.classList.contains("scroll") || e.classList.contains("overflow-auto") || ["auto", "scroll"].includes(window.getComputedStyle(e)["overflow-y"])) : e.scrollWidth > e.clientWidth && (e.classList.contains("scroll") || e.classList.contains("overflow-auto") || ["auto", "scroll"].includes(window.getComputedStyle(e)["overflow-x"]));
1313
+ }
1314
+ const Te = [];
1315
+ let je;
1316
+ function jo(e) {
1317
+ je = e.keyCode === 27;
1318
+ }
1319
+ function No() {
1320
+ je === !0 && (je = !1);
1321
+ }
1322
+ function Ko(e) {
1323
+ je === !0 && (je = !1, kt(e, 27) === !0 && Te[Te.length - 1](e));
1324
+ }
1325
+ function an(e) {
1326
+ window[e]("keydown", jo), window[e]("blur", No), window[e]("keyup", Ko), je = !1;
1327
+ }
1328
+ function rn(e) {
1329
+ we.is.desktop === !0 && (Te.push(e), Te.length === 1 && an("addEventListener"));
1330
+ }
1331
+ function yt(e) {
1332
+ const t = Te.indexOf(e);
1333
+ t !== -1 && (Te.splice(t, 1), Te.length === 0 && an("removeEventListener"));
1334
+ }
1335
+ const { notPassiveCapture: St } = ge, Re = [];
1336
+ function wt(e) {
1337
+ const t = e.target;
1338
+ if (t === void 0 || t.nodeType === 8 || t.classList.contains("no-pointer-events") === !0)
1339
+ return;
1340
+ let l = Je.length - 1;
1341
+ for (; l >= 0; ) {
1342
+ const n = Je[l].$;
1343
+ if (n.type.name === "QTooltip") {
1344
+ l--;
1345
+ continue;
1346
+ }
1347
+ if (n.type.name !== "QDialog")
1348
+ break;
1349
+ if (n.props.seamless !== !0)
1350
+ return;
1351
+ l--;
1352
+ }
1353
+ for (let n = Re.length - 1; n >= 0; n--) {
1354
+ const a = Re[n];
1355
+ if ((a.anchorEl.value === null || a.anchorEl.value.contains(t) === !1) && (t === document.body || a.innerRef.value !== null && a.innerRef.value.contains(t) === !1))
1356
+ e.qClickOutside = !0, a.onClickOutside(e);
1357
+ else
1358
+ return;
1359
+ }
1360
+ }
1361
+ function Qo(e) {
1362
+ Re.push(e), Re.length === 1 && (document.addEventListener("mousedown", wt, St), document.addEventListener("touchstart", wt, St));
1363
+ }
1364
+ function yl(e) {
1365
+ const t = Re.findIndex((l) => l === e);
1366
+ t !== -1 && (Re.splice(t, 1), Re.length === 0 && (document.removeEventListener("mousedown", wt, St), document.removeEventListener("touchstart", wt, St)));
1367
+ }
1368
+ let Sl, wl;
1369
+ function xl(e) {
1370
+ const t = e.split(" ");
1371
+ return t.length !== 2 ? !1 : ["top", "center", "bottom"].includes(t[0]) !== !0 ? (console.error("Anchor/Self position must start with one of top/center/bottom"), !1) : ["left", "middle", "right", "start", "end"].includes(t[1]) !== !0 ? (console.error("Anchor/Self position must end with one of left/middle/right/start/end"), !1) : !0;
1372
+ }
1373
+ function Uo(e) {
1374
+ return e ? !(e.length !== 2 || typeof e[0] != "number" || typeof e[1] != "number") : !0;
1375
+ }
1376
+ const jt = {
1377
+ "start#ltr": "left",
1378
+ "start#rtl": "right",
1379
+ "end#ltr": "right",
1380
+ "end#rtl": "left"
1381
+ };
1382
+ ["left", "middle", "right"].forEach((e) => {
1383
+ jt[`${e}#ltr`] = e, jt[`${e}#rtl`] = e;
1384
+ });
1385
+ function Cl(e, t) {
1386
+ const l = e.split(" ");
1387
+ return {
1388
+ vertical: l[0],
1389
+ horizontal: jt[`${l[1]}#${t === !0 ? "rtl" : "ltr"}`]
1390
+ };
1391
+ }
1392
+ function Xo(e, t) {
1393
+ let { top: l, left: n, right: a, bottom: i, width: u, height: d } = e.getBoundingClientRect();
1394
+ return t !== void 0 && (l -= t[1], n -= t[0], i += t[1], a += t[0], u += t[0], d += t[1]), {
1395
+ top: l,
1396
+ bottom: i,
1397
+ height: d,
1398
+ left: n,
1399
+ right: a,
1400
+ width: u,
1401
+ middle: n + (a - n) / 2,
1402
+ center: l + (i - l) / 2
1403
+ };
1404
+ }
1405
+ function Yo(e, t, l) {
1406
+ let { top: n, left: a } = e.getBoundingClientRect();
1407
+ return n += t.top, a += t.left, l !== void 0 && (n += l[1], a += l[0]), {
1408
+ top: n,
1409
+ bottom: n + 1,
1410
+ height: 1,
1411
+ left: a,
1412
+ right: a + 1,
1413
+ width: 1,
1414
+ middle: a,
1415
+ center: n
1416
+ };
1417
+ }
1418
+ function Go(e, t) {
1419
+ return {
1420
+ top: 0,
1421
+ center: t / 2,
1422
+ bottom: t,
1423
+ left: 0,
1424
+ middle: e / 2,
1425
+ right: e
1426
+ };
1427
+ }
1428
+ function kl(e, t, l, n) {
1429
+ return {
1430
+ top: e[l.vertical] - t[n.vertical],
1431
+ left: e[l.horizontal] - t[n.horizontal]
1432
+ };
1433
+ }
1434
+ function sn(e, t = 0) {
1435
+ if (e.targetEl === null || e.anchorEl === null || t > 5)
1436
+ return;
1437
+ if (e.targetEl.offsetHeight === 0 || e.targetEl.offsetWidth === 0) {
1438
+ setTimeout(() => {
1439
+ sn(e, t + 1);
1440
+ }, 10);
1441
+ return;
1442
+ }
1443
+ const {
1444
+ targetEl: l,
1445
+ offset: n,
1446
+ anchorEl: a,
1447
+ anchorOrigin: i,
1448
+ selfOrigin: u,
1449
+ absoluteOffset: d,
1450
+ fit: v,
1451
+ cover: g,
1452
+ maxHeight: c,
1453
+ maxWidth: y
1454
+ } = e;
1455
+ if (we.is.ios === !0 && window.visualViewport !== void 0) {
1456
+ const B = document.body.style, { offsetLeft: L, offsetTop: H } = window.visualViewport;
1457
+ L !== Sl && (B.setProperty("--q-pe-left", L + "px"), Sl = L), H !== wl && (B.setProperty("--q-pe-top", H + "px"), wl = H);
1458
+ }
1459
+ const { scrollLeft: C, scrollTop: r } = l, m = d === void 0 ? Xo(a, g === !0 ? [0, 0] : n) : Yo(a, d, n);
1460
+ Object.assign(l.style, {
1461
+ top: 0,
1462
+ left: 0,
1463
+ minWidth: null,
1464
+ minHeight: null,
1465
+ maxWidth: y,
1466
+ maxHeight: c,
1467
+ visibility: "visible"
1468
+ });
1469
+ const { offsetWidth: _, offsetHeight: S } = l, { elWidth: P, elHeight: E } = v === !0 || g === !0 ? { elWidth: Math.max(m.width, _), elHeight: g === !0 ? Math.max(m.height, S) : S } : { elWidth: _, elHeight: S };
1470
+ let q = { maxWidth: y, maxHeight: c };
1471
+ (v === !0 || g === !0) && (q.minWidth = m.width + "px", g === !0 && (q.minHeight = m.height + "px")), Object.assign(l.style, q);
1472
+ const R = Go(P, E);
1473
+ let D = kl(m, R, i, u);
1474
+ if (d === void 0 || n === void 0)
1475
+ Mt(D, m, R, i, u);
1476
+ else {
1477
+ const { top: B, left: L } = D;
1478
+ Mt(D, m, R, i, u);
1479
+ let H = !1;
1480
+ if (D.top !== B) {
1481
+ H = !0;
1482
+ const Q = 2 * n[1];
1483
+ m.center = m.top -= Q, m.bottom -= Q + 2;
1484
+ }
1485
+ if (D.left !== L) {
1486
+ H = !0;
1487
+ const Q = 2 * n[0];
1488
+ m.middle = m.left -= Q, m.right -= Q + 2;
1489
+ }
1490
+ H === !0 && (D = kl(m, R, i, u), Mt(D, m, R, i, u));
1491
+ }
1492
+ q = {
1493
+ top: D.top + "px",
1494
+ left: D.left + "px"
1495
+ }, D.maxHeight !== void 0 && (q.maxHeight = D.maxHeight + "px", m.height > D.maxHeight && (q.minHeight = q.maxHeight)), D.maxWidth !== void 0 && (q.maxWidth = D.maxWidth + "px", m.width > D.maxWidth && (q.minWidth = q.maxWidth)), Object.assign(l.style, q), l.scrollTop !== r && (l.scrollTop = r), l.scrollLeft !== C && (l.scrollLeft = C);
1496
+ }
1497
+ function Mt(e, t, l, n, a) {
1498
+ const i = l.bottom, u = l.right, d = Do(), v = window.innerHeight - d, g = document.body.clientWidth;
1499
+ if (e.top < 0 || e.top + i > v)
1500
+ if (a.vertical === "center")
1501
+ e.top = t[n.vertical] > v / 2 ? Math.max(0, v - i) : 0, e.maxHeight = Math.min(i, v);
1502
+ else if (t[n.vertical] > v / 2) {
1503
+ const c = Math.min(
1504
+ v,
1505
+ n.vertical === "center" ? t.center : n.vertical === a.vertical ? t.bottom : t.top
1506
+ );
1507
+ e.maxHeight = Math.min(i, c), e.top = Math.max(0, c - i);
1508
+ } else
1509
+ e.top = Math.max(
1510
+ 0,
1511
+ n.vertical === "center" ? t.center : n.vertical === a.vertical ? t.top : t.bottom
1512
+ ), e.maxHeight = Math.min(i, v - e.top);
1513
+ if (e.left < 0 || e.left + u > g)
1514
+ if (e.maxWidth = Math.min(u, g), a.horizontal === "middle")
1515
+ e.left = t[n.horizontal] > g / 2 ? Math.max(0, g - u) : 0;
1516
+ else if (t[n.horizontal] > g / 2) {
1517
+ const c = Math.min(
1518
+ g,
1519
+ n.horizontal === "middle" ? t.middle : n.horizontal === a.horizontal ? t.right : t.left
1520
+ );
1521
+ e.maxWidth = Math.min(u, c), e.left = Math.max(0, c - e.maxWidth);
1522
+ } else
1523
+ e.left = Math.max(
1524
+ 0,
1525
+ n.horizontal === "middle" ? t.middle : n.horizontal === a.horizontal ? t.left : t.right
1526
+ ), e.maxWidth = Math.min(u, g - e.left);
1527
+ }
1528
+ const Zo = be({
1529
+ name: "QMenu",
1530
+ inheritAttrs: !1,
1531
+ props: {
1532
+ ..._o,
1533
+ ...Zl,
1534
+ ...lt,
1535
+ ...ln,
1536
+ persistent: Boolean,
1537
+ autoClose: Boolean,
1538
+ separateClosePopup: Boolean,
1539
+ noRouteDismiss: Boolean,
1540
+ noRefocus: Boolean,
1541
+ noFocus: Boolean,
1542
+ fit: Boolean,
1543
+ cover: Boolean,
1544
+ square: Boolean,
1545
+ anchor: {
1546
+ type: String,
1547
+ validator: xl
1548
+ },
1549
+ self: {
1550
+ type: String,
1551
+ validator: xl
1552
+ },
1553
+ offset: {
1554
+ type: Array,
1555
+ validator: Uo
1556
+ },
1557
+ scrollTarget: Oo,
1558
+ touchPosition: Boolean,
1559
+ maxHeight: {
1560
+ type: String,
1561
+ default: null
1562
+ },
1563
+ maxWidth: {
1564
+ type: String,
1565
+ default: null
1566
+ }
1567
+ },
1568
+ emits: [
1569
+ ...Jl,
1570
+ "click",
1571
+ "escapeKey"
1572
+ ],
1573
+ setup(e, { slots: t, emit: l, attrs: n }) {
1574
+ let a = null, i, u, d;
1575
+ const v = le(), { proxy: g } = v, { $q: c } = g, y = T(null), C = T(!1), r = f(
1576
+ () => e.persistent !== !0 && e.noRouteDismiss !== !0
1577
+ ), m = nt(e, c), { registerTick: _, removeTick: S } = on(), { registerTimeout: P } = un(), { transitionProps: E, transitionStyle: q } = nn(e), { localScrollTarget: R, changeScrollEvent: D, unconfigureScrollTarget: B } = Bo(e, O), { anchorEl: L, canShow: H } = Eo({ showing: C }), { hide: Q } = en({
1578
+ showing: C,
1579
+ canShow: H,
1580
+ handleShow: se,
1581
+ handleHide: s,
1582
+ hideOnRouteChange: r,
1583
+ processOnMount: !0
1584
+ }), { showPortal: G, hidePortal: ne, renderPortal: A } = tn(v, y, N, "menu"), U = {
1585
+ anchorEl: L,
1586
+ innerRef: y,
1587
+ onClickOutside(b) {
1588
+ if (e.persistent !== !0 && C.value === !0)
1589
+ return Q(b), // always prevent touch event
1590
+ (b.type === "touchstart" || b.target.classList.contains("q-dialog__backdrop")) && ae(b), !0;
1591
+ }
1592
+ }, oe = f(
1593
+ () => Cl(
1594
+ e.anchor || (e.cover === !0 ? "center middle" : "bottom start"),
1595
+ c.lang.rtl
1596
+ )
1597
+ ), te = f(() => e.cover === !0 ? oe.value : Cl(e.self || "top start", c.lang.rtl)), X = f(
1598
+ () => (e.square === !0 ? " q-menu--square" : "") + (m.value === !0 ? " q-menu--dark q-dark" : "")
1599
+ ), re = f(() => e.autoClose === !0 ? { onClick: V } : {}), k = f(
1600
+ () => C.value === !0 && e.persistent !== !0
1601
+ );
1602
+ K(k, (b) => {
1603
+ b === !0 ? (rn(F), Qo(U)) : (yt(F), yl(U));
1604
+ });
1605
+ function M() {
1606
+ Nt(() => {
1607
+ let b = y.value;
1608
+ b && b.contains(document.activeElement) !== !0 && (b = b.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || b.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || b.querySelector("[autofocus], [data-autofocus]") || b, b.focus({ preventScroll: !0 }));
1609
+ });
1610
+ }
1611
+ function se(b) {
1612
+ if (a = e.noRefocus === !1 ? document.activeElement : null, Wl(I), G(), O(), i = void 0, b !== void 0 && (e.touchPosition || e.contextMenu)) {
1613
+ const Z = Kn(b);
1614
+ if (Z.left !== void 0) {
1615
+ const { top: ve, left: ze } = L.value.getBoundingClientRect();
1616
+ i = { left: Z.left - ze, top: Z.top - ve };
1617
+ }
1618
+ }
1619
+ u === void 0 && (u = K(
1620
+ () => c.screen.width + "|" + c.screen.height + "|" + e.self + "|" + e.anchor + "|" + c.lang.rtl,
1621
+ z
1622
+ )), e.noFocus !== !0 && document.activeElement.blur(), _(() => {
1623
+ z(), e.noFocus !== !0 && M();
1624
+ }), P(() => {
1625
+ c.platform.is.ios === !0 && (d = e.autoClose, y.value.click()), z(), G(!0), l("show", b);
1626
+ }, e.transitionDuration);
1627
+ }
1628
+ function s(b) {
1629
+ S(), ne(), p(!0), a !== null && // menu was hidden from code or ESC plugin
1630
+ (b === void 0 || b.qClickOutside !== !0) && (((b && b.type.indexOf("key") === 0 ? a.closest('[tabindex]:not([tabindex^="-"])') : void 0) || a).focus(), a = null), P(() => {
1631
+ ne(!0), l("hide", b);
1632
+ }, e.transitionDuration);
1633
+ }
1634
+ function p(b) {
1635
+ i = void 0, u !== void 0 && (u(), u = void 0), (b === !0 || C.value === !0) && (Pt(I), B(), yl(U), yt(F)), b !== !0 && (a = null);
1636
+ }
1637
+ function O() {
1638
+ (L.value !== null || e.scrollTarget !== void 0) && (R.value = Ho(L.value, e.scrollTarget), D(R.value, z));
1639
+ }
1640
+ function V(b) {
1641
+ d !== !0 ? (Fo(g, b), l("click", b)) : d = !1;
1642
+ }
1643
+ function I(b) {
1644
+ k.value === !0 && e.noFocus !== !0 && Pl(y.value, b.target) !== !0 && M();
1645
+ }
1646
+ function F(b) {
1647
+ l("escapeKey"), Q(b);
1648
+ }
1649
+ function z() {
1650
+ sn({
1651
+ targetEl: y.value,
1652
+ offset: e.offset,
1653
+ anchorEl: L.value,
1654
+ anchorOrigin: oe.value,
1655
+ selfOrigin: te.value,
1656
+ absoluteOffset: i,
1657
+ fit: e.fit,
1658
+ cover: e.cover,
1659
+ maxHeight: e.maxHeight,
1660
+ maxWidth: e.maxWidth
1661
+ });
1662
+ }
1663
+ function N() {
1664
+ return h(
1665
+ bt,
1666
+ E.value,
1667
+ () => C.value === !0 ? h("div", {
1668
+ role: "menu",
1669
+ ...n,
1670
+ ref: y,
1671
+ tabindex: -1,
1672
+ class: [
1673
+ "q-menu q-position-engine scroll" + X.value,
1674
+ n.class
1675
+ ],
1676
+ style: [
1677
+ n.style,
1678
+ q.value
1679
+ ],
1680
+ ...re.value
1681
+ }, Se(t.default)) : null
1682
+ );
1683
+ }
1684
+ return ce(p), Object.assign(g, { focus: M, updatePosition: z }), A;
1685
+ }
1686
+ });
1687
+ function Jo(e, t, l) {
1688
+ function n() {
1689
+ }
1690
+ return ce(() => {
1691
+ e.value === !0 && void 0;
1692
+ }), {
1693
+ removeFromHistory: n,
1694
+ addToHistory() {
1695
+ }
1696
+ };
1697
+ }
1698
+ let Ye = 0, Lt, Ot, Ze, It = !1, ql, Vl, _l, Ee = null;
1699
+ function ei(e) {
1700
+ ti(e) && ae(e);
1701
+ }
1702
+ function ti(e) {
1703
+ if (e.target === document.body || e.target.classList.contains("q-layout__backdrop"))
1704
+ return !0;
1705
+ const t = Qn(e), l = e.shiftKey && !e.deltaX, n = !l && Math.abs(e.deltaX) <= Math.abs(e.deltaY), a = l || n ? e.deltaY : e.deltaX;
1706
+ for (let i = 0; i < t.length; i++) {
1707
+ const u = t[i];
1708
+ if (Wo(u, n))
1709
+ return n ? a < 0 && u.scrollTop === 0 ? !0 : a > 0 && u.scrollTop + u.clientHeight === u.scrollHeight : a < 0 && u.scrollLeft === 0 ? !0 : a > 0 && u.scrollLeft + u.clientWidth === u.scrollWidth;
1710
+ }
1711
+ return !0;
1712
+ }
1713
+ function El(e) {
1714
+ e.target === document && (document.scrollingElement.scrollTop = document.scrollingElement.scrollTop);
1715
+ }
1716
+ function ht(e) {
1717
+ It !== !0 && (It = !0, requestAnimationFrame(() => {
1718
+ It = !1;
1719
+ const { height: t } = e.target, { clientHeight: l, scrollTop: n } = document.scrollingElement;
1720
+ (Ze === void 0 || t !== window.innerHeight) && (Ze = l - t, document.scrollingElement.scrollTop = n), n > Ze && (document.scrollingElement.scrollTop -= Math.ceil((n - Ze) / 8));
1721
+ }));
1722
+ }
1723
+ function Bl(e) {
1724
+ const t = document.body, l = window.visualViewport !== void 0;
1725
+ if (e === "add") {
1726
+ const { overflowY: n, overflowX: a } = window.getComputedStyle(t);
1727
+ Lt = Po(window), Ot = $o(window), ql = t.style.left, Vl = t.style.top, _l = window.location.href, t.style.left = `-${Lt}px`, t.style.top = `-${Ot}px`, a !== "hidden" && (a === "scroll" || t.scrollWidth > window.innerWidth) && t.classList.add("q-body--force-scrollbar-x"), n !== "hidden" && (n === "scroll" || t.scrollHeight > window.innerHeight) && t.classList.add("q-body--force-scrollbar-y"), t.classList.add("q-body--prevent-scroll"), document.qScrollPrevented = !0, we.is.ios === !0 && (l === !0 ? (window.scrollTo(0, 0), window.visualViewport.addEventListener("resize", ht, ge.passiveCapture), window.visualViewport.addEventListener("scroll", ht, ge.passiveCapture), window.scrollTo(0, 0)) : window.addEventListener("scroll", El, ge.passiveCapture));
1728
+ }
1729
+ we.is.desktop === !0 && we.is.mac === !0 && window[`${e}EventListener`]("wheel", ei, ge.notPassive), e === "remove" && (we.is.ios === !0 && (l === !0 ? (window.visualViewport.removeEventListener("resize", ht, ge.passiveCapture), window.visualViewport.removeEventListener("scroll", ht, ge.passiveCapture)) : window.removeEventListener("scroll", El, ge.passiveCapture)), t.classList.remove("q-body--prevent-scroll"), t.classList.remove("q-body--force-scrollbar-x"), t.classList.remove("q-body--force-scrollbar-y"), document.qScrollPrevented = !1, t.style.left = ql, t.style.top = Vl, window.location.href === _l && window.scrollTo(Lt, Ot), Ze = void 0);
1730
+ }
1731
+ function li(e) {
1732
+ let t = "add";
1733
+ if (e === !0) {
1734
+ if (Ye++, Ee !== null) {
1735
+ clearTimeout(Ee), Ee = null;
1736
+ return;
1737
+ }
1738
+ if (Ye > 1)
1739
+ return;
1740
+ } else {
1741
+ if (Ye === 0 || (Ye--, Ye > 0))
1742
+ return;
1743
+ if (t = "remove", we.is.ios === !0 && we.is.nativeMobile === !0) {
1744
+ Ee !== null && clearTimeout(Ee), Ee = setTimeout(() => {
1745
+ Bl(t), Ee = null;
1746
+ }, 100);
1747
+ return;
1748
+ }
1749
+ }
1750
+ Bl(t);
1751
+ }
1752
+ function ni() {
1753
+ let e;
1754
+ return {
1755
+ preventBodyScroll(t) {
1756
+ t !== e && (e !== void 0 || t === !0) && (e = t, li(t));
1757
+ }
1758
+ };
1759
+ }
1760
+ let gt = 0;
1761
+ const oi = {
1762
+ standard: "fixed-full flex-center",
1763
+ top: "fixed-top justify-center",
1764
+ bottom: "fixed-bottom justify-center",
1765
+ right: "fixed-right items-center",
1766
+ left: "fixed-left items-center"
1767
+ }, Al = {
1768
+ standard: ["scale", "scale"],
1769
+ top: ["slide-down", "slide-up"],
1770
+ bottom: ["slide-up", "slide-down"],
1771
+ right: ["slide-left", "slide-right"],
1772
+ left: ["slide-right", "slide-left"]
1773
+ }, ii = be({
1774
+ name: "QDialog",
1775
+ inheritAttrs: !1,
1776
+ props: {
1777
+ ...Zl,
1778
+ ...ln,
1779
+ transitionShow: String,
1780
+ // override useTransitionProps
1781
+ transitionHide: String,
1782
+ // override useTransitionProps
1783
+ persistent: Boolean,
1784
+ autoClose: Boolean,
1785
+ allowFocusOutside: Boolean,
1786
+ noEscDismiss: Boolean,
1787
+ noBackdropDismiss: Boolean,
1788
+ noRouteDismiss: Boolean,
1789
+ noRefocus: Boolean,
1790
+ noFocus: Boolean,
1791
+ noShake: Boolean,
1792
+ seamless: Boolean,
1793
+ maximized: Boolean,
1794
+ fullWidth: Boolean,
1795
+ fullHeight: Boolean,
1796
+ square: Boolean,
1797
+ backdropFilter: String,
1798
+ position: {
1799
+ type: String,
1800
+ default: "standard",
1801
+ validator: (e) => ["standard", "top", "bottom", "left", "right"].includes(e)
1802
+ }
1803
+ },
1804
+ emits: [
1805
+ ...Jl,
1806
+ "shake",
1807
+ "click",
1808
+ "escapeKey"
1809
+ ],
1810
+ setup(e, { slots: t, emit: l, attrs: n }) {
1811
+ const a = le(), i = T(null), u = T(!1), d = T(!1);
1812
+ let v = null, g = null, c, y;
1813
+ const C = f(
1814
+ () => e.persistent !== !0 && e.noRouteDismiss !== !0 && e.seamless !== !0
1815
+ ), { preventBodyScroll: r } = ni(), { registerTimeout: m } = un(), { registerTick: _, removeTick: S } = on(), { transitionProps: P, transitionStyle: E } = nn(
1816
+ e,
1817
+ () => Al[e.position][0],
1818
+ () => Al[e.position][1]
1819
+ ), q = f(() => E.value + (e.backdropFilter !== void 0 ? `;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}` : "")), { showPortal: R, hidePortal: D, portalIsAccessible: B, renderPortal: L } = tn(
1820
+ a,
1821
+ i,
1822
+ O,
1823
+ "dialog"
1824
+ ), { hide: H } = en({
1825
+ showing: u,
1826
+ hideOnRouteChange: C,
1827
+ handleShow: U,
1828
+ handleHide: oe,
1829
+ processOnMount: !0
1830
+ });
1831
+ Jo(u);
1832
+ const Q = f(
1833
+ () => `q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized === !0 ? "maximized" : "minimized"} q-dialog__inner--${e.position} ${oi[e.position]}` + (d.value === !0 ? " q-dialog__inner--animating" : "") + (e.fullWidth === !0 ? " q-dialog__inner--fullwidth" : "") + (e.fullHeight === !0 ? " q-dialog__inner--fullheight" : "") + (e.square === !0 ? " q-dialog__inner--square" : "")
1834
+ ), G = f(() => u.value === !0 && e.seamless !== !0), ne = f(() => e.autoClose === !0 ? { onClick: se } : {}), A = f(() => [
1835
+ `q-dialog fullscreen no-pointer-events q-dialog--${G.value === !0 ? "modal" : "seamless"}`,
1836
+ n.class
1837
+ ]);
1838
+ K(() => e.maximized, (V) => {
1839
+ u.value === !0 && M(V);
1840
+ }), K(G, (V) => {
1841
+ r(V), V === !0 ? (Wl(p), rn(re)) : (Pt(p), yt(re));
1842
+ });
1843
+ function U(V) {
1844
+ g = e.noRefocus === !1 && document.activeElement !== null ? document.activeElement : null, M(e.maximized), R(), d.value = !0, e.noFocus !== !0 ? (document.activeElement !== null && document.activeElement.blur(), _(te)) : S(), m(() => {
1845
+ if (a.proxy.$q.platform.is.ios === !0) {
1846
+ if (e.seamless !== !0 && document.activeElement) {
1847
+ const { top: I, bottom: F } = document.activeElement.getBoundingClientRect(), { innerHeight: z } = window, N = window.visualViewport !== void 0 ? window.visualViewport.height : z;
1848
+ I > 0 && F > N / 2 && (document.scrollingElement.scrollTop = Math.min(
1849
+ document.scrollingElement.scrollHeight - N,
1850
+ F >= z ? 1 / 0 : Math.ceil(document.scrollingElement.scrollTop + F - N / 2)
1851
+ )), document.activeElement.scrollIntoView();
1852
+ }
1853
+ y = !0, i.value.click(), y = !1;
1854
+ }
1855
+ R(!0), d.value = !1, l("show", V);
1856
+ }, e.transitionDuration);
1857
+ }
1858
+ function oe(V) {
1859
+ S(), k(!0), d.value = !0, D(), g !== null && (((V && V.type.indexOf("key") === 0 ? g.closest('[tabindex]:not([tabindex^="-"])') : void 0) || g).focus(), g = null), m(() => {
1860
+ D(!0), d.value = !1, l("hide", V);
1861
+ }, e.transitionDuration);
1862
+ }
1863
+ function te(V) {
1864
+ Nt(() => {
1865
+ let I = i.value;
1866
+ if (I !== null) {
1867
+ if (V !== void 0) {
1868
+ const F = I.querySelector(V);
1869
+ if (F !== null) {
1870
+ F.focus({ preventScroll: !0 });
1871
+ return;
1872
+ }
1873
+ }
1874
+ I.contains(document.activeElement) !== !0 && (I = I.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || I.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || I.querySelector("[autofocus], [data-autofocus]") || I, I.focus({ preventScroll: !0 }));
1875
+ }
1876
+ });
1877
+ }
1878
+ function X(V) {
1879
+ V && typeof V.focus == "function" ? V.focus({ preventScroll: !0 }) : te(), l("shake");
1880
+ const I = i.value;
1881
+ I !== null && (I.classList.remove("q-animate--scale"), I.classList.add("q-animate--scale"), v !== null && clearTimeout(v), v = setTimeout(() => {
1882
+ v = null, i.value !== null && (I.classList.remove("q-animate--scale"), te());
1883
+ }, 170));
1884
+ }
1885
+ function re() {
1886
+ e.seamless !== !0 && (e.persistent === !0 || e.noEscDismiss === !0 ? e.maximized !== !0 && e.noShake !== !0 && X() : (l("escapeKey"), H()));
1887
+ }
1888
+ function k(V) {
1889
+ v !== null && (clearTimeout(v), v = null), (V === !0 || u.value === !0) && (M(!1), e.seamless !== !0 && (r(!1), Pt(p), yt(re))), V !== !0 && (g = null);
1890
+ }
1891
+ function M(V) {
1892
+ V === !0 ? c !== !0 && (gt < 1 && document.body.classList.add("q-body--dialog"), gt++, c = !0) : c === !0 && (gt < 2 && document.body.classList.remove("q-body--dialog"), gt--, c = !1);
1893
+ }
1894
+ function se(V) {
1895
+ y !== !0 && (H(V), l("click", V));
1896
+ }
1897
+ function s(V) {
1898
+ e.persistent !== !0 && e.noBackdropDismiss !== !0 ? H(V) : e.noShake !== !0 && X();
1899
+ }
1900
+ function p(V) {
1901
+ e.allowFocusOutside !== !0 && B.value === !0 && Pl(i.value, V.target) !== !0 && te('[tabindex]:not([tabindex="-1"])');
1902
+ }
1903
+ Object.assign(a.proxy, {
1904
+ // expose public methods
1905
+ focus: te,
1906
+ shake: X,
1907
+ // private but needed by QSelect
1908
+ __updateRefocusTarget(V) {
1909
+ g = V || null;
1910
+ }
1911
+ }), ce(k);
1912
+ function O() {
1913
+ return h("div", {
1914
+ role: "dialog",
1915
+ "aria-modal": G.value === !0 ? "true" : "false",
1916
+ ...n,
1917
+ class: A.value
1918
+ }, [
1919
+ h(bt, {
1920
+ name: "q-transition--fade",
1921
+ appear: !0
1922
+ }, () => G.value === !0 ? h("div", {
1923
+ class: "q-dialog__backdrop fixed-full",
1924
+ style: q.value,
1925
+ "aria-hidden": "true",
1926
+ tabindex: -1,
1927
+ onClick: s
1928
+ }) : null),
1929
+ h(
1930
+ bt,
1931
+ P.value,
1932
+ () => u.value === !0 ? h("div", {
1933
+ ref: i,
1934
+ class: Q.value,
1935
+ style: E.value,
1936
+ tabindex: -1,
1937
+ ...ne.value
1938
+ }, Se(t.default)) : null
1939
+ )
1940
+ ]);
1941
+ }
1942
+ return L;
1943
+ }
1944
+ });
1945
+ let xt = !1;
1946
+ {
1947
+ const e = document.createElement("div");
1948
+ e.setAttribute("dir", "rtl"), Object.assign(e.style, {
1949
+ width: "1px",
1950
+ height: "1px",
1951
+ overflow: "auto"
1952
+ });
1953
+ const t = document.createElement("div");
1954
+ Object.assign(t.style, {
1955
+ width: "1000px",
1956
+ height: "1px"
1957
+ }), document.body.appendChild(e), e.appendChild(t), e.scrollLeft = -1e3, xt = e.scrollLeft >= 0, e.remove();
1958
+ }
1959
+ const fe = 1e3, ui = [
1960
+ "start",
1961
+ "center",
1962
+ "end",
1963
+ "start-force",
1964
+ "center-force",
1965
+ "end-force"
1966
+ ], cn = Array.prototype.filter, ai = window.getComputedStyle(document.body).overflowAnchor === void 0 ? Un : function(e, t) {
1967
+ e !== null && (e._qOverflowAnimationFrame !== void 0 && cancelAnimationFrame(e._qOverflowAnimationFrame), e._qOverflowAnimationFrame = requestAnimationFrame(() => {
1968
+ if (e === null)
1969
+ return;
1970
+ e._qOverflowAnimationFrame = void 0;
1971
+ const l = e.children || [];
1972
+ cn.call(l, (a) => a.dataset && a.dataset.qVsAnchor !== void 0).forEach((a) => {
1973
+ delete a.dataset.qVsAnchor;
1974
+ });
1975
+ const n = l[t];
1976
+ n && n.dataset && (n.dataset.qVsAnchor = "");
1977
+ }));
1978
+ };
1979
+ function We(e, t) {
1980
+ return e + t;
1981
+ }
1982
+ function Ht(e, t, l, n, a, i, u, d) {
1983
+ const v = e === window ? document.scrollingElement || document.documentElement : e, g = a === !0 ? "offsetWidth" : "offsetHeight", c = {
1984
+ scrollStart: 0,
1985
+ scrollViewSize: -u - d,
1986
+ scrollMaxSize: 0,
1987
+ offsetStart: -u,
1988
+ offsetEnd: -d
1989
+ };
1990
+ if (a === !0 ? (e === window ? (c.scrollStart = window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, c.scrollViewSize += document.documentElement.clientWidth) : (c.scrollStart = v.scrollLeft, c.scrollViewSize += v.clientWidth), c.scrollMaxSize = v.scrollWidth, i === !0 && (c.scrollStart = (xt === !0 ? c.scrollMaxSize - c.scrollViewSize : 0) - c.scrollStart)) : (e === window ? (c.scrollStart = window.pageYOffset || window.scrollY || document.body.scrollTop || 0, c.scrollViewSize += document.documentElement.clientHeight) : (c.scrollStart = v.scrollTop, c.scrollViewSize += v.clientHeight), c.scrollMaxSize = v.scrollHeight), l !== null)
1991
+ for (let y = l.previousElementSibling; y !== null; y = y.previousElementSibling)
1992
+ y.classList.contains("q-virtual-scroll--skip") === !1 && (c.offsetStart += y[g]);
1993
+ if (n !== null)
1994
+ for (let y = n.nextElementSibling; y !== null; y = y.nextElementSibling)
1995
+ y.classList.contains("q-virtual-scroll--skip") === !1 && (c.offsetEnd += y[g]);
1996
+ if (t !== e) {
1997
+ const y = v.getBoundingClientRect(), C = t.getBoundingClientRect();
1998
+ a === !0 ? (c.offsetStart += C.left - y.left, c.offsetEnd -= C.width) : (c.offsetStart += C.top - y.top, c.offsetEnd -= C.height), e !== window && (c.offsetStart += c.scrollStart), c.offsetEnd += c.scrollMaxSize - c.offsetStart;
1999
+ }
2000
+ return c;
2001
+ }
2002
+ function Tl(e, t, l, n) {
2003
+ t === "end" && (t = (e === window ? document.body : e)[l === !0 ? "scrollWidth" : "scrollHeight"]), e === window ? l === !0 ? (n === !0 && (t = (xt === !0 ? document.body.scrollWidth - document.documentElement.clientWidth : 0) - t), window.scrollTo(t, window.pageYOffset || window.scrollY || document.body.scrollTop || 0)) : window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, t) : l === !0 ? (n === !0 && (t = (xt === !0 ? e.scrollWidth - e.offsetWidth : 0) - t), e.scrollLeft = t) : e.scrollTop = t;
2004
+ }
2005
+ function Ge(e, t, l, n) {
2006
+ if (l >= n)
2007
+ return 0;
2008
+ const a = t.length, i = Math.floor(l / fe), u = Math.floor((n - 1) / fe) + 1;
2009
+ let d = e.slice(i, u).reduce(We, 0);
2010
+ return l % fe !== 0 && (d -= t.slice(i * fe, l).reduce(We, 0)), n % fe !== 0 && n !== a && (d -= t.slice(n, u * fe).reduce(We, 0)), d;
2011
+ }
2012
+ const ri = {
2013
+ virtualScrollSliceSize: {
2014
+ type: [Number, String],
2015
+ default: 10
2016
+ },
2017
+ virtualScrollSliceRatioBefore: {
2018
+ type: [Number, String],
2019
+ default: 1
2020
+ },
2021
+ virtualScrollSliceRatioAfter: {
2022
+ type: [Number, String],
2023
+ default: 1
2024
+ },
2025
+ virtualScrollItemSize: {
2026
+ type: [Number, String],
2027
+ default: 24
2028
+ },
2029
+ virtualScrollStickySizeStart: {
2030
+ type: [Number, String],
2031
+ default: 0
2032
+ },
2033
+ virtualScrollStickySizeEnd: {
2034
+ type: [Number, String],
2035
+ default: 0
2036
+ },
2037
+ tableColspan: [Number, String]
2038
+ }, Rl = {
2039
+ virtualScrollHorizontal: Boolean,
2040
+ onVirtualScroll: Function,
2041
+ ...ri
2042
+ };
2043
+ function si({
2044
+ virtualScrollLength: e,
2045
+ getVirtualScrollTarget: t,
2046
+ getVirtualScrollEl: l,
2047
+ virtualScrollItemSizeComputed: n
2048
+ // optional
2049
+ }) {
2050
+ const a = le(), { props: i, emit: u, proxy: d } = a, { $q: v } = d;
2051
+ let g, c, y, C = [], r;
2052
+ const m = T(0), _ = T(0), S = T({}), P = T(null), E = T(null), q = T(null), R = T({ from: 0, to: 0 }), D = f(() => i.tableColspan !== void 0 ? i.tableColspan : 100);
2053
+ n === void 0 && (n = f(() => i.virtualScrollItemSize));
2054
+ const B = f(() => n.value + ";" + i.virtualScrollHorizontal), L = f(
2055
+ () => B.value + ";" + i.virtualScrollSliceRatioBefore + ";" + i.virtualScrollSliceRatioAfter
2056
+ );
2057
+ K(L, () => {
2058
+ X();
2059
+ }), K(B, H);
2060
+ function H() {
2061
+ te(c, !0);
2062
+ }
2063
+ function Q(s) {
2064
+ te(s === void 0 ? c : s);
2065
+ }
2066
+ function G(s, p) {
2067
+ const O = t();
2068
+ if (O == null || O.nodeType === 8)
2069
+ return;
2070
+ const V = Ht(
2071
+ O,
2072
+ l(),
2073
+ P.value,
2074
+ E.value,
2075
+ i.virtualScrollHorizontal,
2076
+ v.lang.rtl,
2077
+ i.virtualScrollStickySizeStart,
2078
+ i.virtualScrollStickySizeEnd
2079
+ );
2080
+ y !== V.scrollViewSize && X(V.scrollViewSize), A(
2081
+ O,
2082
+ V,
2083
+ Math.min(e.value - 1, Math.max(0, parseInt(s, 10) || 0)),
2084
+ 0,
2085
+ ui.indexOf(p) !== -1 ? p : c !== -1 && s > c ? "end" : "start"
2086
+ );
2087
+ }
2088
+ function ne() {
2089
+ const s = t();
2090
+ if (s == null || s.nodeType === 8)
2091
+ return;
2092
+ const p = Ht(
2093
+ s,
2094
+ l(),
2095
+ P.value,
2096
+ E.value,
2097
+ i.virtualScrollHorizontal,
2098
+ v.lang.rtl,
2099
+ i.virtualScrollStickySizeStart,
2100
+ i.virtualScrollStickySizeEnd
2101
+ ), O = e.value - 1, V = p.scrollMaxSize - p.offsetStart - p.offsetEnd - _.value;
2102
+ if (g === p.scrollStart)
2103
+ return;
2104
+ if (p.scrollMaxSize <= 0) {
2105
+ A(s, p, 0, 0);
2106
+ return;
2107
+ }
2108
+ y !== p.scrollViewSize && X(p.scrollViewSize), U(R.value.from);
2109
+ const I = Math.floor(p.scrollMaxSize - Math.max(p.scrollViewSize, p.offsetEnd) - Math.min(r[O], p.scrollViewSize / 2));
2110
+ if (I > 0 && Math.ceil(p.scrollStart) >= I) {
2111
+ A(
2112
+ s,
2113
+ p,
2114
+ O,
2115
+ p.scrollMaxSize - p.offsetEnd - C.reduce(We, 0)
2116
+ );
2117
+ return;
2118
+ }
2119
+ let F = 0, z = p.scrollStart - p.offsetStart, N = z;
2120
+ if (z <= V && z + p.scrollViewSize >= m.value)
2121
+ z -= m.value, F = R.value.from, N = z;
2122
+ else
2123
+ for (let b = 0; z >= C[b] && F < O; b++)
2124
+ z -= C[b], F += fe;
2125
+ for (; z > 0 && F < O; )
2126
+ z -= r[F], z > -p.scrollViewSize ? (F++, N = z) : N = r[F] + z;
2127
+ A(
2128
+ s,
2129
+ p,
2130
+ F,
2131
+ N
2132
+ );
2133
+ }
2134
+ function A(s, p, O, V, I) {
2135
+ const F = typeof I == "string" && I.indexOf("-force") !== -1, z = F === !0 ? I.replace("-force", "") : I, N = z !== void 0 ? z : "start";
2136
+ let b = Math.max(0, O - S.value[N]), Z = b + S.value.total;
2137
+ Z > e.value && (Z = e.value, b = Math.max(0, Z - S.value.total)), g = p.scrollStart;
2138
+ const ve = b !== R.value.from || Z !== R.value.to;
2139
+ if (ve === !1 && z === void 0) {
2140
+ k(O);
2141
+ return;
2142
+ }
2143
+ const { activeElement: ze } = document, me = q.value;
2144
+ ve === !0 && me !== null && me !== ze && me.contains(ze) === !0 && (me.addEventListener("focusout", oe), setTimeout(() => {
2145
+ me !== null && me.removeEventListener("focusout", oe);
2146
+ })), ai(me, O - b);
2147
+ const ot = z !== void 0 ? r.slice(b, O).reduce(We, 0) : 0;
2148
+ if (ve === !0) {
2149
+ const ke = Z >= R.value.from && b <= R.value.to ? R.value.to : Z;
2150
+ R.value = { from: b, to: ke }, m.value = Ge(C, r, 0, b), _.value = Ge(C, r, Z, e.value), requestAnimationFrame(() => {
2151
+ R.value.to !== Z && g === p.scrollStart && (R.value = { from: R.value.from, to: Z }, _.value = Ge(C, r, Z, e.value));
2152
+ });
2153
+ }
2154
+ requestAnimationFrame(() => {
2155
+ if (g !== p.scrollStart)
2156
+ return;
2157
+ ve === !0 && U(b);
2158
+ const ke = r.slice(b, O).reduce(We, 0), qe = ke + p.offsetStart + m.value, it = qe + r[O];
2159
+ let Ne = qe + V;
2160
+ if (z !== void 0) {
2161
+ const qt = ke - ot, Ke = p.scrollStart + qt;
2162
+ Ne = F !== !0 && Ke < qe && it < Ke + p.scrollViewSize ? Ke : z === "end" ? it - p.scrollViewSize : qe - (z === "start" ? 0 : Math.round((p.scrollViewSize - r[O]) / 2));
2163
+ }
2164
+ g = Ne, Tl(
2165
+ s,
2166
+ Ne,
2167
+ i.virtualScrollHorizontal,
2168
+ v.lang.rtl
2169
+ ), k(O);
2170
+ });
2171
+ }
2172
+ function U(s) {
2173
+ const p = q.value;
2174
+ if (p) {
2175
+ const O = cn.call(
2176
+ p.children,
2177
+ (b) => b.classList && b.classList.contains("q-virtual-scroll--skip") === !1
2178
+ ), V = O.length, I = i.virtualScrollHorizontal === !0 ? (b) => b.getBoundingClientRect().width : (b) => b.offsetHeight;
2179
+ let F = s, z, N;
2180
+ for (let b = 0; b < V; ) {
2181
+ for (z = I(O[b]), b++; b < V && O[b].classList.contains("q-virtual-scroll--with-prev") === !0; )
2182
+ z += I(O[b]), b++;
2183
+ N = z - r[F], N !== 0 && (r[F] += N, C[Math.floor(F / fe)] += N), F++;
2184
+ }
2185
+ }
2186
+ }
2187
+ function oe() {
2188
+ q.value !== null && q.value !== void 0 && q.value.focus();
2189
+ }
2190
+ function te(s, p) {
2191
+ const O = 1 * n.value;
2192
+ (p === !0 || Array.isArray(r) === !1) && (r = []);
2193
+ const V = r.length;
2194
+ r.length = e.value;
2195
+ for (let F = e.value - 1; F >= V; F--)
2196
+ r[F] = O;
2197
+ const I = Math.floor((e.value - 1) / fe);
2198
+ C = [];
2199
+ for (let F = 0; F <= I; F++) {
2200
+ let z = 0;
2201
+ const N = Math.min((F + 1) * fe, e.value);
2202
+ for (let b = F * fe; b < N; b++)
2203
+ z += r[b];
2204
+ C.push(z);
2205
+ }
2206
+ c = -1, g = void 0, m.value = Ge(C, r, 0, R.value.from), _.value = Ge(C, r, R.value.to, e.value), s >= 0 ? (U(R.value.from), ue(() => {
2207
+ G(s);
2208
+ })) : M();
2209
+ }
2210
+ function X(s) {
2211
+ if (s === void 0 && typeof window < "u") {
2212
+ const z = t();
2213
+ z != null && z.nodeType !== 8 && (s = Ht(
2214
+ z,
2215
+ l(),
2216
+ P.value,
2217
+ E.value,
2218
+ i.virtualScrollHorizontal,
2219
+ v.lang.rtl,
2220
+ i.virtualScrollStickySizeStart,
2221
+ i.virtualScrollStickySizeEnd
2222
+ ).scrollViewSize);
2223
+ }
2224
+ y = s;
2225
+ const p = parseFloat(i.virtualScrollSliceRatioBefore) || 0, O = parseFloat(i.virtualScrollSliceRatioAfter) || 0, V = 1 + p + O, I = s === void 0 || s <= 0 ? 1 : Math.ceil(s / n.value), F = Math.max(
2226
+ 1,
2227
+ I,
2228
+ Math.ceil((i.virtualScrollSliceSize > 0 ? i.virtualScrollSliceSize : 10) / V)
2229
+ );
2230
+ S.value = {
2231
+ total: Math.ceil(F * V),
2232
+ start: Math.ceil(F * p),
2233
+ center: Math.ceil(F * (0.5 + p)),
2234
+ end: Math.ceil(F * (1 + p)),
2235
+ view: I
2236
+ };
2237
+ }
2238
+ function re(s, p) {
2239
+ const O = i.virtualScrollHorizontal === !0 ? "width" : "height", V = {
2240
+ ["--q-virtual-scroll-item-" + O]: n.value + "px"
2241
+ };
2242
+ return [
2243
+ s === "tbody" ? h(s, {
2244
+ class: "q-virtual-scroll__padding",
2245
+ key: "before",
2246
+ ref: P
2247
+ }, [
2248
+ h("tr", [
2249
+ h("td", {
2250
+ style: { [O]: `${m.value}px`, ...V },
2251
+ colspan: D.value
2252
+ })
2253
+ ])
2254
+ ]) : h(s, {
2255
+ class: "q-virtual-scroll__padding",
2256
+ key: "before",
2257
+ ref: P,
2258
+ style: { [O]: `${m.value}px`, ...V }
2259
+ }),
2260
+ h(s, {
2261
+ class: "q-virtual-scroll__content",
2262
+ key: "content",
2263
+ ref: q,
2264
+ tabindex: -1
2265
+ }, p.flat()),
2266
+ s === "tbody" ? h(s, {
2267
+ class: "q-virtual-scroll__padding",
2268
+ key: "after",
2269
+ ref: E
2270
+ }, [
2271
+ h("tr", [
2272
+ h("td", {
2273
+ style: { [O]: `${_.value}px`, ...V },
2274
+ colspan: D.value
2275
+ })
2276
+ ])
2277
+ ]) : h(s, {
2278
+ class: "q-virtual-scroll__padding",
2279
+ key: "after",
2280
+ ref: E,
2281
+ style: { [O]: `${_.value}px`, ...V }
2282
+ })
2283
+ ];
2284
+ }
2285
+ function k(s) {
2286
+ c !== s && (i.onVirtualScroll !== void 0 && u("virtualScroll", {
2287
+ index: s,
2288
+ from: R.value.from,
2289
+ to: R.value.to - 1,
2290
+ direction: s < c ? "decrease" : "increase",
2291
+ ref: d
2292
+ }), c = s);
2293
+ }
2294
+ X();
2295
+ const M = Ql(
2296
+ ne,
2297
+ v.platform.is.ios === !0 ? 120 : 35
2298
+ );
2299
+ An(() => {
2300
+ X();
2301
+ });
2302
+ let se = !1;
2303
+ return Ct(() => {
2304
+ se = !0;
2305
+ }), Ll(() => {
2306
+ if (se !== !0) return;
2307
+ const s = t();
2308
+ g !== void 0 && s !== void 0 && s !== null && s.nodeType !== 8 ? Tl(
2309
+ s,
2310
+ g,
2311
+ i.virtualScrollHorizontal,
2312
+ v.lang.rtl
2313
+ ) : G(c);
2314
+ }), ce(() => {
2315
+ M.cancel();
2316
+ }), Object.assign(d, { scrollTo: G, reset: H, refresh: Q }), {
2317
+ virtualScrollSliceRange: R,
2318
+ virtualScrollSliceSizeComputed: S,
2319
+ setVirtualScrollSize: X,
2320
+ onVirtualScrollEvt: M,
2321
+ localResetVirtualScroll: te,
2322
+ padVirtualScroll: re,
2323
+ scrollTo: G,
2324
+ reset: H,
2325
+ refresh: Q
2326
+ };
2327
+ }
2328
+ const ci = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/, di = /[\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, fi = /[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/, vi = /[a-z0-9_ -]$/i;
2329
+ function mi(e) {
2330
+ return function(l) {
2331
+ if (l.type === "compositionend" || l.type === "change") {
2332
+ if (l.target.qComposing !== !0) return;
2333
+ l.target.qComposing = !1, e(l);
2334
+ } else l.type === "compositionupdate" && l.target.qComposing !== !0 && typeof l.data == "string" && (we.is.firefox === !0 ? vi.test(l.data) === !1 : ci.test(l.data) === !0 || di.test(l.data) === !0 || fi.test(l.data) === !0) === !0 && (l.target.qComposing = !0);
2335
+ };
2336
+ }
2337
+ function Ce(e, t) {
2338
+ if (e === t)
2339
+ return !0;
2340
+ if (e !== null && t !== null && typeof e == "object" && typeof t == "object") {
2341
+ if (e.constructor !== t.constructor)
2342
+ return !1;
2343
+ let l, n;
2344
+ if (e.constructor === Array) {
2345
+ if (l = e.length, l !== t.length)
2346
+ return !1;
2347
+ for (n = l; n-- !== 0; )
2348
+ if (Ce(e[n], t[n]) !== !0)
2349
+ return !1;
2350
+ return !0;
2351
+ }
2352
+ if (e.constructor === Map) {
2353
+ if (e.size !== t.size)
2354
+ return !1;
2355
+ let i = e.entries();
2356
+ for (n = i.next(); n.done !== !0; ) {
2357
+ if (t.has(n.value[0]) !== !0)
2358
+ return !1;
2359
+ n = i.next();
2360
+ }
2361
+ for (i = e.entries(), n = i.next(); n.done !== !0; ) {
2362
+ if (Ce(n.value[1], t.get(n.value[0])) !== !0)
2363
+ return !1;
2364
+ n = i.next();
2365
+ }
2366
+ return !0;
2367
+ }
2368
+ if (e.constructor === Set) {
2369
+ if (e.size !== t.size)
2370
+ return !1;
2371
+ const i = e.entries();
2372
+ for (n = i.next(); n.done !== !0; ) {
2373
+ if (t.has(n.value[0]) !== !0)
2374
+ return !1;
2375
+ n = i.next();
2376
+ }
2377
+ return !0;
2378
+ }
2379
+ if (e.buffer != null && e.buffer.constructor === ArrayBuffer) {
2380
+ if (l = e.length, l !== t.length)
2381
+ return !1;
2382
+ for (n = l; n-- !== 0; )
2383
+ if (e[n] !== t[n])
2384
+ return !1;
2385
+ return !0;
2386
+ }
2387
+ if (e.constructor === RegExp)
2388
+ return e.source === t.source && e.flags === t.flags;
2389
+ if (e.valueOf !== Object.prototype.valueOf)
2390
+ return e.valueOf() === t.valueOf();
2391
+ if (e.toString !== Object.prototype.toString)
2392
+ return e.toString() === t.toString();
2393
+ const a = Object.keys(e).filter((i) => e[i] !== void 0);
2394
+ if (l = a.length, l !== Object.keys(t).filter((i) => t[i] !== void 0).length)
2395
+ return !1;
2396
+ for (n = l; n-- !== 0; ) {
2397
+ const i = a[n];
2398
+ if (Ce(e[i], t[i]) !== !0)
2399
+ return !1;
2400
+ }
2401
+ return !0;
2402
+ }
2403
+ return e !== e && t !== t;
2404
+ }
2405
+ function zl(e, t, l) {
2406
+ if (l <= t)
2407
+ return t;
2408
+ const n = l - t + 1;
2409
+ let a = t + (e - t) % n;
2410
+ return a < t && (a = n + a), a === 0 ? 0 : a;
2411
+ }
2412
+ const Fl = (e) => ["add", "add-unique", "toggle"].includes(e), hi = ".*+?^${}()|[]\\", gi = Object.keys(Kt);
2413
+ function $t(e, t) {
2414
+ if (typeof e == "function") return e;
2415
+ const l = e !== void 0 ? e : t;
2416
+ return (n) => n !== null && typeof n == "object" && l in n ? n[l] : n;
2417
+ }
2418
+ const pi = be({
2419
+ name: "QSelect",
2420
+ inheritAttrs: !1,
2421
+ props: {
2422
+ ...Rl,
2423
+ ...jl,
2424
+ ...Kt,
2425
+ // override of useFieldProps > modelValue
2426
+ modelValue: {
2427
+ required: !0
2428
+ },
2429
+ multiple: Boolean,
2430
+ displayValue: [String, Number],
2431
+ displayValueHtml: Boolean,
2432
+ dropdownIcon: String,
2433
+ options: {
2434
+ type: Array,
2435
+ default: () => []
2436
+ },
2437
+ optionValue: [Function, String],
2438
+ optionLabel: [Function, String],
2439
+ optionDisable: [Function, String],
2440
+ hideSelected: Boolean,
2441
+ hideDropdownIcon: Boolean,
2442
+ fillInput: Boolean,
2443
+ maxValues: [Number, String],
2444
+ optionsDense: Boolean,
2445
+ optionsDark: {
2446
+ type: Boolean,
2447
+ default: null
2448
+ },
2449
+ optionsSelectedClass: String,
2450
+ optionsHtml: Boolean,
2451
+ optionsCover: Boolean,
2452
+ menuShrink: Boolean,
2453
+ menuAnchor: String,
2454
+ menuSelf: String,
2455
+ menuOffset: Array,
2456
+ popupContentClass: String,
2457
+ popupContentStyle: [String, Array, Object],
2458
+ popupNoRouteDismiss: Boolean,
2459
+ useInput: Boolean,
2460
+ useChips: Boolean,
2461
+ newValueMode: {
2462
+ type: String,
2463
+ validator: Fl
2464
+ },
2465
+ mapOptions: Boolean,
2466
+ emitValue: Boolean,
2467
+ disableTabSelection: Boolean,
2468
+ inputDebounce: {
2469
+ type: [Number, String],
2470
+ default: 500
2471
+ },
2472
+ inputClass: [Array, String, Object],
2473
+ inputStyle: [Array, String, Object],
2474
+ tabindex: {
2475
+ type: [String, Number],
2476
+ default: 0
2477
+ },
2478
+ autocomplete: String,
2479
+ transitionShow: {},
2480
+ transitionHide: {},
2481
+ transitionDuration: {},
2482
+ behavior: {
2483
+ type: String,
2484
+ validator: (e) => ["default", "menu", "dialog"].includes(e),
2485
+ default: "default"
2486
+ },
2487
+ // override of useVirtualScrollProps > virtualScrollItemSize (no default)
2488
+ virtualScrollItemSize: Rl.virtualScrollItemSize.type,
2489
+ onNewValue: Function,
2490
+ onFilter: Function
2491
+ },
2492
+ emits: [
2493
+ ...Xl,
2494
+ "add",
2495
+ "remove",
2496
+ "inputValue",
2497
+ "keyup",
2498
+ "keypress",
2499
+ "keydown",
2500
+ "popupShow",
2501
+ "popupHide",
2502
+ "filterAbort"
2503
+ ],
2504
+ setup(e, { slots: t, emit: l }) {
2505
+ const { proxy: n } = le(), { $q: a } = n, i = T(!1), u = T(!1), d = T(-1), v = T(""), g = T(!1), c = T(!1);
2506
+ let y = null, C = null, r, m, _, S = null, P, E, q, R;
2507
+ const D = T(null), B = T(null), L = T(null), H = T(null), Q = T(null), G = lo(e), ne = mi(ll), A = f(() => Array.isArray(e.options) ? e.options.length : 0), U = f(() => e.virtualScrollItemSize === void 0 ? e.optionsDense === !0 ? 24 : 48 : e.virtualScrollItemSize), {
2508
+ virtualScrollSliceRange: oe,
2509
+ virtualScrollSliceSizeComputed: te,
2510
+ localResetVirtualScroll: X,
2511
+ padVirtualScroll: re,
2512
+ onVirtualScrollEvt: k,
2513
+ scrollTo: M,
2514
+ setVirtualScrollSize: se
2515
+ } = si({
2516
+ virtualScrollLength: A,
2517
+ getVirtualScrollTarget: mn,
2518
+ getVirtualScrollEl: el,
2519
+ virtualScrollItemSizeComputed: U
2520
+ }), s = Yl(), p = f(() => {
2521
+ const o = e.mapOptions === !0 && e.multiple !== !0, w = e.modelValue !== void 0 && (e.modelValue !== null || o === !0) ? e.multiple === !0 && Array.isArray(e.modelValue) ? e.modelValue : [e.modelValue] : [];
2522
+ if (e.mapOptions === !0 && Array.isArray(e.options) === !0) {
2523
+ const x = e.mapOptions === !0 && r !== void 0 ? r : [], $ = w.map((j) => vn(j, x));
2524
+ return e.modelValue === null && o === !0 ? $.filter((j) => j !== null) : $;
2525
+ }
2526
+ return w;
2527
+ }), O = f(() => {
2528
+ const o = {};
2529
+ return gi.forEach((w) => {
2530
+ const x = e[w];
2531
+ x !== void 0 && (o[w] = x);
2532
+ }), o;
2533
+ }), V = f(() => e.optionsDark === null ? s.isDark.value : e.optionsDark), I = f(() => Wt(p.value)), F = f(() => {
2534
+ let o = "q-field__input q-placeholder col";
2535
+ return e.hideSelected === !0 || p.value.length === 0 ? [o, e.inputClass] : (o += " q-field__input--padding", e.inputClass === void 0 ? o : [o, e.inputClass]);
2536
+ }), z = f(
2537
+ () => (e.virtualScrollHorizontal === !0 ? "q-virtual-scroll--horizontal" : "") + (e.popupContentClass ? " " + e.popupContentClass : "")
2538
+ ), N = f(() => A.value === 0), b = f(
2539
+ () => p.value.map((o) => ie.value(o)).join(", ")
2540
+ ), Z = f(() => e.displayValue !== void 0 ? e.displayValue : b.value), ve = f(() => e.optionsHtml === !0 ? () => !0 : (o) => o != null && o.html === !0), ze = f(() => e.displayValueHtml === !0 || e.displayValue === void 0 && (e.optionsHtml === !0 || p.value.some(ve.value))), me = f(() => s.focused.value === !0 ? e.tabindex : -1), ot = f(() => {
2541
+ const o = {
2542
+ tabindex: e.tabindex,
2543
+ role: "combobox",
2544
+ "aria-label": e.label,
2545
+ "aria-readonly": e.readonly === !0 ? "true" : "false",
2546
+ "aria-autocomplete": e.useInput === !0 ? "list" : "none",
2547
+ "aria-expanded": i.value === !0 ? "true" : "false",
2548
+ "aria-controls": `${s.targetUid.value}_lb`
2549
+ };
2550
+ return d.value >= 0 && (o["aria-activedescendant"] = `${s.targetUid.value}_${d.value}`), o;
2551
+ }), ke = f(() => ({
2552
+ id: `${s.targetUid.value}_lb`,
2553
+ role: "listbox",
2554
+ "aria-multiselectable": e.multiple === !0 ? "true" : "false"
2555
+ })), qe = f(() => p.value.map((o, w) => ({
2556
+ index: w,
2557
+ opt: o,
2558
+ html: ve.value(o),
2559
+ selected: !0,
2560
+ removeAtIndex: fn,
2561
+ toggleOption: Ve,
2562
+ tabindex: me.value
2563
+ }))), it = f(() => {
2564
+ if (A.value === 0)
2565
+ return [];
2566
+ const { from: o, to: w } = oe.value;
2567
+ return e.options.slice(o, w).map((x, $) => {
2568
+ const j = Fe.value(x) === !0, W = _t(x) === !0, J = o + $, Y = {
2569
+ clickable: !0,
2570
+ active: W,
2571
+ activeClass: Ke.value,
2572
+ manualFocus: !0,
2573
+ focused: !1,
2574
+ disable: j,
2575
+ tabindex: -1,
2576
+ dense: e.optionsDense,
2577
+ dark: V.value,
2578
+ role: "option",
2579
+ "aria-selected": W === !0 ? "true" : "false",
2580
+ id: `${s.targetUid.value}_${J}`,
2581
+ onClick: () => {
2582
+ Ve(x);
2583
+ }
2584
+ };
2585
+ return j !== !0 && (d.value === J && (Y.focused = !0), a.platform.is.desktop === !0 && (Y.onMousemove = () => {
2586
+ i.value === !0 && Me(J);
2587
+ })), {
2588
+ index: J,
2589
+ opt: x,
2590
+ html: ve.value(x),
2591
+ label: ie.value(x),
2592
+ selected: Y.active,
2593
+ focused: Y.focused,
2594
+ toggleOption: Ve,
2595
+ setOptionIndex: Me,
2596
+ itemProps: Y
2597
+ };
2598
+ });
2599
+ }), Ne = f(() => e.dropdownIcon !== void 0 ? e.dropdownIcon : a.iconSet.arrow.dropdown), qt = f(
2600
+ () => e.optionsCover === !1 && e.outlined !== !0 && e.standout !== !0 && e.borderless !== !0 && e.rounded !== !0
2601
+ ), Ke = f(() => e.optionsSelectedClass !== void 0 ? e.optionsSelectedClass : e.color !== void 0 ? `text-${e.color}` : ""), he = f(() => $t(e.optionValue, "value")), ie = f(() => $t(e.optionLabel, "label")), Fe = f(() => $t(e.optionDisable, "disable")), ut = f(() => p.value.map(he.value)), dn = f(() => {
2602
+ const o = {
2603
+ onInput: ll,
2604
+ // Safari < 10.2 & UIWebView doesn't fire compositionend when
2605
+ // switching focus before confirming composition choice
2606
+ // this also fixes the issue where some browsers e.g. iOS Chrome
2607
+ // fires "change" instead of "input" on autocomplete.
2608
+ onChange: ne,
2609
+ onKeydown: Jt,
2610
+ onKeyup: Gt,
2611
+ onKeypress: Zt,
2612
+ onFocus: Xt,
2613
+ onClick(w) {
2614
+ m === !0 && De(w);
2615
+ }
2616
+ };
2617
+ return o.onCompositionstart = o.onCompositionupdate = o.onCompositionend = ne, o;
2618
+ });
2619
+ K(p, (o) => {
2620
+ r = o, e.useInput === !0 && e.fillInput === !0 && e.multiple !== !0 && s.innerLoading.value !== !0 && (u.value !== !0 && i.value !== !0 || I.value !== !0) && (_ !== !0 && He(), (u.value === !0 || i.value === !0) && Le(""));
2621
+ }, { immediate: !0 }), K(() => e.fillInput, He), K(i, Et), K(A, Vn);
2622
+ function Qt(o) {
2623
+ return e.emitValue === !0 ? he.value(o) : o;
2624
+ }
2625
+ function Vt(o) {
2626
+ if (o !== -1 && o < p.value.length)
2627
+ if (e.multiple === !0) {
2628
+ const w = e.modelValue.slice();
2629
+ l("remove", { index: o, value: w.splice(o, 1)[0] }), l("update:modelValue", w);
2630
+ } else
2631
+ l("update:modelValue", null);
2632
+ }
2633
+ function fn(o) {
2634
+ Vt(o), s.focus();
2635
+ }
2636
+ function Ut(o, w) {
2637
+ const x = Qt(o);
2638
+ if (e.multiple !== !0) {
2639
+ e.fillInput === !0 && Qe(
2640
+ ie.value(o),
2641
+ !0,
2642
+ !0
2643
+ ), l("update:modelValue", x);
2644
+ return;
2645
+ }
2646
+ if (p.value.length === 0) {
2647
+ l("add", { index: 0, value: x }), l("update:modelValue", e.multiple === !0 ? [x] : x);
2648
+ return;
2649
+ }
2650
+ if (w === !0 && _t(o) === !0 || e.maxValues !== void 0 && e.modelValue.length >= e.maxValues)
2651
+ return;
2652
+ const $ = e.modelValue.slice();
2653
+ l("add", { index: $.length, value: x }), $.push(x), l("update:modelValue", $);
2654
+ }
2655
+ function Ve(o, w) {
2656
+ if (s.editable.value !== !0 || o === void 0 || Fe.value(o) === !0)
2657
+ return;
2658
+ const x = he.value(o);
2659
+ if (e.multiple !== !0) {
2660
+ w !== !0 && (Qe(
2661
+ e.fillInput === !0 ? ie.value(o) : "",
2662
+ !0,
2663
+ !0
2664
+ ), _e()), B.value !== null && B.value.focus(), (p.value.length === 0 || Ce(he.value(p.value[0]), x) !== !0) && l("update:modelValue", e.emitValue === !0 ? x : o);
2665
+ return;
2666
+ }
2667
+ if ((m !== !0 || g.value === !0) && s.focus(), Xt(), p.value.length === 0) {
2668
+ const W = e.emitValue === !0 ? x : o;
2669
+ l("add", { index: 0, value: W }), l("update:modelValue", e.multiple === !0 ? [W] : W);
2670
+ return;
2671
+ }
2672
+ const $ = e.modelValue.slice(), j = ut.value.findIndex((W) => Ce(W, x));
2673
+ if (j !== -1)
2674
+ l("remove", { index: j, value: $.splice(j, 1)[0] });
2675
+ else {
2676
+ if (e.maxValues !== void 0 && $.length >= e.maxValues)
2677
+ return;
2678
+ const W = e.emitValue === !0 ? x : o;
2679
+ l("add", { index: $.length, value: W }), $.push(W);
2680
+ }
2681
+ l("update:modelValue", $);
2682
+ }
2683
+ function Me(o) {
2684
+ if (a.platform.is.desktop !== !0) return;
2685
+ const w = o !== -1 && o < A.value ? o : -1;
2686
+ d.value !== w && (d.value = w);
2687
+ }
2688
+ function at(o = 1, w) {
2689
+ if (i.value === !0) {
2690
+ let x = d.value;
2691
+ do
2692
+ x = zl(
2693
+ x + o,
2694
+ -1,
2695
+ A.value - 1
2696
+ );
2697
+ while (x !== -1 && x !== d.value && Fe.value(e.options[x]) === !0);
2698
+ d.value !== x && (Me(x), M(x), w !== !0 && e.useInput === !0 && e.fillInput === !0 && rt(
2699
+ x >= 0 ? ie.value(e.options[x]) : P,
2700
+ !0
2701
+ ));
2702
+ }
2703
+ }
2704
+ function vn(o, w) {
2705
+ const x = ($) => Ce(he.value($), o);
2706
+ return e.options.find(x) || w.find(x) || o;
2707
+ }
2708
+ function _t(o) {
2709
+ const w = he.value(o);
2710
+ return ut.value.find((x) => Ce(x, w)) !== void 0;
2711
+ }
2712
+ function Xt(o) {
2713
+ e.useInput === !0 && B.value !== null && (o === void 0 || B.value === o.target && o.target.value === b.value) && B.value.select();
2714
+ }
2715
+ function Yt(o) {
2716
+ kt(o, 27) === !0 && i.value === !0 && (De(o), _e(), He()), l("keyup", o);
2717
+ }
2718
+ function Gt(o) {
2719
+ const { value: w } = o.target;
2720
+ if (o.keyCode !== void 0) {
2721
+ Yt(o);
2722
+ return;
2723
+ }
2724
+ if (o.target.value = "", y !== null && (clearTimeout(y), y = null), C !== null && (clearTimeout(C), C = null), He(), typeof w == "string" && w.length !== 0) {
2725
+ const x = w.toLocaleLowerCase(), $ = (W) => {
2726
+ const J = e.options.find((Y) => String(W.value(Y)).toLocaleLowerCase() === x);
2727
+ return J === void 0 ? !1 : (p.value.indexOf(J) === -1 ? Ve(J) : _e(), !0);
2728
+ }, j = (W) => {
2729
+ $(he) !== !0 && W !== !0 && $(ie) !== !0 && Le(w, !0, () => j(!0));
2730
+ };
2731
+ j();
2732
+ } else
2733
+ s.clearValue(o);
2734
+ }
2735
+ function Zt(o) {
2736
+ l("keypress", o);
2737
+ }
2738
+ function Jt(o) {
2739
+ if (l("keydown", o), Xn(o) === !0)
2740
+ return;
2741
+ const w = v.value.length !== 0 && (e.newValueMode !== void 0 || e.onNewValue !== void 0), x = o.shiftKey !== !0 && e.disableTabSelection !== !0 && e.multiple !== !0 && (d.value !== -1 || w === !0);
2742
+ if (o.keyCode === 27) {
2743
+ pe(o);
2744
+ return;
2745
+ }
2746
+ if (o.keyCode === 9 && x === !1) {
2747
+ Oe();
2748
+ return;
2749
+ }
2750
+ if (o.target === void 0 || o.target.id !== s.targetUid.value || s.editable.value !== !0) return;
2751
+ if (o.keyCode === 40 && s.innerLoading.value !== !0 && i.value === !1) {
2752
+ ae(o), Ie();
2753
+ return;
2754
+ }
2755
+ if (o.keyCode === 8 && (e.useChips === !0 || e.clearable === !0) && e.hideSelected !== !0 && v.value.length === 0) {
2756
+ e.multiple === !0 && Array.isArray(e.modelValue) === !0 ? Vt(e.modelValue.length - 1) : e.multiple !== !0 && e.modelValue !== null && l("update:modelValue", null);
2757
+ return;
2758
+ }
2759
+ (o.keyCode === 35 || o.keyCode === 36) && (typeof v.value != "string" || v.value.length === 0) && (ae(o), d.value = -1, at(o.keyCode === 36 ? 1 : -1, e.multiple)), (o.keyCode === 33 || o.keyCode === 34) && te.value !== void 0 && (ae(o), d.value = Math.max(
2760
+ -1,
2761
+ Math.min(
2762
+ A.value,
2763
+ d.value + (o.keyCode === 33 ? -1 : 1) * te.value.view
2764
+ )
2765
+ ), at(o.keyCode === 33 ? 1 : -1, e.multiple)), (o.keyCode === 38 || o.keyCode === 40) && (ae(o), at(o.keyCode === 38 ? -1 : 1, e.multiple));
2766
+ const $ = A.value;
2767
+ if ((q === void 0 || R < Date.now()) && (q = ""), $ > 0 && e.useInput !== !0 && o.key !== void 0 && o.key.length === 1 && o.altKey === !1 && o.ctrlKey === !1 && o.metaKey === !1 && (o.keyCode !== 32 || q.length !== 0)) {
2768
+ i.value !== !0 && Ie(o);
2769
+ const j = o.key.toLocaleLowerCase(), W = q.length === 1 && q[0] === j;
2770
+ R = Date.now() + 1500, W === !1 && (ae(o), q += j);
2771
+ const J = new RegExp("^" + q.split("").map((Bt) => hi.indexOf(Bt) !== -1 ? "\\" + Bt : Bt).join(".*"), "i");
2772
+ let Y = d.value;
2773
+ if (W === !0 || Y < 0 || J.test(ie.value(e.options[Y])) !== !0)
2774
+ do
2775
+ Y = zl(Y + 1, -1, $ - 1);
2776
+ while (Y !== d.value && (Fe.value(e.options[Y]) === !0 || J.test(ie.value(e.options[Y])) !== !0));
2777
+ d.value !== Y && ue(() => {
2778
+ Me(Y), M(Y), Y >= 0 && e.useInput === !0 && e.fillInput === !0 && rt(ie.value(e.options[Y]), !0);
2779
+ });
2780
+ return;
2781
+ }
2782
+ if (!(o.keyCode !== 13 && (o.keyCode !== 32 || e.useInput === !0 || q !== "") && (o.keyCode !== 9 || x === !1))) {
2783
+ if (o.keyCode !== 9 && ae(o), d.value !== -1 && d.value < $) {
2784
+ Ve(e.options[d.value]);
2785
+ return;
2786
+ }
2787
+ if (w === !0) {
2788
+ const j = (W, J) => {
2789
+ if (J) {
2790
+ if (Fl(J) !== !0)
2791
+ return;
2792
+ } else
2793
+ J = e.newValueMode;
2794
+ if (Qe("", e.multiple !== !0, !0), W == null)
2795
+ return;
2796
+ (J === "toggle" ? Ve : Ut)(W, J === "add-unique"), e.multiple !== !0 && (B.value !== null && B.value.focus(), _e());
2797
+ };
2798
+ if (e.onNewValue !== void 0 ? l("newValue", v.value, j) : j(v.value), e.multiple !== !0)
2799
+ return;
2800
+ }
2801
+ i.value === !0 ? Oe() : s.innerLoading.value !== !0 && Ie();
2802
+ }
2803
+ }
2804
+ function el() {
2805
+ return m === !0 ? Q.value : L.value !== null && L.value.contentEl !== null ? L.value.contentEl : void 0;
2806
+ }
2807
+ function mn() {
2808
+ return el();
2809
+ }
2810
+ function hn() {
2811
+ return e.hideSelected === !0 ? [] : t["selected-item"] !== void 0 ? qe.value.map((o) => t["selected-item"](o)).slice() : t.selected !== void 0 ? [].concat(t.selected()) : e.useChips === !0 ? qe.value.map((o, w) => h(ko, {
2812
+ key: "option-" + w,
2813
+ removable: s.editable.value === !0 && Fe.value(o.opt) !== !0,
2814
+ dense: !0,
2815
+ textColor: e.color,
2816
+ tabindex: me.value,
2817
+ onRemove() {
2818
+ o.removeAtIndex(w);
2819
+ }
2820
+ }, () => h("span", {
2821
+ class: "ellipsis",
2822
+ [o.html === !0 ? "innerHTML" : "textContent"]: ie.value(o.opt)
2823
+ }))) : [
2824
+ h("span", {
2825
+ [ze.value === !0 ? "innerHTML" : "textContent"]: Z.value
2826
+ })
2827
+ ];
2828
+ }
2829
+ function tl() {
2830
+ if (N.value === !0)
2831
+ return t["no-option"] !== void 0 ? t["no-option"]({ inputValue: v.value }) : void 0;
2832
+ const o = t.option !== void 0 ? t.option : (x) => h(Kl, {
2833
+ key: x.index,
2834
+ ...x.itemProps
2835
+ }, () => h(
2836
+ pt,
2837
+ () => h(
2838
+ Nl,
2839
+ () => h("span", {
2840
+ [x.html === !0 ? "innerHTML" : "textContent"]: x.label
2841
+ })
2842
+ )
2843
+ ));
2844
+ let w = re("div", it.value.map(o));
2845
+ return t["before-options"] !== void 0 && (w = t["before-options"]().concat(w)), Il(t["after-options"], w);
2846
+ }
2847
+ function gn(o, w) {
2848
+ const x = w === !0 ? { ...ot.value, ...s.splitAttrs.attributes.value } : void 0, $ = {
2849
+ ref: w === !0 ? B : void 0,
2850
+ key: "i_t",
2851
+ class: F.value,
2852
+ style: e.inputStyle,
2853
+ value: v.value !== void 0 ? v.value : "",
2854
+ // required for Android in order to show ENTER key when in form
2855
+ type: "search",
2856
+ ...x,
2857
+ id: w === !0 ? s.targetUid.value : void 0,
2858
+ maxlength: e.maxlength,
2859
+ autocomplete: e.autocomplete,
2860
+ "data-autofocus": o === !0 || e.autofocus === !0 || void 0,
2861
+ disabled: e.disable === !0,
2862
+ readonly: e.readonly === !0,
2863
+ ...dn.value
2864
+ };
2865
+ return o !== !0 && m === !0 && (Array.isArray($.class) === !0 ? $.class = [...$.class, "no-pointer-events"] : $.class += " no-pointer-events"), h("input", $);
2866
+ }
2867
+ function ll(o) {
2868
+ y !== null && (clearTimeout(y), y = null), C !== null && (clearTimeout(C), C = null), !(o && o.target && o.target.qComposing === !0) && (rt(o.target.value || ""), _ = !0, P = v.value, s.focused.value !== !0 && (m !== !0 || g.value === !0) && s.focus(), e.onFilter !== void 0 && (y = setTimeout(() => {
2869
+ y = null, Le(v.value);
2870
+ }, e.inputDebounce)));
2871
+ }
2872
+ function rt(o, w) {
2873
+ v.value !== o && (v.value = o, w === !0 || e.inputDebounce === 0 || e.inputDebounce === "0" ? l("inputValue", o) : C = setTimeout(() => {
2874
+ C = null, l("inputValue", o);
2875
+ }, e.inputDebounce));
2876
+ }
2877
+ function Qe(o, w, x) {
2878
+ _ = x !== !0, e.useInput === !0 && (rt(o, !0), (w === !0 || x !== !0) && (P = o), w !== !0 && Le(o));
2879
+ }
2880
+ function Le(o, w, x) {
2881
+ if (e.onFilter === void 0 || w !== !0 && s.focused.value !== !0)
2882
+ return;
2883
+ s.innerLoading.value === !0 ? l("filterAbort") : (s.innerLoading.value = !0, c.value = !0), o !== "" && e.multiple !== !0 && p.value.length !== 0 && _ !== !0 && o === ie.value(p.value[0]) && (o = "");
2884
+ const $ = setTimeout(() => {
2885
+ i.value === !0 && (i.value = !1);
2886
+ }, 10);
2887
+ S !== null && clearTimeout(S), S = $, l(
2888
+ "filter",
2889
+ o,
2890
+ (j, W) => {
2891
+ (w === !0 || s.focused.value === !0) && S === $ && (clearTimeout(S), typeof j == "function" && j(), c.value = !1, ue(() => {
2892
+ s.innerLoading.value = !1, s.editable.value === !0 && (w === !0 ? i.value === !0 && _e() : i.value === !0 ? Et(!0) : i.value = !0), typeof W == "function" && ue(() => {
2893
+ W(n);
2894
+ }), typeof x == "function" && ue(() => {
2895
+ x(n);
2896
+ });
2897
+ }));
2898
+ },
2899
+ () => {
2900
+ s.focused.value === !0 && S === $ && (clearTimeout(S), s.innerLoading.value = !1, c.value = !1), i.value === !0 && (i.value = !1);
2901
+ }
2902
+ );
2903
+ }
2904
+ function pn() {
2905
+ return h(Zo, {
2906
+ ref: L,
2907
+ class: z.value,
2908
+ style: e.popupContentStyle,
2909
+ modelValue: i.value,
2910
+ fit: e.menuShrink !== !0,
2911
+ cover: e.optionsCover === !0 && N.value !== !0 && e.useInput !== !0,
2912
+ anchor: e.menuAnchor,
2913
+ self: e.menuSelf,
2914
+ offset: e.menuOffset,
2915
+ dark: V.value,
2916
+ noParentEvent: !0,
2917
+ noRefocus: !0,
2918
+ noFocus: !0,
2919
+ noRouteDismiss: e.popupNoRouteDismiss,
2920
+ square: qt.value,
2921
+ transitionShow: e.transitionShow,
2922
+ transitionHide: e.transitionHide,
2923
+ transitionDuration: e.transitionDuration,
2924
+ separateClosePopup: !0,
2925
+ ...ke.value,
2926
+ onScrollPassive: k,
2927
+ onBeforeShow: ol,
2928
+ onBeforeHide: bn,
2929
+ onShow: yn
2930
+ }, tl);
2931
+ }
2932
+ function bn(o) {
2933
+ il(o), Oe();
2934
+ }
2935
+ function yn() {
2936
+ se();
2937
+ }
2938
+ function Sn(o) {
2939
+ De(o), B.value !== null && B.value.focus(), g.value = !0, window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0);
2940
+ }
2941
+ function wn(o) {
2942
+ De(o), ue(() => {
2943
+ g.value = !1;
2944
+ });
2945
+ }
2946
+ function xn() {
2947
+ const o = [
2948
+ h(xo, {
2949
+ class: `col-auto ${s.fieldClass.value}`,
2950
+ ...O.value,
2951
+ for: s.targetUid.value,
2952
+ dark: V.value,
2953
+ square: !0,
2954
+ loading: c.value,
2955
+ itemAligned: !1,
2956
+ filled: !0,
2957
+ stackLabel: v.value.length !== 0,
2958
+ ...s.splitAttrs.listeners.value,
2959
+ onFocus: Sn,
2960
+ onBlur: wn
2961
+ }, {
2962
+ ...t,
2963
+ rawControl: () => s.getControl(!0),
2964
+ before: void 0,
2965
+ after: void 0
2966
+ })
2967
+ ];
2968
+ return i.value === !0 && o.push(
2969
+ h("div", {
2970
+ ref: Q,
2971
+ class: z.value + " scroll",
2972
+ style: e.popupContentStyle,
2973
+ ...ke.value,
2974
+ onClick: pe,
2975
+ onScrollPassive: k
2976
+ }, tl())
2977
+ ), h(ii, {
2978
+ ref: H,
2979
+ modelValue: u.value,
2980
+ position: e.useInput === !0 ? "top" : void 0,
2981
+ transitionShow: E,
2982
+ transitionHide: e.transitionHide,
2983
+ transitionDuration: e.transitionDuration,
2984
+ noRouteDismiss: e.popupNoRouteDismiss,
2985
+ onBeforeShow: ol,
2986
+ onBeforeHide: Cn,
2987
+ onHide: kn,
2988
+ onShow: qn
2989
+ }, () => h("div", {
2990
+ class: "q-select__dialog" + (V.value === !0 ? " q-select__dialog--dark q-dark" : "") + (g.value === !0 ? " q-select__dialog--focused" : "")
2991
+ }, o));
2992
+ }
2993
+ function Cn(o) {
2994
+ il(o), H.value !== null && H.value.__updateRefocusTarget(
2995
+ s.rootRef.value.querySelector(".q-field__native > [tabindex]:last-child")
2996
+ ), s.focused.value = !1;
2997
+ }
2998
+ function kn(o) {
2999
+ _e(), s.focused.value === !1 && l("blur", o), He();
3000
+ }
3001
+ function qn() {
3002
+ const o = document.activeElement;
3003
+ (o === null || o.id !== s.targetUid.value) && B.value !== null && B.value !== o && B.value.focus(), se();
3004
+ }
3005
+ function Oe() {
3006
+ u.value !== !0 && (d.value = -1, i.value === !0 && (i.value = !1), s.focused.value === !1 && (S !== null && (clearTimeout(S), S = null), s.innerLoading.value === !0 && (l("filterAbort"), s.innerLoading.value = !1, c.value = !1)));
3007
+ }
3008
+ function Ie(o) {
3009
+ s.editable.value === !0 && (m === !0 ? (s.onControlFocusin(o), u.value = !0, ue(() => {
3010
+ s.focus();
3011
+ })) : s.focus(), e.onFilter !== void 0 ? Le(v.value) : (N.value !== !0 || t["no-option"] !== void 0) && (i.value = !0));
3012
+ }
3013
+ function _e() {
3014
+ u.value = !1, Oe();
3015
+ }
3016
+ function He() {
3017
+ e.useInput === !0 && Qe(
3018
+ e.multiple !== !0 && e.fillInput === !0 && p.value.length !== 0 && ie.value(p.value[0]) || "",
3019
+ !0,
3020
+ !0
3021
+ );
3022
+ }
3023
+ function Et(o) {
3024
+ let w = -1;
3025
+ if (o === !0) {
3026
+ if (p.value.length !== 0) {
3027
+ const x = he.value(p.value[0]);
3028
+ w = e.options.findIndex(($) => Ce(he.value($), x));
3029
+ }
3030
+ X(w);
3031
+ }
3032
+ Me(w);
3033
+ }
3034
+ function Vn(o, w) {
3035
+ i.value === !0 && s.innerLoading.value === !1 && (X(-1, !0), ue(() => {
3036
+ i.value === !0 && s.innerLoading.value === !1 && (o > w ? X() : Et(!0));
3037
+ }));
3038
+ }
3039
+ function nl() {
3040
+ u.value === !1 && L.value !== null && L.value.updatePosition();
3041
+ }
3042
+ function ol(o) {
3043
+ o !== void 0 && De(o), l("popupShow", o), s.hasPopupOpen = !0, s.onControlFocusin(o);
3044
+ }
3045
+ function il(o) {
3046
+ o !== void 0 && De(o), l("popupHide", o), s.hasPopupOpen = !1, s.onControlFocusout(o);
3047
+ }
3048
+ function ul() {
3049
+ m = a.platform.is.mobile !== !0 && e.behavior !== "dialog" ? !1 : e.behavior !== "menu" && (e.useInput === !0 ? t["no-option"] !== void 0 || e.onFilter !== void 0 || N.value === !1 : !0), E = a.platform.is.ios === !0 && m === !0 && e.useInput === !0 ? "fade" : e.transitionShow;
3050
+ }
3051
+ return Ml(ul), Tn(nl), ul(), ce(() => {
3052
+ y !== null && clearTimeout(y), C !== null && clearTimeout(C);
3053
+ }), Object.assign(n, {
3054
+ showPopup: Ie,
3055
+ hidePopup: _e,
3056
+ removeAtIndex: Vt,
3057
+ add: Ut,
3058
+ toggleOption: Ve,
3059
+ getOptionIndex: () => d.value,
3060
+ setOptionIndex: Me,
3061
+ moveOptionSelection: at,
3062
+ filter: Le,
3063
+ updateMenuPosition: nl,
3064
+ updateInputValue: Qe,
3065
+ isOptionSelected: _t,
3066
+ getEmittingOptionValue: Qt,
3067
+ isOptionDisabled: (...o) => Fe.value.apply(null, o) === !0,
3068
+ getOptionValue: (...o) => he.value.apply(null, o),
3069
+ getOptionLabel: (...o) => ie.value.apply(null, o)
3070
+ }), Object.assign(s, {
3071
+ innerValue: p,
3072
+ fieldClass: f(
3073
+ () => `q-select q-field--auto-height q-select--with${e.useInput !== !0 ? "out" : ""}-input q-select--with${e.useChips !== !0 ? "out" : ""}-chips q-select--${e.multiple === !0 ? "multiple" : "single"}`
3074
+ ),
3075
+ inputRef: D,
3076
+ targetRef: B,
3077
+ hasValue: I,
3078
+ showPopup: Ie,
3079
+ floatingLabel: f(
3080
+ () => e.hideSelected !== !0 && I.value === !0 || typeof v.value == "number" || v.value.length !== 0 || Wt(e.displayValue)
3081
+ ),
3082
+ getControlChild: () => {
3083
+ if (s.editable.value !== !1 && (u.value === !0 || N.value !== !0 || t["no-option"] !== void 0))
3084
+ return m === !0 ? xn() : pn();
3085
+ s.hasPopupOpen === !0 && (s.hasPopupOpen = !1);
3086
+ },
3087
+ controlEvents: {
3088
+ onFocusin(o) {
3089
+ s.onControlFocusin(o);
3090
+ },
3091
+ onFocusout(o) {
3092
+ s.onControlFocusout(o, () => {
3093
+ He(), Oe();
3094
+ });
3095
+ },
3096
+ onClick(o) {
3097
+ if (pe(o), m !== !0 && i.value === !0) {
3098
+ Oe(), B.value !== null && B.value.focus();
3099
+ return;
3100
+ }
3101
+ Ie(o);
3102
+ }
3103
+ },
3104
+ getControl: (o) => {
3105
+ const w = hn(), x = o === !0 || u.value !== !0 || m !== !0;
3106
+ if (e.useInput === !0)
3107
+ w.push(gn(o, x));
3108
+ else if (s.editable.value === !0) {
3109
+ const j = x === !0 ? ot.value : void 0;
3110
+ w.push(
3111
+ h("input", {
3112
+ ref: x === !0 ? B : void 0,
3113
+ key: "d_t",
3114
+ class: "q-select__focus-target",
3115
+ id: x === !0 ? s.targetUid.value : void 0,
3116
+ value: Z.value,
3117
+ readonly: !0,
3118
+ "data-autofocus": o === !0 || e.autofocus === !0 || void 0,
3119
+ ...j,
3120
+ onKeydown: Jt,
3121
+ onKeyup: Yt,
3122
+ onKeypress: Zt
3123
+ })
3124
+ ), x === !0 && typeof e.autocomplete == "string" && e.autocomplete.length !== 0 && w.push(
3125
+ h("input", {
3126
+ class: "q-select__autocomplete-input",
3127
+ autocomplete: e.autocomplete,
3128
+ tabindex: -1,
3129
+ onKeyup: Gt
3130
+ })
3131
+ );
3132
+ }
3133
+ if (G.value !== void 0 && e.disable !== !0 && ut.value.length !== 0) {
3134
+ const j = ut.value.map((W) => h("option", { value: W, selected: !0 }));
3135
+ w.push(
3136
+ h("select", {
3137
+ class: "hidden",
3138
+ name: G.value,
3139
+ multiple: e.multiple
3140
+ }, j)
3141
+ );
3142
+ }
3143
+ const $ = e.useInput === !0 || x !== !0 ? void 0 : s.splitAttrs.attributes.value;
3144
+ return h("div", {
3145
+ class: "q-field__native row items-center",
3146
+ ...$,
3147
+ ...s.splitAttrs.listeners.value
3148
+ }, w);
3149
+ },
3150
+ getInnerAppend: () => e.loading !== !0 && c.value !== !0 && e.hideDropdownIcon !== !0 ? [
3151
+ h(Ae, {
3152
+ class: "q-select__dropdown-icon" + (i.value === !0 ? " rotate-180" : ""),
3153
+ name: Ne.value
3154
+ })
3155
+ ] : null
3156
+ }), Gl(s);
3157
+ }
3158
+ }), bi = { class: "app-select__amount" }, yi = /* @__PURE__ */ Rn({
3159
+ __name: "index",
3160
+ props: {
3161
+ modelValue: {},
3162
+ size: { default: Yn.MD },
3163
+ options: {},
3164
+ multiple: { type: Boolean },
3165
+ label: {},
3166
+ placeholder: {},
3167
+ required: { type: Boolean },
3168
+ clearable: { type: Boolean },
3169
+ disabled: { type: Boolean },
3170
+ loading: { type: Boolean },
3171
+ filtering: { type: Boolean },
3172
+ autofocus: { type: Boolean },
3173
+ rules: {},
3174
+ lazyRules: { type: [Boolean, String] }
3175
+ },
3176
+ emits: ["update:modelValue"],
3177
+ setup(e, { emit: t }) {
3178
+ const l = e, n = t, a = T(!1), i = T(""), u = f({
3179
+ get() {
3180
+ return l.modelValue;
3181
+ },
3182
+ set(r) {
3183
+ n("update:modelValue", r);
3184
+ }
3185
+ }), d = f(() => {
3186
+ var r;
3187
+ if (Array.isArray(u.value)) {
3188
+ if (l.multiple && u.value.length == 0)
3189
+ return l.placeholder;
3190
+ } else return ((r = u.value) == null ? void 0 : r.label) || l.placeholder || "";
3191
+ return "";
3192
+ }), v = f(() => !(!l.clearable || !l.modelValue || l.modelValue && Array.isArray(l.modelValue) && !l.modelValue.length)), g = f(() => i.value ? l.options.filter(
3193
+ (r) => r.label.toLowerCase().includes(i.value.toLowerCase())
3194
+ ) : l.options), c = f(() => {
3195
+ if (l.rules)
3196
+ return l.required ? [...l.rules, cl] : l.rules;
3197
+ if (l.required)
3198
+ return [cl];
3199
+ }), y = () => {
3200
+ u.value = void 0;
3201
+ }, C = (r, m) => {
3202
+ m(() => {
3203
+ i.value = r;
3204
+ });
3205
+ };
3206
+ return (r, m) => (de(), ye("div", {
3207
+ class: st(["app-select", [{ "app-select_opened": a.value }, `app-select_${r.size}`]])
3208
+ }, [
3209
+ r.label ? (de(), ye("label", {
3210
+ key: 0,
3211
+ class: st(["app-select__label", { "app-select__label_bold": r.required }])
3212
+ }, Ue(r.required ? `${r.label} *` : r.label), 3)) : Pe("", !0),
3213
+ Xe(zn(pi), {
3214
+ standout: "",
3215
+ "hide-bottom-space": "",
3216
+ "hide-dropdown-icon": "",
3217
+ "no-error-icon": "",
3218
+ behavior: "menu",
3219
+ "popup-content-class": `app-select-menu app-select-menu_${r.size}`,
3220
+ placeholder: r.filtering && "Почніть вводити",
3221
+ "input-debounce": "50",
3222
+ modelValue: u.value,
3223
+ "onUpdate:modelValue": m[0] || (m[0] = (_) => u.value = _),
3224
+ options: g.value,
3225
+ multiple: r.multiple,
3226
+ "use-input": r.filtering && (Array.isArray(u.value) || !u.value),
3227
+ rules: c.value,
3228
+ "lazy-rules": r.lazyRules,
3229
+ autofocus: r.autofocus,
3230
+ disable: r.disabled,
3231
+ loading: r.loading,
3232
+ onFilter: C,
3233
+ onPopupShow: m[1] || (m[1] = (_) => a.value = !0),
3234
+ onPopupHide: m[2] || (m[2] = (_) => a.value = !1)
3235
+ }, {
3236
+ append: xe(() => [
3237
+ v.value ? (de(), ye("i", {
3238
+ key: 0,
3239
+ class: "icon-kl icon-kl-close app-select__clear",
3240
+ onClick: Mn(y, ["stop", "prevent"])
3241
+ })) : Pe("", !0),
3242
+ m[3] || (m[3] = At("i", { class: "icon-kl icon-kl-arrow-down app-select__drop-icon" }, null, -1))
3243
+ ]),
3244
+ selected: xe(() => {
3245
+ var _, S;
3246
+ return [
3247
+ Array.isArray(u.value) ? (de(), ye(ct, { key: 0 }, [
3248
+ !r.filtering || u.value.length ? (de(), ye("span", {
3249
+ key: 0,
3250
+ class: st([
3251
+ "app-select__selected",
3252
+ {
3253
+ "app-select__placeholder": !((_ = u.value) != null && _.length) && r.placeholder
3254
+ }
3255
+ ])
3256
+ }, [
3257
+ (S = u.value) != null && S.length ? (de(), ye(ct, { key: 0 }, [
3258
+ m[4] || (m[4] = Tt(" Вибрано ")),
3259
+ At("span", bi, Ue(u.value.length), 1)
3260
+ ], 64)) : (de(), ye(ct, { key: 1 }, [
3261
+ Tt(Ue(l.placeholder), 1)
3262
+ ], 64))
3263
+ ], 2)) : Pe("", !0)
3264
+ ], 64)) : (de(), ye(ct, { key: 1 }, [
3265
+ !r.filtering || u.value ? (de(), ye("span", {
3266
+ key: 0,
3267
+ class: st([
3268
+ "app-select__selected",
3269
+ { "app-select__placeholder": !u.value && r.placeholder }
3270
+ ])
3271
+ }, Ue(d.value), 3)) : Pe("", !0)
3272
+ ], 64))
3273
+ ];
3274
+ }),
3275
+ option: xe((_) => [
3276
+ Xe(Kl, Fn({
3277
+ class: ["app-select__option", { "app-select__option_selected": _.selected }]
3278
+ }, _.itemProps), {
3279
+ default: xe(() => [
3280
+ l.multiple ? (de(), al(pt, {
3281
+ key: 0,
3282
+ class: "option-multiple",
3283
+ avatar: ""
3284
+ }, {
3285
+ default: xe(() => [
3286
+ Xe(ro, {
3287
+ size: "30px",
3288
+ "model-value": _.selected,
3289
+ "onUpdate:modelValue": () => _.toggleOption(_.opt)
3290
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
3291
+ ]),
3292
+ _: 2
3293
+ }, 1024)) : Pe("", !0),
3294
+ _.opt.done ? (de(), al(pt, {
3295
+ key: 1,
3296
+ class: "option-done",
3297
+ avatar: ""
3298
+ }, {
3299
+ default: xe(() => m[5] || (m[5] = [
3300
+ At("i", { class: "icon-kl icon-kl-check option-done__icon" }, null, -1)
3301
+ ])),
3302
+ _: 1
3303
+ })) : Pe("", !0),
3304
+ Xe(pt, null, {
3305
+ default: xe(() => [
3306
+ Xe(Nl, null, {
3307
+ default: xe(() => [
3308
+ Tt(Ue(_.opt.label), 1)
3309
+ ]),
3310
+ _: 2
3311
+ }, 1024)
3312
+ ]),
3313
+ _: 2
3314
+ }, 1024)
3315
+ ]),
3316
+ _: 2
3317
+ }, 1040, ["class"])
3318
+ ]),
3319
+ _: 1
3320
+ }, 8, ["popup-content-class", "placeholder", "modelValue", "options", "multiple", "use-input", "rules", "lazy-rules", "autofocus", "disable", "loading"])
3321
+ ], 2));
3322
+ }
3323
+ }), Ci = /* @__PURE__ */ Gn(yi, [["__scopeId", "data-v-4f110a60"]]);
3324
+ export {
3325
+ Ci as default
3326
+ };