vendor: 18,088 bytes, lines 1-337
1import { a5 as nt, h as ne, k as Ne, ab as it, z as J, K as Ae, o as M, c as F, a as u, Z as E, C as S, u as x, B as ye, i as W, e as b, f as H, w as xe, Q as st, b as O, M as je, T as ot, F as ue, m as Y, a7 as lt, G as $, g as G, r as _e, t as C, S as Ue, j as Oe, d as U, P as ze, O as ut, L as ht } from "./app-yg_pP4S4.js"; 2import { _ as ae } from "./BaseInput-DrEncIoW.js"; 3import { _ as se } from "./InputError-c3Vl2Z79.js"; 4import { _ as re, r as Xe } from "./ModalConfirmation-BptK8hn4.js"; 5import { _ as dt } from "./CopyElement-DS_ZPrcX.js"; 6import { u as ct, L as ft } from "./LoaderIcon-BfI_LFZK.js"; 7import { h as pt } from "./index-CDyB1Hog.js"; 8import { Q as gt, X as mt } from "./XMarkIcon-C7ztHuKP.js"; 9import { S as De, r as qe, M as Ge, b as Q, g as We } from "./menu-DpWDC0YJ.js"; 10import { r as Ye } from "./PencilIcon-DF7D2KxS.js"; 11import { r as Ke } from "./TrashIcon-7IRzqwUc.js"; 12import { _ as vt, u as bt, g as yt } from "./useFileUploads-dfxvBIDP.js"; 13import { m as xt } from "./filesystem-DWhNxEQp.js"; 14import { b as _t } from "./functions-DLrKIvnr.js"; 15function oe(e) { 16 "@babel/helpers - typeof"; 17 return oe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) { 18 return typeof a; 19 } : function(a) { 20 return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a; 21 }, oe(e); 22} 23var kt = /^\s+/, wt = /\s+$/; 24function h(e, a) { 25 if (e = e || "", a = a || {}, e instanceof h) return e; 26 if (!(this instanceof h)) return new h(e, a); 27 var t = St(e); 28 this._originalInput = e, this._r = t.r, this._g = t.g, this._b = t.b, this._a = t.a, this._roundA = Math.round(100 * this._a) / 100, this._format = a.format || t.format, this._gradientType = a.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = t.ok; 29} 30h.prototype = { isDark: function() { 31 return this.getBrightness() < 128; 32}, isLight: function() { 33 return !this.isDark(); 34}, isValid: function() { 35 return this._ok; 36}, getOriginalInput: function() { 37 return this._originalInput; 38}, getFormat: function() { 39 return this._format; 40}, getAlpha: function() { 41 return this._a; 42}, getBrightness: function() { 43 var e = this.toRgb(); 44 return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; 45}, getLuminance: function() { 46 var e = this.toRgb(), a, t, r, i, n, o; 47 return a = e.r / 255, t = e.g / 255, r = e.b / 255, a <= 0.03928 ? i = a / 12.92 : i = Math.pow((a + 0.055) / 1.055, 2.4), t <= 0.03928 ? n = t / 12.92 : n = Math.pow((t + 0.055) / 1.055, 2.4), r <= 0.03928 ? o = r / 12.92 : o = Math.pow((r + 0.055) / 1.055, 2.4), 0.2126 * i + 0.7152 * n + 0.0722 * o; 48}, setAlpha: function(e) { 49 return this._a = Je(e), this._roundA = Math.round(100 * this._a) / 100, this; 50}, toHsv: function() { 51 var e = Re(this._r, this._g, this._b); 52 return { h: e.h * 360, s: e.s, v: e.v, a: this._a }; 53}, toHsvString: function() { 54 var e = Re(this._r, this._g, this._b), a = Math.round(e.h * 360), t = Math.round(e.s * 100), r = Math.round(e.v * 100); 55 return this._a == 1 ? "hsv(" + a + ", " + t + "%, " + r + "%)" : "hsva(" + a + ", " + t + "%, " + r + "%, " + this._roundA + ")"; 56}, toHsl: function() { 57 var e = Ce(this._r, this._g, this._b); 58 return { h: e.h * 360, s: e.s, l: e.l, a: this._a }; 59}, toHslString: function() { 60 var e = Ce(this._r, this._g, this._b), a = Math.round(e.h * 360), t = Math.round(e.s * 100), r = Math.round(e.l * 100); 61 return this._a == 1 ? "hsl(" + a + ", " + t + "%, " + r + "%)" : "hsla(" + a + ", " + t + "%, " + r + "%, " + this._roundA + ")"; 62}, toHex: function(e) { 63 return Ie(this._r, this._g, this._b, e); 64}, toHexString: function(e) { 65 return "#" + this.toHex(e); 66}, toHex8: function(e) { 67 return Rt(this._r, this._g, this._b, this._a, e); 68}, toHex8String: function(e) { 69 return "#" + this.toHex8(e); 70}, toRgb: function() { 71 return { r: Math.round(this._r), g: Math.round(this._g), b: Math.round(this._b), a: this._a }; 72}, toRgbString: function() { 73 return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")"; 74}, toPercentageRgb: function() { 75 return { r: Math.round(R(this._r, 255) * 100) + "%", g: Math.round(R(this._g, 255) * 100) + "%", b: Math.round(R(this._b, 255) * 100) + "%", a: this._a }; 76}, toPercentageRgbString: function() { 77 return this._a == 1 ? "rgb(" + Math.round(R(this._r, 255) * 100) + "%, " + Math.round(R(this._g, 255) * 100) + "%, " + Math.round(R(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(R(this._r, 255) * 100) + "%, " + Math.round(R(this._g, 255) * 100) + "%, " + Math.round(R(this._b, 255) * 100) + "%, " + this._roundA + ")"; 78}, toName: function() { 79 return this._a === 0 ? "transparent" : this._a < 1 ? false : jt[Ie(this._r, this._g, this._b, true)] || false; 80}, toFilter: function(e) { 81 var a = "#" + $e(this._r, this._g, this._b, this._a), t = a, r = this._gradientType ? "GradientType = 1, " : ""; 82 if (e) { 83 var i = h(e); 84 t = "#" + $e(i._r, i._g, i._b, i._a); 85 } 86 return "progid:DXImageTransform.Microsoft.gradient(" + r + "startColorstr=" + a + ",endColorstr=" + t + ")"; 87}, toString: function(e) { 88 var a = !!e; 89 e = e || this._format; 90 var t = false, r = this._a < 1 && this._a >= 0, i = !a && r && (e === "hex" || e === "hex6" || e === "hex3" || e === "hex4" || e === "hex8" || e === "name"); 91 return i ? e === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (t = this.toRgbString()), e === "prgb" && (t = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (t = this.toHexString()), e === "hex3" && (t = this.toHexString(true)), e === "hex4" && (t = this.toHex8String(true)), e === "hex8" && (t = this.toHex8String()), e === "name" && (t = this.toName()), e === "hsl" && (t = this.toHslString()), e === "hsv" && (t = this.toHsvString()), t || this.toHexString()); 92}, clone: function() { 93 return h(this.toString()); 94}, _applyModification: function(e, a) { 95 var t = e.apply(null, [this].concat([].slice.call(a))); 96 return this._r = t._r, this._g = t._g, this._b = t._b, this.setAlpha(t._a), this; 97}, lighten: function() { 98 return this._applyModification(Pt, arguments); 99}, brighten: function() { 100 return this._applyModification(Ft, arguments); 101}, darken: function() { 102 return this._applyModification(Et, arguments); 103}, desaturate: function() { 104 return this._applyModification(It, arguments); 105}, saturate: function() { 106 return this._applyModification($t, arguments); 107}, greyscale: function() { 108 return this._applyModification(Ht, arguments); 109}, spin: function() { 110 return this._applyModification(Vt, arguments); 111}, _applyCombination: function(e, a) { 112 return e.apply(null, [this].concat([].slice.call(a))); 113}, analogous: function() { 114 return this._applyCombination(Lt, arguments); 115}, complement: function() { 116 return this._applyCombination(Tt, arguments); 117}, monochromatic: function() { 118 return this._applyCombination(Nt, arguments); 119}, splitcomplement: function() { 120 return this._applyCombination(Bt, arguments); 121}, triad: function() { 122 return this._applyCombination(He, [3]); 123}, tetrad: function() { 124 return this._applyCombination(He, [4]); 125} }; 126h.fromRatio = function(e, a) { 127 if (oe(e) == "object") { 128 var t = {}; 129 for (var r in e) e.hasOwnProperty(r) && (r === "a" ? t[r] = e[r] : t[r] = ee(e[r])); 130 e = t; 131 } 132 return h(e, a); 133}; 134function St(e) { 135 var a = { r: 0, g: 0, b: 0 }, t = 1, r = null, i = null, n = null, o = false, s = false; 136 return typeof e == "string" && (e = Xt(e)), oe(e) == "object" && (D(e.r) && D(e.g) && D(e.b) ? (a = Mt(e.r, e.g, e.b), o = true, s = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : D(e.h) && D(e.s) && D(e.v) ? (r = ee(e.s), i = ee(e.v), a = Ct(e.h, r, i), o = true, s = "hsv") : D(e.h) && D(e.s) && D(e.l) && (r = ee(e.s), n = ee(e.l), a = At(e.h, r, n), o = true, s = "hsl"), e.hasOwnProperty("a") && (t = e.a)), t = Je(t), { ok: o, format: e.format || s, r: Math.min(255, Math.max(a.r, 0)), g: Math.min(255, Math.max(a.g, 0)), b: Math.min(255, Math.max(a.b, 0)), a: t }; 137} 138function Mt(e, a, t) { 139 return { r: R(e, 255) * 255, g: R(a, 255) * 255, b: R(t, 255) * 255 }; 140} 141function Ce(e, a, t) { 142 e = R(e, 255), a = R(a, 255), t = R(t, 255); 143 var r = Math.max(e, a, t), i = Math.min(e, a, t), n, o, s = (r + i) / 2; 144 if (r == i) n = o = 0; 145 else { 146 var l = r - i; 147 switch (o = s > 0.5 ? l / (2 - r - i) : l / (r + i), r) { 148 case e: 149 n = (a - t) / l + (a < t ? 6 : 0); 150 break; 151 case a: 152 n = (t - e) / l + 2; 153 break; 154 case t: 155 n = (e - a) / l + 4; 156 break; 157 } 158 n /= 6; 159 } 160 return { h: n, s: o, l: s }; 161} 162function At(e, a, t) { 163 var r, i, n; 164 e = R(e, 360), a = R(a, 100), t = R(t, 100); 165 function o(c, m, y) { 166 return y < 0 && (y += 1), y > 1 && (y -= 1), y < 1 / 6 ? c + (m - c) * 6 * y : y < 1 / 2 ? m : y < 2 / 3 ? c + (m - c) * (2 / 3 - y) * 6 : c; 167 } 168 if (a === 0) r = i = n = t; 169 else { 170 var s = t < 0.5 ? t * (1 + a) : t + a - t * a, l = 2 * t - s; 171 r = o(l, s, e + 1 / 3), i = o(l, s, e), n = o(l, s, e - 1 / 3); 172 } 173 return { r: r * 255, g: i * 255, b: n * 255 }; 174} 175function Re(e, a, t) { 176 e = R(e, 255), a = R(a, 255), t = R(t, 255); 177 var r = Math.max(e, a, t), i = Math.min(e, a, t), n, o, s = r, l = r - i; 178 if (o = r === 0 ? 0 : l / r, r == i) n = 0; 179 else { 180 switch (r) { 181 case e: 182 n = (a - t) / l + (a < t ? 6 : 0); 183 break; 184 case a: 185 n = (t - e) / l + 2; 186 break; 187 case t: 188 n = (e - a) / l + 4; 189 break; 190 } 191 n /= 6; 192 } 193 return { h: n, s: o, v: s }; 194} 195function Ct(e, a, t) { 196 e = R(e, 360) * 6, a = R(a, 100), t = R(t, 100); 197 var r = Math.floor(e), i = e - r, n = t * (1 - a), o = t * (1 - i * a), s = t * (1 - (1 - i) * a), l = r % 6, c = [t, o, n, n, s, t][l], m = [s, t, t, o, n, n][l], y = [n, n, s, t, t, o][l]; 198 return { r: c * 255, g: m * 255, b: y * 255 }; 199} 200function Ie(e, a, t, r) { 201 var i = [N(Math.round(e).toString(16)), N(Math.round(a).toString(16)), N(Math.round(t).toString(16))]; 202 return r && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join(""); 203} 204function Rt(e, a, t, r, i) { 205 var n = [N(Math.round(e).toString(16)), N(Math.round(a).toString(16)), N(Math.round(t).toString(16)), N(Qe(r))]; 206 return i && n[0].charAt(0) == n[0].charAt(1) && n[1].charAt(0) == n[1].charAt(1) && n[2].charAt(0) == n[2].charAt(1) && n[3].charAt(0) == n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(""); 207} 208function $e(e, a, t, r) { 209 var i = [N(Qe(r)), N(Math.round(e).toString(16)), N(Math.round(a).toString(16)), N(Math.round(t).toString(16))]; 210 return i.join(""); 211} 212h.equals = function(e, a) { 213 return !e || !a ? false : h(e).toRgbString() == h(a).toRgbString(); 214}; 215h.random = function() { 216 return h.fromRatio({ r: Math.random(), g: Math.random(), b: Math.random() }); 217}; 218function It(e, a) { 219 a = a === 0 ? 0 : a || 10; 220 var t = h(e).toHsl(); 221 return t.s -= a / 100, t.s = he(t.s), h(t); 222} 223function $t(e, a) { 224 a = a === 0 ? 0 : a || 10; 225 var t = h(e).toHsl(); 226 return t.s += a / 100, t.s = he(t.s), h(t); 227} 228function Ht(e) { 229 return h(e).desaturate(100); 230} 231function Pt(e, a) { 232 a = a === 0 ? 0 : a || 10; 233 var t = h(e).toHsl(); 234 return t.l += a / 100, t.l = he(t.l), h(t); 235} 236function Ft(e, a) { 237 a = a === 0 ? 0 : a || 10; 238 var t = h(e).toRgb(); 239 return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(a / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(a / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(a / 100)))), h(t); 240} 241function Et(e, a) { 242 a = a === 0 ? 0 : a || 10; 243 var t = h(e).toHsl(); 244 return t.l -= a / 100, t.l = he(t.l), h(t); 245} 246function Vt(e, a) { 247 var t = h(e).toHsl(), r = (t.h + a) % 360; 248 return t.h = r < 0 ? 360 + r : r, h(t); 249} 250function Tt(e) { 251 var a = h(e).toHsl(); 252 return a.h = (a.h + 180) % 360, h(a); 253} 254function He(e, a) { 255 if (isNaN(a) || a <= 0) throw new Error("Argument to polyad must be a positive number"); 256 for (var t = h(e).toHsl(), r = [h(e)], i = 360 / a, n = 1; n < a; n++) r.push(h({ h: (t.h + n * i) % 360, s: t.s, l: t.l })); 257 return r; 258} 259function Bt(e) { 260 var a = h(e).toHsl(), t = a.h; 261 return [h(e), h({ h: (t + 72) % 360, s: a.s, l: a.l }), h({ h: (t + 216) % 360, s: a.s, l: a.l })]; 262} 263function Lt(e, a, t) { 264 a = a || 6, t = t || 30; 265 var r = h(e).toHsl(), i = 360 / t, n = [h(e)]; 266 for (r.h = (r.h - (i * a >> 1) + 720) % 360; --a; ) r.h = (r.h + i) % 360, n.push(h(r)); 267 return n; 268} 269function Nt(e, a) { 270 a = a || 6; 271 for (var t = h(e).toHsv(), r = t.h, i = t.s, n = t.v, o = [], s = 1 / a; a--; ) o.push(h({ h: r, s: i, v: n })), n = (n + s) % 1; 272 return o; 273} 274h.mix = function(e, a, t) { 275 t = t === 0 ? 0 : t || 50; 276 var r = h(e).toRgb(), i = h(a).toRgb(), n = t / 100, o = { r: (i.r - r.r) * n + r.r, g: (i.g - r.g) * n + r.g, b: (i.b - r.b) * n + r.b, a: (i.a - r.a) * n + r.a }; 277 return h(o); 278}; 279h.readability = function(e, a) { 280 var t = h(e), r = h(a); 281 return (Math.max(t.getLuminance(), r.getLuminance()) + 0.05) / (Math.min(t.getLuminance(), r.getLuminance()) + 0.05); 282}; 283h.isReadable = function(e, a, t) { 284 var r = h.readability(e, a), i, n; 285 switch (n = false, i = Dt(t), i.level + i.size) { 286 case "AAsmall": 287 case "AAAlarge": 288 n = r >= 4.5; 289 break; 290 case "AAlarge": 291 n = r >= 3; 292 break; 293 case "AAAsmall": 294 n = r >= 7; 295 break; 296 } 297 return n; 298}; 299h.mostReadable = function(e, a, t) { 300 var r = null, i = 0, n, o, s, l; 301 t = t || {}, o = t.includeFallbackColors, s = t.level, l = t.size; 302 for (var c = 0; c < a.length; c++) n = h.readability(e, a[c]), n > i && (i = n, r = h(a[c])); 303 return h.isReadable(e, r, { level: s, size: l }) || !o ? r : (t.includeFallbackColors = false, h.mostReadable(e, ["#fff", "#000"], t)); 304}; 305var me = h.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, jt = h.hexNames = Ut(me); 306function Ut(e) { 307 var a = {}; 308 for (var t in e) e.hasOwnProperty(t) && (a[e[t]] = t); 309 return a; 310} 311function Je(e) { 312 return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e; 313} 314function R(e, a) { 315 Ot(e) && (e = "100%"); 316 var t = zt(e); 317 return e = Math.min(a, Math.max(0, parseFloat(e))), t && (e = parseInt(e * a, 10) / 100), Math.abs(e - a) < 1e-6 ? 1 : e % a / parseFloat(a); 318} 319function he(e) { 320 return Math.min(1, Math.max(0, e)); 321} 322function V(e) { 323 return parseInt(e, 16); 324} 325function Ot(e) { 326 return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1; 327} 328function zt(e) { 329 return typeof e == "string" && e.indexOf("%") != -1; 330} 331function N(e) { 332 return e.length == 1 ? "0" + e : "" + e; 333} 334function ee(e) { 335 return e <= 1 && (e = e * 100 + "%"), e; 336} 337function Qe(e) {
338 return Math.round(parseFloat(e) * 255).toString(16); 339} 340function Pe(e) { 341 return V(e) / 255; 342} 343var B = (function() { 344 var e = "[-\\+]?\\d+%?", a = "[-\\+]?\\d*\\.\\d+%?", t = "(?:" + a + ")|(?:" + e + ")", r = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?", i = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?"; 345 return { CSS_UNIT: new RegExp(t), rgb: new RegExp("rgb" + r), rgba: new RegExp("rgba" + i), hsl: new RegExp("hsl" + r), hsla: new RegExp("hsla" + i), hsv: new RegExp("hsv" + r), hsva: new RegExp("hsva" + i), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; 346})(); 347function D(e) { 348 return !!B.CSS_UNIT.exec(e); 349} 350function Xt(e) { 351 e = e.replace(kt, "").replace(wt, "").toLowerCase(); 352 var a = false; 353 if (me[e]) e = me[e], a = true; 354 else if (e == "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; 355 var t; 356 return (t = B.rgb.exec(e)) ? { r: t[1], g: t[2], b: t[3] } : (t = B.rgba.exec(e)) ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = B.hsl.exec(e)) ? { h: t[1], s: t[2], l: t[3] } : (t = B.hsla.exec(e)) ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = B.hsv.exec(e)) ? { h: t[1], s: t[2], v: t[3] } : (t = B.hsva.exec(e)) ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = B.hex8.exec(e)) ? { r: V(t[1]), g: V(t[2]), b: V(t[3]), a: Pe(t[4]), format: a ? "name" : "hex8" } : (t = B.hex6.exec(e)) ? { r: V(t[1]), g: V(t[2]), b: V(t[3]), format: a ? "name" : "hex" } : (t = B.hex4.exec(e)) ? { r: V(t[1] + "" + t[1]), g: V(t[2] + "" + t[2]), b: V(t[3] + "" + t[3]), a: Pe(t[4] + "" + t[4]), format: a ? "name" : "hex8" } : (t = B.hex3.exec(e)) ? { r: V(t[1] + "" + t[1]), g: V(t[2] + "" + t[2]), b: V(t[3] + "" + t[3]), format: a ? "name" : "hex" } : false; 357} 358function Dt(e) { 359 var a, t; 360 return e = e || { level: "AA", size: "small" }, a = (e.level || "AA").toUpperCase(), t = (e.size || "small").toLowerCase(), a !== "AA" && a !== "AAA" && (a = "AA"), t !== "small" && t !== "large" && (t = "small"), { level: a, size: t }; 361} 362const qt = "color-input"; 363function ie(e, a = {}) { 364 const t = `${qt}__${e}`, r = {}; 365 r[t] = true; 366 for (const [i, n] of Object.entries(a)) r[`${t}--${i}`] = !!n; 367 return r; 368} 369const Gt = ["top", "top right", "top left", "top center", "right top", "right", "right bottom", "right center", "bottom right", "bottom", "bottom left", "bottom center", "left top", "left bottom", "left", "left center"], Wt = ["rgb", "rgb object", "rgb string", "hsv", "hsv object", "hsv string", "hsl", "hsl object", "hsl string", "name", "name string", "hex", "hex string", "hex8", "hex8 string"], Ze = "data:image/svg+xml,%3csvg%20width='10'%20height='10'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20height='5'%20width='5'%20y='0'%20x='0'%20fill='%23cccccc'%20shape-rendering='crispEdges'/%3e%3crect%20height='5'%20width='5'%20y='5'%20x='5'%20fill='%23cccccc'%20shape-rendering='crispEdges'/%3e%3c/svg%3e", Yt = (e, a) => { 370 const t = e.__vccOpts || e; 371 for (const [r, i] of a) t[r] = i; 372 return t; 373}, Kt = { name: "ColorPicker", props: ["color", "position", "boxRect", "disableAlpha", "disableTextInputs"], emits: ["updateColor", "hueInputStart", "hueInputEnd", "hueInput", "alphaInputStart", "alphaInputEnd", "alphaInput", "saturationInputStart", "saturationInputEnd", "saturationInput", "ready", "change"], data() { 374 return { h: void 0, s: void 0, v: void 0, a: void 0, hueTranslateX: 0, alphaTranslateX: 0, saturationTranslateX: 0, saturationTranslateY: 0, sliderPointerWidth: 0, saturationPointerWidth: 0, saturationPointerHeight: 0, pickerPositionA: { anchor: "top", offset: 0 }, pickerPositionB: { anchor: "left", offset: 0 }, pickerWidth: 0, pickerHeight: 0, textInputsFormat: "rgb", textInputActive: null, textInputsFreeze: {}, arrowColor: "#0f0f0f", sliderWidth: 0 }; 375}, computed: { pureHueBackground() { 376 return { background: "hsl(" + this.h + ", 100%, 50%)" }; 377}, hexString() { 378 return this.color.toHexString(); 379}, huePointerStyles() { 380 return { transform: "translate(" + (this.hueTranslateX - this.sliderPointerWidth * 0.5) + "px)" }; 381}, alphaPointerStyles() { 382 return { transform: "translate(" + (this.alphaTranslateX - this.sliderPointerWidth * 0.5) + "px)" }; 383}, alphaPointerTransparentStyles() { 384 return { backgroundPosition: -this.alphaTranslateX + "px" }; 385}, alphaPointerColorStyles() { 386 return { opacity: this.a }; 387}, alphaCanvasStyles() { 388 return { background: "linear-gradient(90deg, transparent 0%, " + this.color.toHexString() + " 100%)" }; 389}, saturationPointerStyles() { 390 const e = this.saturationTranslateX - this.saturationPointerWidth * 0.5, a = this.saturationTranslateY + this.saturationPointerHeight * 0.5; 391 return { transform: "translate(" + e + "px, " + a + "px)" }; 392}, arrowsStyles() { 393 return { "--arrow-color": this.arrowColor }; 394}, pickerPosition() { 395 let { top: e, left: a } = this.boxRect; 396 e += window.scrollY, a += window.scrollX; 397 const [t, r] = this.position; 398 return t == "bottom" ? e += this.boxRect.height : t == "top" ? e -= this.pickerHeight : (e += this.boxRect.height * 0.5, e -= this.pickerHeight * 0.5), r == "right" ? t == "center" && (a += this.boxRect.width) : r == "left" ? (a -= this.pickerWidth, t != "center" && (a += this.boxRect.width)) : (a += this.boxRect.width * 0.5, a -= this.pickerWidth * 0.5), { top: e + "px", left: a + "px" }; 399}, textInputs() { 400 const e = this.textInputsFormat, a = {}; 401 if (["name", "hex"].includes(e)) a.hex = this.color.toString("hex"); 402 else { 403 const t = this.color.toString(e).split("(")[1].slice(0, -1).split(", "); 404 e.split("").forEach((r, i) => a[r] = t[i]); 405 } 406 if (this.disableAlpha || (a.a = Number(this.color.getAlpha().toFixed(2))), a.hasOwnProperty("h") && (a.h = Math.round(this.h), a.hasOwnProperty("l"))) { 407 let t = this.s; 408 const r = this.v || 1e-3, i = (2 - t) * r / 2; 409 i < 0.5 && (t *= r / (i * 2), a.s = Math.round(t * 100) + "%"); 410 } 411 return a; 412}, transparentPatternBg() { 413 return { backgroundImage: `url(${Ze})` }; 414} }, methods: { bem: ie, saturationPickStart(e) { 415 this.getCanvasRects(), document.addEventListener("pointerup", this.saturationPickEnd), document.addEventListener("pointermove", this.saturationPickMove), this.saturationPickMove(e), this.emitHook("saturationInputStart", { s: this.s, v: this.v }), this.colorSnapshot = this.color.toRgbString(); 416}, saturationPickEnd(e) { 417 document.removeEventListener("pointerup", this.saturationPickEnd), document.removeEventListener("pointermove", this.saturationPickMove), this.emitHook("saturationInputEnd", { s: this.s, v: this.v }), this.colorSnapshot !== this.color.toRgbString() && this.emitHook("change", { h: this.h, s: this.s, v: this.v, a: this.a }); 418}, saturationPickMove(e) { 419 e.clientX >= this.saturationCanvasRect.x && e.clientX <= this.saturationCanvasRect.right ? this.s = (e.clientX - this.saturationCanvasRect.x) / this.saturationCanvasRect.width : e.clientX < this.saturationCanvasRect.x ? this.s = 0 : this.s = 1, e.clientY >= this.saturationCanvasRect.y && e.clientY <= this.saturationCanvasRect.bottom ? this.v = 1 - (e.clientY - this.saturationCanvasRect.y) / this.saturationCanvasRect.height : e.clientY < this.saturationCanvasRect.y ? this.v = 1 : this.v = 0; 420}, huePickStart(e) { 421 this.getCanvasRects(), document.addEventListener("pointerup", this.huePickEnd), document.addEventListener("pointermove", this.huePickMove), this.huePickMove(e), this.emitHook("hueInputStart", { h: this.h }), this.colorSnapshot = this.color.toRgbString(); 422}, huePickEnd(e) { 423 document.removeEventListener("pointerup", this.huePickEnd), document.removeEventListener("pointermove", this.huePickMove), this.emitHook("hueInputEnd", { h: this.h }), this.colorSnapshot !== this.color.toRgbString() && this.emitHook("change", { h: this.h, s: this.s, v: this.v, a: this.a }); 424}, huePickMove(e) { 425 e.clientX >= this.hueCanvasRect.x && e.clientX <= this.hueCanvasRect.right ? this.h = (e.clientX - this.hueCanvasRect.x) * 360 / this.hueCanvasRect.width : e.clientX < this.hueCanvasRect.x ? this.h = 0 : this.h = 360; 426}, alphaPickStart(e) { 427 this.getCanvasRects(), document.addEventListener("pointerup", this.alphaPickEnd), document.addEventListener("pointermove", this.alphaPickMove), this.alphaPickMove(e), this.emitHook("alphaInputStart", { a: this.a }), this.colorSnapshot = this.color.toRgbString(); 428}, alphaPickEnd(e) { 429 document.removeEventListener("pointerup", this.alphaPickEnd), document.removeEventListener("pointermove", this.alphaPickMove), this.emitHook("alphaInputEnd", { a: this.a }), this.colorSnapshot !== this.color.toRgbString() && this.emitHook("change", { h: this.h, s: this.s, v: this.v, a: this.a }); 430}, alphaPickMove(e) { 431 e.clientX >= this.alphaCanvasRect.x && e.clientX <= this.alphaCanvasRect.right ? this.a = (e.clientX - this.alphaCanvasRect.x) / this.alphaCanvasRect.width : e.clientX < this.alphaCanvasRect.x ? this.a = 0 : this.a = 1; 432}, emitUpdate(e) { 433 e = e || { h: this.h, s: this.s, v: this.v, a: this.a }, this.$emit("updateColor", e); 434}, emitHook(e, a) { 435 if (typeof a == "object") for (let [t, r] of Object.entries(a)) a[t] = Number(r.toFixed(3)); 436 else a = Number(a.toFixed(3)); 437 this.$emit(e, a); 438}, textInputInputHandler(e) { 439 const a = e.target.dataset.component; 440 this.textInputsFreeze[a] = e.target.value; 441 let t = { ...this.textInputsFreeze }; 442 if (t.hasOwnProperty("hex")) { 443 const n = t.a; 444 t = h(t.hex), t.getFormat() !== "hex8" && t.setAlpha(n); 445 } else t = h(t); 446 const r = t.toHsv(); 447 if (this.textInputsFormat === "hsl" && (r.h === 0 && (r.h = parseInt(this.textInputsFreeze.h)), r.v === 0)) { 448 let n = this.textInputsFreeze.s; 449 const o = n.indexOf("%") !== -1; 450 n = parseFloat(n), !n || n < 0 ? n = 0 : (o || n > 1) && (n = Math.min(n * 0.01, 1)); 451 const s = 1e-3, l = n * s + s; 452 n = 2 - 2 * s / l, r.s = n; 453 } 454 const i = { h: 0.5, s: 1e-3, v: 1e-3 }; 455 a !== "a" ? (Object.keys(r).filter((n) => n !== "a").forEach((n) => { 456 const o = this[n], s = r[n]; 457 Math.abs(o - s) > i[n] && (this[n] = s); 458 }), t.getFormat() === "hex8" && t.getOriginalInput().length > 7 && (this.disableAlpha ? Object.assign(this.$data, { h: 0, s: 0, v: 0 }) : (this.a = r.a, this.textInputsFreeze.a = Number(this.a.toFixed(2))))) : this.a = r.a; 459}, textInputFocusHandler(e) { 460 this.textInputActive || (this.textInputsFreeze = { ...this.textInputs }, this.colorSnapshot = this.color.toRgbString()), this.textInputActive = e.target.dataset.component; 461}, textInputBlurHandler(e) { 462 setTimeout(() => { 463 this.textInputActive === e.target.dataset.component && (this.colorSnapshot !== this.color.toRgbString() && this.emitHook("change", { h: this.h, s: this.s, v: this.v, a: this.a }), this.textInputsFreeze = {}, this.textInputActive = null); 464 }, 0); 465}, textInputFormatChange(e) { 466 const a = ["rgb", "name", "hsl"]; 467 this.textInputsFormat; 468 let t = a.indexOf(this.textInputsFormat) + e; 469 t < 0 ? t = a.length - 1 : t === a.length && (t = 0), this.textInputsFormat = a[t]; 470}, getCanvasRects() { 471 this.saturationCanvasRect = this.$refs.saturationCanvas.getBoundingClientRect(), this.hueCanvasRect = this.$refs.hueCanvas.getBoundingClientRect(), this.alphaCanvasRect = this.disableAlpha ? {}
471 : this.$refs.alphaCanvas.getBoundingClientRect(); 472}, init() { 473 const e = this.$refs.pickerRoot, a = window.getComputedStyle(e); 474 Object.assign(this.$data, this.color.toHsv()), window.requestAnimationFrame(() => { 475 const { width: r, height: i } = e.getBoundingClientRect(); 476 this.pickerHeight = i, this.pickerWidth = r, this.getCanvasRects(), this.hueTranslateX = this.h * this.hueCanvasRect.width / 360, this.alphaTranslateX = this.a * this.alphaCanvasRect.width, this.saturationTranslateX = this.s * this.saturationCanvasRect.width, this.saturationTranslateY = -this.v * this.saturationCanvasRect.height, this.sliderPointerWidth = this.$refs.huePointer.offsetWidth, this.saturationPointerWidth = this.$refs.saturationPointer.offsetWidth, this.saturationPointerHeight = this.$refs.saturationPointer.offsetHeight, window.requestAnimationFrame(() => { 477 this.$emit("ready"); 478 }); 479 }); 480 const t = a.getPropertyValue("background-color"); 481 h(t).isDark() && (this.arrowColor = "#fbfbfb"); 482}, fillCanvas() { 483 let e = this.$refs.hueCanvas, a = e.getContext("2d"), t = a.createLinearGradient(e.width, 0, 0, 0); 484 t.addColorStop(0, "hsl(0,100%,50%)"), t.addColorStop(0.17, "hsl(298.8, 100%, 50%)"), t.addColorStop(0.33, "hsl(241.2, 100%, 50%)"), t.addColorStop(0.5, "hsl(180, 100%, 50%)"), t.addColorStop(0.67, "hsl(118.8, 100%, 50%)"), t.addColorStop(0.83, "hsl(61.2,100%,50%)"), t.addColorStop(1, "hsl(360,100%,50%)"), a.fillStyle = t, a.fillRect(0, 0, e.width, e.height), e = this.$refs.saturationCanvas, a = e.getContext("2d"), t = a.createLinearGradient(0, 0, e.width, 0), t.addColorStop(0, "rgba(250,250,250,1)"), t.addColorStop(1, "rgba(250,250,250,0)"), a.fillStyle = t, a.fillRect(0, 0, e.width, e.height), t = a.createLinearGradient(0, e.height, 0, 0), t.addColorStop(0, "rgba(0,0,0,1)"), t.addColorStop(1, "rgba(0,0,0,0)"), a.fillStyle = t, a.fillRect(0, 0, e.width, e.height); 485} }, watch: { h(e, a) { 486 this.hueTranslateX = this.h * this.hueCanvasRect.width / 360, a !== void 0 && (this.emitUpdate(), this.emitHook("hueInput", { h: this.h })); 487}, s(e, a) { 488 this.saturationTranslateX = this.s * this.saturationCanvasRect.width, a !== void 0 && (this.emitUpdate(), this.emitHook("saturationInput", { s: this.s, v: this.v })); 489}, v(e, a) { 490 this.saturationTranslateY = -this.v * this.saturationCanvasRect.height, a !== void 0 && (this.emitUpdate(), this.emitHook("saturationInput", { s: this.s, v: this.v })); 491}, a(e, a) { 492 this.alphaTranslateX = this.a * this.alphaCanvasRect.width, a !== void 0 && (this.emitUpdate(), this.emitHook("alphaInput", { a: this.a })); 493} }, mounted() { 494 this.getCanvasRects(), this.fillCanvas(); 495}, beforeUnmount() { 496} }, Jt = ["for"], Qt = ["value", "id", "data-component"]; 497function Zt(e, a, t, r, i, n) { 498 return M(), F("div", { ref: "pickerRoot", style: E([n.pickerPosition, { "--box-width": t.boxRect.width + "px", "--box-height": t.boxRect.height + "px" }]), class: S(n.bem("popup", { [t.position[0]]: true, [t.position[1]]: true, [t.position.join("-")]: true })) }, [u("div", { class: S(n.bem("saturation-area")), style: E(n.pureHueBackground), onPointerdown: a[0] || (a[0] = (...o) => n.saturationPickStart && n.saturationPickStart(...o)) }, [u("canvas", { class: S(n.bem("slider-canvas")), ref: "saturationCanvas" }, null, 2), u("div", { class: S(n.bem("saturation-pointer")), ref: "saturationPointer", style: E([n.saturationPointerStyles, { background: n.hexString }]) }, null, 6)], 38), u("div", { class: S(n.bem("slider")), onPointerdown: a[1] || (a[1] = (...o) => n.huePickStart && n.huePickStart(...o)) }, [u("div", { class: S(n.bem("slider-container")) }, [u("canvas", { class: S(n.bem("slider-canvas")), ref: "hueCanvas" }, null, 2)], 2), u("div", { class: S(n.bem("slider-active-area")) }, [u("div", { class: S(n.bem("slider-pointer")), ref: "huePointer", style: E([n.huePointerStyles, n.pureHueBackground]) }, null, 6)], 2)], 34), t.disableAlpha ? O("", true) : (M(), F("div", { key: 0, class: S(n.bem("slider")), onPointerdown: a[2] || (a[2] = (...o) => n.alphaPickStart && n.alphaPickStart(...o)) }, [u("div", { class: S(n.bem("slider-container")), style: E(n.transparentPatternBg) }, [u("div", { class: S(n.bem("slider-canvas")), ref: "alphaCanvas", style: E(n.alphaCanvasStyles) }, null, 6)], 6), u("div", { class: S(n.bem("slider-active-area")) }, [u("div", { class: S(n.bem("slider-pointer")), ref: "alphaPointer", style: E(n.alphaPointerStyles) }, [u("div", { class: S(n.bem("pointer-transparent")), style: E([n.alphaPointerTransparentStyles, n.transparentPatternBg]) }, [u("div", { class: S(n.bem("pointer-color")), style: E([n.alphaPointerColorStyles, { background: n.hexString }]) }, null, 6)], 6)], 6)], 2)], 34)), t.disableTextInputs ? O("", true) : (M(), F("div", { key: 1, class: S(n.bem("text-inputs-area")), style: E({ "--outline-color": n.hexString }) }, [u("div", { class: S(n.bem("text-inputs-wrapper")) }, [(M(true), F(ue, null, _e(i.textInputActive ? i.textInputsFreeze : n.textInputs, (o, s) => (M(), F("div", { key: "text-input-" + s, class: S(n.bem("text-input-container")) }, [u("label", { for: "text-input-" + s }, C(s), 9, Jt), u("input", { value: o, class: S(n.bem("text-input", { [s]: true })), autocomplete: "off", spellcheck: "false", id: "text-input-" + s, "data-component": s, onInput: a[3] || (a[3] = ye((...l) => n.textInputInputHandler && n.textInputInputHandler(...l), ["prevent"])), onFocus: a[4] || (a[4] = (...l) => n.textInputFocusHandler && n.textInputFocusHandler(...l)), onBlur: a[5] || (a[5] = (...l) => n.textInputBlurHandler && n.textInputBlurHandler(...l)), onKeypress: a[6] || (a[6] = Ue((l) => l.target.blur(), ["enter"])) }, null, 42, Qt)], 2))), 128))], 2), u("div", { class: S(n.bem("text-format-arrows")), style: E(n.arrowsStyles) }, [u("div", { class: S(n.bem("arrow-up")), onClick: a[7] || (a[7] = (o) => n.textInputFormatChange(-1)) }, null, 2), u("div", { class: S(n.bem("arrow-down")), onClick: a[8] || (a[8] = (o) => n.textInputFormatChange(1)) }, null, 2)], 6)], 6))], 6); 499} 500const ea = Yt(Kt, [["render", Zt]]), ve = nt({ __name: "color-input", props: Y({ format: { default: "rgb" }, position: { default: "bottom" }, transition: { default: "color-input__popup-" }, disableAlpha: { type: Boolean }, disabled: { type: Boolean }, disableTextInputs: { type: Boolean } }, { modelValue: { required: true }, modelModifiers: {} }), emits: Y(["mounted", "beforeUnmount", "update:modelValue", "pickStart", "pickEnd", "hueInputStart", "hueInputEnd", "hueInput", "alphaInputStart", "alphaInputEnd", "alphaInput", "s
500aturationInputStart", "saturationInputEnd", "saturationInput", "change"], ["update:modelValue"]), setup(e, { expose: a, emit: t }) { 501 const r = (f, g) => { 502 for (; !/^(body|html)$/i.test(f.tagName); ) { 503 if (f === g) return true; 504 f = f.parentNode; 505 } 506 return false; 507 }, i = e, n = ne(e, "modelValue"), o = t, s = lt(null), l = $(false), c = $(false), m = $(false), y = $({}), z = $("rgb"), P = $("string"), k = $(null), v = $(null), p = $(null), A = G(() => ({ backgroundImage: `url(${Ze})` })), X = G(() => { 508 var f; 509 return { background: (f = s.value) == null ? void 0 : f.toRgbString() }; 510 }), at = G(() => { 511 let f = i.position.toLowerCase(); 512 Gt.includes(f) || (f && console.warn("[vue-color-input]: invalid position -> " + f), f = "bottom center"); 513 const g = f.split(" "); 514 return g[1] = g[1] || "center", ["top", "bottom"].includes(g[0]) || ["right", "left"].includes(g[1]) || g.reverse(), g; 515 }), K = G(() => { 516 let f = i.format, g, w = false; 517 f ? (f = f.toLowerCase(), Wt.includes(f) ? w = true : (console.warn("[vue-color-input]: invalid format -> " + f), g = z.value)) : g = z.value; 518 const pe = f.split(" "); 519 let ge; 520 const Me = pe.findIndex((rt) => ["string", "object"].includes(rt)); 521 return Me < 0 ? ge = ["rgb", "hsv", "hsl"].includes(f[0]) ? P.value : "string" : ge = pe.splice(Me, 1)[0], g = pe[0], { type: ge, format: g, force: w }; 522 }), ke = G(() => { 523 const f = K.value; 524 return f.force && ["hex", "name"].includes(f.format) ? true : i.disableAlpha; 525 }), we = () => { 526 l.value || i.disabled || (fe(), l.value = true, c.value = false, m.value = true, p.value.init(), document.addEventListener("pointerdown", Z), window.addEventListener("resize", fe), o("pickStart")); 527 }, Z = (f) => { 528 !l.value || f && r(f.target, p.value.$refs.pickerRoot) || (document.removeEventListener("pointerdown", Z), window.removeEventListener("resize", fe), l.value = false, o("pickEnd")); 529 }, Se = () => { 530 s.value = h(n.value); 531 let f = s.value.getFormat(); 532 z.value = f || "rgb"; 533 let g = typeof n.value; 534 P.value = ["string", "object"].includes(g) ? g : "string", K.value, k.value = null, s.value.isValid() || console.warn("[vue-color-input]: invalid color -> " + s.value.getOriginalInput()); 535 }, ce = (f) => { 536 var g; 537 f && (s.value = h(f)); 538 let w = K.value.format; 539 s.value.getAlpha() < 1 && ["hex", "name"].includes(w) && (K.value.force ? s.value.setAlpha(1) : w = "rgb"), K.value.type === "object" ? k.value = ((g = s.value) == null ? void 0 : g["to" + w.charAt(0).toUpperCase() + w.slice(1)]()) || null : k.value = s.value.toString(K.value.format), o("update:modelValue", k.value); 540 }, fe = () => { 541 y.value = v.value.getBoundingClientRect(); 542 }; 543 return Ne(() => { 544 Se(), o("mounted"); 545 }), it(() => { 546 Z(), o("beforeUnmount"); 547 }), J(() => n.value, () => { 548 let f = typeof n.value == "object" ? JSON.stringify(n.value) : n.value, g = typeof k.value == "object" ? JSON.stringify(k.value) : k.value; 549 f !== g && (Se(), l.value && Ae(() => { 550 p.value.init(); 551 })); 552 }), J(() => i.disabled, () => { 553 Z(); 554 }), J(() => ke.value, (f) => { 555 f && (s.value.setAlpha(1), ce()), l.value && Ae(() => { 556 p.value.init(); 557 }); 558 }), J(() => i.format, () => { 559 ce(); 560 }), a({ pickStart: we, pickEnd: Z, color: s, active: l }), (f, g) => (M(), F(ue, null, [u("div", { class: S([f.$attrs.class, x(ie)("box", { disabled: f.disabled, active: l.value })]), onClick: ye(we, ["stop"]), ref_key: "root", ref: v }, [u("div", { class: S(x(ie)("box-inner", { active: l.value })), style: E(A.value) }, [u("div", { class: S(x(ie)("box-color")), style: E(X.value) }, null, 6)], 6)], 2), (M(), W(ot, { to: "body" }, [b(je, { name: f.transition }, { default: H(() => [s.value ? xe((M(), W(ea, { key: 0, class: S(f.$attrs.class), color: s.value, position: at.value, "disable-alpha": ke.value, boxRect: y.value, "disable-text-inputs": f.disableTextInputs, style: E({ visibility: m.value ? "hidden" : "" }), onReady: g[0] || (g[0] = (w) => m.value = false), onUpdateColor: ce, onHueInputStart: g[1] || (g[1] = (w) => f.$emit("hueInputStart", w)), onHueInputEnd: g[2] || (g[2] = (w) => f.$emit("hueInputEnd", w)), onHueInput: g[3] || (g[3] = (w) => f.$emit("hueInput", w)), onAlphaInputStart: g[4] || (g[4] = (w) => f.$emit("alphaInputStart", w)), onAlphaInputEnd: g[5] || (g[5] = (w) => f.$emit("alphaInputEnd", w)), onAlphaInput: g[6] || (g[6] = (w) => f.$emit("alphaInput", w)), onSaturationInputStart: g[7] || (g[7] = (w) => f.$emit("saturationInputStart", w)), onSaturationInputEnd: g[8] || (g[8] = (w) => f.$emit("saturationInputEnd", w)), onSaturationInput: g[9] || (g[9] = (w) => f.$emit("saturationInput", w)), onChange: g[10] || (g[10] = (w) => f.$emit("change", w)), ref_key: "picker", ref: p }, null, 8, ["class", "color", "position", "disable-alpha", "boxRect", "disable-text-inputs", "style"])), [[st, l.value]]) : O("", true)]), _: 1 }
560, 8, ["name"])]))], 64)); 561} }), ta = { class: "relative rounded-md border border-gray-300 bg-white p-3" }, aa = { class: "sr-only" }, ra = { class: "py-1" }, na = { class: "flex space-x-2" }, ia = { class: "truncate" }, sa = { class: "group/copy relative mr-5 block truncate text-sm font-semibold uppercase text-gray-900" }, oa = { class: "block min-w-0 truncate text-xs text-gray-400" }, la = { class: "space-y-4" }, ua = { for: "name", class: "mb-1 block text-sm font-medium text-gray-900" }, ha = { for: "value", class: "mb-1 block text-sm font-medium text-gray-900" }, da = { class: "flex space-x-2" }, ca = { class: "flex w-full items-center space-x-2 border p-1 px-1.5" }, fa = { class: "text-sm text-gray-500" }, pa = { __name: "ColorPickerFieldItem", props: Y({ editable: { type: Boolean, default: true } }, { modelValue: { type: Object }, modelModifiers: {} }), emits: Y(["delete"], ["update:modelValue"]), setup(e, { emit: a }) { 562 const t = ne(e, "modelValue"), r = a, { t: i } = Oe(), { trigger: n, popper: o } = ct({ placement: "bottom-end", strategy: "fixed" }), s = $(false), l = $(false), c = $({}), m = $(_.cloneDeep(t.value)), { copy: y } = pt(), z = () => { 563 r("delete"), s.value = false; 564 }, P = () => { 565 m.value.name ? c.value.name = "" : c.value.name = i("Name is required"), m.value.value ? c.value.value = "" : c.value.value = i("Value is required"), !(c.value.name || c.value.value) && (t.value = { name: m.value.name, value: m.value.value, type: m.value.type }, l.value = false); 566 }; 567 return (k, v) => (M(), F("div", ta, [b(x(We), { as: "div", class: "absolute right-2.5 top-2.5" }, { default: H(() => [u("div", { ref_key: "popoverButton", ref: n }, [b(x(De), { class: "cursor-pointer p-1 text-gray-500 hover:text-gray-600" }, { default: H(() => [u("span", aa, C(k.$t("Open options")), 1), b(x(qe), { class: "h-6 w-6 flex-shrink-0" })]), _: 1 })], 512), b(x(Ge), { ref_key: "popoverPanel", ref: o, class: "absolute right-0 z-20 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" }, { default: H(() => [u("div", ra, [e.editable ? (M(), W(x(Q), { key: 0, class: "group flex items-center" }, { default: H(() => [u("span", { class: "block cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100", onClick: v[0] || (v[0] = (p) => l.value = true) }, [b(x(Ye), { class: "mr-4 h-5 w-5 text-gray-400 group-hover:text-gray-500" }), U(" " + C(k.$t("Edit")), 1)])]), _: 1 })) : O("", true), b(x(Q), { class: "group flex items-center" }, { default: H(() => [u("span", { class: "block cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100", onClick: v[1] || (v[1] = (p) => x(y)(t.value.value)) }, [b(x(gt), { class: "mr-4 h-5 w-5 text-gray-400 group-hover:text-gray-500" }), U(" " + C(k.$t("Copy")), 1)])]), _: 1 }), e.editable ? (M(), W(x(Q), { key: 1, class: "group flex items-center" }, { default: H(() => [u("span", { class: "block cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100", onClick: v[2] || (v[2] = (p) => s.value = true) }, [b(x(Ke), { class: "mr-4 h-5 w-5 text-gray-400 group-hover:text-gray-500" }), U(" " + C(k.$t("Delete")), 1)])]), _: 1 })) : O("", true)])]), _: 1 }, 512)]), _: 1 }), u("div", na, [b(x(ve), { modelValue: t.value.value, "onUpdate:modelValue": v[3] || (v[3] = (p) => t.value.value = p), format: t.value.type, disabled: "", "disable-alpha": "", "disable-text-inputs": "", class: "shrink-0 border border-gray-200" }, null, 8, ["modelValue", "format"]), u("div", ia, [u("span", sa, [U(C(t.value.value) + " ", 1), b(dt, { value: t.value.value }, null, 8, ["value"])]), u("span", oa, C(t.value.name), 1)])]), b(re, { open: l.value, color: "blue", size: "3xl", "confirm-text": k.$t("Save"), onCancel: v[8] || (v[8] = (p) => l.value = false), onClosed: v[9] || (v[9] = (p) => l.value = false), onConfirmed: P }, { title: H(() => [U(C(k.$t("Edit color")), 1)]), content: H(() => [u("div", la, [u("div", null, [u("label", ua, C(k.$t("Name")), 1), b(ae, { modelValue: m.value.name, "onUpdate:modelValue": v[4] || (v[4] = (p) => m.value.name = p), placeholder: k.$t("Give your color a name") }, null, 8, ["modelValue", "placeholder"]), b(se, { message: c.value.name }, null, 8, ["message"])]), u("div", null, [u("label", ha, C(k.$t("Value")), 1
567), u("div", da, [u("div", ca, [b(x(ve), { modelValue: m.value.value, "onUpdate:modelValue": v[5] || (v[5] = (p) => m.value.value = p), format: m.value.type, "disable-alpha": "", "disable-text-inputs": "", class: "shrink-0 border border-gray-200" }, null, 8, ["modelValue", "format"]), b(ae, { modelValue: m.value.value, "onUpdate:modelValue": v[6] || (v[6] = (p) => m.value.value = p), "input-class": "p-0 uppercase border-none shadow-none bg-transparent focus:outline-none focus:ring-0 focus:border-0 w-full" }, null, 8, ["modelValue"])]), xe(u("select", { id: "type", "onUpdate:modelValue": v[7] || (v[7] = (p) => m.value.type = p), name: "type", class: "border-gray-200" }, [...v[12] || (v[12] = [u("option", { value: "hex" }, "HEX", -1), u("option", { value: "rgb" }, "RGB", -1), u("option", { value: "hsv" }, "HSV", -1), u("option", { value: "hsl" }, "HSL", -1)])], 512), [[ze, m.value.type]])]), b(se, { message: c.value.value }, null, 8, ["message"])])])]), _: 1 }, 8, ["open", "confirm-text"]), b(re, { open: s.value, color: "red", title: k.$t("Confirm delete"), content: k.$t("Are you sure you want to delete this color?"), onCancel: v[10] || (v[10] = (p) => s.value = false), onClosed: v[11] || (v[11] = (p) => s.value = false), onConfirmed: z }, { content: H(() => [u("p", fa, C(k.$t("This action cannot be undone")), 1)]), _: 1 }, 8, ["open", "title", "content"])])); 568} }; 569function le(e) { 570 "@babel/helpers - typeof"; 571 return le = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) { 572 return typeof a; 573 } : function(a) { 574 return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a; 575 }, le(e); 576} 577var ga = /^\s+/, ma = /\s+$/; 578function d(e, a) { 579 if (e = e || "", a = a || {}, e instanceof d) return e; 580 if (!(this instanceof d)) return new d(e, a); 581 var t = va(e); 582 this._originalInput = e, this._r = t.r, this._g = t.g, this._b = t.b, this._a = t.a, this._roundA = Math.round(100 * this._a) / 100, this._format = a.format || t.format, this._gradientType = a.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = t.ok; 583} 584d.prototype = { isDark: function() { 585 return this.getBrightness() < 128; 586}, isLight: function() { 587 return !this.isDark(); 588}, isValid: function() { 589 return this._ok; 590}, getOriginalInput: function() { 591 return this._originalInput; 592}, getFormat: function() { 593 return this._format; 594}, getAlpha: function() { 595 return this._a; 596}, getBrightness: function() { 597 var a = this.toRgb(); 598 return (a.r * 299 + a.g * 587 + a.b * 114) / 1e3; 599}, getLuminance: function() { 600 var a = this.toRgb(), t, r, i, n, o, s; 601 return t = a.r / 255, r = a.g / 255, i = a.b / 255, t <= 0.03928 ? n = t / 12.92 : n = Math.pow((t + 0.055) / 1.055, 2.4), r <= 0.03928 ? o = r / 12.92 : o = Math.pow((r + 0.055) / 1.055, 2.4), i <= 0.03928 ? s = i / 12.92 : s = Math.pow((i + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * o + 0.0722 * s; 602}, setAlpha: function(a) { 603 return this._a = et(a), this._roundA = Math.round(100 * this._a) / 100, this; 604}, toHsv: function() { 605 var a = Ee(this._r, this._g, this._b); 606 return { h: a.h * 360, s: a.s, v: a.v, a: this._a }; 607}, toHsvString: function() { 608 var a = Ee(this._r, this._g, this._b), t = Math.round(a.h * 360), r = Math.round(a.s * 100), i = Math.round(a.v * 100); 609 return this._a == 1 ? "hsv(" + t + ", " + r + "%, " + i + "%)" : "hsva(" + t + ", " + r + "%, " + i + "%, " + this._roundA + ")"; 610}, toHsl: function() { 611 var a = Fe(this._r, this._g, this._b); 612 return { h: a.h * 360, s: a.s, l: a.l, a: this._a }; 613}, toHslString: function() { 614 var a = Fe(this._r, this._g, this._b), t = Math.round(a.h * 360), r = Math.round(a.s * 100), i = Math.round(a.l * 100); 615 return this._a == 1 ? "hsl(" + t + ", " + r + "%, " + i + "%)" : "hsla(" + t + ", " + r + "%, " + i + "%, " + this._roundA + ")"; 616}, toHex: function(a) { 617 return Ve(this._r, this._g, this._b, a); 618}, toHexString: function(a) { 619 return "#" + this.toHex(a); 620}, toHex8: function(a) { 621 return _a(this._r, this._g, this._b, this._a, a); 622}, toHex8String: function(a) { 623 return "#" + this.toHex8(a); 624}, toRgb: function() { 625 return { r: Math.round(this._r), g: Math.round(this._g), b: Math.round(this._b), a: this._a }; 626}, toRgbString: function() { 627 return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")"; 628}, toPercentageRgb: function() { 629 return { r: Math.round(I(this._r, 255) * 100) + "%", g: Math.round(I(this._g, 255) * 100) + "%", b: Math.round(I(this._b, 255) * 100) + "%", a: this._a }; 630}, toPercentageRgbString: function() { 631 return this._a == 1 ? "rgb(" + Math.round(I(this._r, 255) * 100) + "%, " + Math.round(I(this._g, 255) * 100) + "%, " + Math.round(I(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(I(this._r, 255) * 100) + "%, " + Math.round(I(this._g, 255) * 100) + "%, " + Math.round(I(this._b, 255) * 100) + "%, " + this._roundA + ")"; 632}, toName: function() { 633 return this._a === 0 ? "transparent" : this._a < 1 ? false : Fa[Ve(this._r, this._g, this._b, true)] || false; 634}, toFilter: function(a) { 635 var t = "#" + Te(this._r, this._g, this._b, this._a), r = t, i = this._gradientType ? "GradientType = 1, " : ""; 636 if (a) { 637 var n = d(a); 638 r = "#" + Te(n._r, n._g, n._b, n._a); 639 } 640 return "progid:DXImageTransform.Microsoft.gradient(" + i + "startColorstr=" + t + ",endColorstr=" + r + ")"; 641}, toString: function(a) { 642 var t = !!a; 643 a = a || this._format; 644 var r = false, i = this._a < 1 && this._a >= 0, n = !t && i && (a === "hex" || a === "hex6" || a === "hex3" || a === "hex4" || a === "hex8" || a === "name"); 645 return n ? a === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (a === "rgb" && (r = this.toRgbString()), a === "prgb" && (r = this.toPercentageRgbString()), (a === "hex" || a === "hex6") && (r = this.toHexString()), a === "hex3" && (r = this.toHexString(true)), a === "hex4" && (r = this.toHex8String(true)), a === "hex8" && (r = this.toHex8String()), a === "name" && (r = this.toName()), a === "hsl" && (r = this.toHslString()), a === "hsv" && (r = this.toHsvString()), r || this.toHexString()); 646}, clone: function() { 647 return d(this.toString()); 648}, _applyModification: function(a, t) { 649 var r = a.apply(null, [this].concat([].slice.call(t))); 650 return this._r = r._r, this._g = r._g, this._b = r._b, this.setAlpha(r._a), this; 651}, lighten: function() { 652 return this._applyModification(Ma, arguments); 653}, brighten: function() { 654 return this._applyModification(Aa, arguments); 655}, darken: function() { 656 return this._applyModification(Ca, arguments); 657}, desaturate: function() { 658 return this._applyModification(ka, arguments); 659}, saturate: function() { 660 return this._applyModification(wa, arguments); 661}, greyscale: function() { 662 return this._applyModification(Sa, arguments); 663}, spin: function() { 664 return this._applyModification(Ra, arguments); 665}, _applyCombination: function(a, t) { 666 return a.apply(null, [this].concat([].slice.call(t))); 667}, analogous: function() { 668 return this._applyCombination(Ha, arguments); 669}, complement: function() { 670 return this._applyCombination(Ia, arguments); 671}, monochromatic: function() { 672 return this._applyCombination(Pa, arguments); 673}, splitcomplement: function() { 674 return this._applyCombination($a, arguments); 675}, triad: function() { 676 return this._applyCombination(Be, [3]); 677}, tetrad: function() { 678 return this._applyCombination(Be, [4]); 679} }; 680d.fromRatio = function(e, a) { 681 if (le(e) == "object") { 682 var t = {}; 683 for (var r in e) e.hasOwnProperty(r) && (r === "a" ? t[r] = e[r] : t[r] = te(e[r])); 684 e = t; 685 } 686 return d(e, a); 687}; 688function va(e) { 689 var a = { r: 0, g: 0, b: 0 }, t = 1, r = null, i = null, n = null, o = false, s = false;
vendor: 10,404 bytes, lines 690-891
690 return typeof e == "string" && (e = Ba(e)), le(e) == "object" && (q(e.r) && q(e.g) && q(e.b) ? (a = ba(e.r, e.g, e.b), o = true, s = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : q(e.h) && q(e.s) && q(e.v) ? (r = te(e.s), i = te(e.v), a = xa(e.h, r, i), o = true, s = "hsv") : q(e.h) && q(e.s) && q(e.l) && (r = te(e.s), n = te(e.l), a = ya(e.h, r, n), o = true, s = "hsl"), e.hasOwnProperty("a") && (t = e.a)), t = et(t), { ok: o, format: e.format || s, r: Math.min(255, Math.max(a.r, 0)), g: Math.min(255, Math.max(a.g, 0)), b: Math.min(255, Math.max(a.b, 0)), a: t }; 691} 692function ba(e, a, t) { 693 return { r: I(e, 255) * 255, g: I(a, 255) * 255, b: I(t, 255) * 255 }; 694} 695function Fe(e, a, t) { 696 e = I(e, 255), a = I(a, 255), t = I(t, 255); 697 var r = Math.max(e, a, t), i = Math.min(e, a, t), n, o, s = (r + i) / 2; 698 if (r == i) n = o = 0; 699 else { 700 var l = r - i; 701 switch (o = s > 0.5 ? l / (2 - r - i) : l / (r + i), r) { 702 case e: 703 n = (a - t) / l + (a < t ? 6 : 0); 704 break; 705 case a: 706 n = (t - e) / l + 2; 707 break; 708 case t: 709 n = (e - a) / l + 4; 710 break; 711 } 712 n /= 6; 713 } 714 return { h: n, s: o, l: s }; 715} 716function ya(e, a, t) { 717 var r, i, n; 718 e = I(e, 360), a = I(a, 100), t = I(t, 100); 719 function o(c, m, y) { 720 return y < 0 && (y += 1), y > 1 && (y -= 1), y < 1 / 6 ? c + (m - c) * 6 * y : y < 1 / 2 ? m : y < 2 / 3 ? c + (m - c) * (2 / 3 - y) * 6 : c; 721 } 722 if (a === 0) r = i = n = t; 723 else { 724 var s = t < 0.5 ? t * (1 + a) : t + a - t * a, l = 2 * t - s; 725 r = o(l, s, e + 1 / 3), i = o(l, s, e), n = o(l, s, e - 1 / 3); 726 } 727 return { r: r * 255, g: i * 255, b: n * 255 }; 728} 729function Ee(e, a, t) { 730 e = I(e, 255), a = I(a, 255), t = I(t, 255); 731 var r = Math.max(e, a, t), i = Math.min(e, a, t), n, o, s = r, l = r - i; 732 if (o = r === 0 ? 0 : l / r, r == i) n = 0; 733 else { 734 switch (r) { 735 case e: 736 n = (a - t) / l + (a < t ? 6 : 0); 737 break; 738 case a: 739 n = (t - e) / l + 2; 740 break; 741 case t: 742 n = (e - a) / l + 4; 743 break; 744 } 745 n /= 6; 746 } 747 return { h: n, s: o, v: s }; 748} 749function xa(e, a, t) { 750 e = I(e, 360) * 6, a = I(a, 100), t = I(t, 100); 751 var r = Math.floor(e), i = e - r, n = t * (1 - a), o = t * (1 - i * a), s = t * (1 - (1 - i) * a), l = r % 6, c = [t, o, n, n, s, t][l], m = [s, t, t, o, n, n][l], y = [n, n, s, t, t, o][l]; 752 return { r: c * 255, g: m * 255, b: y * 255 }; 753} 754function Ve(e, a, t, r) { 755 var i = [j(Math.round(e).toString(16)), j(Math.round(a).toString(16)), j(Math.round(t).toString(16))]; 756 return r && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join(""); 757} 758function _a(e, a, t, r, i) { 759 var n = [j(Math.round(e).toString(16)), j(Math.round(a).toString(16)), j(Math.round(t).toString(16)), j(tt(r))]; 760 return i && n[0].charAt(0) == n[0].charAt(1) && n[1].charAt(0) == n[1].charAt(1) && n[2].charAt(0) == n[2].charAt(1) && n[3].charAt(0) == n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(""); 761} 762function Te(e, a, t, r) { 763 var i = [j(tt(r)), j(Math.round(e).toString(16)), j(Math.round(a).toString(16)), j(Math.round(t).toString(16))]; 764 return i.join(""); 765} 766d.equals = function(e, a) { 767 return !e || !a ? false : d(e).toRgbString() == d(a).toRgbString(); 768}; 769d.random = function() { 770 return d.fromRatio({ r: Math.random(), g: Math.random(), b: Math.random() }); 771}; 772function ka(e, a) { 773 a = a === 0 ? 0 : a || 10; 774 var t = d(e).toHsl(); 775 return t.s -= a / 100, t.s = de(t.s), d(t); 776} 777function wa(e, a) { 778 a = a === 0 ? 0 : a || 10; 779 var t = d(e).toHsl(); 780 return t.s += a / 100, t.s = de(t.s), d(t); 781} 782function Sa(e) { 783 return d(e).desaturate(100); 784} 785function Ma(e, a) { 786 a = a === 0 ? 0 : a || 10; 787 var t = d(e).toHsl(); 788 return t.l += a / 100, t.l = de(t.l), d(t); 789} 790function Aa(e, a) { 791 a = a === 0 ? 0 : a || 10; 792 var t = d(e).toRgb(); 793 return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(a / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(a / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(a / 100)))), d(t); 794} 795function Ca(e, a) { 796 a = a === 0 ? 0 : a || 10; 797 var t = d(e).toHsl(); 798 return t.l -= a / 100, t.l = de(t.l), d(t); 799} 800function Ra(e, a) { 801 var t = d(e).toHsl(), r = (t.h + a) % 360; 802 return t.h = r < 0 ? 360 + r : r, d(t); 803} 804function Ia(e) { 805 var a = d(e).toHsl(); 806 return a.h = (a.h + 180) % 360, d(a); 807} 808function Be(e, a) { 809 if (isNaN(a) || a <= 0) throw new Error("Argument to polyad must be a positive number"); 810 for (var t = d(e).toHsl(), r = [d(e)], i = 360 / a, n = 1; n < a; n++) r.push(d({ h: (t.h + n * i) % 360, s: t.s, l: t.l })); 811 return r; 812} 813function $a(e) { 814 var a = d(e).toHsl(), t = a.h; 815 return [d(e), d({ h: (t + 72) % 360, s: a.s, l: a.l }), d({ h: (t + 216) % 360, s: a.s, l: a.l })]; 816} 817function Ha(e, a, t) { 818 a = a || 6, t = t || 30; 819 var r = d(e).toHsl(), i = 360 / t, n = [d(e)]; 820 for (r.h = (r.h - (i * a >> 1) + 720) % 360; --a; ) r.h = (r.h + i) % 360, n.push(d(r)); 821 return n; 822} 823function Pa(e, a) { 824 a = a || 6; 825 for (var t = d(e).toHsv(), r = t.h, i = t.s, n = t.v, o = [], s = 1 / a; a--; ) o.push(d({ h: r, s: i, v: n })), n = (n + s) % 1; 826 return o; 827} 828d.mix = function(e, a, t) { 829 t = t === 0 ? 0 : t || 50; 830 var r = d(e).toRgb(), i = d(a).toRgb(), n = t / 100, o = { r: (i.r - r.r) * n + r.r, g: (i.g - r.g) * n + r.g, b: (i.b - r.b) * n + r.b, a: (i.a - r.a) * n + r.a }; 831 return d(o); 832}; 833d.readability = function(e, a) { 834 var t = d(e), r = d(a); 835 return (Math.max(t.getLuminance(), r.getLuminance()) + 0.05) / (Math.min(t.getLuminance(), r.getLuminance()) + 0.05); 836}; 837d.isReadable = function(e, a, t) { 838 var r = d.readability(e, a), i, n; 839 switch (n = false, i = La(t), i.level + i.size) { 840 case "AAsmall": 841 case "AAAlarge": 842 n = r >= 4.5; 843 break; 844 case "AAlarge": 845 n = r >= 3; 846 break; 847 case "AAAsmall": 848 n = r >= 7; 849 break; 850 } 851 return n; 852}; 853d.mostReadable = function(e, a, t) { 854 var r = null, i = 0, n, o, s, l; 855 t = t || {}, o = t.includeFallbackColors, s = t.level, l = t.size; 856 for (var c = 0; c < a.length; c++) n = d.readability(e, a[c]), n > i && (i = n, r = d(a[c])); 857 return d.isReadable(e, r, { level: s, size: l }) || !o ? r : (t.includeFallbackColors = false, d.mostReadable(e, ["#fff", "#000"], t)); 858}; 859var be = d.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, Fa = d.hexNames = Ea(be); 860function Ea(e) { 861 var a = {}; 862 for (var t in e) e.hasOwnProperty(t) && (a[e[t]] = t); 863 return a; 864} 865function et(e) { 866 return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e; 867} 868function I(e, a) { 869 Va(e) && (e = "100%"); 870 var t = Ta(e); 871 return e = Math.min(a, Math.max(0, parseFloat(e))), t && (e = parseInt(e * a, 10) / 100), Math.abs(e - a) < 1e-6 ? 1 : e % a / parseFloat(a); 872} 873function de(e) { 874 return Math.min(1, Math.max(0, e)); 875} 876function T(e) { 877 return parseInt(e, 16); 878} 879function Va(e) { 880 return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1; 881} 882function Ta(e) { 883 return typeof e == "string" && e.indexOf("%") != -1; 884} 885function j(e) { 886 return e.length == 1 ? "0" + e : "" + e; 887} 888function te(e) { 889 return e <= 1 && (e = e * 100 + "%"), e; 890} 891function tt(e) {
892 return Math.round(parseFloat(e) * 255).toString(16); 893} 894function Le(e) { 895 return T(e) / 255; 896} 897var L = (function() { 898 var e = "[-\\+]?\\d+%?", a = "[-\\+]?\\d*\\.\\d+%?", t = "(?:" + a + ")|(?:" + e + ")", r = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?", i = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?"; 899 return { CSS_UNIT: new RegExp(t), rgb: new RegExp("rgb" + r), rgba: new RegExp("rgba" + i), hsl: new RegExp("hsl" + r), hsla: new RegExp("hsla" + i), hsv: new RegExp("hsv" + r), hsva: new RegExp("hsva" + i), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; 900})(); 901function q(e) { 902 return !!L.CSS_UNIT.exec(e); 903} 904function Ba(e) { 905 e = e.replace(ga, "").replace(ma, "").toLowerCase(); 906 var a = false; 907 if (be[e]) e = be[e], a = true; 908 else if (e == "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; 909 var t; 910 return (t = L.rgb.exec(e)) ? { r: t[1], g: t[2], b: t[3] } : (t = L.rgba.exec(e)) ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = L.hsl.exec(e)) ? { h: t[1], s: t[2], l: t[3] } : (t = L.hsla.exec(e)) ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = L.hsv.exec(e)) ? { h: t[1], s: t[2], v: t[3] } : (t = L.hsva.exec(e)) ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = L.hex8.exec(e)) ? { r: T(t[1]), g: T(t[2]), b: T(t[3]), a: Le(t[4]), format: a ? "name" : "hex8" } : (t = L.hex6.exec(e)) ? { r: T(t[1]), g: T(t[2]), b: T(t[3]), format: a ? "name" : "hex" } : (t = L.hex4.exec(e)) ? { r: T(t[1] + "" + t[1]), g: T(t[2] + "" + t[2]), b: T(t[3] + "" + t[3]), a: Le(t[4] + "" + t[4]), format: a ? "name" : "hex8" } : (t = L.hex3.exec(e)) ? { r: T(t[1] + "" + t[1]), g: T(t[2] + "" + t[2]), b: T(t[3] + "" + t[3]), format: a ? "name" : "hex" } : false; 911} 912function La(e) { 913 var a, t; 914 return e = e || { level: "AA", size: "small" }, a = (e.level || "AA").toUpperCase(), t = (e.size || "small").toLowerCase(), a !== "AA" && a !== "AAA" && (a = "AA"), t !== "small" && t !== "large" && (t = "small"), { level: a, size: t }; 915} 916const Na = { class: "grid cursor-default grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4" }, ja = { class: "truncate text-center" }, Ua = { class: "group flex px-6 py-2" }, Oa = { class: "truncate text-xs text-gray-500 group-hover:text-gray-900" }, za = { class: "space-y-4" }, Xa = { for: "name", class: "mb-1 block text-sm font-medium text-gray-900" }, Da = { for: "value", class: "mb-1 block text-sm font-medium text-gray-900" }, qa = { class: "flex space-x-2" }, Ga = { class: "flex w-full items-center space-x-2 border p-1 px-1.5" }, Cr = { __name: "ColorPickerField", props: Y({ field: { type: Object, required: true }, hasErrors: { type: Boolean, default: false }, editable: { type: Boolean, default: true } }, { modelValue: { type: Object }, modelModifiers: {} }), emits: ["update:modelValue"], setup(e) { 917 const a = ne(e, "modelValue"), { t } = Oe(), r = ut({ name: "", value: "#000000", type: "hex" }), i = $({}), n = $(false), o = () => { 918 r.name ? i.value.name = "" : i.value.name = t("Name is required"), r.value ? i.value.value = "" : i.value.value = t("Value is required"); 919 var s = d(r.value); 920 s.isValid() ? i.value.value = "" : i.value.value = t("Invalid color value"), !(i.value.name || i.value.value) && (a.value.push({ name: r.name, value: r.value, type: r.type }), r.name = "", r.value = "#000000", r.type = "hex", n.value = false); 921 }; 922 return (s, l) => (M(), F("div", Na, [e.editable ? (M(), F("div", { key: 0, class: "flex h-[68px] cursor-pointer items-center justify-center rounded-md border-2 border-dashed border-primary-600 bg-primary-50", onClick: l[0] || (l[0] = (c) => n.value = true) }, [u("div", ja, [u("div", Ua, [b(x(Xe), { class: "mr-2 h-4 w-4 shrink-0 text-gray-400 group-hover:text-gray-500" }), u("span", Oa, C(e.field.form_field ? e.field.form_field.placeholder : e.field.placeholder), 1)])])])) : O("", true), (M(true), F(ue, null, _e(a.value, (c, m) => (M(), W(pa, { key: m, modelValue: a.value[m], "onUpdate:modelValue": (y) => a.value[m] = y, editable: e.editable, onDelete: (y) => a.value.splice(m, 1) }, null, 8, ["modelValue", "onUpdate:modelValue", "editable", "onDelete"]))), 128)), b(re, { open: n.value, color: "blue", size: "3xl", "confirm-text": s.$t("Save"), onCancel: l[5] || (l[5] = (c) => n.value = false), onClosed: l[6] || (l[6] = (c) => n.value = false), onConfirmed: o }, { title: H(() => [U(C(s.$t("Add color")), 1)]), content: H(() => [u("div", za, [u("div", null, [u("label", Xa, C(s.$t("Name")), 1), b(ae, { modelValue: r.n
922ame, "onUpdate:modelValue": l[1] || (l[1] = (c) => r.name = c), placeholder: s.$t("Give your color a name") }, null, 8, ["modelValue", "placeholder"]), b(se, { message: i.value.name }, null, 8, ["message"])]), u("div", null, [u("label", Da, C(s.$t("Value")), 1), u("div", qa, [u("div", Ga, [b(x(ve), { modelValue: r.value, "onUpdate:modelValue": l[2] || (l[2] = (c) => r.value = c), format: r.type, "disable-alpha": "", "disable-text-inputs": "", class: "shrink-0 border border-gray-200" }, null, 8, ["modelValue", "format"]), b(ae, { modelValue: r.value, "onUpdate:modelValue": l[3] || (l[3] = (c) => r.value = c), "input-class": "p-0 uppercase border-none shadow-none bg-transparent focus:outline-none focus:ring-0 focus:border-0 w-full" }, null, 8, ["modelValue"])]), xe(u("select", { id: "type", "onUpdate:modelValue": l[4] || (l[4] = (c) => r.type = c), name: "type", class: "border-gray-200" }, [...l[7] || (l[7] = [u("option", { value: "hex" }, "HEX", -1), u("option", { value: "rgb" }, "RGB", -1), u("option", { value: "hsv" }, "HSV", -1), u("option", { value: "hsl" }, "HSL", -1)])], 512), [[ze, r.type]])]), b(se, { message: i.value.value }, null, 8, ["message"])])])]), _: 1 }, 8, ["open", "confirm-text"])])); 923} }, Wa = { class: "relative flex h-40 flex-col items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-3" }, Ya = { class: "sr-only" }, Ka = { class: "py-1" }, Ja = ["src", "alt"], Qa = { key: 1, class: "flex h-30 w-full items-center justify-center rounded-md object-cover text-[8px] group-hover:opacity-75" }, Za = { class: "w-full overflow-hidden overflow-ellipsis whitespace-nowrap pt-5 text-center text-sm font-light leading-5 text-blue-900" }, er = { class: "space-y-1" }, tr = { for: "filename", class: "text-sm" }, ar = { class: "text-sm text-gray-500" }, rr = { __name: "FileGroupFieldItem", props: Y({ file: { type: Object, required: true }, editable: { type: Boolean, default: true } }, { modelValue: { type: Object }, modelModifiers: {} }), emits: Y(["delete"], ["update:modelValue"]), setup(e, { emit: a }) { 924 const t = e, r = ne(e, "modelValue"), i = a, n = $(null), o = $(false), s = $(false), l = $(""), c = G(() => ["jpg", "jpeg", "png", "gif", "bmp", "svg"].includes(r.value.text.split(".").pop().toLowerCase())), m = G(() => t.file instanceof File), y = () => { 925 if (!(t.file instanceof File) && c.value) { 926 n.value = r.value.file; 927 return; 928 } 929 xt(t.file, (p, A) => { 930 p || (n.value = A); 931 }); 932 }, z = () => { 933 i("delete"), s.value = false; 934 }; 935 Ne(() => y()); 936 const P = G({ get() { 937 const p = r.value.text.split("."); 938 return p.pop(), p.join("."); 939 }, set(p) { 940 const A = r.value.text.split(".").pop(); 941 r.value.text = `${p}.${A}`; 942 } }); 943 J(o, (p) => { 944 p && (l.value = P.value); 945 }); 946 const k = () => { 947 P.value = l.value, o.value = false; 948 }, v = () => { 949 window.location.replace(route("storage-items.download", { complete_url: r.value.file })); 950 }; 951 return J(() => t.file, () => y()), (p, A) => (M(), F("div", Wa, [b(x(We), { as: "div", class: "absolute right-2.5 top-2.5" }, { default: H(() => [u("div", null, [b(x(De), { class: "relative cursor-pointer p-1 text-gray-500 hover:text-gray-600 max-lg:after:absolute max-lg:after:-inset-1.5 max-lg:after:content-[''] [@media(hover:none)]:after:absolute [@media(hover:none)]:after:-inset-1.5 [@media(hover:none)]:after:content-['']" }, { default: H(() => [u("span", Ya, C(p.$t("Open options")), 1), b(x(qe), { class: "h-6 w-6 flex-shrink-0" })]), _: 1 })]), b(je, { "enter-active-class": "transition ease-out duration-100", "enter-from-class": "transform opacity-0 scale-95", "enter-to-class": "transform opacity-100 scale-100", "leave-active-class": "transition ease-in duration-75", "leave-from-class": "transform opacity-100 scale-100", "leave-to-class": "transform opacity-0 scale-95" }, { default: H(() => [b(x(Ge), { class: "absolute right-0 z-20 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none max-sm:w-40" }, { default: H(() => [u("div", Ka, [m.value ? O("", true) : (M(), W(x(Q), { key: 0, class: "group flex items-center" }, { default: H(() => [u("span", { class: "block cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 max-lg:py-3", onClick: v }, [b(x(mt), { class: "mr-4 h-5 w-5 text-gray-400 group-hover:text-gray-500" }), U(" " + C(p.$t("Download")), 1)])]), _: 1 })), e.editable ? (M(), W(x(Q), { key: 1, class: "group flex items-center" }, { default: H(() => [u("span", { class: "block cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 max-lg:py-3", onClick: A[0] || (A[0] = (X) => o.value = true) }, [b(x(Ye), { class: "mr-4 h-5 w-5 text-gray-400 group-hover:text-gray-500" }), U(" " + C(p.$t("Rename")), 1)])]), _: 1 })) : O("", true), e.editable ? (M(), W(x(Q), { key: 2, class: "group flex items-center" }, { default: H(() => [u("span", { class: "block cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 max-lg:py-3", onClick: A[1] || (A[1] = (X) => s.value = true) }, [b(x(Ke), { class: "mr-4 h-5 w-5 text-gray-400 group-hover:text-gray-500" }), U(" " + C(p.$t("Delete")), 1)])]), _: 1 })) : O("", true)])]), _: 1 })]), _: 1 })]), _: 1 }), n.value ? (M(), F("img", { key: 0, src: n.value, alt: e.file.name, class: "h-full max-h-16 w-auto min-w-16 rounded-none border-0 object-contain object-center text-base" }, null, 8, Ja)) : (M(), F("div", Qa, [b(vt, { class: "h-full max-h-16 w-auto min-w-16", file: e.file }
951, null, 8, ["file"])])), u("div", Za, C(r.value.text), 1), b(re, { open: o.value, color: "blue", size: "3xl", "confirm-text": "Save", onCancel: A[3] || (A[3] = (X) => o.value = false), onClosed: A[4] || (A[4] = (X) => o.value = false), onConfirmed: k }, { title: H(() => [U(C(p.$t("Rename file")), 1)]), content: H(() => [u("div", er, [u("label", tr, C(p.$t("Name")), 1), b(ae, { id: "filename", modelValue: l.value, "onUpdate:modelValue": A[2] || (A[2] = (X) => l.value = X), onKeydown: Ue(k, ["enter"]) }, null, 8, ["modelValue"])])]), _: 1 }, 8, ["open"]), b(re, { open: s.value, color: "red", title: p.$t("Confirm delete"), content: p.$t("Are you sure you want to delete this file?"), onCancel: A[5] || (A[5] = (X) => s.value = false), onClosed: A[6] || (A[6] = (X) => s.value = false), onConfirmed: z }, { content: H(() => [u("p", ar, C(p.$t("This action cannot be undone")), 1)]), _: 1 }, 8, ["open", "title", "content"])])); 952} }, nr = { class: "grid cursor-default grid-cols-2 gap-4 max-sm:gap-3 lg:grid-cols-3 xl:grid-cols-4" }, ir = ["for"], sr = { class: "flex h-40 cursor-pointer items-center justify-center rounded-md border-2 border-dashed border-primary-600 bg-primary-50" }, or = { class: "truncate text-center" }, lr = { key: 0 }, ur = { class: "text-xs" }, hr = { key: 1, class: "group flex truncate px-6 py-2" }, dr = { class: "truncate text-xs text-gray-500 group-hover:text-gray-900" }, cr = ["id", "name", "disabled"], Rr = { __name: "FileGroupField", props: Y({ field: { type: Object, required: true }, hasErrors: { type: Boolean, default: false }, editable: { type: Boolean, default: true } }, { modelValue: { type: Object }, modelModifiers: {} }), emits: ["update:modelValue"], setup(e) { 953 const a = ne(e, "modelValue"), { addUpload: t, removeUpload: r } = bt(), i = $(false), n = $([]), o = $(_.cloneDeep(a.value)), s = $(null), l = G(() => Math.random().toString(36).substring(2, 15)), c = (P) => s3m(P, { data: { folder: `tenants/${_t.value.id}/brands/files` } }).then(({ extension: k, key: v, name: p, uuid: A }) => ({ file: { extension: k, key: v, name: p, uuid: A }, text: P.name })), m = (P) => c(P), y = async (P) => { 954 i.value = true, n.value = P.target.files || P.dataTransfer.files, s.value = yt(), t(s.value); 955 const k = _.map(n.value, m); 956 try { 957 const v = await Promise.all(k); 958 a.value.push(...v), o.value.push(...n.value); 959 } catch (v) { 960 console.error(v); 961 } finally { 962 i.value = false, s.value && (r(s.value), s.value = null); 963 } 964 }, z = (P) => { 965 o.value.splice(P, 1), a.value.splice(P, 1); 966 }; 967 return ht(() => { 968 s.value && r(s.value); 969 }), (P, k) => (M(), F("div", nr, [e.editable ? (M(), F("label", { key: 0, for: l.value }, [u("div", sr, [u("div", or, [i.value ? (M(), F("div", lr, [b(ft, { class: "mx-auto mt-2 h-8 w-8 animate-spin text-primary-400" }), u("span", ur, C(P.$t("Uploading {files} files", { files: n.value.length })), 1)])) : (M(), F("div", hr, [b(x(Xe), { class: "mr-2 h-4 w-4 shrink-0 text-gray-400 group-hover:text-gray-500" }), u("span", dr, C(e.field.form_field ? e.field.form_field.placeholder : e.field.placeholder), 1)]))])]), u("input", { id: l.value, type: "file", name: l.value, class: "sr-only", multiple: "", disabled: i.value, onChange: ye(y, ["stop"]) }, null, 40, cr)], 8, ir)) : O("", true), (M(true), F(ue, null, _e(o.value, (v, p) => (M(), W(rr, { key: p, modelValue: a.value[p], "onUpdate:modelValue": (A) => a.value[p] = A, file: v, editable: e.editable, onDelete: (A) => z(p) }, null, 8, ["modelValue", "onUpdate:modelValue", "file", "editable", "onDelete"]))), 128))])); 970} }; 971export { 972 Cr as _, 973 Rr as a 974};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.