translime-sdk 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3607 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const vuetify = require("vuetify");
5
+ const locale = require("vuetify/locale");
6
+ const components = require("vuetify/components");
7
+ const directives = require("vuetify/directives");
8
+ const md = require("vuetify/iconsets/md");
9
+ const blueprints = require("vuetify/blueprints");
10
+ require("vuetify/styles");
11
+ const previewMock = require("./preview-mock.cjs");
12
+ function _interopNamespaceDefault(e) {
13
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
14
+ if (e) {
15
+ for (const k in e) {
16
+ if (k !== "default") {
17
+ const d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: () => e[k]
21
+ });
22
+ }
23
+ }
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+ const components__namespace = /* @__PURE__ */ _interopNamespaceDefault(components);
29
+ const directives__namespace = /* @__PURE__ */ _interopNamespaceDefault(directives);
30
+ const _export_sfc = (sfc, props) => {
31
+ const target = sfc.__vccOpts || sfc;
32
+ for (const [key, val] of props) {
33
+ target[key] = val;
34
+ }
35
+ return target;
36
+ };
37
+ function propsFactory(props, source) {
38
+ return (defaults) => {
39
+ return Object.keys(props).reduce((obj, prop) => {
40
+ const isObjectDefinition = typeof props[prop] === "object" && props[prop] != null && !Array.isArray(props[prop]);
41
+ const definition = isObjectDefinition ? props[prop] : {
42
+ type: props[prop]
43
+ };
44
+ if (defaults && prop in defaults) {
45
+ obj[prop] = {
46
+ ...definition,
47
+ default: defaults[prop]
48
+ };
49
+ } else {
50
+ obj[prop] = definition;
51
+ }
52
+ if (source && !obj[prop].source) {
53
+ obj[prop].source = source;
54
+ }
55
+ return obj;
56
+ }, {});
57
+ };
58
+ }
59
+ const makeComponentProps = propsFactory({
60
+ class: [String, Array, Object],
61
+ style: {
62
+ type: [String, Array, Object],
63
+ default: null
64
+ }
65
+ }, "component");
66
+ function consoleWarn(message) {
67
+ vue.warn(`Vuetify: ${message}`);
68
+ }
69
+ const IN_BROWSER = typeof window !== "undefined";
70
+ const SUPPORTS_INTERSECTION = IN_BROWSER && "IntersectionObserver" in window;
71
+ const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof window.matchMedia === "function";
72
+ const PREFERS_REDUCED_MOTION = () => SUPPORTS_MATCH_MEDIA && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
73
+ function convertToUnit(str) {
74
+ let unit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "px";
75
+ if (str == null || str === "") {
76
+ return void 0;
77
+ }
78
+ const num = Number(str);
79
+ if (isNaN(num)) {
80
+ return String(str);
81
+ } else if (!isFinite(num)) {
82
+ return void 0;
83
+ } else {
84
+ return `${num}${unit}`;
85
+ }
86
+ }
87
+ function isObject(obj) {
88
+ return obj !== null && typeof obj === "object" && !Array.isArray(obj);
89
+ }
90
+ function isPlainObject(obj) {
91
+ let proto;
92
+ return obj !== null && typeof obj === "object" && ((proto = Object.getPrototypeOf(obj)) === Object.prototype || proto === null);
93
+ }
94
+ function refElement(obj) {
95
+ if (obj && "$el" in obj) {
96
+ const el = obj.$el;
97
+ if (el?.nodeType === Node.TEXT_NODE) {
98
+ return el.nextElementSibling;
99
+ }
100
+ return el;
101
+ }
102
+ return obj;
103
+ }
104
+ function has(obj, key) {
105
+ return key.every((k) => obj.hasOwnProperty(k));
106
+ }
107
+ function pick(obj, paths) {
108
+ const found = {};
109
+ for (const key of paths) {
110
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
111
+ found[key] = obj[key];
112
+ }
113
+ }
114
+ return found;
115
+ }
116
+ function omit(obj, exclude) {
117
+ const clone = {
118
+ ...obj
119
+ };
120
+ exclude.forEach((prop) => delete clone[prop]);
121
+ return clone;
122
+ }
123
+ function wrapInArray(v) {
124
+ return v == null ? [] : Array.isArray(v) ? v : [v];
125
+ }
126
+ function clamp(value) {
127
+ let min = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
128
+ let max = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
129
+ return Math.max(min, Math.min(max, value));
130
+ }
131
+ function padEnd(str, length) {
132
+ let char = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "0";
133
+ return str + char.repeat(Math.max(0, length - str.length));
134
+ }
135
+ function chunk(str) {
136
+ let size = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
137
+ const chunked = [];
138
+ let index = 0;
139
+ while (index < str.length) {
140
+ chunked.push(str.substr(index, size));
141
+ index += size;
142
+ }
143
+ return chunked;
144
+ }
145
+ function mergeDeep() {
146
+ let source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
147
+ let target = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
148
+ let arrayFn = arguments.length > 2 ? arguments[2] : void 0;
149
+ const out = {};
150
+ for (const key in source) {
151
+ out[key] = source[key];
152
+ }
153
+ for (const key in target) {
154
+ const sourceProperty = source[key];
155
+ const targetProperty = target[key];
156
+ if (isPlainObject(sourceProperty) && isPlainObject(targetProperty)) {
157
+ out[key] = mergeDeep(sourceProperty, targetProperty, arrayFn);
158
+ continue;
159
+ }
160
+ if (arrayFn && Array.isArray(sourceProperty) && Array.isArray(targetProperty)) {
161
+ out[key] = arrayFn(sourceProperty, targetProperty);
162
+ continue;
163
+ }
164
+ out[key] = targetProperty;
165
+ }
166
+ return out;
167
+ }
168
+ function flattenFragments(nodes) {
169
+ return nodes.map((node) => {
170
+ if (node.type === vue.Fragment) {
171
+ return flattenFragments(node.children);
172
+ } else {
173
+ return node;
174
+ }
175
+ }).flat();
176
+ }
177
+ function toKebabCase() {
178
+ let str = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
179
+ if (toKebabCase.cache.has(str)) return toKebabCase.cache.get(str);
180
+ const kebab = str.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
181
+ toKebabCase.cache.set(str, kebab);
182
+ return kebab;
183
+ }
184
+ toKebabCase.cache = /* @__PURE__ */ new Map();
185
+ function findChildrenWithProvide(key, vnode) {
186
+ if (!vnode || typeof vnode !== "object") return [];
187
+ if (Array.isArray(vnode)) {
188
+ return vnode.map((child) => findChildrenWithProvide(key, child)).flat(1);
189
+ } else if (vnode.suspense) {
190
+ return findChildrenWithProvide(key, vnode.ssContent);
191
+ } else if (Array.isArray(vnode.children)) {
192
+ return vnode.children.map((child) => findChildrenWithProvide(key, child)).flat(1);
193
+ } else if (vnode.component) {
194
+ if (Object.getOwnPropertyDescriptor(vnode.component.provides, key)) {
195
+ return [vnode.component];
196
+ } else if (vnode.component.subTree) {
197
+ return findChildrenWithProvide(key, vnode.component.subTree).flat(1);
198
+ }
199
+ }
200
+ return [];
201
+ }
202
+ function destructComputed(getter) {
203
+ const refs = vue.reactive({});
204
+ vue.watchEffect(() => {
205
+ const base = getter();
206
+ for (const key in base) {
207
+ refs[key] = base[key];
208
+ }
209
+ }, {
210
+ flush: "sync"
211
+ });
212
+ const obj = {};
213
+ for (const key in refs) {
214
+ obj[key] = vue.toRef(() => refs[key]);
215
+ }
216
+ return obj;
217
+ }
218
+ function includes(arr, val) {
219
+ return arr.includes(val);
220
+ }
221
+ function hasEvent(props, name) {
222
+ name = "on" + vue.capitalize(name);
223
+ return !!(props[name] || props[`${name}Once`] || props[`${name}Capture`] || props[`${name}OnceCapture`] || props[`${name}CaptureOnce`]);
224
+ }
225
+ function templateRef() {
226
+ const el = vue.shallowRef();
227
+ const fn = (target) => {
228
+ el.value = target;
229
+ };
230
+ Object.defineProperty(fn, "value", {
231
+ enumerable: true,
232
+ get: () => el.value,
233
+ set: (val) => el.value = val
234
+ });
235
+ Object.defineProperty(fn, "el", {
236
+ enumerable: true,
237
+ get: () => refElement(el.value)
238
+ });
239
+ return fn;
240
+ }
241
+ function isPrimitive(value) {
242
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint";
243
+ }
244
+ function onlyDefinedProps(props) {
245
+ const booleanAttributes = ["checked", "disabled"];
246
+ return Object.fromEntries(Object.entries(props).filter((_ref) => {
247
+ let [key, v] = _ref;
248
+ return booleanAttributes.includes(key) ? !!v : v !== void 0;
249
+ }));
250
+ }
251
+ const block = ["top", "bottom"];
252
+ const inline = ["start", "end", "left", "right"];
253
+ function parseAnchor(anchor, isRtl) {
254
+ let [side, align] = anchor.split(" ");
255
+ if (!align) {
256
+ align = includes(block, side) ? "start" : includes(inline, side) ? "top" : "center";
257
+ }
258
+ return {
259
+ side: toPhysical(side, isRtl),
260
+ align: toPhysical(align, isRtl)
261
+ };
262
+ }
263
+ function toPhysical(str, isRtl) {
264
+ if (str === "start") return isRtl ? "right" : "left";
265
+ if (str === "end") return isRtl ? "left" : "right";
266
+ return str;
267
+ }
268
+ const mainTRC = 2.4;
269
+ const Rco = 0.2126729;
270
+ const Gco = 0.7151522;
271
+ const Bco = 0.072175;
272
+ const normBG = 0.55;
273
+ const normTXT = 0.58;
274
+ const revTXT = 0.57;
275
+ const revBG = 0.62;
276
+ const blkThrs = 0.03;
277
+ const blkClmp = 1.45;
278
+ const deltaYmin = 5e-4;
279
+ const scaleBoW = 1.25;
280
+ const scaleWoB = 1.25;
281
+ const loConThresh = 0.078;
282
+ const loConFactor = 12.82051282051282;
283
+ const loConOffset = 0.06;
284
+ const loClip = 1e-3;
285
+ function APCAcontrast(text, background) {
286
+ const Rtxt = (text.r / 255) ** mainTRC;
287
+ const Gtxt = (text.g / 255) ** mainTRC;
288
+ const Btxt = (text.b / 255) ** mainTRC;
289
+ const Rbg = (background.r / 255) ** mainTRC;
290
+ const Gbg = (background.g / 255) ** mainTRC;
291
+ const Bbg = (background.b / 255) ** mainTRC;
292
+ let Ytxt = Rtxt * Rco + Gtxt * Gco + Btxt * Bco;
293
+ let Ybg = Rbg * Rco + Gbg * Gco + Bbg * Bco;
294
+ if (Ytxt <= blkThrs) Ytxt += (blkThrs - Ytxt) ** blkClmp;
295
+ if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp;
296
+ if (Math.abs(Ybg - Ytxt) < deltaYmin) return 0;
297
+ let outputContrast;
298
+ if (Ybg > Ytxt) {
299
+ const SAPC = (Ybg ** normBG - Ytxt ** normTXT) * scaleBoW;
300
+ outputContrast = SAPC < loClip ? 0 : SAPC < loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC - loConOffset;
301
+ } else {
302
+ const SAPC = (Ybg ** revBG - Ytxt ** revTXT) * scaleWoB;
303
+ outputContrast = SAPC > -loClip ? 0 : SAPC > -loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC + loConOffset;
304
+ }
305
+ return outputContrast * 100;
306
+ }
307
+ function isCssColor(color) {
308
+ return !!color && /^(#|var\(--|(rgb|hsl)a?\()/.test(color);
309
+ }
310
+ function isParsableColor(color) {
311
+ return isCssColor(color) && !/^((rgb|hsl)a?\()?var\(--/.test(color);
312
+ }
313
+ const cssColorRe = /^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/;
314
+ const mappers = {
315
+ rgb: (r, g, b, a) => ({
316
+ r,
317
+ g,
318
+ b,
319
+ a
320
+ }),
321
+ rgba: (r, g, b, a) => ({
322
+ r,
323
+ g,
324
+ b,
325
+ a
326
+ }),
327
+ hsl: (h, s, l, a) => HSLtoRGB({
328
+ h,
329
+ s,
330
+ l,
331
+ a
332
+ }),
333
+ hsla: (h, s, l, a) => HSLtoRGB({
334
+ h,
335
+ s,
336
+ l,
337
+ a
338
+ }),
339
+ hsv: (h, s, v, a) => HSVtoRGB({
340
+ h,
341
+ s,
342
+ v,
343
+ a
344
+ }),
345
+ hsva: (h, s, v, a) => HSVtoRGB({
346
+ h,
347
+ s,
348
+ v,
349
+ a
350
+ })
351
+ };
352
+ function parseColor(color) {
353
+ if (typeof color === "number") {
354
+ if (isNaN(color) || color < 0 || color > 16777215) {
355
+ consoleWarn(`'${color}' is not a valid hex color`);
356
+ }
357
+ return {
358
+ r: (color & 16711680) >> 16,
359
+ g: (color & 65280) >> 8,
360
+ b: color & 255
361
+ };
362
+ } else if (typeof color === "string" && cssColorRe.test(color)) {
363
+ const {
364
+ groups
365
+ } = color.match(cssColorRe);
366
+ const {
367
+ fn,
368
+ values
369
+ } = groups;
370
+ const realValues = values.split(/,\s*|\s*\/\s*|\s+/).map((v, i) => {
371
+ if (v.endsWith("%") || // unitless slv are %
372
+ i > 0 && i < 3 && ["hsl", "hsla", "hsv", "hsva"].includes(fn)) {
373
+ return parseFloat(v) / 100;
374
+ } else {
375
+ return parseFloat(v);
376
+ }
377
+ });
378
+ return mappers[fn](...realValues);
379
+ } else if (typeof color === "string") {
380
+ let hex = color.startsWith("#") ? color.slice(1) : color;
381
+ if ([3, 4].includes(hex.length)) {
382
+ hex = hex.split("").map((char) => char + char).join("");
383
+ } else if (![6, 8].includes(hex.length)) {
384
+ consoleWarn(`'${color}' is not a valid hex(a) color`);
385
+ }
386
+ const int = parseInt(hex, 16);
387
+ if (isNaN(int) || int < 0 || int > 4294967295) {
388
+ consoleWarn(`'${color}' is not a valid hex(a) color`);
389
+ }
390
+ return HexToRGB(hex);
391
+ } else if (typeof color === "object") {
392
+ if (has(color, ["r", "g", "b"])) {
393
+ return color;
394
+ } else if (has(color, ["h", "s", "l"])) {
395
+ return HSVtoRGB(HSLtoHSV(color));
396
+ } else if (has(color, ["h", "s", "v"])) {
397
+ return HSVtoRGB(color);
398
+ }
399
+ }
400
+ throw new TypeError(`Invalid color: ${color == null ? color : String(color) || color.constructor.name}
401
+ Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
402
+ }
403
+ function HSVtoRGB(hsva) {
404
+ const {
405
+ h,
406
+ s,
407
+ v,
408
+ a
409
+ } = hsva;
410
+ const f = (n) => {
411
+ const k = (n + h / 60) % 6;
412
+ return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
413
+ };
414
+ const rgb = [f(5), f(3), f(1)].map((v2) => Math.round(v2 * 255));
415
+ return {
416
+ r: rgb[0],
417
+ g: rgb[1],
418
+ b: rgb[2],
419
+ a
420
+ };
421
+ }
422
+ function HSLtoRGB(hsla) {
423
+ return HSVtoRGB(HSLtoHSV(hsla));
424
+ }
425
+ function HSLtoHSV(hsl) {
426
+ const {
427
+ h,
428
+ s,
429
+ l,
430
+ a
431
+ } = hsl;
432
+ const v = l + s * Math.min(l, 1 - l);
433
+ const sprime = v === 0 ? 0 : 2 - 2 * l / v;
434
+ return {
435
+ h,
436
+ s: sprime,
437
+ v,
438
+ a
439
+ };
440
+ }
441
+ function HexToRGB(hex) {
442
+ hex = parseHex(hex);
443
+ let [r, g, b, a] = chunk(hex, 2).map((c) => parseInt(c, 16));
444
+ a = a === void 0 ? a : a / 255;
445
+ return {
446
+ r,
447
+ g,
448
+ b,
449
+ a
450
+ };
451
+ }
452
+ function parseHex(hex) {
453
+ if (hex.startsWith("#")) {
454
+ hex = hex.slice(1);
455
+ }
456
+ hex = hex.replace(/([^0-9a-f])/gi, "F");
457
+ if (hex.length === 3 || hex.length === 4) {
458
+ hex = hex.split("").map((x) => x + x).join("");
459
+ }
460
+ if (hex.length !== 6) {
461
+ hex = padEnd(padEnd(hex, 6), 8, "F");
462
+ }
463
+ return hex;
464
+ }
465
+ function getForeground(color) {
466
+ const blackContrast = Math.abs(APCAcontrast(parseColor(0), parseColor(color)));
467
+ const whiteContrast = Math.abs(APCAcontrast(parseColor(16777215), parseColor(color)));
468
+ return whiteContrast > Math.min(blackContrast, 50) ? "#fff" : "#000";
469
+ }
470
+ function getCurrentInstance(name, message) {
471
+ const vm = vue.getCurrentInstance();
472
+ if (!vm) {
473
+ throw new Error(`[Vuetify] ${name} ${"must be called from inside a setup function"}`);
474
+ }
475
+ return vm;
476
+ }
477
+ function getCurrentInstanceName() {
478
+ let name = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
479
+ const vm = getCurrentInstance(name).type;
480
+ return toKebabCase(vm?.aliasName || vm?.name);
481
+ }
482
+ function injectSelf(key) {
483
+ let vm = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstance("injectSelf");
484
+ const {
485
+ provides
486
+ } = vm;
487
+ if (provides && key in provides) {
488
+ return provides[key];
489
+ }
490
+ return void 0;
491
+ }
492
+ const DefaultsSymbol = /* @__PURE__ */ Symbol.for("vuetify:defaults");
493
+ function injectDefaults() {
494
+ const defaults = vue.inject(DefaultsSymbol);
495
+ if (!defaults) throw new Error("[Vuetify] Could not find defaults instance");
496
+ return defaults;
497
+ }
498
+ function provideDefaults(defaults, options) {
499
+ const injectedDefaults = injectDefaults();
500
+ const providedDefaults = vue.ref(defaults);
501
+ const newDefaults = vue.computed(() => {
502
+ const disabled = vue.unref(options?.disabled);
503
+ if (disabled) return injectedDefaults.value;
504
+ const scoped = vue.unref(options?.scoped);
505
+ const reset = vue.unref(options?.reset);
506
+ const root = vue.unref(options?.root);
507
+ if (providedDefaults.value == null && !(scoped || reset || root)) return injectedDefaults.value;
508
+ let properties = mergeDeep(providedDefaults.value, {
509
+ prev: injectedDefaults.value
510
+ });
511
+ if (scoped) return properties;
512
+ if (reset || root) {
513
+ const len = Number(reset || Infinity);
514
+ for (let i = 0; i <= len; i++) {
515
+ if (!properties || !("prev" in properties)) {
516
+ break;
517
+ }
518
+ properties = properties.prev;
519
+ }
520
+ if (properties && typeof root === "string" && root in properties) {
521
+ properties = mergeDeep(mergeDeep(properties, {
522
+ prev: properties
523
+ }), properties[root]);
524
+ }
525
+ return properties;
526
+ }
527
+ return properties.prev ? mergeDeep(properties.prev, properties) : properties;
528
+ });
529
+ vue.provide(DefaultsSymbol, newDefaults);
530
+ return newDefaults;
531
+ }
532
+ function propIsDefined(vnode, prop) {
533
+ return vnode.props && (typeof vnode.props[prop] !== "undefined" || typeof vnode.props[toKebabCase(prop)] !== "undefined");
534
+ }
535
+ function internalUseDefaults() {
536
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
537
+ let name = arguments.length > 1 ? arguments[1] : void 0;
538
+ let defaults = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : injectDefaults();
539
+ const vm = getCurrentInstance("useDefaults");
540
+ name = name ?? vm.type.name ?? vm.type.__name;
541
+ if (!name) {
542
+ throw new Error("[Vuetify] Could not determine component name");
543
+ }
544
+ const componentDefaults = vue.computed(() => defaults.value?.[props._as ?? name]);
545
+ const _props = new Proxy(props, {
546
+ get(target, prop) {
547
+ const propValue = Reflect.get(target, prop);
548
+ if (prop === "class" || prop === "style") {
549
+ return [componentDefaults.value?.[prop], propValue].filter((v) => v != null);
550
+ }
551
+ if (propIsDefined(vm.vnode, prop)) return propValue;
552
+ const _componentDefault = componentDefaults.value?.[prop];
553
+ if (_componentDefault !== void 0) return _componentDefault;
554
+ const _globalDefault = defaults.value?.global?.[prop];
555
+ if (_globalDefault !== void 0) return _globalDefault;
556
+ return propValue;
557
+ }
558
+ });
559
+ const _subcomponentDefaults = vue.shallowRef();
560
+ vue.watchEffect(() => {
561
+ if (componentDefaults.value) {
562
+ const subComponents = Object.entries(componentDefaults.value).filter((_ref) => {
563
+ let [key] = _ref;
564
+ return key.startsWith(key[0].toUpperCase());
565
+ });
566
+ _subcomponentDefaults.value = subComponents.length ? Object.fromEntries(subComponents) : void 0;
567
+ } else {
568
+ _subcomponentDefaults.value = void 0;
569
+ }
570
+ });
571
+ function provideSubDefaults() {
572
+ const injected = injectSelf(DefaultsSymbol, vm);
573
+ vue.provide(DefaultsSymbol, vue.computed(() => {
574
+ return _subcomponentDefaults.value ? mergeDeep(injected?.value ?? {}, _subcomponentDefaults.value) : injected?.value;
575
+ }));
576
+ }
577
+ return {
578
+ props: _props,
579
+ provideSubDefaults
580
+ };
581
+ }
582
+ function defineComponent(options) {
583
+ options._setup = options._setup ?? options.setup;
584
+ if (!options.name) {
585
+ consoleWarn("The component is missing an explicit name, unable to generate default prop value");
586
+ return options;
587
+ }
588
+ if (options._setup) {
589
+ options.props = propsFactory(options.props ?? {}, options.name)();
590
+ const propKeys = Object.keys(options.props).filter((key) => key !== "class" && key !== "style");
591
+ options.filterProps = function filterProps(props) {
592
+ return pick(props, propKeys);
593
+ };
594
+ options.props._as = String;
595
+ options.setup = function setup(props, ctx) {
596
+ const defaults = injectDefaults();
597
+ if (!defaults.value) return options._setup(props, ctx);
598
+ const {
599
+ props: _props,
600
+ provideSubDefaults
601
+ } = internalUseDefaults(props, props._as ?? options.name, defaults);
602
+ const setupBindings = options._setup(_props, ctx);
603
+ provideSubDefaults();
604
+ return setupBindings;
605
+ };
606
+ }
607
+ return options;
608
+ }
609
+ function genericComponent() {
610
+ let exposeDefaults = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
611
+ return (options) => (exposeDefaults ? defineComponent : vue.defineComponent)(options);
612
+ }
613
+ function createSimpleFunctional(klass) {
614
+ let tag = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "div";
615
+ let name = arguments.length > 2 ? arguments[2] : void 0;
616
+ return genericComponent()({
617
+ name: name ?? vue.capitalize(vue.camelize(klass.replace(/__/g, "-"))),
618
+ props: {
619
+ tag: {
620
+ type: String,
621
+ default: tag
622
+ },
623
+ ...makeComponentProps()
624
+ },
625
+ setup(props, _ref) {
626
+ let {
627
+ slots
628
+ } = _ref;
629
+ return () => {
630
+ return vue.h(props.tag, {
631
+ class: [klass, props.class],
632
+ style: props.style
633
+ }, slots.default?.());
634
+ };
635
+ }
636
+ });
637
+ }
638
+ function updateRecursionCache(a, b, cache, result) {
639
+ if (!cache || isPrimitive(a) || isPrimitive(b)) return;
640
+ const visitedObject = cache.get(a);
641
+ if (visitedObject) {
642
+ visitedObject.set(b, result);
643
+ } else {
644
+ const newCacheItem = /* @__PURE__ */ new WeakMap();
645
+ newCacheItem.set(b, result);
646
+ cache.set(a, newCacheItem);
647
+ }
648
+ }
649
+ function findCachedComparison(a, b, cache) {
650
+ if (!cache || isPrimitive(a) || isPrimitive(b)) return null;
651
+ const r1 = cache.get(a)?.get(b);
652
+ if (typeof r1 === "boolean") return r1;
653
+ const r2 = cache.get(b)?.get(a);
654
+ if (typeof r2 === "boolean") return r2;
655
+ return null;
656
+ }
657
+ function deepEqual(a, b) {
658
+ let recursionCache = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : /* @__PURE__ */ new WeakMap();
659
+ if (a === b) return true;
660
+ if (a instanceof Date && b instanceof Date && a.getTime() !== b.getTime()) {
661
+ return false;
662
+ }
663
+ if (a !== Object(a) || b !== Object(b)) {
664
+ return false;
665
+ }
666
+ const props = Object.keys(a);
667
+ if (props.length !== Object.keys(b).length) {
668
+ return false;
669
+ }
670
+ const cachedComparisonResult = findCachedComparison(a, b, recursionCache);
671
+ if (cachedComparisonResult) {
672
+ return cachedComparisonResult;
673
+ }
674
+ updateRecursionCache(a, b, recursionCache, true);
675
+ return props.every((p) => deepEqual(a[p], b[p], recursionCache));
676
+ }
677
+ function useRender(render) {
678
+ const vm = getCurrentInstance("useRender");
679
+ vm.render = render;
680
+ }
681
+ function useResizeObserver(callback) {
682
+ let box = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "content";
683
+ const resizeRef = templateRef();
684
+ const contentRect = vue.ref();
685
+ if (IN_BROWSER) {
686
+ const observer = new ResizeObserver((entries) => {
687
+ if (!entries.length) return;
688
+ if (box === "content") {
689
+ contentRect.value = entries[0].contentRect;
690
+ } else {
691
+ contentRect.value = entries[0].target.getBoundingClientRect();
692
+ }
693
+ });
694
+ vue.onBeforeUnmount(() => {
695
+ observer.disconnect();
696
+ });
697
+ vue.watch(() => resizeRef.el, (newValue, oldValue) => {
698
+ if (oldValue) {
699
+ observer.unobserve(oldValue);
700
+ contentRect.value = void 0;
701
+ }
702
+ if (newValue) observer.observe(newValue);
703
+ }, {
704
+ flush: "post"
705
+ });
706
+ }
707
+ return {
708
+ resizeRef,
709
+ contentRect: vue.readonly(contentRect)
710
+ };
711
+ }
712
+ const VuetifyLayoutKey = /* @__PURE__ */ Symbol.for("vuetify:layout");
713
+ const VuetifyLayoutItemKey = /* @__PURE__ */ Symbol.for("vuetify:layout-item");
714
+ const ROOT_ZINDEX = 1e3;
715
+ const makeLayoutProps = propsFactory({
716
+ overlaps: {
717
+ type: Array,
718
+ default: () => []
719
+ },
720
+ fullHeight: Boolean
721
+ }, "layout");
722
+ function useLayout() {
723
+ const layout = vue.inject(VuetifyLayoutKey);
724
+ if (!layout) throw new Error("[Vuetify] Could not find injected layout");
725
+ return {
726
+ getLayoutItem: layout.getLayoutItem,
727
+ mainRect: layout.mainRect,
728
+ mainStyles: layout.mainStyles
729
+ };
730
+ }
731
+ const generateLayers = (layout, positions, layoutSizes, activeItems) => {
732
+ let previousLayer = {
733
+ top: 0,
734
+ left: 0,
735
+ right: 0,
736
+ bottom: 0
737
+ };
738
+ const layers = [{
739
+ id: "",
740
+ layer: {
741
+ ...previousLayer
742
+ }
743
+ }];
744
+ for (const id of layout) {
745
+ const position = positions.get(id);
746
+ const amount = layoutSizes.get(id);
747
+ const active = activeItems.get(id);
748
+ if (!position || !amount || !active) continue;
749
+ const layer = {
750
+ ...previousLayer,
751
+ [position.value]: parseInt(previousLayer[position.value], 10) + (active.value ? parseInt(amount.value, 10) : 0)
752
+ };
753
+ layers.push({
754
+ id,
755
+ layer
756
+ });
757
+ previousLayer = layer;
758
+ }
759
+ return layers;
760
+ };
761
+ function createLayout(props) {
762
+ const parentLayout = vue.inject(VuetifyLayoutKey, null);
763
+ const rootZIndex = vue.computed(() => parentLayout ? parentLayout.rootZIndex.value - 100 : ROOT_ZINDEX);
764
+ const registered = vue.ref([]);
765
+ const positions = vue.reactive(/* @__PURE__ */ new Map());
766
+ const layoutSizes = vue.reactive(/* @__PURE__ */ new Map());
767
+ const priorities = vue.reactive(/* @__PURE__ */ new Map());
768
+ const activeItems = vue.reactive(/* @__PURE__ */ new Map());
769
+ const disabledTransitions = vue.reactive(/* @__PURE__ */ new Map());
770
+ const {
771
+ resizeRef,
772
+ contentRect: layoutRect
773
+ } = useResizeObserver();
774
+ const computedOverlaps = vue.computed(() => {
775
+ const map = /* @__PURE__ */ new Map();
776
+ const overlaps = props.overlaps ?? [];
777
+ for (const overlap of overlaps.filter((item) => item.includes(":"))) {
778
+ const [top, bottom] = overlap.split(":");
779
+ if (!registered.value.includes(top) || !registered.value.includes(bottom)) continue;
780
+ const topPosition = positions.get(top);
781
+ const bottomPosition = positions.get(bottom);
782
+ const topAmount = layoutSizes.get(top);
783
+ const bottomAmount = layoutSizes.get(bottom);
784
+ if (!topPosition || !bottomPosition || !topAmount || !bottomAmount) continue;
785
+ map.set(bottom, {
786
+ position: topPosition.value,
787
+ amount: parseInt(topAmount.value, 10)
788
+ });
789
+ map.set(top, {
790
+ position: bottomPosition.value,
791
+ amount: -parseInt(bottomAmount.value, 10)
792
+ });
793
+ }
794
+ return map;
795
+ });
796
+ const layers = vue.computed(() => {
797
+ const uniquePriorities = [...new Set([...priorities.values()].map((p) => p.value))].sort((a, b) => a - b);
798
+ const layout = [];
799
+ for (const p of uniquePriorities) {
800
+ const items2 = registered.value.filter((id) => priorities.get(id)?.value === p);
801
+ layout.push(...items2);
802
+ }
803
+ return generateLayers(layout, positions, layoutSizes, activeItems);
804
+ });
805
+ const transitionsEnabled = vue.computed(() => {
806
+ return !Array.from(disabledTransitions.values()).some((ref) => ref.value);
807
+ });
808
+ const mainRect = vue.computed(() => {
809
+ return layers.value[layers.value.length - 1].layer;
810
+ });
811
+ const mainStyles = vue.toRef(() => {
812
+ return {
813
+ "--v-layout-left": convertToUnit(mainRect.value.left),
814
+ "--v-layout-right": convertToUnit(mainRect.value.right),
815
+ "--v-layout-top": convertToUnit(mainRect.value.top),
816
+ "--v-layout-bottom": convertToUnit(mainRect.value.bottom),
817
+ ...transitionsEnabled.value ? void 0 : {
818
+ transition: "none"
819
+ }
820
+ };
821
+ });
822
+ const items = vue.computed(() => {
823
+ return layers.value.slice(1).map((_ref, index) => {
824
+ let {
825
+ id
826
+ } = _ref;
827
+ const {
828
+ layer
829
+ } = layers.value[index];
830
+ const size = layoutSizes.get(id);
831
+ const position = positions.get(id);
832
+ return {
833
+ id,
834
+ ...layer,
835
+ size: Number(size.value),
836
+ position: position.value
837
+ };
838
+ });
839
+ });
840
+ const getLayoutItem = (id) => {
841
+ return items.value.find((item) => item.id === id);
842
+ };
843
+ const rootVm = getCurrentInstance("createLayout");
844
+ const isMounted = vue.shallowRef(false);
845
+ vue.onMounted(() => {
846
+ isMounted.value = true;
847
+ });
848
+ vue.provide(VuetifyLayoutKey, {
849
+ register: (vm, _ref2) => {
850
+ let {
851
+ id,
852
+ order,
853
+ position,
854
+ layoutSize,
855
+ elementSize,
856
+ active,
857
+ disableTransitions,
858
+ absolute
859
+ } = _ref2;
860
+ priorities.set(id, order);
861
+ positions.set(id, position);
862
+ layoutSizes.set(id, layoutSize);
863
+ activeItems.set(id, active);
864
+ disableTransitions && disabledTransitions.set(id, disableTransitions);
865
+ const instances = findChildrenWithProvide(VuetifyLayoutItemKey, rootVm?.vnode);
866
+ const instanceIndex = instances.indexOf(vm);
867
+ if (instanceIndex > -1) registered.value.splice(instanceIndex, 0, id);
868
+ else registered.value.push(id);
869
+ const index = vue.computed(() => items.value.findIndex((i) => i.id === id));
870
+ const zIndex = vue.computed(() => rootZIndex.value + layers.value.length * 2 - index.value * 2);
871
+ const layoutItemStyles = vue.computed(() => {
872
+ const isHorizontal = position.value === "left" || position.value === "right";
873
+ const isOppositeHorizontal = position.value === "right";
874
+ const isOppositeVertical = position.value === "bottom";
875
+ const size = elementSize.value ?? layoutSize.value;
876
+ const unit = size === 0 ? "%" : "px";
877
+ const styles = {
878
+ [position.value]: 0,
879
+ zIndex: zIndex.value,
880
+ transform: `translate${isHorizontal ? "X" : "Y"}(${(active.value ? 0 : -(size === 0 ? 100 : size)) * (isOppositeHorizontal || isOppositeVertical ? -1 : 1)}${unit})`,
881
+ position: absolute.value || rootZIndex.value !== ROOT_ZINDEX ? "absolute" : "fixed",
882
+ ...transitionsEnabled.value ? void 0 : {
883
+ transition: "none"
884
+ }
885
+ };
886
+ if (!isMounted.value) return styles;
887
+ const item = items.value[index.value];
888
+ if (!item) consoleWarn(`[Vuetify] Could not find layout item "${id}"`);
889
+ const overlap = computedOverlaps.value.get(id);
890
+ if (overlap) {
891
+ item[overlap.position] += overlap.amount;
892
+ }
893
+ return {
894
+ ...styles,
895
+ height: isHorizontal ? `calc(100% - ${item.top}px - ${item.bottom}px)` : elementSize.value ? `${elementSize.value}px` : void 0,
896
+ left: isOppositeHorizontal ? void 0 : `${item.left}px`,
897
+ right: isOppositeHorizontal ? `${item.right}px` : void 0,
898
+ top: position.value !== "bottom" ? `${item.top}px` : void 0,
899
+ bottom: position.value !== "top" ? `${item.bottom}px` : void 0,
900
+ width: !isHorizontal ? `calc(100% - ${item.left}px - ${item.right}px)` : elementSize.value ? `${elementSize.value}px` : void 0
901
+ };
902
+ });
903
+ const layoutItemScrimStyles = vue.computed(() => ({
904
+ zIndex: zIndex.value - 1
905
+ }));
906
+ return {
907
+ layoutItemStyles,
908
+ layoutItemScrimStyles,
909
+ zIndex
910
+ };
911
+ },
912
+ unregister: (id) => {
913
+ priorities.delete(id);
914
+ positions.delete(id);
915
+ layoutSizes.delete(id);
916
+ activeItems.delete(id);
917
+ disabledTransitions.delete(id);
918
+ registered.value = registered.value.filter((v) => v !== id);
919
+ },
920
+ mainRect,
921
+ mainStyles,
922
+ getLayoutItem,
923
+ items,
924
+ layoutRect,
925
+ rootZIndex
926
+ });
927
+ const layoutClasses = vue.toRef(() => ["v-layout", {
928
+ "v-layout--full-height": props.fullHeight
929
+ }]);
930
+ const layoutStyles = vue.toRef(() => ({
931
+ zIndex: parentLayout ? rootZIndex.value : void 0,
932
+ position: parentLayout ? "relative" : void 0,
933
+ overflow: parentLayout ? "hidden" : void 0
934
+ }));
935
+ return {
936
+ layoutClasses,
937
+ layoutStyles,
938
+ getLayoutItem,
939
+ items,
940
+ layoutRect,
941
+ layoutRef: resizeRef
942
+ };
943
+ }
944
+ function useToggleScope(source, fn) {
945
+ let scope;
946
+ function start() {
947
+ scope = vue.effectScope();
948
+ scope.run(() => fn.length ? fn(() => {
949
+ scope?.stop();
950
+ start();
951
+ }) : fn());
952
+ }
953
+ vue.watch(source, (active) => {
954
+ if (active && !scope) {
955
+ start();
956
+ } else if (!active) {
957
+ scope?.stop();
958
+ scope = void 0;
959
+ }
960
+ }, {
961
+ immediate: true
962
+ });
963
+ vue.onScopeDispose(() => {
964
+ scope?.stop();
965
+ });
966
+ }
967
+ function useProxiedModel(props, prop, defaultValue) {
968
+ let transformIn = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : (v) => v;
969
+ let transformOut = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : (v) => v;
970
+ const vm = getCurrentInstance("useProxiedModel");
971
+ const internal = vue.ref(props[prop] !== void 0 ? props[prop] : defaultValue);
972
+ const kebabProp = toKebabCase(prop);
973
+ const checkKebab = kebabProp !== prop;
974
+ const isControlled = checkKebab ? vue.computed(() => {
975
+ void props[prop];
976
+ return !!((vm.vnode.props?.hasOwnProperty(prop) || vm.vnode.props?.hasOwnProperty(kebabProp)) && (vm.vnode.props?.hasOwnProperty(`onUpdate:${prop}`) || vm.vnode.props?.hasOwnProperty(`onUpdate:${kebabProp}`)));
977
+ }) : vue.computed(() => {
978
+ void props[prop];
979
+ return !!(vm.vnode.props?.hasOwnProperty(prop) && vm.vnode.props?.hasOwnProperty(`onUpdate:${prop}`));
980
+ });
981
+ useToggleScope(() => !isControlled.value, () => {
982
+ vue.watch(() => props[prop], (val) => {
983
+ internal.value = val;
984
+ });
985
+ });
986
+ const model = vue.computed({
987
+ get() {
988
+ const externalValue = props[prop];
989
+ return transformIn(isControlled.value ? externalValue : internal.value);
990
+ },
991
+ set(internalValue) {
992
+ const newValue = transformOut(internalValue);
993
+ const value = vue.toRaw(isControlled.value ? props[prop] : internal.value);
994
+ if (value === newValue || transformIn(value) === internalValue) {
995
+ return;
996
+ }
997
+ internal.value = newValue;
998
+ vm?.emit(`update:${prop}`, newValue);
999
+ }
1000
+ });
1001
+ Object.defineProperty(model, "externalValue", {
1002
+ get: () => isControlled.value ? props[prop] : internal.value
1003
+ });
1004
+ return model;
1005
+ }
1006
+ const LocaleSymbol = /* @__PURE__ */ Symbol.for("vuetify:locale");
1007
+ function useRtl() {
1008
+ const locale2 = vue.inject(LocaleSymbol);
1009
+ if (!locale2) throw new Error("[Vuetify] Could not find injected rtl instance");
1010
+ return {
1011
+ isRtl: locale2.isRtl,
1012
+ rtlClasses: locale2.rtlClasses
1013
+ };
1014
+ }
1015
+ const ThemeSymbol = /* @__PURE__ */ Symbol.for("vuetify:theme");
1016
+ const makeThemeProps = propsFactory({
1017
+ theme: String
1018
+ }, "theme");
1019
+ function provideTheme(props) {
1020
+ getCurrentInstance("provideTheme");
1021
+ const theme = vue.inject(ThemeSymbol, null);
1022
+ if (!theme) throw new Error("Could not find Vuetify theme injection");
1023
+ const name = vue.toRef(() => props.theme ?? theme.name.value);
1024
+ const current = vue.toRef(() => theme.themes.value[name.value]);
1025
+ const themeClasses = vue.toRef(() => theme.isDisabled ? void 0 : `${theme.prefix}theme--${name.value}`);
1026
+ const newTheme = {
1027
+ ...theme,
1028
+ name,
1029
+ current,
1030
+ themeClasses
1031
+ };
1032
+ vue.provide(ThemeSymbol, newTheme);
1033
+ return newTheme;
1034
+ }
1035
+ function useTheme() {
1036
+ getCurrentInstance("useTheme");
1037
+ const theme = vue.inject(ThemeSymbol, null);
1038
+ if (!theme) throw new Error("Could not find Vuetify theme injection");
1039
+ return theme;
1040
+ }
1041
+ const makeVAppProps = propsFactory({
1042
+ ...makeComponentProps(),
1043
+ ...omit(makeLayoutProps(), ["fullHeight"]),
1044
+ ...makeThemeProps()
1045
+ }, "VApp");
1046
+ const VApp = genericComponent()({
1047
+ name: "VApp",
1048
+ props: makeVAppProps(),
1049
+ setup(props, _ref) {
1050
+ let {
1051
+ slots
1052
+ } = _ref;
1053
+ const theme = provideTheme(props);
1054
+ const {
1055
+ layoutClasses,
1056
+ getLayoutItem,
1057
+ items,
1058
+ layoutRef
1059
+ } = createLayout({
1060
+ ...props,
1061
+ fullHeight: true
1062
+ });
1063
+ const {
1064
+ rtlClasses
1065
+ } = useRtl();
1066
+ useRender(() => vue.createElementVNode("div", {
1067
+ "ref": layoutRef,
1068
+ "class": vue.normalizeClass(["v-application", theme.themeClasses.value, layoutClasses.value, rtlClasses.value, props.class]),
1069
+ "style": vue.normalizeStyle([props.style])
1070
+ }, [vue.createElementVNode("div", {
1071
+ "class": "v-application__wrap"
1072
+ }, [slots.default?.()])]));
1073
+ return {
1074
+ getLayoutItem,
1075
+ items,
1076
+ theme
1077
+ };
1078
+ }
1079
+ });
1080
+ const makeVBannerActionsProps = propsFactory({
1081
+ color: String,
1082
+ density: String,
1083
+ ...makeComponentProps()
1084
+ }, "VBannerActions");
1085
+ const VBannerActions = genericComponent()({
1086
+ name: "VBannerActions",
1087
+ props: makeVBannerActionsProps(),
1088
+ setup(props, _ref) {
1089
+ let {
1090
+ slots
1091
+ } = _ref;
1092
+ provideDefaults({
1093
+ VBtn: {
1094
+ color: props.color,
1095
+ density: props.density,
1096
+ slim: true,
1097
+ variant: "text"
1098
+ }
1099
+ });
1100
+ useRender(() => vue.createElementVNode("div", {
1101
+ "class": vue.normalizeClass(["v-banner-actions", props.class]),
1102
+ "style": vue.normalizeStyle(props.style)
1103
+ }, [slots.default?.()]));
1104
+ return {};
1105
+ }
1106
+ });
1107
+ const VBannerText = createSimpleFunctional("v-banner-text");
1108
+ const makeVDefaultsProviderProps = propsFactory({
1109
+ defaults: Object,
1110
+ disabled: Boolean,
1111
+ reset: [Number, String],
1112
+ root: [Boolean, String],
1113
+ scoped: Boolean
1114
+ }, "VDefaultsProvider");
1115
+ const VDefaultsProvider = genericComponent(false)({
1116
+ name: "VDefaultsProvider",
1117
+ props: makeVDefaultsProviderProps(),
1118
+ setup(props, _ref) {
1119
+ let {
1120
+ slots
1121
+ } = _ref;
1122
+ const {
1123
+ defaults,
1124
+ disabled,
1125
+ reset,
1126
+ root,
1127
+ scoped
1128
+ } = vue.toRefs(props);
1129
+ provideDefaults(defaults, {
1130
+ reset,
1131
+ root,
1132
+ scoped,
1133
+ disabled
1134
+ });
1135
+ return () => slots.default?.();
1136
+ }
1137
+ });
1138
+ function useColor(colors) {
1139
+ return destructComputed(() => {
1140
+ const {
1141
+ class: colorClasses,
1142
+ style: colorStyles
1143
+ } = computeColor(colors);
1144
+ return {
1145
+ colorClasses,
1146
+ colorStyles
1147
+ };
1148
+ });
1149
+ }
1150
+ function useTextColor(color) {
1151
+ const {
1152
+ colorClasses: textColorClasses,
1153
+ colorStyles: textColorStyles
1154
+ } = useColor(() => ({
1155
+ text: vue.toValue(color)
1156
+ }));
1157
+ return {
1158
+ textColorClasses,
1159
+ textColorStyles
1160
+ };
1161
+ }
1162
+ function useBackgroundColor(color) {
1163
+ const {
1164
+ colorClasses: backgroundColorClasses,
1165
+ colorStyles: backgroundColorStyles
1166
+ } = useColor(() => ({
1167
+ background: vue.toValue(color)
1168
+ }));
1169
+ return {
1170
+ backgroundColorClasses,
1171
+ backgroundColorStyles
1172
+ };
1173
+ }
1174
+ function computeColor(colors) {
1175
+ const _colors = vue.toValue(colors);
1176
+ const classes = [];
1177
+ const styles = {};
1178
+ if (_colors.background) {
1179
+ if (isCssColor(_colors.background)) {
1180
+ styles.backgroundColor = _colors.background;
1181
+ if (!_colors.text && isParsableColor(_colors.background)) {
1182
+ const backgroundColor = parseColor(_colors.background);
1183
+ if (backgroundColor.a == null || backgroundColor.a === 1) {
1184
+ const textColor = getForeground(backgroundColor);
1185
+ styles.color = textColor;
1186
+ styles.caretColor = textColor;
1187
+ }
1188
+ }
1189
+ } else {
1190
+ classes.push(`bg-${_colors.background}`);
1191
+ }
1192
+ }
1193
+ if (_colors.text) {
1194
+ if (isCssColor(_colors.text)) {
1195
+ styles.color = _colors.text;
1196
+ styles.caretColor = _colors.text;
1197
+ } else {
1198
+ classes.push(`text-${_colors.text}`);
1199
+ }
1200
+ }
1201
+ return {
1202
+ class: classes,
1203
+ style: styles
1204
+ };
1205
+ }
1206
+ const IconValue = [String, Function, Object, Array];
1207
+ const IconSymbol = /* @__PURE__ */ Symbol.for("vuetify:icons");
1208
+ const makeIconProps = propsFactory({
1209
+ icon: {
1210
+ type: IconValue
1211
+ },
1212
+ // Could not remove this and use makeTagProps, types complained because it is not required
1213
+ tag: {
1214
+ type: [String, Object, Function],
1215
+ required: true
1216
+ }
1217
+ }, "icon");
1218
+ const VComponentIcon = genericComponent()({
1219
+ name: "VComponentIcon",
1220
+ props: makeIconProps(),
1221
+ setup(props, _ref) {
1222
+ let {
1223
+ slots
1224
+ } = _ref;
1225
+ return () => {
1226
+ const Icon = props.icon;
1227
+ return vue.createVNode(props.tag, null, {
1228
+ default: () => [props.icon ? vue.createVNode(Icon, null, null) : slots.default?.()]
1229
+ });
1230
+ };
1231
+ }
1232
+ });
1233
+ const VSvgIcon = defineComponent({
1234
+ name: "VSvgIcon",
1235
+ inheritAttrs: false,
1236
+ props: makeIconProps(),
1237
+ setup(props, _ref2) {
1238
+ let {
1239
+ attrs
1240
+ } = _ref2;
1241
+ return () => {
1242
+ return vue.createVNode(props.tag, vue.mergeProps(attrs, {
1243
+ "style": null
1244
+ }), {
1245
+ default: () => [vue.createElementVNode("svg", {
1246
+ "class": "v-icon__svg",
1247
+ "xmlns": "http://www.w3.org/2000/svg",
1248
+ "viewBox": "0 0 24 24",
1249
+ "role": "img",
1250
+ "aria-hidden": "true"
1251
+ }, [Array.isArray(props.icon) ? props.icon.map((path) => Array.isArray(path) ? vue.createElementVNode("path", {
1252
+ "d": path[0],
1253
+ "fill-opacity": path[1]
1254
+ }, null) : vue.createElementVNode("path", {
1255
+ "d": path
1256
+ }, null)) : vue.createElementVNode("path", {
1257
+ "d": props.icon
1258
+ }, null)])]
1259
+ });
1260
+ };
1261
+ }
1262
+ });
1263
+ defineComponent({
1264
+ name: "VLigatureIcon",
1265
+ props: makeIconProps(),
1266
+ setup(props) {
1267
+ return () => {
1268
+ return vue.createVNode(props.tag, null, {
1269
+ default: () => [props.icon]
1270
+ });
1271
+ };
1272
+ }
1273
+ });
1274
+ defineComponent({
1275
+ name: "VClassIcon",
1276
+ props: makeIconProps(),
1277
+ setup(props) {
1278
+ return () => {
1279
+ return vue.createVNode(props.tag, {
1280
+ "class": vue.normalizeClass(props.icon)
1281
+ }, null);
1282
+ };
1283
+ }
1284
+ });
1285
+ const useIcon = (props) => {
1286
+ const icons = vue.inject(IconSymbol);
1287
+ if (!icons) throw new Error("Missing Vuetify Icons provide!");
1288
+ const iconData = vue.computed(() => {
1289
+ const iconAlias = vue.toValue(props);
1290
+ if (!iconAlias) return {
1291
+ component: VComponentIcon
1292
+ };
1293
+ let icon = iconAlias;
1294
+ if (typeof icon === "string") {
1295
+ icon = icon.trim();
1296
+ if (icon.startsWith("$")) {
1297
+ icon = icons.aliases?.[icon.slice(1)];
1298
+ }
1299
+ }
1300
+ if (!icon) consoleWarn(`Could not find aliased icon "${iconAlias}"`);
1301
+ if (Array.isArray(icon)) {
1302
+ return {
1303
+ component: VSvgIcon,
1304
+ icon
1305
+ };
1306
+ } else if (typeof icon !== "string") {
1307
+ return {
1308
+ component: VComponentIcon,
1309
+ icon
1310
+ };
1311
+ }
1312
+ const iconSetName = Object.keys(icons.sets).find((setName) => typeof icon === "string" && icon.startsWith(`${setName}:`));
1313
+ const iconName = iconSetName ? icon.slice(iconSetName.length + 1) : icon;
1314
+ const iconSet = icons.sets[iconSetName ?? icons.defaultSet];
1315
+ return {
1316
+ component: iconSet.component,
1317
+ icon: iconName
1318
+ };
1319
+ });
1320
+ return {
1321
+ iconData
1322
+ };
1323
+ };
1324
+ const predefinedSizes = ["x-small", "small", "default", "large", "x-large"];
1325
+ const makeSizeProps = propsFactory({
1326
+ size: {
1327
+ type: [String, Number],
1328
+ default: "default"
1329
+ }
1330
+ }, "size");
1331
+ function useSize(props) {
1332
+ let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
1333
+ return destructComputed(() => {
1334
+ const size = props.size;
1335
+ let sizeClasses;
1336
+ let sizeStyles;
1337
+ if (includes(predefinedSizes, size)) {
1338
+ sizeClasses = `${name}--size-${size}`;
1339
+ } else if (size) {
1340
+ sizeStyles = {
1341
+ width: convertToUnit(size),
1342
+ height: convertToUnit(size)
1343
+ };
1344
+ }
1345
+ return {
1346
+ sizeClasses,
1347
+ sizeStyles
1348
+ };
1349
+ });
1350
+ }
1351
+ const makeTagProps = propsFactory({
1352
+ tag: {
1353
+ type: [String, Object, Function],
1354
+ default: "div"
1355
+ }
1356
+ }, "tag");
1357
+ const makeVIconProps = propsFactory({
1358
+ color: String,
1359
+ disabled: Boolean,
1360
+ start: Boolean,
1361
+ end: Boolean,
1362
+ icon: IconValue,
1363
+ opacity: [String, Number],
1364
+ ...makeComponentProps(),
1365
+ ...makeSizeProps(),
1366
+ ...makeTagProps({
1367
+ tag: "i"
1368
+ }),
1369
+ ...makeThemeProps()
1370
+ }, "VIcon");
1371
+ const VIcon = genericComponent()({
1372
+ name: "VIcon",
1373
+ props: makeVIconProps(),
1374
+ setup(props, _ref) {
1375
+ let {
1376
+ attrs,
1377
+ slots
1378
+ } = _ref;
1379
+ const slotIcon = vue.shallowRef();
1380
+ const {
1381
+ themeClasses
1382
+ } = useTheme();
1383
+ const {
1384
+ iconData
1385
+ } = useIcon(() => slotIcon.value || props.icon);
1386
+ const {
1387
+ sizeClasses
1388
+ } = useSize(props);
1389
+ const {
1390
+ textColorClasses,
1391
+ textColorStyles
1392
+ } = useTextColor(() => props.color);
1393
+ useRender(() => {
1394
+ const slotValue = slots.default?.();
1395
+ if (slotValue) {
1396
+ slotIcon.value = flattenFragments(slotValue).filter((node) => node.type === vue.Text && node.children && typeof node.children === "string")[0]?.children;
1397
+ }
1398
+ const hasClick = !!(attrs.onClick || attrs.onClickOnce);
1399
+ return vue.createVNode(iconData.value.component, {
1400
+ "tag": props.tag,
1401
+ "icon": iconData.value.icon,
1402
+ "class": vue.normalizeClass(["v-icon", "notranslate", themeClasses.value, sizeClasses.value, textColorClasses.value, {
1403
+ "v-icon--clickable": hasClick,
1404
+ "v-icon--disabled": props.disabled,
1405
+ "v-icon--start": props.start,
1406
+ "v-icon--end": props.end
1407
+ }, props.class]),
1408
+ "style": vue.normalizeStyle([{
1409
+ "--v-icon-opacity": props.opacity
1410
+ }, !sizeClasses.value ? {
1411
+ fontSize: convertToUnit(props.size),
1412
+ height: convertToUnit(props.size),
1413
+ width: convertToUnit(props.size)
1414
+ } : void 0, textColorStyles.value, props.style]),
1415
+ "role": hasClick ? "button" : void 0,
1416
+ "aria-hidden": !hasClick,
1417
+ "tabindex": hasClick ? props.disabled ? -1 : 0 : void 0
1418
+ }, {
1419
+ default: () => [slotValue]
1420
+ });
1421
+ });
1422
+ return {};
1423
+ }
1424
+ });
1425
+ const makeDimensionProps = propsFactory({
1426
+ height: [Number, String],
1427
+ maxHeight: [Number, String],
1428
+ maxWidth: [Number, String],
1429
+ minHeight: [Number, String],
1430
+ minWidth: [Number, String],
1431
+ width: [Number, String]
1432
+ }, "dimension");
1433
+ function useDimension(props) {
1434
+ const dimensionStyles = vue.computed(() => {
1435
+ const styles = {};
1436
+ const height = convertToUnit(props.height);
1437
+ const maxHeight = convertToUnit(props.maxHeight);
1438
+ const maxWidth = convertToUnit(props.maxWidth);
1439
+ const minHeight = convertToUnit(props.minHeight);
1440
+ const minWidth = convertToUnit(props.minWidth);
1441
+ const width = convertToUnit(props.width);
1442
+ if (height != null) styles.height = height;
1443
+ if (maxHeight != null) styles.maxHeight = maxHeight;
1444
+ if (maxWidth != null) styles.maxWidth = maxWidth;
1445
+ if (minHeight != null) styles.minHeight = minHeight;
1446
+ if (minWidth != null) styles.minWidth = minWidth;
1447
+ if (width != null) styles.width = width;
1448
+ return styles;
1449
+ });
1450
+ return {
1451
+ dimensionStyles
1452
+ };
1453
+ }
1454
+ function useAspectStyles(props) {
1455
+ return {
1456
+ aspectStyles: vue.computed(() => {
1457
+ const ratio = Number(props.aspectRatio);
1458
+ return ratio ? {
1459
+ paddingBottom: String(1 / ratio * 100) + "%"
1460
+ } : void 0;
1461
+ })
1462
+ };
1463
+ }
1464
+ const makeVResponsiveProps = propsFactory({
1465
+ aspectRatio: [String, Number],
1466
+ contentClass: null,
1467
+ inline: Boolean,
1468
+ ...makeComponentProps(),
1469
+ ...makeDimensionProps()
1470
+ }, "VResponsive");
1471
+ const VResponsive = genericComponent()({
1472
+ name: "VResponsive",
1473
+ props: makeVResponsiveProps(),
1474
+ setup(props, _ref) {
1475
+ let {
1476
+ slots
1477
+ } = _ref;
1478
+ const {
1479
+ aspectStyles
1480
+ } = useAspectStyles(props);
1481
+ const {
1482
+ dimensionStyles
1483
+ } = useDimension(props);
1484
+ useRender(() => vue.createElementVNode("div", {
1485
+ "class": vue.normalizeClass(["v-responsive", {
1486
+ "v-responsive--inline": props.inline
1487
+ }, props.class]),
1488
+ "style": vue.normalizeStyle([dimensionStyles.value, props.style])
1489
+ }, [vue.createElementVNode("div", {
1490
+ "class": "v-responsive__sizer",
1491
+ "style": vue.normalizeStyle(aspectStyles.value)
1492
+ }, null), slots.additional?.(), slots.default && vue.createElementVNode("div", {
1493
+ "class": vue.normalizeClass(["v-responsive__content", props.contentClass])
1494
+ }, [slots.default()])]));
1495
+ return {};
1496
+ }
1497
+ });
1498
+ const makeRoundedProps = propsFactory({
1499
+ rounded: {
1500
+ type: [Boolean, Number, String],
1501
+ default: void 0
1502
+ },
1503
+ tile: Boolean
1504
+ }, "rounded");
1505
+ function useRounded(props) {
1506
+ let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
1507
+ const roundedClasses = vue.computed(() => {
1508
+ const rounded = vue.isRef(props) ? props.value : props.rounded;
1509
+ const tile = vue.isRef(props) ? false : props.tile;
1510
+ const classes = [];
1511
+ if (tile || rounded === false) {
1512
+ classes.push("rounded-0");
1513
+ } else if (rounded === true || rounded === "") {
1514
+ classes.push(`${name}--rounded`);
1515
+ } else if (typeof rounded === "string" || rounded === 0) {
1516
+ for (const value of String(rounded).split(" ")) {
1517
+ classes.push(`rounded-${value}`);
1518
+ }
1519
+ }
1520
+ return classes;
1521
+ });
1522
+ return {
1523
+ roundedClasses
1524
+ };
1525
+ }
1526
+ const makeTransitionProps = propsFactory({
1527
+ transition: {
1528
+ type: null,
1529
+ default: "fade-transition",
1530
+ validator: (val) => val !== true
1531
+ }
1532
+ }, "transition");
1533
+ const MaybeTransition = (props, _ref) => {
1534
+ let {
1535
+ slots
1536
+ } = _ref;
1537
+ const {
1538
+ transition,
1539
+ disabled,
1540
+ group,
1541
+ ...rest
1542
+ } = props;
1543
+ const {
1544
+ component = group ? vue.TransitionGroup : vue.Transition,
1545
+ ...customProps
1546
+ } = isObject(transition) ? transition : {};
1547
+ let transitionProps;
1548
+ if (isObject(transition)) {
1549
+ transitionProps = vue.mergeProps(customProps, onlyDefinedProps({
1550
+ disabled,
1551
+ group
1552
+ }), rest);
1553
+ } else {
1554
+ transitionProps = vue.mergeProps({
1555
+ name: disabled || !transition ? "" : transition
1556
+ }, rest);
1557
+ }
1558
+ return vue.h(component, transitionProps, slots);
1559
+ };
1560
+ function mounted$1(el, binding) {
1561
+ if (!SUPPORTS_INTERSECTION) return;
1562
+ const modifiers = binding.modifiers || {};
1563
+ const value = binding.value;
1564
+ const {
1565
+ handler,
1566
+ options
1567
+ } = typeof value === "object" ? value : {
1568
+ handler: value,
1569
+ options: {}
1570
+ };
1571
+ const observer = new IntersectionObserver(function() {
1572
+ let entries = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
1573
+ let observer2 = arguments.length > 1 ? arguments[1] : void 0;
1574
+ const _observe = el._observe?.[binding.instance.$.uid];
1575
+ if (!_observe) return;
1576
+ const isIntersecting = entries.some((entry) => entry.isIntersecting);
1577
+ if (handler && (!modifiers.quiet || _observe.init) && (!modifiers.once || isIntersecting || _observe.init)) {
1578
+ handler(isIntersecting, entries, observer2);
1579
+ }
1580
+ if (isIntersecting && modifiers.once) unmounted$1(el, binding);
1581
+ else _observe.init = true;
1582
+ }, options);
1583
+ el._observe = Object(el._observe);
1584
+ el._observe[binding.instance.$.uid] = {
1585
+ init: false,
1586
+ observer
1587
+ };
1588
+ observer.observe(el);
1589
+ }
1590
+ function unmounted$1(el, binding) {
1591
+ const observe = el._observe?.[binding.instance.$.uid];
1592
+ if (!observe) return;
1593
+ observe.observer.unobserve(el);
1594
+ delete el._observe[binding.instance.$.uid];
1595
+ }
1596
+ const Intersect = {
1597
+ mounted: mounted$1,
1598
+ unmounted: unmounted$1
1599
+ };
1600
+ const makeVImgProps = propsFactory({
1601
+ absolute: Boolean,
1602
+ alt: String,
1603
+ cover: Boolean,
1604
+ color: String,
1605
+ draggable: {
1606
+ type: [Boolean, String],
1607
+ default: void 0
1608
+ },
1609
+ eager: Boolean,
1610
+ gradient: String,
1611
+ lazySrc: String,
1612
+ options: {
1613
+ type: Object,
1614
+ // For more information on types, navigate to:
1615
+ // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
1616
+ default: () => ({
1617
+ root: void 0,
1618
+ rootMargin: void 0,
1619
+ threshold: void 0
1620
+ })
1621
+ },
1622
+ sizes: String,
1623
+ src: {
1624
+ type: [String, Object],
1625
+ default: ""
1626
+ },
1627
+ crossorigin: String,
1628
+ referrerpolicy: String,
1629
+ srcset: String,
1630
+ position: String,
1631
+ ...makeVResponsiveProps(),
1632
+ ...makeComponentProps(),
1633
+ ...makeRoundedProps(),
1634
+ ...makeTransitionProps()
1635
+ }, "VImg");
1636
+ const VImg = genericComponent()({
1637
+ name: "VImg",
1638
+ directives: {
1639
+ vIntersect: Intersect
1640
+ },
1641
+ props: makeVImgProps(),
1642
+ emits: {
1643
+ loadstart: (value) => true,
1644
+ load: (value) => true,
1645
+ error: (value) => true
1646
+ },
1647
+ setup(props, _ref) {
1648
+ let {
1649
+ emit,
1650
+ slots
1651
+ } = _ref;
1652
+ const {
1653
+ backgroundColorClasses,
1654
+ backgroundColorStyles
1655
+ } = useBackgroundColor(() => props.color);
1656
+ const {
1657
+ roundedClasses
1658
+ } = useRounded(props);
1659
+ const vm = getCurrentInstance("VImg");
1660
+ const currentSrc = vue.shallowRef("");
1661
+ const image = vue.ref();
1662
+ const state = vue.shallowRef(props.eager ? "loading" : "idle");
1663
+ const naturalWidth = vue.shallowRef();
1664
+ const naturalHeight = vue.shallowRef();
1665
+ const normalisedSrc = vue.computed(() => {
1666
+ return props.src && typeof props.src === "object" ? {
1667
+ src: props.src.src,
1668
+ srcset: props.srcset || props.src.srcset,
1669
+ lazySrc: props.lazySrc || props.src.lazySrc,
1670
+ aspect: Number(props.aspectRatio || props.src.aspect || 0)
1671
+ } : {
1672
+ src: props.src,
1673
+ srcset: props.srcset,
1674
+ lazySrc: props.lazySrc,
1675
+ aspect: Number(props.aspectRatio || 0)
1676
+ };
1677
+ });
1678
+ const aspectRatio = vue.computed(() => {
1679
+ return normalisedSrc.value.aspect || naturalWidth.value / naturalHeight.value || 0;
1680
+ });
1681
+ vue.watch(() => props.src, () => {
1682
+ init(state.value !== "idle");
1683
+ });
1684
+ vue.watch(aspectRatio, (val, oldVal) => {
1685
+ if (!val && oldVal && image.value) {
1686
+ pollForSize(image.value);
1687
+ }
1688
+ });
1689
+ vue.onBeforeMount(() => init());
1690
+ function init(isIntersecting) {
1691
+ if (props.eager && isIntersecting) return;
1692
+ if (SUPPORTS_INTERSECTION && !isIntersecting && !props.eager) return;
1693
+ state.value = "loading";
1694
+ if (normalisedSrc.value.lazySrc) {
1695
+ const lazyImg = new Image();
1696
+ lazyImg.src = normalisedSrc.value.lazySrc;
1697
+ pollForSize(lazyImg, null);
1698
+ }
1699
+ if (!normalisedSrc.value.src) return;
1700
+ vue.nextTick(() => {
1701
+ emit("loadstart", image.value?.currentSrc || normalisedSrc.value.src);
1702
+ setTimeout(() => {
1703
+ if (vm.isUnmounted) return;
1704
+ if (image.value?.complete) {
1705
+ if (!image.value.naturalWidth) {
1706
+ onError();
1707
+ }
1708
+ if (state.value === "error") return;
1709
+ if (!aspectRatio.value) pollForSize(image.value, null);
1710
+ if (state.value === "loading") onLoad();
1711
+ } else {
1712
+ if (!aspectRatio.value) pollForSize(image.value);
1713
+ getSrc();
1714
+ }
1715
+ });
1716
+ });
1717
+ }
1718
+ function onLoad() {
1719
+ if (vm.isUnmounted) return;
1720
+ getSrc();
1721
+ pollForSize(image.value);
1722
+ state.value = "loaded";
1723
+ emit("load", image.value?.currentSrc || normalisedSrc.value.src);
1724
+ }
1725
+ function onError() {
1726
+ if (vm.isUnmounted) return;
1727
+ state.value = "error";
1728
+ emit("error", image.value?.currentSrc || normalisedSrc.value.src);
1729
+ }
1730
+ function getSrc() {
1731
+ const img = image.value;
1732
+ if (img) currentSrc.value = img.currentSrc || img.src;
1733
+ }
1734
+ let timer = -1;
1735
+ vue.onBeforeUnmount(() => {
1736
+ clearTimeout(timer);
1737
+ });
1738
+ function pollForSize(img) {
1739
+ let timeout = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100;
1740
+ const poll = () => {
1741
+ clearTimeout(timer);
1742
+ if (vm.isUnmounted) return;
1743
+ const {
1744
+ naturalHeight: imgHeight,
1745
+ naturalWidth: imgWidth
1746
+ } = img;
1747
+ if (imgHeight || imgWidth) {
1748
+ naturalWidth.value = imgWidth;
1749
+ naturalHeight.value = imgHeight;
1750
+ } else if (!img.complete && state.value === "loading" && timeout != null) {
1751
+ timer = window.setTimeout(poll, timeout);
1752
+ } else if (img.currentSrc.endsWith(".svg") || img.currentSrc.startsWith("data:image/svg+xml")) {
1753
+ naturalWidth.value = 1;
1754
+ naturalHeight.value = 1;
1755
+ }
1756
+ };
1757
+ poll();
1758
+ }
1759
+ const containClasses = vue.toRef(() => ({
1760
+ "v-img__img--cover": props.cover,
1761
+ "v-img__img--contain": !props.cover
1762
+ }));
1763
+ const __image = () => {
1764
+ if (!normalisedSrc.value.src || state.value === "idle") return null;
1765
+ const img = vue.createElementVNode("img", {
1766
+ "class": vue.normalizeClass(["v-img__img", containClasses.value]),
1767
+ "style": {
1768
+ objectPosition: props.position
1769
+ },
1770
+ "crossorigin": props.crossorigin,
1771
+ "src": normalisedSrc.value.src,
1772
+ "srcset": normalisedSrc.value.srcset,
1773
+ "alt": props.alt,
1774
+ "referrerpolicy": props.referrerpolicy,
1775
+ "draggable": props.draggable,
1776
+ "sizes": props.sizes,
1777
+ "ref": image,
1778
+ "onLoad": onLoad,
1779
+ "onError": onError
1780
+ }, null);
1781
+ const sources = slots.sources?.();
1782
+ return vue.createVNode(MaybeTransition, {
1783
+ "transition": props.transition,
1784
+ "appear": true
1785
+ }, {
1786
+ default: () => [vue.withDirectives(sources ? vue.createElementVNode("picture", {
1787
+ "class": "v-img__picture"
1788
+ }, [sources, img]) : img, [[vue.vShow, state.value === "loaded"]])]
1789
+ });
1790
+ };
1791
+ const __preloadImage = () => vue.createVNode(MaybeTransition, {
1792
+ "transition": props.transition
1793
+ }, {
1794
+ default: () => [normalisedSrc.value.lazySrc && state.value !== "loaded" && vue.createElementVNode("img", {
1795
+ "class": vue.normalizeClass(["v-img__img", "v-img__img--preload", containClasses.value]),
1796
+ "style": {
1797
+ objectPosition: props.position
1798
+ },
1799
+ "crossorigin": props.crossorigin,
1800
+ "src": normalisedSrc.value.lazySrc,
1801
+ "alt": props.alt,
1802
+ "referrerpolicy": props.referrerpolicy,
1803
+ "draggable": props.draggable
1804
+ }, null)]
1805
+ });
1806
+ const __placeholder = () => {
1807
+ if (!slots.placeholder) return null;
1808
+ return vue.createVNode(MaybeTransition, {
1809
+ "transition": props.transition,
1810
+ "appear": true
1811
+ }, {
1812
+ default: () => [(state.value === "loading" || state.value === "error" && !slots.error) && vue.createElementVNode("div", {
1813
+ "class": "v-img__placeholder"
1814
+ }, [slots.placeholder()])]
1815
+ });
1816
+ };
1817
+ const __error = () => {
1818
+ if (!slots.error) return null;
1819
+ return vue.createVNode(MaybeTransition, {
1820
+ "transition": props.transition,
1821
+ "appear": true
1822
+ }, {
1823
+ default: () => [state.value === "error" && vue.createElementVNode("div", {
1824
+ "class": "v-img__error"
1825
+ }, [slots.error()])]
1826
+ });
1827
+ };
1828
+ const __gradient = () => {
1829
+ if (!props.gradient) return null;
1830
+ return vue.createElementVNode("div", {
1831
+ "class": "v-img__gradient",
1832
+ "style": {
1833
+ backgroundImage: `linear-gradient(${props.gradient})`
1834
+ }
1835
+ }, null);
1836
+ };
1837
+ const isBooted = vue.shallowRef(false);
1838
+ {
1839
+ const stop = vue.watch(aspectRatio, (val) => {
1840
+ if (val) {
1841
+ requestAnimationFrame(() => {
1842
+ requestAnimationFrame(() => {
1843
+ isBooted.value = true;
1844
+ });
1845
+ });
1846
+ stop();
1847
+ }
1848
+ });
1849
+ }
1850
+ useRender(() => {
1851
+ const responsiveProps = VResponsive.filterProps(props);
1852
+ return vue.withDirectives(vue.createVNode(VResponsive, vue.mergeProps({
1853
+ "class": ["v-img", {
1854
+ "v-img--absolute": props.absolute,
1855
+ "v-img--booting": !isBooted.value
1856
+ }, backgroundColorClasses.value, roundedClasses.value, props.class],
1857
+ "style": [{
1858
+ width: convertToUnit(props.width === "auto" ? naturalWidth.value : props.width)
1859
+ }, backgroundColorStyles.value, props.style]
1860
+ }, responsiveProps, {
1861
+ "aspectRatio": aspectRatio.value,
1862
+ "aria-label": props.alt,
1863
+ "role": props.alt ? "img" : void 0
1864
+ }), {
1865
+ additional: () => vue.createElementVNode(vue.Fragment, null, [vue.createVNode(__image, null, null), vue.createVNode(__preloadImage, null, null), vue.createVNode(__gradient, null, null), vue.createVNode(__placeholder, null, null), vue.createVNode(__error, null, null)]),
1866
+ default: slots.default
1867
+ }), [[Intersect, {
1868
+ handler: init,
1869
+ options: props.options
1870
+ }, null, {
1871
+ once: true
1872
+ }]]);
1873
+ });
1874
+ return {
1875
+ currentSrc,
1876
+ image,
1877
+ state,
1878
+ naturalWidth,
1879
+ naturalHeight
1880
+ };
1881
+ }
1882
+ });
1883
+ const makeBorderProps = propsFactory({
1884
+ border: [Boolean, Number, String]
1885
+ }, "border");
1886
+ function useBorder(props) {
1887
+ let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
1888
+ const borderClasses = vue.computed(() => {
1889
+ const border = props.border;
1890
+ if (border === true || border === "") {
1891
+ return `${name}--border`;
1892
+ } else if (typeof border === "string" || border === 0) {
1893
+ return String(border).split(" ").map((v) => `border-${v}`);
1894
+ }
1895
+ return [];
1896
+ });
1897
+ return {
1898
+ borderClasses
1899
+ };
1900
+ }
1901
+ const allowedDensities = [null, "default", "comfortable", "compact"];
1902
+ const makeDensityProps = propsFactory({
1903
+ density: {
1904
+ type: String,
1905
+ default: "default",
1906
+ validator: (v) => allowedDensities.includes(v)
1907
+ }
1908
+ }, "density");
1909
+ function useDensity(props) {
1910
+ let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
1911
+ const densityClasses = vue.toRef(() => {
1912
+ return `${name}--density-${props.density}`;
1913
+ });
1914
+ return {
1915
+ densityClasses
1916
+ };
1917
+ }
1918
+ const allowedVariants = ["elevated", "flat", "tonal", "outlined", "text", "plain"];
1919
+ function genOverlays(isClickable, name) {
1920
+ return vue.createElementVNode(vue.Fragment, null, [isClickable && vue.createElementVNode("span", {
1921
+ "key": "overlay",
1922
+ "class": vue.normalizeClass(`${name}__overlay`)
1923
+ }, null), vue.createElementVNode("span", {
1924
+ "key": "underlay",
1925
+ "class": vue.normalizeClass(`${name}__underlay`)
1926
+ }, null)]);
1927
+ }
1928
+ const makeVariantProps = propsFactory({
1929
+ color: String,
1930
+ variant: {
1931
+ type: String,
1932
+ default: "elevated",
1933
+ validator: (v) => allowedVariants.includes(v)
1934
+ }
1935
+ }, "variant");
1936
+ function useVariant(props) {
1937
+ let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
1938
+ const variantClasses = vue.toRef(() => {
1939
+ const {
1940
+ variant
1941
+ } = vue.toValue(props);
1942
+ return `${name}--variant-${variant}`;
1943
+ });
1944
+ const {
1945
+ colorClasses,
1946
+ colorStyles
1947
+ } = useColor(() => {
1948
+ const {
1949
+ variant,
1950
+ color
1951
+ } = vue.toValue(props);
1952
+ return {
1953
+ [["elevated", "flat"].includes(variant) ? "background" : "text"]: color
1954
+ };
1955
+ });
1956
+ return {
1957
+ colorClasses,
1958
+ colorStyles,
1959
+ variantClasses
1960
+ };
1961
+ }
1962
+ const makeVAvatarProps = propsFactory({
1963
+ start: Boolean,
1964
+ end: Boolean,
1965
+ icon: IconValue,
1966
+ image: String,
1967
+ text: String,
1968
+ ...makeBorderProps(),
1969
+ ...makeComponentProps(),
1970
+ ...makeDensityProps(),
1971
+ ...makeRoundedProps(),
1972
+ ...makeSizeProps(),
1973
+ ...makeTagProps(),
1974
+ ...makeThemeProps(),
1975
+ ...makeVariantProps({
1976
+ variant: "flat"
1977
+ })
1978
+ }, "VAvatar");
1979
+ const VAvatar = genericComponent()({
1980
+ name: "VAvatar",
1981
+ props: makeVAvatarProps(),
1982
+ setup(props, _ref) {
1983
+ let {
1984
+ slots
1985
+ } = _ref;
1986
+ const {
1987
+ themeClasses
1988
+ } = provideTheme(props);
1989
+ const {
1990
+ borderClasses
1991
+ } = useBorder(props);
1992
+ const {
1993
+ colorClasses,
1994
+ colorStyles,
1995
+ variantClasses
1996
+ } = useVariant(props);
1997
+ const {
1998
+ densityClasses
1999
+ } = useDensity(props);
2000
+ const {
2001
+ roundedClasses
2002
+ } = useRounded(props);
2003
+ const {
2004
+ sizeClasses,
2005
+ sizeStyles
2006
+ } = useSize(props);
2007
+ useRender(() => vue.createVNode(props.tag, {
2008
+ "class": vue.normalizeClass(["v-avatar", {
2009
+ "v-avatar--start": props.start,
2010
+ "v-avatar--end": props.end
2011
+ }, themeClasses.value, borderClasses.value, colorClasses.value, densityClasses.value, roundedClasses.value, sizeClasses.value, variantClasses.value, props.class]),
2012
+ "style": vue.normalizeStyle([colorStyles.value, sizeStyles.value, props.style])
2013
+ }, {
2014
+ default: () => [!slots.default ? props.image ? vue.createVNode(VImg, {
2015
+ "key": "image",
2016
+ "src": props.image,
2017
+ "alt": "",
2018
+ "cover": true
2019
+ }, null) : props.icon ? vue.createVNode(VIcon, {
2020
+ "key": "icon",
2021
+ "icon": props.icon
2022
+ }, null) : props.text : vue.createVNode(VDefaultsProvider, {
2023
+ "key": "content-defaults",
2024
+ "defaults": {
2025
+ VImg: {
2026
+ cover: true,
2027
+ src: props.image
2028
+ },
2029
+ VIcon: {
2030
+ icon: props.icon
2031
+ }
2032
+ }
2033
+ }, {
2034
+ default: () => [slots.default()]
2035
+ }), genOverlays(false, "v-avatar")]
2036
+ }));
2037
+ return {};
2038
+ }
2039
+ });
2040
+ const DisplaySymbol = /* @__PURE__ */ Symbol.for("vuetify:display");
2041
+ const makeDisplayProps = propsFactory({
2042
+ mobile: {
2043
+ type: Boolean,
2044
+ default: false
2045
+ },
2046
+ mobileBreakpoint: [Number, String]
2047
+ }, "display");
2048
+ function useDisplay() {
2049
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
2050
+ mobile: null
2051
+ };
2052
+ let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
2053
+ const display = vue.inject(DisplaySymbol);
2054
+ if (!display) throw new Error("Could not find Vuetify display injection");
2055
+ const mobile = vue.computed(() => {
2056
+ if (props.mobile) {
2057
+ return true;
2058
+ } else if (typeof props.mobileBreakpoint === "number") {
2059
+ return display.width.value < props.mobileBreakpoint;
2060
+ } else if (props.mobileBreakpoint) {
2061
+ return display.width.value < display.thresholds.value[props.mobileBreakpoint];
2062
+ } else if (props.mobile === null) {
2063
+ return display.mobile.value;
2064
+ } else {
2065
+ return false;
2066
+ }
2067
+ });
2068
+ const displayClasses = vue.toRef(() => {
2069
+ if (!name) return {};
2070
+ return {
2071
+ [`${name}--mobile`]: mobile.value
2072
+ };
2073
+ });
2074
+ return {
2075
+ ...display,
2076
+ displayClasses,
2077
+ mobile
2078
+ };
2079
+ }
2080
+ const makeElevationProps = propsFactory({
2081
+ elevation: {
2082
+ type: [Number, String],
2083
+ validator(v) {
2084
+ const value = parseInt(v);
2085
+ return !isNaN(value) && value >= 0 && // Material Design has a maximum elevation of 24
2086
+ // https://material.io/design/environment/elevation.html#default-elevations
2087
+ value <= 24;
2088
+ }
2089
+ }
2090
+ }, "elevation");
2091
+ function useElevation(props) {
2092
+ const elevationClasses = vue.toRef(() => {
2093
+ const elevation = vue.isRef(props) ? props.value : props.elevation;
2094
+ if (elevation == null) return [];
2095
+ return [`elevation-${elevation}`];
2096
+ });
2097
+ return {
2098
+ elevationClasses
2099
+ };
2100
+ }
2101
+ const oppositeMap = {
2102
+ center: "center",
2103
+ top: "bottom",
2104
+ bottom: "top",
2105
+ left: "right",
2106
+ right: "left"
2107
+ };
2108
+ const makeLocationProps = propsFactory({
2109
+ location: String
2110
+ }, "location");
2111
+ function useLocation(props) {
2112
+ let opposite = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
2113
+ let offset = arguments.length > 2 ? arguments[2] : void 0;
2114
+ const {
2115
+ isRtl
2116
+ } = useRtl();
2117
+ const locationStyles = vue.computed(() => {
2118
+ if (!props.location) return {};
2119
+ const {
2120
+ side,
2121
+ align
2122
+ } = parseAnchor(props.location.split(" ").length > 1 ? props.location : `${props.location} center`, isRtl.value);
2123
+ function getOffset(side2) {
2124
+ return offset ? offset(side2) : 0;
2125
+ }
2126
+ const styles = {};
2127
+ if (side !== "center") {
2128
+ if (opposite) styles[oppositeMap[side]] = `calc(100% - ${getOffset(side)}px)`;
2129
+ else styles[side] = 0;
2130
+ }
2131
+ if (align !== "center") {
2132
+ if (opposite) styles[oppositeMap[align]] = `calc(100% - ${getOffset(align)}px)`;
2133
+ else styles[align] = 0;
2134
+ } else {
2135
+ if (side === "center") styles.top = styles.left = "50%";
2136
+ else {
2137
+ styles[{
2138
+ top: "left",
2139
+ bottom: "left",
2140
+ left: "top",
2141
+ right: "top"
2142
+ }[side]] = "50%";
2143
+ }
2144
+ styles.transform = {
2145
+ top: "translateX(-50%)",
2146
+ bottom: "translateX(-50%)",
2147
+ left: "translateY(-50%)",
2148
+ right: "translateY(-50%)",
2149
+ center: "translate(-50%, -50%)"
2150
+ }[side];
2151
+ }
2152
+ return styles;
2153
+ });
2154
+ return {
2155
+ locationStyles
2156
+ };
2157
+ }
2158
+ const positionValues = ["static", "relative", "fixed", "absolute", "sticky"];
2159
+ const makePositionProps = propsFactory({
2160
+ position: {
2161
+ type: String,
2162
+ validator: (
2163
+ /* istanbul ignore next */
2164
+ (v) => positionValues.includes(v)
2165
+ )
2166
+ }
2167
+ }, "position");
2168
+ function usePosition(props) {
2169
+ let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
2170
+ const positionClasses = vue.toRef(() => {
2171
+ return props.position ? `${name}--${props.position}` : void 0;
2172
+ });
2173
+ return {
2174
+ positionClasses
2175
+ };
2176
+ }
2177
+ const makeVBannerProps = propsFactory({
2178
+ avatar: String,
2179
+ bgColor: String,
2180
+ color: String,
2181
+ icon: IconValue,
2182
+ lines: String,
2183
+ stacked: Boolean,
2184
+ sticky: Boolean,
2185
+ text: String,
2186
+ ...makeBorderProps(),
2187
+ ...makeComponentProps(),
2188
+ ...makeDensityProps(),
2189
+ ...makeDimensionProps(),
2190
+ ...makeDisplayProps({
2191
+ mobile: null
2192
+ }),
2193
+ ...makeElevationProps(),
2194
+ ...makeLocationProps(),
2195
+ ...makePositionProps(),
2196
+ ...makeRoundedProps(),
2197
+ ...makeTagProps(),
2198
+ ...makeThemeProps()
2199
+ }, "VBanner");
2200
+ const VBanner = genericComponent()({
2201
+ name: "VBanner",
2202
+ props: makeVBannerProps(),
2203
+ setup(props, _ref) {
2204
+ let {
2205
+ slots
2206
+ } = _ref;
2207
+ const {
2208
+ backgroundColorClasses,
2209
+ backgroundColorStyles
2210
+ } = useBackgroundColor(() => props.bgColor);
2211
+ const {
2212
+ borderClasses
2213
+ } = useBorder(props);
2214
+ const {
2215
+ densityClasses
2216
+ } = useDensity(props);
2217
+ const {
2218
+ displayClasses,
2219
+ mobile
2220
+ } = useDisplay(props);
2221
+ const {
2222
+ dimensionStyles
2223
+ } = useDimension(props);
2224
+ const {
2225
+ elevationClasses
2226
+ } = useElevation(props);
2227
+ const {
2228
+ locationStyles
2229
+ } = useLocation(props);
2230
+ const {
2231
+ positionClasses
2232
+ } = usePosition(props);
2233
+ const {
2234
+ roundedClasses
2235
+ } = useRounded(props);
2236
+ const {
2237
+ themeClasses
2238
+ } = provideTheme(props);
2239
+ const color = vue.toRef(() => props.color);
2240
+ const density = vue.toRef(() => props.density);
2241
+ provideDefaults({
2242
+ VBannerActions: {
2243
+ color,
2244
+ density
2245
+ }
2246
+ });
2247
+ useRender(() => {
2248
+ const hasText = !!(props.text || slots.text);
2249
+ const hasPrependMedia = !!(props.avatar || props.icon);
2250
+ const hasPrepend = !!(hasPrependMedia || slots.prepend);
2251
+ return vue.createVNode(props.tag, {
2252
+ "class": vue.normalizeClass(["v-banner", {
2253
+ "v-banner--stacked": props.stacked || mobile.value,
2254
+ "v-banner--sticky": props.sticky,
2255
+ [`v-banner--${props.lines}-line`]: !!props.lines
2256
+ }, themeClasses.value, backgroundColorClasses.value, borderClasses.value, densityClasses.value, displayClasses.value, elevationClasses.value, positionClasses.value, roundedClasses.value, props.class]),
2257
+ "style": vue.normalizeStyle([backgroundColorStyles.value, dimensionStyles.value, locationStyles.value, props.style]),
2258
+ "role": "banner"
2259
+ }, {
2260
+ default: () => [hasPrepend && vue.createElementVNode("div", {
2261
+ "key": "prepend",
2262
+ "class": "v-banner__prepend"
2263
+ }, [!slots.prepend ? vue.createVNode(VAvatar, {
2264
+ "key": "prepend-avatar",
2265
+ "color": color.value,
2266
+ "density": density.value,
2267
+ "icon": props.icon,
2268
+ "image": props.avatar
2269
+ }, null) : vue.createVNode(VDefaultsProvider, {
2270
+ "key": "prepend-defaults",
2271
+ "disabled": !hasPrependMedia,
2272
+ "defaults": {
2273
+ VAvatar: {
2274
+ color: color.value,
2275
+ density: density.value,
2276
+ icon: props.icon,
2277
+ image: props.avatar
2278
+ }
2279
+ }
2280
+ }, slots.prepend)]), vue.createElementVNode("div", {
2281
+ "class": "v-banner__content"
2282
+ }, [hasText && vue.createVNode(VBannerText, {
2283
+ "key": "text"
2284
+ }, {
2285
+ default: () => [slots.text?.() ?? props.text]
2286
+ }), slots.default?.()]), slots.actions && vue.createVNode(VBannerActions, {
2287
+ "key": "actions"
2288
+ }, slots.actions)]
2289
+ });
2290
+ });
2291
+ }
2292
+ });
2293
+ const makeVBtnGroupProps = propsFactory({
2294
+ baseColor: String,
2295
+ divided: Boolean,
2296
+ direction: {
2297
+ type: String,
2298
+ default: "horizontal"
2299
+ },
2300
+ ...makeBorderProps(),
2301
+ ...makeComponentProps(),
2302
+ ...makeDensityProps(),
2303
+ ...makeElevationProps(),
2304
+ ...makeRoundedProps(),
2305
+ ...makeTagProps(),
2306
+ ...makeThemeProps(),
2307
+ ...makeVariantProps()
2308
+ }, "VBtnGroup");
2309
+ const VBtnGroup = genericComponent()({
2310
+ name: "VBtnGroup",
2311
+ props: makeVBtnGroupProps(),
2312
+ setup(props, _ref) {
2313
+ let {
2314
+ slots
2315
+ } = _ref;
2316
+ const {
2317
+ themeClasses
2318
+ } = provideTheme(props);
2319
+ const {
2320
+ densityClasses
2321
+ } = useDensity(props);
2322
+ const {
2323
+ borderClasses
2324
+ } = useBorder(props);
2325
+ const {
2326
+ elevationClasses
2327
+ } = useElevation(props);
2328
+ const {
2329
+ roundedClasses
2330
+ } = useRounded(props);
2331
+ provideDefaults({
2332
+ VBtn: {
2333
+ height: vue.toRef(() => props.direction === "horizontal" ? "auto" : null),
2334
+ baseColor: vue.toRef(() => props.baseColor),
2335
+ color: vue.toRef(() => props.color),
2336
+ density: vue.toRef(() => props.density),
2337
+ flat: true,
2338
+ variant: vue.toRef(() => props.variant)
2339
+ }
2340
+ });
2341
+ useRender(() => {
2342
+ return vue.createVNode(props.tag, {
2343
+ "class": vue.normalizeClass(["v-btn-group", `v-btn-group--${props.direction}`, {
2344
+ "v-btn-group--divided": props.divided
2345
+ }, themeClasses.value, borderClasses.value, densityClasses.value, elevationClasses.value, roundedClasses.value, props.class]),
2346
+ "style": vue.normalizeStyle(props.style)
2347
+ }, slots);
2348
+ });
2349
+ }
2350
+ });
2351
+ const makeGroupProps = propsFactory({
2352
+ modelValue: {
2353
+ type: null,
2354
+ default: void 0
2355
+ },
2356
+ multiple: Boolean,
2357
+ mandatory: [Boolean, String],
2358
+ max: Number,
2359
+ selectedClass: String,
2360
+ disabled: Boolean
2361
+ }, "group");
2362
+ const makeGroupItemProps = propsFactory({
2363
+ value: null,
2364
+ disabled: Boolean,
2365
+ selectedClass: String
2366
+ }, "group-item");
2367
+ function useGroupItem(props, injectKey) {
2368
+ let required = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
2369
+ const vm = getCurrentInstance("useGroupItem");
2370
+ if (!vm) {
2371
+ throw new Error("[Vuetify] useGroupItem composable must be used inside a component setup function");
2372
+ }
2373
+ const id = vue.useId();
2374
+ vue.provide(/* @__PURE__ */ Symbol.for(`${injectKey.description}:id`), id);
2375
+ const group = vue.inject(injectKey, null);
2376
+ if (!group) {
2377
+ if (!required) return group;
2378
+ throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${injectKey.description}`);
2379
+ }
2380
+ const value = vue.toRef(() => props.value);
2381
+ const disabled = vue.computed(() => !!(group.disabled.value || props.disabled));
2382
+ function register() {
2383
+ group?.register({
2384
+ id,
2385
+ value,
2386
+ disabled
2387
+ }, vm);
2388
+ }
2389
+ function unregister() {
2390
+ group?.unregister(id);
2391
+ }
2392
+ register();
2393
+ vue.onBeforeUnmount(() => unregister());
2394
+ const isSelected = vue.computed(() => {
2395
+ return group.isSelected(id);
2396
+ });
2397
+ const isFirst = vue.computed(() => {
2398
+ return group.items.value[0].id === id;
2399
+ });
2400
+ const isLast = vue.computed(() => {
2401
+ return group.items.value[group.items.value.length - 1].id === id;
2402
+ });
2403
+ const selectedClass = vue.computed(() => isSelected.value && [group.selectedClass.value, props.selectedClass]);
2404
+ vue.watch(isSelected, (value2) => {
2405
+ vm.emit("group:selected", {
2406
+ value: value2
2407
+ });
2408
+ }, {
2409
+ flush: "sync"
2410
+ });
2411
+ return {
2412
+ id,
2413
+ isSelected,
2414
+ isFirst,
2415
+ isLast,
2416
+ toggle: () => group.select(id, !isSelected.value),
2417
+ select: (value2) => group.select(id, value2),
2418
+ selectedClass,
2419
+ value,
2420
+ disabled,
2421
+ group,
2422
+ register,
2423
+ unregister
2424
+ };
2425
+ }
2426
+ function useGroup(props, injectKey) {
2427
+ let isUnmounted = false;
2428
+ const items = vue.reactive([]);
2429
+ const selected = useProxiedModel(props, "modelValue", [], (v) => {
2430
+ if (v === void 0) return [];
2431
+ return getIds(items, v === null ? [null] : wrapInArray(v));
2432
+ }, (v) => {
2433
+ const arr = getValues(items, v);
2434
+ return props.multiple ? arr : arr[0];
2435
+ });
2436
+ const groupVm = getCurrentInstance("useGroup");
2437
+ function register(item, vm) {
2438
+ const unwrapped = item;
2439
+ const key = /* @__PURE__ */ Symbol.for(`${injectKey.description}:id`);
2440
+ const children = findChildrenWithProvide(key, groupVm?.vnode);
2441
+ const index = children.indexOf(vm);
2442
+ if (vue.unref(unwrapped.value) === void 0) {
2443
+ unwrapped.value = index;
2444
+ unwrapped.useIndexAsValue = true;
2445
+ }
2446
+ if (index > -1) {
2447
+ items.splice(index, 0, unwrapped);
2448
+ } else {
2449
+ items.push(unwrapped);
2450
+ }
2451
+ }
2452
+ function unregister(id) {
2453
+ if (isUnmounted) return;
2454
+ forceMandatoryValue();
2455
+ const index = items.findIndex((item) => item.id === id);
2456
+ items.splice(index, 1);
2457
+ }
2458
+ function forceMandatoryValue() {
2459
+ const item = items.find((item2) => !item2.disabled);
2460
+ if (item && props.mandatory === "force" && !selected.value.length) {
2461
+ selected.value = [item.id];
2462
+ }
2463
+ }
2464
+ vue.onMounted(() => {
2465
+ forceMandatoryValue();
2466
+ });
2467
+ vue.onBeforeUnmount(() => {
2468
+ isUnmounted = true;
2469
+ });
2470
+ vue.onUpdated(() => {
2471
+ for (let i = 0; i < items.length; i++) {
2472
+ if (items[i].useIndexAsValue) {
2473
+ items[i].value = i;
2474
+ }
2475
+ }
2476
+ });
2477
+ function select(id, value) {
2478
+ const item = items.find((item2) => item2.id === id);
2479
+ if (value && item?.disabled) return;
2480
+ if (props.multiple) {
2481
+ const internalValue = selected.value.slice();
2482
+ const index = internalValue.findIndex((v) => v === id);
2483
+ const isSelected = ~index;
2484
+ value = value ?? !isSelected;
2485
+ if (isSelected && props.mandatory && internalValue.length <= 1) return;
2486
+ if (!isSelected && props.max != null && internalValue.length + 1 > props.max) return;
2487
+ if (index < 0 && value) internalValue.push(id);
2488
+ else if (index >= 0 && !value) internalValue.splice(index, 1);
2489
+ selected.value = internalValue;
2490
+ } else {
2491
+ const isSelected = selected.value.includes(id);
2492
+ if (props.mandatory && isSelected) return;
2493
+ if (!isSelected && !value) return;
2494
+ selected.value = value ?? !isSelected ? [id] : [];
2495
+ }
2496
+ }
2497
+ function step(offset) {
2498
+ if (props.multiple) consoleWarn('This method is not supported when using "multiple" prop');
2499
+ if (!selected.value.length) {
2500
+ const item = items.find((item2) => !item2.disabled);
2501
+ item && (selected.value = [item.id]);
2502
+ } else {
2503
+ const currentId = selected.value[0];
2504
+ const currentIndex = items.findIndex((i) => i.id === currentId);
2505
+ let newIndex = (currentIndex + offset) % items.length;
2506
+ let newItem = items[newIndex];
2507
+ while (newItem.disabled && newIndex !== currentIndex) {
2508
+ newIndex = (newIndex + offset) % items.length;
2509
+ newItem = items[newIndex];
2510
+ }
2511
+ if (newItem.disabled) return;
2512
+ selected.value = [items[newIndex].id];
2513
+ }
2514
+ }
2515
+ const state = {
2516
+ register,
2517
+ unregister,
2518
+ selected,
2519
+ select,
2520
+ disabled: vue.toRef(() => props.disabled),
2521
+ prev: () => step(items.length - 1),
2522
+ next: () => step(1),
2523
+ isSelected: (id) => selected.value.includes(id),
2524
+ selectedClass: vue.toRef(() => props.selectedClass),
2525
+ items: vue.toRef(() => items),
2526
+ getItemIndex: (value) => getItemIndex(items, value)
2527
+ };
2528
+ vue.provide(injectKey, state);
2529
+ return state;
2530
+ }
2531
+ function getItemIndex(items, value) {
2532
+ const ids = getIds(items, [value]);
2533
+ if (!ids.length) return -1;
2534
+ return items.findIndex((item) => item.id === ids[0]);
2535
+ }
2536
+ function getIds(items, modelValue) {
2537
+ const ids = [];
2538
+ modelValue.forEach((value) => {
2539
+ const item = items.find((item2) => deepEqual(value, item2.value));
2540
+ const itemByIndex = items[value];
2541
+ if (item?.value !== void 0) {
2542
+ ids.push(item.id);
2543
+ } else if (itemByIndex?.useIndexAsValue) {
2544
+ ids.push(itemByIndex.id);
2545
+ }
2546
+ });
2547
+ return ids;
2548
+ }
2549
+ function getValues(items, ids) {
2550
+ const values = [];
2551
+ ids.forEach((id) => {
2552
+ const itemIndex = items.findIndex((item) => item.id === id);
2553
+ if (~itemIndex) {
2554
+ const item = items[itemIndex];
2555
+ values.push(item.value !== void 0 ? item.value : itemIndex);
2556
+ }
2557
+ });
2558
+ return values;
2559
+ }
2560
+ const VBtnToggleSymbol = /* @__PURE__ */ Symbol.for("vuetify:v-btn-toggle");
2561
+ const makeVBtnToggleProps = propsFactory({
2562
+ ...makeVBtnGroupProps(),
2563
+ ...makeGroupProps()
2564
+ }, "VBtnToggle");
2565
+ genericComponent()({
2566
+ name: "VBtnToggle",
2567
+ props: makeVBtnToggleProps(),
2568
+ emits: {
2569
+ "update:modelValue": (value) => true
2570
+ },
2571
+ setup(props, _ref) {
2572
+ let {
2573
+ slots
2574
+ } = _ref;
2575
+ const {
2576
+ isSelected,
2577
+ next,
2578
+ prev,
2579
+ select,
2580
+ selected
2581
+ } = useGroup(props, VBtnToggleSymbol);
2582
+ useRender(() => {
2583
+ const btnGroupProps = VBtnGroup.filterProps(props);
2584
+ return vue.createVNode(VBtnGroup, vue.mergeProps({
2585
+ "class": ["v-btn-toggle", props.class]
2586
+ }, btnGroupProps, {
2587
+ "style": props.style
2588
+ }), {
2589
+ default: () => [slots.default?.({
2590
+ isSelected,
2591
+ next,
2592
+ prev,
2593
+ select,
2594
+ selected
2595
+ })]
2596
+ });
2597
+ });
2598
+ return {
2599
+ next,
2600
+ prev,
2601
+ select
2602
+ };
2603
+ }
2604
+ });
2605
+ function useIntersectionObserver(callback, options) {
2606
+ const intersectionRef = vue.ref();
2607
+ const isIntersecting = vue.shallowRef(false);
2608
+ if (SUPPORTS_INTERSECTION) {
2609
+ const observer = new IntersectionObserver((entries) => {
2610
+ isIntersecting.value = !!entries.find((entry) => entry.isIntersecting);
2611
+ }, options);
2612
+ vue.onScopeDispose(() => {
2613
+ observer.disconnect();
2614
+ });
2615
+ vue.watch(intersectionRef, (newValue, oldValue) => {
2616
+ if (oldValue) {
2617
+ observer.unobserve(oldValue);
2618
+ isIntersecting.value = false;
2619
+ }
2620
+ if (newValue) observer.observe(newValue);
2621
+ }, {
2622
+ flush: "post"
2623
+ });
2624
+ }
2625
+ return {
2626
+ intersectionRef,
2627
+ isIntersecting
2628
+ };
2629
+ }
2630
+ const makeVProgressCircularProps = propsFactory({
2631
+ bgColor: String,
2632
+ color: String,
2633
+ indeterminate: [Boolean, String],
2634
+ rounded: Boolean,
2635
+ modelValue: {
2636
+ type: [Number, String],
2637
+ default: 0
2638
+ },
2639
+ rotate: {
2640
+ type: [Number, String],
2641
+ default: 0
2642
+ },
2643
+ width: {
2644
+ type: [Number, String],
2645
+ default: 4
2646
+ },
2647
+ ...makeComponentProps(),
2648
+ ...makeSizeProps(),
2649
+ ...makeTagProps({
2650
+ tag: "div"
2651
+ }),
2652
+ ...makeThemeProps()
2653
+ }, "VProgressCircular");
2654
+ const VProgressCircular = genericComponent()({
2655
+ name: "VProgressCircular",
2656
+ props: makeVProgressCircularProps(),
2657
+ setup(props, _ref) {
2658
+ let {
2659
+ slots
2660
+ } = _ref;
2661
+ const MAGIC_RADIUS_CONSTANT = 20;
2662
+ const CIRCUMFERENCE = 2 * Math.PI * MAGIC_RADIUS_CONSTANT;
2663
+ const root = vue.ref();
2664
+ const {
2665
+ themeClasses
2666
+ } = provideTheme(props);
2667
+ const {
2668
+ sizeClasses,
2669
+ sizeStyles
2670
+ } = useSize(props);
2671
+ const {
2672
+ textColorClasses,
2673
+ textColorStyles
2674
+ } = useTextColor(() => props.color);
2675
+ const {
2676
+ textColorClasses: underlayColorClasses,
2677
+ textColorStyles: underlayColorStyles
2678
+ } = useTextColor(() => props.bgColor);
2679
+ const {
2680
+ intersectionRef,
2681
+ isIntersecting
2682
+ } = useIntersectionObserver();
2683
+ const {
2684
+ resizeRef,
2685
+ contentRect
2686
+ } = useResizeObserver();
2687
+ const normalizedValue = vue.toRef(() => clamp(parseFloat(props.modelValue), 0, 100));
2688
+ const width = vue.toRef(() => Number(props.width));
2689
+ const size = vue.toRef(() => {
2690
+ return sizeStyles.value ? Number(props.size) : contentRect.value ? contentRect.value.width : Math.max(width.value, 32);
2691
+ });
2692
+ const diameter = vue.toRef(() => MAGIC_RADIUS_CONSTANT / (1 - width.value / size.value) * 2);
2693
+ const strokeWidth = vue.toRef(() => width.value / size.value * diameter.value);
2694
+ const strokeDashOffset = vue.toRef(() => {
2695
+ const baseLength = (100 - normalizedValue.value) / 100 * CIRCUMFERENCE;
2696
+ return props.rounded && normalizedValue.value > 0 && normalizedValue.value < 100 ? convertToUnit(Math.min(CIRCUMFERENCE - 0.01, baseLength + strokeWidth.value)) : convertToUnit(baseLength);
2697
+ });
2698
+ const startAngle = vue.computed(() => {
2699
+ const baseAngle = Number(props.rotate);
2700
+ return props.rounded ? baseAngle + strokeWidth.value / 2 / CIRCUMFERENCE * 360 : baseAngle;
2701
+ });
2702
+ vue.watchEffect(() => {
2703
+ intersectionRef.value = root.value;
2704
+ resizeRef.value = root.value;
2705
+ });
2706
+ useRender(() => vue.createVNode(props.tag, {
2707
+ "ref": root,
2708
+ "class": vue.normalizeClass(["v-progress-circular", {
2709
+ "v-progress-circular--indeterminate": !!props.indeterminate,
2710
+ "v-progress-circular--visible": isIntersecting.value,
2711
+ "v-progress-circular--disable-shrink": props.indeterminate && (props.indeterminate === "disable-shrink" || PREFERS_REDUCED_MOTION())
2712
+ }, themeClasses.value, sizeClasses.value, textColorClasses.value, props.class]),
2713
+ "style": vue.normalizeStyle([sizeStyles.value, textColorStyles.value, props.style]),
2714
+ "role": "progressbar",
2715
+ "aria-valuemin": "0",
2716
+ "aria-valuemax": "100",
2717
+ "aria-valuenow": props.indeterminate ? void 0 : normalizedValue.value
2718
+ }, {
2719
+ default: () => [vue.createElementVNode("svg", {
2720
+ "style": {
2721
+ transform: `rotate(calc(-90deg + ${startAngle.value}deg))`
2722
+ },
2723
+ "xmlns": "http://www.w3.org/2000/svg",
2724
+ "viewBox": `0 0 ${diameter.value} ${diameter.value}`
2725
+ }, [vue.createElementVNode("circle", {
2726
+ "class": vue.normalizeClass(["v-progress-circular__underlay", underlayColorClasses.value]),
2727
+ "style": vue.normalizeStyle(underlayColorStyles.value),
2728
+ "fill": "transparent",
2729
+ "cx": "50%",
2730
+ "cy": "50%",
2731
+ "r": MAGIC_RADIUS_CONSTANT,
2732
+ "stroke-width": strokeWidth.value,
2733
+ "stroke-dasharray": CIRCUMFERENCE,
2734
+ "stroke-dashoffset": 0
2735
+ }, null), vue.createElementVNode("circle", {
2736
+ "class": "v-progress-circular__overlay",
2737
+ "fill": "transparent",
2738
+ "cx": "50%",
2739
+ "cy": "50%",
2740
+ "r": MAGIC_RADIUS_CONSTANT,
2741
+ "stroke-width": strokeWidth.value,
2742
+ "stroke-dasharray": CIRCUMFERENCE,
2743
+ "stroke-dashoffset": strokeDashOffset.value,
2744
+ "stroke-linecap": props.rounded ? "round" : void 0
2745
+ }, null)]), slots.default && vue.createElementVNode("div", {
2746
+ "class": "v-progress-circular__content"
2747
+ }, [slots.default({
2748
+ value: normalizedValue.value
2749
+ })])]
2750
+ }));
2751
+ return {};
2752
+ }
2753
+ });
2754
+ const makeLoaderProps = propsFactory({
2755
+ loading: [Boolean, String]
2756
+ }, "loader");
2757
+ function useLoader(props) {
2758
+ let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
2759
+ const loaderClasses = vue.toRef(() => ({
2760
+ [`${name}--loading`]: props.loading
2761
+ }));
2762
+ return {
2763
+ loaderClasses
2764
+ };
2765
+ }
2766
+ function useRoute() {
2767
+ const vm = getCurrentInstance("useRoute");
2768
+ return vue.computed(() => vm?.proxy?.$route);
2769
+ }
2770
+ function useLink(props, attrs) {
2771
+ const RouterLink = vue.resolveDynamicComponent("RouterLink");
2772
+ const isLink = vue.toRef(() => !!(props.href || props.to));
2773
+ const isClickable = vue.computed(() => {
2774
+ return isLink?.value || hasEvent(attrs, "click") || hasEvent(props, "click");
2775
+ });
2776
+ if (typeof RouterLink === "string" || !("useLink" in RouterLink)) {
2777
+ const href2 = vue.toRef(() => props.href);
2778
+ return {
2779
+ isLink,
2780
+ isRouterLink: vue.toRef(() => false),
2781
+ isClickable,
2782
+ href: href2,
2783
+ linkProps: vue.reactive({
2784
+ href: href2
2785
+ })
2786
+ };
2787
+ }
2788
+ const routerLink = RouterLink.useLink({
2789
+ to: vue.toRef(() => props.to || ""),
2790
+ replace: vue.toRef(() => props.replace)
2791
+ });
2792
+ const link = vue.computed(() => props.to ? routerLink : void 0);
2793
+ const route = useRoute();
2794
+ const isActive = vue.computed(() => {
2795
+ if (!link.value) return false;
2796
+ if (!props.exact) return link.value.isActive?.value ?? false;
2797
+ if (!route.value) return link.value.isExactActive?.value ?? false;
2798
+ return link.value.isExactActive?.value && deepEqual(link.value.route.value.query, route.value.query);
2799
+ });
2800
+ const href = vue.computed(() => props.to ? link.value?.route.value.href : props.href);
2801
+ const isRouterLink = vue.toRef(() => !!props.to);
2802
+ return {
2803
+ isLink,
2804
+ isRouterLink,
2805
+ isClickable,
2806
+ isActive,
2807
+ route: link.value?.route,
2808
+ navigate: link.value?.navigate,
2809
+ href,
2810
+ linkProps: vue.reactive({
2811
+ href,
2812
+ "aria-current": vue.toRef(() => isActive.value ? "page" : void 0),
2813
+ "aria-disabled": vue.toRef(() => props.disabled && isLink.value ? "true" : void 0),
2814
+ tabindex: vue.toRef(() => props.disabled && isLink.value ? "-1" : void 0)
2815
+ })
2816
+ };
2817
+ }
2818
+ const makeRouterProps = propsFactory({
2819
+ href: String,
2820
+ replace: Boolean,
2821
+ to: [String, Object],
2822
+ exact: Boolean
2823
+ }, "router");
2824
+ function useSelectLink(link, select) {
2825
+ vue.watch(() => link.isActive?.value, (isActive) => {
2826
+ if (link.isLink.value && isActive != null && select) {
2827
+ vue.nextTick(() => {
2828
+ select(isActive);
2829
+ });
2830
+ }
2831
+ }, {
2832
+ immediate: true
2833
+ });
2834
+ }
2835
+ const stopSymbol = /* @__PURE__ */ Symbol("rippleStop");
2836
+ const DELAY_RIPPLE = 80;
2837
+ function transform(el, value) {
2838
+ el.style.transform = value;
2839
+ el.style.webkitTransform = value;
2840
+ }
2841
+ function isTouchEvent(e) {
2842
+ return e.constructor.name === "TouchEvent";
2843
+ }
2844
+ function isKeyboardEvent(e) {
2845
+ return e.constructor.name === "KeyboardEvent";
2846
+ }
2847
+ const calculate = function(e, el) {
2848
+ let value = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2849
+ let localX = 0;
2850
+ let localY = 0;
2851
+ if (!isKeyboardEvent(e)) {
2852
+ const offset = el.getBoundingClientRect();
2853
+ const target = isTouchEvent(e) ? e.touches[e.touches.length - 1] : e;
2854
+ localX = target.clientX - offset.left;
2855
+ localY = target.clientY - offset.top;
2856
+ }
2857
+ let radius = 0;
2858
+ let scale = 0.3;
2859
+ if (el._ripple?.circle) {
2860
+ scale = 0.15;
2861
+ radius = el.clientWidth / 2;
2862
+ radius = value.center ? radius : radius + Math.sqrt((localX - radius) ** 2 + (localY - radius) ** 2) / 4;
2863
+ } else {
2864
+ radius = Math.sqrt(el.clientWidth ** 2 + el.clientHeight ** 2) / 2;
2865
+ }
2866
+ const centerX = `${(el.clientWidth - radius * 2) / 2}px`;
2867
+ const centerY = `${(el.clientHeight - radius * 2) / 2}px`;
2868
+ const x = value.center ? centerX : `${localX - radius}px`;
2869
+ const y = value.center ? centerY : `${localY - radius}px`;
2870
+ return {
2871
+ radius,
2872
+ scale,
2873
+ x,
2874
+ y,
2875
+ centerX,
2876
+ centerY
2877
+ };
2878
+ };
2879
+ const ripples = {
2880
+ /* eslint-disable max-statements */
2881
+ show(e, el) {
2882
+ let value = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2883
+ if (!el?._ripple?.enabled) {
2884
+ return;
2885
+ }
2886
+ const container = document.createElement("span");
2887
+ const animation = document.createElement("span");
2888
+ container.appendChild(animation);
2889
+ container.className = "v-ripple__container";
2890
+ if (value.class) {
2891
+ container.className += ` ${value.class}`;
2892
+ }
2893
+ const {
2894
+ radius,
2895
+ scale,
2896
+ x,
2897
+ y,
2898
+ centerX,
2899
+ centerY
2900
+ } = calculate(e, el, value);
2901
+ const size = `${radius * 2}px`;
2902
+ animation.className = "v-ripple__animation";
2903
+ animation.style.width = size;
2904
+ animation.style.height = size;
2905
+ el.appendChild(container);
2906
+ const computed = window.getComputedStyle(el);
2907
+ if (computed && computed.position === "static") {
2908
+ el.style.position = "relative";
2909
+ el.dataset.previousPosition = "static";
2910
+ }
2911
+ animation.classList.add("v-ripple__animation--enter");
2912
+ animation.classList.add("v-ripple__animation--visible");
2913
+ transform(animation, `translate(${x}, ${y}) scale3d(${scale},${scale},${scale})`);
2914
+ animation.dataset.activated = String(performance.now());
2915
+ requestAnimationFrame(() => {
2916
+ requestAnimationFrame(() => {
2917
+ animation.classList.remove("v-ripple__animation--enter");
2918
+ animation.classList.add("v-ripple__animation--in");
2919
+ transform(animation, `translate(${centerX}, ${centerY}) scale3d(1,1,1)`);
2920
+ });
2921
+ });
2922
+ },
2923
+ hide(el) {
2924
+ if (!el?._ripple?.enabled) return;
2925
+ const ripples2 = el.getElementsByClassName("v-ripple__animation");
2926
+ if (ripples2.length === 0) return;
2927
+ const animation = Array.from(ripples2).findLast((ripple) => !ripple.dataset.isHiding);
2928
+ if (!animation) return;
2929
+ else animation.dataset.isHiding = "true";
2930
+ const diff = performance.now() - Number(animation.dataset.activated);
2931
+ const delay = Math.max(250 - diff, 0);
2932
+ setTimeout(() => {
2933
+ animation.classList.remove("v-ripple__animation--in");
2934
+ animation.classList.add("v-ripple__animation--out");
2935
+ setTimeout(() => {
2936
+ const ripples3 = el.getElementsByClassName("v-ripple__animation");
2937
+ if (ripples3.length === 1 && el.dataset.previousPosition) {
2938
+ el.style.position = el.dataset.previousPosition;
2939
+ delete el.dataset.previousPosition;
2940
+ }
2941
+ if (animation.parentNode?.parentNode === el) el.removeChild(animation.parentNode);
2942
+ }, 300);
2943
+ }, delay);
2944
+ }
2945
+ };
2946
+ function isRippleEnabled(value) {
2947
+ return typeof value === "undefined" || !!value;
2948
+ }
2949
+ function rippleShow(e) {
2950
+ const value = {};
2951
+ const element = e.currentTarget;
2952
+ if (!element?._ripple || element._ripple.touched || e[stopSymbol]) return;
2953
+ e[stopSymbol] = true;
2954
+ if (isTouchEvent(e)) {
2955
+ element._ripple.touched = true;
2956
+ element._ripple.isTouch = true;
2957
+ } else {
2958
+ if (element._ripple.isTouch) return;
2959
+ }
2960
+ value.center = element._ripple.centered || isKeyboardEvent(e);
2961
+ if (element._ripple.class) {
2962
+ value.class = element._ripple.class;
2963
+ }
2964
+ if (isTouchEvent(e)) {
2965
+ if (element._ripple.showTimerCommit) return;
2966
+ element._ripple.showTimerCommit = () => {
2967
+ ripples.show(e, element, value);
2968
+ };
2969
+ element._ripple.showTimer = window.setTimeout(() => {
2970
+ if (element?._ripple?.showTimerCommit) {
2971
+ element._ripple.showTimerCommit();
2972
+ element._ripple.showTimerCommit = null;
2973
+ }
2974
+ }, DELAY_RIPPLE);
2975
+ } else {
2976
+ ripples.show(e, element, value);
2977
+ }
2978
+ }
2979
+ function rippleStop(e) {
2980
+ e[stopSymbol] = true;
2981
+ }
2982
+ function rippleHide(e) {
2983
+ const element = e.currentTarget;
2984
+ if (!element?._ripple) return;
2985
+ window.clearTimeout(element._ripple.showTimer);
2986
+ if (e.type === "touchend" && element._ripple.showTimerCommit) {
2987
+ element._ripple.showTimerCommit();
2988
+ element._ripple.showTimerCommit = null;
2989
+ element._ripple.showTimer = window.setTimeout(() => {
2990
+ rippleHide(e);
2991
+ });
2992
+ return;
2993
+ }
2994
+ window.setTimeout(() => {
2995
+ if (element._ripple) {
2996
+ element._ripple.touched = false;
2997
+ }
2998
+ });
2999
+ ripples.hide(element);
3000
+ }
3001
+ function rippleCancelShow(e) {
3002
+ const element = e.currentTarget;
3003
+ if (!element?._ripple) return;
3004
+ if (element._ripple.showTimerCommit) {
3005
+ element._ripple.showTimerCommit = null;
3006
+ }
3007
+ window.clearTimeout(element._ripple.showTimer);
3008
+ }
3009
+ let keyboardRipple = false;
3010
+ function keyboardRippleShow(e, keys) {
3011
+ if (!keyboardRipple && keys.includes(e.key)) {
3012
+ keyboardRipple = true;
3013
+ rippleShow(e);
3014
+ }
3015
+ }
3016
+ function keyboardRippleHide(e) {
3017
+ keyboardRipple = false;
3018
+ rippleHide(e);
3019
+ }
3020
+ function focusRippleHide(e) {
3021
+ if (keyboardRipple) {
3022
+ keyboardRipple = false;
3023
+ rippleHide(e);
3024
+ }
3025
+ }
3026
+ function updateRipple(el, binding, wasEnabled) {
3027
+ const {
3028
+ value,
3029
+ modifiers
3030
+ } = binding;
3031
+ const enabled = isRippleEnabled(value);
3032
+ if (!enabled) {
3033
+ ripples.hide(el);
3034
+ }
3035
+ el._ripple = el._ripple ?? {};
3036
+ el._ripple.enabled = enabled;
3037
+ el._ripple.centered = modifiers.center;
3038
+ el._ripple.circle = modifiers.circle;
3039
+ const bindingValue = isObject(value) ? value : {};
3040
+ if (bindingValue.class) {
3041
+ el._ripple.class = bindingValue.class;
3042
+ }
3043
+ const allowedKeys = bindingValue.keys ?? ["Enter", "Space"];
3044
+ el._ripple.keyDownHandler = (e) => keyboardRippleShow(e, allowedKeys);
3045
+ if (enabled && !wasEnabled) {
3046
+ if (modifiers.stop) {
3047
+ el.addEventListener("touchstart", rippleStop, {
3048
+ passive: true
3049
+ });
3050
+ el.addEventListener("mousedown", rippleStop);
3051
+ return;
3052
+ }
3053
+ el.addEventListener("touchstart", rippleShow, {
3054
+ passive: true
3055
+ });
3056
+ el.addEventListener("touchend", rippleHide, {
3057
+ passive: true
3058
+ });
3059
+ el.addEventListener("touchmove", rippleCancelShow, {
3060
+ passive: true
3061
+ });
3062
+ el.addEventListener("touchcancel", rippleHide);
3063
+ el.addEventListener("mousedown", rippleShow);
3064
+ el.addEventListener("mouseup", rippleHide);
3065
+ el.addEventListener("mouseleave", rippleHide);
3066
+ el.addEventListener("keydown", el._ripple.keyDownHandler);
3067
+ el.addEventListener("keyup", keyboardRippleHide);
3068
+ el.addEventListener("blur", focusRippleHide);
3069
+ el.addEventListener("dragstart", rippleHide, {
3070
+ passive: true
3071
+ });
3072
+ } else if (!enabled && wasEnabled) {
3073
+ removeListeners(el);
3074
+ }
3075
+ }
3076
+ function removeListeners(el) {
3077
+ el.removeEventListener("touchstart", rippleStop);
3078
+ el.removeEventListener("mousedown", rippleStop);
3079
+ el.removeEventListener("touchstart", rippleShow);
3080
+ el.removeEventListener("touchend", rippleHide);
3081
+ el.removeEventListener("touchmove", rippleCancelShow);
3082
+ el.removeEventListener("touchcancel", rippleHide);
3083
+ el.removeEventListener("mousedown", rippleShow);
3084
+ el.removeEventListener("mouseup", rippleHide);
3085
+ el.removeEventListener("mouseleave", rippleHide);
3086
+ if (el._ripple?.keyDownHandler) {
3087
+ el.removeEventListener("keydown", el._ripple.keyDownHandler);
3088
+ }
3089
+ el.removeEventListener("keyup", keyboardRippleHide);
3090
+ el.removeEventListener("blur", focusRippleHide);
3091
+ el.removeEventListener("dragstart", rippleHide);
3092
+ }
3093
+ function mounted(el, binding) {
3094
+ updateRipple(el, binding, false);
3095
+ }
3096
+ function unmounted(el) {
3097
+ removeListeners(el);
3098
+ delete el._ripple;
3099
+ }
3100
+ function updated(el, binding) {
3101
+ if (binding.value === binding.oldValue) {
3102
+ return;
3103
+ }
3104
+ const wasEnabled = isRippleEnabled(binding.oldValue);
3105
+ updateRipple(el, binding, wasEnabled);
3106
+ }
3107
+ const Ripple = {
3108
+ mounted,
3109
+ unmounted,
3110
+ updated
3111
+ };
3112
+ const makeVBtnProps = propsFactory({
3113
+ active: {
3114
+ type: Boolean,
3115
+ default: void 0
3116
+ },
3117
+ activeColor: String,
3118
+ baseColor: String,
3119
+ symbol: {
3120
+ type: null,
3121
+ default: VBtnToggleSymbol
3122
+ },
3123
+ flat: Boolean,
3124
+ icon: [Boolean, String, Function, Object],
3125
+ prependIcon: IconValue,
3126
+ appendIcon: IconValue,
3127
+ block: Boolean,
3128
+ readonly: Boolean,
3129
+ slim: Boolean,
3130
+ stacked: Boolean,
3131
+ spaced: String,
3132
+ ripple: {
3133
+ type: [Boolean, Object],
3134
+ default: true
3135
+ },
3136
+ text: {
3137
+ type: [String, Number, Boolean],
3138
+ default: void 0
3139
+ },
3140
+ ...makeBorderProps(),
3141
+ ...makeComponentProps(),
3142
+ ...makeDensityProps(),
3143
+ ...makeDimensionProps(),
3144
+ ...makeElevationProps(),
3145
+ ...makeGroupItemProps(),
3146
+ ...makeLoaderProps(),
3147
+ ...makeLocationProps(),
3148
+ ...makePositionProps(),
3149
+ ...makeRoundedProps(),
3150
+ ...makeRouterProps(),
3151
+ ...makeSizeProps(),
3152
+ ...makeTagProps({
3153
+ tag: "button"
3154
+ }),
3155
+ ...makeThemeProps(),
3156
+ ...makeVariantProps({
3157
+ variant: "elevated"
3158
+ })
3159
+ }, "VBtn");
3160
+ const VBtn = genericComponent()({
3161
+ name: "VBtn",
3162
+ props: makeVBtnProps(),
3163
+ emits: {
3164
+ "group:selected": (val) => true
3165
+ },
3166
+ setup(props, _ref) {
3167
+ let {
3168
+ attrs,
3169
+ slots
3170
+ } = _ref;
3171
+ const {
3172
+ themeClasses
3173
+ } = provideTheme(props);
3174
+ const {
3175
+ borderClasses
3176
+ } = useBorder(props);
3177
+ const {
3178
+ densityClasses
3179
+ } = useDensity(props);
3180
+ const {
3181
+ dimensionStyles
3182
+ } = useDimension(props);
3183
+ const {
3184
+ elevationClasses
3185
+ } = useElevation(props);
3186
+ const {
3187
+ loaderClasses
3188
+ } = useLoader(props);
3189
+ const {
3190
+ locationStyles
3191
+ } = useLocation(props);
3192
+ const {
3193
+ positionClasses
3194
+ } = usePosition(props);
3195
+ const {
3196
+ roundedClasses
3197
+ } = useRounded(props);
3198
+ const {
3199
+ sizeClasses,
3200
+ sizeStyles
3201
+ } = useSize(props);
3202
+ const group = useGroupItem(props, props.symbol, false);
3203
+ const link = useLink(props, attrs);
3204
+ const isActive = vue.computed(() => {
3205
+ if (props.active !== void 0) {
3206
+ return props.active;
3207
+ }
3208
+ if (link.isRouterLink.value) {
3209
+ return link.isActive?.value;
3210
+ }
3211
+ return group?.isSelected.value;
3212
+ });
3213
+ const color = vue.toRef(() => isActive.value ? props.activeColor ?? props.color : props.color);
3214
+ const variantProps = vue.computed(() => {
3215
+ const showColor = group?.isSelected.value && (!link.isLink.value || link.isActive?.value) || !group || link.isActive?.value;
3216
+ return {
3217
+ color: showColor ? color.value ?? props.baseColor : props.baseColor,
3218
+ variant: props.variant
3219
+ };
3220
+ });
3221
+ const {
3222
+ colorClasses,
3223
+ colorStyles,
3224
+ variantClasses
3225
+ } = useVariant(variantProps);
3226
+ const isDisabled = vue.computed(() => group?.disabled.value || props.disabled);
3227
+ const isElevated = vue.toRef(() => {
3228
+ return props.variant === "elevated" && !(props.disabled || props.flat || props.border);
3229
+ });
3230
+ const valueAttr = vue.computed(() => {
3231
+ if (props.value === void 0 || typeof props.value === "symbol") return void 0;
3232
+ return Object(props.value) === props.value ? JSON.stringify(props.value, null, 0) : props.value;
3233
+ });
3234
+ function onClick(e) {
3235
+ if (isDisabled.value || link.isLink.value && (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0 || attrs.target === "_blank")) return;
3236
+ if (link.isRouterLink.value) {
3237
+ link.navigate?.(e);
3238
+ } else {
3239
+ group?.toggle();
3240
+ }
3241
+ }
3242
+ useSelectLink(link, group?.select);
3243
+ useRender(() => {
3244
+ const Tag = link.isLink.value ? "a" : props.tag;
3245
+ const hasPrepend = !!(props.prependIcon || slots.prepend);
3246
+ const hasAppend = !!(props.appendIcon || slots.append);
3247
+ const hasIcon = !!(props.icon && props.icon !== true);
3248
+ return vue.withDirectives(vue.createVNode(Tag, vue.mergeProps(link.linkProps, {
3249
+ "type": Tag === "a" ? void 0 : "button",
3250
+ "class": ["v-btn", group?.selectedClass.value, {
3251
+ "v-btn--active": isActive.value,
3252
+ "v-btn--block": props.block,
3253
+ "v-btn--disabled": isDisabled.value,
3254
+ "v-btn--elevated": isElevated.value,
3255
+ "v-btn--flat": props.flat,
3256
+ "v-btn--icon": !!props.icon,
3257
+ "v-btn--loading": props.loading,
3258
+ "v-btn--readonly": props.readonly,
3259
+ "v-btn--slim": props.slim,
3260
+ "v-btn--stacked": props.stacked
3261
+ }, props.spaced ? ["v-btn--spaced", `v-btn--spaced-${props.spaced}`] : [], themeClasses.value, borderClasses.value, colorClasses.value, densityClasses.value, elevationClasses.value, loaderClasses.value, positionClasses.value, roundedClasses.value, sizeClasses.value, variantClasses.value, props.class],
3262
+ "style": [colorStyles.value, dimensionStyles.value, locationStyles.value, sizeStyles.value, props.style],
3263
+ "aria-busy": props.loading ? true : void 0,
3264
+ "disabled": isDisabled.value && Tag !== "a" || void 0,
3265
+ "tabindex": props.loading || props.readonly ? -1 : void 0,
3266
+ "onClick": onClick,
3267
+ "value": valueAttr.value
3268
+ }), {
3269
+ default: () => [genOverlays(true, "v-btn"), !props.icon && hasPrepend && vue.createElementVNode("span", {
3270
+ "key": "prepend",
3271
+ "class": "v-btn__prepend"
3272
+ }, [!slots.prepend ? vue.createVNode(VIcon, {
3273
+ "key": "prepend-icon",
3274
+ "icon": props.prependIcon
3275
+ }, null) : vue.createVNode(VDefaultsProvider, {
3276
+ "key": "prepend-defaults",
3277
+ "disabled": !props.prependIcon,
3278
+ "defaults": {
3279
+ VIcon: {
3280
+ icon: props.prependIcon
3281
+ }
3282
+ }
3283
+ }, slots.prepend)]), vue.createElementVNode("span", {
3284
+ "class": "v-btn__content",
3285
+ "data-no-activator": ""
3286
+ }, [!slots.default && hasIcon ? vue.createVNode(VIcon, {
3287
+ "key": "content-icon",
3288
+ "icon": props.icon
3289
+ }, null) : vue.createVNode(VDefaultsProvider, {
3290
+ "key": "content-defaults",
3291
+ "disabled": !hasIcon,
3292
+ "defaults": {
3293
+ VIcon: {
3294
+ icon: props.icon
3295
+ }
3296
+ }
3297
+ }, {
3298
+ default: () => [slots.default?.() ?? vue.toDisplayString(props.text)]
3299
+ })]), !props.icon && hasAppend && vue.createElementVNode("span", {
3300
+ "key": "append",
3301
+ "class": "v-btn__append"
3302
+ }, [!slots.append ? vue.createVNode(VIcon, {
3303
+ "key": "append-icon",
3304
+ "icon": props.appendIcon
3305
+ }, null) : vue.createVNode(VDefaultsProvider, {
3306
+ "key": "append-defaults",
3307
+ "disabled": !props.appendIcon,
3308
+ "defaults": {
3309
+ VIcon: {
3310
+ icon: props.appendIcon
3311
+ }
3312
+ }
3313
+ }, slots.append)]), !!props.loading && vue.createElementVNode("span", {
3314
+ "key": "loader",
3315
+ "class": "v-btn__loader"
3316
+ }, [slots.loader?.() ?? vue.createVNode(VProgressCircular, {
3317
+ "color": typeof props.loading === "boolean" ? void 0 : props.loading,
3318
+ "indeterminate": true,
3319
+ "width": "2"
3320
+ }, null)])]
3321
+ }), [[Ripple, !isDisabled.value && props.ripple, "", {
3322
+ center: !!props.icon
3323
+ }]]);
3324
+ });
3325
+ return {
3326
+ group
3327
+ };
3328
+ }
3329
+ });
3330
+ function useSsrBoot() {
3331
+ const isBooted = vue.shallowRef(false);
3332
+ vue.onMounted(() => {
3333
+ window.requestAnimationFrame(() => {
3334
+ isBooted.value = true;
3335
+ });
3336
+ });
3337
+ const ssrBootStyles = vue.toRef(() => !isBooted.value ? {
3338
+ transition: "none !important"
3339
+ } : void 0);
3340
+ return {
3341
+ ssrBootStyles,
3342
+ isBooted: vue.readonly(isBooted)
3343
+ };
3344
+ }
3345
+ const makeVMainProps = propsFactory({
3346
+ scrollable: Boolean,
3347
+ ...makeComponentProps(),
3348
+ ...makeDimensionProps(),
3349
+ ...makeTagProps({
3350
+ tag: "main"
3351
+ })
3352
+ }, "VMain");
3353
+ const VMain = genericComponent()({
3354
+ name: "VMain",
3355
+ props: makeVMainProps(),
3356
+ setup(props, _ref) {
3357
+ let {
3358
+ slots
3359
+ } = _ref;
3360
+ const {
3361
+ dimensionStyles
3362
+ } = useDimension(props);
3363
+ const {
3364
+ mainStyles
3365
+ } = useLayout();
3366
+ const {
3367
+ ssrBootStyles
3368
+ } = useSsrBoot();
3369
+ useRender(() => vue.createVNode(props.tag, {
3370
+ "class": vue.normalizeClass(["v-main", {
3371
+ "v-main--scrollable": props.scrollable
3372
+ }, props.class]),
3373
+ "style": vue.normalizeStyle([mainStyles.value, ssrBootStyles.value, dimensionStyles.value, props.style])
3374
+ }, {
3375
+ default: () => [props.scrollable ? vue.createElementVNode("div", {
3376
+ "class": "v-main__scroller"
3377
+ }, [slots.default?.()]) : slots.default?.()]
3378
+ }));
3379
+ return {};
3380
+ }
3381
+ });
3382
+ const _hoisted_1 = {
3383
+ key: 1,
3384
+ class: "d-flex align-center justify-center",
3385
+ style: { "height": "200px" }
3386
+ };
3387
+ const _sfc_main = /* @__PURE__ */ Object.assign({
3388
+ name: "PreviewApp"
3389
+ }, {
3390
+ __name: "App",
3391
+ setup(__props, { expose: __expose }) {
3392
+ const currentTheme = vue.ref("light");
3393
+ const pluginComponent = vue.shallowRef(null);
3394
+ const toggleTheme = () => {
3395
+ currentTheme.value = currentTheme.value === "light" ? "dark" : "light";
3396
+ };
3397
+ vue.onMounted(() => {
3398
+ if (window.__PREVIEW_PLUGIN_COMPONENT__) {
3399
+ pluginComponent.value = window.__PREVIEW_PLUGIN_COMPONENT__;
3400
+ }
3401
+ });
3402
+ __expose({
3403
+ setPluginComponent: (component) => {
3404
+ pluginComponent.value = component;
3405
+ }
3406
+ });
3407
+ return (_ctx, _cache) => {
3408
+ return vue.openBlock(), vue.createBlock(VApp, { theme: currentTheme.value }, {
3409
+ default: vue.withCtx(() => [
3410
+ vue.createVNode(VMain, null, {
3411
+ default: vue.withCtx(() => [
3412
+ vue.createVNode(VBanner, {
3413
+ density: "compact",
3414
+ color: "info",
3415
+ lines: "one"
3416
+ }, {
3417
+ text: vue.withCtx(() => _cache[0] || (_cache[0] = [
3418
+ vue.createElementVNode("span", { class: "text-caption" }, "Preview 模式 - Electron API 已 mock", -1)
3419
+ ])),
3420
+ actions: vue.withCtx(() => [
3421
+ vue.createVNode(VBtn, {
3422
+ variant: "text",
3423
+ icon: currentTheme.value === "light" ? "dark_mode" : "light_mode",
3424
+ onClick: toggleTheme
3425
+ }, null, 8, ["icon"])
3426
+ ]),
3427
+ _: 1
3428
+ }),
3429
+ pluginComponent.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(pluginComponent.value), { key: 0 })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, _cache[1] || (_cache[1] = [
3430
+ vue.createElementVNode("span", { class: "text-medium-emphasis" }, "加载中...", -1)
3431
+ ])))
3432
+ ]),
3433
+ _: 1
3434
+ })
3435
+ ]),
3436
+ _: 1
3437
+ }, 8, ["theme"]);
3438
+ };
3439
+ }
3440
+ });
3441
+ const PreviewApp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-10207be4"]]);
3442
+ async function startPreview(pluginComponent, options = {}) {
3443
+ const { mountId = "app" } = options;
3444
+ previewMock.initPreviewMock();
3445
+ const vuetify$1 = vuetify.createVuetify({
3446
+ components: components__namespace,
3447
+ directives: directives__namespace,
3448
+ locale: {
3449
+ locale: "zhHans",
3450
+ messages: { zhHans: locale.zhHans }
3451
+ },
3452
+ icons: {
3453
+ defaultSet: "md",
3454
+ aliases: md.aliases,
3455
+ sets: { md: md.md }
3456
+ },
3457
+ theme: {
3458
+ defaultTheme: "light",
3459
+ layers: true,
3460
+ themes: {
3461
+ light: {
3462
+ colors: {
3463
+ primary: "#00639b",
3464
+ "on-primary": "#ffffff",
3465
+ "primary-container": "#cee5ff",
3466
+ "on-primary-container": "#004a76",
3467
+ "inverse-primary": "#96cbff",
3468
+ "primary-fixed": "#cee5ff",
3469
+ "primary-fixed-dim": "#96cbff",
3470
+ "on-primary-fixed": "#001d33",
3471
+ "on-primary-fixed-variant": "#004a76",
3472
+ secondary: "#51606f",
3473
+ "on-secondary": "#ffffff",
3474
+ "secondary-container": "#d5e4f7",
3475
+ "on-secondary-container": "#3a4857",
3476
+ "secondary-fixed": "#d5e4f7",
3477
+ "secondary-fixed-dim": "#b9c8da",
3478
+ "on-secondary-fixed": "#0e1d2a",
3479
+ "on-secondary-fixed-variant": "#3a4857",
3480
+ tertiary: "#68587a",
3481
+ "on-tertiary": "#ffffff",
3482
+ "tertiary-container": "#eedbff",
3483
+ "on-tertiary-container": "#504061",
3484
+ "tertiary-fixed": "#eedbff",
3485
+ "tertiary-fixed-dim": "#d3bfe6",
3486
+ "on-tertiary-fixed": "#231533",
3487
+ "on-tertiary-fixed-variant": "#504061",
3488
+ error: "#ba1a1a",
3489
+ "on-error": "#ffffff",
3490
+ "error-container": "#ffdad6",
3491
+ "on-error-container": "#93000a",
3492
+ "surface-dim": "#dadada",
3493
+ surface: "#f9f9f9",
3494
+ "surface-bright": "#f9f9f9",
3495
+ "surface-container-lowest": "#ffffff",
3496
+ "surface-container-low": "#f3f3f3",
3497
+ "surface-container": "#eeeeee",
3498
+ "surface-container-high": "#e8e8e8",
3499
+ "surface-container-highest": "#e2e2e2",
3500
+ "on-surface": "#1b1b1b",
3501
+ "on-surface-variant": "#474747",
3502
+ outline: "#777777",
3503
+ "outline-variant": "#c6c6c6",
3504
+ "inverse-surface": "#303030",
3505
+ "inverse-on-surface": "#f1f1f1",
3506
+ "surface-variant": "#e2e2e2",
3507
+ "surface-tint": "#00639b",
3508
+ background: "#f9f9f9",
3509
+ "on-background": "#1b1b1b",
3510
+ shadow: "#000000",
3511
+ scrim: "#000000"
3512
+ },
3513
+ dark: false
3514
+ },
3515
+ dark: {
3516
+ colors: {
3517
+ primary: "#96cbff",
3518
+ "on-primary": "#003353",
3519
+ "primary-container": "#004a76",
3520
+ "on-primary-container": "#cee5ff",
3521
+ "inverse-primary": "#00639b",
3522
+ "primary-fixed": "#cee5ff",
3523
+ "primary-fixed-dim": "#96cbff",
3524
+ "on-primary-fixed": "#001d33",
3525
+ "on-primary-fixed-variant": "#004a76",
3526
+ secondary: "#b9c8da",
3527
+ "on-secondary": "#233240",
3528
+ "secondary-container": "#3a4857",
3529
+ "on-secondary-container": "#d5e4f7",
3530
+ "secondary-fixed": "#d5e4f7",
3531
+ "secondary-fixed-dim": "#b9c8da",
3532
+ "on-secondary-fixed": "#0e1d2a",
3533
+ "on-secondary-fixed-variant": "#3a4857",
3534
+ tertiary: "#d3bfe6",
3535
+ "on-tertiary": "#382a49",
3536
+ "tertiary-container": "#504061",
3537
+ "on-tertiary-container": "#eedbff",
3538
+ "tertiary-fixed": "#eedbff",
3539
+ "tertiary-fixed-dim": "#d3bfe6",
3540
+ "on-tertiary-fixed": "#231533",
3541
+ "on-tertiary-fixed-variant": "#504061",
3542
+ error: "#ffb4ab",
3543
+ "on-error": "#690005",
3544
+ "error-container": "#93000a",
3545
+ "on-error-container": "#ffdad6",
3546
+ "surface-dim": "#131313",
3547
+ surface: "#131313",
3548
+ "surface-bright": "#393939",
3549
+ "surface-container-lowest": "#0e0e0e",
3550
+ "surface-container-low": "#1b1b1b",
3551
+ "surface-container": "#1f1f1f",
3552
+ "surface-container-high": "#2a2a2a",
3553
+ "surface-container-highest": "#353535",
3554
+ "on-surface": "#e2e2e2",
3555
+ "on-surface-variant": "#c6c6c6",
3556
+ outline: "#919191",
3557
+ "outline-variant": "#474747",
3558
+ "inverse-surface": "#e2e2e2",
3559
+ "inverse-on-surface": "#303030",
3560
+ "surface-variant": "#474747",
3561
+ "surface-tint": "#96cbff",
3562
+ background: "#131313",
3563
+ "on-background": "#e2e2e2",
3564
+ shadow: "#000000",
3565
+ scrim: "#000000"
3566
+ },
3567
+ dark: true
3568
+ }
3569
+ }
3570
+ },
3571
+ defaults: {
3572
+ VBtn: {
3573
+ class: "normal-case"
3574
+ },
3575
+ VSwitch: {
3576
+ color: "primary",
3577
+ hideDetails: true,
3578
+ inset: true,
3579
+ trueIcon: "check"
3580
+ },
3581
+ VCard: {
3582
+ color: "surface-container"
3583
+ }
3584
+ },
3585
+ blueprint: blueprints.md3
3586
+ });
3587
+ window.vuetify$ = {
3588
+ instance: vuetify$1,
3589
+ components: components__namespace,
3590
+ directives: directives__namespace
3591
+ };
3592
+ window.__PREVIEW_PLUGIN_COMPONENT__ = pluginComponent;
3593
+ const app = vue.createApp(PreviewApp);
3594
+ app.use(vuetify$1);
3595
+ let mountEl = document.getElementById(mountId);
3596
+ if (!mountEl) {
3597
+ mountEl = document.createElement("div");
3598
+ mountEl.id = mountId;
3599
+ document.body.appendChild(mountEl);
3600
+ }
3601
+ app.mount(`#${mountId}`);
3602
+ console.log("[Preview] 插件预览模式已启动");
3603
+ return app;
3604
+ }
3605
+ exports.default = startPreview;
3606
+ exports.startPreview = startPreview;
3607
+ //# sourceMappingURL=preview.cjs.map